From cbaf5587d62459df3ddd0a4312cb549649c30a4a Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 7 Jun 2010 07:13:35 -0600 Subject: * shared lib builds again under Linux. --HG-- branch : trunk --- dep/include/utf8cpp/utf8/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dep/include/utf8cpp') diff --git a/dep/include/utf8cpp/utf8/core.h b/dep/include/utf8cpp/utf8/core.h index 389dd3e8ca5..3b6edf70b96 100644 --- a/dep/include/utf8cpp/utf8/core.h +++ b/dep/include/utf8cpp/utf8/core.h @@ -31,7 +31,7 @@ DEALINGS IN THE SOFTWARE. #include // use Trinity core types -#include "Platform/Define.h" +#include "Define.h" namespace utf8 { -- cgit v1.2.3 From e4e13c2bb8c691486ac717b206f166f33c8c531a Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 7 Jun 2010 19:35:24 +0200 Subject: removed 'dep' folder, no more needed --HG-- branch : trunk --- dep/CMakeLists.txt | 6 - dep/include/ace/ACE.h | 825 --- dep/include/ace/ACE.inl | 349 -- dep/include/ace/ACE_export.h | 77 - dep/include/ace/ARGV.h | 334 -- dep/include/ace/ARGV.inl | 104 - dep/include/ace/ATM_Acceptor.h | 122 - dep/include/ace/ATM_Acceptor.inl | 43 - dep/include/ace/ATM_Addr.h | 197 - dep/include/ace/ATM_Addr.inl | 37 - dep/include/ace/ATM_Connector.h | 165 - dep/include/ace/ATM_Connector.inl | 132 - dep/include/ace/ATM_Params.h | 214 - dep/include/ace/ATM_Params.inl | 235 - dep/include/ace/ATM_QoS.h | 115 - dep/include/ace/ATM_QoS.inl | 29 - dep/include/ace/ATM_Stream.h | 107 - dep/include/ace/ATM_Stream.inl | 133 - dep/include/ace/Acceptor.h | 687 --- dep/include/ace/Activation_Queue.h | 174 - dep/include/ace/Activation_Queue.inl | 31 - dep/include/ace/Active_Map_Manager.h | 116 - dep/include/ace/Active_Map_Manager.inl | 95 - dep/include/ace/Active_Map_Manager_T.h | 211 - dep/include/ace/Active_Map_Manager_T.inl | 311 -- dep/include/ace/Addr.h | 104 - dep/include/ace/Addr.inl | 61 - dep/include/ace/Arg_Shifter.h | 222 - dep/include/ace/Argv_Type_Converter.h | 120 - dep/include/ace/Argv_Type_Converter.inl | 44 - dep/include/ace/Array.h | 30 - dep/include/ace/Array_Base.h | 257 - dep/include/ace/Array_Base.inl | 146 - dep/include/ace/Array_Map.h | 300 -- dep/include/ace/Array_Map.inl | 133 - dep/include/ace/Assert.h | 39 - dep/include/ace/Asynch_Acceptor.h | 282 -- dep/include/ace/Asynch_Connector.h | 170 - dep/include/ace/Asynch_IO.h | 1731 ------- dep/include/ace/Asynch_IO_Impl.h | 814 --- dep/include/ace/Asynch_IO_Impl.inl | 105 - dep/include/ace/Asynch_Pseudo_Task.h | 74 - dep/include/ace/Atomic_Op.h | 261 - dep/include/ace/Atomic_Op.inl | 334 -- dep/include/ace/Atomic_Op_Sparc.h | 15 - dep/include/ace/Atomic_Op_T.h | 370 -- dep/include/ace/Atomic_Op_T.inl | 339 -- dep/include/ace/Auto_Event.h | 74 - dep/include/ace/Auto_Event.inl | 12 - dep/include/ace/Auto_Functor.h | 128 - dep/include/ace/Auto_Functor.inl | 134 - dep/include/ace/Auto_IncDec_T.h | 91 - dep/include/ace/Auto_IncDec_T.inl | 25 - dep/include/ace/Auto_Ptr.h | 241 - dep/include/ace/Auto_Ptr.inl | 171 - dep/include/ace/Barrier.h | 216 - dep/include/ace/Barrier.inl | 22 - dep/include/ace/Base_Thread_Adapter.h | 193 - dep/include/ace/Base_Thread_Adapter.inl | 48 - dep/include/ace/Based_Pointer_Repository.h | 91 - dep/include/ace/Based_Pointer_T.h | 206 - dep/include/ace/Based_Pointer_T.inl | 139 - dep/include/ace/Basic_Stats.h | 87 - dep/include/ace/Basic_Stats.inl | 53 - dep/include/ace/Basic_Types.h | 888 ---- dep/include/ace/Basic_Types.inl | 952 ---- dep/include/ace/Bound_Ptr.h | 389 -- dep/include/ace/Bound_Ptr.inl | 492 -- dep/include/ace/CDR_Base.h | 378 -- dep/include/ace/CDR_Base.inl | 255 - dep/include/ace/CDR_Size.h | 237 - dep/include/ace/CDR_Size.inl | 419 -- dep/include/ace/CDR_Stream.h | 1398 ----- dep/include/ace/CDR_Stream.inl | 1720 ------- dep/include/ace/CE_Screen_Output.h | 110 - dep/include/ace/CORBA_macros.h | 575 --- dep/include/ace/Cache_Map_Manager_T.h | 406 -- dep/include/ace/Cache_Map_Manager_T.inl | 244 - dep/include/ace/Cached_Connect_Strategy_T.h | 263 - dep/include/ace/Caching_Strategies_T.h | 552 -- dep/include/ace/Caching_Strategies_T.inl | 456 -- dep/include/ace/Caching_Utility_T.h | 348 -- dep/include/ace/Capabilities.h | 220 - dep/include/ace/Capabilities.inl | 52 - dep/include/ace/Cleanup.h | 138 - dep/include/ace/Cleanup.inl | 12 - dep/include/ace/Cleanup_Strategies_T.h | 149 - dep/include/ace/Codecs.h | 121 - dep/include/ace/Codeset_IBM1047.h | 127 - dep/include/ace/Codeset_Registry.h | 105 - dep/include/ace/Codeset_Registry.inl | 102 - dep/include/ace/Codeset_Symbols.h | 221 - dep/include/ace/Condition_Recursive_Thread_Mutex.h | 119 - dep/include/ace/Condition_T.h | 168 - dep/include/ace/Condition_T.inl | 51 - dep/include/ace/Condition_Thread_Mutex.h | 191 - dep/include/ace/Condition_Thread_Mutex.inl | 74 - dep/include/ace/Configuration.h | 893 ---- dep/include/ace/Configuration.inl | 13 - dep/include/ace/Configuration_Import_Export.h | 216 - dep/include/ace/Connection_Recycling_Strategy.h | 64 - dep/include/ace/Connector.h | 564 --- dep/include/ace/Containers.h | 72 - dep/include/ace/Containers.inl | 25 - dep/include/ace/Containers_T.h | 2065 -------- dep/include/ace/Containers_T.inl | 473 -- dep/include/ace/Copy_Disabled.h | 66 - dep/include/ace/Countdown_Time.h | 81 - dep/include/ace/DEV.h | 78 - dep/include/ace/DEV.inl | 18 - dep/include/ace/DEV_Addr.h | 91 - dep/include/ace/DEV_Addr.inl | 51 - dep/include/ace/DEV_Connector.h | 110 - dep/include/ace/DEV_Connector.inl | 34 - dep/include/ace/DEV_IO.h | 186 - dep/include/ace/DEV_IO.inl | 126 - dep/include/ace/DLL.h | 195 - dep/include/ace/DLL_Manager.h | 269 - dep/include/ace/Date_Time.h | 126 - dep/include/ace/Date_Time.inl | 219 - dep/include/ace/Default_Constants.h | 574 --- dep/include/ace/Dev_Poll_Reactor.h | 1250 ----- dep/include/ace/Dev_Poll_Reactor.inl | 227 - dep/include/ace/Dirent.h | 123 - dep/include/ace/Dirent.inl | 99 - dep/include/ace/Dirent_Selector.h | 76 - dep/include/ace/Dirent_Selector.inl | 19 - dep/include/ace/Dump.h | 172 - dep/include/ace/Dump_T.h | 82 - dep/include/ace/Dynamic.h | 76 - dep/include/ace/Dynamic.inl | 34 - dep/include/ace/Dynamic_Message_Strategy.h | 218 - dep/include/ace/Dynamic_Message_Strategy.inl | 75 - dep/include/ace/Dynamic_Service.h | 90 - dep/include/ace/Dynamic_Service.inl | 39 - dep/include/ace/Dynamic_Service_Base.h | 75 - dep/include/ace/Dynamic_Service_Dependency.h | 69 - dep/include/ace/Encoding_Converter.h | 71 - dep/include/ace/Encoding_Converter_Factory.h | 55 - dep/include/ace/Env_Value_T.h | 167 - dep/include/ace/Env_Value_T.inl | 60 - dep/include/ace/Event.h | 144 - dep/include/ace/Event.inl | 18 - dep/include/ace/Event_Handler.h | 389 -- dep/include/ace/Event_Handler.inl | 12 - dep/include/ace/Event_Handler_T.h | 192 - dep/include/ace/Event_Handler_T.inl | 135 - dep/include/ace/Exception_Macros.h | 56 - dep/include/ace/FIFO.h | 85 - dep/include/ace/FIFO.inl | 25 - dep/include/ace/FIFO_Recv.h | 85 - dep/include/ace/FIFO_Recv.inl | 24 - dep/include/ace/FIFO_Recv_Msg.h | 138 - dep/include/ace/FIFO_Recv_Msg.inl | 137 - dep/include/ace/FIFO_Send.h | 75 - dep/include/ace/FIFO_Send.inl | 24 - dep/include/ace/FIFO_Send_Msg.h | 91 - dep/include/ace/FIFO_Send_Msg.inl | 53 - dep/include/ace/FILE.h | 140 - dep/include/ace/FILE.inl | 18 - dep/include/ace/FILE_Addr.h | 90 - dep/include/ace/FILE_Addr.inl | 33 - dep/include/ace/FILE_Connector.h | 114 - dep/include/ace/FILE_Connector.inl | 36 - dep/include/ace/FILE_IO.h | 171 - dep/include/ace/FILE_IO.inl | 152 - dep/include/ace/File_Lock.h | 171 - dep/include/ace/File_Lock.inl | 96 - dep/include/ace/Filecache.h | 353 -- dep/include/ace/Flag_Manip.h | 59 - dep/include/ace/Flag_Manip.inl | 26 - dep/include/ace/Framework_Component.h | 211 - dep/include/ace/Framework_Component.inl | 39 - dep/include/ace/Framework_Component_T.h | 72 - dep/include/ace/Free_List.h | 151 - dep/include/ace/Functor.h | 593 --- dep/include/ace/Functor.inl | 282 -- dep/include/ace/Functor_String.h | 138 - dep/include/ace/Functor_String.inl | 53 - dep/include/ace/Functor_T.h | 157 - dep/include/ace/Functor_T.inl | 42 - dep/include/ace/Future.h | 388 -- dep/include/ace/Future_Set.h | 147 - dep/include/ace/Get_Opt.h | 495 -- dep/include/ace/Get_Opt.inl | 97 - dep/include/ace/Global_Macros.h | 1119 ---- dep/include/ace/Guard_T.h | 366 -- dep/include/ace/Guard_T.inl | 170 - dep/include/ace/Handle_Gobbler.h | 68 - dep/include/ace/Handle_Gobbler.inl | 78 - dep/include/ace/Handle_Ops.h | 51 - dep/include/ace/Handle_Set.h | 241 - dep/include/ace/Handle_Set.inl | 193 - dep/include/ace/Hash_Cache_Map_Manager_T.h | 213 - dep/include/ace/Hash_Cache_Map_Manager_T.inl | 73 - dep/include/ace/Hash_Map_Manager.h | 32 - dep/include/ace/Hash_Map_Manager_T.h | 1304 ----- dep/include/ace/Hash_Map_Manager_T.inl | 1253 ----- dep/include/ace/Hash_Map_With_Allocator_T.h | 112 - dep/include/ace/Hash_Map_With_Allocator_T.inl | 82 - dep/include/ace/Hash_Multi_Map_Manager_T.h | 968 ---- dep/include/ace/Hash_Multi_Map_Manager_T.inl | 994 ---- dep/include/ace/Hashable.h | 66 - dep/include/ace/Hashable.inl | 13 - dep/include/ace/High_Res_Timer.h | 316 -- dep/include/ace/High_Res_Timer.inl | 150 - dep/include/ace/ICMP_Socket.h | 111 - dep/include/ace/INET_Addr.h | 391 -- dep/include/ace/INET_Addr.inl | 256 - dep/include/ace/IOStream.h | 512 -- dep/include/ace/IOStream_T.h | 298 -- dep/include/ace/IOStream_T.inl | 123 - dep/include/ace/IO_Cntl_Msg.h | 112 - dep/include/ace/IO_Cntl_Msg.inl | 61 - dep/include/ace/IO_SAP.h | 95 - dep/include/ace/IO_SAP.inl | 42 - dep/include/ace/IPC_SAP.h | 97 - dep/include/ace/IPC_SAP.inl | 40 - dep/include/ace/If_Then_Else.h | 90 - dep/include/ace/Init_ACE.h | 62 - dep/include/ace/Intrusive_Auto_Ptr.h | 165 - dep/include/ace/Intrusive_Auto_Ptr.inl | 146 - dep/include/ace/Intrusive_List.h | 145 - dep/include/ace/Intrusive_List.inl | 40 - dep/include/ace/Intrusive_List_Node.h | 86 - dep/include/ace/Intrusive_List_Node.inl | 31 - dep/include/ace/LOCK_SOCK_Acceptor.h | 67 - dep/include/ace/LSOCK.h | 84 - dep/include/ace/LSOCK.inl | 43 - dep/include/ace/LSOCK_Acceptor.h | 95 - dep/include/ace/LSOCK_CODgram.h | 78 - dep/include/ace/LSOCK_CODgram.inl | 30 - dep/include/ace/LSOCK_Connector.h | 92 - dep/include/ace/LSOCK_Connector.inl | 27 - dep/include/ace/LSOCK_Dgram.h | 74 - dep/include/ace/LSOCK_Dgram.inl | 22 - dep/include/ace/LSOCK_Stream.h | 82 - dep/include/ace/LSOCK_Stream.inl | 25 - dep/include/ace/Lib_Find.h | 131 - dep/include/ace/Local_Memory_Pool.h | 134 - dep/include/ace/Local_Name_Space.h | 133 - dep/include/ace/Local_Name_Space_T.h | 280 - dep/include/ace/Local_Tokens.h | 1122 ---- dep/include/ace/Local_Tokens.inl | 288 -- dep/include/ace/Lock.h | 162 - dep/include/ace/Lock.inl | 12 - dep/include/ace/Lock_Adapter_T.h | 124 - dep/include/ace/Lock_Adapter_T.inl | 16 - dep/include/ace/Log_Msg.h | 747 --- dep/include/ace/Log_Msg.inl | 233 - dep/include/ace/Log_Msg_Backend.h | 88 - dep/include/ace/Log_Msg_Callback.h | 70 - dep/include/ace/Log_Msg_IPC.h | 80 - dep/include/ace/Log_Msg_NT_Event_Log.h | 73 - dep/include/ace/Log_Msg_UNIX_Syslog.h | 77 - dep/include/ace/Log_Priority.h | 86 - dep/include/ace/Log_Record.h | 223 - dep/include/ace/Log_Record.inl | 123 - dep/include/ace/Logging_Strategy.h | 196 - dep/include/ace/MEM_Acceptor.h | 193 - dep/include/ace/MEM_Acceptor.inl | 103 - dep/include/ace/MEM_Addr.h | 155 - dep/include/ace/MEM_Addr.inl | 110 - dep/include/ace/MEM_Connector.h | 180 - dep/include/ace/MEM_Connector.inl | 30 - dep/include/ace/MEM_IO.h | 308 -- dep/include/ace/MEM_IO.inl | 247 - dep/include/ace/MEM_SAP.h | 170 - dep/include/ace/MEM_SAP.inl | 63 - dep/include/ace/MEM_Stream.h | 158 - dep/include/ace/MEM_Stream.inl | 179 - dep/include/ace/MMAP_Memory_Pool.h | 348 -- dep/include/ace/MMAP_Memory_Pool.inl | 21 - dep/include/ace/Malloc.h | 394 -- dep/include/ace/Malloc.inl | 26 - dep/include/ace/Malloc_Allocator.h | 147 - dep/include/ace/Malloc_Allocator.inl | 16 - dep/include/ace/Malloc_Base.h | 168 - dep/include/ace/Malloc_T.h | 932 ---- dep/include/ace/Malloc_T.inl | 183 - dep/include/ace/Managed_Object.h | 169 - dep/include/ace/Managed_Object.inl | 23 - dep/include/ace/Manual_Event.h | 74 - dep/include/ace/Manual_Event.inl | 12 - dep/include/ace/Map.h | 32 - dep/include/ace/Map_Manager.h | 720 --- dep/include/ace/Map_Manager.inl | 729 --- dep/include/ace/Map_T.h | 1612 ------ dep/include/ace/Map_T.inl | 415 -- dep/include/ace/Mem_Map.h | 236 - dep/include/ace/Mem_Map.inl | 237 - dep/include/ace/Memory_Pool.h | 32 - dep/include/ace/Message_Block.h | 871 ---- dep/include/ace/Message_Block.inl | 507 -- dep/include/ace/Message_Block_T.h | 89 - dep/include/ace/Message_Block_T.inl | 31 - dep/include/ace/Message_Queue.h | 238 - dep/include/ace/Message_Queue.inl | 12 - dep/include/ace/Message_Queue_NT.h | 232 - dep/include/ace/Message_Queue_NT.inl | 131 - dep/include/ace/Message_Queue_T.h | 1560 ------ dep/include/ace/Message_Queue_Vx.h | 228 - dep/include/ace/Message_Queue_Vx.inl | 19 - dep/include/ace/Method_Object.h | 38 - dep/include/ace/Method_Request.h | 99 - dep/include/ace/Metrics_Cache.h | 139 - dep/include/ace/Metrics_Cache_T.h | 243 - dep/include/ace/Metrics_Cache_T.inl | 230 - dep/include/ace/Min_Max.h | 71 - dep/include/ace/Module.h | 216 - dep/include/ace/Module.inl | 65 - dep/include/ace/Monitor_Admin.h | 110 - dep/include/ace/Monitor_Admin_Manager.h | 71 - dep/include/ace/Monitor_Base.h | 153 - dep/include/ace/Monitor_Base.inl | 59 - dep/include/ace/Monitor_Control_Action.h | 66 - dep/include/ace/Monitor_Control_Types.h | 125 - dep/include/ace/Monitor_Point_Registry.h | 101 - dep/include/ace/Monitor_Size.h | 65 - dep/include/ace/Msg_WFMO_Reactor.h | 120 - dep/include/ace/Msg_WFMO_Reactor.inl | 35 - dep/include/ace/Multihomed_INET_Addr.h | 199 - dep/include/ace/Multihomed_INET_Addr.inl | 15 - dep/include/ace/Mutex.h | 193 - dep/include/ace/Mutex.inl | 174 - dep/include/ace/NT_Service.h | 439 -- dep/include/ace/NT_Service.inl | 82 - dep/include/ace/Name_Proxy.h | 101 - dep/include/ace/Name_Request_Reply.h | 265 - dep/include/ace/Name_Space.h | 165 - dep/include/ace/Naming_Context.h | 388 -- dep/include/ace/Naming_Context.inl | 44 - dep/include/ace/Netlink_Addr.h | 119 - dep/include/ace/Netlink_Addr.inl | 50 - dep/include/ace/Node.h | 85 - dep/include/ace/Notification_Queue.h | 157 - dep/include/ace/Notification_Queue.inl | 50 - dep/include/ace/Notification_Strategy.h | 76 - dep/include/ace/Notification_Strategy.inl | 31 - dep/include/ace/Null_Barrier.h | 60 - dep/include/ace/Null_Condition.h | 86 - dep/include/ace/Null_Mutex.h | 232 - dep/include/ace/Null_Semaphore.h | 106 - dep/include/ace/Numeric_Limits.h | 270 - dep/include/ace/OS.h | 328 -- dep/include/ace/OS.inl | 92 - dep/include/ace/OS_Dirent.h | 33 - dep/include/ace/OS_Errno.h | 102 - dep/include/ace/OS_Errno.inl | 67 - dep/include/ace/OS_Log_Msg_Attributes.h | 91 - dep/include/ace/OS_Log_Msg_Attributes.inl | 12 - dep/include/ace/OS_Memory.h | 339 -- dep/include/ace/OS_NS_Thread.h | 2022 -------- dep/include/ace/OS_NS_Thread.inl | 3634 ------------- dep/include/ace/OS_NS_arpa_inet.h | 75 - dep/include/ace/OS_NS_arpa_inet.inl | 98 - dep/include/ace/OS_NS_ctype.h | 131 - dep/include/ace/OS_NS_ctype.inl | 163 - dep/include/ace/OS_NS_dirent.h | 154 - dep/include/ace/OS_NS_dirent.inl | 184 - dep/include/ace/OS_NS_dlfcn.h | 70 - dep/include/ace/OS_NS_dlfcn.inl | 286 -- dep/include/ace/OS_NS_errno.h | 101 - dep/include/ace/OS_NS_errno.inl | 83 - dep/include/ace/OS_NS_fcntl.h | 84 - dep/include/ace/OS_NS_fcntl.inl | 23 - dep/include/ace/OS_NS_macros.h | 113 - dep/include/ace/OS_NS_math.h | 113 - dep/include/ace/OS_NS_math.inl | 41 - dep/include/ace/OS_NS_netdb.h | 146 - dep/include/ace/OS_NS_netdb.inl | 750 --- dep/include/ace/OS_NS_poll.h | 67 - dep/include/ace/OS_NS_poll.inl | 45 - dep/include/ace/OS_NS_pwd.h | 81 - dep/include/ace/OS_NS_pwd.inl | 120 - dep/include/ace/OS_NS_regex.h | 66 - dep/include/ace/OS_NS_regex.inl | 39 - dep/include/ace/OS_NS_signal.h | 154 - dep/include/ace/OS_NS_signal.inl | 236 - dep/include/ace/OS_NS_stdio.h | 542 -- dep/include/ace/OS_NS_stdio.inl | 1211 ----- dep/include/ace/OS_NS_stdlib.h | 332 -- dep/include/ace/OS_NS_stdlib.inl | 556 -- dep/include/ace/OS_NS_string.h | 472 -- dep/include/ace/OS_NS_string.inl | 560 -- dep/include/ace/OS_NS_strings.h | 87 - dep/include/ace/OS_NS_strings.inl | 59 - dep/include/ace/OS_NS_stropts.h | 173 - dep/include/ace/OS_NS_stropts.inl | 201 - dep/include/ace/OS_NS_sys_mman.h | 98 - dep/include/ace/OS_NS_sys_mman.inl | 297 -- dep/include/ace/OS_NS_sys_msg.h | 78 - dep/include/ace/OS_NS_sys_msg.inl | 78 - dep/include/ace/OS_NS_sys_resource.h | 67 - dep/include/ace/OS_NS_sys_resource.inl | 98 - dep/include/ace/OS_NS_sys_select.h | 78 - dep/include/ace/OS_NS_sys_select.inl | 80 - dep/include/ace/OS_NS_sys_sendfile.h | 65 - dep/include/ace/OS_NS_sys_sendfile.inl | 24 - dep/include/ace/OS_NS_sys_shm.h | 75 - dep/include/ace/OS_NS_sys_shm.inl | 76 - dep/include/ace/OS_NS_sys_socket.h | 302 -- dep/include/ace/OS_NS_sys_socket.inl | 1002 ---- dep/include/ace/OS_NS_sys_stat.h | 150 - dep/include/ace/OS_NS_sys_stat.inl | 292 -- dep/include/ace/OS_NS_sys_time.h | 70 - dep/include/ace/OS_NS_sys_time.inl | 96 - dep/include/ace/OS_NS_sys_uio.h | 81 - dep/include/ace/OS_NS_sys_uio.inl | 55 - dep/include/ace/OS_NS_sys_utsname.h | 72 - dep/include/ace/OS_NS_sys_wait.h | 88 - dep/include/ace/OS_NS_sys_wait.inl | 105 - dep/include/ace/OS_NS_time.h | 287 -- dep/include/ace/OS_NS_time.inl | 505 -- dep/include/ace/OS_NS_unistd.h | 382 -- dep/include/ace/OS_NS_unistd.inl | 1192 ----- dep/include/ace/OS_NS_wchar.h | 200 - dep/include/ace/OS_NS_wchar.inl | 87 - dep/include/ace/OS_QoS.h | 449 -- dep/include/ace/OS_String.h | 33 - dep/include/ace/OS_TLI.h | 285 -- dep/include/ace/OS_TLI.inl | 390 -- dep/include/ace/OS_Thread_Adapter.h | 73 - dep/include/ace/OS_main.h | 306 -- dep/include/ace/Obchunk.h | 77 - dep/include/ace/Obchunk.inl | 12 - dep/include/ace/Object_Manager.h | 466 -- dep/include/ace/Object_Manager.inl | 40 - dep/include/ace/Object_Manager_Base.h | 248 - dep/include/ace/Obstack.h | 32 - dep/include/ace/Obstack_T.h | 135 - dep/include/ace/Obstack_T.inl | 19 - dep/include/ace/PI_Malloc.h | 214 - dep/include/ace/PI_Malloc.inl | 33 - dep/include/ace/POSIX_Asynch_IO.h | 1296 ----- dep/include/ace/POSIX_CB_Proactor.h | 97 - dep/include/ace/POSIX_Proactor.h | 656 --- dep/include/ace/POSIX_Proactor.inl | 13 - dep/include/ace/Pagefile_Memory_Pool.h | 202 - dep/include/ace/Pagefile_Memory_Pool.inl | 54 - dep/include/ace/Pair.h | 32 - dep/include/ace/Pair_T.h | 129 - dep/include/ace/Pair_T.inl | 90 - dep/include/ace/Parse_Node.h | 522 -- dep/include/ace/Ping_Socket.h | 119 - dep/include/ace/Ping_Socket.inl | 13 - dep/include/ace/Pipe.h | 166 - dep/include/ace/Pipe.inl | 188 - dep/include/ace/Priority_Reactor.h | 101 - dep/include/ace/Proactor.h | 690 --- dep/include/ace/Proactor.inl | 80 - dep/include/ace/Proactor_Impl.h | 265 - dep/include/ace/Process.h | 635 --- dep/include/ace/Process.inl | 412 -- dep/include/ace/Process_Manager.h | 478 -- dep/include/ace/Process_Manager.inl | 13 - dep/include/ace/Process_Mutex.h | 217 - dep/include/ace/Process_Mutex.inl | 118 - dep/include/ace/Process_Semaphore.h | 161 - dep/include/ace/Process_Semaphore.inl | 66 - dep/include/ace/Profile_Timer.h | 139 - dep/include/ace/Profile_Timer.inl | 129 - dep/include/ace/RB_Tree.h | 902 ---- dep/include/ace/RB_Tree.inl | 1103 ---- dep/include/ace/RW_Mutex.h | 142 - dep/include/ace/RW_Mutex.inl | 83 - dep/include/ace/RW_Process_Mutex.h | 145 - dep/include/ace/RW_Process_Mutex.inl | 77 - dep/include/ace/RW_Thread_Mutex.h | 75 - dep/include/ace/RW_Thread_Mutex.inl | 19 - dep/include/ace/Reactor.h | 880 ---- dep/include/ace/Reactor.inl | 498 -- dep/include/ace/Reactor_Impl.h | 569 --- dep/include/ace/Reactor_Notification_Strategy.h | 67 - dep/include/ace/Reactor_Notification_Strategy.inl | 19 - dep/include/ace/Reactor_Timer_Interface.h | 61 - dep/include/ace/Reactor_Token_T.h | 93 - dep/include/ace/Read_Buffer.h | 130 - dep/include/ace/Read_Buffer.inl | 32 - dep/include/ace/Recursive_Thread_Mutex.h | 195 - dep/include/ace/Recursive_Thread_Mutex.inl | 95 - dep/include/ace/Recyclable.h | 80 - dep/include/ace/Recyclable.inl | 20 - dep/include/ace/Refcountable.h | 33 - dep/include/ace/Refcountable_T.h | 68 - dep/include/ace/Refcountable_T.inl | 35 - dep/include/ace/Refcounted_Auto_Ptr.h | 200 - dep/include/ace/Refcounted_Auto_Ptr.inl | 190 - dep/include/ace/Registry.h | 558 -- dep/include/ace/Registry_Name_Space.h | 140 - dep/include/ace/Remote_Name_Space.h | 147 - dep/include/ace/Remote_Tokens.h | 322 -- dep/include/ace/Remote_Tokens.inl | 48 - dep/include/ace/Reverse_Lock_T.h | 140 - dep/include/ace/Reverse_Lock_T.inl | 19 - dep/include/ace/SOCK.h | 139 - dep/include/ace/SOCK.inl | 39 - dep/include/ace/SOCK_Acceptor.h | 179 - dep/include/ace/SOCK_Acceptor.inl | 13 - dep/include/ace/SOCK_CODgram.h | 143 - dep/include/ace/SOCK_CODgram.inl | 19 - dep/include/ace/SOCK_Connector.h | 322 -- dep/include/ace/SOCK_Connector.inl | 38 - dep/include/ace/SOCK_Dgram.h | 240 - dep/include/ace/SOCK_Dgram.inl | 167 - dep/include/ace/SOCK_Dgram_Bcast.h | 140 - dep/include/ace/SOCK_Dgram_Bcast.inl | 37 - dep/include/ace/SOCK_Dgram_Mcast.h | 384 -- dep/include/ace/SOCK_Dgram_Mcast.inl | 52 - dep/include/ace/SOCK_IO.h | 137 - dep/include/ace/SOCK_IO.inl | 123 - dep/include/ace/SOCK_Netlink.h | 107 - dep/include/ace/SOCK_Netlink.inl | 37 - dep/include/ace/SOCK_SEQPACK_Acceptor.h | 189 - dep/include/ace/SOCK_SEQPACK_Acceptor.inl | 13 - dep/include/ace/SOCK_SEQPACK_Association.h | 203 - dep/include/ace/SOCK_SEQPACK_Association.inl | 177 - dep/include/ace/SOCK_SEQPACK_Connector.h | 332 -- dep/include/ace/SOCK_SEQPACK_Connector.inl | 38 - dep/include/ace/SOCK_Stream.h | 185 - dep/include/ace/SOCK_Stream.inl | 177 - dep/include/ace/SPIPE.h | 116 - dep/include/ace/SPIPE.inl | 18 - dep/include/ace/SPIPE_Acceptor.h | 168 - dep/include/ace/SPIPE_Addr.h | 123 - dep/include/ace/SPIPE_Addr.inl | 58 - dep/include/ace/SPIPE_Connector.h | 119 - dep/include/ace/SPIPE_Connector.inl | 15 - dep/include/ace/SPIPE_Stream.h | 172 - dep/include/ace/SPIPE_Stream.inl | 275 - dep/include/ace/SSL/SSL_Asynch_BIO.h | 42 - dep/include/ace/SSL/SSL_Asynch_Stream.h | 425 -- dep/include/ace/SSL/SSL_Context.h | 384 -- dep/include/ace/SSL/SSL_Context.inl | 113 - dep/include/ace/SSL/SSL_Export.h | 45 - dep/include/ace/SSL/SSL_SOCK.h | 103 - dep/include/ace/SSL/SSL_SOCK.inl | 71 - dep/include/ace/SSL/SSL_SOCK_Acceptor.h | 197 - dep/include/ace/SSL/SSL_SOCK_Acceptor.inl | 85 - dep/include/ace/SSL/SSL_SOCK_Connector.h | 318 -- dep/include/ace/SSL/SSL_SOCK_Connector.inl | 28 - dep/include/ace/SSL/SSL_SOCK_Stream.h | 321 -- dep/include/ace/SSL/SSL_SOCK_Stream.inl | 330 -- dep/include/ace/SSL/sslconf.h | 55 - dep/include/ace/SString.h | 499 -- dep/include/ace/SString.inl | 299 -- dep/include/ace/SStringfwd.h | 56 - dep/include/ace/SUN_Proactor.h | 127 - dep/include/ace/SV_Message.h | 66 - dep/include/ace/SV_Message.inl | 37 - dep/include/ace/SV_Message_Queue.h | 106 - dep/include/ace/SV_Message_Queue.inl | 81 - dep/include/ace/SV_Semaphore_Complex.h | 160 - dep/include/ace/SV_Semaphore_Complex.inl | 84 - dep/include/ace/SV_Semaphore_Simple.h | 198 - dep/include/ace/SV_Semaphore_Simple.inl | 128 - dep/include/ace/SV_Shared_Memory.h | 122 - dep/include/ace/SV_Shared_Memory.inl | 118 - dep/include/ace/Sample_History.h | 91 - dep/include/ace/Sample_History.inl | 26 - dep/include/ace/Sbrk_Memory_Pool.h | 118 - dep/include/ace/Sched_Params.h | 233 - dep/include/ace/Sched_Params.inl | 133 - dep/include/ace/Select_Reactor.h | 70 - dep/include/ace/Select_Reactor_Base.h | 612 --- dep/include/ace/Select_Reactor_Base.inl | 152 - dep/include/ace/Select_Reactor_T.h | 719 --- dep/include/ace/Select_Reactor_T.inl | 236 - dep/include/ace/Semaphore.h | 184 - dep/include/ace/Semaphore.inl | 119 - dep/include/ace/Service_Config.h | 681 --- dep/include/ace/Service_Config.inl | 202 - dep/include/ace/Service_Gestalt.h | 506 -- dep/include/ace/Service_Gestalt.inl | 74 - dep/include/ace/Service_Manager.h | 121 - dep/include/ace/Service_Object.h | 208 - dep/include/ace/Service_Object.inl | 79 - dep/include/ace/Service_Repository.h | 280 - dep/include/ace/Service_Repository.inl | 51 - dep/include/ace/Service_Templates.h | 29 - dep/include/ace/Service_Types.h | 207 - dep/include/ace/Service_Types.inl | 32 - dep/include/ace/Shared_Memory.h | 58 - dep/include/ace/Shared_Memory_MM.h | 120 - dep/include/ace/Shared_Memory_MM.inl | 42 - dep/include/ace/Shared_Memory_Pool.h | 211 - dep/include/ace/Shared_Memory_SV.h | 101 - dep/include/ace/Shared_Memory_SV.inl | 30 - dep/include/ace/Shared_Object.h | 63 - dep/include/ace/Shared_Object.inl | 12 - dep/include/ace/Sig_Adapter.h | 82 - dep/include/ace/Sig_Handler.h | 238 - dep/include/ace/Sig_Handler.inl | 15 - dep/include/ace/Signal.h | 267 - dep/include/ace/Signal.inl | 265 - dep/include/ace/Singleton.h | 328 -- dep/include/ace/Singleton.inl | 42 - dep/include/ace/Sock_Connect.h | 108 - dep/include/ace/Stack_Trace.h | 108 - dep/include/ace/Static_Object_Lock.h | 79 - dep/include/ace/Stats.h | 222 - dep/include/ace/Stats.inl | 104 - dep/include/ace/Strategies.h | 33 - dep/include/ace/Strategies_T.h | 1076 ---- dep/include/ace/Strategies_T.inl | 230 - dep/include/ace/Stream.h | 242 - dep/include/ace/Stream.inl | 51 - dep/include/ace/Stream_Modules.h | 167 - dep/include/ace/String_Base.h | 613 --- dep/include/ace/String_Base.inl | 158 - dep/include/ace/String_Base_Const.h | 52 - dep/include/ace/Svc_Conf.h | 108 - dep/include/ace/Svc_Conf_Lexer.h | 71 - dep/include/ace/Svc_Conf_Param.h | 141 - dep/include/ace/Svc_Conf_Token_Table.h | 83 - dep/include/ace/Svc_Conf_Tokens.h | 29 - dep/include/ace/Svc_Handler.h | 346 -- dep/include/ace/Synch.h | 66 - dep/include/ace/Synch_Options.h | 164 - dep/include/ace/Synch_T.h | 43 - dep/include/ace/Synch_Traits.h | 153 - dep/include/ace/System_Time.h | 100 - dep/include/ace/TLI.h | 116 - dep/include/ace/TLI.inl | 49 - dep/include/ace/TLI_Acceptor.h | 123 - dep/include/ace/TLI_Connector.h | 130 - dep/include/ace/TLI_Connector.inl | 49 - dep/include/ace/TLI_Stream.h | 141 - dep/include/ace/TLI_Stream.inl | 25 - dep/include/ace/TP_Reactor.h | 319 -- dep/include/ace/TP_Reactor.inl | 118 - dep/include/ace/TSS_Adapter.h | 62 - dep/include/ace/TSS_T.h | 254 - dep/include/ace/TSS_T.inl | 42 - dep/include/ace/TTY_IO.h | 114 - dep/include/ace/Task.h | 308 -- dep/include/ace/Task.inl | 77 - dep/include/ace/Task_Ex_T.h | 206 - dep/include/ace/Task_Ex_T.inl | 109 - dep/include/ace/Task_T.h | 199 - dep/include/ace/Task_T.inl | 105 - dep/include/ace/Test_and_Set.h | 75 - dep/include/ace/Thread.h | 283 -- dep/include/ace/Thread.inl | 286 -- dep/include/ace/Thread_Adapter.h | 101 - dep/include/ace/Thread_Adapter.inl | 13 - dep/include/ace/Thread_Control.h | 102 - dep/include/ace/Thread_Control.inl | 46 - dep/include/ace/Thread_Exit.h | 111 - dep/include/ace/Thread_Hook.h | 65 - dep/include/ace/Thread_Manager.h | 1265 ----- dep/include/ace/Thread_Manager.inl | 307 -- dep/include/ace/Thread_Mutex.h | 176 - dep/include/ace/Thread_Mutex.inl | 97 - dep/include/ace/Thread_Semaphore.h | 90 - dep/include/ace/Thread_Semaphore.inl | 12 - dep/include/ace/Throughput_Stats.h | 86 - dep/include/ace/Time_Value.h | 381 -- dep/include/ace/Time_Value.inl | 422 -- dep/include/ace/Timeprobe.h | 202 - dep/include/ace/Timeprobe.inl | 14 - dep/include/ace/Timeprobe_T.h | 219 - dep/include/ace/Timer_Hash.h | 74 - dep/include/ace/Timer_Hash_T.h | 343 -- dep/include/ace/Timer_Heap.h | 42 - dep/include/ace/Timer_Heap_T.h | 339 -- dep/include/ace/Timer_List.h | 42 - dep/include/ace/Timer_List_T.h | 227 - dep/include/ace/Timer_Queue.h | 53 - dep/include/ace/Timer_Queue_Adapters.h | 262 - dep/include/ace/Timer_Queue_Adapters.inl | 29 - dep/include/ace/Timer_Queue_T.h | 563 --- dep/include/ace/Timer_Queue_T.inl | 222 - dep/include/ace/Timer_Queuefwd.h | 39 - dep/include/ace/Timer_Wheel.h | 42 - dep/include/ace/Timer_Wheel_T.h | 227 - dep/include/ace/Token.h | 376 -- dep/include/ace/Token.inl | 176 - dep/include/ace/Token_Collection.h | 242 - dep/include/ace/Token_Collection.inl | 17 - dep/include/ace/Token_Invariants.h | 246 - dep/include/ace/Token_Manager.h | 151 - dep/include/ace/Token_Manager.inl | 25 - dep/include/ace/Token_Request_Reply.h | 270 - dep/include/ace/Token_Request_Reply.inl | 205 - dep/include/ace/Trace.h | 97 - dep/include/ace/Truncate.h | 1054 ---- dep/include/ace/Typed_SV_Message.h | 107 - dep/include/ace/Typed_SV_Message.inl | 96 - dep/include/ace/Typed_SV_Message_Queue.h | 93 - dep/include/ace/Typed_SV_Message_Queue.inl | 80 - dep/include/ace/UNIX_Addr.h | 117 - dep/include/ace/UNIX_Addr.inl | 55 - dep/include/ace/UPIPE_Acceptor.h | 99 - dep/include/ace/UPIPE_Acceptor.inl | 14 - dep/include/ace/UPIPE_Addr.h | 33 - dep/include/ace/UPIPE_Connector.h | 115 - dep/include/ace/UPIPE_Connector.inl | 34 - dep/include/ace/UPIPE_Stream.h | 140 - dep/include/ace/UPIPE_Stream.inl | 14 - dep/include/ace/UTF16_Encoding_Converter.h | 87 - dep/include/ace/UTF16_Encoding_Converter.inl | 76 - dep/include/ace/UTF32_Encoding_Converter.h | 68 - dep/include/ace/UTF8_Encoding_Converter.h | 72 - dep/include/ace/UUID.h | 240 - dep/include/ace/UUID.inl | 200 - dep/include/ace/Unbounded_Queue.h | 298 -- dep/include/ace/Unbounded_Queue.inl | 27 - dep/include/ace/Unbounded_Set.h | 104 - dep/include/ace/Unbounded_Set.inl | 48 - dep/include/ace/Unbounded_Set_Ex.h | 348 -- dep/include/ace/Unbounded_Set_Ex.inl | 23 - dep/include/ace/Value_Ptr.h | 168 - dep/include/ace/Vector_T.h | 316 -- dep/include/ace/Vector_T.inl | 107 - dep/include/ace/Version.h | 10 - dep/include/ace/Versioned_Namespace.h | 51 - dep/include/ace/WFMO_Reactor.h | 1368 ----- dep/include/ace/WFMO_Reactor.inl | 1200 ----- dep/include/ace/WIN32_Asynch_IO.h | 1936 ------- dep/include/ace/WIN32_Proactor.h | 325 -- dep/include/ace/XML_Svc_Conf.h | 65 - dep/include/ace/XTI_ATM_Mcast.h | 137 - dep/include/ace/XTI_ATM_Mcast.inl | 65 - dep/include/ace/ace_wchar.h | 386 -- dep/include/ace/ace_wchar.inl | 183 - dep/include/ace/checked_iterator.h | 59 - dep/include/ace/config-WinCE.h | 237 - dep/include/ace/config-aix-5.x.h | 334 -- dep/include/ace/config-all.h | 90 - dep/include/ace/config-borland-common.h | 67 - dep/include/ace/config-cray.h | 214 - dep/include/ace/config-cxx-common.h | 87 - dep/include/ace/config-cygwin32.h | 207 - dep/include/ace/config-doxygen.h | 121 - dep/include/ace/config-freebsd.h | 284 -- dep/include/ace/config-g++-common.h | 137 - dep/include/ace/config-ghs-common.h | 44 - dep/include/ace/config-hpux-11.00.h | 449 -- dep/include/ace/config-icc-common.h | 114 - dep/include/ace/config-integritySCA.h | 231 - dep/include/ace/config-irix6.5.x-sgic++.h | 19 - dep/include/ace/config-irix6.x-common.h | 257 - dep/include/ace/config-irix6.x-g++.h | 24 - dep/include/ace/config-irix6.x-sgic++.h | 37 - dep/include/ace/config-linux-common.h | 449 -- dep/include/ace/config-linux.h | 76 - dep/include/ace/config-lite.h | 164 - dep/include/ace/config-lynxos.h | 163 - dep/include/ace/config-macosx-leopard.h | 227 - dep/include/ace/config-macosx-panther.h | 192 - dep/include/ace/config-macosx-tiger.h | 219 - dep/include/ace/config-macosx.h | 192 - dep/include/ace/config-macros.h | 637 --- dep/include/ace/config-minimal.h | 40 - dep/include/ace/config-mvs.h | 132 - dep/include/ace/config-netbsd.h | 168 - dep/include/ace/config-openbsd.h | 235 - dep/include/ace/config-openvms.h | 196 - dep/include/ace/config-pharlap.h | 91 - dep/include/ace/config-posix-nonetworking.h | 87 - dep/include/ace/config-posix.h | 74 - dep/include/ace/config-qnx-neutrino.h | 138 - dep/include/ace/config-qnx-rtp-62x.h | 130 - dep/include/ace/config-qnx-rtp-common.h | 47 - dep/include/ace/config-qnx-rtp-pre62x.h | 152 - dep/include/ace/config-qnx-rtp.h | 26 - dep/include/ace/config-rtems.h | 166 - dep/include/ace/config-sco-5.0.0-nothread.h | 15 - dep/include/ace/config-sco-5.0.0.h | 98 - dep/include/ace/config-suncc-common.h | 68 - dep/include/ace/config-sunos5.10.h | 52 - dep/include/ace/config-sunos5.11.h | 16 - dep/include/ace/config-sunos5.4-g++.h | 182 - dep/include/ace/config-sunos5.4-sunc++-4.x.h | 191 - dep/include/ace/config-sunos5.5.h | 417 -- dep/include/ace/config-sunos5.6.h | 126 - dep/include/ace/config-sunos5.7.h | 79 - dep/include/ace/config-sunos5.8.h | 40 - dep/include/ace/config-sunos5.9.h | 19 - dep/include/ace/config-tandem-nsk-mips-v2.h | 396 -- dep/include/ace/config-tandem-nsk-mips-v3.h | 463 -- dep/include/ace/config-tandem.h | 193 - dep/include/ace/config-tru64.h | 155 - dep/include/ace/config-unixware-7.1.0.h | 412 -- dep/include/ace/config-unixware-7.1.0.udk.h | 456 -- dep/include/ace/config-visualage.h | 21 - dep/include/ace/config-vxworks.h | 56 - dep/include/ace/config-vxworks5.x.h | 346 -- dep/include/ace/config-vxworks6.2.h | 329 -- dep/include/ace/config-vxworks6.3.h | 318 -- dep/include/ace/config-vxworks6.4.h | 341 -- dep/include/ace/config-vxworks6.5.h | 26 - dep/include/ace/config-vxworks6.6.h | 30 - dep/include/ace/config-win32-borland.h | 126 - dep/include/ace/config-win32-common.h | 663 --- dep/include/ace/config-win32-dmc.h | 111 - dep/include/ace/config-win32-ghs.h | 97 - dep/include/ace/config-win32-interix.h | 100 - dep/include/ace/config-win32-mingw.h | 101 - dep/include/ace/config-win32-msvc-7.h | 126 - dep/include/ace/config-win32-msvc-8.h | 149 - dep/include/ace/config-win32-msvc-9.h | 141 - dep/include/ace/config-win32-msvc.h | 170 - dep/include/ace/config-win32.h | 92 - dep/include/ace/iosfwd.h | 99 - dep/include/ace/os_include/arpa/os_inet.h | 75 - dep/include/ace/os_include/net/os_if.h | 120 - dep/include/ace/os_include/netinet/os_in.h | 186 - dep/include/ace/os_include/netinet/os_tcp.h | 47 - dep/include/ace/os_include/os_aio.h | 48 - dep/include/ace/os_include/os_assert.h | 47 - dep/include/ace/os_include/os_byteswap.h | 42 - dep/include/ace/os_include/os_complex.h | 43 - dep/include/ace/os_include/os_cpio.h | 43 - dep/include/ace/os_include/os_ctype.h | 46 - dep/include/ace/os_include/os_dirent.h | 109 - dep/include/ace/os_include/os_dlfcn.h | 102 - dep/include/ace/os_include/os_errno.h | 154 - dep/include/ace/os_include/os_fcntl.h | 107 - dep/include/ace/os_include/os_fenv.h | 43 - dep/include/ace/os_include/os_float.h | 43 - dep/include/ace/os_include/os_fmtmsg.h | 43 - dep/include/ace/os_include/os_fnmatch.h | 43 - dep/include/ace/os_include/os_ftw.h | 45 - dep/include/ace/os_include/os_glob.h | 43 - dep/include/ace/os_include/os_grp.h | 45 - dep/include/ace/os_include/os_iconv.h | 45 - dep/include/ace/os_include/os_intrin.h | 58 - dep/include/ace/os_include/os_inttypes.h | 47 - dep/include/ace/os_include/os_iso646.h | 43 - dep/include/ace/os_include/os_kstat.h | 44 - dep/include/ace/os_include/os_langinfo.h | 45 - dep/include/ace/os_include/os_libgen.h | 43 - dep/include/ace/os_include/os_limits.h | 144 - dep/include/ace/os_include/os_local.h | 45 - dep/include/ace/os_include/os_math.h | 45 - dep/include/ace/os_include/os_monetary.h | 45 - dep/include/ace/os_include/os_mqueue.h | 45 - dep/include/ace/os_include/os_ndbm.h | 45 - dep/include/ace/os_include/os_netdb.h | 109 - dep/include/ace/os_include/os_nl_types.h | 43 - dep/include/ace/os_include/os_pdh.h | 46 - dep/include/ace/os_include/os_pdhmsg.h | 42 - dep/include/ace/os_include/os_poll.h | 43 - dep/include/ace/os_include/os_pthread.h | 424 -- dep/include/ace/os_include/os_pwd.h | 59 - dep/include/ace/os_include/os_regex.h | 49 - dep/include/ace/os_include/os_sched.h | 53 - dep/include/ace/os_include/os_search.h | 45 - dep/include/ace/os_include/os_semaphore.h | 78 - dep/include/ace/os_include/os_setjmp.h | 43 - dep/include/ace/os_include/os_signal.h | 254 - dep/include/ace/os_include/os_spawn.h | 47 - dep/include/ace/os_include/os_stdarg.h | 51 - dep/include/ace/os_include/os_stdbool.h | 43 - dep/include/ace/os_include/os_stddef.h | 98 - dep/include/ace/os_include/os_stdint.h | 141 - dep/include/ace/os_include/os_stdio.h | 88 - dep/include/ace/os_include/os_stdlib.h | 78 - dep/include/ace/os_include/os_string.h | 77 - dep/include/ace/os_include/os_strings.h | 53 - dep/include/ace/os_include/os_stropts.h | 121 - dep/include/ace/os_include/os_syslog.h | 43 - dep/include/ace/os_include/os_tar.h | 43 - dep/include/ace/os_include/os_termios.h | 47 - dep/include/ace/os_include/os_tgmath.h | 46 - dep/include/ace/os_include/os_time.h | 124 - dep/include/ace/os_include/os_trace.h | 45 - dep/include/ace/os_include/os_ucontext.h | 49 - dep/include/ace/os_include/os_ulimit.h | 43 - dep/include/ace/os_include/os_unistd.h | 204 - dep/include/ace/os_include/os_utime.h | 45 - dep/include/ace/os_include/os_utmpx.h | 45 - dep/include/ace/os_include/os_wchar.h | 50 - dep/include/ace/os_include/os_wctype.h | 46 - dep/include/ace/os_include/os_wordexp.h | 45 - dep/include/ace/os_include/sys/os_ipc.h | 75 - dep/include/ace/os_include/sys/os_loadavg.h | 42 - dep/include/ace/os_include/sys/os_mman.h | 123 - dep/include/ace/os_include/sys/os_msg.h | 56 - dep/include/ace/os_include/sys/os_pstat.h | 43 - dep/include/ace/os_include/sys/os_resource.h | 105 - dep/include/ace/os_include/sys/os_select.h | 60 - dep/include/ace/os_include/sys/os_sem.h | 91 - dep/include/ace/os_include/sys/os_shm.h | 49 - dep/include/ace/os_include/sys/os_socket.h | 308 -- dep/include/ace/os_include/sys/os_stat.h | 128 - dep/include/ace/os_include/sys/os_statvfs.h | 43 - dep/include/ace/os_include/sys/os_sysctl.h | 42 - dep/include/ace/os_include/sys/os_sysinfo.h | 40 - dep/include/ace/os_include/sys/os_time.h | 61 - dep/include/ace/os_include/sys/os_timeb.h | 50 - dep/include/ace/os_include/sys/os_times.h | 45 - dep/include/ace/os_include/sys/os_types.h | 159 - dep/include/ace/os_include/sys/os_uio.h | 77 - dep/include/ace/os_include/sys/os_un.h | 52 - dep/include/ace/os_include/sys/os_utsname.h | 43 - dep/include/ace/os_include/sys/os_wait.h | 98 - dep/include/ace/post.h | 23 - dep/include/ace/pre.h | 26 - dep/include/ace/streams.h | 137 - dep/include/ace/svc_export.h | 45 - dep/include/bzip2/bzlib.h | 282 -- dep/include/g3dlite/G3D/AABox.h | 272 - dep/include/g3dlite/G3D/Any.h | 570 --- dep/include/g3dlite/G3D/AnyVal.h | 512 -- dep/include/g3dlite/G3D/AreaMemoryManager.h | 93 - dep/include/g3dlite/G3D/Array.h | 1274 ----- dep/include/g3dlite/G3D/AtomicInt32.h | 164 - dep/include/g3dlite/G3D/BinaryFormat.h | 140 - dep/include/g3dlite/G3D/BinaryInput.h | 441 -- dep/include/g3dlite/G3D/BinaryOutput.h | 421 -- dep/include/g3dlite/G3D/BoundsTrait.h | 20 - dep/include/g3dlite/G3D/Box.h | 195 - dep/include/g3dlite/G3D/Box2D.h | 121 - dep/include/g3dlite/G3D/BumpMapPreprocess.h | 61 - dep/include/g3dlite/G3D/Capsule.h | 90 - dep/include/g3dlite/G3D/CollisionDetection.h | 1205 ----- dep/include/g3dlite/G3D/Color1.h | 144 - dep/include/g3dlite/G3D/Color1uint8.h | 91 - dep/include/g3dlite/G3D/Color3.h | 432 -- dep/include/g3dlite/G3D/Color3uint8.h | 110 - dep/include/g3dlite/G3D/Color4.h | 338 -- dep/include/g3dlite/G3D/Color4uint8.h | 115 - dep/include/g3dlite/G3D/Cone.h | 68 - dep/include/g3dlite/G3D/ConvexPolyhedron.h | 180 - dep/include/g3dlite/G3D/CoordinateFrame.h | 331 -- dep/include/g3dlite/G3D/Crypto.h | 96 - dep/include/g3dlite/G3D/Cylinder.h | 92 - dep/include/g3dlite/G3D/EqualsTrait.h | 26 - dep/include/g3dlite/G3D/G3D.h | 162 - dep/include/g3dlite/G3D/G3DAll.h | 26 - dep/include/g3dlite/G3D/G3DGameUnits.h | 42 - dep/include/g3dlite/G3D/GCamera.h | 337 -- dep/include/g3dlite/G3D/GImage.h | 607 --- dep/include/g3dlite/G3D/GLight.h | 106 - dep/include/g3dlite/G3D/GMutex.h | 123 - dep/include/g3dlite/G3D/GThread.h | 121 - dep/include/g3dlite/G3D/GUniqueID.h | 69 - dep/include/g3dlite/G3D/HashTrait.h | 92 - dep/include/g3dlite/G3D/Image1.h | 81 - dep/include/g3dlite/G3D/Image1uint8.h | 80 - dep/include/g3dlite/G3D/Image3.h | 81 - dep/include/g3dlite/G3D/Image3uint8.h | 85 - dep/include/g3dlite/G3D/Image4.h | 86 - dep/include/g3dlite/G3D/Image4uint8.h | 85 - dep/include/g3dlite/G3D/ImageFormat.h | 419 -- dep/include/g3dlite/G3D/Intersect.h | 55 - dep/include/g3dlite/G3D/KDTree.h | 1667 ------ dep/include/g3dlite/G3D/Line.h | 105 - dep/include/g3dlite/G3D/LineSegment.h | 115 - dep/include/g3dlite/G3D/Log.h | 109 - dep/include/g3dlite/G3D/Map2D.h | 667 --- dep/include/g3dlite/G3D/Matrix.h | 634 --- dep/include/g3dlite/G3D/Matrix2.h | 69 - dep/include/g3dlite/G3D/Matrix3.h | 366 -- dep/include/g3dlite/G3D/Matrix4.h | 249 - dep/include/g3dlite/G3D/MemoryManager.h | 93 - dep/include/g3dlite/G3D/MeshAlg.h | 683 --- dep/include/g3dlite/G3D/MeshBuilder.h | 82 - dep/include/g3dlite/G3D/NetAddress.h | 132 - dep/include/g3dlite/G3D/NetworkDevice.h | 738 --- dep/include/g3dlite/G3D/ParseError.h | 59 - dep/include/g3dlite/G3D/PhysicsFrame.h | 74 - dep/include/g3dlite/G3D/Plane.h | 161 - dep/include/g3dlite/G3D/PointHashGrid.h | 917 ---- dep/include/g3dlite/G3D/PointKDTree.h | 1185 ----- dep/include/g3dlite/G3D/Pointer.h | 292 -- dep/include/g3dlite/G3D/PositionTrait.h | 7 - dep/include/g3dlite/G3D/PrecomputedRandom.h | 110 - dep/include/g3dlite/G3D/Quat.h | 725 --- dep/include/g3dlite/G3D/Quat.inl | 36 - dep/include/g3dlite/G3D/Queue.h | 364 -- dep/include/g3dlite/G3D/Random.h | 139 - dep/include/g3dlite/G3D/Ray.h | 371 -- dep/include/g3dlite/G3D/Rect2D.h | 417 -- dep/include/g3dlite/G3D/ReferenceCount.h | 570 --- dep/include/g3dlite/G3D/RegistryUtil.h | 97 - dep/include/g3dlite/G3D/Set.h | 186 - dep/include/g3dlite/G3D/SmallArray.h | 155 - dep/include/g3dlite/G3D/Sphere.h | 148 - dep/include/g3dlite/G3D/Spline.h | 367 -- dep/include/g3dlite/G3D/Stopwatch.h | 144 - dep/include/g3dlite/G3D/System.h | 507 -- dep/include/g3dlite/G3D/Table.h | 924 ---- dep/include/g3dlite/G3D/TextInput.h | 801 --- dep/include/g3dlite/G3D/TextOutput.h | 249 - dep/include/g3dlite/G3D/ThreadSet.h | 87 - dep/include/g3dlite/G3D/Triangle.h | 160 - dep/include/g3dlite/G3D/UprightFrame.h | 83 - dep/include/g3dlite/G3D/Vector2.h | 454 -- dep/include/g3dlite/G3D/Vector2.inl | 18 - dep/include/g3dlite/G3D/Vector2int16.h | 127 - dep/include/g3dlite/G3D/Vector3.h | 798 --- dep/include/g3dlite/G3D/Vector3.inl | 249 - dep/include/g3dlite/G3D/Vector3int16.h | 127 - dep/include/g3dlite/G3D/Vector3int32.h | 128 - dep/include/g3dlite/G3D/Vector4.h | 716 --- dep/include/g3dlite/G3D/Vector4.inl | 191 - dep/include/g3dlite/G3D/Vector4int8.h | 113 - dep/include/g3dlite/G3D/WeakCache.h | 122 - dep/include/g3dlite/G3D/Welder.h | 82 - dep/include/g3dlite/G3D/WrapMode.h | 93 - dep/include/g3dlite/G3D/constants.h | 129 - dep/include/g3dlite/G3D/debug.h | 66 - dep/include/g3dlite/G3D/debugAssert.h | 233 - dep/include/g3dlite/G3D/debugPrintf.h | 62 - dep/include/g3dlite/G3D/enumclass.h | 147 - dep/include/g3dlite/G3D/fileutils.h | 254 - dep/include/g3dlite/G3D/filter.h | 29 - dep/include/g3dlite/G3D/format.h | 44 - dep/include/g3dlite/G3D/g3dfnmatch.h | 83 - dep/include/g3dlite/G3D/g3dmath.h | 845 ---- dep/include/g3dlite/G3D/g3dmath.inl | 288 -- dep/include/g3dlite/G3D/platform.h | 331 -- dep/include/g3dlite/G3D/prompt.h | 67 - dep/include/g3dlite/G3D/serialize.h | 30 - dep/include/g3dlite/G3D/splinefunc.h | 118 - dep/include/g3dlite/G3D/stringutils.h | 140 - dep/include/g3dlite/G3D/uint128.h | 51 - dep/include/g3dlite/G3D/units.h | 126 - dep/include/g3dlite/G3D/vectorMath.h | 235 - dep/include/jemalloc/internal/arena.h | 537 -- dep/include/jemalloc/internal/base.h | 24 - dep/include/jemalloc/internal/chunk.h | 61 - dep/include/jemalloc/internal/chunk_dss.h | 29 - dep/include/jemalloc/internal/chunk_mmap.h | 20 - dep/include/jemalloc/internal/chunk_swap.h | 33 - dep/include/jemalloc/internal/ckh.h | 95 - dep/include/jemalloc/internal/ctl.h | 117 - dep/include/jemalloc/internal/extent.h | 49 - dep/include/jemalloc/internal/hash.h | 70 - dep/include/jemalloc/internal/huge.h | 38 - dep/include/jemalloc/internal/jemalloc_internal.h | 561 -- .../jemalloc/internal/jemalloc_internal.h.in | 561 -- dep/include/jemalloc/internal/mb.h | 108 - dep/include/jemalloc/internal/mutex.h | 61 - dep/include/jemalloc/internal/prof.h | 171 - dep/include/jemalloc/internal/ql.h | 83 - dep/include/jemalloc/internal/qr.h | 67 - dep/include/jemalloc/internal/rb.h | 973 ---- dep/include/jemalloc/internal/stats.h | 174 - dep/include/jemalloc/internal/tcache.h | 380 -- dep/include/jemalloc/internal/totally_not_p_r_n.h | 60 - dep/include/jemalloc/jemalloc.h | 42 - dep/include/jemalloc/jemalloc.h.in | 42 - dep/include/jemalloc/jemalloc_defs.h | 102 - dep/include/jemalloc/jemalloc_defs.h.in | 101 - dep/include/libmpq/common.h | 60 - dep/include/libmpq/crypt_buf.h | 217 - dep/include/libmpq/explode.h | 94 - dep/include/libmpq/extract.h | 106 - dep/include/libmpq/huffman.h | 151 - dep/include/libmpq/mpq-internal.h | 155 - dep/include/libmpq/mpq.h | 98 - dep/include/libmpq/wave.h | 45 - dep/include/mersennetwister/MersenneTwister.h | 405 -- dep/include/mysql/Libmysql.def | 153 - dep/include/mysql/config-netware.h | 142 - dep/include/mysql/config-os2.h | 836 --- dep/include/mysql/config-win.h | 461 -- dep/include/mysql/errmsg.h | 103 - dep/include/mysql/m_ctype.h | 522 -- dep/include/mysql/m_string.h | 267 - dep/include/mysql/my_alloc.h | 52 - dep/include/mysql/my_dbug.h | 108 - dep/include/mysql/my_getopt.h | 78 - dep/include/mysql/my_global.h | 1355 ----- dep/include/mysql/my_list.h | 46 - dep/include/mysql/my_pthread.h | 800 --- dep/include/mysql/my_sys.h | 937 ---- dep/include/mysql/mysql.h | 872 ---- dep/include/mysql/mysql_com.h | 468 -- dep/include/mysql/mysql_embed.h | 32 - dep/include/mysql/mysql_time.h | 56 - dep/include/mysql/mysql_version.h | 31 - dep/include/mysql/mysqld_error.h | 481 -- dep/include/mysql/raid.h | 159 - dep/include/mysql/typelib.h | 37 - dep/include/openssl/aes.h | 148 - dep/include/openssl/asn1.h | 1329 ----- dep/include/openssl/asn1_mac.h | 572 --- dep/include/openssl/asn1t.h | 893 ---- dep/include/openssl/bio.h | 776 --- dep/include/openssl/blowfish.h | 129 - dep/include/openssl/bn.h | 855 ---- dep/include/openssl/buffer.h | 119 - dep/include/openssl/cast.h | 107 - dep/include/openssl/comp.h | 80 - dep/include/openssl/conf.h | 254 - dep/include/openssl/conf_api.h | 90 - dep/include/openssl/crypto.h | 619 --- dep/include/openssl/des.h | 245 - dep/include/openssl/des_old.h | 446 -- dep/include/openssl/dh.h | 245 - dep/include/openssl/dsa.h | 324 -- dep/include/openssl/dso.h | 369 -- dep/include/openssl/dtls1.h | 218 - dep/include/openssl/e_os2.h | 280 - dep/include/openssl/ebcdic.h | 20 - dep/include/openssl/ec.h | 526 -- dep/include/openssl/ecdh.h | 124 - dep/include/openssl/ecdsa.h | 272 - dep/include/openssl/engine.h | 801 --- dep/include/openssl/err.h | 330 -- dep/include/openssl/evp.h | 1059 ---- dep/include/openssl/hmac.h | 109 - dep/include/openssl/idea.h | 103 - dep/include/openssl/krb5_asn.h | 257 - dep/include/openssl/kssl.h | 180 - dep/include/openssl/lhash.h | 201 - dep/include/openssl/md2.h | 95 - dep/include/openssl/md4.h | 120 - dep/include/openssl/md5.h | 120 - dep/include/openssl/obj_mac.h | 3775 -------------- dep/include/openssl/objects.h | 1050 ---- dep/include/openssl/ocsp.h | 623 --- dep/include/openssl/opensslconf.h | 259 - dep/include/openssl/opensslv.h | 89 - dep/include/openssl/ossl_typ.h | 183 - dep/include/openssl/pem.h | 782 --- dep/include/openssl/pem2.h | 71 - dep/include/openssl/pkcs12.h | 333 -- dep/include/openssl/pkcs7.h | 465 -- dep/include/openssl/pq_compat.h | 152 - dep/include/openssl/pqueue.h | 96 - dep/include/openssl/rand.h | 167 - dep/include/openssl/rc2.h | 103 - dep/include/openssl/rc4.h | 90 - dep/include/openssl/ripemd.h | 106 - dep/include/openssl/rsa.h | 496 -- dep/include/openssl/safestack.h | 2030 -------- dep/include/openssl/sha.h | 203 - dep/include/openssl/ssl.h | 2075 -------- dep/include/openssl/ssl2.h | 269 - dep/include/openssl/ssl23.h | 84 - dep/include/openssl/ssl3.h | 565 --- dep/include/openssl/stack.h | 110 - dep/include/openssl/store.h | 555 -- dep/include/openssl/symhacks.h | 409 -- dep/include/openssl/tls1.h | 407 -- dep/include/openssl/tmdiff.h | 94 - dep/include/openssl/txt_db.h | 110 - dep/include/openssl/ui.h | 382 -- dep/include/openssl/ui_compat.h | 84 - dep/include/openssl/x509.h | 1355 ----- dep/include/openssl/x509_vfy.h | 532 -- dep/include/openssl/x509v3.h | 922 ---- dep/include/sockets/Base64.h | 77 - dep/include/sockets/Exception.h | 55 - dep/include/sockets/File.h | 82 - dep/include/sockets/IFile.h | 71 - dep/include/sockets/ISocketHandler.h | 231 - dep/include/sockets/Ipv4Address.h | 95 - dep/include/sockets/Ipv6Address.h | 105 - dep/include/sockets/ListenSocket.h | 418 -- dep/include/sockets/Lock.h | 58 - dep/include/sockets/Mutex.h | 68 - dep/include/sockets/Parse.h | 100 - dep/include/sockets/ResolvServer.h | 72 - dep/include/sockets/ResolvSocket.h | 105 - dep/include/sockets/SctpSocket.h | 108 - dep/include/sockets/Socket.h | 735 --- dep/include/sockets/SocketAddress.h | 93 - dep/include/sockets/SocketHandler.h | 265 - dep/include/sockets/StdLog.h | 73 - dep/include/sockets/StdoutLog.h | 55 - dep/include/sockets/StreamSocket.h | 124 - dep/include/sockets/TcpSocket.h | 356 -- dep/include/sockets/Thread.h | 100 - dep/include/sockets/UdpSocket.h | 215 - dep/include/sockets/Utility.h | 186 - dep/include/sockets/socket_include.h | 290 -- dep/include/sockets/sockets-config.h | 90 - dep/include/utf8cpp/doc/ReleaseNotes | 9 - dep/include/utf8cpp/doc/utf8cpp.html | 1574 ------ dep/include/utf8cpp/utf8.h | 35 - dep/include/utf8cpp/utf8/checked.h | 319 -- dep/include/utf8cpp/utf8/core.h | 269 - dep/include/utf8cpp/utf8/unchecked.h | 229 - dep/include/vld/vld.h | 105 - dep/include/zlib/zconf.h | 333 -- dep/include/zlib/zlib.h | 1358 ----- dep/src/CMakeLists.txt | 9 - dep/src/ace/ACE.cpp | 3439 ------------- dep/src/ace/ACE_crc32.cpp | 161 - dep/src/ace/ACE_crc_ccitt.cpp | 129 - dep/src/ace/ARGV.cpp | 384 -- dep/src/ace/ATM_Acceptor.cpp | 308 -- dep/src/ace/ATM_Addr.cpp | 522 -- dep/src/ace/ATM_Connector.cpp | 139 - dep/src/ace/ATM_Params.cpp | 21 - dep/src/ace/ATM_QoS.cpp | 632 --- dep/src/ace/ATM_Stream.cpp | 291 -- dep/src/ace/Acceptor.cpp | 1236 ----- dep/src/ace/Activation_Queue.cpp | 139 - dep/src/ace/Active_Map_Manager.cpp | 10 - dep/src/ace/Active_Map_Manager_T.cpp | 23 - dep/src/ace/Addr.cpp | 71 - dep/src/ace/Arg_Shifter.cpp | 231 - dep/src/ace/Argv_Type_Converter.cpp | 203 - dep/src/ace/Array_Base.cpp | 236 - dep/src/ace/Array_Map.cpp | 300 -- dep/src/ace/Assert.cpp | 25 - dep/src/ace/Asynch_Acceptor.cpp | 515 -- dep/src/ace/Asynch_Connector.cpp | 297 -- dep/src/ace/Asynch_IO.cpp | 1410 ------ dep/src/ace/Asynch_IO_Impl.cpp | 118 - dep/src/ace/Asynch_Pseudo_Task.cpp | 129 - dep/src/ace/Atomic_Op.cpp | 311 -- dep/src/ace/Atomic_Op_Sparc.c | 187 - dep/src/ace/Atomic_Op_T.cpp | 83 - dep/src/ace/Auto_Event.cpp | 50 - dep/src/ace/Auto_Functor.cpp | 40 - dep/src/ace/Auto_IncDec_T.cpp | 35 - dep/src/ace/Auto_Ptr.cpp | 22 - dep/src/ace/Barrier.cpp | 198 - dep/src/ace/Base_Thread_Adapter.cpp | 129 - dep/src/ace/Based_Pointer_Repository.cpp | 120 - dep/src/ace/Based_Pointer_T.cpp | 122 - dep/src/ace/Basic_Stats.cpp | 79 - dep/src/ace/Basic_Types.cpp | 136 - dep/src/ace/CDR_Base.cpp | 800 --- dep/src/ace/CDR_Size.cpp | 262 - dep/src/ace/CDR_Stream.cpp | 2060 -------- dep/src/ace/CE_Screen_Output.cpp | 159 - dep/src/ace/Cache_Map_Manager_T.cpp | 421 -- dep/src/ace/Cached_Connect_Strategy_T.cpp | 735 --- dep/src/ace/Caching_Strategies_T.cpp | 60 - dep/src/ace/Caching_Utility_T.cpp | 500 -- dep/src/ace/Capabilities.cpp | 355 -- dep/src/ace/Cleanup.cpp | 192 - dep/src/ace/Cleanup_Strategies_T.cpp | 96 - dep/src/ace/Codecs.cpp | 235 - dep/src/ace/Codeset_IBM1047.cpp | 309 -- dep/src/ace/Codeset_Registry.cpp | 112 - dep/src/ace/Codeset_Registry_db.cpp | 34 - dep/src/ace/Condition_Recursive_Thread_Mutex.cpp | 130 - dep/src/ace/Condition_T.cpp | 123 - dep/src/ace/Condition_Thread_Mutex.cpp | 127 - dep/src/ace/Configuration.cpp | 2144 -------- dep/src/ace/Configuration_Import_Export.cpp | 670 --- dep/src/ace/Connection_Recycling_Strategy.cpp | 12 - dep/src/ace/Connector.cpp | 967 ---- dep/src/ace/Containers.cpp | 13 - dep/src/ace/Containers_T.cpp | 1933 ------- dep/src/ace/Copy_Disabled.cpp | 22 - dep/src/ace/Countdown_Time.cpp | 67 - dep/src/ace/DEV.cpp | 44 - dep/src/ace/DEV_Addr.cpp | 109 - dep/src/ace/DEV_Connector.cpp | 52 - dep/src/ace/DEV_IO.cpp | 131 - dep/src/ace/DLL.cpp | 267 - dep/src/ace/DLL_Manager.cpp | 786 --- dep/src/ace/Date_Time.cpp | 11 - dep/src/ace/Dev_Poll_Reactor.cpp | 2513 --------- dep/src/ace/Dirent.cpp | 8 - dep/src/ace/Dirent_Selector.cpp | 60 - dep/src/ace/Dump.cpp | 142 - dep/src/ace/Dump_T.cpp | 49 - dep/src/ace/Dynamic.cpp | 35 - dep/src/ace/Dynamic_Message_Strategy.cpp | 205 - dep/src/ace/Dynamic_Service.cpp | 64 - dep/src/ace/Dynamic_Service_Base.cpp | 99 - dep/src/ace/Dynamic_Service_Dependency.cpp | 48 - dep/src/ace/Encoding_Converter.cpp | 13 - dep/src/ace/Encoding_Converter_Factory.cpp | 75 - dep/src/ace/Env_Value_T.cpp | 13 - dep/src/ace/Event.cpp | 94 - dep/src/ace/Event_Handler.cpp | 396 -- dep/src/ace/Event_Handler_T.cpp | 126 - dep/src/ace/FIFO.cpp | 79 - dep/src/ace/FIFO_Recv.cpp | 89 - dep/src/ace/FIFO_Recv_Msg.cpp | 68 - dep/src/ace/FIFO_Send.cpp | 59 - dep/src/ace/FIFO_Send_Msg.cpp | 81 - dep/src/ace/FILE.cpp | 148 - dep/src/ace/FILE_Addr.cpp | 125 - dep/src/ace/FILE_Connector.cpp | 85 - dep/src/ace/FILE_IO.cpp | 146 - dep/src/ace/File_Lock.cpp | 73 - dep/src/ace/Filecache.cpp | 752 --- dep/src/ace/Flag_Manip.cpp | 96 - dep/src/ace/Framework_Component.cpp | 280 - dep/src/ace/Framework_Component_T.cpp | 34 - dep/src/ace/Free_List.cpp | 164 - dep/src/ace/Functor.cpp | 43 - dep/src/ace/Functor_String.cpp | 8 - dep/src/ace/Functor_T.cpp | 50 - dep/src/ace/Future.cpp | 437 -- dep/src/ace/Future_Set.cpp | 137 - dep/src/ace/Get_Opt.cpp | 735 --- dep/src/ace/Guard_T.cpp | 62 - dep/src/ace/Handle_Ops.cpp | 48 - dep/src/ace/Handle_Set.cpp | 570 --- dep/src/ace/Hash_Cache_Map_Manager_T.cpp | 233 - dep/src/ace/Hash_Map_Manager_T.cpp | 531 -- dep/src/ace/Hash_Map_With_Allocator_T.cpp | 36 - dep/src/ace/Hash_Multi_Map_Manager_T.cpp | 606 --- dep/src/ace/Hashable.cpp | 35 - dep/src/ace/High_Res_Timer.cpp | 535 -- dep/src/ace/ICMP_Socket.cpp | 184 - dep/src/ace/INET_Addr.cpp | 1158 ----- dep/src/ace/IOStream.cpp | 664 --- dep/src/ace/IOStream_T.cpp | 248 - dep/src/ace/IO_Cntl_Msg.cpp | 52 - dep/src/ace/IO_SAP.cpp | 143 - dep/src/ace/IPC_SAP.cpp | 194 - dep/src/ace/Init_ACE.cpp | 45 - dep/src/ace/Intrusive_Auto_Ptr.cpp | 23 - dep/src/ace/Intrusive_List.cpp | 154 - dep/src/ace/Intrusive_List_Node.cpp | 28 - dep/src/ace/LOCK_SOCK_Acceptor.cpp | 36 - dep/src/ace/LSOCK.cpp | 182 - dep/src/ace/LSOCK_Acceptor.cpp | 144 - dep/src/ace/LSOCK_CODgram.cpp | 63 - dep/src/ace/LSOCK_Connector.cpp | 60 - dep/src/ace/LSOCK_Dgram.cpp | 72 - dep/src/ace/LSOCK_Stream.cpp | 138 - dep/src/ace/Lib_Find.cpp | 768 --- dep/src/ace/Local_Memory_Pool.cpp | 145 - dep/src/ace/Local_Name_Space.cpp | 170 - dep/src/ace/Local_Name_Space_T.cpp | 967 ---- dep/src/ace/Local_Tokens.cpp | 1621 ------ dep/src/ace/Lock.cpp | 89 - dep/src/ace/Lock_Adapter_T.cpp | 118 - dep/src/ace/Log_Msg.cpp | 2524 --------- dep/src/ace/Log_Msg_Backend.cpp | 14 - dep/src/ace/Log_Msg_Callback.cpp | 13 - dep/src/ace/Log_Msg_IPC.cpp | 112 - dep/src/ace/Log_Msg_NT_Event_Log.cpp | 163 - dep/src/ace/Log_Msg_UNIX_Syslog.cpp | 208 - dep/src/ace/Log_Record.cpp | 413 -- dep/src/ace/Logging_Strategy.cpp | 567 --- dep/src/ace/MEM_Acceptor.cpp | 266 - dep/src/ace/MEM_Addr.cpp | 171 - dep/src/ace/MEM_Connector.cpp | 148 - dep/src/ace/MEM_IO.cpp | 574 --- dep/src/ace/MEM_SAP.cpp | 98 - dep/src/ace/MEM_Stream.cpp | 48 - dep/src/ace/MMAP_Memory_Pool.cpp | 594 --- dep/src/ace/Malloc.cpp | 185 - dep/src/ace/Malloc_Allocator.cpp | 362 -- dep/src/ace/Malloc_T.cpp | 1263 ----- dep/src/ace/Managed_Object.cpp | 26 - dep/src/ace/Manual_Event.cpp | 48 - dep/src/ace/Map_Manager.cpp | 702 --- dep/src/ace/Map_T.cpp | 1344 ----- dep/src/ace/Mem_Map.cpp | 310 -- dep/src/ace/Message_Block.cpp | 1272 ----- dep/src/ace/Message_Block_T.cpp | 55 - dep/src/ace/Message_Queue.cpp | 29 - dep/src/ace/Message_Queue_NT.cpp | 237 - dep/src/ace/Message_Queue_T.cpp | 2967 ----------- dep/src/ace/Message_Queue_Vx.cpp | 368 -- dep/src/ace/Method_Request.cpp | 31 - dep/src/ace/Metrics_Cache_T.cpp | 238 - dep/src/ace/Module.cpp | 274 - dep/src/ace/Monitor_Admin.cpp | 114 - dep/src/ace/Monitor_Admin_Manager.cpp | 43 - dep/src/ace/Monitor_Base.cpp | 403 -- dep/src/ace/Monitor_Control_Action.cpp | 45 - dep/src/ace/Monitor_Control_Types.cpp | 78 - dep/src/ace/Monitor_Point_Registry.cpp | 173 - dep/src/ace/Monitor_Size.cpp | 48 - dep/src/ace/Msg_WFMO_Reactor.cpp | 86 - dep/src/ace/Multihomed_INET_Addr.cpp | 300 -- dep/src/ace/Mutex.cpp | 125 - dep/src/ace/NT_Service.cpp | 616 --- dep/src/ace/Name_Proxy.cpp | 210 - dep/src/ace/Name_Request_Reply.cpp | 578 --- dep/src/ace/Name_Space.cpp | 73 - dep/src/ace/Naming_Context.cpp | 650 --- dep/src/ace/Netlink_Addr.cpp | 69 - dep/src/ace/Node.cpp | 47 - dep/src/ace/Notification_Queue.cpp | 229 - dep/src/ace/Notification_Strategy.cpp | 23 - dep/src/ace/OS.cpp | 54 - dep/src/ace/OS_Errno.cpp | 48 - dep/src/ace/OS_Log_Msg_Attributes.cpp | 10 - dep/src/ace/OS_NS_Thread.cpp | 5332 -------------------- dep/src/ace/OS_NS_arpa_inet.cpp | 54 - dep/src/ace/OS_NS_ctype.cpp | 12 - dep/src/ace/OS_NS_dirent.cpp | 275 - dep/src/ace/OS_NS_dlfcn.cpp | 11 - dep/src/ace/OS_NS_errno.cpp | 12 - dep/src/ace/OS_NS_fcntl.cpp | 246 - dep/src/ace/OS_NS_math.cpp | 11 - dep/src/ace/OS_NS_netdb.cpp | 422 -- dep/src/ace/OS_NS_poll.cpp | 11 - dep/src/ace/OS_NS_pwd.cpp | 11 - dep/src/ace/OS_NS_regex.cpp | 11 - dep/src/ace/OS_NS_signal.cpp | 27 - dep/src/ace/OS_NS_stdio.cpp | 462 -- dep/src/ace/OS_NS_stdlib.cpp | 873 ---- dep/src/ace/OS_NS_string.cpp | 378 -- dep/src/ace/OS_NS_strings.cpp | 85 - dep/src/ace/OS_NS_stropts.cpp | 194 - dep/src/ace/OS_NS_sys_mman.cpp | 11 - dep/src/ace/OS_NS_sys_msg.cpp | 11 - dep/src/ace/OS_NS_sys_resource.cpp | 11 - dep/src/ace/OS_NS_sys_select.cpp | 11 - dep/src/ace/OS_NS_sys_sendfile.cpp | 54 - dep/src/ace/OS_NS_sys_shm.cpp | 11 - dep/src/ace/OS_NS_sys_socket.cpp | 162 - dep/src/ace/OS_NS_sys_stat.cpp | 11 - dep/src/ace/OS_NS_sys_time.cpp | 11 - dep/src/ace/OS_NS_sys_uio.cpp | 131 - dep/src/ace/OS_NS_sys_utsname.cpp | 238 - dep/src/ace/OS_NS_sys_wait.cpp | 10 - dep/src/ace/OS_NS_time.cpp | 638 --- dep/src/ace/OS_NS_unistd.cpp | 901 ---- dep/src/ace/OS_NS_wchar.cpp | 378 -- dep/src/ace/OS_QoS.cpp | 477 -- dep/src/ace/OS_TLI.cpp | 10 - dep/src/ace/OS_Thread_Adapter.cpp | 154 - dep/src/ace/OS_main.cpp | 128 - dep/src/ace/Obchunk.cpp | 37 - dep/src/ace/Object_Manager.cpp | 887 ---- dep/src/ace/Object_Manager_Base.cpp | 507 -- dep/src/ace/Obstack_T.cpp | 227 - dep/src/ace/PI_Malloc.cpp | 166 - dep/src/ace/POSIX_Asynch_IO.cpp | 2412 --------- dep/src/ace/POSIX_CB_Proactor.cpp | 185 - dep/src/ace/POSIX_Proactor.cpp | 2045 -------- dep/src/ace/Pagefile_Memory_Pool.cpp | 386 -- dep/src/ace/Pair_T.cpp | 17 - dep/src/ace/Parse_Node.cpp | 877 ---- dep/src/ace/Ping_Socket.cpp | 375 -- dep/src/ace/Pipe.cpp | 361 -- dep/src/ace/Priority_Reactor.cpp | 189 - dep/src/ace/Proactor.cpp | 1173 ----- dep/src/ace/Proactor_Impl.cpp | 22 - dep/src/ace/Process.cpp | 1389 ----- dep/src/ace/Process_Manager.cpp | 1022 ---- dep/src/ace/Process_Mutex.cpp | 91 - dep/src/ace/Process_Semaphore.cpp | 112 - dep/src/ace/Profile_Timer.cpp | 442 -- dep/src/ace/RB_Tree.cpp | 1251 ----- dep/src/ace/RW_Mutex.cpp | 56 - dep/src/ace/RW_Process_Mutex.cpp | 55 - dep/src/ace/RW_Thread_Mutex.cpp | 46 - dep/src/ace/Reactor.cpp | 513 -- dep/src/ace/Reactor_Impl.cpp | 16 - dep/src/ace/Reactor_Notification_Strategy.cpp | 39 - dep/src/ace/Reactor_Timer_Interface.cpp | 16 - dep/src/ace/Reactor_Token_T.cpp | 71 - dep/src/ace/Read_Buffer.cpp | 176 - dep/src/ace/Recursive_Thread_Mutex.cpp | 126 - dep/src/ace/Recyclable.cpp | 22 - dep/src/ace/Refcountable_T.cpp | 26 - dep/src/ace/Refcounted_Auto_Ptr.cpp | 19 - dep/src/ace/Registry.cpp | 1052 ---- dep/src/ace/Registry_Name_Space.cpp | 281 -- dep/src/ace/Remote_Name_Space.cpp | 381 -- dep/src/ace/Remote_Tokens.cpp | 525 -- dep/src/ace/Reverse_Lock_T.cpp | 94 - dep/src/ace/Rtems_init.c | 219 - dep/src/ace/SOCK.cpp | 186 - dep/src/ace/SOCK_Acceptor.cpp | 407 -- dep/src/ace/SOCK_CODgram.cpp | 152 - dep/src/ace/SOCK_Connector.cpp | 360 -- dep/src/ace/SOCK_Dgram.cpp | 751 --- dep/src/ace/SOCK_Dgram_Bcast.cpp | 380 -- dep/src/ace/SOCK_Dgram_Mcast.cpp | 930 ---- dep/src/ace/SOCK_IO.cpp | 182 - dep/src/ace/SOCK_Netlink.cpp | 113 - dep/src/ace/SOCK_SEQPACK_Acceptor.cpp | 597 --- dep/src/ace/SOCK_SEQPACK_Association.cpp | 339 -- dep/src/ace/SOCK_SEQPACK_Connector.cpp | 441 -- dep/src/ace/SOCK_Stream.cpp | 41 - dep/src/ace/SPIPE.cpp | 83 - dep/src/ace/SPIPE_Acceptor.cpp | 338 -- dep/src/ace/SPIPE_Addr.cpp | 167 - dep/src/ace/SPIPE_Connector.cpp | 161 - dep/src/ace/SPIPE_Stream.cpp | 105 - dep/src/ace/SSL/SSL_Asynch_BIO.cpp | 253 - dep/src/ace/SSL/SSL_Asynch_Stream.cpp | 1063 ---- dep/src/ace/SSL/SSL_Context.cpp | 640 --- dep/src/ace/SSL/SSL_SOCK.cpp | 72 - dep/src/ace/SSL/SSL_SOCK_Acceptor.cpp | 250 - dep/src/ace/SSL/SSL_SOCK_Connector.cpp | 425 -- dep/src/ace/SSL/SSL_SOCK_Stream.cpp | 630 --- dep/src/ace/SString.cpp | 549 -- dep/src/ace/SUN_Proactor.cpp | 323 -- dep/src/ace/SV_Message.cpp | 25 - dep/src/ace/SV_Message_Queue.cpp | 45 - dep/src/ace/SV_Semaphore_Complex.cpp | 260 - dep/src/ace/SV_Semaphore_Simple.cpp | 238 - dep/src/ace/SV_Shared_Memory.cpp | 89 - dep/src/ace/Sample_History.cpp | 73 - dep/src/ace/Sbrk_Memory_Pool.cpp | 125 - dep/src/ace/Sched_Params.cpp | 332 -- dep/src/ace/Select_Reactor_Base.cpp | 1110 ---- dep/src/ace/Select_Reactor_T.cpp | 1599 ------ dep/src/ace/Semaphore.cpp | 63 - dep/src/ace/Service_Config.cpp | 611 --- dep/src/ace/Service_Gestalt.cpp | 1271 ----- dep/src/ace/Service_Manager.cpp | 438 -- dep/src/ace/Service_Object.cpp | 180 - dep/src/ace/Service_Repository.cpp | 634 --- dep/src/ace/Service_Types.cpp | 453 -- dep/src/ace/Shared_Memory.cpp | 14 - dep/src/ace/Shared_Memory_MM.cpp | 111 - dep/src/ace/Shared_Memory_Pool.cpp | 462 -- dep/src/ace/Shared_Memory_SV.cpp | 87 - dep/src/ace/Shared_Object.cpp | 55 - dep/src/ace/Sig_Adapter.cpp | 80 - dep/src/ace/Sig_Handler.cpp | 613 --- dep/src/ace/Signal.cpp | 221 - dep/src/ace/Singleton.cpp | 535 -- dep/src/ace/Sock_Connect.cpp | 1599 ------ dep/src/ace/Stack_Trace.cpp | 694 --- dep/src/ace/Stats.cpp | 426 -- dep/src/ace/Strategies_T.cpp | 1503 ------ dep/src/ace/Stream.cpp | 620 --- dep/src/ace/Stream_Modules.cpp | 381 -- dep/src/ace/String_Base.cpp | 564 --- dep/src/ace/String_Base_Const.cpp | 21 - dep/src/ace/Svc_Conf_Lexer.cpp | 676 --- dep/src/ace/Svc_Conf_y.cpp | 1950 ------- dep/src/ace/Svc_Handler.cpp | 526 -- dep/src/ace/Synch_Options.cpp | 111 - dep/src/ace/Synch_T.cpp | 23 - dep/src/ace/System_Time.cpp | 141 - dep/src/ace/TLI.cpp | 274 - dep/src/ace/TLI_Acceptor.cpp | 554 -- dep/src/ace/TLI_Connector.cpp | 257 - dep/src/ace/TLI_Stream.cpp | 230 - dep/src/ace/TP_Reactor.cpp | 683 --- dep/src/ace/TSS_Adapter.cpp | 46 - dep/src/ace/TSS_T.cpp | 726 --- dep/src/ace/TTY_IO.cpp | 583 --- dep/src/ace/Task.cpp | 298 -- dep/src/ace/Task_Ex_T.cpp | 115 - dep/src/ace/Task_T.cpp | 109 - dep/src/ace/Test_and_Set.cpp | 52 - dep/src/ace/Thread.cpp | 100 - dep/src/ace/Thread_Adapter.cpp | 229 - dep/src/ace/Thread_Control.cpp | 97 - dep/src/ace/Thread_Exit.cpp | 124 - dep/src/ace/Thread_Hook.cpp | 34 - dep/src/ace/Thread_Manager.cpp | 2220 -------- dep/src/ace/Thread_Mutex.cpp | 63 - dep/src/ace/Thread_Semaphore.cpp | 62 - dep/src/ace/Throughput_Stats.cpp | 202 - dep/src/ace/Time_Value.cpp | 263 - dep/src/ace/Timeprobe.cpp | 16 - dep/src/ace/Timeprobe_T.cpp | 428 -- dep/src/ace/Timer_Hash_T.cpp | 874 ---- dep/src/ace/Timer_Heap_T.cpp | 890 ---- dep/src/ace/Timer_List_T.cpp | 419 -- dep/src/ace/Timer_Queue_Adapters.cpp | 362 -- dep/src/ace/Timer_Queue_T.cpp | 482 -- dep/src/ace/Timer_Wheel_T.cpp | 968 ---- dep/src/ace/Token.cpp | 546 -- dep/src/ace/Token_Collection.cpp | 292 -- dep/src/ace/Token_Invariants.cpp | 354 -- dep/src/ace/Token_Manager.cpp | 273 - dep/src/ace/Token_Request_Reply.cpp | 187 - dep/src/ace/Trace.cpp | 137 - dep/src/ace/Typed_SV_Message.cpp | 31 - dep/src/ace/Typed_SV_Message_Queue.cpp | 57 - dep/src/ace/UNIX_Addr.cpp | 152 - dep/src/ace/UPIPE_Acceptor.cpp | 130 - dep/src/ace/UPIPE_Connector.cpp | 102 - dep/src/ace/UPIPE_Stream.cpp | 235 - dep/src/ace/UTF16_Encoding_Converter.cpp | 364 -- dep/src/ace/UTF32_Encoding_Converter.cpp | 255 - dep/src/ace/UTF8_Encoding_Converter.cpp | 93 - dep/src/ace/UUID.cpp | 554 -- dep/src/ace/Unbounded_Queue.cpp | 435 -- dep/src/ace/Unbounded_Set.cpp | 19 - dep/src/ace/Unbounded_Set_Ex.cpp | 500 -- dep/src/ace/Vector_T.cpp | 155 - dep/src/ace/WFMO_Reactor.cpp | 2744 ---------- dep/src/ace/WIN32_Asynch_IO.cpp | 3768 -------------- dep/src/ace/WIN32_Proactor.cpp | 805 --- dep/src/ace/XML_Svc_Conf.cpp | 16 - dep/src/ace/XTI_ATM_Mcast.cpp | 71 - dep/src/ace/ace_wchar.cpp | 18 - dep/src/ace/gethrtime.cpp | 61 - dep/src/bzip2/blocksort.c | 1094 ---- dep/src/bzip2/bzlib.c | 1572 ------ dep/src/bzip2/bzlib.h | 282 -- dep/src/bzip2/bzlib_private.h | 509 -- dep/src/bzip2/compress.c | 672 --- dep/src/bzip2/crctable.c | 104 - dep/src/bzip2/decompress.c | 626 --- dep/src/bzip2/huffman.c | 205 - dep/src/bzip2/randtable.c | 84 - dep/src/g3dlite/AABox.cpp | 366 -- dep/src/g3dlite/Any.cpp | 1237 ----- dep/src/g3dlite/AnyVal.cpp | 1379 ----- dep/src/g3dlite/AreaMemoryManager.cpp | 87 - dep/src/g3dlite/BinaryFormat.cpp | 81 - dep/src/g3dlite/BinaryInput.cpp | 568 --- dep/src/g3dlite/BinaryOutput.cpp | 522 -- dep/src/g3dlite/Box.cpp | 393 -- dep/src/g3dlite/Box2D.cpp | 113 - dep/src/g3dlite/BumpMapPreprocess.cpp | 43 - dep/src/g3dlite/CMakeLists.txt | 53 - dep/src/g3dlite/Capsule.cpp | 179 - dep/src/g3dlite/CollisionDetection.cpp | 2455 --------- dep/src/g3dlite/Color1.cpp | 58 - dep/src/g3dlite/Color1uint8.cpp | 38 - dep/src/g3dlite/Color3.cpp | 384 -- dep/src/g3dlite/Color3uint8.cpp | 45 - dep/src/g3dlite/Color4.cpp | 192 - dep/src/g3dlite/Color4uint8.cpp | 47 - dep/src/g3dlite/Cone.cpp | 79 - dep/src/g3dlite/ConvexPolyhedron.cpp | 457 -- dep/src/g3dlite/CoordinateFrame.cpp | 436 -- dep/src/g3dlite/Crypto.cpp | 70 - dep/src/g3dlite/Crypto_md5.cpp | 471 -- dep/src/g3dlite/Cylinder.cpp | 176 - dep/src/g3dlite/GCamera.cpp | 502 -- dep/src/g3dlite/GImage.cpp | 1166 ----- dep/src/g3dlite/GImage_bayer.cpp | 298 -- dep/src/g3dlite/GImage_bmp.cpp | 717 --- dep/src/g3dlite/GImage_jpeg.cpp | 446 -- dep/src/g3dlite/GImage_png.cpp | 266 - dep/src/g3dlite/GImage_ppm.cpp | 217 - dep/src/g3dlite/GImage_tga.cpp | 193 - dep/src/g3dlite/GLight.cpp | 267 - dep/src/g3dlite/GThread.cpp | 229 - dep/src/g3dlite/GUniqueID.cpp | 78 - dep/src/g3dlite/Image1.cpp | 224 - dep/src/g3dlite/Image1uint8.cpp | 212 - dep/src/g3dlite/Image3.cpp | 225 - dep/src/g3dlite/Image3uint8.cpp | 225 - dep/src/g3dlite/Image4.cpp | 226 - dep/src/g3dlite/Image4uint8.cpp | 222 - dep/src/g3dlite/ImageFormat.cpp | 567 --- dep/src/g3dlite/ImageFormat_convert.cpp | 1307 ----- dep/src/g3dlite/Intersect.cpp | 844 ---- dep/src/g3dlite/Line.cpp | 89 - dep/src/g3dlite/LineSegment.cpp | 236 - dep/src/g3dlite/Log.cpp | 146 - dep/src/g3dlite/Makefile.am | 69 - dep/src/g3dlite/Matrix.cpp | 1802 ------- dep/src/g3dlite/Matrix3.cpp | 1927 ------- dep/src/g3dlite/Matrix4.cpp | 523 -- dep/src/g3dlite/MemoryManager.cpp | 91 - dep/src/g3dlite/MeshAlg.cpp | 637 --- dep/src/g3dlite/MeshAlgAdjacency.cpp | 739 --- dep/src/g3dlite/MeshAlgWeld.cpp | 213 - dep/src/g3dlite/MeshBuilder.cpp | 113 - dep/src/g3dlite/NetAddress.cpp | 164 - dep/src/g3dlite/NetworkDevice.cpp | 1362 ----- dep/src/g3dlite/PhysicsFrame.cpp | 77 - dep/src/g3dlite/Plane.cpp | 149 - dep/src/g3dlite/PrecomputedRandom.cpp | 125 - dep/src/g3dlite/Quat.cpp | 583 --- dep/src/g3dlite/Random.cpp | 212 - dep/src/g3dlite/Ray.cpp | 218 - dep/src/g3dlite/Rect2D.cpp | 41 - dep/src/g3dlite/ReferenceCount.cpp | 61 - dep/src/g3dlite/RegistryUtil.cpp | 290 -- dep/src/g3dlite/Sphere.cpp | 223 - dep/src/g3dlite/SplineBase.cpp | 162 - dep/src/g3dlite/Stopwatch.cpp | 119 - dep/src/g3dlite/System.cpp | 1746 ------- dep/src/g3dlite/TextInput.cpp | 1136 ----- dep/src/g3dlite/TextOutput.cpp | 452 -- dep/src/g3dlite/ThreadSet.cpp | 166 - dep/src/g3dlite/Triangle.cpp | 186 - dep/src/g3dlite/UprightFrame.cpp | 132 - dep/src/g3dlite/Vector2.cpp | 224 - dep/src/g3dlite/Vector2int16.cpp | 47 - dep/src/g3dlite/Vector3.cpp | 507 -- dep/src/g3dlite/Vector3int16.cpp | 49 - dep/src/g3dlite/Vector3int32.cpp | 57 - dep/src/g3dlite/Vector4.cpp | 520 -- dep/src/g3dlite/Vector4int8.cpp | 58 - dep/src/g3dlite/Welder.cpp | 416 -- dep/src/g3dlite/WinMain.cpp | 159 - dep/src/g3dlite/constants.cpp | 82 - dep/src/g3dlite/debugAssert.cpp | 389 -- dep/src/g3dlite/fileutils.cpp | 1165 ----- dep/src/g3dlite/filter.cpp | 32 - dep/src/g3dlite/format.cpp | 164 - dep/src/g3dlite/g3dfnmatch.cpp | 204 - dep/src/g3dlite/g3dmath.cpp | 108 - dep/src/g3dlite/license.cpp | 73 - dep/src/g3dlite/license.html | 115 - dep/src/g3dlite/prompt.cpp | 729 --- dep/src/g3dlite/stringutils.cpp | 275 - dep/src/g3dlite/uint128.cpp | 155 - dep/src/jmalloc/CMakeLists.txt | 27 - dep/src/jmalloc/arena.c | 2446 --------- dep/src/jmalloc/base.c | 106 - dep/src/jmalloc/chunk.c | 150 - dep/src/jmalloc/chunk_dss.c | 268 - dep/src/jmalloc/chunk_mmap.c | 201 - dep/src/jmalloc/chunk_swap.c | 383 -- dep/src/jmalloc/ckh.c | 601 --- dep/src/jmalloc/ctl.c | 1482 ------ dep/src/jmalloc/extent.c | 41 - dep/src/jmalloc/hash.c | 2 - dep/src/jmalloc/huge.c | 298 -- dep/src/jmalloc/jemalloc.c | 1349 ----- dep/src/jmalloc/mb.c | 2 - dep/src/jmalloc/mutex.c | 70 - dep/src/jmalloc/prof.c | 1328 ----- dep/src/jmalloc/stats.c | 717 --- dep/src/jmalloc/tcache.c | 403 -- dep/src/libmpq/common.c | 222 - dep/src/libmpq/explode.c | 602 --- dep/src/libmpq/extract.c | 361 -- dep/src/libmpq/huffman.c | 1101 ---- dep/src/libmpq/mpq.c | 1033 ---- dep/src/libmpq/wave.c | 250 - dep/src/sockets/Base64.cpp | 262 - dep/src/sockets/CMakeLists.txt | 26 - dep/src/sockets/Exception.cpp | 45 - dep/src/sockets/Ipv4Address.cpp | 192 - dep/src/sockets/Ipv6Address.cpp | 247 - dep/src/sockets/Lock.cpp | 52 - dep/src/sockets/Mutex.cpp | 77 - dep/src/sockets/Parse.cpp | 318 -- dep/src/sockets/ResolvServer.cpp | 92 - dep/src/sockets/ResolvSocket.cpp | 426 -- dep/src/sockets/Socket.cpp | 1726 ------- dep/src/sockets/SocketHandler.cpp | 1377 ----- dep/src/sockets/StdoutLog.cpp | 98 - dep/src/sockets/StreamSocket.cpp | 145 - dep/src/sockets/TcpSocket.cpp | 1681 ------ dep/src/sockets/Thread.cpp | 154 - dep/src/sockets/UdpSocket.cpp | 810 --- dep/src/sockets/Utility.cpp | 960 ---- dep/src/sockets/network_kist.txt | 20 - dep/src/sockets/socket_include.cpp | 89 - dep/src/zlib/CMakeLists.txt | 20 - dep/src/zlib/adler32.c | 149 - dep/src/zlib/compress.c | 79 - dep/src/zlib/crc32.c | 423 -- dep/src/zlib/crc32.h | 442 -- dep/src/zlib/deflate.c | 1734 ------- dep/src/zlib/deflate.h | 330 -- dep/src/zlib/example.c | 565 --- dep/src/zlib/gzio.c | 1018 ---- dep/src/zlib/infback.c | 623 --- dep/src/zlib/inffast.c | 318 -- dep/src/zlib/inffast.h | 12 - dep/src/zlib/inffixed.h | 95 - dep/src/zlib/inflate.c | 1368 ----- dep/src/zlib/inflate.h | 116 - dep/src/zlib/inftrees.c | 329 -- dep/src/zlib/inftrees.h | 56 - dep/src/zlib/trees.c | 1217 ----- dep/src/zlib/trees.h | 129 - dep/src/zlib/uncompr.c | 61 - dep/src/zlib/zconf.h | 333 -- dep/src/zlib/zlib.h | 1348 ----- dep/src/zlib/zutil.c | 314 -- dep/src/zlib/zutil.h | 269 - 1758 files changed, 483696 deletions(-) delete mode 100644 dep/CMakeLists.txt delete mode 100644 dep/include/ace/ACE.h delete mode 100644 dep/include/ace/ACE.inl delete mode 100644 dep/include/ace/ACE_export.h delete mode 100644 dep/include/ace/ARGV.h delete mode 100644 dep/include/ace/ARGV.inl delete mode 100644 dep/include/ace/ATM_Acceptor.h delete mode 100644 dep/include/ace/ATM_Acceptor.inl delete mode 100644 dep/include/ace/ATM_Addr.h delete mode 100644 dep/include/ace/ATM_Addr.inl delete mode 100644 dep/include/ace/ATM_Connector.h delete mode 100644 dep/include/ace/ATM_Connector.inl delete mode 100644 dep/include/ace/ATM_Params.h delete mode 100644 dep/include/ace/ATM_Params.inl delete mode 100644 dep/include/ace/ATM_QoS.h delete mode 100644 dep/include/ace/ATM_QoS.inl delete mode 100644 dep/include/ace/ATM_Stream.h delete mode 100644 dep/include/ace/ATM_Stream.inl delete mode 100644 dep/include/ace/Acceptor.h delete mode 100644 dep/include/ace/Activation_Queue.h delete mode 100644 dep/include/ace/Activation_Queue.inl delete mode 100644 dep/include/ace/Active_Map_Manager.h delete mode 100644 dep/include/ace/Active_Map_Manager.inl delete mode 100644 dep/include/ace/Active_Map_Manager_T.h delete mode 100644 dep/include/ace/Active_Map_Manager_T.inl delete mode 100644 dep/include/ace/Addr.h delete mode 100644 dep/include/ace/Addr.inl delete mode 100644 dep/include/ace/Arg_Shifter.h delete mode 100644 dep/include/ace/Argv_Type_Converter.h delete mode 100644 dep/include/ace/Argv_Type_Converter.inl delete mode 100644 dep/include/ace/Array.h delete mode 100644 dep/include/ace/Array_Base.h delete mode 100644 dep/include/ace/Array_Base.inl delete mode 100644 dep/include/ace/Array_Map.h delete mode 100644 dep/include/ace/Array_Map.inl delete mode 100644 dep/include/ace/Assert.h delete mode 100644 dep/include/ace/Asynch_Acceptor.h delete mode 100644 dep/include/ace/Asynch_Connector.h delete mode 100644 dep/include/ace/Asynch_IO.h delete mode 100644 dep/include/ace/Asynch_IO_Impl.h delete mode 100644 dep/include/ace/Asynch_IO_Impl.inl delete mode 100644 dep/include/ace/Asynch_Pseudo_Task.h delete mode 100644 dep/include/ace/Atomic_Op.h delete mode 100644 dep/include/ace/Atomic_Op.inl delete mode 100644 dep/include/ace/Atomic_Op_Sparc.h delete mode 100644 dep/include/ace/Atomic_Op_T.h delete mode 100644 dep/include/ace/Atomic_Op_T.inl delete mode 100644 dep/include/ace/Auto_Event.h delete mode 100644 dep/include/ace/Auto_Event.inl delete mode 100644 dep/include/ace/Auto_Functor.h delete mode 100644 dep/include/ace/Auto_Functor.inl delete mode 100644 dep/include/ace/Auto_IncDec_T.h delete mode 100644 dep/include/ace/Auto_IncDec_T.inl delete mode 100644 dep/include/ace/Auto_Ptr.h delete mode 100644 dep/include/ace/Auto_Ptr.inl delete mode 100644 dep/include/ace/Barrier.h delete mode 100644 dep/include/ace/Barrier.inl delete mode 100644 dep/include/ace/Base_Thread_Adapter.h delete mode 100644 dep/include/ace/Base_Thread_Adapter.inl delete mode 100644 dep/include/ace/Based_Pointer_Repository.h delete mode 100644 dep/include/ace/Based_Pointer_T.h delete mode 100644 dep/include/ace/Based_Pointer_T.inl delete mode 100644 dep/include/ace/Basic_Stats.h delete mode 100644 dep/include/ace/Basic_Stats.inl delete mode 100644 dep/include/ace/Basic_Types.h delete mode 100644 dep/include/ace/Basic_Types.inl delete mode 100644 dep/include/ace/Bound_Ptr.h delete mode 100644 dep/include/ace/Bound_Ptr.inl delete mode 100644 dep/include/ace/CDR_Base.h delete mode 100644 dep/include/ace/CDR_Base.inl delete mode 100644 dep/include/ace/CDR_Size.h delete mode 100644 dep/include/ace/CDR_Size.inl delete mode 100644 dep/include/ace/CDR_Stream.h delete mode 100644 dep/include/ace/CDR_Stream.inl delete mode 100644 dep/include/ace/CE_Screen_Output.h delete mode 100644 dep/include/ace/CORBA_macros.h delete mode 100644 dep/include/ace/Cache_Map_Manager_T.h delete mode 100644 dep/include/ace/Cache_Map_Manager_T.inl delete mode 100644 dep/include/ace/Cached_Connect_Strategy_T.h delete mode 100644 dep/include/ace/Caching_Strategies_T.h delete mode 100644 dep/include/ace/Caching_Strategies_T.inl delete mode 100644 dep/include/ace/Caching_Utility_T.h delete mode 100644 dep/include/ace/Capabilities.h delete mode 100644 dep/include/ace/Capabilities.inl delete mode 100644 dep/include/ace/Cleanup.h delete mode 100644 dep/include/ace/Cleanup.inl delete mode 100644 dep/include/ace/Cleanup_Strategies_T.h delete mode 100644 dep/include/ace/Codecs.h delete mode 100644 dep/include/ace/Codeset_IBM1047.h delete mode 100644 dep/include/ace/Codeset_Registry.h delete mode 100644 dep/include/ace/Codeset_Registry.inl delete mode 100644 dep/include/ace/Codeset_Symbols.h delete mode 100644 dep/include/ace/Condition_Recursive_Thread_Mutex.h delete mode 100644 dep/include/ace/Condition_T.h delete mode 100644 dep/include/ace/Condition_T.inl delete mode 100644 dep/include/ace/Condition_Thread_Mutex.h delete mode 100644 dep/include/ace/Condition_Thread_Mutex.inl delete mode 100644 dep/include/ace/Configuration.h delete mode 100644 dep/include/ace/Configuration.inl delete mode 100644 dep/include/ace/Configuration_Import_Export.h delete mode 100644 dep/include/ace/Connection_Recycling_Strategy.h delete mode 100644 dep/include/ace/Connector.h delete mode 100644 dep/include/ace/Containers.h delete mode 100644 dep/include/ace/Containers.inl delete mode 100644 dep/include/ace/Containers_T.h delete mode 100644 dep/include/ace/Containers_T.inl delete mode 100644 dep/include/ace/Copy_Disabled.h delete mode 100644 dep/include/ace/Countdown_Time.h delete mode 100644 dep/include/ace/DEV.h delete mode 100644 dep/include/ace/DEV.inl delete mode 100644 dep/include/ace/DEV_Addr.h delete mode 100644 dep/include/ace/DEV_Addr.inl delete mode 100644 dep/include/ace/DEV_Connector.h delete mode 100644 dep/include/ace/DEV_Connector.inl delete mode 100644 dep/include/ace/DEV_IO.h delete mode 100644 dep/include/ace/DEV_IO.inl delete mode 100644 dep/include/ace/DLL.h delete mode 100644 dep/include/ace/DLL_Manager.h delete mode 100644 dep/include/ace/Date_Time.h delete mode 100644 dep/include/ace/Date_Time.inl delete mode 100644 dep/include/ace/Default_Constants.h delete mode 100644 dep/include/ace/Dev_Poll_Reactor.h delete mode 100644 dep/include/ace/Dev_Poll_Reactor.inl delete mode 100644 dep/include/ace/Dirent.h delete mode 100644 dep/include/ace/Dirent.inl delete mode 100644 dep/include/ace/Dirent_Selector.h delete mode 100644 dep/include/ace/Dirent_Selector.inl delete mode 100644 dep/include/ace/Dump.h delete mode 100644 dep/include/ace/Dump_T.h delete mode 100644 dep/include/ace/Dynamic.h delete mode 100644 dep/include/ace/Dynamic.inl delete mode 100644 dep/include/ace/Dynamic_Message_Strategy.h delete mode 100644 dep/include/ace/Dynamic_Message_Strategy.inl delete mode 100644 dep/include/ace/Dynamic_Service.h delete mode 100644 dep/include/ace/Dynamic_Service.inl delete mode 100644 dep/include/ace/Dynamic_Service_Base.h delete mode 100644 dep/include/ace/Dynamic_Service_Dependency.h delete mode 100644 dep/include/ace/Encoding_Converter.h delete mode 100644 dep/include/ace/Encoding_Converter_Factory.h delete mode 100644 dep/include/ace/Env_Value_T.h delete mode 100644 dep/include/ace/Env_Value_T.inl delete mode 100644 dep/include/ace/Event.h delete mode 100644 dep/include/ace/Event.inl delete mode 100644 dep/include/ace/Event_Handler.h delete mode 100644 dep/include/ace/Event_Handler.inl delete mode 100644 dep/include/ace/Event_Handler_T.h delete mode 100644 dep/include/ace/Event_Handler_T.inl delete mode 100644 dep/include/ace/Exception_Macros.h delete mode 100644 dep/include/ace/FIFO.h delete mode 100644 dep/include/ace/FIFO.inl delete mode 100644 dep/include/ace/FIFO_Recv.h delete mode 100644 dep/include/ace/FIFO_Recv.inl delete mode 100644 dep/include/ace/FIFO_Recv_Msg.h delete mode 100644 dep/include/ace/FIFO_Recv_Msg.inl delete mode 100644 dep/include/ace/FIFO_Send.h delete mode 100644 dep/include/ace/FIFO_Send.inl delete mode 100644 dep/include/ace/FIFO_Send_Msg.h delete mode 100644 dep/include/ace/FIFO_Send_Msg.inl delete mode 100644 dep/include/ace/FILE.h delete mode 100644 dep/include/ace/FILE.inl delete mode 100644 dep/include/ace/FILE_Addr.h delete mode 100644 dep/include/ace/FILE_Addr.inl delete mode 100644 dep/include/ace/FILE_Connector.h delete mode 100644 dep/include/ace/FILE_Connector.inl delete mode 100644 dep/include/ace/FILE_IO.h delete mode 100644 dep/include/ace/FILE_IO.inl delete mode 100644 dep/include/ace/File_Lock.h delete mode 100644 dep/include/ace/File_Lock.inl delete mode 100644 dep/include/ace/Filecache.h delete mode 100644 dep/include/ace/Flag_Manip.h delete mode 100644 dep/include/ace/Flag_Manip.inl delete mode 100644 dep/include/ace/Framework_Component.h delete mode 100644 dep/include/ace/Framework_Component.inl delete mode 100644 dep/include/ace/Framework_Component_T.h delete mode 100644 dep/include/ace/Free_List.h delete mode 100644 dep/include/ace/Functor.h delete mode 100644 dep/include/ace/Functor.inl delete mode 100644 dep/include/ace/Functor_String.h delete mode 100644 dep/include/ace/Functor_String.inl delete mode 100644 dep/include/ace/Functor_T.h delete mode 100644 dep/include/ace/Functor_T.inl delete mode 100644 dep/include/ace/Future.h delete mode 100644 dep/include/ace/Future_Set.h delete mode 100644 dep/include/ace/Get_Opt.h delete mode 100644 dep/include/ace/Get_Opt.inl delete mode 100644 dep/include/ace/Global_Macros.h delete mode 100644 dep/include/ace/Guard_T.h delete mode 100644 dep/include/ace/Guard_T.inl delete mode 100644 dep/include/ace/Handle_Gobbler.h delete mode 100644 dep/include/ace/Handle_Gobbler.inl delete mode 100644 dep/include/ace/Handle_Ops.h delete mode 100644 dep/include/ace/Handle_Set.h delete mode 100644 dep/include/ace/Handle_Set.inl delete mode 100644 dep/include/ace/Hash_Cache_Map_Manager_T.h delete mode 100644 dep/include/ace/Hash_Cache_Map_Manager_T.inl delete mode 100644 dep/include/ace/Hash_Map_Manager.h delete mode 100644 dep/include/ace/Hash_Map_Manager_T.h delete mode 100644 dep/include/ace/Hash_Map_Manager_T.inl delete mode 100644 dep/include/ace/Hash_Map_With_Allocator_T.h delete mode 100644 dep/include/ace/Hash_Map_With_Allocator_T.inl delete mode 100644 dep/include/ace/Hash_Multi_Map_Manager_T.h delete mode 100644 dep/include/ace/Hash_Multi_Map_Manager_T.inl delete mode 100644 dep/include/ace/Hashable.h delete mode 100644 dep/include/ace/Hashable.inl delete mode 100644 dep/include/ace/High_Res_Timer.h delete mode 100644 dep/include/ace/High_Res_Timer.inl delete mode 100644 dep/include/ace/ICMP_Socket.h delete mode 100644 dep/include/ace/INET_Addr.h delete mode 100644 dep/include/ace/INET_Addr.inl delete mode 100644 dep/include/ace/IOStream.h delete mode 100644 dep/include/ace/IOStream_T.h delete mode 100644 dep/include/ace/IOStream_T.inl delete mode 100644 dep/include/ace/IO_Cntl_Msg.h delete mode 100644 dep/include/ace/IO_Cntl_Msg.inl delete mode 100644 dep/include/ace/IO_SAP.h delete mode 100644 dep/include/ace/IO_SAP.inl delete mode 100644 dep/include/ace/IPC_SAP.h delete mode 100644 dep/include/ace/IPC_SAP.inl delete mode 100644 dep/include/ace/If_Then_Else.h delete mode 100644 dep/include/ace/Init_ACE.h delete mode 100644 dep/include/ace/Intrusive_Auto_Ptr.h delete mode 100644 dep/include/ace/Intrusive_Auto_Ptr.inl delete mode 100644 dep/include/ace/Intrusive_List.h delete mode 100644 dep/include/ace/Intrusive_List.inl delete mode 100644 dep/include/ace/Intrusive_List_Node.h delete mode 100644 dep/include/ace/Intrusive_List_Node.inl delete mode 100644 dep/include/ace/LOCK_SOCK_Acceptor.h delete mode 100644 dep/include/ace/LSOCK.h delete mode 100644 dep/include/ace/LSOCK.inl delete mode 100644 dep/include/ace/LSOCK_Acceptor.h delete mode 100644 dep/include/ace/LSOCK_CODgram.h delete mode 100644 dep/include/ace/LSOCK_CODgram.inl delete mode 100644 dep/include/ace/LSOCK_Connector.h delete mode 100644 dep/include/ace/LSOCK_Connector.inl delete mode 100644 dep/include/ace/LSOCK_Dgram.h delete mode 100644 dep/include/ace/LSOCK_Dgram.inl delete mode 100644 dep/include/ace/LSOCK_Stream.h delete mode 100644 dep/include/ace/LSOCK_Stream.inl delete mode 100644 dep/include/ace/Lib_Find.h delete mode 100644 dep/include/ace/Local_Memory_Pool.h delete mode 100644 dep/include/ace/Local_Name_Space.h delete mode 100644 dep/include/ace/Local_Name_Space_T.h delete mode 100644 dep/include/ace/Local_Tokens.h delete mode 100644 dep/include/ace/Local_Tokens.inl delete mode 100644 dep/include/ace/Lock.h delete mode 100644 dep/include/ace/Lock.inl delete mode 100644 dep/include/ace/Lock_Adapter_T.h delete mode 100644 dep/include/ace/Lock_Adapter_T.inl delete mode 100644 dep/include/ace/Log_Msg.h delete mode 100644 dep/include/ace/Log_Msg.inl delete mode 100644 dep/include/ace/Log_Msg_Backend.h delete mode 100644 dep/include/ace/Log_Msg_Callback.h delete mode 100644 dep/include/ace/Log_Msg_IPC.h delete mode 100644 dep/include/ace/Log_Msg_NT_Event_Log.h delete mode 100644 dep/include/ace/Log_Msg_UNIX_Syslog.h delete mode 100644 dep/include/ace/Log_Priority.h delete mode 100644 dep/include/ace/Log_Record.h delete mode 100644 dep/include/ace/Log_Record.inl delete mode 100644 dep/include/ace/Logging_Strategy.h delete mode 100644 dep/include/ace/MEM_Acceptor.h delete mode 100644 dep/include/ace/MEM_Acceptor.inl delete mode 100644 dep/include/ace/MEM_Addr.h delete mode 100644 dep/include/ace/MEM_Addr.inl delete mode 100644 dep/include/ace/MEM_Connector.h delete mode 100644 dep/include/ace/MEM_Connector.inl delete mode 100644 dep/include/ace/MEM_IO.h delete mode 100644 dep/include/ace/MEM_IO.inl delete mode 100644 dep/include/ace/MEM_SAP.h delete mode 100644 dep/include/ace/MEM_SAP.inl delete mode 100644 dep/include/ace/MEM_Stream.h delete mode 100644 dep/include/ace/MEM_Stream.inl delete mode 100644 dep/include/ace/MMAP_Memory_Pool.h delete mode 100644 dep/include/ace/MMAP_Memory_Pool.inl delete mode 100644 dep/include/ace/Malloc.h delete mode 100644 dep/include/ace/Malloc.inl delete mode 100644 dep/include/ace/Malloc_Allocator.h delete mode 100644 dep/include/ace/Malloc_Allocator.inl delete mode 100644 dep/include/ace/Malloc_Base.h delete mode 100644 dep/include/ace/Malloc_T.h delete mode 100644 dep/include/ace/Malloc_T.inl delete mode 100644 dep/include/ace/Managed_Object.h delete mode 100644 dep/include/ace/Managed_Object.inl delete mode 100644 dep/include/ace/Manual_Event.h delete mode 100644 dep/include/ace/Manual_Event.inl delete mode 100644 dep/include/ace/Map.h delete mode 100644 dep/include/ace/Map_Manager.h delete mode 100644 dep/include/ace/Map_Manager.inl delete mode 100644 dep/include/ace/Map_T.h delete mode 100644 dep/include/ace/Map_T.inl delete mode 100644 dep/include/ace/Mem_Map.h delete mode 100644 dep/include/ace/Mem_Map.inl delete mode 100644 dep/include/ace/Memory_Pool.h delete mode 100644 dep/include/ace/Message_Block.h delete mode 100644 dep/include/ace/Message_Block.inl delete mode 100644 dep/include/ace/Message_Block_T.h delete mode 100644 dep/include/ace/Message_Block_T.inl delete mode 100644 dep/include/ace/Message_Queue.h delete mode 100644 dep/include/ace/Message_Queue.inl delete mode 100644 dep/include/ace/Message_Queue_NT.h delete mode 100644 dep/include/ace/Message_Queue_NT.inl delete mode 100644 dep/include/ace/Message_Queue_T.h delete mode 100644 dep/include/ace/Message_Queue_Vx.h delete mode 100644 dep/include/ace/Message_Queue_Vx.inl delete mode 100644 dep/include/ace/Method_Object.h delete mode 100644 dep/include/ace/Method_Request.h delete mode 100644 dep/include/ace/Metrics_Cache.h delete mode 100644 dep/include/ace/Metrics_Cache_T.h delete mode 100644 dep/include/ace/Metrics_Cache_T.inl delete mode 100644 dep/include/ace/Min_Max.h delete mode 100644 dep/include/ace/Module.h delete mode 100644 dep/include/ace/Module.inl delete mode 100644 dep/include/ace/Monitor_Admin.h delete mode 100644 dep/include/ace/Monitor_Admin_Manager.h delete mode 100644 dep/include/ace/Monitor_Base.h delete mode 100644 dep/include/ace/Monitor_Base.inl delete mode 100644 dep/include/ace/Monitor_Control_Action.h delete mode 100644 dep/include/ace/Monitor_Control_Types.h delete mode 100644 dep/include/ace/Monitor_Point_Registry.h delete mode 100644 dep/include/ace/Monitor_Size.h delete mode 100644 dep/include/ace/Msg_WFMO_Reactor.h delete mode 100644 dep/include/ace/Msg_WFMO_Reactor.inl delete mode 100644 dep/include/ace/Multihomed_INET_Addr.h delete mode 100644 dep/include/ace/Multihomed_INET_Addr.inl delete mode 100644 dep/include/ace/Mutex.h delete mode 100644 dep/include/ace/Mutex.inl delete mode 100644 dep/include/ace/NT_Service.h delete mode 100644 dep/include/ace/NT_Service.inl delete mode 100644 dep/include/ace/Name_Proxy.h delete mode 100644 dep/include/ace/Name_Request_Reply.h delete mode 100644 dep/include/ace/Name_Space.h delete mode 100644 dep/include/ace/Naming_Context.h delete mode 100644 dep/include/ace/Naming_Context.inl delete mode 100644 dep/include/ace/Netlink_Addr.h delete mode 100644 dep/include/ace/Netlink_Addr.inl delete mode 100644 dep/include/ace/Node.h delete mode 100644 dep/include/ace/Notification_Queue.h delete mode 100644 dep/include/ace/Notification_Queue.inl delete mode 100644 dep/include/ace/Notification_Strategy.h delete mode 100644 dep/include/ace/Notification_Strategy.inl delete mode 100644 dep/include/ace/Null_Barrier.h delete mode 100644 dep/include/ace/Null_Condition.h delete mode 100644 dep/include/ace/Null_Mutex.h delete mode 100644 dep/include/ace/Null_Semaphore.h delete mode 100644 dep/include/ace/Numeric_Limits.h delete mode 100644 dep/include/ace/OS.h delete mode 100644 dep/include/ace/OS.inl delete mode 100644 dep/include/ace/OS_Dirent.h delete mode 100644 dep/include/ace/OS_Errno.h delete mode 100644 dep/include/ace/OS_Errno.inl delete mode 100644 dep/include/ace/OS_Log_Msg_Attributes.h delete mode 100644 dep/include/ace/OS_Log_Msg_Attributes.inl delete mode 100644 dep/include/ace/OS_Memory.h delete mode 100644 dep/include/ace/OS_NS_Thread.h delete mode 100644 dep/include/ace/OS_NS_Thread.inl delete mode 100644 dep/include/ace/OS_NS_arpa_inet.h delete mode 100644 dep/include/ace/OS_NS_arpa_inet.inl delete mode 100644 dep/include/ace/OS_NS_ctype.h delete mode 100644 dep/include/ace/OS_NS_ctype.inl delete mode 100644 dep/include/ace/OS_NS_dirent.h delete mode 100644 dep/include/ace/OS_NS_dirent.inl delete mode 100644 dep/include/ace/OS_NS_dlfcn.h delete mode 100644 dep/include/ace/OS_NS_dlfcn.inl delete mode 100644 dep/include/ace/OS_NS_errno.h delete mode 100644 dep/include/ace/OS_NS_errno.inl delete mode 100644 dep/include/ace/OS_NS_fcntl.h delete mode 100644 dep/include/ace/OS_NS_fcntl.inl delete mode 100644 dep/include/ace/OS_NS_macros.h delete mode 100644 dep/include/ace/OS_NS_math.h delete mode 100644 dep/include/ace/OS_NS_math.inl delete mode 100644 dep/include/ace/OS_NS_netdb.h delete mode 100644 dep/include/ace/OS_NS_netdb.inl delete mode 100644 dep/include/ace/OS_NS_poll.h delete mode 100644 dep/include/ace/OS_NS_poll.inl delete mode 100644 dep/include/ace/OS_NS_pwd.h delete mode 100644 dep/include/ace/OS_NS_pwd.inl delete mode 100644 dep/include/ace/OS_NS_regex.h delete mode 100644 dep/include/ace/OS_NS_regex.inl delete mode 100644 dep/include/ace/OS_NS_signal.h delete mode 100644 dep/include/ace/OS_NS_signal.inl delete mode 100644 dep/include/ace/OS_NS_stdio.h delete mode 100644 dep/include/ace/OS_NS_stdio.inl delete mode 100644 dep/include/ace/OS_NS_stdlib.h delete mode 100644 dep/include/ace/OS_NS_stdlib.inl delete mode 100644 dep/include/ace/OS_NS_string.h delete mode 100644 dep/include/ace/OS_NS_string.inl delete mode 100644 dep/include/ace/OS_NS_strings.h delete mode 100644 dep/include/ace/OS_NS_strings.inl delete mode 100644 dep/include/ace/OS_NS_stropts.h delete mode 100644 dep/include/ace/OS_NS_stropts.inl delete mode 100644 dep/include/ace/OS_NS_sys_mman.h delete mode 100644 dep/include/ace/OS_NS_sys_mman.inl delete mode 100644 dep/include/ace/OS_NS_sys_msg.h delete mode 100644 dep/include/ace/OS_NS_sys_msg.inl delete mode 100644 dep/include/ace/OS_NS_sys_resource.h delete mode 100644 dep/include/ace/OS_NS_sys_resource.inl delete mode 100644 dep/include/ace/OS_NS_sys_select.h delete mode 100644 dep/include/ace/OS_NS_sys_select.inl delete mode 100644 dep/include/ace/OS_NS_sys_sendfile.h delete mode 100644 dep/include/ace/OS_NS_sys_sendfile.inl delete mode 100644 dep/include/ace/OS_NS_sys_shm.h delete mode 100644 dep/include/ace/OS_NS_sys_shm.inl delete mode 100644 dep/include/ace/OS_NS_sys_socket.h delete mode 100644 dep/include/ace/OS_NS_sys_socket.inl delete mode 100644 dep/include/ace/OS_NS_sys_stat.h delete mode 100644 dep/include/ace/OS_NS_sys_stat.inl delete mode 100644 dep/include/ace/OS_NS_sys_time.h delete mode 100644 dep/include/ace/OS_NS_sys_time.inl delete mode 100644 dep/include/ace/OS_NS_sys_uio.h delete mode 100644 dep/include/ace/OS_NS_sys_uio.inl delete mode 100644 dep/include/ace/OS_NS_sys_utsname.h delete mode 100644 dep/include/ace/OS_NS_sys_wait.h delete mode 100644 dep/include/ace/OS_NS_sys_wait.inl delete mode 100644 dep/include/ace/OS_NS_time.h delete mode 100644 dep/include/ace/OS_NS_time.inl delete mode 100644 dep/include/ace/OS_NS_unistd.h delete mode 100644 dep/include/ace/OS_NS_unistd.inl delete mode 100644 dep/include/ace/OS_NS_wchar.h delete mode 100644 dep/include/ace/OS_NS_wchar.inl delete mode 100644 dep/include/ace/OS_QoS.h delete mode 100644 dep/include/ace/OS_String.h delete mode 100644 dep/include/ace/OS_TLI.h delete mode 100644 dep/include/ace/OS_TLI.inl delete mode 100644 dep/include/ace/OS_Thread_Adapter.h delete mode 100644 dep/include/ace/OS_main.h delete mode 100644 dep/include/ace/Obchunk.h delete mode 100644 dep/include/ace/Obchunk.inl delete mode 100644 dep/include/ace/Object_Manager.h delete mode 100644 dep/include/ace/Object_Manager.inl delete mode 100644 dep/include/ace/Object_Manager_Base.h delete mode 100644 dep/include/ace/Obstack.h delete mode 100644 dep/include/ace/Obstack_T.h delete mode 100644 dep/include/ace/Obstack_T.inl delete mode 100644 dep/include/ace/PI_Malloc.h delete mode 100644 dep/include/ace/PI_Malloc.inl delete mode 100644 dep/include/ace/POSIX_Asynch_IO.h delete mode 100644 dep/include/ace/POSIX_CB_Proactor.h delete mode 100644 dep/include/ace/POSIX_Proactor.h delete mode 100644 dep/include/ace/POSIX_Proactor.inl delete mode 100644 dep/include/ace/Pagefile_Memory_Pool.h delete mode 100644 dep/include/ace/Pagefile_Memory_Pool.inl delete mode 100644 dep/include/ace/Pair.h delete mode 100644 dep/include/ace/Pair_T.h delete mode 100644 dep/include/ace/Pair_T.inl delete mode 100644 dep/include/ace/Parse_Node.h delete mode 100644 dep/include/ace/Ping_Socket.h delete mode 100644 dep/include/ace/Ping_Socket.inl delete mode 100644 dep/include/ace/Pipe.h delete mode 100644 dep/include/ace/Pipe.inl delete mode 100644 dep/include/ace/Priority_Reactor.h delete mode 100644 dep/include/ace/Proactor.h delete mode 100644 dep/include/ace/Proactor.inl delete mode 100644 dep/include/ace/Proactor_Impl.h delete mode 100644 dep/include/ace/Process.h delete mode 100644 dep/include/ace/Process.inl delete mode 100644 dep/include/ace/Process_Manager.h delete mode 100644 dep/include/ace/Process_Manager.inl delete mode 100644 dep/include/ace/Process_Mutex.h delete mode 100644 dep/include/ace/Process_Mutex.inl delete mode 100644 dep/include/ace/Process_Semaphore.h delete mode 100644 dep/include/ace/Process_Semaphore.inl delete mode 100644 dep/include/ace/Profile_Timer.h delete mode 100644 dep/include/ace/Profile_Timer.inl delete mode 100644 dep/include/ace/RB_Tree.h delete mode 100644 dep/include/ace/RB_Tree.inl delete mode 100644 dep/include/ace/RW_Mutex.h delete mode 100644 dep/include/ace/RW_Mutex.inl delete mode 100644 dep/include/ace/RW_Process_Mutex.h delete mode 100644 dep/include/ace/RW_Process_Mutex.inl delete mode 100644 dep/include/ace/RW_Thread_Mutex.h delete mode 100644 dep/include/ace/RW_Thread_Mutex.inl delete mode 100644 dep/include/ace/Reactor.h delete mode 100644 dep/include/ace/Reactor.inl delete mode 100644 dep/include/ace/Reactor_Impl.h delete mode 100644 dep/include/ace/Reactor_Notification_Strategy.h delete mode 100644 dep/include/ace/Reactor_Notification_Strategy.inl delete mode 100644 dep/include/ace/Reactor_Timer_Interface.h delete mode 100644 dep/include/ace/Reactor_Token_T.h delete mode 100644 dep/include/ace/Read_Buffer.h delete mode 100644 dep/include/ace/Read_Buffer.inl delete mode 100644 dep/include/ace/Recursive_Thread_Mutex.h delete mode 100644 dep/include/ace/Recursive_Thread_Mutex.inl delete mode 100644 dep/include/ace/Recyclable.h delete mode 100644 dep/include/ace/Recyclable.inl delete mode 100644 dep/include/ace/Refcountable.h delete mode 100644 dep/include/ace/Refcountable_T.h delete mode 100644 dep/include/ace/Refcountable_T.inl delete mode 100644 dep/include/ace/Refcounted_Auto_Ptr.h delete mode 100644 dep/include/ace/Refcounted_Auto_Ptr.inl delete mode 100644 dep/include/ace/Registry.h delete mode 100644 dep/include/ace/Registry_Name_Space.h delete mode 100644 dep/include/ace/Remote_Name_Space.h delete mode 100644 dep/include/ace/Remote_Tokens.h delete mode 100644 dep/include/ace/Remote_Tokens.inl delete mode 100644 dep/include/ace/Reverse_Lock_T.h delete mode 100644 dep/include/ace/Reverse_Lock_T.inl delete mode 100644 dep/include/ace/SOCK.h delete mode 100644 dep/include/ace/SOCK.inl delete mode 100644 dep/include/ace/SOCK_Acceptor.h delete mode 100644 dep/include/ace/SOCK_Acceptor.inl delete mode 100644 dep/include/ace/SOCK_CODgram.h delete mode 100644 dep/include/ace/SOCK_CODgram.inl delete mode 100644 dep/include/ace/SOCK_Connector.h delete mode 100644 dep/include/ace/SOCK_Connector.inl delete mode 100644 dep/include/ace/SOCK_Dgram.h delete mode 100644 dep/include/ace/SOCK_Dgram.inl delete mode 100644 dep/include/ace/SOCK_Dgram_Bcast.h delete mode 100644 dep/include/ace/SOCK_Dgram_Bcast.inl delete mode 100644 dep/include/ace/SOCK_Dgram_Mcast.h delete mode 100644 dep/include/ace/SOCK_Dgram_Mcast.inl delete mode 100644 dep/include/ace/SOCK_IO.h delete mode 100644 dep/include/ace/SOCK_IO.inl delete mode 100644 dep/include/ace/SOCK_Netlink.h delete mode 100644 dep/include/ace/SOCK_Netlink.inl delete mode 100644 dep/include/ace/SOCK_SEQPACK_Acceptor.h delete mode 100644 dep/include/ace/SOCK_SEQPACK_Acceptor.inl delete mode 100644 dep/include/ace/SOCK_SEQPACK_Association.h delete mode 100644 dep/include/ace/SOCK_SEQPACK_Association.inl delete mode 100644 dep/include/ace/SOCK_SEQPACK_Connector.h delete mode 100644 dep/include/ace/SOCK_SEQPACK_Connector.inl delete mode 100644 dep/include/ace/SOCK_Stream.h delete mode 100644 dep/include/ace/SOCK_Stream.inl delete mode 100644 dep/include/ace/SPIPE.h delete mode 100644 dep/include/ace/SPIPE.inl delete mode 100644 dep/include/ace/SPIPE_Acceptor.h delete mode 100644 dep/include/ace/SPIPE_Addr.h delete mode 100644 dep/include/ace/SPIPE_Addr.inl delete mode 100644 dep/include/ace/SPIPE_Connector.h delete mode 100644 dep/include/ace/SPIPE_Connector.inl delete mode 100644 dep/include/ace/SPIPE_Stream.h delete mode 100644 dep/include/ace/SPIPE_Stream.inl delete mode 100644 dep/include/ace/SSL/SSL_Asynch_BIO.h delete mode 100644 dep/include/ace/SSL/SSL_Asynch_Stream.h delete mode 100644 dep/include/ace/SSL/SSL_Context.h delete mode 100644 dep/include/ace/SSL/SSL_Context.inl delete mode 100644 dep/include/ace/SSL/SSL_Export.h delete mode 100644 dep/include/ace/SSL/SSL_SOCK.h delete mode 100644 dep/include/ace/SSL/SSL_SOCK.inl delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Acceptor.h delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Acceptor.inl delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Connector.h delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Connector.inl delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Stream.h delete mode 100644 dep/include/ace/SSL/SSL_SOCK_Stream.inl delete mode 100644 dep/include/ace/SSL/sslconf.h delete mode 100644 dep/include/ace/SString.h delete mode 100644 dep/include/ace/SString.inl delete mode 100644 dep/include/ace/SStringfwd.h delete mode 100644 dep/include/ace/SUN_Proactor.h delete mode 100644 dep/include/ace/SV_Message.h delete mode 100644 dep/include/ace/SV_Message.inl delete mode 100644 dep/include/ace/SV_Message_Queue.h delete mode 100644 dep/include/ace/SV_Message_Queue.inl delete mode 100644 dep/include/ace/SV_Semaphore_Complex.h delete mode 100644 dep/include/ace/SV_Semaphore_Complex.inl delete mode 100644 dep/include/ace/SV_Semaphore_Simple.h delete mode 100644 dep/include/ace/SV_Semaphore_Simple.inl delete mode 100644 dep/include/ace/SV_Shared_Memory.h delete mode 100644 dep/include/ace/SV_Shared_Memory.inl delete mode 100644 dep/include/ace/Sample_History.h delete mode 100644 dep/include/ace/Sample_History.inl delete mode 100644 dep/include/ace/Sbrk_Memory_Pool.h delete mode 100644 dep/include/ace/Sched_Params.h delete mode 100644 dep/include/ace/Sched_Params.inl delete mode 100644 dep/include/ace/Select_Reactor.h delete mode 100644 dep/include/ace/Select_Reactor_Base.h delete mode 100644 dep/include/ace/Select_Reactor_Base.inl delete mode 100644 dep/include/ace/Select_Reactor_T.h delete mode 100644 dep/include/ace/Select_Reactor_T.inl delete mode 100644 dep/include/ace/Semaphore.h delete mode 100644 dep/include/ace/Semaphore.inl delete mode 100644 dep/include/ace/Service_Config.h delete mode 100644 dep/include/ace/Service_Config.inl delete mode 100644 dep/include/ace/Service_Gestalt.h delete mode 100644 dep/include/ace/Service_Gestalt.inl delete mode 100644 dep/include/ace/Service_Manager.h delete mode 100644 dep/include/ace/Service_Object.h delete mode 100644 dep/include/ace/Service_Object.inl delete mode 100644 dep/include/ace/Service_Repository.h delete mode 100644 dep/include/ace/Service_Repository.inl delete mode 100644 dep/include/ace/Service_Templates.h delete mode 100644 dep/include/ace/Service_Types.h delete mode 100644 dep/include/ace/Service_Types.inl delete mode 100644 dep/include/ace/Shared_Memory.h delete mode 100644 dep/include/ace/Shared_Memory_MM.h delete mode 100644 dep/include/ace/Shared_Memory_MM.inl delete mode 100644 dep/include/ace/Shared_Memory_Pool.h delete mode 100644 dep/include/ace/Shared_Memory_SV.h delete mode 100644 dep/include/ace/Shared_Memory_SV.inl delete mode 100644 dep/include/ace/Shared_Object.h delete mode 100644 dep/include/ace/Shared_Object.inl delete mode 100644 dep/include/ace/Sig_Adapter.h delete mode 100644 dep/include/ace/Sig_Handler.h delete mode 100644 dep/include/ace/Sig_Handler.inl delete mode 100644 dep/include/ace/Signal.h delete mode 100644 dep/include/ace/Signal.inl delete mode 100644 dep/include/ace/Singleton.h delete mode 100644 dep/include/ace/Singleton.inl delete mode 100644 dep/include/ace/Sock_Connect.h delete mode 100644 dep/include/ace/Stack_Trace.h delete mode 100644 dep/include/ace/Static_Object_Lock.h delete mode 100644 dep/include/ace/Stats.h delete mode 100644 dep/include/ace/Stats.inl delete mode 100644 dep/include/ace/Strategies.h delete mode 100644 dep/include/ace/Strategies_T.h delete mode 100644 dep/include/ace/Strategies_T.inl delete mode 100644 dep/include/ace/Stream.h delete mode 100644 dep/include/ace/Stream.inl delete mode 100644 dep/include/ace/Stream_Modules.h delete mode 100644 dep/include/ace/String_Base.h delete mode 100644 dep/include/ace/String_Base.inl delete mode 100644 dep/include/ace/String_Base_Const.h delete mode 100644 dep/include/ace/Svc_Conf.h delete mode 100644 dep/include/ace/Svc_Conf_Lexer.h delete mode 100644 dep/include/ace/Svc_Conf_Param.h delete mode 100644 dep/include/ace/Svc_Conf_Token_Table.h delete mode 100644 dep/include/ace/Svc_Conf_Tokens.h delete mode 100644 dep/include/ace/Svc_Handler.h delete mode 100644 dep/include/ace/Synch.h delete mode 100644 dep/include/ace/Synch_Options.h delete mode 100644 dep/include/ace/Synch_T.h delete mode 100644 dep/include/ace/Synch_Traits.h delete mode 100644 dep/include/ace/System_Time.h delete mode 100644 dep/include/ace/TLI.h delete mode 100644 dep/include/ace/TLI.inl delete mode 100644 dep/include/ace/TLI_Acceptor.h delete mode 100644 dep/include/ace/TLI_Connector.h delete mode 100644 dep/include/ace/TLI_Connector.inl delete mode 100644 dep/include/ace/TLI_Stream.h delete mode 100644 dep/include/ace/TLI_Stream.inl delete mode 100644 dep/include/ace/TP_Reactor.h delete mode 100644 dep/include/ace/TP_Reactor.inl delete mode 100644 dep/include/ace/TSS_Adapter.h delete mode 100644 dep/include/ace/TSS_T.h delete mode 100644 dep/include/ace/TSS_T.inl delete mode 100644 dep/include/ace/TTY_IO.h delete mode 100644 dep/include/ace/Task.h delete mode 100644 dep/include/ace/Task.inl delete mode 100644 dep/include/ace/Task_Ex_T.h delete mode 100644 dep/include/ace/Task_Ex_T.inl delete mode 100644 dep/include/ace/Task_T.h delete mode 100644 dep/include/ace/Task_T.inl delete mode 100644 dep/include/ace/Test_and_Set.h delete mode 100644 dep/include/ace/Thread.h delete mode 100644 dep/include/ace/Thread.inl delete mode 100644 dep/include/ace/Thread_Adapter.h delete mode 100644 dep/include/ace/Thread_Adapter.inl delete mode 100644 dep/include/ace/Thread_Control.h delete mode 100644 dep/include/ace/Thread_Control.inl delete mode 100644 dep/include/ace/Thread_Exit.h delete mode 100644 dep/include/ace/Thread_Hook.h delete mode 100644 dep/include/ace/Thread_Manager.h delete mode 100644 dep/include/ace/Thread_Manager.inl delete mode 100644 dep/include/ace/Thread_Mutex.h delete mode 100644 dep/include/ace/Thread_Mutex.inl delete mode 100644 dep/include/ace/Thread_Semaphore.h delete mode 100644 dep/include/ace/Thread_Semaphore.inl delete mode 100644 dep/include/ace/Throughput_Stats.h delete mode 100644 dep/include/ace/Time_Value.h delete mode 100644 dep/include/ace/Time_Value.inl delete mode 100644 dep/include/ace/Timeprobe.h delete mode 100644 dep/include/ace/Timeprobe.inl delete mode 100644 dep/include/ace/Timeprobe_T.h delete mode 100644 dep/include/ace/Timer_Hash.h delete mode 100644 dep/include/ace/Timer_Hash_T.h delete mode 100644 dep/include/ace/Timer_Heap.h delete mode 100644 dep/include/ace/Timer_Heap_T.h delete mode 100644 dep/include/ace/Timer_List.h delete mode 100644 dep/include/ace/Timer_List_T.h delete mode 100644 dep/include/ace/Timer_Queue.h delete mode 100644 dep/include/ace/Timer_Queue_Adapters.h delete mode 100644 dep/include/ace/Timer_Queue_Adapters.inl delete mode 100644 dep/include/ace/Timer_Queue_T.h delete mode 100644 dep/include/ace/Timer_Queue_T.inl delete mode 100644 dep/include/ace/Timer_Queuefwd.h delete mode 100644 dep/include/ace/Timer_Wheel.h delete mode 100644 dep/include/ace/Timer_Wheel_T.h delete mode 100644 dep/include/ace/Token.h delete mode 100644 dep/include/ace/Token.inl delete mode 100644 dep/include/ace/Token_Collection.h delete mode 100644 dep/include/ace/Token_Collection.inl delete mode 100644 dep/include/ace/Token_Invariants.h delete mode 100644 dep/include/ace/Token_Manager.h delete mode 100644 dep/include/ace/Token_Manager.inl delete mode 100644 dep/include/ace/Token_Request_Reply.h delete mode 100644 dep/include/ace/Token_Request_Reply.inl delete mode 100644 dep/include/ace/Trace.h delete mode 100644 dep/include/ace/Truncate.h delete mode 100644 dep/include/ace/Typed_SV_Message.h delete mode 100644 dep/include/ace/Typed_SV_Message.inl delete mode 100644 dep/include/ace/Typed_SV_Message_Queue.h delete mode 100644 dep/include/ace/Typed_SV_Message_Queue.inl delete mode 100644 dep/include/ace/UNIX_Addr.h delete mode 100644 dep/include/ace/UNIX_Addr.inl delete mode 100644 dep/include/ace/UPIPE_Acceptor.h delete mode 100644 dep/include/ace/UPIPE_Acceptor.inl delete mode 100644 dep/include/ace/UPIPE_Addr.h delete mode 100644 dep/include/ace/UPIPE_Connector.h delete mode 100644 dep/include/ace/UPIPE_Connector.inl delete mode 100644 dep/include/ace/UPIPE_Stream.h delete mode 100644 dep/include/ace/UPIPE_Stream.inl delete mode 100644 dep/include/ace/UTF16_Encoding_Converter.h delete mode 100644 dep/include/ace/UTF16_Encoding_Converter.inl delete mode 100644 dep/include/ace/UTF32_Encoding_Converter.h delete mode 100644 dep/include/ace/UTF8_Encoding_Converter.h delete mode 100644 dep/include/ace/UUID.h delete mode 100644 dep/include/ace/UUID.inl delete mode 100644 dep/include/ace/Unbounded_Queue.h delete mode 100644 dep/include/ace/Unbounded_Queue.inl delete mode 100644 dep/include/ace/Unbounded_Set.h delete mode 100644 dep/include/ace/Unbounded_Set.inl delete mode 100644 dep/include/ace/Unbounded_Set_Ex.h delete mode 100644 dep/include/ace/Unbounded_Set_Ex.inl delete mode 100644 dep/include/ace/Value_Ptr.h delete mode 100644 dep/include/ace/Vector_T.h delete mode 100644 dep/include/ace/Vector_T.inl delete mode 100644 dep/include/ace/Version.h delete mode 100644 dep/include/ace/Versioned_Namespace.h delete mode 100644 dep/include/ace/WFMO_Reactor.h delete mode 100644 dep/include/ace/WFMO_Reactor.inl delete mode 100644 dep/include/ace/WIN32_Asynch_IO.h delete mode 100644 dep/include/ace/WIN32_Proactor.h delete mode 100644 dep/include/ace/XML_Svc_Conf.h delete mode 100644 dep/include/ace/XTI_ATM_Mcast.h delete mode 100644 dep/include/ace/XTI_ATM_Mcast.inl delete mode 100644 dep/include/ace/ace_wchar.h delete mode 100644 dep/include/ace/ace_wchar.inl delete mode 100644 dep/include/ace/checked_iterator.h delete mode 100644 dep/include/ace/config-WinCE.h delete mode 100644 dep/include/ace/config-aix-5.x.h delete mode 100644 dep/include/ace/config-all.h delete mode 100644 dep/include/ace/config-borland-common.h delete mode 100644 dep/include/ace/config-cray.h delete mode 100644 dep/include/ace/config-cxx-common.h delete mode 100644 dep/include/ace/config-cygwin32.h delete mode 100644 dep/include/ace/config-doxygen.h delete mode 100644 dep/include/ace/config-freebsd.h delete mode 100644 dep/include/ace/config-g++-common.h delete mode 100644 dep/include/ace/config-ghs-common.h delete mode 100644 dep/include/ace/config-hpux-11.00.h delete mode 100644 dep/include/ace/config-icc-common.h delete mode 100644 dep/include/ace/config-integritySCA.h delete mode 100644 dep/include/ace/config-irix6.5.x-sgic++.h delete mode 100644 dep/include/ace/config-irix6.x-common.h delete mode 100644 dep/include/ace/config-irix6.x-g++.h delete mode 100644 dep/include/ace/config-irix6.x-sgic++.h delete mode 100644 dep/include/ace/config-linux-common.h delete mode 100644 dep/include/ace/config-linux.h delete mode 100644 dep/include/ace/config-lite.h delete mode 100644 dep/include/ace/config-lynxos.h delete mode 100644 dep/include/ace/config-macosx-leopard.h delete mode 100644 dep/include/ace/config-macosx-panther.h delete mode 100644 dep/include/ace/config-macosx-tiger.h delete mode 100644 dep/include/ace/config-macosx.h delete mode 100644 dep/include/ace/config-macros.h delete mode 100644 dep/include/ace/config-minimal.h delete mode 100644 dep/include/ace/config-mvs.h delete mode 100644 dep/include/ace/config-netbsd.h delete mode 100644 dep/include/ace/config-openbsd.h delete mode 100644 dep/include/ace/config-openvms.h delete mode 100644 dep/include/ace/config-pharlap.h delete mode 100644 dep/include/ace/config-posix-nonetworking.h delete mode 100644 dep/include/ace/config-posix.h delete mode 100644 dep/include/ace/config-qnx-neutrino.h delete mode 100644 dep/include/ace/config-qnx-rtp-62x.h delete mode 100644 dep/include/ace/config-qnx-rtp-common.h delete mode 100644 dep/include/ace/config-qnx-rtp-pre62x.h delete mode 100644 dep/include/ace/config-qnx-rtp.h delete mode 100644 dep/include/ace/config-rtems.h delete mode 100644 dep/include/ace/config-sco-5.0.0-nothread.h delete mode 100644 dep/include/ace/config-sco-5.0.0.h delete mode 100644 dep/include/ace/config-suncc-common.h delete mode 100644 dep/include/ace/config-sunos5.10.h delete mode 100644 dep/include/ace/config-sunos5.11.h delete mode 100644 dep/include/ace/config-sunos5.4-g++.h delete mode 100644 dep/include/ace/config-sunos5.4-sunc++-4.x.h delete mode 100644 dep/include/ace/config-sunos5.5.h delete mode 100644 dep/include/ace/config-sunos5.6.h delete mode 100644 dep/include/ace/config-sunos5.7.h delete mode 100644 dep/include/ace/config-sunos5.8.h delete mode 100644 dep/include/ace/config-sunos5.9.h delete mode 100644 dep/include/ace/config-tandem-nsk-mips-v2.h delete mode 100644 dep/include/ace/config-tandem-nsk-mips-v3.h delete mode 100644 dep/include/ace/config-tandem.h delete mode 100644 dep/include/ace/config-tru64.h delete mode 100644 dep/include/ace/config-unixware-7.1.0.h delete mode 100644 dep/include/ace/config-unixware-7.1.0.udk.h delete mode 100644 dep/include/ace/config-visualage.h delete mode 100644 dep/include/ace/config-vxworks.h delete mode 100644 dep/include/ace/config-vxworks5.x.h delete mode 100644 dep/include/ace/config-vxworks6.2.h delete mode 100644 dep/include/ace/config-vxworks6.3.h delete mode 100644 dep/include/ace/config-vxworks6.4.h delete mode 100644 dep/include/ace/config-vxworks6.5.h delete mode 100644 dep/include/ace/config-vxworks6.6.h delete mode 100644 dep/include/ace/config-win32-borland.h delete mode 100644 dep/include/ace/config-win32-common.h delete mode 100644 dep/include/ace/config-win32-dmc.h delete mode 100644 dep/include/ace/config-win32-ghs.h delete mode 100644 dep/include/ace/config-win32-interix.h delete mode 100644 dep/include/ace/config-win32-mingw.h delete mode 100644 dep/include/ace/config-win32-msvc-7.h delete mode 100644 dep/include/ace/config-win32-msvc-8.h delete mode 100644 dep/include/ace/config-win32-msvc-9.h delete mode 100644 dep/include/ace/config-win32-msvc.h delete mode 100644 dep/include/ace/config-win32.h delete mode 100644 dep/include/ace/iosfwd.h delete mode 100644 dep/include/ace/os_include/arpa/os_inet.h delete mode 100644 dep/include/ace/os_include/net/os_if.h delete mode 100644 dep/include/ace/os_include/netinet/os_in.h delete mode 100644 dep/include/ace/os_include/netinet/os_tcp.h delete mode 100644 dep/include/ace/os_include/os_aio.h delete mode 100644 dep/include/ace/os_include/os_assert.h delete mode 100644 dep/include/ace/os_include/os_byteswap.h delete mode 100644 dep/include/ace/os_include/os_complex.h delete mode 100644 dep/include/ace/os_include/os_cpio.h delete mode 100644 dep/include/ace/os_include/os_ctype.h delete mode 100644 dep/include/ace/os_include/os_dirent.h delete mode 100644 dep/include/ace/os_include/os_dlfcn.h delete mode 100644 dep/include/ace/os_include/os_errno.h delete mode 100644 dep/include/ace/os_include/os_fcntl.h delete mode 100644 dep/include/ace/os_include/os_fenv.h delete mode 100644 dep/include/ace/os_include/os_float.h delete mode 100644 dep/include/ace/os_include/os_fmtmsg.h delete mode 100644 dep/include/ace/os_include/os_fnmatch.h delete mode 100644 dep/include/ace/os_include/os_ftw.h delete mode 100644 dep/include/ace/os_include/os_glob.h delete mode 100644 dep/include/ace/os_include/os_grp.h delete mode 100644 dep/include/ace/os_include/os_iconv.h delete mode 100644 dep/include/ace/os_include/os_intrin.h delete mode 100644 dep/include/ace/os_include/os_inttypes.h delete mode 100644 dep/include/ace/os_include/os_iso646.h delete mode 100644 dep/include/ace/os_include/os_kstat.h delete mode 100644 dep/include/ace/os_include/os_langinfo.h delete mode 100644 dep/include/ace/os_include/os_libgen.h delete mode 100644 dep/include/ace/os_include/os_limits.h delete mode 100644 dep/include/ace/os_include/os_local.h delete mode 100644 dep/include/ace/os_include/os_math.h delete mode 100644 dep/include/ace/os_include/os_monetary.h delete mode 100644 dep/include/ace/os_include/os_mqueue.h delete mode 100644 dep/include/ace/os_include/os_ndbm.h delete mode 100644 dep/include/ace/os_include/os_netdb.h delete mode 100644 dep/include/ace/os_include/os_nl_types.h delete mode 100644 dep/include/ace/os_include/os_pdh.h delete mode 100644 dep/include/ace/os_include/os_pdhmsg.h delete mode 100644 dep/include/ace/os_include/os_poll.h delete mode 100644 dep/include/ace/os_include/os_pthread.h delete mode 100644 dep/include/ace/os_include/os_pwd.h delete mode 100644 dep/include/ace/os_include/os_regex.h delete mode 100644 dep/include/ace/os_include/os_sched.h delete mode 100644 dep/include/ace/os_include/os_search.h delete mode 100644 dep/include/ace/os_include/os_semaphore.h delete mode 100644 dep/include/ace/os_include/os_setjmp.h delete mode 100644 dep/include/ace/os_include/os_signal.h delete mode 100644 dep/include/ace/os_include/os_spawn.h delete mode 100644 dep/include/ace/os_include/os_stdarg.h delete mode 100644 dep/include/ace/os_include/os_stdbool.h delete mode 100644 dep/include/ace/os_include/os_stddef.h delete mode 100644 dep/include/ace/os_include/os_stdint.h delete mode 100644 dep/include/ace/os_include/os_stdio.h delete mode 100644 dep/include/ace/os_include/os_stdlib.h delete mode 100644 dep/include/ace/os_include/os_string.h delete mode 100644 dep/include/ace/os_include/os_strings.h delete mode 100644 dep/include/ace/os_include/os_stropts.h delete mode 100644 dep/include/ace/os_include/os_syslog.h delete mode 100644 dep/include/ace/os_include/os_tar.h delete mode 100644 dep/include/ace/os_include/os_termios.h delete mode 100644 dep/include/ace/os_include/os_tgmath.h delete mode 100644 dep/include/ace/os_include/os_time.h delete mode 100644 dep/include/ace/os_include/os_trace.h delete mode 100644 dep/include/ace/os_include/os_ucontext.h delete mode 100644 dep/include/ace/os_include/os_ulimit.h delete mode 100644 dep/include/ace/os_include/os_unistd.h delete mode 100644 dep/include/ace/os_include/os_utime.h delete mode 100644 dep/include/ace/os_include/os_utmpx.h delete mode 100644 dep/include/ace/os_include/os_wchar.h delete mode 100644 dep/include/ace/os_include/os_wctype.h delete mode 100644 dep/include/ace/os_include/os_wordexp.h delete mode 100644 dep/include/ace/os_include/sys/os_ipc.h delete mode 100644 dep/include/ace/os_include/sys/os_loadavg.h delete mode 100644 dep/include/ace/os_include/sys/os_mman.h delete mode 100644 dep/include/ace/os_include/sys/os_msg.h delete mode 100644 dep/include/ace/os_include/sys/os_pstat.h delete mode 100644 dep/include/ace/os_include/sys/os_resource.h delete mode 100644 dep/include/ace/os_include/sys/os_select.h delete mode 100644 dep/include/ace/os_include/sys/os_sem.h delete mode 100644 dep/include/ace/os_include/sys/os_shm.h delete mode 100644 dep/include/ace/os_include/sys/os_socket.h delete mode 100644 dep/include/ace/os_include/sys/os_stat.h delete mode 100644 dep/include/ace/os_include/sys/os_statvfs.h delete mode 100644 dep/include/ace/os_include/sys/os_sysctl.h delete mode 100644 dep/include/ace/os_include/sys/os_sysinfo.h delete mode 100644 dep/include/ace/os_include/sys/os_time.h delete mode 100644 dep/include/ace/os_include/sys/os_timeb.h delete mode 100644 dep/include/ace/os_include/sys/os_times.h delete mode 100644 dep/include/ace/os_include/sys/os_types.h delete mode 100644 dep/include/ace/os_include/sys/os_uio.h delete mode 100644 dep/include/ace/os_include/sys/os_un.h delete mode 100644 dep/include/ace/os_include/sys/os_utsname.h delete mode 100644 dep/include/ace/os_include/sys/os_wait.h delete mode 100644 dep/include/ace/post.h delete mode 100644 dep/include/ace/pre.h delete mode 100644 dep/include/ace/streams.h delete mode 100644 dep/include/ace/svc_export.h delete mode 100644 dep/include/bzip2/bzlib.h delete mode 100644 dep/include/g3dlite/G3D/AABox.h delete mode 100644 dep/include/g3dlite/G3D/Any.h delete mode 100644 dep/include/g3dlite/G3D/AnyVal.h delete mode 100644 dep/include/g3dlite/G3D/AreaMemoryManager.h delete mode 100644 dep/include/g3dlite/G3D/Array.h delete mode 100644 dep/include/g3dlite/G3D/AtomicInt32.h delete mode 100644 dep/include/g3dlite/G3D/BinaryFormat.h delete mode 100644 dep/include/g3dlite/G3D/BinaryInput.h delete mode 100644 dep/include/g3dlite/G3D/BinaryOutput.h delete mode 100644 dep/include/g3dlite/G3D/BoundsTrait.h delete mode 100644 dep/include/g3dlite/G3D/Box.h delete mode 100644 dep/include/g3dlite/G3D/Box2D.h delete mode 100644 dep/include/g3dlite/G3D/BumpMapPreprocess.h delete mode 100644 dep/include/g3dlite/G3D/Capsule.h delete mode 100644 dep/include/g3dlite/G3D/CollisionDetection.h delete mode 100644 dep/include/g3dlite/G3D/Color1.h delete mode 100644 dep/include/g3dlite/G3D/Color1uint8.h delete mode 100644 dep/include/g3dlite/G3D/Color3.h delete mode 100644 dep/include/g3dlite/G3D/Color3uint8.h delete mode 100644 dep/include/g3dlite/G3D/Color4.h delete mode 100644 dep/include/g3dlite/G3D/Color4uint8.h delete mode 100644 dep/include/g3dlite/G3D/Cone.h delete mode 100644 dep/include/g3dlite/G3D/ConvexPolyhedron.h delete mode 100644 dep/include/g3dlite/G3D/CoordinateFrame.h delete mode 100644 dep/include/g3dlite/G3D/Crypto.h delete mode 100644 dep/include/g3dlite/G3D/Cylinder.h delete mode 100644 dep/include/g3dlite/G3D/EqualsTrait.h delete mode 100644 dep/include/g3dlite/G3D/G3D.h delete mode 100644 dep/include/g3dlite/G3D/G3DAll.h delete mode 100644 dep/include/g3dlite/G3D/G3DGameUnits.h delete mode 100644 dep/include/g3dlite/G3D/GCamera.h delete mode 100644 dep/include/g3dlite/G3D/GImage.h delete mode 100644 dep/include/g3dlite/G3D/GLight.h delete mode 100644 dep/include/g3dlite/G3D/GMutex.h delete mode 100644 dep/include/g3dlite/G3D/GThread.h delete mode 100644 dep/include/g3dlite/G3D/GUniqueID.h delete mode 100644 dep/include/g3dlite/G3D/HashTrait.h delete mode 100644 dep/include/g3dlite/G3D/Image1.h delete mode 100644 dep/include/g3dlite/G3D/Image1uint8.h delete mode 100644 dep/include/g3dlite/G3D/Image3.h delete mode 100644 dep/include/g3dlite/G3D/Image3uint8.h delete mode 100644 dep/include/g3dlite/G3D/Image4.h delete mode 100644 dep/include/g3dlite/G3D/Image4uint8.h delete mode 100644 dep/include/g3dlite/G3D/ImageFormat.h delete mode 100644 dep/include/g3dlite/G3D/Intersect.h delete mode 100644 dep/include/g3dlite/G3D/KDTree.h delete mode 100644 dep/include/g3dlite/G3D/Line.h delete mode 100644 dep/include/g3dlite/G3D/LineSegment.h delete mode 100644 dep/include/g3dlite/G3D/Log.h delete mode 100644 dep/include/g3dlite/G3D/Map2D.h delete mode 100644 dep/include/g3dlite/G3D/Matrix.h delete mode 100644 dep/include/g3dlite/G3D/Matrix2.h delete mode 100644 dep/include/g3dlite/G3D/Matrix3.h delete mode 100644 dep/include/g3dlite/G3D/Matrix4.h delete mode 100644 dep/include/g3dlite/G3D/MemoryManager.h delete mode 100644 dep/include/g3dlite/G3D/MeshAlg.h delete mode 100644 dep/include/g3dlite/G3D/MeshBuilder.h delete mode 100644 dep/include/g3dlite/G3D/NetAddress.h delete mode 100644 dep/include/g3dlite/G3D/NetworkDevice.h delete mode 100644 dep/include/g3dlite/G3D/ParseError.h delete mode 100644 dep/include/g3dlite/G3D/PhysicsFrame.h delete mode 100644 dep/include/g3dlite/G3D/Plane.h delete mode 100644 dep/include/g3dlite/G3D/PointHashGrid.h delete mode 100644 dep/include/g3dlite/G3D/PointKDTree.h delete mode 100644 dep/include/g3dlite/G3D/Pointer.h delete mode 100644 dep/include/g3dlite/G3D/PositionTrait.h delete mode 100644 dep/include/g3dlite/G3D/PrecomputedRandom.h delete mode 100644 dep/include/g3dlite/G3D/Quat.h delete mode 100644 dep/include/g3dlite/G3D/Quat.inl delete mode 100644 dep/include/g3dlite/G3D/Queue.h delete mode 100644 dep/include/g3dlite/G3D/Random.h delete mode 100644 dep/include/g3dlite/G3D/Ray.h delete mode 100644 dep/include/g3dlite/G3D/Rect2D.h delete mode 100644 dep/include/g3dlite/G3D/ReferenceCount.h delete mode 100644 dep/include/g3dlite/G3D/RegistryUtil.h delete mode 100644 dep/include/g3dlite/G3D/Set.h delete mode 100644 dep/include/g3dlite/G3D/SmallArray.h delete mode 100644 dep/include/g3dlite/G3D/Sphere.h delete mode 100644 dep/include/g3dlite/G3D/Spline.h delete mode 100644 dep/include/g3dlite/G3D/Stopwatch.h delete mode 100644 dep/include/g3dlite/G3D/System.h delete mode 100644 dep/include/g3dlite/G3D/Table.h delete mode 100644 dep/include/g3dlite/G3D/TextInput.h delete mode 100644 dep/include/g3dlite/G3D/TextOutput.h delete mode 100644 dep/include/g3dlite/G3D/ThreadSet.h delete mode 100644 dep/include/g3dlite/G3D/Triangle.h delete mode 100644 dep/include/g3dlite/G3D/UprightFrame.h delete mode 100644 dep/include/g3dlite/G3D/Vector2.h delete mode 100644 dep/include/g3dlite/G3D/Vector2.inl delete mode 100644 dep/include/g3dlite/G3D/Vector2int16.h delete mode 100644 dep/include/g3dlite/G3D/Vector3.h delete mode 100644 dep/include/g3dlite/G3D/Vector3.inl delete mode 100644 dep/include/g3dlite/G3D/Vector3int16.h delete mode 100644 dep/include/g3dlite/G3D/Vector3int32.h delete mode 100644 dep/include/g3dlite/G3D/Vector4.h delete mode 100644 dep/include/g3dlite/G3D/Vector4.inl delete mode 100644 dep/include/g3dlite/G3D/Vector4int8.h delete mode 100644 dep/include/g3dlite/G3D/WeakCache.h delete mode 100644 dep/include/g3dlite/G3D/Welder.h delete mode 100644 dep/include/g3dlite/G3D/WrapMode.h delete mode 100644 dep/include/g3dlite/G3D/constants.h delete mode 100644 dep/include/g3dlite/G3D/debug.h delete mode 100644 dep/include/g3dlite/G3D/debugAssert.h delete mode 100644 dep/include/g3dlite/G3D/debugPrintf.h delete mode 100644 dep/include/g3dlite/G3D/enumclass.h delete mode 100644 dep/include/g3dlite/G3D/fileutils.h delete mode 100644 dep/include/g3dlite/G3D/filter.h delete mode 100644 dep/include/g3dlite/G3D/format.h delete mode 100644 dep/include/g3dlite/G3D/g3dfnmatch.h delete mode 100644 dep/include/g3dlite/G3D/g3dmath.h delete mode 100644 dep/include/g3dlite/G3D/g3dmath.inl delete mode 100644 dep/include/g3dlite/G3D/platform.h delete mode 100644 dep/include/g3dlite/G3D/prompt.h delete mode 100644 dep/include/g3dlite/G3D/serialize.h delete mode 100644 dep/include/g3dlite/G3D/splinefunc.h delete mode 100644 dep/include/g3dlite/G3D/stringutils.h delete mode 100644 dep/include/g3dlite/G3D/uint128.h delete mode 100644 dep/include/g3dlite/G3D/units.h delete mode 100644 dep/include/g3dlite/G3D/vectorMath.h delete mode 100644 dep/include/jemalloc/internal/arena.h delete mode 100644 dep/include/jemalloc/internal/base.h delete mode 100644 dep/include/jemalloc/internal/chunk.h delete mode 100644 dep/include/jemalloc/internal/chunk_dss.h delete mode 100644 dep/include/jemalloc/internal/chunk_mmap.h delete mode 100644 dep/include/jemalloc/internal/chunk_swap.h delete mode 100644 dep/include/jemalloc/internal/ckh.h delete mode 100644 dep/include/jemalloc/internal/ctl.h delete mode 100644 dep/include/jemalloc/internal/extent.h delete mode 100644 dep/include/jemalloc/internal/hash.h delete mode 100644 dep/include/jemalloc/internal/huge.h delete mode 100644 dep/include/jemalloc/internal/jemalloc_internal.h delete mode 100644 dep/include/jemalloc/internal/jemalloc_internal.h.in delete mode 100644 dep/include/jemalloc/internal/mb.h delete mode 100644 dep/include/jemalloc/internal/mutex.h delete mode 100644 dep/include/jemalloc/internal/prof.h delete mode 100644 dep/include/jemalloc/internal/ql.h delete mode 100644 dep/include/jemalloc/internal/qr.h delete mode 100644 dep/include/jemalloc/internal/rb.h delete mode 100644 dep/include/jemalloc/internal/stats.h delete mode 100644 dep/include/jemalloc/internal/tcache.h delete mode 100644 dep/include/jemalloc/internal/totally_not_p_r_n.h delete mode 100644 dep/include/jemalloc/jemalloc.h delete mode 100644 dep/include/jemalloc/jemalloc.h.in delete mode 100644 dep/include/jemalloc/jemalloc_defs.h delete mode 100644 dep/include/jemalloc/jemalloc_defs.h.in delete mode 100644 dep/include/libmpq/common.h delete mode 100644 dep/include/libmpq/crypt_buf.h delete mode 100644 dep/include/libmpq/explode.h delete mode 100644 dep/include/libmpq/extract.h delete mode 100644 dep/include/libmpq/huffman.h delete mode 100644 dep/include/libmpq/mpq-internal.h delete mode 100644 dep/include/libmpq/mpq.h delete mode 100644 dep/include/libmpq/wave.h delete mode 100644 dep/include/mersennetwister/MersenneTwister.h delete mode 100644 dep/include/mysql/Libmysql.def delete mode 100644 dep/include/mysql/config-netware.h delete mode 100644 dep/include/mysql/config-os2.h delete mode 100644 dep/include/mysql/config-win.h delete mode 100644 dep/include/mysql/errmsg.h delete mode 100644 dep/include/mysql/m_ctype.h delete mode 100644 dep/include/mysql/m_string.h delete mode 100644 dep/include/mysql/my_alloc.h delete mode 100644 dep/include/mysql/my_dbug.h delete mode 100644 dep/include/mysql/my_getopt.h delete mode 100644 dep/include/mysql/my_global.h delete mode 100644 dep/include/mysql/my_list.h delete mode 100644 dep/include/mysql/my_pthread.h delete mode 100644 dep/include/mysql/my_sys.h delete mode 100644 dep/include/mysql/mysql.h delete mode 100644 dep/include/mysql/mysql_com.h delete mode 100644 dep/include/mysql/mysql_embed.h delete mode 100644 dep/include/mysql/mysql_time.h delete mode 100644 dep/include/mysql/mysql_version.h delete mode 100644 dep/include/mysql/mysqld_error.h delete mode 100644 dep/include/mysql/raid.h delete mode 100644 dep/include/mysql/typelib.h delete mode 100644 dep/include/openssl/aes.h delete mode 100644 dep/include/openssl/asn1.h delete mode 100644 dep/include/openssl/asn1_mac.h delete mode 100644 dep/include/openssl/asn1t.h delete mode 100644 dep/include/openssl/bio.h delete mode 100644 dep/include/openssl/blowfish.h delete mode 100644 dep/include/openssl/bn.h delete mode 100644 dep/include/openssl/buffer.h delete mode 100644 dep/include/openssl/cast.h delete mode 100644 dep/include/openssl/comp.h delete mode 100644 dep/include/openssl/conf.h delete mode 100644 dep/include/openssl/conf_api.h delete mode 100644 dep/include/openssl/crypto.h delete mode 100644 dep/include/openssl/des.h delete mode 100644 dep/include/openssl/des_old.h delete mode 100644 dep/include/openssl/dh.h delete mode 100644 dep/include/openssl/dsa.h delete mode 100644 dep/include/openssl/dso.h delete mode 100644 dep/include/openssl/dtls1.h delete mode 100644 dep/include/openssl/e_os2.h delete mode 100644 dep/include/openssl/ebcdic.h delete mode 100644 dep/include/openssl/ec.h delete mode 100644 dep/include/openssl/ecdh.h delete mode 100644 dep/include/openssl/ecdsa.h delete mode 100644 dep/include/openssl/engine.h delete mode 100644 dep/include/openssl/err.h delete mode 100644 dep/include/openssl/evp.h delete mode 100644 dep/include/openssl/hmac.h delete mode 100644 dep/include/openssl/idea.h delete mode 100644 dep/include/openssl/krb5_asn.h delete mode 100644 dep/include/openssl/kssl.h delete mode 100644 dep/include/openssl/lhash.h delete mode 100644 dep/include/openssl/md2.h delete mode 100644 dep/include/openssl/md4.h delete mode 100644 dep/include/openssl/md5.h delete mode 100644 dep/include/openssl/obj_mac.h delete mode 100644 dep/include/openssl/objects.h delete mode 100644 dep/include/openssl/ocsp.h delete mode 100644 dep/include/openssl/opensslconf.h delete mode 100644 dep/include/openssl/opensslv.h delete mode 100644 dep/include/openssl/ossl_typ.h delete mode 100644 dep/include/openssl/pem.h delete mode 100644 dep/include/openssl/pem2.h delete mode 100644 dep/include/openssl/pkcs12.h delete mode 100644 dep/include/openssl/pkcs7.h delete mode 100644 dep/include/openssl/pq_compat.h delete mode 100644 dep/include/openssl/pqueue.h delete mode 100644 dep/include/openssl/rand.h delete mode 100644 dep/include/openssl/rc2.h delete mode 100644 dep/include/openssl/rc4.h delete mode 100644 dep/include/openssl/ripemd.h delete mode 100644 dep/include/openssl/rsa.h delete mode 100644 dep/include/openssl/safestack.h delete mode 100644 dep/include/openssl/sha.h delete mode 100644 dep/include/openssl/ssl.h delete mode 100644 dep/include/openssl/ssl2.h delete mode 100644 dep/include/openssl/ssl23.h delete mode 100644 dep/include/openssl/ssl3.h delete mode 100644 dep/include/openssl/stack.h delete mode 100644 dep/include/openssl/store.h delete mode 100644 dep/include/openssl/symhacks.h delete mode 100644 dep/include/openssl/tls1.h delete mode 100644 dep/include/openssl/tmdiff.h delete mode 100644 dep/include/openssl/txt_db.h delete mode 100644 dep/include/openssl/ui.h delete mode 100644 dep/include/openssl/ui_compat.h delete mode 100644 dep/include/openssl/x509.h delete mode 100644 dep/include/openssl/x509_vfy.h delete mode 100644 dep/include/openssl/x509v3.h delete mode 100644 dep/include/sockets/Base64.h delete mode 100644 dep/include/sockets/Exception.h delete mode 100644 dep/include/sockets/File.h delete mode 100644 dep/include/sockets/IFile.h delete mode 100644 dep/include/sockets/ISocketHandler.h delete mode 100644 dep/include/sockets/Ipv4Address.h delete mode 100644 dep/include/sockets/Ipv6Address.h delete mode 100644 dep/include/sockets/ListenSocket.h delete mode 100644 dep/include/sockets/Lock.h delete mode 100644 dep/include/sockets/Mutex.h delete mode 100644 dep/include/sockets/Parse.h delete mode 100644 dep/include/sockets/ResolvServer.h delete mode 100644 dep/include/sockets/ResolvSocket.h delete mode 100644 dep/include/sockets/SctpSocket.h delete mode 100644 dep/include/sockets/Socket.h delete mode 100644 dep/include/sockets/SocketAddress.h delete mode 100644 dep/include/sockets/SocketHandler.h delete mode 100644 dep/include/sockets/StdLog.h delete mode 100644 dep/include/sockets/StdoutLog.h delete mode 100644 dep/include/sockets/StreamSocket.h delete mode 100644 dep/include/sockets/TcpSocket.h delete mode 100644 dep/include/sockets/Thread.h delete mode 100644 dep/include/sockets/UdpSocket.h delete mode 100644 dep/include/sockets/Utility.h delete mode 100644 dep/include/sockets/socket_include.h delete mode 100644 dep/include/sockets/sockets-config.h delete mode 100644 dep/include/utf8cpp/doc/ReleaseNotes delete mode 100644 dep/include/utf8cpp/doc/utf8cpp.html delete mode 100644 dep/include/utf8cpp/utf8.h delete mode 100644 dep/include/utf8cpp/utf8/checked.h delete mode 100644 dep/include/utf8cpp/utf8/core.h delete mode 100644 dep/include/utf8cpp/utf8/unchecked.h delete mode 100644 dep/include/vld/vld.h delete mode 100644 dep/include/zlib/zconf.h delete mode 100644 dep/include/zlib/zlib.h delete mode 100644 dep/src/CMakeLists.txt delete mode 100644 dep/src/ace/ACE.cpp delete mode 100644 dep/src/ace/ACE_crc32.cpp delete mode 100644 dep/src/ace/ACE_crc_ccitt.cpp delete mode 100644 dep/src/ace/ARGV.cpp delete mode 100644 dep/src/ace/ATM_Acceptor.cpp delete mode 100644 dep/src/ace/ATM_Addr.cpp delete mode 100644 dep/src/ace/ATM_Connector.cpp delete mode 100644 dep/src/ace/ATM_Params.cpp delete mode 100644 dep/src/ace/ATM_QoS.cpp delete mode 100644 dep/src/ace/ATM_Stream.cpp delete mode 100644 dep/src/ace/Acceptor.cpp delete mode 100644 dep/src/ace/Activation_Queue.cpp delete mode 100644 dep/src/ace/Active_Map_Manager.cpp delete mode 100644 dep/src/ace/Active_Map_Manager_T.cpp delete mode 100644 dep/src/ace/Addr.cpp delete mode 100644 dep/src/ace/Arg_Shifter.cpp delete mode 100644 dep/src/ace/Argv_Type_Converter.cpp delete mode 100644 dep/src/ace/Array_Base.cpp delete mode 100644 dep/src/ace/Array_Map.cpp delete mode 100644 dep/src/ace/Assert.cpp delete mode 100644 dep/src/ace/Asynch_Acceptor.cpp delete mode 100644 dep/src/ace/Asynch_Connector.cpp delete mode 100644 dep/src/ace/Asynch_IO.cpp delete mode 100644 dep/src/ace/Asynch_IO_Impl.cpp delete mode 100644 dep/src/ace/Asynch_Pseudo_Task.cpp delete mode 100644 dep/src/ace/Atomic_Op.cpp delete mode 100644 dep/src/ace/Atomic_Op_Sparc.c delete mode 100644 dep/src/ace/Atomic_Op_T.cpp delete mode 100644 dep/src/ace/Auto_Event.cpp delete mode 100644 dep/src/ace/Auto_Functor.cpp delete mode 100644 dep/src/ace/Auto_IncDec_T.cpp delete mode 100644 dep/src/ace/Auto_Ptr.cpp delete mode 100644 dep/src/ace/Barrier.cpp delete mode 100644 dep/src/ace/Base_Thread_Adapter.cpp delete mode 100644 dep/src/ace/Based_Pointer_Repository.cpp delete mode 100644 dep/src/ace/Based_Pointer_T.cpp delete mode 100644 dep/src/ace/Basic_Stats.cpp delete mode 100644 dep/src/ace/Basic_Types.cpp delete mode 100644 dep/src/ace/CDR_Base.cpp delete mode 100644 dep/src/ace/CDR_Size.cpp delete mode 100644 dep/src/ace/CDR_Stream.cpp delete mode 100644 dep/src/ace/CE_Screen_Output.cpp delete mode 100644 dep/src/ace/Cache_Map_Manager_T.cpp delete mode 100644 dep/src/ace/Cached_Connect_Strategy_T.cpp delete mode 100644 dep/src/ace/Caching_Strategies_T.cpp delete mode 100644 dep/src/ace/Caching_Utility_T.cpp delete mode 100644 dep/src/ace/Capabilities.cpp delete mode 100644 dep/src/ace/Cleanup.cpp delete mode 100644 dep/src/ace/Cleanup_Strategies_T.cpp delete mode 100644 dep/src/ace/Codecs.cpp delete mode 100644 dep/src/ace/Codeset_IBM1047.cpp delete mode 100644 dep/src/ace/Codeset_Registry.cpp delete mode 100644 dep/src/ace/Codeset_Registry_db.cpp delete mode 100644 dep/src/ace/Condition_Recursive_Thread_Mutex.cpp delete mode 100644 dep/src/ace/Condition_T.cpp delete mode 100644 dep/src/ace/Condition_Thread_Mutex.cpp delete mode 100644 dep/src/ace/Configuration.cpp delete mode 100644 dep/src/ace/Configuration_Import_Export.cpp delete mode 100644 dep/src/ace/Connection_Recycling_Strategy.cpp delete mode 100644 dep/src/ace/Connector.cpp delete mode 100644 dep/src/ace/Containers.cpp delete mode 100644 dep/src/ace/Containers_T.cpp delete mode 100644 dep/src/ace/Copy_Disabled.cpp delete mode 100644 dep/src/ace/Countdown_Time.cpp delete mode 100644 dep/src/ace/DEV.cpp delete mode 100644 dep/src/ace/DEV_Addr.cpp delete mode 100644 dep/src/ace/DEV_Connector.cpp delete mode 100644 dep/src/ace/DEV_IO.cpp delete mode 100644 dep/src/ace/DLL.cpp delete mode 100644 dep/src/ace/DLL_Manager.cpp delete mode 100644 dep/src/ace/Date_Time.cpp delete mode 100644 dep/src/ace/Dev_Poll_Reactor.cpp delete mode 100644 dep/src/ace/Dirent.cpp delete mode 100644 dep/src/ace/Dirent_Selector.cpp delete mode 100644 dep/src/ace/Dump.cpp delete mode 100644 dep/src/ace/Dump_T.cpp delete mode 100644 dep/src/ace/Dynamic.cpp delete mode 100644 dep/src/ace/Dynamic_Message_Strategy.cpp delete mode 100644 dep/src/ace/Dynamic_Service.cpp delete mode 100644 dep/src/ace/Dynamic_Service_Base.cpp delete mode 100644 dep/src/ace/Dynamic_Service_Dependency.cpp delete mode 100644 dep/src/ace/Encoding_Converter.cpp delete mode 100644 dep/src/ace/Encoding_Converter_Factory.cpp delete mode 100644 dep/src/ace/Env_Value_T.cpp delete mode 100644 dep/src/ace/Event.cpp delete mode 100644 dep/src/ace/Event_Handler.cpp delete mode 100644 dep/src/ace/Event_Handler_T.cpp delete mode 100644 dep/src/ace/FIFO.cpp delete mode 100644 dep/src/ace/FIFO_Recv.cpp delete mode 100644 dep/src/ace/FIFO_Recv_Msg.cpp delete mode 100644 dep/src/ace/FIFO_Send.cpp delete mode 100644 dep/src/ace/FIFO_Send_Msg.cpp delete mode 100644 dep/src/ace/FILE.cpp delete mode 100644 dep/src/ace/FILE_Addr.cpp delete mode 100644 dep/src/ace/FILE_Connector.cpp delete mode 100644 dep/src/ace/FILE_IO.cpp delete mode 100644 dep/src/ace/File_Lock.cpp delete mode 100644 dep/src/ace/Filecache.cpp delete mode 100644 dep/src/ace/Flag_Manip.cpp delete mode 100644 dep/src/ace/Framework_Component.cpp delete mode 100644 dep/src/ace/Framework_Component_T.cpp delete mode 100644 dep/src/ace/Free_List.cpp delete mode 100644 dep/src/ace/Functor.cpp delete mode 100644 dep/src/ace/Functor_String.cpp delete mode 100644 dep/src/ace/Functor_T.cpp delete mode 100644 dep/src/ace/Future.cpp delete mode 100644 dep/src/ace/Future_Set.cpp delete mode 100644 dep/src/ace/Get_Opt.cpp delete mode 100644 dep/src/ace/Guard_T.cpp delete mode 100644 dep/src/ace/Handle_Ops.cpp delete mode 100644 dep/src/ace/Handle_Set.cpp delete mode 100644 dep/src/ace/Hash_Cache_Map_Manager_T.cpp delete mode 100644 dep/src/ace/Hash_Map_Manager_T.cpp delete mode 100644 dep/src/ace/Hash_Map_With_Allocator_T.cpp delete mode 100644 dep/src/ace/Hash_Multi_Map_Manager_T.cpp delete mode 100644 dep/src/ace/Hashable.cpp delete mode 100644 dep/src/ace/High_Res_Timer.cpp delete mode 100644 dep/src/ace/ICMP_Socket.cpp delete mode 100644 dep/src/ace/INET_Addr.cpp delete mode 100644 dep/src/ace/IOStream.cpp delete mode 100644 dep/src/ace/IOStream_T.cpp delete mode 100644 dep/src/ace/IO_Cntl_Msg.cpp delete mode 100644 dep/src/ace/IO_SAP.cpp delete mode 100644 dep/src/ace/IPC_SAP.cpp delete mode 100644 dep/src/ace/Init_ACE.cpp delete mode 100644 dep/src/ace/Intrusive_Auto_Ptr.cpp delete mode 100644 dep/src/ace/Intrusive_List.cpp delete mode 100644 dep/src/ace/Intrusive_List_Node.cpp delete mode 100644 dep/src/ace/LOCK_SOCK_Acceptor.cpp delete mode 100644 dep/src/ace/LSOCK.cpp delete mode 100644 dep/src/ace/LSOCK_Acceptor.cpp delete mode 100644 dep/src/ace/LSOCK_CODgram.cpp delete mode 100644 dep/src/ace/LSOCK_Connector.cpp delete mode 100644 dep/src/ace/LSOCK_Dgram.cpp delete mode 100644 dep/src/ace/LSOCK_Stream.cpp delete mode 100644 dep/src/ace/Lib_Find.cpp delete mode 100644 dep/src/ace/Local_Memory_Pool.cpp delete mode 100644 dep/src/ace/Local_Name_Space.cpp delete mode 100644 dep/src/ace/Local_Name_Space_T.cpp delete mode 100644 dep/src/ace/Local_Tokens.cpp delete mode 100644 dep/src/ace/Lock.cpp delete mode 100644 dep/src/ace/Lock_Adapter_T.cpp delete mode 100644 dep/src/ace/Log_Msg.cpp delete mode 100644 dep/src/ace/Log_Msg_Backend.cpp delete mode 100644 dep/src/ace/Log_Msg_Callback.cpp delete mode 100644 dep/src/ace/Log_Msg_IPC.cpp delete mode 100644 dep/src/ace/Log_Msg_NT_Event_Log.cpp delete mode 100644 dep/src/ace/Log_Msg_UNIX_Syslog.cpp delete mode 100644 dep/src/ace/Log_Record.cpp delete mode 100644 dep/src/ace/Logging_Strategy.cpp delete mode 100644 dep/src/ace/MEM_Acceptor.cpp delete mode 100644 dep/src/ace/MEM_Addr.cpp delete mode 100644 dep/src/ace/MEM_Connector.cpp delete mode 100644 dep/src/ace/MEM_IO.cpp delete mode 100644 dep/src/ace/MEM_SAP.cpp delete mode 100644 dep/src/ace/MEM_Stream.cpp delete mode 100644 dep/src/ace/MMAP_Memory_Pool.cpp delete mode 100644 dep/src/ace/Malloc.cpp delete mode 100644 dep/src/ace/Malloc_Allocator.cpp delete mode 100644 dep/src/ace/Malloc_T.cpp delete mode 100644 dep/src/ace/Managed_Object.cpp delete mode 100644 dep/src/ace/Manual_Event.cpp delete mode 100644 dep/src/ace/Map_Manager.cpp delete mode 100644 dep/src/ace/Map_T.cpp delete mode 100644 dep/src/ace/Mem_Map.cpp delete mode 100644 dep/src/ace/Message_Block.cpp delete mode 100644 dep/src/ace/Message_Block_T.cpp delete mode 100644 dep/src/ace/Message_Queue.cpp delete mode 100644 dep/src/ace/Message_Queue_NT.cpp delete mode 100644 dep/src/ace/Message_Queue_T.cpp delete mode 100644 dep/src/ace/Message_Queue_Vx.cpp delete mode 100644 dep/src/ace/Method_Request.cpp delete mode 100644 dep/src/ace/Metrics_Cache_T.cpp delete mode 100644 dep/src/ace/Module.cpp delete mode 100644 dep/src/ace/Monitor_Admin.cpp delete mode 100644 dep/src/ace/Monitor_Admin_Manager.cpp delete mode 100644 dep/src/ace/Monitor_Base.cpp delete mode 100644 dep/src/ace/Monitor_Control_Action.cpp delete mode 100644 dep/src/ace/Monitor_Control_Types.cpp delete mode 100644 dep/src/ace/Monitor_Point_Registry.cpp delete mode 100644 dep/src/ace/Monitor_Size.cpp delete mode 100644 dep/src/ace/Msg_WFMO_Reactor.cpp delete mode 100644 dep/src/ace/Multihomed_INET_Addr.cpp delete mode 100644 dep/src/ace/Mutex.cpp delete mode 100644 dep/src/ace/NT_Service.cpp delete mode 100644 dep/src/ace/Name_Proxy.cpp delete mode 100644 dep/src/ace/Name_Request_Reply.cpp delete mode 100644 dep/src/ace/Name_Space.cpp delete mode 100644 dep/src/ace/Naming_Context.cpp delete mode 100644 dep/src/ace/Netlink_Addr.cpp delete mode 100644 dep/src/ace/Node.cpp delete mode 100644 dep/src/ace/Notification_Queue.cpp delete mode 100644 dep/src/ace/Notification_Strategy.cpp delete mode 100644 dep/src/ace/OS.cpp delete mode 100644 dep/src/ace/OS_Errno.cpp delete mode 100644 dep/src/ace/OS_Log_Msg_Attributes.cpp delete mode 100644 dep/src/ace/OS_NS_Thread.cpp delete mode 100644 dep/src/ace/OS_NS_arpa_inet.cpp delete mode 100644 dep/src/ace/OS_NS_ctype.cpp delete mode 100644 dep/src/ace/OS_NS_dirent.cpp delete mode 100644 dep/src/ace/OS_NS_dlfcn.cpp delete mode 100644 dep/src/ace/OS_NS_errno.cpp delete mode 100644 dep/src/ace/OS_NS_fcntl.cpp delete mode 100644 dep/src/ace/OS_NS_math.cpp delete mode 100644 dep/src/ace/OS_NS_netdb.cpp delete mode 100644 dep/src/ace/OS_NS_poll.cpp delete mode 100644 dep/src/ace/OS_NS_pwd.cpp delete mode 100644 dep/src/ace/OS_NS_regex.cpp delete mode 100644 dep/src/ace/OS_NS_signal.cpp delete mode 100644 dep/src/ace/OS_NS_stdio.cpp delete mode 100644 dep/src/ace/OS_NS_stdlib.cpp delete mode 100644 dep/src/ace/OS_NS_string.cpp delete mode 100644 dep/src/ace/OS_NS_strings.cpp delete mode 100644 dep/src/ace/OS_NS_stropts.cpp delete mode 100644 dep/src/ace/OS_NS_sys_mman.cpp delete mode 100644 dep/src/ace/OS_NS_sys_msg.cpp delete mode 100644 dep/src/ace/OS_NS_sys_resource.cpp delete mode 100644 dep/src/ace/OS_NS_sys_select.cpp delete mode 100644 dep/src/ace/OS_NS_sys_sendfile.cpp delete mode 100644 dep/src/ace/OS_NS_sys_shm.cpp delete mode 100644 dep/src/ace/OS_NS_sys_socket.cpp delete mode 100644 dep/src/ace/OS_NS_sys_stat.cpp delete mode 100644 dep/src/ace/OS_NS_sys_time.cpp delete mode 100644 dep/src/ace/OS_NS_sys_uio.cpp delete mode 100644 dep/src/ace/OS_NS_sys_utsname.cpp delete mode 100644 dep/src/ace/OS_NS_sys_wait.cpp delete mode 100644 dep/src/ace/OS_NS_time.cpp delete mode 100644 dep/src/ace/OS_NS_unistd.cpp delete mode 100644 dep/src/ace/OS_NS_wchar.cpp delete mode 100644 dep/src/ace/OS_QoS.cpp delete mode 100644 dep/src/ace/OS_TLI.cpp delete mode 100644 dep/src/ace/OS_Thread_Adapter.cpp delete mode 100644 dep/src/ace/OS_main.cpp delete mode 100644 dep/src/ace/Obchunk.cpp delete mode 100644 dep/src/ace/Object_Manager.cpp delete mode 100644 dep/src/ace/Object_Manager_Base.cpp delete mode 100644 dep/src/ace/Obstack_T.cpp delete mode 100644 dep/src/ace/PI_Malloc.cpp delete mode 100644 dep/src/ace/POSIX_Asynch_IO.cpp delete mode 100644 dep/src/ace/POSIX_CB_Proactor.cpp delete mode 100644 dep/src/ace/POSIX_Proactor.cpp delete mode 100644 dep/src/ace/Pagefile_Memory_Pool.cpp delete mode 100644 dep/src/ace/Pair_T.cpp delete mode 100644 dep/src/ace/Parse_Node.cpp delete mode 100644 dep/src/ace/Ping_Socket.cpp delete mode 100644 dep/src/ace/Pipe.cpp delete mode 100644 dep/src/ace/Priority_Reactor.cpp delete mode 100644 dep/src/ace/Proactor.cpp delete mode 100644 dep/src/ace/Proactor_Impl.cpp delete mode 100644 dep/src/ace/Process.cpp delete mode 100644 dep/src/ace/Process_Manager.cpp delete mode 100644 dep/src/ace/Process_Mutex.cpp delete mode 100644 dep/src/ace/Process_Semaphore.cpp delete mode 100644 dep/src/ace/Profile_Timer.cpp delete mode 100644 dep/src/ace/RB_Tree.cpp delete mode 100644 dep/src/ace/RW_Mutex.cpp delete mode 100644 dep/src/ace/RW_Process_Mutex.cpp delete mode 100644 dep/src/ace/RW_Thread_Mutex.cpp delete mode 100644 dep/src/ace/Reactor.cpp delete mode 100644 dep/src/ace/Reactor_Impl.cpp delete mode 100644 dep/src/ace/Reactor_Notification_Strategy.cpp delete mode 100644 dep/src/ace/Reactor_Timer_Interface.cpp delete mode 100644 dep/src/ace/Reactor_Token_T.cpp delete mode 100644 dep/src/ace/Read_Buffer.cpp delete mode 100644 dep/src/ace/Recursive_Thread_Mutex.cpp delete mode 100644 dep/src/ace/Recyclable.cpp delete mode 100644 dep/src/ace/Refcountable_T.cpp delete mode 100644 dep/src/ace/Refcounted_Auto_Ptr.cpp delete mode 100644 dep/src/ace/Registry.cpp delete mode 100644 dep/src/ace/Registry_Name_Space.cpp delete mode 100644 dep/src/ace/Remote_Name_Space.cpp delete mode 100644 dep/src/ace/Remote_Tokens.cpp delete mode 100644 dep/src/ace/Reverse_Lock_T.cpp delete mode 100644 dep/src/ace/Rtems_init.c delete mode 100644 dep/src/ace/SOCK.cpp delete mode 100644 dep/src/ace/SOCK_Acceptor.cpp delete mode 100644 dep/src/ace/SOCK_CODgram.cpp delete mode 100644 dep/src/ace/SOCK_Connector.cpp delete mode 100644 dep/src/ace/SOCK_Dgram.cpp delete mode 100644 dep/src/ace/SOCK_Dgram_Bcast.cpp delete mode 100644 dep/src/ace/SOCK_Dgram_Mcast.cpp delete mode 100644 dep/src/ace/SOCK_IO.cpp delete mode 100644 dep/src/ace/SOCK_Netlink.cpp delete mode 100644 dep/src/ace/SOCK_SEQPACK_Acceptor.cpp delete mode 100644 dep/src/ace/SOCK_SEQPACK_Association.cpp delete mode 100644 dep/src/ace/SOCK_SEQPACK_Connector.cpp delete mode 100644 dep/src/ace/SOCK_Stream.cpp delete mode 100644 dep/src/ace/SPIPE.cpp delete mode 100644 dep/src/ace/SPIPE_Acceptor.cpp delete mode 100644 dep/src/ace/SPIPE_Addr.cpp delete mode 100644 dep/src/ace/SPIPE_Connector.cpp delete mode 100644 dep/src/ace/SPIPE_Stream.cpp delete mode 100644 dep/src/ace/SSL/SSL_Asynch_BIO.cpp delete mode 100644 dep/src/ace/SSL/SSL_Asynch_Stream.cpp delete mode 100644 dep/src/ace/SSL/SSL_Context.cpp delete mode 100644 dep/src/ace/SSL/SSL_SOCK.cpp delete mode 100644 dep/src/ace/SSL/SSL_SOCK_Acceptor.cpp delete mode 100644 dep/src/ace/SSL/SSL_SOCK_Connector.cpp delete mode 100644 dep/src/ace/SSL/SSL_SOCK_Stream.cpp delete mode 100644 dep/src/ace/SString.cpp delete mode 100644 dep/src/ace/SUN_Proactor.cpp delete mode 100644 dep/src/ace/SV_Message.cpp delete mode 100644 dep/src/ace/SV_Message_Queue.cpp delete mode 100644 dep/src/ace/SV_Semaphore_Complex.cpp delete mode 100644 dep/src/ace/SV_Semaphore_Simple.cpp delete mode 100644 dep/src/ace/SV_Shared_Memory.cpp delete mode 100644 dep/src/ace/Sample_History.cpp delete mode 100644 dep/src/ace/Sbrk_Memory_Pool.cpp delete mode 100644 dep/src/ace/Sched_Params.cpp delete mode 100644 dep/src/ace/Select_Reactor_Base.cpp delete mode 100644 dep/src/ace/Select_Reactor_T.cpp delete mode 100644 dep/src/ace/Semaphore.cpp delete mode 100644 dep/src/ace/Service_Config.cpp delete mode 100644 dep/src/ace/Service_Gestalt.cpp delete mode 100644 dep/src/ace/Service_Manager.cpp delete mode 100644 dep/src/ace/Service_Object.cpp delete mode 100644 dep/src/ace/Service_Repository.cpp delete mode 100644 dep/src/ace/Service_Types.cpp delete mode 100644 dep/src/ace/Shared_Memory.cpp delete mode 100644 dep/src/ace/Shared_Memory_MM.cpp delete mode 100644 dep/src/ace/Shared_Memory_Pool.cpp delete mode 100644 dep/src/ace/Shared_Memory_SV.cpp delete mode 100644 dep/src/ace/Shared_Object.cpp delete mode 100644 dep/src/ace/Sig_Adapter.cpp delete mode 100644 dep/src/ace/Sig_Handler.cpp delete mode 100644 dep/src/ace/Signal.cpp delete mode 100644 dep/src/ace/Singleton.cpp delete mode 100644 dep/src/ace/Sock_Connect.cpp delete mode 100644 dep/src/ace/Stack_Trace.cpp delete mode 100644 dep/src/ace/Stats.cpp delete mode 100644 dep/src/ace/Strategies_T.cpp delete mode 100644 dep/src/ace/Stream.cpp delete mode 100644 dep/src/ace/Stream_Modules.cpp delete mode 100644 dep/src/ace/String_Base.cpp delete mode 100644 dep/src/ace/String_Base_Const.cpp delete mode 100644 dep/src/ace/Svc_Conf_Lexer.cpp delete mode 100644 dep/src/ace/Svc_Conf_y.cpp delete mode 100644 dep/src/ace/Svc_Handler.cpp delete mode 100644 dep/src/ace/Synch_Options.cpp delete mode 100644 dep/src/ace/Synch_T.cpp delete mode 100644 dep/src/ace/System_Time.cpp delete mode 100644 dep/src/ace/TLI.cpp delete mode 100644 dep/src/ace/TLI_Acceptor.cpp delete mode 100644 dep/src/ace/TLI_Connector.cpp delete mode 100644 dep/src/ace/TLI_Stream.cpp delete mode 100644 dep/src/ace/TP_Reactor.cpp delete mode 100644 dep/src/ace/TSS_Adapter.cpp delete mode 100644 dep/src/ace/TSS_T.cpp delete mode 100644 dep/src/ace/TTY_IO.cpp delete mode 100644 dep/src/ace/Task.cpp delete mode 100644 dep/src/ace/Task_Ex_T.cpp delete mode 100644 dep/src/ace/Task_T.cpp delete mode 100644 dep/src/ace/Test_and_Set.cpp delete mode 100644 dep/src/ace/Thread.cpp delete mode 100644 dep/src/ace/Thread_Adapter.cpp delete mode 100644 dep/src/ace/Thread_Control.cpp delete mode 100644 dep/src/ace/Thread_Exit.cpp delete mode 100644 dep/src/ace/Thread_Hook.cpp delete mode 100644 dep/src/ace/Thread_Manager.cpp delete mode 100644 dep/src/ace/Thread_Mutex.cpp delete mode 100644 dep/src/ace/Thread_Semaphore.cpp delete mode 100644 dep/src/ace/Throughput_Stats.cpp delete mode 100644 dep/src/ace/Time_Value.cpp delete mode 100644 dep/src/ace/Timeprobe.cpp delete mode 100644 dep/src/ace/Timeprobe_T.cpp delete mode 100644 dep/src/ace/Timer_Hash_T.cpp delete mode 100644 dep/src/ace/Timer_Heap_T.cpp delete mode 100644 dep/src/ace/Timer_List_T.cpp delete mode 100644 dep/src/ace/Timer_Queue_Adapters.cpp delete mode 100644 dep/src/ace/Timer_Queue_T.cpp delete mode 100644 dep/src/ace/Timer_Wheel_T.cpp delete mode 100644 dep/src/ace/Token.cpp delete mode 100644 dep/src/ace/Token_Collection.cpp delete mode 100644 dep/src/ace/Token_Invariants.cpp delete mode 100644 dep/src/ace/Token_Manager.cpp delete mode 100644 dep/src/ace/Token_Request_Reply.cpp delete mode 100644 dep/src/ace/Trace.cpp delete mode 100644 dep/src/ace/Typed_SV_Message.cpp delete mode 100644 dep/src/ace/Typed_SV_Message_Queue.cpp delete mode 100644 dep/src/ace/UNIX_Addr.cpp delete mode 100644 dep/src/ace/UPIPE_Acceptor.cpp delete mode 100644 dep/src/ace/UPIPE_Connector.cpp delete mode 100644 dep/src/ace/UPIPE_Stream.cpp delete mode 100644 dep/src/ace/UTF16_Encoding_Converter.cpp delete mode 100644 dep/src/ace/UTF32_Encoding_Converter.cpp delete mode 100644 dep/src/ace/UTF8_Encoding_Converter.cpp delete mode 100644 dep/src/ace/UUID.cpp delete mode 100644 dep/src/ace/Unbounded_Queue.cpp delete mode 100644 dep/src/ace/Unbounded_Set.cpp delete mode 100644 dep/src/ace/Unbounded_Set_Ex.cpp delete mode 100644 dep/src/ace/Vector_T.cpp delete mode 100644 dep/src/ace/WFMO_Reactor.cpp delete mode 100644 dep/src/ace/WIN32_Asynch_IO.cpp delete mode 100644 dep/src/ace/WIN32_Proactor.cpp delete mode 100644 dep/src/ace/XML_Svc_Conf.cpp delete mode 100644 dep/src/ace/XTI_ATM_Mcast.cpp delete mode 100644 dep/src/ace/ace_wchar.cpp delete mode 100644 dep/src/ace/gethrtime.cpp delete mode 100644 dep/src/bzip2/blocksort.c delete mode 100644 dep/src/bzip2/bzlib.c delete mode 100644 dep/src/bzip2/bzlib.h delete mode 100644 dep/src/bzip2/bzlib_private.h delete mode 100644 dep/src/bzip2/compress.c delete mode 100644 dep/src/bzip2/crctable.c delete mode 100644 dep/src/bzip2/decompress.c delete mode 100644 dep/src/bzip2/huffman.c delete mode 100644 dep/src/bzip2/randtable.c delete mode 100644 dep/src/g3dlite/AABox.cpp delete mode 100644 dep/src/g3dlite/Any.cpp delete mode 100644 dep/src/g3dlite/AnyVal.cpp delete mode 100644 dep/src/g3dlite/AreaMemoryManager.cpp delete mode 100644 dep/src/g3dlite/BinaryFormat.cpp delete mode 100644 dep/src/g3dlite/BinaryInput.cpp delete mode 100644 dep/src/g3dlite/BinaryOutput.cpp delete mode 100644 dep/src/g3dlite/Box.cpp delete mode 100644 dep/src/g3dlite/Box2D.cpp delete mode 100644 dep/src/g3dlite/BumpMapPreprocess.cpp delete mode 100644 dep/src/g3dlite/CMakeLists.txt delete mode 100644 dep/src/g3dlite/Capsule.cpp delete mode 100644 dep/src/g3dlite/CollisionDetection.cpp delete mode 100644 dep/src/g3dlite/Color1.cpp delete mode 100644 dep/src/g3dlite/Color1uint8.cpp delete mode 100644 dep/src/g3dlite/Color3.cpp delete mode 100644 dep/src/g3dlite/Color3uint8.cpp delete mode 100644 dep/src/g3dlite/Color4.cpp delete mode 100644 dep/src/g3dlite/Color4uint8.cpp delete mode 100644 dep/src/g3dlite/Cone.cpp delete mode 100644 dep/src/g3dlite/ConvexPolyhedron.cpp delete mode 100644 dep/src/g3dlite/CoordinateFrame.cpp delete mode 100644 dep/src/g3dlite/Crypto.cpp delete mode 100644 dep/src/g3dlite/Crypto_md5.cpp delete mode 100644 dep/src/g3dlite/Cylinder.cpp delete mode 100644 dep/src/g3dlite/GCamera.cpp delete mode 100644 dep/src/g3dlite/GImage.cpp delete mode 100644 dep/src/g3dlite/GImage_bayer.cpp delete mode 100644 dep/src/g3dlite/GImage_bmp.cpp delete mode 100644 dep/src/g3dlite/GImage_jpeg.cpp delete mode 100644 dep/src/g3dlite/GImage_png.cpp delete mode 100644 dep/src/g3dlite/GImage_ppm.cpp delete mode 100644 dep/src/g3dlite/GImage_tga.cpp delete mode 100644 dep/src/g3dlite/GLight.cpp delete mode 100644 dep/src/g3dlite/GThread.cpp delete mode 100644 dep/src/g3dlite/GUniqueID.cpp delete mode 100644 dep/src/g3dlite/Image1.cpp delete mode 100644 dep/src/g3dlite/Image1uint8.cpp delete mode 100644 dep/src/g3dlite/Image3.cpp delete mode 100644 dep/src/g3dlite/Image3uint8.cpp delete mode 100644 dep/src/g3dlite/Image4.cpp delete mode 100644 dep/src/g3dlite/Image4uint8.cpp delete mode 100644 dep/src/g3dlite/ImageFormat.cpp delete mode 100644 dep/src/g3dlite/ImageFormat_convert.cpp delete mode 100644 dep/src/g3dlite/Intersect.cpp delete mode 100644 dep/src/g3dlite/Line.cpp delete mode 100644 dep/src/g3dlite/LineSegment.cpp delete mode 100644 dep/src/g3dlite/Log.cpp delete mode 100644 dep/src/g3dlite/Makefile.am delete mode 100644 dep/src/g3dlite/Matrix.cpp delete mode 100644 dep/src/g3dlite/Matrix3.cpp delete mode 100644 dep/src/g3dlite/Matrix4.cpp delete mode 100644 dep/src/g3dlite/MemoryManager.cpp delete mode 100644 dep/src/g3dlite/MeshAlg.cpp delete mode 100644 dep/src/g3dlite/MeshAlgAdjacency.cpp delete mode 100644 dep/src/g3dlite/MeshAlgWeld.cpp delete mode 100644 dep/src/g3dlite/MeshBuilder.cpp delete mode 100644 dep/src/g3dlite/NetAddress.cpp delete mode 100644 dep/src/g3dlite/NetworkDevice.cpp delete mode 100644 dep/src/g3dlite/PhysicsFrame.cpp delete mode 100644 dep/src/g3dlite/Plane.cpp delete mode 100644 dep/src/g3dlite/PrecomputedRandom.cpp delete mode 100644 dep/src/g3dlite/Quat.cpp delete mode 100644 dep/src/g3dlite/Random.cpp delete mode 100644 dep/src/g3dlite/Ray.cpp delete mode 100644 dep/src/g3dlite/Rect2D.cpp delete mode 100644 dep/src/g3dlite/ReferenceCount.cpp delete mode 100644 dep/src/g3dlite/RegistryUtil.cpp delete mode 100644 dep/src/g3dlite/Sphere.cpp delete mode 100644 dep/src/g3dlite/SplineBase.cpp delete mode 100644 dep/src/g3dlite/Stopwatch.cpp delete mode 100644 dep/src/g3dlite/System.cpp delete mode 100644 dep/src/g3dlite/TextInput.cpp delete mode 100644 dep/src/g3dlite/TextOutput.cpp delete mode 100644 dep/src/g3dlite/ThreadSet.cpp delete mode 100644 dep/src/g3dlite/Triangle.cpp delete mode 100644 dep/src/g3dlite/UprightFrame.cpp delete mode 100644 dep/src/g3dlite/Vector2.cpp delete mode 100644 dep/src/g3dlite/Vector2int16.cpp delete mode 100644 dep/src/g3dlite/Vector3.cpp delete mode 100644 dep/src/g3dlite/Vector3int16.cpp delete mode 100644 dep/src/g3dlite/Vector3int32.cpp delete mode 100644 dep/src/g3dlite/Vector4.cpp delete mode 100644 dep/src/g3dlite/Vector4int8.cpp delete mode 100644 dep/src/g3dlite/Welder.cpp delete mode 100644 dep/src/g3dlite/WinMain.cpp delete mode 100644 dep/src/g3dlite/constants.cpp delete mode 100644 dep/src/g3dlite/debugAssert.cpp delete mode 100644 dep/src/g3dlite/fileutils.cpp delete mode 100644 dep/src/g3dlite/filter.cpp delete mode 100644 dep/src/g3dlite/format.cpp delete mode 100644 dep/src/g3dlite/g3dfnmatch.cpp delete mode 100644 dep/src/g3dlite/g3dmath.cpp delete mode 100644 dep/src/g3dlite/license.cpp delete mode 100644 dep/src/g3dlite/license.html delete mode 100644 dep/src/g3dlite/prompt.cpp delete mode 100644 dep/src/g3dlite/stringutils.cpp delete mode 100644 dep/src/g3dlite/uint128.cpp delete mode 100644 dep/src/jmalloc/CMakeLists.txt delete mode 100644 dep/src/jmalloc/arena.c delete mode 100644 dep/src/jmalloc/base.c delete mode 100644 dep/src/jmalloc/chunk.c delete mode 100644 dep/src/jmalloc/chunk_dss.c delete mode 100644 dep/src/jmalloc/chunk_mmap.c delete mode 100644 dep/src/jmalloc/chunk_swap.c delete mode 100644 dep/src/jmalloc/ckh.c delete mode 100644 dep/src/jmalloc/ctl.c delete mode 100644 dep/src/jmalloc/extent.c delete mode 100644 dep/src/jmalloc/hash.c delete mode 100644 dep/src/jmalloc/huge.c delete mode 100644 dep/src/jmalloc/jemalloc.c delete mode 100644 dep/src/jmalloc/mb.c delete mode 100644 dep/src/jmalloc/mutex.c delete mode 100644 dep/src/jmalloc/prof.c delete mode 100644 dep/src/jmalloc/stats.c delete mode 100644 dep/src/jmalloc/tcache.c delete mode 100644 dep/src/libmpq/common.c delete mode 100644 dep/src/libmpq/explode.c delete mode 100644 dep/src/libmpq/extract.c delete mode 100644 dep/src/libmpq/huffman.c delete mode 100644 dep/src/libmpq/mpq.c delete mode 100644 dep/src/libmpq/wave.c delete mode 100644 dep/src/sockets/Base64.cpp delete mode 100644 dep/src/sockets/CMakeLists.txt delete mode 100644 dep/src/sockets/Exception.cpp delete mode 100644 dep/src/sockets/Ipv4Address.cpp delete mode 100644 dep/src/sockets/Ipv6Address.cpp delete mode 100644 dep/src/sockets/Lock.cpp delete mode 100644 dep/src/sockets/Mutex.cpp delete mode 100644 dep/src/sockets/Parse.cpp delete mode 100644 dep/src/sockets/ResolvServer.cpp delete mode 100644 dep/src/sockets/ResolvSocket.cpp delete mode 100644 dep/src/sockets/Socket.cpp delete mode 100644 dep/src/sockets/SocketHandler.cpp delete mode 100644 dep/src/sockets/StdoutLog.cpp delete mode 100644 dep/src/sockets/StreamSocket.cpp delete mode 100644 dep/src/sockets/TcpSocket.cpp delete mode 100644 dep/src/sockets/Thread.cpp delete mode 100644 dep/src/sockets/UdpSocket.cpp delete mode 100644 dep/src/sockets/Utility.cpp delete mode 100644 dep/src/sockets/network_kist.txt delete mode 100644 dep/src/sockets/socket_include.cpp delete mode 100644 dep/src/zlib/CMakeLists.txt delete mode 100644 dep/src/zlib/adler32.c delete mode 100644 dep/src/zlib/compress.c delete mode 100644 dep/src/zlib/crc32.c delete mode 100644 dep/src/zlib/crc32.h delete mode 100644 dep/src/zlib/deflate.c delete mode 100644 dep/src/zlib/deflate.h delete mode 100644 dep/src/zlib/example.c delete mode 100644 dep/src/zlib/gzio.c delete mode 100644 dep/src/zlib/infback.c delete mode 100644 dep/src/zlib/inffast.c delete mode 100644 dep/src/zlib/inffast.h delete mode 100644 dep/src/zlib/inffixed.h delete mode 100644 dep/src/zlib/inflate.c delete mode 100644 dep/src/zlib/inflate.h delete mode 100644 dep/src/zlib/inftrees.c delete mode 100644 dep/src/zlib/inftrees.h delete mode 100644 dep/src/zlib/trees.c delete mode 100644 dep/src/zlib/trees.h delete mode 100644 dep/src/zlib/uncompr.c delete mode 100644 dep/src/zlib/zconf.h delete mode 100644 dep/src/zlib/zlib.h delete mode 100644 dep/src/zlib/zutil.c delete mode 100644 dep/src/zlib/zutil.h (limited to 'dep/include/utf8cpp') diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt deleted file mode 100644 index e1398d989ff..00000000000 --- a/dep/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -#if(BUILD_ACE) -#add_subdirectory(ACE_wrappers) -#endif(BUILD_ACE) -#add_subdirectory(include) -#add_subdirectory(lib) -add_subdirectory(src) diff --git a/dep/include/ace/ACE.h b/dep/include/ace/ACE.h deleted file mode 100644 index ea7a3fa02e4..00000000000 --- a/dep/include/ace/ACE.h +++ /dev/null @@ -1,825 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ACE.h - * - * $Id: ACE.h 82581 2008-08-11 08:58:24Z johnnyw $ - * - * This file contains value added ACE functions that extend the - * behavior of the UNIX and Win32 OS calls. - * - * All these ACE static functions are consolidated in a single place - * in order to manage the namespace better. These functions are put - * here rather than in @c ACE_OS in order to separate concerns. - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ACE_H -#define ACE_ACE_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_math.h" -#include "ace/Flag_Manip.h" -#include "ace/Handle_Ops.h" -#include "ace/Lib_Find.h" -#include "ace/Init_ACE.h" -#include "ace/Sock_Connect.h" -#include "ace/Default_Constants.h" - -#if defined (ACE_EXPORT_MACRO) -# undef ACE_EXPORT_MACRO -#endif -#define ACE_EXPORT_MACRO ACE_Export - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -class ACE_Time_Value; -class ACE_Message_Block; -class ACE_Handle_Set; - -/** - * @namespace ACE - * - * @brief The namespace containing the ACE framework itself. - * - * The ACE namespace contains all types (classes, structures, - * typedefs, etc), and global functions and variables in the ACE - * framework. - */ -namespace ACE -{ - // = ACE version information. - /// e.g., the "5" in ACE 5.1.12. - extern ACE_Export u_int major_version (void); - - /// e.g., the "1" in ACE 5.1.12. - extern ACE_Export u_int minor_version (void); - - /// e.g., the "12" in ACE 5.1.12. - /// Returns 0 for "stable" (non-beta) releases. - extern ACE_Export u_int beta_version (void); - - // = C++ compiler version information. - /// E.g., the "SunPro C++" in SunPro C++ 4.32.0 - extern ACE_Export const ACE_TCHAR * compiler_name (void); - - /// E.g., the "4" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_major_version (void); - - /// E.g., the "32" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_minor_version (void); - - /// E.g., the "0" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_beta_version (void); - - /// Check if error indicates the process being out of handles (file - /// descriptors). - extern ACE_Export int out_of_handles (int error); - - /// Simple wildcard matching function supporting '*' and '?' - /// return true if string s matches pattern. - extern ACE_Export bool wild_match(const char* s, const char* pattern, bool case_sensitive = true); - - /** - * @name I/O operations - * - * Notes on common parameters: - * - * @a handle is the connected endpoint that will be used for I/O. - * - * @a buf is the buffer to write from or receive into. - * - * @a len is the number of bytes to transfer. - * - * The @a timeout parameter in the following methods indicates how - * long to blocking trying to transfer data. If @a timeout == 0, - * then the call behaves as a normal send/recv call, i.e., for - * blocking sockets, the call will block until action is possible; - * for non-blocking sockets, @c EWOULDBLOCK will be returned if no - * action is immediately possible. - * - * If @a timeout != 0, the call will wait until the relative time - * specified in @a *timeout elapses. - * - * The "_n()" I/O methods keep looping until all the data has been - * transferred. These methods also work for sockets in non-blocking - * mode i.e., they keep looping on @c EWOULDBLOCK. @a timeout is - * used to make sure we keep making progress, i.e., the same timeout - * value is used for every I/O operation in the loop and the timeout - * is not counted down. - * - * The return values for the "*_n()" methods match the return values - * from the non "_n()" methods and are specified as follows: - * - * - On complete transfer, the number of bytes transferred is returned. - * - On timeout, -1 is returned, @c errno == @c ETIME. - * - On error, -1 is returned, @c errno is set to appropriate error. - * - On @c EOF, 0 is returned, @c errno is irrelevant. - * - * On partial transfers, i.e., if any data is transferred before - * timeout / error / @c EOF, @a bytes_transferred> will contain the - * number of bytes transferred. - * - * Methods with @a iovec parameter are I/O vector variants of the - * I/O operations. - * - * Methods with the extra @a flags argument will always result in - * @c send getting called. Methods without the extra @a flags - * argument will result in @c send getting called on Win32 - * platforms, and @c write getting called on non-Win32 platforms. - */ - //@{ - extern ACE_Export ssize_t recv (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); - -#if defined (ACE_HAS_TLI) - - extern ACE_Export ssize_t t_rcv (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout = 0); - -#endif /* ACE_HAS_TLI */ - - extern ACE_Export ssize_t recv (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t recvmsg (ACE_HANDLE handle, - struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t recvfrom (ACE_HANDLE handle, - char *buf, - int len, - int flags, - struct sockaddr *addr, - int *addrlen, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - -#if defined (ACE_HAS_TLI) - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_rcv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - -#endif /* ACE_HAS_TLI */ - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - /// Receive into a variable number of pieces. - /** - * Accepts a variable, caller-specified, number of pointer/length - * pairs. Arguments following @a n are char *, size_t pairs. - * - * @param handle The I/O handle to receive on - * @param n The total number of char *, size_t pairs following @a n. - * - * @return -1 on error, else total number of bytes received. - */ - extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...); - - extern ACE_Export ssize_t recvv (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recvv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t recv_n (ACE_HANDLE handle, - ACE_Message_Block *message_block, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t send (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); - -#if defined (ACE_HAS_TLI) - - extern ACE_Export ssize_t t_snd (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); - -#endif /* ACE_HAS_TLI */ - - extern ACE_Export ssize_t send (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t sendmsg (ACE_HANDLE handle, - const struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t sendto (ACE_HANDLE handle, - const char *buf, - int len, - int flags, - const struct sockaddr *addr, - int addrlen, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - -#if defined (ACE_HAS_TLI) - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_snd_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - -#endif /* ACE_HAS_TLI */ - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - /// Varargs variant. - extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...); - - extern ACE_Export ssize_t sendv (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t sendv_n (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - /// Send all the @a message_blocks chained through their @c next and - /// @c cont pointers. This call uses the underlying OS gather-write - /// operation to reduce the domain-crossing penalty. - extern ACE_Export ssize_t send_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - // = File system I/O functions (these don't support timeouts). - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t read_n (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bytes_transferred = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t write_n (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bytes_transferred = 0); - - /// Write all the @a message_blocks chained through their @c next - /// and @c cont pointers. This call uses the underlying OS - /// gather-write operation to reduce the domain-crossing penalty. - extern ACE_Export ssize_t write_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t readv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t writev_n (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - size_t *bytes_transferred = 0); - //@} - - /** - * Wait up to @a timeout amount of time to passively establish a - * connection. This method doesn't perform the @c accept, it just - * does the timed wait. - */ - extern ACE_Export int handle_timed_accept (ACE_HANDLE listener, - ACE_Time_Value *timeout, - int restart); - - /** - * Wait up to @a timeout amount of time to complete an actively - * established non-blocking connection. If @a is_tli is non-0 then - * we are being called by a TLI wrapper (which behaves slightly - * differently from a socket wrapper). - */ - extern ACE_Export ACE_HANDLE handle_timed_complete ( - ACE_HANDLE listener, - const ACE_Time_Value *timeout, - int is_tli = 0); - - /** - * Reset the limit on the number of open handles. If @a new_limit - * == -1 set the limit to the maximum allowable. Otherwise, set - * the limit value to @a new_limit. If @a increase_limit_only is - * non-0 then only allow increases to the limit. - */ - extern ACE_Export int set_handle_limit (int new_limit = -1, - int increase_limit_only = 0); - - /** - * Returns the maximum number of open handles currently permitted in - * this process. This maximum may be extended using - * @c ACE::set_handle_limit. - */ - extern ACE_Export int max_handles (void); - - // = String functions -#if !defined (ACE_HAS_WINCE) - /** - * Return a dynamically allocated duplicate of @a str, substituting - * the environment variable if @c str[0] @c == @c '$'. Note that - * the pointer is allocated with @c ACE_OS::malloc and must be freed - * by @c ACE_OS::free. - */ - extern ACE_Export ACE_TCHAR *strenvdup (const ACE_TCHAR *str); -#endif /* ACE_HAS_WINCE */ - - /// Returns a pointer to the "end" of the string, i.e., the character - /// past the '\0'. - extern ACE_Export const char *strend (const char *s); - - /// This method is just like @c strdup, except that it uses - /// @c operator @c new rather than @c malloc. If @a s is NULL - /// returns NULL rather than segfaulting. - extern ACE_Export char *strnew (const char *s); - - /// Delete the memory allocated by @c strnew. - ACE_NAMESPACE_INLINE_FUNCTION void strdelete (char *s); - - /// Create a fresh new copy of @a str, up to @a n chars long. Uses - /// @c ACE_OS::malloc to allocate the new string. - extern ACE_Export char *strndup (const char *str, size_t n); - - /// Create a fresh new copy of @a str, up to @a n chars long. Uses - /// @c ACE_OS::malloc to allocate the new string. - extern ACE_Export char *strnnew (const char *str, size_t n); - -#if defined (ACE_HAS_WCHAR) - extern ACE_Export const wchar_t *strend (const wchar_t *s); - - extern ACE_Export wchar_t *strnew (const wchar_t *s); - - ACE_NAMESPACE_INLINE_FUNCTION void strdelete (wchar_t *s); - - extern ACE_Export wchar_t *strndup (const wchar_t *str, size_t n); - - extern ACE_Export wchar_t *strnnew (const wchar_t *str, size_t n); - -#endif /* ACE_HAS_WCHAR */ - - /** - * On Windows, determines if a specified pathname ends with ".exe" - * (not case sensitive). If on Windows and there is no ".exe" suffix, - * a new ACE_TCHAR array is allocated and a copy of @c pathname with - * the ".exe" suffix is copied into it. In this case, the caller is - * responsible for calling delete [] on the returned pointer. - * - * @param pathname The name to check for a proper suffix. - * - * @retval @c pathname if there is a proper suffix for Windows. This is - * always the return value for non-Windows platforms. - * @retval If a suffix needs to be added, returns a pointer to new[] - * allocated memory containing the original @c pathname plus - * a ".exe" suffix. The caller is responsible for freeing the - * memory using delete []. - */ - extern ACE_Export const ACE_TCHAR *execname (const ACE_TCHAR *pathname); - - /** - * Returns the "basename" of a @a pathname separated by @a delim. - * For instance, the basename of "/tmp/foo.cpp" is "foo.cpp" when - * @a delim is @a '/'. - */ - extern ACE_Export const ACE_TCHAR *basename (const ACE_TCHAR *pathname, - ACE_TCHAR delim = - ACE_DIRECTORY_SEPARATOR_CHAR); - - /** - * Returns the "dirname" of a @a pathname. For instance, the - * dirname of "/tmp/foo.cpp" is "/tmp" when @a delim is @a '/'. If - * @a pathname has no @a delim ".\0" is returned. This method does - * not modify @a pathname and is not reentrant. - */ - extern ACE_Export const ACE_TCHAR *dirname (const ACE_TCHAR *pathname, - ACE_TCHAR delim = - ACE_DIRECTORY_SEPARATOR_CHAR); - - /** - * Returns the current timestamp in the form - * "hour:minute:second:microsecond." The month, day, and year are - * also stored in the beginning of the @a date_and_time array, which - * is a user-supplied array of size @a time_len> @c ACE_TCHARs. - * Returns 0 if unsuccessful, else returns pointer to beginning of the - * "time" portion of @a date_and_time. If @a - * return_pointer_to_first_digit is 0 then return a pointer to the - * space before the time, else return a pointer to the beginning of - * the time portion. - */ - extern ACE_Export ACE_TCHAR *timestamp (ACE_TCHAR date_and_time[], - size_t time_len, - bool return_pointer_to_first_digit = false); - - /** - * if @a avoid_zombies == 0 call @c ACE_OS::fork directly, else - * create an orphan process that's inherited by the init process; - * init cleans up when the orphan process terminates so we don't - * create zombies. Returns -1 on failure and either the child PID - * on success if @a avoid_zombies == 0 or 1 on success if @a - * avoid_zombies != 0 (this latter behavior is a known bug that - * needs to be fixed). - */ - extern ACE_Export pid_t fork ( - const ACE_TCHAR *program_name = ACE_TEXT (""), - int avoid_zombies = 0); - - /** - * Become a daemon process using the algorithm in Richard Stevens - * "Advanced Programming in the UNIX Environment." If - * @a close_all_handles is non-zero then all open file handles are - * closed. - */ - extern ACE_Export int daemonize ( - const ACE_TCHAR pathname[] = ACE_TEXT ("/"), - bool close_all_handles = ACE_DEFAULT_CLOSE_ALL_HANDLES, - const ACE_TCHAR program_name[] = ACE_TEXT ("")); - - // = Miscellaneous functions. - /// Rounds the request to a multiple of the page size. - extern ACE_Export size_t round_to_pagesize (size_t len); - - /// Rounds the request to a multiple of the allocation granularity. - extern ACE_Export size_t round_to_allocation_granularity (size_t len); - - // @@ UNICODE what about buffer? - /// Format buffer into printable format. This is useful for - /// debugging. - extern ACE_Export size_t format_hexdump (const char *buffer, size_t size, - ACE_TCHAR *obuf, size_t obuf_sz); - - /// Computes the hash value of {str} using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const char *str); - - /// Computes the hash value of {str} using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const char *str, size_t len); - -#if defined (ACE_HAS_WCHAR) - /// Computes the hash value of {str} using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const wchar_t *str); - - /// Computes the hash value of {str} using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const wchar_t *str, size_t len); -#endif /* ACE_HAS_WCHAR */ - - /// Computes CRC-CCITT for the string. - extern ACE_Export ACE_UINT16 crc_ccitt(const char *str); - - /// Computes CRC-CCITT for the buffer. - extern ACE_Export ACE_UINT16 crc_ccitt(const void *buf, size_t len, - ACE_UINT16 crc = 0); - - /// Computes CRC-CCITT for the @ len iovec buffers. - extern ACE_Export ACE_UINT16 crc_ccitt(const iovec *iov, int len, - ACE_UINT16 crc = 0); - - /// Computes the ISO 8802-3 standard 32 bits CRC for the string. - extern ACE_Export ACE_UINT32 crc32 (const char *str); - - /// Computes the ISO 8802-3 standard 32 bits CRC for the buffer. - extern ACE_Export ACE_UINT32 crc32 (const void *buf, size_t len, - ACE_UINT32 crc = 0); - - /// Computes the ISO 8802-3 standard 32 bits CRC for the - /// @ len iovec buffers. - extern ACE_Export ACE_UINT32 crc32 (const iovec *iov, int len, - ACE_UINT32 crc = 0); - - /// Euclid's greatest common divisor algorithm. - extern ACE_Export u_long gcd (u_long x, u_long y); - - /// Calculates the minimum enclosing frame size for the given values. - extern ACE_Export u_long minimum_frame_size (u_long period1, u_long period2); - - /** - * Function that can burn up noticeable CPU time: brute-force - * determination of whether number @a n is prime. Returns 0 if - * it is prime, or the smallest factor if it is not prime. - * @a min_factor and @a max_factor can be used to partition the work - * among threads. For just one thread, typical values are 2 and - * n/2. - */ - extern ACE_Export u_long is_prime (const u_long n, - const u_long min_factor, - const u_long max_factor); - - /// Map troublesome win32 errno values to values that standard C - /// strerr function understands. Thank you Microsoft. - extern ACE_Export int map_errno (int error); - - /// Returns a string containing the error message corresponding to a - /// WinSock error. This works around an omission in the Win32 API. - /// @internal - extern ACE_Export const ACE_TCHAR * sock_error (int error); - - /// Determins whether the given error code corresponds to to a - /// WinSock error. If so returns true, false otherwise. - /// @internal - extern ACE_Export bool is_sock_error (int error); - - /** - * Checks if process with {pid} is still alive. Returns 1 if it is - * still alive, 0 if it isn't alive, and -1 if something weird - * happened. - */ - extern ACE_Export int process_active (pid_t pid); - - /** - * Terminate the process abruptly with id @a pid. On Win32 platforms - * this uses {TerminateProcess} and on POSIX platforms is uses - * {kill} with the -9 (SIGKILL) signal, which cannot be caught or - * ignored. Note that this call is potentially dangerous to use - * since the process being terminated may not have a chance to - * cleanup before it shuts down. - */ - extern ACE_Export int terminate_process (pid_t pid); - - /** - * 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 - * {object} will provide uniqueness between other "live" objects in - * the same process. The uniqueness of this name is therefore only - * valid for the life of {object}. - */ - ACE_NAMESPACE_INLINE_FUNCTION void unique_name (const void *object, - ACE_TCHAR *name, - size_t length); - - /// Computes the base 2 logarithm of {num}. - ACE_NAMESPACE_INLINE_FUNCTION u_long log2 (u_long num); - - /// Hex conversion utility. - ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR nibble2hex (u_int n); - - /// Convert a hex character to its byte representation. - ACE_NAMESPACE_INLINE_FUNCTION u_char hex2byte (ACE_TCHAR c); - - // = Set/get the debug level. - extern ACE_Export bool debug (void); - extern ACE_Export void debug (bool onoff); - - /// Wrapper facade for @c select that uses @c ACE_Handle_Sets. - extern ACE_Export int select (int width, - ACE_Handle_Set *readfds, - ACE_Handle_Set *writefds = 0, - ACE_Handle_Set *exceptfds = 0, - const ACE_Time_Value *timeout = 0); - - /// Wrapper facade for the most common use of @c select that uses - /// @c ACE_Handle_Sets. - extern ACE_Export int select (int width, - ACE_Handle_Set &readfds, - const ACE_Time_Value *timeout = 0); - - /// Timed wait for handle to get read ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_read_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); - - /// Timed wait for handle to get write ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_write_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); - - /// Timed wait for handle to get exception ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_exception_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); - - /// Timed wait for handle to get read, write, or exception ready. - extern ACE_Export int handle_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int read_ready, - int write_ready, - int exception_ready); - - /// Wait for @a timeout before proceeding to a @c recv operation. - /// @a val keeps track of whether we're in non-blocking mode or - /// not. - extern ACE_Export int enter_recv_timedwait (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int &val); - - /// Wait for @a timeout before proceeding to a @c send operation. - /// @a val keeps track of whether we're in non-blocking mode or - /// not. - extern ACE_Export int enter_send_timedwait (ACE_HANDLE handle, - const ACE_Time_Value* timeout, - int &val); - - /// This makes sure that @a handle is set into non-blocking mode. - /// @a val keeps track of whether were in non-blocking mode or not. - extern ACE_Export void record_and_set_non_blocking_mode (ACE_HANDLE handle, - int &val); - - /// Cleanup after a timed operation, restore the appropriate - /// non-blocking status of @a handle. - extern ACE_Export void restore_non_blocking_mode (ACE_HANDLE handle, - int val); - - // private: - // These functions aren't meant to be used internally, so they are - // not exported. - - // - // = Recv_n helpers - // - - ACE_NAMESPACE_INLINE_FUNCTION ssize_t recv_i (ACE_HANDLE handle, - void *buf, - size_t len); - - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - size_t *bytes_transferred); - - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - -#if defined (ACE_HAS_TLI) - - extern ACE_Export ssize_t t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - size_t *bytes_transferred); - - extern ACE_Export ssize_t t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - -#endif /* ACE_HAS_TLI */ - - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bytes_transferred); - - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - - extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bytes_transferred); - - extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - - // - // = Send_n helpers - // - - ACE_NAMESPACE_INLINE_FUNCTION ssize_t send_i (ACE_HANDLE handle, - const void *buf, - size_t len); - - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bytes_transferred); - - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - -#if defined (ACE_HAS_TLI) - - extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bytes_transferred); - - extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - -#endif /* ACE_HAS_TLI */ - - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bytes_transferred); - - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - - extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - size_t *bytes_transferred); - - extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); - -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ACE.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ACE_H */ - diff --git a/dep/include/ace/ACE.inl b/dep/include/ace/ACE.inl deleted file mode 100644 index 8e92cb2bc39..00000000000 --- a/dep/include/ace/ACE.inl +++ /dev/null @@ -1,349 +0,0 @@ -// -*- C++ -*- -// -// $Id: ACE.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_Thread.h" -#include "ace/OS_NS_ctype.h" -#include "ace/OS_NS_sys_socket.h" - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Wrappers for methods that have been moved to ACE_OS. - -ACE_INLINE ssize_t -ACE::read_n (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bytes_transferred) -{ - return ACE_OS::read_n (handle, - buf, - len, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::write_n (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bytes_transferred) -{ - return ACE_OS::write_n (handle, - buf, - len, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::recv_n_i (handle, - buf, - len, - flags, - bytes_transferred); - else - return ACE::recv_n_i (handle, - buf, - len, - flags, - timeout, - bytes_transferred); -} - -#if defined (ACE_HAS_TLI) - -ACE_INLINE ssize_t -ACE::t_rcv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::t_rcv_n_i (handle, - buf, - len, - flags, - bytes_transferred); - else - return ACE::t_rcv_n_i (handle, - buf, - len, - flags, - timeout, - bytes_transferred); -} - -#endif /* ACE_HAS_TLI */ - -ACE_INLINE ssize_t -ACE::recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::recv_n_i (handle, - buf, - len, - bytes_transferred); - else - return ACE::recv_n_i (handle, - buf, - len, - timeout, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::recvv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::recvv_n_i (handle, - iov, - iovcnt, - bytes_transferred); - else - return ACE::recvv_n_i (handle, - iov, - iovcnt, - timeout, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::send_n_i (handle, - buf, - len, - flags, - bytes_transferred); - else - return ACE::send_n_i (handle, - buf, - len, - flags, - timeout, - bytes_transferred); -} - -#if defined (ACE_HAS_TLI) - -ACE_INLINE ssize_t -ACE::t_snd_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::t_snd_n_i (handle, - buf, - len, - flags, - bytes_transferred); - else - return ACE::t_snd_n_i (handle, - buf, - len, - flags, - timeout, - bytes_transferred); -} - -#endif /* ACE_HAS_TLI */ - -ACE_INLINE ssize_t -ACE::send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::send_n_i (handle, - buf, - len, - bytes_transferred); - else - return ACE::send_n_i (handle, - buf, - len, - timeout, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::sendv_n (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - if (timeout == 0) - return ACE::sendv_n_i (handle, - iov, - iovcnt, - bytes_transferred); - else - return ACE::sendv_n_i (handle, - iov, - iovcnt, - timeout, - bytes_transferred); -} - -ACE_INLINE ssize_t -ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len) -{ -#if defined (ACE_WIN32) || defined (HPUX) - return ACE_OS::send (handle, (const char *) buf, len); -#else - return ACE_OS::write (handle, (const char *) buf, len); -#endif /* ACE_WIN32 */ -} - -ACE_INLINE ssize_t -ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len) -{ -#if defined (ACE_WIN32) || defined (ACE_OPENVMS) || defined (ACE_TANDEM_T1248_PTHREADS) - return ACE_OS::recv (handle, (char *) buf, len); -#else - return ACE_OS::read (handle, (char *) buf, len); -#endif /* ACE_WIN32 */ -} - -ACE_INLINE int -ACE::handle_read_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout) -{ - return ACE::handle_ready (handle, - timeout, - 1, - 0, - 0); -} - -ACE_INLINE int -ACE::handle_write_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout) -{ - return ACE::handle_ready (handle, - timeout, - 0, - 1, - 0); -} - -ACE_INLINE int -ACE::handle_exception_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout) -{ - return ACE::handle_ready (handle, - timeout, - 0, - 0, - 1); -} - -ACE_INLINE void -ACE::strdelete (char *s) -{ - delete [] s; -} - -#if defined (ACE_HAS_WCHAR) -ACE_INLINE void -ACE::strdelete (wchar_t *s) -{ - delete [] s; -} -#endif /* ACE_HAS_WCHAR */ - -ACE_INLINE void -ACE::unique_name (const void *object, - ACE_TCHAR *name, - size_t length) -{ - ACE_OS::unique_name (object, name, length); -} - -ACE_INLINE u_long -ACE::log2 (u_long num) -{ - u_long log = 0; - - for (; num > 1; ++log) - num >>= 1; - - return log; -} - -ACE_INLINE ACE_TCHAR -ACE::nibble2hex (u_int n) -{ - // Hexadecimal characters. -#if defined (ACE_VXWORKS) && !defined (__DCPLUSPLUS__) - // temporary solution to prevent Windriver GNU toolchains from spewing - // loads of warnings when inlining. - // problem (incorrect warning leftover from older GNU) has been reported as - // TSR to Windriver. - const ACE_TCHAR hex_chars[] = ACE_TEXT ("0123456789abcdef"); -#else - static const ACE_TCHAR hex_chars[] = ACE_TEXT ("0123456789abcdef"); -#endif - - // Yes, this works for UNICODE - return hex_chars[n & 0x0f]; -} - -ACE_INLINE int -ACE::map_errno (int error) -{ -#if defined (ACE_WIN32) - switch (error) - { - case WSAEWOULDBLOCK: - return EAGAIN; // Same as UNIX errno EWOULDBLOCK. - } -#endif /* ACE_WIN32 */ - - return error; -} - -ACE_INLINE u_char -ACE::hex2byte (ACE_TCHAR c) -{ - if (ACE_OS::ace_isdigit (c)) - return (u_char) (c - ACE_TEXT ('0')); - else if (ACE_OS::ace_islower (c)) - return (u_char) (10 + c - ACE_TEXT ('a')); - else - return (u_char) (10 + c - ACE_TEXT ('A')); -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ACE_export.h b/dep/include/ace/ACE_export.h deleted file mode 100644 index 60e79b01f1f..00000000000 --- a/dep/include/ace/ACE_export.h +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- -// $Id: ACE_export.h 80826 2008-03-04 14:51:23Z wotte $ -// Definition for Win32 Export directives. -// This file is generated automatically by -// generate_export_file.pl -// ------------------------------ - -#ifndef ACE_EXPORT_H -#define ACE_EXPORT_H - -#include "ace/config-lite.h" - -#if defined (ACE_AS_STATIC_LIBS) - -# if !defined (ACE_HAS_DLL) -# define ACE_HAS_DLL 0 -# endif /* ! ACE_HAS_DLL */ -#else -# if !defined (ACE_HAS_DLL) -# define ACE_HAS_DLL 1 -# endif /* ! ACE_HAS_DLL */ -#endif /* ACE_AS_STATIC_LIB */ - -#if defined (ACE_HAS_DLL) -# if (ACE_HAS_DLL == 1) -# if defined (ACE_BUILD_DLL) -# define ACE_Export ACE_Proper_Export_Flag -# define ACE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else -# define ACE_Export ACE_Proper_Import_Flag -# define ACE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_BUILD_DLL */ -# else -# define ACE_Export -# define ACE_SINGLETON_DECLARATION(T) -# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ! ACE_HAS_DLL == 1 */ -#else -# define ACE_Export -# define ACE_SINGLETON_DECLARATION(T) -# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_HAS_DLL */ - -// Added by hand to help with ACE_OS namespace -#if defined (__TANDEM) && defined (USE_EXPLICIT_EXPORT) -#define ACE_NAMESPACE_STORAGE_CLASS ACE_EXPORT_MACRO extern -#else -#define ACE_NAMESPACE_STORAGE_CLASS extern ACE_EXPORT_MACRO -#endif - -#if defined (__ACE_INLINE__) -# if defined (_MSC_VER) || defined (__MINGW32__) || defined (CYGWIN32) || \ - (defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x560) || \ - (defined (__HP_aCC) && (__HP_aCC >= 60500)) || \ - (defined (__sgi) && \ - defined (_COMPILER_VERSION) && _COMPILER_VERSION <= 730) -# define ACE_NAMESPACE_INLINE_FUNCTION inline -# else -# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS inline -# endif -# define ACE_INLINE_TEMPLATE_FUNCTION inline -#else -# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS -// Microsoft Visual C++ will accept 'extern'; others refuse. -# if defined (_MSC_VER) || defined (__BORLANDC__) -# define ACE_INLINE_TEMPLATE_FUNCTION ACE_Export -# else -# define ACE_INLINE_TEMPLATE_FUNCTION -# endif -#endif - -#endif /* ACE_EXPORT_H */ - -// End of auto generated file. - diff --git a/dep/include/ace/ARGV.h b/dep/include/ace/ARGV.h deleted file mode 100644 index c2995a451f2..00000000000 --- a/dep/include/ace/ARGV.h +++ /dev/null @@ -1,334 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file ARGV.h - * - * $Id: ARGV.h 81156 2008-03-30 20:56:47Z iliyan $ - * - * @author Doug Schmidt - * @author Everett Anderson - */ -//========================================================================== - -#ifndef ACE_ARGUMENT_VECTOR_H -#define ACE_ARGUMENT_VECTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/Unbounded_Queue.h" - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_ARGV_Queue_Entry_T - * - * @brief An entry in the queue which keeps user supplied arguments. - */ -template -class ACE_ARGV_Queue_Entry_T -{ -public: - // = Initialization and termination. - /// Initialize a ACE_ARGV_Queue_Entry_T. - ACE_ARGV_Queue_Entry_T (void); - - /** - * Initialize a ACE_ARGV_Queue_Entry_T. - * - * @param arg Pointer to an argument - * - * @param quote_arg The argument @a arg need to be quoted - * while adding to the vector. - */ - ACE_ARGV_Queue_Entry_T (const CHAR_TYPE *arg, - bool quote_arg); - - /** - * Initialize a ACE_ARGV_Queue_Entry_T. - * - * @param entry Pointer to a queue entry - */ - ACE_ARGV_Queue_Entry_T (const ACE_ARGV_Queue_Entry_T &entry); - - /// We need this destructor to keep some compilers from complaining. - /// It's just a no-op, however. - ~ACE_ARGV_Queue_Entry_T (void); - - /// Dump the state of this object. - void dump (void) const; - - // Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Pointer to the argument. - const CHAR_TYPE * arg_; - - /// The argument need to be quoted while adding to the vector. - bool quote_arg_; -}; - -/** - * @class ACE_ARGV_T - * - * @brief Builds a counted argument vector (ala argc/argv) from either - * a string or a set of separate tokens. This class preserves whitespace - * within tokens only if the whitespace-containing token is enclosed in - * either single (') or double (") quotes. This is consistent with the - * expected behavior if an argument vector obtained using this class is - * passed to, for example, ACE_Get_Opt. - * - * This class can substitute environment variable values for tokens that - * are environment variable references (e.g., @c $VAR). This only works - * if the token is an environment variable reference and nothing else; it - * doesn't substitute environment variable references within a token. - * For example, @c $HOME/file will not substitute the value of the HOME - * environment variable. - */ -template -class ACE_ARGV_T -{ -public: - // = Initialization and termination. - /** - * Splits the specified string into an argument vector. Arguments in the - * string are delimited by whitespace. Whitespace-containing arguments - * must be enclosed in quotes, either single (') or double ("). - * - * @param buf A nul-terminated CHAR_TYPE array to split into arguments - * for the vector. - * - * @param substitute_env_args If non-zero, any token that is an - * environment variable reference (e.g., @c $VAR) will have - * its environment variable value in the resultant vector - * in place of the environment variable name. - */ - explicit ACE_ARGV_T (const CHAR_TYPE buf[], - bool substitute_env_args = true); - - /** - * Initializes the argument vector from a set of arguments. Any environment - * variable references are translated (if applicable) during execution of - * this method. In contrast with ACE_ARGV_T(CHAR_TYPE *[], bool, bool), this - * ctor does not require argv to be 0-terminated as the number of arguments - * is provided explicitely. - * - * @param argc The number of arguments in the argv array. - * - * @param argv An array of tokens to initialize the object with. All needed - * data is copied from @a argv during this call; the pointers - * in @a argv are not needed after this call, and the memory - * referred to by @a argv is not referenced by this object. - * - * @param substitute_env_args If non-zero, any element of @a argv that is - * an environment variable reference (e.g., @c $VAR) will have - * its environment variable value in the resultant vector - * in place of the environment variable name. - * - * @param quote_args If non-zero each argument @a argv[i] needs to - * be enclosed in double quotes ('"'). - */ - explicit ACE_ARGV_T (int argc, - CHAR_TYPE *argv[], - bool substitute_env_args = true, - bool quote_args = false); - - /** - * Initializes the argument vector from a set of arguments. Any environment - * variable references are translated (if applicable) during execution of - * this method. - * - * @param argv An array of tokens to initialize the object with. The - * array must be terminated with a 0 pointer. All needed - * data is copied from @a argv during this call; the pointers - * in @a argv are not needed after this call, and the memory - * referred to by @a argv is not referenced by this object. - * - * @param substitute_env_args If non-zero, any element of @a argv that is - * an environment variable reference (e.g., @c $VAR) will have - * its environment variable value in the resultant vector - * in place of the environment variable name. - * - * @param quote_args If non-zero each argument @a argv[i] needs to - * be enclosed in double quotes ('"'). - */ - explicit ACE_ARGV_T (CHAR_TYPE *argv[], - bool substitute_env_args = true, - bool quote_args = false); - - /** - * Initializes the argument vector from two combined argument vectors. - * - * @param first_argv An array of tokens to initialize the object with. - * The array must be terminated with a 0 pointer. - * @param second_argv An array of tokens that is concatenated with the - * the tokens in @a first_argv. The array must be - * terminated with a 0 pointer. - * @param substitute_env_args If non-zero, any element of @a first_argv - * or @a second_argv that is an environment variable - * reference (e.g., @c $VAR) will have its environment - * variable value in the resultant vector in place - * of the environment variable name. - * - * @param quote_args If non-zero each arguments @a first_argv[i] and - * @a second_argv[i] needs to be enclosed - * in double quotes ('"'). - */ - ACE_ARGV_T (CHAR_TYPE *first_argv[], - CHAR_TYPE *second_argv[], - bool substitute_env_args = true, - bool quote_args = false); - - /** - * Initialize this object so arguments can be added later using one - * of the add methods. This is referred to as the @i iterative method - * of adding arguments to this object. - */ - explicit ACE_ARGV_T (bool substitute_env_args = true); - - /// Destructor. - ~ACE_ARGV_T (void); - - /** @name Accessor methods - * - * These methods access the argument vector contained in this object. - */ - //@{ - /** - * Returns the specified element of the current argument vector. - * - * @param index Index to the desired element. - * - * @retval Pointer to the indexed string. - * @retval 0 if @a index is out of bounds. - */ - const CHAR_TYPE *operator[] (size_t index); - - /** - * Returns the current argument vector. The returned pointers are to data - * maintained internally to this class. Do not change or delete either the - * pointers or the memory to which they refer. - */ - CHAR_TYPE **argv (void); - - /// Returns the current number of arguments. - int argc (void) const; - - /** - * Returns a single string form of the current arguments. The returned - * pointer refers to memory maintained internally to this class. Do not - * change or delete it. - */ - const CHAR_TYPE *buf (void); - - //@} - - /// Dump the state of this object. - void dump (void) const; - - // Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /** - * Add another argument. This only works in the iterative mode. - * - * @note This method copies the specified pointer, but not the data - * contained in the referenced memory. Thus, if the content of - * the memory referred to by @a next_arg are changed after this - * method returns, the results are undefined. - * - * @param next_arg Pointer to the next argument to add to the vector. - * - * @param quote_arg The argument @a next_arg need to be quoted while - * adding to the vector. - * - * @retval 0 on success; -1 on failure. Most likely @c errno values are: - * - EINVAL: This object is not in iterative mode. - * - ENOMEM: Not enough memory available to save @a next_arg. - */ - int add (const CHAR_TYPE *next_arg, bool quote_arg = false); - - /** - * Add an array of arguments. This only works in the iterative mode. - * - * @note This method copies the specified pointers, but not the data - * contained in the referenced memory. Thus, if the content of - * the memory referred to by any of the @a argv elements is - * changed after this method returns, the results are undefined. - * - * @param argv Pointers to the arguments to add to the vector. - * @a argv must be terminated by a 0 pointer. - * - * @param quote_args If non-zero each argument @a argv[i] needs to - * be enclosed in double quotes ('"'). - * - * @retval 0 on success; -1 on failure. Most likely @c errno values are: - * - EINVAL: This object is not in iterative mode. - * - ENOMEM: Not enough memory available to save @a next_arg. - */ - int add (CHAR_TYPE *argv[], bool quote_args = false); - -private: - /// Copy constructor not implemented. - ACE_UNIMPLEMENTED_FUNC (ACE_ARGV_T (const ACE_ARGV_T&)) - - /// Assignment operator not implemented. - ACE_UNIMPLEMENTED_FUNC (ACE_ARGV_T operator= (const ACE_ARGV_T&)) - - /// Creates buf_ from the queue of added args, deletes previous buf_. - int create_buf_from_queue (void); - - /// Converts buf_ into the CHAR_TYPE *argv[] format. - int string_to_argv (void); - - /// Replace args with environment variable values? - bool substitute_env_args_; - - bool iterative_; - - /// Number of arguments in the ARGV array. - int argc_; - - /// The array of string arguments. - CHAR_TYPE **argv_; - - /// Buffer containing the contents. - CHAR_TYPE *buf_; - - /// Total length of the arguments in the queue, not counting - /// separating spaces - size_t length_; - - /// Queue which keeps user supplied arguments. This is only - /// active in the "iterative" mode. - ACE_Unbounded_Queue > queue_; -}; - -typedef ACE_ARGV_Queue_Entry_T ACE_ARGV_Queue_Entry; -typedef ACE_ARGV_T ACE_ARGV; - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ARGV.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/ARGV.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("ARGV.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_ARGUMENT_VECTOR_H */ - diff --git a/dep/include/ace/ARGV.inl b/dep/include/ace/ARGV.inl deleted file mode 100644 index fdc5b13d7c3..00000000000 --- a/dep/include/ace/ARGV.inl +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- C++ -*- */ -// $Id: ARGV.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Global_Macros.h" - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_ARGV_Queue_Entry_T::ACE_ARGV_Queue_Entry_T (void) - : arg_(0), - quote_arg_(false) -{ - // No-op -} - -template ACE_INLINE -ACE_ARGV_Queue_Entry_T::ACE_ARGV_Queue_Entry_T (const CHAR_TYPE *arg, - bool quote_arg) - : arg_(arg), - quote_arg_(quote_arg) -{ - // No-op -} - -template ACE_INLINE -ACE_ARGV_Queue_Entry_T::ACE_ARGV_Queue_Entry_T (const ACE_ARGV_Queue_Entry_T &entry) - : arg_(entry.arg_), - quote_arg_(entry.quote_arg_) -{ - // No-op -} - -template ACE_INLINE -ACE_ARGV_Queue_Entry_T::~ACE_ARGV_Queue_Entry_T (void) -{ - // No-op just to keep some compilers happy... -} - -// Return the number of args -template -ACE_INLINE int -ACE_ARGV_T::argc (void) const -{ - ACE_TRACE ("ACE_ARGV_T::argc"); - // Try to create the argv_ if it isn't there - ACE_ARGV_T *nonconst_this = - const_cast *> (this); - (void) nonconst_this->argv (); - return this->argc_; -} - -// Return the arguments in a space-separated string -template -ACE_INLINE const CHAR_TYPE * -ACE_ARGV_T::buf (void) -{ - ACE_TRACE ("ACE_ARGV_T::buf"); - - if (this->buf_ == 0 && this->iterative_) - this->create_buf_from_queue (); - - return (const CHAR_TYPE *) this->buf_; -} - -// Return the arguments in an entry-per-argument array - -template -ACE_INLINE CHAR_TYPE ** -ACE_ARGV_T::argv (void) -{ - ACE_TRACE ("ACE_ARGV_T::argv"); - - // Try to create the argv_ if it isn't there - if (this->argv_ == 0) - { - if (this->iterative_ && this->buf_ == 0) - this->create_buf_from_queue (); - - // Convert buf_ to argv_ - if (this->string_to_argv () == -1) - return (CHAR_TYPE **) 0; - } - - return (CHAR_TYPE **) this->argv_; -} - -// Subscript operator. - -template -ACE_INLINE const CHAR_TYPE * -ACE_ARGV_T::operator[] (size_t i) -{ - ACE_TRACE ("ACE_ARGV_T::operator[]"); - - // Don't go out of bounds. - if (i >= static_cast (this->argc_)) - return 0; - - return (const CHAR_TYPE *) this->argv ()[i]; -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_Acceptor.h b/dep/include/ace/ATM_Acceptor.h deleted file mode 100644 index 762a8c2122c..00000000000 --- a/dep/include/ace/ATM_Acceptor.h +++ /dev/null @@ -1,122 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ATM_Acceptor.h - * - * $Id: ATM_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//============================================================================= - -#ifndef ACE_ATM_ACCEPTOR_H -#define ACE_ATM_ACCEPTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#include "ace/ATM_Stream.h" -#include "ace/ATM_Params.h" -#include "ace/ATM_QoS.h" - -#if defined (ACE_HAS_LINUX_ATM) -#include /**/ "atm.h" -#endif /* ACE_HAS_LINUX_ATM */ - -#if defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) -#include "ace/SOCK_Acceptor.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_SOCK_Acceptor ATM_Acceptor; -ACE_END_VERSIONED_NAMESPACE_DECL -#elif defined (ACE_HAS_FORE_ATM_XTI) -#include "ace/TLI_Acceptor.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_TLI_Acceptor ATM_Acceptor; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif // ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -class ACE_Time_Value; - -/** - * @class ACE_ATM_Acceptor - * - * @brief Defines the member functions for ACE_ATM_Acceptor abstraction. - * - * This class wraps up the ACE_SOCK_Acceptor and ACE_TLI_Acceptor - * to make the mechanism for the ATM protocol transparent. - */ -class ACE_Export ACE_ATM_Acceptor -{ - -public: - // = Initialization and termination methods. - /// Default constructor. - ACE_ATM_Acceptor (void); - - ~ACE_ATM_Acceptor (); - - /// Initiate a passive mode connection. - ACE_ATM_Acceptor (const ACE_Addr &remote_sap, - int backlog = ACE_DEFAULT_BACKLOG, - ACE_ATM_Params params = ACE_ATM_Params()); - - /// Initiate a passive mode socket. - ACE_HANDLE open (const ACE_Addr &remote_sap, - int backlog = ACE_DEFAULT_BACKLOG, - ACE_ATM_Params params = ACE_ATM_Params()); - - /// Close down the acceptor and release resources. - int close (void); - - // = Passive connection acceptance method. - - /// Accept a new data transfer connection. A @a timeout of 0 means - /// block forever, a @a timeout of {0, 0} means poll. @a restart == 1 - /// means "restart if interrupted." - int accept (ACE_ATM_Stream &new_sap, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0, - ACE_ATM_Params params = ACE_ATM_Params(), - ACE_ATM_QoS qos = ACE_ATM_QoS()); - - /// Get the local address currently listening on - int get_local_addr( ACE_ATM_Addr &local_addr ); - - // = Meta-type info - typedef ACE_ATM_Addr PEER_ADDR; - typedef ACE_ATM_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - ATM_Acceptor acceptor_; -}; - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_Acceptor.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_ACCEPTOR_H */ - diff --git a/dep/include/ace/ATM_Acceptor.inl b/dep/include/ace/ATM_Acceptor.inl deleted file mode 100644 index fa60c4ad89a..00000000000 --- a/dep/include/ace/ATM_Acceptor.inl +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_Acceptor.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_ATM_Acceptor::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_Acceptor::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_ATM_Acceptor::ACE_ATM_Acceptor (const ACE_Addr &remote_sap, - int backlog, - ACE_ATM_Params params) -{ - ACE_TRACE ("ACE_ATM_Acceptor::ACE_ATM_Acceptor"); - - //FUZZ: disable check_for_lack_ACE_OS - if (open (remote_sap, backlog, params) < 0) - //FUZZ: enable check_for_lack_ACE_OS - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_ATM_Acceptor::ACE_ATM_Acceptor"))); -} - -ACE_INLINE -int -ACE_ATM_Acceptor::close (void) -{ -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) - return (acceptor_.close()); -#else - return 0; -#endif // ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_Addr.h b/dep/include/ace/ATM_Addr.h deleted file mode 100644 index 3c586f10a11..00000000000 --- a/dep/include/ace/ATM_Addr.h +++ /dev/null @@ -1,197 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file ATM_Addr.h - * - * $Id: ATM_Addr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//========================================================================== - -#ifndef ACE_ATM_ADDR_H -#define ACE_ATM_ADDR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#include /**/ "ace/ACE_export.h" -#include "ace/Addr.h" - -#if defined (ACE_HAS_FORE_ATM_XTI) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ATMSAPAddress ATM_Addr; -ACE_END_VERSIONED_NAMESPACE_DECL -#elif defined (ACE_HAS_FORE_ATM_WS2) -#define FORE_NAME_SPACE NS_ALL -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef struct sockaddr_atm ATM_Addr; -ACE_END_VERSIONED_NAMESPACE_DECL -#elif defined (ACE_HAS_LINUX_ATM) - -#include /**/ "atm.h" - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -//pbrandao:as Linux has this 2 structs separeted we "link it" here -typedef struct _linux_atm_addr -{ - struct sockaddr_atmsvc sockaddratmsvc; - struct atm_sap atmsap; -} ATM_Addr; -#else -typedef int ATM_Addr; -#endif /* ACE_HAS_FORE_ATM_XTI/ACE_HAS_FORE_ATM_WS2/ACE_HAS_LINUX_ATM */ - -/** - * @class ACE_ATM_Addr - * - * @brief Defines the ATM domain address family address format. - */ -class ACE_Export ACE_ATM_Addr : public ACE_Addr -{ -public: - // Constants used for ATM options - static const long LINE_RATE; - static const int OPT_FLAGS_CPID; - static const int OPT_FLAGS_PMP; - static const int DEFAULT_SELECTOR; - - // = Initialization methods. - /// Default constructor. - ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR); - - /// Copy constructor. - ACE_ATM_Addr (const ACE_ATM_Addr &, - u_char selector = DEFAULT_SELECTOR); - - /** - * Creates an ACE_ATM_Addr from an ATMSAPAddress structure. This - * is vendor specific (FORE systems). May need to change when other - * vendors are supported. - */ - ACE_ATM_Addr (const ATM_Addr *, - u_char selector = DEFAULT_SELECTOR); - - /** - * Initializes an ACE_ATM_Addr from the which can be - * "atm-address" (e.g., - * "47.0005.80.ffe100.0000.f20f.2200.0020480694f9.00") or "hostname" - * (e.g., "frisbee.cs.wustl.edu"). - */ - ACE_ATM_Addr (const ACE_TCHAR sap[], - u_char selector = DEFAULT_SELECTOR); - - /// Default dtor. - ~ACE_ATM_Addr (void); - - // = Initialization methods (useful after object construction). - /// Default initialization for non-address values (e.g., - /// t_atm_sap_addr.SVE_tag_addr, t_atm_sap_addr.SVE_tag_selector) - void init (u_char selector = DEFAULT_SELECTOR); - - /// Initializes from another ACE_ATM_Addr. - int set (const ACE_ATM_Addr &, - u_char selector = DEFAULT_SELECTOR); - - /** - * Initializes an ACE_ATM_Addr from an ATMSAPAddress/sockaddr_atm - * structure. This is vendor specific (FORE systems). May need to - * change when other vendors are supported. - */ - int set (const ATM_Addr *, - u_char selector = DEFAULT_SELECTOR); - - /** - * Initializes an ACE_ATM_Addr from the which can be - * "atm-address" (e.g., - * "47.0005.80.ffe100.0000.f20f.2200.0020480694f9.00") or "hostname" - * (e.g., "frisbee.cs.wustl.edu"). - */ - int set (const ACE_TCHAR sap[], - u_char selector = DEFAULT_SELECTOR); - - /** - * Initializes an ACE_ATM_Addr from the which can be - * "atm-address" (e.g., - * "47.0005.80.ffe100.0000.f20f.2200.0020480694f9.00") or "hostname" - * (e.g., "frisbee.cs.wustl.edu"). - */ - virtual int string_to_addr (const ACE_TCHAR sap[]); - - /** - * Return the character representation of the ATM address (e.g., - * "47.0005.80.ffe100.0000.f20f.2200.0020480694f9.00") storing it in - * the @a addr (which is assumed to be bytes long). This - * version is reentrant. Returns -1 if the of the @a addr - * is too small, else 0. - */ - virtual int addr_to_string (ACE_TCHAR addr[], - size_t addrlen) const; - - /** - * Return the character representation of the ATM address (e.g., - * "47.0005.80.ffe100.0000.f20f.2200.0020480694f9.00"). Returns -1 - * if the of the is too small, else 0.(This version - * is non-reentrant since it returns a pointer to a static data - * area.) - */ - const ACE_TCHAR *addr_to_string (void) const; - - /// Return a pointer to the underlying network address. - virtual void *get_addr (void) const; - - /// Set a pointer to the address. - virtual void set_addr (void *, int); - - /// Return the selector for network address. - u_char get_selector (void) const; - - /// Set the selector for the network address. - void set_selector (u_char selector); - - /** - * Compare two addresses for equality. The addresses are considered - * equal if they contain the same ATM address. Q: Is there any - * other check for equality needed for ATM? - */ - bool operator == (const ACE_ATM_Addr &SAP) const; - - /// Compare two addresses for inequality. - bool operator != (const ACE_ATM_Addr &SAP) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -// char *construct_options (ACE_HANDLE fd, -// int qos_kb, -// int flags, -// long *optsize); -// // Construct options for ATM connections - -private: - ATM_Addr atm_addr_; -}; - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_ADDR_H */ - diff --git a/dep/include/ace/ATM_Addr.inl b/dep/include/ace/ATM_Addr.inl deleted file mode 100644 index 55f43d6613a..00000000000 --- a/dep/include/ace/ATM_Addr.inl +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE u_char -ACE_ATM_Addr::get_selector (void) const -{ - ACE_TRACE ("ACE_ATM_Addr::get_selector"); -#if defined (ACE_HAS_FORE_ATM_XTI) - return atm_addr_.sap.t_atm_sap_addr.address[ATMNSAP_ADDR_LEN - 1]; -#elif defined (ACE_HAS_FORE_ATM_WS2) - return atm_addr_.satm_number.Addr[ ATM_ADDR_SIZE - 1 ]; -#elif defined (ACE_HAS_LINUX_ATM) - return atm_addr_.sockaddratmsvc.sas_addr.prv[ATM_ESA_LEN - 1]; -#else - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -ACE_INLINE void -ACE_ATM_Addr::set_selector (u_char selector) -{ - ACE_TRACE ("ACE_ATM_Addr::set_selector"); -#if defined (ACE_HAS_FORE_ATM_XTI) - atm_addr_.sap.t_atm_sap_addr.address[ATMNSAP_ADDR_LEN - 1] = selector; -#elif defined (ACE_HAS_FORE_ATM_WS2) - atm_addr_.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] = selector; -#elif defined (ACE_HAS_LINUX_ATM) - atm_addr_.sockaddratmsvc.sas_addr.prv[ATM_ESA_LEN - 1] = selector; -#else - ACE_UNUSED_ARG (selector); -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_Connector.h b/dep/include/ace/ATM_Connector.h deleted file mode 100644 index e8657e91a23..00000000000 --- a/dep/include/ace/ATM_Connector.h +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file ATM_Connector.h - * - * $Id: ATM_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//============================================================================= - -#ifndef ACE_ATM_CONNECTOR_H -#define ACE_ATM_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#include "ace/ATM_Stream.h" -#include "ace/ATM_Params.h" -#include "ace/ATM_QoS.h" - -#if defined (ACE_WIN32) || defined (ACE_HAS_LINUX_ATM) -#include "ace/SOCK_Connector.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_SOCK_Connector ATM_Connector; -ACE_END_VERSIONED_NAMESPACE_DECL -#else -#include "ace/XTI_ATM_Mcast.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_XTI_ATM_Mcast ATM_Connector; -// Open versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL -#endif - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_ATM_Connector - * - * @brief Defines an active connection factory for the ACE_ATM C++ - * wrappers. - */ -class ACE_Export ACE_ATM_Connector -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_ATM_Connector (void); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The are the parameters needed for either socket - * or XTI/ATM connections. The @a timeout is the amount of time to - * wait to connect. If it's 0 then we block indefinitely. If - * *timeout == {0, 0} then the connection is done using non-blocking - * mode. In this case, if the connection can't be made immediately - * the value of -1 is returned with @c errno == EWOULDBLOCK. If - * *timeout > {0, 0} then this is the maximum amount of time to wait before - * timing out. If the time expires before the connection is made - * @c errno == ETIME. The @a local_sap is the value of local address - * to bind to. If it's the default value of then - * the user is letting the OS do the binding. If @a reuse_addr == 1 - * then the is reused, even if it hasn't been cleanedup yet. - */ - ACE_ATM_Connector (ACE_ATM_Stream &new_stream, - const ACE_ATM_Addr &remote_sap, - ACE_ATM_Params params = ACE_ATM_Params(), - ACE_ATM_QoS options = ACE_ATM_QoS(), - ACE_Time_Value *timeout = 0, - const ACE_ATM_Addr &local_sap = ACE_ATM_Addr( "", 0 ), - int reuse_addr = 0, -#if defined (ACE_WIN32) - int flags = 0, -#else - int flags = O_RDWR, -#endif /* ACE_WIN32 */ - int perms = 0); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The are the parameters needed for either socket - * or XTI/ATM connections. The @a timeout is the amount of time to - * wait to connect. If it's 0 then we block indefinitely. If - * *timeout == {0, 0} then the connection is done using non-blocking - * mode. In this case, if the connection can't be made immediately - * the value of -1 is returned with @c errno == EWOULDBLOCK. If - * *timeout > {0, 0} then this is the maximum amount of time to wait before - * timing out. If the time expires before the connection is made - * @c errno == ETIME. The @a local_sap is the value of local address - * to bind to. If it's the default value of then - * the user is letting the OS do the binding. If @a reuse_addr == 1 - * then the is reused, even if it hasn't been cleanedup yet. - */ - int connect (ACE_ATM_Stream &new_stream, - const ACE_ATM_Addr &remote_sap, - ACE_ATM_Params params = ACE_ATM_Params(), - ACE_ATM_QoS options = ACE_ATM_QoS(), - ACE_Time_Value *timeout = 0, - const ACE_ATM_Addr &local_sap = ACE_ATM_Addr( "", - 0 ), - int reuse_addr = 0, -#if defined (ACE_WIN32) - int flags = 0, -#else - int flags = O_RDWR, -#endif /* ACE_WIN32 */ - int perms = 0); - - /** - * Try to complete a non-blocking connection. - * If connection completion is successful then @a new_stream contains - * the connected ACE_SOCK_Stream. If @a remote_sap is non-NULL then it - * will contain the address of the connected peer. - */ - int complete (ACE_ATM_Stream &new_stream, - ACE_ATM_Addr *remote_sap, - ACE_Time_Value *tv); - - /** - * Actively add a leaf to the root (i.e., point-to-multipoint). The - * @a remote_sap is the address of the leaf that we - * are trying to add. - */ - int add_leaf (ACE_ATM_Stream ¤t_stream, - const ACE_Addr &remote_sap, - ACE_ATM_QoS &qos); - - /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); - - // = Meta-type info - typedef ACE_ATM_Addr PEER_ADDR; - typedef ACE_ATM_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - ATM_Connector connector_; -}; - -// Open versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_CONNECTOR_H */ - diff --git a/dep/include/ace/ATM_Connector.inl b/dep/include/ace/ATM_Connector.inl deleted file mode 100644 index 0b89cbf0828..00000000000 --- a/dep/include/ace/ATM_Connector.inl +++ /dev/null @@ -1,132 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_ATM_Connector::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_Connector::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_ATM_Connector::ACE_ATM_Connector (ACE_ATM_Stream &new_stream, - const ACE_ATM_Addr &remote_sap, - ACE_ATM_Params params, - ACE_ATM_QoS options, - ACE_Time_Value *timeout, - const ACE_ATM_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_ATM_Connector::ACE_ATM_Connector"); - if ((ACE_HANDLE)this->connect (new_stream, - remote_sap, - params, - options, - timeout, - local_sap, - reuse_addr, - flags, - perms) == ACE_INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_ATM_Stream::ACE_ATM_Stream"))); -} - -// Try to complete a non-blocking connection. - -ACE_INLINE -int -ACE_ATM_Connector::complete (ACE_ATM_Stream &new_stream, - ACE_ATM_Addr *remote_sap, - ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_ATM_Connector::complete"); -#if defined (ACE_HAS_ATM) - return connector_.complete(new_stream.get_stream(), - remote_sap, - tv); -#else - ACE_UNUSED_ARG(new_stream); - ACE_UNUSED_ARG(remote_sap); - ACE_UNUSED_ARG(tv); - return 0; -#endif -} - -ACE_INLINE -int -ACE_ATM_Connector::add_leaf (ACE_ATM_Stream ¤t_stream, - const ACE_Addr &remote_sap, - ACE_ATM_QoS &qos) -{ - ACE_TRACE ("ACE_ATM_Connector::add_leaf"); -#if defined (ACE_HAS_FORE_ATM_XTI) - return connector_.add_leaf(current_stream.get_stream(), - remote_sap, - leaf_id, - timeout); -#elif defined (ACE_HAS_FORE_ATM_WS2) - struct sockaddr_atm *saddr = (struct sockaddr_atm *)remote_sap.get_addr(); - ACE_QoS cqos = qos.get_qos(); - int addr_len = sizeof( struct sockaddr_atm ); - - ACE_QoS_Params qos_params(0, - 0, - &cqos, - 0, - (JL_SENDER_ONLY)); - - ACE_OS::printf( "ATM_Connector::add_leaf: connecting...\n" ); - - ACE_HANDLE result = ACE_OS::join_leaf(current_stream.get_handle(), - (struct sockaddr *)saddr, - addr_len, - qos_params); - - if ( result == ACE_INVALID_HANDLE ) - ACE_OS::printf( "ATM_Connector(add_leaf): connection failed, %d\n", - ::WSAGetLastError()); - - return (result != ACE_INVALID_HANDLE); -#elif defined (ACE_HAS_LINUX_ATM) - ACE_OS::printf("ATM_Connector(add_leaf): not yet implemented in Linux \n"); - - ACE_UNUSED_ARG(current_stream); - ACE_UNUSED_ARG(remote_sap); - ACE_UNUSED_ARG(leaf_id); - ACE_UNUSED_ARG(timeout); - - return 0; -#else - ACE_UNUSED_ARG(current_stream); - ACE_UNUSED_ARG(remote_sap); - ACE_UNUSED_ARG(leaf_id); - ACE_UNUSED_ARG(timeout); - return 0; -#endif -} - -ACE_INLINE -int -ACE_ATM_Connector::reset_new_handle (ACE_HANDLE handle) -{ -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - // Reset the event association - return ::WSAEventSelect ((SOCKET) handle, - 0, - 0); -#else /* !defined ACE_HAS_WINSOCK2 */ - ACE_UNUSED_ARG (handle); - return 0; -#endif /* ACE_WIN32 */ -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_Params.h b/dep/include/ace/ATM_Params.h deleted file mode 100644 index c460afbd3c2..00000000000 --- a/dep/include/ace/ATM_Params.h +++ /dev/null @@ -1,214 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file ATM_Params.h - * - * $Id: ATM_Params.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//========================================================================== - -#ifndef ACE_ATM_PARAMS_H -#define ACE_ATM_PARAMS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#include /**/ "ace/ACE_export.h" - -#if defined (ACE_HAS_FORE_ATM_XTI) -#include "ace/TLI.h" -#define ATM_PROTOCOL_DEFAULT 0 -typedef struct t_info Param_Info; -typedef struct netbuf Param_Udata; -#elif defined (ACE_HAS_FORE_ATM_WS2) -#include "ace/SOCK.h" -#define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5 -#define ACE_XTI_ATM_DEVICE "" -typedef int Param_Info; -typedef int Param_Udata; -#elif defined (ACE_HAS_LINUX_ATM) -#include /**/ "atm.h" -#define AF_ATM PF_ATMSVC -#define ACE_XTI_ATM_DEVICE "" -#define ATM_PROTOCOL_DEFAULT ATM_AAL5 -typedef int Param_Info; -typedef int Param_Udata; -#else -#define ACE_XTI_ATM_DEVICE "" -typedef int Param_Info; -typedef int Param_Udata; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_ATM_Params - * - * @brief Wrapper class that simplifies the information passed to the ATM - * enabled ACE_ATM_Connector class. - */ -class ACE_Export ACE_ATM_Params -{ -public: - /** - * Initialize the data members. This class combines options from - * ACE_SOCK_Connector (@a protocol_family, @a protocol, , - * @a protocol_info, , and @a flags) and - * ACE_TLI_Connector (, , , , and ) - * so that either mechanism can be used transparently for ATM. - */ - ACE_ATM_Params (int rw_flag = 1, - const char device[] = ACE_XTI_ATM_DEVICE, - Param_Info *info = 0, - Param_Udata *udata = 0, - int oflag = O_RDWR, - int protocol_family = AF_ATM, - int protocol = ATM_PROTOCOL_DEFAULT, - int type = -#if defined (ACE_HAS_LINUX_ATM) - SOCK_DGRAM, -#else - SOCK_RAW, -#endif /* ACE_HAS_LINUX_ATM */ - ACE_Protocol_Info *protocol_info = 0, - ACE_SOCK_GROUP g = 0, - u_long flags - = ACE_FLAG_MULTIPOINT_C_ROOT - | ACE_FLAG_MULTIPOINT_D_ROOT, // connector by default - int reuse_addr = 0); - - /// Destructor. - ~ACE_ATM_Params (); - - /// Get protocol family. - int get_protocol_family (void) const; - - /// Set protocol family. - void set_protocol_family (int); - - /// Get protocol. - int get_protocol (void) const; - - /// Set protocol. - void set_protocol (int); - - /// Get type. - int get_type (void) const; - - /// Set type. - void set_type (int); - - /// Get protocol info. - ACE_Protocol_Info *get_protocol_info( void ); - - /// Set protocol info. - void set_protocol_info( ACE_Protocol_Info *); - - /// Get socket group. - ACE_SOCK_GROUP get_sock_group( void ); - - /// Set socket group. - void set_sock_group( ACE_SOCK_GROUP ); - - /// Get socket flags. - u_long get_flags( void ); - - /// Set socket flags. - void set_flags( u_long ); - - /// Get reuse_addr flag. - int get_reuse_addr (void) const; - - /// Set reuse_addr flag. - void set_reuse_addr (int); - - /// Get device. - const char* get_device (void) const; - - /// Get info. - Param_Info* get_info (void) const; - - /// Set info. - void set_info (Param_Info *); - - /// Get r/w flag. - int get_rw_flag (void) const; - - /// Set r/w flag. - void set_rw_flag (int); - - /// Get user data. - Param_Udata* get_user_data (void) const; - - /// Set user data. - void set_user_data (Param_Udata*); - - /// Get open flag. - int get_oflag (void) const; - - /// Set open flag. - void set_oflag (int); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Protocol family for sockets connections. - int protocol_family_; - - /// Protocol for sockets connections. - int protocol_; - - /// Type for opening sockets. - int type_; - - /// Information about the protocol. - ACE_Protocol_Info *protocol_info_; - - /// Socket group used (for sockets only). - ACE_SOCK_GROUP group_; - - /// Flags for sockets (for sockets only). - u_long flags_; - - /// Flag for reusing address for opening sockets. - int reuse_addr_; - - /// Device name for XTI/ATM connections. - const char *device_; - - /// Info for XTI/ATM connections. - Param_Info *info_; - - /// R/W flag for XTI/ATM connections. - int rw_flag_; - - /// User data for XTI/ATM connections. - Param_Udata *udata_; - - /// Open flag for XTI/ATM connections. - int oflag_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_Params.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_PARAMS_H */ - diff --git a/dep/include/ace/ATM_Params.inl b/dep/include/ace/ATM_Params.inl deleted file mode 100644 index de2a4d45127..00000000000 --- a/dep/include/ace/ATM_Params.inl +++ /dev/null @@ -1,235 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_Params.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_ATM_Params::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_Params::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_ATM_Params::ACE_ATM_Params (int rw_flag, - const char device[], - Param_Info *info, - Param_Udata *udata, - int oflag, - int protocol_family, - int protocol, - int type, - ACE_Protocol_Info *protocol_info, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) - : protocol_family_(protocol_family), - protocol_(protocol), - type_(type), - protocol_info_(protocol_info), - group_(g), - flags_(flags), - reuse_addr_(reuse_addr), - device_(device), - info_(info), - rw_flag_(rw_flag), - udata_(udata), - oflag_(oflag) -{ - ACE_TRACE ("ACE_ATM_Params::ACE_ATM_Params"); -} - -// Default dtor. -ACE_INLINE -ACE_ATM_Params::~ACE_ATM_Params (void) -{ - ACE_TRACE ("ACE_ATM_Params::~ACE_ATM_Params"); -} - -ACE_INLINE -int -ACE_ATM_Params::get_protocol_family (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_protocol_family"); - return protocol_family_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_protocol_family (int family) -{ - ACE_TRACE ("ACE_ATM_Params::set_protocol_family"); - protocol_family_ = family; -} - -ACE_INLINE -int -ACE_ATM_Params::get_protocol (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_protocol"); - return protocol_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_protocol (int protocol) -{ - ACE_TRACE ("ACE_ATM_Params::set_protocol"); - protocol_ = protocol; -} - -ACE_INLINE -int -ACE_ATM_Params::get_type (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_type"); - return type_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_type (int type) -{ - ACE_TRACE ("ACE_ATM_Params::set_type"); - type_ = type; -} - -ACE_INLINE -ACE_Protocol_Info* -ACE_ATM_Params::get_protocol_info( void ) -{ - ACE_TRACE ("ACE_ATM_Params::get_protocol_info"); - return protocol_info_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_protocol_info( ACE_Protocol_Info *protocol_info ) -{ - ACE_TRACE ("ACE_ATM_Params::set_protocol_info"); - protocol_info_ = protocol_info; -} - -ACE_INLINE -ACE_SOCK_GROUP -ACE_ATM_Params::get_sock_group( void ) -{ - ACE_TRACE ("ACE_ATM_Params::get_sock_group"); - return group_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_sock_group( ACE_SOCK_GROUP g ) -{ - ACE_TRACE ("ACE_ATM_Params::set_sock_group"); - group_ = g; -} - -ACE_INLINE -u_long -ACE_ATM_Params::get_flags( void ) -{ - ACE_TRACE ("ACE_ATM_Params::get_flags"); - return flags_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_flags( u_long flags) -{ - ACE_TRACE ("ACE_ATM_Params::set_flags"); - flags_ = flags; -} - -ACE_INLINE -int -ACE_ATM_Params::get_reuse_addr (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_reuse_addr"); - return reuse_addr_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_reuse_addr (int reuse_addr) -{ - ACE_TRACE ("ACE_ATM_Params::set_reuse_addr"); - reuse_addr_ = reuse_addr; -} - -ACE_INLINE -const char* -ACE_ATM_Params::get_device (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_device"); - return device_; -} - -ACE_INLINE -Param_Info* -ACE_ATM_Params::get_info (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_info"); - return info_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_info (Param_Info* info) -{ - ACE_TRACE ("ACE_ATM_Params::set_info"); - info_ = info; -} - -ACE_INLINE -int -ACE_ATM_Params::get_rw_flag (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_rw_flag"); - return rw_flag_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_rw_flag (int rw_flag) -{ - ACE_TRACE ("ACE_ATM_Params::set_rw_flag"); - rw_flag_ = rw_flag; -} - -ACE_INLINE -Param_Udata* -ACE_ATM_Params::get_user_data (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_user_data"); - return udata_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_user_data (Param_Udata *udata) -{ - ACE_TRACE ("ACE_ATM_Params::set_user_data"); - udata_ = udata; -} - -ACE_INLINE -int -ACE_ATM_Params::get_oflag (void) const -{ - ACE_TRACE ("ACE_ATM_Params::get_oflag"); - return oflag_; -} - -ACE_INLINE -void -ACE_ATM_Params::set_oflag (int oflag) -{ - ACE_TRACE ("ACE_ATM_Params::set_oflag"); - oflag_ = oflag; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_QoS.h b/dep/include/ace/ATM_QoS.h deleted file mode 100644 index 927005aa68d..00000000000 --- a/dep/include/ace/ATM_QoS.h +++ /dev/null @@ -1,115 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file ATM_QoS.h - * - * $Id: ATM_QoS.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//========================================================================== - -#ifndef ACE_ATM_QoS_H -#define ACE_ATM_QoS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined(ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#if defined (ACE_HAS_FORE_ATM_WS2) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// just map to WS2 GQOS struct -typedef ACE_QoS ATM_QoS; -ACE_END_VERSIONED_NAMESPACE_DECL -#elif defined (ACE_HAS_FORE_ATM_XTI) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef struct netbuf ATM_QoS; -ACE_END_VERSIONED_NAMESPACE_DECL -#elif defined (ACE_HAS_LINUX_ATM) -#include /**/ "atm.h" -#include "ace/ATM_Params.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef struct atm_qos ATM_QoS; -ACE_END_VERSIONED_NAMESPACE_DECL -#else -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef int ATM_QoS; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_HAS_FORE_ATM_WS2 || ACE_HAS_FORE_ATM_XTI || ACE_HAS_LINUX_ATM */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_ATM_QoS - * - * @brief Define the QoS parameters for ATM - * - * This class wraps up QoS parameters for both ATM/XTI and - * ATM/WinSock2 to make the mechanism for the ATM protocol - * transparent. - */ -class ACE_Export ACE_ATM_QoS -{ -public: - // Constants used for ATM options - static const long LINE_RATE; - static const int OPT_FLAGS_CPID; - static const int OPT_FLAGS_PMP; - static const int DEFAULT_SELECTOR; - static const int DEFAULT_PKT_SIZE; - - // = Initializattion and termination methods. - /// Default constructor. - ACE_ATM_QoS(int = DEFAULT_PKT_SIZE); - - /// Constructor with a CBR rate. - ACE_ATM_QoS(int, - int = DEFAULT_PKT_SIZE); - - ~ACE_ATM_QoS (); - - /// Set the rate. - void set_rate (ACE_HANDLE, - int, - int); - - /// Set CBR rate in cells per second. - void set_cbr_rate (int, - int = DEFAULT_PKT_SIZE); - - /// Get ATM_QoS struct. - ATM_QoS get_qos (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Construct QoS options. - char* construct_options(ACE_HANDLE, - int, - int, - long*); - -private: - ATM_QoS qos_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_QoS.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_QoS_H */ - diff --git a/dep/include/ace/ATM_QoS.inl b/dep/include/ace/ATM_QoS.inl deleted file mode 100644 index 52b5211190d..00000000000 --- a/dep/include/ace/ATM_QoS.inl +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_QoS.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_ATM_QoS::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_QoS::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_ATM_QoS::~ACE_ATM_QoS () -{ - ACE_TRACE ("ACE_ATM_QoS::~ACE_ATM_QoS"); -} - -ACE_INLINE -ATM_QoS -ACE_ATM_QoS::get_qos (void) -{ - ACE_TRACE ("ACE_ATM_QoS::get_qos"); - return qos_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ATM_Stream.h b/dep/include/ace/ATM_Stream.h deleted file mode 100644 index 2d31c7654d1..00000000000 --- a/dep/include/ace/ATM_Stream.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file ATM_Stream.h - * - * $Id: ATM_Stream.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//============================================================================= - -#ifndef ACE_ATM_STREAM_H -#define ACE_ATM_STREAM_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_ATM) - -#include "ace/ATM_Addr.h" -#include "ace/ATM_Params.h" - -#if defined (ACE_WIN32) -#include "ace/SOCK_Stream.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_SOCK_Stream ATM_Stream; -ACE_END_VERSIONED_NAMESPACE_DECL -#else -#include "ace/TLI_Stream.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -typedef ACE_TLI_Stream ATM_Stream; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_ATM_Stream - * - * @brief Defines the member functions for ACE_ATM_Stream abstraction. - */ -class ACE_Export ACE_ATM_Stream -{ -public: - // = Initialization and termination methods. - /// Default constructor. - ACE_ATM_Stream (void); - - // = ATM-specific open and shutdown operations. - /// open the stream. - int open (ACE_ATM_Params params = ACE_ATM_Params()); - - /// Close down and release resources. - int close (void); - - /// Get the underlying handle. - ACE_HANDLE get_handle (void) const; - - /// Get the underlying stream. - ATM_Stream& get_stream (void); - - /// Get the name of the connected host. - char* get_peer_name (void) const; - - /// Get the VPI and VCI of the stream. - int get_vpi_vci (ACE_UINT16 &vpi, - ACE_UINT16 &vci) const; - - /// Recv an n byte buffer from the connected transport mechanism. - ssize_t recv (void *buf, - size_t n, - int *flags = 0) const; - - /// Send exactly n bytes to the connected transport mechanism. - ssize_t send_n (const void *buf, - size_t n, - int flags) const; - - // = Meta-type info - typedef ACE_ATM_Addr PEER_ADDR; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Typedef'd to the appropriate stream mechanism above. - ATM_Stream stream_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/ATM_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ATM */ -#include /**/ "ace/post.h" -#endif /* ACE_ATM_STREAM_H */ - diff --git a/dep/include/ace/ATM_Stream.inl b/dep/include/ace/ATM_Stream.inl deleted file mode 100644 index 087c1ed440b..00000000000 --- a/dep/include/ace/ATM_Stream.inl +++ /dev/null @@ -1,133 +0,0 @@ -// -*- C++ -*- -// -// $Id: ATM_Stream.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_ATM_Stream::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_Stream::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_ATM_Stream::ACE_ATM_Stream (void) -{ - ACE_TRACE ("ACE_ATM_Stream::ACE_ATM_Stream"); -} - -ACE_INLINE -int -ACE_ATM_Stream::open (ACE_ATM_Params params) -{ - ACE_TRACE ("ACE_ATM_Stream::open"); -#if defined (ACE_HAS_FORE_ATM_XTI) - ACE_HANDLE handle = stream_.open (params.get_device(), - params.get_oflag(), - params.get_info()); - return (handle == ACE_INVALID_HANDLE ? -1 : 0); -#elif defined (ACE_HAS_FORE_ATM_WS2) - params.set_flags( ACE_FLAG_MULTIPOINT_C_ROOT | ACE_FLAG_MULTIPOINT_D_ROOT ); - - int retval = stream_.open (params.get_type(), - params.get_protocol_family(), - params.get_protocol(), - params.get_protocol_info(), - params.get_sock_group(), - params.get_flags(), - params.get_reuse_addr()); - if (retval == -1) - return -1; - - struct sockaddr_atm sock_addr; - - ACE_OS::memset(&sock_addr, 0, sizeof(struct sockaddr_atm)); - sock_addr.satm_family = AF_ATM; - sock_addr.satm_number.AddressType=ADDR_ANY; - sock_addr.satm_number.NumofDigits = ATM_ADDR_SIZE; - sock_addr.satm_blli.Layer2Protocol = SAP_FIELD_ABSENT; - sock_addr.satm_blli.Layer3Protocol = SAP_FIELD_ABSENT; - sock_addr.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT; - if (ACE_OS::bind(get_handle(), - (struct sockaddr FAR *)&sock_addr, - sizeof(struct sockaddr_atm)) < 0) - { - ACE_OS::printf("Error binding local address: %d",WSAGetLastError()); - return -1; - } - - return 0; -#else - ACE_UNUSED_ARG(params); - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI */ -} - -ACE_INLINE -int -ACE_ATM_Stream::close (void) -{ - ACE_TRACE ("ACE_ATM_Stream::close"); -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - return stream_.close (); -#else - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ -} - -ACE_INLINE -ATM_Stream& -ACE_ATM_Stream::get_stream (void) -{ - ACE_TRACE ("ACE_ATM_Stream::get_stream"); - return stream_; -} - -ACE_INLINE -ssize_t -ACE_ATM_Stream::recv (void *buf, - size_t n, - int *flags) const -{ - ACE_TRACE ("ACE_ATM_Stream::recv"); -#if defined (ACE_HAS_FORE_ATM_XTI) - return stream_.recv (buf, - n, - flags); -#elif defined (ACE_HAS_FORE_ATM_WS2) - return stream_.recv (buf, - n); -#else - ACE_UNUSED_ARG(buf); - ACE_UNUSED_ARG(n); - ACE_UNUSED_ARG(flags); - return (0); -#endif /* ACE_HAS_FORE_ATM_XTI */ -} - -ACE_INLINE -ssize_t -ACE_ATM_Stream::send_n (const void *buf, - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_ATM_Stream::send_n"); -#if defined (ACE_HAS_FORE_ATM_XTI) - return stream_.send_n (buf, - n, - flags); -#elif defined (ACE_HAS_FORE_ATM_WS2) - return stream_.send_n (buf, - n, - flags); -#else - ACE_UNUSED_ARG(buf); - ACE_UNUSED_ARG(n); - ACE_UNUSED_ARG(flags); - return (0); -#endif /* ACE_HAS_FORE_ATM_XTI */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Acceptor.h b/dep/include/ace/Acceptor.h deleted file mode 100644 index 8f0f16935fb..00000000000 --- a/dep/include/ace/Acceptor.h +++ /dev/null @@ -1,687 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Acceptor.h - * - * $Id: Acceptor.h 81460 2008-04-28 11:34:23Z elliott_c $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ACCEPTOR_H -#define ACE_ACCEPTOR_H - -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Strategies_T.h" -#include "ace/Synch_Options.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Acceptor - * - * @brief Abstract factory for creating a service handler - * (SVC_HANDLER), accepting into the SVC_HANDLER, and - * activating the SVC_HANDLER. - * - * Implements the basic strategy for passively establishing - * connections with clients. An ACE_Acceptor is parameterized - * by concrete types that conform to the interfaces of - * PEER_ACCEPTOR and SVC_HANDLER. The PEER_ACCEPTOR is - * instantiated with a transport mechanism that passively - * establishes connections. The SVC_HANDLER is instantiated - * with a concrete type that performs the application-specific - * service. An ACE_Acceptor inherits from ACE_Service_Object, - * which in turn inherits from ACE_Event_Handler. This enables - * the ACE_Reactor to dispatch the ACE_Acceptor's handle_input - * method when connection events occur. The handle_input method - * performs the ACE_Acceptor's default creation, connection - * establishment, and service activation strategies. These - * strategies can be overridden by subclasses individually or as - * a group. - */ -template -class ACE_Acceptor : public ACE_Service_Object -{ -public: - - // Useful STL-style traits. - typedef ACE_PEER_ACCEPTOR_ADDR addr_type; - typedef ACE_PEER_ACCEPTOR acceptor_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - /// "Do-nothing" constructor. - ACE_Acceptor (ACE_Reactor * = 0, - int use_select = 1); - - /** - * Open the contained @c PEER_ACCEPTOR object to begin listening, and - * register with the specified reactor for accept events. An - * acceptor can only listen to one port at a time, so make sure to - * @c close() the acceptor before calling @c open() again. - * - * The @c PEER_ACCEPTOR handle is put into non-blocking mode as a - * safeguard against the race condition that can otherwise occur - * between the time when the passive-mode socket handle is "ready" - * and when the actual @c accept() call is made. During this - * interval, the client can shutdown the connection, in which case, - * the @c accept() call can hang. - * - * @param local_addr The address to listen at. - * @param reactor Pointer to the ACE_Reactor instance to register - * this object with. The default is the singleton. - * @param flags Flags to control what mode an accepted socket - * will be put into after it is accepted. The only - * legal value for this argument is @c ACE_NONBLOCK, - * which enables non-blocking mode on the accepted - * peer stream object in @c SVC_HANDLER. The default - * is 0. - * @param use_select Affects behavior when called back by the reactor - * when a connection can be accepted. If non-zero, - * this object will accept all pending connections, - * intead of just the one that triggered the reactor - * callback. Uses ACE_OS::select() internally to - * detect any remaining acceptable connections. - * The default is 1. - * @param reuse_addr Passed to the @c PEER_ACCEPTOR::open() method with - * @p local_addr. Generally used to request that the - * OS allow reuse of the listen port. The default is 1. - */ - ACE_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor = ACE_Reactor::instance (), - int flags = 0, - int use_select = 1, - int reuse_addr = 1); - - /** - * Open the contained @c PEER_ACCEPTOR object to begin listening, and - * register with the specified reactor for accept events. An - * acceptor can only listen to one port at a time, so make sure to - * @c close() the acceptor before calling @c open() again. - * - * The @c PEER_ACCEPTOR handle is put into non-blocking mode as a - * safeguard against the race condition that can otherwise occur - * between the time when the passive-mode socket handle is "ready" - * and when the actual @c accept() call is made. During this - * interval, the client can shutdown the connection, in which case, - * the @c accept() call can hang. - * - * @param local_addr The address to listen at. - * @param reactor Pointer to the ACE_Reactor instance to register - * this object with. The default is the singleton. - * @param flags Flags to control what mode an accepted socket - * will be put into after it is accepted. The only - * legal value for this argument is @c ACE_NONBLOCK, - * which enables non-blocking mode on the accepted - * peer stream object in @c SVC_HANDLER. The default - * is 0. - * @param use_select Affects behavior when called back by the reactor - * when a connection can be accepted. If non-zero, - * this object will accept all pending connections, - * intead of just the one that triggered the reactor - * callback. Uses ACE_OS::select() internally to - * detect any remaining acceptable connections. - * The default is 1. - * @param reuse_addr Passed to the @c PEER_ACCEPTOR::open() method with - * @p local_addr. Generally used to request that the - * OS allow reuse of the listen port. The default is 1. - * - * @retval 0 Success - * @retval -1 Failure, @c errno contains an error code. - */ - virtual int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor = ACE_Reactor::instance (), - int flags = 0, - int use_select = 1, - int reuse_addr = 1); - - /// Close down the Acceptor's resources. - virtual ~ACE_Acceptor (void); - - /// Return the underlying PEER_ACCEPTOR object. - virtual operator ACE_PEER_ACCEPTOR &() const; - - /// Return the underlying PEER_ACCEPTOR object. - virtual ACE_PEER_ACCEPTOR &acceptor (void) const; - - /// Returns the listening acceptor's {ACE_HANDLE}. - virtual ACE_HANDLE get_handle (void) const; - - /// Close down the Acceptor - virtual int close (void); - - /// In the event that an accept fails, this method will be called and - /// the return value will be returned from handle_input(). - virtual int handle_accept_error (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = The following three methods define the Acceptor's strategies - // for creating, accepting, and activating SVC_HANDLER's, - // respectively. - - /** - * Bridge method for creating a SVC_HANDLER. The default is to - * create a new {SVC_HANDLER} if {sh} == 0, else {sh} is unchanged. - * However, subclasses can override this policy to perform - * SVC_HANDLER creation in any way that they like (such as creating - * subclass instances of SVC_HANDLER, using a singleton, dynamically - * linking the handler, etc.). Returns -1 on failure, else 0. - */ - virtual int make_svc_handler (SVC_HANDLER *&sh); - - /** - * Bridge method for accepting the new connection into the - * . The default behavior delegates to the - * PEER_ACCEPTOR::accept. - */ - virtual int accept_svc_handler (SVC_HANDLER *svc_handler); - - /** - * Bridge method for activating a {svc_handler} with the appropriate - * concurrency strategy. The default behavior of this method is to - * activate the SVC_HANDLER by calling its {open} method (which - * allows the SVC_HANDLER to define its own concurrency strategy). - * However, subclasses can override this strategy to do more - * sophisticated concurrency activations (such as making the - * SVC_HANDLER as an "active object" via multi-threading or - * multi-processing). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - // = Demultiplexing hooks. - /// Perform termination activities when {this} is removed from the - /// {reactor}. - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Accepts all pending connections from clients, and creates and - /// activates SVC_HANDLERs. - virtual int handle_input (ACE_HANDLE); - - // = Dynamic linking hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Calls {handle_close}. - virtual int fini (void); - - /// Default version returns address info in {buf}. - virtual int info (ACE_TCHAR **buf, size_t) const; - -public: - // = Service management hooks. - /// This method calls {Reactor::suspend}. - virtual int suspend (void); - - /// This method calls {Reactor::resume}. - virtual int resume (void); - -protected: - /// Concrete factory for accepting connections from clients... - ACE_PEER_ACCEPTOR peer_acceptor_; - - /// Needed to reopen the socket if {accept} fails. - ACE_PEER_ACCEPTOR_ADDR peer_acceptor_addr_; - - /** - * Flags that indicate how {SVC_HANDLER}'s should be initialized - * prior to being activated. Right now, the only flag that is - * processed is {ACE_NONBLOCK}, which enabled non-blocking I/O on - * the {SVC_HANDLER} when it is opened. - */ - int flags_; - - /// Flag that indicates whether it shall use {select} in the - /// {accept}-loop. - int use_select_; - - /// Needed to reopen the socket if {accept} fails. - int reuse_addr_; -}; - -/** - * @class ACE_Strategy_Acceptor - * - * @brief Abstract factory for creating a service handler - * (SVC_HANDLER), accepting into the SVC_HANDLER, and activating - * the SVC_HANDLER. - * - * Implements a flexible and extensible set of strategies for - * passively establishing connections with clients. There are - * three main strategies: (1) creating a SVC_HANDLER, (2) - * passively accepting a new connection from a client into the - * SVC_HANDLER, and (3) activating the SVC_HANDLER with a - * particular concurrency mechanism. - */ -template -class ACE_Strategy_Acceptor - : public ACE_Acceptor -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy - creation_strategy_type; - typedef ACE_Accept_Strategy - accept_strategy_type; - typedef ACE_Concurrency_Strategy - concurrency_strategy_type; - typedef ACE_Scheduling_Strategy scheduling_strategy_type; - typedef ACE_Acceptor - base_type; - - // = Define some useful (old style) traits. - typedef ACE_Creation_Strategy CREATION_STRATEGY; - typedef ACE_Accept_Strategy ACCEPT_STRATEGY; - typedef ACE_Concurrency_Strategy CONCURRENCY_STRATEGY; - typedef ACE_Scheduling_Strategy SCHEDULING_STRATEGY; - - /// Default constructor. - ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = 0, - const ACE_TCHAR service_description[] = 0, - int use_select = 1, - int reuse_addr = 1); - - /** - * Initialize the appropriate strategies for creation, passive - * connection acceptance, and concurrency, and then register {this} - * with the Reactor and listen for connection requests at the - * designated {local_addr}. - */ - ACE_Strategy_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor * = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Accept_Strategy * = 0, - ACE_Concurrency_Strategy * = 0, - ACE_Scheduling_Strategy * = 0, - const ACE_TCHAR service_name[] = 0, - const ACE_TCHAR service_description[] = 0, - int use_select = 1, - int reuse_addr = 1); - - /** - * Open the contained @c PEER_ACCEPTOR object to begin listening, and - * register with the specified reactor for accept events. - * - * The @c PEER_ACCEPTOR handle is put into non-blocking mode as a - * safeguard against the race condition that can otherwise occur - * between the time when the passive-mode socket handle is "ready" - * and when the actual @c accept call is made. During this - * interval, the client can shutdown the connection, in which case, - * the {accept} call can hang. - * - * @param local_addr The address to listen at. - * @param reactor Pointer to the ACE_Reactor instance to register - * this object with. The default is the singleton. - * @param flags Flags to control what mode an accepted socket - * will be put into after it is accepted. The only - * legal value for this argument is @c ACE_NONBLOCK, - * which enables non-blocking mode on the accepted - * peer stream object in @c SVC_HANDLER. The default - * is 0. - * @param use_select Affects behavior when called back by the reactor - * when a connection can be accepted. If non-zero, - * this object will accept all pending connections, - * intead of just the one that triggered the reactor - * callback. Uses ACE_OS::select() internally to - * detect any remaining acceptable connections. - * The default is 1. - * @param reuse_addr Passed to the @c PEER_ACCEPTOR::open() method with - * @p local_addr. Generally used to request that the - * OS allow reuse of the listen port. The default is 1. - * - * @retval 0 Success - * @retval -1 Failure, @c errno contains an error code. - */ - virtual int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - int flags = 0, - int use_select = 1, - int reuse_addr = 1); - - /** - * Initialize the appropriate strategies for creation, passive - * connection acceptance, and concurrency, and then register {this} - * with the Reactor and listen for connection requests at the - * designated {local_addr}. - */ - virtual int open (const ACE_PEER_ACCEPTOR_ADDR &, - ACE_Reactor * = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Accept_Strategy * =0, - ACE_Concurrency_Strategy * = 0, - ACE_Scheduling_Strategy * = 0, - const ACE_TCHAR *service_name = 0, - const ACE_TCHAR *service_description = 0, - int use_select = 1, - int reuse_addr = 1); - - /// Close down the Strategy_Acceptor's resources. - virtual ~ACE_Strategy_Acceptor (void); - - /// Return the underlying PEER_ACCEPTOR object. - virtual operator ACE_PEER_ACCEPTOR &() const; - - /// Return the underlying PEER_ACCEPTOR object. - virtual ACE_PEER_ACCEPTOR &acceptor (void) const; - - /// Returns the listening acceptor's {ACE_HANDLE}. - virtual ACE_HANDLE get_handle (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Service management hooks. - - /// This method delegates to the {Scheduling_Strategy}'s {suspend} - /// method. - virtual int suspend (void); - - /// This method delegates to the {Scheduling_Strategy}'s {resume} - /// method. - virtual int resume (void); - -protected: - - /// Calls {handle_close} when dynamically unlinked. - virtual int fini (void); - - /// Default version returns address info in {buf}. - virtual int info (ACE_TCHAR **buf, size_t) const; - - // = The following three methods define the {Acceptor}'s strategies - // for creating, accepting, and activating {SVC_HANDLER}'s, - // respectively. - - /** - * Bridge method for creating a {SVC_HANDLER}. The strategy for - * creating a {SVC_HANDLER} are configured into the Acceptor via - * it's {creation_strategy_}. The default is to create a new - * {SVC_HANDLER} if {sh} == 0, else {sh} is unchanged. However, - * subclasses can override this policy to perform {SVC_HANDLER} - * creation in any way that they like (such as creating subclass - * instances of {SVC_HANDLER}, using a singleton, dynamically - * linking the handler, etc.). Returns -1 on failure, else 0. - */ - virtual int make_svc_handler (SVC_HANDLER *&); - - /** - * Bridge method for accepting the new connection into the - * {SVC_HANDLER}. The default behavior delegates to the - * {PEER_ACCEPTOR::accept} in the {Acceptor_Strategy}. - */ - virtual int accept_svc_handler (SVC_HANDLER *svc_handler); - - /** - * Bridge method for activating a {SVC_HANDLER} with the appropriate - * concurrency strategy. The default behavior of this method is to - * activate the {SVC_HANDLER} by calling its {open} method (which - * allows the {SVC_HANDLER} to define its own concurrency strategy). - * However, subclasses can override this strategy to do more - * sophisticated concurrency activations (such as creating the - * {SVC_HANDLER} as an "active object" via multi-threading or - * multi-processing). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - // = Demultiplexing hooks. - /// Perform termination activities when {this} is removed from the - /// {Reactor}. - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Handle SIGINT. - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - - // = These data members are "logically private" but are put in the - // protected part in case subclasses want to access them. - - // = Strategy objects. - - /// Creation strategy for an Acceptor. - CREATION_STRATEGY *creation_strategy_; - - /// true if {Acceptor} created the creation strategy and thus should - /// delete it, else false. - bool delete_creation_strategy_; - - /// Accept strategy for an {Acceptor}. - ACCEPT_STRATEGY *accept_strategy_; - - /// true if {Acceptor} created the accept strategy and thus should delete - /// it, else false. - bool delete_accept_strategy_; - - /// Concurrency strategy for an {Acceptor}. - CONCURRENCY_STRATEGY *concurrency_strategy_; - - /// true if {Acceptor} created the concurrency strategy and thus should - /// delete it, else false. - bool delete_concurrency_strategy_; - - /// Scheduling strategy for an {Acceptor}. - SCHEDULING_STRATEGY *scheduling_strategy_; - - /// true if {Acceptor} created the scheduling strategy and thus should - /// delete it, else false. - bool delete_scheduling_strategy_; - - // = Service information objects. - - /// Name of the service. - ACE_TCHAR *service_name_; - - /// Description of the service. - ACE_TCHAR *service_description_; - - /// Address that the {Strategy_Acceptor} uses to listen for - /// connections. - ACE_PEER_ACCEPTOR_ADDR service_addr_; -}; - -/** - * @class ACE_Oneshot_Acceptor - * - * @brief Generic factory for passively connecting clients and creating - * exactly one service handler (SVC_HANDLER). - * - * This class works similarly to the regular {ACE_Acceptor}, - * with the following differences: - * 1. This class doesn't automagically register {this} with the - * {ACE_Reactor} since it expects to have its {accept} method - * called directly. However, it stashes the {ACE_Reactor} - * pointer away in case it's needed later to finish accepting - * a connection asynchronously. - * 2. The class doesn't need an {ACE_Creation_Strategy} (since - * the user supplies the SVC_HANDLER) or an - * {ACE_Accept_Strategy} (since this class only accepts one - * connection and then removes all traces of itself from the - * {ACE_Reactor} if it was registered for asynchronous - * accepts). - */ -template -class ACE_Oneshot_Acceptor : public ACE_Service_Object -{ -public: - - // Useful STL-style traits. - typedef ACE_PEER_ACCEPTOR_ADDR addr_type; - typedef ACE_PEER_ACCEPTOR acceptor_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - /// Constructor. - ACE_Oneshot_Acceptor (void); - - /** - * Initialize the appropriate strategies for concurrency and then - * open the {peer_acceptor} at the designated {local_addr}. Note - * that unlike the {ACE_Acceptor} and {ACE_Strategy_Acceptor}, this - * method does NOT register {this} acceptor with the {reactor} at - * this point -- it just stashes the {reactor} away in case it's - * needed later. - */ - ACE_Oneshot_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor = ACE_Reactor::instance (), - ACE_Concurrency_Strategy * = 0); - - /** - * Initialize the appropriate strategies for concurrency and then - * open the {peer_acceptor} at the designated {local_addr}. Note - * that unlike the {ACE_Acceptor} and {ACE_Strategy_Acceptor}, this - * method does NOT register {this} acceptor with the {reactor} at - * this point -- it just stashes the {reactor} away in case it's - * needed later. - */ - int open (const ACE_PEER_ACCEPTOR_ADDR &, - ACE_Reactor *reactor = ACE_Reactor::instance (), - ACE_Concurrency_Strategy * = 0); - - /// Close down the {Oneshot_Acceptor}. - virtual ~ACE_Oneshot_Acceptor (void); - - // = Explicit factory operation. - /// Create a {SVC_HANDLER}, accept the connection into the - /// {SVC_HANDLER}, and activate the {SVC_HANDLER}. - virtual int accept (SVC_HANDLER * = 0, - ACE_PEER_ACCEPTOR_ADDR *remote_addr = 0, - const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - int restart = 1, - int reset_new_handle = 0); - - /// Cancel a oneshot acceptor that was started asynchronously. - virtual int cancel (void); - - /// Return the underlying {PEER_ACCEPTOR} object. - virtual operator ACE_PEER_ACCEPTOR &() const; - - /// Return the underlying {PEER_ACCEPTOR} object. - virtual ACE_PEER_ACCEPTOR &acceptor (void) const; - - /// Close down the {Oneshot_Acceptor}. - virtual int close (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /** - * Bridge method for activating a {svc_handler} with the appropriate - * concurrency strategy. Default behavior is to activate the - * {SVC_HANDLER} as a "passive object." However, subclasses can - * override this strategy to do more sophisticated concurrency - * activations (such as creating the {SVC_HANDLER} as an "active - * object" via multi-threading or multi-processing). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - /// Factors out the code shared between the {accept} and - /// {handle_input} methods. - int shared_accept (SVC_HANDLER *svc_handler, - ACE_PEER_ACCEPTOR_ADDR *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle); - - // = Demultiplexing hooks. - /// Returns the listening acceptor's {ACE_HANDLE}. - virtual ACE_HANDLE get_handle (void) const; - - /// Perform termination activities when {this} is removed from the - /// {reactor}. - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Accept one connection from a client and activates the - /// SVC_HANDLER. - virtual int handle_input (ACE_HANDLE); - - /// Called when an acceptor times out... - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - - // = Dynamic linking hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int fini (void); - - /// Default version returns address info in {buf}. - virtual int info (ACE_TCHAR **, size_t) const; - - // = Service management hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int suspend (void); - - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int resume (void); - -private: - /** - * Insert ourselves into the {ACE_Reactor} so that we can continue - * accepting this connection asynchronously. This method should NOT - * be called by developers directly. - */ - int register_handler (SVC_HANDLER *svc_handler, - const ACE_Synch_Options &options, - int restart); - - /// Hold the svc_handler_ across asynchrony boundaries. - SVC_HANDLER *svc_handler_; - - /// Hold the restart flag across asynchrony boundaries. - int restart_; - - /// Factory that establishes connections passively. - ACE_PEER_ACCEPTOR peer_acceptor_; - - /// Concurrency strategy for an Acceptor. - ACE_Concurrency_Strategy *concurrency_strategy_; - - /// true if Acceptor created the concurrency strategy and thus should - /// delete it, else false. - bool delete_concurrency_strategy_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Acceptor.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Acceptor.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ACCEPTOR_H */ - diff --git a/dep/include/ace/Activation_Queue.h b/dep/include/ace/Activation_Queue.h deleted file mode 100644 index 69197c1b72d..00000000000 --- a/dep/include/ace/Activation_Queue.h +++ /dev/null @@ -1,174 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Activation_Queue.h - * - * $Id: Activation_Queue.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Andres Kruse - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ACTIVATION_QUEUE_H -#define ACE_ACTIVATION_QUEUE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Message_Queue.h" -#include "ace/Condition_Thread_Mutex.h" - -/// Define to be compatible with the terminology in the POSA2 book! -#define ACE_Activation_List ACE_Activation_Queue - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Method_Request; - -/** - * @class ACE_Activation_Queue - * - * @brief Reifies a method into a request. Subclasses typically - * represent necessary state and behavior. - * - * Maintains a priority-ordered queue of ACE_Method_Request objects. - * A scheduler class (often derived from ACE_Task) subsequently removes - * each method request and invokes its @c call() method. - * - * This class is discussed in depth in the Active Object chapter - * of POSA2. In that book, it is referred to as an Activation List. - * - * @sa ACE_Method_Request - */ -class ACE_Export ACE_Activation_Queue -{ -public: - // = Initialization and termination methods. - /// Constructor. - /** - * Initializes a new activation queue. - * - * @param new_queue The activation queue uses an ACE_Message_Queue to - * queue and order the method requests. If this argument - * is 0, a new ACE_Message_Queue is created for this - * object's use and will be deleted when this object is - * destroyed. If a non-zero pointer is supplied, the - * passed object will be used and will not be deleted when - * this object is destroyed. If an ACE_Task is being created - * to act as the scheduler, for instance, its - * ACE_Message_Queue pointer can be passed to this object. - * @param alloc Optional, the allocator to use when allocating - * ACE_Message_Block instances that wrap the method requests - * queued to this activation queue. Defaults to - * ACE_Allocator::instance(). - * @param db_alloc Optional, the allocator to use when allocating - * data blocks for the ACE_Message_Block instances that - * wrap the method requests queued to this activation queue. - * Defaults to ACE_Allocator::instance(). - */ - ACE_Activation_Queue (ACE_Message_Queue *new_queue = 0, - ACE_Allocator *alloc = 0, - ACE_Allocator *db_alloc = 0); - - /// Destructor. - virtual ~ACE_Activation_Queue (void); - - // = Activate Queue operations. - - /// Dequeue the next available ACE_Method_Request. - /** - * @param tv If 0, the method will block until a method request is - * available, else will wait until the absolute time specified - * in the referenced ACE_Time_Value. This method will return, - * earlier, however, if queue is closed, deactivated, or when - * a signal occurs. - * - * @retval Pointer to the dequeued ACE_Method_Request object. - * @retval 0 an error occurs; errno contains further information. If - * the specified timeout elapses, errno will be @c EWOULDBLOCK. - */ - ACE_Method_Request *dequeue (ACE_Time_Value *tv = 0); - - /// Enqueue the ACE_Method_Request in priority order. - /** - * The priority of the method request is obtained via the @c priority() - * method of the queued method request. Priority ordering is determined - * by the ACE_Message_Queue class; 0 is the lowest priority. - * - * @param new_method_request Pointer to the ACE_Method_Request object to - * queue. This object's @c priority() method is called to obtain - * the priority. - * @param tv If 0, the method will block until the method request can - * be queued, else will wait until the absolute time specified - * in the referenced ACE_Time_Value. This method will return, - * earlier, however, if queue is closed, deactivated, or when - * a signal occurs. - * - * @retval >0 The number of method requests on the queue after adding - * the specified request. - * @retval -1 if an error occurs; errno contains further information. If - * the specified timeout elapses, errno will be @c EWOULDBLOCK. - */ - int enqueue (ACE_Method_Request *new_method_request, ACE_Time_Value *tv = 0); - - /// Get the current number of method objects in the queue. - size_t method_count (void) const; - - /// Returns 1 if the queue is empty, 0 otherwise. - int is_empty (void) const; - - /// Returns 1 if the queue is full, 0 otherwise. - int is_full (void) const; - - /// Dump the state of an request. - void dump (void) const; - - /// Get a pointer to the underlying queue. - ACE_Message_Queue *queue (void) const; - - /// Set the pointer to the underlying queue. - void queue (ACE_Message_Queue *q); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - // = Prevent copying and assignment. - ACE_Activation_Queue (const ACE_Activation_Queue &); - void operator= (const ACE_Activation_Queue &); - -protected: - - /// Stores the Method_Requests. - ACE_Message_Queue *queue_; - - /// Keeps track of whether we need to delete the queue. - bool delete_queue_; - -private: - - /// Allocation strategy of the queue. - ACE_Allocator *allocator_; - - /// Allocation strategy of the message blocks. - ACE_Allocator *data_block_allocator_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Activation_Queue.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_ACTIVATION_QUEUE_H */ - diff --git a/dep/include/ace/Activation_Queue.inl b/dep/include/ace/Activation_Queue.inl deleted file mode 100644 index 4c0ffc049d3..00000000000 --- a/dep/include/ace/Activation_Queue.inl +++ /dev/null @@ -1,31 +0,0 @@ -// -*- C++ -*- -// -// $Id: Activation_Queue.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE size_t -ACE_Activation_Queue::method_count (void) const -{ - return queue_->message_count (); -} - -ACE_INLINE int -ACE_Activation_Queue::is_full (void) const -{ - return queue_->is_full (); -} - -ACE_INLINE int -ACE_Activation_Queue::is_empty (void) const -{ - return queue_->is_empty (); -} - -ACE_INLINE ACE_Message_Queue * -ACE_Activation_Queue::queue (void) const -{ - return queue_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Active_Map_Manager.h b/dep/include/ace/Active_Map_Manager.h deleted file mode 100644 index c72d6dbba4c..00000000000 --- a/dep/include/ace/Active_Map_Manager.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Active_Map_Manager.h - * - * $Id: Active_Map_Manager.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_ACTIVE_MAP_MANAGER_H -#define ACE_ACTIVE_MAP_MANAGER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Types.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Active_Map_Manager_Key - * - * @brief Key used in the Active Object Map. - * - * This key keeps information of the index and the generation - * count of the slot it represents. Since the index information - * is part of the key, lookups are super fast and predictable, - */ -class ACE_Export ACE_Active_Map_Manager_Key -{ -public: - /// Default constructor. - ACE_Active_Map_Manager_Key (void); - - /** - * Constructor given the @a slot_index and @a slot_generation number. - * This is useful once the user has somehow recovered the - * @a slot_index and @a slot_generation number from the client. - */ - ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index, - ACE_UINT32 slot_generation); - - /// Get the slot_index. - ACE_UINT32 slot_index (void) const; - - /// Set the slot_index. - void slot_index (ACE_UINT32 i); - - /// Get the slot_generation number. - ACE_UINT32 slot_generation (void) const; - - /// Set the slot_generation number. - void slot_generation (ACE_UINT32 g); - - /// Size required to store information about active key. - static size_t size (void); - - /// Recover state of active key from @a data. User must make sure - /// that @a data encoded using the encode() method. - void decode (const void *data); - - /// Encode state of the active key into @a data. @a data must be as - /// big as the value returned from . - void encode (void *data) const; - - /// Compare keys. - bool operator== (const ACE_Active_Map_Manager_Key &rhs) const; - bool operator!= (const ACE_Active_Map_Manager_Key &rhs) const; - - // = This really should be protected but because of template - // friends, they are not. - - /// Increment the number. - void increment_slot_generation_count (void); - -private: - - /** - * @brief Data for the Active Object Map Key. - * - * This separate structure makes it easier to manage copying - * the index and the generation to and from the user buffer. - * - */ - struct key_data - { - /// Slot index in the active map. - ACE_UINT32 slot_index_; - - /// Slot generation number of slot in the active map. - ACE_UINT32 slot_generation_; - }; - - /// Data for the Active Object Map Key. - key_data key_data_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Active_Map_Manager.inl" -#endif /* __ACE_INLINE__ */ - -// Include the templates here. -#include "ace/Active_Map_Manager_T.h" - -#include /**/ "ace/post.h" -#endif /* ACE_ACTIVE_MAP_MANAGER_H */ - diff --git a/dep/include/ace/Active_Map_Manager.inl b/dep/include/ace/Active_Map_Manager.inl deleted file mode 100644 index df90ada6a00..00000000000 --- a/dep/include/ace/Active_Map_Manager.inl +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- -// -// $Id: Active_Map_Manager.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (void) -{ - // If you change ~0, please change ACE_Map_Manager::free_list_id() - // accordingly. - this->key_data_.slot_index_ = (ACE_UINT32) ~0; - this->key_data_.slot_generation_ = 0; -} - -ACE_INLINE -ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index, - ACE_UINT32 slot_generation) -{ - this->key_data_.slot_index_ = slot_index; - this->key_data_.slot_generation_ = slot_generation; -} - -ACE_INLINE ACE_UINT32 -ACE_Active_Map_Manager_Key::slot_index (void) const -{ - return this->key_data_.slot_index_; -} - -ACE_INLINE ACE_UINT32 -ACE_Active_Map_Manager_Key::slot_generation (void) const -{ - return this->key_data_.slot_generation_; -} - -ACE_INLINE bool -ACE_Active_Map_Manager_Key::operator== (const ACE_Active_Map_Manager_Key &rhs) const -{ - return - this->key_data_.slot_index_ == rhs.key_data_.slot_index_ && - this->key_data_.slot_generation_ == rhs.key_data_.slot_generation_; -} - -ACE_INLINE bool -ACE_Active_Map_Manager_Key::operator!= (const ACE_Active_Map_Manager_Key &rhs) const -{ - return !this->operator== (rhs); -} - -ACE_INLINE void -ACE_Active_Map_Manager_Key::slot_index (ACE_UINT32 i) -{ - this->key_data_.slot_index_ = i; -} - -ACE_INLINE void -ACE_Active_Map_Manager_Key::slot_generation (ACE_UINT32 g) -{ - this->key_data_.slot_generation_ = g; -} - -ACE_INLINE void -ACE_Active_Map_Manager_Key::increment_slot_generation_count (void) -{ - ++this->key_data_.slot_generation_; -} - -/* static */ -ACE_INLINE size_t -ACE_Active_Map_Manager_Key::size (void) -{ - return sizeof (ACE_UINT32) + sizeof (ACE_UINT32); -} - -ACE_INLINE void -ACE_Active_Map_Manager_Key::decode (const void *data) -{ - // Copy the information from the user buffer into the key. - ACE_OS::memcpy (&this->key_data_, - data, - sizeof this->key_data_); -} - -ACE_INLINE void -ACE_Active_Map_Manager_Key::encode (void *data) const -{ - // Copy the key data to the user buffer. - ACE_OS::memcpy (data, - &this->key_data_, - sizeof this->key_data_); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Active_Map_Manager_T.h b/dep/include/ace/Active_Map_Manager_T.h deleted file mode 100644 index 660f0bbbec4..00000000000 --- a/dep/include/ace/Active_Map_Manager_T.h +++ /dev/null @@ -1,211 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Active_Map_Manager_T.h - * - * $Id: Active_Map_Manager_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_ACTIVE_MAP_MANAGER_T_H -#define ACE_ACTIVE_MAP_MANAGER_T_H -#include /**/ "ace/pre.h" - -#include "ace/Map_Manager.h" -#include "ace/Active_Map_Manager.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Null_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Active_Map_Manager - * - * @brief Define a map abstraction that associates system generated - * keys with user specified values. - * - * Since the key is system generated, searches are very fast and - * take a constant amount of time. - */ -template -class ACE_Active_Map_Manager : public ACE_Map_Manager -{ -public: - - // = Traits. - typedef ACE_Active_Map_Manager_Key key_type; - typedef T mapped_type; - - typedef ACE_Map_Entry ENTRY; - typedef ACE_Map_Iterator ITERATOR; - typedef ACE_Map_Reverse_Iterator REVERSE_ITERATOR; - - typedef ENTRY entry; - typedef ITERATOR iterator; - typedef REVERSE_ITERATOR reverse_iterator; - - // = Initialization and termination methods. - /// Initialize a with the ACE_DEFAULT_MAP_SIZE. - ACE_Active_Map_Manager (ACE_Allocator *alloc = 0); - - /// Initialize a with @a size entries. - ACE_Active_Map_Manager (size_t size, - ACE_Allocator *alloc = 0); - - /// Close down a and release dynamically - /// allocated resources. - ~ACE_Active_Map_Manager (void); - - /// Initialize a with size @a length. - int open (size_t length = ACE_DEFAULT_MAP_SIZE, - ACE_Allocator *alloc = 0); - - /// Close down a and release dynamically - /// allocated resources. - int close (void); - - /// Add @a value to the map, and the corresponding key produced by the - /// Active_Map_Manager is returned through @a key. - int bind (const T &value, - ACE_Active_Map_Manager_Key &key); - - /// Add @a value to the map. The user does not care about the - /// corresponding key produced by the Active_Map_Manager. - int bind (const T &value); - - /** - * Reserves a slot in the internal structure and returns the key and - * a pointer to the value. User should place their @a value into - * <*internal_value>. This method is useful in reducing the number - * of copies required in some cases. Note that is - * only a temporary pointer and will change when the map resizes. - * Therefore, the user should use the pointer immediately and not - * hold on to it. - */ - int bind (ACE_Active_Map_Manager_Key &key, - T *&internal_value); - - /// Reassociate @a key with @a value. The function fails if @a key is - /// not in the map. - int rebind (const ACE_Active_Map_Manager_Key &key, - const T &value); - - /** - * Reassociate @a key with @a value, storing the old value into the - * "out" parameter @a old_value. The function fails if @a key is not - * in the map. - */ - int rebind (const ACE_Active_Map_Manager_Key &key, - const T &value, - T &old_value); - - /** - * Reassociate @a key with @a value, storing the old key and value - * into the "out" parameter @a old_key and @a old_value. The function - * fails if @a key is not in the map. - */ - int rebind (const ACE_Active_Map_Manager_Key &key, - const T &value, - ACE_Active_Map_Manager_Key &old_key, - T &old_value); - - /// Locate @a value associated with @a key. - int find (const ACE_Active_Map_Manager_Key &key, - T &value) const; - - /// Is @a key in the map? - int find (const ACE_Active_Map_Manager_Key &key) const; - - /** - * Locate @a value associated with @a key. The value is returned via - * and hence a copy is saved. Note that - * is only a temporary pointer and will change when - * the map resizes. Therefore, the user should use the pointer - * immediately and not hold on to it. - */ - int find (const ACE_Active_Map_Manager_Key &key, - T *&internal_value) const; - - // Creates a key. User should place their @a value into - // <*internal_value>. This method is useful in reducing the number - // of copies required in some cases. - - /// Remove @a key from the map. - int unbind (const ACE_Active_Map_Manager_Key &key); - - /// Remove @a key from the map, and return the @a value associated with - /// @a key. - int unbind (const ACE_Active_Map_Manager_Key &key, - T &value); - - /** - * Locate @a value associated with @a key. The value is returned via - * and hence a copy is saved. Note that - * is only a temporary pointer and will change when - * the map resizes or when this slot is reused. Therefore, the user - * should use the pointer immediately and not hold on to it. - */ - int unbind (const ACE_Active_Map_Manager_Key &key, - T *&internal_value); - - /// Return the current size of the map. - size_t current_size (void) const; - - /// Return the total size of the map. - size_t total_size (void) const; - - /// Returns a key that cannot be found in the map. - static const ACE_Active_Map_Manager_Key npos (void); - - /// Dump the state of an object. - void dump (void) const; - - // = STL styled iterator factory functions. - - /// Return forward iterator. - ACE_Map_Iterator begin (void); - ACE_Map_Iterator end (void); - - /// Return reverse iterator. - ACE_Map_Reverse_Iterator rbegin (void); - ACE_Map_Reverse_Iterator rend (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - /// Private base class - typedef ACE_Map_Manager ACE_AMM_BASE; - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager (const ACE_Active_Map_Manager &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Active_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Active_Map_Manager_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Active_Map_Manager_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_ACTIVE_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Active_Map_Manager_T.inl b/dep/include/ace/Active_Map_Manager_T.inl deleted file mode 100644 index 647b55ebd56..00000000000 --- a/dep/include/ace/Active_Map_Manager_T.inl +++ /dev/null @@ -1,311 +0,0 @@ -// -*- C++ -*- -// -// $Id: Active_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Active_Map_Manager::bind (ACE_Active_Map_Manager_Key &key, - T *&internal_value) -{ - ACE_UINT32 slot_index; - int result = this->next_free (slot_index); - - if (result == 0) - { - // Move from free list to occupied list - this->move_from_free_list_to_occupied_list (slot_index); - - // Reset the key. - this->search_structure_[slot_index].ext_id_.increment_slot_generation_count (); - this->search_structure_[slot_index].ext_id_.slot_index (slot_index); - - // Copy the key for the user. - key = this->search_structure_[slot_index].ext_id_; - - // This is where the user should place the value. - internal_value = &this->search_structure_[slot_index].int_id_; - - // Update the current size. - ++this->cur_size_; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::bind (const T &value, - ACE_Active_Map_Manager_Key &key) -{ - T *internal_value = 0; - int result = this->bind (key, - internal_value); - - if (result == 0) - { - // Store new value. - *internal_value = value; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::bind (const T &value) -{ - ACE_Active_Map_Manager_Key key; - return this->bind (value, key); -} - -template ACE_INLINE int -ACE_Active_Map_Manager::find (const ACE_Active_Map_Manager_Key &key, - T *&internal_value) const -{ - ACE_UINT32 slot_index = key.slot_index (); - ACE_UINT32 slot_generation = key.slot_generation (); - - if (slot_index > this->total_size_ || -#if defined (ACE_HAS_LAZY_MAP_MANAGER) - this->search_structure_[slot_index].free_ || -#endif /* ACE_HAS_LAZY_MAP_MANAGER */ - this->search_structure_[slot_index].ext_id_.slot_generation () != slot_generation || - this->search_structure_[slot_index].ext_id_.slot_index () == - (ACE_UINT32)this->free_list_id ()) - { - return -1; - } - else - { - // This is where the user value is. - internal_value = &this->search_structure_[slot_index].int_id_; - } - - return 0; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::find (const ACE_Active_Map_Manager_Key &key) const -{ - T *internal_value = 0; - return this->find (key, - internal_value); -} - -template ACE_INLINE int -ACE_Active_Map_Manager::find (const ACE_Active_Map_Manager_Key &key, - T &value) const -{ - T *internal_value = 0; - int result = this->find (key, - internal_value); - - if (result == 0) - value = *internal_value; - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::rebind (const ACE_Active_Map_Manager_Key &key, - const T &value) -{ - int result = this->find (key); - - if (result == 0) - { - // Store new value. - this->search_structure_[key.slot_index ()].int_id_ = value; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::rebind (const ACE_Active_Map_Manager_Key &key, - const T &value, - T &old_value) -{ - int result = this->find (key); - - if (result == 0) - { - // Copy old value. - old_value = this->search_structure_[key.slot_index ()].int_id_; - - // Store new value. - this->search_structure_[key.slot_index ()].int_id_ = value; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::rebind (const ACE_Active_Map_Manager_Key &key, - const T &value, - ACE_Active_Map_Manager_Key &old_key, - T &old_value) -{ - int result = this->find (key); - - if (result == 0) - { - // Copy old key. - old_key = this->search_structure_[key.slot_index ()].ext_id_; - - // Copy old value. - old_value = this->search_structure_[key.slot_index ()].int_id_; - - // Store new value. - this->search_structure_[key.slot_index ()].int_id_ = value; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::unbind (const ACE_Active_Map_Manager_Key &key, - T *&internal_value) -{ - int result = this->find (key, - internal_value); - - if (result == 0) - { - ACE_UINT32 slot_index = key.slot_index (); - -#if defined (ACE_HAS_LAZY_MAP_MANAGER) - - // - // In the case of lazy map managers, the movement of free slots - // from the occupied list to the free list is delayed until we - // run out of free slots in the free list. - // - - this->search_structure_[slot_index].free_ = 1; - -#else - - // Move from occupied list to free list. - this->move_from_occupied_list_to_free_list (slot_index); - -#endif /* ACE_HAS_LAZY_MAP_MANAGER */ - - // Reset the slot_index. This will tell us that this entry is free. - this->search_structure_[slot_index].ext_id_.slot_index (this->free_list_id ()); - - // Update the current size. - --this->cur_size_; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::unbind (const ACE_Active_Map_Manager_Key &key, - T &value) -{ - T *internal_value; - int result = this->unbind (key, - internal_value); - - if (result == 0) - { - // Copy old value. - value = *internal_value; - } - - return result; -} - -template ACE_INLINE int -ACE_Active_Map_Manager::unbind (const ACE_Active_Map_Manager_Key &key) -{ - T *internal_value; - return this->unbind (key, - internal_value); -} - -template ACE_INLINE -ACE_Active_Map_Manager::ACE_Active_Map_Manager (ACE_Allocator *alloc) - : ACE_AMM_BASE (alloc) -{ -} - -template ACE_INLINE -ACE_Active_Map_Manager::ACE_Active_Map_Manager (size_t size, - ACE_Allocator *alloc) - : ACE_AMM_BASE (size, - alloc) -{ -} - -template ACE_INLINE -ACE_Active_Map_Manager::~ACE_Active_Map_Manager (void) -{ -} - -template ACE_INLINE int -ACE_Active_Map_Manager::open (size_t length, - ACE_Allocator *alloc) -{ - return ACE_AMM_BASE::open (length, alloc); -} - -template ACE_INLINE int -ACE_Active_Map_Manager::close (void) -{ - return ACE_AMM_BASE::close (); -} - -template ACE_INLINE size_t -ACE_Active_Map_Manager::current_size (void) const -{ - return ACE_AMM_BASE::current_size (); -} - -template ACE_INLINE size_t -ACE_Active_Map_Manager::total_size (void) const -{ - return ACE_AMM_BASE::total_size (); -} - -/* static */ -template ACE_INLINE const ACE_Active_Map_Manager_Key -ACE_Active_Map_Manager::npos (void) -{ - return ACE_Active_Map_Manager_Key (~0, ~0); -} - -template ACE_INLINE void -ACE_Active_Map_Manager::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_AMM_BASE::dump (); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_Map_Iterator -ACE_Active_Map_Manager::begin (void) -{ - return ACE_AMM_BASE::begin (); -} - -template ACE_INLINE ACE_Map_Iterator -ACE_Active_Map_Manager::end (void) -{ - return ACE_AMM_BASE::end (); -} - -template ACE_INLINE ACE_Map_Reverse_Iterator -ACE_Active_Map_Manager::rbegin (void) -{ - return ACE_AMM_BASE::rbegin (); -} - -template ACE_INLINE ACE_Map_Reverse_Iterator -ACE_Active_Map_Manager::rend (void) -{ - return ACE_AMM_BASE::rend (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Addr.h b/dep/include/ace/Addr.h deleted file mode 100644 index fa9b5d757b6..00000000000 --- a/dep/include/ace/Addr.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Addr.h - * - * $Id: Addr.h 81030 2008-03-20 12:43:29Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ADDR_H -#define ACE_ADDR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Addr - * - * @brief Defines the base class for the "address family independent" - * address format. - */ -class ACE_Export ACE_Addr -{ -public: - // = Initialization and termination methods. - /// Initializes instance variables. - ACE_Addr (int type = -1, int size = -1); - - /// Destructor. - virtual ~ACE_Addr (void); - - // = Get/set the size of the address. - - /// Return the size of the address. - int get_size (void) const; - - /// Sets the size of the address. - void set_size (int size); - - // = Get/set the type of the address. - - /// Get the type of the address. - int get_type (void) const; - - /// Set the type of the address. - void set_type (int type); - - /// Return a pointer to the address. - virtual void *get_addr (void) const; - - /// Set a pointer to the address. - virtual void set_addr (void *, int len); - - // = Equality/inequality tests - /// Check for address equality. - bool operator == (const ACE_Addr &sap) const; - - /// Check for address inequality. - bool operator != (const ACE_Addr &sap) const; - - /// Initializes instance variables. - void base_set (int type, int size); - - /// Wild-card address. - static const ACE_Addr sap_any; - - /// Returns a hash value. This should be overwritten by a subclass - /// that can produce a better hash value. - virtual unsigned long hash (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// e.g., AF_UNIX, AF_INET, AF_SPIPE, etc. - int addr_type_; - - /// Number of bytes in the address. - int addr_size_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ADDR_H */ - diff --git a/dep/include/ace/Addr.inl b/dep/include/ace/Addr.inl deleted file mode 100644 index 44fd495a6e9..00000000000 --- a/dep/include/ace/Addr.inl +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- -// -// $Id: Addr.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Return the address of the address. - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE bool -ACE_Addr::operator == (const ACE_Addr &sap) const -{ - return (sap.addr_type_ == this->addr_type_ && - sap.addr_size_ == this->addr_size_ ); -} - -ACE_INLINE bool -ACE_Addr::operator != (const ACE_Addr &sap) const -{ - return (sap.addr_type_ != this->addr_type_ || - sap.addr_size_ != this->addr_size_ ); -} - -// Return the size of the address. - -ACE_INLINE int -ACE_Addr::get_size (void) const -{ - return this->addr_size_; -} - -// Sets the size of the address. - -ACE_INLINE void -ACE_Addr::set_size (int size) -{ - this->addr_size_ = size; -} - -// Return the type of the address. - -ACE_INLINE int -ACE_Addr::get_type (void) const -{ - return this->addr_type_; -} - -// Set the type of the address. - -ACE_INLINE void -ACE_Addr::set_type (int type) -{ - this->addr_type_ = type; -} - -ACE_INLINE unsigned long -ACE_Addr::hash (void) const -{ - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Arg_Shifter.h b/dep/include/ace/Arg_Shifter.h deleted file mode 100644 index b5700c9f98f..00000000000 --- a/dep/include/ace/Arg_Shifter.h +++ /dev/null @@ -1,222 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Arg_Shifter.h - * - * $Id: Arg_Shifter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Seth Widoff - */ -//============================================================================= - -#ifndef ACE_ARG_SHIFTER_H -#define ACE_ARG_SHIFTER_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Arg_Shifter_T - * - * @brief This ADT operates on a specified set of arguments (@a argv). - * As known arguments are scanned, they are shifted to the back of the - * @a argv vector, so deeper levels of argument parsing can locate the yet - * unprocessed arguments at the beginning of the vector. - * - * The @c ACE_Arg_Shifter copies the pointers of the @a argv vector - * into a temporary array. As the @c ACE_Arg_Shifter iterates over - * the copied vector, it places known arguments in the rear of the - * vector, leaving the unknown ones in the beginning. So, after having - * visited all the arguments in the temporary vector, @c ACE_Arg_Shifter - * has placed all the unknown arguments in their original order at - * the front of original @a argv. - */ -template -class ACE_Arg_Shifter_T -{ -public: - // = Initialization and termination methods. - /** - * Initialize the ACE_Arg_Shifter to the vector over which to - * iterate. Optionally, also provide the temporary array for - * use in shifting the arguments. If ACE_Arg_Shifter must allocate - * the temporary vector internally and dynamic allocation fails, the - * ACE_Arg_Shifter will set all indicators to end of the vector, - * forbidding iteration. Following iteration over @a argv, the - * @a argc value will be updated to contain the number of - * unconsumed arguments. - * @param argc The number of strings in @a argv. @a argc will be - * updated to reflect the number of unconsumed arguments. - * @param argv The argument vector to shift. The string pointers in - * the vector will be reordered to place the @a argc unconsumed - * arguments at the front of the vector. - * @param temp A vector of @c CHAR_TYPE pointers at least @a argc - * elements long. The vector will be used for argument shifting as - * the specified @a argv vector is consumed. The vector must not - * be modified while this object exists. If this argument is 0 - * (the default) the object will allocate and free the temporary - * vector transparently. - */ - ACE_Arg_Shifter_T (int& argc, - const CHAR_TYPE **argv, - const CHAR_TYPE **temp = 0); - - /// Same behavior as the preceding constructor, but without the - /// "const" qualifier. - ACE_Arg_Shifter_T (int& argc, - CHAR_TYPE **argv, - CHAR_TYPE **temp = 0); - - /// Destructor. - ~ACE_Arg_Shifter_T (void); - - /// Get the current head of the vector. - const CHAR_TYPE *get_current (void) const; - - /** - * If the @a flag matches the current_arg of arg shifter - * this method will attempt to return the associated - * parameter value - * - * Safe to call without checking that a current arg exists - * - * In the following examples, a pointer to the char* "value" is ret - * - * eg: main -foobar value, main -FooBar value - * main -FOOBARvalue - * - * all of the above will all match the @a flag == -FooBar - * and will return a char* to "value" - * - * main -foobar 4 would succeed and return a char* to "4" - * main -foobar -4 does not succeed (-4 is not a parameter) - * but instead, would return 0 - * - * 0 is returned: - * If the current argument does not match flag - * If there is no parameter found after a 'matched' flag - * - * If the flag is matched and the flag and paramter DO NOT RUN - * together, the flag is consumed, the parameter is returned, - * and the new current argument is the parameter value. - * ie '-foobarflag VALUE' leaves the new cur arg == "VALUE" - * - * If the flag is matched and the flag and parameter RUN - * together '-foobarflagVALUE', the flag is NOT consumed - * and the cur arg is left pointing to the entire flag/value pair - */ - const CHAR_TYPE *get_the_parameter (const CHAR_TYPE* flag); - - /** - * Check if the current argument matches (case insensitive) - * - * ------------------------------------------------------------ - * - * Case A: Perfect Match (case insensitive) - * 0 is returned. - * - * ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR" - * this->cur_arg_strncasecmp ("-FooBar); - * will return 0 - * - * ------------------------------------------------------------ - * - * Case B: Perfect Match (case insensitive) but the current_arg - * is longer than the flag. Returns a number equal to the index - * in the char* indicating the start of the extra characters - * - * ie: when current_arg = "-foobar98023" - * this->cur_arg_strncasecmp ("-FooBar); - * will return 7 - * - * Notice: this number will always be > 0 - * - * ------------------------------------------------------------ - * - * Case C: If neither of Case A or B is met (no match) - * then -1 is returned - */ - int cur_arg_strncasecmp (const CHAR_TYPE *flag); - - /// Consume @a number argument(s) by sticking them/it on the end of - /// the vector. - int consume_arg (int number = 1); - - /// Place @a number arguments in the same relative order ahead of the - /// known arguments in the vector. - int ignore_arg (int number = 1); - - /// Returns the number of args left to see in the vector. - int is_anything_left (void) const; - - /// Returns 1 if there's a next item in the vector and it begins with - /// '-'. - int is_option_next (void) const; - - /// Returns 1 if there's a next item in the vector and it doesn't - /// begin with '-'. - int is_parameter_next (void) const; - - /// Returns the number of irrelevant args seen. - int num_ignored_args (void) const; - -private: - /// Copy Constructor should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T&)) - - /// Assignment '=' operator should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T&)) - - /// Refactor the constructor logic. - void init (void); - - /// The size of the argument vector. - int& argc_; - - /// The size of argv_. - int total_size_; - - /// The temporary array over which we traverse. - const CHAR_TYPE **temp_; - - /// The array in which the arguments are reordered. - const CHAR_TYPE **argv_; - - /// The element in we're currently examining. - int current_index_; - - /// The index of in which we'll stick the next unknown - /// argument. - int back_; - - /// The index of in which we'll stick the next known - /// argument. - int front_; -}; - -typedef ACE_Arg_Shifter_T ACE_Arg_Shifter; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Arg_Shifter.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Arg_Shifter.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ARG_SHIFTER_H */ - diff --git a/dep/include/ace/Argv_Type_Converter.h b/dep/include/ace/Argv_Type_Converter.h deleted file mode 100644 index 957a431a6c3..00000000000 --- a/dep/include/ace/Argv_Type_Converter.h +++ /dev/null @@ -1,120 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Argv_Type_Converter.h - * - * $Id: Argv_Type_Converter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Si Mong Park - */ -//============================================================================= - -#ifndef ACE_ARGV_TYPE_CONVERTER_H -#define ACE_ARGV_TYPE_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" -#include "ace/OS_Memory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Argv_Type_Converter - * - * @brief To convert 'char' input/command line parameter to 'wchar_t'. - * - * This class is to convert 'char' type command line paramter to - * wide-character (wchar_t) format and stores the copy of it. - * This is useful for all classes that use 'char**' argv but cannot - * be converted into 'ACE_TCHAR**' version. - * Note that the converted data will be lost upon destruction, so - * classes should use this class as their data member. - */ -class ACE_Export ACE_Argv_Type_Converter -{ -public: - - ACE_Argv_Type_Converter (int &argc, char** argv); - -#if defined (ACE_USES_WCHAR) - ACE_Argv_Type_Converter (int &argc, wchar_t** argv); -#endif // ACE_USES_WCHAR - - ~ACE_Argv_Type_Converter (void); - - /// Returns the pointer of converted command line. - ACE_TCHAR** get_TCHAR_argv (void); - - /// Returns the pointer of ASCII (char) command line. - char** get_ASCII_argv (void); - - /// Returns the number of sub paramters (argc). - int& get_argc (void); - -private: - - /// Copy Constructor should not be used. - ACE_Argv_Type_Converter (const ACE_Argv_Type_Converter&); - - /// Assignment '=' operator should not be used. - ACE_Argv_Type_Converter operator= (const ACE_Argv_Type_Converter&); - -#if defined (ACE_USES_WCHAR) - - /// Perform common initialization for two Ctor's. - void initialize (void); - - /// Align all entries in the char type argv list with wchar_t type - /// argv list. - void align_char_with_wchar (void); - - /// Align all entries in the wchar_t type argv list with char type - /// argv list. - void align_wchar_with_char (void); - - /// Clean up removed (comsumed) argv entries and reset the pass flags. - void cleanup (void); -#endif // ACE_USES_WCHAR - -private: - /// Original number of input paramter, same as 'argc'. - int &saved_argc_; - - /// Data member pointer that contains converted argv in ACE_ANTI_TCHAR. - char** char_argv_; - -#if defined (ACE_USES_WCHAR) - /// Data member pointer that contains converted argv in ACE_TCHAR. - wchar_t** wchar_argv_; - - /// argc value before any argv has been passed. - int before_pass_argc_; - - /// false represents original argv passed in is char, and true - /// represents wchar_t. - bool const original_type_; - - /// true indicates wchar_t type argv has been passed. - bool wchar_passed_; - - /// true indicates char type argv has been passed. - bool char_passed_; -#endif /* ACE_USES_WCHAR */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Argv_Type_Converter.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ARGV_TYPE_CONVERTER_H */ - diff --git a/dep/include/ace/Argv_Type_Converter.inl b/dep/include/ace/Argv_Type_Converter.inl deleted file mode 100644 index e4b0ed5a059..00000000000 --- a/dep/include/ace/Argv_Type_Converter.inl +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- -// -// $Id: Argv_Type_Converter.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_TCHAR** -ACE_Argv_Type_Converter::get_TCHAR_argv (void) -{ -#if defined (ACE_USES_WCHAR) - if (this->char_passed_) - { - this->align_wchar_with_char (); - } - - this->wchar_passed_ = true; - return this->wchar_argv_; -#else - return this->char_argv_; -#endif // ACE_USES_WCHAR -} - -ACE_INLINE char** -ACE_Argv_Type_Converter::get_ASCII_argv (void) -{ -#if defined (ACE_USES_WCHAR) - if (this->wchar_passed_) - { - this->align_char_with_wchar (); - } - - this->char_passed_ = true; -#endif // ACE_USES_WCHAR - - return this->char_argv_; -} - -ACE_INLINE int& -ACE_Argv_Type_Converter::get_argc (void) -{ - return this->saved_argc_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Array.h b/dep/include/ace/Array.h deleted file mode 100644 index 8ef7f094ac8..00000000000 --- a/dep/include/ace/Array.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Array.h - * - * $Id: Array.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @deprecated - * - * @note This file has been deprecated and will soon go away. You - * should directly include "Containers_T.h" instead. - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ARRAY_H -#define ACE_ARRAY_H -#include /**/ "ace/pre.h" - -#include "ace/Containers_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/post.h" -#endif /* ACE_ARRAY_H */ - diff --git a/dep/include/ace/Array_Base.h b/dep/include/ace/Array_Base.h deleted file mode 100644 index feef89eda01..00000000000 --- a/dep/include/ace/Array_Base.h +++ /dev/null @@ -1,257 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Array_Base.h - * - * $Id: Array_Base.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ARRAY_BASE_H -#define ACE_ARRAY_BASE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/Malloc_Base.h" -#include /* For reverse_iterator adapters */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration. -template class ACE_Array_Iterator; - -/** - * @class ACE_Array_Base - * - * @brief Implement a simple dynamic array - * - * This parametric class implements a simple dynamic array; - * resizing must be controlled by the user. No comparison or find - * operations are implemented. - */ -template -class ACE_Array_Base -{ -public: - - // Old/ACE-style traits. - typedef T TYPE; - typedef ACE_Array_Iterator ITERATOR; - - // STL-style typedefs/traits. - typedef T value_type; - typedef value_type * iterator; - typedef value_type const * const_iterator; - typedef value_type & reference; - typedef value_type const & const_reference; - typedef value_type * pointer; - typedef value_type const * const_pointer; - typedef ptrdiff_t difference_type; - typedef ACE_Allocator::size_type size_type; - - ACE_DECLARE_STL_REVERSE_ITERATORS - - // = Initialization and termination methods. - - /// Dynamically create an uninitialized array. - ACE_Array_Base (size_type size = 0, - ACE_Allocator * the_allocator = 0); - - /// Dynamically initialize the entire array to the . - ACE_Array_Base (size_type size, - T const & default_value, - ACE_Allocator * the_allocator = 0); - - /** - * The copy constructor performs initialization by making an exact - * copy of the contents of parameter , i.e., *this == s will - * return true. - */ - ACE_Array_Base (ACE_Array_Base const & s); - - /** - * Assignment operator performs an assignment by making an exact - * copy of the contents of parameter , i.e., *this == s will - * return true. Note that if the of is >= than - * we can copy it without reallocating. However, if - * is < we must delete the , - * reallocate a new , and then copy the contents of . - */ - void operator= (ACE_Array_Base const & s); - - /// Clean up the array (e.g., delete dynamically allocated memory). - ~ACE_Array_Base (void); - - // = Set/get methods. - - /// Set item in the array at location @a slot. Doesn't - /// perform range checking. - T & operator[] (size_type slot); - - /// Get item in the array at location @a slot. Doesn't - /// perform range checking. - T const & operator[] (size_type slot) const; - - /// Set an item in the array at location @a slot. Returns - /// -1 if @a slot is not in range, else returns 0. - int set (T const & new_item, size_type slot); - - /** - * Get an item in the array at location @a slot. Returns -1 if - * @a slot is not in range, else returns 0. Note that this function - * copies the item. If you want to avoid the copy, you can use - * the const operator [], but then you'll be responsible for range checking. - */ - int get (T & item, size_type slot) const; - - /// Returns the of the array. - size_type size (void) const; - - /** - * Changes the size of the array to match . - * It copies the old contents into the new array. - * Return -1 on failure. - */ - int size (size_type new_size); - - /// Returns the of the array. - size_type max_size (void) const; - - /** - * Changes the size of the array to match . - * It copies the old contents into the new array. - * Return -1 on failure. - * It does not affect new_size - */ - int max_size (size_type new_size); - - /** - * @name Forward Iterator Accessors - * - * Forward iterator accessors. - */ - //@{ - iterator begin (void); - iterator end (void); - const_iterator begin (void) const; - const_iterator end (void) const; - //@} - - /** - * @name Reverse Iterator Accessors - * - * Reverse iterator accessors. - */ - //@{ - reverse_iterator rbegin (void); - reverse_iterator rend (void); - const_reverse_iterator rbegin (void) const; - const_reverse_iterator rend (void) const; - //@} - - /// Swap the contents of this array with the given @a array in - /// an exception-safe manner. - void swap (ACE_Array_Base & array); - -protected: - - /// Returns 1 if @a slot is within range, i.e., 0 >= @a slot < - /// , else returns 0. - bool in_range (size_type slot) const; - - /// Maximum size of the array, i.e., the total number of elements - /// in . - size_type max_size_; - - /** - * Current size of the array. This starts out being == to - * . However, if we are assigned a smaller array, then - * will become less than . The purpose of - * keeping track of both sizes is to avoid reallocating memory if we - * don't have to. - */ - size_type cur_size_; - - /// Pointer to the array's storage buffer. - value_type * array_; - - /// Allocation strategy of the ACE_Array_Base. - ACE_Allocator * allocator_; - - friend class ACE_Array_Iterator; -}; - -// **************************************************************** - -/** - * @class ACE_Array_Iterator - * - * @brief Implement an iterator over an ACE_Array. - * - * This iterator is safe in the face of array element deletions. - * But it is NOT safe if the array is resized (via the ACE_Array - * assignment operator) during iteration. That would be very - * odd, and dangerous. - */ -template -class ACE_Array_Iterator -{ -public: - // = Initialization method. - ACE_Array_Iterator (ACE_Array_Base &); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the Array. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the Array. Returns 0 when all the - /// items in the Array have been seen, else 1. - int advance (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the current item in the iteration. - size_t current_; - - /// Pointer to the Array we're iterating over. - ACE_Array_Base &array_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Array_Base.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Array_Base.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Array_Base.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ARRAY_BASE_H */ - diff --git a/dep/include/ace/Array_Base.inl b/dep/include/ace/Array_Base.inl deleted file mode 100644 index 046c1bffc89..00000000000 --- a/dep/include/ace/Array_Base.inl +++ /dev/null @@ -1,146 +0,0 @@ -// -*- C++ -*- -// -// $Id: Array_Base.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Clean up the array (e.g., delete dynamically allocated memory). -template ACE_INLINE -ACE_Array_Base::~ACE_Array_Base (void) -{ - ACE_DES_ARRAY_FREE (this->array_, - this->max_size_, - this->allocator_->free, - T); -} - -template -ACE_INLINE typename ACE_Array_Base::iterator -ACE_Array_Base::begin (void) -{ - return this->array_; -} - -template -ACE_INLINE typename ACE_Array_Base::iterator -ACE_Array_Base::end (void) -{ - return this->array_ + this->cur_size_; -} - -template -ACE_INLINE typename ACE_Array_Base::const_iterator -ACE_Array_Base::begin (void) const -{ - return this->array_; -} - -template -ACE_INLINE typename ACE_Array_Base::const_iterator -ACE_Array_Base::end (void) const -{ - return this->array_ + this->cur_size_; -} - -template -ACE_INLINE typename ACE_Array_Base::reverse_iterator -ACE_Array_Base::rbegin (void) -{ - return reverse_iterator (this->end ()); -} - -template -ACE_INLINE typename ACE_Array_Base::reverse_iterator -ACE_Array_Base::rend (void) -{ - return reverse_iterator (this->begin ()); -} - -template -ACE_INLINE typename ACE_Array_Base::const_reverse_iterator -ACE_Array_Base::rbegin (void) const -{ - return const_reverse_iterator (this->end ()); -} - -template -ACE_INLINE typename ACE_Array_Base::const_reverse_iterator -ACE_Array_Base::rend (void) const -{ - return const_reverse_iterator (this->begin ()); -} - -template ACE_INLINE typename ACE_Array_Base::size_type -ACE_Array_Base::size (void) const -{ - return this->cur_size_; -} - -template ACE_INLINE typename ACE_Array_Base::size_type -ACE_Array_Base::max_size (void) const -{ - return this->max_size_; -} - -template ACE_INLINE bool -ACE_Array_Base::in_range (typename ACE_Array_Base::size_type index) const -{ - return index < this->cur_size_; -} - -template ACE_INLINE T & -ACE_Array_Base::operator[] (typename ACE_Array_Base::size_type index) -{ - return this->array_[index]; -} - -template ACE_INLINE const T & -ACE_Array_Base::operator[] (typename ACE_Array_Base::size_type index) const -{ - return this->array_[index]; -} - -// **************************************************************** - -template ACE_INLINE void -ACE_Array_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Array_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE -ACE_Array_Iterator::ACE_Array_Iterator (ACE_Array_Base &a) - : current_ (0), - array_ (a) -{ - // ACE_TRACE ("ACE_Array_Iterator::ACE_Array_Iterator"); -} - -template ACE_INLINE int -ACE_Array_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Array_Iterator::advance"); - - if (this->current_ < array_.size ()) - { - ++this->current_; - return 1; - } - else - { - // Already finished iterating. - return 0; - } -} - -template ACE_INLINE int -ACE_Array_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Array_Iterator::done"); - - return this->current_ >= array_.size (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Array_Map.h b/dep/include/ace/Array_Map.h deleted file mode 100644 index f7b79a4be39..00000000000 --- a/dep/include/ace/Array_Map.h +++ /dev/null @@ -1,300 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Array_Map.h - * - * $Id: Array_Map.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Light weight array-based map with fast iteration but linear - * (i.e. O(n)) search times. STL-style interface is exposed. - * - * @note This class requires the STL generic algorithms and - * reverse_iterator adapter. - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_ARRAY_MAP_H -#define ACE_ARRAY_MAP_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include -#include -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Array_Map - * - * @brief Light weight array-based map with fast iteration, but linear - * (i.e. O(n)) search times. - * - * Map implementation that focuses on small footprint and fast - * iteration. Search times are, however, linear (O(n)) meaning that - * this map isn't suitable for large data sets that will be searched - * in performance critical areas of code. Iteration over large data - * sets, however, is faster than linked list-based maps, for example, - * since spatial locality is maximized through the use of contiguous - * arrays as the underlying storage. - * @par - * An @c ACE_Array_Map is a unique associative container, meaning that - * duplicate values may not be added to the map. It is also pair - * associative (value_type is a std::pair<>). It is not a sorted - * container. - * @par - * An STL @c std::map -like interface is exposed by this class - * portability. Furthermore, this map's iterators are compatible with - * STL algorithms. - * @par - * Requirements and Performance Characteristics - * - Internal Structure - * Array - * - Duplicates allowed? - * No - * - Random access allowed? - * Yes - * - Search speed - * O(n) - * - Insert/replace speed - * O(n), can be longer if the map has to resize - * - Iterator still valid after change to container? - * No - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for key type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== - * - Requirements for object type - * -# Default constructor - * -# Copy constructor - * -# operator= - */ -template > -class ACE_Array_Map -{ -public: - - // STL-style typedefs/traits. - typedef Key key_type; - typedef Value data_type; - typedef std::pair value_type; - typedef value_type * iterator; - typedef value_type const * const_iterator; - typedef value_type & reference; - typedef value_type const & const_reference; - typedef value_type * pointer; - typedef value_type const * const_pointer; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - - ACE_DECLARE_STL_REVERSE_ITERATORS - - /// Default Constructor. - /** - * Create an empty map with a preallocated buffer of size @a s. - */ - ACE_Array_Map (size_type s = 0); - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - template - ACE_Array_Map (InputIterator f, InputIterator l); -#else - ACE_Array_Map (const_iterator f, const_iterator l); -#endif /* !ACE_LACKS_MEMBER_TEMPLATES */ - - ACE_Array_Map (ACE_Array_Map const & map); - ACE_Array_Map & operator= (ACE_Array_Map const & map); - - /// Destructor. - ~ACE_Array_Map (void); - - /** - * @name Forward Iterator Accessors - * - * Forward iterator accessors. - */ - //@{ - iterator begin (void); - iterator end (void); - const_iterator begin (void) const; - const_iterator end (void) const; - //@} - - /** - * @name Reverse Iterator Accessors - * - * Reverse iterator accessors. - */ - //@{ - reverse_iterator rbegin (void); - reverse_iterator rend (void); - const_reverse_iterator rbegin (void) const; - const_reverse_iterator rend (void) const; - //@} - - /// Return current size of map. - /** - * @return The number of elements in the map. - */ - size_type size (void) const; - - /// Maximum number of elements the map can hold. - size_type max_size (void) const; - - /// Return @c true if the map is empty, else @c false. - bool is_empty (void) const; // ACE style - - /** - * Return @c true if the map is empty, else @c false. We recommend - * using @c is_empty() instead since it's more consistent with the - * ACE container naming conventions. - */ - bool empty (void) const; // STL style - - /// Swap the contents of this map with the given @a map in an - /// exception-safe manner. - void swap (ACE_Array_Map & map); - - /// Insert the value @a x into the map. - /** - * STL-style map insertion method. - * - * @param x @c std::pair containing key and datum. - * - * @return @c std::pair::second will be @c false if the map already - * contains a value with the same key as @a x. - */ - std::pair insert (value_type const & x); - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - /// Insert range of elements into map. - template - void insert (InputIterator f, InputIterator l); -#else - /// Insert range of elements into map. - void insert (const_iterator f, const_iterator l); -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - - /// Remove element at position @a pos from the map. - void erase (iterator pos); - - /// Remove element corresponding to key @a k from the map. - /** - * @return Number of elements that were erased. - */ - size_type erase (key_type const & k); - - /// Remove range of elements [@a first, @a last) from the map. - /** - * @note [@a first, @a last) must be valid range within the map. - */ - void erase (iterator first, iterator last); - - /// Clear contents of map. - /** - * @note This a constant time (O(1)) operation. - */ - void clear (void); - - /** - * @name Search Operations - * - * Search the map for data corresponding to key @a k. - */ - //@{ - /** - * @return @c end() if data corresponding to key @a k is not in the - * map. - */ - iterator find (key_type const & k); - - /** - * @return @c end() if data corresponding to key @a k is not in the - * map. - */ - const_iterator find (key_type const & k) const; - //@} - - /// Count the number of elements corresponding to key @a k. - /** - * @return In the case of this map, the count will always be one if - * such exists in the map. - */ - size_type count (key_type const & k); - - /// Convenience array index operator. - /** - * Array index operator that allows insertion and retrieval of - * elements using an array index syntax, such as: - * @par - * map["Foo"] = 12; - */ - data_type & operator[] (key_type const & k); - -private: - - /// Increase size of underlying buffer by @a s. - void grow (size_type s); - -private: - - /// Number of elements in the map. - size_type size_; - - /// Current size of underlying array. - /** - * @note @c capacity_ is always greater than or equal to @c size_; - */ - size_type capacity_; - - /// Underlying array containing keys and data. - value_type * nodes_; - -}; - -// -------------------------------------------------------------- - -/// @c ACE_Array_Map equality operator. -template -bool operator== (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs); - -/// @c ACE_Array_Map lexicographical comparison operator. -template -bool operator< (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs); - -// -------------------------------------------------------------- - -ACE_END_VERSIONED_NAMESPACE_DECL - -#ifdef __ACE_INLINE__ -# include "ace/Array_Map.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Array_Map.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Array_Map.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ARRAY_MAP_H */ - diff --git a/dep/include/ace/Array_Map.inl b/dep/include/ace/Array_Map.inl deleted file mode 100644 index b053dc0a441..00000000000 --- a/dep/include/ace/Array_Map.inl +++ /dev/null @@ -1,133 +0,0 @@ -// -*- C++ -*- -// -// $Id: Array_Map.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_INLINE -ACE_Array_Map::ACE_Array_Map ( - typename ACE_Array_Map::size_type s) - : size_ (0) - , capacity_ (s) - , nodes_ (s == 0 ? 0 : new value_type[s]) -{ -} - -template -ACE_INLINE ACE_Array_Map & -ACE_Array_Map::operator= ( - ACE_Array_Map const & map) -{ - // Strongly exception-safe assignment. - - ACE_Array_Map temp (map); - this->swap (temp); - return *this; -} - -template -ACE_INLINE typename ACE_Array_Map::iterator -ACE_Array_Map::begin (void) -{ - return this->nodes_; -} - -template -ACE_INLINE typename ACE_Array_Map::iterator -ACE_Array_Map::end (void) -{ - return this->nodes_ + this->size_; -} - -template -ACE_INLINE typename ACE_Array_Map::const_iterator -ACE_Array_Map::begin (void) const -{ - return this->nodes_; -} - -template -ACE_INLINE typename ACE_Array_Map::const_iterator -ACE_Array_Map::end (void) const -{ - return this->nodes_ + this->size_; -} - -template -ACE_INLINE typename ACE_Array_Map::reverse_iterator -ACE_Array_Map::rbegin (void) -{ - return reverse_iterator (this->end ()); -} - -template -ACE_INLINE typename ACE_Array_Map::reverse_iterator -ACE_Array_Map::rend (void) -{ - return reverse_iterator (this->begin ()); -} - -template -ACE_INLINE typename ACE_Array_Map::const_reverse_iterator -ACE_Array_Map::rbegin (void) const -{ - return const_reverse_iterator (this->end ()); -} - -template -ACE_INLINE typename ACE_Array_Map::const_reverse_iterator -ACE_Array_Map::rend (void) const -{ - return const_reverse_iterator (this->begin ()); -} - -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::size (void) const -{ - return this->size_; -} - -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::max_size (void) const -{ - return size_type (-1) / sizeof (value_type); -} - -template -ACE_INLINE bool -ACE_Array_Map::is_empty (void) const -{ - return this->size_ == 0; -} - -// The following method is deprecated. - -template -ACE_INLINE bool -ACE_Array_Map::empty (void) const -{ - return this->is_empty (); -} - -template -ACE_INLINE typename ACE_Array_Map::size_type -ACE_Array_Map::count ( - typename ACE_Array_Map::key_type const & k) -{ - return - (this->find (k) == this->end () ? 0 : 1); // Only one datum per key. -} - -template -ACE_INLINE typename ACE_Array_Map::data_type & -ACE_Array_Map::operator[] ( - typename ACE_Array_Map::key_type const & k) -{ - iterator i = (this->insert (value_type (k, data_type ()))).first; - return (*i).second; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Assert.h b/dep/include/ace/Assert.h deleted file mode 100644 index 5bdf56f0531..00000000000 --- a/dep/include/ace/Assert.h +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Assert.h - * - * $Id: Assert.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ASSERT_H -#define ACE_ASSERT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#include /**/ "ace/config-all.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_Export void __ace_assert(const char *file, int line, const ACE_TCHAR *expression); -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_NDEBUG) -#define ACE_ASSERT(x) \ - (static_cast(0)) -#else -#define ACE_ASSERT(X) \ - ((X) \ - ? static_cast(0) \ - : ACE_VERSIONED_NAMESPACE_NAME::__ace_assert(__FILE__, __LINE__, ACE_TEXT_CHAR_TO_TCHAR (#X))) -#endif /* ACE_NDEBUG */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ASSERT */ - diff --git a/dep/include/ace/Asynch_Acceptor.h b/dep/include/ace/Asynch_Acceptor.h deleted file mode 100644 index e14126d3f1f..00000000000 --- a/dep/include/ace/Asynch_Acceptor.h +++ /dev/null @@ -1,282 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Asynch_Acceptor.h - * - * $Id: Asynch_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali (irfan@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_ASYNCH_ACCEPTOR_H -#define ACE_ASYNCH_ACCEPTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) -// This only works on platforms that support async i/o. - -#include "ace/Default_Constants.h" -#include "ace/Asynch_IO.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations -class ACE_Message_Block; -class ACE_INET_Addr; - -/** - * @class ACE_Asynch_Acceptor - * - * @brief This class is an example of the Acceptor Pattern. This class - * will accept new connections and create new HANDLER to handle - * the new connections. - * - * Unlike the ACE_Acceptor, however, this class is designed to - * be used asynchronously. - */ -template -class ACE_Asynch_Acceptor : public ACE_Handler -{ -public: - /// A do nothing constructor. - ACE_Asynch_Acceptor (void); - - /// Virtual destruction - virtual ~ACE_Asynch_Acceptor (void); - - /** - * @c open starts one or more asynchronous accept requests on a - * @a address. Each accept operation may optionally read an - * initial buffer from the new connection when accepted. - * - * @param address The address to listen/accept connections on. - * If the address does not specify a port, a random - * port is selected and bound. - * @param bytes_to_read Optional, specifies the maximum number of bytes - * to read with the accept. The buffer for the initial - * data is allocated internally and passed to the - * @c ACE_Service_Handler::open() hook method. It is - * legitimate only during the @c open() method and must - * be copied if required after @c open() returns. - * This pre-read function works only on Windows. - * @param pass_addresses Optional, a non-zero value indicates that - * the local and peer addresses should be passed to the - * associated @c ACE_Service_Handler::addresses() method - * after any call to @c validate_new_connection() and prior - * to the @c open() hook method call. - * @param backlog Optional, defaulting to @c ACE_DEFAULT_ASYNCH_BACKLOG (which - * can be adjusted in your platform's @c config.h file). - * Specifies the listening backlog for the listening socket. - * @param reuse_addr Optional, indicates whether the @c SO_REUSEADDR - * option is set on the listening socket or not. - * @param proactor Optional, pointer to the @c ACE_Proactor to use for - * demultiplexing asynchronous accepts. If 0, the - * process's singleton @c ACE_Proactor is used. - * @param validate_new_connection Optional, if true, this object's - * @c validate_connection() method is called after - * the accept completes, but before the service handler's - * @c open() hook method is called. If @c - * validate_connection() returns -1, the newly-accepted - * socket is immediately closed, and the @c addresses() - * method is not called. - * @param reissue_accept Optional, if non-zero (the default), a new - * asynchronous accept operation is started after each - * completion, whether the completion is for success or - * failure, and whether or not a successfully-accepted - * connection is subsequently refused. - * @param number_of_initial_accepts Optional, the number of asynchronous - * accepts that are started immediately. If -1 (the - * default), the value of @a backlog is used. - * - * @note On Windows, the peer address is only available at the time - * the connection is accepted. Therefore, if you require the peer - * address on Windows, do not rely on the - * @c ACE_SOCK::get_remote_addr() method - it won't work. You must - * supply a non-zero value for @a pass_addresses and obtain the - * peer address in the @c ACE_Service_Handler::addresses() method. - * - * @see ACE_INET_Addr - * @see ACE_Service_Handler - */ - virtual int open (const ACE_INET_Addr &address, - size_t bytes_to_read = 0, - bool pass_addresses = false, - int backlog = ACE_DEFAULT_ASYNCH_BACKLOG, - int reuse_addr = 1, - ACE_Proactor *proactor = 0, - bool validate_new_connection = false, - int reissue_accept = 1, - int number_of_initial_accepts = -1); - - /// Get the underlying handle. - virtual ACE_HANDLE get_handle (void) const; - - /** - * Set the underlying listen handle. It is the user's responsibility - * to make sure that the old listen handle has been appropriately - * closed and the all outstanding asynchronous operations have - * either completed or have been canceled on the old listen handle. - */ - virtual int set_handle (ACE_HANDLE handle); - - /// This initiates a new asynchronous accept operation. - /** - * You need only call this method if the @a reissue_accept argument - * passed to @c open() was 0. - */ - virtual int accept (size_t bytes_to_read = 0, const void *act = 0); - - /** - * Cancels all pending accepts operations issued by this object. - * - * @note On Windows, only accept operations initiated by the calling thread - * are canceled. - */ - virtual int cancel (void); - - /** - * Template method to validate peer before service is opened. - * This method is called after a new connection is accepted if the - * @a validate_connection argument to @c open() was non-zero or - * the @c validate_new_connection() method is called to turn this - * feature on. The default implementation returns 0. Users can - * reimplement this method to perform validation of the peer - * using it's address, running an authentication procedure (such as - * SSL) or anything else necessary or desireable. The return value - * from this method determines whether or not ACE will continue - * opening the service or abort the connection. - * - * @param result Result of the connection acceptance. - * @param remote Peer's address. - * @param local Local address connection was accepted at. - * - * @retval -1 ACE_Asynch_Acceptor will close the connection, and - * the service will not be opened. - * @retval 0 Service opening will proceeed. - */ - virtual int validate_connection (const ACE_Asynch_Accept::Result& result, - const ACE_INET_Addr &remote, - const ACE_INET_Addr& local); - - /** - * Template method for deciding whether to reissue accept. - * - * This hook method is called after each accept completes to decide if - * another accept should be initiated. If the method returns a non-zero - * value, another accept is initiated. - * - * The default implemenation always returns the value passed as the - * @c open() method's @a reissue_accept argument. That value can also - * be changed using the @c reissue_accept() method. - */ - virtual int should_reissue_accept (void); - - // - // These are low level tweaking methods - // - - /// Get flag that indicates if parsing and passing of addresses to - /// the service_handler is necessary. - virtual bool pass_addresses (void) const; - - /// Set flag that indicates if parsing and passing of addresses to - /// the service_handler is necessary. - virtual void pass_addresses (bool new_value); - - /// Get flag that indicates if address validation is required. - virtual bool validate_new_connection (void) const; - - /// Set flag that indicates if address validation is required. - virtual void validate_new_connection (bool new_value); - - /// Get flag that indicates if a new accept should be reissued when a accept - /// completes. - virtual int reissue_accept (void) const; - - /// Set flag that indicates if a new accept should be reissued when a accept - /// completes. - virtual void reissue_accept (int new_value); - - /// Get bytes to be read with the call. - virtual size_t bytes_to_read (void) const; - - /// Set bytes to be read with the call. - virtual void bytes_to_read (size_t new_value); - - /// @deprecated address_size() assumes IPv4 use, so is not always valid. - /// This method will be removed after ACE 5.5. Internal uses have been - /// changes to base needed sizes on the addr_family_ member. - static size_t address_size (void); - -protected: - - /// This is called when an outstanding accept completes. - virtual void handle_accept (const ACE_Asynch_Accept::Result &result); - - /// Return the listen handle. - ACE_HANDLE handle (void) const; - /// Set the listen handle. - void handle (ACE_HANDLE h); - - /// This parses the address from read buffer. - void parse_address (const ACE_Asynch_Accept::Result &result, - ACE_INET_Addr &remote_address, - ACE_INET_Addr &local_address); - - /// Return the asynch accept object. - ACE_Asynch_Accept &asynch_accept (void); - - /** - * This is the template method used to create new handler. - * Subclasses must overwrite this method if a new handler creation - * strategy is required. - */ - virtual HANDLER *make_handler (void); - -private: - /// Handle used to listen for new connections. - ACE_HANDLE listen_handle_; - - /// Asynch_Accept used to make life easier :-) - ACE_Asynch_Accept asynch_accept_; - - /// Flag that indicates if parsing of addresses is necessary. - bool pass_addresses_; - - /// Flag that indicates if address validation is required. - bool validate_new_connection_; - - /// Flag that indicates if a new accept should be reissued when a - /// accept completes. - int reissue_accept_; - - /// Bytes to be read with the call. - size_t bytes_to_read_; - - /// Address family used to open this object. Obtained from @a address passed - /// to @c open(). - int addr_family_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Asynch_Acceptor.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Asynch_Acceptor.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ -#include /**/ "ace/post.h" -#endif /* ACE_ASYNCH_ACCEPTOR_H */ - diff --git a/dep/include/ace/Asynch_Connector.h b/dep/include/ace/Asynch_Connector.h deleted file mode 100644 index 569242cba22..00000000000 --- a/dep/include/ace/Asynch_Connector.h +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Asynch_Connector.h - * - * $Id: Asynch_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_ASYNCH_CONNECTOR_H -#define ACE_ASYNCH_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (defined (ACE_WIN32) || defined (ACE_HAS_AIO_CALLS)) && !defined(ACE_HAS_WINCE) -// This only works on platforms that support async i/o. - -#include "ace/Asynch_IO.h" -#include "ace/INET_Addr.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations -class ACE_Message_Block; - -/** - * @class ACE_Asynch_Connector - * - * @brief This class is an example of the Connector pattern. This class - * will establish new connections and create new HANDLER objects to handle - * the new connections. - * - * Unlike the ACE_Connector, however, this class is designed to - * be used asynchronously with the ACE Proactor framework. - */ - -template -class ACE_Asynch_Connector : public ACE_Handler -{ -public: - /// A do nothing constructor. - ACE_Asynch_Connector (void); - - /// Virtual destruction - virtual ~ACE_Asynch_Connector (void); - - /** - * This opens asynch connector - */ - virtual int open (bool pass_addresses = false, - ACE_Proactor *proactor = 0, - bool validate_new_connection = true); - - /// This initiates a new asynchronous connect - virtual int connect (const ACE_INET_Addr &remote_sap, - const ACE_INET_Addr &local_sap = - (const ACE_INET_Addr &)ACE_Addr::sap_any, - int reuse_addr = 1, - const void *act = 0); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. - * - * @note On Windows, this method does not cancel connect operations - * issued by other threads. - * - * @note On POSIX, delegates cancelation to ACE_POSIX_Asynch_Connect. - */ - virtual int cancel (void); - - /** - * Template method to validate peer before service is opened. - * This method is called when the connection attempt completes, - * whether it succeeded or failed, if the @a validate_connection - * argument to @c open() was non-zero or the @c validate_new_connection() - * method is called to turn this feature on. The default implementation - * returns 0. Users can (and probably should) reimplement this method - * to learn about the success or failure of the connection attempt. - * If the connection completed successfully, this method can be used to - * perform validation of the peer using it's address, running an - * authentication procedure (such as SSL) or anything else necessary or - * desireable. The return value from this method determines whether or - * not ACE will continue opening the service or abort the connection. - * - * @param result Result of the connection acceptance. Use - * result.success() to determine success or failure of - * the connection attempt. - * @param remote Peer's address. If the connection failed, this object - * is undefined. - * @param local Local address connection was completed from. If the - * connection failed, this object is undefined. - * - * @retval -1 ACE_Asynch_Connector will close the connection, and - * the service will not be opened. - * @retval 0 Service opening will proceeed. - * @return Return value is ignored if the connection attempt failed. - */ - virtual int validate_connection (const ACE_Asynch_Connect::Result& result, - const ACE_INET_Addr &remote, - const ACE_INET_Addr& local); - - // - // These are low level tweaking methods - // - - /// Set and get flag that indicates if parsing and passing of - /// addresses to the service_handler is necessary. - virtual bool pass_addresses (void) const; - virtual void pass_addresses (bool new_value); - - /// Set and get flag that indicates if address validation is - /// required. - virtual bool validate_new_connection (void) const; - virtual void validate_new_connection (bool new_value); - -protected: - - /// This is called when an outstanding accept completes. - virtual void handle_connect (const ACE_Asynch_Connect::Result &result); - - /// This parses the address from read buffer. - void parse_address (const ACE_Asynch_Connect::Result &result, - ACE_INET_Addr &remote_address, - ACE_INET_Addr &local_address); - - /// Return the asynch Connect object. - ACE_Asynch_Connect & asynch_connect (void); - - /** - * This is the template method used to create new handler. - * Subclasses must overwrite this method if a new handler creation - * strategy is required. - */ - virtual HANDLER *make_handler (void); - -private: - - /// Asynch_Connect used to make life easier :-) - ACE_Asynch_Connect asynch_connect_; - - /// Flag that indicates if parsing of addresses is necessary. - bool pass_addresses_; - - /// Flag that indicates if address validation is required. - bool validate_new_connection_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Asynch_Connector.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Asynch_Connector.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ -#include /**/ "ace/post.h" -#endif /* ACE_ASYNCH_CONNECTOR_H */ - diff --git a/dep/include/ace/Asynch_IO.h b/dep/include/ace/Asynch_IO.h deleted file mode 100644 index 00b24b82e74..00000000000 --- a/dep/include/ace/Asynch_IO.h +++ /dev/null @@ -1,1731 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Asynch_IO.h - * - * $Id: Asynch_IO.h 81870 2008-06-09 20:53:53Z shuston $ - * - * This works on Win32 (defined (ACE_WIN32) && !defined - * (ACE_HAS_WINCE)) platforms and on POSIX4 platforms with {aio_*} - * routines (defined (ACE_HAS_AIO_CALLS)) - * - * On Win32 platforms, the implementation of - * {ACE_Asynch_Transmit_File} and {ACE_Asynch_Accept} are only - * supported if ACE_HAS_WINSOCK2 is defined or you are on WinNT 4.0 - * or higher. - * - * @author Irfan Pyarali - * @author Tim Harrison - * @author Alexander Babu Arulanthu - * @author Roger Tragin - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_ASYNCH_IO_H -#define ACE_ASYNCH_IO_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) - -#include "ace/Synch_Traits.h" -#if defined (ACE_HAS_THREADS) -# include "ace/Thread_Mutex.h" -#else -# include "ace/Null_Mutex.h" -#endif /* ACE_HAS_THREADS */ -#include "ace/Refcounted_Auto_Ptr.h" - -#include "ace/os_include/os_signal.h" -#include "ace/os_include/sys/os_socket.h" -#include "ace/os_include/sys/os_types.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_WIN32_OVERLAPPED_IO) -typedef TRANSMIT_FILE_BUFFERS ACE_TRANSMIT_FILE_BUFFERS; -typedef LPTRANSMIT_FILE_BUFFERS ACE_LPTRANSMIT_FILE_BUFFERS; -typedef PTRANSMIT_FILE_BUFFERS ACE_PTRANSMIT_FILE_BUFFERS; - -# define ACE_INFINITE INFINITE -# define ACE_STATUS_TIMEOUT STATUS_TIMEOUT -# define ACE_WAIT_FAILED WAIT_FAILED -# define ACE_WAIT_TIMEOUT WAIT_TIMEOUT -# else /* ACE_HAS_WIN32_OVERLAPPED_IO */ -struct ACE_TRANSMIT_FILE_BUFFERS -{ - void *Head; - size_t HeadLength; - void *Tail; - size_t TailLength; -}; -typedef ACE_TRANSMIT_FILE_BUFFERS* ACE_PTRANSMIT_FILE_BUFFERS; -typedef ACE_TRANSMIT_FILE_BUFFERS* ACE_LPTRANSMIT_FILE_BUFFERS; - -# if !defined (ACE_INFINITE) -# define ACE_INFINITE LONG_MAX -# endif /* ACE_INFINITE */ -# define ACE_STATUS_TIMEOUT LONG_MAX -# define ACE_WAIT_FAILED LONG_MAX -# define ACE_WAIT_TIMEOUT LONG_MAX -# endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ - -// Forward declarations -class ACE_Proactor; -class ACE_Handler; -class ACE_Message_Block; -class ACE_INET_Addr; -class ACE_Addr; - -// Forward declarations -class ACE_Asynch_Result_Impl; -class ACE_Time_Value; - -/** - * @class ACE_Asynch_Result - * - * @brief An interface base class which allows users access to common - * information related to an asynchronous operation. - * - * An interface base class from which you can obtain some basic - * information like the number of bytes transferred, the ACT - * associated with the asynchronous operation, indication of - * success or failure, etc. Subclasses may want to store more - * information that is particular to the asynchronous operation - * it represents. - */ -class ACE_Export ACE_Asynch_Result -{ - -public: - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This is the ACT associated with the handle on which the - * Asynch_Operation takes place. - * - * On WIN32, this returns the ACT associated with the handle when it - * was registered with the I/O completion port. - * - * @@ This is not implemented for POSIX4 platforms. Returns 0. - */ - const void *completion_key (void) const; - - /// Error value if the operation fails. - unsigned long error (void) const; - - /** - * On WIN32, this returns the event associated with the OVERLAPPED - * structure. - * - * This returns ACE_INVALID_HANDLE on POSIX4-Unix platforms. - */ - ACE_HANDLE event (void) const; - - /** - * This really makes sense only when doing file I/O. - * - * On WIN32, these are represented in the OVERLAPPED datastructure. - * - * @@ On POSIX4-Unix, offset_high should be supported using - * aiocb64. - */ - unsigned long offset (void) const; - unsigned long offset_high (void) const; - - /** - * Priority of the operation. - * - * On POSIX4-Unix, this is supported. Priority works like {nice} in - * Unix. Negative values are not allowed. 0 means priority of the - * operation same as the process priority. 1 means priority of the - * operation is one less than process. And so forth. - * - * On Win32, this is a no-op. - */ - int priority (void) const; - - /** - * POSIX4 real-time signal number to be used for the - * operation. {signal_number} ranges from ACE_SIGRTMIN to ACE_SIGRTMAX. By - * default, ACE_SIGRTMIN is used to issue {aio_} calls. This is a no-op - * on non-POSIX4 systems and returns 0. - */ - int signal_number (void) const; - - /// Destructor. - virtual ~ACE_Asynch_Result (void); - -protected: - /// Constructor. This implementation will not be deleted. The - /// implementation will be deleted by the Proactor. - ACE_Asynch_Result (ACE_Asynch_Result_Impl *implementation); - - /// Get the implementation class. - ACE_Asynch_Result_Impl *implementation (void) const; - - /// Implementation class. - ACE_Asynch_Result_Impl *implementation_; -}; - -// Forward declarations -class ACE_Asynch_Operation_Impl; - -/** - * @class ACE_Asynch_Operation - * - * @brief This is an interface base class for all asynch - * operations. The resposiblility of this class is to forward - * all methods to its delegation/implementation class, e.g., - * ACE_WIN32_Asynch_Operation or ACE_POSIX_Asynch_Operation. - * - * There are some attributes and functionality which is common - * to all asychronous operations. The delegation classes of this - * class will factor out this code. - */ -class ACE_Export ACE_Asynch_Operation -{ - -public: - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * (Attempts to) cancel the asynchronous operation pending against - * the {handle} registered with this Operation. - * - * All completion notifications for the I/O operations will occur - * normally. - * - * = Return Values: - * - * -1 : Operation failed. (can get only in POSIX). - * 0 : All the operations were cancelled. - * 1 : All the operations were already finished in this - * handle. Unable to cancel them. - * 2 : Atleast one of the requested operations cannot be - * cancelled. - * - * There is slight difference in the semantics between NT and POSIX - * platforms which is given below. - * - * = Win32 : - * - * cancels all pending accepts operations that were issued by the - * calling thread. The function does not cancel asynchronous - * operations issued by other threads. - * All I/O operations that are canceled will complete with the - * error ERROR_OPERATION_ABORTED. - * - * = POSIX: - * - * Attempts to cancel one or more asynchronous I/O requests - * currently outstanding against the {handle} registered in this - * operation. - * For requested operations that are successfully canceled, the - * associated error status is set to ECANCELED. - */ - int cancel (void); - - // = Access methods. - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - - /// Destructor. - virtual ~ACE_Asynch_Operation (void); - -protected: - /// Constructor. - ACE_Asynch_Operation (void); - - /// Return the underlying implementation class. - virtual ACE_Asynch_Operation_Impl *implementation (void) const = 0; - - /// Get a proactor for/from the user - ACE_Proactor *get_proactor (ACE_Proactor *user_proactor, - ACE_Handler &handler) const; -}; - -// Forward declarations -class ACE_Asynch_Read_Stream_Result_Impl; -class ACE_Asynch_Read_Stream_Impl; - -/** - * @class ACE_Asynch_Read_Stream - * - * @brief This class is a factory for starting off asynchronous reads - * on a stream. This class forwards all methods to its - * implementation class. - * - * Once {open} is called, multiple asynchronous {read}s can - * started using this class. An ACE_Asynch_Read_Stream::Result - * will be passed back to the {handler} when the asynchronous - * reads completes through the {ACE_Handler::handle_read_stream} - * callback. - */ -class ACE_Export ACE_Asynch_Read_Stream : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Read_Stream (void); - - /// Destructor - virtual ~ACE_Asynch_Read_Stream (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. - * - * @param handler The ACE_Handler that will be called to handle completions - * for operations initiated using this factory. - * @param handle The handle that future read operations will use. - * If handle == @c ACE_INVALID_HANDLE, - * ACE_Handler::handle() will be called on @ handler - * to get the correct handle. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * Initiate an asynchronous read operation. - * - * @param message_block The ACE_Message_Block to receive the data. - * Received bytes will be placed in the block - * beginning at its current write pointer. - * If data is read, the message block's write - * pointer will be advanced by the number of - * bytes read. - * @param num_bytes_to_read The maximum number of bytes to read. - * @param act Asynchronous Completion Token; passed through to - * the completion handler in the Result object. - * @param priority Priority of the operation. On POSIX4-Unix, - * this is supported. Works like @c nice in Unix. - * Negative values are not allowed. 0 means - * priority of the operation same as the process - * priority. 1 means priority of the operation is - * one less than process priority, etc. - * Ignored on Windows. - * @param signal_number The POSIX4 real-time signal number to be used - * to signal completion of the operation. Values - * range from ACE_SIGRTMIN to ACE_SIGRTMAX. - * This argument is ignored on non-POSIX4 systems. - */ - int read (ACE_Message_Block &message_block, - size_t num_bytes_to_read, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - */ - int readv (ACE_Message_Block &message_block, - size_t num_bytes_to_read, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); -#endif /* defined (ACE_HAS_WIN32_OVERLAPPED_IO) */ - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Implementation class that all methods will be forwarded to. - ACE_Asynch_Read_Stream_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is the class which will be passed back to the - * ACE_Handler::handle_read_stream when the asynchronous read completes. - * This class forwards all the methods to the implementation classes. - * - * This class has all the information necessary for the - * handler to uniquiely identify the completion of the - * asynchronous read. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Read_Stream_Result; - friend class ACE_WIN32_Asynch_Read_Stream_Result; - - public: - /// The number of bytes which were requested at the start of the - /// asynchronous read. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for reading. - ACE_HANDLE handle (void) const; - - /// Get the implementation class. - ACE_Asynch_Read_Stream_Result_Impl *implementation (void) const; - - protected: - /// Constructor. - Result (ACE_Asynch_Read_Stream_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// The implementation class. - ACE_Asynch_Read_Stream_Result_Impl *implementation_; - }; -}; - -// Forward declarations -class ACE_Asynch_Write_Stream_Impl; -class ACE_Asynch_Write_Stream_Result_Impl; - -/** - * @class ACE_Asynch_Write_Stream - * - * @brief This class is a factory for initiating asynchronous writes - * on a connected TCP/IP stream. This class forwards all methods to its - * implementation class. - * - * Once open() is called, multiple asynchronous writes can be - * started using this class. An ACE_Asynch_Write_Stream::Result - * will be passed to the ACE_Handler::handle_write_stream() method on the - * opened ACE_Handler object when the asynchronous write completes. - */ -class ACE_Export ACE_Asynch_Write_Stream : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Write_Stream (void); - - /// Destructor. - virtual ~ACE_Asynch_Write_Stream (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous operation. - * - * @param handler ACE_Handler to be notified when operations initiated - * via this factory complete. The handle_write_stream() - * method will be called on this object. - * @param handle The socket handle to initiate write operations on. - * If handle is @c ACE_INVALID_HANDLE, - * ACE_Handler::handle() will be called on handler to - * get the handle value. - * @param completion_key A token that is passed to the completion handler. - * @param proactor The ACE_Proactor object which will control operation - * completion and dispatching the results to handler. - * If this is 0, the process's singleton ACE_Proactor - * will be used. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * Initiates an asynchronous write on a socket. If the operation completes - * the ACE_Handler object registered in open() will receive a completion - * callback via its handle_write_stream() method. - * - * @param bytes_to_write The number of bytes to write. - * @param message_block The ACE_Message_Block containing data to write. - * Data is written to the socket beginning at the - * block's rd_ptr. Upon successful completion - * of the write operation, the message_block rd_ptr - * is updated to reflect the data that was written. - * @param act Token that is passed through to the completion - * handler. - * @param priority Priority of the operation. This argument only has - * an affect on POSIX4-Unix. Works like @c nice in - * Unix; negative values are not allowed. 0 means - * priority of the operation same as the process - * priority. 1 means priority of the operation is one - * less than the process, and so forth. - * @param signal_number The POSIX4 real-time signal number to be used - * for the operation. signal_number ranges from - * ACE_SIGRTMIN to ACE_SIGRTMAX. This argument is - * not used on other platforms. - * - * @retval 0 for success, and the handle_write_stream associated - * with the opened ACE_Handler will be called. An - * instance of ACE_Asynch_Write_Stream::Result will be - * passed to the completion handler. - * @retval -1 for failure; consult @c errno for further information. - */ - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - */ - int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); -#endif /* defined (ACE_HAS_WIN32_OVERLAPPED_IO) */ - - /// Return the underlying implementation class. - /// @todo (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Implementation class that all methods will be forwarded to. - ACE_Asynch_Write_Stream_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * ACE_Handler when the asynchronous write completes. This class - * forwards all the methods to the implementation class. - * - * This class has all the information necessary for the - * handler to uniquiely identify the completion of the - * asynchronous write. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Write_Stream_Result; - friend class ACE_WIN32_Asynch_Write_Stream_Result; - - public: - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write (void) const; - - /// Message block that contains the data to be written. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for writing. - ACE_HANDLE handle (void) const; - - /// Get the implementation class. - ACE_Asynch_Write_Stream_Result_Impl *implementation (void) const; - - protected: - /// Constructor. - Result (ACE_Asynch_Write_Stream_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// Implementation class. - ACE_Asynch_Write_Stream_Result_Impl *implementation_; - }; -}; - -// Forward declarations -class ACE_Asynch_Read_File_Impl; -class ACE_Asynch_Read_File_Result_Impl; - -/** - * @class ACE_Asynch_Read_File - * - * @brief This class is a factory for starting off asynchronous reads - * on a file. This class forwards all methods to its - * implementation class. - * - * Once open() is called, multiple asynchronous reads can - * started using this class. An ACE_Asynch_Read_File::Result - * will be passed back to the completion handler's - * ACE_Handler::handle_read_file() method when each asynchronous - * read completes. - * This class differs slightly from ACE_Asynch_Read_Stream as it - * allows the user to specify an offset for the read. - */ -class ACE_Export ACE_Asynch_Read_File : public ACE_Asynch_Read_Stream -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Read_File (void); - - /// Destructor. - virtual ~ACE_Asynch_Read_File (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous operation. - * - * @param handler ACE_Handler to be notified when operations initiated - * via this factory complete. The - * ACE_Handler::handle_read_file() method will be - * called on this object. - * @param handle The file handle to initiate read operations on. - * If handle is @c ACE_INVALID_HANDLE, - * ACE_Handler::handle() will be called on handler to - * get the handle value. - * @param completion_key A token that is passed to the completion handler. - * @param proactor The ACE_Proactor object which will control operation - * completion and dispatching the results to handler. - * If this is 0, the process's singleton ACE_Proactor - * will be used. - * - * @retval 0 for success. - * @retval -1 for failure; consult @c errno for further information. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * This starts off an asynchronous read. Upto {bytes_to_read} will - * be read and stored in the {message_block}. The read will start - * at {offset} from the beginning of the file. Priority of the - * operation is specified by {priority}. On POSIX4-Unix, this is - * supported. Works like {nice} in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, this argument is a no-op. - * {signal_number} is the POSIX4 real-time signal number to be used - * for the operation. {signal_number} ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - unsigned long offset = 0, - unsigned long offset_high = 0, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - * @note In win32 Each data block payload must be at least the size of a system - * memory page and must be aligned on a system memory page size boundary - */ - int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - unsigned long offset = 0, - unsigned long offset_high = 0, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Delegation/implementation class that all methods will be - /// forwarded to. - ACE_Asynch_Read_File_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * {handler} when the asynchronous read completes. This class - * forwards all the methods to the implementation class. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous read. - * This class differs slightly from - * ACE_Asynch_Read_Stream::Result as it calls back - * {ACE_Handler::handle_read_file} on the {handler} instead of - * {ACE_Handler::handle_read_stream}. No additional state is - * required by this class as ACE_Asynch_Result can store the - * {offset}. - */ - class ACE_Export Result : public ACE_Asynch_Read_Stream::Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Read_File_Result; - friend class ACE_WIN32_Asynch_Read_File_Result; - - public: - /// Get the implementation class. - ACE_Asynch_Read_File_Result_Impl *implementation (void) const; - - protected: - /// Constructor. This implementation will not be deleted. - Result (ACE_Asynch_Read_File_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// The implementation class. - ACE_Asynch_Read_File_Result_Impl *implementation_; - - private: - /// Here just to provide an dummpy implementation, since the - /// one auto generated by MSVC is flagged as infinitely recursive - void operator= (Result &) {} - }; -}; - -// Forward declarations -class ACE_Asynch_Write_File_Impl; -class ACE_Asynch_Write_File_Result_Impl; - -/** - * @class ACE_Asynch_Write_File - * - * @brief This class is a factory for starting off asynchronous writes - * on a file. This class forwards all methods to its - * implementation class. - * - * Once {open} is called, multiple asynchronous {write}s can be - * started using this class. A ACE_Asynch_Write_File::Result - * will be passed back to the {handler} when the asynchronous - * writes completes through the {ACE_Handler::handle_write_file} - * callback. - * This class differs slightly from ACE_Asynch_Write_Stream as - * it allows the user to specify an offset for the write. - */ -class ACE_Export ACE_Asynch_Write_File : public ACE_Asynch_Write_Stream -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Write_File (void); - - /// Destructor. - virtual ~ACE_Asynch_Write_File (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * This starts off an asynchronous write. Upto {bytes_to_write} - * will be written from the {message_block}, starting at the - * block's {rd_ptr}. The write will go to the file, starting - * {offset} bytes from the beginning of the file. Priority of the - * operation is specified by {priority}. On POSIX4-Unix, this is - * supported. Works like {nice} in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, this is a no-op. - * {signal_number} is the POSIX4 real-time signal number to be used - * for the operation. {signal_number} ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - unsigned long offset = 0, - unsigned long offset_high = 0, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - * @note In win32 Each data block payload must be at least the size of a system - * memory page and must be aligned on a system memory page size boundary - */ - int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - unsigned long offset = 0, - unsigned long offset_high = 0, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Implementation object. - ACE_Asynch_Write_File_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * {handler} when the asynchronous write completes. This class - * forwards all the methods to the implementation class. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous write. - * This class differs slightly from - * ACE_Asynch_Write_Stream::Result as it calls back - * {ACE_Handler::handle_write_file} on the {handler} instead - * of {ACE_Handler::handle_write_stream}. No additional state - * is required by this class as ACE_Asynch_Result can store - * the {offset}. - */ - class ACE_Export Result : public ACE_Asynch_Write_Stream::Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Write_File_Result; - friend class ACE_WIN32_Asynch_Write_File_Result; - - public: - /// Get the implementation class. - ACE_Asynch_Write_File_Result_Impl *implementation (void) const; - - protected: - /// Constructor. This implementation will not be deleted. - Result (ACE_Asynch_Write_File_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// The implementation class. - ACE_Asynch_Write_File_Result_Impl *implementation_; - - private: - /// Here just to provide an dummpy implementation, since the - /// one auto generated by MSVC is flagged as infinitely recursive - void operator= (Result &) {}; - }; -}; - -// Forward declarations -class ACE_Asynch_Accept_Result_Impl; -class ACE_Asynch_Accept_Impl; - -/** - * @class ACE_Asynch_Accept - * - * @brief This class is a factory for starting off asynchronous accepts - * on a listen handle. This class forwards all methods to its - * implementation class. - * - * Once {open} is called, multiple asynchronous {accept}s can - * started using this class. A ACE_Asynch_Accept::Result will - * be passed back to the {handler} when the asynchronous accept - * completes through the {ACE_Handler::handle_accept} - * callback. - */ -class ACE_Export ACE_Asynch_Accept : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Accept (void); - - /// Destructor. - virtual ~ACE_Asynch_Accept (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * This starts off an asynchronous accept. The asynchronous accept - * call also allows any initial data to be returned to the - * handler specified to @c open(). - * @param message_block A message block to receive initial data, as well - * as the local and remote addresses when the - * connection is made. Since the block receives - * the addresses regardless of whether or not - * initial data is available or requested, the - * message block size must be at least - * @a bytes_to_read plus two times the size of - * the addresses used (IPv4 or IPv6). - * @param bytes_to_read The maximum number of bytes of initial data - * to read into @a message_block. - * @param accept_handle The handle that the new connection will be - * accepted on. If @c INVALID_HANDLE, a new - * handle will be created using @a addr_family. - * @param act Value to be passed in result when operation - * completes. - * @param priority Priority of the operation. On POSIX4-Unix, this - * is supported. Works like @c nice in Unix. - * Negative values are not allowed. 0 means - * priority of the operation same as the process - * priority. 1 means priority of the operation is - * one less than process. And so forth. - * On Win32, this argument is ignored. - * @param signal_number The POSIX4 real-time signal number to be used - * for the operation. Value range is from - * @c ACE_SIGRTMIN to @c ACE_SIGRTMAX. - * This argument is ignored on non-POSIX4 systems. - * @param addr_family The address family to use if @a accept_handle - * is @c ACE_INVALID_HANDLE and a new handle must - * be opened. Values are @c AF_INET and @c PF_INET6. - */ - int accept (ACE_Message_Block &message_block, - size_t bytes_to_read, - ACE_HANDLE accept_handle = ACE_INVALID_HANDLE, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN, - int addr_family = AF_INET); - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Delegation/implementation class that all methods will be - /// forwarded to. - ACE_Asynch_Accept_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * {handler} when the asynchronous accept completes. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous accept. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Accept_Result; - friend class ACE_WIN32_Asynch_Accept_Result; - - public: - /// The number of bytes which were requested at the start of the - /// asynchronous accept. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for accepting new connections. - ACE_HANDLE listen_handle (void) const; - - /// I/O handle for the new connection. - ACE_HANDLE accept_handle (void) const; - - /// Get the implementation. - ACE_Asynch_Accept_Result_Impl *implementation (void) const; - - protected: - /// Contructor. Implementation will not be deleted. - Result (ACE_Asynch_Accept_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// Impelmentation class. - ACE_Asynch_Accept_Result_Impl *implementation_; - }; -}; -// Forward declarations -class ACE_Asynch_Connect_Result_Impl; -class ACE_Asynch_Connect_Impl; - -/** - * @class ACE_Asynch_Connect - * - * @brief This class is a factory for starting off asynchronous connects - * This class forwards all methods to its implementation class. - * - * Once @c open is called, multiple asynchronous connect operationss can - * started using this class. A ACE_Asynch_Connect::Result will - * be passed back to the associated ACE_Handler when the asynchronous connect - * completes through the ACE_Handler::handle_connect() callback. - */ -class ACE_Export ACE_Asynch_Connect : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Connect (void); - - /// Destructor. - virtual ~ACE_Asynch_Connect (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. - * - * @note @arg handle is ignored and should be @c ACE_INVALID_HANDLE. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * This starts off an asynchronous Connect. - */ - int connect (ACE_HANDLE connect_handle, - const ACE_Addr & remote_sap, - const ACE_Addr & local_sap, - int reuse_addr, - const void *act=0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Delegation/implementation class that all methods will be - /// forwarded to. - ACE_Asynch_Connect_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * handler when the asynchronous connect completes. - * - * This class has all the information necessary for the - * handler to uniquely identify the completion of the - * asynchronous connect. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Connect_Result; - friend class ACE_WIN32_Asynch_Connect_Result; - - public: - - /// I/O handle for the connection. - ACE_HANDLE connect_handle (void) const; - - /// Get the implementation. - ACE_Asynch_Connect_Result_Impl *implementation (void) const; - - protected: - /// Contructor. Implementation will not be deleted. - Result (ACE_Asynch_Connect_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// Impelmentation class. - ACE_Asynch_Connect_Result_Impl *implementation_; - }; -}; - -// Forward declarations -class ACE_Asynch_Transmit_File_Result_Impl; -class ACE_Asynch_Transmit_File_Impl; - -/** - * @class ACE_Asynch_Transmit_File - * - * @brief This class is a factory for starting off asynchronous - * transmit files on a stream. - * - * Once {open} is called, multiple asynchronous {transmit_file}s - * can started using this class. A - * ACE_Asynch_Transmit_File::Result will be passed back to the - * {handler} when the asynchronous transmit file completes - * through the {ACE_Handler::handle_transmit_file} callback. - * The transmit_file function transmits file data over a - * connected network connection. The function uses the operating - * system's cache manager to retrieve the file data. This - * function provides high-performance file data transfer over - * network connections. This function would be of great use in - * a Web Server, Image Server, etc. - */ -class ACE_Export ACE_Asynch_Transmit_File : public ACE_Asynch_Operation -{ - -public: - // Forward declarations - class Header_And_Trailer; - - /// A do nothing constructor. - ACE_Asynch_Transmit_File (void); - - /// Destructor. - virtual ~ACE_Asynch_Transmit_File (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** - * This starts off an asynchronous transmit file. The {file} is a - * handle to an open file. {header_and_trailer} is a pointer to a - * data structure that contains pointers to data to send before and - * after the file data is sent. Set this parameter to 0 if you only - * want to transmit the file data. Upto {bytes_to_write} will be - * written to the {socket}. If you want to send the entire file, - * let {bytes_to_write} = 0. {bytes_per_send} is the size of each - * block of data sent per send operation. Please read the Win32 - * documentation on what the flags should be. Priority of the - * operation is specified by {priority}. On POSIX4-Unix, this is - * supported. Works like {nice} in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, this is a no-op. - * {signal_number} is the POSIX4 real-time signal number to be used - * for the operation. {signal_number} ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - int transmit_file (ACE_HANDLE file, - Header_And_Trailer *header_and_trailer = 0, - size_t bytes_to_write = 0, - unsigned long offset = 0, - unsigned long offset_high = 0, - size_t bytes_per_send = 0, - unsigned long flags = 0, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// The implementation class. - ACE_Asynch_Transmit_File_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * {handler} when the asynchronous transmit file completes. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous transmit file. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Transmit_File_Result; - friend class ACE_WIN32_Asynch_Transmit_File_Result; - - public: - /// Socket used for transmitting the file. - ACE_HANDLE socket (void) const; - - /// File from which the data is read. - ACE_HANDLE file (void) const; - - /// Header and trailer data associated with this transmit file. - Header_And_Trailer *header_and_trailer (void) const; - - /// The number of bytes which were requested at the start of the - /// asynchronous transmit file. - size_t bytes_to_write (void) const; - - /// Number of bytes per send requested at the start of the transmit - /// file. - size_t bytes_per_send (void) const; - - /// Flags which were passed into transmit file. - unsigned long flags (void) const; - - /// Get the implementation class. - ACE_Asynch_Transmit_File_Result_Impl *implementation (void) const; - - protected: - /// Constructor. - Result (ACE_Asynch_Transmit_File_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// The implementation class. - ACE_Asynch_Transmit_File_Result_Impl *implementation_; - }; - -/** - * @class Header_And_Trailer - * - * @brief The class defines a data structure that contains pointers - * to data to send before and after the file data is sent. - * - * This class provides a wrapper over TRANSMIT_FILE_BUFFERS - * and provided a consistent use of ACE_Message_Blocks. - */ - class ACE_Export Header_And_Trailer - { - - public: - /// Constructor. - Header_And_Trailer (ACE_Message_Block *header = 0, - size_t header_bytes = 0, - ACE_Message_Block *trailer = 0, - size_t trailer_bytes = 0); - - /// Destructor - virtual ~Header_And_Trailer (void); - - /// This method allows all the member to be set in one fell swoop. - void header_and_trailer (ACE_Message_Block *header = 0, - size_t header_bytes = 0, - ACE_Message_Block *trailer = 0, - size_t trailer_bytes = 0); - - /// Get header which goes before the file data. - ACE_Message_Block *header (void) const; - - /// Set header which goes before the file data. - void header (ACE_Message_Block *message_block); - - /// Get size of the header data. - size_t header_bytes (void) const; - - /// Set size of the header data. - void header_bytes (size_t bytes); - - /// Get trailer which goes after the file data. - ACE_Message_Block *trailer (void) const; - - /// Set trailer which goes after the file data. - void trailer (ACE_Message_Block *message_block); - - /// Get size of the trailer data. - size_t trailer_bytes (void) const; - - /// Set size of the trailer data. - void trailer_bytes (size_t bytes); - - /// Conversion routine. - ACE_LPTRANSMIT_FILE_BUFFERS transmit_buffers (void); - - protected: - /// Header data. - ACE_Message_Block *header_; - - /// Size of header data. - size_t header_bytes_; - - /// Trailer data. - ACE_Message_Block *trailer_; - - /// Size of trailer data. - size_t trailer_bytes_; - - /// Target data structure. - ACE_TRANSMIT_FILE_BUFFERS transmit_buffers_; - }; -}; - -// Forward declarations -class ACE_Asynch_Read_Dgram_Result_Impl; -class ACE_Asynch_Read_Dgram_Impl; -class ACE_Addr; - -/** - * @class ACE_Asynch_Read_Dgram - * - * @brief This class is a factory for starting off asynchronous reads - * on a UDP socket. This class forwards all methods to its - * implementation class. - * - * Once {open} is called, multiple asynchronous {read}s can be - * started using this class. An ACE_Asynch_Read_Dgram::Result - * will be passed back to the {handler} when the asynchronous - * reads completes through the {ACE_Handler::handle_read_dgram} - * callback. - */ -class ACE_Export ACE_Asynch_Read_Dgram : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Read_Dgram (void); - - /// Destructor - virtual ~ACE_Asynch_Read_Dgram (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** This starts off an asynchronous read. Upto - * {message_block->total_size()} will be read and stored in the - * {message_block}. {message_block}'s {wr_ptr} will be updated to reflect - * the added bytes if the read operation is successfully completed. - * Return code of 1 means immediate success and {number_of_bytes_recvd} - * will contain number of bytes read. The {ACE_Handler::handle_read_dgram} - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the {message_block->cont()} - * method. Up to ACE_IOV_MAX {message_block}'s are supported. Upto - * {message_block->size()} bytes will be read into each {message block} for - * a total of {message_block->total_size()} bytes. All {message_block}'s - * {wr_ptr}'s will be updated to reflect the added bytes for each - * {message_block} - * - * Priority of the operation is specified by {priority}. On POSIX4-Unix, - * this is supported. Works like {nice} in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, {priority} is a no-op. - * {signal_number} is the POSIX4 real-time signal number to be used - * for the operation. {signal_number} ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - ssize_t recv (ACE_Message_Block *message_block, - size_t &number_of_bytes_recvd, - int flags, - int protocol_family = PF_INET, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Implementation class that all methods will be forwarded to. - ACE_Asynch_Read_Dgram_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is the class which will be passed back to the - * {handler} when the asynchronous read completes. This class - * forwards all the methods to the implementation classes. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous read. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Read_Dgram_Result; - friend class ACE_WIN32_Asynch_Read_Dgram_Result; - - public: - - /// The number of bytes which were requested at the start of the - /// asynchronous read. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data - ACE_Message_Block *message_block (void) const; - - /// The flags used in the read - int flags (void) const; - - /// The address of where the packet came from - int remote_address (ACE_Addr& addr) const; - - /// I/O handle used for reading. - ACE_HANDLE handle (void) const; - - /// Get the implementation class. - ACE_Asynch_Read_Dgram_Result_Impl *implementation (void) const; - - protected: - /// Constructor. - Result (ACE_Asynch_Read_Dgram_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// The implementation class. - ACE_Asynch_Read_Dgram_Result_Impl *implementation_; - }; -}; - -// Forward declarations -class ACE_Asynch_Write_Dgram_Impl; -class ACE_Asynch_Write_Dgram_Result_Impl; - -/** - * @class ACE_Asynch_Write_Dgram - * - * @brief This class is a factory for starting off asynchronous writes - * on a UDP socket. This class forwards all methods to its - * implementation class. - * - * Once {open} is called, multiple asynchronous {writes}s can - * started using this class. An ACE_Asynch_Write_Dgram::Result - * will be passed back to the {handler} when the asynchronous - * write completes through the - * {ACE_Handler::handle_write_dgram} callback. - */ -class ACE_Export ACE_Asynch_Write_Dgram : public ACE_Asynch_Operation -{ - -public: - /// A do nothing constructor. - ACE_Asynch_Write_Dgram (void); - - /// Destructor. - virtual ~ACE_Asynch_Write_Dgram (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ({handle} == ACE_INVALID_HANDLE), - * {ACE_Handler::handle} will be called on the {handler} to get the - * correct handle. - */ - int open (ACE_Handler &handler, - ACE_HANDLE handle = ACE_INVALID_HANDLE, - const void *completion_key = 0, - ACE_Proactor *proactor = 0); - - /** This starts off an asynchronous send. Upto - * {message_block->total_length()} will be sent. {message_block}'s - * {rd_ptr} will be updated to reflect the sent bytes if the send operation - * is successfully completed. - * Return code of 1 means immediate success and {number_of_bytes_sent} - * is updated to number of bytes sent. The {ACE_Handler::handle_write_dgram} - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the {message_block->cont()} - * method. Up to ACE_IOV_MAX {message_block}'s are supported. Upto - * {message_block->length()} bytes will be sent from each {message block} - * for a total of {message_block->total_length()} bytes. All - * {message_block}'s {rd_ptr}'s will be updated to reflect the bytes sent - * from each {message_block}. - * - * Priority of the operation is specified by {priority}. On POSIX4-Unix, - * this is supported. Works like {nice} in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, this argument is a no-op. - * {signal_number} is the POSIX4 real-time signal number to be used - * for the operation. {signal_number} ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - ssize_t send (ACE_Message_Block *message_block, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr& remote_addr, - const void *act = 0, - int priority = 0, - int signal_number = ACE_SIGRTMIN); - - /// Return the underlying implementation class. - // (this should be protected...) - virtual ACE_Asynch_Operation_Impl *implementation (void) const; - -protected: - /// Implementation class that all methods will be forwarded to. - ACE_Asynch_Write_Dgram_Impl *implementation_; - -public: -/** - * @class Result - * - * @brief This is that class which will be passed back to the - * {handler} when the asynchronous write completes. This class - * forwards all the methods to the implementation class. - * - * This class has all the information necessary for the - * {handler} to uniquiely identify the completion of the - * asynchronous write. - */ - class ACE_Export Result : public ACE_Asynch_Result - { - - /// The concrete implementation result classes only construct this - /// class. - friend class ACE_POSIX_Asynch_Write_Dgram_Result; - friend class ACE_WIN32_Asynch_Write_Dgram_Result; - - public: - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write (void) const; - - /// Message block which contains the sent data - ACE_Message_Block *message_block (void) const; - - /// The flags using in the write - int flags (void) const; - - /// I/O handle used for writing. - ACE_HANDLE handle (void) const; - - /// Get the implementation class. - ACE_Asynch_Write_Dgram_Result_Impl *implementation (void) const; - - protected: - /// Constructor. - Result (ACE_Asynch_Write_Dgram_Result_Impl *implementation); - - /// Destructor. - virtual ~Result (void); - - /// Implementation class. - ACE_Asynch_Write_Dgram_Result_Impl *implementation_; - }; -}; - -/** - * @class ACE_Handler - * - * @brief This base class defines the interface for receiving the - * results of asynchronous operations. - * - * Subclasses of this class will fill in appropriate methods. - */ -class ACE_Export ACE_Handler -{ -public: - /// A do nothing constructor. - ACE_Handler (void); - - /// A do nothing constructor which allows proactor to be set to \. - ACE_Handler (ACE_Proactor *p); - - /// Virtual destruction. - virtual ~ACE_Handler (void); - - /// This method will be called when an asynchronous read completes on - /// a stream. - virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - - /// This method will be called when an asynchronous write completes - /// on a UDP socket. - virtual void handle_write_dgram (const ACE_Asynch_Write_Dgram::Result &result); - - /// This method will be called when an asynchronous read completes on - /// a UDP socket. - virtual void handle_read_dgram (const ACE_Asynch_Read_Dgram::Result &result); - - /// This method will be called when an asynchronous write completes - /// on a stream. - virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - - /// This method will be called when an asynchronous read completes on - /// a file. - virtual void handle_read_file (const ACE_Asynch_Read_File::Result &result); - - /// This method will be called when an asynchronous write completes - /// on a file. - virtual void handle_write_file (const ACE_Asynch_Write_File::Result &result); - - /// This method will be called when an asynchronous accept completes. - virtual void handle_accept (const ACE_Asynch_Accept::Result &result); - - /// This method will be called when an asynchronous connect completes. - virtual void handle_connect (const ACE_Asynch_Connect::Result &result); - - /// This method will be called when an asynchronous transmit file - /// completes. - virtual void handle_transmit_file (const ACE_Asynch_Transmit_File::Result &result); - - /// Called when timer expires. {tv} was the requested time value and - /// {act} is the ACT passed when scheduling the timer. - virtual void handle_time_out (const ACE_Time_Value &tv, - const void *act = 0); - - /** - * This is method works with the {run_event_loop} of the - * ACE_Proactor. A special {Wake_Up_Completion} is used to wake up - * all the threads that are blocking for completions. - */ - virtual void handle_wakeup (void); - - /// Get the proactor associated with this handler. - ACE_Proactor *proactor (void); - - /// Set the proactor. - void proactor (ACE_Proactor *p); - - /** - * Get the I/O handle used by this {handler}. This method will be - * called by the ACE_Asynch_* classes when an ACE_INVALID_HANDLE is - * passed to {open}. - */ - virtual ACE_HANDLE handle (void) const; - - /// Set the ACE_HANDLE value for this Handler. - virtual void handle (ACE_HANDLE); - - /** - * @class Proxy - * - * @brief The Proxy class acts as a proxy for dispatch of completions - * to operations issued for the associated handler. It allows the handler - * to be deleted while operations are outstanding. The proxy must be used - * to get the ACE_Handler pointer for dispatching, and if it's 0, the - * handler is no longer valid and the result should not be dispatched. - */ - class ACE_Export Proxy - { - public: - Proxy (ACE_Handler *handler) : handler_ (handler) {}; - void reset (void) { this->handler_ = 0; }; - ACE_Handler *handler (void) { return this->handler_; }; - private: - ACE_Handler *handler_; - }; - typedef ACE_Refcounted_Auto_Ptr - Proxy_Ptr; - - Proxy_Ptr &proxy (void); - -protected: - /// The proactor associated with this handler. - ACE_Proactor *proactor_; - - /// The ACE_HANDLE in use with this handler. - ACE_HANDLE handle_; - - /// Refers to proxy for this handler. - ACE_Refcounted_Auto_Ptr proxy_; - - ACE_UNIMPLEMENTED_FUNC (ACE_Handler (const ACE_Handler &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Handler operator= (const ACE_Handler &)) -}; - -// Forward declarations -class ACE_INET_Addr; - -// Forward declarations -template -class ACE_Asynch_Acceptor; - -/** - * @class ACE_Service_Handler - * - * @brief This base class defines the interface for the - * ACE_Asynch_Acceptor to call into when new connection are - * accepted. - * - * Subclasses of this class will fill in appropriate methods to - * define application specific behavior. - */ -class ACE_Export ACE_Service_Handler : public ACE_Handler -{ - - /// The Acceptor is the factory and therefore should have special - /// privileges. - friend class ACE_Asynch_Acceptor; - -public: - /// A do nothing constructor. - ACE_Service_Handler (void); - - /// Virtual destruction. - virtual ~ACE_Service_Handler (void); - - /** - * {open} is called by ACE_Asynch_Acceptor to initialize a new - * instance of ACE_Service_Handler that has been created after the - * new connection is accepted. The handle for the new connection is - * passed along with the initial data that may have shown up. - */ - virtual void open (ACE_HANDLE new_handle, - ACE_Message_Block &message_block); - - // protected: - // This should be corrected after the correct semantics of the - // friend has been figured out. - - /// Called by ACE_Asynch_Acceptor to pass the addresses of the new - /// connections. - virtual void addresses (const ACE_INET_Addr &remote_address, - const ACE_INET_Addr &local_address); - - /// Called by ACE_Asynch_Acceptor to pass the act. - virtual void act (const void *); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS*/ -#include /**/ "ace/post.h" -#endif /* ACE_ASYNCH_IO_H */ - diff --git a/dep/include/ace/Asynch_IO_Impl.h b/dep/include/ace/Asynch_IO_Impl.h deleted file mode 100644 index 087a292f813..00000000000 --- a/dep/include/ace/Asynch_IO_Impl.h +++ /dev/null @@ -1,814 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Asynch_IO_Impl.h - * - * $Id: Asynch_IO_Impl.h 80826 2008-03-04 14:51:23Z wotte $ - * - * - * This class contains asbtract base classes for all the concrete - * implementation classes for the various asynchronous operations - * that are used with the Praoctor. - * - * - * @author Irfan Pyarali (irfan@cs.wustl.edu) - * @author Tim Harrison (harrison@cs.wustl.edu) - * @author Alexander Babu Arulanthu - * @author Roger Tragin - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_ASYNCH_IO_IMPL_H -#define ACE_ASYNCH_IO_IMPL_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) -// This only works on Win32 platforms and on Unix platforms supporting -// aio calls. - -#include "ace/Asynch_IO.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration. -class ACE_Proactor_Impl; - -/** - * @class ACE_Asynch_Result_Impl - * - * @brief Abstract base class for the all the classes that provide - * concrete implementations for ACE_Asynch_Result. - * - */ -class ACE_Export ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Result_Impl (void); - - /// Number of bytes transferred by the operation. - virtual size_t bytes_transferred (void) const = 0; - - /// ACT associated with the operation. - virtual const void *act (void) const = 0; - - /// Did the operation succeed? - virtual int success (void) const = 0; - - /// This ACT is not the same as the ACT associated with the - /// asynchronous operation. - virtual const void *completion_key (void) const = 0; - - /// Error value if the operation fail. - virtual u_long error (void) const = 0; - - /// Event associated with the OVERLAPPED structure. - virtual ACE_HANDLE event (void) const = 0; - - /// This really make sense only when doing file I/O. - virtual u_long offset (void) const = 0; - virtual u_long offset_high (void) const = 0; - - /// Priority of the operation. - virtual int priority (void) const = 0; - - /** - * POSIX4 real-time signal number to be used for the - * operation. ranges from SIGRTMIN to SIGRTMAX. By - * default, SIGRTMIN is used to issue calls. This is a no-op - * on non-POSIX4 systems and returns 0. - */ - virtual int signal_number (void) const = 0; - - // protected: - // - // These two should really be protected. But sometimes it - // simplifies code to be able to "fake" a result. Use carefully. - /// This is called when the asynchronous operation completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error = 0) = 0; - - /// Post @c this to the Proactor's completion port. - virtual int post_completion (ACE_Proactor_Impl *proactor) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Operation_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Operation. - */ -class ACE_Export ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Operation_Impl (void); - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If @a handle == ACE_INVALID_HANDLE, - * ACE_Handler::handle() will be called on the proxied handler to get the - * correct handle. - */ - virtual int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) = 0; - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - virtual int cancel (void) = 0; - - // = Access methods. - - /// Return the underlying proactor. - virtual ACE_Proactor* proactor (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Operation_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_Stream_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Read_Stream - * - */ -class ACE_Export ACE_Asynch_Read_Stream_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Read_Stream_Impl (void); - - /// This starts off an asynchronous read. Upto @a bytes_to_read will - /// be read and stored in the @a message_block. - virtual int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - */ - virtual int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_Stream_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_Stream_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Read_Stream::Result class. - * - */ -class ACE_Export ACE_Asynch_Read_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Read_Stream_Result_Impl (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous read. - virtual size_t bytes_to_read (void) const = 0; - - /// Message block which contains the read data. - virtual ACE_Message_Block &message_block (void) const = 0; - - /// I/O handle used for reading. - virtual ACE_HANDLE handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_Stream_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_Stream_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Write_Stream class. - * - */ -class ACE_Export ACE_Asynch_Write_Stream_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Write_Stream_Impl (void); - - /// This starts off an asynchronous write. Upto @a bytes_to_write - /// will be written from the @a message_block. - virtual int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - */ - virtual int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_Stream_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_Stream_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Write_Stream::Result. - * - */ -class ACE_Export ACE_Asynch_Write_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Write_Stream_Result_Impl (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - virtual size_t bytes_to_write (void) const = 0; - - /// Message block that contains the data to be written. - virtual ACE_Message_Block &message_block (void) const = 0; - - /// I/O handle used for writing. - virtual ACE_HANDLE handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_Stream_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_File_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Read_File::Result. - * - */ -class ACE_Export ACE_Asynch_Read_File_Impl : public virtual ACE_Asynch_Read_Stream_Impl -{ -public: - virtual ~ACE_Asynch_Read_File_Impl (void); - - /** - * This starts off an asynchronous read. Upto @a bytes_to_read will - * be read and stored in the @a message_block. The read will start - * at @a offset from the beginning of the file. - */ - virtual int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - * @note In win32 Each data block payload must be at least the size of a system - * memory page and must be aligned on a system memory page size boundary - */ - virtual int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - - /// This starts off an asynchronous read. Upto @a bytes_to_read will - /// be read and stored in the @a message_block. - virtual int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - */ - virtual int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_File_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_File_Result_Impl - * - * @brief This is the abstract base class for all the concrete - * implementation classes for ACE_Asynch_Read_File::Result. - * - */ -class ACE_Export ACE_Asynch_Read_File_Result_Impl : public virtual ACE_Asynch_Read_Stream_Result_Impl -{ -public: - /// Destructor. - virtual ~ACE_Asynch_Read_File_Result_Impl (void); - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_File_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_File_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Write_File. - * - */ -class ACE_Export ACE_Asynch_Write_File_Impl : public virtual ACE_Asynch_Write_Stream_Impl -{ -public: - virtual ~ACE_Asynch_Write_File_Impl (void); - - /** - * This starts off an asynchronous write. Upto @a bytes_to_write - * will be write and stored in the @a message_block. The write will - * start at @a offset from the beginning of the file. - */ - virtual int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - * @note In win32 Each data block payload must be at least the size of a system - * memory page and must be aligned on a system memory page size boundary - */ - virtual int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - - /// This starts off an asynchronous write. Upto @a bytes_to_write - /// will be written from the @a message_block. - virtual int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) = 0; - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - */ - virtual int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) = 0; -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_File_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_File_Result_Impl - * - * @brief This is the abstract base class for all the concrete - * implementation classes that provide different implementations - * for the ACE_Asynch_Write_File::Result. - * - */ -class ACE_Export ACE_Asynch_Write_File_Result_Impl : public virtual ACE_Asynch_Write_Stream_Result_Impl -{ -public: - virtual ~ACE_Asynch_Write_File_Result_Impl (void); - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_File_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Accept_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Accept. - * - */ -class ACE_Export ACE_Asynch_Accept_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Accept_Impl (void); - - /** - * This starts off an asynchronous accept. The asynchronous accept - * call also allows any initial data to be returned to the - * . Upto @a bytes_to_read will be read and stored in the - * @a message_block. The @a accept_handle will be used for the - * call. If (@a accept_handle == INVALID_HANDLE), a new - * handle will be created. - * - * @a message_block must be specified. This is because the address of - * the new connection is placed at the end of this buffer. - */ - virtual int accept (ACE_Message_Block &message_block, - size_t bytes_to_read, - ACE_HANDLE accept_handle, - const void *act, - int priority, - int signal_number, - int addr_family) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Accept_Impl (void); -}; - -/** - * @class ACE_Asynch_Accept_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Accept. - * - */ -class ACE_Export ACE_Asynch_Accept_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Accept_Result_Impl (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous accept. - virtual size_t bytes_to_read (void) const = 0; - - /// Message block which contains the read data. - virtual ACE_Message_Block &message_block (void) const = 0; - - /// I/O handle used for accepting new connections. - virtual ACE_HANDLE listen_handle (void) const = 0; - - /// I/O handle for the new connection. - virtual ACE_HANDLE accept_handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Accept_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Connect_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Connect. - * - */ -class ACE_Export ACE_Asynch_Connect_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Connect_Impl (void); - - /** - * This starts off an asynchronous connect - */ - virtual int connect (ACE_HANDLE connect_handle, - const ACE_Addr & remote_sap, - const ACE_Addr & local_sap, - int reuse_addr, - const void *act, - int priority, - int signal_number) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Connect_Impl (void); -}; - -/** - * @class ACE_Asynch_Connect_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Connect. - * - */ -class ACE_Export ACE_Asynch_Connect_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Connect_Result_Impl (void); - - /// I/O handle for the connection. - virtual ACE_HANDLE connect_handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Connect_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Transmit_File_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Transmit_File. - * - */ -class ACE_Asynch_Transmit_File_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Transmit_File_Impl (void); - - /// This starts off an asynchronous transmit file. - virtual int transmit_file (ACE_HANDLE file, - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - size_t bytes_per_send, - u_long flags, - const void *act, - int priority, - int signal_number) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Transmit_File_Impl (void); -}; - -/** - * @class ACE_Asynch_Transmit_File_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Transmit_File::Result. - * - */ -class ACE_Export ACE_Asynch_Transmit_File_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Transmit_File_Result_Impl (void); - - /// Socket used for transmitting the file. - virtual ACE_HANDLE socket (void) const = 0; - - /// File from which the data is read. - virtual ACE_HANDLE file (void) const = 0; - - /// Header and trailer data associated with this transmit file. - virtual ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer (void) const = 0; - - /// The number of bytes which were requested at the start of the - /// asynchronous transmit file. - virtual size_t bytes_to_write (void) const = 0; - - /// Number of bytes per send requested at the start of the transmit - /// file. - virtual size_t bytes_per_send (void) const = 0; - - /// Flags which were passed into transmit file. - virtual u_long flags (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Transmit_File_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_Dgram_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Read_Dgram - * - */ -class ACE_Export ACE_Asynch_Read_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Read_Dgram_Impl (void); - - /** This starts off an asynchronous read. Upto - * total_size()> will be read and stored in the - * @a message_block. @a message_block's will be updated to reflect - * the added bytes if the read operation is successful completed. - * Return code of 1 means immediate success and - * will contain number of bytes read. The - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the cont()> - * method. Up to ACE_IOV_MAX @a message_block's are supported. Upto - * size()> bytes will be read into each for - * a total of total_size()> bytes. All @a message_block's - * 's will be updated to reflect the added bytes for each - * @a message_block - * - * Priority of the operation is specified by @a priority. On POSIX4-Unix, - * this is supported. Works like in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, @a priority is a no-op. - * @a signal_number is the POSIX4 real-time signal number to be used - * for the operation. @a signal_number ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - virtual ssize_t recv (ACE_Message_Block *message_block, - size_t &number_of_bytes_recvd, - int flags, - int protocol_family, - const void *act, - int priority, - int signal_number) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_Dgram_Impl (void); -}; - -/** - * @class ACE_Asynch_Read_Dgram_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Read_Dgram::Result class. - * - */ -class ACE_Export ACE_Asynch_Read_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Read_Dgram_Result_Impl (void); - - /// Message block which contains the read data - virtual ACE_Message_Block *message_block (void) const = 0; - - /// The number of bytes which were requested at the start of the - /// asynchronous read. - virtual size_t bytes_to_read (void) const = 0; - - /// The address of where the packet came from - virtual int remote_address (ACE_Addr& addr) const = 0; - - /// The flags used in the read - virtual int flags (void) const = 0; - - /// I/O handle used for reading. - virtual ACE_HANDLE handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Read_Dgram_Result_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_Dgram_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Write_Dgram class. - * - */ -class ACE_Export ACE_Asynch_Write_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl -{ -public: - virtual ~ACE_Asynch_Write_Dgram_Impl (void); - - /** This starts off an asynchronous send. Upto - * total_length()> will be sent. @a message_block's - * will be updated to reflect the sent bytes if the send operation - * is successful completed. - * Return code of 1 means immediate success and - * is updated to number of bytes sent. The - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the cont()> - * method. Up to ACE_IOV_MAX @a message_block's are supported. Upto - * length()> bytes will be sent from each - * for a total of total_length()> bytes. All - * @a message_block's 's will be updated to reflect the bytes sent - * from each @a message_block. - * - * Priority of the operation is specified by @a priority. On POSIX4-Unix, - * this is supported. Works like in Unix. Negative values are not - * allowed. 0 means priority of the operation same as the process - * priority. 1 means priority of the operation is one less than - * process. And so forth. On Win32, this argument is a no-op. - * @a signal_number is the POSIX4 real-time signal number to be used - * for the operation. @a signal_number ranges from ACE_SIGRTMIN to - * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems. - */ - virtual ssize_t send (ACE_Message_Block *message_block, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - const void *act, - int priority, - int signal_number) = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_Dgram_Impl (void); -}; - -/** - * @class ACE_Asynch_Write_Dgram_Result_Impl - * - * @brief Abstract base class for all the concrete implementation - * classes that provide different implementations for the - * ACE_Asynch_Write_Dgram::Result class. - * - */ -class ACE_Export ACE_Asynch_Write_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl -{ -public: - virtual ~ACE_Asynch_Write_Dgram_Result_Impl (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - virtual size_t bytes_to_write (void) const = 0; - - /// Message block which contains the sent data - virtual ACE_Message_Block *message_block (void) const = 0; - - /// The flags using in the write - virtual int flags (void) const = 0; - - /// I/O handle used for writing. - virtual ACE_HANDLE handle (void) const = 0; - -protected: - /// Do-nothing constructor. - ACE_Asynch_Write_Dgram_Result_Impl (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Asynch_IO_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ -#include /**/ "ace/post.h" -#endif /* ACE_ASYNCH_IO_IMPL_H */ - diff --git a/dep/include/ace/Asynch_IO_Impl.inl b/dep/include/ace/Asynch_IO_Impl.inl deleted file mode 100644 index 8e37772f5c9..00000000000 --- a/dep/include/ace/Asynch_IO_Impl.inl +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- -// -// $Id: Asynch_IO_Impl.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Asynch_Result_Impl::ACE_Asynch_Result_Impl (void) -{ -} - -ACE_INLINE -ACE_Asynch_Operation_Impl::ACE_Asynch_Operation_Impl (void) -{ -} - -ACE_INLINE -ACE_Asynch_Read_Stream_Impl::ACE_Asynch_Read_Stream_Impl (void) - : ACE_Asynch_Operation_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Read_Stream_Result_Impl::ACE_Asynch_Read_Stream_Result_Impl (void) - : ACE_Asynch_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Write_Stream_Impl::ACE_Asynch_Write_Stream_Impl (void) - : ACE_Asynch_Operation_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Write_Stream_Result_Impl::ACE_Asynch_Write_Stream_Result_Impl (void) - : ACE_Asynch_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Read_File_Impl::ACE_Asynch_Read_File_Impl (void) - : ACE_Asynch_Operation_Impl (), - ACE_Asynch_Read_Stream_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Read_File_Result_Impl::ACE_Asynch_Read_File_Result_Impl (void) - : ACE_Asynch_Result_Impl (), - ACE_Asynch_Read_Stream_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Write_File_Impl::ACE_Asynch_Write_File_Impl (void) - : ACE_Asynch_Operation_Impl (), - ACE_Asynch_Write_Stream_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Write_File_Result_Impl::ACE_Asynch_Write_File_Result_Impl (void) - : ACE_Asynch_Result_Impl (), - ACE_Asynch_Write_Stream_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Accept_Impl::ACE_Asynch_Accept_Impl (void) - : ACE_Asynch_Operation_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Accept_Result_Impl::ACE_Asynch_Accept_Result_Impl (void) - : ACE_Asynch_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Connect_Impl::ACE_Asynch_Connect_Impl (void) - : ACE_Asynch_Operation_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Connect_Result_Impl::ACE_Asynch_Connect_Result_Impl (void) - : ACE_Asynch_Result_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Transmit_File_Impl::ACE_Asynch_Transmit_File_Impl (void) - : ACE_Asynch_Operation_Impl () -{ -} - -ACE_INLINE -ACE_Asynch_Transmit_File_Result_Impl::ACE_Asynch_Transmit_File_Result_Impl (void) - : ACE_Asynch_Result_Impl () -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Asynch_Pseudo_Task.h b/dep/include/ace/Asynch_Pseudo_Task.h deleted file mode 100644 index 4c5a94feca4..00000000000 --- a/dep/include/ace/Asynch_Pseudo_Task.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Asynch_Pseudo_Task.h - * - * $Id: Asynch_Pseudo_Task.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_ASYNCH_PSEUDO_TASK_H -#define ACE_ASYNCH_PSEUDO_TASK_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Reactor.h" -#include "ace/Select_Reactor.h" -#include "ace/Task.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/* - * Specialization hook to replace the Reactor with the - * concrete Reactor implementation, e.g., select_st, - * select_mt etc. - */ -//@@ REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK - -/** - * @class ACE_Asynch_Pseudo_Task - * - */ -class ACE_Export ACE_Asynch_Pseudo_Task : public ACE_Task -{ -public: - ACE_Asynch_Pseudo_Task(); - virtual ~ACE_Asynch_Pseudo_Task(); - - int start (void); - int stop (void); - - int register_io_handler (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask, - int flg_suspend); - - int remove_io_handler (ACE_HANDLE handle); - int remove_io_handler (ACE_Handle_Set &set); - int resume_io_handler (ACE_HANDLE handle); - int suspend_io_handler (ACE_HANDLE handle); - -protected: - virtual int svc (void); - - /// Should be initialized before reactor_ - ACE_Select_Reactor select_reactor_; - - ACE_Reactor reactor_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_ASYNCH_PSEUDO_TASK_H */ - diff --git a/dep/include/ace/Atomic_Op.h b/dep/include/ace/Atomic_Op.h deleted file mode 100644 index c750999af4c..00000000000 --- a/dep/include/ace/Atomic_Op.h +++ /dev/null @@ -1,261 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Atomic_Op.h - * - * $Id: Atomic_Op.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ATOMIC_OP_H -#define ACE_ATOMIC_OP_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Thread_Mutex.h" - -// Include the templates here. -#include "ace/Atomic_Op_T.h" - -// Determine whether builtin atomic op support is -// available on this platform. -#if defined (ACE_HAS_THREADS) -# if defined (WIN32) -# if defined (ACE_HAS_INTRINSIC_INTERLOCKED) -# define ACE_HAS_BUILTIN_ATOMIC_OP -# endif /* ACE_HAS_INTRINSIC_INTERLOCKED */ -# if defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) -# define ACE_HAS_BUILTIN_ATOMIC_OP -# else /* ACE_HAS_INTERLOCKED_EXCHANGEADD */ - // Inline assembly emulation of InterlockedExchangeAdd - // is currently only implemented for MSVC (x86 only) and Borland. -# if (defined (_MSC_VER) && defined (_M_IX86)) || defined (__BORLANDC__) -# define ACE_HAS_BUILTIN_ATOMIC_OP -# endif /* _MSC_VER || __BORLANDC__ */ -# endif /* ACE_HAS_INTERLOCKED_EXCHANGEADD */ -# elif defined (ACE_HAS_INTEL_ASSEMBLY) -# define ACE_HAS_BUILTIN_ATOMIC_OP -# endif /* WIN32 */ -#endif /* ACE_HAS_THREADS */ - -#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Atomic_Op - * - * @brief Specialization of ACE_Atomic_Op for platforms that - * support atomic integer operations. - * - * Specialization of ACE_Atomic_Op for platforms that support atomic - * integer operations. - */ -template<> -class ACE_Export ACE_Atomic_Op -{ -public: - /// Initialize to 0. - ACE_Atomic_Op (void); - - /// Initialize to c. - ACE_Atomic_Op (long c); - - /// Manage copying... - ACE_Atomic_Op (const ACE_Atomic_Op &c); - - /// Atomically pre-increment . - long operator++ (void); - - /// Atomically post-increment . - long operator++ (int); - - /// Atomically increment by rhs. - long operator+= (long rhs); - - /// Atomically pre-decrement . - long operator-- (void); - - /// Atomically post-decrement . - long operator-- (int); - - /// Atomically decrement by rhs. - long operator-= (long rhs); - - /// Atomically compare with rhs. - bool operator== (long rhs) const; - - /// Atomically compare with rhs. - bool operator!= (long rhs) const; - - /// Atomically check if greater than or equal to rhs. - bool operator>= (long rhs) const; - - /// Atomically check if greater than rhs. - bool operator> (long rhs) const; - - /// Atomically check if less than or equal to rhs. - bool operator<= (long rhs) const; - - /// Atomically check if less than rhs. - bool operator< (long rhs) const; - - /// Atomically assign rhs to . - ACE_Atomic_Op &operator= (long rhs); - - /// Atomically assign to . - ACE_Atomic_Op &operator= (const ACE_Atomic_Op &rhs); - - /// Explicitly return . - long value (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Explicitly return (by reference). - volatile long &value_i (void); - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - /// Used during ACE object manager initialization to optimize the fast - /// atomic op implementation according to the number of CPUs. - static void init_functions (void); - -private: - - // This function cannot be supported by this template specialization. - // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex - // template instead. - ACE_Thread_Mutex &mutex (void); - -private: - - /// Current object decorated by the atomic op. - volatile long value_; - - // Pointers to selected atomic op implementations. - static long (*increment_fn_) (volatile long *); - static long (*decrement_fn_) (volatile long *); - static long (*exchange_fn_) (volatile long *, long); - static long (*exchange_add_fn_) (volatile long *, long); -}; - -/** - * @class ACE_Atomic_Op - * - * @brief Specialization of ACE_Atomic_Op for platforms that - * support atomic integer operations. - * - * Specialization of ACE_Atomic_Op for platforms that support atomic - * integer operations. - */ -template<> -class ACE_Export ACE_Atomic_Op -{ -public: - /// Initialize to 0. - ACE_Atomic_Op (void); - - /// Initialize to c. - ACE_Atomic_Op (unsigned long c); - - /// Manage copying... - ACE_Atomic_Op (const ACE_Atomic_Op &c); - - /// Atomically pre-increment . - unsigned long operator++ (void); - - /// Atomically post-increment . - unsigned long operator++ (int); - - /// Atomically increment by rhs. - unsigned long operator+= (unsigned long rhs); - - /// Atomically pre-decrement . - unsigned long operator-- (void); - - /// Atomically post-decrement . - unsigned long operator-- (int); - - /// Atomically decrement by rhs. - unsigned long operator-= (unsigned long rhs); - - /// Atomically compare with rhs. - bool operator== (unsigned long rhs) const; - - /// Atomically compare with rhs. - bool operator!= (unsigned long rhs) const; - - /// Atomically check if greater than or equal to rhs. - bool operator>= (unsigned long rhs) const; - - /// Atomically check if greater than rhs. - bool operator> (unsigned long rhs) const; - - /// Atomically check if less than or equal to rhs. - bool operator<= (unsigned long rhs) const; - - /// Atomically check if less than rhs. - bool operator< (unsigned long rhs) const; - - /// Atomically assign rhs to . - ACE_Atomic_Op &operator= (unsigned long rhs); - - /// Atomically assign to . - ACE_Atomic_Op &operator= (const ACE_Atomic_Op &rhs); - - /// Explicitly return . - unsigned long value (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Explicitly return (by reference). - volatile unsigned long &value_i (void); - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - /// Used during ACE object manager initialization to optimize the fast - /// atomic op implementation according to the number of CPUs. - static void init_functions (void); - -private: - - // This function cannot be supported by this template specialization. - // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex - // template instead. - ACE_Thread_Mutex &mutex (void); - -private: - - /// Current object decorated by the atomic op. - volatile unsigned long value_; - - // Pointers to selected atomic op implementations. - static long (*increment_fn_) (volatile long *); - static long (*decrement_fn_) (volatile long *); - static long (*exchange_fn_) (volatile long *, long); - static long (*exchange_add_fn_) (volatile long *, long); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ - -#if defined (__ACE_INLINE__) -#include "ace/Atomic_Op.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /*ACE_ATOMIC_OP_H*/ - diff --git a/dep/include/ace/Atomic_Op.inl b/dep/include/ace/Atomic_Op.inl deleted file mode 100644 index 8735fa8d85a..00000000000 --- a/dep/include/ace/Atomic_Op.inl +++ /dev/null @@ -1,334 +0,0 @@ -// -*- C++ -*- -// -// $Id: Atomic_Op.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) - -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) -# include "ace/os_include/os_intrin.h" - -#pragma intrinsic (_InterlockedExchange, _InterlockedExchangeAdd, _InterlockedIncrement, _InterlockedDecrement) -#endif /* ACE_HAS_INTRINSIC_INTERLOCKED */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op (void) - : value_ (0) -{ -} - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op (long c) - : value_ (c) -{ -} - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op ( - const ACE_Atomic_Op &rhs) - : value_ (rhs.value_) -{ -} - -ACE_INLINE long -ACE_Atomic_Op::operator++ (void) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return ::_InterlockedIncrement (const_cast (&this->value_)); -#elif defined (WIN32) - return ::InterlockedIncrement (const_cast (&this->value_)); -#else /* WIN32 */ - return (*increment_fn_) (&this->value_); -#endif /* WIN32 */ -} - -ACE_INLINE long -ACE_Atomic_Op::operator++ (int) -{ - return ++*this - 1; -} - -ACE_INLINE long -ACE_Atomic_Op::operator-- (void) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return ::_InterlockedDecrement (const_cast (&this->value_)); -#elif defined (WIN32) - return ::InterlockedDecrement (const_cast (&this->value_)); -#else /* WIN32 */ - return (*decrement_fn_) (&this->value_); -#endif /* WIN32 */ -} - -ACE_INLINE long -ACE_Atomic_Op::operator-- (int) -{ - return --*this + 1; -} - -ACE_INLINE long -ACE_Atomic_Op::operator+= (long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return ::_InterlockedExchangeAdd (const_cast (&this->value_), - rhs) + rhs; -#elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (const_cast (&this->value_), - rhs) + rhs; -#else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ - return (*exchange_add_fn_) (&this->value_, rhs) + rhs; -#endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ -} - -ACE_INLINE long -ACE_Atomic_Op::operator-= (long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return ::_InterlockedExchangeAdd (const_cast (&this->value_), - -rhs) - rhs; -#elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (const_cast (&this->value_), - -rhs) - rhs; -#else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ - return (*exchange_add_fn_) (&this->value_, -rhs) - rhs; -#endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ -} - -ACE_INLINE bool -ACE_Atomic_Op::operator== (long rhs) const -{ - return (this->value_ == rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator!= (long rhs) const -{ - return (this->value_ != rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator>= (long rhs) const -{ - return (this->value_ >= rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator> (long rhs) const -{ - return (this->value_ > rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator<= (long rhs) const -{ - return (this->value_ <= rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator< (long rhs) const -{ - return (this->value_ < rhs); -} - -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= (long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - ::_InterlockedExchange (const_cast (&this->value_), rhs); -#elif defined (WIN32) - ::InterlockedExchange (const_cast (&this->value_), rhs); -#else /* WIN32 */ - (*exchange_fn_) (&this->value_, rhs); -#endif /* WIN32 */ - return *this; -} - -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= ( - const ACE_Atomic_Op &rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - ::_InterlockedExchange (const_cast (&this->value_), rhs.value_); -#elif defined (WIN32) - ::InterlockedExchange (const_cast (&this->value_), rhs.value_); -#else /* WIN32 */ - (*exchange_fn_) (&this->value_, rhs.value_); -#endif /* WIN32 */ - return *this; -} - -ACE_INLINE long -ACE_Atomic_Op::value (void) const -{ - return this->value_; -} - -ACE_INLINE volatile long & -ACE_Atomic_Op::value_i (void) -{ - return this->value_; -} - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op (void) - : value_ (0) -{ -} - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op (unsigned long c) - : value_ (c) -{ -} - -ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op ( - const ACE_Atomic_Op &rhs) - : value_ (rhs.value_) -{ -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator++ (void) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return static_cast (::_InterlockedIncrement (const_cast (reinterpret_cast(&this->value_)))); -#elif defined (WIN32) - return static_cast (::InterlockedIncrement (const_cast (reinterpret_cast(&this->value_)))); -#else /* WIN32 */ - return static_cast ((*increment_fn_) (reinterpret_cast (&this->value_))); -#endif /* WIN32 */ -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator++ (int) -{ - return ++*this - 1; -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator-- (void) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return static_cast (::_InterlockedDecrement (const_cast (reinterpret_cast(&this->value_)))); -#elif defined (WIN32) - return static_cast (::InterlockedDecrement (const_cast (reinterpret_cast(&this->value_)))); -#else /* WIN32 */ - return static_cast ((*decrement_fn_) (reinterpret_cast (&this->value_))); -#endif /* WIN32 */ -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator-- (int) -{ - return --*this + 1; -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator+= (unsigned long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return static_cast (::_InterlockedExchangeAdd (const_cast (reinterpret_cast (&this->value_)), - rhs)) + rhs; -#elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return static_cast (::InterlockedExchangeAdd (const_cast (reinterpret_cast (&this->value_)), - rhs)) + rhs; -#else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ - return static_cast ((*exchange_add_fn_) (reinterpret_cast (&this->value_), rhs)) + rhs; -#endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::operator-= (unsigned long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - return static_cast (::_InterlockedExchangeAdd (const_cast (reinterpret_cast(&this->value_)), - -static_cast(rhs))) - rhs; -#elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return static_cast (::InterlockedExchangeAdd (const_cast (reinterpret_cast(&this->value_)), - -static_cast(rhs))) - rhs; -#else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ - long l_rhs = static_cast (rhs); - return static_cast ((*exchange_add_fn_) (reinterpret_cast (&this->value_), -l_rhs)) - rhs; -#endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ -} - -ACE_INLINE bool -ACE_Atomic_Op::operator== (unsigned long rhs) const -{ - return (this->value_ == rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator!= (unsigned long rhs) const -{ - return (this->value_ != rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator>= (unsigned long rhs) const -{ - return (this->value_ >= rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator> (unsigned long rhs) const -{ - return (this->value_ > rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator<= (unsigned long rhs) const -{ - return (this->value_ <= rhs); -} - -ACE_INLINE bool -ACE_Atomic_Op::operator< (unsigned long rhs) const -{ - return (this->value_ < rhs); -} - -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= (unsigned long rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - ::_InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs); -#elif defined (WIN32) - ::InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs); -#else /* WIN32 */ - (*exchange_fn_) (reinterpret_cast (&this->value_), rhs); -#endif /* WIN32 */ - return *this; -} - -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= ( - const ACE_Atomic_Op &rhs) -{ -#if defined (ACE_HAS_INTRINSIC_INTERLOCKED) - ::_InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs.value_); -#elif defined (WIN32) - ::InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs.value_); -#else /* WIN32 */ - (*exchange_fn_) (reinterpret_cast (&this->value_), rhs.value_); -#endif /* WIN32 */ - return *this; -} - -ACE_INLINE unsigned long -ACE_Atomic_Op::value (void) const -{ - return this->value_; -} - -ACE_INLINE volatile unsigned long & -ACE_Atomic_Op::value_i (void) -{ - return this->value_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ diff --git a/dep/include/ace/Atomic_Op_Sparc.h b/dep/include/ace/Atomic_Op_Sparc.h deleted file mode 100644 index d521520c9ec..00000000000 --- a/dep/include/ace/Atomic_Op_Sparc.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id: Atomic_Op_Sparc.h 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ATOMIC_OP_SPARC_H -#define ACE_ATOMIC_OP_SPARC_H - -extern "C" -{ - unsigned long ace_atomic_add_long (volatile unsigned long *dest, long rhs); - unsigned long ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs); - unsigned long ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs); -} - -#endif /* ACE_ATOMIC_OP_SPARC_H */ - diff --git a/dep/include/ace/Atomic_Op_T.h b/dep/include/ace/Atomic_Op_T.h deleted file mode 100644 index afd163c58e9..00000000000 --- a/dep/include/ace/Atomic_Op_T.h +++ /dev/null @@ -1,370 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Atomic_Op_T.h - * - * $Id: Atomic_Op_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_ATOMIC_OP_T_H -#define ACE_ATOMIC_OP_T_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -struct ACE_Type_Traits -{ - typedef TYPE const & parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef bool parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef char parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef signed char parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef unsigned char parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef short parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef unsigned short parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef int parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef unsigned int parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef long parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef unsigned long parameter_type; -}; - -#ifndef ACE_LACKS_LONGLONG_T -template<> -struct ACE_Type_Traits -{ - typedef long long parameter_type; -}; -#endif /* !ACE_LACKS_LONGLONG_T */ - -#if !defined (ACE_LACKS_LONGLONG_T) \ - && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -template<> -struct ACE_Type_Traits -{ - typedef unsigned long long parameter_type; -}; -#endif /* !ACE_LACKS_LONGLONG_T && !ACE_LACKS_UNSIGNEDLONGLONG_T */ - -template<> -struct ACE_Type_Traits -{ - typedef float parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef double parameter_type; -}; - -template<> -struct ACE_Type_Traits -{ - typedef long double parameter_type; -}; - -template -struct ACE_Type_Traits -{ - typedef TYPE* parameter_type; -}; - -/** - * @class ACE_Atomic_Op_Ex - * - * @brief Transparently parameterizes synchronization into basic - * arithmetic operations. - * - * This class is described in an article in the July/August 1994 - * issue of the C++ Report magazine. It implements a - * templatized version of the Decorator pattern from the GoF book. - * - * ACE_Atomic_Op_Ex objects must be constructed with a reference - * to an existing lock. A single lock can be shared between - * multiple ACE_Atomic_Op_Ex objects. If you do not require this - * ability consider using the ACE_Atomic_Op class instead, which - * may be able to take advantage of platform-specific - * optimisations to provide atomic operations without requiring a - * lock. - */ -template -class ACE_Atomic_Op_Ex -{ -public: - - typedef typename ACE_Type_Traits::parameter_type arg_type; - - // = Initialization methods. - - /// Initialize @c value_ to 0. - ACE_Atomic_Op_Ex (ACE_LOCK & mtx); - - /// Initialize @c value_ to c. - ACE_Atomic_Op_Ex (ACE_LOCK & mtx, arg_type c); - - // = Accessors. - - /// Atomically pre-increment @c value_. - TYPE operator++ (void); - - /// Atomically post-increment @c value_. - TYPE operator++ (int); - - /// Atomically increment @c value_ by rhs. - TYPE operator+= (arg_type rhs); - - /// Atomically pre-decrement @c value_. - TYPE operator-- (void); - - /// Atomically post-decrement @c value_. - TYPE operator-- (int); - - /// Atomically decrement @c value_ by rhs. - TYPE operator-= (arg_type rhs); - - /// Atomically compare @c value_ with rhs. - bool operator== (arg_type rhs) const; - - /// Atomically compare @c value_ with rhs. - bool operator!= (arg_type rhs) const; - - /// Atomically check if @c value_ greater than or equal to rhs. - bool operator>= (arg_type rhs) const; - - /// Atomically check if @c value_ greater than rhs. - bool operator> (arg_type rhs) const; - - /// Atomically check if @c value_ less than or equal to rhs. - bool operator<= (arg_type rhs) const; - - /// Atomically check if @c value_ less than rhs. - bool operator< (arg_type rhs) const; - - /// Atomically assign rhs to @c value_. - ACE_Atomic_Op_Ex &operator= (arg_type rhs); - - /// Atomically assign to @c value_. - ACE_Atomic_Op_Ex &operator= ( - ACE_Atomic_Op_Ex const & rhs); - - /// Explicitly return @c value_. - TYPE value (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - /// Manage copying... - ACE_Atomic_Op_Ex (ACE_Atomic_Op_Ex const &); - - /** - * Returns a reference to the underlying . This makes it - * possible to acquire the lock explicitly, which can be useful in - * some cases if you instantiate the with an - * ACE_Recursive_Mutex or ACE_Process_Mutex. @note the right - * name would be lock_, but HP/C++ will choke on that! - */ - ACE_LOCK & mutex (void); - - /** - * Explicitly return @c value_ (by reference). This gives the user - * full, unrestricted access to the underlying value. This method - * will usually be used in conjunction with explicit access to the - * lock. Use with care ;-) - */ - TYPE & value_i (void); - -private: - /// Type of synchronization mechanism. - ACE_LOCK & mutex_; - - /// Current object decorated by the atomic op. - TYPE value_; -}; - -/** - * @class ACE_Atomic_Op - * - * @brief Transparently parameterizes synchronization into basic - * arithmetic operations. - * - * This class is described in an article in the July/August 1994 - * issue of the C++ Report magazine. It implements a - * templatized version of the Decorator pattern from the GoF book. - * - * Certain platforms may provide a template specialization for - * ACE_Atomic_Op that provides optimized - * atomic integer operations without actually requiring a mutex. - */ -template -class ACE_Atomic_Op -{ -public: - - typedef typename ACE_Type_Traits::parameter_type arg_type; - - /// Initialize @c value_ to 0. - ACE_Atomic_Op (void); - - /// Initialize @c value_ to c. - ACE_Atomic_Op (arg_type c); - - /// Manage copying... - ACE_Atomic_Op (ACE_Atomic_Op const & c); - - /// Atomically assign rhs to @c value_. - ACE_Atomic_Op & operator= (arg_type rhs); - - /// Atomically assign to @c value_. - ACE_Atomic_Op & operator= ( - ACE_Atomic_Op const & rhs); - - /// Atomically pre-increment @c value_. - TYPE operator++ (void); - - /// Atomically post-increment @c value_. - TYPE operator++ (int); - - /// Atomically increment @c value_ by rhs. - TYPE operator+= (arg_type rhs); - - /// Atomically pre-decrement @c value_. - TYPE operator-- (void); - - /// Atomically post-decrement @c value_. - TYPE operator-- (int); - - /// Atomically decrement @c value_ by rhs. - TYPE operator-= (arg_type rhs); - - /// Atomically compare @c value_ with rhs. - bool operator== (arg_type rhs) const; - - /// Atomically compare @c value_ with rhs. - bool operator!= (arg_type rhs) const; - - /// Atomically check if @c value_ greater than or equal to rhs. - bool operator>= (arg_type rhs) const; - - /// Atomically check if @c value_ greater than rhs. - bool operator> (arg_type rhs) const; - - /// Atomically check if @c value_ less than or equal to rhs. - bool operator<= (arg_type rhs) const; - - /// Atomically check if @c value_ less than rhs. - bool operator< (arg_type rhs) const; - - /// Explicitly return @c value_. - TYPE value (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /** - * Returns a reference to the underlying . This makes it - * possible to acquire the lock explicitly, which can be useful in - * some cases if you instantiate the ACE_Atomic_Op with an - * ACE_Recursive_Mutex or ACE_Process_Mutex. - * - * @deprecated This member function is deprecated and so may go away in - * the future. If you need access to the underlying mutex, consider - * using the ACE_Atomic_Op_Ex template instead. - */ - ACE_LOCK & mutex (void); - - /** - * Explicitly return @c value_ (by reference). This gives the user - * full, unrestricted access to the underlying value. This method - * will usually be used in conjunction with explicit access to the - * lock. Use with care ;-) - */ - TYPE & value_i (void); - -private: - /// Type of synchronization mechanism. - ACE_LOCK own_mutex_; - - /// Underlying atomic op implementation. - ACE_Atomic_Op_Ex impl_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Atomic_Op_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Atomic_Op_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Atomic_Op_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /*ACE_ATOMIC_OP_T_H*/ - diff --git a/dep/include/ace/Atomic_Op_T.inl b/dep/include/ace/Atomic_Op_T.inl deleted file mode 100644 index 2ac73d9fd39..00000000000 --- a/dep/include/ace/Atomic_Op_T.inl +++ /dev/null @@ -1,339 +0,0 @@ -// -*- C++ -*- -// -// $Id: Atomic_Op_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Guard_T.h" - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// -// ACE_Atomic_Op_Ex inline functions -// - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator++ (void) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator++"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return ++this->value_; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator+= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator+="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return this->value_ += rhs; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator-- (void) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator--"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return --this->value_; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator-= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator-="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return this->value_ -= rhs; -} - -template -ACE_INLINE -ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex ( - ACE_Atomic_Op_Ex const & rhs) - : mutex_ (rhs.mutex_) - , value_ (rhs.value ()) // rhs.value() returns atomically -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex"); -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator++ (int) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator++"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return this->value_++; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::operator-- (int) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator--"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return this->value_--; -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator== ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator=="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, false); - return this->value_ == rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator!= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator!="); - return !(*this == rhs); -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator>= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator>="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, false); - return this->value_ >= rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator> ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator>"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, false); - return this->value_ > rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator<= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator<="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, false); - return this->value_ <= rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op_Ex::operator< ( - typename ACE_Atomic_Op_Ex::arg_type rhs) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator<"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, false); - return this->value_ < rhs; -} - -template -ACE_INLINE ACE_Atomic_Op_Ex & -ACE_Atomic_Op_Ex::operator= ( - ACE_Atomic_Op_Ex const & rhs) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator="); - - ACE_Atomic_Op_Ex tmp (rhs); - - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, *this); - std::swap (this->value_, tmp.value_); - - return *this; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op_Ex::value (void) const -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::value"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); - return this->value_; -} - -template -ACE_INLINE TYPE & -ACE_Atomic_Op_Ex::value_i (void) -{ - // Explicitly return (by reference). This gives the user - // full, unrestricted access to the underlying value. This method - // will usually be used in conjunction with explicit access to the - // lock. Use with care ;-) - return this->value_; -} - -template -ACE_INLINE ACE_Atomic_Op_Ex & -ACE_Atomic_Op_Ex::operator= ( - typename ACE_Atomic_Op_Ex::arg_type rhs) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::operator="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, *this); - this->value_ = rhs; - return *this; -} - -// -// ACE_Atomic_Op inline functions -// - -template ACE_INLINE -ACE_Atomic_Op::ACE_Atomic_Op ( - ACE_Atomic_Op const & rhs) - : impl_ (own_mutex_, rhs.value ()) -{ - // ACE_TRACE ("ACE_Atomic_Op::ACE_Atomic_Op"); -} - -template -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= ( - typename ACE_Atomic_Op::arg_type i) -{ - this->impl_ = i; - return *this; -} - -template -ACE_INLINE ACE_Atomic_Op & -ACE_Atomic_Op::operator= ( - ACE_Atomic_Op const & rhs) -{ - this->impl_ = rhs.impl_; - return *this; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator++ (void) -{ - return ++this->impl_; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator++ (int) -{ - return this->impl_++; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator+= ( - typename ACE_Atomic_Op::arg_type rhs) -{ - return this->impl_ += rhs; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator-- (void) -{ - return --this->impl_; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator-- (int) -{ - return this->impl_--; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::operator-= ( - typename ACE_Atomic_Op::arg_type rhs) -{ - return this->impl_ -= rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator== ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ == rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator!= ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ != rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator>= ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ >= rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator> ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ > rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator<= ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ <= rhs; -} - -template -ACE_INLINE bool -ACE_Atomic_Op::operator< ( - typename ACE_Atomic_Op::arg_type rhs) const -{ - return this->impl_ < rhs; -} - -template -ACE_INLINE TYPE -ACE_Atomic_Op::value (void) const -{ - return this->impl_.value (); -} - -template -ACE_INLINE void -ACE_Atomic_Op::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->impl_.dump (); -#endif /* ACE_HAS_DUMP */ - return; -} - -template -ACE_INLINE ACE_LOCK & -ACE_Atomic_Op::mutex (void) -{ - return this->own_mutex_; -} - -template -ACE_INLINE TYPE & -ACE_Atomic_Op::value_i (void) -{ - return this->impl_.value_i (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Auto_Event.h b/dep/include/ace/Auto_Event.h deleted file mode 100644 index 307c89cddae..00000000000 --- a/dep/include/ace/Auto_Event.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Auto_Event.h - * - * $Id: Auto_Event.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_AUTO_EVENT_H -#define ACE_AUTO_EVENT_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Event.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Auto_Event - * - * @brief Auto Events. - * - * Specialization of Event mechanism which wakes up one waiting - * thread on . All platforms support process-scope locking - * support. However, only Win32 platforms support global naming and - * system-scope locking support. - */ -class ACE_Export ACE_Auto_Event : public ACE_Event -{ -public: - /// Constructor which will create auto event - ACE_Auto_Event (int initial_state = 0, - int type = USYNC_THREAD, - const char *name = 0, - void *arg = 0); - -#if defined (ACE_HAS_WCHAR) - /// Constructor which will create auto event (wchar_t version) - ACE_Auto_Event (int initial_state, - int type, - const wchar_t *name, - void *arg = 0); -#endif /* ACE_HAS_WCHAR */ - - /// Default dtor. - ~ACE_Auto_Event (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Auto_Event.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_AUTO_EVENT_H */ - diff --git a/dep/include/ace/Auto_Event.inl b/dep/include/ace/Auto_Event.inl deleted file mode 100644 index b614e0b0d77..00000000000 --- a/dep/include/ace/Auto_Event.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Auto_Event.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Auto_Event::~ACE_Auto_Event (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Auto_Functor.h b/dep/include/ace/Auto_Functor.h deleted file mode 100644 index 339054506be..00000000000 --- a/dep/include/ace/Auto_Functor.h +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Auto_Functor.h - * - * $Id: Auto_Functor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= -#ifndef ACE_AUTO_FUNCTOR_H -#define ACE_AUTO_FUNCTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE_Utils -{ -/** - * @class Auto_Functor_Ref - * - * @brief Helper class to implement assignment and copy-construction - * as expected - */ -template -struct Auto_Functor_Ref -{ - X * p_; - Functor f_; - - Auto_Functor_Ref(X * p, Functor f); -}; - -/** - * @class Auto_Functor - * - * @brief Helper template to implement auto_ptr<>-like classes, but - * executing a functor in the destructor, instead of always - * deleting things. - * - * The functor is called in the destructor, and it must implement: - * - * Functor() throw();
- * Functor(Functor const &) throw();
- * Functor & operator=(Functor const &) throw();
- * void operator()(X * p) throw();
- * - */ -template -class Auto_Functor -{ -public: - typedef X element_type; - typedef Functor functor_type; - - /// Constructor - explicit Auto_Functor (X * p = 0, - Functor functor = Functor()); // throw() - - Auto_Functor (Auto_Functor & rhs); // throw() - - Auto_Functor& operator= (Auto_Functor & rhs); // throw() - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) - template - Auto_Functor(Auto_Functor& rhs); // throw() - - template - Auto_Functor& operator= (Auto_Functor& rhs); // throw() -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - - ~Auto_Functor(); // throw() - - X & operator*() const; // throw() - - X * operator->() const; // throw() - - X * get(); // throw() - - X * release(); // throw() - - void reset (X * p = 0); // throw() - - void reset (X * p, Functor f); // throw() - - Functor const & functor() const; // throw() - - Auto_Functor(Auto_Functor_Ref rhs); // throw() - - Auto_Functor & operator=(Auto_Functor_Ref rhs); // throw() - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) - template operator Auto_Functor_Ref(); // throw() - - template operator Auto_Functor(); // throw() -#else - operator Auto_Functor_Ref(); // throw() -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -private: - X * p_; - - Functor f_; -}; - -} // namespace ACE_Utils - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -# include "ace/Auto_Functor.inl" -#endif /* __ACE_INLINE__ */ - -#if defined(ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Auto_Functor.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#include /**/ "ace/post.h" -#endif /* ACE_AUTO_FUNCTOR_H*/ - diff --git a/dep/include/ace/Auto_Functor.inl b/dep/include/ace/Auto_Functor.inl deleted file mode 100644 index d4cb2cc0473..00000000000 --- a/dep/include/ace/Auto_Functor.inl +++ /dev/null @@ -1,134 +0,0 @@ -// -*- C++ -*- -// -// $Id: Auto_Functor.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Utils::Auto_Functor_Ref:: -Auto_Functor_Ref(X * p, Functor f) - : p_(p) - , f_(f) -{ -} - -template ACE_INLINE -ACE_Utils::Auto_Functor::Auto_Functor(X * p, Functor f) - : p_(p) - , f_(f) -{ -} - -template ACE_INLINE -ACE_Utils::Auto_Functor::Auto_Functor(Auto_Functor & rhs) - : p_(rhs.release()) - , f_(rhs.f_) -{ -} - -template -ACE_INLINE ACE_Utils::Auto_Functor& -ACE_Utils::Auto_Functor:: operator=(Auto_Functor & rhs) -{ - reset(rhs.release()); - f_ = rhs.f_; - return *this; -} - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) -template template ACE_INLINE -ACE_Utils::Auto_Functor::Auto_Functor(Auto_Functor& rhs) - : p_(rhs.release()) - , f_(rhs.f_) -{ -} - -template template -ACE_INLINE ACE_Utils::Auto_Functor& -ACE_Utils::Auto_Functor::operator=(Auto_Functor& rhs) -{ - reset(rhs.release()); - return *this; -} -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -template ACE_INLINE X & -ACE_Utils::Auto_Functor::operator*() const -{ - return *p_; -} - -template -ACE_INLINE X * -ACE_Utils::Auto_Functor::operator->() const -{ - return p_; -} - -template -ACE_INLINE X * -ACE_Utils::Auto_Functor::get() -{ - return p_; -} - -template -ACE_INLINE X * -ACE_Utils::Auto_Functor::release() -{ - X * tmp = p_; - p_ = 0; - return tmp; -} - -template -ACE_INLINE Functor const & -ACE_Utils::Auto_Functor::functor() const -{ - return f_; -} - -template ACE_INLINE -ACE_Utils::Auto_Functor::Auto_Functor(Auto_Functor_Ref rhs) - : p_(rhs.p_) - , f_(rhs.f_) -{ -} - -template -ACE_INLINE ACE_Utils::Auto_Functor & -ACE_Utils::Auto_Functor::operator=(Auto_Functor_Ref rhs) -{ - if(rhs.p_ != p_) - { - reset(rhs.p_); - f_ = rhs.f_; - } - return *this; -} - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) - -template template ACE_INLINE -ACE_Utils::Auto_Functor::operator ACE_Utils::Auto_Functor_Ref() -{ - return ACE_Utils::Auto_Functor_Ref(release(), f_); -} - -template template ACE_INLINE -ACE_Utils::Auto_Functor::operator ACE_Utils::Auto_Functor() -{ - return ACE_Utils::Auto_Functor(release(), f_); -} - -#else - -templateACE_INLINE -ACE_Utils::Auto_Functor::operator ACE_Utils::Auto_Functor_Ref() -{ - return ACE_Utils::Auto_Functor_Ref(release(), f_); -} - -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Auto_IncDec_T.h b/dep/include/ace/Auto_IncDec_T.h deleted file mode 100644 index 8a8840e84b2..00000000000 --- a/dep/include/ace/Auto_IncDec_T.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Auto_IncDec_T.h - * - * $Id: Auto_IncDec_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Edan Ayal - */ -//============================================================================= - -#ifndef ACE_AUTO_INCDEC_T_H -#define ACE_AUTO_INCDEC_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Auto_IncDec - * - * @brief This class automatically increments and decrements a - * parameterized counter. - * - * This data structure is meant to be used within a method, - * function, or scope. The actual parameter given for the - * template parameter - * must provide at least operators ++ and --. - */ -template -class ACE_Auto_IncDec -{ -public: - - /// Implicitly increment the counter. - ACE_Auto_IncDec (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter); - - /// Implicitly decrement the counter. - ~ACE_Auto_IncDec (void); - - /// Dump the state of an object. - void dump (void) const; - -protected: - /// Reference to the counter - /// we're incrementing/decrementing. - ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter_; - -private: - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const - ACE_Auto_IncDec &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Auto_IncDec (const - ACE_Auto_IncDec &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Auto_IncDec_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Auto_IncDec_T.cpp" -// On Win32 platforms, this code will be included as template source -// code and will not be inlined. Therefore, we first turn off -// ACE_INLINE, set it to be nothing, include the code, and then turn -// ACE_INLINE back to its original setting. All this nonsense is -// necessary, since the generic template code that needs to be -// specialized cannot be inlined, else the compiler will ignore the -// specialization code. Also, the specialization code *must* be -// inlined or the compiler will ignore the specializations. -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Auto_IncDec_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_AUTO_INCDEC_T_H */ - diff --git a/dep/include/ace/Auto_IncDec_T.inl b/dep/include/ace/Auto_IncDec_T.inl deleted file mode 100644 index e61980e7192..00000000000 --- a/dep/include/ace/Auto_IncDec_T.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// -// $Id: Auto_IncDec_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Implicitly and automatically increment the counter. - -template ACE_INLINE -ACE_Auto_IncDec::ACE_Auto_IncDec - (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter) - : counter_ (counter) -{ - ++this->counter_; -} - -// Implicitly and automatically decrement the counter. - -template ACE_INLINE -ACE_Auto_IncDec::~ACE_Auto_IncDec (void) -{ - --this->counter_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Auto_Ptr.h b/dep/include/ace/Auto_Ptr.h deleted file mode 100644 index ce52100609b..00000000000 --- a/dep/include/ace/Auto_Ptr.h +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Auto_Ptr.h - * - * $Id: Auto_Ptr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - * @author Irfan Pyarali - * @author Jack Reeves - * @author Dr. Harald M. Mueller - */ -//============================================================================= - -#ifndef ACE_AUTO_PTR_H -#define ACE_AUTO_PTR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (_MSC_VER) -// Suppress warning e.g. "return type for -// 'ACE_Auto_Array_Pointer::operator ->' is 'type *' (i.e., not a UDT -// or reference to a UDT. Will produce errors if applied using infix -// notation)" -# pragma warning(push) -# pragma warning(disable: 4284) -#endif /* _MSC_VER */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Auto_Basic_Ptr - * - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This class allows one to work on non-object (basic) types - */ -template -class ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - // = Initialization and termination methods - explicit ACE_Auto_Basic_Ptr (X * p = 0) : p_ (p) {} - - ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr & ap); - ACE_Auto_Basic_Ptr &operator= (ACE_Auto_Basic_Ptr & rhs); - ~ACE_Auto_Basic_Ptr (void); - - // = Accessor methods. - X &operator *() const; - X *get (void) const; - X *release (void); - void reset (X * p = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - X *p_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if !defined (ACE_LACKS_AUTO_PTR) && \ - defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ - (ACE_HAS_STANDARD_CPP_LIBRARY != 0) -#include -#if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) -using std::auto_ptr; -#endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ -#else /* ACE_HAS_STANDARD_CPP_LIBRARY */ - -/** - * @class auto_ptr - * - * @brief Implements the draft C++ standard auto_ptr abstraction. - */ -template -class auto_ptr : public ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - // = Initialization and termination methods - explicit auto_ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} - auto_ptr (auto_ptr & ap) : ACE_Auto_Basic_Ptr (ap.release ()) {} - - X *operator-> () const; -}; - -#endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This version can be used instead of auto_ptr, and obviates - * the need for the ACE_AUTO_PTR_RESET macro on platforms like - * VC6 where the auto_ptr is broken. - */ -template -class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - // = Initialization and termination methods - explicit ACE_Auto_Ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} - - X *operator-> () const; -}; - -/** - * @class ACE_Auto_Basic_Array_Ptr - * - * @brief Implements an extension to the draft C++ standard auto_ptr - * abstraction. This class allows one to work on non-object - * (basic) types that must be treated as an array, e.g., - * deallocated via "delete [] foo". - */ -template -class ACE_Auto_Basic_Array_Ptr -{ -public: - typedef X element_type; - - // = Initialization and termination methods. - explicit ACE_Auto_Basic_Array_Ptr (X * p = 0) : p_ (p) {} - - ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr & ap); - ACE_Auto_Basic_Array_Ptr &operator= (ACE_Auto_Basic_Array_Ptr & rhs); - ~ACE_Auto_Basic_Array_Ptr (void); - - // = Accessor methods. - X & operator* () const; - X & operator[] (int i) const; - X * get (void) const; - X * release (void); - void reset (X * p = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - X * p_; -}; - -/** - * @class ACE_Auto_Array_Ptr - * - * @brief Implements an extension to the draft C++ standard auto_ptr - * abstraction. - */ -template -class ACE_Auto_Array_Ptr : public ACE_Auto_Basic_Array_Ptr -{ -public: - typedef X element_type; - - // = Initialization and termination methods. - explicit ACE_Auto_Array_Ptr (X *p = 0) - : ACE_Auto_Basic_Array_Ptr (p) {} - - X *operator-> () const; -}; - -/** - * @brief Reset given @c auto_ptr element to new element. - * - * Some platforms have an older version of auto_ptr support, which - * lacks reset, and cannot be disabled easily. Portability to these - * platforms requires use of this function template. This function - * template also works for the @c ACE_Auto_{Basic_}Array_Ptr class - * template, as well. - */ -template -inline void -ACE_auto_ptr_reset (AUTO_PTR_TYPE & ap, - PTR_TYPE * p) -{ -#if defined (ACE_AUTO_PTR_LACKS_RESET) - // Allow compiler to adjust pointer to potential base class pointer - // of element type found in auto_ptr. - typename AUTO_PTR_TYPE::element_type * const tp = p; - if (tp != ap.get ()) - { - ap = AUTO_PTR_TYPE (tp); - } -#else - ap.reset (p); -#endif /* ACE_AUTO_PTR_LACKS_RESET */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -// Some platforms have an older version of auto_ptr -// support, which lacks reset, and cannot be disabled -// easily. Portability to these platforms requires -// use of the following ACE_AUTO_PTR_RESET macro. -// -// The TYPE macro parameter is no longer necessary but we leave it -// around for backward compatibility. This is also the reason why the -// ACE_auto_ptr_reset function template is not called -// ACE_AUTO_PTR_RESET. -# define ACE_AUTO_PTR_RESET(AUTOPTR,NEWPTR,TYPE) \ - ACE_auto_ptr_reset (AUTOPTR, NEWPTR); - -#if defined (__ACE_INLINE__) -#include "ace/Auto_Ptr.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Auto_Ptr.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Auto_Ptr.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#if defined (_MSC_VER) -// Restore the warning state to what it was before entry. -# pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* ACE_AUTO_PTR_H */ - diff --git a/dep/include/ace/Auto_Ptr.inl b/dep/include/ace/Auto_Ptr.inl deleted file mode 100644 index 9ea47c3f208..00000000000 --- a/dep/include/ace/Auto_Ptr.inl +++ /dev/null @@ -1,171 +0,0 @@ -// -*- C++ -*- -// -// $Id: Auto_Ptr.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Auto_Basic_Ptr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Auto_Basic_Ptr::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE void -ACE_Auto_Basic_Array_Ptr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE -ACE_Auto_Basic_Ptr::ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::ACE_Auto_Basic_Ptr"); -} - -template ACE_INLINE X * -ACE_Auto_Basic_Ptr::get (void) const -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::get"); - return this->p_; -} - -template ACE_INLINE X * -ACE_Auto_Basic_Ptr::release (void) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::release"); - X *old = this->p_; - this->p_ = 0; - return old; -} - -template ACE_INLINE void -ACE_Auto_Basic_Ptr::reset (X *p) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::reset"); - if (this->get () != p) - delete this->get (); - this->p_ = p; -} - -template ACE_INLINE ACE_Auto_Basic_Ptr & -ACE_Auto_Basic_Ptr::operator= (ACE_Auto_Basic_Ptr &rhs) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -template ACE_INLINE -ACE_Auto_Basic_Ptr::~ACE_Auto_Basic_Ptr (void) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::~ACE_Auto_Basic_Ptr"); - delete this->get (); -} - -template ACE_INLINE X & -ACE_Auto_Basic_Ptr::operator *() const -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::operator *()"); - return *this->get (); -} - -#if defined (ACE_LACKS_AUTO_PTR) || \ - !defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ - (ACE_HAS_STANDARD_CPP_LIBRARY == 0) - -template ACE_INLINE X * -auto_ptr::operator-> () const -{ - ACE_TRACE ("auto_ptr::operator->"); - return this->get (); -} - -#endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ - -template ACE_INLINE X * -ACE_Auto_Ptr::operator-> () const -{ - ACE_TRACE ("ACE_Auto_Ptr::operator->"); - return this->get (); -} - -template ACE_INLINE X * -ACE_Auto_Basic_Array_Ptr::get (void) const -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::get"); - return this->p_; -} - -template ACE_INLINE X * -ACE_Auto_Basic_Array_Ptr::release (void) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::release"); - X *old = this->p_; - this->p_ = 0; - return old; -} - -template ACE_INLINE void -ACE_Auto_Basic_Array_Ptr::reset (X *p) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::reset"); - if (this->get () != p) - delete [] this->get (); - this->p_ = p; -} - -template ACE_INLINE -ACE_Auto_Basic_Array_Ptr::ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::ACE_Auto_Basic_Array_Ptr"); -} - -template ACE_INLINE ACE_Auto_Basic_Array_Ptr & -ACE_Auto_Basic_Array_Ptr::operator= (ACE_Auto_Basic_Array_Ptr &rhs) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -template ACE_INLINE -ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr (void) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr"); - delete [] this->get (); -} - -template ACE_INLINE X & -ACE_Auto_Basic_Array_Ptr::operator *() const -{ - return *this->get (); -} - -template ACE_INLINE X & -ACE_Auto_Basic_Array_Ptr::operator[](int i) const -{ - X *array = this->get (); - return array[i]; -} - -template ACE_INLINE X * -ACE_Auto_Array_Ptr::operator->() const -{ - return this->get (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Barrier.h b/dep/include/ace/Barrier.h deleted file mode 100644 index 5fc9b9e8b7d..00000000000 --- a/dep/include/ace/Barrier.h +++ /dev/null @@ -1,216 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Barrier.h - * - * $Id: Barrier.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_BARRIER_H -#define ACE_BARRIER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/config-all.h" - -// ACE platform supports some form of threading. -#if !defined (ACE_HAS_THREADS) - -#include "ace/OS_NS_errno.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Barrier - * - * @brief This is a no-op to make ACE "syntactically consistent." - */ -class ACE_Export ACE_Barrier -{ -public: - ACE_Barrier (unsigned int, const ACE_TCHAR * = 0, void * = 0) {} - ~ACE_Barrier (void) {} - int wait (void) { ACE_NOTSUP_RETURN (-1); } - void dump (void) const {} -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#else /* ACE_HAS_THREADS */ - -#include "ace/Condition_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -struct ACE_Export ACE_Sub_Barrier -{ - // = Initialization. - ACE_Sub_Barrier (unsigned int count, - ACE_Thread_Mutex &lock, - const ACE_TCHAR *name = 0, - void *arg = 0); - - ~ACE_Sub_Barrier (void); - - /// True if this generation of the barrier is done. - ACE_Condition_Thread_Mutex barrier_finished_; - - /// Number of threads that are still running. - int running_threads_; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/** - * @class ACE_Barrier - * - * @brief Implements "barrier synchronization". - * - * This class allows number of threads to synchronize - * their completion of (one round of) a task, which is known as - * "barrier synchronization". After all the threads call - * on the barrier they are all atomically released and can begin a new - * round. - * - * This implementation uses a "sub-barrier generation numbering" - * scheme to avoid overhead and to ensure that all threads wait to - * leave the barrier correct. This code is based on an article from - * SunOpsis Vol. 4, No. 1 by Richard Marejka - * (Richard.Marejka@canada.sun.com). - */ -class ACE_Export ACE_Barrier -{ -public: - /// Initialize the barrier to synchronize @a count threads. - ACE_Barrier (unsigned int count, - const ACE_TCHAR *name = 0, - void *arg = 0); - - /// Default dtor. - ~ACE_Barrier (void); - - /// Block the caller until all @c count threads have called @c wait and - /// then allow all the caller threads to continue in parallel. - /// - /// @retval 0 after successfully waiting for all threads to wait. - /// @retval -1 if an error occurs or the barrier is shut - /// down (@sa shutdown ()). - int wait (void); - - /// Shut the barrier down, aborting the wait of all waiting threads. - /// Any threads waiting on the barrier when it is shut down will return with - /// value -1, errno ESHUTDOWN. - /// - /// @retval 0 for success, -1 if already shut down. - /// - /// @since ACE beta 5.4.9. - int shutdown (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Serialize access to the barrier state. - ACE_Thread_Mutex lock_; - - /// Either 0 or 1, depending on whether we are the first generation - /// of waiters or the next generation of waiters. - int current_generation_; - - /// Total number of threads that can be waiting at any one time. - int count_; - - /** - * We keep two @c sub_barriers, one for the first "generation" of - * waiters, and one for the next "generation" of waiters. This - * efficiently solves the problem of what to do if all the first - * generation waiters don't leave the barrier before one of the - * threads calls wait() again (i.e., starts up the next generation - * barrier). - */ - ACE_Sub_Barrier sub_barrier_1_; - ACE_Sub_Barrier sub_barrier_2_; - ACE_Sub_Barrier *sub_barrier_[2]; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_Barrier &); - ACE_Barrier (const ACE_Barrier &); -}; - -#if 0 -/** - * @class ACE_Process_Barrier - * - * @brief Implements "barrier synchronization" using ACE_Process_Mutexes! - * - * This class is just a simple wrapper for ACE_Barrier that - * selects the USYNC_PROCESS variant for the locks. - */ -class ACE_Export ACE_Process_Barrier : public ACE_Barrier -{ -public: - /// Create a Process_Barrier, passing in the optional @a name. - ACE_Process_Barrier (unsigned int count, const ACE_TCHAR *name = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; -#endif /* 0 */ - -/** - * @class ACE_Thread_Barrier - * - * @brief Implements "barrier synchronization" using ACE_Thread_Mutexes! - * - * This class is just a simple wrapper for ACE_Barrier that - * selects the USYNC_THREAD variant for the locks. - */ -class ACE_Export ACE_Thread_Barrier : public ACE_Barrier -{ -public: - /// Create a Thread_Barrier, passing in the optional @a name. - ACE_Thread_Barrier (unsigned int count, const ACE_TCHAR *name = 0); - - /// Default dtor. - ~ACE_Thread_Barrier (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Barrier.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* !ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_BARRIER_H */ - diff --git a/dep/include/ace/Barrier.inl b/dep/include/ace/Barrier.inl deleted file mode 100644 index 10430d917a3..00000000000 --- a/dep/include/ace/Barrier.inl +++ /dev/null @@ -1,22 +0,0 @@ -// -*- C++ -*- -// -// $Id: Barrier.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Sub_Barrier::~ACE_Sub_Barrier (void) -{ -} - -ACE_INLINE -ACE_Barrier::~ACE_Barrier (void) -{ -} - -ACE_INLINE -ACE_Thread_Barrier::~ACE_Thread_Barrier (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Base_Thread_Adapter.h b/dep/include/ace/Base_Thread_Adapter.h deleted file mode 100644 index 968535917d2..00000000000 --- a/dep/include/ace/Base_Thread_Adapter.h +++ /dev/null @@ -1,193 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Base_Thread_Adapter.h - * - * $Id: Base_Thread_Adapter.h 81239 2008-04-04 22:28:48Z iliyan $ - * - * @author Nanbor Wang - */ -//============================================================================= - -#ifndef ACE_BASE_THREAD_ADAPTER_H -#define ACE_BASE_THREAD_ADAPTER_H -#include /**/ "ace/pre.h" - -#include "ace/OS_Log_Msg_Attributes.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/ACE_export.h" -#include "ace/OS_Log_Msg_Attributes.h" - -#ifdef ACE_USES_GPROF -#include "os_include/sys/os_time.h" -#endif // ACE_USES_GPROF - -#if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1) -# define ACE_THREAD_ADAPTER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_thread_adapter) -#else -# define ACE_THREAD_ADAPTER_NAME ace_thread_adapter -#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ - -// Run the thread entry point for the ACE_Thread_Adapter. This must -// be an extern "C" to make certain compilers happy... - -extern "C" ACE_Export ACE_THR_FUNC_RETURN ACE_THREAD_ADAPTER_NAME (void *args); - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_OS_Thread_Descriptor - * - * @brief Parent class of all ACE_Thread_Descriptor classes. - * = - * Container for ACE_Thread_Descriptor members that are - * used in ACE_OS. - */ -class ACE_Export ACE_OS_Thread_Descriptor -{ -public: - /// Get the thread creation flags. - long flags (void) const; - -protected: - /// For use by ACE_Thread_Descriptor. - ACE_OS_Thread_Descriptor (long flags = 0); - - /** - * Keeps track of whether this thread was created "detached" or not. - * If a thread is *not* created detached then if someone calls - * , we need to join with that thread (and - * close down the handle). - */ - long flags_; -}; - -class ACE_Service_Gestalt; - -/** - * @class ACE_Base_Thread_Adapter - * - * @brief Base class for all the Thread_Adapters. - * - * Converts a C++ function into a function that can be - * called from a thread creation routine - * (e.g., pthread_create() or _beginthreadex()) that expects an - * extern "C" entry point. This class also makes it possible to - * transparently provide hooks to register a thread with an - * ACE_Thread_Manager. - * This class is used in ACE_OS::thr_create(). In general, the - * thread that creates an object of this class is different from - * the thread that calls @c invoke() on this object. Therefore, - * the @c invoke() method is responsible for deleting itself. - */ -class ACE_Export ACE_Base_Thread_Adapter -{ -public: - - virtual ~ACE_Base_Thread_Adapter (void); - - /// Virtual method invoked by the thread entry point. - virtual ACE_THR_FUNC_RETURN invoke (void) = 0; - - /// Accessor for the C entry point function to the OS thread creation - /// routine. - ACE_THR_C_FUNC entry_point (void); - -#ifdef ACE_USES_GPROF - /// Accessor to the itimer_ - /// followed http://sam.zoy.org/writings/programming/gprof.html - struct itimerval* timerval (void); -#endif // ACE_USES_PROF - - /// Invoke the close_log_msg_hook, if it is present - static void close_log_msg (void); - - /// Invoke the sync_log_msg_hook, if it is present - static void sync_log_msg (const ACE_TCHAR *prog_name); - - /// Invoke the thr_desc_log_msg_hook, if it is present - static ACE_OS_Thread_Descriptor *thr_desc_log_msg (void); - -protected: - /// Constructor. - ACE_Base_Thread_Adapter (ACE_THR_FUNC user_func, - void *arg, - ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME, - ACE_OS_Thread_Descriptor *td = 0 -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector = 0 - , ACE_SEH_EXCEPT_HANDLER handler = 0 -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ); - /// Inherit the logging features if the parent thread has an - /// ACE_Log_Msg. - void inherit_log_msg (void); - -private: - /// The hooks to inherit and cleanup the Log_Msg attributes - static ACE_INIT_LOG_MSG_HOOK init_log_msg_hook_; - static ACE_INHERIT_LOG_MSG_HOOK inherit_log_msg_hook_; - static ACE_CLOSE_LOG_MSG_HOOK close_log_msg_hook_; - static ACE_SYNC_LOG_MSG_HOOK sync_log_msg_hook_; - static ACE_THR_DESC_LOG_MSG_HOOK thr_desc_log_msg_hook_; - - /// Set the Log_Msg hooks - static void set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, - ACE_INHERIT_LOG_MSG_HOOK inherit_hook, - ACE_CLOSE_LOG_MSG_HOOK close_hook, - ACE_SYNC_LOG_MSG_HOOK sync_hook, - ACE_THR_DESC_LOG_MSG_HOOK thr_desc); - - /// Allow the ACE_Log_Msg class to set its hooks. - friend class ACE_Log_Msg; - -protected: - /// Thread startup function passed in by the user (C++ linkage). - ACE_THR_FUNC user_func_; - - /// Argument to thread startup function. - void *arg_; - - /// Entry point to the underlying OS thread creation call (C - /// linkage). - ACE_THR_C_FUNC entry_point_; - - /** - * Optional thread descriptor. Passing this pointer in will force - * the spawned thread to cache this location in and wait - * until fills in all information in thread - * descriptor. - */ - ACE_OS_Thread_Descriptor *thr_desc_; - - /// The ACE_Log_Msg attributes. - ACE_OS_Log_Msg_Attributes log_msg_attributes_; - - /// That is usefull for gprof, define itimerval -#ifdef ACE_USES_GPROF - struct itimerval itimer_; -#endif // ACE_USES_GPROF - - /// Keep a reference to the configuration context that spawns the - /// thread so the child can inherit it. - ACE_Service_Gestalt * const ctx_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_INLINED_OSCALLS) -# if defined (ACE_INLINE) -# undef ACE_INLINE -# endif /* ACE_INLINE */ -# define ACE_INLINE inline -# include "ace/Base_Thread_Adapter.inl" -# endif /* ACE_HAS_INLINED_OSCALLS */ - -#include /**/ "ace/post.h" -#endif /* ACE_BASE_THREAD_ADAPTER_H */ - diff --git a/dep/include/ace/Base_Thread_Adapter.inl b/dep/include/ace/Base_Thread_Adapter.inl deleted file mode 100644 index 3bac80246dd..00000000000 --- a/dep/include/ace/Base_Thread_Adapter.inl +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id: Base_Thread_Adapter.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE long -ACE_OS_Thread_Descriptor::flags (void) const -{ - return flags_; -} - -ACE_INLINE -ACE_OS_Thread_Descriptor::ACE_OS_Thread_Descriptor (long flags) - : flags_ (flags) -{ -} - -ACE_INLINE void -ACE_Base_Thread_Adapter::set_log_msg_hooks ( - ACE_INIT_LOG_MSG_HOOK init_hook, - ACE_INHERIT_LOG_MSG_HOOK inherit_hook, - ACE_CLOSE_LOG_MSG_HOOK close_hook, - ACE_SYNC_LOG_MSG_HOOK sync_hook, - ACE_THR_DESC_LOG_MSG_HOOK thr_desc_hook) -{ - ACE_Base_Thread_Adapter::init_log_msg_hook_ = init_hook; - ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = inherit_hook; - ACE_Base_Thread_Adapter::close_log_msg_hook_ = close_hook; - ACE_Base_Thread_Adapter::sync_log_msg_hook_ = sync_hook; - ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = thr_desc_hook; -} - -ACE_INLINE ACE_THR_C_FUNC -ACE_Base_Thread_Adapter::entry_point (void) -{ - return this->entry_point_; -} - -#ifdef ACE_USES_GPROF -ACE_INLINE itimerval* -ACE_Base_Thread_Adapter::timerval (void) -{ - return &(this->itimer_); -} -#endif // ACE_USES_GPROF - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Based_Pointer_Repository.h b/dep/include/ace/Based_Pointer_Repository.h deleted file mode 100644 index 4cb49cb078b..00000000000 --- a/dep/include/ace/Based_Pointer_Repository.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Based_Pointer_Repository.h - * - * $Id: Based_Pointer_Repository.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Dietrich Quehl - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_BASED_POINTER_REPOSITORY_H -#define ACE_BASED_POINTER_REPOSITORY_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Singleton.h" -#include "ace/Synch_Traits.h" -#include "ace/os_include/os_stddef.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl., using the "Cheshire Cat" technique. -class ACE_Based_Pointer_Repository_Rep; - -/** - * @class ACE_Based_Pointer_Repository - * - * @brief Maps pointers to the base address of the region to which each - * pointer belongs. - */ -class ACE_Export ACE_Based_Pointer_Repository -{ -public: - // = Use ACE_Null_Mutex to allow locking while iterating. - - // = Initialization and termination methods. - ACE_Based_Pointer_Repository (void); - ~ACE_Based_Pointer_Repository (void); - - // = Search structure methods. - /** - * Return the appropriate @a base_addr region that contains @a addr. - * Returns 1 on success and 0 if the @a addr isn't contained in any - * @a base_addr region. - */ - int find (void *addr, - void *&base_addr); - - /// Bind a new entry to the repository or update the size of an - /// existing entry. Returns 0 on success and -1 on failure. - int bind (void *addr, - size_t size); - - /// Unbind from the repository the that @a addr is - /// contained within. - int unbind (void *addr); - -private: - - /// Use the "Cheshire-Cat" technique to hide the implementation in - /// order to avoid circular #include dependencies. - ACE_Based_Pointer_Repository_Rep *rep_; - -}; - -// ---------------------------------- - -/// Declare a process wide singleton -ACE_SINGLETON_DECLARE (ACE_Singleton, - ACE_Based_Pointer_Repository, - ACE_SYNCH_RW_MUTEX) - -/// Provide a Singleton access point to the based pointer repository. -typedef ACE_Singleton - ACE_BASED_POINTER_REPOSITORY; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_BASED_POINTER_REPOSITORY_H */ - diff --git a/dep/include/ace/Based_Pointer_T.h b/dep/include/ace/Based_Pointer_T.h deleted file mode 100644 index 39437bbb3c9..00000000000 --- a/dep/include/ace/Based_Pointer_T.h +++ /dev/null @@ -1,206 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Based_Pointer_T.h - * - * $Id: Based_Pointer_T.h 81705 2008-05-15 14:02:02Z johnnyw $ - * - * @author Dietrich Quehl - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_BASED_POINTER_T_H -#define ACE_BASED_POINTER_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Basic_Types.h" - -#if defined (_MSC_VER) -// Suppress warning e.g. "return type for -// 'ACE_Based_Pointer::operator ->' is 'long *' (i.e., not a UDT -// or reference to a UDT. Will produce errors if applied using infix -// notation)" -#pragma warning(disable: 4284) -#endif /* _MSC_VER */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Based_Pointer_Basic - * - * @brief A proxy that keeps track of the relative offset of a "pointer" - * from its base address. - * This class makes it possible to transparently use "pointers" in - * shared memory as easily as programming with pointers to local - * memory. In particular, we don't need to ensure that the base - * addresses of all the pointers are mapped into separate - * processes at the same absolute memory base address. - */ -template -class ACE_Based_Pointer_Basic -{ -public: - /** - * This constructor initializes the by asking the - * Singleton for the base address of - * the memory region within which it is instantiated. Two results - * are possible: - * - * 1. An has stored a base address/size pair and the - * new based-pointer instance is located between the base address and - * the base address + size - 1. In this case, the repository - * returns the base address. - * - * 2. No suitable address/size pair was found. The repository - * assumes an address in the regular (not mapped) virtual address - * space of the process and returns 0. In this case, the - * based-pointer uses its address as an offset to it's base - * address 0. - */ - ACE_Based_Pointer_Basic (void); - - /** - * Initialize this object using the @a initial pointer. This - * constructor initializes the by asking the - * Singleton for the base address of - * the memory region within which it is instantiated. Three results - * are possible: - * - * 1. An has stored a base address/size pair and the - * new based-pointer instance is located between the base address and - * the base address + size - 1. In this case, the repository - * returns the base address. - * - * 2. No suitable address/size pair was found. The repository - * assumes an address in the regular (not mapped) virtual address - * space of the process and returns 0. In this case, the - * based-pointer uses its address as an offset to its base - * address 0. - * - * 3. If @a initial is 0 then set the value of to -1, which - * indicates a "NULL" pointer. - */ - ACE_Based_Pointer_Basic (CONCRETE *initial); - - /// Copy constructor. - ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic &); - - /// Constructor for know base address. @a o is only used to - /// resolve overload ambiguity. - ACE_Based_Pointer_Basic (const void *base_addr, int o); - - /// Pseudo-assignment operator. - void operator = (CONCRETE *from); - - /// Pseudo-assignment operator. - void operator = (const ACE_Based_Pointer_Basic &); - - /// Dereference operator. - CONCRETE operator * (void) const; - - /// Less than operator. - bool operator < (const ACE_Based_Pointer_Basic &) const; - - /// Less than or equal operator. - bool operator <= (const ACE_Based_Pointer_Basic &) const; - - /// Greater than operator. - bool operator > (const ACE_Based_Pointer_Basic &) const; - - /// Greater than or equal operator. - bool operator >= (const ACE_Based_Pointer_Basic &) const; - - /// Equality operator. - bool operator == (const ACE_Based_Pointer_Basic &) const; - - /// Inequality operator. - bool operator != (const ACE_Based_Pointer_Basic &) const; - - /// Subscript operator. - CONCRETE operator [](int index) const; - - /// Increment operator. - void operator+= (int index); - - /// Returns the underlying memory address of the smart pointer. - operator CONCRETE *() const; - - /// Returns the underlying memory address of the smart pointer. - CONCRETE *addr (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Dump the state of the object. - void dump (void) const; - -protected: - ptrdiff_t target_; - - /// Keep track of our offset from the base pointer. - ptrdiff_t base_offset_; -}; - -/** - * @class ACE_Based_Pointer - * - * @brief A smart proxy that keeps track of the relative offset of a - * "pointer" from its base address. - * - * This class makes it possible to transparently use "pointers" in - * shared memory as easily as programming with pointers to local - * memory by overloading the C++ delegation operator ->(). - */ -template -class ACE_Based_Pointer : public ACE_Based_Pointer_Basic -{ -public: - // = Initialization method. - /// Constructor. See constructor for ACE_Based_Pointer_Basic for - /// details. - ACE_Based_Pointer (void); - - /// Initialize this object using the pointer. See - /// constructor for ACE_Based_Pointer_Basic for details. - ACE_Based_Pointer (CONCRETE *initial); - - /// Initialize this object with known @a base_addr. @a dummy is - /// a dummy value used to resolve overload ambiguity and it - /// otherwise ignored. - ACE_Based_Pointer (const void *base_addr, int dummy); - - /// Copy constructor (not implemented yet). - ACE_Based_Pointer (const ACE_Based_Pointer &); - - /// Assignment operator. - void operator = (const ACE_Based_Pointer &); - - /// Pseudo-assignment operator. - void operator = (CONCRETE *from); - - /// The C++ "delegation operator". - CONCRETE *operator-> (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Based_Pointer_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Based_Pointer_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Based_Pointer_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_BASED_POINTER_T_H */ - diff --git a/dep/include/ace/Based_Pointer_T.inl b/dep/include/ace/Based_Pointer_T.inl deleted file mode 100644 index ba6a5aa511b..00000000000 --- a/dep/include/ace/Based_Pointer_T.inl +++ /dev/null @@ -1,139 +0,0 @@ -// -*- C++ -*- -// -// $Id: Based_Pointer_T.inl 81705 2008-05-15 14:02:02Z johnnyw $ - -#define ACE_COMPUTE_BASED_POINTER(P) (((char *) (P) - (P)->base_offset_) + (P)->target_) -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE CONCRETE * -ACE_Based_Pointer::operator->(void) -{ - ACE_TRACE ("ACE_Based_Pointer::operator->"); - return reinterpret_cast (ACE_COMPUTE_BASED_POINTER (this)); -} - -template ACE_INLINE void -ACE_Based_Pointer_Basic::operator = (CONCRETE *rhs) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator ="); - if (rhs == 0) - // Store a value of that indicate "NULL" pointer. - this->target_ = -1; - else - this->target_ = ((char *) rhs - - ((char *) this - this->base_offset_)); -} - -template ACE_INLINE void -ACE_Based_Pointer::operator = (CONCRETE *rhs) -{ - ACE_TRACE ("ACE_Based_Pointer::operator ="); - if (rhs == 0) - // Store a value of that indicate "NULL" pointer. - this->target_ = -1; - else - this->target_ = ((char *) rhs - - ((char *) this - this->base_offset_)); -} - -template ACE_INLINE CONCRETE -ACE_Based_Pointer_Basic::operator *(void) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator *"); - return *reinterpret_cast (ACE_COMPUTE_BASED_POINTER (this)); -} - -template ACE_INLINE CONCRETE * -ACE_Based_Pointer_Basic::addr (void) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::addr"); - - if (this->target_ == -1) - return 0; - else - return reinterpret_cast (ACE_COMPUTE_BASED_POINTER (this)); -} - -template ACE_INLINE -ACE_Based_Pointer_Basic::operator CONCRETE *() const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator CONCRETE *()"); - - return this->addr (); -} - -template ACE_INLINE CONCRETE -ACE_Based_Pointer_Basic::operator [] (int index) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator []"); - CONCRETE *c = - reinterpret_cast (ACE_COMPUTE_BASED_POINTER (this)); - return c[index]; -} - -template ACE_INLINE void -ACE_Based_Pointer_Basic::operator += (int index) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator +="); - this->base_offset_ += (index * sizeof (CONCRETE)); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator == (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator =="); - return ACE_COMPUTE_BASED_POINTER (this) == ACE_COMPUTE_BASED_POINTER (&rhs); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator != (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator !="); - return !(*this == rhs); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator < (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator <"); - return ACE_COMPUTE_BASED_POINTER (this) < ACE_COMPUTE_BASED_POINTER (&rhs); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator <= (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator <="); - return ACE_COMPUTE_BASED_POINTER (this) <= ACE_COMPUTE_BASED_POINTER (&rhs); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator > (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator >"); - return ACE_COMPUTE_BASED_POINTER (this) > ACE_COMPUTE_BASED_POINTER (&rhs); -} - -template ACE_INLINE bool -ACE_Based_Pointer_Basic::operator >= (const ACE_Based_Pointer_Basic &rhs) const -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator >="); - return ACE_COMPUTE_BASED_POINTER (this) >= ACE_COMPUTE_BASED_POINTER (&rhs); -} - -template ACE_INLINE void -ACE_Based_Pointer_Basic::operator= (const ACE_Based_Pointer_Basic &rhs) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::operator="); - *this = rhs.addr (); -} - -template ACE_INLINE void -ACE_Based_Pointer::operator= (const ACE_Based_Pointer &rhs) -{ - ACE_TRACE ("ACE_Based_Pointer::operator="); - *this = rhs.addr (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Basic_Stats.h b/dep/include/ace/Basic_Stats.h deleted file mode 100644 index 2bf96a61c06..00000000000 --- a/dep/include/ace/Basic_Stats.h +++ /dev/null @@ -1,87 +0,0 @@ - -//============================================================================= -/** - * @file Basic_Stats.h - * - * $Id: Basic_Stats.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_BASIC_STATS_H -#define ACE_BASIC_STATS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Basic_Types.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Collect basic stats about a series of samples -/** - * Compute the average and standard deviation (aka jitter) for an - * arbitrary number of samples, using constant space. - * Normally used for latency statistics. - */ -class ACE_Export ACE_Basic_Stats -{ -public: - /// Constructor - /** - * The number of samples is pre-allocated, and cannot changes once - * the class is initialized. - */ - ACE_Basic_Stats (void); - - /// The number of samples received so far - ACE_UINT32 samples_count (void) const; - - /// Record one sample. - void sample (ACE_UINT64 value); - - /// Update the values to reflect the stats in @a rhs. - void accumulate (const ACE_Basic_Stats &rhs); - - /// Dump all the samples - /** - * Prints out the results, using @a msg as a prefix for each message and - * scaling all the numbers by @a scale_factor. The latter is useful because - * high resolution timer samples are acquired in clock ticks, but often - * presented in microseconds. - */ - void dump_results (const ACE_TCHAR *msg, - ACE_UINT32 scale_factor) const; - - /// The number of samples - ACE_UINT32 samples_count_; - - /// The minimum value - ACE_UINT64 min_; - - /// The number of the sample that had the minimum value - ACE_UINT32 min_at_; - - /// The maximum value - ACE_UINT64 max_; - - /// The number of the sample that had the maximum value - ACE_UINT32 max_at_; - - /// The sum of all the values - ACE_UINT64 sum_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Basic_Stats.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_BASIC_STATS_H */ - diff --git a/dep/include/ace/Basic_Stats.inl b/dep/include/ace/Basic_Stats.inl deleted file mode 100644 index e2f153884e3..00000000000 --- a/dep/include/ace/Basic_Stats.inl +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id: Basic_Stats.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Basic_Stats::ACE_Basic_Stats (void) - : samples_count_ (0) - , min_ (0) - , min_at_ (0) - , max_ (0) - , max_at_ (0) - , sum_ (0) -{ -} - -ACE_INLINE ACE_UINT32 -ACE_Basic_Stats::samples_count (void) const -{ - return this->samples_count_; -} - -ACE_INLINE void -ACE_Basic_Stats::sample (ACE_UINT64 value) -{ - ++this->samples_count_; - - if (this->samples_count_ == 1u) - { - this->min_ = value; - this->min_at_ = this->samples_count_; - this->max_ = value; - this->max_at_ = this->samples_count_; - } - else - { - if (this->min_ > value) - { - this->min_ = value; - this->min_at_ = this->samples_count_; - } - if (this->max_ < value) - { - this->max_ = value; - this->max_at_ = this->samples_count_; - } - } - - this->sum_ += value; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Basic_Types.h b/dep/include/ace/Basic_Types.h deleted file mode 100644 index eb080e4975e..00000000000 --- a/dep/include/ace/Basic_Types.h +++ /dev/null @@ -1,888 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Basic_Types.h - * - * $Id: Basic_Types.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author David L. Levine - * - * #defines the list of preprocessor macros below. The config.h file can - * pre-define any of these to short-cut the definitions. This is usually - * only necessary if the preprocessor does all of its math using integers. - * - * Sizes of built-in types: - * - ACE_SIZEOF_CHAR - * - ACE_SIZEOF_WCHAR - * - ACE_SIZEOF_SHORT - * - ACE_SIZEOF_INT - * - ACE_SIZEOF_LONG - * - ACE_SIZEOF_LONG_LONG - * - ACE_SIZEOF_VOID_P - * - ACE_SIZEOF_FLOAT - * - ACE_SIZEOF_DOUBLE - * - ACE_SIZEOF_LONG_DOUBLE - * - * Wrappers for built-in types of specific sizes: - * - ACE_USHORT16 (For backward compatibility. Use ACE_UINT16 instead.) - * - ACE_INT8 - * - ACE_UINT8 - * - ACE_INT16 - * - ACE_UINT16 - * - ACE_INT32 - * - ACE_UINT32 - * - ACE_UINT64 - * (@note ACE_INT64 is partly defined, there is no ACE_LongLong for - * platforms that don't have a native 8-byte integer type.) - * - * Byte-order (endian-ness) determination: - * ACE_BYTE_ORDER, to either ACE_BIG_ENDIAN or ACE_LITTLE_ENDIAN - * - * - */ -//============================================================================= - -#include "ace/config-lite.h" - -#ifndef ACE_BASIC_TYPES_H -# define ACE_BASIC_TYPES_H - -# include /**/ "ace/pre.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Pull in definitions -# include "ace/os_include/os_limits.h" // Integer limits -# include "ace/os_include/os_float.h" // Floating point limits -# include "ace/os_include/os_stdlib.h" // Other types -# include "ace/os_include/os_stddef.h" // Get ptrdiff_t - see further comments below - -# if defined(ACE_LACKS_LONGLONG_T) -# include "ace/os_include/os_stdio.h" // For long long emulation -# endif /* ACE_LACKS_LONGLONG_T */ - -# include "ace/os_include/sys/os_types.h" - -# if !defined (ACE_LACKS_SYS_PARAM_H) -# include /**/ -# endif /* ACE_LACKS_SYS_PARAM_H */ - -# include "ace/ACE_export.h" - -# if !defined (ACE_LACKS_STDINT_H) -# include -# endif -# if !defined (ACE_LACKS_INTTYPES_H) -# include -# endif - -#ifdef ACE_LACKS_INTPTR_T -# include "ace/If_Then_Else.h" - -// This intptr_t typedef is here instead of -// since it depends on the template -// metaprogramming in . - -// We could compare ACE_SIZEOF_VOID_P against ACE_SIZEOF_LONG, etc. -// However, that depends on the ACE preprocessor symbol definitions in -// the platform-specific configuration header being correct. -// The template meta-programming approach we take below, -// i.e. determining the type at compile-time rather than at -// preprocessing-time, will work for all platforms, and does not -// depend on ACE developer-defined configuration parameters. - -typedef ACE::If_Then_Else< - (sizeof (void*) == sizeof (signed int)), - signed int, - ACE::If_Then_Else< - (sizeof (void*) == sizeof (signed long)), - signed long, -#ifdef ACE_LACKS_LONGLONG_T - void /* Unknown. Force an invalid type */ -#else - ACE::If_Then_Else< - (sizeof (void*) == sizeof (signed long long)), - signed long long, - void /* Unknown. Force an invalid type */ - >::result_type -#endif /* ACE_LACKS_LONGLONG_T */ - >::result_type - >::result_type intptr_t; - -typedef ACE::If_Then_Else< - (sizeof (void*) == sizeof (unsigned int)), - unsigned int, - ACE::If_Then_Else< - (sizeof (void*) == sizeof (unsigned long)), - unsigned long, -#ifdef ACE_LACKS_UNSIGNEDLONGLONG_T - void /* Unknown. Force an invalid type */ -#else - ACE::If_Then_Else< - (sizeof (void*) == sizeof (unsigned long long)), - unsigned long long, - void /* Unknown. Force an invalid type */ - >::result_type -#endif /* ACE_LACKS_UNSIGNEDLONGLONG_T */ - >::result_type - >::result_type uintptr_t; - -#endif /* ACE_LACKS_INTPTR_T */ - -// A char always has 1 byte, by definition. -# define ACE_SIZEOF_CHAR 1 - -// Unfortunately, there isn't a portable way to determine the size of a wchar. -// So we just define them on a platform basis. If the platform doesn't -// define it and it's an XPG4 system, assume wchar_t is 4 bytes. Some code -// uses ACE_SIZEOF_WCHAR in preprocessor statements, so sizeof() isn't valid. -// If the platform config doesn't set this, and this guess is wrong, -// Basic_Types_Test should catch the inconsistency. -# if defined (ACE_HAS_WCHAR) -# if !defined (ACE_SIZEOF_WCHAR) -# if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) -# define ACE_SIZEOF_WCHAR 4 -# else -// 0 so the Basic_Types test will catch this. -# define ACE_SIZEOF_WCHAR 0 -# endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */ -# endif /* !ACE_SIZEOF_WCHAR */ -# endif /* ACE_HAS_WCHAR */ - -// The number of bytes in a short. -# if !defined (ACE_SIZEOF_SHORT) -# if (USHRT_MAX) == 255U -# define ACE_SIZEOF_SHORT 1 -# elif (USHRT_MAX) == 65535U -# define ACE_SIZEOF_SHORT 2 -# elif (USHRT_MAX) == 4294967295U -# define ACE_SIZEOF_SHORT 4 -# elif (USHRT_MAX) == 18446744073709551615U -# define ACE_SIZEOF_SHORT 8 -# else -# error: unsupported short size, must be updated for this platform! -# endif /* USHRT_MAX */ -# endif /* !defined (ACE_SIZEOF_SHORT) */ - -// The number of bytes in an int. -# if !defined (ACE_SIZEOF_INT) -# if (UINT_MAX) == 65535U -# define ACE_SIZEOF_INT 2 -# elif (UINT_MAX) == 4294967295U -# define ACE_SIZEOF_INT 4 -# elif (UINT_MAX) == 18446744073709551615U -# define ACE_SIZEOF_INT 8 -# else -# error: unsupported int size, must be updated for this platform! -# endif /* UINT_MAX */ -# endif /* !defined (ACE_SIZEOF_INT) */ - -// The number of bytes in a long. -# if !defined (ACE_SIZEOF_LONG) -# if (ULONG_MAX) == 65535UL -# define ACE_SIZEOF_LONG 2 -# elif ((ULONG_MAX) == 4294967295UL) -# define ACE_SIZEOF_LONG 4 -# elif ((ULONG_MAX) == 18446744073709551615UL) -# define ACE_SIZEOF_LONG 8 -# else -# error: unsupported long size, must be updated for this platform! -# endif /* ULONG_MAX */ -# endif /* !defined (ACE_SIZEOF_LONG) */ - -// The number of bytes in a long long. -# if !defined (ACE_SIZEOF_LONG_LONG) -# if defined (ACE_LACKS_LONGLONG_T) -# define ACE_SIZEOF_LONG_LONG 8 -# elif defined (ULLONG_MAX) -# if ((ULLONG_MAX) == 4294967295ULL) -# define ACE_SIZEOF_LONG_LONG 4 -# elif ((ULLONG_MAX) == 18446744073709551615ULL) -# define ACE_SIZEOF_LONG_LONG 8 -# endif -# elif defined (ULONGLONG_MAX) -# if ((ULONGLONG_MAX) == 4294967295ULL) -# define ACE_SIZEOF_LONG_LONG 4 -# elif ((ULONGLONG_MAX) == 18446744073709551615ULL) -# define ACE_SIZEOF_LONG_LONG 8 -# endif -# endif -# // If we can't determine the size of long long, assume it is 8 -# // instead of erroring out. (Either ULLONG_MAX and ULONGLONG_MAX -# // may not be supported; or an extended C/C++ dialect may need to -# // be selected. If this assumption is wrong, it can be addressed -# // in the platform-specific config header. -# if !defined (ACE_SIZEOF_LONG_LONG) -# define ACE_SIZEOF_LONG_LONG 8 -# endif -# endif /* !defined (ACE_SIZEOF_LONG_LONG) */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The sizes of the commonly implemented types are now known. Set up -// typedefs for whatever we can. Some of these are needed for certain -// cases of ACE_UINT64, so do them before the 64-bit stuff. - -#if defined (ACE_INT8_TYPE) - typedef ACE_INT8_TYPE ACE_INT8; -#elif defined (ACE_HAS_INT8_T) - typedef int8_t ACE_INT8; -#elif !defined (ACE_LACKS_SIGNED_CHAR) - typedef signed char ACE_INT8; -#else - typedef char ACE_INT8; -#endif /* defined (ACE_INT8_TYPE) */ - -#if defined (ACE_UINT8_TYPE) - typedef ACE_UINT8_TYPE ACE_UINT8; -#elif defined (ACE_HAS_UINT8_T) - typedef uint8_t ACE_UINT8; -#else - typedef unsigned char ACE_UINT8; -#endif /* defined (ACE_UINT8_TYPE) */ - -#if defined (ACE_INT16_TYPE) - typedef ACE_INT16_TYPE ACE_INT16; -#elif defined (ACE_HAS_INT16_T) - typedef int16_t ACE_INT16; -#elif ACE_SIZEOF_SHORT == 2 - typedef short ACE_INT16; -#elif ACE_SIZEOF_INT == 2 - typedef int ACE_INT16; -#else -# error Have to add to the ACE_INT16 type setting -#endif /* defined (ACE_INT16_TYPE) */ - -#if defined (ACE_UINT16_TYPE) - typedef ACE_UINT16_TYPE ACE_UINT16; -#elif defined (ACE_HAS_UINT16_T) - typedef uint16_t ACE_UINT16; -#elif ACE_SIZEOF_SHORT == 2 - typedef unsigned short ACE_UINT16; -#elif ACE_SIZEOF_INT == 2 - typedef unsigned int ACE_UINT16; -#else -# error Have to add to the ACE_UINT16 type setting -#endif /* defined (ACE_UINT16_TYPE) */ - -#if defined (ACE_INT32_TYPE) - typedef ACE_INT32_TYPE ACE_INT32; -#elif defined (ACE_HAS_INT32_T) - typedef int32_t ACE_INT32; -#elif ACE_SIZEOF_INT == 4 - typedef int ACE_INT32; -#elif ACE_SIZEOF_LONG == 4 - typedef long ACE_INT32; -#else -# error Have to add to the ACE_INT32 type setting -#endif /* defined (ACE_INT32_TYPE) */ - -#if defined (ACE_UINT32_TYPE) - typedef ACE_UINT32_TYPE ACE_UINT32; -#elif defined (ACE_HAS_UINT32_T) - typedef uint32_t ACE_UINT32; -#elif ACE_SIZEOF_INT == 4 - typedef unsigned int ACE_UINT32; -#elif ACE_SIZEOF_LONG == 4 - typedef unsigned long ACE_UINT32; -#else -# error Have to add to the ACE_UINT32 type setting -#endif /* defined (ACE_UINT32_TYPE) */ - -#if defined (ACE_INT64_TYPE) - typedef ACE_INT64_TYPE ACE_INT64; -#elif defined (ACE_HAS_INT64_T) - typedef int64_t ACE_INT64; -#elif ACE_SIZEOF_LONG == 8 - typedef long ACE_INT64; -#elif !defined (ACE_LACKS_LONGLONG_T) && ACE_SIZEOF_LONG_LONG == 8 -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - typedef long long ACE_INT64; -#endif /* defined (ACE_INT64_TYPE) */ - -#if !(defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)) -/* See matching #if around ACE_U_LongLong class declaration below */ - -# if defined (ACE_UINT64_TYPE) - typedef ACE_UINT64_TYPE ACE_UINT64; -# elif defined (ACE_HAS_UINT64_T) - typedef uint64_t ACE_UINT64; -# elif ACE_SIZEOF_LONG == 8 - typedef unsigned long ACE_UINT64; -# elif ACE_SIZEOF_LONG_LONG == 8 -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - typedef unsigned long long ACE_UINT64; -# endif /* defined (ACE_UINT64_TYPE) */ -#endif /* !(ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T) */ - -typedef ACE_UINT16 ACE_USHORT16; // @@ Backward compatibility. - -// Define a generic byte for use in codecs -typedef unsigned char ACE_Byte; - -// Define a pseudo wide character type when wchar is not supported so we -// can support basic wide character string operations. - -# if defined (ACE_HAS_WCHAR) || defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) -# define ACE_WINT_T wint_t -# define ACE_WCHAR_T wchar_t -# else -# define ACE_WINT_T ACE_UINT16 -# define ACE_WCHAR_T ACE_UINT16 -# endif /* ACE_HAS_WCHAR */ - -// The number of bytes in a void *. -# ifndef ACE_SIZEOF_VOID_P -# define ACE_SIZEOF_VOID_P ACE_SIZEOF_LONG -# endif /* ACE_SIZEOF_VOID_P */ - -// Type for doing arithmetic on pointers ... as elsewhere, we assume -// that unsigned versions of a type are the same size as the signed -// version of the same type. -# if defined (ACE_HAS_WINCE) && (_WIN32_WCE < 400) -typedef unsigned long ptrdiff_t; // evc3, PocketPC don't defined ptrdiff_t -# endif - -ACE_END_VERSIONED_NAMESPACE_DECL - -// Byte-order (endian-ness) determination. -# if defined (BYTE_ORDER) -# if (BYTE_ORDER == LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (BYTE_ORDER == BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown BYTE_ORDER! -# endif /* BYTE_ORDER */ -# elif defined (_BYTE_ORDER) -# if (_BYTE_ORDER == _LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (_BYTE_ORDER == _BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown _BYTE_ORDER! -# endif /* _BYTE_ORDER */ -# elif defined (__BYTE_ORDER) -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown __BYTE_ORDER! -# endif /* __BYTE_ORDER */ -# else /* ! BYTE_ORDER && ! __BYTE_ORDER */ - // We weren't explicitly told, so we have to figure it out . . . -# if defined (i386) || defined (__i386__) || defined (_M_IX86) || \ - defined (vax) || defined (__alpha) || defined (__LITTLE_ENDIAN__) || \ - defined (ARM) || defined (_M_IA64) || defined (__ia64__) || \ - defined (_M_AMD64) || defined (__amd64) - // We know these are little endian. -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# else - // Otherwise, we assume big endian. -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# endif -# endif /* ! BYTE_ORDER && ! __BYTE_ORDER */ - -// Byte swapping macros to deal with differences between little endian -// and big endian machines. Note that "long" here refers to 32 bit -// quantities. -# define ACE_SWAP_LONG(L) ((ACE_SWAP_WORD ((L) & 0xFFFF) << 16) \ - | ACE_SWAP_WORD(((L) >> 16) & 0xFFFF)) -# define ACE_SWAP_WORD(L) ((((L) & 0x00FF) << 8) | (((L) & 0xFF00) >> 8)) - -# if defined (ACE_LITTLE_ENDIAN) -# define ACE_HTONL(X) ACE_SWAP_LONG (X) -# define ACE_NTOHL(X) ACE_SWAP_LONG (X) -# define ACE_IDL_NCTOHL(X) (X) -# define ACE_IDL_NSTOHL(X) (X) -# else -# define ACE_HTONL(X) X -# define ACE_NTOHL(X) X -# define ACE_IDL_NCTOHL(X) (X << 24) -# define ACE_IDL_NSTOHL(X) ((X) << 16) -# endif /* ACE_LITTLE_ENDIAN */ - -# if defined (ACE_LITTLE_ENDIAN) -# define ACE_HTONS(x) ACE_SWAP_WORD(x) -# define ACE_NTOHS(x) ACE_SWAP_WORD(x) -# else -# define ACE_HTONS(x) x -# define ACE_NTOHS(x) x -# endif /* ACE_LITTLE_ENDIAN */ - -#if defined (ACE_LACKS_LONGLONG_T) - // This throws away the high 32 bits. It's very unlikely that a - // pointer will be more than 32 bits wide if the platform does not - // support 64-bit integers. -# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ - reinterpret_cast (L.lo ()) -#elif defined (ACE_OPENVMS) && (!defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64)) -# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ - reinterpret_cast (static_cast (L)) -#else /* ! ACE_LACKS_LONGLONG_T */ -# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ - reinterpret_cast (static_cast (L)) -#endif /* ! ACE_LACKS_LONGLONG_T */ - -// If the platform lacks an unsigned long long, define one. -#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -// Forward declaration for streams -# include "ace/iosfwd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_U_LongLong - * - * @brief Unsigned long long for platforms that don't have one. - * - * Provide our own unsigned long long. This is intended to be - * use with ACE_High_Res_Timer, so the division operator assumes - * that the quotient fits into a u_long. - * Please note that the constructor takes (optionally) two values. - * The high one contributes 0x100000000 times its value. So, - * for example, (0, 2) is _not_ 20000000000, but instead - * 0x200000000. To emphasize this, the default values are expressed - * in hex, and output () dumps the value in hex. - */ - class ACE_Export ACE_U_LongLong - { - public: - // = Initialization and termination methods. -#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - ACE_U_LongLong (const long long value = 0x0); -#else - ACE_U_LongLong (const ACE_UINT32 lo = 0x0, const ACE_UINT32 hi = 0x0); -#endif - ACE_U_LongLong (const ACE_U_LongLong &); - ACE_U_LongLong &operator= (const ACE_U_LongLong &); - ACE_U_LongLong &operator= (const ACE_INT32 &); - ACE_U_LongLong &operator= (const ACE_UINT32 &); - ~ACE_U_LongLong (void); - - // = Overloaded relation operators. - bool operator== (const ACE_U_LongLong &) const; - bool operator== (const ACE_UINT32) const; - bool operator!= (const ACE_U_LongLong &) const; - bool operator!= (const ACE_UINT32) const; - bool operator< (const ACE_U_LongLong &) const; - bool operator< (const ACE_UINT32) const; - bool operator<= (const ACE_U_LongLong &) const; - bool operator<= (const ACE_UINT32) const; - bool operator> (const ACE_U_LongLong &) const; - bool operator> (const ACE_UINT32) const; - bool operator>= (const ACE_U_LongLong &) const; - bool operator>= (const ACE_UINT32) const; - - ACE_U_LongLong operator+ (const ACE_U_LongLong &) const; - ACE_U_LongLong operator+ (const ACE_UINT32) const; - ACE_U_LongLong operator- (const ACE_U_LongLong &) const; - ACE_U_LongLong operator- (const ACE_UINT32) const; - ACE_U_LongLong operator* (const ACE_UINT32) const; - ACE_U_LongLong &operator*= (const ACE_UINT32); - - ACE_U_LongLong operator<< (const unsigned int) const; - ACE_U_LongLong &operator<<= (const unsigned int); - ACE_U_LongLong operator>> (const unsigned int) const; - ACE_U_LongLong &operator>>= (const unsigned int); - - double operator/ (const double) const; - - ACE_U_LongLong &operator+= (const ACE_U_LongLong &); - ACE_U_LongLong &operator+= (const ACE_UINT32); - ACE_U_LongLong &operator-= (const ACE_U_LongLong &); - ACE_U_LongLong &operator-= (const ACE_UINT32); - ACE_U_LongLong &operator++ (); - ACE_U_LongLong &operator-- (); - const ACE_U_LongLong operator++ (int); - const ACE_U_LongLong operator-- (int); - ACE_U_LongLong &operator|= (const ACE_U_LongLong); - ACE_U_LongLong &operator|= (const ACE_UINT32); - ACE_U_LongLong &operator&= (const ACE_U_LongLong); - ACE_U_LongLong &operator&= (const ACE_UINT32); - - // Note that the following take ACE_UINT32 arguments. These are - // typical use cases, and easy to implement. But, they limit the - // return values to 32 bits as well. There are no checks for - // overflow. - ACE_UINT32 operator/ (const ACE_UINT32) const; - ACE_UINT32 operator% (const ACE_UINT32) const; - - // The following only operate on the lower 32 bits (they take only - // 32 bit arguments). - ACE_UINT32 operator| (const ACE_INT32) const; - ACE_UINT32 operator& (const ACE_INT32) const; - - // The following operators convert their arguments to - // ACE_UINT32. So, there may be information loss if they are - // used. - ACE_U_LongLong operator* (const ACE_INT32) const; - ACE_U_LongLong &operator*= (const ACE_INT32); - ACE_UINT32 operator/ (const ACE_INT32) const; -# if ACE_SIZEOF_INT == 4 - ACE_UINT32 operator/ (const unsigned long) const; - ACE_UINT32 operator/ (const long) const; -# else /* ACE_SIZEOF_INT != 4 */ - ACE_UINT32 operator/ (const unsigned int) const; - ACE_UINT32 operator/ (const int) const; -# endif /* ACE_SIZEOF_INT != 4 */ - - // = Helper methods. - /// Outputs the value to the FILE, in hex. - void output (FILE * = stdout) const; - - ACE_TCHAR *as_string (ACE_TCHAR *string, - unsigned int base = 10, - unsigned int uppercase = 0) const; - - ACE_UINT32 hi (void) const; - ACE_UINT32 lo (void) const; - - void hi (const ACE_UINT32 hi); - void lo (const ACE_UINT32 lo); - -#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - long long to_int64 (void) const; -# endif - - private: - -#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - long long data_; -#else - public: - struct ace_hi_lo_correct_endian - { -# if defined (ACE_BIG_ENDIAN) - /// High 32 bits. - ACE_UINT32 hi_; - /// Low 32 bits. - ACE_UINT32 lo_; - -# else - - /// Low 32 bits. - ACE_UINT32 lo_; - /// High 32 bits. - ACE_UINT32 hi_; -# endif /* ! ACE_BIG_ENDIAN */ - }; - private: - union - { - struct ace_hi_lo_correct_endian data_; - - /// To ensure alignment on 8-byte boundary. - double for_alignment_; - }; - - // @note the following four accessors are inlined here in - // order to minimize the extent of the data_ struct. It's - // only used here; the .i and .cpp files use the accessors. - - /// Internal utility function to hide access through struct. - const ACE_UINT32 &h_ () const { return data_.hi_; } - - /// Internal utility function to hide access through struct. - ACE_UINT32 &h_ () { return data_.hi_; } - - /// Internal utility function to hide access through struct. - const ACE_UINT32 &l_ () const { return data_.lo_; } - - /// Internal utility function to hide access through struct. - ACE_UINT32 &l_ () { return data_.lo_; } - - // @note the above four accessors are inlined here in - // order to minimize the extent of the data_ struct. It's - // only used here; the .inl and .cpp files use the accessors. - - /// These functions are used to implement multiplication. - ACE_UINT32 ul_shift (ACE_UINT32 a, - ACE_UINT32 c_in, - ACE_UINT32 *c_out) const; - ACE_U_LongLong ull_shift (ACE_U_LongLong a, - ACE_UINT32 c_in, - ACE_UINT32 *c_out) const; - ACE_U_LongLong ull_add (ACE_U_LongLong a, - ACE_U_LongLong b, - ACE_UINT32 *carry) const; - ACE_U_LongLong ull_mult (ACE_U_LongLong a, - ACE_UINT32 b, - ACE_UINT32 *carry) const; -#endif // ACE_LACKS_UNSIGNEDLONGLONG_T - }; - - typedef ACE_U_LongLong ACE_UINT64; - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) - ostream &operator<< (ostream &, const ACE_U_LongLong &); -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -# endif /* ACE_LACKS_LONGLONG_T */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Conversions from ACE_UINT64 to ACE_UINT32. ACE_CU64_TO_CU32 should -// be used on const ACE_UINT64's. -# if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -inline ACE_UINT32 -ACE_U64_TO_U32 (ACE_U_LongLong const & n) -{ - /** - * @note We could add a cast operator to ACE_U_LongLong but that may - * cause more problems than it solves. Force users to perform - * an explicit cast via ACE_{C}U64_TO_{C}U32. - */ - return n.lo (); -} - -inline ACE_UINT32 -ACE_CU64_TO_CU32 (ACE_U_LongLong const & n) -{ - return ACE_U64_TO_U32 (n); -} -# else /* ! ACE_LACKS_LONGLONG_T */ -inline ACE_UINT32 -ACE_U64_TO_U32 (ACE_UINT64 n) -{ - return static_cast (n); -} - -inline ACE_UINT32 -ACE_CU64_TO_CU32 (ACE_UINT64 n) -{ - return static_cast (n); -} -# endif /* ! ACE_LACKS_LONGLONG_T */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -// 64-bit literals require special marking on some platforms. -# if defined (ACE_LACKS_LONGLONG_T) - // Can only specify 32-bit arguments. -# define ACE_UINT64_LITERAL(n) n ## UL - // This one won't really work, but it'll keep - // some compilers happy until we have better support -# define ACE_INT64_LITERAL(n) n ## L -# elif defined (ACE_WIN32) -# if defined (__MINGW32__) -# define ACE_UINT64_LITERAL(n) n ## ull -# define ACE_INT64_LITERAL(n) n ## ll -# else -# define ACE_UINT64_LITERAL(n) n ## ui64 -# define ACE_INT64_LITERAL(n) n ## i64 -# endif /* defined (__MINGW32__) */ -# elif defined (__TANDEM) -# define ACE_UINT64_LITERAL(n) n ## LL -# define ACE_INT64_LITERAL(n) n ## LL -# else /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ -# define ACE_UINT64_LITERAL(n) n ## ull -# define ACE_INT64_LITERAL(n) n ## ll -# endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ - -#if !defined (ACE_INT8_FORMAT_SPECIFIER) -# if defined (PRId8) -# define ACE_INT8_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRId8) -# else -# define ACE_INT8_FORMAT_SPECIFIER ACE_TEXT ("%d") -# endif /* defined (PRId8) */ -#endif /* ACE_INT8_FORMAT_SPECIFIER */ - -#if !defined (ACE_UINT8_FORMAT_SPECIFIER) -# if defined (PRIu8) -# define ACE_UINT8_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRIu8) -# else -# define ACE_UINT8_FORMAT_SPECIFIER ACE_TEXT ("%u") -# endif /* defined (PRIu8) */ -#endif /* ACE_UINT8_FORMAT_SPECIFIER */ - -#if !defined (ACE_INT16_FORMAT_SPECIFIER) -# if defined (PRId16) -# define ACE_INT16_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRId16) -# else -# define ACE_INT16_FORMAT_SPECIFIER ACE_TEXT ("%d") -# endif /* defined (PRId16) */ -#endif /* ACE_INT16_FORMAT_SPECIFIER */ - -#if !defined (ACE_UINT16_FORMAT_SPECIFIER) -# if defined (PRIu16) -# define ACE_UINT16_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRIu16) -# else -# define ACE_UINT16_FORMAT_SPECIFIER ACE_TEXT ("%u") -# endif /* defined (PRIu16) */ -#endif /* ACE_UINT16_FORMAT_SPECIFIER */ - -#if !defined (ACE_INT32_FORMAT_SPECIFIER) -# if defined (PRId32) -# define ACE_INT32_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRId32) -# elif ACE_SIZEOF_INT == 4 -# define ACE_INT32_FORMAT_SPECIFIER ACE_TEXT ("%d") -# else -# define ACE_INT32_FORMAT_SPECIFIER ACE_TEXT ("%ld") -# endif /* defined (PRId32) */ -#endif /* ACE_INT32_FORMAT_SPECIFIER */ - -#if !defined (ACE_UINT32_FORMAT_SPECIFIER) -# if defined (PRIu32) -# define ACE_UINT32_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRIu32) -# elif ACE_SIZEOF_INT == 4 -# define ACE_UINT32_FORMAT_SPECIFIER ACE_TEXT ("%u") -# else -# define ACE_UINT32_FORMAT_SPECIFIER ACE_TEXT ("%lu") -# endif /* defined (PRIu32) */ -#endif /* ACE_UINT32_FORMAT_SPECIFIER */ - -#if !defined (ACE_INT64_FORMAT_SPECIFIER) -# if defined (PRId64) -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRId64) -# elif ACE_SIZEOF_LONG == 8 -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%ld") -# else -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%lld") -# endif /* defined (PRId64) */ -#endif /* ACE_INT64_FORMAT_SPECIFIER */ - -#if !defined (ACE_UINT64_FORMAT_SPECIFIER) -# if defined (PRIu64) -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRIu64) -# elif ACE_SIZEOF_LONG == 8 -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%lu") -# else -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%llu") -# endif /* defined (PRIu64) */ -#endif /* ACE_UINT64_FORMAT_SPECIFIER */ - -#if !defined (ACE_SSIZE_T_FORMAT_SPECIFIER) -# if defined (ACE_WIN64) -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -# else -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%d") -# endif /* ACE_WIN64 */ -#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER */ - -#if !defined (ACE_SIZE_T_FORMAT_SPECIFIER) -# if defined (ACE_WIN64) -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%I64u") -# else -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%u") -# endif /* ACE_WIN64 */ -#endif /* ACE_SIZE_T_FORMAT_SPECIFIER */ - -// Cast from UINT64 to a double requires an intermediate cast to INT64 -// on some platforms. -# if defined (ACE_LACKS_LONGLONG_T) - // Only use the low 32 bits. -# define ACE_UINT64_DBLCAST_ADAPTER(n) ACE_U64_TO_U32 (n) -# elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -# define ACE_UINT64_DBLCAST_ADAPTER(n) ((n).to_int64 ()) -# elif defined (ACE_WIN32) -# define ACE_UINT64_DBLCAST_ADAPTER(n) static_cast<__int64> (n) -# else /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ -# define ACE_UINT64_DBLCAST_ADAPTER(n) (n) -# endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ - -// The number of bytes in a float. -# ifndef ACE_SIZEOF_FLOAT -# if FLT_MAX_EXP == 128 -# define ACE_SIZEOF_FLOAT 4 -# elif FLT_MAX_EXP == 1024 -# define ACE_SIZEOF_FLOAT 8 -# else -# error: unsupported float size, must be updated for this platform! -# endif /* FLT_MAX_EXP */ -# endif /* ACE_SIZEOF_FLOAT */ - -// The number of bytes in a double. -# ifndef ACE_SIZEOF_DOUBLE -# if DBL_MAX_EXP == 128 -# define ACE_SIZEOF_DOUBLE 4 -# elif DBL_MAX_EXP == 1024 -# define ACE_SIZEOF_DOUBLE 8 -# else -# error: unsupported double size, must be updated for this platform! -# endif /* DBL_MAX_EXP */ -# endif /* ACE_SIZEOF_DOUBLE */ - -// The number of bytes in a long double. -# ifndef ACE_SIZEOF_LONG_DOUBLE -# if LDBL_MAX_EXP == 128 -# define ACE_SIZEOF_LONG_DOUBLE 4 -# elif LDBL_MAX_EXP == 1024 -# define ACE_SIZEOF_LONG_DOUBLE 8 -# elif LDBL_MAX_EXP == 16384 -# if defined (LDBL_DIG) && LDBL_DIG == 18 -# if defined (__ia64) || defined (__x86_64) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# else /* ! __ia64 */ -# define ACE_SIZEOF_LONG_DOUBLE 12 -# endif /* __ia64 */ -# else /* ! LDBL_DIG || LDBL_DIG != 18 */ -# define ACE_SIZEOF_LONG_DOUBLE 16 -# endif /* ! LDBL_DIG || LDBL_DIG != 18 */ -# else -# error: unsupported double size, must be updated for this platform! -# endif /* LDBL_MAX_EXP */ -# endif /* ACE_SIZEOF_LONG_DOUBLE */ - -// Max and min sizes for the ACE integer types. -#define ACE_CHAR_MAX 0x7F -#define ACE_CHAR_MIN -(ACE_CHAR_MAX)-1 -#define ACE_OCTET_MAX 0xFF -#define ACE_INT16_MAX 0x7FFF -#define ACE_INT16_MIN -(ACE_INT16_MAX)-1 -#define ACE_UINT16_MAX 0xFFFF -#define ACE_WCHAR_MAX ACE_UINT16_MAX -#define ACE_INT32_MAX 0x7FFFFFFF -#define ACE_INT32_MIN -(ACE_INT32_MAX)-1 -#define ACE_UINT32_MAX 0xFFFFFFFF -#define ACE_INT64_MAX ACE_INT64_LITERAL(0x7FFFFFFFFFFFFFFF) -#define ACE_INT64_MIN -(ACE_INT64_MAX)-1 - -#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -// ACE_U_LongLong's constructor accepts a "long long" in this -// case. Set it to ACE_U_LongLong (-1) since the bit pattern for long -// long (-1) is the same as the maximum unsigned long long value. -# define ACE_UINT64_MAX ACE_U_LongLong (ACE_INT64_LITERAL (0xFFFFFFFFFFFFFFFF)) -#elif defined (ACE_LACKS_LONGLONG_T) -// ACE_U_LongLong's constructor accepts an ACE_UINT32 low and high -// pair of parameters. -# define ACE_UINT64_MAX ACE_U_LongLong (0xFFFFFFFFu, 0xFFFFFFFFu) -#else -# define ACE_UINT64_MAX ACE_UINT64_LITERAL (0xFFFFFFFFFFFFFFFF) -#endif /* ACE_LACKS_UNSIGNEDLONGLONG_T */ - -// These use ANSI/IEEE format. -#define ACE_FLT_MAX 3.402823466e+38F -#define ACE_FLT_MIN 1.175494351e-38F -#define ACE_DBL_MAX 1.7976931348623158e+308 -#define ACE_DBL_MIN 2.2250738585072014e-308 - -# if defined (__ACE_INLINE__) -# include "ace/Basic_Types.inl" -# endif /* __ACE_INLINE__ */ - -# include /**/ "ace/post.h" -#endif /* ACE_BASIC_TYPES_H */ - diff --git a/dep/include/ace/Basic_Types.inl b/dep/include/ace/Basic_Types.inl deleted file mode 100644 index 19cc7579b82..00000000000 --- a/dep/include/ace/Basic_Types.inl +++ /dev/null @@ -1,952 +0,0 @@ -// -*- C++ -*- -// -// $Id: Basic_Types.inl 80826 2008-03-04 14:51:23Z wotte $ - -# if !defined (ACE_LACKS_LONGLONG_T) && defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Implementation for ACE_U_LongLong when we have signed long long -// but no unsigned long long. - -ACE_INLINE -ACE_U_LongLong::ACE_U_LongLong (const long long value) - : data_ (value) -{ -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::hi (void) const -{ - return (data_ >> 32) & 0xFFFFFFFF; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::lo (void) const -{ - return data_ & 0xFFFFFFFF; -} - -ACE_INLINE void -ACE_U_LongLong::hi (const ACE_UINT32 hi) -{ - data_ = hi; - data_ <<= 32; -} - -ACE_INLINE void -ACE_U_LongLong::lo (const ACE_UINT32 lo) -{ - data_ = lo; -} - -ACE_INLINE long long -ACE_U_LongLong::to_int64 (void) const -{ - return data_; -} - -ACE_INLINE -ACE_U_LongLong::~ACE_U_LongLong (void) -{ -} - -ACE_INLINE bool -ACE_U_LongLong::operator== (const ACE_U_LongLong &n) const -{ - return data_ == n.data_; -} - -ACE_INLINE bool -ACE_U_LongLong::operator== (const ACE_UINT32 n) const -{ - return data_ == n; -} - -ACE_INLINE bool -ACE_U_LongLong::operator!= (const ACE_U_LongLong &n) const -{ - return ! (*this == n); -} - -ACE_INLINE bool -ACE_U_LongLong::operator!= (const ACE_UINT32 n) const -{ - return ! (*this == n); -} - -ACE_INLINE bool -ACE_U_LongLong::operator< (const ACE_U_LongLong &n) const -{ - if (data_ > 0) - if (n.data_ > 0) - return data_ < n.data_; - else - return true; - else - if (n.data_ > 0) - return false; - else - return data_ < n.data_; -} - -ACE_INLINE bool -ACE_U_LongLong::operator< (const ACE_UINT32 n) const -{ - return operator< (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator<= (const ACE_U_LongLong &n) const -{ - if (data_ == n.data_) return true; - - return data_ < n.data_; -} - -ACE_INLINE bool -ACE_U_LongLong::operator<= (const ACE_UINT32 n) const -{ - return operator<= (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator> (const ACE_U_LongLong &n) const -{ - if (data_ > 0) - if (n.data_ > 0) - return data_ > n.data_; - else - return false; - else - if (n.data_ > 0) - return true; - else - return data_ > n.data_; -} - -ACE_INLINE bool -ACE_U_LongLong::operator> (const ACE_UINT32 n) const -{ - return operator> (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator>= (const ACE_U_LongLong &n) const -{ - if (data_ == n.data_) return true; - - return data_ > n.data_; -} - -ACE_INLINE bool -ACE_U_LongLong::operator>= (const ACE_UINT32 n) const -{ - return operator>= (static_cast (n)); -} - -ACE_INLINE -ACE_U_LongLong::ACE_U_LongLong (const ACE_U_LongLong &n) - : data_ (n.data_) -{ -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_U_LongLong &n) -{ - data_ = n.data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_INT32 &rhs) -{ - if (rhs >= 0) - { - data_ = rhs; - data_ &= 0xFFFFFFFF; - } - else - { - // We do not handle the case where a negative 32 bit integer is - // assigned to this representation of a 64 bit unsigned integer. - // The "undefined behavior" behavior performed by this - // implementation is to simply set all bits to zero. - data_ = 0; - } - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_UINT32 &rhs) -{ - data_ = rhs; - - return *this; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const -{ - return data_ + n.data_; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator+ (const ACE_UINT32 n) const -{ - return operator+ (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator- (const ACE_U_LongLong &n) const -{ - return data_ - n.data_; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator- (const ACE_UINT32 n) const -{ - return operator- (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator<< (const u_int n) const -{ - return data_ << n; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator<<= (const u_int n) -{ - data_ <<= n; - - return *this; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator>> (const u_int n) const -{ - return data_ >> n; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator>>= (const u_int n) -{ - data_ >>= n; - - return *this; -} - -ACE_INLINE double -ACE_U_LongLong::operator/ (const double n) const -{ - return data_ / n; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator+= (const ACE_U_LongLong &n) -{ - data_ += n.data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator+= (const ACE_UINT32 n) -{ - return operator+= (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator* (const ACE_UINT32 n) const -{ - return data_ * n; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator*= (const ACE_UINT32 n) -{ - data_ *= n; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-= (const ACE_U_LongLong &n) -{ - data_ -= n.data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-= (const ACE_UINT32 n) -{ - return operator-= (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator++ () -{ - ++data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-- () -{ - --data_; - - return *this; -} - -ACE_INLINE const ACE_U_LongLong -ACE_U_LongLong::operator++ (int) -{ - // Post-increment operator should always be implemented in terms of - // the pre-increment operator to enforce consistent semantics. - ACE_U_LongLong temp (*this); - ++*this; - return temp; -} - -ACE_INLINE const ACE_U_LongLong -ACE_U_LongLong::operator-- (int) -{ - // Post-decrement operator should always be implemented in terms of - // the pre-decrement operator to enforce consistent semantics. - ACE_U_LongLong temp (*this); - --*this; - return temp; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator|= (const ACE_U_LongLong n) -{ - data_ |= n.data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator|= (const ACE_UINT32 n) -{ - return operator|= (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator&= (const ACE_U_LongLong n) -{ - data_ &= n.data_; - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator&= (const ACE_UINT32 n) -{ - return operator&= (static_cast (n)); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const ACE_UINT32 n) const -{ - return data_ / n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator% (const ACE_UINT32 n) const -{ - return data_ % n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator| (const ACE_INT32 n) const -{ - return data_ | n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator& (const ACE_INT32 n) const -{ - return data_ & n; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator* (const ACE_INT32 n) const -{ - return operator* ((ACE_UINT32) n); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator*= (const ACE_INT32 n) -{ - return operator*= ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const ACE_INT32 n) const -{ - return operator/ ((ACE_UINT32) n); -} - -#if ACE_SIZEOF_INT == 4 -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const u_long n) const -{ - return operator/ ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const long n) const -{ - return operator/ ((ACE_UINT32) n); -} - -#else /* ACE_SIZEOF_INT != 4 */ -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const u_int n) const -{ - return operator/ ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const int n) const -{ - return operator/ ((ACE_UINT32) n); -} -#endif - -ACE_END_VERSIONED_NAMESPACE_DECL - -#elif defined (ACE_LACKS_LONGLONG_T) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_U_LongLong::ACE_U_LongLong (const ACE_UINT32 lo, const ACE_UINT32 hi) -{ - h_ () = hi; - l_ () = lo; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::hi (void) const -{ - return h_ (); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::lo (void) const -{ - return l_ (); -} - -ACE_INLINE void -ACE_U_LongLong::hi (const ACE_UINT32 hi) -{ - h_ () = hi; -} - -ACE_INLINE void -ACE_U_LongLong::lo (const ACE_UINT32 lo) -{ - l_ () = lo; -} - -ACE_INLINE -ACE_U_LongLong::~ACE_U_LongLong (void) -{ -} - -ACE_INLINE bool -ACE_U_LongLong::operator== (const ACE_U_LongLong &n) const -{ - return h_ () == n.h_ () && l_ () == n.l_ (); -} - -ACE_INLINE bool -ACE_U_LongLong::operator== (const ACE_UINT32 n) const -{ - return h_ () == 0 && l_ () == n; -} - -ACE_INLINE bool -ACE_U_LongLong::operator!= (const ACE_U_LongLong &n) const -{ - return ! (*this == n); -} - -ACE_INLINE bool -ACE_U_LongLong::operator!= (const ACE_UINT32 n) const -{ - return ! (*this == n); -} - -ACE_INLINE bool -ACE_U_LongLong::operator< (const ACE_U_LongLong &n) const -{ - return h_ () < n.h_ () ? 1 - : h_ () > n.h_ () ? 0 - : l_ () < n.l_ (); -} - -ACE_INLINE bool -ACE_U_LongLong::operator< (const ACE_UINT32 n) const -{ - return operator< (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator<= (const ACE_U_LongLong &n) const -{ - return h_ () < n.h_ () ? 1 - : h_ () > n.h_ () ? 0 - : l_ () <= n.l_ (); -} - -ACE_INLINE bool -ACE_U_LongLong::operator<= (const ACE_UINT32 n) const -{ - return operator<= (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator> (const ACE_U_LongLong &n) const -{ - return h_ () > n.h_ () ? 1 - : h_ () < n.h_ () ? 0 - : l_ () > n.l_ (); -} - -ACE_INLINE bool -ACE_U_LongLong::operator> (const ACE_UINT32 n) const -{ - return operator> (static_cast (n)); -} - -ACE_INLINE bool -ACE_U_LongLong::operator>= (const ACE_U_LongLong &n) const -{ - return h_ () > n.h_ () ? 1 - : h_ () < n.h_ () ? 0 - : l_ () >= n.l_ (); -} - -ACE_INLINE bool -ACE_U_LongLong::operator>= (const ACE_UINT32 n) const -{ - return operator>= (static_cast (n)); -} - -ACE_INLINE -ACE_U_LongLong::ACE_U_LongLong (const ACE_U_LongLong &n) -{ - h_ () = n.h_ (); - l_ () = n.l_ (); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_U_LongLong &n) -{ - h_ () = n.h_ (); - l_ () = n.l_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_INT32 &rhs) -{ - if (rhs >= 0) - { - l_ () = static_cast (rhs); - h_ () = 0; - } - else - { - // We do not handle the case where a negative 32 bit integer is - // assigned to this representation of a 64 bit unsigned integer. - // The "undefined behavior" behavior performed by this - // implementation is to simply set all bits to zero. - l_ () = 0; - h_ () = 0; - } - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator= (const ACE_UINT32 &rhs) -{ - l_ () = rhs; - h_ () = 0; - - return *this; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const -{ - ACE_U_LongLong ret (l_ () + n.l_ (), h_ () + n.h_ ()); - if (ret.l_ () < n.l_ ()) /* carry */ ++ret.h_ (); - - return ret; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator+ (const ACE_UINT32 n) const -{ - return operator+ (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator- (const ACE_U_LongLong &n) const -{ - ACE_U_LongLong ret (l_ () - n.l_ (), h_ () - n.h_ ()); - if (l_ () < n.l_ ()) /* borrow */ --ret.h_ (); - - return ret; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator- (const ACE_UINT32 n) const -{ - return operator- (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator<< (const u_int n) const -{ - const ACE_UINT32 carry_mask = l_ () >> (32 - n); - ACE_U_LongLong ret (n < 32 ? l_ () << n : 0, - n < 32 ? (h_ () << n) | carry_mask : carry_mask); - - return ret; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator<<= (const u_int n) -{ - const ACE_UINT32 carry_mask = l_ () >> (32 - n); - h_ () = n < 32 ? (h_ () << n) | carry_mask : carry_mask; - - // g++ 2.7.2.3/Solaris 2.5.1 doesn't modify l_ () if shifted by 32. - l_ () = n < 32 ? l_ () << n : 0; - - return *this; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator>> (const u_int n) const -{ - const ACE_UINT32 carry_mask = h_ () << (32 - n); - ACE_U_LongLong ret (n < 32 ? (l_ () >> n) | carry_mask : 0, - n < 32 ? h_ () >> n : 0); - - return ret; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator>>= (const u_int n) -{ - const ACE_UINT32 carry_mask = h_ () << (32 - n); - l_ () = n < 32 ? (l_ () >> n) | carry_mask : carry_mask; - h_ () = n < 32 ? h_ () >> n : 0; - - return *this; -} - -ACE_INLINE double -ACE_U_LongLong::operator/ (const double n) const -{ - // See the derivation above in operator/ (const ACE_UINT32). - - return ((double) 0xffffffffu - n + 1.0) / n * h_ () + - (double) h_ () + (double) l_ () / n; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator+= (const ACE_U_LongLong &n) -{ - h_ () += n.h_ (); - l_ () += n.l_ (); - if (l_ () < n.l_ ()) /* carry */ ++h_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator+= (const ACE_UINT32 n) -{ - return operator+= (static_cast (n)); -} - -#define ACE_HIGHBIT (~(~0UL >> 1)) - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::ul_shift (ACE_UINT32 a, ACE_UINT32 c_in, ACE_UINT32 *c_out) const -{ - const ACE_UINT32 b = (a << 1) | c_in; - *c_out = (*c_out << 1) + ((a & ACE_HIGHBIT) > 0); - - return b; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::ull_shift (ACE_U_LongLong a, - ACE_UINT32 c_in, - ACE_UINT32 *c_out) const -{ - ACE_U_LongLong b; - - b.l_ () = (a.l_ () << 1) | c_in; - c_in = ((a.l_ () & ACE_HIGHBIT) > 0); - b.h_ () = (a.h_ () << 1) | c_in; - *c_out = (*c_out << 1) + ((a.h_ () & ACE_HIGHBIT) > 0); - - return b; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::ull_add (ACE_U_LongLong a, ACE_U_LongLong b, ACE_UINT32 *carry) const -{ - ACE_U_LongLong r (0, 0); - ACE_UINT32 c1, c2, c3, c4; - - c1 = a.l_ () % 2; - c2 = b.l_ () % 2; - c3 = 0; - - r.l_ () = a.l_ ()/2 + b.l_ ()/2 + (c1+c2)/2; - r.l_ () = ul_shift (r.l_ (), (c1+c2)%2, &c3); - - c1 = a.h_ () % 2; - c2 = b.h_ () % 2; - c4 = 0; - - r.h_ () = a.h_ ()/2 + b.h_ ()/2 + (c1+c2+c3)/2; - r.h_ () = ul_shift (r.h_ (), (c1+c2+c3)%2, &c4); - - *carry = c4; - - return r; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::ull_mult (ACE_U_LongLong a, ACE_UINT32 b, ACE_UINT32 *carry) const -{ - register ACE_UINT32 mask = ACE_HIGHBIT; - const ACE_U_LongLong zero (0, 0); - ACE_U_LongLong accum (0, 0); - ACE_UINT32 c; - - *carry = 0; - if (b > 0) - do - { - accum = ull_shift (accum, 0U, carry); - if (b & mask) - accum = ull_add (accum, a, &c); - else - accum = ull_add (accum, zero, &c); - *carry += c; - mask >>= 1; - } - while (mask > 0); - - return accum; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator* (const ACE_UINT32 n) const -{ - ACE_UINT32 carry; // will throw the carry away - - return ull_mult (*this, n, &carry); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator*= (const ACE_UINT32 n) -{ - ACE_UINT32 carry; // will throw the carry away - - return *this = ull_mult (*this, n, &carry); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-= (const ACE_U_LongLong &n) -{ - h_ () -= n.h_ (); - if (l_ () < n.l_ ()) /* borrow */ --h_ (); - l_ () -= n.l_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-= (const ACE_UINT32 n) -{ - return operator-= (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator++ () -{ - ++l_ (); - if (l_ () == 0) /* carry */ ++h_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator-- () -{ - if (l_ () == 0) /* borrow */ --h_ (); - --l_ (); - - return *this; -} - -ACE_INLINE const ACE_U_LongLong -ACE_U_LongLong::operator++ (int) -{ - // Post-increment operator should always be implemented in terms of - // the pre-increment operator to enforce consistent semantics. - ACE_U_LongLong temp (*this); - ++*this; - return temp; -} - -ACE_INLINE const ACE_U_LongLong -ACE_U_LongLong::operator-- (int) -{ - // Post-decrement operator should always be implemented in terms of - // the pre-decrement operator to enforce consistent semantics. - ACE_U_LongLong temp (*this); - --*this; - return temp; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator|= (const ACE_U_LongLong n) -{ - l_ () |= n.l_ (); - h_ () |= n.h_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator|= (const ACE_UINT32 n) -{ - return operator|= (static_cast (n)); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator&= (const ACE_U_LongLong n) -{ - l_ () &= n.l_ (); - h_ () &= n.h_ (); - - return *this; -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator&= (const ACE_UINT32 n) -{ - return operator&= (static_cast (n)); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const ACE_UINT32 n) const -{ - // This takes advantage of the fact that the return type has only 32 - // bits. Replace 0x100000000 with 0xffffffff + 1 because the former - // has 33 bits. - // Quotient = (0x100000000u * hi_ + lo_) / n - // = ((0x100000000u - n + n) * hi_ + lo_) / n - // = ((0x100000000u - n) / n * hi_ + hi_ * n / n + lo_ / n - // = (0x100000000u - n) / n * hi_ + hi_ + lo_ / n - // = (0xffffffffu - n + 1) / n * hi_ + hi_ + lo_ / n - - return (0xffffffffu - n + 1) / n * h_ () + h_ () + l_ () / n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator% (const ACE_UINT32 n) const -{ - // Because the argument is an ACE_UINT32, the result can never be - // bigger than 32 bits. Replace 0x100000000 with 0xffffffff + 1 - // because the former has 33 bits. - // Mod = (0x100000000u * hi_ + lo_) % n - // = (0x100000000u % n * hi_ + lo_ % n) % n - // = ((0x100000000u - n) % n * hi_ + lo_ % n) % n - // = ((0xffffffffu - n + 1) % n * hi_ + lo_ % n) % n - - return ((0xffffffff - n + 1) % n * h_ () + l_ () % n) % n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator| (const ACE_INT32 n) const -{ - return l_ () | n; -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator& (const ACE_INT32 n) const -{ - return l_ () & n; -} - -ACE_INLINE ACE_U_LongLong -ACE_U_LongLong::operator* (const ACE_INT32 n) const -{ - return operator* ((ACE_UINT32) n); -} - -ACE_INLINE ACE_U_LongLong & -ACE_U_LongLong::operator*= (const ACE_INT32 n) -{ - return operator*= ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const ACE_INT32 n) const -{ - return operator/ ((ACE_UINT32) n); -} - -#if ACE_SIZEOF_INT == 4 -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const u_long n) const -{ - return operator/ ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const long n) const -{ - return operator/ ((ACE_UINT32) n); -} - -#else /* ACE_SIZEOF_INT != 4 */ -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const u_int n) const -{ - return operator/ ((ACE_UINT32) n); -} - -ACE_INLINE ACE_UINT32 -ACE_U_LongLong::operator/ (const int n) const -{ - return operator/ ((ACE_UINT32) n); -} -#endif /* ACE_SIZEOF_INT != 4 */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */ diff --git a/dep/include/ace/Bound_Ptr.h b/dep/include/ace/Bound_Ptr.h deleted file mode 100644 index 16ea929002e..00000000000 --- a/dep/include/ace/Bound_Ptr.h +++ /dev/null @@ -1,389 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Bound_Ptr.h - * - * $Id: Bound_Ptr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Christopher Kohlhoff - * @author Boris Kolpackov - */ -//============================================================================= - -#ifndef ACE_BOUND_PTR_H -#define ACE_BOUND_PTR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Auto_Ptr.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Bound_Ptr_Counter - * - * @brief An ACE_Bound_Ptr_Counter object encapsulates an - * object reference count. - * - * Do not use this class directly, use ACE_Strong_Bound_Ptr or - * ACE_Weak_Bound_Ptr instead. - */ -template -class ACE_Bound_Ptr_Counter -{ -public: - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - ACE_Bound_Ptr_Counter (long init_obj_ref_count = 0); - ~ACE_Bound_Ptr_Counter (void); - - /// Create a ACE_Bound_Ptr_Counter and initialize the - /// reference count to indicate ownership by a strong pointer. - static ACE_Bound_Ptr_Counter *create_strong (void); - - /// Increase both the object and counter reference counts and return - /// the new object reference count. A return value of -1 indicates - /// that the object has already been destroyed. - static long attach_strong (ACE_Bound_Ptr_Counter *counter); - - /// Decreases both the object and counter reference counts and - /// deletes whichever has no more references. Returns the new object - /// reference count. - static long detach_strong (ACE_Bound_Ptr_Counter *counter); - - /// Create a ACE_Bound_Ptr_Counter and initialize the - /// reference count to indicate no ownership. - static ACE_Bound_Ptr_Counter *create_weak (void); - - /// Increase the counter reference count and return argument. - static void attach_weak (ACE_Bound_Ptr_Counter *counter); - - /// Decreases the counter reference count and deletes the counter if - /// it has no more references. - static void detach_weak (ACE_Bound_Ptr_Counter *counter); - - /// Determine whether the object has been deleted. - static bool object_was_deleted (ACE_Bound_Ptr_Counter *counter); - -private: - - /// Allocate a new ACE_Bound_Ptr_Counter instance, - /// returning NULL if it cannot be created. - static ACE_Bound_Ptr_Counter *internal_create (long init_obj_ref_count); - -private: - - /// Reference count of underlying object. Is set to -1 once the - /// object has been destroyed to indicate to all weak pointers that - /// it is no longer valid. - long obj_ref_count_; - - /// Reference count of this counter. - long self_ref_count_; - - /// Mutex variable to synchronize access to the reference counts. - ACE_LOCK lock_; -}; - -// Forward decl. -template class ACE_Weak_Bound_Ptr; - -/** - * @class ACE_Strong_Bound_Ptr - * - * @brief This class implements support for a reference counted - * pointer. - * - * Assigning or copying instances of an ACE_Strong_Bound_Ptr will - * automatically increment the reference count of the underlying object. - * When the last instance of an ACE_Strong_Bound_Ptr that references a - * particular object is destroyed or overwritten, it will invoke delete - * on its underlying pointer. - */ -template -class ACE_Strong_Bound_Ptr -{ -public: - /// Constructor that initializes an ACE_Strong_Bound_Ptr to point to the - /// object \ immediately. - explicit ACE_Strong_Bound_Ptr (X *p = 0); - - /// Constructor that initializes an ACE_Strong_Bound_Ptr by stealing - /// ownership of an object from an auto_ptr. - explicit ACE_Strong_Bound_Ptr (auto_ptr p); - - /// Copy constructor binds @c this and @a r to the same object. - ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr &r); - - /// Constructor binds @c this and @a r to the same object. - ACE_Strong_Bound_Ptr (const ACE_Weak_Bound_Ptr &r); - - /// Copy constructor binds @c this and @a r to the same object if - /// Y* can be implicitly converted to X*. - template - ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr &r) - : counter_ (r.counter_), - ptr_ (dynamic_cast(r.ptr_)) - { - // This ctor is temporarily defined here to increase our chances - // of being accepted by broken compilers. - // - COUNTER::attach_strong (this->counter_); - } - - /// Destructor. - ~ACE_Strong_Bound_Ptr (void); - - /// Assignment operator that binds @c this and @a r to the same object. - void operator = (const ACE_Strong_Bound_Ptr &r); - - /// Assignment operator that binds @c this and @a r to the same object. - void operator = (const ACE_Weak_Bound_Ptr &r); - - /// Assignment operator that binds @c this and @a r to the same object - /// if Y* can be implicitly converted to X*. - template - ACE_Weak_Bound_Ptr& - operator= (const ACE_Strong_Bound_Ptr &r) - { - // This operator is temporarily defined here to increase our chances - // of being accepted by broken compilers. - // - - // This will work if &r == this, by first increasing the ref count - - COUNTER *new_counter = r.counter_; - X* new_ptr = dynamic_cast (r.ptr_); - COUNTER::attach_strong (new_counter); - if (COUNTER::detach_strong (this->counter_) == 0) - delete this->ptr_; - this->counter_ = new_counter; - this->ptr_ = new_ptr; - - return *this; - } - - /// Equality operator that returns @c true if both - /// ACE_Strong_Bound_Ptr instances point to the same underlying - /// object. - /** - * @note It also returns @c true if both objects have just been - * instantiated and not used yet. - */ - bool operator == (const ACE_Strong_Bound_Ptr &r) const; - - /// Equality operator that returns true if the ACE_Strong_Bound_Ptr - /// and ACE_Weak_Bound_Ptr objects point to the same underlying - /// object. - /** - * @note It also returns @c true if both objects have just been - * instantiated and not used yet. - */ - bool operator == (const ACE_Weak_Bound_Ptr &r) const; - - /// Equality operator that returns @c true if the - /// ACE_Strong_Bound_Ptr and the raw pointer point to the same - /// underlying object. - bool operator == (X *p) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (const ACE_Strong_Bound_Ptr &r) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (const ACE_Weak_Bound_Ptr &r) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (X *p) const; - - /// Redirection operator - X *operator-> (void) const; - - /// Dereference operator - X &operator * (void) const; - - /// Get the pointer value. - X *get (void) const; - - /// Resets the ACE_Strong_Bound_Ptr to refer to a different - /// underlying object. - void reset (X *p = 0); - - /// Resets the ACE_Strong_Bound_Ptr to refer to a different - /// underlying object, ownership of which is stolen from the - /// auto_ptr. - void reset (auto_ptr p); - - /// Allows us to check for NULL on all ACE_Strong_Bound_Ptr - /// objects. - int null (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - typedef X X_t; // This indirection is for Borland C++. - - friend class ACE_Weak_Bound_Ptr; - - template - friend class ACE_Strong_Bound_Ptr; - - /// The ACE_Bound_Ptr_Counter type. - typedef ACE_Bound_Ptr_Counter COUNTER; - - /// The reference counter. - COUNTER *counter_; - - /// The underlying object. - X *ptr_; -}; - -/** - * @class ACE_Weak_Bound_Ptr - * - * @brief This class implements support for a weak pointer that complements - * ACE_Strong_Bound_Ptr. - * - * Unlike ACE_Strong_Bound_Ptr, assigning or copying instances of an - * ACE_Weak_Bound_Ptr will not automatically increment the reference - * count of the underlying object. What ACE_Weak_Bound_Ptr does is - * preserve the knowledge that the object is in fact reference - * counted, and thus provides an alternative to raw pointers where - * non-ownership associations must be maintained. When the last - * instance of an ACE_Strong_Bound_Ptr that references a particular - * object is destroyed or overwritten, the corresponding - * ACE_Weak_Bound_Ptr instances are set to NULL. - */ -template -class ACE_Weak_Bound_Ptr -{ -public: - /// Constructor that initializes an ACE_Weak_Bound_Ptr to point to - /// the object \ immediately. - explicit ACE_Weak_Bound_Ptr (X *p = 0); - - /// Copy constructor binds @c this and @a r to the same object. - ACE_Weak_Bound_Ptr (const ACE_Weak_Bound_Ptr &r); - - /// Constructor binds @c this and @a r to the same object. - ACE_Weak_Bound_Ptr (const ACE_Strong_Bound_Ptr &r); - - /// Destructor. - ~ACE_Weak_Bound_Ptr (void); - - /// Assignment operator that binds @c this and @a r to the same object. - void operator = (const ACE_Weak_Bound_Ptr &r); - - /// Assignment operator that binds @c this and @a r to the same object. - void operator = (const ACE_Strong_Bound_Ptr &r); - - /// Equality operator that returns @c true if both - /// ACE_Weak_Bound_Ptr objects point to the same underlying object. - /** - * @note It also returns @c true if both objects have just been - * instantiated and not used yet. - */ - bool operator == (const ACE_Weak_Bound_Ptr &r) const; - - /// Equality operator that returns @c true if the ACE_Weak_Bound_Ptr - /// and ACE_Strong_Bound_Ptr objects point to the same underlying - /// object. - /** - * @note It also returns @c true if both objects have just been - * instantiated and not used yet. - */ - bool operator == (const ACE_Strong_Bound_Ptr &r) const; - - /// Equality operator that returns @c true if the ACE_Weak_Bound_Ptr - /// and the raw pointer point to the same underlying object. - bool operator == (X *p) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (const ACE_Weak_Bound_Ptr &r) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (const ACE_Strong_Bound_Ptr &r) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (X *p) const; - - /// Redirection operator. - /** - * It returns a temporary strong pointer and makes use of the - * chaining properties of operator-> to ensure that the underlying - * object does not disappear while you are using it. If you are - * certain of the lifetimes of the object, and do not want to incur - * the locking overhead, then use the unsafe_get method instead. - */ - ACE_Strong_Bound_Ptr operator-> (void) const; - - /// Obtain a strong pointer corresponding to this weak pointer. This - /// function is useful to create a temporary strong pointer for - /// conversion to a reference. - ACE_Strong_Bound_Ptr strong (void) const; - - /// Get the pointer value. Warning: this does not affect the - /// reference count of the underlying object, so it may disappear on - /// you while you are using it if you are not careful. - X *unsafe_get (void) const; - - /// Resets the ACE_Weak_Bound_Ptr to refer to a different underlying - /// object. - void reset (X *p = 0); - - /// Increment the reference count on the underlying object. - /** - * Returns the new reference count on the object. This function may - * be used to integrate the bound pointers into an external - * reference counting mechanism such as those used by COM or CORBA - * servants. - */ - long add_ref (void); - - /// Decrement the reference count on the underlying object, which is deleted - /// if the count has reached zero. - /** - * Returns the new reference count on the object. This function may - * be used to integrate the bound pointers into an external - * reference counting mechanism such as those used by COM or CORBA - * servants. - */ - long remove_ref (void); - - /// Allows us to check for NULL on all ACE_Weak_Bound_Ptr objects. - int null (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - typedef X X_t; // This indirection is for Borland C++. - - friend class ACE_Strong_Bound_Ptr; - - /// The ACE_Bound_Ptr_Counter type. - typedef ACE_Bound_Ptr_Counter COUNTER; - - /// The reference counter. - COUNTER *counter_; - - /// The underlying object. - X *ptr_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include "ace/Bound_Ptr.inl" - -#include /**/ "ace/post.h" - -#endif /* ACE_BOUND_PTR_H */ - diff --git a/dep/include/ace/Bound_Ptr.inl b/dep/include/ace/Bound_Ptr.inl deleted file mode 100644 index 3165f6f5acc..00000000000 --- a/dep/include/ace/Bound_Ptr.inl +++ /dev/null @@ -1,492 +0,0 @@ -/* -*- C++ -*- */ -// $Id: Bound_Ptr.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Bound_Ptr.i - -#include "ace/Guard_T.h" -#if !defined (ACE_NEW_THROWS_EXCEPTIONS) -# include "ace/Log_Msg.h" -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template inline ACE_Bound_Ptr_Counter * -ACE_Bound_Ptr_Counter::internal_create (long init_obj_ref_count) -{ - ACE_Bound_Ptr_Counter *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Bound_Ptr_Counter (init_obj_ref_count), - 0); - return temp; -} - -template inline ACE_Bound_Ptr_Counter * -ACE_Bound_Ptr_Counter::create_strong (void) -{ - // Set initial object reference count to 1. - ACE_Bound_Ptr_Counter *temp = internal_create (1); -#if defined (ACE_NEW_THROWS_EXCEPTIONS) - if (temp == 0) - ACE_throw_bad_alloc; -#else - ACE_ASSERT (temp != 0); -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - return temp; -} - -template inline long -ACE_Bound_Ptr_Counter::attach_strong (ACE_Bound_Ptr_Counter* counter) -{ - ACE_GUARD_RETURN (ACE_LOCK, guard, counter->lock_, -1); - - // Can't attach a strong pointer to an object that has already been deleted. - if (counter->obj_ref_count_ == -1) - return -1; - - long new_obj_ref_count = ++counter->obj_ref_count_; - ++counter->self_ref_count_; - - return new_obj_ref_count; -} - -template inline long -ACE_Bound_Ptr_Counter::detach_strong (ACE_Bound_Ptr_Counter* counter) -{ - ACE_Bound_Ptr_Counter *counter_del = 0; - long new_obj_ref_count; - - { - ACE_GUARD_RETURN (ACE_LOCK, guard, counter->lock_, -1); - - if ((new_obj_ref_count = --counter->obj_ref_count_) == 0) - // Change the object reference count to -1 to indicate that the - // object has been deleted, as opposed to a weak pointer that - // simply hasn't had any strong pointers created from it yet. - counter->obj_ref_count_ = -1; - - if (--counter->self_ref_count_ == 0) - // Since counter contains the lock held by the ACE_Guard, the - // guard needs to be released before freeing the memory holding - // the lock. So save the pointer to free, then release, then - // free. - counter_del = counter; - - } // Release the lock - - delete counter_del; - - return new_obj_ref_count; -} - -template inline ACE_Bound_Ptr_Counter * -ACE_Bound_Ptr_Counter::create_weak (void) -{ - // Set initial object reference count to 0. - - ACE_Bound_Ptr_Counter *temp = internal_create (0); -#if defined (ACE_NEW_THROWS_EXCEPTIONS) - if (temp == 0) - ACE_throw_bad_alloc; -#else - ACE_ASSERT (temp != 0); -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - return temp; -} - -template inline void -ACE_Bound_Ptr_Counter::attach_weak (ACE_Bound_Ptr_Counter* counter) -{ - ACE_GUARD (ACE_LOCK, guard, counter->lock_); - - ++counter->self_ref_count_; -} - -template inline void -ACE_Bound_Ptr_Counter::detach_weak (ACE_Bound_Ptr_Counter* counter) -{ - ACE_Bound_Ptr_Counter *counter_del = 0; - - { - ACE_GUARD (ACE_LOCK, guard, counter->lock_); - - if (--counter->self_ref_count_ == 0) - // Since counter contains the lock held by the ACE_Guard, the - // guard needs to be released before freeing the memory holding - // the lock. So save the pointer to free, then release, then - // free. - counter_del = counter; - - } // Release the lock - - delete counter_del; -} - -template inline bool -ACE_Bound_Ptr_Counter::object_was_deleted (ACE_Bound_Ptr_Counter *counter) -{ - ACE_GUARD_RETURN (ACE_LOCK, guard, counter->lock_, 0); - - return counter->obj_ref_count_ == -1; -} - -template inline -ACE_Bound_Ptr_Counter::ACE_Bound_Ptr_Counter (long init_obj_ref_count) - : obj_ref_count_ (init_obj_ref_count), - self_ref_count_ (1) -{ -} - -template inline -ACE_Bound_Ptr_Counter::~ACE_Bound_Ptr_Counter (void) -{ -} - -template inline -ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (X *p) - : counter_ (COUNTER::create_strong ()), - ptr_ (p) -{ -} - -template inline -ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (auto_ptr p) - : counter_ (COUNTER::create_strong ()), - ptr_ (p.release()) -{ -} - -template inline -ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr &r) - : counter_ (r.counter_), - ptr_ (r.ptr_) -{ - COUNTER::attach_strong (this->counter_); -} - -template inline -ACE_Strong_Bound_Ptr::ACE_Strong_Bound_Ptr (const ACE_Weak_Bound_Ptr &r) - : counter_ (r.counter_), - ptr_ (r.ptr_) -{ - // When creating a strong pointer from a weak one we can't assume that the - // underlying object still exists. Therefore we must check for a return value - // of -1, which indicates that the object has been destroyed. - if (COUNTER::attach_strong (this->counter_) == -1) - { - // Underlying object has already been deleted, so set this pointer to null. - this->counter_ = COUNTER::create_strong (); - this->ptr_ = 0; - } -} - -template inline -ACE_Strong_Bound_Ptr::~ACE_Strong_Bound_Ptr (void) -{ - if (COUNTER::detach_strong (this->counter_) == 0) - delete this->ptr_; -} - -template inline void -ACE_Strong_Bound_Ptr::operator = (const ACE_Strong_Bound_Ptr &rhs) -{ - // This will work if &r == this, by first increasing the ref count, but - // why go through all that? - if (&rhs == this) - return; - - COUNTER *new_counter = rhs.counter_; - X_t *new_ptr = rhs.ptr_; - COUNTER::attach_strong (new_counter); - if (COUNTER::detach_strong (this->counter_) == 0) - delete this->ptr_; - this->counter_ = new_counter; - this->ptr_ = new_ptr; -} - -template inline void -ACE_Strong_Bound_Ptr::operator = (const ACE_Weak_Bound_Ptr &rhs) -{ - // This will work if &r == this, by first increasing the ref count, but - // why go through all that? - if (&rhs == this) - return; - - COUNTER *new_counter = rhs.counter_; - X_t *new_ptr = rhs.ptr_; - - // When creating a strong pointer from a weak one we can't assume that the - // underlying object still exists. Therefore we must check for a return value - // of -1, which indicates that the object has been destroyed. - if (COUNTER::attach_strong (new_counter) == -1) - { - // Underlying object has already been deleted, so set this pointer to null. - new_counter = COUNTER::create_strong (); - new_ptr = 0; - } - - if (COUNTER::detach_strong (this->counter_) == 0) - delete this->ptr_; - this->counter_ = new_counter; - this->ptr_ = new_ptr; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator== (const ACE_Strong_Bound_Ptr &r) const -{ - return this->ptr_ == r.ptr_; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator== (const ACE_Weak_Bound_Ptr &r) const -{ - // Use the weak pointer's operator== since it will check for null. - return r == *this; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator== (X *p) const -{ - return this->ptr_ == p; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator!= (const ACE_Strong_Bound_Ptr &r) const -{ - return this->ptr_ != r.ptr_; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator!= (const ACE_Weak_Bound_Ptr &r) const -{ - // Use the weak pointer's operator!= since it will check for null. - return r != *this; -} - -template inline bool -ACE_Strong_Bound_Ptr::operator!= (X *p) const -{ - return this->ptr_ != p; -} - -template inline X * -ACE_Strong_Bound_Ptr::operator-> (void) const -{ - return this->ptr_; -} - -template inline X & -ACE_Strong_Bound_Ptr::operator *() const -{ - return *this->ptr_; -} - -template inline X* -ACE_Strong_Bound_Ptr::get (void) const -{ - return this->ptr_; -} - -template inline int -ACE_Strong_Bound_Ptr::null (void) const -{ - return this->ptr_ == 0; -} - -template inline void -ACE_Strong_Bound_Ptr::reset (X *p) -{ - COUNTER *old_counter = this->counter_; - X_t *old_ptr = this->ptr_; - this->counter_ = COUNTER::create_strong (); - this->ptr_ = p; - if (COUNTER::detach_strong (old_counter) == 0) - delete old_ptr; -} - -template inline void -ACE_Strong_Bound_Ptr::reset (auto_ptr p) -{ - COUNTER *old_counter = this->counter_; - X_t *old_ptr = this->ptr_; - this->counter_ = COUNTER::create_strong (); - this->ptr_ = p.release (); - if (COUNTER::detach_strong (old_counter) == 0) - delete old_ptr; -} - -template inline -ACE_Weak_Bound_Ptr::ACE_Weak_Bound_Ptr (X *p) - : counter_ (COUNTER::create_weak ()), - ptr_ (p) -{ -} - -template inline -ACE_Weak_Bound_Ptr::ACE_Weak_Bound_Ptr (const ACE_Weak_Bound_Ptr &r) - : counter_ (r.counter_), - ptr_ (r.ptr_) -{ - COUNTER::attach_weak (this->counter_); -} - -template inline -ACE_Weak_Bound_Ptr::ACE_Weak_Bound_Ptr (const ACE_Strong_Bound_Ptr &r) - : counter_ (r.counter_), - ptr_ (r.ptr_) -{ - COUNTER::attach_weak (this->counter_); -} - -template inline -ACE_Weak_Bound_Ptr::~ACE_Weak_Bound_Ptr (void) -{ - COUNTER::detach_weak (this->counter_); -} - -template inline void -ACE_Weak_Bound_Ptr::operator = (const ACE_Weak_Bound_Ptr &rhs) -{ - // This will work if &rhs == this, by first increasing the ref count - COUNTER *new_counter = rhs.counter_; - COUNTER::attach_weak (new_counter); - COUNTER::detach_weak (this->counter_); - this->counter_ = new_counter; - this->ptr_ = rhs.ptr_; -} - -template inline void -ACE_Weak_Bound_Ptr::operator = (const ACE_Strong_Bound_Ptr &rhs) -{ - // This will work if &rhs == this, by first increasing the ref count - COUNTER *new_counter = rhs.counter_; - COUNTER::attach_weak (new_counter); - COUNTER::detach_weak (this->counter_); - this->counter_ = new_counter; - this->ptr_ = rhs.ptr_; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator== (const ACE_Weak_Bound_Ptr &r) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return r.ptr_ == 0; - - return this->ptr_ == r.ptr_; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator== (const ACE_Strong_Bound_Ptr &r) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return r.ptr_ == 0; - - return this->ptr_ == r.ptr_; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator== (X *p) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return p == 0; - - return this->ptr_ == p; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator!= (const ACE_Weak_Bound_Ptr &r) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return r.ptr_ != 0; - - return this->ptr_ != r.ptr_; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator!= (const ACE_Strong_Bound_Ptr &r) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return r.ptr_ != 0; - - return this->ptr_ != r.ptr_; -} - -template inline bool -ACE_Weak_Bound_Ptr::operator!= (X *p) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return p != 0; - - return this->ptr_ != p; -} - -template inline ACE_Strong_Bound_Ptr -ACE_Weak_Bound_Ptr::operator-> (void) const -{ - return ACE_Strong_Bound_Ptr (*this); -} - -template inline ACE_Strong_Bound_Ptr -ACE_Weak_Bound_Ptr::strong (void) const -{ - return ACE_Strong_Bound_Ptr (*this); -} - -template inline X* -ACE_Weak_Bound_Ptr::unsafe_get (void) const -{ - // We do not check if the object has been deleted, since this operation - // is defined to be unsafe! - return this->ptr_; -} - -template inline int -ACE_Weak_Bound_Ptr::null (void) const -{ - // A weak pointer must behave as though it is automatically set to null - // if the underlying object has been deleted. - if (COUNTER::object_was_deleted (this->counter_)) - return 1; - - return this->ptr_ == 0; -} - -template inline void -ACE_Weak_Bound_Ptr::reset (X *p) -{ - COUNTER *old_counter = this->counter_; - this->counter_ = COUNTER::create_weak (); - this->ptr_ = p; - COUNTER::detach_weak (old_counter); -} - -template inline long -ACE_Weak_Bound_Ptr::add_ref () -{ - return COUNTER::attach_strong (counter_); -} - -template inline long -ACE_Weak_Bound_Ptr::remove_ref () -{ - long new_obj_ref_count = COUNTER::detach_strong (counter_); - if (new_obj_ref_count == 0) - { - delete this->ptr_; - this->ptr_ = 0; - } - return new_obj_ref_count; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/CDR_Base.h b/dep/include/ace/CDR_Base.h deleted file mode 100644 index 47db56002ee..00000000000 --- a/dep/include/ace/CDR_Base.h +++ /dev/null @@ -1,378 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CDR_Base.h - * - * $Id: CDR_Base.h 82088 2008-06-19 16:22:16Z shuston $ - * - * ACE Common Data Representation (CDR) basic types. - * - * The current implementation assumes that the host has 1-byte, - * 2-byte and 4-byte integral types, and that it has single - * precision and double precision IEEE floats. - * Those assumptions are pretty good these days, with Crays being - * the only known exception. - * - * - * @author TAO version by - * @author Aniruddha Gokhale - * @author Carlos O'Ryan - * @author ACE version by - * @author Jeff Parsons - * @author Istvan Buki - */ -//============================================================================= - -#ifndef ACE_CDR_BASE_H -#define ACE_CDR_BASE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Types.h" -#include "ace/Default_Constants.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Stuff used by the ACE CDR classes. Watch these values... they're also used -// in the ACE_CDR Byte_Order enum below. -#if defined ACE_LITTLE_ENDIAN -# define ACE_CDR_BYTE_ORDER 1 -// little endian encapsulation byte order has value = 1 -#else /* ! ACE_LITTLE_ENDIAN */ -# define ACE_CDR_BYTE_ORDER 0 -// big endian encapsulation byte order has value = 0 -#endif /* ! ACE_LITTLE_ENDIAN */ - -class ACE_Message_Block; - -/** - * @class ACE_CDR - * - * @brief Keep constants and some routines common to both Output and - * Input CDR streams. - */ -class ACE_Export ACE_CDR -{ -public: - // = Constants defined by the CDR protocol. - // By defining as many of these constants as possible as enums we - // ensure they get inlined and avoid pointless static memory - // allocations. - - enum - { - // Note that some of these get reused as part of the standard - // binary format: unsigned is the same size as its signed cousin, - // float is LONG_SIZE, and double is LONGLONG_SIZE. - - OCTET_SIZE = 1, - SHORT_SIZE = 2, - LONG_SIZE = 4, - LONGLONG_SIZE = 8, - LONGDOUBLE_SIZE = 16, - - OCTET_ALIGN = 1, - SHORT_ALIGN = 2, - LONG_ALIGN = 4, - LONGLONG_ALIGN = 8, - /// @note the CORBA LongDouble alignment requirements do not - /// match its size... - LONGDOUBLE_ALIGN = 8, - - /// Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long - /// double", size as above). - MAX_ALIGNMENT = 8, - - /// The default buffer size. - /** - * @todo We want to add options to control this - * default value, so this constant should be read as the default - * default value ;-) - */ - DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE, - - /// The buffer size grows exponentially until it reaches this size; - /// afterwards it grows linearly using the next constant - EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX, - - /// Once exponential growth is ruled out the buffer size increases - /// in chunks of this size, note that this constants have the same - /// value right now, but it does not need to be so. - LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK - }; - - /** - * @enum Byte_Order - * - * Defines values for the byte_order argument to ACE_OutputCDR and - * ACE_InputCDR. - */ - enum Byte_Order - { - /// Use big-endian order (also known as network byte order). - BYTE_ORDER_BIG_ENDIAN = 0, - /// Use little-endian order. - BYTE_ORDER_LITTLE_ENDIAN = 1, - /// Use whichever byte order is native to this machine. - BYTE_ORDER_NATIVE = ACE_CDR_BYTE_ORDER - }; - - /** - * Do byte swapping for each basic IDL type size. There exist only - * routines to put byte, halfword (2 bytes), word (4 bytes), - * doubleword (8 bytes) and quadword (16 byte); because those are - * the IDL basic type sizes. - */ - static void swap_2 (char const *orig, char *target); - static void swap_4 (char const *orig, char *target); - static void swap_8 (char const *orig, char *target); - static void swap_16 (char const *orig, char *target); - static void swap_2_array (char const *orig, - char *target, - size_t length); - static void swap_4_array (char const *orig, - char *target, - size_t length); - static void swap_8_array (char const *orig, - char *target, - size_t length); - static void swap_16_array (char const *orig, - char *target, - size_t length); - - /// Align the message block to ACE_CDR::MAX_ALIGNMENT, - /// set by the CORBA spec at 8 bytes. - static void mb_align (ACE_Message_Block *mb); - - /** - * Compute the size of the smallest buffer that can contain at least - * @a minsize bytes. - * To understand how a "best fit" is computed look at the - * algorithm in the code. - * Basically the buffers grow exponentially, up to a certain point, - * then the buffer size grows linearly. - * The advantage of this algorithm is that is rapidly grows to a - * large value, but does not explode at the end. - */ - static size_t first_size (size_t minsize); - - /// Compute not the smallest, but the second smallest buffer that - /// will fir @a minsize bytes. - static size_t next_size (size_t minsize); - - /** - * Increase the capacity of mb to contain at least @a minsize bytes. - * If @a minsize is zero the size is increased by an amount at least - * large enough to contain any of the basic IDL types. - * @retval -1 Failure - * @retval 0 Success. - */ - static int grow (ACE_Message_Block *mb, size_t minsize); - - /// Copy a message block chain into a single message block, - /// preserving the alignment of the first message block of the - /// original stream, not the following message blocks. - static void consolidate (ACE_Message_Block *dst, - const ACE_Message_Block *src); - - static size_t total_length (const ACE_Message_Block *begin, - const ACE_Message_Block *end); - - /** - * @name Basic OMG IDL Types - * - * These types are for use in the CDR classes. The cleanest way to - * avoid complaints from all compilers is to define them all. - */ - //@{ - typedef bool Boolean; - typedef unsigned char Octet; - typedef char Char; - typedef ACE_WCHAR_T WChar; - typedef ACE_INT16 Short; - typedef ACE_UINT16 UShort; - typedef ACE_INT32 Long; - typedef ACE_UINT32 ULong; - typedef ACE_UINT64 ULongLong; - -# if (defined (_MSC_VER)) || (defined (__BORLANDC__)) - typedef __int64 LongLong; -# elif ACE_SIZEOF_LONG == 8 && !defined(_CRAYMPP) - typedef long LongLong; -# elif defined(__TANDEM) - typedef long long LongLong; -# elif ACE_SIZEOF_LONG_LONG == 8 && !defined (ACE_LACKS_LONGLONG_T) -# if defined (sun) && !defined (ACE_LACKS_U_LONGLONG_T) - // sun #defines u_longlong_t, maybe other platforms do also. - // Use it, at least with g++, so that its -pedantic doesn't - // complain about no ANSI C++ long long. - typedef longlong_t LongLong; -# else - // LynxOS 2.5.0 and Linux don't have u_longlong_t. - typedef long long LongLong; -# endif /* sun */ -# else /* no native 64 bit integer type */ -# define NONNATIVE_LONGLONG - struct ACE_Export LongLong - { -# if defined (ACE_BIG_ENDIAN) - ACE_CDR::Long h; - ACE_CDR::Long l; -# else - ACE_CDR::Long l; - ACE_CDR::Long h; -# endif /* ! ACE_BIG_ENDIAN */ - - /** - * @name Overloaded Relation Operators. - * - * The canonical comparison operators. - */ - //@{ - bool operator== (const LongLong &rhs) const; - bool operator!= (const LongLong &rhs) const; - //@} - }; -# endif /* no native 64 bit integer type */ - -# if defined (NONNATIVE_LONGLONG) -# define ACE_CDR_LONGLONG_INITIALIZER {0,0} -# else -# define ACE_CDR_LONGLONG_INITIALIZER 0 -# endif /* NONNATIVE_LONGLONG */ - -# if ACE_SIZEOF_FLOAT == 4 - typedef float Float; -# else /* ACE_SIZEOF_FLOAT != 4 */ - struct Float - { -# if ACE_SIZEOF_INT == 4 - // Use unsigned int to get word alignment. - unsigned int f; -# else /* ACE_SIZEOF_INT != 4 */ - // Applications will probably have trouble with this. - char f[4]; -# if defined(_UNICOS) && !defined(_CRAYMPP) - Float (void); - Float (const float &init); - Float & operator= (const float &rhs); - bool operator!= (const Float &rhs) const; -# endif /* _UNICOS */ -# endif /* ACE_SIZEOF_INT != 4 */ - }; -# endif /* ACE_SIZEOF_FLOAT != 4 */ - -# if ACE_SIZEOF_DOUBLE == 8 - typedef double Double; -# else /* ACE_SIZEOF_DOUBLE != 8 */ - struct Double - { -# if ACE_SIZEOF_LONG == 8 - // Use u long to get word alignment. - unsigned long f; -# else /* ACE_SIZEOF_INT != 8 */ - // Applications will probably have trouble with this. - char f[8]; -# endif /* ACE_SIZEOF_INT != 8 */ - }; -# endif /* ACE_SIZEOF_DOUBLE != 8 */ - - // 94-9-32 Appendix A defines a 128 bit floating point "long - // double" data type, with greatly extended precision and four - // more bits of exponent (compared to "double"). This is an IDL - // extension, not yet standard. - -# if ACE_SIZEOF_LONG_DOUBLE == 16 - typedef long double LongDouble; -# define ACE_CDR_LONG_DOUBLE_INITIALIZER 0 -# define ACE_CDR_LONG_DOUBLE_ASSIGNMENT(LHS, RHS) LHS = RHS -# else -# define NONNATIVE_LONGDOUBLE -# define ACE_CDR_LONG_DOUBLE_INITIALIZER {{0}} -# define ACE_CDR_LONG_DOUBLE_ASSIGNMENT(LHS, RHS) LHS.assign (RHS) - struct ACE_Export LongDouble - { - // VxWorks' compiler (gcc 2.96) gets confused by the operator long - // double, so we avoid using long double as the NativeImpl. - // Linux's x86 long double format (12 or 16 bytes) is incompatible - // with Windows, Solaris, AIX, MacOS X and HP-UX (and probably others) - // long double format (8 or 16 bytes). If you need 32-bit Linux to - // inter-operate with 64-bit Linux you will want to define this - // macro to 0 so that "long double" is used. Otherwise, do not define - // this macro. -# if defined (ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE) && \ - (ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE == 1) - typedef double NativeImpl; -# else - typedef long double NativeImpl; -# endif /* ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE==1 */ - - char ld[16]; - - LongDouble& assign (const NativeImpl& rhs); - LongDouble& assign (const LongDouble& rhs); - - bool operator== (const LongDouble &rhs) const; - bool operator!= (const LongDouble &rhs) const; - - LongDouble& operator*= (const NativeImpl rhs) { - return this->assign (static_cast (*this) * rhs); - } - LongDouble& operator/= (const NativeImpl rhs) { - return this->assign (static_cast (*this) / rhs); - } - LongDouble& operator+= (const NativeImpl rhs) { - return this->assign (static_cast (*this) + rhs); - } - LongDouble& operator-= (const NativeImpl rhs) { - return this->assign (static_cast (*this) - rhs); - } - LongDouble& operator++ () { - return this->assign (static_cast (*this) + 1); - } - LongDouble& operator-- () { - return this->assign (static_cast (*this) - 1); - } - LongDouble operator++ (int) { - LongDouble ldv = *this; - this->assign (static_cast (*this) + 1); - return ldv; - } - LongDouble operator-- (int) { - LongDouble ldv = *this; - this->assign (static_cast (*this) - 1); - return ldv; - } - - operator NativeImpl () const; - }; -# endif /* ACE_SIZEOF_LONG_DOUBLE != 16 */ - - //@} - -#if !defined (ACE_CDR_GIOP_MAJOR_VERSION) -# define ACE_CDR_GIOP_MAJOR_VERSION 1 -#endif /*ACE_CDR_GIOP_MAJOR_VERSION */ - -#if !defined (ACE_CDR_GIOP_MINOR_VERSION) -# define ACE_CDR_GIOP_MINOR_VERSION 2 -#endif /* ACE_CDR_GIOP_MINOR_VERSION */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/CDR_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CDR_BASE_H */ - diff --git a/dep/include/ace/CDR_Base.inl b/dep/include/ace/CDR_Base.inl deleted file mode 100644 index 85373170af7..00000000000 --- a/dep/include/ace/CDR_Base.inl +++ /dev/null @@ -1,255 +0,0 @@ -// -*- C++ -*- -// -// $Id: CDR_Base.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_INTRINSIC_BYTESWAP) -// Take advantage of MSVC++ byte swapping compiler intrinsics (found -// in ). -# pragma intrinsic (_byteswap_ushort, _byteswap_ulong, _byteswap_uint64) -#endif /* ACE_HAS_INTRINSIC_BYTESWAP */ - -#if defined (ACE_HAS_BSWAP_16) || defined (ACE_HAS_BSWAP_32) || defined (ACE_HAS_BSWAP_64) -# include "ace/os_include/os_byteswap.h" -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// -// The ACE_CDR::swap_X and ACE_CDR::swap_X_array routines are broken -// in 5 cases for optimization: -// -// * MSVC++ 7.1 or better -// => Compiler intrinsics -// -// * AMD64 CPU + gnu g++ -// => gcc amd64 inline assembly. -// -// * x86 Pentium CPU + gnu g++ -// (ACE_HAS_PENTIUM && __GNUG__) -// => gcc x86 inline assembly. -// -// * x86 Pentium CPU and (_MSC_VER) or BORLAND C++) -// (ACE_HAS_PENTIUM && ( _MSC_VER || __BORLANDC__ ) -// => MSC x86 inline assembly. -// -// * 64 bit architecture -// (ACE_SIZEOF_LONG == 8) -// => shift/masks using 64bit words. -// -// * default -// (none of the above) -// => shift/masks using 32bit words. -// -// -// Some things you could find useful to know if you intend to mess -// with this optimizations for swaps: -// -// * MSVC++ don't assume register values are conserved between -// statements. So you can clobber any register you want, -// whenever you want (well not *anyone* really, see manual). -// The MSVC++ optimizer will try to pick different registers -// for the C++ statements sorrounding your asm block, and if -// it's not possible will use the stack. -// -// * If you clobber registers with asm statements in gcc, you -// better do it in an asm-only function, or save/restore them -// before/after in the stack. If not, sorrounding C statements -// could end using the same registers and big-badda-bum (been -// there, done that...). The big-badda-bum could happen *even -// if you specify the clobbered register in your asm's*. -// Even better, use gcc asm syntax for detecting the register -// asigned to a certain variable so you don't have to clobber any -// register directly. -// - -ACE_INLINE void -ACE_CDR::swap_2 (const char *orig, char* target) -{ -#if defined (ACE_HAS_INTRINSIC_BYTESWAP) - // Take advantage of MSVC++ compiler intrinsic byte swapping - // function. - *reinterpret_cast (target) = - _byteswap_ushort (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP16) - *reinterpret_cast (target) = - bswap16 (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP_16) - *reinterpret_cast (target) = - bswap_16 (*reinterpret_cast (orig)); -#elif defined(ACE_HAS_INTEL_ASSEMBLY) - unsigned short a = - *reinterpret_cast (orig); - asm( "rolw $8, %0" : "=r" (a) : "0" (a) ); - *reinterpret_cast (target) = a; -#elif defined (ACE_HAS_PENTIUM) \ - && (defined(_MSC_VER) || defined(__BORLANDC__)) \ - && !defined(ACE_LACKS_INLINE_ASSEMBLY) - __asm mov ebx, orig; - __asm mov ecx, target; - __asm mov ax, [ebx]; - __asm rol ax, 8; - __asm mov [ecx], ax; -#else - register ACE_UINT16 usrc = * reinterpret_cast (orig); - register ACE_UINT16* udst = reinterpret_cast (target); - *udst = (usrc << 8) | (usrc >> 8); -#endif /* ACE_HAS_PENTIUM */ -} - -ACE_INLINE void -ACE_CDR::swap_4 (const char* orig, char* target) -{ -#if defined (ACE_HAS_INTRINSIC_BYTESWAP) - // Take advantage of MSVC++ compiler intrinsic byte swapping - // function. - *reinterpret_cast (target) = - _byteswap_ulong (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP32) - *reinterpret_cast (target) = - bswap32 (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP_32) - *reinterpret_cast (target) = - bswap_32 (*reinterpret_cast (orig)); -#elif defined(ACE_HAS_INTEL_ASSEMBLY) - // We have ACE_HAS_PENTIUM, so we know the sizeof's. - register unsigned int j = - *reinterpret_cast (orig); - asm ("bswap %1" : "=r" (j) : "0" (j)); - *reinterpret_cast (target) = j; -#elif defined(ACE_HAS_PENTIUM) \ - && (defined(_MSC_VER) || defined(__BORLANDC__)) \ - && !defined(ACE_LACKS_INLINE_ASSEMBLY) - __asm mov ebx, orig; - __asm mov ecx, target; - __asm mov eax, [ebx]; - __asm bswap eax; - __asm mov [ecx], eax; -#else - register ACE_UINT32 x = * reinterpret_cast (orig); - x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); - * reinterpret_cast (target) = x; -#endif /* ACE_HAS_INTRINSIC_BYTESWAP */ -} - -ACE_INLINE void -ACE_CDR::swap_8 (const char* orig, char* target) -{ -#if defined (ACE_HAS_INTRINSIC_BYTESWAP) - // Take advantage of MSVC++ compiler intrinsic byte swapping - // function. - *reinterpret_cast (target) = - _byteswap_uint64 (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP64) - *reinterpret_cast (target) = - bswap64 (*reinterpret_cast (orig)); -#elif defined (ACE_HAS_BSWAP_64) - *reinterpret_cast (target) = - bswap_64 (*reinterpret_cast (orig)); -#elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) - register unsigned long x = - * reinterpret_cast (orig); - asm ("bswapq %1" : "=r" (x) : "0" (x)); - *reinterpret_cast (target) = x; -#elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) - register unsigned int i = - *reinterpret_cast (orig); - register unsigned int j = - *reinterpret_cast (orig + 4); - asm ("bswap %1" : "=r" (i) : "0" (i)); - asm ("bswap %1" : "=r" (j) : "0" (j)); - *reinterpret_cast (target + 4) = i; - *reinterpret_cast (target) = j; -#elif defined(ACE_HAS_PENTIUM) \ - && (defined(_MSC_VER) || defined(__BORLANDC__)) \ - && !defined(ACE_LACKS_INLINE_ASSEMBLY) - __asm mov ecx, orig; - __asm mov edx, target; - __asm mov eax, [ecx]; - __asm mov ebx, 4[ecx]; - __asm bswap eax; - __asm bswap ebx; - __asm mov 4[edx], eax; - __asm mov [edx], ebx; -#elif ACE_SIZEOF_LONG == 8 - // 64 bit architecture. - register unsigned long x = - * reinterpret_cast (orig); - register unsigned long x84 = (x & 0x000000ff000000ffUL) << 24; - register unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8; - register unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8; - register unsigned long x51 = (x & 0xff000000ff000000UL) >> 24; - x = (x84 | x73 | x62 | x51); - x = (x << 32) | (x >> 32); - *reinterpret_cast (target) = x; -#else - register ACE_UINT32 x = - * reinterpret_cast (orig); - register ACE_UINT32 y = - * reinterpret_cast (orig + 4); - x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); - y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); - * reinterpret_cast (target) = y; - * reinterpret_cast (target + 4) = x; -#endif /* ACE_HAS_INTRINSIC_BYTESWAP */ -} - -ACE_INLINE void -ACE_CDR::swap_16 (const char* orig, char* target) -{ - swap_8 (orig + 8, target); - swap_8 (orig, target + 8); -} - -ACE_INLINE size_t -ACE_CDR::first_size (size_t minsize) -{ - if (minsize == 0) - return ACE_CDR::DEFAULT_BUFSIZE; - - size_t newsize = ACE_CDR::DEFAULT_BUFSIZE; - while (newsize < minsize) - { - if (newsize < ACE_CDR::EXP_GROWTH_MAX) - { - // We grow exponentially at the beginning, this is fast and - // reduces the number of allocations. - - // Quickly multiply by two using a bit shift. This is - // guaranteed to work since the variable is an unsigned - // integer. - newsize <<= 1; - } - else - { - // but continuing with exponential growth can result in over - // allocations and easily yield an allocation failure. - // So we grow linearly when the buffer is too big. - newsize += ACE_CDR::LINEAR_GROWTH_CHUNK; - } - } - return newsize; -} - -ACE_INLINE size_t -ACE_CDR::next_size (size_t minsize) -{ - size_t newsize = ACE_CDR::first_size (minsize); - - if (newsize == minsize) - { - // If necessary increment the size - if (newsize < ACE_CDR::EXP_GROWTH_MAX) - // Quickly multiply by two using a bit shift. This is - // guaranteed to work since the variable is an unsigned - // integer. - newsize <<= 1; - else - newsize += ACE_CDR::LINEAR_GROWTH_CHUNK; - } - - return newsize; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -// **************************************************************** diff --git a/dep/include/ace/CDR_Size.h b/dep/include/ace/CDR_Size.h deleted file mode 100644 index 3803310c7f2..00000000000 --- a/dep/include/ace/CDR_Size.h +++ /dev/null @@ -1,237 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CDR_Size.h - * - * $Id: CDR_Size.h 80826 2008-03-04 14:51:23Z wotte $ - * - * - * ACE Common Data Representation (CDR) size-calculating stream. - * - * - * The current implementation assumes that the host has 1-byte, - * 2-byte and 4-byte integral types, and that it has single - * precision and double precision IEEE floats. - * Those assumptions are pretty good these days, with Crays beign - * the only known exception. - * - * - * @author Boris Kolpackov - * - */ -//============================================================================= - -#ifndef ACE_CDR_SIZE_H -#define ACE_CDR_SIZE_H - -#include /**/ "ace/pre.h" - -#include "ace/CDR_Base.h" -#include "ace/CDR_Stream.h" // for ACE_OutputCDR::from_* - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SStringfwd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_SizeCDR - * - * @brief A CDR stream for calculating size of the representation. - * - */ -class ACE_Export ACE_SizeCDR -{ -public: - /// Default constructor. - ACE_SizeCDR (ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Returns @c false if an error has ocurred. - bool good_bit (void) const; - - /// Reset current size. - void reset (void); - - /// Return current size. - size_t total_length (void) const; - - // Return 0 on failure and 1 on success. - //@{ @name Size-calculating pseudo-write operations - ACE_CDR::Boolean write_boolean (ACE_CDR::Boolean x); - ACE_CDR::Boolean write_char (ACE_CDR::Char x); - ACE_CDR::Boolean write_wchar (ACE_CDR::WChar x); - ACE_CDR::Boolean write_octet (ACE_CDR::Octet x); - ACE_CDR::Boolean write_short (ACE_CDR::Short x); - ACE_CDR::Boolean write_ushort (ACE_CDR::UShort x); - ACE_CDR::Boolean write_long (ACE_CDR::Long x); - ACE_CDR::Boolean write_ulong (ACE_CDR::ULong x); - ACE_CDR::Boolean write_longlong (const ACE_CDR::LongLong &x); - ACE_CDR::Boolean write_ulonglong (const ACE_CDR::ULongLong &x); - ACE_CDR::Boolean write_float (ACE_CDR::Float x); - ACE_CDR::Boolean write_double (const ACE_CDR::Double &x); - ACE_CDR::Boolean write_longdouble (const ACE_CDR::LongDouble &x); - - /// For string we offer methods that accept a precomputed length. - ACE_CDR::Boolean write_string (const ACE_CDR::Char *x); - ACE_CDR::Boolean write_string (ACE_CDR::ULong len, - const ACE_CDR::Char *x); - ACE_CDR::Boolean write_string (const ACE_CString &x); - ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); - ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, - const ACE_CDR::WChar *x); - //@} - - /// @note the portion written starts at and ends - /// at . - /// The length is *NOT* stored into the CDR stream. - //@{ @name Array write operations - ACE_CDR::Boolean write_boolean_array (const ACE_CDR::Boolean *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_longlong_array (const ACE_CDR::LongLong* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length); - - /// - /// Adjust to @a size and count octets. - void adjust (size_t size); - - /// As above, but now the size and alignment requirements may be - /// different. - void adjust (size_t size, - size_t align); - -private: - /// disallow copying... - ACE_SizeCDR (const ACE_SizeCDR& rhs); - ACE_SizeCDR& operator= (const ACE_SizeCDR& rhs); - - ACE_CDR::Boolean write_1 (const ACE_CDR::Octet *x); - ACE_CDR::Boolean write_2 (const ACE_CDR::UShort *x); - ACE_CDR::Boolean write_4 (const ACE_CDR::ULong *x); - ACE_CDR::Boolean write_8 (const ACE_CDR::ULongLong *x); - ACE_CDR::Boolean write_16 (const ACE_CDR::LongDouble *x); - - /** - * write an array of @a length elements, each of @a size bytes and the - * start aligned at a multiple of . The elements are assumed - * to be packed with the right alignment restrictions. It is mostly - * designed for buffers of the basic types. - * - * This operation uses ; as explained above it is expected - * that using assignment is faster that for one element, - * but for several elements should be more efficient, it - * could be interesting to find the break even point and optimize - * for that case, but that would be too platform dependent. - */ - ACE_CDR::Boolean write_array (const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar* x, - ACE_CDR::ULong length); - -private: - /// Set to false when an error ocurrs. - bool good_bit_; - - /// Current size. - size_t size_; - -protected: - /// GIOP version information - ACE_CDR::Octet major_version_; - ACE_CDR::Octet minor_version_; -}; - -// @@ This operator should not be inlined since they force SString.h -// to be included in this header. -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - const ACE_CString &x); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/CDR_Size.inl" -#else /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Not used by CORBA or TAO -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::Char x); - -// CDR size-calculating output operators for primitive types - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::Short x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::UShort x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::Long x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::ULong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::LongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::ULongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR& ss, - ACE_CDR::LongDouble x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::Float x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_CDR::Double x); - -// CDR size-calculating output operator from helper classes - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_boolean x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_char x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_wchar x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_octet x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_string x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - ACE_OutputCDR::from_wstring x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - const ACE_CDR::Char* x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, - const ACE_CDR::WChar* x); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CDR_SIZE_H */ - diff --git a/dep/include/ace/CDR_Size.inl b/dep/include/ace/CDR_Size.inl deleted file mode 100644 index 5d65ab94c09..00000000000 --- a/dep/include/ace/CDR_Size.inl +++ /dev/null @@ -1,419 +0,0 @@ -// -*- C++ -*- -// -// $Id: CDR_Size.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_SizeCDR::ACE_SizeCDR (ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : good_bit_ (true), - size_ (0), - major_version_ (major_version), - minor_version_ (minor_version) -{ -} - -ACE_INLINE bool -ACE_SizeCDR::good_bit (void) const -{ - return this->good_bit_; -} - -ACE_INLINE void -ACE_SizeCDR::reset (void) -{ - this->size_ = 0; -} - -ACE_INLINE size_t -ACE_SizeCDR::total_length (void) const -{ - return this->size_; -} - -// Encode the CDR stream. - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_octet (ACE_CDR::Octet x) -{ - return this->write_1 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_boolean (ACE_CDR::Boolean x) -{ - return (ACE_CDR::Boolean) this->write_octet (x ? (ACE_CDR::Octet) 1 : (ACE_CDR::Octet) 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_char (ACE_CDR::Char x) -{ - // Note: translator framework is not supported. - // - return this->write_1 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_short (ACE_CDR::Short x) -{ - return this->write_2 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ushort (ACE_CDR::UShort x) -{ - return this->write_2 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_long (ACE_CDR::Long x) -{ - return this->write_4 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ulong (ACE_CDR::ULong x) -{ - return this->write_4 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_longlong (const ACE_CDR::LongLong &x) -{ - return this->write_8 (reinterpret_cast (&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ulonglong (const ACE_CDR::ULongLong &x) -{ - const void *temp = &x; - return this->write_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_float (ACE_CDR::Float x) -{ - const void *temp = &x; - return this->write_4 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_double (const ACE_CDR::Double &x) -{ - const void *temp = &x; - return this->write_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_longdouble (const ACE_CDR::LongDouble &x) -{ - const void *temp = &x; - return this->write_16 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_string (const ACE_CDR::Char *x) -{ - if (x != 0) - { - const ACE_CDR::ULong len = - static_cast (ACE_OS::strlen (x)); - return this->write_string (len, x); - } - return this->write_string (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_wstring (const ACE_CDR::WChar *x) -{ - if (x != 0) - { - ACE_CDR::ULong len = - static_cast (ACE_OS::strlen (x)); - return this->write_wstring (len, x); - } - return this->write_wstring (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length) -{ - // Note: translator framework is not supported. - // - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - // Note: translator framework is not supported. - // - if (ACE_OutputCDR::wchar_maxbytes () == 0) - { - errno = EACCES; - return (ACE_CDR::Boolean) (this->good_bit_ = false); - } - if (ACE_OutputCDR::wchar_maxbytes () == sizeof (ACE_CDR::WChar)) - return this->write_array (x, - sizeof (ACE_CDR::WChar), - sizeof (ACE_CDR::WChar) == 2 - ? ACE_CDR::SHORT_ALIGN - : ACE_CDR::LONG_ALIGN, - length); - return this->write_wchar_array_i (x,length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_longlong_array (const ACE_CDR::LongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_SizeCDR::write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::Char x) -{ - ss.write_char (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::Short x) -{ - ss.write_short (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::UShort x) -{ - ss.write_ushort (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::Long x) -{ - ss.write_long (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::ULong x) -{ - ss.write_ulong (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::LongLong x) -{ - ss.write_longlong (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::ULongLong x) -{ - ss.write_ulonglong (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::LongDouble x) -{ - ss.write_longdouble (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::Float x) -{ - ss.write_float (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_CDR::Double x) -{ - ss.write_double (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, const ACE_CDR::Char *x) -{ - ss.write_string (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, const ACE_CDR::WChar *x) -{ - ss.write_wstring (x); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -// The following use the helper classes -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_boolean x) -{ - ss.write_boolean (x.val_); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_char x) -{ - ss.write_char (x.val_); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_wchar x) -{ - ss.write_wchar (x.val_); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_octet x) -{ - ss.write_octet (x.val_); - return (ACE_CDR::Boolean) ss.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_string x) -{ - ACE_CDR::ULong len = 0; - - if (x.val_ != 0) - { - len = static_cast (ACE_OS::strlen (x.val_)); - } - - ss.write_string (len, x.val_); - return - (ACE_CDR::Boolean) (ss.good_bit () && (!x.bound_ || len <= x.bound_)); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_wstring x) -{ - ACE_CDR::ULong len = 0; - - if (x.val_ != 0) - { - len = static_cast (ACE_OS::strlen (x.val_)); - } - - ss.write_wstring (len, x.val_); - return - (ACE_CDR::Boolean) (ss.good_bit () && (!x.bound_ || len <= x.bound_)); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/CDR_Stream.h b/dep/include/ace/CDR_Stream.h deleted file mode 100644 index c49a0006266..00000000000 --- a/dep/include/ace/CDR_Stream.h +++ /dev/null @@ -1,1398 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CDR_Stream.h - * - * $Id: CDR_Stream.h 82350 2008-07-22 07:36:47Z johnnyw $ - * - * ACE Common Data Representation (CDR) marshaling and demarshaling - * classes. - * - * This implementation was inspired in the CDR class in SunSoft's - * IIOP engine, but has a completely different implementation and a - * different interface too. - * - * The current implementation assumes that the host has 1-byte, - * 2-byte and 4-byte integral types, and that it has single - * precision and double precision IEEE floats. - * Those assumptions are pretty good these days, with Crays being - * the only known exception. - * - * Optimizations - * ------------- - * ACE_LACKS_CDR_ALIGNMENT - * @author Arvind S. Krishna - * - * CDR stream ignores alignment when marshaling data. Use this option - * only when ACE_DISABLE_SWAP_ON_READ can be enabled. This option requires - * ACE CDR engine to do both marshaling and demarshaling. - * - * - * @author TAO version by Aniruddha Gokhale - * @author Carlos O'Ryan - * @author ACE version by Jeff Parsons - * @author Istvan Buki - * @author Codeset translation by Jim Rogers - */ -//============================================================================= - -#ifndef ACE_CDR_STREAM_H -#define ACE_CDR_STREAM_H - -#include /**/ "ace/pre.h" - -#include "ace/CDR_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SStringfwd.h" -#include "ace/Message_Block.h" - -#if defined (GEN_OSTREAM_OPS) -#include "ace/streams.h" -#endif /* GEN_OSTREAM_OPS */ - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) -#include "Monitor_Size.h" -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Char_Codeset_Translator; -class ACE_WChar_Codeset_Translator; - -class ACE_InputCDR; - -/** - * @class ACE_OutputCDR - * - * @brief A CDR stream for marshalling data, most often for transmission to - * another system which may or may not have the same byte order. - * - * This class is based on the the CORBA spec for Java (98-02-29), - * java class omg.org.CORBA.portable.OutputStream. It diverts in - * a few ways: - * @li Operations taking arrays don't have offsets, because in C++ - * it is easier to describe an array starting from x+offset. - * @li Operations return an error status, because exceptions are - * not widely available in C++ (yet). - */ -class ACE_Export ACE_OutputCDR -{ -public: - /** - * The Codeset translators need access to some private members to - * efficiently marshal arrays - * For reading from an output CDR stream. - */ - friend class ACE_Char_Codeset_Translator; - friend class ACE_WChar_Codeset_Translator; - friend class ACE_InputCDR; - - /** - * Default constructor; allows one to set byte ordering, allocators, and - * tuning information. - * - * @param size Causes constructor to preallocate @a size bytes; if - * @a size is 0 it allocates the default size. - * - * @param byte_order The byte order that data will have within this - * object. Unless otherwise specified, the byte order - * will be the order native to the hardware this is - * executed on. To force the marshalled data to have - * a specific order, specify one of the values defined - * in ACE_CDR::Byte_Order. - * @note The @c ACE_ENABLE_SWAP_ON_WRITE config macro - * must be set for any local byte swapping to occur - * as data is inserted into an ACE_OutputCDR object. - */ - ACE_OutputCDR (size_t size = 0, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_Allocator* buffer_allocator = 0, - ACE_Allocator* data_block_allocator = 0, - ACE_Allocator* message_block_allocator = 0, - size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Build a CDR stream with an initial buffer, it will *not* remove - /// , since it did not allocated it. It's important to be careful - /// with the alignment of . - /** - * Create an output stream from an arbitrary buffer, care must be - * exercised with alignment, because this contructor will align if - * needed. In this case @a data will not point to the start of the - * output stream. @c begin()->rd_ptr() points to the start of the - * output stream. See @c ACE_ptr_align_binary() to properly align a - * pointer and use ACE_CDR::MAX_ALIGNMENT for the correct alignment. - */ - ACE_OutputCDR (char *data, - size_t size, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_Allocator* buffer_allocator = 0, - ACE_Allocator* data_block_allocator = 0, - ACE_Allocator* message_block_allocator = 0, - size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, - ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Build a CDR stream with an initial data block, it will *not* remove - /// , since it did not allocated it. It's important to be - // careful with the alignment of . - /** - * Create an output stream from an arbitrary data block, care must be - * exercised with alignment, because this contructor will align if - * needed. In this case @a data_block will not point to the - * start of the output stream. begin()->rd_ptr() points to the start - * off the output stream. See ACE_ptr_align_binary() to properly align a - * pointer and use ACE_CDR::MAX_ALIGNMENT for the correct alignment. - */ - ACE_OutputCDR (ACE_Data_Block *data_block, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_Allocator* message_block_allocator = 0, - size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, - ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Build a CDR stream with an initial Message_Block chain, it will - /// *not* remove @a data, since it did not allocate it. - ACE_OutputCDR (ACE_Message_Block *data, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, - ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// destructor - ~ACE_OutputCDR (void); - - /** - * Disambiguate overload when inserting booleans, octets, chars, and - * bounded strings. - */ - //@{ @name Helper classes - - struct ACE_Export from_boolean - { - explicit from_boolean (ACE_CDR::Boolean b); - ACE_CDR::Boolean val_; - }; - - struct ACE_Export from_octet - { - explicit from_octet (ACE_CDR::Octet o); - ACE_CDR::Octet val_; - }; - - struct ACE_Export from_char - { - explicit from_char (ACE_CDR::Char c); - ACE_CDR::Char val_; - }; - - struct ACE_Export from_wchar - { - explicit from_wchar (ACE_CDR::WChar wc); - ACE_CDR::WChar val_; - }; - - struct ACE_Export from_string - { - from_string (ACE_CDR::Char* s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy = 0); - from_string (const ACE_CDR::Char* s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy = 0); - ACE_CDR::Char *val_; - ACE_CDR::ULong bound_; - ACE_CDR::Boolean nocopy_; - }; - - struct ACE_Export from_wstring - { - from_wstring (ACE_CDR::WChar* ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy = 0); - from_wstring (const ACE_CDR::WChar* ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy = 0); - ACE_CDR::WChar *val_; - ACE_CDR::ULong bound_; - ACE_CDR::Boolean nocopy_; - }; - //@} - - /** - * @{ @name Write operations - * Return 0 on failure and 1 on success. - */ - ACE_CDR::Boolean write_boolean (ACE_CDR::Boolean x); - ACE_CDR::Boolean write_char (ACE_CDR::Char x); - ACE_CDR::Boolean write_wchar (ACE_CDR::WChar x); - ACE_CDR::Boolean write_octet (ACE_CDR::Octet x); - ACE_CDR::Boolean write_short (ACE_CDR::Short x); - ACE_CDR::Boolean write_ushort (ACE_CDR::UShort x); - ACE_CDR::Boolean write_long (ACE_CDR::Long x); - ACE_CDR::Boolean write_ulong (ACE_CDR::ULong x); - ACE_CDR::Boolean write_longlong (const ACE_CDR::LongLong &x); - ACE_CDR::Boolean write_ulonglong (const ACE_CDR::ULongLong &x); - ACE_CDR::Boolean write_float (ACE_CDR::Float x); - ACE_CDR::Boolean write_double (const ACE_CDR::Double &x); - ACE_CDR::Boolean write_longdouble (const ACE_CDR::LongDouble &x); - - /// For string we offer methods that accept a precomputed length. - ACE_CDR::Boolean write_string (const ACE_CDR::Char *x); - ACE_CDR::Boolean write_string (ACE_CDR::ULong len, - const ACE_CDR::Char *x); - ACE_CDR::Boolean write_string (const ACE_CString &x); - ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); - ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, - const ACE_CDR::WChar *x); - //@} - - /// @note the portion written starts at and ends - /// at . - /// The length is *NOT* stored into the CDR stream. - //@{ @name Array write operations - ACE_CDR::Boolean write_boolean_array (const ACE_CDR::Boolean *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_longlong_array (const ACE_CDR::LongLong* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length); - - /// Write an octet array contained inside a MB, this can be optimized - /// to minimize copies. - ACE_CDR::Boolean write_octet_array_mb (const ACE_Message_Block* mb); - //@} - - /** - * @{ @name Placeholder/replace operations - * Facilitates writing a placeholder into a CDR stream to be replaced - * later with a different value. - * - * @note An example use for this facility is: - * @code - ACE_OutputCDR strm; - ... // insert values... - char *pos = strm.write_long_placeholder (); - ... // insert more values - ACE_CDR::Long real_val; // Somehow assign the "correct" value - strm.replace (real_val, pos); // Replace earlier placeholder - @endcode - */ - - /** - * Write a placeholder into the stream. The placeholder's pointer - * is returned so it may later be passed as the @a loc argument to - * replace (). - * These methods align the stream's write pointer properly prior to - * writing the placeholder. - * - * @retval Pointer to the placeholder; 0 if there is not enough space - * in the stream and memory could not be allocated. - */ - char* write_long_placeholder (void); - char* write_short_placeholder (void); - - /** - * Writes a new value into a specific location. This is commonly - * used to update a prior "placeholder" location in the stream. - * The specified location is assumed to have proper CDR alignment for the - * type to insert. This requirement is satisfied by using one of the - * placeholder-writing methods to align the stream for the anticipated - * value and obtain the correct location. - * Treatment of @a x with repect to byte swapping is the same as for when - * any value is inserted. - * - * @param x The value to insert into the specified location. - * @param loc The location at which to insert @a x. @a loc must be a valid - * position within the stream's current set of message blocks. - * - * @sa write_long_placeholder(), write_short_placeholder () - */ - ACE_CDR::Boolean replace (ACE_CDR::Long x, char* loc); - ACE_CDR::Boolean replace (ACE_CDR::Short x, char* loc); - //@} - - /** - * Return 0 on failure and 1 on success. - */ - //@{ @name Append contents of own CDR stream to another - ACE_CDR::Boolean append_boolean (ACE_InputCDR &); - ACE_CDR::Boolean append_char (ACE_InputCDR &); - ACE_CDR::Boolean append_wchar (ACE_InputCDR &); - ACE_CDR::Boolean append_octet (ACE_InputCDR &); - ACE_CDR::Boolean append_short (ACE_InputCDR &); - ACE_CDR::Boolean append_ushort (ACE_InputCDR &); - ACE_CDR::Boolean append_long (ACE_InputCDR &); - ACE_CDR::Boolean append_ulong (ACE_InputCDR &); - ACE_CDR::Boolean append_longlong (ACE_InputCDR &); - ACE_CDR::Boolean append_ulonglong (ACE_InputCDR &); - ACE_CDR::Boolean append_float (ACE_InputCDR &); - ACE_CDR::Boolean append_double (ACE_InputCDR &); - ACE_CDR::Boolean append_longdouble (ACE_InputCDR &); - - ACE_CDR::Boolean append_wstring (ACE_InputCDR &); - ACE_CDR::Boolean append_string (ACE_InputCDR &); - //@} - - /// Returns @c false if an error has ocurred. - /** - * @note The only expected error is to run out of memory. - */ - bool good_bit (void) const; - - /// Reuse the CDR stream to write on the old buffer. - void reset (void); - - /// Add the length of each message block in the chain. - size_t total_length (void) const; - - /** - * Return the start of the message block chain for this CDR stream. - * @note The complete CDR stream is represented by a chain of - * message blocks. - */ - const ACE_Message_Block *begin (void) const; - - /// Return the last message in the chain that is is use. - const ACE_Message_Block *end (void) const; - - /// Return the message block in chain. - const ACE_Message_Block *current (void) const; - - /// Replace the message block chain with a single message block. - /** - * Upon successful completion, there will be a single message block - * containing the data from the complete message block chain. - * - * @note The only expected error is to run out of memory. - */ - int consolidate (void); - - /** - * Access the underlying buffer (read only). @note This - * method only returns a pointer to the first block in the - * chain. - */ - const char *buffer (void) const; - - /** - * Return the size of first message block in the block chain. @note This - * method only returns information about the first block in the - * chain. - */ - size_t length (void) const; - - /** - * Utility function to allow the user more flexibility. - * Pads the stream up to the nearest -byte boundary. - * Argument MUST be a power of 2. - * Returns 0 on success and -1 on failure. - */ - int align_write_ptr (size_t alignment); - - /// Access the codeset translators. They can be null! - ACE_Char_Codeset_Translator *char_translator (void) const; - ACE_WChar_Codeset_Translator *wchar_translator (void) const; - - /// Set the char codeset translator. - void char_translator (ACE_Char_Codeset_Translator *); - /// Set the wchar codeset translator. - void wchar_translator (ACE_WChar_Codeset_Translator *); - - /// set the global size of serialized wchars. This may be different - /// than the size of a wchar_t. - static void wchar_maxbytes (size_t max_bytes); - - /// access the serialized size of wchars. - static size_t wchar_maxbytes (void); - - /** - * Return alignment of the wr_ptr(), with respect to the start of - * the CDR stream. This is not the same as the alignment of - * current->wr_ptr()! - */ - size_t current_alignment (void) const; - - void current_alignment (size_t current_alignment); - - /** - * Returns (in @a buf) the next position in the buffer aligned to - * @a size, it advances the Message_Block wr_ptr past the data - * (i.e., @a buf + @a size). If necessary it grows the Message_Block - * buffer. Sets the good_bit to false and returns a -1 on failure. - */ - int adjust (size_t size, - char *&buf); - - /// As above, but now the size and alignment requirements may be - /// different. - int adjust (size_t size, - size_t align, - char *&buf); - - /// Returns true if this stream is writing in non-native byte order - /// and false otherwise. For example, it would be true if either - /// ACE_ENABLE_SWAP_ON_WRITE is defined or a specific byte order was - /// specified for this stream. - bool do_byte_swap (void) const; - - /// Returns the byte order this stream is marshaling data in. Will be one - /// of the values in ACE_CDR::Byte_Order. - int byte_order (void) const; - - /// For use by a gateway, which creates the output stream for the - /// reply to the client in its native byte order, but which must - /// send the reply in the byte order of the target's reply to the - /// gateway. - void reset_byte_order (int byte_order); - - /// set GIOP version info - void set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor); - - /// Set the underlying GIOP version.. - void get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - /// Register and unregister our buffer size monitor. - void register_monitor (const char* id); - void unregister_monitor (void); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -private: - - // Find the message block in the chain of message blocks - // that the provide location locates. - ACE_Message_Block* find (char* loc); - - /// disallow copying... - ACE_OutputCDR (const ACE_OutputCDR& rhs); - ACE_OutputCDR& operator= (const ACE_OutputCDR& rhs); - - ACE_CDR::Boolean write_1 (const ACE_CDR::Octet *x); - ACE_CDR::Boolean write_2 (const ACE_CDR::UShort *x); - ACE_CDR::Boolean write_4 (const ACE_CDR::ULong *x); - ACE_CDR::Boolean write_8 (const ACE_CDR::ULongLong *x); - ACE_CDR::Boolean write_16 (const ACE_CDR::LongDouble *x); - - /** - * write an array of @a length elements, each of @a size bytes and the - * start aligned at a multiple of . The elements are assumed - * to be packed with the right alignment restrictions. It is mostly - * designed for buffers of the basic types. - * - * This operation uses ; as explained above it is expected - * that using assignment is faster that for one element, - * but for several elements should be more efficient, it - * could be interesting to find the break even point and optimize - * for that case, but that would be too platform dependent. - */ - ACE_CDR::Boolean write_array (const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar* x, - ACE_CDR::ULong length); - - /** - * Grow the CDR stream. When it returns @a buf contains a pointer to - * memory in the CDR stream, with at least @a size bytes ahead of it - * and aligned to an boundary. It moved the to . - */ - int grow_and_adjust (size_t size, - size_t align, - char *&buf); - -private: - /// The start of the chain of message blocks. - ACE_Message_Block start_; - - /// The current block in the chain where we are writing. - ACE_Message_Block *current_; - -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - /** - * The current alignment as measured from the start of the buffer. - * Usually this coincides with the alignment of the buffer in - * memory, but, when we chain another buffer this "quasi invariant" - * is broken. - * The current_alignment is used to readjust the buffer following - * the stolen message block. - */ - size_t current_alignment_; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - /** - * Is the current block writable. When we steal a buffer from the - * user and just chain it into the message block we are not supposed - * to write on it, even if it is past the start and end of the - * buffer. - */ - bool current_is_writable_; - - /** - * If not zero swap bytes at writing so the created CDR stream byte - * order does *not* match the machine byte order. The motivation - * for such a beast is that in some setting a few (fast) machines - * can be serving hundreds of slow machines with the opposite byte - * order, so it makes sense (as a load balancing device) to put the - * responsibility in the writers. THIS IS NOT A STANDARD IN CORBA, - * USE AT YOUR OWN RISK - */ - bool do_byte_swap_; - - /// Set to false when an error ocurrs. - bool good_bit_; - - /// Break-even point for copying. - size_t const memcpy_tradeoff_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE::Monitor_Control::Size_Monitor *monitor_; -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -protected: - /// GIOP version information - ACE_CDR::Octet major_version_; - ACE_CDR::Octet minor_version_; - - /// If not nil, invoke for translation of character and string data. - ACE_Char_Codeset_Translator *char_translator_; - ACE_WChar_Codeset_Translator *wchar_translator_; - - /** - * Some wide char codesets may be defined with a maximum number - * of bytes that is smaller than the size of a wchar_t. This means - * that the CDR cannot simply memcpy a block of wchars to and from - * the stream, but must instead realign the bytes appropriately. - * In cases when wchar i/o is not allowed, such as with GIOP 1.0, - * or not having a native wchar codeset defined, the maxbytes is - * set to zero, indicating no wchar data is allowed. - */ - static size_t wchar_maxbytes_; -}; - -// **************************************************************** - -/** - * @class ACE_InputCDR - * - * @brief A CDR stream for demarshalling CDR-encoded data. - * - * This class is based on the the CORBA spec for Java (98-02-29), - * java class omg.org.CORBA.portable.InputStream. It diverts in a - * few ways: - * @li Operations to retrieve basic types take parameters by - * reference. - * @li Operations taking arrays don't have offsets, because in C++ - * it is easier to describe an array starting from x+offset. - * @li Operations return an error status, because exceptions are - * not widely available in C++ (yet). - */ -class ACE_Export ACE_InputCDR -{ -public: - // The translators need privileged access to efficiently demarshal - // arrays and such. - friend class ACE_Char_Codeset_Translator; - friend class ACE_WChar_Codeset_Translator; - - /** - * Create an input stream from an arbitrary buffer. The buffer must - * be properly aligned because this contructor will *not* work if - * the buffer is aligned unproperly.See ACE_ptr_align_binary() for - * instructions on how to align a pointer properly and use - * ACE_CDR::MAX_ALIGNMENT for the correct alignment. - */ - ACE_InputCDR (const char *buf, - size_t bufsiz, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Create an empty input stream. The caller is responsible for - /// putting the right data and providing the right alignment. - ACE_InputCDR (size_t bufsiz, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Create an input stream from an ACE_Message_Block - /** - * The alignment of the @a data block is carried into the new - * ACE_InputCDR object. This constructor either increments the - * @a data reference count, or copies the data (if it's a compound - * message block) so the caller can release the block immediately - * upon return. - */ - ACE_InputCDR (const ACE_Message_Block *data, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION, - ACE_Lock* lock = 0); - - /// Create an input stream from an ACE_Data_Block. The - /// indicates whether the can be deleted by the CDR stream - /// or not - ACE_InputCDR (ACE_Data_Block *data, - ACE_Message_Block::Message_Flags flag = 0, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /// Create an input stream from an ACE_Data_Block. It also sets the - /// read and write pointers at the desired positions. This would be - /// helpful if the applications desires to create a new CDR stream - /// from a semi-processed datablock. - ACE_InputCDR (ACE_Data_Block *data, - ACE_Message_Block::Message_Flags flag, - size_t read_pointer_position, - size_t write_pointer_position, - int byte_order = ACE_CDR::BYTE_ORDER_NATIVE, - ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, - ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); - - /** - * These make a copy of the current stream state, but do not copy - * the internal buffer, so the same stream can be read multiple - * times efficiently. - */ - ACE_InputCDR (const ACE_InputCDR& rhs); - - ACE_InputCDR& operator= (const ACE_InputCDR& rhs); - - /// When interpreting indirected TypeCodes it is useful to make a - /// "copy" of the stream starting in the new position. - ACE_InputCDR (const ACE_InputCDR& rhs, - size_t size, - ACE_CDR::Long offset); - - /// This creates an encapsulated stream, the first byte must be (per - /// the spec) the byte order of the encapsulation. - ACE_InputCDR (const ACE_InputCDR& rhs, - size_t size); - - /// Create an input CDR from an output CDR. - ACE_InputCDR (const ACE_OutputCDR& rhs, - ACE_Allocator* buffer_allocator = 0, - ACE_Allocator* data_block_allocator = 0, - ACE_Allocator* message_block_allocator = 0); - - /// Helper class to transfer the contents from one input CDR to - /// another without requiring any extra memory allocations, data - /// copies or too many temporaries. - struct ACE_Export Transfer_Contents - { - Transfer_Contents (ACE_InputCDR &rhs); - - ACE_InputCDR &rhs_; - }; - /// Transfer the contents from to a new CDR - ACE_InputCDR (Transfer_Contents rhs); - - /// Destructor - ~ACE_InputCDR (void); - - /// Disambiguate overloading when extracting octets, chars, - /// booleans, and bounded strings - //@{ @name Helper classes - - struct ACE_Export to_boolean - { - explicit to_boolean (ACE_CDR::Boolean &b); - ACE_CDR::Boolean &ref_; - }; - - struct ACE_Export to_char - { - explicit to_char (ACE_CDR::Char &c); - ACE_CDR::Char &ref_; - }; - - struct ACE_Export to_wchar - { - explicit to_wchar (ACE_CDR::WChar &wc); - ACE_CDR::WChar &ref_; - }; - - struct ACE_Export to_octet - { - explicit to_octet (ACE_CDR::Octet &o); - ACE_CDR::Octet &ref_; - }; - - struct ACE_Export to_string - { - /** - * @deprecated The constructor taking a non-const string is now - * deprecated (C++ mapping 00-01-02), but we keep it - * around for backward compatibility. - */ - to_string (ACE_CDR::Char *&s, - ACE_CDR::ULong b); - to_string (const ACE_CDR::Char *&s, - ACE_CDR::ULong b); - const ACE_CDR::Char *&val_; - ACE_CDR::ULong bound_; - }; - - struct ACE_Export to_wstring - { - /// The constructor taking a non-const wstring is - /// now deprecated (C++ mapping 00-01-02), but we - /// keep it around for backward compatibility. - to_wstring (ACE_CDR::WChar *&ws, - ACE_CDR::ULong b); - to_wstring (const ACE_CDR::WChar *&ws, - ACE_CDR::ULong b); - const ACE_CDR::WChar *&val_; - ACE_CDR::ULong bound_; - }; - //@} - - /** - * Return @c false on failure and @c true on success. - */ - //@{ @name Read basic IDL types - ACE_CDR::Boolean read_boolean (ACE_CDR::Boolean& x); - ACE_CDR::Boolean read_char (ACE_CDR::Char &x); - ACE_CDR::Boolean read_wchar (ACE_CDR::WChar& x); - ACE_CDR::Boolean read_octet (ACE_CDR::Octet& x); - ACE_CDR::Boolean read_short (ACE_CDR::Short &x); - ACE_CDR::Boolean read_ushort (ACE_CDR::UShort &x); - ACE_CDR::Boolean read_long (ACE_CDR::Long &x); - ACE_CDR::Boolean read_ulong (ACE_CDR::ULong &x); - ACE_CDR::Boolean read_longlong (ACE_CDR::LongLong& x); - ACE_CDR::Boolean read_ulonglong (ACE_CDR::ULongLong& x); - ACE_CDR::Boolean read_float (ACE_CDR::Float &x); - ACE_CDR::Boolean read_double (ACE_CDR::Double &x); - ACE_CDR::Boolean read_longdouble (ACE_CDR::LongDouble &x); - - ACE_CDR::Boolean read_string (ACE_CDR::Char *&x); - ACE_CDR::Boolean read_string (ACE_CString &x); - ACE_CDR::Boolean read_wstring (ACE_CDR::WChar*& x); - //@} - - /** - * The buffer @a x must be large enough to contain @a length - * elements. - * Return @c false on failure and @c true on success. - */ - //@{ @name Read basic IDL types arrays - ACE_CDR::Boolean read_boolean_array (ACE_CDR::Boolean* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_char_array (ACE_CDR::Char *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_wchar_array (ACE_CDR::WChar* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_octet_array (ACE_CDR::Octet* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_short_array (ACE_CDR::Short *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_ushort_array (ACE_CDR::UShort *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_long_array (ACE_CDR::Long *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_ulong_array (ACE_CDR::ULong *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_longlong_array (ACE_CDR::LongLong* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_ulonglong_array (ACE_CDR::ULongLong* x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_float_array (ACE_CDR::Float *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_double_array (ACE_CDR::Double *x, - ACE_CDR::ULong length); - ACE_CDR::Boolean read_longdouble_array (ACE_CDR::LongDouble* x, - ACE_CDR::ULong length); - //@} - - /** - * Return @c false on failure and @c true on success. - */ - //@{ @name Skip elements - ACE_CDR::Boolean skip_boolean (void); - ACE_CDR::Boolean skip_char (void); - ACE_CDR::Boolean skip_wchar (void); - ACE_CDR::Boolean skip_octet (void); - ACE_CDR::Boolean skip_short (void); - ACE_CDR::Boolean skip_ushort (void); - ACE_CDR::Boolean skip_long (void); - ACE_CDR::Boolean skip_ulong (void); - ACE_CDR::Boolean skip_longlong (void); - ACE_CDR::Boolean skip_ulonglong (void); - ACE_CDR::Boolean skip_float (void); - ACE_CDR::Boolean skip_double (void); - ACE_CDR::Boolean skip_longdouble (void); - //@} - - /** - * The next field must be a string, this method skips it. It is - * useful in parsing a TypeCode. - * @return @c false on failure and @c true on success. - */ - ACE_CDR::Boolean skip_wstring (void); - ACE_CDR::Boolean skip_string (void); - - /// Skip @a n bytes in the CDR stream. - /** - * @return @c false on failure and @c true on success. - */ - ACE_CDR::Boolean skip_bytes (size_t n); - - /// returns @c false if a problem has been detected. - bool good_bit (void) const; - - /** - * @return The start of the message block chain for this CDR - * stream. - * - * @note In the current implementation the chain has length 1, but - * we are planning to change that. - */ - const ACE_Message_Block* start (void) const; - - // = The following functions are useful to read the contents of the - // CDR stream from a socket or file. - - /** - * Grow the internal buffer, reset @c rd_ptr to the first byte in - * the new buffer that is properly aligned, and set @c wr_ptr to @c - * rd_ptr @c + @c newsize - */ - int grow (size_t newsize); - - /** - * After reading and partially parsing the contents the user can - * detect a change in the byte order, this method will let him/her - * change it. - */ - void reset_byte_order (int byte_order); - - /// Re-initialize the CDR stream, copying the contents of the chain - /// of message_blocks starting from @a data. - void reset (const ACE_Message_Block *data, - int byte_order); - - /// Steal the contents from the current CDR. - ACE_Message_Block *steal_contents (void); - - /// Steal the contents of @a cdr and make a shallow copy into this - /// stream. - void steal_from (ACE_InputCDR &cdr); - - /// Exchange data blocks with the caller of this method. The read - /// and write pointers are also exchanged. - /** - * @note We now do only with the start_ message block. - */ - void exchange_data_blocks (ACE_InputCDR &cdr); - - /// Copy the data portion from the @c cdr to this cdr and return the - /// data content (ie. the ACE_Data_Block) from this CDR to the - /// caller. - /** - * @note The caller is responsible for managing the memory of the - * returned ACE_Data_Block. - */ - ACE_Data_Block* clone_from (ACE_InputCDR &cdr); - - /// Re-initialize the CDR stream, forgetting about the old contents - /// of the stream and allocating a new buffer (from the allocators). - void reset_contents (void); - - /// Returns the current position for the @c rd_ptr. - char* rd_ptr (void); - - /// Returns the current position for the @c wr_ptr. - char* wr_ptr (void); - - /// Return how many bytes are left in the stream. - size_t length (void) const; - - /** - * Utility function to allow the user more flexibility. - * Skips up to the nearest @a alignment-byte boundary. - * Argument MUST be a power of 2. - * - * @return 0 on success and -1 on failure. - */ - int align_read_ptr (size_t alignment); - - /// If @c true then this stream is writing in non-native byte order. - /// This is only meaningful if ACE_ENABLE_SWAP_ON_WRITE is defined. - bool do_byte_swap (void) const; - - /// If @c do_byte_swap() returns @c false, this returns - /// ACE_CDR_BYTE_ORDER else it returns !ACE_CDR_BYTE_ORDER. - int byte_order (void) const; - - /// Access the codeset translators. They can be nil! - ACE_Char_Codeset_Translator *char_translator (void) const; - ACE_WChar_Codeset_Translator *wchar_translator (void) const; - - /// Set the codeset translators. - void char_translator (ACE_Char_Codeset_Translator *); - void wchar_translator (ACE_WChar_Codeset_Translator *); - - /** - * Returns (in @a buf) the next position in the buffer aligned to - * @a size. It advances the Message_Block @c rd_ptr past the data - * (i.e., @c buf @c + @c size). Sets the good_bit to @c false and - * returns a -1 on failure. - */ - int adjust (size_t size, - char *&buf); - - /// As above, but now the size and alignment requirements may be - /// different. - int adjust (size_t size, - size_t align, - char *&buf); - - /// Set the underlying GIOP version.. - void set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor); - - /// Set the underlying GIOP version.. - void get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - /// Register and unregister our buffer size monitor. - void register_monitor (const char* id); - void unregister_monitor (void); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -protected: - - /// The start of the chain of message blocks, even though in the - /// current version the chain always has length 1. - ACE_Message_Block start_; - - /// The CDR stream byte order does not match the one on the machine, - /// swapping is needed while reading. - bool do_byte_swap_; - - /// set to @c false when an error occurs. - bool good_bit_; - - /// The GIOP versions for this stream - ACE_CDR::Octet major_version_; - ACE_CDR::Octet minor_version_; - - /// If not nil, invoke for translation of character and string data. - ACE_Char_Codeset_Translator *char_translator_; - ACE_WChar_Codeset_Translator *wchar_translator_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE::Monitor_Control::Size_Monitor *monitor_; -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -private: - - ACE_CDR::Boolean read_1 (ACE_CDR::Octet *x); - ACE_CDR::Boolean read_2 (ACE_CDR::UShort *x); - ACE_CDR::Boolean read_4 (ACE_CDR::ULong *x); - ACE_CDR::Boolean read_8 (ACE_CDR::ULongLong *x); - ACE_CDR::Boolean read_16 (ACE_CDR::LongDouble *x); - - // Several types can be read using the same routines, since TAO - // tries to use native types with known size for each CORBA type. - // We could use void* or char* to make the interface more - // consistent, but using native types let us exploit the strict - // alignment requirements of CDR streams and implement the - // operations using asignment. - - /** - * Read an array of @a length elements, each of @a size bytes and the - * start aligned at a multiple of . The elements are assumed - * to be packed with the right alignment restrictions. It is mostly - * designed for buffers of the basic types. - * - * This operation uses ; as explained above it is expected - * that using assignment is faster that for one element, - * but for several elements should be more efficient, it - * could be interesting to find the break even point and optimize - * for that case, but that would be too platform dependent. - */ - ACE_CDR::Boolean read_array (void* x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - /** - * On those occasions when the native codeset for wchar is smaller than - * the size of a wchar_t, such as using UTF-16 with a 4-byte wchar_t, a - * special form of reading the array is needed. Actually, this should be - * a default translator. - */ - ACE_CDR::Boolean read_wchar_array_i (ACE_CDR::WChar * x, - ACE_CDR::ULong length); - - /// Move the rd_ptr ahead by @a offset bytes. - void rd_ptr (size_t offset); - - /// Points to the continuation field of the current message block. - char* end (void); -}; - -// **************************************************************** - -/** - * @class ACE_Char_Codeset_Translator - * - * @brief Codeset translation routines common to both Output and Input - * CDR streams. - * - * This class is a base class for defining codeset translation - * routines to handle the character set translations required by - * both CDR Input streams and CDR Output streams. - * - * Translators are reference counted. This allows for stateful as well - * as stateless translators. Stateless translators will be allocated - * once whereas CDR Streams own their own copy of a stateful translator. - */ -class ACE_Export ACE_Char_Codeset_Translator -{ -public: - virtual ~ACE_Char_Codeset_Translator (); - - /// Read a single character from the stream, converting from the - /// stream codeset to the native codeset - virtual ACE_CDR::Boolean read_char (ACE_InputCDR&, - ACE_CDR::Char&) = 0; - - /// Read a string from the stream, including the length, converting - /// the characters from the stream codeset to the native codeset - virtual ACE_CDR::Boolean read_string (ACE_InputCDR&, - ACE_CDR::Char *&) = 0; - - /// Read an array of characters from the stream, converting the - /// characters from the stream codeset to the native codeset. - virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR&, - ACE_CDR::Char*, - ACE_CDR::ULong) = 0; - - /// Write a single character to the stream, converting from the - /// native codeset to the stream codeset - virtual ACE_CDR::Boolean write_char (ACE_OutputCDR&, - ACE_CDR::Char) = 0; - - /// Write a string to the stream, including the length, converting - /// from the native codeset to the stream codeset - virtual ACE_CDR::Boolean write_string (ACE_OutputCDR&, - ACE_CDR::ULong, - const ACE_CDR::Char*) = 0; - - /// Write an array of characters to the stream, converting from the - /// native codeset to the stream codeset - virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR&, - const ACE_CDR::Char*, - ACE_CDR::ULong) = 0; - - virtual ACE_CDR::ULong ncs () = 0; - virtual ACE_CDR::ULong tcs () = 0; -protected: - /// Children have access to low-level routines because they cannot - /// use read_char or something similar (it would recurse). - ACE_CDR::Boolean read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x); - ACE_CDR::Boolean write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x); - - /// Efficiently read @a length elements of size @a size each from - /// into ; the data must be aligned to . - ACE_CDR::Boolean read_array (ACE_InputCDR& input, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - /** - * Efficiently write @a length elements of size @a size from into - * . Before inserting the elements enough padding is added - * to ensure that the elements will be aligned to in the - * stream. - */ - ACE_CDR::Boolean write_array (ACE_OutputCDR& output, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - /** - * Exposes the stream implementation of , this is useful in - * many cases to minimize memory allocations during marshaling. - * On success @a buf will contain a contiguous area in the CDR stream - * that can hold @a size bytes aligned to . - * Results - */ - int adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf); - - /// Used by derived classes to set errors in the CDR stream. - void good_bit (ACE_OutputCDR& out, bool bit); - - /// Obtain the CDR Stream's major & minor version values. - ACE_CDR::Octet major_version (ACE_InputCDR& input); - ACE_CDR::Octet minor_version (ACE_InputCDR& input); - ACE_CDR::Octet major_version (ACE_OutputCDR& output); - ACE_CDR::Octet minor_version (ACE_OutputCDR& output); -}; - -// **************************************************************** - -/** - * @class ACE_WChar_Codeset_Translator - * - * @brief Codeset translation routines common to both Output and Input - * CDR streams. - * - * This class is a base class for defining codeset translation - * routines to handle the character set translations required by - * both CDR Input streams and CDR Output streams. - */ -class ACE_Export ACE_WChar_Codeset_Translator -{ -public: - virtual ~ACE_WChar_Codeset_Translator (); - - virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR&, - ACE_CDR::WChar&) = 0; - virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&, - ACE_CDR::WChar *&) = 0; - virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&, - ACE_CDR::WChar*, - ACE_CDR::ULong) = 0; - virtual ACE_CDR::Boolean write_wchar (ACE_OutputCDR&, - ACE_CDR::WChar) = 0; - virtual ACE_CDR::Boolean write_wstring (ACE_OutputCDR&, - ACE_CDR::ULong, - const ACE_CDR::WChar*) = 0; - virtual ACE_CDR::Boolean write_wchar_array (ACE_OutputCDR&, - const ACE_CDR::WChar*, - ACE_CDR::ULong) = 0; - - virtual ACE_CDR::ULong ncs () = 0; - virtual ACE_CDR::ULong tcs () = 0; -protected: - /// Children have access to low-level routines because they cannot - /// use read_char or something similar (it would recurse). - ACE_CDR::Boolean read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x); - ACE_CDR::Boolean read_2 (ACE_InputCDR& input, - ACE_CDR::UShort *x); - ACE_CDR::Boolean read_4 (ACE_InputCDR& input, - ACE_CDR::ULong *x); - ACE_CDR::Boolean write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x); - ACE_CDR::Boolean write_2 (ACE_OutputCDR& output, - const ACE_CDR::UShort *x); - ACE_CDR::Boolean write_4 (ACE_OutputCDR& output, - const ACE_CDR::ULong *x); - - /// Efficiently read @a length elements of size @a size each from - /// into ; the data must be aligned to . - ACE_CDR::Boolean read_array (ACE_InputCDR& input, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - /** - * Efficiently write @a length elements of size @a size from into - * . Before inserting the elements enough padding is added - * to ensure that the elements will be aligned to in the - * stream. - */ - ACE_CDR::Boolean write_array (ACE_OutputCDR& output, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - - /** - * Exposes the stream implementation of , this is useful in - * many cases to minimize memory allocations during marshaling. - * On success @a buf will contain a contiguous area in the CDR stream - * that can hold @a size bytes aligned to . - * Results - */ - int adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf); - - /// Used by derived classes to set errors in the CDR stream. - void good_bit (ACE_OutputCDR& out, bool bit); - - /// Obtain the CDR Stream's major & minor version values. - ACE_CDR::Octet major_version (ACE_InputCDR& input); - ACE_CDR::Octet minor_version (ACE_InputCDR& input); - ACE_CDR::Octet major_version (ACE_OutputCDR& output); - ACE_CDR::Octet minor_version (ACE_OutputCDR& output); - -}; - -// @@ These operators should not be inlined since they force SString.h -// to be included in this header. -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CString &x); - -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CString &x); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/CDR_Stream.inl" -#else /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Not used by CORBA or TAO -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Char x); -// CDR output operators for primitive types - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Short x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::UShort x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Long x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::ULong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::LongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::ULongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR& os, - ACE_CDR::LongDouble x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Float x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Double x); - -// CDR output operator from helper classes - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_boolean x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_char x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_wchar x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_octet x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_string x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_wstring x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CDR::Char* x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CDR::WChar* x); - -// Not used by CORBA or TAO -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Char &x); -// CDR input operators for primitive types - -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Short &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::UShort &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Long &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::ULong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::LongLong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::ULongLong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::LongDouble &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Float &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Double &x); - -// CDR input operator from helper classes - -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_boolean x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_char x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_wchar x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_octet x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_string x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_wstring x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Char*& x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::WChar*& x); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* __ACE_INLINE__ */ - -#if defined (GEN_OSTREAM_OPS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// ostream insertion operators for debugging code generated from IDL. All -// but these below are either in generated code itself or are unambiguous -// primitive types. - -ACE_Export std::ostream& operator<< (std::ostream &os, - ACE_OutputCDR::from_boolean x); - -ACE_Export std::ostream& operator<< (std::ostream &os, - ACE_OutputCDR::from_char x); - -ACE_Export std::ostream& operator<< (std::ostream &os, - ACE_OutputCDR::from_wchar x); - -ACE_Export std::ostream& operator<< (std::ostream &os, - ACE_OutputCDR::from_octet x); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* GEN_OSTREAM_OPS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CDR_STREAM_H */ - diff --git a/dep/include/ace/CDR_Stream.inl b/dep/include/ace/CDR_Stream.inl deleted file mode 100644 index bf5a6e25cb2..00000000000 --- a/dep/include/ace/CDR_Stream.inl +++ /dev/null @@ -1,1720 +0,0 @@ -// -*- C++ -*- -// -// $Id: CDR_Stream.inl 82350 2008-07-22 07:36:47Z johnnyw $ - -#include "ace/OS_NS_string.h" -#include "ace/OS_Memory.h" - -// **************************************************************** - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// implementing the special types -ACE_INLINE -ACE_OutputCDR::from_boolean::from_boolean (ACE_CDR::Boolean b) - : val_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::to_boolean::to_boolean (ACE_CDR::Boolean &b) - : ref_ (b) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_octet::from_octet (ACE_CDR::Octet o) - : val_ (o) -{ -} - -ACE_INLINE -ACE_InputCDR::to_octet::to_octet (ACE_CDR::Octet &o) - : ref_ (o) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_char::from_char (ACE_CDR::Char c) - : val_ (c) -{ -} - -ACE_INLINE -ACE_InputCDR::to_char::to_char (ACE_CDR::Char &c) - : ref_ (c) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_wchar::from_wchar (ACE_CDR::WChar wc) - : val_ (wc) -{ -} - -ACE_INLINE -ACE_InputCDR::to_wchar::to_wchar (ACE_CDR::WChar &wc) - : ref_ (wc) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_string::from_string (ACE_CDR::Char *s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (s), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (const_cast (s)), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s, - ACE_CDR::ULong b) - : val_ (const_cast (s)), - bound_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::to_string::to_string (const ACE_CDR::Char *&s, - ACE_CDR::ULong b) - : val_ (s), - bound_ (b) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_wstring::from_wstring (ACE_CDR::WChar *ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (ws), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (const_cast (ws)), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws, - ACE_CDR::ULong b) - : val_ (const_cast (ws)), - bound_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::to_wstring::to_wstring (const ACE_CDR::WChar *&ws, - ACE_CDR::ULong b) - : val_ (ws), - bound_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs) - : rhs_ (rhs) -{ -} - -// **************************************************************** - -ACE_INLINE -ACE_OutputCDR::~ACE_OutputCDR (void) -{ - if (this->start_.cont () != 0) - { - ACE_Message_Block::release (this->start_.cont ()); - this->start_.cont (0); - } - - this->current_ = 0; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->remove_ref (); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_INLINE void -ACE_OutputCDR::reset (void) -{ - this->current_ = &this->start_; - this->current_is_writable_ = true; - ACE_CDR::mb_align (&this->start_); - -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - this->current_alignment_ = 0; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - // It is tempting not to remove the memory, but we need to do so to - // release any potential user buffers chained in the continuation - // field. - - ACE_Message_Block * const cont = this->start_.cont (); - if (cont) - { - ACE_Message_Block::release (cont); - this->start_.cont (0); - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -// Encode the CDR stream. - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_octet (ACE_CDR::Octet x) -{ - return this->write_1 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_boolean (ACE_CDR::Boolean x) -{ - return - static_cast ( - this->write_octet ( - x - ? static_cast (1) - : static_cast (0))); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_char (ACE_CDR::Char x) -{ - if (this->char_translator_ == 0) - { - ACE_CDR::Octet temp = static_cast (x); - return this->write_1 (&temp); - } - return this->char_translator_->write_char (*this, x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_short (ACE_CDR::Short x) -{ - ACE_CDR::UShort temp = static_cast (x); - return this->write_2 (&temp); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ushort (ACE_CDR::UShort x) -{ - return this->write_2 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_long (ACE_CDR::Long x) -{ - ACE_CDR::ULong temp = static_cast (x); - return this->write_4 (&temp); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulong (ACE_CDR::ULong x) -{ - return this->write_4 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longlong (const ACE_CDR::LongLong &x) -{ - void const * const temp = &x; - return this->write_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulonglong (const ACE_CDR::ULongLong &x) -{ - return this->write_8 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_float (ACE_CDR::Float x) -{ - void const * const temp = &x; - return this->write_4 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_double (const ACE_CDR::Double &x) -{ - void const * const temp = &x; - return this->write_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longdouble (const ACE_CDR::LongDouble &x) -{ - return this->write_16 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_string (const ACE_CDR::Char *x) -{ - if (x) - { - ACE_CDR::ULong const len = - static_cast (ACE_OS::strlen (x)); - return this->write_string (len, x); - } - - return this->write_string (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) -{ - if (x) - { - ACE_CDR::ULong const len = - static_cast (ACE_OS::strlen (x)); - return this->write_wstring (len, x); - } - - return this->write_wstring (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length) -{ - if (this->char_translator_ == 0) - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); - return this->char_translator_->write_char_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - if (this->wchar_translator_) - return this->wchar_translator_->write_wchar_array (*this, x, length); - - if (ACE_OutputCDR::wchar_maxbytes_ == 0) - { - errno = EACCES; - return (ACE_CDR::Boolean) (this->good_bit_ = false); - } - - if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar)) - return this->write_array (x, - sizeof (ACE_CDR::WChar), - sizeof (ACE_CDR::WChar) == 2 - ? ACE_CDR::SHORT_ALIGN - : ACE_CDR::LONG_ALIGN, - length); - return this->write_wchar_array_i (x,length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longlong_array (const ACE_CDR::LongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); -} - -ACE_INLINE bool -ACE_OutputCDR::good_bit (void) const -{ - return this->good_bit_; -} - -ACE_INLINE int -ACE_OutputCDR::adjust (size_t size, - size_t align, - char*& buf) -{ - if (!this->current_is_writable_) - return this->grow_and_adjust (size, align, buf); - -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - size_t const offset = - ACE_align_binary (this->current_alignment_, align) - - this->current_alignment_; - - buf = this->current_->wr_ptr () + offset; -#else - buf = this->current_->wr_ptr (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - char * const end = buf + size; - - if (end <= this->current_->end () && - end >= buf) - { -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - this->current_alignment_ += offset + size; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - this->current_->wr_ptr (end); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->total_length ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - return 0; - } - - return this->grow_and_adjust (size, align, buf); -} - -ACE_INLINE int -ACE_OutputCDR::adjust (size_t size, char*& buf) -{ - return this->adjust (size, size, buf); -} - -ACE_INLINE void -ACE_OutputCDR::set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor) -{ - this->major_version_ = major; - this->minor_version_ = minor; -} - -ACE_INLINE void -ACE_OutputCDR::get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor) -{ - major = this->major_version_; - minor = this->minor_version_; -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::begin (void) const -{ - return &this->start_; -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::end (void) const -{ - return this->current_->cont (); -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::current (void) const -{ - return this->current_; -} - -ACE_INLINE size_t -ACE_OutputCDR::total_length (void) const -{ - return ACE_CDR::total_length (this->begin (), this->end ()); -} - -ACE_INLINE const char* -ACE_OutputCDR::buffer (void) const -{ - return this->start_.rd_ptr (); -} - -ACE_INLINE size_t -ACE_OutputCDR::length (void) const -{ - return this->start_.length (); -} - -ACE_INLINE bool -ACE_OutputCDR::do_byte_swap (void) const -{ - return this->do_byte_swap_; -} - -ACE_INLINE int -ACE_OutputCDR::byte_order (void) const -{ - if (this->do_byte_swap ()) - return !ACE_CDR_BYTE_ORDER; - else - return ACE_CDR_BYTE_ORDER; -} - -ACE_INLINE void -ACE_OutputCDR::reset_byte_order (int byte_order) -{ - this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER); -} - -ACE_INLINE size_t -ACE_OutputCDR::current_alignment (void) const -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - return this->current_alignment_; -#else - // Default value set to 0 - return 0; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ -} - -ACE_INLINE void -ACE_OutputCDR::current_alignment (size_t current_alignment) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - this->current_alignment_ = current_alignment; -#else - ACE_UNUSED_ARG (current_alignment); - return 0; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ -} - -ACE_INLINE int -ACE_OutputCDR::align_write_ptr (size_t alignment) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - char *dummy; - return this->adjust (0, alignment, dummy); -#else - ACE_UNUSED_ARG (alignment); - // A return value of -1 from this function is used - // to indicate failure, returning 0 - return 0; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ -} - -ACE_INLINE ACE_Char_Codeset_Translator * -ACE_OutputCDR::char_translator (void) const -{ - return this->char_translator_; -} - -ACE_INLINE ACE_WChar_Codeset_Translator * -ACE_OutputCDR::wchar_translator (void) const -{ - return this->wchar_translator_; -} - -ACE_INLINE void -ACE_OutputCDR::char_translator (ACE_Char_Codeset_Translator * ctran) -{ - this->char_translator_ = ctran; -} - -ACE_INLINE void -ACE_OutputCDR::wchar_translator (ACE_WChar_Codeset_Translator * wctran) -{ - this->wchar_translator_ = wctran; -} - -// **************************************************************** - -ACE_INLINE -ACE_InputCDR::~ACE_InputCDR (void) -{ -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->remove_ref (); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_octet (ACE_CDR::Octet& x) -{ - return this->read_1 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_boolean (ACE_CDR::Boolean& x) -{ - ACE_CDR::Octet tmp = 0; - (void) this->read_octet (tmp); - x = tmp ? true : false; - return (ACE_CDR::Boolean) this->good_bit_; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_char (ACE_CDR::Char &x) -{ - if (this->char_translator_ == 0) - { - void *temp = &x; - return this->read_1 (reinterpret_cast (temp)); - } - return this->char_translator_->read_char (*this, x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_short (ACE_CDR::Short &x) -{ - void *temp = &x; - return this->read_2 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ushort (ACE_CDR::UShort &x) -{ - return this->read_2 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_long (ACE_CDR::Long &x) -{ - void *temp = &x; - return this->read_4 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulong (ACE_CDR::ULong &x) -{ - return this->read_4 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x) -{ - void *temp = &x; - return this->read_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulonglong (ACE_CDR::ULongLong &x) -{ - return this->read_8 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_float (ACE_CDR::Float &x) -{ - void *temp = &x; - return this->read_4 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_double (ACE_CDR::Double &x) -{ - void *temp = &x; - return this->read_8 (reinterpret_cast (temp)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longdouble (ACE_CDR::LongDouble &x) -{ - return this->read_16 (&x); -} - -ACE_INLINE size_t -ACE_InputCDR::length (void) const -{ - return this->start_.length (); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_char_array (ACE_CDR::Char* x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length > this->length ()) - { - this->good_bit_ = false; - return false; - } - - if (this->char_translator_ == 0) - return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); - return this->char_translator_->read_char_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_wchar_array (ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_OutputCDR::wchar_maxbytes_ > this->length ()) - { - this->good_bit_ = false; - return false; - } - - if (this->wchar_translator_ != 0) - return this->wchar_translator_->read_wchar_array (*this, x, length); - if (ACE_OutputCDR::wchar_maxbytes_ != sizeof (ACE_CDR::WChar)) - return this->read_wchar_array_i (x, length); - return this->read_array (x, - sizeof (ACE_CDR::WChar), - sizeof (ACE_CDR::WChar) == 2 - ? ACE_CDR::SHORT_ALIGN - : ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_octet_array (ACE_CDR::Octet* x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::OCTET_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_short_array (ACE_CDR::Short *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::SHORT_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ushort_array (ACE_CDR::UShort *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::SHORT_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_long_array (ACE_CDR::Long *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulong_array (ACE_CDR::ULong *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longlong_array (ACE_CDR::LongLong *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONGLONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulonglong_array (ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONGLONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_float_array (ACE_CDR::Float *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_double_array (ACE_CDR::Double *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONGLONG_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longdouble_array (ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length * ACE_CDR::LONGDOUBLE_SIZE > this->length ()) - { - this->good_bit_ = false; - return false; - } - return this->read_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_octet (void) -{ - ACE_CDR::Octet x; - return this->read_1 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_char (void) -{ - return this->skip_octet (); // sizeof (Char) == sizeof (Octet) -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_boolean (void) -{ - return this->skip_octet () && this->good_bit_; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ushort (void) -{ - ACE_CDR::UShort x; - return this->read_2 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_short (void) -{ - return this->skip_ushort (); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ulong (void) -{ - ACE_CDR::ULong x; - return this->read_4 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_long (void) -{ - return this->skip_ulong (); // sizeof (Long) == sizeof (ULong) -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ulonglong (void) -{ - ACE_CDR::ULongLong x; - return this->read_8 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_longlong (void) -{ - return this->skip_ulonglong (); // sizeof (LongLong) == sizeof (ULongLong) -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_float (void) -{ - return this->skip_ulong (); // sizeof(Float) == sizeof (ULong) -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_double (void) -{ - return this->skip_ulonglong (); // sizeof(Double) == sizeof (ULongLong) -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_longdouble (void) -{ - ACE_CDR::LongDouble x; - return this->read_16 (&x); -} - -ACE_INLINE char* -ACE_InputCDR::end (void) -{ - return this->start_.end (); -} - -ACE_INLINE void -ACE_InputCDR::rd_ptr (size_t offset) -{ - this->start_.rd_ptr (offset); -} - -ACE_INLINE char* -ACE_InputCDR::rd_ptr (void) -{ - return this->start_.rd_ptr (); -} - -ACE_INLINE char* -ACE_InputCDR::wr_ptr (void) -{ - return this->start_.wr_ptr (); -} - -ACE_INLINE int -ACE_InputCDR::adjust (size_t size, - size_t align, - char*& buf) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - buf = ACE_ptr_align_binary (this->rd_ptr (), align); -#else - buf = this->rd_ptr (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - char * const end = buf + size; - if (end <= this->wr_ptr ()) - { - this->start_.rd_ptr (end); - return 0; - } - - this->good_bit_ = false; - return -1; -#if defined (ACE_LACKS_CDR_ALIGNMENT) - ACE_UNUSED_ARG (align); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ -} - -ACE_INLINE int -ACE_InputCDR::adjust (size_t size, - char*& buf) -{ - return this->adjust (size, size, buf); -} - -ACE_INLINE const ACE_Message_Block* -ACE_InputCDR::start (void) const -{ - return &this->start_; -} - -ACE_INLINE bool -ACE_InputCDR::good_bit (void) const -{ - return this->good_bit_; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Char x) -{ - os.write_char (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Short x) -{ - os.write_short (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::UShort x) -{ - os.write_ushort (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Long x) -{ - os.write_long (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::ULong x) -{ - os.write_ulong (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::LongLong x) -{ - os.write_longlong (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::ULongLong x) -{ - os.write_ulonglong (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::LongDouble x) -{ - os.write_longdouble (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Float x) -{ - os.write_float (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Double x) -{ - os.write_double (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CDR::Char *x) -{ - os.write_string (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar *x) -{ - os.write_wstring (x); - return (ACE_CDR::Boolean) os.good_bit (); -} - -// The following use the helper classes -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x) -{ - (void) os.write_boolean (x.val_); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_char x) -{ - os.write_char (x.val_); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wchar x) -{ - os.write_wchar (x.val_); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_octet x) -{ - os.write_octet (x.val_); - return (ACE_CDR::Boolean) os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_string x) -{ - ACE_CDR::ULong len = 0; - - if (x.val_ != 0) - { - len = static_cast (ACE_OS::strlen (x.val_)); - } - - os.write_string (len, x.val_); - return - (ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_)); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x) -{ - ACE_CDR::ULong len = 0; - - if (x.val_ != 0) - { - len = static_cast (ACE_OS::strlen (x.val_)); - } - - os.write_wstring (len, x.val_); - return - (ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_)); -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Char &x) -{ - return is.read_char (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Short &x) -{ - return is.read_short (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::UShort &x) -{ - return is.read_ushort (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>>(ACE_InputCDR &is, ACE_CDR::Long &x) -{ - return is.read_long (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::ULong &x) -{ - return is.read_ulong (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::LongLong &x) -{ - return is.read_longlong (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::ULongLong &x) -{ - return is.read_ulonglong (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::LongDouble &x) -{ - return is.read_longdouble (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Float &x) -{ - return is.read_float (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Double &x) -{ - return is.read_double (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Char *&x) -{ - return is.read_string (x) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::WChar *&x) -{ - return is.read_wstring (x) && is.good_bit (); -} - -// The following use the helper classes -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x) -{ - return is.read_boolean (x.ref_); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_char x) -{ - return is.read_char (x.ref_) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wchar x) -{ - return is.read_wchar (x.ref_) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_octet x) -{ - return is.read_octet (x.ref_) && is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x) -{ - // check if the bounds are satisfied - return - (is.read_string (const_cast (x.val_)) - && is.good_bit () - && (!x.bound_ - || ACE_OS::strlen (x.val_) <= x.bound_)); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x) -{ - // check if the bounds are satisfied - return - (is.read_wstring (const_cast (x.val_)) - && is.good_bit () - && (!x.bound_ - || ACE_OS::strlen (x.val_) <= x.bound_)); -} - -// *************************************************************************** -// We must define these methods here because they use the "read_*" inlined -// methods of the ACE_InputCDR class -// *************************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_boolean (ACE_InputCDR &stream) -{ - ACE_CDR::Boolean x; - return stream.read_boolean (x) ? this->write_boolean (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_char (ACE_InputCDR &stream) -{ - ACE_CDR::Char x; - return stream.read_char (x) ? this->write_char (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_wchar (ACE_InputCDR &stream) -{ - ACE_CDR::WChar x; - return stream.read_wchar (x) ? this->write_wchar (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_octet (ACE_InputCDR &stream) -{ - ACE_CDR::Octet x; - return stream.read_octet (x) ? this->write_octet (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_short (ACE_InputCDR &stream) -{ - ACE_CDR::Short x; - return stream.read_short (x) ? this->write_short (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ushort (ACE_InputCDR &stream) -{ - ACE_CDR::UShort x; - return stream.read_ushort (x) ? this->write_ushort (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_long (ACE_InputCDR &stream) -{ - ACE_CDR::Long x; - return stream.read_long (x) ? this->write_long (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ulong (ACE_InputCDR &stream) -{ - ACE_CDR::ULong x; - return stream.read_ulong (x) ? this->write_ulong (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_longlong (ACE_InputCDR &stream) -{ - ACE_CDR::LongLong x; - return stream.read_longlong (x) ? this->write_longlong (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ulonglong (ACE_InputCDR &stream) -{ - ACE_CDR::ULongLong x; - return stream.read_ulonglong (x) ? this->write_ulonglong (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_float (ACE_InputCDR &stream) -{ - ACE_CDR::Float x; - return stream.read_float (x) ? this->write_float (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_double (ACE_InputCDR &stream) -{ - ACE_CDR::Double x; - return stream.read_double (x) ? this->write_double (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_longdouble (ACE_InputCDR &stream) -{ - ACE_CDR::LongDouble x; - return stream.read_longdouble (x) ? this->write_longdouble (x) : false; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_string (ACE_InputCDR &stream) -{ - ACE_CDR::Char *x = 0; - ACE_CDR::Boolean const flag = - (stream.read_string (x) ? this->write_string (x) : false); - delete [] x; - return flag; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_wstring (ACE_InputCDR &stream) -{ - ACE_CDR::WChar *x = 0; - ACE_CDR::Boolean const flag = - (stream.read_wstring (x) ? this->write_wstring (x) : false); - delete [] x; - return flag; -} - -ACE_INLINE void -ACE_InputCDR::reset_byte_order (int byte_order) -{ - this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER); -} - -ACE_INLINE bool -ACE_InputCDR::do_byte_swap (void) const -{ - return this->do_byte_swap_; -} - -ACE_INLINE int -ACE_InputCDR::byte_order (void) const -{ - return this->do_byte_swap () ? !ACE_CDR_BYTE_ORDER : ACE_CDR_BYTE_ORDER; -} - -ACE_INLINE int -ACE_InputCDR::align_read_ptr (size_t alignment) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - char *buf = ACE_ptr_align_binary (this->rd_ptr (), - alignment); -#else - char *buf = this->rd_ptr (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - if (buf <= this->wr_ptr ()) - { - this->start_.rd_ptr (buf); - return 0; - } - - this->good_bit_ = false; - return -1; -} - -ACE_INLINE void -ACE_InputCDR::set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor) -{ - this->major_version_ = major; - this->minor_version_ = minor; -} - -ACE_INLINE void -ACE_InputCDR::get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor) -{ - major = this->major_version_; - minor = this->minor_version_; -} - -ACE_INLINE ACE_Char_Codeset_Translator * -ACE_InputCDR::char_translator (void) const -{ - return this->char_translator_; -} - -ACE_INLINE ACE_WChar_Codeset_Translator * -ACE_InputCDR::wchar_translator (void) const -{ - return this->wchar_translator_; -} - -ACE_INLINE void -ACE_InputCDR::char_translator (ACE_Char_Codeset_Translator * ctran) -{ - this->char_translator_ = ctran; -} - -ACE_INLINE void -ACE_InputCDR::wchar_translator (ACE_WChar_Codeset_Translator * wctran) -{ - this->wchar_translator_ = wctran; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) -{ - return input.read_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) -{ - return output.write_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return in.read_array (x, size, align, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return out.write_array(x, size, align, length); -} - -ACE_INLINE int -ACE_Char_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) -{ - return out.adjust(size, align, buf); -} - -ACE_INLINE void -ACE_Char_Codeset_Translator::good_bit (ACE_OutputCDR& out, bool bit) -{ - out.good_bit_ = bit; -} - -ACE_INLINE ACE_CDR::Octet -ACE_Char_Codeset_Translator::major_version (ACE_InputCDR& input) -{ - return input.major_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_Char_Codeset_Translator::minor_version (ACE_InputCDR& input) -{ - return input.minor_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_Char_Codeset_Translator::major_version (ACE_OutputCDR& output) -{ - return output.major_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_Char_Codeset_Translator::minor_version (ACE_OutputCDR& output) -{ - return output.minor_version_; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) -{ - return input.read_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_2 (ACE_InputCDR& input, - ACE_CDR::UShort *x) -{ - return input.read_2 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_4 (ACE_InputCDR& input, - ACE_CDR::ULong *x) -{ - return input.read_4 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) -{ - return output.write_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_2 (ACE_OutputCDR& output, - const ACE_CDR::UShort *x) -{ - return output.write_2 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_4 (ACE_OutputCDR& output, - const ACE_CDR::ULong *x) -{ - return output.write_4 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return in.read_array (x, size, align, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return out.write_array(x, size, align, length); -} - -ACE_INLINE int -ACE_WChar_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) -{ - return out.adjust(size, align, buf); -} - -ACE_INLINE void -ACE_WChar_Codeset_Translator::good_bit (ACE_OutputCDR& out, bool bit) -{ - out.good_bit_ = bit; -} - -ACE_INLINE ACE_CDR::Octet -ACE_WChar_Codeset_Translator::major_version (ACE_InputCDR& input) -{ - return input.major_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_WChar_Codeset_Translator::minor_version (ACE_InputCDR& input) -{ - return input.minor_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_WChar_Codeset_Translator::major_version (ACE_OutputCDR& output) -{ - return output.major_version_; -} - -ACE_INLINE ACE_CDR::Octet -ACE_WChar_Codeset_Translator::minor_version (ACE_OutputCDR& output) -{ - return output.minor_version_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/CE_Screen_Output.h b/dep/include/ace/CE_Screen_Output.h deleted file mode 100644 index e4a3e3d92b0..00000000000 --- a/dep/include/ace/CE_Screen_Output.h +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CE_Screen_Output.h - * - * $Id: CE_Screen_Output.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Si Mong Park - */ -//============================================================================= - -#ifndef ACE_CE_SCREEN_OUTPUT_H -#define ACE_CE_SCREEN_OUTPUT_H - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WINCE) - -#include "ace/Log_Msg_Callback.h" -#include "ace/Log_Record.h" - -namespace -{ - const ACE_TCHAR endl[] = ACE_TEXT("\r\n"); - const ACE_TCHAR tab[] = ACE_TEXT("\t"); -} - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_CE_Screen_Output - * - * @brief Replacement of text output for Windows CE. - * - * This class allows standard text output to be displayed on - * text window for Windows CE. Generally, all ACE output will - * go through under CE if and only if user uses WindozeCE - * implementation by using main_ce instead of main. - * Also, for the easier debugging purpose, object pointer of - * this class can be gotten from ACE_Log_Msg::msg_callback() - * and then can be used directly by user just like cout stream. - */ -class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback -{ -public: - - ACE_CE_Screen_Output (HWND hEdit); - - ACE_CE_Screen_Output (void); - - virtual ~ACE_CE_Screen_Output(); - - /// Implementation of pure virtual function from ACE_Log_Msg_Callback. - virtual void log (ACE_Log_Record &log_record); - - /// Interface to specify active window handle. - void SetOutputWindow (HWND hWnd); - - void clear (void); - - /// Stream insertion operator that performs actual print out. - /** - * @note This is the only one operator that performs output. All - * other perators convert the type and use this operator - * underneath. - */ - ACE_CE_Screen_Output& operator << (ACE_TCHAR*); - ACE_CE_Screen_Output& operator << (const ACE_TCHAR*); - - ACE_CE_Screen_Output& operator << (ACE_ANTI_TCHAR* output); - ACE_CE_Screen_Output& operator << (const ACE_ANTI_TCHAR* output); - - ACE_CE_Screen_Output& operator << (char output); - ACE_CE_Screen_Output& operator << (unsigned char output); - - ACE_CE_Screen_Output& operator << (unsigned short output); - - ACE_CE_Screen_Output& operator << (int output); - ACE_CE_Screen_Output& operator << (unsigned int output); - - ACE_CE_Screen_Output& operator << (float output); - - ACE_CE_Screen_Output& operator << (long output); - ACE_CE_Screen_Output& operator << (unsigned long output); - - ACE_CE_Screen_Output& operator << (FILE* pFile); - -private: - - ACE_CE_Screen_Output (ACE_CE_Screen_Output&); - -private: - - HWND handler_; - - /// FILE pointer that used to save output to file. This class does - /// not own the file handler pointer. - FILE* pFile_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif // ACE_HAS_WINCE -#endif // ACE_CE_SCREEN_OUTPUT_H - diff --git a/dep/include/ace/CORBA_macros.h b/dep/include/ace/CORBA_macros.h deleted file mode 100644 index 7284e9ae8e3..00000000000 --- a/dep/include/ace/CORBA_macros.h +++ /dev/null @@ -1,575 +0,0 @@ -// -*- C++ -*- - -// ============================================================================ -/** - * @file CORBA_macros.h - * - * $Id: CORBA_macros.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Writing code that is portable between platforms with or without - * native C++ exceptions is hard. The following macros offer some - * help on this task, mostly oriented to making the ORB code and the - * IDL generated code portable. - * - * @author Nanbor Wang - * @author Aniruddha Gokhale - * @author Carlos O'Ryan , et al. - */ -// ============================================================================ - -// Macros for handling CORBA exceptions. - -#ifndef ACE_CORBA_MACROS_H -#define ACE_CORBA_MACROS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -#define ACE_ENV_POLLUTE_NAMES - -#include "ace/Exception_Macros.h" - -// The Windows MFC exception mechanism requires that a caught CException -// (including the CMemoryException in use here) be freed using its Delete() -// method. Thus, when MFC is in use and we're catching exceptions as a result -// of new(), the exception's Delete() method has to be called. No other -// platform imposes this sort of restriction/requirement. The Windows -// config stuff (at least for MSVC/MFC) defines a ACE_del_bad_alloc macro -// that works with its ACE_bad_alloc macro to implement this cleanup -// requirement. Since no other platform requires this, define it as -// empty here. -#if !defined (ACE_del_bad_alloc) -# define ACE_del_bad_alloc -#endif - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - -// If you wish to you use these macros for emulating exceptions on -// platforms which lack native exception support, you need to do the -// following: -// 1. Define a class Exception. You can name it as you please. This class -// should be at the root of the inheritance hierarchy of all the -// exceptions used in your application. It should define at a minimum -// the following pure virtual methods: -// a) _downcast () - Which allows narrowing of the base exception type to a -// derived type. -// b) _raise() - Which throws an exception of type Exception. -// -// Classes which derive from these should implement these operations. -// -// 2. Define a class Environment. You can name it as you please. This class -// is an exception holder. This class is always on the stack. It should -// support at a minimum the following methods: -// a) exception() - Which returns the Exception held in the current -// Environment. -// b) exception (Exception* foo) - Which replaces/sets the Exception -// held in the current Environment with foo. -// b) clear() - Which resets a particular instance of Environment. -// c) A copy constructor and an assignment operator. -// -// Note that the above description assumes that you use the following -// macros only within a particular domain. For example, if your -// application has to interoperate across domains, then you need to define -// an exception adapter to translate exceptions from one domain to -// exceptions in the other. Please refer to Stroustrup's book on how to do -// this. If your use case is this complex, you would be better off with -// going with native exceptions rather than emulated exceptions, though -// the macros should still work if you defined your adapter class as -// ACE_EXCEPTION_TYPE. - -// The following macros assume that an environment variable is passed -// in/out of each function that can throw an exception. The type of the -// environment variable is defined by ACE_ENV_TYPE. - -#if !defined (ACE_ENV_TYPE) -# define ACE_ENV_TYPE CORBA::Environment -#endif /* ACE_ENV_TYPE */ - -// The name of the variable is defined by ACE_TRY_ENV. Below is the name -// that we use by default. If you wish to change it you can redefine -// ACE_TRY_ENV to change the default name. Also ACE_ADOPT_ENV allows the -// use of non-standard name within a scope. - -#if !defined (ACE_TRY_ENV) -# define ACE_TRY_ENV _ACE_CORBA_Environment_variable -#endif /* ACE_TRY_ENV */ - -// The base type of Exception from which all the other exception types are -// derived. You can set this to any type as you please. By default, it is -// set to CORBA::Exception. - -#if !defined (ACE_EXCEPTION_TYPE) -# define ACE_EXCEPTION_TYPE CORBA::Exception -#endif /* ACE_EXCEPTION_TYPE */ - -// This method is used to get the default value of the Environment -// variable. In the case of TAO, this variable is part of the TSS ORB -// resources and the method TAO_default_environment() returns the -// Environment variable. - -#if !defined (ACE_DEFAULT_GET_ENV_METHOD) -# define ACE_DEFAULT_GET_ENV_METHOD TAO_default_environment -#endif /* ACE_DEFAULT_GET_ENV_METHOD */ - -// This is the exception caught by ACE_CATCHANY. -#if !defined (ACE_ANY_EXCEPTION) -# define ACE_ANY_EXCEPTION ex -#endif /* ACE_ANY_EXCEPTION */ - -// Declare a new environment variable on the stack. The type of the -// environment variable is determined by ACE_ENV_TYPE. -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -// Don't instantiate an emulated exception environment at all when -// using native C++ exception support. It won't be used. -# define ACE_DECLARE_NEW_ENV -#else -# define ACE_DECLARE_NEW_ENV \ - ACE_ENV_TYPE ACE_TRY_ENV -#endif /* ACE_USES_NATIVE_EXCEPTIONS */ - -// Provided for backward compatibility purposes. Don't use it in new code. -// Use the definition above along with defining ACE_ENV_TYPE. - -#if defined (ACE_ENV_POLLUTE_NAMES) -# define ACE_DECLARE_NEW_CORBA_ENV ACE_DECLARE_NEW_ENV -#endif /* ACE_ENV_POLLUTE_NAMES */ - -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -// ----------------------------------------------------------------- - -// Provided for backward compatibility purposes. Don't use it in new code. -#if defined (ACE_ENV_POLLUTE_NAMES) -# define ACE_ADOPT_CORBA_ENV(ENV) -#endif /* ACE_ENV_POLLUTE_NAMES */ - -#define ACE_ADOPT_ENV (ENV) - -// No need to check. Native exceptions handle the control flow -// automatically when an exception occurs. -# define ACE_CHECK - -// Used when the function requires a return value. -# define ACE_CHECK_RETURN(RETV) - -// ACE_THROW_INT should not be used by the user. -# define ACE_THROW_INT(EXCEPTION) \ - throw EXCEPTION - -// Throwing an exception is easy. These two macros should _NOT_ be -// used within try blocks. -# define ACE_THROW(EXCEPTION) \ - throw EXCEPTION - -// Throwing an exception when the function requires a return value. -# define ACE_THROW_RETURN(EXCEPTION,RETV) \ - throw EXCEPTION - -// For compilers with native exceptions, we can simply use try to try. ;-) -// do {} while (0) is required to avoid compilation warnings. -# define ACE_TRY \ - do \ - { \ - try \ - { -# define ACE_TRY_NEW_ENV \ - do \ - { \ - try \ - { -# define ACE_TRY_EX(LABEL) \ - do \ - { \ - try \ - { - -// No need to check for exceptions within try block for compilers with -// native exceptions. -# define ACE_TRY_CHECK -# define ACE_TRY_CHECK_EX(LABEL) - -// Likewise, throwing exceptions within try blocks is easy. -# define ACE_TRY_THROW(EXCEPTION) throw EXCEPTION -# define ACE_TRY_THROW_EX(EXCEPTION,LABEL) throw EXCEPTION - -// Same thing for catch. -# define ACE_CATCH(EXCEPTION,VAR) \ - } \ - catch (EXCEPTION & VAR) \ - { \ - ACE_UNUSED_ARG (VAR); - -# define ACE_CATCHANY \ - ACE_CATCH(ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION) - -# define ACE_CATCHALL \ - } \ - catch (...) \ - { - -# if defined (ACE_HAS_DEPRECATED_ACE_RETHROW) -# define ACE_RETHROW throw -# endif /* ACE_HAS_DEPRECATED_ACE_RETHROW */ - -// Rethrowing the exception from catch blocks. -# define ACE_RE_THROW throw -# define ACE_RE_THROW_EX(LABEL) throw - -// Close the catch block. -# define ACE_ENDTRY \ - } \ - } while (0) - -#else /* ! ACE_USES_NATIVE_EXCEPTIONS */ -// ----------------------------------------------------------------- - -// When handling compilers without native exceptions, things get a bit -// hairy. Exceptions are simulated using ACE_ENV_TYPE. The trick here is to -// make sure the flow-of-control can simulate the case when native -// exceptions occur... - -#if defined (ACE_ENV_POLLUTE_NAMES) -# define ACE_ADOPT_CORBA_ENV(ENV) ACE_ENV_TYPE &ACE_TRY_ENV = ENV -#endif /* ACE_ENV_POLLUTE_NAMES */ - -# define ACE_ADOPT_ENV(ENV) ACE_ENV_TYPE &ACE_TRY_ENV = ENV - -// Follow every statement that could throw exceptions with ACE_CHECK or -// ACE_CHECK_RETURN. These two macros should _NOT_ be used within try -// blocks. Use ACE_TRY_CHECK or ACE_TRY_CHECK_EX instead. -# define ACE_CHECK \ - if (ACE_TRY_ENV . exception () != 0) \ - return -// When function requires a return value -# define ACE_CHECK_RETURN(RETV) \ - if (ACE_TRY_ENV . exception () != 0) \ - return RETV - -// ACE_THROW_INT should not be used by the user. -# define ACE_THROW_INT(EXCEPTION) ACE_TRY_ENV.exception (new EXCEPTION) - -// Throwing exceptions will inevitably cause a return from the current -// function. These two macros should _NOT_ be used within try blocks. Use -// ACE_TRY_THROW or ACE_TRY_THROW_EX instead. -# define ACE_THROW(EXCEPTION) \ - do \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - return; \ - } while (0) - -# define ACE_THROW_RETURN(EXCEPTION,RETV) \ - do \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - return RETV; \ - } while (0) - -// ACE_TRY sets up flags to control program flow. ACE_TRY_FLAG acts like a -// one-shot flip-flop. When an exception occurs (detected using -// ACE_TRY_CHECK,) ACE_TRY_FLAG will be reset and the control goes back -// into ACE_TRY_LABEL. Since ACE_TRY_FLAG is reset, the try block won't get -// executed again and the control proceeds to the following catch blocks. -// ACE_EXCEPTION_NOT_CAUGHT flag is used to prevent catching an exception -// twice. This macro assumes there's already an ACE_ENV_TYPE variable -// ACE_TRY_ENV defined (which should be the case normally) -# define ACE_TRY \ - do { \ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// ACE_TRY_NEW_ENV functions like the macro ACE_TRY but defines a new -// ACE_ENV_TYPE variable ACE_TRY_ENV. It is most often used in the outer -// most function where no ACE_TRY_ENV is available. -# define ACE_TRY_NEW_ENV \ - do { \ - ACE_DECLARE_NEW_ENV;\ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// ACE_TRY_EX works exactly like ACE_TRY macro except the label used in the -// try block is customizable to avoid name clashing. It should be used when -// nested try blocks or multiple try blocks are required, in the same -// function. -# define ACE_TRY_EX(LABEL) \ - do { \ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL ## LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// Check for exceptions within try blocks. -# define ACE_TRY_CHECK \ - { \ - if (ACE_TRY_ENV.exception () != 0) \ - { \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL; \ - } \ - } - -// Checking exception within EX try blocks. -# define ACE_TRY_CHECK_EX(LABEL) \ - { \ - if (ACE_TRY_ENV.exception () != 0) \ - { \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL ## LABEL; \ - } \ - } - -// Throwing exception within TRY blocks. -# define ACE_TRY_THROW(EXCEPTION) \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL; \ - } - -# define ACE_TRY_THROW_EX(EXCEPTION,LABEL) \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL ## LABEL; \ - } - -// When exceptions occur or try block finishes execution without exception, -// control will continue in the catch block. This macro first checks if -// there's any uncaught exception left. If all the conditions are met, we -// have caught an exception. It then resets ACE_EXCEPTION_NOT_CAUGHT to -// prevent subsequent catch blocks from catching the same exception again, -// and extracts out the underlying exception in ACE_TRY_ENV. We also make a -// copy of ACE_TRY_ENV in ACE_CAUGHT_ENV, in case we want to rethrow the -// exception. ACE_TRY_ENV is cleared out after the exception is caught so -// you should not use ACE_TRY_ENV within the catch block(You should use the -// exception directly). -# define ACE_CATCH(TYPE,VAR) \ - } while (0); \ - do \ - if (ACE_TRY_ENV.exception () != 0 && ACE_EXCEPTION_NOT_CAUGHT && \ - TYPE::_downcast(ACE_TRY_ENV.exception ()) != 0) \ - { \ - ACE_ENV_TYPE ACE_CAUGHT_ENV = ACE_TRY_ENV;\ - ACE_EXCEPTION_NOT_CAUGHT = 0; \ - TYPE &VAR = *TYPE::_downcast (ACE_CAUGHT_ENV.exception ()); \ - ACE_UNUSED_ARG (VAR); \ - ACE_TRY_ENV.clear (); - -// ACE_CATCHANY uses ACE_CATCH to catch all exceptions derived from -// ACE_EXCEPTION_TYPE -# define ACE_CATCHANY ACE_CATCH (ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION) - -// Since there's no other exception for compilers without exception -// support, we simply catch all ACE_EXCEPTION_TYPE exceptions for -// ACE_CATCHALL. -# define ACE_CATCHALL ACE_CATCHANY - -# if defined (ACE_HAS_DEPRECATED_ACE_RETHROW) -# define ACE_RETHROW \ - do \ - ACE_TRY_ENV = ACE_CAUGHT_ENV; \ - while (0) -# endif /* ACE_HAS_DEPRECATED_ACE_RETHROW */ - -// Rethrowing exception within catch blocks. Notice that we depend on the -// ACE_CHECK/ACE_CHECK_RETURN following the ACE_ENDTRY, or ACE_TRY_CHECK/ -// ACE_TRY_CHECK_EX following the ACE_ENDTRY when the catch block is within -// another try block, to do the "Right Thing[TM]." -# define ACE_RE_THROW \ - do {\ - ACE_TRY_ENV = ACE_CAUGHT_ENV; \ - goto ACE_TRY_LABEL; \ - } while (0) -# define ACE_RE_THROW_EX(LABEL) \ - do {\ - ACE_TRY_ENV = ACE_CAUGHT_ENV; \ - goto ACE_TRY_LABEL ## LABEL; \ - } while (0) - -// Close the try block. Since exceptions may not get caught, and exceptions -// can also be rethrown from the catch block, it's always a good idea to -// follow ACE_ENDTRY with ACE_CHECK or ACE_TRY_CHECK (depending on the -// context.) -# define ACE_ENDTRY \ - } while (0); \ - } while (0) - -#endif /* ! ACE_USES_NATIVE_EXCEPTIONS */ - -#endif /* !ACE_LACKS_DEPRECATED_MACROS */ - -// ACE_HAS_EXCEPTIONS is not the same as ACE_NEW_THROWS_EXCEPTIONS. -#if defined(ACE_NEW_THROWS_EXCEPTIONS) - -# if defined (ACE_HAS_NEW_NOTHROW) - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new (ACE_nothrow) CONSTRUCTOR; \ - if (POINTER == 0) { throw EXCEPTION; } \ - } while (0) - -# else - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc throw EXCEPTION; } \ - } while (0) - -# endif /* ACE_HAS_NEW_NOTHROW */ - -#else /* ! ACE_NEW_THROWS_EXCEPTIONS */ - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0) { throw EXCEPTION; } \ - } while (0) - -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - -# define ACE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) throw EXCEPTION; - -# define ACE_READ_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Read_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) throw EXCEPTION; - -# define ACE_WRITE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Write_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) throw EXCEPTION; - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - -//@{ -/** - * @name Native C++ exceptions portability macros. - * - * The following macros are used to write code portable between platforms - * with and without native C++ exception support. Their main goal is to - * hide the presence of the ACE_ENV_TYPE argument, but they collaborate - * with the ACE_TRY_* macros to emulate the try/catch blocks. - */ - -/// Define a macro to emit code only when ACE_ENV_TYPE is used -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) -# define ACE_ENV_EMIT_CODE(X) X -#else -# define ACE_ENV_EMIT_CODE(X) -#endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACE_ENV_BKWD_COMPAT */ - -/// Another macro to emit code only when ACE_ENV_TYPE is used -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) -# define ACE_ENV_EMIT_CODE2(X,Y) X,Y -#else -# define ACE_ENV_EMIT_CODE2(X,Y) -#endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACE_ENV_BKWD_COMPAT */ - -/// Helper macro -#define ACE_ENV_EMIT_DUMMY - -/// Declare a ACE_ENV_TYPE argument as the last argument of a -/// function -/** - * Normally this macro is used as follows: - * - * void my_funct (int x, int y ACE_ENV_ARG_DECL); - * - * Its purpose is to provide developers (and users) with a mechanism to - * write code that is portable to platforms with and without native C++ - * exceptions. - */ -#define ACE_ENV_ARG_DECL \ - ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \ - ACE_ENV_TYPE &ACE_TRY_ENV) - -/// Declare a ACE_ENV_TYPE argument with the default value obtained from -/// the ORB/application. -/** - * It is similar to ACE_ENV_ARG_DECL. The name of the default environment - * getter method needs to be changed when switching ORBs or when used with - * another application. - */ -#define ACE_ENV_ARG_DECL_WITH_DEFAULTS \ - ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \ - ACE_ENV_TYPE &ACE_TRY_ENV = \ - ACE_DEFAULT_GET_ENV_METHOD ()) - -/// Declare a ACE_ENV_TYPE argument that is not used by the -/// function definition. -/** - * Similar to ACE_ENV_ARG_DECL, but the formal parameter name is dropped to - * avoid warnings about unused parameters - */ -#define ACE_ENV_ARG_DECL_NOT_USED \ - ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \ - ACE_ENV_TYPE &) - -/// Declare a ACE_ENV_TYPE argument for methods that do not take any other -/// parameters -#define ACE_ENV_SINGLE_ARG_DECL \ - ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV) - -/// Declare a ACE_ENV_TYPE argument with a default value for methods that -/// do not take any other parameters. The name of the default environment -/// getter method needs to be changed when switching ORBs or when used in -/// another application. -#define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS \ - ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV = \ - ACE_DEFAULT_GET_ENV_METHOD ()) - -/// Declare a ACE_ENV_TYPE argument for methods which don't use it. -#define ACE_ENV_SINGLE_ARG_DECL_NOT_USED \ - ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &) - -/// Use the ACE_ENV_TYPE argument in a nested call -#define ACE_ENV_ARG_PARAMETER \ - ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \ - ACE_TRY_ENV) - -/// Use the ACE_ENV_TYPE argument in a nested call, assuming that the -/// called function takes only the ACE_TRY_ENV argument. -#define ACE_ENV_SINGLE_ARG_PARAMETER \ - ACE_ENV_EMIT_CODE(ACE_TRY_ENV) - -/// Eliminate unused argument warnings about ACE_TRY_ENV -#define ACE_ENV_ARG_NOT_USED \ - ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV)) -//@} - -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) -// This thing can be moved above when we drop ACE_ENV_BKWD_COMPAT. -# define ACE_ENV_RAISE(ex) ACE_TRY_ENV.exception (ex) -#else -# define ACE_ENV_RAISE(ex) (ex)->_raise () -#endif /* ACE_USES_NATIVE_EXCEPTIONS */ - -// ============================================================ - -// Print out a TAO exception. This is not CORBA compliant. -# define ACE_PRINT_TAO_EXCEPTION(EX,INFO) \ - EX._tao_print_exception (INFO) - -// Print out a CORBA exception. There is not portable way to -// dump a CORBA exception. If you are using other ORB implementation, -// redefine the macro to get what you want. -# if !defined ACE_PRINT_EXCEPTION -# define ACE_PRINT_EXCEPTION(EX,INFO) ACE_PRINT_TAO_EXCEPTION(EX,INFO) -# endif /* ACE_PRINT_EXCEPTION */ - -#endif /* !ACE_LACKS_DEPRECATED_MACROS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CORBA_MACROS_H */ - diff --git a/dep/include/ace/Cache_Map_Manager_T.h b/dep/include/ace/Cache_Map_Manager_T.h deleted file mode 100644 index 1476597ab54..00000000000 --- a/dep/include/ace/Cache_Map_Manager_T.h +++ /dev/null @@ -1,406 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Cache_Map_Manager_T.h - * - * $Id: Cache_Map_Manager_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef ACE_CACHE_MAP_MANAGER_T_H -#define ACE_CACHE_MAP_MANAGER_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Default_Constants.h" -#include "ace/Global_Macros.h" -#include "ace/Pair_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration. -class ACE_Allocator; - -#define ACE_Cache_Map_Iterator ACMI -#define ACE_Cache_Map_Reverse_Iterator ACMRI - -template -class ACE_Cache_Map_Iterator; - -template -class ACE_Cache_Map_Reverse_Iterator; - -// For linkers that cant grok long names. -#define ACE_Cache_Map_Manager ACMM - -/** - * @class ACE_Cache_Map_Manager - * - * @brief Defines a abstraction that will purge entries from a map. - * - * The will manage the map it contains - * and provide purging on demand from the map. The strategy for - * caching is decided by the user and provided to the Cache - * Manager. The Cache Manager acts as a agent and communicates - * between the Map and the Strategy for purging entries from the - * map. - * No locking mechanism provided since locking at this level - * isn't efficient. Locking has to be provided by the - * application. - */ -template -class ACE_Cache_Map_Manager -{ -public: - - // = Traits. - typedef KEY key_type; - typedef VALUE mapped_type; - typedef CMAP_TYPE map_type; - typedef CACHING_STRATEGY caching_strategy_type; - - typedef ITERATOR_IMPL ITERATOR_IMPLEMENTATION; - typedef REVERSE_ITERATOR_IMPL REVERSE_ITERATOR_IMPLEMENTATION; - - friend class ACE_Cache_Map_Iterator; - friend class ACE_Cache_Map_Reverse_Iterator; - - // = ACE-style iterator typedefs. - typedef ACE_Cache_Map_Iterator - ITERATOR; - typedef ACE_Cache_Map_Reverse_Iterator - REVERSE_ITERATOR; - - // = STL-style iterator typedefs. - typedef ITERATOR - iterator; - typedef REVERSE_ITERATOR - reverse_iterator; - - /** - * The actual value mapped to the key in the map. The - * are used by the strategy and is transparent to the user of this - * class. - */ - typedef ACE_Pair CACHE_VALUE; - - // = Initialization and termination methods. - - /// Initialize a with and - /// @a size entries. - ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_strategy, - size_t size = ACE_DEFAULT_MAP_SIZE, - ACE_Allocator *alloc = 0); - - /// Close down a and release dynamically allocated - /// resources. - virtual ~ACE_Cache_Map_Manager (void); - - /// Initialize a cache with size @a length. - int open (size_t length = ACE_DEFAULT_MAP_SIZE, - ACE_Allocator *alloc = 0); - - /// Close down a cache and release dynamically allocated resources. - int close (void); - - /** - * Associate @a key with @a value. If @a key is already in the CMAP_TYPE - * then the ENTRY is not changed. Returns 0 if a new entry is bound - * successfully, returns 1 if an attempt is made to bind an existing - * entry, and returns -1 if failures occur. - */ - int bind (const KEY &key, - const VALUE &value); - - /** - * Lookup entry in the cache. If it is not found, returns -1. - * If the @a key is located in the CMAP_TYPE object, the CACHING_STRATEGY is - * notified of it via notify_find (int result, ATTRIBUTES &attribute). - * If notify_find also returns 0 (success), then this function returns - * 0 (success) and sets the cached value in @a value. - */ - int find (const KEY &key, - VALUE &value); - - /** - * Lookup entry in the cache. If it is not found, returns -1. - * If the @a key is located in the CMAP_TYPE object, the CACHING_STRATEGY is - * notified of it via notify_find (int result, ATTRIBUTES &attribute). - * If notify_find also returns 0 (success), then this function returns - * 0 (success). - */ - int find (const KEY &key); - - /** - * Reassociate the @a key with @a value. If the @a key already exists - * in the cache then returns 1, on a new bind returns 0 and returns - * -1 in case of any failures. - */ - int rebind (const KEY &key, - const VALUE &value); - - /** - * Reassociate @a key with @a value, storing the old value into the - * "out" parameter @a old_value. The function fails if @a key is not - * in the cache for caches that do not allow user specified keys. - * However, for caches that allow user specified keys, if the key is - * not in the cache, a new @a key / @a value association is created. - */ - int rebind (const KEY &key, - const VALUE &value, - VALUE &old_value); - - /** - * Reassociate @a key with @a value, storing the old key and value - * into the "out" parameters @a old_key and @a old_value. The - * function fails if @a key is not in the cache for caches that do - * not allow user specified keys. However, for caches that allow - * user specified keys, if the key is not in the cache, a new - * @a key / @a value association is created. - */ - int rebind (const KEY &key, - const VALUE &value, - KEY &old_key, - VALUE &old_value); - - /** - * Associate @a key with @a value if and only if @a key is not in the - * cache. If @a key is already in the cache, then the @a value - * parameter is overwritten with the existing value in the - * cache. Returns 0 if a new @a key / @a value association is created. - * Returns 1 if an attempt is made to bind an existing entry. This - * function fails for maps that do not allow user specified keys. - */ - int trybind (const KEY &key, - VALUE &value); - - /// Remove @a key from the cache. - int unbind (const KEY &key); - - /// Remove @a key from the cache, and return the @a value associated with - /// @a key. - int unbind (const KEY &key, - VALUE &value); - - /// Remove entries from the cache depending upon the strategy. - int purge (void); - - /// Return the current size of the cache. - size_t current_size (void) const; - - /// Return the total size of the cache. - size_t total_size (void) const; - - /// Dumps the state of the object. - void dump (void) const; - - // = STL styled iterator factory functions. - - /// Return forward iterator. - ITERATOR begin (void); - ITERATOR end (void); - - /// Return reverse iterator. - REVERSE_ITERATOR rbegin (void); - REVERSE_ITERATOR rend (void); - - /// The map managed by the Cache_Map_Manager. - CMAP_TYPE &map (void); - - /// The caching strategy used on the cache. - CACHING_STRATEGY &caching_strategy (void); - -protected: - - /// The underlying map which needs to be cached. - CMAP_TYPE map_; - - /// The strategy to be followed for caching entries in the map. - CACHING_STRATEGY &caching_strategy_; - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Cache_Map_Manager &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Cache_Map_Manager (const ACE_Cache_Map_Manager &)) - -}; - -/** - * @class ACE_Cache_Map_Iterator - * - * @brief Defines a iterator for the Cache_Map_Manager. - * - * Implementation to be provided by the iterator of the map - * managed by the ACE_Cache_Map_Manager. - */ -template -class ACE_Cache_Map_Iterator -{ - -public: - - // = Traits. - /// The actual value mapped to the key in the cache. The - /// are used by the strategy and is transperant to the cache user. - typedef ACE_Reference_Pair - value_type; - typedef ACE_Pair - CACHE_VALUE; - - // = Initialisation and termination methods. - - ACE_Cache_Map_Iterator (const IMPLEMENTATION &iterator_impl); - - /// Copy constructor. - ACE_Cache_Map_Iterator (const ACE_Cache_Map_Iterator &rhs); - - virtual ~ACE_Cache_Map_Iterator (void); - - // = Iteration methods. - - /// assignment operator. - ACE_Cache_Map_Iterator &operator= - (const ACE_Cache_Map_Iterator &rhs); - - /// Comparision operators. - bool operator== (const ACE_Cache_Map_Iterator &rhs) const; - bool operator!= (const ACE_Cache_Map_Iterator &rhs) const; - - /// Returns a reference to the internal element @c this is pointing - /// to. - ACE_Reference_Pair operator* (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Prefix advance - ACE_Cache_Map_Iterator &operator++ (void); - - /// Postfix advance. - ACE_Cache_Map_Iterator operator++ (int); - - /// Prefix reverse. - ACE_Cache_Map_Iterator &operator-- (void); - - /// Postfix reverse. - ACE_Cache_Map_Iterator operator-- (int); - - /// Returns the iterator of the internal map in the custody of the - /// Cache_Map_Manager. - IMPLEMENTATION &iterator_implementation (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// The actual iterator which iterates internally on the map - /// belonging to the Cache_Map_Manager. - IMPLEMENTATION iterator_implementation_; -}; - -/** - * @class ACE_Cache_Map_Reverse_Iterator - * - * @brief Defines a reverse iterator for the Cache_Map_Manager. - * - * Implementation to be provided by the reverse iterator of the map - * managed by thr Cache_Map_manager. - */ -template -class ACE_Cache_Map_Reverse_Iterator -{ -public: - - // = Traits. - /// The actual value mapped to the key in the cache. The - /// are used by the strategy and is transperant to the cache user. - typedef ACE_Reference_Pair value_type; - typedef ACE_Pair CACHE_VALUE; - - // = Initialisation and termination methods. - - ACE_Cache_Map_Reverse_Iterator (const REVERSE_IMPLEMENTATION &iterator_impl); - - /// Copy constructor. - ACE_Cache_Map_Reverse_Iterator (const ACE_Cache_Map_Reverse_Iterator &rhs); - - ~ACE_Cache_Map_Reverse_Iterator (void); - - // = Iteration methods. - - /// Assignment operator. - ACE_Cache_Map_Reverse_Iterator &operator= - (const ACE_Cache_Map_Reverse_Iterator &rhs); - - /// Comparision operators. - bool operator== (const ACE_Cache_Map_Reverse_Iterator &rhs) const; - bool operator!= (const ACE_Cache_Map_Reverse_Iterator &rhs) const; - - /// Returns a reference to the internal element @c this is pointing - /// to. - ACE_Reference_Pair operator* (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Prefix advance - ACE_Cache_Map_Reverse_Iterator &operator++ (void); - - /// Postfix advance. - ACE_Cache_Map_Reverse_Iterator operator++ (int); - - /// Prefix reverse. - ACE_Cache_Map_Reverse_Iterator &operator-- (void); - - /// Postfix reverse. - ACE_Cache_Map_Reverse_Iterator operator-- (int); - - /// Returns the iterator of the internal map in the custody of the - /// Cache_Map_Manager. - REVERSE_IMPLEMENTATION &iterator_implementation (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// The actual iterator which iterates internally on the map - /// belonging to the Cache_Map_Manager. - REVERSE_IMPLEMENTATION reverse_iterator_implementation_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Cache_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cache_Map_Manager_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cache_Map_Manager_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CACHE_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Cache_Map_Manager_T.inl b/dep/include/ace/Cache_Map_Manager_T.inl deleted file mode 100644 index 5c5c4eb593e..00000000000 --- a/dep/include/ace/Cache_Map_Manager_T.inl +++ /dev/null @@ -1,244 +0,0 @@ -// -*- C++ -*- -// -//$Id: Cache_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Cache_Map_Manager::purge (void) -{ - return this->caching_strategy ().caching_utility ().clear_cache (this->map_, - this->caching_strategy ().purge_percent ()); -} - -template ACE_INLINE size_t -ACE_Cache_Map_Manager::current_size (void) const -{ - return this->map_.current_size (); -} - -template ACE_INLINE size_t -ACE_Cache_Map_Manager::total_size (void) const -{ - return this->map_.total_size (); -} - -template ACE_INLINE CMAP_TYPE & -ACE_Cache_Map_Manager::map (void) -{ - return this->map_; -} - -template ACE_INLINE CACHING_STRATEGY & -ACE_Cache_Map_Manager::caching_strategy (void) -{ - return this->caching_strategy_; -} - -template ACE_INLINE ACE_Cache_Map_Iterator -ACE_Cache_Map_Manager::begin (void) -{ - return ITERATOR (this->map_.begin ()); -} - -template ACE_INLINE ACE_Cache_Map_Iterator -ACE_Cache_Map_Manager::end (void) -{ - return ITERATOR (this->map_.end ()); -} - -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Manager::rbegin (void) -{ - return REVERSE_ITERATOR (this->map_.rbegin ()); -} -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Manager::rend (void) -{ - return REVERSE_ITERATOR (this->map_.rend ()); -} - -//////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE -ACE_Cache_Map_Iterator::ACE_Cache_Map_Iterator (const ACE_Cache_Map_Iterator &rhs) - : iterator_implementation_ (rhs.iterator_implementation_) -{ -} - -template ACE_INLINE ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator= (const ACE_Cache_Map_Iterator &rhs) -{ - this->iterator_implementation_ = rhs.iterator_implementation_; - return *this; -} - -template ACE_INLINE bool -ACE_Cache_Map_Iterator::operator== (const ACE_Cache_Map_Iterator &rhs) const -{ - return this->iterator_implementation_ == rhs.iterator_implementation_; -} - -template ACE_INLINE bool -ACE_Cache_Map_Iterator::operator!= (const ACE_Cache_Map_Iterator &rhs) const -{ - return this->iterator_implementation_ != rhs.iterator_implementation_; -} - -template ACE_INLINE ACE_Reference_Pair -ACE_Cache_Map_Iterator::operator* (void) const -{ - value_type retn ((*this->iterator_implementation_).ext_id_, - (*this->iterator_implementation_).int_id_.first ()); - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator++ (void) -{ - ++this->iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator -ACE_Cache_Map_Iterator::operator++ (int) -{ - ACE_Cache_Map_Iterator retn = *this; - ++this->iterator_implementation_; - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator-- (void) -{ - --this->iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator -ACE_Cache_Map_Iterator::operator-- (int) -{ - ACE_Cache_Map_Iterator retn = *this; - --this->iterator_implementation_; - return retn; -} - -template ACE_INLINE void -ACE_Cache_Map_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->iterator_implementation_.dump (); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE -ACE_Cache_Map_Iterator::ACE_Cache_Map_Iterator (const IMPLEMENTATION &iterator_impl) - : iterator_implementation_ (iterator_impl) -{ -} - -template ACE_INLINE IMPLEMENTATION & -ACE_Cache_Map_Iterator::iterator_implementation (void) -{ - return this->iterator_implementation_; -} - -//////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::ACE_Cache_Map_Reverse_Iterator (const ACE_Cache_Map_Reverse_Iterator &rhs) - : reverse_iterator_implementation_ (rhs.reverse_iterator_implementation_) -{ -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::~ACE_Cache_Map_Reverse_Iterator (void) -{ -} - -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator= (const ACE_Cache_Map_Reverse_Iterator &rhs) -{ - this->reverse_iterator_implementation_ = rhs.reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE bool -ACE_Cache_Map_Reverse_Iterator::operator== (const ACE_Cache_Map_Reverse_Iterator &rhs) const -{ - return this->reverse_iterator_implementation_ == rhs.reverse_iterator_implementation_; -} - -template ACE_INLINE bool -ACE_Cache_Map_Reverse_Iterator::operator!= (const ACE_Cache_Map_Reverse_Iterator &rhs) const -{ - return this->reverse_iterator_implementation_ != rhs.reverse_iterator_implementation_; -} - -template ACE_INLINE ACE_Reference_Pair -ACE_Cache_Map_Reverse_Iterator::operator* (void) const -{ - value_type retv ((*this->reverse_iterator_implementation_).ext_id_, - (*this->reverse_iterator_implementation_).int_id_.first ()); - return retv; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator++ (void) -{ - ++this->reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Reverse_Iterator::operator++ (int) -{ - ACE_Cache_Map_Reverse_Iterator retn = *this; - ++this->reverse_iterator_implementation_; - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator-- (void) -{ - --this->reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Reverse_Iterator::operator-- (int) -{ - ACE_Cache_Map_Reverse_Iterator retn = *this; - --this->reverse_iterator_implementation_; - return retn; -} - -template ACE_INLINE void -ACE_Cache_Map_Reverse_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->reverse_iterator_implementation_.dump (); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::ACE_Cache_Map_Reverse_Iterator (const REVERSE_IMPLEMENTATION &iterator_impl) - : reverse_iterator_implementation_(iterator_impl) -{ -} - -template ACE_INLINE REVERSE_IMPLEMENTATION & -ACE_Cache_Map_Reverse_Iterator::iterator_implementation (void) -{ - return this->reverse_iterator_implementation_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Cached_Connect_Strategy_T.h b/dep/include/ace/Cached_Connect_Strategy_T.h deleted file mode 100644 index 9f3227b54f1..00000000000 --- a/dep/include/ace/Cached_Connect_Strategy_T.h +++ /dev/null @@ -1,263 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Cached_Connect_Strategy_T.h - * - * $Id: Cached_Connect_Strategy_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef CACHED_CONNECT_STRATEGY_T_H -#define CACHED_CONNECT_STRATEGY_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Strategies_T.h" -#include "ace/Hash_Cache_Map_Manager_T.h" -#include "ace/Caching_Strategies_T.h" -#include "ace/Functor_T.h" -#include "ace/Pair_T.h" - -// For linkers which cant grok long names... -#define ACE_Cached_Connect_Strategy_Ex ACCSE - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Cached_Connect_Strategy_Ex - * - * @brief A connection strategy which caches connections to peers - * (represented by SVC_HANDLER instances), thereby allowing - * subsequent re-use of unused, but available, connections. - * - * is intended to be used as a - * plug-in connection strategy for ACE_Strategy_Connector. - * It's added value is re-use of established connections and - * tweaking the role of the cache as per the caching strategy. - */ -template -class ACE_Cached_Connect_Strategy_Ex - : public ACE_Cached_Connect_Strategy -{ -public: - /// Constructor - ACE_Cached_Connect_Strategy_Ex ( - CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s = 0, - ACE_Concurrency_Strategy *con_s = 0, - ACE_Recycling_Strategy *rec_s = 0, - MUTEX *lock = 0, - int delete_lock = 0); - - /// Destructor - virtual ~ACE_Cached_Connect_Strategy_Ex (void); - - /// Explicit purging of connection entries from the connection cache. - virtual int purge_connections (void); - - /// Mark as closed (non-locking version). This is used during the cleanup of the - /// connections purged. - virtual int mark_as_closed_i (const void *recycling_act); - - /** - * Since g++ version < 2.8 arent happy with templates, this special - * method had to be devised to avoid memory leaks and perform - * cleanup of the . - */ - void cleanup (void); - - // = Typedefs for managing the map - typedef ACE_Refcounted_Hash_Recyclable - REFCOUNTED_HASH_RECYCLABLE_ADDRESS; - typedef ACE_Hash_Cache_Map_Manager, - ACE_Equal_To, - CACHING_STRATEGY, - ATTRIBUTES> - CONNECTION_CACHE; - typedef typename CONNECTION_CACHE::CACHE_ENTRY CONNECTION_CACHE_ENTRY; - typedef typename CONNECTION_CACHE::key_type KEY; - typedef typename CONNECTION_CACHE::mapped_type VALUE; - - typedef ACE_Recyclable_Handler_Cleanup_Strategy, - ACE_Hash_Map_Manager_Ex, - ACE_Hash, - ACE_Equal_To, - MUTEX> > - CLEANUP_STRATEGY; - - typedef ACE_Cached_Connect_Strategy - CCSBASE; - - // = Accessor. - CACHING_STRATEGY &caching_strategy (void); - -protected: - - /// Find an idle handle. - int find (ACE_Refcounted_Hash_Recyclable &search_addr, - ACE_Hash_Map_Entry, ACE_Pair > *&entry); - - /// Remove from cache (non-locking version). - virtual int purge_i (const void *recycling_act); - - /// Add to cache (non-locking version). - virtual int cache_i (const void *recycling_act); - - /// Get/Set (non-locking version). - virtual int recycle_state_i (const void *recycling_act, - ACE_Recyclable_State new_state); - virtual ACE_Recyclable_State recycle_state_i (const void *recycling_act) const; - - /// Cleanup hint and reset <*act_holder> to zero if . - virtual int cleanup_hint_i (const void *recycling_act, - void **act_holder); - - // = Helpers - int check_hint_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found); - - virtual int find_or_create_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found); - - virtual int connect_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int &found); - - /** - * Connection of the svc_handler with the remote host. This method - * also encapsulates the connection done with auto_purging under the - * hood. If the connect failed due to the process running out of - * file descriptors then, auto_purging of some connections are done - * from the CONNECTION_CACHE. This frees the descriptors which get - * used in the connect process and hence the connect operation can - * succeed. - */ - virtual int cached_connect (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /// Table that maintains the cache of connected SVC_HANDLERs. - CONNECTION_CACHE connection_cache_; -}; - -///////////////////////////////////////////////////////////////////////////// - -// For linkers which cant grok long names... -#define ACE_Bounded_Cached_Connect_Strategy ABCCS - -/** - * @class ACE_Bounded_Cached_Connect_Strategy - * - * @brief A connection strategy which caches connections to peers - * (represented by SVC_HANDLER instances), thereby allowing - * subsequent re-use of unused, but available, connections. - * This strategy should be used when the cache is bounded by - * maximum size. - * - * is intended to be used as a - * plug-in connection strategy for ACE_Strategy_Connector. - * It's added value is re-use of established connections and - * tweaking the role of the cache as per the caching strategy. - * Thanks to Edan Ayal for contributing this - * class and Susan Liebeskind for - * brainstorming about it. - */ -template -class ACE_Bounded_Cached_Connect_Strategy - : public ACE_Cached_Connect_Strategy_Ex -{ - - typedef ACE_Cached_Connect_Strategy_Ex - CCSEBASE; - - // = Typedefs for managing the map - typedef ACE_Refcounted_Hash_Recyclable - REFCOUNTED_HASH_RECYCLABLE_ADDRESS; - -public: - - /// Constructor - ACE_Bounded_Cached_Connect_Strategy (size_t max_size, - CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s = 0, - ACE_Concurrency_Strategy *con_s = 0, - ACE_Recycling_Strategy *rec_s = 0, - MUTEX *lock = 0, - int delete_lock = 0); - - /// Destructor - virtual ~ACE_Bounded_Cached_Connect_Strategy (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - virtual int find_or_create_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, - ACE_Pair > *&entry, - int &found); - -protected: - - /// max items in the cache, used as a bound for the creation of svc_handlers. - size_t max_size_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cached_Connect_Strategy_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cached_Connect_Strategy_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* CACHED_CONNECT_STRATEGY_T_H */ - diff --git a/dep/include/ace/Caching_Strategies_T.h b/dep/include/ace/Caching_Strategies_T.h deleted file mode 100644 index e2fa428c3b7..00000000000 --- a/dep/include/ace/Caching_Strategies_T.h +++ /dev/null @@ -1,552 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Caching_Strategies_T.h - * - * $Id: Caching_Strategies_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef ACE_CACHING_STRATEGIES_H -#define ACE_CACHING_STRATEGIES_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Caching_Utility_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined(_MSC_VER) -#pragma warning(disable:4503) -#endif /* _MSC_VER */ - -// For linkers that cant grok long names. -#define ACE_Caching_Strategy ACS - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Caching_Strategy - * - * @brief This class is an abstract base class for a caching strategy. - * - * This class consists of all the interfaces a caching strategy should - * have and is used in association with the - * ACE_Caching_Strategy_Adaptor. - */ -template -class ACE_Caching_Strategy -{ -public: - /// Destructor. - virtual ~ACE_Caching_Strategy (void); - - /// Accessor method for the timer attributes. - virtual ATTRIBUTES attributes (void) = 0; - - /// Get the percentage of entries to purge. - virtual double purge_percent (void) = 0; - - /// Set the percentage of entries to purge. - virtual void purge_percent (double percentage) = 0; - - // = Strategy related Operations - - /// This method acts as a notification about the CONTAINERs bind - /// method call. - virtual int notify_bind (int result, - const ATTRIBUTES &attr) = 0; - - /// This method acts as a notification about the CONTAINERs find - /// method call - virtual int notify_find (int result, - ATTRIBUTES &attr) = 0; - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - virtual int notify_unbind (int result, - const ATTRIBUTES &attr) = 0; - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - virtual int notify_trybind (int result, - ATTRIBUTES &attr) = 0; - - /// This method acts as a notification about the CONTAINERs rebind - /// method call - virtual int notify_rebind (int result, - const ATTRIBUTES &attr) = 0; - - /// Purge the cache. - virtual CACHING_UTILITY &caching_utility (void) = 0; - - /// Dumps the state of the object. - virtual void dump (void) const = 0; -}; - -////////////////////////////////////////////////////////////////////////// - -#define ACE_Caching_Strategy_Adapter ACSA - -/** - * @class ACE_Caching_Strategy_Adapter - * - * @brief This class follows the Adaptor pattern and is used to provide - * External Polymorphism by deriving from ACE_Caching_Strategy. - * - * This class simply delegates all requests to the - * IMPLEMNETATION object within. This class should be passed in - * place of the the abstract base ACE_Caching_Strategy class as - * part of the External Polymorphism pattern. - */ -template -class ACE_Caching_Strategy_Adapter - : public ACE_Caching_Strategy -{ - -public: - - /// Constructor. - ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation = 0, - bool delete_implementation = false); - - /// Destructor. - ~ACE_Caching_Strategy_Adapter (void); - - /// Accessor method for the timer attributes. - ATTRIBUTES attributes (void); - - /// Get the percentage of entries to purge. - double purge_percent (void); - - /// Set the percentage of entries to purge. - void purge_percent (double percentage); - - // = Strategy related Operations - - /// This method acts as a notification about the CONTAINERs bind - /// method call. - int notify_bind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs find - /// method call - int notify_find (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - int notify_unbind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - int notify_trybind (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs rebind - /// method call - int notify_rebind (int result, - const ATTRIBUTES &attr); - - /// Accessor to the implementation. - IMPLEMENTATION &implementation (void); - - /// Purge the cache. - CACHING_UTILITY &caching_utility (void); - - /// Dumps the state of the object. - void dump (void) const; - -private: - - /// Implementation class. - IMPLEMENTATION *implementation_; - - /// Do we need to delete the implementation? - bool delete_implementation_; -}; - -////////////////////////////////////////////////////////////////////////// -#define ACE_LRU_Caching_Strategy ALRU - -/** - * @class ACE_LRU_Caching_Strategy - * - * @brief Defines a Least Recently Used strategy which will decide on - * the item to be removed from the cache. - * - * This is a strategy which makes use of a virtual timer which - * is updated whenever an item is inserted or looked up in the - * container. When the need of purging entries arises, the items - * with the lowest timer values are removed. - * Explanation of the template parameter list: - * CONTAINER is any map with entries of type . - * The ATTRIBUTES are the deciding factor for purging of entries - * and should logically be included with the VALUE. Some ways of - * doing this are: As being a member of the VALUE or VALUE being - * ACE_Pair. The CACHING_UTILITY is the - * class which can be plugged in and which decides the entries - * to purge. - */ -template -class ACE_LRU_Caching_Strategy -{ -public: - - // Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination. - - /** - * The is the map in which the entries reside. The - * timer attribute is initialed to zero in this constructor. And - * the field denotes the percentage of the entries - * in the cache which can be purged automagically and by default is - * set to 10%. - */ - ACE_LRU_Caching_Strategy (void); - - // = Operations of the strategy. - - /// Accessor method for the timer attributes. - ATTRIBUTES attributes (void); - - /// Get the percentage of entries to purge. - double purge_percent (void); - - /// Set the percentage of entries to purge. - void purge_percent (double percentage); - - // = Strategy related Operations - - /// This method acts as a notification about the CONTAINERs bind - /// method call. - int notify_bind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs find - /// method call - int notify_find (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - int notify_unbind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - int notify_trybind (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs rebind - /// method call - int notify_rebind (int result, - const ATTRIBUTES &attr); - - /// Purge the cache. - CACHING_UTILITY &caching_utility (void); - - /// Dumps the state of the object. - void dump (void) const; - -private: - - /// This element is the one which is the deciding factor for purging - /// of an ITEM. - ATTRIBUTES timer_; - - /// The level about which the purging will happen automagically. - double purge_percent_; - - /// This is the helper class which will decide and expunge entries - /// from the cache. - CACHING_UTILITY caching_utility_; -}; - -////////////////////////////////////////////////////////////////////////// -#define ACE_LFU_Caching_Strategy ALFU - -/** - * @class ACE_LFU_Caching_Strategy - * - * @brief Defines a Least Frequently Used strategy for which will decide on - * the item to be removed from the cache. - * - * A attribute is tagged to each item which increments whenever - * the item is bound or looked up in the cache. Thus it denotes - * the frequency of use. According to the value of the attribute - * the item is removed from the CONTAINER i.e cache. - * Explanation of the template parameter list: - * CONTAINER is any map with entries of type . - * The ATTRIBUTES are the deciding factor for purging of entries - * and should logically be included with the VALUE. Some ways of - * doing this are: As being a member of the VALUE or VALUE being - * ACE_Pair. The CACHING_UTILITY is the - * class which can be plugged in and which decides the entries - * to purge. - */ -template -class ACE_LFU_Caching_Strategy -{ - -public: - - // Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination methods. - - /** - * The is the map in which the entries reside. The - * timer attribute is initialed to zero in this constructor. And - * the field denotes the percentage of the entries - * in the cache which can be purged automagically and by default is - * set to 10%. - */ - ACE_LFU_Caching_Strategy (void); - - // = Strategy methods. - - /// Access the attributes. - ATTRIBUTES attributes (void); - - /// Get the percentage of entries to purge. - double purge_percent (void); - - /// Set the percentage of entries to purge. - void purge_percent (double percentage); - - // = Strategy related Operations - - /// This method acts as a notification about the CONTAINERs bind - /// method call. - int notify_bind (int result, - const ATTRIBUTES &attr); - - /// Lookup notification. - int notify_find (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - int notify_unbind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - int notify_trybind (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs rebind - /// method call - int notify_rebind (int result, - const ATTRIBUTES &attr); - - /// Purge the cache. - CACHING_UTILITY &caching_utility (void); - - /// Dumps the state of the object. - void dump (void) const; - -private: - - /// The level about which the purging will happen automagically. - double purge_percent_; - - /// This is the helper class which will decide and expunge entries - /// from the cache. - CACHING_UTILITY caching_utility_; -}; - -///////////////////////////////////////////////////////////// -#define ACE_FIFO_Caching_Strategy AFIFO - -/** - * @class ACE_FIFO_Caching_Strategy - * - * @brief The First In First Out strategy is implemented wherein each - * item is ordered. - * - * The order tag of each item is used to decide the item to be - * removed from the cache. The items with least order are removed. - * Explanation of the template parameter list: - * CONTAINER is any map with entries of type . - * The ATTRIBUTES are the deciding factor for purging of entries - * and should logically be included with the VALUE. Some ways of - * doing this are: As being a member of the VALUE or VALUE being - * ACE_Pair. The CACHING_UTILITY is the - * class which can be plugged in and which decides the entries - * to purge. - */ -template -class ACE_FIFO_Caching_Strategy -{ - -public: - - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination. - - /** - * The is the map in which the entries reside. The - * timer attribute is initialed to zero in this constructor. And - * the field denotes the percentage of the entries - * in the cache which can be purged automagically and by default is - * set to 10%. - */ - ACE_FIFO_Caching_Strategy (void); - - // = Strategy methods. - - /// Accessor method. - ATTRIBUTES attributes (void); - - /// Get the percentage of entries to purge. - double purge_percent (void); - - /// Set the percentage of entries to purge. - void purge_percent (double percentage); - - // = Strategy related Operations - - /// Notification for an item getting bound into the cache. - int notify_bind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs find - /// method call - int notify_find (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - int notify_unbind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - int notify_trybind (int result, - ATTRIBUTES &attr); - - /// Notification for an item getting bound again into the cache. - int notify_rebind (int result, - const ATTRIBUTES &attr); - - /// Purge the cache. - CACHING_UTILITY &caching_utility (void); - - /// Dumps the state of the object. - void dump (void) const; - -private: - - /// The order is the deciding factor for the item to be removed from - /// the cache. - ATTRIBUTES order_; - - /// The level about which the purging will happen automagically. - double purge_percent_; - - /// This is the helper class which will decide and expunge entries - /// from the cache. - CACHING_UTILITY caching_utility_; -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Null_Caching_Strategy ANULL - -/** - * @class ACE_Null_Caching_Strategy - * - * @brief The is a special caching strategy which doesnt have the purging - * feature. - * - * No purging provided. To be used when purging might be too expensive - * an operation. - */ -template -class ACE_Null_Caching_Strategy -{ - -public: - - // = Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Strategy methods. All are NO_OP methods!!! - - /// Accessor method. - ATTRIBUTES attributes (void); - - /// Get the percentage of entries to purge. - double purge_percent (void); - - /// Set the percentage of entries to purge. - void purge_percent (double percentage); - - // = Strategy related Operations - - /// Notification for an item getting bound into the cache. - int notify_bind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs find - /// method call - int notify_find (int result, - ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs unbind - /// method call - int notify_unbind (int result, - const ATTRIBUTES &attr); - - /// This method acts as a notification about the CONTAINERs trybind - /// method call - int notify_trybind (int result, - ATTRIBUTES &attr); - - /// Notification for an item getting bound again into the cache. - int notify_rebind (int result, - const ATTRIBUTES &attr); - - /// Purge the cache. - CACHING_UTILITY &caching_utility (void); - - /// Dumps the state of the object. - void dump (void) const; - -private: - - /// This is the helper class which will decide and expunge entries - /// from the cache. - CACHING_UTILITY caching_utility_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Caching_Strategies_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Caching_Strategies_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Caching_Strategies_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CACHING_STRATEGIES_H */ - diff --git a/dep/include/ace/Caching_Strategies_T.inl b/dep/include/ace/Caching_Strategies_T.inl deleted file mode 100644 index 41fa2d30301..00000000000 --- a/dep/include/ace/Caching_Strategies_T.inl +++ /dev/null @@ -1,456 +0,0 @@ -// -*-C++-*- -// -//$Id: Caching_Strategies_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -////////////////////////////////////////////////////////////////////////////////// - -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Caching_Strategy_Adapter::ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation, - bool delete_implementation) - : implementation_ (implementation), - delete_implementation_ (delete_implementation) -{ - if (this->implementation_ == 0) - { - ACE_NEW (this->implementation_, - IMPLEMENTATION); - this->delete_implementation_ = true; - } -} - -template ACE_INLINE -ACE_Caching_Strategy_Adapter::~ACE_Caching_Strategy_Adapter (void) -{ - if (this->delete_implementation_) - { - delete this->implementation_; - this->delete_implementation_ = false; - this->implementation_ = 0; - } -} - -template ACE_INLINE ATTRIBUTES -ACE_Caching_Strategy_Adapter::attributes (void) -{ - return this->implementation_->attributes (); -} - -template ACE_INLINE double -ACE_Caching_Strategy_Adapter::purge_percent (void) -{ - return this->implementation_->purge_percent (); -} - -template ACE_INLINE void -ACE_Caching_Strategy_Adapter::purge_percent (double percentage) -{ - this->implementation_->purge_percent (percentage); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_bind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_bind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_find (int result, - ATTRIBUTES &attr) -{ - return this->implementation_->notify_find (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_unbind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_trybind (int result, - ATTRIBUTES &attr) -{ - return this->implementation_->notify_trybind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_rebind (result, - attr); -} - -template ACE_INLINE IMPLEMENTATION & -ACE_Caching_Strategy_Adapter::implementation (void) -{ - return *this->implementation_; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_Caching_Strategy_Adapter::caching_utility (void) -{ - return this->implementation_->caching_utility (); -} - -template ACE_INLINE void -ACE_Caching_Strategy_Adapter::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Caching_Strategy_Adapter::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_LRU_Caching_Strategy::attributes (void) -{ - return this->timer_; -} - -template ACE_INLINE double -ACE_LRU_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_LRU_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_bind ( - int result, - const ATTRIBUTES & /* attr */) -{ - if (result == 0) - ++this->timer_; - - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_find ( - int result, - ATTRIBUTES &attr) -{ - if (result == 0) - { - attr = this->timer_; - ++this->timer_; - } - - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_unbind ( - int result, - const ATTRIBUTES & /* attr */) -{ - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_trybind ( - int result, - ATTRIBUTES & /* attr */) -{ - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_rebind ( - int result, - const ATTRIBUTES & /* attr */) -{ - if (result == 0) - ++this->timer_; - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_LRU_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_LRU_Caching_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LRU_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("timer_ = %d "), this->timer_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_LFU_Caching_Strategy::attributes (void) -{ - return 0; -} - -template ACE_INLINE double -ACE_LFU_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_LFU_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES & /* attr */) -{ - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - if (result == 0) - ++attr; - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES & /* attr */) -{ - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES & /* attr */) -{ - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES & /* attr */) -{ - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_LFU_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_LFU_Caching_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LFU_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -////////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_FIFO_Caching_Strategy::attributes (void) -{ - return this->order_; -} - -template ACE_INLINE double -ACE_FIFO_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_FIFO_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->order_; - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->order_; - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_FIFO_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_FIFO_Caching_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("order_ = %d "), this->order_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_Null_Caching_Strategy::attributes (void) -{ - return 0; -} - -template ACE_INLINE double -ACE_Null_Caching_Strategy::purge_percent (void) -{ - return 0; -} - -template ACE_INLINE void -ACE_Null_Caching_Strategy::purge_percent (double percentage) -{ - ACE_UNUSED_ARG (percentage); -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_Null_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_Null_Caching_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Null_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -////////////////////////////////////////////////////////////////////////////////// diff --git a/dep/include/ace/Caching_Utility_T.h b/dep/include/ace/Caching_Utility_T.h deleted file mode 100644 index 9859159be4c..00000000000 --- a/dep/include/ace/Caching_Utility_T.h +++ /dev/null @@ -1,348 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Caching_Utility_T.h - * - * $Id: Caching_Utility_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef ACE_CACHING_UTILITY_H -#define ACE_CACHING_UTILITY_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/Cleanup_Strategies_T.h" - -// For linkers that cant grok long names. -#define ACE_Pair_Caching_Utility APUTIL - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Pair_Caching_Utility - * - * @brief Defines a helper class for the Caching Strategies. - * - * This class defines the methods commonly used by the different - * caching strategies. For instance: method which - * decides and purges the entry from the container. @note This - * class helps in the caching_strategies using a container - * containing entries of > - * kind. The attributes helps in deciding the entries to be - * purged. The Cleanup_Strategy is the callback class to which the - * entries to be cleaned up will be delegated. - */ -template -class ACE_Pair_Caching_Utility -{ -public: - - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY; - - /// Constructor. - ACE_Pair_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - /// Destructor. - ~ACE_Pair_Caching_Utility (void); - - /** - * Purge entries from the @a container. The Cleanup_Strategy will do the - * actual job of cleanup once the entries to be cleaned up are decided. - */ - int clear_cache (CONTAINER &container, - double purge_percent); - -protected: - - /// Find the entry with minimum caching attributes. - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - - /// The cleanup strategy which can be used to destroy the entries of - /// the container. - CLEANUP_STRATEGY *cleanup_strategy_; - - /// Whether the cleanup_strategy should be destroyed or not. - int delete_cleanup_strategy_; - - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Pair_Caching_Utility &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Pair_Caching_Utility (const ACE_Pair_Caching_Utility &)) -}; - -//////////////////////////////////////////////////////////////////////////////// -#define ACE_Recyclable_Handler_Caching_Utility ARHUTIL - -/** - * @class ACE_Recyclable_Handler_Caching_Utility - * - * @brief Defines a helper class for the Caching Strategies. - * - * This class defines the methods commonly used by the different - * caching strategies. For instance: method which - * decides and purges the entry from the container. @note This - * class helps in the caching_strategies using a container - * containing entries of kind. The attributes - * helps in deciding the entries to be purged. The - * Cleanup_Strategy is the callback class to which the entries to - * be cleaned up will be delegated. - */ -template -class ACE_Recyclable_Handler_Caching_Utility -{ - -public: - - typedef ACE_Recyclable_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - /// Constructor. - ACE_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - /// Destructor. - ~ACE_Recyclable_Handler_Caching_Utility (void); - - /** - * Purge entries from the . The Cleanup_Strategy will do - * the actual job of cleanup once the entries to be cleaned up are - * decided. - */ - int clear_cache (CONTAINER &container, - double purge_percent); - -protected: - - /// Find the entry with minimum caching attributes. - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - - /// This is the default Cleanup Strategy for this utility. - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - - /// Whether the cleanup_strategy should be destroyed or not. - int delete_cleanup_strategy_; - -private: - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Recyclable_Handler_Caching_Utility &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Recyclable_Handler_Caching_Utility (const ACE_Recyclable_Handler_Caching_Utility &)) -}; - -/////////////////////////////////////////////////////////////////////////// -#define ACE_Refcounted_Recyclable_Handler_Caching_Utility ARRHUTIL - -/** - * @class ACE_Refcounted_Recyclable_Handler_Caching_Utility - * - * @brief Defines a helper class for the Caching Strategies. - * - * This class defines the methods commonly used by the different - * caching strategies. For instance: clear_cache () method which - * decides and purges the entry from the container. @note This - * class helps in the caching_strategies using a container - * containing entries of kind. The attributes helps in - * deciding the entries to be purged. The Cleanup_Strategy is the - * callback class to which the entries to be cleaned up will be - * delegated. - */ -template -class ACE_Refcounted_Recyclable_Handler_Caching_Utility -{ - -public: - - typedef ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - /// Constructor. - ACE_Refcounted_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - /// Destructor. - ~ACE_Refcounted_Recyclable_Handler_Caching_Utility (void); - - /** - * Purge entries from the . The Cleanup_Strategy will do - * the actual job of cleanup once the entries to be cleaned up are - * decided. - */ - int clear_cache (CONTAINER &container, - double purge_percent); - -protected: - - /// Find the entry with minimum caching attributes. - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - - /// This is the default Cleanup Strategy for this utility. - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - - /// Whether the cleanup_strategy should be destroyed or not. - int delete_cleanup_strategy_; - - /** - * This figure denotes the number of entries are there in the - * container which have been marked as closed already but might - * not have been unbound from the container. - */ - size_t marked_as_closed_entries_; - -private: - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Refcounted_Recyclable_Handler_Caching_Utility &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Refcounted_Recyclable_Handler_Caching_Utility (const ACE_Refcounted_Recyclable_Handler_Caching_Utility &)) -}; - -//////////////////////////////////////////////////////////////////////////////////////// - -/** - * @class ACE_Handler_Caching_Utility - * - * @brief Defines a helper class for the Caching Strategies. - * - * This class defines the methods commonly used by the different - * caching strategies. For instance: method which - * decides and purges the entry from the container. @note This - * class helps in the caching_strategies using a container - * containing entries of kind where the HANDLER - * contains the caching attributes which help in deciding the - * entries to be purged. The Cleanup_Strategy is the callback - * class to which the entries to be cleaned up will be delegated. - */ -template -class ACE_Handler_Caching_Utility -{ -public: - - typedef ACE_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - /// Constructor. - ACE_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - /// Destructor. - ~ACE_Handler_Caching_Utility (void); - - /** - * Purge entries from the . The Cleanup_Strategy will do - * the actual job of cleanup once the entries to be cleaned up are - * decided. - */ - int clear_cache (CONTAINER &container, - double purge_percent); - -protected: - - /** - * Find the entry with minimum caching attributes. This is handler - * specific since this utility is to be used very specifically for - * handler who have caching_attributes for server side acched - * connection management. - */ - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - - /// The cleanup strategy which can be used to destroy the entries of - /// the container. - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - - /// Whether the cleanup_strategy should be destroyed or not. - int delete_cleanup_strategy_; - -private: - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Handler_Caching_Utility &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Handler_Caching_Utility (const ACE_Handler_Caching_Utility &)) -}; - -/////////////////////////////////////////////////////////////////////////// -#define ACE_Null_Caching_Utility ANUTIL -/** - * @class ACE_Null_Caching_Utility - * - * @brief Defines a dummy helper class for the Caching Strategies. - * - * This class defines the methods commonly used by the different - * caching strategies. For instance: method which - * decides and purges the entry from the container. @note This - * class is be used with the Null_Caching_Strategy. The - * Cleanup_Strategy is the callback class to which the entries to - * be cleaned up will be delegated. - */ -template -class ACE_Null_Caching_Utility -{ -public: - - typedef ACE_Null_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - /// Constructor. - ACE_Null_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - /// Destructor. - ~ACE_Null_Caching_Utility (void); - - /** - * Purge entries from the . The Cleanup_Strategy will do - * the actual job of cleanup once the entries to be cleaned up are - * decided. @note Here it is a no-op. - */ - int clear_cache (CONTAINER &container, - double purge_percent); - -protected: - - /** - * Find the entry with minimum caching attributes. This is handler - * specific since this utility is to be used very specifically for - * handler who have caching_attributes for server side acched - * connection management.@note Here it is a no-op. - */ - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - - /// The cleanup strategy which can be used to destroy the entries of - /// the container. - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - - /// Whether the cleanup_strategy should be destroyed or not. - int delete_cleanup_strategy_; - -private: - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Null_Caching_Utility &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Null_Caching_Utility (const ACE_Null_Caching_Utility &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Caching_Utility_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Caching_Utility_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CACHING_UTILITY_H */ - diff --git a/dep/include/ace/Capabilities.h b/dep/include/ace/Capabilities.h deleted file mode 100644 index 8c239825e7d..00000000000 --- a/dep/include/ace/Capabilities.h +++ /dev/null @@ -1,220 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Capabilities.h - * - * $Id: Capabilities.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Arturo Montes - */ -//============================================================================= - -#ifndef ACE_CAPABILITIES_H -#define ACE_CAPABILITIES_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Null_Mutex.h" -#include "ace/Hash_Map_Manager_T.h" -#include "ace/Containers.h" -#include "ace/SString.h" -#include "ace/Functor_String.h" - -#if defined (ACE_IS_SPLITTING) -# include "ace/OS_NS_ctype.h" -#endif /* ACE_IS_SPLITTING */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_CapEntry - * - * @brief This class is the base class for all ACE Capabilities entry - * subclasses. - * - * This class is not instantiable and does not provide accessors - * or methods. If you want to add a new kind of attribute subclass - * this class and dynamic_cast to proper subclass. - */ -class ACE_Export ACE_CapEntry -{ -public: - - virtual ~ACE_CapEntry (void); - -protected: - - enum - { - ACE_INTCAP = 0, - ACE_STRINGCAP = 1, - ACE_BOOLCAP = 2 - }; - - ACE_CapEntry (int captype); - -protected: - - int captype_; - -}; - -/** - * @class ACE_IntCapEntry - * - * @brief This class implement the ACE Integer Capability subclass. - * - * This is a container class for ACE Capabilities integer container - * values. - */ -class ACE_Export ACE_IntCapEntry : public ACE_CapEntry -{ -public: - ACE_IntCapEntry (int val); - int getval (void) const; - -protected: - int val_; -}; - -/** - * @class ACE_StringCapEntry - * - * @brief This class implement the ACE String Capability subclass. - * - * This is a container class for ACE Capabilities String container - * values. - */ -class ACE_Export ACE_StringCapEntry : public ACE_CapEntry -{ -public: - ACE_StringCapEntry (const ACE_TString &val); - ACE_TString getval (void) const; - -protected: - ACE_TString val_; -}; - -/** - * @class ACE_BoolCapEntry - * - * @brief This class implement the ACE Bool Capability subclass. - * - * This is a container class for ACE Capabilities bool container - * values. - */ -class ACE_Export ACE_BoolCapEntry : public ACE_CapEntry -{ -public: - ACE_BoolCapEntry (int val); - int getval (void) const; - -protected: - int val_; -}; - -/** - * @class ACE_Capabilities - * - * @brief This class implement the ACE Capabilities. - * - * This is a container class for ACE Capabilities - * values. Currently exist three different capability values: - * (integer), (bool) and - * (String). An ACE_Capabilities is a - * unordered set of pair = (, *). Where - * the first component is the name of capability and the second - * component is a pointer to the capability value container. A - * is a container for ACE_Capabilities, the - * ACE_Capabilities has a name in the file, as a termcap file. - */ -class ACE_Export ACE_Capabilities -{ -public: - - typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> CAPABILITIES_MAP; - - /// The Constructor - ACE_Capabilities (void); - - /// The Destructor - ~ACE_Capabilities(void); - -public: - - /// Get a string entry. - int getval (const ACE_TCHAR *ent, ACE_TString &val); - - /// Get an integer entry. - int getval (const ACE_TCHAR *ent, int &val); - - /// Get the ACE_Capabilities name from FILE fname and load the - /// associated capabitily entries in map. - int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name); - -protected: - - /// Parse an integer property - const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap); - - /// Parse a string property - const ACE_TCHAR *parse (const ACE_TCHAR *buf, ACE_TString &cap); - - /// Fill the ACE_Capabilities with description in ent. - int fillent(const ACE_TCHAR *ent); - - /// Parse a cap entry - int parseent (const ACE_TCHAR *name, ACE_TCHAR *line); - - /// Get a line from FILE input stream - int getline (FILE* fp, - ACE_TString &line); - - /// Is a valid entry - int is_entry (const ACE_TCHAR *name, const ACE_TCHAR *line); - - /// Reset the set of capabilities - void resetcaps (void); - -private: - - /// This is the set of ACE_CapEntry. - CAPABILITIES_MAP caps_; - -}; - -#if defined (ACE_IS_SPLITTING) -int -is_empty (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line == ACE_TEXT ('\0') || *line == ACE_TEXT ('#'); -} - -int -is_line (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line != ACE_TEXT ('\0'); -} -#endif /* ACE_IS_SPLITTING */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Capabilities.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* __ACE_CAPABILITIES_H__ */ - diff --git a/dep/include/ace/Capabilities.inl b/dep/include/ace/Capabilities.inl deleted file mode 100644 index 37284b28696..00000000000 --- a/dep/include/ace/Capabilities.inl +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -// -// $Id: Capabilities.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_CapEntry::ACE_CapEntry (int captype) - : captype_ (captype) -{ -} - -ACE_INLINE -ACE_IntCapEntry::ACE_IntCapEntry (int val) - : ACE_CapEntry (ACE_INTCAP), - val_ (val) -{ -} - -ACE_INLINE int -ACE_IntCapEntry::getval (void) const -{ - return val_; -} - -ACE_INLINE -ACE_StringCapEntry::ACE_StringCapEntry (const ACE_TString &val) - : ACE_CapEntry (ACE_STRINGCAP), - val_ (val) -{ -} - -ACE_INLINE ACE_TString -ACE_StringCapEntry::getval (void) const -{ - return val_; -} - -ACE_INLINE -ACE_BoolCapEntry::ACE_BoolCapEntry (int val) - : ACE_CapEntry (ACE_BOOLCAP), - val_(val) -{ -} - -ACE_INLINE int -ACE_BoolCapEntry::getval (void) const -{ - return val_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Cleanup.h b/dep/include/ace/Cleanup.h deleted file mode 100644 index c38db701360..00000000000 --- a/dep/include/ace/Cleanup.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Cleanup.h - * - * $Id: Cleanup.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - * - * Originally in OS.h. - */ -//============================================================================= - -#ifndef ACE_CLEANUP_H -# define ACE_CLEANUP_H - -# include /**/ "ace/pre.h" - -# include "ace/config-lite.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/ACE_export.h" - -#if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1) -# include "ace/Global_Macros.h" -# define ACE_CLEANUP_DESTROYER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_cleanup_destroyer) -#else -# define ACE_CLEANUP_DESTROYER_NAME ace_cleanup_destroyer -#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Cleanup - * - * @brief Base class for objects that are cleaned by ACE_Object_Manager. - */ -class ACE_Export ACE_Cleanup -{ -public: - /// No-op constructor. - ACE_Cleanup (void); - - /// Destructor. - virtual ~ACE_Cleanup (void); - - /// Cleanup method that, by default, simply deletes itself. - virtual void cleanup (void *param = 0); -}; - -// Adapter for cleanup, used by ACE_Object_Manager. -extern "C" ACE_Export -void ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *, void *param = 0); - -/** - * @class ACE_Cleanup_Info - * - * @brief Hold cleanup information for thread/process - */ -class ACE_Export ACE_Cleanup_Info -{ -public: - /// Default constructor. - ACE_Cleanup_Info (void); - - /// Equality operator. - bool operator== (const ACE_Cleanup_Info &o) const; - - /// Inequality operator. - bool operator!= (const ACE_Cleanup_Info &o) const; - - /// Point to object that gets passed into the . - void *object_; - - /// Cleanup hook that gets called back. - ACE_CLEANUP_FUNC cleanup_hook_; - - /// Parameter passed to the . - void *param_; -}; - -class ACE_Cleanup_Info_Node; - -/** - * @class ACE_OS_Exit_Info - * - * @brief Hold Object Manager cleanup (exit) information. - * - * For internal use by the ACE library, only. - */ -class ACE_Export ACE_OS_Exit_Info -{ -public: - /// Default constructor. - ACE_OS_Exit_Info (void); - - /// Destructor. - ~ACE_OS_Exit_Info (void); - - /// Use to register a cleanup hook. - int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param); - - /// Look for a registered cleanup hook object. Returns 1 if already - /// registered, 0 if not. - int find (void *object); - - /// Call all registered cleanup hooks, in reverse order of - /// registration. - void call_hooks (); - -private: - /** - * Keeps track of all registered objects. The last node is only - * used to terminate the list (it doesn't contain a valid - * ACE_Cleanup_Info). - */ - ACE_Cleanup_Info_Node *registered_objects_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_INLINED_OSCALLS) -# if defined (ACE_INLINE) -# undef ACE_INLINE -# endif /* ACE_INLINE */ -# define ACE_INLINE inline -# include "ace/Cleanup.inl" -# endif /* ACE_HAS_INLINED_OSCALLS */ - -# include /**/ "ace/post.h" -#endif /* ACE_CLEANUP_H */ - diff --git a/dep/include/ace/Cleanup.inl b/dep/include/ace/Cleanup.inl deleted file mode 100644 index 9c36d6b1ffd..00000000000 --- a/dep/include/ace/Cleanup.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Cleanup.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Cleanup::ACE_Cleanup (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Cleanup_Strategies_T.h b/dep/include/ace/Cleanup_Strategies_T.h deleted file mode 100644 index 89775562f6e..00000000000 --- a/dep/include/ace/Cleanup_Strategies_T.h +++ /dev/null @@ -1,149 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Cleanup_Strategies_T.h - * - * $Id: Cleanup_Strategies_T.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef CLEANUP_STRATEGIES_H -#define CLEANUP_STRATEGIES_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// For linkers that cant grok long names. -#define ACE_Cleanup_Strategy ACLE - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Cleanup_Strategy - * - * @brief Defines a default strategy to be followed for cleaning up - * entries from a map which is the container. - * - * By default the entry to be cleaned up is removed from the - * container. - */ -template -class ACE_Cleanup_Strategy -{ - -public: - - /// Destructor. - virtual ~ACE_Cleanup_Strategy (void); - - /// The method which will do the cleanup of the entry in the container. - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Recyclable_Handler_Cleanup_Strategy ARHCLE - -/** - * @class ACE_Recyclable_Handler_Cleanup_Strategy - * - * @brief Defines a strategy to be followed for cleaning up - * entries which are svc_handlers from a container. - * - * The entry to be cleaned up is removed from the container. - * Here, since we are dealing with svc_handlers specifically, we - * perform a couple of extra operations. @note To be used when - * the handler is recyclable. - */ -template -class ACE_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ - -public: - - /// The method which will do the cleanup of the entry in the container. - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy ARRHCLE - -/** - * @class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy - * - * @brief Defines a strategy to be followed for cleaning up - * entries which are svc_handlers from a container. - * - * The entry to be cleaned up is removed from the container. - * Here, since we are dealing with recyclable svc_handlers with - * addresses which are refcountable specifically, we perform a - * couple of extra operations and do so without any locking. - */ -template -class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ -public: - /// The method which will do the cleanup of the entry in the container. - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); -}; - -////////////////////////////////////////////////////////////////////// - -/** - * @class ACE_Handler_Cleanup_Strategy - * - * @brief Defines a strategy to be followed for cleaning up - * entries which are svc_handlers from a container. - * - * The entry to be cleaned up is removed from the container. - * Here, since we are dealing with svc_handlers specifically, we - * perform a couple of extra operations. @note This cleanup strategy - * should be used in the case when the handler has the caching - * attributes. - */ -template -class ACE_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ -public: - /// The method which will do the cleanup of the entry in the container. - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Null_Cleanup_Strategy ANCLE - -/** - * @class ACE_Null_Cleanup_Strategy - * - * @brief Defines a do-nothing implementation of the cleanup strategy. - * - * This class simply does nothing at all! Can be used to nullify - * the effect of the Cleanup Strategy. - */ -template -class ACE_Null_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ -public: - /// The dummy cleanup method. - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cleanup_Strategies_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cleanup_Strategies_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* CLEANUP_STRATEGIES_H */ - diff --git a/dep/include/ace/Codecs.h b/dep/include/ace/Codecs.h deleted file mode 100644 index 5b1b8bbde70..00000000000 --- a/dep/include/ace/Codecs.h +++ /dev/null @@ -1,121 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Codecs.h - * - * $Id: Codecs.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Krishnakumar B - * - * Codecs is a generic wrapper for various encoding and decoding - * mechanisms. Currently it includes Base64 content transfer-encoding as - * specified by RFC 2045, Multipurpose Internet Mail Extensions (MIME) Part - * One: Format of Internet Message Bodies. - * - */ -//============================================================================= - -#ifndef ACE_CODECS_H -#define ACE_CODECS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Types.h" -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Base64 - * - * @brief Encode/Decode a stream of bytes according to Base64 encoding. - * - * This class provides methods to encode or decode a stream of bytes - * to/from Base64 encoding. It doesn't convert the input stream to a - * canonical form before encoding. - * - */ -class ACE_Export ACE_Base64 -{ -public: - - //@{ - - /** - * Encodes a stream of bytes to Base64 data - * - * @param input Binary data in byte stream. - * @param input_len Length of the byte stream. - * @param output_len Length of the encoded Base64 byte stream. - * @param is_chunked If true, terminate 72 character blocks with newline - * @return Encoded Base64 data in byte stream or NULL if input data cannot - * be encoded. - */ - - static ACE_Byte* encode (const ACE_Byte* input, - const size_t input_len, - size_t* output_len, - bool is_chunked = true); - /** - * Decodes a stream of Base64 to bytes data - * - * @param input Encoded Base64 data in byte stream. - * @param output_len Length of the binary byte stream. - * @return Binary data in byte stream or NULL if input data cannot - * be encoded. - */ - static ACE_Byte* decode (const ACE_Byte* input, - size_t* output_len); - - /** - * Return the length of the encoded input data - * - * @param input Encoded Base64 data in byte stream. - * @return Length of the encoded Base64 data. - * - */ - static size_t length (const ACE_Byte* input); - - //@} - -protected: - - // Prevent default construction. - ACE_Base64 (void) {} - -private: - - // Preventing copying and assignment. - ACE_Base64 (ACE_Base64 const &); - ACE_Base64 & operator= (ACE_Base64 const &); - - /// Initialize the tables for encoding/decoding. - static void init (void); - -private: - - /// Alphabet used for decoding i.e decoder_[alphabet_[i = 0..63]] = i - static ACE_Byte decoder_[]; - - /// Alphabet used to check valid range of encoded input i.e - /// member_[alphabet_[0..63]] = 1 - static ACE_Byte member_[]; - - /// Boolean to denote whether initialization is complete - static bool init_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_CODECS_H */ - diff --git a/dep/include/ace/Codeset_IBM1047.h b/dep/include/ace/Codeset_IBM1047.h deleted file mode 100644 index 5e19763f94c..00000000000 --- a/dep/include/ace/Codeset_IBM1047.h +++ /dev/null @@ -1,127 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Codeset_IBM1047.h - * - * $Id: Codeset_IBM1047.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * Declares the arrays required to convert between ISO8859 (aka - * Latin/1) and IBM1047 (aka EBCDIC). - * - * @author Jim Rogers (jrogers@viasoft.com) - */ -//============================================================================= - -#ifndef ACE_CODESET_IMB1047_H -#define ACE_CODESET_IMB1047_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_EBCDIC) - -#include "ace/CDR_Stream.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// **************************************************************** - -/** - * @class ACE_IBM1047_ISO8859 - * - * @brief Codeset translation specialization. - * - * This class performs the codeset translation: - * - Native: IBM_1047 (i.e. EBCDIC) - * - Stream: ISO-8859 (i.e. Latin/1) - */ -class ACE_Export ACE_IBM1047_ISO8859 : public ACE_Char_Codeset_Translator -{ -public: - /// A do nothing constructor. - ACE_IBM1047_ISO8859 (void); - - /// Virtual destruction - virtual ~ACE_IBM1047_ISO8859 (void); - - // = Documented in $ACE_ROOT/ace/CDR_Stream.h - virtual ACE_CDR::Boolean read_char (ACE_InputCDR &, - ACE_CDR::Char &); - virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, - ACE_CDR::Char *&); - virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, - ACE_CDR::Char *, - ACE_CDR::ULong); - virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &, - ACE_CDR::Char); - virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &, - ACE_CDR::ULong, - const ACE_CDR::Char *); - virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &, - const ACE_CDR::Char *, - ACE_CDR::ULong); - - /// Return the native codeset ID as defined in the OSF code and character - /// set registry, 0x10020417 - virtual ACE_CDR::ULong ncs (); - /// Return the translated codeset ID as defined in the OSF code and character - /// set registry, 0x00010001 - virtual ACE_CDR::ULong tcs (); -}; - -/** - * @class ACE_ISO8859_IBM1047 - * - * @brief Codeset translation specialization. - * - * This class performs the codeset translation: - * - Native: ISO-8859 (i.e. Latin/1) - * - Stream: IBM-1047 (i.e. EBCDIC) - */ -class ACE_Export ACE_ISO8859_IBM1047 : public ACE_Char_Codeset_Translator -{ -public: - /// A do nothing constructor. - ACE_ISO8859_IBM1047 (void); - - /// Virtual destruction - virtual ~ACE_ISO8859_IBM1047 (void); - - // = Documented in $ACE_ROOT/ace/CDR_Stream.h - virtual ACE_CDR::Boolean read_char (ACE_InputCDR &, - ACE_CDR::Char &); - virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, - ACE_CDR::Char *&); - virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, - ACE_CDR::Char *, - ACE_CDR::ULong); - virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &, - ACE_CDR::Char); - virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &, - ACE_CDR::ULong, - const ACE_CDR::Char *); - virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &, - const ACE_CDR::Char *, - ACE_CDR::ULong); - - /// Return the native codeset ID as defined in the OSF code and character - /// set registry, 0x00010001 - virtual ACE_CDR::ULong ncs (); - /// Return the translated codeset ID as defined in the OSF code and character - /// set registry, 0x10020417 - virtual ACE_CDR::ULong tcs (); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_EBCDIC */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CODESET_IMB1047_H */ - diff --git a/dep/include/ace/Codeset_Registry.h b/dep/include/ace/Codeset_Registry.h deleted file mode 100644 index 80887d9a106..00000000000 --- a/dep/include/ace/Codeset_Registry.h +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Codeset_Registry.h - * - * $Id: Codeset_Registry.h 81348 2008-04-14 09:00:32Z johnnyw $ - * - * ACE wrapper around access functions for the OSF's DCE codeset registry - * access functions - * - * For environments that intrinsicly support the DCE defined access functions, - * the methods in this class are simply wrappers. On other platforms, emulation - * is provided. The motivation for this class is to support interoperability - * via translators and the CDR streams, primarily in TAO, but this capability - * is not restricted to CORBA. - * - * The emulated functionality supports Open Group RFC #40, currently RFC 40.2, - * www.opengroup.org/tech/rfc/rfc40.2.html - * - * @author Phil Mesnier - */ -//============================================================================= - -#ifndef ACE_CODESET_REGISTRY_H -#define ACE_CODESET_REGISTRY_H - -#include /**/ "ace/pre.h" -#include "ace/SString.h" -#include "ace/CDR_Base.h" -#include "ace/Codeset_Symbols.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_DCE_CODESET_REGISTRY) -#include /**/ -#endif /* ACE_HAS_DCE_CODESET_REGISTRY */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Export ACE_Codeset_Registry -{ -public: - - /// Based on a locale string, find the registry value and optional codeset - /// collection. This wraps the dce_cs_loc_to_rgy function, or emulates it. - static int locale_to_registry (const ACE_CString &locale, - ACE_CDR::ULong &codeset_id, - ACE_CDR::UShort * = 0, - ACE_CDR::UShort ** = 0); - - /// Based on a registry value, find the locale string and optional codeset - /// collection. This wraps the dce_cs_rgy_to_loc function, or emulates it. - static int registry_to_locale (ACE_CDR::ULong codeset_id, - ACE_CString &locale, - ACE_CDR::UShort * = 0, - ACE_CDR::UShort ** = 0); - - /// Tell if two codesets are compatible. This wraps the - /// rpc_cs_char_set_compat_check function. - static int is_compatible (ACE_CDR::ULong codeset_id, - ACE_CDR::ULong other); - - /// Return the max number of bytes required to represent a single character. - /// This wraps the rpc_rgy_get_max_bytes function. - static ACE_CDR::Short get_max_bytes (ACE_CDR::ULong codeset_id); - - enum {max_charsets_ = 5}; -protected: - typedef struct { - const char * desc_; - const char * loc_name_; - ACE_CDR::ULong codeset_id_; - ACE_CDR::UShort num_sets_; - ACE_CDR::UShort char_sets_[max_charsets_]; - ACE_CDR::UShort max_bytes_; - } registry_entry; - -private: - static size_t const num_registry_entries_; - static registry_entry const registry_db_[]; - - static int locale_to_registry_i (const ACE_CString &locale, - ACE_CDR::ULong &codeset_id, - ACE_CDR::UShort * = 0, - ACE_CDR::UShort ** = 0); - static int registry_to_locale_i (ACE_CDR::ULong codeset_id, - ACE_CString &locale, - ACE_CDR::UShort * = 0, - ACE_CDR::UShort ** = 0); - static int is_compatible_i (ACE_CDR::ULong codeset_id, - ACE_CDR::ULong other); - static ACE_CDR::Short get_max_bytes_i (ACE_CDR::ULong codeset_id); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Codeset_Registry.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_CODESET_REGISTRY_H */ - diff --git a/dep/include/ace/Codeset_Registry.inl b/dep/include/ace/Codeset_Registry.inl deleted file mode 100644 index 4419cf5e7fc..00000000000 --- a/dep/include/ace/Codeset_Registry.inl +++ /dev/null @@ -1,102 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Codeset_Registry.inl - * - * $Id: Codeset_Registry.inl 80826 2008-03-04 14:51:23Z wotte $ - * - * ACE wrapper around access functions for the OSF's DCE codeset registry - * access functions - the inline functions either call the system supplied - * DCE based codeset regsitry function, or calls the emulation - * - * - * @author Phil Mesnier - */ -//============================================================================= - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -int -ACE_Codeset_Registry::locale_to_registry(const ACE_CString &locale, - ACE_CDR::ULong &codeset_id, - ACE_CDR::UShort *num_sets, - ACE_CDR::UShort **char_sets) -{ -#if defined (ACE_HAS_DCE_CODESET_REGISTRY) - error_status_t result; - dce_cs_loc_to_rgy (locale.c_str(), - &codeset_id, - num_sets, - char_sets, - &result); - return (result == dce_cs_c_ok) ? 1 : 0; -#else - return ACE_Codeset_Registry::locale_to_registry_i (locale, - codeset_id, - num_sets, - char_sets); -#endif /* ACE_HAS_DCE_CODESET_REGISTRY */ -} - -// based on a registry value, find the locale string and optional codeset -// collection. This wraps the dce_cs_rgy_to_loc function, or emulates it. -ACE_INLINE -int -ACE_Codeset_Registry::registry_to_locale(ACE_CDR::ULong codeset_id, - ACE_CString &locale, - ACE_CDR::UShort *num_sets, - ACE_CDR::UShort **char_sets) -{ -#if defined (ACE_HAS_DCE_CODESET_REGISTRY) - error_status_t result; - char *buffer; - dce_cs_rgy_to_loc (codeset_id, - &buffer, - num_sets, - char_sets, - &result); - locale.set(buffer); // does a copy :-( - free (buffer); - return (result == dce_cs_c_ok) ? 1 : 0; -#else - return ACE_Codeset_Registry::registry_to_locale_i (codeset_id, - locale, - num_sets, - char_sets); -#endif /* ACE_HAS_DCE_CODESET_REGISTRY */ -} - -// Tell if two codesets are compatible. This wraps the -// rpc_cs_char_set_compat_check function. -ACE_INLINE -int -ACE_Codeset_Registry::is_compatible (ACE_CDR::ULong codeset_id, - ACE_CDR::ULong other) -{ -#if defined (ACE_HAS_DCE_CODESET_REGISTRY) - error_status_t result; - rpc_cs_char_set_compat_check(codeset_id,other,&result); - return (result == rpc_s_ok) ? 1 : 0; -#else - return ACE_Codeset_Registry::is_compatible_i (codeset_id,other); -#endif /* ACE_HAS_DCE_CODESET_REGISTRY */ -} - -// Return the max number of bytes required to represent a single character. -// This wraps the rpc_rgy_get_max_bytes function. -ACE_INLINE -ACE_CDR::Short -ACE_Codeset_Registry::get_max_bytes (ACE_CDR::ULong codeset_id) -{ -#if defined (ACE_HAS_DCE_CODESET_REGISTRY) - error_status_t result; - short max_bytes; - rpc_rgy_get_max_bytes(codeset_id,&max_bytes,&result); - return (result == rpc_s_ok) ? (short)max_bytes : 0; -#else - return ACE_Codeset_Registry::get_max_bytes_i (codeset_id); -#endif /* ACE_HAS_DCE_CODESET_REGISTRY */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Codeset_Symbols.h b/dep/include/ace/Codeset_Symbols.h deleted file mode 100644 index 2cfb6bc26b6..00000000000 --- a/dep/include/ace/Codeset_Symbols.h +++ /dev/null @@ -1,221 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Codeset_Symbols.h - * - * $Id: Codeset_Symbols.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Symbolic names for codeset ids. - * - * @author Dale Wilson (wilson_d@ociweb.com) - */ -//============================================================================= -#ifndef CODESET_SYMBOLS_H -#define CODESET_SYMBOLS_H - -// These numbers are assigned by the OpenGroup, a database is -// available at -// -// ftp://ftp.opengroup.org/pub/code_set_registry/ -// -// Alas, the database is in a semi-regular text file -- difficult to use. -// The following C/C++-friendly version of the codeset ids was captured -// from Version 1.2g of the registry. -// -#define ACE_CODESET_ID_ISO_8859_1 0x00010001U -#define ACE_CODESET_ID_ISO_8859_2 0x00010002U -#define ACE_CODESET_ID_ISO_8859_3 0x00010003U -#define ACE_CODESET_ID_ISO_8859_4 0x00010004U -#define ACE_CODESET_ID_ISO_8859_5 0x00010005U -#define ACE_CODESET_ID_ISO_8859_6 0x00010006U -#define ACE_CODESET_ID_ISO_8859_7 0x00010007U -#define ACE_CODESET_ID_ISO_8859_8 0x00010008U -#define ACE_CODESET_ID_ISO_8859_9 0x00010009U -#define ACE_CODESET_ID_ISO_8859_10 0x0001000AU -#define ACE_CODESET_ID_ISO_8859_15 0x0001000FU -#define ACE_CODESET_ID_ISO_646 0x00010020U -#define ACE_CODESET_ID_ISO_UCS_2_LEVEL_1 0x00010100U -#define ACE_CODESET_ID_ISO_UCS_2_LEVEL_2 0x00010101U -#define ACE_CODESET_ID_ISO_UCS_2_LEVEL_3 0x00010102U -#define ACE_CODESET_ID_ISO_UCS_4_LEVEL_1 0x00010104U -#define ACE_CODESET_ID_ISO_UCS_4_LEVEL_2 0x00010105U -#define ACE_CODESET_ID_ISO_UCS_4_LEVEL_3 0x00010106U -#define ACE_CODESET_ID_ISO_UTF_8 0x00010108U -#define ACE_CODESET_ID_ISO_UTF_16 0x00010109U -#define ACE_CODESET_ID_JIS_X0201 0x00030001U -#define ACE_CODESET_ID_JIS_X0208_1978 0x00030004U -#define ACE_CODESET_ID_JIS_X0208_1983 0x00030005U -#define ACE_CODESET_ID_JIS_X0208_1990 0x00030006U -#define ACE_CODESET_ID_JIS_X0212 0x0003000AU -#define ACE_CODESET_ID_JIS_EUCJP 0x00030010U -#define ACE_CODESET_ID_KS_C5601 0x00040001U -#define ACE_CODESET_ID_KS_C5657 0x00040002U -#define ACE_CODESET_ID_KS_EUCKR 0x0004000AU -#define ACE_CODESET_ID_CNS_11643_1986 0x00050001U -#define ACE_CODESET_ID_CNS_11643_1992 0x00050002U -#define ACE_CODESET_ID_CNS_EUCTW_1991 0x0005000AU -#define ACE_CODESET_ID_CNS_EUCTW_1993 0x00050010U -#define ACE_CODESET_ID_TIS_620_25290X000B0001U -#define ACE_CODESET_ID_TTB_CCDC 0x000D0001U -#define ACE_CODESET_ID_OSF_JAPANESE_UJIS 0x05000010U -#define ACE_CODESET_ID_OSF_JAPANESE_SJIS_1 0x05000011U -#define ACE_CODESET_ID_OSF_JAPANESE_SJIS_2 0x05000012U -#define ACE_CODESET_ID_XOPEN_UTF_8 0x05010001U -#define ACE_CODESET_ID_JVC_EUCJP 0x05020001U -#define ACE_CODESET_ID_JVC_SJIS 0x05020002U -#define ACE_CODESET_ID_DEC_KANJI 0x10000001U -#define ACE_CODESET_ID_SUPER_DEC_KANJI 0x10000002U -#define ACE_CODESET_ID_DEC_SHIFT_JIS 0x10000003U -#define ACE_CODESET_ID_HP_ROMAN8 0x10010001U -#define ACE_CODESET_ID_HP_KANA8 0x10010002U -#define ACE_CODESET_ID_HP_ARABIC8 0x10010003U -#define ACE_CODESET_ID_HP_GREEK8 0x10010004U -#define ACE_CODESET_ID_HP_HEBREW8 0x10010005U -#define ACE_CODESET_ID_HP_TURKISH8 0x10010006U -#define ACE_CODESET_ID_HP15CN 0x10010007U -#define ACE_CODESET_ID_HP_BIG5 0x10010008U -#define ACE_CODESET_ID_HP_JAPANESE15__SJIS_ 0x10010009U -#define ACE_CODESET_ID_HP_SJISHI 0x1001000AU -#define ACE_CODESET_ID_HP_SJISPC 0x1001000BU -#define ACE_CODESET_ID_HP_UJIS 0x1001000CU -#define ACE_CODESET_ID_IBM_037 0x10020025U -#define ACE_CODESET_ID_IBM_273 0x10020111U -#define ACE_CODESET_ID_IBM_277 0x10020115U -#define ACE_CODESET_ID_IBM_278 0x10020116U -#define ACE_CODESET_ID_IBM_280 0x10020118U -#define ACE_CODESET_ID_IBM_282 0x1002011AU -#define ACE_CODESET_ID_IBM_284 0x1002011CU -#define ACE_CODESET_ID_IBM_285 0x1002011DU -#define ACE_CODESET_ID_IBM_290 0x10020122U -#define ACE_CODESET_ID_IBM_297 0x10020129U -#define ACE_CODESET_ID_IBM_300 0x1002012CU -#define ACE_CODESET_ID_IBM_301 0x1002012DU -#define ACE_CODESET_ID_IBM_420 0x100201A4U -#define ACE_CODESET_ID_IBM_424 0x100201A8U -#define ACE_CODESET_ID_IBM_437 0x100201B5U -#define ACE_CODESET_ID_IBM_500 0x100201F4U -#define ACE_CODESET_ID_IBM_833 0x10020341U -#define ACE_CODESET_ID_IBM_834 0x10020342U -#define ACE_CODESET_ID_IBM_835 0x10020343U -#define ACE_CODESET_ID_IBM_836 0x10020344U -#define ACE_CODESET_ID_IBM_837 0x10020345U -#define ACE_CODESET_ID_IBM_838 0x10020346U -#define ACE_CODESET_ID_IBM_839 0x10020347U -#define ACE_CODESET_ID_IBM_850 0x10020352U -#define ACE_CODESET_ID_IBM_852 0x10020354U -#define ACE_CODESET_ID_IBM_855 0x10020357U -#define ACE_CODESET_ID_IBM_856 0x10020358U -#define ACE_CODESET_ID_IBM_857 0x10020359U -#define ACE_CODESET_ID_IBM_861 0x1002035DU -#define ACE_CODESET_ID_IBM_862 0x1002035EU -#define ACE_CODESET_ID_IBM_863 0x1002035FU -#define ACE_CODESET_ID_IBM_864 0x10020360U -#define ACE_CODESET_ID_IBM_866 0x10020362U -#define ACE_CODESET_ID_IBM_868 0x10020364U -#define ACE_CODESET_ID_IBM_869 0x10020365U -#define ACE_CODESET_ID_IBM_870 0x10020366U -#define ACE_CODESET_ID_IBM_871 0x10020367U -#define ACE_CODESET_ID_IBM_874 0x1002036AU -#define ACE_CODESET_ID_IBM_875 0x1002036BU -#define ACE_CODESET_ID_IBM_880 0x10020370U -#define ACE_CODESET_ID_IBM_891 0x1002037BU -#define ACE_CODESET_ID_IBM_896 0x10020380U -#define ACE_CODESET_ID_IBM_897 0x10020381U -#define ACE_CODESET_ID_IBM_903 0x10020387U -#define ACE_CODESET_ID_IBM_904 0x10020388U -#define ACE_CODESET_ID_IBM_918 0x10020396U -#define ACE_CODESET_ID_IBM_921 0x10020399U -#define ACE_CODESET_ID_IBM_922 0x1002039AU -#define ACE_CODESET_ID_IBM_926 0x1002039EU -#define ACE_CODESET_ID_IBM_927 0x1002039FU -#define ACE_CODESET_ID_IBM_928 0x100203A0U -#define ACE_CODESET_ID_IBM_929 0x100203A1U -#define ACE_CODESET_ID_IBM_930 0x100203A2U -#define ACE_CODESET_ID_IBM_932 0x100203A4U -#define ACE_CODESET_ID_IBM_933 0x100203A5U -#define ACE_CODESET_ID_IBM_934 0x100203A6U -#define ACE_CODESET_ID_IBM_935 0x100203A7U -#define ACE_CODESET_ID_IBM_936 0x100203A8U -#define ACE_CODESET_ID_IBM_937 0x100203A9U -#define ACE_CODESET_ID_IBM_938 0x100203AAU -#define ACE_CODESET_ID_IBM_939 0x100203ABU -#define ACE_CODESET_ID_IBM_941 0x100203ADU -#define ACE_CODESET_ID_IBM_942 0x100203AEU -#define ACE_CODESET_ID_IBM_943 0x100203AFU -#define ACE_CODESET_ID_IBM_946 0x100203B2U -#define ACE_CODESET_ID_IBM_947 0x100203B3U -#define ACE_CODESET_ID_IBM_948 0x100203B4U -#define ACE_CODESET_ID_IBM_949 0x100203B5U -#define ACE_CODESET_ID_IBM_950 0x100203B6U -#define ACE_CODESET_ID_IBM_951 0x100203B7U -#define ACE_CODESET_ID_IBM_955 0x100203BBU -#define ACE_CODESET_ID_IBM_964 0x100203C4U -#define ACE_CODESET_ID_IBM_970 0x100203CAU -#define ACE_CODESET_ID_IBM_1006 0x100203EEU -#define ACE_CODESET_ID_IBM_1025 0x10020401U -#define ACE_CODESET_ID_IBM_1026 0x10020402U -#define ACE_CODESET_ID_IBM_1027 0x10020403U -#define ACE_CODESET_ID_IBM_1040 0x10020410U -#define ACE_CODESET_ID_IBM_1041 0x10020411U -#define ACE_CODESET_ID_IBM_1043 0x10020413U -#define ACE_CODESET_ID_IBM_1046 0x10020416U -#define ACE_CODESET_ID_IBM_1047 0x10020417U -#define ACE_CODESET_ID_IBM_1088 0x10020440U -#define ACE_CODESET_ID_IBM_1097 0x10020449U -#define ACE_CODESET_ID_IBM_1098 0x1002044AU -#define ACE_CODESET_ID_IBM_1112 0x10020458U -#define ACE_CODESET_ID_IBM_1114 0x1002045AU -#define ACE_CODESET_ID_IBM_1115 0x1002045BU -#define ACE_CODESET_ID_IBM_1122 0x10020462U -#define ACE_CODESET_ID_IBM_1250 0x100204E2U -#define ACE_CODESET_ID_IBM_1251 0x100204E3U -#define ACE_CODESET_ID_IBM_1252 0x100204E4U -#define ACE_CODESET_ID_IBM_1253 0x100204E5U -#define ACE_CODESET_ID_IBM_1254 0x100204E6U -#define ACE_CODESET_ID_IBM_1255 0x100204E7U -#define ACE_CODESET_ID_IBM_1256 0x100204E8U -#define ACE_CODESET_ID_IBM_1257 0x100204E9U -#define ACE_CODESET_ID_IBM_1380 0x10020564U -#define ACE_CODESET_ID_IBM_1381 0x10020565U -#define ACE_CODESET_ID_IBM_1383 0x10020567U -#define ACE_CODESET_ID_IBM_4396 0x1002112CU -#define ACE_CODESET_ID_IBM_4946 0x10021352U -#define ACE_CODESET_ID_IBM_4948 0x10021354U -#define ACE_CODESET_ID_IBM_4951 0x10021357U -#define ACE_CODESET_ID_IBM_4952 0x10021358U -#define ACE_CODESET_ID_IBM_4953 0x10021359U -#define ACE_CODESET_ID_IBM_4960 0x10021360U -#define ACE_CODESET_ID_IBM_4964 0x10021364U -#define ACE_CODESET_ID_IBM_4965 0x10021365U -#define ACE_CODESET_ID_IBM_5026 0x100213A2U -#define ACE_CODESET_ID_IBM_5031 0x100213A7U -#define ACE_CODESET_ID_IBM_5035 0x100213ABU -#define ACE_CODESET_ID_IBM_5048 0x100213B8U -#define ACE_CODESET_ID_IBM_5049 0x100213B9U -#define ACE_CODESET_ID_IBM_5067 0x100213CBU -#define ACE_CODESET_ID_IBM_8612 0x100221A4U -#define ACE_CODESET_ID_IBM_9025 0x10022341U -#define ACE_CODESET_ID_IBM_9026 0x10022342U -#define ACE_CODESET_ID_IBM_9030 0x10022346U -#define ACE_CODESET_ID_IBM_9056 0x10022360U -#define ACE_CODESET_ID_IBM_9066 0x1002236AU -#define ACE_CODESET_ID_IBM_9125 0x100223A5U -#define ACE_CODESET_ID_IBM_25426 0x10026352U -#define ACE_CODESET_ID_IBM_25432 0x10026358U -#define ACE_CODESET_ID_IBM_1042 0x10026412U -#define ACE_CODESET_ID_IBM_28709 0x10027025U -#define ACE_CODESET_ID_IBM_33624 0x10028358U -#define ACE_CODESET_ID_IBM_33722 0x100283BAU -#define ACE_CODESET_ID_HTCSJIS 0x10030001U -#define ACE_CODESET_ID_HTCUJIS 0x10030002U -#define ACE_CODESET_ID_FUJITSU_U90 0x10040001U -#define ACE_CODESET_ID_FUJITSU_S90 0x10040002U -#define ACE_CODESET_ID_FUJITSU_R90 0x10040003U -#define ACE_CODESET_ID_EBCDIC_ASCII_AND_JEF 0x10040004U -#define ACE_CODESET_ID_EBCDIC_KATAKANA_AND_JEF 0x10040005U -#define ACE_CODESET_ID_EBCDIC_JAPANESE_ENGLISH_AND_JEF 0x10040006U - -#define ACE_CODESET_ID_TAO_BACKWARD_COMPATIBLE 0xf54414F0U -#endif // CODESET_SYMBOLS_H - diff --git a/dep/include/ace/Condition_Recursive_Thread_Mutex.h b/dep/include/ace/Condition_Recursive_Thread_Mutex.h deleted file mode 100644 index 8625aa2fcea..00000000000 --- a/dep/include/ace/Condition_Recursive_Thread_Mutex.h +++ /dev/null @@ -1,119 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Condition_Recursive_Thread_Mutex.h - * - * $Id: Condition_Recursive_Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_CONDITION_RECURSIVE_THREAD_MUTEX_H -#define ACE_CONDITION_RECURSIVE_THREAD_MUTEX_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_HAS_THREADS) -# include "ace/Null_Condition.h" -#else /* ACE_HAS_THREADS */ -#include "ace/Recursive_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template class ACE_Condition; - -/** - * @class ACE_Condition - * - * @brief ACE_Condition template specialization written using - * @a ACE_Recursive_Thread_Mutex. This allows threads to block until - * shared data changes state using recursive mutexes. - */ -template<> -class ACE_Export ACE_Condition -{ -public: - /// Initialize the condition variable with a recursive mutex. - ACE_Condition (ACE_Recursive_Thread_Mutex &m); - - /// Implicitly destroy the condition variable. - ~ACE_Condition (void); - - /** - * Explicitly destroy the condition variable. Note that only one - * thread should call this method since it doesn't protect against - * race conditions. - */ - int remove (void); - - /** - * Block on condition, or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" semantics. Else, if - * != 0 and the call times out before the condition is signaled - * returns -1 and sets errno to ETIME. - */ - int wait (const ACE_Time_Value *abstime = 0); - - /** - * Block on condition or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" wait() semantics on the recursive @a mutex - * passed as a parameter (this is useful if you need to store the - * in shared memory). Else, if != 0 and the - * call times out before the condition is signaled returns -1 - * and sets errno to ETIME. - */ - int wait (ACE_Recursive_Thread_Mutex &mutex, - const ACE_Time_Value *abstime = 0); - - /// Signal one waiting thread. - int signal (void); - - /// Signal *all* waiting threads. - int broadcast (void); - - /// Returns a reference to the underlying mutex; - ACE_Recursive_Thread_Mutex &mutex (void); - - /// Dump the state of an object. - void dump (void) const; - -private: - - // = Prevent assignment and copying. - void operator= (const ACE_Condition &); - ACE_Condition (const ACE_Condition &); - -private: - - /// A normal (i.e., non-recursive) condition variable. - ACE_cond_t cond_; - - /// Reference to the recursive mutex. - ACE_Recursive_Thread_Mutex &mutex_; - -}; - -class ACE_Export ACE_Condition_Recursive_Thread_Mutex - : public ACE_Condition -{ -public: - /// Initialize the condition variable with a recursive mutex. - ACE_Condition_Recursive_Thread_Mutex (ACE_Recursive_Thread_Mutex &m); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* !ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONDITION_RECURSIVE_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/Condition_T.h b/dep/include/ace/Condition_T.h deleted file mode 100644 index 8e6132ec92c..00000000000 --- a/dep/include/ace/Condition_T.h +++ /dev/null @@ -1,168 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Condition_T.h - * - * $Id: Condition_T.h 81462 2008-04-28 11:39:40Z johnnyw $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_CONDITION_T_H -#define ACE_CONDITION_T_H - -#include /**/ "ace/pre.h" - -#include "ace/OS_NS_Thread.h" -#include "ace/Lock.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) /* ACE platform supports some form of threading. */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_Condition - * - * @brief ACE_Condition variable wrapper, which allows threads to block - * until shared data changes state. - * - * A condition variable enables threads to atomically block and - * test the condition under the protection of a mutual exclu- - * sion lock (mutex) until the condition is satisfied. That is, - * the mutex must have been held by the thread before calling - * wait or signal on the condition. If the condition is false, - * a thread blocks on a condition variable and atomically - * releases the mutex that is waiting for the condition to - * change. If another thread changes the condition, it may wake - * up waiting threads by signaling the associated condition - * variable. The waiting threads, upon awakening, reacquire the - * mutex and re-evaluate the condition. - * Note, you can only parameterize with - * @a ACE_Thread_Mutex, @a ACE_Recursive_Thread_Mutex, or @a ACE_Null_Mutex. - */ -template -class ACE_Condition -{ -public: - // = Initialiation and termination methods. - /// Initialize the condition variable. - ACE_Condition (MUTEX &m, int type = USYNC_THREAD, - const ACE_TCHAR *name = 0, void *arg = 0); - - /// Implicitly destroy the condition variable. - ~ACE_Condition (void); - - // = Lock accessors. - /** - * Block on condition, or until absolute time-of-day has passed. If - * @a abstime == 0 use "blocking" semantics. Else, if @a abstime - * != 0 and the call times out before the condition is signaled - * returns -1 and sets errno to ETIME. - */ - int wait (const ACE_Time_Value *abstime); - - /// Block on condition. - int wait (void); - - /** - * Block on condition or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" wait() semantics on the - * passed as a parameter (this is useful if you need to store the - * in shared memory). Else, if != 0 and the - * call times out before the condition is signaled returns -1 - * and sets errno to ETIME. - */ - int wait (MUTEX &mutex, const ACE_Time_Value *abstime = 0); - - /// Signal one waiting thread. - int signal (void); - - /// Signal *all* waiting threads. - int broadcast (void); - - // = Utility methods. - /// Explicitly destroy the condition variable. - int remove (void); - - /// Returns a reference to the underlying mutex_; - MUTEX &mutex (void); - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - /// Condition variable. - ACE_cond_t cond_; - - /// Reference to mutex lock. - MUTEX &mutex_; - -private: - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Condition &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Condition (const ACE_Condition &)) -}; - -/** - * @class ACE_Thread_Condition - * - * @brief ACE_Condition variable wrapper that works within processes. - * - * A condition variable enables threads to atomically block and - * test the condition under the protection of a mutual exclu- - * sion lock (mutex) until the condition is satisfied. That is, - * the mutex must have been held by the thread before calling - * wait or signal on the condition. If the condition is false, - * a thread blocks on a condition variable and atomically - * releases the mutex that is waiting for the condition to - * change. If another thread changes the condition, it may wake - * up waiting threads by signaling the associated condition - * variable. The waiting threads, upon awakening, reacquire the - * mutex and re-evaluate the condition. - */ -template -class ACE_Thread_Condition : public ACE_Condition -{ -public: - // = Initialization method. - ACE_Thread_Condition (MUTEX &m, const ACE_TCHAR *name = 0, void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Condition_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Condition_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Condition_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONDITION_T_H */ - diff --git a/dep/include/ace/Condition_T.inl b/dep/include/ace/Condition_T.inl deleted file mode 100644 index e3b452734a2..00000000000 --- a/dep/include/ace/Condition_T.inl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id: Condition_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Condition::remove (void) -{ - // ACE_TRACE ("ACE_Condition::remove"); - - // cond_destroy() is called in a loop if the condition variable is - // BUSY. This avoids a condition where a condition is signaled and - // because of some timing problem, the thread that is to be signaled - // has called the cond_wait routine after the signal call. Since - // the condition signal is not queued in any way, deadlock occurs. - - int result = 0; - - while ((result = ACE_OS::cond_destroy (&this->cond_)) == -1 - && errno == EBUSY) - { - ACE_OS::cond_broadcast (&this->cond_); - ACE_OS::thr_yield (); - } - - return result; -} - -template ACE_INLINE MUTEX & -ACE_Condition::mutex (void) -{ - // ACE_TRACE ("ACE_Condition::mutex"); - return this->mutex_; -} - -template ACE_INLINE int -ACE_Condition::signal (void) -{ -// ACE_TRACE ("ACE_Condition::signal"); - return ACE_OS::cond_signal (&this->cond_); -} - -template ACE_INLINE int -ACE_Condition::broadcast (void) -{ -// ACE_TRACE ("ACE_Condition::broadcast"); - return ACE_OS::cond_broadcast (&this->cond_); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Condition_Thread_Mutex.h b/dep/include/ace/Condition_Thread_Mutex.h deleted file mode 100644 index bc47ae2514a..00000000000 --- a/dep/include/ace/Condition_Thread_Mutex.h +++ /dev/null @@ -1,191 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Condition_Thread_Mutex.h - * - * $Id: Condition_Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_CONDITION_THREAD_MUTEX_H -#define ACE_CONDITION_THREAD_MUTEX_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_HAS_THREADS) -# include "ace/Null_Condition.h" -#else /* ACE_HAS_THREADS */ -// ACE platform supports some form of threading. - -#include "ace/Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -class ACE_Export ACE_Condition_Attributes -{ -public: - /// Constructor - ACE_Condition_Attributes (int type = ACE_DEFAULT_SYNCH_TYPE); - - /// Destructor - ~ACE_Condition_Attributes (void); - -private: - friend class ACE_Condition_Thread_Mutex; - - /// The attributes - ACE_condattr_t attributes_; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_Condition_Attributes &); - ACE_Condition_Attributes (const ACE_Condition_Attributes &); -}; - -/** - * @class ACE_Condition_Thread_Mutex - * - * @brief ACE_Condition variable wrapper written using ACE_Mutexes This - * allows threads to block until shared data changes state. - * A condition variable enables threads to atomically block and - * test the condition under the protection of a mutual exclu- - * sion lock (mutex) until the condition is satisfied. That is, - * the mutex must have been held by the thread before calling - * wait or signal on the condition. If the condition is false, - * a thread blocks on a condition variable and atomically - * releases the mutex that is waiting for the condition to - * change. If another thread changes the condition, it may wake - * up waiting threads by signaling the associated condition - * variable. The waiting threads, upon awakening, reacquire the - * mutex and re-evaluate the condition. - * - * This should be an instantiation of ACE_Condition but problems - * with compilers precludes this... - */ -class ACE_Export ACE_Condition_Thread_Mutex -{ -public: - /// Initialize the condition variable. - ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m, - const ACE_TCHAR *name = 0, - void *arg = 0); - - /// Initialize the condition variable. - ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m, - ACE_Condition_Attributes &attributes, - const ACE_TCHAR *name = 0, - void *arg = 0); - - /// Implicitly destroy the condition variable. - ~ACE_Condition_Thread_Mutex (void); - - /** - * Explicitly destroy the condition variable. Note that only one - * thread should call this method since it doesn't protect against - * race conditions. - */ - int remove (void); - - /** - * Block on condition, or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" semantics. Else, if @a abstime - * != 0 and the call times out before the condition is signaled - * returns -1 and sets errno to ETIME. - */ - int wait (const ACE_Time_Value *abstime); - - /// Block on condition. - int wait (void); - - /** - * Block on condition or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" wait() semantics on the - * passed as a parameter (this is useful if you need to store the - * in shared memory). Else, if @a abstime != 0 and the - * call times out before the condition is signaled returns -1 - * and sets errno to ETIME. - */ - int wait (ACE_Thread_Mutex &mutex, const ACE_Time_Value *abstime = 0); - - /// Signal one waiting thread. - int signal (void); - - /// Signal *all* waiting threads. - int broadcast (void); - - /// Returns a reference to the underlying mutex; - ACE_Thread_Mutex &mutex (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Condition variable. - ACE_cond_t cond_; - - /// Reference to mutex lock. - ACE_Thread_Mutex &mutex_; - - /// Keeps track of whether has been called yet to avoid - /// multiple calls, e.g., explicitly and implicitly in the - /// destructor. This flag isn't protected by a lock, so make sure - /// that you don't have multiple threads simultaneously calling - /// on the same object, which is a bad idea anyway... - bool removed_; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_Condition_Thread_Mutex &); - ACE_Condition_Thread_Mutex (const ACE_Condition_Thread_Mutex &); -}; - -#if 0 -// The following class is commented out since there doesn't -// appear to be a portable and robust means of implementing this -// functionality across platforms. If you know of a portable and -// robust way to implement this functionality please let us know. - -/** - * @class ACE_Process_Condition - * - * @brief ACE_Condition variable wrapper that works across processes. - */ -class ACE_Export ACE_Process_Condition -{ -public: - ACE_Process_Condition (MUTEX &m, const ACE_TCHAR *name = 0, void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; -#endif /* 0 */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Condition_Thread_Mutex.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* !ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONDITION_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/Condition_Thread_Mutex.inl b/dep/include/ace/Condition_Thread_Mutex.inl deleted file mode 100644 index 851269e4af6..00000000000 --- a/dep/include/ace/Condition_Thread_Mutex.inl +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- -// -// $Id: Condition_Thread_Mutex.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Condition_Attributes::ACE_Condition_Attributes (int type) -{ - (void) ACE_OS::condattr_init (this->attributes_, type); -} - -ACE_INLINE -ACE_Condition_Attributes::~ACE_Condition_Attributes (void) -{ - ACE_OS::condattr_destroy (this->attributes_); -} - -ACE_INLINE int -ACE_Condition_Thread_Mutex::remove (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::remove"); - - // is called in a loop if the condition variable is - // BUSY. This avoids a condition where a condition is signaled and - // because of some timing problem, the thread that is to be signaled - // has called the cond_wait routine after the signal call. Since - // the condition signal is not queued in any way, deadlock occurs. - - int result = 0; - - if (!this->removed_) - { - this->removed_ = true; - - while ((result = ACE_OS::cond_destroy (&this->cond_)) == -1 - && errno == EBUSY) - { - ACE_OS::cond_broadcast (&this->cond_); - ACE_OS::thr_yield (); - } - } - return result; -} - -ACE_INLINE ACE_Thread_Mutex & -ACE_Condition_Thread_Mutex::mutex (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::mutex"); - return this->mutex_; -} - -#if 0 -template void -ACE_Process_Condition::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Process_Condition::dump"); - - ACE_Condition::dump (); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Process_Condition::ACE_Process_Condition (MUTEX &m, - const ACE_TCHAR *name, - void *arg) - : ACE_Condition (m, USYNC_PROCESS, name, arg) -{ -// ACE_TRACE ("ACE_Process_Condition::ACE_Process_Condition"); -} -#endif /* 0 */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Configuration.h b/dep/include/ace/Configuration.h deleted file mode 100644 index 14972e1eca3..00000000000 --- a/dep/include/ace/Configuration.h +++ /dev/null @@ -1,893 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Configuration.h - * - * $Id: Configuration.h 82294 2008-07-12 13:03:37Z johnnyw $ - * - * @author Chris Hafey - * - * The ACE configuration API provides a portable abstraction for - * program configuration similar to the Microsoft Windows registry. - * The API supports a tree based hierarchy of configuration sections. Each - * section contains other sections or values. Values may contain string, - * unsigned integer and binary data. - * - * @note These classes are not thread safe, if multiple threads use these - * classes, you are responsible for serializing access. - * - * For examples of using this class, see: - * -# The test code in ACE_wrappers/test - * -# wxConfigViewer, a Windows like Registry Editor for ACE_Configuration - * -# TAO's IFR, it makes extensive use of ACE_Configuration - * - * @todo Templatize this class with an ACE_LOCK to provide thread safety - */ -//============================================================================= - -#ifndef ACE_CONFIGURATION_H -#define ACE_CONFIGURATION_H -#include /**/ "ace/pre.h" - -#include "ace/SStringfwd.h" -#include "ace/Hash_Map_With_Allocator_T.h" -#include "ace/Malloc_T.h" -#include "ace/MMAP_Memory_Pool.h" -#include "ace/Local_Memory_Pool.h" -#include "ace/Synch_Traits.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// configurable parameters - -#if !defined (ACE_CONFIG_SECTION_INDEX) -# define ACE_CONFIG_SECTION_INDEX "Config_Section_Index" -#endif /* ! ACE_CONFIG_SECTION_INDEX */ - -#if !defined (ACE_DEFAULT_CONFIG_SECTION_SIZE) -#define ACE_DEFAULT_CONFIG_SECTION_SIZE 16 -#endif /* ACE_DEFAULT_CONFIG_SECTION_SIZE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Section_Key_Internal - * - * @internal - * - * @brief A base class for internal handles to section keys for - * configuration implementations - * - * Implementations subclass this base class to represent a - * section key. - */ -class ACE_Export ACE_Section_Key_Internal -{ -public: - /// Virtual destructor, make sure descendants are virtual! - virtual ~ACE_Section_Key_Internal (void); - - /// Increment reference count - virtual int add_ref (void); - - /// Decrement reference count. Will delete this if count gets to 0 - virtual int dec_ref (void); -protected: - ACE_Section_Key_Internal (void); - ACE_Section_Key_Internal (const ACE_Section_Key_Internal& rhs); - ACE_Section_Key_Internal& operator= (ACE_Section_Key_Internal& rhs); - - u_int ref_count_; -}; - -/** - * @class ACE_Configuration_Section_Key - * - * @brief Reference counted wrapper for ACE_Section_Key_Internal. - * - * Reference counted wrapper class for the abstract internal - * section key. A user gets one of these to represent a section - * in the configuration database. - */ -class ACE_Export ACE_Configuration_Section_Key -{ - friend class ACE_Configuration; -public: - /// Default constructor. - ACE_Configuration_Section_Key (void); - - /// Constructor that initializes to a pointer to a concrete internal key. - /** - * @param key The section key to reference. Calls add_ref() with @a key. - */ - explicit ACE_Configuration_Section_Key (ACE_Section_Key_Internal *key); - - /// Copy constructor, increments the reference count on the key. - ACE_Configuration_Section_Key (const ACE_Configuration_Section_Key &rhs); - - /// Destructor, decrements reference count on the referenced key. - ~ACE_Configuration_Section_Key (void); - - /// Assignment operator, increments reference count for this object - /// and decrements it on @a rhs. - ACE_Configuration_Section_Key & - operator= (const ACE_Configuration_Section_Key &rhs); -private: - ACE_Section_Key_Internal *key_; -}; - -/** - * @class ACE_Configuration - * - * @internal - * - * @brief Base class for configuration databases - * - * This class provides an interface for configuration databases. A concrete - * class is required that implements the interface. - * - * @sa ACE_Configuration_Heap - * @sa ACE_Configuration_Win32Registry - */ -class ACE_Export ACE_Configuration -{ -public: - /// Enumeration for the various types of values we can store. - enum VALUETYPE - { - STRING, - INTEGER, - BINARY, - INVALID - }; - - /// Destructor - virtual ~ACE_Configuration (void); - - /// Obtain a reference to the root section of this configuration. - /* - * @return Reference to the configuration's root section. Note that - * it is a const reference. - */ - virtual const ACE_Configuration_Section_Key& root_section (void) const; - - /** - * Opens a named section in an existing section. - * - * @param base Existing section in which to open the named section. - * @param sub_section Name of the section to open. - * @param create If zero, the named section must exist. If non-zero, - * the named section will be created if it does not exist. - * @param result Reference; receives the section key for the new - * section. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int open_section (const ACE_Configuration_Section_Key &base, - const ACE_TCHAR *sub_section, - int create, - ACE_Configuration_Section_Key& result) = 0; - - /// Removes a named section. - /** - * @param key Section key to remove the named section from. - * @param sub_section Name of the section to remove. - * @param recursive If non zero, any subkeys below @a sub_section are - * removed as well. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int remove_section (const ACE_Configuration_Section_Key &key, - const ACE_TCHAR *sub_section, - int recursive) = 0; - - /** - * Enumerates through the values in a section. - * - * @param key Section key to iterate through. - * @param index Iteration position. Must be zero on the first call to - * iterate through @a key. Increment @a index by one on each - * successive call to this method. - * @param name Receives the value's name. - * @param type Receives the value's data type. - * - * @note You may not delete or add values while enumerating. If the - * section is modified during enumeration, results are undefined; - * you must restart the enumeration from index 0. - * - * @retval 0 for success, @a name and @a type are valid. - * @retval 1 there are no more values in the section. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type) = 0; - - /** - * Enumerates through the subsections in a section. - * - * @param key Section key to iterate through. - * @param index Iteration position. Must be zero on the first call to - * iterate through @a key. Increment @a index by one on each - * successive call to this method. - * @param name Receives the subsection's name. - * - * @note You may not modify the @a key section while enumerating. If the - * section is modified during enumeration, results are undefined; - * you must restart the enumeration from index 0. - * - * @retval 0 for success, @a name has a valid name. - * @retval 1 there are no more subsections in the section. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, ACE_TString& name) = 0; - - /// Sets a string-typed value. - /** - * @param key Configuration section to set the value in. - * @param name Name of the configuration value to set. If a value with - * the specified name exists, it is replaced. - * @param value The string to set the configuration value to. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) = 0; - - /// Sets a integer-typed value. - /** - * @param key Configuration section to set the value in. - * @param name Name of the configuration value to set. If a value with - * the specified name exists, it is replaced. - * @param value The integer to set the configuration value to. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) = 0; - - /// Sets a binary-typed value. - /** - * @param key Configuration section to set the value in. - * @param name Name of the configuration value to set. If a value with - * the specified name exists, it is replaced. - * @param data Pointer to the binary data for the value. - * @param length Number of bytes for the new value. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - size_t length) = 0; - - /// Gets a string-typed value. - /** - * @param key Configuration section to get the value from. - * @param name Name of the configuration value to get. - * @param value Receives the configuration value if it exists and - * has type STRING. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) = 0; - - /// Gets an integer-typed value. - /** - * @param key Configuration section to get the value from. - * @param name Name of the configuration value to get. - * @param value Receives the configuration value if it exists and - * has type INTEGER. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) = 0; - - /// Gets a binary-typed value. - /** - * @param key Configuration section to get the value from. - * @param name Name of the configuration value to get. - * @param data Receives a pointer to memory holding the binary data - * for the value. This method allocates the memory pointed - * to using operator new[]. The caller is responsible for - * freeing the memory using operator delete[]. - * @param length Receives the number of bytes in the value. - * - * @retval 0 for success; caller is responsible for freeing the - * returned memory. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - size_t& length) = 0; - - /** - * Retrieves the type of a named configuration value. - * - * @param key Configuration section to look up the name in. - * @param name Name of the configuration value to get the type of. - * @param type Receives the data type of the named value, if it exists. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int find_value(const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - VALUETYPE& type) = 0; - - /// Removes a named value. - /** - * @param key Configuration section to remove the named value from. - * @param name Name of the configuration value to remove. - * - * @retval 0 for success. - * @retval -1 for error; ACE_OS::last_error() retrieves error code. - */ - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) = 0; - - /** - * Expands @a path_in to @a key_out from @a key. If create is true, - * the subsections are created. Returns 0 on success, non zero on - * error The path consists of sections separated by the backslash - * '\' or forward slash '/'. - * Returns 0 on success, -1 if - virtual ~ACE_Section_Key_Win32 (void); - - // Not used - ACE_Section_Key_Win32 (const ACE_Section_Key_Win32& rhs); - ACE_Section_Key_Win32& operator= (const ACE_Section_Key_Win32& rhs); -}; - -/** - * @class ACE_Configuration_Win32Registry - * - * @brief The win32 registry implementation of a configuration database - * - * The win32 implementation basically makes calls through to the - * registry functions. The API is very similar so very little - * work must be done - */ -class ACE_Export ACE_Configuration_Win32Registry : public ACE_Configuration -{ -public: - - /** - * Constructor for registry configuration database. hKey is the - * base registry key to attach to. This class takes ownership of - * hKey, it will invoke on it upon destruction. - */ - explicit ACE_Configuration_Win32Registry (HKEY hKey); - - /// Destructor - virtual ~ACE_Configuration_Win32Registry (void); - - virtual int open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result); - - virtual int remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive); - - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type); - - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name); - - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value); - - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value); - - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - size_t length); - - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value); - - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value); - - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - size_t& length); - - virtual int find_value(const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - VALUETYPE& type); - - /// Removes the the value @a name from @a key. returns non zero on error - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name); - - /** - * This method traverses through . It is useful when - * you want the HKEY for a specific registry key, especially when - * initializing this implementation. Caller is responsible for - * closeing this key when it is no longer used. If create is 1 - * (default) the keys are create if they don't already exist. - * Returns 0 on error - */ - static HKEY resolve_key (HKEY hKey, - const ACE_TCHAR* path, - int create = 1); - virtual bool operator== (const ACE_Configuration_Win32Registry &rhs) const; - virtual bool operator!= (const ACE_Configuration_Win32Registry &rhs) const; - -protected: - - /// Gets the HKEY for a configuration section - int load_key (const ACE_Configuration_Section_Key& key, HKEY& hKey); - - // Not used - ACE_Configuration_Win32Registry (void); - ACE_Configuration_Win32Registry (const ACE_Configuration_Win32Registry& rhs); - ACE_Configuration_Win32Registry& operator= (const ACE_Configuration_Win32Registry& rhs); -}; -#endif /* ACE_WIN32 && !ACE_LACKS_WIN32_REGISTRY */ - -// ACE_Allocator version - -typedef ACE_Allocator_Adapter > - PERSISTENT_ALLOCATOR; -typedef ACE_Allocator_Adapter > - HEAP_ALLOCATOR; - -/** - * @class ACE_Configuration_ExtId - * - * @brief External ID for the section and value hash - * - * Contains a pointer to the section or value name. - */ -class ACE_Export ACE_Configuration_ExtId -{ -public: - /// Defeault ctor - ACE_Configuration_ExtId (void); - - /// Named constructor - explicit ACE_Configuration_ExtId (const ACE_TCHAR* name); - - /// Copy ctor - ACE_Configuration_ExtId (const ACE_Configuration_ExtId& rhs); - - /// destructor - ~ACE_Configuration_ExtId (void); - - /// Assignment operator - ACE_Configuration_ExtId& operator= (const ACE_Configuration_ExtId& rhs); - - /// Equality comparison operator (must match name_). - bool operator== (const ACE_Configuration_ExtId &rhs) const; - - /// Inequality comparison operator. - bool operator!= (const ACE_Configuration_ExtId &rhs) const; - - /// Frees the name of the value. needed since we don't know the - /// allocator name_ was created in - void free (ACE_Allocator *alloc); - - /// function is required in order for this class to be usable by - /// ACE_Hash_Map_Manager. - u_long hash (void) const; - - // = Data members. - - const ACE_TCHAR * name_; - - // Accessors - const ACE_TCHAR *name (void); -}; - -typedef ACE_Hash_Map_With_Allocator - SUBSECTION_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - SUBSECTION_HASH; - -/// @deprecated Deprecated typedef. Use the SUBSECTION_HASH::ENTRY trait instead. -typedef SUBSECTION_HASH::ENTRY SUBSECTION_ENTRY; - -/** - * @class ACE_Configuration_Value_IntId - * - * @brief The section hash table internal value class - * - * This class is present as the internal portion of a section's - * value hash table It may store string, integer or binary data. - */ -class ACE_Export ACE_Configuration_Value_IntId -{ -public: - /// Default constructor - ACE_Configuration_Value_IntId (void); - - /// String constructor, takes ownership of string - explicit ACE_Configuration_Value_IntId (ACE_TCHAR* string); - - /// Integer constructor - explicit ACE_Configuration_Value_IntId (u_int integer); - - /// Binary constructor, takes ownership of data - ACE_Configuration_Value_IntId (void* data, size_t length); - - /// Copy ctor - ACE_Configuration_Value_IntId (const ACE_Configuration_Value_IntId& rhs); - - /// Destructor - ~ACE_Configuration_Value_IntId (void); - - /// Assignment operator - ACE_Configuration_Value_IntId& operator= ( - const ACE_Configuration_Value_IntId& rhs); - - void free (ACE_Allocator *alloc); - - // = Data members. - - /** - * Points to the string value or binary data or IS the integer - * Length is only used when type_ == BINARY - */ - ACE_Configuration::VALUETYPE type_; - union { - void * ptr_; - u_int int_; - } data_; - size_t length_; -}; - -typedef ACE_Hash_Map_With_Allocator - VALUE_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - VALUE_HASH; - -// Deprecated typedef. Use the VALUE_HASH::ENTRY trait instead. -typedef VALUE_HASH::ENTRY VALUE_ENTRY; - -/** - * @class ACE_Configuration_Section_IntId - * - * @brief The internal ID for a section hash table - * - * Contains a hash table containing value name/values - */ -class ACE_Export ACE_Configuration_Section_IntId -{ -public: - /// Default ctor - ACE_Configuration_Section_IntId (void); - - /// Named ctor - ACE_Configuration_Section_IntId (VALUE_MAP* value_hash_map, - SUBSECTION_MAP* section_hash_map); - - /// Copy ctor - ACE_Configuration_Section_IntId (const ACE_Configuration_Section_IntId& rhs); - - /// Destructor - ~ACE_Configuration_Section_IntId (void); - - /// Assignment operator - ACE_Configuration_Section_IntId& operator= ( - const ACE_Configuration_Section_IntId& rhs); - - /// Frees the hash table and all its values - void free (ACE_Allocator *alloc); - - // = Data Members. - VALUE_MAP* value_hash_map_; - - SUBSECTION_MAP* section_hash_map_; -}; - -typedef ACE_Hash_Map_With_Allocator - SECTION_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - SECTION_HASH; - -// Deprecated typedef. Use the SECTION_HASH::ENTRY trait instead. -typedef SECTION_HASH::ENTRY SECTION_ENTRY; - -/** - * @class ACE_Configuration_Section_Key_Heap - * - * @brief Internal section key class for heap based configuration - * database. - * - * Contains a value iterator and full path name of section. - */ -class ACE_Export ACE_Configuration_Section_Key_Heap - : public ACE_Section_Key_Internal -{ -public: - /// Constructor based on the full path of the section - ACE_Configuration_Section_Key_Heap (const ACE_TCHAR* path); - - /// The path itself - ACE_TCHAR* path_; - - /// The value iterator - VALUE_HASH::ITERATOR* value_iter_; - - /// The sub section iterator - SUBSECTION_HASH::ITERATOR* section_iter_; -protected: - /// Destructor - will delete the iterators - virtual ~ACE_Configuration_Section_Key_Heap (void); - - // Not used - ACE_Configuration_Section_Key_Heap (const ACE_Configuration_Section_Key_Heap& rhs); - ACE_Configuration_Section_Key_Heap& operator= (const ACE_Configuration_Section_Key_Heap& rhs); -}; - -/** - * @class ACE_Configuration_Heap - * - * @brief The concrete implementation of a allocator based - * configuration database - * - * This class uses ACE's Allocators to manage a memory - * representation of a configuration database. A persistent heap - * may be used to store configurations persistently - * - * @note Before using this class you must call one of the open methods. - * - * @todo - * - Need to investigate what happens if memory mapped file gets mapped to - * a location different than it was created with. - */ -class ACE_Export ACE_Configuration_Heap : public ACE_Configuration -{ -public: - - /// Default ctor - ACE_Configuration_Heap (void); - - /// Destructor - virtual ~ACE_Configuration_Heap (void); - - /// Opens a configuration based on a file name - int open (const ACE_TCHAR* file_name, - void* base_address = ACE_DEFAULT_BASE_ADDR, - size_t default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); - - /// Opens a heap based configuration - int open (size_t default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); - - virtual int open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, ACE_Configuration_Section_Key& result); - - virtual int remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive); - - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type); - - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name); - - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value); - - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value); - - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - size_t length); - - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value); - - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value); - - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void* &data, - size_t &length); - - virtual int find_value(const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - VALUETYPE& type); - - /// Removes the the value @a name from @a key. returns non zero on error - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name); - -private: - /// @a sub_section may not contain path separators - int open_simple_section (const ACE_Configuration_Section_Key &base, - const ACE_TCHAR *sub_section, - int create, ACE_Configuration_Section_Key &result); - /// Adds a new section - int add_section (const ACE_Configuration_Section_Key &base, - const ACE_TCHAR *sub_section, - ACE_Configuration_Section_Key &result); - - /// Helper for the method. - int create_index (void); - - /// Helper for create_index() method: places hash table into an - /// allocated space. - int create_index_helper (void *buffer); - - int value_open_helper (size_t hash_table_size, void *buffer); - - int section_open_helper (size_t hash_table_size, void *buffer); - - int load_key (const ACE_Configuration_Section_Key& key, ACE_TString& name); - - int new_section (const ACE_TString& section, - ACE_Configuration_Section_Key& result); - - ACE_Configuration_Heap (const ACE_Configuration_Heap& rhs); - ACE_Configuration_Heap& operator= (const ACE_Configuration_Heap& rhs); - - ACE_Allocator *allocator_; - SECTION_MAP *index_; - size_t default_map_size_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Configuration.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIGURATION_H */ - diff --git a/dep/include/ace/Configuration.inl b/dep/include/ace/Configuration.inl deleted file mode 100644 index 19c2c591bf4..00000000000 --- a/dep/include/ace/Configuration.inl +++ /dev/null @@ -1,13 +0,0 @@ -// -*- C++ -*- -// -// $Id: Configuration.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE const ACE_TCHAR* -ACE_Configuration_ExtId::name (void) -{ - return name_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Configuration_Import_Export.h b/dep/include/ace/Configuration_Import_Export.h deleted file mode 100644 index ec47bafa144..00000000000 --- a/dep/include/ace/Configuration_Import_Export.h +++ /dev/null @@ -1,216 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Configuration_Import_Export.h - * - * $Id: Configuration_Import_Export.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Jerry D. Odenwelder Jr. - * Chris Hafey - * - * Classes defined in this file provide the ability to import and export - * ACE Configuration objects to/from disk files. The base class - * ACE_Config_ImpExp_Base provides the common functionality and the derived - * classes implement the import/export functionality for the specific format. - * - * @todo - * - Add locking for thread safety. - * - Provide ability to read file in one format and write in another. - * - See todo's in each class - */ -//============================================================================= - -#ifndef ACE_CONFIGURATION_IMPORT_EXPORT_H -#define ACE_CONFIGURATION_IMPORT_EXPORT_H -#include /**/ "ace/pre.h" - -#include "ace/Configuration.h" -#include "ace/SString.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Config_ImpExp_Base - * - * @brief Base class for file import/export configuration. - * - * This class provides base functionality for configuration objects - * that are persisted in files. It takes an ACE_Configuration - * object that it populates with the data read. - * - */ -class ACE_Export ACE_Config_ImpExp_Base -{ -public: - /// Constructor taking the ACE_Configuration to import/export to - ACE_Config_ImpExp_Base (ACE_Configuration& config); - - /** - * Destructor - */ - virtual ~ACE_Config_ImpExp_Base (void); - - /** - * Imports the configuration database from @a filename. - * No existing data is removed. - */ - virtual int import_config (const ACE_TCHAR* filename) = 0; - - /** - * This method exports the entire configuration database to @a filename. - * Once the file is opened this method calls 'export_section' passing - * the root section. - */ - virtual int export_config (const ACE_TCHAR* filename) = 0; - -protected: - ACE_Configuration &config_; - -private: - ACE_Config_ImpExp_Base (const ACE_Config_ImpExp_Base&); - ACE_Config_ImpExp_Base& operator= (const ACE_Config_ImpExp_Base&); -}; - -/** - * @class ACE_Registry_ImpExp - * - * @brief Configuration object that imports/exports data to a file formatted - * using the Win32 Registry file export format. This format looks like - * [Section] - * "key"="String Data" - * "key"=dword: numeric data in hexidecimal format - * "key"=hex: binary data - * - * @todo - * - Add dynamic buffer when importing. currently it will not allow - * importing of values greater than a fixed ammount (4096 bytes) - * - */ -class ACE_Export ACE_Registry_ImpExp : public ACE_Config_ImpExp_Base -{ -public: - /// Construction - ACE_Registry_ImpExp (ACE_Configuration&); - - /// Destruction. - virtual ~ACE_Registry_ImpExp (void); - - /** - * Imports the configuration database from filename. - * No existing data is removed. - */ - virtual int import_config (const ACE_TCHAR* filename); - - /** - * This method exports the entire configuration database to @a filename. - * Once the file is opened this method calls export_section() passing - * the root section. - */ - virtual int export_config (const ACE_TCHAR* filename); - -private: - int export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out); - - int process_previous_line_format (ACE_TCHAR* buffer, - ACE_Configuration_Section_Key& section); - - ACE_Registry_ImpExp ( const ACE_Registry_ImpExp&); - ACE_Registry_ImpExp& operator= ( const ACE_Registry_ImpExp&); -}; - -/** - * @class ACE_Ini_ImpExp - * - * @brief Imports the configuration database from filename as strings. - * Allows non-typed values. (no #, dword: hex:, etc. prefixes) and - * skips whitespace (tabs and spaces) as in standard .ini and .conf - * files. Values (to right of equal sign) can be double quote - * delimited to embed tabs and spaces in the string. - * Caller must convert string to type. - * - * This method allows for lines in the .ini or .conf file like this: - * - * TimeToLive = 100 - * Delay = FALSE - * Flags = FF34 - * Heading = "ACE - Adaptive Communication Environment" - * - * (note leading whitespace (tabs) in examples below) - * - * SeekIndex = 14 - * TraceLevel = 6 # Can comment lines like this - * Justification = left_justified - * - * The caller can then retrieve the string with the regular - * function and convert the string to the - * desired data type. - * - * @todo - * - Strings with embedded newlines cause the import to fail - * - Strings with embedded quotes " cause the import to fail - * - Importing/exporting for values in the root section does not work - * - Add dynamic buffer when importing. currently it will not allow - * importing of values greater than a fixed ammount (4096 bytes) -*/ -class ACE_Export ACE_Ini_ImpExp : public ACE_Config_ImpExp_Base -{ -public: - /** - * Construction - */ - ACE_Ini_ImpExp (ACE_Configuration&); - - /** - * Destructor - */ - virtual ~ACE_Ini_ImpExp (void); - - /** - * Imports the configuration database from filename. - * No existing data is removed. - */ - virtual int import_config (const ACE_TCHAR* filename); - - /** - * This method exports the entire configuration database to @a filename. - * Once the file is opened this method calls export_section() passing - * the root section. - */ - virtual int export_config (const ACE_TCHAR* filename); - -private: - /** - * Method provided by derived classes in order to write one section - * to the file specified. Called by export_config() when exporting - * the entire configuration object. - */ - int export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out); - - /** - * Method to squish leading and trailing whitespaces in a string. - * Whitespace is defined as: spaces (' '), tabs ('\\t') or cr/lf. - * Returns a pointer to the first non-whitespace character in the - * buffer provided, or a pointer to the terminating null if the string - * is all whitespace. The terminating null is moved forward to the - * first character past the last non-whitespace. - */ - ACE_TCHAR *squish (ACE_TCHAR *src); - - ACE_Ini_ImpExp (const ACE_Ini_ImpExp&); - ACE_Ini_ImpExp& operator= (const ACE_Ini_ImpExp&); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIGURATION_IMPORT_EXPORT_H */ - diff --git a/dep/include/ace/Connection_Recycling_Strategy.h b/dep/include/ace/Connection_Recycling_Strategy.h deleted file mode 100644 index 0770c3a6c26..00000000000 --- a/dep/include/ace/Connection_Recycling_Strategy.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Connection_Recycling_Strategy.h - * - * $Id: Connection_Recycling_Strategy.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= -#ifndef ACE_CONNECTION_RECYCLING_STRATEGY_H -#define ACE_CONNECTION_RECYCLING_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "ace/Recyclable.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Connection_Recycling_Strategy - * - * @brief Defines the interface for a connection recycler. - */ -class ACE_Export ACE_Connection_Recycling_Strategy -{ -public: - /// Virtual Destructor - virtual ~ACE_Connection_Recycling_Strategy (void); - - /// Remove from cache. - virtual int purge (const void *recycling_act) = 0; - - /// Add to cache. - virtual int cache (const void *recycling_act) = 0; - - virtual int recycle_state (const void *recycling_act, - ACE_Recyclable_State new_state) = 0; - - /// Get/Set recycle_state. - virtual ACE_Recyclable_State recycle_state (const void *recycling_act) const = 0; - - /// Mark as closed. - virtual int mark_as_closed (const void *recycling_act) = 0; - - /// Mark as closed.(non-locking version) - virtual int mark_as_closed_i (const void *recycling_act) = 0; - - /// Cleanup hint and reset @a act_holder to zero if @a act_holder != 0. - virtual int cleanup_hint (const void *recycling_act, - void **act_holder = 0) = 0; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /*ACE_CONNECTION_RECYCLING_STRATEGY*/ - diff --git a/dep/include/ace/Connector.h b/dep/include/ace/Connector.h deleted file mode 100644 index 73689356501..00000000000 --- a/dep/include/ace/Connector.h +++ /dev/null @@ -1,564 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Connector.h - * - * $Id: Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_CONNECTOR_H -#define ACE_CONNECTOR_H - -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Strategies_T.h" -#include "ace/Synch_Options.h" -#include "ace/Unbounded_Set.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Connector_Base - * - * @brief This base interface allows ACE_NonBlocking_Connect_Handler - * to only care about the SVC_HANDLER template parameter of the - * ACE_Connector. Otherwise, ACE_NonBlocking_Connect_Handler would - * have to be configured with all the template parameters that - * ACE_Connector is configured with. - */ -template -class ACE_Connector_Base -{ -public: - - virtual ~ACE_Connector_Base (void) {} - - /// Initialize the Svc_Handler. - virtual void initialize_svc_handler (ACE_HANDLE handle, - SVC_HANDLER *svc_handler) = 0; - - /// Return the handle set representing the non-blocking connects in - /// progress. - virtual ACE_Unbounded_Set &non_blocking_handles (void) = 0; -}; - -/** - * @class ACE_NonBlocking_Connect_Handler - * - * @brief Performs non-blocking connects on behalf of the Connector. - */ -template -class ACE_NonBlocking_Connect_Handler : public ACE_Event_Handler -{ -public: - - /// Constructor. - ACE_NonBlocking_Connect_Handler (ACE_Connector_Base &connector, - SVC_HANDLER *, - long timer_id); - - /// Close up and return underlying SVC_HANDLER through @c sh. - /** - * If the return value is true the close was performed succesfully, - * implying that this object was removed from the reactor and thereby - * (by means of reference counting decremented to 0) deleted. - * If the return value is false, the close was not successful. - * The @c sh does not have any connection to the return - * value. The argument will return a valid svc_handler object if a - * valid one exists within the object. Returning a valid svc_handler - * pointer also invalidates the svc_handler contained in this - * object. - */ - bool close (SVC_HANDLER *&sh); - - /// Get SVC_HANDLER. - SVC_HANDLER *svc_handler (void); - - /// Get handle. - ACE_HANDLE handle (void); - - /// Set handle. - void handle (ACE_HANDLE); - - /// Get timer id. - long timer_id (void); - - /// Set timer id. - void timer_id (long timer_id); - - /// Called by ACE_Reactor when asynchronous connections fail. - virtual int handle_input (ACE_HANDLE); - - /// Called by ACE_Reactor when asynchronous connections succeed. - virtual int handle_output (ACE_HANDLE); - - /// Called by ACE_Reactor when asynchronous connections suceeds (on - /// some platforms only). - virtual int handle_exception (ACE_HANDLE fd); - - /// This method is called if a connection times out before - /// completing. - virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg); - - /// Should Reactor resume us if we have been suspended before the upcall? - virtual int resume_handler (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Connector base. - ACE_Connector_Base &connector_; - - /// Associated SVC_HANDLER. - SVC_HANDLER *svc_handler_; - - /// Associated timer id. - long timer_id_; -}; - -/** - * @class ACE_Connector - * - * @brief Generic factory for actively connecting clients and creating - * service handlers (SVC_HANDLERs). - * - * Implements the strategy for actively establishing connections with - * clients. An ACE_Connector is parameterized by concrete types that - * conform to the interfaces of PEER_CONNECTOR and SVC_HANDLER. The - * PEER_CONNECTOR is instantiated with a transport mechanism that - * actively establishes connections. The SVC_HANDLER is instantiated - * with a concrete type that performs the application-specific - * service. Both blocking and non-blocking connects are supported. - * Further, non-blocking connects support timeouts. - */ -template -class ACE_Connector : public ACE_Connector_Base, public ACE_Service_Object -{ -public: - - // Useful STL-style traits. - typedef typename SVC_HANDLER::addr_type addr_type; - typedef ACE_PEER_CONNECTOR connector_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - typedef typename ACE_PEER_CONNECTOR::PEER_ADDR peer_addr_type; - typedef ACE_PEER_CONNECTOR_ADDR ACE_PEER_ADDR_TYPEDEF; - - /** - * Initialize a connector. @a flags indicates how SVC_HANDLER's - * should be initialized prior to being activated. Right now, the - * only flag that is processed is ACE_NONBLOCK, which enabled - * non-blocking I/O on the SVC_HANDLER when it is opened. - */ - ACE_Connector (ACE_Reactor *r = ACE_Reactor::instance (), - int flags = 0); - - /** - * Initialize a connector. @a flags indicates how SVC_HANDLER's - * should be initialized prior to being activated. Right now, the - * only flag that is processed is ACE_NONBLOCK, which enabled - * non-blocking I/O on the SVC_HANDLER when it is opened. - */ - virtual int open (ACE_Reactor *r = ACE_Reactor::instance (), - int flags = 0); - - /// Shutdown a connector and release resources. - virtual ~ACE_Connector (void); - - // = Connection establishment methods. - - /** - * Initiate connection of @a svc_handler to peer at @a remote_addr - * using @a synch_options. If the caller wants to designate the - * selected @a local_addr they can (and can also insist that the - * @a local_addr be reused by passing a value @a reuse_addr == - * 1). @a flags and @a perms can be used to pass any flags that are - * needed to perform specific operations such as opening a file - * within connect with certain permissions. If the connection fails - * the hook on the will be called - * automatically to prevent resource leaks. - */ - virtual int connect (SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - const ACE_PEER_CONNECTOR_ADDR &local_addr - = (peer_addr_type &) ACE_PEER_CONNECTOR_ADDR_ANY, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /** - * This is a variation on the previous method. On cached - * connectors the @a svc_handler_hint variable can be used as a hint - * for future lookups. Since this variable is modified in the - * context of the internal cache its use is thread-safe. But the - * actual svc_handler for the current connection is returned in the - * second parameter @a svc_handler. If the connection fails the - * hook on the will be called automatically to - * prevent resource leaks. - */ - virtual int connect (SVC_HANDLER *&svc_handler_hint, - SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - const ACE_PEER_CONNECTOR_ADDR &local_addr - = (peer_addr_type &) ACE_PEER_CONNECTOR_ADDR_ANY, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /** - * Initiate connection of @a n @a svc_handlers to peers at - * @a remote_addrs using @a synch_options. Returns -1 if failure - * occurs and 0 otherwise. If @a failed_svc_handlers is non-NULL, a - * 1 is placed in the corresponding index of @a failed_svc_handlers - * for each that failed to connect, else a 0 is - * placed in that index. - */ - virtual int connect_n (size_t n, - SVC_HANDLER *svc_handlers[], - ACE_PEER_CONNECTOR_ADDR remote_addrs[], - ACE_TCHAR *failed_svc_handlers = 0, - const ACE_Synch_Options &synch_options = - ACE_Synch_Options::defaults); - - /** - * Cancel the @a svc_handler that was started asynchronously. Note that - * this is the only case when the Connector does not actively close - * the @a svc_handler. It is left up to the caller of to - * decide the fate of the @a svc_handler. - */ - virtual int cancel (SVC_HANDLER *svc_handler); - - /// Close down the Connector. All pending non-blocking connects are - /// canceled and the corresponding svc_handler is closed. - virtual int close (void); - - /// Return the underlying PEER_CONNECTOR object. - virtual ACE_PEER_CONNECTOR &connector (void) const; - - /// Initialize Svc_Handler. - virtual void initialize_svc_handler (ACE_HANDLE handle, - SVC_HANDLER *svc_handler); - - /// Set Reactor. - virtual void reactor (ACE_Reactor *reactor); - - /// Get Reactor. - virtual ACE_Reactor *reactor (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Helpful typedefs. - typedef ACE_NonBlocking_Connect_Handler NBCH; - - // = The following two methods define the Connector's strategies for - // creating, connecting, and activating SVC_HANDLER's, respectively. - - /** - * Bridge method for creating a SVC_HANDLER. The default is to - * create a new SVC_HANDLER only if @a sh == 0, else @a sh is - * unchanged. However, subclasses can override this policy to - * perform SVC_HANDLER creation in any way that they like (such as - * creating subclass instances of SVC_HANDLER, using a singleton, - * dynamically linking the handler, etc.). Returns -1 if failure, - * else 0. - */ - virtual int make_svc_handler (SVC_HANDLER *&sh); - - /** - * Bridge method for connecting the @a svc_handler to the - * @a remote_addr. The default behavior delegates to the - * . - */ - virtual int connect_svc_handler (SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - virtual int connect_svc_handler (SVC_HANDLER *&svc_handler, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /** - * Bridge method for activating a @a svc_handler with the appropriate - * concurrency strategy. The default behavior of this method is to - * activate the SVC_HANDLER by calling its method (which - * allows the SVC_HANDLER to define its own concurrency strategy). - * However, subclasses can override this strategy to do more - * sophisticated concurrency activations (such as creating the - * SVC_HANDLER as an "active object" via multi-threading or - * multi-processing). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - /// Creates and registers ACE_NonBlocking_Connect_Handler. - int nonblocking_connect (SVC_HANDLER *, - const ACE_Synch_Options &); - - /// Implementation of the connect methods. - virtual int connect_i (SVC_HANDLER *&svc_handler, - SVC_HANDLER **sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /// Return the handle set representing the non-blocking connects in - /// progress. - ACE_Unbounded_Set &non_blocking_handles (void); - - // = Dynamic linking hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Calls handle_close() to shutdown the Connector gracefully. - virtual int fini (void); - - /// Default version returns address info in @a buf. - virtual int info (ACE_TCHAR **strp, size_t length) const; - - // = Service management hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int suspend (void); - - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int resume (void); - -private: - /// This is the peer connector factory. - ACE_PEER_CONNECTOR connector_; - - /** - * Flags that indicate how SVC_HANDLER's should be initialized - * prior to being activated. Right now, the only flag that is - * processed is ACE_NONBLOCK, which enabled non-blocking I/O on - * the SVC_HANDLER when it is opened. - */ - int flags_; - - /// Pointer to the Reactor. - ACE_Reactor *reactor_; - - /// Handle set representing the non-blocking connects in progress. - ACE_Unbounded_Set non_blocking_handles_; - -}; - -/** - * @class ACE_Strategy_Connector - * - * @brief Abstract factory for creating a service handler - * (SVC_HANDLER), connecting the SVC_HANDLER, and activating the - * SVC_HANDLER. - * - * Implements a flexible and extensible set of strategies for - * actively establishing connections with clients. There are - * three main strategies: (1) creating a SVC_HANDLER, (2) - * actively initiating a new connection from the client, - * and (3) activating the SVC_HANDLER with a - * particular concurrency mechanism after the connection is established. - */ -template -class ACE_Strategy_Connector - : public ACE_Connector -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy - creation_strategy_type; - typedef ACE_Connect_Strategy - connect_strategy_type; - typedef ACE_Concurrency_Strategy - concurrency_strategy_type; - typedef ACE_Connector - base_type; - - // = Define some useful (old style) traits. - typedef ACE_Creation_Strategy - CREATION_STRATEGY; - typedef ACE_Connect_Strategy - CONNECT_STRATEGY; - typedef ACE_Concurrency_Strategy - CONCURRENCY_STRATEGY; - typedef ACE_Connector - SUPER; - - /** - * Initialize a connector. @a flags indicates how 's - * should be initialized prior to being activated. Right now, the - * only flag that is processed is ACE_NONBLOCK, which enabled - * non-blocking I/O on the SVC_HANDLER when it is opened. - */ - ACE_Strategy_Connector (ACE_Reactor *r = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Connect_Strategy * = 0, - ACE_Concurrency_Strategy * = 0, - int flags = 0); - - /** - * Initialize a connector. @a flags indicates how SVC_HANDLER's - * should be initialized prior to being activated. Right now, the - * only flag that is processed is ACE_NONBLOCK, which enabled - * non-blocking I/O on the SVC_HANDLER when it is opened. - * Default strategies would be created and used. - */ - virtual int open (ACE_Reactor *r, - int flags); - - /** - * Initialize a connector. @a flags indicates how SVC_HANDLER's - * should be initialized prior to being activated. Right now, the - * only flag that is processed is ACE_NONBLOCK, which enabled - * non-blocking I/O on the SVC_HANDLER when it is opened. - */ - virtual int open (ACE_Reactor *r = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Connect_Strategy * = 0, - ACE_Concurrency_Strategy * = 0, - int flags = 0); - - /// Shutdown a connector and release resources. - virtual ~ACE_Strategy_Connector (void); - - /// Close down the Connector - virtual int close (void); - - // = Strategies accessors - virtual ACE_Creation_Strategy *creation_strategy (void) const; - virtual ACE_Connect_Strategy *connect_strategy (void) const; - virtual ACE_Concurrency_Strategy *concurrency_strategy (void) const; - -protected: - // = The following three methods define the 's strategies - // for creating, connecting, and activating SVC_HANDLER's, - // respectively. - - /** - * Bridge method for creating a SVC_HANDLER. The strategy for - * creating a SVC_HANDLER are configured into the Connector via - * it's . The default is to create a new - * SVC_HANDLER only if @a sh == 0, else @a sh is unchanged. - * However, subclasses can override this policy to perform - * SVC_HANDLER creation in any way that they like (such as - * creating subclass instances of SVC_HANDLER, using a singleton, - * dynamically linking the handler, etc.). Returns -1 if failure, - * else 0. - */ - virtual int make_svc_handler (SVC_HANDLER *&sh); - - /** - * Bridge method for connecting the new connection into the - * SVC_HANDLER. The default behavior delegates to the - * in the . - */ - virtual int connect_svc_handler (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /** - * Bridge method for connecting the new connection into the - * SVC_HANDLER. The default behavior delegates to the - * in the . - * @a sh_copy is used to obtain a copy of the @a sh pointer, but that - * can be kept in the stack; the motivation is a bit too long to - * include here, but basically we want to modify @a sh safely, using - * the internal locks in the Connect_Strategy, while saving a TSS - * copy in @a sh_copy, usually located in the stack. - */ - virtual int connect_svc_handler (SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /** - * Bridge method for activating a SVC_HANDLER with the appropriate - * concurrency strategy. The default behavior of this method is to - * activate the SVC_HANDLER by calling its method (which - * allows the SVC_HANDLER to define its own concurrency strategy). - * However, subclasses can override this strategy to do more - * sophisticated concurrency activations (such as creating the - * SVC_HANDLER as an "active object" via multi-threading or - * multi-processing). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - // = Strategy objects. - - /// Creation strategy for an Connector. - CREATION_STRATEGY *creation_strategy_; - - /// true if Connector created the creation strategy and thus should - /// delete it, else false. - bool delete_creation_strategy_; - - /// Connect strategy for a Connector. - CONNECT_STRATEGY *connect_strategy_; - - /// true if Connector created the connect strategy and thus should - /// delete it, else false. - bool delete_connect_strategy_; - - /// Concurrency strategy for an . - CONCURRENCY_STRATEGY *concurrency_strategy_; - - /// true if Connector created the concurrency strategy and thus should - /// delete it, else false. - bool delete_concurrency_strategy_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Connector.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Connector.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CONNECTOR_H */ - diff --git a/dep/include/ace/Containers.h b/dep/include/ace/Containers.h deleted file mode 100644 index f6f1d35bb60..00000000000 --- a/dep/include/ace/Containers.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Containers.h - * - * $Id: Containers.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_CONTAINERS_H -#define ACE_CONTAINERS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template class ACE_Double_Linked_List; -template class ACE_Double_Linked_List_Iterator_Base; -template class ACE_Double_Linked_List_Iterator; -template class ACE_Double_Linked_List_Reverse_Iterator; - -/** - * @class ACE_DLList_Node - * - * @brief Base implementation of element in a DL list. Needed for - * ACE_Double_Linked_List. - */ -class ACE_Export ACE_DLList_Node -{ -public: - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List_Reverse_Iterator; - - ACE_DLList_Node (void *i, - ACE_DLList_Node *n = 0, - ACE_DLList_Node *p = 0); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - void *item_; - - ACE_DLList_Node *next_; - ACE_DLList_Node *prev_; - -protected: - ACE_DLList_Node (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Containers.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Containers_T.h" - -#include /**/ "ace/post.h" - -#endif /* ACE_CONTAINERS_H */ - diff --git a/dep/include/ace/Containers.inl b/dep/include/ace/Containers.inl deleted file mode 100644 index 8094672a8f6..00000000000 --- a/dep/include/ace/Containers.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// -// $Id: Containers.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_DLList_Node::ACE_DLList_Node (void) - : item_ (0), - next_ (0), - prev_ (0) -{ -} - -ACE_INLINE -ACE_DLList_Node::ACE_DLList_Node (void *i, - ACE_DLList_Node *n, - ACE_DLList_Node *p) - : item_ (i), - next_ (n), - prev_ (p) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Containers_T.h b/dep/include/ace/Containers_T.h deleted file mode 100644 index d8ba71c64a6..00000000000 --- a/dep/include/ace/Containers_T.h +++ /dev/null @@ -1,2065 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Containers_T.h - * - * $Id: Containers_T.h 82588 2008-08-11 13:37:41Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_CONTAINERS_T_H -#define ACE_CONTAINERS_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Need by ACE_DLList_Node. -#include "ace/Containers.h" - -// Shared with "ace/Unbounded_Set.h" -#include "ace/Node.h" - -// Backwards compatibility, please include "ace/Array_Base.h" directly. -#include "ace/Array_Base.h" - -// Backwards compatibility, please include "ace/Unbounded_Set.h" directly. -#include "ace/Unbounded_Set.h" - -// Backwards compatibility, please include "ace/Unbounded_Queue.h" directly. -#include "ace/Unbounded_Queue.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Allocator; - -/** - * @class ACE_Bounded_Stack - * - * @brief Implement a generic LIFO abstract data type. - * - * This implementation of a Stack uses a bounded array - * that is allocated dynamically. The Stack interface - * provides the standard constant time push, pop, and top - * operations. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Dynamic array - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * N/A - * - Insert/replace speed - * N/A - * - Iterator still valid after change to container? - * N/A - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * - */ -template -class ACE_Bounded_Stack -{ -public: - // = Initialization, assignment, and termination methods. - - /// Initialize a new empty stack with the provided size.. - /** - * Initialize and allocate space for a new Bounded_Stack with the provided - * size. - */ - ACE_Bounded_Stack (size_t size); - - /// Initialize the stack to be a copy of the stack provided. - /** - * Initialize the stack to be an exact copy of the Bounded_Stack provided - * as a parameter. - */ - ACE_Bounded_Stack (const ACE_Bounded_Stack &s); - - /// Assignment operator - /** - * Perform a deep copy operation using the Bounded_Stack parameter. If the - * capacity of the lhs isn't sufficient for the rhs, then the underlying data - * structure will be reallocated to accomadate the larger number of elements. - */ - void operator= (const ACE_Bounded_Stack &s); - - /// Perform actions needed when stack goes out of scope. - /** - * Deallocate the memory used by the Bounded_Stack. - */ - ~ACE_Bounded_Stack (void); - - // = Classic Stack operations. - - ///Add an element to the top of the stack. - /** - * Place a new item on top of the stack. Returns -1 if the stack - * is already full, 0 if the stack is not already full, and -1 if - * failure occurs. - */ - int push (const T &new_item); - - ///Remove an item from the top of stack. - /** - * Remove and return the top stack item. Returns -1 if the stack is - * already empty, 0 if the stack is not already empty, and -1 if - * failure occurs. - */ - int pop (T &item); - - ///Examine the contents of the top of stack. - /** - * Return top stack item without removing it. Returns -1 if the - * stack is already empty, 0 if the stack is not already empty, and - * -1 if failure occurs. - */ - int top (T &item) const; - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Performs constant time check to determine if the stack is empty. - */ - int is_empty (void) const; - - /// Returns 1 if the container is full, otherwise returns 0. - /** - * Performs constant time check to determine if the stack is at capacity. - */ - int is_full (void) const; - - /// The number of items in the stack. - /** - * Return the number of items currently in the stack. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Size of the dynamically allocated data. - size_t size_; - - /// Keeps track of the current top of stack. - size_t top_; - - /// Holds the stack's contents. - T *stack_; -}; - -//---------------------------------------- - -/** - * @class ACE_Fixed_Stack - * - * @brief Implement a generic LIFO abstract data type. - * - * This implementation of a Stack uses a fixed array - * with the size fixed at instantiation time. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Fixed array - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * N/A - * - Insert/replace speed - * N/A - * - Iterator still valid after change to container? - * N/A - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * - */ -template -class ACE_Fixed_Stack -{ -public: - // = Initialization, assignment, and termination methods. - /// Initialize a new stack so that it is empty. - /** - * Initialize an empty stack. - */ - ACE_Fixed_Stack (void); - - /// The copy constructor (performs initialization). - /** - * Initialize the stack and copy the provided stack into the current stack. - */ - ACE_Fixed_Stack (const ACE_Fixed_Stack &s); - - /// Assignment operator (performs assignment). - /** - * Perform a deep copy of the provided stack. - */ - void operator= (const ACE_Fixed_Stack &s); - - /// Perform actions needed when stack goes out of scope. - /** - * Destroy the stack. - */ - ~ACE_Fixed_Stack (void); - - // = Classic Stack operations. - - ///Constant time placement of element on top of stack. - /** - * Place a new item on top of the stack. Returns -1 if the stack - * is already full, 0 if the stack is not already full, and -1 if - * failure occurs. - */ - int push (const T &new_item); - - ///Constant time removal of top of stack. - /** - * Remove and return the top stack item. Returns -1 if the stack is - * already empty, 0 if the stack is not already empty, and -1 if - * failure occurs. - */ - int pop (T &item); - - ///Constant time examination of top of stack. - /** - * Return top stack item without removing it. Returns -1 if the - * stack is already empty, 0 if the stack is not already empty, and - * -1 if failure occurs. - */ - int top (T &item) const; - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Performs constant time check to see if stack is empty. - */ - int is_empty (void) const; - - /// Returns 1 if the container is full, otherwise returns 0. - /** - * Performs constant time check to see if stack is full. - */ - int is_full (void) const; - - /// The number of items in the stack. - /** - * Constant time access to the current size of the stack. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Size of the allocated data. - size_t size_; - - /// Keeps track of the current top of stack. - size_t top_; - - /// Holds the stack's contents. - T stack_[ACE_SIZE]; -}; - -//---------------------------------------- - -template class ACE_Ordered_MultiSet; -template class ACE_Ordered_MultiSet_Iterator; - -/** - * @class ACE_DNode - * - * @brief Implementation element in a bilinked list. - */ -template -class ACE_DNode -{ - friend class ACE_Ordered_MultiSet; - friend class ACE_Ordered_MultiSet_Iterator; - -public: - - /// This isn't necessary, but it keeps some compilers happy. - ~ACE_DNode (void); - -private: - - // = Initialization methods - ACE_DNode (const T &i, ACE_DNode *n = 0, ACE_DNode *p = 0); - - /// Pointer to next element in the list of {ACE_DNode}s. - ACE_DNode *next_; - - /// Pointer to previous element in the list of {ACE_DNode}s. - ACE_DNode *prev_; - - /// Current value of the item in this node. - T item_; -}; - -/** - * @class ACE_Unbounded_Stack - * - * @brief Implement a generic LIFO abstract data type. - * - * This implementation of an unbounded Stack uses a linked list. - * If you use the {insert} or {remove} methods you should keep - * in mind that duplicate entries aren't allowed. In general, - * therefore, you should avoid the use of these methods since - * they aren't really part of the ADT stack. The stack is implemented - * as a doubly linked list. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Double linked list - * - Duplicates allowed? - * No - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * - */ -template -class ACE_Unbounded_Stack -{ -public: - friend class ACE_Unbounded_Stack_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Stack_Iterator ITERATOR; - - // = Initialization, assignment, and termination methods. - /// Initialize a new stack so that it is empty. Use user defined - /// allocation strategy if specified. - /** - * Initialize an empty stack using the user specified allocation strategy - * if provided. - */ - ACE_Unbounded_Stack (ACE_Allocator *the_allocator = 0); - - /// The copy constructor (performs initialization). - /** - * Initialize this stack to be an exact copy of {s}. - */ - ACE_Unbounded_Stack (const ACE_Unbounded_Stack &s); - - /// Assignment operator (performs assignment). - /** - * Perform a deep copy of the rhs into the lhs. - */ - void operator= (const ACE_Unbounded_Stack &s); - - /// Perform actions needed when stack goes out of scope. - /** - * Destroy the underlying list for the stack. - */ - ~ACE_Unbounded_Stack (void); - - // = Classic Stack operations. - - ///Push an element onto the top of stack. - /** - * Place a new item on top of the stack. Returns -1 if the stack - * is already full, 0 if the stack is not already full, and -1 if - * failure occurs. - */ - int push (const T &new_item); - - ///Pop the top element of the stack. - /** - * Remove and return the top stack item. Returns -1 if the stack is - * already empty, 0 if the stack is not already empty, and -1 if - * failure occurs. - */ - int pop (T &item); - - ///Examine the top of the stack. - /** - * Return top stack item without removing it. Returns -1 if the - * stack is already empty, 0 if the stack is not already empty, and - * -1 if failure occurs. - */ - int top (T &item) const; - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Constant time check to see if the stack is empty. - */ - int is_empty (void) const; - - /// Returns 1 if the container is full, otherwise returns 0. - /** - * Always resturns 0 since the stack is unbounded. - */ - int is_full (void) const; - - // = Auxiliary methods (not strictly part of the Stack ADT). - - ///Linear Insert of an item. - /** - * Insert {new_item} into the Stack at the head (but doesn't allow - * duplicates). Returns -1 if failures occur, 1 if item is already - * present (i.e., no duplicates are allowed), else 0. - */ - int insert (const T &new_item); - - /// Remove @a item from the Stack. Returns 0 if it removes the item, - /// -1 if it can't find the item, and -1 if a failure occurs. - /** - * Linear remove operation. - */ - int remove (const T &item); - - /// Finds if @a item occurs the set. Returns 0 if finds, else -1. - /** - * Linear find operation. - */ - int find (const T &item) const; - - /// The number of items in the stack. - /** - * Constant time access to the current stack size. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Delete all the nodes in the stack. - void delete_all_nodes (void); - - /// Copy all nodes from {s} to {this}. - void copy_all_nodes (const ACE_Unbounded_Stack &s); - - /// Head of the linked list of Nodes. - ACE_Node *head_; - - /// Current size of the stack. - size_t cur_size_; - - /// Allocation strategy of the stack. - ACE_Allocator *allocator_; -}; - -/** - * @class ACE_Unbounded_Stack_Iterator - * - * @brief Implement an iterator over an unbounded Stack. - */ -template -class ACE_Unbounded_Stack_Iterator -{ -public: - // = Initialization method. - /// Move to the first element in the {stack}. - ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack &stack); - - // = Iteration methods. - - /// Pass back the @a next_item that hasn't been seen in the Stack. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the Stack. Returns 0 when all the - /// items in the Stack have been seen, else 1. - int advance (void); - - /// Move to the first element in the Stack. Returns 0 if the - /// Stack is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the Stack we're iterating over. - ACE_Unbounded_Stack &stack_; -}; - -template -class ACE_Double_Linked_List; - -/** - * @class ACE_Double_Linked_List_Iterator_Base - * - * @brief Implements a common base class for iterators for a double - * linked list ADT - */ -template -class ACE_Double_Linked_List_Iterator_Base -{ -public: - // = Iteration methods. - - /// Passes back the {entry} under the iterator. Returns 0 if the - /// iteration has completed, otherwise 1 - int next (T *&) const; - - /** - * @deprecated Return the address of next (current) unvisited item in - * the list. 0 if there is no more element available. - */ - T *next (void) const; - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// STL-like iterator dereference operator: returns a reference - /// to the node underneath the iterator. - T & operator* (void) const ; - - /** - * Retasks the iterator to iterate over a new - * Double_Linked_List. This allows clients to reuse an iterator - * without incurring the constructor overhead. If you do use this, - * be aware that if there are more than one reference to this - * iterator, the other "clients" may be very bothered when their - * iterator changes. @@ Here be dragons. Comments? - */ - void reset (ACE_Double_Linked_List &); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Initialization methods. - - /// Constructor - ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List &); - - /// Copy constructor. - ACE_Double_Linked_List_Iterator_Base (const - ACE_Double_Linked_List_Iterator_Base - &iter); - - // = Iteration methods. - /** - * Move to the first element of the list. Returns 0 if the list is - * empty, else 1. - * @note the head of the ACE_DLList is actually a null entry, so the - * first element is actually the 2n'd entry - */ - int go_head (void); - - /// Move to the last element of the list. Returns 0 if the list is - /// empty, else 1. - int go_tail (void); - - /** - * Check if we reach the end of the list. Can also be used to get - * the *current* element in the list. Return the address of the - * current item if there are still elements left , 0 if we run out - * of element. - */ - T *not_done (void) const ; - - /// Advance to the next element in the list. Return the address of the - /// next element if there are more, 0 otherwise. - T *do_advance (void); - - /// Retreat to the previous element in the list. Return the address - /// of the previous element if there are more, 0 otherwise. - T *do_retreat (void); - - /// Dump the state of an object. - void dump_i (void) const; - - /// Remember where we are. - T *current_; - - const ACE_Double_Linked_List *dllist_; -}; - -/** - * @class ACE_Double_Linked_List_Iterator - * - * @brief Implements an iterator for a double linked list ADT - * - * Iterate thru the double-linked list. This class provides - * an interface that let users access the internal element - * addresses directly. Notice {class T} must declare - * ACE_Double_Linked_List<T>, - * ACE_Double_Linked_List_Iterator_Base <T> and - * ACE_Double_Linked_List_Iterator as friend classes and class T - * should also have data members T* next_ and T* prev_. - */ -template -class ACE_Double_Linked_List_Iterator : public ACE_Double_Linked_List_Iterator_Base -{ -public: - // = Initialization method. - ACE_Double_Linked_List_Iterator (const ACE_Double_Linked_List &); - - /** - * Retasks the iterator to iterate over a new - * Double_Linked_List. This allows clients to reuse an iterator - * without incurring the constructor overhead. If you do use this, - * be aware that if there are more than one reference to this - * iterator, the other "clients" may be very bothered when their - * iterator changes. - * @@ Here be dragons. Comments? - */ - void reset (ACE_Double_Linked_List &); - - /// Move to the first element in the list. Returns 0 if the - /// list is empty, else 1. - int first (void); - - /// Move forward by one element in the list. Returns 0 when all the - /// items in the list have been seen, else 1. - int advance (void); - - /** - * Advance the iterator while removing the original item from the - * list. Return a pointer points to the original (removed) item. - * If @a dont_remove equals false, this function behaves like {advance} - * but return 0 (NULL) instead. - */ - T* advance_and_remove (bool dont_remove); - - // = STL-style iteration methods - - /// Prefix advance. - ACE_Double_Linked_List_Iterator & operator++ (void); - - /// Postfix advance. - ACE_Double_Linked_List_Iterator operator++ (int); - - /// Prefix reverse. - ACE_Double_Linked_List_Iterator & operator-- (void); - - /// Postfix reverse. - ACE_Double_Linked_List_Iterator operator-- (int); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/** - * @class ACE_Double_Linked_List_Reverse_Iterator - * - * @brief Implements a reverse iterator for a double linked list ADT - * - * Iterate backwards over the double-linked list. This class - * provide an interface that let users access the internal - * element addresses directly, which seems to break the - * encapsulation. Notice {class T} must declare - * ACE_Double_Linked_List<T>, - * ACE_Double_Linked_List_Iterator_Base <T> and - * ACE_Double_Linked_List_Iterator as friend classes and class T - * should also have data members T* next_ and T* prev_. - */ -template -class ACE_Double_Linked_List_Reverse_Iterator : public ACE_Double_Linked_List_Iterator_Base -{ -public: - // = Initialization method. - ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &); - - /** - * Retasks the iterator to iterate over a new - * Double_Linked_List. This allows clients to reuse an iterator - * without incurring the constructor overhead. If you do use this, - * be aware that if there are more than one reference to this - * iterator, the other "clients" may be very bothered when their - * iterator changes. - * @@ Here be dragons. Comments? - */ - void reset (ACE_Double_Linked_List &); - - /// Move to the first element in the list. Returns 0 if the - /// list is empty, else 1. - int first (void); - - /// Move forward by one element in the list. Returns 0 when all the - /// items in the list have been seen, else 1. - int advance (void); - - /** - * Advance the iterator while removing the original item from the - * list. Return a pointer points to the original (removed) item. - * If @a dont_remove equals false, this function behaves like {advance} - * but return 0 (NULL) instead. - */ - T* advance_and_remove (bool dont_remove); - - // = STL-style iteration methods - - /// Prefix advance. - ACE_Double_Linked_List_Reverse_Iterator & operator++ (void); - - /// Postfix advance. - ACE_Double_Linked_List_Reverse_Iterator operator++ (int); - - /// Prefix reverse. - ACE_Double_Linked_List_Reverse_Iterator & operator-- (void); - - /// Postfix reverse. - ACE_Double_Linked_List_Reverse_Iterator operator-- (int); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/** - * @class ACE_Double_Linked_List - * - * @brief A double-linked list implementation. - * - * This implementation of an unbounded double-linked list uses a - * circular linked list with a dummy node. It is pretty much - * like the {ACE_Unbounded_Queue} except that it allows removing - * of a specific element from a specific location. - * Notice that this class is an implementation of a very simple - * data structure. This is *NOT* a container class. You can use the - * class to implement other contains classes but it is *NOT* a - * general purpose container class. - * The parameter class *MUST* have members T* prev and T* next - * and users of this class are responsible to follow the general - * rules of using double-linked lists to maintaining the list - * integrity. - * If you need a double linked container class, use the DLList - * class which is a container but delegates to the Double_Linked_List - * class. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Double Linked List - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * N/A - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * - */ -template -class ACE_Double_Linked_List -{ -public: - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List_Reverse_Iterator; - - // Trait definition. - typedef ACE_Double_Linked_List_Iterator ITERATOR; - typedef ACE_Double_Linked_List_Reverse_Iterator REVERSE_ITERATOR; - - // = Initialization and termination methods. - /// construction. Use user specified allocation strategy - /// if specified. - /** - * Initialize an empy list using the allocation strategy specified by the user. - * If none is specified, then use default allocation strategy. - */ - ACE_Double_Linked_List (ACE_Allocator *the_allocator = 0); - - /// Copy constructor. - /** - * Create a double linked list that is a copy of the provided - * parameter. - */ - ACE_Double_Linked_List (const ACE_Double_Linked_List &); - - /// Assignment operator. - /** - * Perform a deep copy of the provided list by first deleting the nodes of the - * lhs and then copying the nodes of the rhs. - */ - void operator= (const ACE_Double_Linked_List &); - - /// Destructor. - /** - * Clean up the memory allocated for the nodes of the list. - */ - ~ACE_Double_Linked_List (void); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, 0 otherwise. - /** - * Performs constant time check to determine if the list is empty. - */ - int is_empty (void) const; - - /// The list is unbounded, so this always returns 0. - /** - * Since the list is unbounded, the method simply returns 0. - */ - int is_full (void) const; - - // = Classic queue operations. - - /// Adds @a new_item to the tail of the list. Returns the new item - /// that was inserted. - /** - * Provides constant time insertion at the end of the list structure. - */ - T *insert_tail (T *new_item); - - /// Adds @a new_item to the head of the list.Returns the new item that - /// was inserted. - /** - * Provides constant time insertion at the head of the list. - */ - T *insert_head (T *new_item); - - /// Removes the head of the list and returns a pointer to that item. - /** - * Removes and returns the first {item} in the list. Returns - * internal node's address on success, 0 if the queue was empty. - * This method will *not* free the internal node. - */ - T* delete_head (void); - - /// Removes the tail of the list and returns a pointer to that item. - /** - * Removes and returns the last {item} in the list. Returns - * internal nodes's address on success, 0 if the queue was - * empty. This method will *not* free the internal node. - */ - T *delete_tail (void); - - // = Additional utility methods. - - ///Empty the list. - /** - * Reset the {ACE_Double_Linked_List} to be empty. - * Notice that since no one is interested in the items within, - * This operation will delete all items. - */ - void reset (void); - - /// Get the {slot}th element in the set. Returns -1 if the element - /// isn't in the range {0..{size} - 1}, else 0. - /** - * Iterates through the list to the desired index and assigns the provides pointer - * with the address of the node occupying that index. - */ - int get (T *&item, size_t slot = 0); - - /// The number of items in the queue. - /** - * Constant time call to return the current size of the list. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Use DNode address directly. - /** - * Constant time removal of an item from the list using it's address. - */ - int remove (T *n); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Delete all the nodes in the list. - /** - * Removes and deallocates memory for all of the list nodes. - */ - void delete_nodes (void); - - /// Copy nodes from {rhs} into this list. - /** - * Copy the elements of the provided list by allocated new nodes and assigning - * them with the proper data. - */ - void copy_nodes (const ACE_Double_Linked_List &rhs); - - /// Setup header pointer. Called after we create the head node in ctor. - /** - * Initialize the head pointer so that the list has a dummy node. - */ - void init_head (void); - - ///Constant time insert a new item into the list structure. - /** - * Insert a @a new_item into the list. It will be added before - * or after @a old_item. Default is to insert the new item *after* - * {head_}. Return 0 if succeed, -1 if error occured. - */ - int insert_element (T *new_item, - int before = 0, - T *old_item = 0); - - ///Constant time delete an item from the list structure. - /** - * Remove @a item from the list. Return 0 if succeed, -1 otherwise. - * Notice that this function checks if item is {head_} and either its - * {next_} or {prev_} is NULL. The function resets item's {next_} and - * {prev_} to 0 to prevent clobbering the double-linked list if a user - * tries to remove the same node again. - */ - int remove_element (T *item); - - /// Head of the circular double-linked list. - T *head_; - - /// Size of this list. - size_t size_; - - /// Allocation Strategy of the queue. - ACE_Allocator *allocator_; -}; - -template class ACE_DLList; -template class ACE_DLList_Iterator; -template class ACE_DLList_Reverse_Iterator; - -typedef ACE_Double_Linked_List ACE_DLList_Base; - -//typedef ACE_Double_Linked_List_Iterator -// ACE_DLList_Iterator_Base; -//typedef ACE_Double_Linked_List_Reverse_Iterator -// ACE_DLList_Reverse_Iterator_Base; -//@@ These two typedefs (inherited from James Hu's original design) -// have been removed because Sun CC 4.2 had problems with it. I guess -// having the DLList_Iterators inheriting from a class which is -// actually a typedef leads to problems. #define'ing rather than -// typedef'ing worked, but as per Carlos's reccomendation, I'm just -// replacing all references to the base classes with their actual -// type. Matt Braun (6/15/99) - -/** - * @class ACE_DLList - * - * @brief A double-linked list container class. - * - * ACE_DLList is a simple, unbounded container implemented using a - * double-linked list. It is critical to remember that ACE_DLList inherits - * from ACE_Double_Linked_List, wrapping each T pointer in a ACE_DLList_Node - * object which satisfies the next/prev pointer requirements imposed by - * ACE_Double_Linked_List. - * - * Each item inserted to an ACE_DLList is a pointer to a T object. The - * caller is responsible for lifetime of the T object. ACE_DLList takes no - * action on the T object; it is not copied on insertion and it is not - * deleted on removal from the ACE_DLList. - */ -template -class ACE_DLList : public ACE_DLList_Base -{ - friend class ACE_DLList_Node; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_DLList_Iterator; - friend class ACE_DLList_Reverse_Iterator; - -public: - - /// Delegates to ACE_Double_Linked_List. - void operator= (const ACE_DLList &l); - - /** - * @name Queue-like insert and delete methods - */ - //@{ - - /** - * Insert pointer for a new item at the tail of the list. - * - * @return Pointer to item inserted; 0 on error. - */ - T *insert_tail (T *new_item); - - /** - * Insert pointer for a new item at the head of the list. - * - * @return Pointer to item inserted; 0 on error. - */ - T *insert_head (T *new_item); - - /** - * Removes the item at the head of the list and returns its pointer. - * - * @return Pointer to previously inserted item; 0 if the list is empty, - * an error occurred, or the original pointer inserted was 0. - */ - T *delete_head (void); - - /** - * Removes the item at the tail of the list and returns its pointer. - * - * @return Pointer to previously inserted item; 0 if the list is empty, - * an error occurred, or the original pointer inserted was 0. - */ - T *delete_tail (void); - //@} - - /** - * Provide random access to any item in the list. - * - * @param item Receives a pointer to the T object pointer held at the - * specified position in the list. - * @param slot Position in the list to access. The first position is 0. - * - * @retval 0 Success; T pointer returned in item. - * @retval -1 Error, most likely slot is outside the range of the list. - */ - int get (T *&item, size_t slot = 0); - - /// Delegates to ACE_Double_Linked_List. - void dump (void) const; - - /// Delegates to ACE_Double_Linked_List. - int remove (ACE_DLList_Node *n); - - /** - * Constructor. - * - * @param the_allocator Allocator to use for allocating ACE_DLList_Node - * objects that wrap T objects for inclusion in the - * list. If 0, ACE_Allocator::instance() is used. - */ - ACE_DLList (ACE_Allocator *the_allocator = 0); - - /// Delegates to ACE_Double_Linked_List. - ACE_DLList (const ACE_DLList &l); - - /** - * Deletes all ACE_DLList_Node objects in the list starting from the head. - * No T objects referred to by the deleted ACE_DLList_Node objects are - * modified or freed. If you desire all of the T objects in the list to - * be deleted as well, code such as this should be used prior to destroying - * the ACE_DLList: - * @code - ACE_DLList list; - ... // insert dynamically allocated Items... - Item *p; - while ((p = list.delete_head()) != 0) - delete *p; - @endcode - */ - ~ACE_DLList (void); -}; - -/** - * @class ACE_DLList_Iterator - * - * @brief A double-linked list container class iterator. - * - * This implementation uses ACE_Double_Linked_List_Iterator to - * perform the logic behind this container class. It delegates - * all of its calls to ACE_Double_Linked_List_Iterator. - */ -template -class ACE_DLList_Iterator : public ACE_Double_Linked_List_Iterator -{ - - friend class ACE_DLList; - friend class ACE_DLList_Node; - -public: - - // = Initialization method. - ACE_DLList_Iterator (ACE_DLList &l); - - /** - * Retasks the iterator to iterate over a new - * Double_Linked_List. This allows clients to reuse an iterator - * without incurring the constructor overhead. If you do use this, - * be aware that if there are more than one reference to this - * iterator, the other "clients" may be very bothered when their - * iterator changes. - * @@ Here be dragons. Comments? - */ - void reset (ACE_DLList &l); - - // = Iteration methods. - /// Move forward by one element in the list. Returns 0 when all the - /// items in the list have been seen, else 1. - int advance (void); - - /// Pass back the {next_item} that hasn't been seen in the list. - /// Returns 0 when all items have been seen, else 1. - int next (T *&); - - /** - * @deprecated Delegates to ACE_Double_Linked_List_Iterator, except that - * whereas the Double_Linked_List version of next returns the node, this next - * returns the contents of the node - */ - T *next (void) const; - - /** - * Removes the current item (i.e., {next}) from the list. - * Note that DLList iterators do not support {advance_and_remove} - * directly (defined in its base class) and you will need to - * release the element returned by it. - */ - int remove (void); - - /// Delegates to ACE_Double_Linked_List_Iterator. - void dump (void) const; - -private: - ACE_DLList *list_; -}; - -/** - * @class ACE_DLList_Reverse_Iterator - * - * @brief A double-linked list container class iterator. - * - * This implementation uses ACE_Double_Linked_List_Iterator to - * perform the logic behind this container class. It delegates - * all of its calls to ACE_Double_Linked_List_Iterator. - */ -template -class ACE_DLList_Reverse_Iterator : public ACE_Double_Linked_List_Reverse_Iterator -{ - - friend class ACE_DLList; - friend class ACE_DLList_Node; - -public: - - // = Initialization method. - ACE_DLList_Reverse_Iterator (ACE_DLList &l); - - /** - * Retasks the iterator to iterate over a new - * Double_Linked_List. This allows clients to reuse an iterator - * without incurring the constructor overhead. If you do use this, - * be aware that if there are more than one reference to this - * iterator, the other "clients" may be very bothered when their - * iterator changes. - * @@ Here be dragons. Comments? - */ - void reset (ACE_DLList &l); - - // = Iteration methods. - /// Move forward by one element in the list. Returns 0 when all the - /// items in the list have been seen, else 1. - int advance (void); - - /// Pass back the {next_item} that hasn't been seen in the list. - /// Returns 0 when all items have been seen, else 1. - int next (T *&); - - /// @deprecated Delegates to ACE_Double_Linked_List_Iterator. - T *next (void) const; - - /// Removes the current item (i.e., {next}) from the list. - /// Note that DLList iterators do not support {advance_and_remove} - /// directly (defined in its base class) and you will need to - /// release the element returned by it. - int remove (void); - - /// Delegates to ACE_Double_Linked_List_Iterator. - void dump (void) const; - -private: - ACE_DLList *list_; -}; - -// Forward declaration. -template -class ACE_Fixed_Set; - -/** - * @class ACE_Fixed_Set_Iterator_Base - * - * @brief Implements a common base class for iterators for a unordered set. - */ -template -class ACE_Fixed_Set_Iterator_Base -{ -public: - // = Iteration methods. - - /// Pass back the {next_item} that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Initialization method. - ACE_Fixed_Set_Iterator_Base (ACE_Fixed_Set &s); - - /// Set we are iterating over. - ACE_Fixed_Set &s_; - - /// How far we've advanced over the set. - ssize_t next_; - - /// The number of non free items that the iterator had pointed at. - size_t iterated_items_; - - /// Dump the state of an object. - void dump_i (void) const; - - /// Pass back the {next_item} that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next_i (T *&next_item); -}; - -/** - * @class ACE_Fixed_Set_Iterator - * - * @brief Iterates through an unordered set. - * - * This implementation of an unordered set uses a fixed array. - * Allows deletions while iteration is occurring. - */ -template -class ACE_Fixed_Set_Iterator : public ACE_Fixed_Set_Iterator_Base -{ -public: - // = Initialization method. - ACE_Fixed_Set_Iterator (ACE_Fixed_Set &s); - - // = Iteration methods. - - /// Pass back the {next_item} that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Dump the state of an object. - void dump (void) const; - - /// Remove the item where the itearetor is located at. - /// Returns 1 if it removes a item, else 0. - /// Pass back the removed {item}. - int remove (T *&item); - - /// STL-like iterator dereference operator: returns a reference - /// to the node underneath the iterator. - T & operator* (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/** - * @class ACE_Fixed_Set_Const_Iterator - * - * @brief Iterates through a const unordered set. - * - * This implementation of an unordered set uses a fixed array. - */ -template -class ACE_Fixed_Set_Const_Iterator : public ACE_Fixed_Set_Iterator_Base -{ -public: - // = Initialization method. - ACE_Fixed_Set_Const_Iterator (const ACE_Fixed_Set &s); - - // = Iteration methods. - - /// Pass back the {next_item} that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (const T *&next_item); - - /// Dump the state of an object. - void dump (void) const; - - /// STL-like iterator dereference operator: returns a reference - /// to the node underneath the iterator. - const T & operator* (void) const ; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/** - * @class ACE_Fixed_Set - * - * @brief Implement a simple unordered set of {T} with maximum {ACE_SIZE}. - * - * This implementation of an unordered set uses a fixed array. - * It does not allow duplicate members. The set provides linear insertion/deletion - * operations. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Fixed array - * - Duplicates allowed? - * No - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== - * - */ -template -class ACE_Fixed_Set -{ -public: - friend class ACE_Fixed_Set_Iterator_Base; - friend class ACE_Fixed_Set_Iterator; - friend class ACE_Fixed_Set_Const_Iterator; - - // Trait definitions. - typedef ACE_Fixed_Set_Iterator ITERATOR; - typedef ACE_Fixed_Set_Const_Iterator CONST_ITERATOR; - - // = Initialization and termination methods. - /// Default Constructor. - /** - * Creates an empy set - */ - ACE_Fixed_Set (void); - - /// Copy constructor. - /** - * Initializes a set to be a copy of the set parameter. - */ - ACE_Fixed_Set (const ACE_Fixed_Set &); - - /// Assignment operator. - /** - * Deep copy of one set to another. - */ - void operator= (const ACE_Fixed_Set &); - - /// Destructor. - /** - * Destroys a set. - */ - ~ACE_Fixed_Set (void); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Performs constant time check to determine if a set is empty. - */ - int is_empty (void) const; - - /// Returns 1 if the container is full, otherwise returns 0. - /** - * Performs a constant time check to see if the set is full. - */ - int is_full (void) const; - - // = Classic unordered set operations. - - ///Linear time insertion of an item unique to the set. - /** - * Insert @a new_item into the set (doesn't allow duplicates). - * Returns -1 if failures occur, 1 if item is already present, else - * 0. - */ - int insert (const T &new_item); - - ///Linear time removal operation of an item. - /** - * Remove first occurrence of {item} from the set. Returns 0 if - * it removes the item, -1 if it can't find the item, and -1 if a - * failure occurs. Removal doesn't reclaim memory for the @a item. - */ - int remove (const T &item); - - /// Finds if @a item occurs in the set. Returns 0 if finds, else -1. - /** - * Performs a linear find operation for the specified @a item. - */ - int find (const T &item) const; - - /// Size of the set. - /** - * Returns the current size of the set. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Holds the contents of the set. - struct - { - /// Item in the set. - T item_; - - /// Keeps track of whether this item is in use or not. - int is_free_; - } search_structure_[ACE_SIZE]; - - /// Current size of the set. - size_t cur_size_; - - /// Maximum size of the set. - size_t max_size_; -}; - -// Forward declaration. -template -class ACE_Bounded_Set; - -/** - * @class ACE_Bounded_Set_Iterator - * - * @brief Iterates through an unordered set. - * - * This implementation of an unordered set uses a Bounded array. - * Allows deletions while iteration is occurring. - */ -template -class ACE_Bounded_Set_Iterator -{ -public: - // = Initialization method. - ACE_Bounded_Set_Iterator (ACE_Bounded_Set &s); - - // = Iteration methods. - - /// Pass back the {next_item} that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Set we are iterating over. - ACE_Bounded_Set &s_; - - /// How far we've advanced over the set. - ssize_t next_; -}; - -/** - * @class ACE_Bounded_Set - * - * @brief Implement a simple unordered set of {T} with maximum - * set at creation time. - * - * This implementation of an unordered set uses a Bounded array. - * This implementation does not allow duplicates. It provides - * linear insert/remove/find operations. Insertion/removal does not - * invalidate iterators, but caution should be taken to ensure - * expected behavior. Once initialized, the object has a maximum size - * which can only be increased by the assignment of another larger Bounded_Set. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Bounded array which can grow via assignment - * - Duplicates allowed? - * No - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== - * - */ -template -class ACE_Bounded_Set -{ -public: - friend class ACE_Bounded_Set_Iterator; - - // Trait definition. - typedef ACE_Bounded_Set_Iterator ITERATOR; - - enum - { - DEFAULT_SIZE = 10 - }; - - // = Initialization and termination methods. - /// Construct a Bounded_Set using the default size. - /** - * The default constructor initializes the Bounded_Set to a maximum size - * specified by the DEFAULT_SIZE. - */ - ACE_Bounded_Set (void); - - /// Construct a Bounded_Set with the provided sizeB. - /** - * Initialize the Bounded_Set to have a maximum size equal to the size - * parameter specified. - */ - ACE_Bounded_Set (size_t size); - - /// Construct a Bounded_Set that is a copy of the provides Bounded_Set. - /** - * Initialize the Bounded_Set to be a copy of the Bounded_Set parameter. - */ - ACE_Bounded_Set (const ACE_Bounded_Set &); - - /// Assignment operator. - /** - * The assignment will make a deep copy of the Bounded_Set provided. If the - * rhs has more elements than the capacity of the lhs, then the lhs will be - * deleted and reallocated to accomadate the larger number of elements. - */ - void operator= (const ACE_Bounded_Set &); - - /// Destructor - /** - * Clean up the underlying dynamically allocated memory that is used by - * the Bounded_Set. - */ - ~ACE_Bounded_Set (void); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * A constant time check is performed to determine if the Bounded_Set is - * empty. - */ - int is_empty (void) const; - - /// Returns 1 if the container is full, otherwise returns 0. - /** - * Performs a constant time check to determine if the Bounded_Set is at - * capacity. - */ - int is_full (void) const; - - // = Classic unordered set operations. - - ///Inserts a new element unique to the set. - /** - * Insert @a new_item into the set (doesn't allow duplicates) in linear - * time. - * Returns -1 if failures occur, 1 if item is already present, else - * 0. - */ - int insert (const T &new_item); - - ///Finds the specified element and removes it from the set. - /** - * Remove first occurrence of @a item from the set. Returns 0 if it - * removes the item, -1 if it can't find the item, and -1 if a - * failure occurs. The linear remove operation does not reclaim the - * memory associated with the removed item. - */ - int remove (const T &item); - - /// Finds if @a item occurs in the set. Returns 0 if finds, else -1. - /** - * find preforms a linear search for {item} and returns 0 on successful - * find and -1 otherwise. - */ - int find (const T &item) const; - - /// Size of the set. - /** - * Returns a size_t representing the current size of the set. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - struct Search_Structure - { - /// Item in the set. - T item_; - - /// Keeps track of whether this item is in use or not. - int is_free_; - }; - - /// Holds the contents of the set. - Search_Structure *search_structure_; - - /// Current size of the set. - size_t cur_size_; - - /// Maximum size of the set. - size_t max_size_; -}; - -/** - * @class ACE_Ordered_MultiSet_Iterator - * - * @brief Implement a bidirectional iterator over an ordered multiset. - * This class template requires that < operator semantics be - * defined for the parameterized type {T}, but does not impose - * any restriction on how that ordering operator is implemented. - */ -template -class ACE_Ordered_MultiSet_Iterator -{ -public: - friend class ACE_Ordered_MultiSet; - - // = Initialization method. - ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s); - - // = Iteration methods. - - /// Pass back the {next_item} that hasn't been seen in the ordered multiset. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item) const; - - /// Repositions the iterator at the first item in the ordered multiset - /// Returns 0 if the list is empty else 1. - int first (void); - - /// Repositions the iterator at the last item in the ordered multiset - /// Returns 0 if the list is empty else 1. - int last (void); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move backward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int retreat (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Returns a reference to the internal element {this} is pointing to. - T& operator* (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Pointer to the current node in the iteration. - ACE_DNode *current_; - - /// Pointer to the set we're iterating over. - ACE_Ordered_MultiSet &set_; -}; - -/** - * @class ACE_Ordered_MultiSet - * - * @brief Implement a simple ordered multiset of {T} of unbounded size - * that allows duplicates. This class template requires that < - * operator semantics be defined for the parameterized type {T}, but - * does not impose any restriction on how that ordering operator is - * implemented. The set is implemented as a linked list. - * - * - * Requirements and Performance Characteristics - * - Internal Structure - * Double linked list - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== - * -# operator< - * - * - */ -template -class ACE_Ordered_MultiSet -{ -public: - friend class ACE_Ordered_MultiSet_Iterator; - - // Trait definition. - typedef ACE_Ordered_MultiSet_Iterator ITERATOR; - - // = Initialization and termination methods. - /// Constructor. Use user specified allocation strategy - /// if specified. - /** - * Initialize the set using the allocation strategy specified. If none, use the - * default strategy. - */ - ACE_Ordered_MultiSet (ACE_Allocator *the_allocator = 0); - - /// Copy constructor. - /** - * Initialize the set to be a copy of the provided set. - */ - ACE_Ordered_MultiSet (const ACE_Ordered_MultiSet &); - - /// Destructor. - /** - * Delete the nodes of the set. - */ - ~ACE_Ordered_MultiSet (void); - - /// Assignment operator. - /** - * Delete the nodes in lhs, and copy the nodes from the rhs. - */ - void operator= (const ACE_Ordered_MultiSet &); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Constant time check to determine if the set is empty. - */ - int is_empty (void) const; - - /// Size of the set. - /** - * Constant time check to determine the size of the set. - */ - size_t size (void) const; - - // = Classic unordered set operations. - - /// Insert @a new_item into the ordered multiset. - /// Returns -1 if failures occur, else 0. - /** - * Linear time, order preserving insert into the set beginning at the head. - */ - int insert (const T &new_item); - - ///Linear time insert beginning at the point specified by the provided iterator. - /** - * Insert @a new_item into the ordered multiset, starting its search at - * the node pointed to by the iterator, and if insertion was successful, - * updates the iterator to point to the newly inserted node. - * Returns -1 if failures occur, else 0. - */ - int insert (const T &new_item, ITERATOR &iter); - - /// Remove first occurrence of @a item from the set. Returns 0 if - /// it removes the item, -1 if it can't find the item. - /** - * Linear time search operation which removes the item from the set if found . - */ - int remove (const T &item); - - ///Linear find operation. - /** - * Finds first occurrence of @a item in the multiset, using the iterator's - * current position as a hint to improve performance. If find succeeds, - * it positions the iterator at that node and returns 0, or if it cannot - * locate the node, it leaves the iterator alone and just returns -1. - */ - int find (const T &item, ITERATOR &iter) const; - - /// Reset the ACE_Ordered_MultiSet to be empty. - /** - * Delete the nodes inside the set. - */ - void reset (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /** - * Insert @a item, starting its search at the position given, - * and if successful updates the passed pointer to point to - * the newly inserted item's node. - */ - int insert_from (const T &item, ACE_DNode *start_position, - ACE_DNode **new_position); - - /** - * Looks for first occurance of @a item in the ordered set, using the - * passed starting position as a hint: if there is such an instance, it - * updates the new_position pointer to point to this node and returns 0; - * if there is no such node, then if there is a node before where the - * item would have been, it updates the new_position pointer to point - * to this node and returns -1; if there is no such node, then if there - * is a node after where the item would have been, it updates the - * new_position pointer to point to this node (or 0 if there is no such - * node) and returns 1; - */ - int locate (const T &item, ACE_DNode *start_position, - ACE_DNode *&new_position) const; - - /// Delete all the nodes in the Set. - void delete_nodes (void); - - /// Copy nodes into this set. - void copy_nodes (const ACE_Ordered_MultiSet &); - - /// Head of the bilinked list of Nodes. - ACE_DNode *head_; - - /// Head of the bilinked list of Nodes. - ACE_DNode *tail_; - - /// Current size of the set. - size_t cur_size_; - - /// Allocation strategy of the set. - ACE_Allocator *allocator_; -}; - -// **************************************************************** - -/** - * @class ACE_Array - * - * @brief A dynamic array class. - * - * This class extends ACE_Array_Base, adding comparison operators. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Dynamic array - * - Duplicates allowed? - * Yes - * - Random access allowed? - * Yes - * - Search speed - * N/A - * - Insert/replace speed - * O(1) - * - Iterator still valid after change to container? - * - In general, yes. - * - If array size is changed during iteration, no. - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator!= - * - * @sa ACE_Array_Base. This class inherits its operations and requirements. - */ -template -class ACE_Array : public ACE_Array_Base -{ -public: - // Define a "trait" - typedef T TYPE; - - typedef ACE_Array_Iterator ITERATOR; - - // = Exceptions. - - // = Initialization and termination methods. - - /// Dynamically create an uninitialized array. - /** - * Initialize an empty array of the specified size using the provided - * allocation strategy. - */ - ACE_Array (size_t size = 0, - ACE_Allocator* alloc = 0); - - /// Dynamically initialize the entire array to the {default_value}. - /** - * Initialize an array the given size placing the default_value in each index. - */ - ACE_Array (size_t size, - const T &default_value, - ACE_Allocator* alloc = 0); - - ///Copy constructor. - /** - * The copy constructor performs initialization by making an exact - * copy of the contents of parameter {s}, i.e., *this == s will - * return true. - */ - ACE_Array (const ACE_Array &s); - - ///Assignment operator - /** - * Assignment operator performs an assignment by making an exact - * copy of the contents of parameter {s}, i.e., *this == s will - * return true. Note that if the {max_size_} of {array_} is >= than - * {s.max_size_} we can copy it without reallocating. However, if - * {max_size_} is < {s.max_size_} we must delete the {array_}, - * reallocate a new {array_}, and then copy the contents of {s}. - */ - void operator= (const ACE_Array &s); - - // = Compare operators - - ///Equality comparison operator. - /** - * Compare this array with {s} for equality. Two arrays are equal - * if their {size}'s are equal and all the elements from 0 .. {size} - * are equal. - */ - bool operator== (const ACE_Array &s) const; - - ///Inequality comparison operator. - /** - * Compare this array with {s} for inequality such that {*this} != - * {s} is always the complement of the boolean return value of - * {*this} == {s}. - */ - bool operator!= (const ACE_Array &s) const; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Containers_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Containers_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Containers_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CONTAINERS_T_H */ - diff --git a/dep/include/ace/Containers_T.inl b/dep/include/ace/Containers_T.inl deleted file mode 100644 index b387061ac80..00000000000 --- a/dep/include/ace/Containers_T.inl +++ /dev/null @@ -1,473 +0,0 @@ -// -*- C++ -*- -// -// $Id: Containers_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Bounded_Stack::is_empty (void) const -{ - ACE_TRACE ("ACE_Bounded_Stack::is_empty"); - return this->top_ == 0; -} - -template ACE_INLINE int -ACE_Bounded_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Bounded_Stack::is_full"); - return this->top_ >= this->size_; -} - -template ACE_INLINE int -ACE_Bounded_Stack::push (const T &new_item) -{ - ACE_TRACE ("ACE_Bounded_Stack::push"); - if (this->is_full () == 0) - { - this->stack_[this->top_++] = new_item; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Bounded_Stack::pop (T &item) -{ - ACE_TRACE ("ACE_Bounded_Stack::pop"); - if (this->is_empty () == 0) - { - item = this->stack_[--this->top_]; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Bounded_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Bounded_Stack::top"); - if (this->is_empty () == 0) - { - item = this->stack_[this->top_ - 1]; - return 0; - } - else - return -1; -} - -template ACE_INLINE size_t -ACE_Bounded_Stack::size (void) const -{ - return this->size_; -} - -//---------------------------------------- - -template ACE_INLINE int -ACE_Fixed_Stack::is_empty (void) const -{ - ACE_TRACE ("ACE_Fixed_Stack::is_empty"); - return this->top_ == 0; -} - -template ACE_INLINE int -ACE_Fixed_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Fixed_Stack::is_full"); - return this->top_ >= this->size_; -} - -template ACE_INLINE int -ACE_Fixed_Stack::push (const T &new_item) -{ - ACE_TRACE ("ACE_Fixed_Stack::push"); - if (this->is_full () == 0) - { - this->stack_[this->top_++] = new_item; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Fixed_Stack::pop (T &item) -{ - ACE_TRACE ("ACE_Fixed_Stack::pop"); - if (this->is_empty () == 0) - { - item = this->stack_[--this->top_]; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Fixed_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Fixed_Stack::top"); - if (this->is_empty () == 0) - { - item = this->stack_[this->top_ - 1]; - return 0; - } - else - return -1; -} - -template ACE_INLINE size_t -ACE_Fixed_Stack::size (void) const -{ - return this->size_; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::is_empty (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Unbounded_Stack::top"); - if (this->is_empty () == 0) - { - item = this->head_->next_->item_; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Unbounded_Stack::is_full"); - return 0; // ??? -} - -template ACE_INLINE size_t -ACE_Unbounded_Stack::size (void) const -{ - return this->cur_size_; -} - -// --- - -// --- - -template ACE_INLINE int -ACE_Fixed_Set::is_empty (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::is_empty"); - return this->cur_size_ == 0; -} - -template ACE_INLINE int -ACE_Fixed_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::is_full"); - return this->cur_size_ == this->max_size_; -} - -// --- - -template ACE_INLINE int -ACE_Bounded_Set::is_empty (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::is_empty"); - return this->cur_size_ == 0; -} - -template ACE_INLINE int -ACE_Bounded_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::is_full"); - return this->cur_size_ == this->max_size_; -} - -// -- - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::first (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::first"); - current_ = set_.head_; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::last (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::last"); - current_ = set_.tail_; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::advance"); - - current_ = current_ ? current_->next_ : 0; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::retreat (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::retreat"); - - current_ = current_ ? current_->prev_ : 0; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::done"); - - return (current_ ? 0 : 1); -} - -template ACE_INLINE void -ACE_Ordered_MultiSet_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -// -- - -template ACE_INLINE int -ACE_Ordered_MultiSet::is_empty (void) const -{ - ACE_TRACE ("ACE_Ordered_MultiSet::is_empty"); - return this->cur_size_ > 0 ? 0 : 1; -} - -template ACE_INLINE size_t -ACE_Ordered_MultiSet::size (void) const -{ -// ACE_TRACE ("ACE_Ordered_MultiSet::size"); - return this->cur_size_; -} - -// **************************************************************** - -template ACE_INLINE -ACE_Array::ACE_Array (size_t size, - ACE_Allocator *alloc) - : ACE_Array_Base (size, alloc) -{ -} - -template ACE_INLINE -ACE_Array::ACE_Array (size_t size, - const T &default_value, - ACE_Allocator *alloc) - : ACE_Array_Base (size, default_value, alloc) -{ -} - -// The copy constructor (performs initialization). - -template ACE_INLINE -ACE_Array::ACE_Array (const ACE_Array &s) - : ACE_Array_Base (s) -{ -} - -// Assignment operator (performs assignment). - -template ACE_INLINE void -ACE_Array::operator= (const ACE_Array &s) -{ - // Check for "self-assignment". - - if (this != &s) - this->ACE_Array_Base::operator= (s); -} - -// Compare this array with for inequality. - -template ACE_INLINE bool -ACE_Array::operator!= (const ACE_Array &s) const -{ - return !(*this == s); -} - -// **************************************************************** - -// **************************************************************** - -template ACE_INLINE void -ACE_DLList::operator= (const ACE_DLList &l) -{ - *(ACE_DLList_Base *) this = l; -} - -template ACE_INLINE int -ACE_DLList::get (T *&item, size_t index) -{ - ACE_DLList_Node *node; - int result = ACE_DLList_Base::get (node, index); - if (result != -1) - item = (T *) node->item_; - return result; -} - -template ACE_INLINE void -ACE_DLList::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DLList_Base::dump (); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE int -ACE_DLList::remove (ACE_DLList_Node *n) -{ - int result = ACE_DLList_Base::remove (n); - ACE_DES_FREE (n, - this->allocator_->free, - ACE_DLList_Node); - return result; -} - -template ACE_INLINE -ACE_DLList::ACE_DLList (ACE_Allocator *alloc) - : ACE_DLList_Base (alloc) -{ -} - -template ACE_INLINE -ACE_DLList::ACE_DLList (const ACE_DLList &l) - : ACE_DLList_Base ((ACE_DLList &) l) -{ -} - -template ACE_INLINE -ACE_DLList::~ACE_DLList (void) -{ - while (this->delete_head ()) ; -} - -template ACE_INLINE int -ACE_DLList_Iterator::remove (void) -{ - ACE_DLList_Node *temp = this->ACE_Double_Linked_List_Iterator ::next (); - this->ACE_Double_Linked_List_Iterator ::advance (); - return list_->remove (temp); -} - -template ACE_INLINE -ACE_DLList_Iterator::ACE_DLList_Iterator (ACE_DLList &l) - : ACE_Double_Linked_List_Iterator ((ACE_DLList_Base &)l), - list_ (&l) -{ -} - -template ACE_INLINE void -ACE_DLList_Iterator::reset (ACE_DLList &l) -{ - list_ = &l; - this->ACE_Double_Linked_List_Iterator ::reset ((ACE_DLList_Base &)l); -} - -template ACE_INLINE int -ACE_DLList_Iterator::next (T *&ptr) -{ - ACE_DLList_Node *temp = - ACE_Double_Linked_List_Iterator ::next (); - if (temp) - ptr = (T *) temp->item_; - return temp ? 1 : 0; -} - -template ACE_INLINE T * -ACE_DLList_Iterator::next (void) const -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Iterator ::next (); - return (T *) (temp ? temp->item_ : 0); -} - -template ACE_INLINE int -ACE_DLList_Iterator::advance (void) -{ - return this->ACE_Double_Linked_List_Iterator ::advance (); -} - -template ACE_INLINE void -ACE_DLList_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_Double_Linked_List_Iterator ::dump (); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::remove (void) -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator ::next (); - this->ACE_Double_Linked_List_Reverse_Iterator ::advance (); - return list_->remove (temp); -} - -template ACE_INLINE -ACE_DLList_Reverse_Iterator::ACE_DLList_Reverse_Iterator (ACE_DLList &l) - : ACE_Double_Linked_List_Reverse_Iterator ((ACE_DLList_Base &)l), - list_ (&l) -{ -} - -template ACE_INLINE void -ACE_DLList_Reverse_Iterator::reset (ACE_DLList &l) -{ - list_ = &l; - this->ACE_Double_Linked_List_Reverse_Iterator ::reset ((ACE_DLList_Base &)l); -} - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::advance (void) -{ - return ACE_Double_Linked_List_Reverse_Iterator ::advance (); -} - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::next (T *&ptr) -{ - ACE_DLList_Node *temp = - ACE_Double_Linked_List_Reverse_Iterator ::next (); - if (temp == 0) - return 0; - ptr = (T *) temp->item_; - return 1; -} - -template ACE_INLINE T * -ACE_DLList_Reverse_Iterator::next (void) const -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator ::next (); - return (T *) (temp ? temp->item_ : 0); -} - -template ACE_INLINE void -ACE_DLList_Reverse_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_Double_Linked_List_Reverse_Iterator ::dump (); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Copy_Disabled.h b/dep/include/ace/Copy_Disabled.h deleted file mode 100644 index 4dd6c2216b5..00000000000 --- a/dep/include/ace/Copy_Disabled.h +++ /dev/null @@ -1,66 +0,0 @@ -// -*- C++ -*- - -//=========================================================================== -/** - * @file Copy_Disabled.h - * - * $Id: Copy_Disabled.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//=========================================================================== - -#ifndef ACE_COPY_DISABLED_H -#define ACE_COPY_DISABLED_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Copy_Disabled - * - * @brief Helper class to disable copy construction and assignment - * - * Classes used to control OS and other resources are not "canonical", - * i.e. they have their copy constructor and assignment operators - * disabled. - * This is often done by making the copy constructor and assignment - * operators private, effectively disallowing copying by clients of - * the class (including derived classes). If the copy constructor and - * assingment operators are left unimplemented then the class itself - * cannot make any copies of its instances, because it would result in - * link errors. - * - * To use this class simply use private inheritance: - * - * class Foo : private ACE_Copy_Disabled - * { - * // code here - * }; - * - */ -class ACE_Export ACE_Copy_Disabled -{ -public: - - /// Default constructor - ACE_Copy_Disabled (void); - -private: - ACE_Copy_Disabled (const ACE_Copy_Disabled &); - ACE_Copy_Disabled &operator= (const ACE_Copy_Disabled &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_COPY_DISABLED_H */ - diff --git a/dep/include/ace/Countdown_Time.h b/dep/include/ace/Countdown_Time.h deleted file mode 100644 index cc76bed02f4..00000000000 --- a/dep/include/ace/Countdown_Time.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Countdown_Time.h - * - * $Id: Countdown_Time.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_COUNTDOWN_TIME_H -#define ACE_COUNTDOWN_TIME_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Time_Value.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Countdown_Time - * - * @brief Keeps track of the amount of elapsed time. - * - * This class has a side-effect on the @c max_wait_time -- every - * time the stop() method is called the @c max_wait_time is - * updated. - */ -class ACE_Export ACE_Countdown_Time -{ -public: - /// Cache the @a max_wait_time and call @c start(). - ACE_Countdown_Time (ACE_Time_Value *max_wait_time); - - /// Destructor, makes sure the max_wait_time that got passed as pointer - /// to the constructor is updated with the time elapsed. - ~ACE_Countdown_Time (void); - - /// Cache the current time and enter a start state. - void start (void); - - /// Subtract the elapsed time from max_wait_time_ and enter a stopped - /// state. - void stop (void); - - /// Calls stop and then start. max_wait_time_ is modified by the - /// call to stop. - void update (void); - - /// Returns true if we've already been stopped, else false. - bool stopped (void) const; - -private: - /// Maximum time we were willing to wait. - ACE_Time_Value *max_wait_time_; - - /// Beginning of the start time. - ACE_Time_Value start_time_; - - /// Keeps track of whether we've already been stopped. - bool stopped_; - - // Prevent copying - ACE_Countdown_Time (const ACE_Countdown_Time &); - ACE_Countdown_Time &operator= (const ACE_Countdown_Time &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_COUNTDOWN_TIME_H */ - diff --git a/dep/include/ace/DEV.h b/dep/include/ace/DEV.h deleted file mode 100644 index 21b4783ca4a..00000000000 --- a/dep/include/ace/DEV.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file DEV.h - * - * $Id: DEV.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer - */ -//============================================================================= - -#ifndef ACE_DEV_H -#define ACE_DEV_H -#include /**/ "ace/pre.h" - -#include "ace/IO_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/DEV_Addr.h" - -// The following is necessary since many C++ compilers don't support -// typedef'd types inside of classes used as formal template -// arguments... ;-(. Luckily, using the C++ preprocessor I can hide -// most of this nastiness! - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) -#define ACE_DEV_CONNECTOR ACE_DEV_Connector -#define ACE_DEV_STREAM ACE_DEV_IO -#else /* TEMPLATES are broken (must be a cfront-based compiler...) */ -#define ACE_DEV_CONNECTOR ACE_DEV_Connector, ACE_DEV_Addr -#define ACE_DEV_STREAM ACE_DEV_IO, ACE_DEV_Addr -#endif /* ACE_TEMPLATE_TYPEDEFS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_DEV - * - * @brief Defines the member functions for the base class of the - * ACE_DEV abstraction. - */ -class ACE_Export ACE_DEV : public ACE_IO_SAP -{ -public: - /// Close down the DEVICE - int close (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /** - * Disable signal @a signum - * This is here to prevent Win32 from - * disabling SPIPE using socket calls - */ - int disable (int signum) const ; - -protected: - /// Ensure that this class is an abstract base class - ACE_DEV (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/DEV.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DEV_H */ - diff --git a/dep/include/ace/DEV.inl b/dep/include/ace/DEV.inl deleted file mode 100644 index 4d97a73d8e8..00000000000 --- a/dep/include/ace/DEV.inl +++ /dev/null @@ -1,18 +0,0 @@ -// -*- C++ -*- -// -// $Id: DEV.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_DEV::disable (int signum) const -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (signum) ; - return 0 ; -#else /* ACE_WIN32 */ - return ACE_IO_SAP::disable (signum) ; -#endif /* ACE_WIN32 */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/DEV_Addr.h b/dep/include/ace/DEV_Addr.h deleted file mode 100644 index f658cb0207d..00000000000 --- a/dep/include/ace/DEV_Addr.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file DEV_Addr.h - * - * $Id: DEV_Addr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer and Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_DEV_ADDR_H -#define ACE_DEV_ADDR_H - -#include /**/ "ace/pre.h" - -#include "ace/Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_dirent.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_DEV_Addr - * - * @brief Defines device address family address format. - */ -class ACE_Export ACE_DEV_Addr : public ACE_Addr -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_DEV_Addr (void); - - /// Copy constructor. - ACE_DEV_Addr (const ACE_DEV_Addr &sa); - - /// Acts like a copy constructor. - int set (const ACE_DEV_Addr &sa); - - /// Create a ACE_DEV_Addr from a device name. - explicit ACE_DEV_Addr (const ACE_TCHAR *devname); - - /// Create a ACE_Addr from a ACE_DEV pathname. - void set (const ACE_TCHAR *devname); - - /// Assignment operator. - ACE_DEV_Addr &operator= (const ACE_DEV_Addr &); - - /// Return a pointer to the address. - virtual void *get_addr (void) const; - - /// Transform the current address into string format. - virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; - - /// Compare two addresses for equality. - bool operator == (const ACE_DEV_Addr &SAP) const; - - /// Compare two addresses for inequality. - bool operator != (const ACE_DEV_Addr &SAP) const; - - /// Return the path name used for the rendezvous point. - const ACE_TCHAR *get_path_name (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - enum { DEVNAME_LENGTH = MAXPATHLEN + 1 }; - /// Name of the device. - ACE_TCHAR devname_[DEVNAME_LENGTH]; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/DEV_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_DEV_ADDR_H */ - diff --git a/dep/include/ace/DEV_Addr.inl b/dep/include/ace/DEV_Addr.inl deleted file mode 100644 index 5c1da68d7e7..00000000000 --- a/dep/include/ace/DEV_Addr.inl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id: DEV_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_string.h" -#include "ace/Global_Macros.h" -#include "ace/os_include/sys/os_socket.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_DEV_Addr::set (const ACE_TCHAR *devname) -{ - ACE_TRACE ("ACE_DEV_Addr::set"); - - this->ACE_Addr::base_set - (AF_DEV, static_cast (ACE_OS::strlen (devname))); - ACE_OS::strsncpy (this->devname_, devname, ACE_DEV_Addr::DEVNAME_LENGTH); -} - -// Compare two addresses for equality. - -ACE_INLINE bool -ACE_DEV_Addr::operator == (const ACE_DEV_Addr &sap) const -{ - ACE_TRACE ("ACE_DEV_Addr::operator =="); - - return ACE_OS::strcmp (this->devname_, sap.devname_) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE bool -ACE_DEV_Addr::operator != (const ACE_DEV_Addr &sap) const -{ - ACE_TRACE ("ACE_DEV_Addr::operator !="); - - return !((*this) == sap); // This is lazy, of course... ;-). -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const ACE_TCHAR * -ACE_DEV_Addr::get_path_name (void) const -{ - ACE_TRACE ("ACE_DEV_Addr::get_path_name"); - - return this->devname_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/DEV_Connector.h b/dep/include/ace/DEV_Connector.h deleted file mode 100644 index 9a949ed92d7..00000000000 --- a/dep/include/ace/DEV_Connector.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file DEV_Connector.h - * - * $Id: DEV_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer and Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_DEV_CONNECTOR_H -#define ACE_DEV_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include "ace/DEV_IO.h" -#include "ace/Log_Msg.h" -#include "ace/os_include/os_fcntl.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_DEV_Connector - * - * @brief Defines an active connection factory for the ACE_DEV wrappers. - */ -class ACE_Export ACE_DEV_Connector -{ -public: - /// Default constructor. - ACE_DEV_Connector (void); - - /** - * Actively connect and produce a @a new_io if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - * The @a flags and @a perms arguments are passed down to the - * method. - */ - ACE_DEV_Connector (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /** - * Actively connect and produce a @a new_io if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - * The @a flags and @a perms arguments are passed down to the - * method. - */ - int connect (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Meta-type info - typedef ACE_DEV_Addr PEER_ADDR; - typedef ACE_DEV_IO PEER_STREAM; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/DEV_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DEV_CONNECTOR_H */ - diff --git a/dep/include/ace/DEV_Connector.inl b/dep/include/ace/DEV_Connector.inl deleted file mode 100644 index 924a4254791..00000000000 --- a/dep/include/ace/DEV_Connector.inl +++ /dev/null @@ -1,34 +0,0 @@ -// -*- C++ -*- -// -// $Id: DEV_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Creates a Local ACE_DEV. - -ACE_INLINE -ACE_DEV_Connector::ACE_DEV_Connector (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_DEV_Connector::ACE_DEV_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, - reuse_addr, flags, perms) == ACE_IO_SAP::INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("address %s, %p\n"), - remote_sap.get_path_name (), ACE_TEXT ("ACE_DEV_IO"))); -} - -ACE_INLINE int -ACE_DEV_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/DEV_IO.h b/dep/include/ace/DEV_IO.h deleted file mode 100644 index e19cfd35603..00000000000 --- a/dep/include/ace/DEV_IO.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file DEV_IO.h - * - * $Id: DEV_IO.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_DEV_IO_H -#define ACE_DEV_IO_H -#include /**/ "ace/pre.h" - -#include "ace/DEV.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - -#include "ace/os_include/os_stdio.h" -#include "ace/os_include/sys/os_uio.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_DEV_IO - * - * @brief Read/Write operations on Devices. - */ -class ACE_Export ACE_DEV_IO : public ACE_DEV -{ -public: - friend class ACE_DEV_Connector; - - /// Default constructor. - ACE_DEV_IO (void); - - // = Various send operations. - /// send upto @a n bytes in @a buf. - ssize_t send (const void *buf, size_t n) const; - - /// Recv upto @a n bytes in @a buf. - ssize_t recv (void *buf, size_t n) const; - - /// Send n bytes, keep trying until n are sent. - ssize_t send_n (const void *buf, - size_t n) const; - - /** - * @name I/O operations - * - * Notes on common parameters: - * - * @a buf is the buffer to write from or receive into. - * - * @a len is the number of bytes to transfer. - * - * The @a timeout parameter in the following methods indicates how - * long to blocking trying to transfer data. If @a timeout == 0, - * then the call behaves as a normal send/recv call, i.e., for - * blocking sockets, the call will block until action is possible; - * for non-blocking sockets, EWOULDBLOCK will be returned if no - * action is immediately possible. - * - * If @a timeout != 0, the call will wait until the relative time - * specified in *@a timeout elapses. - * - * The "_n()" I/O methods keep looping until all the data has been - * transferred. These methods also work for sockets in non-blocking - * mode i.e., they keep looping on EWOULDBLOCK. @a timeout is used - * to make sure we keep making progress, i.e., the same timeout - * value is used for every I/O operation in the loop and the timeout - * is not counted down. - * - * The return values for the "*_n()" methods match the return values - * from the non "_n()" methods and are specified as follows: - * - * - On complete transfer, the number of bytes transferred is returned. - * - On timeout, -1 is returned, errno == ETIME. - * - On error, -1 is returned, errno is set to appropriate error. - * - On EOF, 0 is returned, errno is irrelevant. - * - * On partial transfers, i.e., if any data is transferred before - * timeout/error/EOF, @a bytes_transferred will contain the number of - * bytes transferred. - */ - ssize_t recv_n (void *buf, - size_t n, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0) const; - -#if defined (ACE_HAS_STREAM_PIPES) - /// Recv bytes via STREAM pipes using "band" mode. - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *band, - int *flags) const; - - /// Send bytes via STREAM pipes using "band" mode. - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int band, - int flags) const; - - /// Recv @a cntl and @a data via STREAM pipes. - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *flags) const; - - /// Send @a cntl and @a data via STREAM pipes. - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int flags = 0) const; -#endif /* ACE_HAS_STREAM_PIPES */ - - /// Send iovecs via <::writev>. - ssize_t send (const iovec iov[], size_t n) const; - - /// Recv iovecs via <::readv>. - ssize_t recv (iovec iov[], size_t n) const; - - /** - * Send N char *ptrs and int lengths. Note that the char *'s - * precede the ints (basically, an varargs version of writev). The - * count N is the *total* number of trailing arguments, *not* a - * couple of the number of tuple pairs! - */ - ssize_t send (size_t n, ...) const; - - /** - * This is an interface to ::readv, that doesn't use the struct - * iovec explicitly. The ... can be passed as an arbitrary number - * of (char *ptr, int len) tuples. However, the count N is the - * *total* number of trailing arguments, *not* a couple of the - * number of tuple pairs! - */ - ssize_t recv (size_t n, ...) const; - - /// Send @a n bytes via Win32 WriteFile using overlapped I/O. - ssize_t send (const void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - - /// Recv @a n bytes via Win32 ReadFile using overlapped I/O. - ssize_t recv (void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - - /// Dump the state of an object. - void dump (void) const; - - // = The following two methods are no-ops to keep the - // ACE_Connector happy. - /// Return the local endpoint address. - int get_local_addr (ACE_DEV_Addr &) const; - - /// Return the address of the remotely connected peer (if there is - /// one). - int get_remote_addr (ACE_DEV_Addr &) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Meta-type info - typedef ACE_DEV_Addr PEER_ADDR; - -private: - /// Address of device we are connected to. - ACE_DEV_Addr addr_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/DEV_IO.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DEV_IO_H */ - diff --git a/dep/include/ace/DEV_IO.inl b/dep/include/ace/DEV_IO.inl deleted file mode 100644 index 796d24e114a..00000000000 --- a/dep/include/ace/DEV_IO.inl +++ /dev/null @@ -1,126 +0,0 @@ -// -*- C++ -*- -// -// $Id: DEV_IO.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_sys_uio.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_Memory.h" - -#include "ace/ACE.h" - -// Send exactly N bytes from BUF to this device. Keeping trying until -// this many bytes are sent. - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_DEV_IO::send_n (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send_n"); - return ACE::write_n (this->get_handle (), buf, n); -} - -// Receive exactly N bytes from this file into BUF. Keep trying until -// this many bytes are received. - -ACE_INLINE ssize_t -ACE_DEV_IO::recv_n (void *buf, - size_t n, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) const -{ - ACE_TRACE ("ACE_DEV_IO::recv_n"); -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (timeout); - - return ACE::read_n (this->get_handle (), - buf, - n, - bytes_transferred); -#else - return ACE::recv_n (this->get_handle (), - buf, - n, - timeout, - bytes_transferred); -#endif /*ACE_WIN32*/ -} - -ACE_INLINE ssize_t -ACE_DEV_IO::send (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, n); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::recv (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::send (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::writev (this->get_handle (), iov, static_cast (n)); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::recv (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::readv (this->get_handle (), iov, static_cast (n)); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::send (const void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::write (this->get_handle (), - (const char *) buf, n, - overlapped); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::recv (void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n, - overlapped); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ACE_INLINE ssize_t -ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ACE_INLINE ssize_t -ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/DLL.h b/dep/include/ace/DLL.h deleted file mode 100644 index afd309d02c4..00000000000 --- a/dep/include/ace/DLL.h +++ /dev/null @@ -1,195 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file DLL.h - * - * $Id: DLL.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - */ -//============================================================================= - -#ifndef ACE_DLL_H -#define ACE_DLL_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/os_include/os_dlfcn.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_DLL_Handle; - -/** - * @class ACE_DLL - * - * @brief Provides an abstract interface for handling various DLL - * operations. - * - * This class is a wrapper over the various methods for utilizing - * a dynamically linked library (DLL), which is called a shared - * library on some platforms. Operations @c open(), @c close(), and - * @c symbol() have been implemented to help opening/closing and - * extracting symbol information from a DLL, respectively. - */ -class ACE_Export ACE_DLL -{ -public: - // = Initialization and termination methods. - - /** - * Default constructor. By default, the close() operation on the - * object will be invoked before it is destroyed. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). - */ - explicit ACE_DLL (bool close_handle_on_destruction = true); - - /// Allow assignment - ACE_DLL& operator= (const ACE_DLL &rhs); - - /** - * This constructor performs the actions of open() during construction. - * @param dll_name The name or path of the DLL to load. - * @param open_mode Flags to alter the actions taken when loading the DLL. - * The possible values are: - * @li @c RTLD_LAZY (this the default): loads identifier symbols but - * not the symbols for functions, which are loaded dynamically - * on-demand. - * @li @c RTLD_NOW: performs all necessary relocations when - * @a dll_name is first loaded - * @li RTLD_GLOBAL: makes symbols available for relocation - * processing of any other DLLs. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). - */ - explicit ACE_DLL (const ACE_TCHAR *dll_name, - int open_mode = ACE_DEFAULT_SHLIB_MODE, - bool close_handle_on_destruction = true); - - /// Copy constructor. - ACE_DLL (const ACE_DLL &); - - /** - * This method opens and dynamically links a specified DLL. - * @param dll_name The filename or path of the DLL to load. - * If a filename is given to @c open(), the @c ACE::ldfind() is used - * to locate DLLs via the following algorithms: (1) DLL filename - * expansion: @c ACE::ldfind() determines the name of the DLL by - * adding the appropriate prefix and suffix, e.g., it adds the @c lib - * prefix and @c .so suffix for Solaris and the @c .dll suffix for - * Windows and (2) DLL search path: @c ACE::ldfind() will also search - * for the designated DLL using the platform's DLL search path - * environment variable, e.g., it searches for DLLs using @c - * LD_LIBRARY_PATH on many UNIX systems and @c PATH on Windows. - * @param open_mode Flags to alter the actions taken when loading the DLL. - * The possible values are: - * @li @c RTLD_LAZY (this the default): loads identifier symbols but - * not the symbols for functions, which are loaded dynamically - * on-demand. - * @li @c RTLD_NOW: performs all necessary relocations when - * @a dll_name is first loaded - * @li RTLD_GLOBAL: makes symbols available for relocation - * processing of any other DLLs. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). - * @retval -1 On failure - * @retval 0 On success. - */ - int open (const ACE_TCHAR *dll_name, - int open_mode = ACE_DEFAULT_SHLIB_MODE, - bool close_handle_on_destruction = true); - - /// Call to close the DLL object. - int close (void); - - /** - * Called when the DLL object is destroyed -- invokes close() if the - * @a close_handle_on_destruction flag was set to non-zero in the - * constructor or open() method. - */ - ~ACE_DLL (void); - - /** - * Look up a named symbol in the DLL. DLL must be successfully opened - * before calling symbol(). - * @param symbol_name The symbol name to look up. - * @param ignore_errors If set to 1, allows you to probe a dll without - * generating error messages in the log. Handy for determining - * the capabilities of a library. - * @return Returns the value of @a symbol_name if it is a valid symbol - * in the DLL. Otherwise, returns 0. - */ - void *symbol (const ACE_TCHAR *symbol_name, int ignore_errors = 0); - - /// Returns a pointer to a string explaining that an error occured. You - /// will need to consult the error log for the actual error string - /// returned by the OS. - ACE_TCHAR *error (void) const; - - /** - * Return the handle to the caller. If @a become_owner is non-0 then - * caller assumes ownership of the handle and the ACE_DLL object - * won't call close() when it goes out of scope, even if - * is set. - */ - ACE_SHLIB_HANDLE get_handle (int become_owner = 0) const; - - /// Set the handle for the DLL object. By default, the close() - //operation on / the object will be invoked before it is destroyed. - int set_handle (ACE_SHLIB_HANDLE handle, - bool close_handle_on_destruction = true); - -private: - - int open_i (const ACE_TCHAR *dll_name, - int open_mode = ACE_DEFAULT_SHLIB_MODE, - bool close_handle_on_destruction = true, - ACE_SHLIB_HANDLE handle = 0); - - //private: -public: - - /// Open mode. - int open_mode_; - - /// Keep track of the name of the loaded dll, so it can be used - /// to remove framework components, singletons that live in the dll, - /// prior to unloading the dll in the close() method. - ACE_TCHAR *dll_name_; - - /// This flag keeps track of whether we should close the handle - /// automatically when the object is destroyed. - bool close_handle_on_destruction_; - - ACE_DLL_Handle *dll_handle_; - - /// Flag to record if the last operation had an error. - bool error_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_DLL_H */ - diff --git a/dep/include/ace/DLL_Manager.h b/dep/include/ace/DLL_Manager.h deleted file mode 100644 index 9b63c7ead5b..00000000000 --- a/dep/include/ace/DLL_Manager.h +++ /dev/null @@ -1,269 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file DLL_Manager.h - * - * $Id: DLL_Manager.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - */ -//============================================================================= - -#ifndef ACE_DLL_MANAGER_H -#define ACE_DLL_MANAGER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Auto_Ptr.h" -#include "ace/Containers_T.h" -#include "ace/SStringfwd.h" -#include "ace/os_include/os_dlfcn.h" - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# include "ace/Thread_Mutex.h" -#endif /* ACE_MT_SAFE */ - -#define ACE_DEFAULT_DLL_MANAGER_SIZE 1024 - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_DLL_Handle - * - * @brief Provides an abstract interface for handling various DLL - * operations. - * - * This class is an wrapper over the various methods for utilizing a - * dynamically linked library (DLL), which is called a shared library - * on some platforms. It is refcounted and managed by - * ACE_DLL_Manager, so there will only be a single instance of this - * class for each dll loaded, no matter how many instances of ACE_DLL - * an application has open. Operations , , and - * have been implemented to help opening/closing and extracting symbol - * information from a DLL, respectively. - * - * Most of this class came from the original ACE_DLL class. ACE_DLL - * is now just an interface that passed all it's calls either directly - * or via ACE_DLL_Manager to this class for execution. - * - */ -class ACE_Export ACE_DLL_Handle -{ -public: - - /// Default construtor. - ACE_DLL_Handle (void); - - /// Destructor. - ~ACE_DLL_Handle (void); - - /// Returns the name of the shared library (without prefixes or suffixes). - const ACE_TCHAR *dll_name () const; - - /** - * This method opens and dynamically links @a dll_name. The default - * mode is , which loads identifier symbols but not the - * symbols for functions, which are loaded dynamically on-demand. - * Other supported modes include: , which performs all - * necessary relocations when @a dll_name is first loaded and - * , which makes symbols available for relocation - * processing of any other DLLs. Returns -1 on failure and 0 on - * success. - */ - int open (const ACE_TCHAR *dll_name, - int open_mode, - ACE_SHLIB_HANDLE handle); - - /// Call to close the DLL object. If unload = 0, it only decrements - /// the refcount, but if unload = 1, then it will actually unload - /// the library when the refcount == 0; - int close (int unload = 0); - - /// Return the current refcount. - sig_atomic_t refcount (void) const; - - /// If @a symbol_name is in the symbol table of the DLL a pointer to - /// the @a symbol_name is returned. Otherwise, returns 0. Set the - /// ignore_errors flag to supress logging errors if symbol_name isn't - /// found. This is nice if you just want to probe a dll to see what's - /// available, since missing functions in that case aren't really errors. - void *symbol (const ACE_TCHAR *symbol_name, int ignore_errors = 0); - - /** - * Return the handle to the caller. If @a become_owner is non-0 then - * caller assumes ownership of the handle so we decrement the retcount. - */ - ACE_SHLIB_HANDLE get_handle (int become_owner = 0); - -private: - - /// Returns a pointer to a string explaining why or - /// failed. This is used internal to print out the error to the log, - /// but since this object is shared, we can't store or return the error - /// to the caller. - auto_ptr error (void); - - // Builds array of DLL names to try to dlopen, based on platform - // and configured DLL prefixes/suffixes. - // Returns the array of names to try in try_names. - void get_dll_names (const ACE_TCHAR *dll_name, - ACE_Array &try_names); - - // Disallow copying and assignment since we don't handle them. - ACE_DLL_Handle (const ACE_DLL_Handle &); - void operator= (const ACE_DLL_Handle &); - -private: - - // Keep track of how many ACE_DLL objects have a reference to this - // dll. - sig_atomic_t refcount_; - - /// Name of the shared library. - ACE_TCHAR *dll_name_; - - /// Handle to the actual library loaded by the OS. - ACE_SHLIB_HANDLE handle_; - - /// Keeps track of whether or not open() has ever been called. This - /// helps get around problem on Linux, and perhaps other OS's, that - /// seg-fault if dlerror() is called before the ld library has been - /// initialized by a call to dlopen(). - static sig_atomic_t open_called_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for the MT_SAFE Repository - ACE_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ -}; - -class ACE_Framework_Repository; - -/** - * @class ACE_DLL_Manager - * - * @brief This class is a singleton and serves as a factory and - * repository for instances of ACE_DLL_Handle. - * - * This class is a singleton whose lifetime is managed by the - * ACE_Framework_Repository. Although it is normally meant to be - * used directly only by ACE_DLL, applications can call the unload_policy() - * methods in order get/set the the dll unload policy. Unload policies include - * per_process/per-dll and eager/lazy. Dlls can export set their own policy - * by using the ACE_DLL_UNLOAD_POLICY macro found in config-all.h. If a dll - * choses to set an unload policy, it will be used when the per-dll policy - * (the default) is in effect. If the per-dll policy is in effect and a dll - * has not chosen to set a policy, the current per-process policy will be - * used. - * - * The following policy macros are provided in config-all.h: - * - * ACE_DLL_UNLOAD_POLICY_PER_PROCESS - Per-process policy that unloads dlls - * eagerly. - * - * ACE_DLL_UNLOAD_POLICY_PER_DLL - Apply policy on a per-dll basis. If the - * dll doesn't use one of the macros below, the current per-process policy - * will be used. - * - * ACE_DLL_UNLOAD_POLICY_LAZY - Don't unload dll when refcount reaches - * zero, i.e., wait for either an explicit unload request or program exit. - * - * ACE_DLL_UNLOAD_POLICY_DEFAULT - Default policy allows dlls to control - * their own destinies, but will unload those that don't make a choice eagerly. - * - */ -class ACE_Export ACE_DLL_Manager -{ -public: - friend class ACE_Framework_Repository; - friend class ACE_Object_Manager; - - enum - { - DEFAULT_SIZE = ACE_DEFAULT_DLL_MANAGER_SIZE - }; - - /// Return a unique instance - static ACE_DLL_Manager *instance (int size = ACE_DLL_Manager::DEFAULT_SIZE); - - /// Factory for ACE_DLL_Handle objects. If one already exits, - /// its refcount is incremented. - ACE_DLL_Handle *open_dll (const ACE_TCHAR *dll_name, - int openmode, - ACE_SHLIB_HANDLE handle); - - /// Close the underlying dll. Decrements the refcount. - int close_dll (const ACE_TCHAR *dll_name); - - /// Returns the current per-process UNLOAD_POLICY. - u_long unload_policy (void) const; - - /// Set the per-process UNLOAD_POLICY. If the policy is changed from - /// LAZY to EAGER, then it will also unload any dlls with zero - /// refcounts. - void unload_policy (u_long unload_policy); - -protected: - - /// Default constructor. - ACE_DLL_Manager (int size = ACE_DLL_Manager::DEFAULT_SIZE); - - /// Destructor. - ~ACE_DLL_Manager (void); - - // Allocate handle_vector_. - int open (int size); - - // Close all open dlls and deallocate memory. - int close (void); - - // Find dll in handle_vector_. - ACE_DLL_Handle *find_dll (const ACE_TCHAR *dll_name) const; - - // Applies strategy for unloading dll. - int unload_dll (ACE_DLL_Handle *dll_handle, int force_unload = 0); - -private: - - /// Close the singleton instance. - static void close_singleton (void); - - // Disallow copying and assignment since we don't handle these. - ACE_DLL_Manager (const ACE_DLL_Manager &); - void operator= (const ACE_DLL_Manager &); - -private: - - /// Vector containing all loaded handle objects. - ACE_DLL_Handle **handle_vector_; - - /// Current number of handles. - int current_size_; - - /// Maximum number of handles. - int total_size_; - - /// Unload strategy. - u_long unload_policy_; - - /// Pointer to a process-wide ACE_DLL_Manager. - static ACE_DLL_Manager *instance_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for the MT_SAFE Repository - ACE_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_DLL_MANAGER_H */ - diff --git a/dep/include/ace/Date_Time.h b/dep/include/ace/Date_Time.h deleted file mode 100644 index 7e91549d2a5..00000000000 --- a/dep/include/ace/Date_Time.h +++ /dev/null @@ -1,126 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Date_Time.h - * - * $Id: Date_Time.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Tim Harrison (harrison@cs.wustl.edu) (and he's darn proud of this ;-)) - * - */ -//========================================================================== - -#ifndef ACE_DATE_TIME_H -#define ACE_DATE_TIME_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_Date_Time - * - * @brief System independent representation of date and time. - */ -class ACE_Export ACE_Date_Time -{ -public: - /// Constructor initializes current time/date info. - ACE_Date_Time (void); - - /// Constructor initializes with the given ACE_Time_Value - explicit ACE_Date_Time (const ACE_Time_Value& timevalue); - - /// Constructor with init values, no check for validy - /// Set/get portions of ACE_Date_Time, no check for validity. - ACE_Date_Time (long day, - long month = 0, - long year = 0, - long hour = 0, - long minute = 0, - long second = 0, - long microsec = 0, - long wday = 0); - - /// Update to the current time/date. - void update (void); - - /// Update to the given ACE_Time_Value - void update (const ACE_Time_Value& timevalue); - - /// Get day. - long day (void) const; - - /// Set day. - void day (long day); - - /// Get month. - long month (void) const; - - /// Set month. - void month (long month); - - /// Get year. - long year (void) const; - - /// Set year. - void year (long year); - - /// Get hour. - long hour (void) const; - - /// Set hour. - void hour (long hour); - - /// Get minute. - long minute (void) const; - - /// Set minute. - void minute (long minute); - - /// Get second. - long second (void) const; - - /// Set second. - void second (long second); - - /// Get microsec. - long microsec (void) const; - - /// Set microsec. - void microsec (long microsec); - - /// Get weekday. - long weekday (void) const; - - /// Set weekday. - void weekday (long wday); - -private: - long day_; - long month_; - long year_; - long hour_; - long minute_; - long second_; - long microsec_; - long wday_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Date_Time.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DATE_TIME_H */ - diff --git a/dep/include/ace/Date_Time.inl b/dep/include/ace/Date_Time.inl deleted file mode 100644 index d34807d83a4..00000000000 --- a/dep/include/ace/Date_Time.inl +++ /dev/null @@ -1,219 +0,0 @@ -// -*- C++ -*- -// -// $Id: Date_Time.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Global_Macros.h" -#include "ace/Time_Value.h" -#include "ace/OS_NS_sys_time.h" -#include "ace/OS_NS_time.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void -ACE_Date_Time::update (const ACE_Time_Value& timevalue) -{ -#if defined (ACE_HAS_WINCE) - // CE doesn't do localtime(). - FILETIME file_time = timevalue; - FILETIME local_file_time; - SYSTEMTIME sys_time; - ::FileTimeToLocalFileTime (&file_time, &local_file_time); - ::FileTimeToSystemTime (&local_file_time, &sys_time); - this->day_ = sys_time.wDay; - this->month_ = sys_time.wMonth; - this->year_ = sys_time.wYear; - this->hour_ = sys_time.wHour; - this->minute_ = sys_time.wMinute; - this->second_ = sys_time.wSecond; - this->microsec_ = sys_time.wMilliseconds * 1000; - this->wday_ = sys_time.wDayOfWeek; -#else - time_t time = timevalue.sec (); - struct tm tm_time; - ACE_OS::localtime_r (&time, &tm_time); - this->day_ = tm_time.tm_mday; - this->month_ = tm_time.tm_mon + 1; // localtime's months are 0-11 - this->year_ = tm_time.tm_year + 1900; // localtime reports years since 1900 - this->hour_ = tm_time.tm_hour; - this->minute_ = tm_time.tm_min; - this->second_ = tm_time.tm_sec; - this->microsec_ = timevalue.usec (); - this->wday_ = tm_time.tm_wday; -#endif /* ACE_HAS_WINCE */ -} - -ACE_INLINE void -ACE_Date_Time::update (void) -{ - ACE_TRACE ("ACE_Date_Time::update"); - - update(ACE_OS::gettimeofday ()); -} - -ACE_INLINE -ACE_Date_Time::ACE_Date_Time (void) -{ - ACE_TRACE ("ACE_Date_Time::ACE_Date_Time"); - this->update (); -} - -ACE_INLINE -ACE_Date_Time::ACE_Date_Time (const ACE_Time_Value& timevalue) -{ - ACE_TRACE ("ACE_Date_Time::ACE_Date_Time: timevalue"); - this->update (timevalue); -} - -// Constructor with init values, no check for validy -ACE_INLINE -ACE_Date_Time::ACE_Date_Time (long day, - long month, - long year, - long hour, - long minute, - long second, - long microsec, - long wday) - : day_ (day), - month_ (month), - year_ (year), - hour_ (hour), - minute_ (minute), - second_ (second), - microsec_ (microsec), - wday_ (wday) -{ - ACE_TRACE ("ACE_Date_Time::ACE_Date_Time"); -} - -// set/get portions of ACE_Date_Time, no check for validy - -// get day -ACE_INLINE long -ACE_Date_Time::day (void) const -{ - ACE_TRACE ("ACE_Date_Time::day"); - return day_; -} - -// set day -ACE_INLINE void -ACE_Date_Time::day (long day) -{ - ACE_TRACE ("ACE_Date_Time::day"); - day_ = day; -} - -// get month -ACE_INLINE long -ACE_Date_Time::month (void) const -{ - ACE_TRACE ("ACE_Date_Time::month"); - return month_; -} - -// set month -ACE_INLINE void -ACE_Date_Time::month (long month) -{ - ACE_TRACE ("ACE_Date_Time::month"); - month_ = month; -} - -// get year -ACE_INLINE long -ACE_Date_Time::year (void) const -{ - ACE_TRACE ("ACE_Date_Time::year"); - return year_; -} - -// set year -ACE_INLINE void -ACE_Date_Time::year (long year) -{ - ACE_TRACE ("ACE_Date_Time::year"); - year_ = year; -} - -// get hour -ACE_INLINE long -ACE_Date_Time::hour (void) const -{ - ACE_TRACE ("ACE_Date_Time::hour"); - return hour_; -} - -// set hour -ACE_INLINE void -ACE_Date_Time::hour (long hour) -{ - ACE_TRACE ("ACE_Date_Time::hour"); - hour_ = hour; -} - -// get minute -ACE_INLINE long -ACE_Date_Time::minute (void) const -{ - ACE_TRACE ("ACE_Date_Time::minute"); - return minute_; -} - -// set minute -ACE_INLINE void -ACE_Date_Time::minute (long minute) -{ - ACE_TRACE ("ACE_Date_Time::minute"); - minute_ = minute; -} - -// get second -ACE_INLINE long -ACE_Date_Time::second (void) const -{ - ACE_TRACE ("ACE_Date_Time::second"); - return second_; -} - -// set second -ACE_INLINE void -ACE_Date_Time::second (long second) -{ - ACE_TRACE ("ACE_Date_Time::second"); - second_ = second; -} - -// get microsec -ACE_INLINE long -ACE_Date_Time::microsec (void) const -{ - ACE_TRACE ("ACE_Date_Time::microsec"); - return microsec_; -} - -// set microsec -ACE_INLINE void -ACE_Date_Time::microsec (long microsec) -{ - ACE_TRACE ("ACE_Date_Time::microsec"); - microsec_ = microsec; -} - -// get wday -ACE_INLINE long -ACE_Date_Time::weekday (void) const -{ - ACE_TRACE ("ACE_Date_Time::weekday"); - return wday_; -} - -// set wday -ACE_INLINE void -ACE_Date_Time::weekday (long wday) -{ - ACE_TRACE ("ACE_Date_Time::weekday"); - wday_ = wday; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Default_Constants.h b/dep/include/ace/Default_Constants.h deleted file mode 100644 index 9eefd496b9b..00000000000 --- a/dep/include/ace/Default_Constants.h +++ /dev/null @@ -1,574 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Default_Constants.h - * - * $Id: Default_Constants.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - * - * This one is split from the famous OS.h - */ -//============================================================================= - -#ifndef ACE_DEFAULT_CONSTANTS_H -#define ACE_DEFAULT_CONSTANTS_H -#include /**/ "ace/pre.h" - -// Included just keep compilers that see #pragma dierctive first -// happy. -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Define the default constants for ACE. Many of these are used for -// the ACE tests and applications. You can change these values by -// defining the macros in your config.h file. -# if !defined (ACE_DEFAULT_CLOSE_ALL_HANDLES) -# define ACE_DEFAULT_CLOSE_ALL_HANDLES true -# endif /* ACE_DEFAULT_CLOSE_ALL_HANDLES */ - -// The maximum length for a fully qualified Internet name. -# if !defined(ACE_MAX_FULLY_QUALIFIED_NAME_LEN) -# define ACE_MAX_FULLY_QUALIFIED_NAME_LEN 256 -# endif /* ACE_MAX_FULLY_QUALIFIED_NAME_LEN */ - -#if !defined (ACE_DEFAULT_PAGEFILE_POOL_BASE) -#define ACE_DEFAULT_PAGEFILE_POOL_BASE (void *) 0 -#endif /* ACE_DEFAULT_PAGEFILE_POOL_BASE */ - -#if !defined (ACE_DEFAULT_PAGEFILE_POOL_SIZE) -#define ACE_DEFAULT_PAGEFILE_POOL_SIZE (size_t) 0x01000000 -#endif /* ACE_DEFAULT_PAGEFILE_POOL_SIZE */ - -#if !defined (ACE_DEFAULT_PAGEFILE_POOL_CHUNK) -#define ACE_DEFAULT_PAGEFILE_POOL_CHUNK (size_t) 0x00010000 -#endif /* ACE_DEFAULT_PAGEFILE_POOL_CHUNK */ - -#if !defined (ACE_DEFAULT_PAGEFILE_POOL_NAME) -#define ACE_DEFAULT_PAGEFILE_POOL_NAME ACE_TEXT ("Default_ACE_Pagefile_Memory_Pool") -#endif /* ACE_DEFAULT_PAGEFILE_POOL_NAME */ - -#if !defined (ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY) -#define ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY 0 -#endif /* ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY */ - -#if !defined (ACE_DEFAULT_SERVICE_REPOSITORY_SIZE) -#define ACE_DEFAULT_SERVICE_REPOSITORY_SIZE 1024 -#endif /* ACE_DEFAULT_SERVICE_REPOSITORY_SIZE */ - -#if !defined (ACE_REACTOR_NOTIFICATION_ARRAY_SIZE) -#define ACE_REACTOR_NOTIFICATION_ARRAY_SIZE 1024 -#endif /* ACE_REACTOR_NOTIFICATION_ARRAY_SIZE */ - -# if !defined (ACE_DEFAULT_TIMEOUT) -# define ACE_DEFAULT_TIMEOUT 5 -# endif /* ACE_DEFAULT_TIMEOUT */ - -# if !defined (ACE_DEFAULT_BACKLOG) -# define ACE_DEFAULT_BACKLOG 5 -# endif /* ACE_DEFAULT_BACKLOG */ - -# if !defined (ACE_DEFAULT_ASYNCH_BACKLOG) -# define ACE_DEFAULT_ASYNCH_BACKLOG 5 -# endif /* ACE_DEFAULT_ASYNCH_BACKLOG */ - -# if !defined (ACE_DEFAULT_THREADS) -# define ACE_DEFAULT_THREADS 1 -# endif /* ACE_DEFAULT_THREADS */ - -// The following 3 defines are used in the IP multicast and broadcast tests. -# if !defined (ACE_DEFAULT_BROADCAST_PORT) -# define ACE_DEFAULT_BROADCAST_PORT 20000 -# endif /* ACE_DEFAULT_BROADCAST_PORT */ - -# if !defined (ACE_DEFAULT_MULTICAST_PORT) -# define ACE_DEFAULT_MULTICAST_PORT 20001 -# endif /* ACE_DEFAULT_MULTICAST_PORT */ - -# if !defined (ACE_DEFAULT_MULTICAST_ADDR) -// This address MUST be within the range for host group addresses: -// 224.0.0.0 to 239.255.255.255. -# define ACE_DEFAULT_MULTICAST_ADDR "224.9.9.2" -# endif /* ACE_DEFAULT_MULTICAST_ADDR */ - -# if defined (ACE_HAS_IPV6) -# if !defined (ACE_DEFAULT_MULTICASTV6_ADDR) -// This address should be within the range for site-local addresses: -// ff05::0/16 . -# define ACE_DEFAULT_MULTICASTV6_ADDR "ff05:0::ff01:1" -# endif /* ACE_DEFAULT_MULTICASTV6_ADDR */ -# endif - -// Default port number for HTTP. -# if !defined (ACE_DEFAULT_HTTP_SERVER_PORT) -# define ACE_DEFAULT_HTTP_SERVER_PORT 80 -# endif /* ACE_DEFAULT_HTTP_SERVER_PORT */ - -// Used in many IPC_SAP tests -# if !defined (ACE_DEFAULT_SERVER_PORT) -# define ACE_DEFAULT_SERVER_PORT 20002 -# endif /* ACE_DEFAULT_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_HTTP_PORT) -# define ACE_DEFAULT_HTTP_PORT 80 -# endif /* ACE_DEFAULT_HTTP_PORT */ - -# if !defined (ACE_DEFAULT_MAX_SOCKET_BUFSIZ) -# define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65536 -# endif /* ACE_DEFAULT_MAX_SOCKET_BUFSIZ */ - -# if !defined (ACE_DEFAULT_SERVER_PORT_STR) -# define ACE_DEFAULT_SERVER_PORT_STR ACE_TEXT("20002") -# endif /* ACE_DEFAULT_SERVER_PORT_STR */ - -// Used for the Service_Directory test -# if !defined (ACE_DEFAULT_SERVICE_PORT) -# define ACE_DEFAULT_SERVICE_PORT 20003 -# endif /* ACE_DEFAULT_SERVICE_PORT */ - -// Used for the ACE_Thread_Spawn test -# if !defined (ACE_DEFAULT_THR_PORT ) -# define ACE_DEFAULT_THR_PORT 20004 -# endif /* ACE_DEFAULT_THR_PORT */ - -// Used for tests -# if !defined (ACE_DEFAULT_LOCAL_PORT) -# define ACE_DEFAULT_LOCAL_PORT 20005 -# endif /* ACE_DEFAULT_LOCAL_PORT */ - -// Used for Connector tests -# if !defined (ACE_DEFAULT_LOCAL_PORT_STR) -# define ACE_DEFAULT_LOCAL_PORT_STR "20005" -# endif /* ACE_DEFAULT_LOCAL_PORT_STR */ - -// Used for the name server. -# if !defined (ACE_DEFAULT_NAME_SERVER_PORT) -# define ACE_DEFAULT_NAME_SERVER_PORT 20006 -# endif /* ACE_DEFAULT_NAME_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_NAME_SERVER_PORT_STR) -# define ACE_DEFAULT_NAME_SERVER_PORT_STR "20006" -# endif /* ACE_DEFAULT_NAME_SERVER_PORT_STR */ - -// Used for the token server. -# if !defined (ACE_DEFAULT_TOKEN_SERVER_PORT) -# define ACE_DEFAULT_TOKEN_SERVER_PORT 20007 -# endif /* ACE_DEFAULT_TOKEN_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_TOKEN_SERVER_PORT_STR) -# define ACE_DEFAULT_TOKEN_SERVER_PORT_STR "20007" -# endif /* ACE_DEFAULT_TOKEN_SERVER_PORT_STR */ - -// Used for the logging server. -# if !defined (ACE_DEFAULT_LOGGING_SERVER_PORT) -# define ACE_DEFAULT_LOGGING_SERVER_PORT 20008 -# endif /* ACE_DEFAULT_LOGGING_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_LOGGING_SERVER_PORT_STR) -# define ACE_DEFAULT_LOGGING_SERVER_PORT_STR "20008" -# endif /* ACE_DEFAULT_LOGGING_SERVER_PORT_STR */ - -// Used for the logging server. -# if !defined (ACE_DEFAULT_THR_LOGGING_SERVER_PORT) -# define ACE_DEFAULT_THR_LOGGING_SERVER_PORT 20008 -# endif /* ACE_DEFAULT_THR_LOGGING_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR) -# define ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR "20008" -# endif /* ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR */ - -// Used for the time server. -# if !defined (ACE_DEFAULT_TIME_SERVER_PORT) -# define ACE_DEFAULT_TIME_SERVER_PORT 20009 -# endif /* ACE_DEFAULT_TIME_SERVER_PORT */ - -# if !defined (ACE_DEFAULT_TIME_SERVER_PORT_STR) -# define ACE_DEFAULT_TIME_SERVER_PORT_STR "20009" -# endif /* ACE_DEFAULT_TIME_SERVER_PORT_STR */ - -# if !defined (ACE_DEFAULT_TIME_SERVER_STR) -# define ACE_DEFAULT_TIME_SERVER_STR "ACE_TS_TIME" -# endif /* ACE_DEFAULT_TIME_SERVER_STR */ - -// Used by the FIFO tests and the Client_Logging_Handler netsvc. -# if !defined (ACE_DEFAULT_RENDEZVOUS) -# if defined (ACE_HAS_STREAM_PIPES) -# define ACE_DEFAULT_RENDEZVOUS ACE_TEXT("/tmp/fifo.ace") -# else -# define ACE_DEFAULT_RENDEZVOUS ACE_TEXT("localhost:20010") -# endif /* ACE_HAS_STREAM_PIPES */ -# endif /* ACE_DEFAULT_RENDEZVOUS */ - -// Used for the UNIX syslog logging interface to ACE_Log_Msg. -# ifndef ACE_DEFAULT_SYSLOG_FACILITY -# define ACE_DEFAULT_SYSLOG_FACILITY LOG_USER -# endif /* ACE_DEFAULT_SYSLOG_FACILITY */ - -# if !defined (ACE_DEFAULT_LOGGER_KEY) - -# if defined (ACE_HAS_STREAM_PIPES) -# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("/tmp/server_daemon") -# else -# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("localhost:20012") -# endif /* ACE_HAS_STREAM_PIPES */ -# endif /* ACE_DEFAULT_LOGGER_KEY */ - -// The way to specify the local host for loopback IP. This is usually -// "localhost" but it may need changing on some platforms. -# if !defined (ACE_LOCALHOST) -# define ACE_LOCALHOST ACE_TEXT ("localhost") -# endif - -// This specification for an IPv6 localhost should work on all platforms -// supporting IPv6 -# if defined (ACE_HAS_IPV6) -# if !defined (ACE_IPV6_LOCALHOST) -# define ACE_IPV6_LOCALHOST ACE_TEXT ("::1") -# endif /* ACE_IPV6_LOCALHOST*/ -#endif /* ACE_HAS_IPV6 */ - -// This specification for an IPv6 ANY address should work on all platforms -// supporting IPv6 -# if defined (ACE_HAS_IPV6) -# if !defined (ACE_IPV6_ANY) -# define ACE_IPV6_ANY ACE_TEXT ("::") -# endif /* ACE_IPV6_ANY*/ -#endif /* ACE_HAS_IPV6 */ - -# if !defined (ACE_DEFAULT_SERVER_HOST) -# if defined (ACE_HAS_IPV6) -# define ACE_DEFAULT_SERVER_HOST ACE_IPV6_LOCALHOST -# else /*ACE_HAS_IPV6*/ -# define ACE_DEFAULT_SERVER_HOST ACE_LOCALHOST -# endif /*ACE_HAS_IPV6*/ -# endif /* ACE_DEFAULT_SERVER_HOST */ - -// Default shared memory key -# if !defined (ACE_DEFAULT_SHM_KEY) -# define ACE_DEFAULT_SHM_KEY 1234 -# endif /* ACE_DEFAULT_SHM_KEY */ - -// Default address for shared memory mapped files and SYSV shared memory -// (defaults to 64 M). -# if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR ((char *) (64 * 1024 * 1024)) -# endif /* ACE_DEFAULT_BASE_ADDR */ - -// Default segment size used by SYSV shared memory (128 K) -# if !defined (ACE_DEFAULT_SEGMENT_SIZE) -# define ACE_DEFAULT_SEGMENT_SIZE 1024 * 128 -# endif /* ACE_DEFAULT_SEGMENT_SIZE */ - -// Maximum number of SYSV shared memory segments -// (does anyone know how to figure out the right values?!) -# if !defined (ACE_DEFAULT_MAX_SEGMENTS) -# define ACE_DEFAULT_MAX_SEGMENTS 6 -# endif /* ACE_DEFAULT_MAX_SEGMENTS */ - -// Name of the map that's stored in shared memory. -# if !defined (ACE_NAME_SERVER_MAP) -# define ACE_NAME_SERVER_MAP "Name Server Map" -# endif /* ACE_NAME_SERVER_MAP */ - -// Default file permissions. -# if !defined (ACE_DEFAULT_FILE_PERMS) -# if defined (ACE_VXWORKS) -# define ACE_DEFAULT_FILE_PERMS (S_IRUSR | S_IWUSR| S_IRGRP| S_IROTH) -# else -# define ACE_DEFAULT_FILE_PERMS 0644 -# endif /* ACE_VXWORKS */ -# endif /* ACE_DEFAULT_FILE_PERMS */ - -// Default directory permissions. -# if !defined (ACE_DEFAULT_DIR_PERMS) -# define ACE_DEFAULT_DIR_PERMS 0755 -# endif /* ACE_DEFAULT_DIR_PERMS */ - -# if !defined (ACE_DEFAULT_TIMEPROBE_TABLE_SIZE) -# define ACE_DEFAULT_TIMEPROBE_TABLE_SIZE 8 * 1024 -# endif /* ACE_DEFAULT_TIMEPROBE_TABLE_SIZE */ - -// Default size of the ACE Map_Manager. -# if !defined (ACE_DEFAULT_MAP_SIZE) -# define ACE_DEFAULT_MAP_SIZE 1024 -# endif /* ACE_DEFAULT_MAP_SIZE */ - -// Defaults for ACE Timer Wheel -# if !defined (ACE_DEFAULT_TIMER_WHEEL_SIZE) -# define ACE_DEFAULT_TIMER_WHEEL_SIZE 1024 -# endif /* ACE_DEFAULT_TIMER_WHEEL_SIZE */ - -# if !defined (ACE_DEFAULT_TIMER_WHEEL_RESOLUTION) -# define ACE_DEFAULT_TIMER_WHEEL_RESOLUTION 100 -# endif /* ACE_DEFAULT_TIMER_WHEEL_RESOLUTION */ - -// Default size for ACE Timer Hash table -# if !defined (ACE_DEFAULT_TIMER_HASH_TABLE_SIZE) -# define ACE_DEFAULT_TIMER_HASH_TABLE_SIZE 1024 -# endif /* ACE_DEFAULT_TIMER_HASH_TABLE_SIZE */ - -// Defaults for the ACE Free List -# if !defined (ACE_DEFAULT_FREE_LIST_PREALLOC) -# define ACE_DEFAULT_FREE_LIST_PREALLOC 0 -# endif /* ACE_DEFAULT_FREE_LIST_PREALLOC */ - -# if !defined (ACE_DEFAULT_FREE_LIST_LWM) -# define ACE_DEFAULT_FREE_LIST_LWM 0 -# endif /* ACE_DEFAULT_FREE_LIST_LWM */ - -# if !defined (ACE_DEFAULT_FREE_LIST_HWM) -# define ACE_DEFAULT_FREE_LIST_HWM 25000 -# endif /* ACE_DEFAULT_FREE_LIST_HWM */ - -# if !defined (ACE_DEFAULT_FREE_LIST_INC) -# define ACE_DEFAULT_FREE_LIST_INC 100 -# endif /* ACE_DEFAULT_FREE_LIST_INC */ - -# if !defined (ACE_UNIQUE_NAME_LEN) -# define ACE_UNIQUE_NAME_LEN 100 -# endif /* ACE_UNIQUE_NAME_LEN */ - -# if !defined (ACE_MAX_DGRAM_SIZE) - // This is just a guess. 8k is the normal limit on - // most machines because that's what NFS expects. -# define ACE_MAX_DGRAM_SIZE 8192 -# endif /* ACE_MAX_DGRAM_SIZE */ - -# if !defined (ACE_DEFAULT_ARGV_BUFSIZ) -# define ACE_DEFAULT_ARGV_BUFSIZ 1024 * 4 -# endif /* ACE_DEFAULT_ARGV_BUFSIZ */ - -// A free list which create more elements when there aren't enough -// elements. -# define ACE_FREE_LIST_WITH_POOL 1 - -// A simple free list which doen't allocate/deallocate elements. -# define ACE_PURE_FREE_LIST 2 - -# if defined (ACE_WIN32) - -// This is necessary to work around bugs with Win32 non-blocking -// connects... -# if !defined (ACE_NON_BLOCKING_BUG_DELAY) -# define ACE_NON_BLOCKING_BUG_DELAY 35000 -# endif /* ACE_NON_BLOCKING_BUG_DELAY */ -# endif /*ACE_WIN32*/ - -// Max size of an ACE Log Record data buffer. This can be reset in -// the config.h file if you'd like to increase or decrease the size. -# if !defined (ACE_MAXLOGMSGLEN) -# define ACE_MAXLOGMSGLEN 4 * 1024 -# endif /* ACE_MAXLOGMSGLEN */ - -// Max size of an ACE Token. -# define ACE_MAXTOKENNAMELEN 40 - -// Max size of an ACE Token client ID. -# define ACE_MAXCLIENTIDLEN MAXHOSTNAMELEN + 20 - -/// Max udp packet size -#if !defined (ACE_MAX_UDP_PACKET_SIZE) -#define ACE_MAX_UDP_PACKET_SIZE 65536 -#endif - -/** - * @name Default values to control CDR classes memory allocation strategies - */ -//@{ - -/// Control the initial size of all CDR buffers, application -/// developers may want to optimize this value to fit their request -/// size -#if !defined (ACE_DEFAULT_CDR_BUFSIZE) -# define ACE_DEFAULT_CDR_BUFSIZE 512 -#endif /* ACE_DEFAULT_CDR_BUFSIZE */ - -#if (ACE_DEFAULT_CDR_BUFSIZE == 0) -# error: ACE_DEFAULT_CDR_BUFSIZE should be bigger then 0 -#endif - -/// Stop exponential growth of CDR buffers to avoid overallocation -#if !defined (ACE_DEFAULT_CDR_EXP_GROWTH_MAX) -# define ACE_DEFAULT_CDR_EXP_GROWTH_MAX 65536 -#endif /* ACE_DEFAULT_CDR_EXP_GROWTH_MAX */ - -/// Control CDR buffer growth after maximum exponential growth is -/// reached -#if !defined (ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK) -# define ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK 65536 -#endif /* ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK */ -//@} - -/// Control the zero-copy optimizations for octet sequences -/** - * Large octet sequences can be sent without any copies by chaining - * them in the list of message blocks that represent a single CDR - * stream. However, if the octet sequence is too small the zero copy - * optimizations actually hurt performance. Octet sequences smaller - * than this value will be copied. - */ -#if !defined (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF) -#define ACE_DEFAULT_CDR_MEMCPY_TRADEOFF 256 -#endif /* ACE_DEFAULT_CDR_MEMCPY_TRADEOFF */ - -#if defined (ACE_WIN32) - // Define the pathname separator characters for Win32 (ugh). -# define ACE_DIRECTORY_SEPARATOR_STR_A "\\" -# define ACE_DIRECTORY_SEPARATOR_CHAR_A '\\' -#else - // Define the pathname separator characters for UNIX. -# define ACE_DIRECTORY_SEPARATOR_STR_A "/" -# define ACE_DIRECTORY_SEPARATOR_CHAR_A '/' -#endif /* ACE_WIN32 */ - -// Define the Wide character and normal versions of some of the string macros -#if defined (ACE_HAS_WCHAR) -# define ACE_DIRECTORY_SEPARATOR_STR_W ACE_TEXT_WIDE(ACE_DIRECTORY_SEPARATOR_STR_A) -# define ACE_DIRECTORY_SEPARATOR_CHAR_W ACE_TEXT_WIDE(ACE_DIRECTORY_SEPARATOR_CHAR_A) -#endif /* ACE_HAS_WCHAR */ - -#define ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT (ACE_DIRECTORY_SEPARATOR_STR_A) -#define ACE_DIRECTORY_SEPARATOR_CHAR ACE_TEXT (ACE_DIRECTORY_SEPARATOR_CHAR_A) - -#if !defined (ACE_DEFAULT_THREAD_PRIORITY) -# define ACE_DEFAULT_THREAD_PRIORITY (-0x7fffffffL - 1L) -#endif /* ACE_DEFAULT_THREAD_PRIORITY */ - -#if !defined (ACE_DEFAULT_THREAD_STACKSIZE) -# define ACE_DEFAULT_THREAD_STACKSIZE 0 -#endif /* ACE_DEFAULT_THREAD_STACKSIZE */ - -#if !defined (ACE_MAX_DEFAULT_PORT) -# define ACE_MAX_DEFAULT_PORT 65535 -#endif /* ACE_MAX_DEFAULT_PORT */ - -// Default number of ACE_Event_Handlers supported by -// ACE_Timer_Heap. -# if !defined (ACE_DEFAULT_TIMERS) -# define ACE_DEFAULT_TIMERS _POSIX_TIMER_MAX -# endif /* ACE_DEFAULT_TIMERS */ - -#if defined (ACE_WIN32) -# define ACE_PLATFORM_A "Win32" -# define ACE_PLATFORM_EXE_SUFFIX_A ".exe" -#elif defined (ACE_VXWORKS) -# define ACE_PLATFORM_A "VxWorks" -# if defined (__RTP__) -# define ACE_PLATFORM_EXE_SUFFIX_A ".vxe" -# else -# define ACE_PLATFORM_EXE_SUFFIX_A ".out" -# endif -#else /* !ACE_WIN32 && !ACE_VXWORKS */ -# define ACE_PLATFORM_A "UNIX" -# define ACE_PLATFORM_EXE_SUFFIX_A "" -#endif /* ACE_WIN32 */ - -// Define the Wide character and normal versions of some of the string macros -#if defined (ACE_HAS_WCHAR) -# define ACE_PLATFORM_W ACE_TEXT_WIDE(ACE_PLATFORM_A) -# define ACE_PLATFORM_EXE_SUFFIX_W ACE_TEXT_WIDE(ACE_PLATFORM_EXE_SUFFIX_A) -#endif /* ACE_HAS_WCHAR */ - -#define ACE_PLATFORM ACE_TEXT (ACE_PLATFORM_A) -#define ACE_PLATFORM_EXE_SUFFIX ACE_TEXT (ACE_PLATFORM_EXE_SUFFIX_A) - -#if defined (ACE_WIN32) -# define ACE_LD_SEARCH_PATH ACE_TEXT ("PATH") -# define ACE_LD_SEARCH_PATH_SEPARATOR_STR ACE_TEXT (";") -# define ACE_DLL_SUFFIX ACE_TEXT (".dll") -# if defined (__MINGW32__) -# define ACE_DLL_PREFIX ACE_TEXT ("lib") -# else /* __MINGW32__ */ -# define ACE_DLL_PREFIX ACE_TEXT ("") -# endif /* __MINGW32__ */ -#else /* !ACE_WIN32 */ -# if !defined (ACE_LD_SEARCH_PATH) -# define ACE_LD_SEARCH_PATH ACE_TEXT ("LD_LIBRARY_PATH") -# endif /* ACE_LD_SEARCH_PATH */ -# if !defined (ACE_LD_SEARCH_PATH_SEPARATOR_STR) -# define ACE_LD_SEARCH_PATH_SEPARATOR_STR ACE_TEXT (":") -# endif /* ACE_LD_SEARCH_PATH_SEPARATOR_STR */ -#endif /* ACE_WIN32 */ - -#if !defined (ACE_DLL_SUFFIX) -# define ACE_DLL_SUFFIX ACE_TEXT (".so") -#endif /* ACE_DLL_SUFFIX */ - -#if !defined (ACE_DLL_PREFIX) -# define ACE_DLL_PREFIX ACE_TEXT ("lib") -#endif /* ACE_DLL_PREFIX */ - -#if defined (ACE_WIN32) -// Used for dynamic linking -# if !defined (ACE_DEFAULT_SVC_CONF) -# if (ACE_USES_CLASSIC_SVC_CONF == 1) -# define ACE_DEFAULT_SVC_CONF ACE_TEXT (".\\svc.conf") -# else -# define ACE_DEFAULT_SVC_CONF ACE_TEXT (".\\svc.conf.xml") -# endif /* ACE_USES_CLASSIC_SVC_CONF ==1 */ -# endif /* ACE_DEFAULT_SVC_CONF */ -#endif /* ACE_WIN32 */ - - // Used for dynamic linking. -#if !defined (ACE_DEFAULT_SVC_CONF) -# if (ACE_USES_CLASSIC_SVC_CONF == 1) -# define ACE_DEFAULT_SVC_CONF ACE_TEXT ("./svc.conf") -# else -# define ACE_DEFAULT_SVC_CONF ACE_TEXT ("./svc.conf.xml") -# endif /* ACE_USES_CLASSIC_SVC_CONF ==1 */ -#endif /* ACE_DEFAULT_SVC_CONF */ - -#if !defined (ACE_LOGGER_KEY) -# define ACE_LOGGER_KEY ACE_TEXT ("/tmp/server_daemon") -#endif /* ACE_LOGGER_KEY */ - -// Theses defines are used by the ACE Name Server. -#if !defined (ACE_DEFAULT_LOCALNAME_A) -# define ACE_DEFAULT_LOCALNAME_A "localnames" -#endif /* ACE_DEFAULT_LOCALNAME_A */ -#if !defined (ACE_DEFAULT_GLOBALNAME_A) -# define ACE_DEFAULT_GLOBALNAME_A "globalnames" -#endif /* ACE_DEFAULT_GLOBALNAME_A */ - -// ACE_DEFAULT_NAMESPACE_DIR is for legacy mode apps. A better -// way of doing this is something like ACE_Lib_Find::get_temp_dir, since -// this directory may not exist -#if defined (ACE_LEGACY_MODE) -# if defined (ACE_WIN32) -# define ACE_DEFAULT_NAMESPACE_DIR_A "C:\\temp" -# else /* ACE_WIN32 */ -# define ACE_DEFAULT_NAMESPACE_DIR_A "/tmp" -# endif /* ACE_WIN32 */ -# if defined (ACE_HAS_WCHAR) -# define ACE_DEFAULT_NAMESPACE_DIR_W ACE_TEXT_WIDE(ACE_DEFAULT_NAMESPACE_DIR_A) -# endif /* ACE_HAS_WCHAR */ -# define ACE_DEFAULT_NAMESPACE_DIR ACE_TEXT(ACE_DEFAULT_NAMESPACE_DIR_A) -#endif /* ACE_LEGACY_MODE */ - -#if defined (ACE_HAS_WCHAR) -# define ACE_DEFAULT_LOCALNAME_W ACE_TEXT_WIDE(ACE_DEFAULT_LOCALNAME_A) -# define ACE_DEFAULT_GLOBALNAME_W ACE_TEXT_WIDE(ACE_DEFAULT_GLOBALNAME_A) -#endif /* ACE_HAS_WCHAR */ - -#define ACE_DEFAULT_LOCALNAME ACE_TEXT (ACE_DEFAULT_LOCALNAME_A) -#define ACE_DEFAULT_GLOBALNAME ACE_TEXT (ACE_DEFAULT_GLOBALNAME_A) - -# if defined (ACE_WIN32) - // The "null" device on Win32. -# define ACE_DEV_NULL "nul" -# define ACE_SYSCALL_FAILED 0xFFFFFFFF -# else /* !ACE_WIN32 */ - // The "null" device on UNIX. -# define ACE_DEV_NULL "/dev/null" -# define ACE_SYSCALL_FAILED -1 -# endif /* ACE_WIN32 */ - -#include /**/ "ace/post.h" -#endif /*ACE_DEFAULT_CONSTANTS_H*/ - diff --git a/dep/include/ace/Dev_Poll_Reactor.h b/dep/include/ace/Dev_Poll_Reactor.h deleted file mode 100644 index 6118d8e0a38..00000000000 --- a/dep/include/ace/Dev_Poll_Reactor.h +++ /dev/null @@ -1,1250 +0,0 @@ -// -*- C++ -*- - -// ========================================================================= -/** - * @file Dev_Poll_Reactor.h - * - * $Id: Dev_Poll_Reactor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @c /dev/poll (or Linux @c sys_epoll) based Reactor implementation. - * - * @author Ossama Othman - */ -// ========================================================================= - -#ifndef ACE_DEV_POLL_REACTOR_H -#define ACE_DEV_POLL_REACTOR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_EVENT_POLL) && defined (ACE_HAS_DEV_POLL) -# error ACE_HAS_EVENT_POLL and ACE_HAS_DEV_POLL are mutually exclusive. -#endif /* ACE_HAS_EVENT_POLL && defined ACE_HAS_DEV_POLL */ - -#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) - -#include "ace/Pipe.h" -#include "ace/Lock_Adapter_T.h" -#include "ace/Reactor_Impl.h" -#include "ace/Reactor_Token_T.h" -#include "ace/Token.h" - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) -# include "ace/Notification_Queue.h" -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - -#if defined (ACE_HAS_DEV_POLL) -struct pollfd; -#elif defined (ACE_HAS_EVENT_POLL) -struct epoll_event; -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations -class ACE_Sig_Handler; -class ACE_Dev_Poll_Reactor; - -/** - * @class ACE_Dev_Poll_Event_Tuple - * - * @brief Class that associates specific event mask with a given event - * handler. - * - * This class merely provides a means to associate an event mask - * with an event handler. Such an association is needed since it is - * not possible to retrieve the event mask from the "interest set" - * stored in the `/dev/poll' or `/dev/epoll' driver. Without this - * external association, it would not be possible keep track of the - * event mask for a given event handler when suspending it or resuming - * it. - * - * @note An ACE_Handle_Set is not used since the number of handles may - * exceed its capacity (ACE_DEFAULT_SELECT_REACTOR_SIZE). - */ -class ACE_Dev_Poll_Event_Tuple -{ -public: - - /// Constructor. - ACE_Dev_Poll_Event_Tuple (void); - -public: - - /// The event handler. - ACE_Event_Handler *event_handler; - - /// The event mask for the above event handler. - ACE_Reactor_Mask mask; - - /// Flag that states whether or not the event handler is suspended. - char suspended; -}; - -// --------------------------------------------------------------------- - -#if 0 -/** - * @class ACE_Dev_Poll_Ready_Set - * - * @brief Class that contains the list of "ready" file descriptors. - * - * This class points to an array of pollfd structures corresponding to - * "ready" file descriptors, such as those corresponding to event - * handlers that request an additional callback after being initially - * dispatched (i.e. return a value greater than zero). - * @par - * The idea is to store the "ready" set in an existing area of memory - * that already contains pollfd instances. Doing so is safe since the - * "ready" set is dispatched before polling for additional events, - * thus avoiding being potentially overwritten during the event poll. - * @par - * When the "ready" set is dispatched, all that needs to be done is to - * iterate over the contents of the array. There is no need to "walk" - * the array in search of ready file descriptors since the array by - * design only contains ready file descriptors. As such, this - * implementation of a ready set is much more efficient in the - * presence of a large number of file descriptors in terms of both - * time and space than the one used in the Select_Reactor, for - * example. - */ -class ACE_Dev_Poll_Ready_Set -{ -public: - - /// Constructor. - ACE_Dev_Poll_Ready_Set (void); - -public: - - /// The array containing the pollfd structures corresponding to the - /// "ready" file descriptors. - struct pollfd *pfds; - - /// The number of "ready" file descriptors in the above array. - int nfds; - -}; -#endif /* 0 */ - -// --------------------------------------------------------------------- - -/** - * @class ACE_Dev_Poll_Reactor_Notify - * - * @brief Event handler used for unblocking the ACE_Dev_Poll_Reactor - * from its event loop. - * - * This event handler is used internally by the ACE_Dev_Poll_Reactor - * as a means to allow a thread other then the one running the event - * loop to unblock the event loop. - */ -class ACE_Dev_Poll_Reactor_Notify : public ACE_Reactor_Notify -{ -public: - - /// Constructor - ACE_Dev_Poll_Reactor_Notify (void); - - /** - * @name Initialization and Termination Methods - * - * Methods called when initializing and terminating this event - * handler. - */ - virtual int open (ACE_Reactor_Impl *, - ACE_Timer_Queue *timer_queue = 0, - int disable_notify = 0); - virtual int close (void); - - /** - * Called by a thread when it wants to unblock the Reactor_Impl. - * This wakes up the Reactor_Impl if currently blocked. Pass over - * both the Event_Handler and the mask to allow the caller to - * dictate which Event_Handler method the Reactor_Impl will - * invoke. The ACE_Time_Value indicates how long to block - * trying to notify the Reactor_Impl. If timeout == 0, the - * caller will block until action is possible, else will wait until - * the relative time specified in *timeout elapses). - */ - virtual int notify (ACE_Event_Handler *eh = 0, - ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value *timeout = 0); - - /// Unimplemented method required by pure virtual method in abstract - /// base class. - /** - * This method's interface is not very compatibile with this - * Reactor's design. It's not clear why this method is pure virtual - * either. - */ - virtual int dispatch_notifications (int &number_of_active_handles, - ACE_Handle_Set &rd_mask); - - /// Returns the ACE_HANDLE of the notify pipe on which the reactor - /// is listening for notifications so that other threads can unblock - /// the Reactor_Impl. - virtual ACE_HANDLE notify_handle (void); - - /// Verify whether the buffer has dispatchable info or not. - virtual int is_dispatchable (ACE_Notification_Buffer &buffer); - - /// Handle one notify call represented in @a buffer. This could be - /// because of a thread trying to unblock the Reactor_Impl. - virtual int dispatch_notify (ACE_Notification_Buffer &buffer); - - /// Read one notify call on the handle into @a buffer. - /// This could be because of a thread trying to unblock the Reactor_Impl. - virtual int read_notify_pipe (ACE_HANDLE handle, - ACE_Notification_Buffer &buffer); - - /// Called back by the ACE_Dev_Poll_Reactor when a thread wants to - /// unblock us. - virtual int handle_input (ACE_HANDLE handle); - - /** - * Set the maximum number of times that the handle_input method - * will iterate and dispatch the ACE_Event_Handlers that are - * passed in via the notify queue before breaking out of the event - * loop. By default, this is set to -1, which means "iterate until - * the queue is empty." Setting this to a value like "1 or 2" will - * increase "fairness" (and thus prevent starvation) at the expense - * of slightly higher dispatching overhead. - */ - virtual void max_notify_iterations (int); - - /** - * Get the maximum number of times that the handle_input method - * will iterate and dispatch the ACE_Event_Handlers that are - * passed in via the notify queue before breaking out of its event - * loop. - */ - virtual int max_notify_iterations (void); - - /** - * Purge any notifications pending in this reactor for the specified - * ACE_Event_Handler object. Returns the number of notifications - * purged. Returns -1 on error. - */ - virtual int purge_pending_notifications ( - ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Dump the state of an object. - virtual void dump (void) const; - -protected: - - /** - * Keep a back pointer to the ACE_Dev_Poll_Reactor. If this value - * if NULL then the ACE_Dev_Poll_Reactor has been initialized with - * disable_notify_pipe. - */ - ACE_Dev_Poll_Reactor *dp_reactor_; - - /** - * Contains the ACE_HANDLE the ACE_Dev_Poll_Reactor is listening - * on, as well as the ACE_HANDLE that threads wanting the attention - * of the ACE_Dev_Poll_Reactor will write to. - */ - ACE_Pipe notification_pipe_; - - /** - * Keeps track of the maximum number of times that the - * ACE_Dev_Poll_Reactor_Notify::handle_input method will iterate and - * dispatch the ACE_Event_Handlers that are passed in via the - * notify pipe before breaking out of its recv loop. By default, - * this is set to -1, which means "iterate until the pipe is empty." - */ - int max_notify_iterations_; - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - /** - * @brief A user-space queue to store the notifications. - * - * The notification pipe has OS-specific size restrictions. That - * is, no more than a certain number of bytes may be stored in the - * pipe without blocking. This limit may be too small for certain - * applications. In this case, ACE can be configured to store all - * the events in user-space. The pipe is still needed to wake up - * the reactor thread, but only one event is sent through the pipe - * at a time. - */ - ACE_Notification_Queue notification_queue_; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - -}; - -// --------------------------------------------------------------------- - -/** - * @class ACE_Dev_Poll_Reactor_Handler_Repository - * - * @internal - - * @brief Used to map ACE_HANDLEs onto the appropriate - * ACE_Event_Handler *. - * - * - * This class is simply a container that maps a handle to its - * corresponding event handler. It is not meant for use outside of - * the Dev_Poll_Reactor. - */ -class ACE_Dev_Poll_Reactor_Handler_Repository -{ -public: - - /// Constructor. - ACE_Dev_Poll_Reactor_Handler_Repository (void); - - /// Initialize a repository of the appropriate @a size. - int open (size_t size); - - /// Close down the repository. - int close (void); - - /** - * @name Repository Manipulation Operations - * - * Methods used to search and modify the handler repository. - */ - //@{ - - /** - * Return the @c ACE_Event_Handler associated with @c ACE_HANDLE. If - * @a index_p is non-zero, then return the index location of the - * handle, if found. - */ - ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0); - - /// Set the event mask for event handler associated with the given - /// handle. - void mask (ACE_HANDLE handle, ACE_Reactor_Mask mask); - - /// Retrieve the event mask for the event handler associated with - /// the given handle. - ACE_Reactor_Mask mask (ACE_HANDLE handle); - - /// Mark the event handler associated with the given handle as - /// "suspended." - void suspend (ACE_HANDLE handle); - - /// Mark the event handler associated with the given handle as - /// "resumed." - void resume (ACE_HANDLE handle); - - /// Is the event handler for the given handle suspended? - int suspended (ACE_HANDLE handle) const; - - /// Bind the ACE_Event_Handler to the @c ACE_HANDLE with the - /// appropriate ACE_Reactor_Mask settings. - int bind (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Remove the binding for @c ACE_HANDLE; optionally decrement the associated - /// handler's reference count. - int unbind (ACE_HANDLE handle, bool decr_refcnt = true); - - /// Remove all the (@c ACE_HANDLE, @c ACE_Event_Handler) tuples. - int unbind_all (void); - - /** - * @name Sanity Checking - * - * Methods used to prevent "out-of-range" errors when indexing the - * underlying handler array. - */ - //@{ - - // Check the @a handle to make sure it's a valid @c ACE_HANDLE that - // within the range of legal handles (i.e., greater than or equal to - // zero and less than @c max_size_). - int invalid_handle (ACE_HANDLE handle) const; - - // Check the handle to make sure it's a valid @c ACE_HANDLE that is - // within the range of currently registered handles (i.e., greater - // than or equal to zero and less than @c max_handlep1_). - int handle_in_range (ACE_HANDLE handle) const; - - //@} - - /// Returns the current table size. - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Maximum number of handles. - int max_size_; - - /// The underlying array of event handlers. - /** - * The array of event handlers is directly indexed directly using - * an @c ACE_HANDLE value. This is Unix-specific. - */ - ACE_Dev_Poll_Event_Tuple *handlers_; - -}; - -// --------------------------------------------------------------------- - -/** - * @class ACE_Dev_Poll_Reactor - * - * @brief A `/dev/poll' or `/dev/epoll' based Reactor implemenatation. - * - * @attention The Linux epoll implementation works quite well and is - * fully supported; however, the /dev/poll implementation is @em experimental. - * - * The ACE_Dev_Poll_Reactor uses the `/dev/poll' or '/dev/epoll' - * character devices to demultiplex events on a given set of file - * descriptors. Unlike @c select(), `/dev/poll' and `/dev/epoll' have - * no hard-coded limit on the number of file descriptors that may be - * handled at any given time. As such, the ACE_Dev_Poll_Reactor can - * generally handle a much larger number of file descriptors than - * @c select() -based reactors. Furthermore, since `/dev/poll' and - * `/dev/epoll' both return a set of file descriptors that are active, - * there is no need to "walk" the set of file descriptors to determine - * which ones are active, such as what is done with the @c select() and - * @c poll() system calls. All returned file descriptors are active. - * This makes event dispatching very efficient. - * - * @note In general, this reactor may only be used to demultiplex - * events on sockets. Demultiplexing events on pipes, for - * example may not work. This is due to a limitation in the - * underlying `/dev/poll' device driver. - * - * @note It is only possible to achieve millisecond timeout - * resolutions with the @c ACE_Dev_Poll_Reactor. However, the - * timeout resolution for timers is independent of the reactors - * timeout resolution. As such, it may be possible to achieve - * sub-millisecond timeout resolutions for timers but that is - * entirely platform dependent. - */ - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -typedef ACE_Token ACE_DEV_POLL_TOKEN; -#else -typedef ACE_Noop_Token ACE_DEV_POLL_TOKEN; -#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ -typedef ACE_Reactor_Token_T ACE_Dev_Poll_Reactor_Token; - -class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl -{ -public: - - /// Initialize @c ACE_Dev_Poll_Reactor with the default size. - /** - * The default size for the @c ACE_Dev_Poll_Reactor is the maximum - * number of open file descriptors for the process. - */ - ACE_Dev_Poll_Reactor (ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - int mask_signals = 1, - int s_queue = ACE_DEV_POLL_TOKEN::FIFO); - - /// Initialize ACE_Dev_Poll_Reactor with size @a size. - /** - * @note On Unix platforms, the @a size parameter should be as large - * as the maximum number of file descriptors allowed for a - * given process. This is necessary since a file descriptor - * is used to directly index the array of event handlers - * maintained by the Reactor's handler repository. Direct - * indexing is used for efficiency reasons. If the size - * parameter is less than the process maximum, the process - * maximum will be decreased in order to prevent potential - * access violations. - */ - ACE_Dev_Poll_Reactor (size_t size, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - int mask_signals = 1, - int s_queue = ACE_DEV_POLL_TOKEN::FIFO); - - /// Close down and release all resources. - virtual ~ACE_Dev_Poll_Reactor (void); - - /// Initialization. - virtual int open (size_t size, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify * = 0); - - /** - * @param handle allows the reactor to check if the caller is - * valid. - * - * @return 0 if the size of the current message has been put in - * size. -1 if not. - */ - virtual int current_info (ACE_HANDLE handle, size_t & /* size */); - - /// Use a user specified signal handler instead. - virtual int set_sig_handler (ACE_Sig_Handler *signal_handler); - - /// Set a user-specified timer queue. - virtual int timer_queue (ACE_Timer_Queue *tq); - - /// Get the timer queue - /// @return The current @c ACE_Timer_Queue. - virtual ACE_Timer_Queue *timer_queue (void) const; - - /// Close down and release all resources. - virtual int close (void); - - // = Event loop drivers. - /** - * Returns non-zero if there are I/O events "ready" for dispatching, - * but does not actually dispatch the event handlers. By default, - * don't block while checking this, i.e., "poll". - * - * @note It is only possible to achieve millisecond timeout - * resolutions with the @c ACE_Dev_Poll_Reactor. - */ - virtual int work_pending ( - const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero); - - /** - * This event loop driver blocks for up to @a max_wait_time before - * returning. It will return earlier if events occur. Note that - * @a max_wait_time can be 0, in which case this method blocks - * indefinitely until events occur. - * @par - * @a max_wait_time is decremented to reflect how much time this - * call took. For instance, if a time value of 3 seconds is passed - * to @c handle_events() and an event occurs after 2 seconds, - * @a max_wait_time will equal 1 second. This can be used if an - * application wishes to handle events for some fixed amount of - * time. - * @par - * The only difference between @c alertable_handle_events() and - * handle_events() is that in the alertable case, the event loop - * will return when the system queues an I/O completion routine or - * an Asynchronous Procedure Call. - * - * @return The total number of @c ACE_Event_Handlers that were - * dispatched, 0 if the @a max_wait_time elapsed without - * dispatching any handlers, or -1 if an error occurs. - - * @note It is only possible to achieve millisecond timeout - * resolutions with the @c ACE_Dev_Poll_Reactor. - */ - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0); - - /** - * This method is just like the one above, except the - * @a max_wait_time value is a reference and can therefore never be - * @c NULL. - * - * @note It is only possible to achieve millisecond timeout - * resolutions with the @c ACE_Dev_Poll_Reactor. - */ - virtual int handle_events (ACE_Time_Value &max_wait_time); - virtual int alertable_handle_events (ACE_Time_Value &max_wait_time); - - // = Event handling control. - - /** - * @return The status of Reactor. If this function returns 0, the - * reactor is actively handling events. If it returns - * non-zero, @c handle_events() and - * @c handle_alertable_events() return -1 immediately. - */ - virtual int deactivated (void); - - /** - * Control whether the Reactor will handle any more incoming events - * or not. If @a do_stop == 1, the Reactor will be disabled. By - * default, a reactor is in active state and can be - * deactivated/reactived as desired. - */ - virtual void deactivate (int do_stop); - - // = Register and remove Handlers. - - /// Register @a event_handler with @a mask. The I/O handle will - /// always come from get_handle on the event_handler. - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /// Register @a event_handler with @a mask. The I/O handle is - /// provided through the @a io_handle parameter. - virtual int register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * Register an @a event_handler that will be notified when - * @a event_handle is signaled. @a mask specifies the network - * events that the @a event_handler is interested in. - */ - virtual int register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /// Register @a event_handler> with all the @a handles> in the @c - /// Handle_Set. - virtual int register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * Register @a new_sh to handle the signal @a signum using the - * @a new_disp. Returns the @a old_sh that was previously - * registered (if any), along with the @a old_disp of the signal - * handler. - */ - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - - /// Registers to handle a set of signals using the - /// . - virtual int register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0); - - /// Removes @a event_handler. - /** - * @note The I/O handle will be obtained using @c get_handle() - * method of @a event_handler . If @a mask == - * @c ACE_Event_Handler::DONT_CALL then the @c handle_close() - * method of the @a event_handler is not invoked. - */ - virtual int remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * Removes @a handle. If @a mask == ACE_Event_Handler::DONT_CALL - * then the method of the associated - * is not invoked. - */ - virtual int remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /** - * Removes all handles in . If @a mask == - * ACE_Event_Handler::DONT_CALL then the method of - * the associated s is not invoked. - */ - virtual int remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask mask); - - /** - * Remove the ACE_Event_Handler currently associated with @a signum. - * Install the new disposition (if given) and return the previous - * disposition (if desired by the caller). Returns 0 on success and - * -1 if @a signum is invalid. - */ - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - - /// Calls for every signal in . - virtual int remove_handler (const ACE_Sig_Set &sigset); - - // = Suspend and resume Handlers. - - /// Suspend event_handler temporarily. Use - /// ACE_Event_Handler::get_handle() to get the handle. - virtual int suspend_handler (ACE_Event_Handler *event_handler); - - /// Suspend handle temporarily. - virtual int suspend_handler (ACE_HANDLE handle); - - /// Suspend all handles in handle set temporarily. - virtual int suspend_handler (const ACE_Handle_Set &handles); - - /// Suspend all handles temporarily. - virtual int suspend_handlers (void); - - /// Resume event_handler. Use ACE_Event_Handler::get_handle() to - /// get the handle. - virtual int resume_handler (ACE_Event_Handler *event_handler); - - /// Resume handle. - virtual int resume_handler (ACE_HANDLE handle); - - /// Resume all handles in handle set. - virtual int resume_handler (const ACE_Handle_Set &handles); - - /// Resume all handles. - virtual int resume_handlers (void); - - /// Does the reactor allow the application to resume the handle on - /// its own, i.e., can it pass on the control of handle resumption to - /// the application. - virtual int resumable_handler (void); - - /// Return 1 if we any event associations were made by the reactor - /// for the handles that it waits on, 0 otherwise. - virtual int uses_event_associations (void); - - // = Timer management. - - /** - * Schedule an ACE_Event_Handler that will expire after an amount - * of time. The return value of this method, a timer_id value, - * uniquely identifies the event_handler in the ACE_Reactor's - * internal list of timers. - * This timer_id value can be used to cancel the timer - * with the cancel_timer() call. - * - * @see cancel_timer() - * @see reset_timer_interval() - * - * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of - * event_handler. - * @param delay time interval after which the timer will expire. - * @param interval time interval for which the timer will be - * automatically rescheduled. - * @return -1 on failure, a timer_id value on success - */ - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - - /// Cancel all Event_Handlers that match the address of - /// @a event_handler. Returns number of handlers cancelled. - virtual int cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close = 1); - - /** - * Cancel the single event handler that matches the @a timer_id value - * (which was returned from the schedule method). If @a arg is - * non-NULL then it will be set to point to the ``magic cookie'' - * argument passed in when the event handler was registered. This - * makes it possible to free up the memory and avoid memory leaks. - * Returns 1 if cancellation succeeded and 0 if the @a timer_id - * wasn't found. - */ - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - - // = High-level event handler scheduling operations - - /// Add @a masks_to_be_added to the @a event_handler's entry. - /// @a event_handler must already have been registered. - virtual int schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added); - - /// Add @a masks_to_be_added to the @a handle's entry. - /// associated with @a handle must already have been registered. - virtual int schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_added); - - /// Clear @a masks_to_be_cleared from the @a event_handler's entry. - virtual int cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_cleared); - - /// Clear @a masks_to_be_cleared from the @a handle's entry. - virtual int cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_cleared); - - // = Notification methods. - - /** - * Notify @a event_handler of @a mask event. The ACE_Time_Value - * indicates how long to blocking trying to notify. If @a timeout == - * 0, the caller will block until action is possible, else will wait - * until the relative time specified in @a timeout elapses). - */ - virtual int notify (ACE_Event_Handler *event_handler = 0, - ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - - /** - * Set the maximum number of times that ACE_Reactor_Impl will - * iterate and dispatch the that are passed in - * via the notify queue before breaking out of its - * loop. By default, this is set to - * -1, which means "iterate until the queue is empty." Setting this - * to a value like "1 or 2" will increase "fairness" (and thus - * prevent starvation) at the expense of slightly higher dispatching - * overhead. - */ - virtual void max_notify_iterations (int); - - /** - * Get the maximum number of times that the ACE_Reactor_Impl will - * iterate and dispatch the that are passed in - * via the notify queue before breaking out of its - * loop. - */ - virtual int max_notify_iterations (void); - - /** - * Purge any notifications pending in this reactor for the specified - * ACE_Event_Handler object. Returns the number of notifications - * purged. Returns -1 on error. - */ - virtual int purge_pending_notifications (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /** - * Return the Event_Handler associated with @a handle. Return 0 if - * @a handle is not registered. - */ - virtual ACE_Event_Handler *find_handler (ACE_HANDLE handle); - - /** - * Check to see if @a handle is associated with a valid Event_Handler - * bound to @a mask. Return the @a event_handler associated with this - * @c handler if @a event_handler != 0. - */ - virtual int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler = 0); - - /** - * Check to see if @a signum is associated with a valid Event_Handler - * bound to a signal. Return the @a event_handler associated with - * this @c handler if @a event_handler != 0. - */ - virtual int handler (int signum, - ACE_Event_Handler ** = 0); - - /// Returns true if Reactor has been successfully initialized, else - /// false. - virtual bool initialized (void); - - /// Returns the current size of the Reactor's internal descriptor - /// table. - virtual size_t size (void) const; - - /// Returns a reference to the Reactor's internal lock. - virtual ACE_Lock &lock (void); - - /// Wake up all threads waiting in the event loop. - virtual void wakeup_all_threads (void); - - /// Transfers ownership of Reactor_Impl to the new_owner. - /** - * @note There is no need to set the owner of the event loop for the - * ACE_Dev_Poll_Reactor. Multiple threads may invoke the - * event loop simulataneously. As such, this method is a - * no-op. - */ - virtual int owner (ACE_thread_t new_owner, ACE_thread_t *old_owner = 0); - - /// Return the ID of the "owner" thread. - /** - * @note There is no need to set the owner of the event loop for the - * ACE_Dev_Poll_Reactor. Multiple threads may invoke the - * event loop simulataneously. As such, this method is a - * no-op. - */ - virtual int owner (ACE_thread_t *owner); - - /// Get the existing restart value. - virtual int restart (void); - - /// Set a new value for restart and return the original value. - /** - * @param r If zero, then the event loop will not be automatically - * restarted if the underlying poll is interrupted via the - * INTR (interrupt) signal. - * - * @return Returns the previous "restart" value. - */ - virtual int restart (int r); - - /// Set position of the owner thread. - /** - * @note This is currently a no-op. - */ - virtual void requeue_position (int); - - /// Get position of the owner thread. - /** - * @note This is currently a no-op. - */ - virtual int requeue_position (void); - - /** - * @name Low-level wait_set mask manipulation methods - * - * Low-level methods to manipulate the event/reactor mask associated - * with a handle and event handler when polling for events. - * @par - * The "interest set," i.e. the wait set, can be directly - * manipulated with these methods. - */ - //@{ - - /// GET/SET/ADD/CLR the dispatch mask "bit" bound with the - /// event_handler and mask. - /** - * @return Old mask on success, -1 on error. - */ - virtual int mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops); - - /// GET/SET/ADD/CLR the dispatch MASK "bit" bound with the handle - /// and mask. - /** - * @return Old mask on success, -1 on error. - */ - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - - //@} - - /** - * @name Low-level ready_set mask manipulation methods - * - * These methods are unimplemented. - */ - //@{ - - /// GET/SET/ADD/CLR the ready "bit" bound with the event_handler - /// and mask. - virtual int ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops); - - /// GET/SET/ADD/CLR the ready "bit" bound with the handle and mask. - virtual int ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask, - int ops); - - //@} - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - class Token_Guard; - - /// Non-locking version of wait_pending(). - /** - * Returns non-zero if there are I/O events "ready" for dispatching, - * but does not actually dispatch the event handlers. By default, - * don't block while checking this, i.e., "poll". - * - * @note It is only possible to achieve millisecond timeout - * resolutions with the ACE_Dev_Poll_Reactor. - */ - int work_pending_i (ACE_Time_Value *max_wait_time); - - /// Poll for events and return the number of event handlers that - /// were dispatched. - /** - * This is a helper method called by all handle_events() methods. - */ - int handle_events_i (ACE_Time_Value *max_wait_time, Token_Guard &guard); - - /// Perform the upcall with the given event handler method. - int upcall (ACE_Event_Handler *event_handler, - int (ACE_Event_Handler::*callback)(ACE_HANDLE), - ACE_HANDLE handle); - - /** - * Dispatch ACE_Event_Handlers for time events, I/O events, and - * signal events. Returns the total number of ACE_Event_Handlers - * that were dispatched or -1 if something goes wrong. - */ - int dispatch (Token_Guard &guard); - - /// Dispatch a single timer, if ready. - /// Returns: 0 if no timers ready (token still held), - /// 1 if a timer was expired (token released), - /// -1 on error (token still held). - int dispatch_timer_handler (Token_Guard &guard); - - /// Dispatch an IO event to the corresponding event handler. Returns - /// Returns: 0 if no events ready (token still held), - /// 1 if an event was expired (token released), - /// -1 on error (token still held). - int dispatch_io_event (Token_Guard &guard); - - /// Register the given event handler with the reactor. - int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - - /// Remove the event handler associated with the given handle and - /// event mask from the "interest set." - int remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask); - - /// Temporarily remove the given handle from the "interest set." - int suspend_handler_i (ACE_HANDLE handle); - - /// Place the given handle that was temporarily removed from the - /// "interest set," i.e that was suspended, back in to the interest - /// set. The given handle will once again be polled for events. - int resume_handler_i (ACE_HANDLE handle); - - /// GET/SET/ADD/CLR the dispatch MASK "bit" bound with the handle - /// and mask. This internal helper method acquires no lock. - /** - * @return Old mask on success, -1 on error. - */ - int mask_ops_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - - /// Convert a reactor mask to its corresponding poll() event mask. - short reactor_mask_to_poll_event (ACE_Reactor_Mask mask); - -protected: - - /// Has the reactor been initialized. - bool initialized_; - - /// The file descriptor associated with the open `/dev/poll' or - /// `/dev/epoll' device. - /** - * All interactions with the `/dev/poll' or `/dev/epoll' device are - * done through this file descriptor. - */ - ACE_HANDLE poll_fd_; - - /// The maximum number of file descriptors over which demultiplexing - /// will occur. - size_t size_; - - /// Track HANDLES we are interested in for various events that must - /// be dispatched *without* polling. - /// ACE_Dev_Poll_Ready_Set ready_set_; - -#if defined (ACE_HAS_EVENT_POLL) - /// Table of event structures to be filled by epoll_wait: - struct epoll_event *events_; - - /// Pointer to the next epoll_event array element that contains the next - /// event to be dispatched. - struct epoll_event *start_pevents_; - - /// The last element in the event array plus one. - /** - * The loop that dispatches IO events stops when this->start_pevents_ == - * this->end_pevents_. - */ - struct epoll_event *end_pevents_; - -#else - /// The pollfd array that `/dev/poll' will feed its results to. - struct pollfd *dp_fds_; - - /// Pointer to the next pollfd array element that contains the next - /// event to be dispatched. - struct pollfd *start_pfds_; - - /// The last element in the pollfd array plus one. - /** - * The loop that dispatches IO events stops when this->start_pfds == - * this->end_pfds_. - */ - struct pollfd *end_pfds_; -#endif /* ACE_HAS_EVENT_POLL */ - - /// This flag is used to keep track of whether we are actively handling - /// events or not. - sig_atomic_t deactivated_; - - /// Lock used for synchronization of reactor state. - ACE_Dev_Poll_Reactor_Token token_; - - /// Adapter used to return internal lock to outside world. - ACE_Lock_Adapter lock_adapter_; - - /// The repository that contains all registered event handlers. - ACE_Dev_Poll_Reactor_Handler_Repository handler_rep_; - - /// Defined as a pointer to allow overriding by derived classes... - ACE_Timer_Queue *timer_queue_; - - /// Keeps track of whether we should delete the timer queue (if we - /// didn't create it, then we don't delete it). - bool delete_timer_queue_; - - /// Handle signals without requiring global/static variables. - ACE_Sig_Handler *signal_handler_; - - /// Keeps track of whether we should delete the signal handler (if we - /// didn't create it, then we don't delete it). - bool delete_signal_handler_; - - /// Callback object that unblocks the if it's - /// sleeping. - ACE_Reactor_Notify *notify_handler_; - - /// Keeps track of whether we need to delete the notify handler (if - /// we didn't create it, then we don't delete it). - bool delete_notify_handler_; - - /// Flag that determines if signals are masked during event - /// dispatching. - /** - * If 0 then the Reactor will not mask the signals during the event - * dispatching. This is useful for applications that do not - * register any signal handlers and want to reduce the overhead - * introduce by the kernel level locks required to change the mask. - */ - int mask_signals_; - - /// Restart the handle_events event loop method automatically when - /// polling function in use (ioctl() in this case) is interrupted - /// via an EINTR signal. - int restart_; - -protected: - - /** - * @class Token_Guard - * - * @brief A helper class that helps grabbing, releasing and waiting - * on tokens for a thread that needs access to the reactor's token. - */ - class ACE_Export Token_Guard - { - public: - - /// Constructor that will grab the token for us - Token_Guard (ACE_Dev_Poll_Reactor_Token &token); - - /// Destructor. This will release the token if it hasn't been - /// released till this point - ~Token_Guard (void); - - /// Release the token .. - void release_token (void); - - /// Returns whether the thread that created this object owns the - /// token or not. - int is_owner (void); - - /// A helper method that acquires the token 1) at a low priority, and - /// 2) wait quietly for the token, not waking another thread. This - /// is appropriate for cases where a thread wants to wait for and - /// dispatch an event, not causing an existing waiter to relinquish the - /// token, and also queueing up behind other threads waiting to modify - /// event records. - int acquire_quietly (ACE_Time_Value *max_wait = 0); - - /// A helper method that acquires the token at a high priority, and - /// does wake the current token holder. - int acquire (ACE_Time_Value *max_wait = 0); - - private: - - Token_Guard (void); - - private: - - /// The Reactor token. - ACE_Dev_Poll_Reactor_Token &token_; - - /// Flag that indicate whether the thread that created this object - /// owns the token or not. A value of 0 indicates that this class - /// hasn't got the token (and hence the thread) and a value of 1 - /// vice-versa. - int owner_; - - }; - -}; - -/** - * @class ACE_Dev_Poll_Handler_Guard - * - * @brief Class used to make event handler reference count - * manipulation exception-safe. - * - * This class makes the reference count manipulation that occurs - * during an upcall exception-safe. Prior to dispatching the event - * handler, the reference count is increased. Once the upcall for the - * given event handler is complete, its reference count will be decreased. - */ -class ACE_Dev_Poll_Handler_Guard -{ -public: - - /// Constructor - /** - * The constructor checks to see if @a eh is a reference-counted handler and - * remember that for later. If @a eh is reference counted, its reference - * count is incremented unless @a do_incr is false. - * @a do_incr should be false if the reference count was incremented - * independently of this guard, for example, on a notify handler since - * the reference count is incremented when the notify is queued. - */ - ACE_Dev_Poll_Handler_Guard (ACE_Event_Handler *eh, bool do_incr = true); - - /// Destructor - /** - * The destructor decrements the reference count on the event - * handler corresponding to the given handle. - */ - ~ACE_Dev_Poll_Handler_Guard (void); - - /// Release the event handler from this guard; when the destructor is - /// called, the handler's reference count will not be decremented. - void release (void); - -private: - - /// The event handler being managed. - ACE_Event_Handler *eh_; - - /// true if eh_ is a reference-counted handler. - bool refcounted_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/Dev_Poll_Reactor.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */ - -#include /**/ "ace/post.h" - -#endif /* ACE_DEV_POLL_REACTOR_H */ - diff --git a/dep/include/ace/Dev_Poll_Reactor.inl b/dep/include/ace/Dev_Poll_Reactor.inl deleted file mode 100644 index 98761f63220..00000000000 --- a/dep/include/ace/Dev_Poll_Reactor.inl +++ /dev/null @@ -1,227 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dev_Poll_Reactor.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Dev_Poll_Event_Tuple::ACE_Dev_Poll_Event_Tuple (void) - : event_handler (0), - mask (ACE_Event_Handler::NULL_MASK), - suspended (0) -{ -} - -// --------------------------------------------------------------------- - -#if 0 -ACE_INLINE -ACE_Dev_Poll_Ready_Set::ACE_Dev_Poll_Ready_Set (void) - : pfds (0), - nfds (0) -{ -} -#endif /* 0 */ - -// --------------------------------------------------------------------- - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::mask"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].mask = mask; -} - -ACE_INLINE ACE_Reactor_Mask -ACE_Dev_Poll_Reactor_Handler_Repository::mask (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::mask"); - - ACE_Reactor_Mask mask = ACE_Event_Handler::NULL_MASK; - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - mask = this->handlers_[handle].mask; - - if (mask == ACE_Event_Handler::NULL_MASK) - errno = ENOENT; - - return mask; -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::suspend (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::suspend"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].suspended = 1; -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::resume (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::resume"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].suspended = 0; -} - -ACE_INLINE int -ACE_Dev_Poll_Reactor_Handler_Repository::suspended (ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::suspended"); - - if (this->handle_in_range (handle)) - return this->handlers_[handle].suspended; - - return -1; -} - -ACE_INLINE size_t -ACE_Dev_Poll_Reactor_Handler_Repository::size (void) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::size"); - - return this->max_size_; -} - -// ----------------------------------------------------------------- - -ACE_INLINE -ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard - (ACE_Event_Handler *eh, - bool do_incr) - : eh_ (eh), - refcounted_ (false) -{ - if (eh == 0) - return; - - this->refcounted_ = - eh->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - - if (do_incr && this->refcounted_) - eh->add_reference (); - - /** - * The below comments were here when I replaced the old refcount - * scheme was replaced. They may still need addressing. -Steve Huston - */ - - /** - * @todo Suspend the handler so that other threads will not cause - * an event that is already in an upcall from being dispatched - * again. - * - * @note The naive approach would be to simply call - * suspend_handler_i() on the reactor. However, that would - * cause a system call (write()) to occur. Obviously this - * can potentially have an adverse affect on performance. - * Ideally, the handler would only be marked as "suspended" in - * the handler repository. If an event arrives for a - * suspended handler that event can be "queued" in a - * "handle readiness queue." "Queued" is quoted since a real - * queue need not be used since duplicate events can be - * coalesced, thus avoiding unbounded queue growth. Event - * coalescing is already done by Linux's event poll driver - * (/dev/epoll) so Solaris' poll driver (/dev/poll) is the - * main concern here. The largest the queue can be is the - * same size as the number of handlers stored in the handler - * repository. - */ -} - -ACE_INLINE -ACE_Dev_Poll_Handler_Guard::~ACE_Dev_Poll_Handler_Guard (void) -{ - if (this->refcounted_ && this->eh_ != 0) - this->eh_->remove_reference (); - - /** - * The below comments were here when I replaced the old refcount - * scheme was replaced. They may still need addressing. -Steve Huston - */ - /** - * @todo Resume the handler so that other threads will be allowed to - * dispatch the handler. - */ -} - -ACE_INLINE void -ACE_Dev_Poll_Handler_Guard::release (void) -{ - this->eh_ = 0; -} - -// --------------------------------------------------------------------- - -ACE_INLINE int -ACE_Dev_Poll_Reactor::upcall (ACE_Event_Handler *event_handler, - int (ACE_Event_Handler::*callback)(ACE_HANDLE), - ACE_HANDLE handle) -{ - // If the handler returns positive value (requesting a reactor - // callback) just call back as many times as the handler requests - // it. Other threads are off handling other things. - int status = 0; - - do - { - status = (event_handler->*callback) (handle); - } - while (status > 0); - - return status; -} - -/************************************************************************/ -// Methods for ACE_Dev_Poll_Reactor::Token_Guard -/************************************************************************/ - -ACE_INLINE -ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token) - - : token_ (token), - owner_ (0) -{ -} - -ACE_INLINE -ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void) -{ - if (this->owner_ == 1) - { - ACE_MT (this->token_.release ()); - this->owner_ = 0; - } -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor::Token_Guard::release_token (void) -{ - if (this->owner_) - { - ACE_MT (this->token_.release ()); - - // We are not the owner anymore.. - this->owner_ = 0; - } -} - -ACE_INLINE int -ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void) -{ - return this->owner_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dirent.h b/dep/include/ace/Dirent.h deleted file mode 100644 index 036a942c611..00000000000 --- a/dep/include/ace/Dirent.h +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dirent.h - * - * $Id: Dirent.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Define a portable C++ interface to ACE_OS_Dirent directory-entry - * manipulation. - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_DIRENT_H -#define ACE_DIRENT_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_dirent.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dirent - * - * @brief Define a portable C++ directory-entry iterator based on the POSIX API. - */ -class ACE_Export ACE_Dirent -{ -public: - // = Initialization and termination methods. - /// Default constructor. - ACE_Dirent (void); - - /// Constructor calls - explicit ACE_Dirent (const ACE_TCHAR *dirname); - - /// Opens the directory named by filename and associates a directory - /// stream with it. - int open (const ACE_TCHAR *filename); - - /// Destructor calls . - ~ACE_Dirent (void); - - /// Closes the directory stream and frees the structure. - void close (void); - - // = Iterator methods. - /** - * Returns a pointer to a structure representing the directory entry - * at the current position in the directory stream to which dirp - * refers, and positions the directory stream at the next entry, - * except on read-only filesystems. It returns a NULL pointer upon - * reaching the end of the directory stream, or upon detecting an - * invalid location in the directory. shall not return - * directory entries containing empty names. It is unspecified - * whether entries are returned for dot or dot-dot. The pointer - * returned by points to data that may be overwritten by - * another call to on the same directory stream. This - * data shall not be overwritten by another call to on a - * different directory stream. may buffer several - * directory entries per actual read operation; marks for - * update the st_atime field of the directory each time the - * directory is actually read. - */ - ACE_DIRENT *read (void); - - /** - * Has the equivalent functionality as except that an - * @a entry and @a result buffer must be supplied by the caller to - * store the result. - */ - int read (struct ACE_DIRENT *entry, - struct ACE_DIRENT **result); - - // = Manipulators. - /// Returns the current location associated with the directory - /// stream. - long tell (void); - - /** - * Sets the position of the next operation on the - * directory stream. The new position reverts to the position - * associated with the directory stream at the time the - * operation that provides loc was performed. Values returned by - * are good only for the lifetime of the pointer from - * which they are derived. If the directory is closed and then - * reopened, the value may be invalidated due to - * undetected directory compaction. It is safe to use a previous - * value immediately after a call to and before - * any calls to readdir. - */ - void seek (long loc); - - /** - * Resets the position of the directory stream to the beginning of - * the directory. It also causes the directory stream to refer to - * the current state of the corresponding directory, as a call to - * would. - */ - void rewind (void); - -private: - /// Pointer to the directory stream. - ACE_DIR *dirp_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Dirent.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DIRENT_H */ - diff --git a/dep/include/ace/Dirent.inl b/dep/include/ace/Dirent.inl deleted file mode 100644 index 01ce3a96c4b..00000000000 --- a/dep/include/ace/Dirent.inl +++ /dev/null @@ -1,99 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dirent.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_Dirent::open (const ACE_TCHAR *dirname) -{ - // If the directory stream is already open, close it to prevent - // possible resource leaks. - - if (this->dirp_ != 0) - { - ACE_OS::closedir (this->dirp_); - this->dirp_ = 0; - } - - this->dirp_ = ACE_OS::opendir (dirname); - - if (this->dirp_ == 0) - return -1; - else - return 0; -} - -ACE_INLINE -ACE_Dirent::ACE_Dirent (void) - : dirp_ (0) -{ -} - -ACE_INLINE -ACE_Dirent::ACE_Dirent (const ACE_TCHAR *dirname) - : dirp_ (0) -{ - if (this->open (dirname) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Dirent::ACE_Dirent"))); -} - -ACE_INLINE -ACE_Dirent::~ACE_Dirent (void) -{ - if (this->dirp_ != 0) - ACE_OS::closedir (this->dirp_); -} - -ACE_INLINE ACE_DIRENT * -ACE_Dirent::read (void) -{ - return this->dirp_ ? ACE_OS::readdir (this->dirp_) : 0; -} - -ACE_INLINE int -ACE_Dirent::read (struct ACE_DIRENT *entry, - struct ACE_DIRENT **result) -{ - return this->dirp_ - ? ACE_OS::readdir_r (this->dirp_, entry, result) - : 0; -} - -ACE_INLINE void -ACE_Dirent::close (void) -{ - if (this->dirp_ != 0) - { - ACE_OS::closedir (this->dirp_); - - // Prevent double closure - this->dirp_ = 0; - } -} - -ACE_INLINE void -ACE_Dirent::rewind (void) -{ - if (this->dirp_) - ACE_OS::rewinddir (this->dirp_); -} - -ACE_INLINE void -ACE_Dirent::seek (long loc) -{ - if (this->dirp_) - ACE_OS::seekdir (this->dirp_, loc); -} - -ACE_INLINE long -ACE_Dirent::tell (void) -{ - return this->dirp_ ? ACE_OS::telldir (this->dirp_) : 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dirent_Selector.h b/dep/include/ace/Dirent_Selector.h deleted file mode 100644 index 3356f18723d..00000000000 --- a/dep/include/ace/Dirent_Selector.h +++ /dev/null @@ -1,76 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dirent_Selector.h - * - * $Id: Dirent_Selector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Define a portable C++ interface to the method. - * - * @author Rich Newman - */ -//============================================================================= - -#ifndef ACE_DIRENT_SELECTOR_H -#define ACE_DIRENT_SELECTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_dirent.h" /* Need ACE_SCANDIR_SELECTOR, COMPARATOR */ -#include "ace/os_include/os_dirent.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dirent_Selector - * - * @brief Define a portable C++ directory-entry iterator based on the - * POSIX scandir API. - */ -class ACE_Export ACE_Dirent_Selector -{ -public: - /// Constructor - ACE_Dirent_Selector (void); - - /// Destructor. - virtual ~ACE_Dirent_Selector (void); - - /// Return the length of the list of matching directory entries. - int length (void) const; - - /// Return the entry at @a index. - ACE_DIRENT *operator[] (const int index) const; - - /// Free up resources. - int close (void); - - /// Open the directory @a dir and populate the current list of names with - /// directory entries that match the @a selector and @a comparator. - int open (const ACE_TCHAR *dir, - ACE_SCANDIR_SELECTOR selector = 0, - ACE_SCANDIR_COMPARATOR comparator = 0); - -protected: - /// Ptr to the namelist array. - ACE_DIRENT **namelist_; - - /// Number of entries in the array. - int n_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Dirent_Selector.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DIRENT_SELECTOR_H */ - diff --git a/dep/include/ace/Dirent_Selector.inl b/dep/include/ace/Dirent_Selector.inl deleted file mode 100644 index 15f804704bf..00000000000 --- a/dep/include/ace/Dirent_Selector.inl +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dirent_Selector.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_Dirent_Selector::length (void) const -{ - return n_; -} - -ACE_INLINE ACE_DIRENT * -ACE_Dirent_Selector::operator[] (const int n) const -{ - return this->namelist_[n]; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dump.h b/dep/include/ace/Dump.h deleted file mode 100644 index d94a740bce7..00000000000 --- a/dep/include/ace/Dump.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Dump.h - * - * $Id: Dump.h 80826 2008-03-04 14:51:23Z wotte $ - * - * - * A prototype mechanism that allow all ACE objects to be registered - * with a central in-memory "database" that can dump the state of all - * live ACE objects (e.g., from within a debugger). - * - * The macros which allow easy registration and removal of objects to be - * dumped (ACE_REGISTER_OBJECT and ACE_REMOVE_OBJECT) are turned into - * no-ops by compiling with the ACE_NDEBUG macro defined. This allows - * usage to be removed in "release mode" builds without changing code. - * - * There are several interesting aspects to this design: - * - * 1. It uses the External Polymorphism pattern to avoid having to - * derive all ACE classes from a common base class that has virtual - * methods (this is crucial to avoid unnecessary overhead). In - * addition, there is no additional space added to ACE objects - * (this is crucial to maintain binary layout compatibility). - * - * 2. This mechanism can be conditionally compiled in order to - * completely disable this feature entirely. Moreover, by - * using macros there are relatively few changes to ACE code. - * - * 3. This mechanism copes with single-inheritance hierarchies of - * dumpable classes. In such cases we typically want only one - * dump, corresponding to the most derived instance. Thanks to - * Christian Millour (chris@etca.fr) for illustrating how to do - * this. Note, however, that this scheme doesn't generalize to - * work with multiple-inheritance or virtual base classes. - * - * Future work includes: - * - * 1. Using a dynamic object table rather than a static table - * - * 2. Adding support to allow particular classes of objects to - * be selectively dumped. - * - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_DUMP_H -#define ACE_DUMP_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dumpable - * - * @brief Base class that defines a uniform interface for all object - * dumping. - */ -class ACE_Export ACE_Dumpable -{ -public: - friend class ACE_ODB; - friend class ACE_Dumpable_Ptr; - - /// Constructor. - ACE_Dumpable (const void *); - - /// This pure virtual method must be filled in by a subclass. - virtual void dump (void) const = 0; - -protected: - virtual ~ACE_Dumpable (void); - -private: - /// Pointer to the object that is being stored. - const void *this_; -}; - -/** - * @class ACE_Dumpable_Ptr - * - * @brief A smart pointer stored in the in-memory object database - * ACE_ODB. The pointee (if any) is deleted when reassigned. - */ -class ACE_Export ACE_Dumpable_Ptr -{ -public: - ACE_Dumpable_Ptr (const ACE_Dumpable *dumper = 0); - const ACE_Dumpable *operator->() const; - void operator= (const ACE_Dumpable *dumper) const; - -private: - /// "Real" pointer to the underlying abstract base class - /// pointer that does the real work. - const ACE_Dumpable *dumper_; -}; - -/** - * @class ACE_ODB - * - * @brief This is the object database (ODB) that keeps track of all - * live ACE objects. - */ -class ACE_Export ACE_ODB -{ -public: - /// @todo This is clearly inadequate and should be dynamic... - enum {MAX_TABLE_SIZE = 100000}; - - /// Iterates through the entire set of registered objects and - /// dumps their state. - void dump_objects (void); - - /// Add the tuple to the list of registered ACE objects. - void register_object (const ACE_Dumpable *dumper); - - /// Use to locate and remove the associated from the - /// list of registered ACE objects. - void remove_object (const void *this_); - - /// Interface to the Singleton instance of the object database. - static ACE_ODB *instance (void); - -private: - ACE_ODB (void); // Ensure we have a Singleton... - - struct Tuple - { - /// Pointer to the object that is registered. - const void *this_; - - /// Smart pointer to the ACE_Dumpable object associated with this_. - /// This uses an ACE_Dumpable_Ptr, instead of a bare pointer, to - /// cope with hierarchies of dumpable classes. In such cases we - /// typically want only one dump, corresponding to the most derived - /// instance. To achieve this, the handle registered for the - /// subobject corresponding to the base class is destroyed (hence - /// on destruction of the subobject its handle won't exist anymore - /// and we'll have to check for that). - const ACE_Dumpable_Ptr dumper_; - - Tuple (void) : dumper_(0) {} - }; - - /// Singleton instance of this class. - static ACE_ODB *instance_; - - /// The current implementation is very simple-minded and will be - /// changed to be dynamic. - Tuple object_table_[ACE_ODB::MAX_TABLE_SIZE]; - - /// Current size of . - int current_size_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -// Include the templates classes at this point. -#include "ace/Dump_T.h" - -#include /**/ "ace/post.h" -#endif /* ACE_DUMP_H */ - diff --git a/dep/include/ace/Dump_T.h b/dep/include/ace/Dump_T.h deleted file mode 100644 index fe18af0cdcf..00000000000 --- a/dep/include/ace/Dump_T.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dump_T.h - * - * $Id: Dump_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_DUMP_T_H -#define ACE_DUMP_T_H -#include /**/ "ace/pre.h" - -#include "ace/Dump.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dumpable_Adapter - * - * @brief This class inherits the interface of the abstract ACE_Dumpable - * class and is instantiated with the implementation of the - * concrete component class . - * - * This design is similar to the Adapter and Decorator patterns - * from the ``Gang of Four'' book. Note that - * need not inherit from a common class since ACE_Dumpable - * provides the uniform virtual interface! - */ -template -class ACE_Dumpable_Adapter : public ACE_Dumpable -{ -public: - // = Initialization and termination methods. - ACE_Dumpable_Adapter (const Concrete *t); - ~ACE_Dumpable_Adapter (void); - - /// Concrete dump method (simply delegates to the method of - /// ). - virtual void dump (void) const; - - /// Delegate to methods in the Concrete class. - Concrete *operator->() const; - -private: - /// Pointer to @c this of . - const Concrete *this_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -// Some useful macros for conditionally compiling this feature... -#if defined (ACE_NDEBUG) -#define ACE_REGISTER_OBJECT(CLASS) -#define ACE_REMOVE_OBJECT -#else -#define ACE_REGISTER_OBJECT(CLASS) \ - ACE_ODB::instance ()->register_object \ - (new ACE_Dumpable_Adapter (this)); -#define ACE_REMOVE_OBJECT \ - ACE_ODB::instance ()->remove_object \ - ((void *) this); -#endif /* ACE_NDEBUG */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Dump_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Dump_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_DUMP_T_H */ - diff --git a/dep/include/ace/Dynamic.h b/dep/include/ace/Dynamic.h deleted file mode 100644 index 6906ebf1267..00000000000 --- a/dep/include/ace/Dynamic.h +++ /dev/null @@ -1,76 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Dynamic.h - * - * $Id: Dynamic.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - * @author Irfan Pyarali. - */ -//========================================================================== - -#ifndef ACE_DYNAMIC_H -#define ACE_DYNAMIC_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dynamic - * - * @brief Checks to see if an object was dynamically allocated. - * - * This class holds the pointer in a thread-safe manner between - * the call to operator new and the call to the constructor. - */ -class ACE_Export ACE_Dynamic -{ -public: - // = Initialization and termination method. - /// Constructor. - ACE_Dynamic (void); - - /// Destructor. - ~ACE_Dynamic (void); - - /** - * Sets a flag that indicates that the object was dynamically - * created. This method is usually called in operator new and then - * checked and reset in the constructor. - */ - void set (void); - - /// @c true if we were allocated dynamically, else @c false. - bool is_dynamic (void); - - /// Resets state flag. - void reset (void); - - static ACE_Dynamic *instance (void); - -private: - /** - * Flag that indicates that the object was dynamically created. This - * method is usually called in operator new and then checked and - * reset in the constructor. - */ - bool is_dynamic_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Dynamic.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_DYNAMIC_H */ - diff --git a/dep/include/ace/Dynamic.inl b/dep/include/ace/Dynamic.inl deleted file mode 100644 index 1e8e968f898..00000000000 --- a/dep/include/ace/Dynamic.inl +++ /dev/null @@ -1,34 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dynamic.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Dynamic::~ACE_Dynamic (void) -{ - // ACE_TRACE ("ACE_Dynamic::~ACE_Dynamic"); -} - -ACE_INLINE void -ACE_Dynamic::set (void) -{ - // ACE_TRACE ("ACE_Dynamic::set"); - this->is_dynamic_ = true; -} - -ACE_INLINE bool -ACE_Dynamic::is_dynamic (void) -{ - // ACE_TRACE ("ACE_Dynamic::is_dynamic"); - return this->is_dynamic_; -} - -ACE_INLINE void -ACE_Dynamic::reset (void) -{ - // ACE_TRACE ("ACE_Dynamic::reset"); - this->is_dynamic_ = false; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dynamic_Message_Strategy.h b/dep/include/ace/Dynamic_Message_Strategy.h deleted file mode 100644 index db6a51bb70e..00000000000 --- a/dep/include/ace/Dynamic_Message_Strategy.h +++ /dev/null @@ -1,218 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Dynamic_Message_Strategy.h - * - * $Id: Dynamic_Message_Strategy.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_DYNAMIC_MESSAGE_STRATEGY_H -#define ACE_DYNAMIC_MESSAGE_STRATEGY_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Message_Block.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dynamic_Message_Strategy - * - * @brief An abstract base class which provides dynamic priority - * evaluation methods for use by the ACE_Dynamic_Message_Queue - * class or any other class which needs to manage the priorities - * of a collection of ACE_Message_Blocks dynamically. - * - * Methods for deadline and laxity based priority evaluation are - * provided. These methods assume a specific partitioning of - * the message priority number into a higher order dynamic bit - * field and a lower order static priority bit field. The - * default partitioning assumes an unsigned dynamic message - * priority field of 22 bits and an unsigned static message - * priority field of 10 bits. This corresponds to the initial - * values of the static class members. To provide a different - * partitioning, assign a different set of values to the static - * class memebers before using the static member functions. - */ -class ACE_Export ACE_Dynamic_Message_Strategy -{ -public: - - // = Message priority status - - // Values are defined as bit flags so that status combinations may - // be specified easily. - - enum Priority_Status - { - /// Message can still make its deadline - PENDING = 0x01, - /// Message cannot make its deadline - LATE = 0x02, - /// Message is so late its priority is undefined - BEYOND_LATE = 0x04, - /// Mask to match any priority status - ANY_STATUS = 0x07 - }; - - /// Constructor. - ACE_Dynamic_Message_Strategy (unsigned long static_bit_field_mask, - unsigned long static_bit_field_shift, - unsigned long dynamic_priority_max, - unsigned long dynamic_priority_offset); - - /// Virtual destructor. - virtual ~ACE_Dynamic_Message_Strategy (void); - - /// Updates the message's priority and returns its priority status. - Priority_Status priority_status (ACE_Message_Block &mb, - const ACE_Time_Value &tv); - - /// Get static bit field mask. - unsigned long static_bit_field_mask (void) const; - - /// Set static bit field mask. - void static_bit_field_mask (unsigned long); - - /// Get left shift value to make room for static bit field. - unsigned long static_bit_field_shift (void) const; - - /// Set left shift value to make room for static bit field. - void static_bit_field_shift (unsigned long); - - /// Get maximum supported priority value. - unsigned long dynamic_priority_max (void) const; - - /// Set maximum supported priority value. - void dynamic_priority_max (unsigned long); - - /// Get offset to boundary between signed range and unsigned range. - unsigned long dynamic_priority_offset (void) const; - - /// Set offset to boundary between signed range and unsigned range. - void dynamic_priority_offset (unsigned long); - - /// Dump the state of the strategy. - virtual void dump (void) const; - -protected: - /// Hook method for dynamic priority conversion. - virtual void convert_priority (ACE_Time_Value &priority, - const ACE_Message_Block &mb) = 0; - - /// This is a bit mask with all ones in the static bit field. - unsigned long static_bit_field_mask_; - - /** - * This is a left shift value to make room for static bit field: - * this value should be the logarithm base 2 of - * (static_bit_field_mask_ + 1). - */ - unsigned long static_bit_field_shift_; - - /// Maximum supported priority value. - unsigned long dynamic_priority_max_; - - /// Offset to boundary between signed range and unsigned range. - unsigned long dynamic_priority_offset_; - - /// Maximum late time value that can be represented. - ACE_Time_Value max_late_; - - /// Minimum pending time value that can be represented. - ACE_Time_Value min_pending_; - - /// Time value by which to shift pending priority. - ACE_Time_Value pending_shift_; -}; - -/** - * @class ACE_Deadline_Message_Strategy - * - * @brief Deadline based message priority strategy. - * - * Assigns dynamic message priority according to time to deadline. The - * message priority is divided into high and low order bit fields. The - * high order bit field is used for dynamic message priority, which is - * updated whenever the convert_priority() method is called. The - * low order bit field is used for static message priority and is left - * unchanged. The partitioning of the priority value into high and low - * order bit fields is done according to the arguments passed to the - * strategy object's constructor. - */ -class ACE_Export ACE_Deadline_Message_Strategy : public ACE_Dynamic_Message_Strategy -{ -public: - /// Ctor, with all arguments defaulted. - ACE_Deadline_Message_Strategy (unsigned long static_bit_field_mask = 0x3FFUL, // 2^(10) - 1 - unsigned long static_bit_field_shift = 10, // 10 low order bits - unsigned long dynamic_priority_max = 0x3FFFFFUL, // 2^(22)-1 - unsigned long dynamic_priority_offset = 0x200000UL); // 2^(22-1) - - /// Virtual dtor. - virtual ~ACE_Deadline_Message_Strategy (void); - - /// Dynamic priority conversion function based on time to deadline. - virtual void convert_priority (ACE_Time_Value &priority, - const ACE_Message_Block &mb); - - /// Dump the state of the strategy. - virtual void dump (void) const; -}; - -/** - * @class ACE_Laxity_Message_Strategy - * - * @brief Laxity based message priority strategy. - * - * Assigns dynamic message priority according to laxity (time to - * deadline minus worst case execution time). The message priority is - * divided into high and low order bit fields. The high order - * bit field is used for dynamic message priority, which is - * updated whenever the convert_priority() method is called. The - * low order bit field is used for static message priority and is left - * unchanged. The partitioning of the priority value into high and low - * order bit fields is done according to the arguments passed to the - * strategy object's constructor. - */ -class ACE_Export ACE_Laxity_Message_Strategy : public ACE_Dynamic_Message_Strategy -{ -public: - /// Ctor, with all arguments defaulted. - ACE_Laxity_Message_Strategy (unsigned long static_bit_field_mask = 0x3FFUL, // 2^(10) - 1 - unsigned long static_bit_field_shift = 10, // 10 low order bits - unsigned long dynamic_priority_max = 0x3FFFFFUL, // 2^(22)-1 - unsigned long dynamic_priority_offset = 0x200000UL); // 2^(22-1) - - /// virtual dtor. - virtual ~ACE_Laxity_Message_Strategy (void); - - /// Dynamic priority conversion function based on laxity. - virtual void convert_priority (ACE_Time_Value &priority, - const ACE_Message_Block &mb); - - /// Dump the state of the strategy. - virtual void dump (void) const; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Dynamic_Message_Strategy.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_DYNAMIC_MESSAGE_STRATEGY_H */ - diff --git a/dep/include/ace/Dynamic_Message_Strategy.inl b/dep/include/ace/Dynamic_Message_Strategy.inl deleted file mode 100644 index 9742a07fd88..00000000000 --- a/dep/include/ace/Dynamic_Message_Strategy.inl +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dynamic_Message_Strategy.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE unsigned long -ACE_Dynamic_Message_Strategy::static_bit_field_mask (void) const -{ - return static_bit_field_mask_; -} - // get static bit field mask - -ACE_INLINE void -ACE_Dynamic_Message_Strategy::static_bit_field_mask (unsigned long ul) -{ - static_bit_field_mask_ = ul; -} - // set static bit field mask - -ACE_INLINE unsigned long -ACE_Dynamic_Message_Strategy::static_bit_field_shift (void) const -{ - return static_bit_field_shift_; -} - // get left shift value to make room for static bit field - -ACE_INLINE void -ACE_Dynamic_Message_Strategy::static_bit_field_shift (unsigned long ul) -{ - static_bit_field_shift_ = ul; -} - // set left shift value to make room for static bit field - -ACE_INLINE unsigned long -ACE_Dynamic_Message_Strategy::dynamic_priority_max (void) const -{ - return dynamic_priority_max_; -} - // get maximum supported priority value - -ACE_INLINE void -ACE_Dynamic_Message_Strategy::dynamic_priority_max (unsigned long ul) -{ - // pending_shift_ depends on dynamic_priority_max_: for performance - // reasons, the value in pending_shift_ is (re)calculated only when - // dynamic_priority_max_ is initialized or changes, and is stored - // as a class member rather than being a derived value. - dynamic_priority_max_ = ul; - pending_shift_ = ACE_Time_Value (0, ul); -} - // set maximum supported priority value - -ACE_INLINE unsigned long -ACE_Dynamic_Message_Strategy::dynamic_priority_offset (void) const -{ - return dynamic_priority_offset_; -} - // get offset for boundary between signed range and unsigned range - -ACE_INLINE void -ACE_Dynamic_Message_Strategy::dynamic_priority_offset (unsigned long ul) -{ - // max_late_ and min_pending_ depend on dynamic_priority_offset_: - // for performance reasons, the values in max_late_ and min_pending_ - // are (re)calculated only when dynamic_priority_offset_ is - // initialized or changes, and are stored as a class member rather - // than being derived each time one of their values is needed. - dynamic_priority_offset_ = ul; - max_late_ = ACE_Time_Value (0, ul - 1); - min_pending_ = ACE_Time_Value (0, ul); -} - // set offset for boundary between signed range and unsigned range - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dynamic_Service.h b/dep/include/ace/Dynamic_Service.h deleted file mode 100644 index fb2469c5418..00000000000 --- a/dep/include/ace/Dynamic_Service.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dynamic_Service.h - * - * $Id: Dynamic_Service.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Prashant Jain - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_DYNAMIC_SERVICE_H -#define ACE_DYNAMIC_SERVICE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Global_Macros.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Dynamic_Service_Base.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Service_Object; - -/** - * @class ACE_Dynamic_Service - * - * @brief Provides a general interface to retrieve arbitrary objects - * from the ACE service repository. - * - * Uses "name" for lookup in the ACE service repository. Obtains - * the object and returns it as the appropriate type. - */ -template -class ACE_Dynamic_Service : public ACE_Dynamic_Service_Base -{ -public: - /// Return instance using @a name to search the Service_Repository. - static TYPE* instance (const ACE_TCHAR *name); - static TYPE* instance (const ACE_TCHAR *name, bool no_global); - - static TYPE* instance (const ACE_Service_Gestalt* repo, - const ACE_TCHAR *name); - static TYPE* instance (const ACE_Service_Gestalt* repo, - const ACE_TCHAR *name, bool no_global); - -#if defined (ACE_USES_WCHAR) - - /// Return instance using @a name to search the Service_Repository. - static TYPE* instance (const ACE_ANTI_TCHAR *name); - - static TYPE* instance (const ACE_ANTI_TCHAR *name, bool no_global); - - static TYPE* instance (const ACE_Service_Gestalt* repo, - const ACE_ANTI_TCHAR *name); - static TYPE* instance (const ACE_Service_Gestalt* repo, - const ACE_ANTI_TCHAR *name, bool no_global); -#endif // ACE_USES_WCHAR - -private: - ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service ()) - ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service (const ACE_Dynamic_Service&)) - ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service& operator= (const ACE_Dynamic_Service&)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Dynamic_Service.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Dynamic_Service.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -# pragma implementation ("Dynamic_Service.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_DYNAMIC_SERVICE_H */ - diff --git a/dep/include/ace/Dynamic_Service.inl b/dep/include/ace/Dynamic_Service.inl deleted file mode 100644 index 31324bf535b..00000000000 --- a/dep/include/ace/Dynamic_Service.inl +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dynamic_Service.inl 81318 2008-04-10 10:12:05Z johnnyw $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_USES_WCHAR) - -template ACE_INLINE TYPE * -ACE_Dynamic_Service::instance (const ACE_ANTI_TCHAR *name) -{ - return instance (ACE_TEXT_CHAR_TO_TCHAR (name),false); -} - -template ACE_INLINE TYPE * -ACE_Dynamic_Service::instance (const ACE_ANTI_TCHAR *name, - bool no_global) -{ - return instance (ACE_TEXT_CHAR_TO_TCHAR (name),no_global); -} - -template ACE_INLINE TYPE * -ACE_Dynamic_Service::instance (const ACE_Service_Gestalt* repo, - const ACE_ANTI_TCHAR *name) -{ - return instance (repo, ACE_TEXT_CHAR_TO_TCHAR (name),false); -} - -template ACE_INLINE TYPE * -ACE_Dynamic_Service::instance (const ACE_Service_Gestalt* repo, - const ACE_ANTI_TCHAR *name, - bool no_global) -{ - return instance (repo, ACE_TEXT_CHAR_TO_TCHAR (name),no_global); -} - -#endif // ACE_USES_WCHAR - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dynamic_Service_Base.h b/dep/include/ace/Dynamic_Service_Base.h deleted file mode 100644 index 4491a9407d8..00000000000 --- a/dep/include/ace/Dynamic_Service_Base.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Dynamic_Service_Base.h - * - * $Id: Dynamic_Service_Base.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Prashant Jain - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_DYNAMIC_SERVICE_BASE_H -#define ACE_DYNAMIC_SERVICE_BASE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Service_Gestalt; -class ACE_Service_Type; - -/** - * @class ACE_Dynamic_Service_Base - * - * @brief Base class for all ACE_Dynamic_Service instantiations. - * - * Factors out common code shared by all ACE_Dynamic_Service - * instantiations, this avoid code bloat. - */ -class ACE_Export ACE_Dynamic_Service_Base -{ - -public: - /// Dump the current static of the object - void dump (void) const; - -protected: - /// Perform the default repo search, but optionally skip searching the global - /// repo. - static void* instance (const ACE_TCHAR *name, bool no_global = false); - - static void* instance (const ACE_Service_Gestalt* repo, - const ACE_TCHAR *name, - bool no_global = false); - - /// No need to create, or assign instances of this class - ACE_Dynamic_Service_Base (void); - ~ACE_Dynamic_Service_Base (void); - const ACE_Dynamic_Service_Base& operator= (const ACE_Dynamic_Service_Base&); - -private: - /// Implement the service search policy, i.e. "look for the service first - /// locally and then globally" - static const ACE_Service_Type *find_i (const ACE_Service_Gestalt* &repo, - const ACE_TCHAR *name, - bool no_global); - - /// The dependency declaration class needs access to the service search - /// policy, implemented by find_i() - friend class ACE_Dynamic_Service_Dependency; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_DYNAMIC_SERVICE_BASE_H */ - diff --git a/dep/include/ace/Dynamic_Service_Dependency.h b/dep/include/ace/Dynamic_Service_Dependency.h deleted file mode 100644 index 21e63bb9411..00000000000 --- a/dep/include/ace/Dynamic_Service_Dependency.h +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dynamic_Service_Dependency.h - * - * $Id: Dynamic_Service_Dependency.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Iliyan Jeliazkov - */ -//============================================================================= - -#ifndef ACE_DYNAMIC_SERVICE_DEPENDENCY_H -#define ACE_DYNAMIC_SERVICE_DEPENDENCY_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Dynamic_Service_Base.h" -#include "ace/Service_Object.h" -#include "ace/DLL.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Dynamic_Service_Dependency - * - * @brief Provides a way to declare dependency on specific service, - * thus helping to avoid order of initialization issues with instances - * of an objects whose implementation code resides in dynamically loaded - * services. - * - * It is disastrous to have dynamically loadable services create and give away - * ownership of objects and then ending up being unloaded before all those - * instances have been deleted. Normally the code for such objects classes - * resides within the TEXT segment of the DLL, which implements the service. - * If a service gets removed, its DLL may be unmapped from memory and then - * any attempt to invoke a method on the said objects will cause SEGV. - * - * Such instances must contain a member of ACE_Dynamic_Service_Dependency - * initialized with the service they depend on. - * ACE_Dynamic_Service_Dependency's constructor and destructor are - * "magical" - they work by maintaining the underlying dynamic service's - * DLL reference count. - */ -class ACE_Export ACE_Dynamic_Service_Dependency -{ -public: - ACE_Dynamic_Service_Dependency (const ACE_Service_Gestalt *cfg, - const ACE_TCHAR *principal); - ACE_Dynamic_Service_Dependency (const ACE_TCHAR *principal); - ~ACE_Dynamic_Service_Dependency (void); - -private: - void init (const ACE_Service_Gestalt *cfg, const ACE_TCHAR *principal); - -private: - ACE_DLL tracker_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_DYNAMIC_SERVICE_DEPENDENCY_H */ - diff --git a/dep/include/ace/Encoding_Converter.h b/dep/include/ace/Encoding_Converter.h deleted file mode 100644 index 8833d3fced8..00000000000 --- a/dep/include/ace/Encoding_Converter.h +++ /dev/null @@ -1,71 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file Encoding_Converter.h - * - * $Id: Encoding_Converter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class is the base class for all encoding converters that convert - * to and from UTF-8. - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef ACE_ENCODING_CONVERTER_H -#define ACE_ENCODING_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include "ace/Basic_Types.h" - -#if defined (ACE_USES_WCHAR) -#include /**/ "ace/ACE_export.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** The base class for all ACE UTF Encoding Converters. - * This class provides a generic interface that is used to implement - * various UTF encoding conversion classes. - */ -class ACE_Export ACE_Encoding_Converter -{ -public: - /// This enum describes the various states that can be returned - /// from the to_utf8() and from_utf8() methods which depends on - /// both the source buffer and the size of the target buffer. - enum Result {CONVERSION_OK, - SOURCE_EXHAUSTED, - TARGET_EXHAUSTED, - SOURCE_ILLEGAL - }; - - /// This destructor is here (and virtual) because we have virtual - /// functions. - virtual ~ACE_Encoding_Converter (void); - - /// Convert the source (which can be in any encoding) to UTF-8 and - /// store it in the provided target buffer. - virtual Result to_utf8 (const void* source, - size_t source_size, - ACE_Byte* target, - size_t target_size, - bool strict = true) = 0; - - /// Convert the UTF-8 source into an alternate encoding and store it - /// in the provided target buffer. - virtual Result from_utf8 (const ACE_Byte* source, - size_t source_size, - void* target, - size_t target_size, - bool strict = true) = 0; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ENCODING_CONVERTER_H */ - diff --git a/dep/include/ace/Encoding_Converter_Factory.h b/dep/include/ace/Encoding_Converter_Factory.h deleted file mode 100644 index c1311451db5..00000000000 --- a/dep/include/ace/Encoding_Converter_Factory.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file Encoding_Converter_Factory.h - * - * $Id: Encoding_Converter_Factory.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class can be used to create encoding converters of various types. - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef ACE_ENCODING_CONVERTER_FACTORY_H -#define ACE_ENCODING_CONVERTER_FACTORY_H - -#include /**/ "ace/pre.h" - -#include "ace/Basic_Types.h" - -#if defined (ACE_USES_WCHAR) -#include /**/ "ace/ACE_export.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Encoding_Converter; - -/** Create an encoding converter based on the source or hint. - * This class allows users to avoid knowing any concrete converter types. - */ -class ACE_Export ACE_Encoding_Converter_Factory -{ -public: - /// This enum is used to tell what type of converter to create. - enum Encoding_Hint { ACE_UTF_32BE, ACE_UTF_32LE, - ACE_UTF_16BE, ACE_UTF_16LE, - ACE_UTF_8, ACE_NONE - }; - - /// Create an encoding converter based on the source. If a hint is - /// given, it just creates the specified type of converter without looking - /// at the source. - static ACE_Encoding_Converter* create (const ACE_Byte* source, - size_t source_size, - Encoding_Hint hint = ACE_NONE); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - -#include /**/ "ace/post.h" - -#endif /* ACE_ENCODING_CONVERTER_FACTORY_H */ - diff --git a/dep/include/ace/Env_Value_T.h b/dep/include/ace/Env_Value_T.h deleted file mode 100644 index 05b4706c122..00000000000 --- a/dep/include/ace/Env_Value_T.h +++ /dev/null @@ -1,167 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Env_Value_T.h - * - * $Id: Env_Value_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Template to encapsulate getting a value from an environment variable - * and using a supplied default value if not in the environment. - * - * - * @author Chris Cleeland (derived from work by Carlos O'Ryan) - */ -//============================================================================= - -#ifndef ACE_ENV_VALUE_T_H -#define ACE_ENV_VALUE_T_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Global_Macros.h" -#include "ace/OS_NS_stdlib.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Env_Value - * - * @brief Environment Variable Value - * - * Reads a variable from the user environment, providing a default - * value. - */ -template -class ACE_Env_Value -{ -public: - /** - * Default constructor which isn't bound to a specific environment - * variable name or a default value. Before being useful it must - * 'd. - */ - ACE_Env_Value (void); - - /// Constructor that calls . - ACE_Env_Value (const ACE_TCHAR *varname, - const T &vardefault); - - /// Destroy the value. - ~ACE_Env_Value (void); - - /// Returns the value as type T. - operator T (void); - - /// The constructor, read @a varname from the environment, using - /// @a defval as its value if it is not defined. - void open (const ACE_TCHAR *varname, const T &defval); - - /// Returns the name of the variable being tracked. - const ACE_TCHAR *varname (void) const; - -private: - /// Disallow copying and assignment. - ACE_UNIMPLEMENTED_FUNC (ACE_Env_Value(const ACE_Env_Value &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Env_Value operator=(const ACE_Env_Value &)) - - void fetch_value (void); - - const ACE_TCHAR *varname_; - T value_; -}; - -/// Function to convert a string @a s into type @c T. -template void ACE_Convert (const ACE_TCHAR *s, T &t); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Env_Value_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Env_Value_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, ACE_TCHAR *&v) -{ - v = (ACE_TCHAR *) s; -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, const ACE_TCHAR *&v) -{ - v = (const ACE_TCHAR *) s; -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, short &si) -{ - si = static_cast (ACE_OS::strtol (s, 0, 10)); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, u_short &us) -{ - us = static_cast (ACE_OS::strtol (s, 0, 10)); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, u_int &i) -{ - i = static_cast (ACE_OS::strtol (s, 0, 10)); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, long &l) -{ - l = ACE_OS::strtol (s, 0, 10); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, int &i) -{ - i = static_cast (ACE_OS::strtol (s, 0, 10)); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, u_long &ul) -{ - ul = ACE_OS::strtoul (s, 0, 10); -} - -template <> inline void -ACE_Convert (const ACE_TCHAR *s, double &d) -{ - d = ACE_OS::strtod (s, 0); -} - -// Default calls a CTOR on type T of the form 'T::T(const char*)', but -// users can feel free to create their own specialized conversion -// functions if necessary, as shown above. Note that for 'char*' the -// default is used because a simple cast will be performed and no -// conversion will be necessary. -template inline void -ACE_Convert (const ACE_TCHAR *s, T &t) -{ - t = T (s); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Env_Value_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_ENV_VALUE_T_H */ - diff --git a/dep/include/ace/Env_Value_T.inl b/dep/include/ace/Env_Value_T.inl deleted file mode 100644 index d9af1b03164..00000000000 --- a/dep/include/ace/Env_Value_T.inl +++ /dev/null @@ -1,60 +0,0 @@ -// $Id: Env_Value_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Env_Value::operator T (void) -{ - return value_; -} - -template ACE_INLINE -ACE_Env_Value::ACE_Env_Value (void) - : varname_ (0) -{ -} - -template ACE_INLINE -ACE_Env_Value::ACE_Env_Value (const ACE_TCHAR *varname, - const T &defval) - : varname_ (varname), - value_(defval) -{ - this->fetch_value (); -} - -template ACE_INLINE void -ACE_Env_Value::open (const ACE_TCHAR *varname, - const T &defval) -{ - this->varname_ = varname; - this->value_ = defval; - this->fetch_value (); -} - -template ACE_INLINE void -ACE_Env_Value::fetch_value (void) -{ -#if defined (ACE_WIN32) - const ACE_TCHAR *env = ACE_OS::getenv (this->varname_); - if (env != 0) - ACE_Convert (env, value_); -#else - char *nenv = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (this->varname_)); - if (nenv != 0) - ACE_Convert (ACE_TEXT_CHAR_TO_TCHAR (nenv), this->value_); -#endif -} - -template ACE_INLINE const ACE_TCHAR* -ACE_Env_Value::varname (void) const -{ - return this->varname_; -} - -template ACE_INLINE -ACE_Env_Value::~ACE_Env_Value (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Event.h b/dep/include/ace/Event.h deleted file mode 100644 index 69d819b3978..00000000000 --- a/dep/include/ace/Event.h +++ /dev/null @@ -1,144 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Event.h - * - * $Id: Event.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_EVENT_H -#define ACE_EVENT_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Event - * - * @brief A wrapper around the Win32 event locking mechanism. - * - * Portable implementation of an Event mechanism, which is native to - * Win32, but must be emulated on UNIX. All platforms support - * process-scope locking support. However, only Win32 platforms - * support global naming and system-scope locking support. - */ -class ACE_Export ACE_Event -{ -public: - /// Constructor that creates event. - ACE_Event (int manual_reset = 0, - int initial_state = 0, - int type = USYNC_THREAD, - const ACE_TCHAR *name = 0, - void *arg = 0, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Implicitly destroy the event variable. - ~ACE_Event (void); - - /** - * Explicitly destroy the event variable. Note that only one thread - * should call this method since it doesn't protect against race - * conditions. - */ - int remove (void); - - /// Underlying handle to event. - ACE_event_t handle (void) const; - - /** - * Set the underlying handle to event. Note that this method assumes - * ownership of the and will close it down in . If - * you want the to stay open when is called make - * sure to call on the before closing it. You are - * responsible for the closing the existing before - * overwriting it. - */ - void handle (ACE_event_t new_handle); - - /** - * if MANUAL reset - * sleep till the event becomes signaled - * event remains signaled after wait() completes. - * else AUTO reset - * sleep till the event becomes signaled - * event resets wait() completes. - */ - int wait (void); - - /// Same as wait() above, but this one can be timed - /// @a abstime is absolute time-of-day if if @a use_absolute_time - /// is non-0, else it is relative time. - int wait (const ACE_Time_Value *abstime, - int use_absolute_time = 1); - - /** - * if MANUAL reset - * wake up all waiting threads - * set to signaled state - * else AUTO reset - * if no thread is waiting, set to signaled state - * if thread(s) are waiting, wake up one waiting thread and - * reset event - */ - int signal (void); - - /** - * if MANUAL reset - * wakeup all waiting threads and - * reset event - * else AUTO reset - * wakeup one waiting thread (if present) and - * reset event - */ - int pulse (void); - - /// Set to nonsignaled state. - int reset (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// The underlying handle. - ACE_event_t handle_; - - /// Keeps track of whether has been called yet to avoid - /// multiple calls, e.g., explicitly and implicitly in the - /// destructor. This flag isn't protected by a lock, so make sure - /// that you don't have multiple threads simultaneously calling - /// on the same object, which is a bad idea anyway... - bool removed_; - -private: - // = Prevent copying. - ACE_Event (const ACE_Event& event); - const ACE_Event &operator= (const ACE_Event &rhs); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Event.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_EVENT_H */ - diff --git a/dep/include/ace/Event.inl b/dep/include/ace/Event.inl deleted file mode 100644 index ae0805c95f0..00000000000 --- a/dep/include/ace/Event.inl +++ /dev/null @@ -1,18 +0,0 @@ -// -*- C++ -*- -// $Id: Event.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_event_t -ACE_Event::handle (void) const -{ - return this->handle_; -} - -ACE_INLINE void -ACE_Event::handle (ACE_event_t new_handle) -{ - this->handle_ = new_handle; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Event_Handler.h b/dep/include/ace/Event_Handler.h deleted file mode 100644 index e97cca48a46..00000000000 --- a/dep/include/ace/Event_Handler.h +++ /dev/null @@ -1,389 +0,0 @@ -/* -*- C++ -*- */ - -//========================================================================== -/** - * @file Event_Handler.h - * - * $Id: Event_Handler.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_EVENT_HANDLER_H -#define ACE_EVENT_HANDLER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" -#include "ace/Atomic_Op.h" -#include "ace/Synch_Traits.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration. -class ACE_Message_Block; -class ACE_Reactor; -class ACE_Reactor_Timer_Interface; -class ACE_Thread_Manager; -class ACE_Process; - -typedef unsigned long ACE_Reactor_Mask; - -/** - * @class ACE_Event_Handler - * - * @brief Provides an abstract interface for handling various types of - * I/O, timer, and signal events. - * - * Subclasses read/write input/output on an I/O descriptor, - * handle an exception raised on an I/O descriptor, handle a - * timer's expiration, or handle a signal. - */ -class ACE_Export ACE_Event_Handler -{ -public: - enum - { - LO_PRIORITY = 0, - HI_PRIORITY = 10, - NULL_MASK = 0, -#if defined (ACE_USE_POLL) - READ_MASK = POLLIN, - WRITE_MASK = POLLOUT, - EXCEPT_MASK = POLLPRI, -#else /* USE SELECT */ - READ_MASK = (1 << 0), - WRITE_MASK = (1 << 1), - EXCEPT_MASK = (1 << 2), -#endif /* ACE_USE_POLL */ - ACCEPT_MASK = (1 << 3), - CONNECT_MASK = (1 << 4), - TIMER_MASK = (1 << 5), - QOS_MASK = (1 << 6), - GROUP_QOS_MASK = (1 << 7), - SIGNAL_MASK = (1 << 8), - ALL_EVENTS_MASK = READ_MASK | - WRITE_MASK | - EXCEPT_MASK | - ACCEPT_MASK | - CONNECT_MASK | - TIMER_MASK | - QOS_MASK | - GROUP_QOS_MASK | - SIGNAL_MASK, - RWE_MASK = READ_MASK | - WRITE_MASK | - EXCEPT_MASK, - DONT_CALL = (1 << 9) - }; - - /// Destructor is virtual to enable proper cleanup. - virtual ~ACE_Event_Handler (void); - - /// Get the I/O handle. - virtual ACE_HANDLE get_handle (void) const; - - /// Set the I/O handle. - virtual void set_handle (ACE_HANDLE); - - // = Get/set priority - - // Priorities run from MIN_PRIORITY (which is the "lowest priority") - // to MAX_PRIORITY (which is the "highest priority"). - /// Get the priority of the Event_Handler. - virtual int priority (void) const; - - /// Set the priority of the Event_Handler. - virtual void priority (int priority); - - /// Called when input events occur (e.g., connection or data). - virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); - - /// Called when output events are possible (e.g., when flow control - /// abates or non-blocking connection completes). - virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE); - - /// Called when an exceptional events occur (e.g., SIGURG). - virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE); - - /** - * Called when timer expires. @a current_time represents the current - * time that the was selected for timeout - * dispatching and @a act is the asynchronous completion token that - * was passed in when was invoked. - */ - virtual int handle_timeout (const ACE_Time_Value ¤t_time, - const void *act = 0); - - /// Called when a process exits. - virtual int handle_exit (ACE_Process *); - - /// Called when a method returns -1 or when the - /// method is called on an ACE_Reactor. The - /// @a close_mask indicates which event has triggered the - /// method callback on a particular @a handle. - virtual int handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask); - - /// Called when object is signaled by OS (either via UNIX signals or - /// when a Win32 object becomes signaled). - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - - enum - { - /// The handler is not resumed at all. Could lead to deadlock.. - ACE_EVENT_HANDLER_NOT_RESUMED = -1, - /// The reactor takes responsibility of resuming the handler and - /// is the default - ACE_REACTOR_RESUMES_HANDLER = 0, - /// The application takes responsibility of resuming the handler - ACE_APPLICATION_RESUMES_HANDLER - }; - /** - * Called to figure out whether the handler needs to resumed by the - * reactor or the application can take care of it. The default - * value of 0 would be returned which would allow the reactor to - * take care of resumption of the handler. The application can - * return a value more than zero and decide to resume the handler - * themseleves. - * - * @note This method is only useful for the ACE_TP_Reactor. Sad - * that we have to have this method in a class that is supposed to - * be used across different components in ACE. - */ - virtual int resume_handler (void); - - virtual int handle_qos (ACE_HANDLE = ACE_INVALID_HANDLE); - virtual int handle_group_qos (ACE_HANDLE = ACE_INVALID_HANDLE); - - // = Accessors to set/get the various event demultiplexors. - /// Set the event demultiplexors. - virtual void reactor (ACE_Reactor *reactor); - - /// Get the event demultiplexors. - virtual ACE_Reactor *reactor (void) const; - - /// Get only the reactor's timer related interface. - virtual ACE_Reactor_Timer_Interface *reactor_timer_interface (void) const; - - /** - * Used to read from non-socket ACE_HANDLEs in our own thread to - * work around Win32 limitations that don't allow us to 'able on - * Win32. - */ - static int register_stdin_handler (ACE_Event_Handler *eh, - ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr, - int flags = THR_DETACHED); - - /// Performs the inverse of the method. - static int remove_stdin_handler (ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr); - - /// Reference count type. - typedef long Reference_Count; - - /// Increment reference count on the handler. - /** - * This method is called when the handler is registered with the - * Reactor and when the Reactor makes an upcall on the handler. - * Reference count is 1 when the handler is created. - * - * @return Current reference count. - */ - virtual Reference_Count add_reference (void); - - /// Decrement reference count on the handler. - /** - * This method is called when the handler is removed from the - * Reactor and when an upcall made on the handler by the Reactor - * completes. Handler is deleted when the reference count reaches - * 0. - * - * @return Current reference count. - */ - virtual Reference_Count remove_reference (void); - - /** - * @class Policy - * - * @brief Base class for all handler policies. - */ - class ACE_Export Policy - { - - public: - - /// Virtual destructor. - virtual ~Policy (void); - }; - - /** - * @class Reference_Counting_Policy - * - * @brief This policy dictates the reference counting requirements - * for the handler. - * - * This policy allows applications to configure whether it wants the - * Reactor to call add_reference() and remove_reference() during - * registrations, removals, and upcalls. - * - * Default: DISABLED. - */ - class ACE_Export Reference_Counting_Policy : public Policy - { - /// This policy can only be created by the handler. - friend class ACE_Event_Handler; - - public: - - enum Value - { - /// Perform reference counting. - ENABLED, - /// Don't perform reference counting. - DISABLED - }; - - /// Current Reference_Counting_Policy. - Value value (void) const; - - /// Update Reference_Counting_Policy. - void value (Value value); - - private: - - /// Private constructor. - Reference_Counting_Policy (Value value); - - /// The value of the policy. - Value value_; - }; - - /// Current Reference_Counting_Policy. - Reference_Counting_Policy &reference_counting_policy (void); - -protected: - /// Force ACE_Event_Handler to be an abstract base class. - ACE_Event_Handler (ACE_Reactor * = 0, - int priority = ACE_Event_Handler::LO_PRIORITY); - - /// Typedef for implementation of reference counting. - typedef ACE_Atomic_Op Atomic_Reference_Count; - - /// Reference count. - Atomic_Reference_Count reference_count_; - -private: - - /// Priority of this Event_Handler. - int priority_; - - /// Pointer to the various event demultiplexors. - ACE_Reactor *reactor_; - - /// Reference counting requirements. - Reference_Counting_Policy reference_counting_policy_; -}; - -/** - * @class ACE_Event_Handler_var - * - * @brief Auto pointer like class for Event Handlers. - * - * Used to manage lifecycle of handlers. This class calls - * ACE_Event_Handler::remove_reference() in its destructor. - */ -class ACE_Export ACE_Event_Handler_var -{ - -public: - - /// Default constructor. - ACE_Event_Handler_var (void); - - /// Construct with a handler. - ACE_Event_Handler_var (ACE_Event_Handler *p); - - /// Copy constructor. - ACE_Event_Handler_var (const ACE_Event_Handler_var &b); - - /// Destructor. - ~ACE_Event_Handler_var (void); - - /// Assignment to a handler. - ACE_Event_Handler_var &operator= (ACE_Event_Handler *p); - - /// Assignment to a ACE_Event_Handler_var. - ACE_Event_Handler_var &operator= (const ACE_Event_Handler_var &b); - - /// Overloaded "->". - ACE_Event_Handler *operator-> () const; - - /// Access the handler. - ACE_Event_Handler *handler (void) const; - - /// Release the handler. - ACE_Event_Handler *release (void); - - /// Reset the handler. - void reset (ACE_Event_Handler *p = 0); - -private: - - /// Handler. - ACE_Event_Handler *ptr_; -}; - -/** - * @class ACE_Notification_Buffer - * - * @brief Simple wrapper for passing s and - * ACE_Reactor_Masks between threads. - */ -class ACE_Export ACE_Notification_Buffer -{ -public: - ACE_Notification_Buffer (void); - - ACE_Notification_Buffer (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - - /// Default dtor. - ~ACE_Notification_Buffer (void); - - /// Pointer to the Event_Handler that will be dispatched - /// by the main event loop. - ACE_Event_Handler *eh_; - - /// Mask that indicates which method to call. - ACE_Reactor_Mask mask_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Event_Handler.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_EVENT_HANDLER_H */ - diff --git a/dep/include/ace/Event_Handler.inl b/dep/include/ace/Event_Handler.inl deleted file mode 100644 index d97c45466ae..00000000000 --- a/dep/include/ace/Event_Handler.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Event_Handler.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Notification_Buffer::~ACE_Notification_Buffer (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Event_Handler_T.h b/dep/include/ace/Event_Handler_T.h deleted file mode 100644 index 47cc5fd56bf..00000000000 --- a/dep/include/ace/Event_Handler_T.h +++ /dev/null @@ -1,192 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Event_Handler_T.h - * - * $Id: Event_Handler_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_EVENT_HANDLER_T_H -#define ACE_EVENT_HANDLER_T_H -#include /**/ "ace/pre.h" - -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Event_Handler_T - * - * @brief Enable a class that doesn't inherit from the - * ACE_Event_Handler to be incorporated into the ACE_Reactor - * framework. Thanks to Greg Lavender (g.lavender@isode.com) - * for sharing this idea. - * - * It is sometimes the case that an application has a hierarchy - * of operation dispatcher classes that have their own - * inheritance hierarchy but also would like to integrate with - * the ACE_Reactor. Rather than adopt a "mixin" approach, it is - * often cleaner to define a template as a subclass of - * ACE_Event_Handler and paramterize it with an operation - * dispatcher type. - * When constructing an instantiation of the ACE_Event_Handler_T - * object, a set of pointers to member functions must be - * provided so that when one of the handle_* methods is called - * by the ACE_Reactor, the appropriate method is called on the - * underlying operations object. This is done since in some - * cases it is useful to map any event that happens to the same - * method on an object. - * The ACE_Event_Handler_T template is instantiated by an - * operations object and registered with the ACE_Reactor, and it - * then calls the appropriate op_handler. So, it's basically - * just another level of indirection in event dispatching. The - * coupling betweent the ultimate handler of the event and the - * ACE_Event_Handler class is relaxed a bit by have this - * intermediate object of type around. The - * client object can then dynamically change the bindings for - * the various handlers so that during the life of one of the - * operation objects, it can change how it wants events to be - * handled. It just instantiates a new instance of the template - * with different bindings and reregisters this new object with - * the ACE_Reactor. - */ -template -class ACE_Event_Handler_T : public ACE_Event_Handler -{ -public: - // = Typedefs to simplify pointer-to-member-function registration. - - // Get/set the underlying handle. - typedef ACE_HANDLE (T::*GET_HANDLE) (void) const; - typedef void (T::*SET_HANDLE) (ACE_HANDLE); - - /// Handle I/O events. - typedef int (T::*IO_HANDLER) (ACE_HANDLE); - - /// Handle timeout events. - typedef int (T::*TO_HANDLER) (const ACE_Time_Value &, const void *); - - /// Handle close events. - typedef int (T::*CL_HANDLER) (ACE_HANDLE, ACE_Reactor_Mask); - - /// = Initialization and termination methods. - typedef int (T::*SIG_HANDLER) (int, siginfo_t*, ucontext_t*); - - /// Initialize the op_handler. - ACE_Event_Handler_T (T *op_handler, - int delete_handler, - GET_HANDLE get_handle = 0, - IO_HANDLER input = 0, - CL_HANDLER close = 0, - SIG_HANDLER sig = 0, - TO_HANDLER timeout = 0, - IO_HANDLER output = 0, - SET_HANDLE set_handle = 0, - IO_HANDLER except = 0); - - /// Close down and delete the - ~ACE_Event_Handler_T (void); - - // = Override all the ACE_Event_Handler methods. - - // These methods all delegate down to the operations handler. - virtual ACE_HANDLE get_handle (void) const; - virtual void set_handle (ACE_HANDLE); - virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0); - virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask); - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - - // = Get/set the operations handler. - T *op_handler (void); - void op_handler (T *); - - // = Get/set the target pointer-to-method used for dispatching. - - GET_HANDLE handle_get (void); - void handle_get (GET_HANDLE); - - SET_HANDLE handle_set (void); - void handle_set (SET_HANDLE); - - IO_HANDLER input_handler (void); - void input_handler (IO_HANDLER); - - IO_HANDLER output_handler (void); - void output_handler (IO_HANDLER); - - IO_HANDLER except_handler (void); - void except_handler (IO_HANDLER); - - TO_HANDLER to_handler (void); - void to_handler (TO_HANDLER); - - CL_HANDLER cl_handler (void); - void cl_handler (CL_HANDLER); - - SIG_HANDLER sig_handler (void); - void sig_handler (SIG_HANDLER); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Pointer to the object that handles all the delegated operations. - T *op_handler_; - - // = Handle input, output, and exception events. - IO_HANDLER input_handler_; - IO_HANDLER output_handler_; - IO_HANDLER except_handler_; - - /// Handle timeout events. - TO_HANDLER to_handler_; - - /// Handle close events. - CL_HANDLER cl_handler_; - - /// Handle signal events. - SIG_HANDLER sig_handler_; - - /// Keeps track of whether we need to delete the handler in the - /// destructor. - int delete_handler_; - - // = Get/set underlying handle. - SET_HANDLE set_handle_; - GET_HANDLE get_handle_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Event_Handler_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Event_Handler_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Event_Handler_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ -#include /**/ "ace/post.h" -#endif /* ACE_EVENT_HANDLER_H */ - diff --git a/dep/include/ace/Event_Handler_T.inl b/dep/include/ace/Event_Handler_T.inl deleted file mode 100644 index 40db43e8e23..00000000000 --- a/dep/include/ace/Event_Handler_T.inl +++ /dev/null @@ -1,135 +0,0 @@ -// -*- C++ -*- -// -// $Id: Event_Handler_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Event_Handler_T::op_handler (T *op) -{ - ACE_TRACE ("ACE_Event_Handler_T::op_handler"); - this->op_handler_ = op; -} - -template ACE_INLINE T * -ACE_Event_Handler_T::op_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::op_handler"); - return this->op_handler_; -} - -template ACE_INLINE typename ACE_Event_Handler_T::GET_HANDLE -ACE_Event_Handler_T::handle_get (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_get"); - return this->get_handle_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::handle_get (typename ACE_Event_Handler_T::GET_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_get"); - this->get_handle_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::SET_HANDLE -ACE_Event_Handler_T::handle_set (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_set"); - return this->set_handle_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::handle_set (typename ACE_Event_Handler_T::SET_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_set"); - this->set_handle_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::input_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::input_handler"); - return this->input_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::input_handler (typename ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::input_handler"); - this->input_handler_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::output_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::output_handler"); - return this->output_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::output_handler (typename ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::output_handler"); - this->output_handler_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::except_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::except_handler"); - return this->except_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::except_handler (typename ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::except_handler"); - this->except_handler_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::TO_HANDLER -ACE_Event_Handler_T::to_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::to_handler"); - return this->to_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::to_handler (typename ACE_Event_Handler_T::TO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::to_handler"); - this->to_handler_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::CL_HANDLER -ACE_Event_Handler_T::cl_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::cl_handler"); - return this->cl_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::cl_handler (typename ACE_Event_Handler_T::CL_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::cl_handler"); - this->cl_handler_ = h; -} - -template ACE_INLINE typename ACE_Event_Handler_T::SIG_HANDLER -ACE_Event_Handler_T::sig_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::sig_handler"); - return this->sig_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::sig_handler (typename ACE_Event_Handler_T::SIG_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::sig_handler"); - this->sig_handler_ = h; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Exception_Macros.h b/dep/include/ace/Exception_Macros.h deleted file mode 100644 index 32805184d04..00000000000 --- a/dep/include/ace/Exception_Macros.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- - -// ============================================================================ -/** - * @file Exception_Macros.h - * - * $Id: Exception_Macros.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Writing code that is portable between platforms with or without - * native C++ exceptions is hard. The following macros offer some - * help on this task. - * - * @author Nanbor Wang - * @author Aniruddha Gokhale - * @author Carlos O'Ryan - * @author Krishnakumar B , et al. - */ -// ============================================================================ - -// Macros for handling exceptions. - -#ifndef ACE_EXCEPTION_MACROS_H -#define ACE_EXCEPTION_MACROS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -// By default, if the compiler supports native exception handling, assume -// CORBA also support native exception handling. But it can be disabled by -// defining ACE_CORBA_HAS_EXCEPTIONS=0. If the compiler does not support -// exceptions handling, make sure native exception handling is disabled. -#if defined (ACE_HAS_EXCEPTIONS) -# if defined (ACE_CORBA_HAS_EXCEPTIONS) -# if (ACE_CORBA_HAS_EXCEPTIONS == 0) -# undef ACE_USES_NATIVE_EXCEPTIONS -# else /* ACE_CORBA_HAS_EXCEPTIONS != 0 */ -# define ACE_USES_NATIVE_EXCEPTIONS -# endif /* ACE_CORBA_HAS_EXCEPTIONS == 0 */ -# else -# define ACE_USES_NATIVE_EXCEPTIONS -# define ACE_CORBA_HAS_EXCEPTIONS -# endif /* ACE_CORBA_HAS_EXCEPTIONS */ -#else /* ! ACE_HAS_EXCEPTIONS */ -# undef ACE_CORBA_HAS_EXCEPTIONS -# undef ACE_USES_NATIVE_EXCEPTIONS -#endif /* ACE_HAS_EXCEPTIONS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_EXCEPTION_MACROS_H */ - diff --git a/dep/include/ace/FIFO.h b/dep/include/ace/FIFO.h deleted file mode 100644 index 76090778e8f..00000000000 --- a/dep/include/ace/FIFO.h +++ /dev/null @@ -1,85 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file FIFO.h - * - * $Id: FIFO.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//========================================================================== - -#ifndef ACE_FIFO_H -#define ACE_FIFO_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/IPC_SAP.h" -#include "ace/os_include/os_limits.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FIFO - * - * @brief Abstract base class for UNIX FIFOs - * - * UNIX FIFOs are also known Named Pipes, which are totally - * unrelated to Win32 Named Pipes. If you want to use a local - * IPC mechanism that will be portable to both UNIX and Win32, - * take a look at the classes. - */ -class ACE_Export ACE_FIFO : public ACE_IPC_SAP -{ -public: - /// Open up the named pipe on the in accordance with the - /// flags. - int open (const ACE_TCHAR *rendezvous, int flags, mode_t perms, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Close down the ACE_FIFO without removing the rendezvous point. - int close (void); - - /// Close down the ACE_FIFO and remove the rendezvous point from the - /// file system. - int remove (void); - - /// Return the local address of this endpoint. - int get_local_addr (const ACE_TCHAR *&rendezvous) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Make these protected to ensure that the class is "abstract." - /// Default constructor. - ACE_FIFO (void); - - /// Open up the named pipe on the in accordance with the - /// flags. - ACE_FIFO (const ACE_TCHAR *rendezvous, int flags, mode_t perms, - LPSECURITY_ATTRIBUTES sa = 0); - -private: - /// Rendezvous point in the file system. - ACE_TCHAR rendezvous_[MAXPATHLEN + 1]; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FIFO.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FIFO_H */ - diff --git a/dep/include/ace/FIFO.inl b/dep/include/ace/FIFO.inl deleted file mode 100644 index 05cc030a917..00000000000 --- a/dep/include/ace/FIFO.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// -// $Id: FIFO.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_unistd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_FIFO::get_local_addr (const ACE_TCHAR *&r) const -{ - ACE_TRACE ("ACE_FIFO::get_local_addr"); - r = this->rendezvous_; - return 0; -} - -ACE_INLINE int -ACE_FIFO::remove (void) -{ - ACE_TRACE ("ACE_FIFO::remove"); - int const result = this->close (); - return ACE_OS::unlink (this->rendezvous_) == -1 || result == -1 ? -1 : 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FIFO_Recv.h b/dep/include/ace/FIFO_Recv.h deleted file mode 100644 index 482b9a1f283..00000000000 --- a/dep/include/ace/FIFO_Recv.h +++ /dev/null @@ -1,85 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file FIFO_Recv.h - * - * $Id: FIFO_Recv.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//========================================================================== - -#ifndef ACE_FIFO_RECV_H -#define ACE_FIFO_RECV_H - -#include /**/ "ace/pre.h" - -#include "ace/FIFO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_fcntl.h" -#include "ace/Default_Constants.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FIFO_Recv - * - * @brief Receiver side of the bytestream C++ wrapper for UNIX - * FIFOs. - */ -class ACE_Export ACE_FIFO_Recv : public ACE_FIFO -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FIFO_Recv (void); - - /// Open up a bytestream named pipe for reading. - ACE_FIFO_Recv (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Open up a bytestream named pipe for reading. - int open (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Close down the named pipe. - int close (void); - - /// Recv @a buf of up to @a len bytes. - ssize_t recv (void *buf, size_t len); - - /// Recv @a buf of exactly @a len bytes (block until done). - ssize_t recv_n (void *buf, size_t len); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Auxiliary handle that is used to implement persistent FIFOs. - ACE_HANDLE aux_handle_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FIFO_Recv.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_FIFO_RECV_H */ - diff --git a/dep/include/ace/FIFO_Recv.inl b/dep/include/ace/FIFO_Recv.inl deleted file mode 100644 index d4c3fee4326..00000000000 --- a/dep/include/ace/FIFO_Recv.inl +++ /dev/null @@ -1,24 +0,0 @@ -// -*- C++ -*- -// -// $Id: FIFO_Recv.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" -#include "ace/OS_NS_unistd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_FIFO_Recv::recv (void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Recv::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, len); -} - -ACE_INLINE ssize_t -ACE_FIFO_Recv::recv_n (void *buf, size_t n) -{ - ACE_TRACE ("ACE_FIFO_Recv::recv_n"); - return ACE::recv_n (this->get_handle (), buf, n); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FIFO_Recv_Msg.h b/dep/include/ace/FIFO_Recv_Msg.h deleted file mode 100644 index c9ce36a1523..00000000000 --- a/dep/include/ace/FIFO_Recv_Msg.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FIFO_Recv_Msg.h - * - * $Id: FIFO_Recv_Msg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_FIFO_RECV_MSG_H -#define ACE_FIFO_RECV_MSG_H -#include /**/ "ace/pre.h" - -#include "ace/FIFO_Recv.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decls -class ACE_Str_Buf; - -/** - * @class ACE_FIFO_Recv_Msg - * - * @brief Receiver side for the record oriented C++ wrapper for UNIX FIFOs. - * - * This method works slightly differently on platforms with the - * @c ACE_HAS_STREAM_PIPES configuration setting than those without. - * With ACE_HAS_STREAM_PIPES, the @c getmsg() system function is used - * and it preserves message boundaries internally. Without - * @c ACE_HAS_STREAM_PIPES, the message boundaries are emulated by - * this class and ACE_FIFO_Send_Msg cooperating. The sending class - * first writes an integer number of bytes in the message, then the - * message. ACE_FIFO_Recv_Msg reads the count, then the data. - * The operational differences occur primarily when a message is larger - * than what a caller of this class requests. See recv() for details. - */ -class ACE_Export ACE_FIFO_Recv_Msg : public ACE_FIFO_Recv -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FIFO_Recv_Msg (void); - - /// Open up a record-oriented named pipe for reading. - ACE_FIFO_Recv_Msg (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Open up a record-oriented named pipe for reading. - int open (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Receive a message based on attributes in an ACE_Str_Buf. - /** - * @param msg Reference to an ACE_Str_Buf whose @c buf member points - * to the memory to receive the data and @c maxlen member - * contains the maximum number of bytes to receive. - * On return after successfully reading data, the - * @c len member contains the number of bytes received and - * placed in the buffer pointed to by @c msg.buf. - * - * @retval -1 Error; consult @c errno for specific error number. - * @return If the @c ACE_HAS_STREAM_PIPES configuration setting is - * defined, the return value is the number of bytes received - * in the message and will be the same as @c buf.len. - * The return value from the @c getmsg() system function - * is discarded. - * If @c ACE_HAS_STREAM_PIPES is not defined, the number - * of bytes in the message read from the FIFO is returned. - * If the message is larger than the maximum length - * requested in @c msg.maxlen, the return value reflects - * the entire message length, and the @c msg.len member - * reflects how many bytes were actually placed in the - * caller's buffer. Any part of the message longer than - * @c msg.maxlen is discarded. - */ - ssize_t recv (ACE_Str_Buf &msg); - - /// Receive a message based on buffer pointer and maximum size. - /** - * @param buf Pointer to the memory to receive the data. - * @param len The maximum number of bytes to receive. - * - * @retval -1 Error; consult @c errno for specific error number. - * @return The number of bytes received in the message. For messages - * that are larger than the requested maximum size, the - * behavior is different depending on the @c ACE_HAS_STREAM_PIPES - * configuration setting. With @c ACE_HAS_STREAM_PIPES, - * the return value will be the same as @arg len (this is - * also possible if the message is exactly the same length - * as @arg len, and the two cases are indistinguishable). - * Without @c ACE_HAS_STREAM_PIPES, the return value is - * the total length of the message, including bytes in - * excess of @arg len. The excess bytes are discarded. - */ - ssize_t recv (void *buf, size_t len); - -#if defined (ACE_HAS_STREAM_PIPES) - /// Recv and message via Stream pipes. - ssize_t recv (ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags); - - /// Recv and message via Stream pipes in "band" mode. - ssize_t recv (int *band, - ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags); -#endif /* ACE_HAS_STREAM_PIPES */ - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FIFO_Recv_Msg.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FIFO_RECV_MSG_H */ - diff --git a/dep/include/ace/FIFO_Recv_Msg.inl b/dep/include/ace/FIFO_Recv_Msg.inl deleted file mode 100644 index 3055892172b..00000000000 --- a/dep/include/ace/FIFO_Recv_Msg.inl +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- -// -// $Id: FIFO_Recv_Msg.inl 82559 2008-08-07 20:23:07Z parsons $ - -#include "ace/Min_Max.h" -#include "ace/OS_NS_stropts.h" -#include "ace/Truncate.h" - -#if !defined (ACE_HAS_STREAM_PIPES) -#include "ace/OS_NS_unistd.h" -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); -#if defined (ACE_HAS_STREAM_PIPES) - int i = 0; - if (ACE_OS::getmsg (this->get_handle (), - (strbuf *) 0, - (strbuf *) &recv_msg, - &i) == -1) - { - return -1; - } - else - { - return recv_msg.len; - } -#else /* Do the ol' 2-read trick... */ - if (ACE_OS::read (this->get_handle (), - (char *) &recv_msg.len, - sizeof recv_msg.len) != sizeof recv_msg.len) - { - return -1; - } - else - { - size_t remaining = static_cast (recv_msg.len); - size_t requested = static_cast (recv_msg.maxlen); - ssize_t recv_len = ACE_OS::read (this->get_handle (), - (char *) recv_msg.buf, - ACE_MIN (remaining, requested)); - - if (recv_len == -1) - { - return -1; - } - - // Tell caller what's really in the buffer. - recv_msg.len = static_cast (recv_len); - - // If there are more bytes remaining in the message, read them and - // throw them away. Leaving them in the FIFO would make it difficult - // to find the start of the next message in the fifo. - // Since the ACE_HAS_STREAM_PIPES version of this method doesn't - // return getmsg()'s indication of "data remaining", don't worry about - // saving the indication here either to read the remainder later. - size_t total_msg_size = remaining; - remaining -= recv_len; - - while (remaining > 0) - { - const size_t throw_away = 1024; - char dev_null[throw_away]; - recv_len = ACE_OS::read (this->get_handle (), - dev_null, - ACE_MIN (remaining, throw_away)); - - if (recv_len == -1) - { - break; - } - - remaining -= recv_len; - } - - return ACE_Utils::truncate_cast (total_msg_size); - } -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ACE_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (void *buf, size_t max_len) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - ACE_Str_Buf recv_msg ((char *) buf, 0, static_cast (max_len)); - - return this->recv (recv_msg); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ACE_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - if (ACE_OS::getmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - flags) == -1) - { - return -1; - } - else - { - return (cntl == 0 ? 0 : cntl->len) + (data == 0 ? 0 : data->len); - } -} - -ACE_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (int *band, - ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - - if (ACE_OS::getpmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - band, - flags) == -1) - { - return -1; - } - else - { - return (cntl == 0 ? 0 : cntl->len) + (data == 0 ? 0 : data->len); - } -} -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FIFO_Send.h b/dep/include/ace/FIFO_Send.h deleted file mode 100644 index 414569325d9..00000000000 --- a/dep/include/ace/FIFO_Send.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file FIFO_Send.h - * - * $Id: FIFO_Send.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//========================================================================== - -#ifndef ACE_FIFO_SEND_H -#define ACE_FIFO_SEND_H - -#include /**/ "ace/pre.h" - -#include "ace/FIFO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_fcntl.h" -#include "ace/Default_Constants.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FIFO_Send - * - * @brief Sender side for the bytestream C++ wrapper for UNIX FIFOs - */ -class ACE_Export ACE_FIFO_Send : public ACE_FIFO -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FIFO_Send (void); - - /// Open up a bytestream named pipe for writing. - ACE_FIFO_Send (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Open up a bytestream named pipe for writing. - int open (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Send @a buf of up to @a len bytes. - ssize_t send (const void *buf, size_t len); - - /// Send @a buf of exactly @a len bytes (block until done). - ssize_t send_n (const void *buf, size_t len); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FIFO_Send.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_FIFO_SEND_H */ - diff --git a/dep/include/ace/FIFO_Send.inl b/dep/include/ace/FIFO_Send.inl deleted file mode 100644 index a01facd61f0..00000000000 --- a/dep/include/ace/FIFO_Send.inl +++ /dev/null @@ -1,24 +0,0 @@ -// -*- C++ -*- -// -// $Id: FIFO_Send.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" -#include "ace/OS_NS_unistd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_FIFO_Send::send (const void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Send::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, len); -} - -ACE_INLINE ssize_t -ACE_FIFO_Send::send_n (const void *buf, size_t n) -{ - ACE_TRACE ("ACE_FIFO_Send::send_n"); - return ACE::send_n (this->get_handle (), buf, n); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FIFO_Send_Msg.h b/dep/include/ace/FIFO_Send_Msg.h deleted file mode 100644 index 79314a89ad5..00000000000 --- a/dep/include/ace/FIFO_Send_Msg.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file FIFO_Send_Msg.h - * - * $Id: FIFO_Send_Msg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_FIFO_SEND_MSG_H -#define ACE_FIFO_SEND_MSG_H -#include /**/ "ace/pre.h" - -#include "ace/FIFO_Send.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward Decls -class ACE_Str_Buf; - -/** - * @class ACE_FIFO_Send_Msg - * - * @brief Sender side for the Record oriented C++ wrapper for UNIX - * FIFOs. - */ -class ACE_Export ACE_FIFO_Send_Msg : public ACE_FIFO_Send -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FIFO_Send_Msg (void); - - /// Open up a record-oriented named pipe for writing. - ACE_FIFO_Send_Msg (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Open up a record-oriented named pipe for writing. - int open (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - mode_t perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Send @a buf of up to @a len bytes. - ssize_t send (const ACE_Str_Buf &msg); - - /// Send @a buf of exactly @a len bytes (block until done). - ssize_t send (const void *buf, size_t len); - -#if defined (ACE_HAS_STREAM_PIPES) - /// Send and message via Stream pipes. - ssize_t send (const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl = 0, - int flags = 0); - - /// Send and message via Stream pipes in "band" mode. - ssize_t send (int band, - const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl = 0, - int flags = MSG_BAND); -#endif /* ACE_HAS_STREAM_PIPES */ - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FIFO_Send_Msg.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FIFO_SEND_MSG_H */ - diff --git a/dep/include/ace/FIFO_Send_Msg.inl b/dep/include/ace/FIFO_Send_Msg.inl deleted file mode 100644 index 0a34e64e370..00000000000 --- a/dep/include/ace/FIFO_Send_Msg.inl +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id: FIFO_Send_Msg.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_stropts.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_FIFO_Send_Msg::send (const void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - ACE_Str_Buf send_msg ((char *) buf, static_cast (len)); - - return this->send (send_msg); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ACE_INLINE ssize_t -ACE_FIFO_Send_Msg::send (const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, - int flags) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - if (ACE_OS::putmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - flags) == -1) - return-1; - else - return (cntl == 0 ? 0 : cntl->len) + (data == 0 ? 0 : data->len); -} - -ACE_INLINE ssize_t -ACE_FIFO_Send_Msg::send (int band, - const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, - int flags) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - - if (ACE_OS::putpmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - band, - flags) == -1) - return -1; - else - return (cntl == 0 ? 0 : cntl->len) + (data == 0 ? 0 : data->len); -} -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FILE.h b/dep/include/ace/FILE.h deleted file mode 100644 index 44d5ac71d20..00000000000 --- a/dep/include/ace/FILE.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file FILE.h - * - * $Id: FILE.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer - */ -//============================================================================= - -#ifndef ACE_FILE_H -#define ACE_FILE_H -#include /**/ "ace/pre.h" - -#include "ace/IO_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/FILE_Addr.h" - -// The following is necessary since many C++ compilers don't support -// typedef'd types inside of classes used as formal template -// arguments... ;-(. Luckily, using the C++ preprocessor I can hide -// most of this nastiness! - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) -#define ACE_FILE_CONNECTOR ACE_FILE_Connector -#define ACE_FILE_STREAM ACE_FILE_IO -#else /* TEMPLATES are broken (must be a cfront-based compiler...) */ -#define ACE_FILE_CONNECTOR ACE_FILE_Connector, ACE_FILE_Addr -#define ACE_FILE_STREAM ACE_FILE_IO, ACE_FILE_Addr -#endif /* ACE_TEMPLATE_TYPEDEFS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FILE_Info - * - * @brief Abstracts basic OS FILE information. - */ -class ACE_Export ACE_FILE_Info -{ -public: - /// Mode of file - mode_t mode_; - - /// No of links - nlink_t nlink_; - - /// Size of file - ACE_OFF_T size_; -}; - -/** - * @class ACE_FILE - * - * @brief Defines the core methods of the ACE_FILE abstraction. - */ -class ACE_Export ACE_FILE : public ACE_IO_SAP -{ -public: - /// Close the ACE_FILE handle without removing the ACE_FILE from - /// the file system. - int close (void); - - /// Close and remove the ACE_FILE from the file system. - int remove (void); - - /// Remove the ACE_FILE from the file system without closing the - /// ACE_FILE handle. - int unlink (void); - - /// Get information on this ACE_FILE. - int get_info (ACE_FILE_Info *finfo); - - /// Get information on this ACE_FILE. - int get_info (ACE_FILE_Info &finfo); - - /// Set filesize to length byte. - int truncate (ACE_OFF_T length); - - /** - * Sets the file pointer as follows: - * o If is , the pointer is set to @a offset - * bytes. - * - * o If is , the pointer is set to its - * current location plus @a offset. - * - * o If is , the pointer is set to the size - * of the file plus offset. - */ - ACE_OFF_T seek (ACE_OFF_T offset, - int whence = SEEK_CUR); - - /// Return an offset for the file handle. - ACE_OFF_T tell (void); - - /** - * Disable signal @a signum - * This is here to prevent Win32 from - * disabling SPIPE using socket calls - */ - int disable (int signum) const ; - - /// Return the local endpoint address in the referenced ACE_Addr. - /// Returns 0 if successful, else -1. - int get_local_addr (ACE_Addr &) const; - - /// Return the same thing as get_local_addr(). - int get_remote_addr (ACE_Addr &) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Ensure that this class is only created by the - /// ACE_FILE_Connector. - ACE_FILE (void); - - /// File we are "connected" with... - ACE_FILE_Addr addr_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FILE.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FILE_H */ - diff --git a/dep/include/ace/FILE.inl b/dep/include/ace/FILE.inl deleted file mode 100644 index 288374afc58..00000000000 --- a/dep/include/ace/FILE.inl +++ /dev/null @@ -1,18 +0,0 @@ -// -*- C++ -*- -// -// $Id: FILE.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_FILE::disable (int signum) const -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (signum) ; - return 0 ; -#else /* ACE_WIN32 */ - return ACE_IO_SAP::disable (signum) ; -#endif /* ACE_WIN32 */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FILE_Addr.h b/dep/include/ace/FILE_Addr.h deleted file mode 100644 index 0604b689e5b..00000000000 --- a/dep/include/ace/FILE_Addr.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FILE_Addr.h - * - * $Id: FILE_Addr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_FILE_ADDR_H -#define ACE_FILE_ADDR_H -#include /**/ "ace/pre.h" - -#include "ace/Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Flag_Manip.h" -#include "ace/os_include/os_dirent.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FILE_Addr - * - * @brief Defines the FILE address family address format. - */ -class ACE_Export ACE_FILE_Addr : public ACE_Addr -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FILE_Addr (void); - - /// Copy constructor. - ACE_FILE_Addr (const ACE_FILE_Addr &sa); - - /// Acts like a copy constructor. If @a sa == ACE_Addr::sap_any then - /// create a temporary filename using ACE_OS::mktemp. - int set (const ACE_FILE_Addr &sa); - - /// Create a ACE_FILE_Addr from a pathname. - explicit ACE_FILE_Addr (const ACE_TCHAR *filename); - - /// Create a ACE_FILE_Addr from a pathname. - int set (const ACE_TCHAR *filename); - - /// Assignment operator. - ACE_FILE_Addr &operator= (const ACE_FILE_Addr &); - - /// Return a pointer to the address. - virtual void *get_addr (void) const; - - /// Transform the current address into string format. - virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; - - /// Compare two addresses for equality. - bool operator == (const ACE_FILE_Addr &SAP) const; - - /// Compare two addresses for inequality. - bool operator != (const ACE_FILE_Addr &SAP) const; - - /// Return the path name used for the rendezvous point. - const ACE_TCHAR *get_path_name (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Name of the file. - ACE_TCHAR filename_[MAXPATHLEN + 1]; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FILE_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FILE_ADDR_H */ - diff --git a/dep/include/ace/FILE_Addr.inl b/dep/include/ace/FILE_Addr.inl deleted file mode 100644 index b323911e516..00000000000 --- a/dep/include/ace/FILE_Addr.inl +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- -// -// $Id: FILE_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/SString.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Compare two addresses for equality. - -ACE_INLINE bool -ACE_FILE_Addr::operator == (const ACE_FILE_Addr &sap) const -{ - return ACE_OS::strcmp (this->filename_, sap.filename_) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE bool -ACE_FILE_Addr::operator != (const ACE_FILE_Addr &sap) const -{ - return !((*this) == sap); // This is lazy, of course... ;-) -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const ACE_TCHAR * -ACE_FILE_Addr::get_path_name (void) const -{ - return this->filename_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FILE_Connector.h b/dep/include/ace/FILE_Connector.h deleted file mode 100644 index 4f87e209d66..00000000000 --- a/dep/include/ace/FILE_Connector.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file FILE_Connector.h - * - * $Id: FILE_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_FILE_CONNECTOR_H -#define ACE_FILE_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include "ace/FILE_IO.h" -#include "ace/Log_Msg.h" -#include "ace/os_include/os_fcntl.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_FILE_Connector - * - * @brief Defines an active connection factory for the ACE_FILE wrappers. - * - * Note that the O_APPEND flag is only partly supported on Win32. If - * you specify O_APPEND, then the file pointer will be positioned at - * the end of the file initially during open, but it is not - * re-positioned at the end prior to each write, as specified by - * POSIX. This is generally good enough for typical situations, but - * it is ``not quite right'' in its semantics. - */ -class ACE_Export ACE_FILE_Connector -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_FILE_Connector (void); - - /** - * Actively ``connect'' and produce a @a new_io ACE_FILE_IO object - * if things go well. The @a remote_sap is the file that we are - * trying to create/open. If it's the default value of - * ACE_Addr::sap_any then the user is letting the OS create the - * filename (via ). The @a timeout is the amount of - * time to wait to create/open the file. If it's 0 then we block - * indefinitely. If *timeout == {0, 0} then the file is created - * using non-blocking mode. If *timeout > {0, 0} then this is the - * maximum amount of time to wait before timing out. The - * @a local_sap and @a reuse_addr parameters are ignored. The @a flags - * and @a perms arguments are passed down to the - * method. - */ - ACE_FILE_Connector (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR | O_CREAT, - int perms = ACE_DEFAULT_FILE_PERMS); - - /** - * Actively ``connect'' and produce a @a new_io object - * if things go well. The @a remote_sap is the file that we are - * trying to create/open. If it's the default value of - * ACE_Addr::sap_any then the user is letting the OS create the - * filename (via ). The @a timeout is the amount of - * time to wait to create/open the file. If it's 0 then we block - * indefinitely. If *timeout == {0, 0} then the file is created - * using non-blocking mode. In this case, if the create/open can't - * be done immediately the value of -1 is returned with . If *timeout > {0, 0} then this is the maximum amount of - * time to wait before timing out. If the time expires before the - * connection is made @c errno == ETIME. The @a local_sap and - * @a reuse_addr parameters are ignored. The @a flags and @a perms - * arguments are passed down to the method. - */ - int connect (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR | O_CREAT, - int perms = ACE_DEFAULT_FILE_PERMS); - - /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Meta-type "trait" information. - typedef ACE_FILE_Addr PEER_ADDR; - typedef ACE_FILE_IO PEER_STREAM; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FILE_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FILE_CONNECTOR_H */ - diff --git a/dep/include/ace/FILE_Connector.inl b/dep/include/ace/FILE_Connector.inl deleted file mode 100644 index deab94e0061..00000000000 --- a/dep/include/ace/FILE_Connector.inl +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -// -// $Id: FILE_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Creates a Local ACE_FILE. - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_FILE_Connector::ACE_FILE_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, - reuse_addr, flags, perms) == ACE_IO_SAP::INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("address %s, %p\n"), - remote_sap.get_path_name (), - ACE_TEXT ("ACE_FILE_IO"))); -} - -ACE_INLINE int -ACE_FILE_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/FILE_IO.h b/dep/include/ace/FILE_IO.h deleted file mode 100644 index a1a470b8d30..00000000000 --- a/dep/include/ace/FILE_IO.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file FILE_IO.h - * - * $Id: FILE_IO.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_FILE_IO_H -#define ACE_FILE_IO_H -#include /**/ "ace/pre.h" - -#include "ace/FILE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/FILE_Addr.h" - -// Used in the FILE_IO.h file... -#include "ace/os_include/os_stdio.h" -#include "ace/os_include/sys/os_uio.h" - -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -class ACE_Message_Block; -class ACE_Time_Value; - -/** - * @class ACE_FILE_IO - * - * @brief Read/Write operations on Files - */ -class ACE_Export ACE_FILE_IO : public ACE_FILE -{ -public: - friend class ACE_FILE_Connector; - - // = Initialization method. - /// Default constructor. - ACE_FILE_IO (void); - - /// send upto @a n bytes in @a buf. - ssize_t send (const void *buf, size_t n) const; - - /// Recv upto @a n bytes in @a buf. - ssize_t recv (void *buf, size_t n) const; - - /// Send n bytes, keep trying until n are sent. - ssize_t send_n (const void *buf, size_t n) const; - - /// Send all the @a message_blocks chained through their and - /// pointers. This call uses the underlying OS gather-write - /// operation to reduce the domain-crossing penalty. - ssize_t send_n (const ACE_Message_Block *message_block, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - /// Recv n bytes, keep trying until n are received. - ssize_t recv_n (void *buf, size_t n) const; - -#if defined (ACE_HAS_STREAM_PIPES) - /// Send bytes via STREAM pipes. - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int flags = 0) const; - - /// Recv bytes via STREAM pipes. - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *flags) const; - - /// Send bytes via STREAM pipes using "band" mode. - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int band, - int flags) const; - - /// Recv bytes via STREAM pipes using "band" mode. - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *band, - int *flags) const; - -#endif /* ACE_HAS_STREAM_PIPES */ - - /// Send iovecs via <::writev>. - ssize_t send (const iovec iov[], int n) const; - - /// Recv iovecs via <::readv>. - ssize_t recv (iovec iov[], int n) const; - - /** - * Send N char *ptrs and int lengths. Note that the char *'s - * precede the ints (basically, an varargs version of writev). The - * count N is the *total* number of trailing arguments, *not* a - * couple of the number of tuple pairs! - */ - ssize_t send (size_t n, ...) const; - - /** - * This is an interface to ::readv, that doesn't use the struct - * iovec explicitly. The ... can be passed as an arbitrary number - * of (char *ptr, int len) tuples. However, the count N is the - * *total* number of trailing arguments, *not* a couple of the - * number of tuple pairs! - */ - ssize_t recv (size_t n, ...) const; - - /// Send @a n bytes via Win32 WriteFile using overlapped I/O. - ssize_t send (const void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - - /// Recv @a n bytes via Win32 ReadFile using overlapped I/O. - ssize_t recv (void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - - /// Send an @c iovec of size @a n to the file. - ssize_t sendv (const iovec iov[], - int n) const; - - /** - * Allows a client to read from a file without having to provide a - * buffer to read. This method determines how much data is in the - * file, allocates a buffer of this size, reads in the data, and - * returns the number of bytes read. The caller is responsible for - * deleting the member in the field of using - * delete [] io_vec->iov_base. - */ - ssize_t recvv (iovec *io_vec); - - /// Send an of size @a n to the file. Will block until all - /// bytes are sent or an error occurs. - ssize_t sendv_n (const iovec iov[], - int n) const; - - /// Receive an of size @a n to the file. - ssize_t recvv_n (iovec iov[], - int n) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Meta-type info - typedef ACE_FILE_Addr PEER_ADDR; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/FILE_IO.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FILE_IO_H */ - diff --git a/dep/include/ace/FILE_IO.inl b/dep/include/ace/FILE_IO.inl deleted file mode 100644 index d2e4f756c2c..00000000000 --- a/dep/include/ace/FILE_IO.inl +++ /dev/null @@ -1,152 +0,0 @@ -// -*- C++ -*- -// -// $Id: FILE_IO.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" -#include "ace/OS_NS_sys_uio.h" -#include "ace/OS_NS_unistd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ssize_t -ACE_FILE_IO::sendv_n (const iovec iov[], int n) const -{ - ACE_TRACE ("ACE_FILE_IO::sendv_n"); - return ACE::writev_n (this->get_handle (), - iov, - n); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send_n (const ACE_Message_Block *message_block, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) -{ - ACE_TRACE ("ACE_FILE_IO::send_n"); - ACE_UNUSED_ARG (timeout); - return ACE::write_n (this->get_handle (), - message_block, - bytes_transferred); -} - -// Recv an n byte message from the file. - -ACE_INLINE ssize_t -ACE_FILE_IO::recvv_n (iovec iov[], int n) const -{ - ACE_TRACE ("ACE_FILE_IO::recvv_n"); - // @@ Carlos, can you please update this to call the - // new ACE::recvv_n() method that you write? - return ACE_OS::readv (this->get_handle (), - iov, - n); -} - -// Send an of size to the file. - -ACE_INLINE ssize_t -ACE_FILE_IO::sendv (const iovec iov[], int n) const -{ - ACE_TRACE ("ACE_FILE_IO::sendv"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -// Send exactly N bytes from BUF to this file. Keeping trying until -// this many bytes are sent. - -ACE_INLINE ssize_t -ACE_FILE_IO::send_n (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::send_n"); - return ACE::write_n (this->get_handle (), buf, n); -} - -// Receive exactly N bytes from this file into BUF. Keep trying until -// this many bytes are received. - -ACE_INLINE ssize_t -ACE_FILE_IO::recv_n (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv_n"); - return ACE::read_n (this->get_handle (), buf, n); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::write (this->get_handle (), buf, n); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::recv (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::read (this->get_handle (), buf, n); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send (const iovec iov[], int n) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::recv (iovec iov[], int n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::readv (this->get_handle (), iov, n); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ACE_INLINE ssize_t -ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::send (const void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::write (this->get_handle (), - buf, n, - overlapped); -} - -ACE_INLINE ssize_t -ACE_FILE_IO::recv (void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::read (this->get_handle (), buf, n, - overlapped); -} - -#endif /* ACE_HAS_STREAM_PIPES */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/File_Lock.h b/dep/include/ace/File_Lock.h deleted file mode 100644 index c0629762d15..00000000000 --- a/dep/include/ace/File_Lock.h +++ /dev/null @@ -1,171 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file File_Lock.h - * - * $Id: File_Lock.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_FILE_LOCK_H -#define ACE_FILE_LOCK_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_stdio.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_File_Lock - * - * @brief A wrapper around the UNIX file locking mechanism. - * - * Allows us to "adapt" the UNIX file locking mechanisms to work - * with all of our Guard stuff... - */ -class ACE_Export ACE_File_Lock -{ -public: - /** - * Set the of the File_Lock to @a handle. Note that this - * constructor assumes ownership of the @a handle and will close it - * down in . If you want the @a handle to stay open when - * is called make sure to call on the @a handle. - * If you don't want the file unlinked in the destructor pass a - * zero value for . - */ - ACE_File_Lock (ACE_HANDLE handle = ACE_INVALID_HANDLE, - int unlink_in_destructor = 1); - - /// Open the @a filename with @a flags and @a mode and set the result - /// to . If you don't want the file unlinked in the - /// destructor pass a zero value for . - ACE_File_Lock (const ACE_TCHAR *filename, - int flags, - mode_t mode = 0, - int unlink_in_destructor = 1); - - /// Open the @a filename with @a flags and @a mode and set the result to - /// . - int open (const ACE_TCHAR *filename, - int flags, - mode_t mode = 0); - - /// Remove a File lock by releasing it and closing down the . - ~ACE_File_Lock (void); - - /// Remove a File lock by releasing it and closing down the - /// . If is non-0 then we unlink the file. - int remove (int unlink_file = 1); - - /** - * Note, for interface uniformity with other synchronization - * wrappers we include the method. This is implemented as - * a write-lock to be on the safe-side... - */ - int acquire (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /** - * Note, for interface uniformity with other synchronization - * wrappers we include the method. This is implemented - * as a write-lock to be on the safe-side... Returns -1 on failure. - * If we "failed" because someone else already had the lock, @c errno - * is set to @c EBUSY. - */ - int tryacquire (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /// Unlock a readers/writer lock. - int release (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /// Acquire a write lock, but block if any readers or a - /// writer hold the lock. - int acquire_write (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /** - * Conditionally acquire a write lock (i.e., won't block). Returns - * -1 on failure. If we "failed" because someone else already had - * the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_write (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /** - * Conditionally upgrade to a write lock (i.e., won't block). Returns - * -1 on failure. If we "failed" because someone else already had - * the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_write_upgrade (short whence = 0, - ACE_OFF_T start = 0, - ACE_OFF_T len = 1); - - /** - * Acquire a read lock, but block if a writer hold the lock. - * Returns -1 on failure. If we "failed" because someone else - * already had the lock, @c errno is set to @c EBUSY. - */ - int acquire_read (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /** - * Conditionally acquire a read lock (i.e., won't block). Returns - * -1 on failure. If we "failed" because someone else already had - * the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_read (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1); - - /// Get underlying ACE_HANDLE for the file. - ACE_HANDLE get_handle (void) const; - - /** - * Set underlying ACE_HANDLE. Note that this method assumes - * ownership of the and will close it down in . If - * you want the to stay open when is called make - * sure to call on the before closing it. You are - * responsible for the closing the existing before - * overwriting it. - */ - void set_handle (ACE_HANDLE); - - /// Dump state of the object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Locking structure for OS record locks. - ACE_OS::ace_flock_t lock_; - - /// Keeps track of whether has been called yet to avoid - /// multiple calls, e.g., explicitly and implicitly in the - /// destructor. This flag isn't protected by a lock, so make sure - /// that you don't have multiple threads simultaneously calling - /// on the same object, which is a bad idea anyway... - int removed_; - - /// Keeps track of whether to unlink the underlying file in the - /// destructor. - int unlink_in_destructor_; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_File_Lock &); - ACE_File_Lock (const ACE_File_Lock &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/File_Lock.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FILE_LOCK_H */ - diff --git a/dep/include/ace/File_Lock.inl b/dep/include/ace/File_Lock.inl deleted file mode 100644 index 20b00039222..00000000000 --- a/dep/include/ace/File_Lock.inl +++ /dev/null @@ -1,96 +0,0 @@ -// -*- C++ -*- -// -// $Id: File_Lock.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_File_Lock::acquire_read (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::acquire_read"); - return ACE_OS::flock_rdlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::tryacquire_read (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::tryacquire_read"); - return ACE_OS::flock_tryrdlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::tryacquire_write (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::tryacquire_write"); - return ACE_OS::flock_trywrlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::tryacquire_write_upgrade (short whence, - ACE_OFF_T start, - ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::tryacquire_write_upgrade"); - return ACE_OS::flock_trywrlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::tryacquire (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::tryacquire"); - return this->tryacquire_write (whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::acquire_write (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::acquire_write"); - return ACE_OS::flock_wrlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::acquire (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::acquire"); - return this->acquire_write (whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::release (short whence, ACE_OFF_T start, ACE_OFF_T len) -{ -// ACE_TRACE ("ACE_File_Lock::release"); - return ACE_OS::flock_unlock (&this->lock_, whence, start, len); -} - -ACE_INLINE int -ACE_File_Lock::remove (int unlink_file) -{ -// ACE_TRACE ("ACE_File_Lock::remove"); - - int result = 0; - - if (this->removed_ == 0) - { - this->removed_ = 1; - result = ACE_OS::flock_destroy (&this->lock_, - unlink_file); - } - return result; -} - -ACE_INLINE ACE_HANDLE -ACE_File_Lock::get_handle (void) const -{ -// ACE_TRACE ("ACE_File_Lock::get_handle"); - return this->lock_.handle_; -} - -ACE_INLINE void -ACE_File_Lock::set_handle (ACE_HANDLE h) -{ -// ACE_TRACE ("ACE_File_Lock::set_handle"); - this->lock_.handle_ = h; - this->removed_ = 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Filecache.h b/dep/include/ace/Filecache.h deleted file mode 100644 index 126082adc12..00000000000 --- a/dep/include/ace/Filecache.h +++ /dev/null @@ -1,353 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Filecache.h - * - * $Id: Filecache.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author James Hu - */ -//============================================================================= - -#ifndef ACE_FILECACHE_H -#define ACE_FILECACHE_H - -#include /**/ "ace/pre.h" - -#include "ace/Mem_Map.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Hash_Map_Manager_T.h" -#include "ace/Null_Mutex.h" -#include "ace/Synch_Traits.h" -#include "ace/RW_Thread_Mutex.h" -#include "ace/OS_NS_sys_stat.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -enum ACE_Filecache_Flag -{ - ACE_NOMAP = 0, - ACE_MAPIT = 1 -}; - -class ACE_Filecache_Object; - -/** - * @class ACE_Filecache_Handle - * - * @brief Abstraction over a real file. This is meant to be the entry - * point into the Cached Virtual Filesystem. - * - * This is a cached filesystem implementation based loosely on the - * implementation of JAWS_File. The interfaces will be nearly the - * same. The under-the-hood implementation should hopefully be a - * much faster thing. - * These will be given their own implementations later. For now, we - * borrow the implementation provided by JAWS. - * On creation, the cache is checked, and reference count is - * incremented. On destruction, reference count is decremented. If - * the reference count is 0, the file is removed from the cache. - * E.g. 1, - * { - * ACE_Filecache_Handle foo("foo.html"); - * this->peer ().send (foo.address (), foo.size ()); - * } - * E.g. 2, - * { - * ACE_Filecache_Handle foo("foo.html"); - * io->transmitfile (foo.handle (), this->peer ().handle ()); - * } - * E.g. 3, - * { - * ACE_Filecache_Handle foo("foo.html", content_length); - * this->peer ().recv (foo.address (), content_length); - * } - * TODO: - */ -class ACE_Export ACE_Filecache_Handle -{ - // (1) Get rid of the useless copying of files when reading. - // Although it does make sure the file you send isn't being changed, - // it doesn't make sure the file is in a sensible state before - // sending it. - // - // Alternative: if the file get's trashed while it is being shipped, - // let the client request the file again. The cache should have an - // updated copy by that point. - // - // (2) Use hashing for locating files. This means I need a hastable - // implementation with buckets. - // - // (3) Only lock when absolutely necessary. JAWS_Virtual_Filesystem was - // rather conservative, but for some reason it still ran into problems. - // Since this design should be simpler, problems should be easier to spot. - // -public: - - /// Query cache for file, and acquire it. Assumes the file is being - /// opened for reading. - ACE_Filecache_Handle (const ACE_TCHAR *filename, - ACE_Filecache_Flag mapit = ACE_MAPIT); - - /** - * Create new entry, and acquire it. Presence of SIZE assumes the - * file is being opened for writing. If SIZE is zero, assumes the - * file is to be removed from the cache. - */ - ACE_Filecache_Handle (const ACE_TCHAR *filename, - int size, - ACE_Filecache_Flag mapit = ACE_MAPIT); - - /// Closes any open handles, release acquired file. - ~ACE_Filecache_Handle (void); - - /// Base address of memory mapped file. - void *address (void) const; - - /// A handle (e.g., UNIX file descriptor, or NT file handle). - ACE_HANDLE handle (void) const; - - /// Any associated error in handle creation and acquisition. - int error (void) const; - - /// The size of the file. - ACE_OFF_T size (void) const; - -protected: - /// Default do nothing constructor. Prevent it from being called. - ACE_Filecache_Handle (void); - - /// Common initializations for constructors. - void init (void); - -public: - /// These come from ACE_Filecache_Object, which is an internal class. - enum - { - ACE_SUCCESS = 0, - ACE_ACCESS_FAILED, - ACE_OPEN_FAILED, - ACE_COPY_FAILED, - ACE_STAT_FAILED, - ACE_MEMMAP_FAILED, - ACE_WRITE_FAILED - }; - -private: - /// A reference to the low level instance. - ACE_Filecache_Object *file_; - - /// A 'd version of the one from . - ACE_HANDLE handle_; - - int mapit_; -}; - -typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> - ACE_Filecache_Hash; - -typedef ACE_Hash_Map_Entry ACE_Filecache_Hash_Entry; - -/** - * @class ACE_Filecache - * - * @brief A hash table holding the information about entry point into - * the Cached Virtual Filesystem. On insertion, the reference - * count is incremented. On destruction, reference count is - * decremented. - */ -class ACE_Export ACE_Filecache -{ -public: - /// Singleton pattern. - static ACE_Filecache *instance (void); - - ~ACE_Filecache (void); - - /// Returns 0 if the file associated with ``filename'' is in the cache, - /// or -1 if not. - int find (const ACE_TCHAR *filename); - - /// Return the file associated with ``filename'' if it is in the cache, - /// or create if not. - ACE_Filecache_Object *fetch (const ACE_TCHAR *filename, int mapit = 1); - - /// Remove the file associated with ``filename'' from the cache. - ACE_Filecache_Object *remove (const ACE_TCHAR *filename); - - /// Create a new Filecache_Object, returns it. - ACE_Filecache_Object *create (const ACE_TCHAR *filename, int size); - - /// Release an acquired Filecache_Object, returns it again or NULL if it - /// was deleted. - ACE_Filecache_Object *finish (ACE_Filecache_Object *&new_file); - -protected: - ACE_Filecache_Object *insert_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit); - ACE_Filecache_Object *remove_i (const ACE_TCHAR *filename); - ACE_Filecache_Object *update_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit); - -public: - - enum - { - /// For this stupid implementation, use an array. Someday, use a - /// balanced search tree, or real hash table. - ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE = 512, - - /// This determines the highwater mark in megabytes for the cache. - /// This will be ignored for now. - ACE_DEFAULT_VIRTUAL_FILESYSTEM_CACHE_SIZE = 20 - }; - -protected: - /// Prevent it from being called. - ACE_Filecache (void); - -private: - ACE_OFF_T size_; - - /// The hash table - ACE_Filecache_Hash hash_; - - /// The reference to the instance - static ACE_Filecache *cvf_; - - // = Synchronization variables. - ACE_SYNCH_RW_MUTEX hash_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]; - ACE_SYNCH_RW_MUTEX file_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]; -}; - -/** - * @class ACE_Filecache_Object - * - * @brief Abstraction over a real file. This is what the Virtual - * Filesystem contains. This class is not intended for general - * consumption. Please consult a physician before attempting to - * use this class. - */ -class ACE_Export ACE_Filecache_Object -{ -public: - friend class ACE_Filecache; - - /// Creates a file for reading. - ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa = 0, - int mapit = 1); - - /// Creates a file for writing. - ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_OFF_T size, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa = 0); - - /// Only if reference count is zero should this be called. - ~ACE_Filecache_Object (void); - - /// Increment the reference_count_. - int acquire (void); - - /// Decrement the reference_count_. - int release (void); - - // = error_ accessors - int error (void) const; - int error (int error_value, - const ACE_TCHAR *s = ACE_TEXT ("ACE_Filecache_Object")); - - /// filename_ accessor - const ACE_TCHAR *filename (void) const; - - /// handle_ accessor. - ACE_HANDLE handle (void) const; - - /// Base memory address for memory mapped file. - void *address (void) const; - - /// size_ accessor. - ACE_OFF_T size (void) const; - - /// True if file on disk is newer than cached file. - int update (void) const; - -protected: - /// Prevent from being called. - ACE_Filecache_Object (void); - - /// Common initialization code, - void init (void); - -private: - /// Internal error logging method, no locking. - int error_i (int error_value, - const ACE_TCHAR *s = ACE_TEXT ("ACE_Filecache_Object")); - -public: - - enum Creation_States - { - ACE_READING = 1, - ACE_WRITING = 2 - }; - - enum Error_Conditions - { - ACE_SUCCESS = 0, - ACE_ACCESS_FAILED, - ACE_OPEN_FAILED, - ACE_COPY_FAILED, - ACE_STAT_FAILED, - ACE_MEMMAP_FAILED, - ACE_WRITE_FAILED - }; - -private: - /// The temporary file name and the real file name. The real file is - /// copied into the temporary file for safety reasons. - ACE_TCHAR *tempname_; - ACE_TCHAR filename_[MAXPATHLEN + 1]; - - /// Holds the memory mapped version of the temporary file. - ACE_Mem_Map mmap_; - - /// The descriptor to the temporary file. - ACE_HANDLE handle_; - - /// Used to compare against the real file to test if an update is needed. - ACE_stat stat_; - ACE_OFF_T size_; - - /// Status indicators. - int action_; - int error_; - - /// If set to 1, means the object is flagged for removal. - int stale_; - - /// Security attribute object. - LPSECURITY_ATTRIBUTES sa_; - - /// The default initializer - ACE_SYNCH_RW_MUTEX junklock_; - - /// Provides a bookkeeping mechanism for users of this object. - ACE_SYNCH_RW_MUTEX &lock_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_FILECACHE_H */ - diff --git a/dep/include/ace/Flag_Manip.h b/dep/include/ace/Flag_Manip.h deleted file mode 100644 index 6bd797e5606..00000000000 --- a/dep/include/ace/Flag_Manip.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Flag_Manip.h - * - * $Id: Flag_Manip.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class includes the functions used for the Flag Manipulation. - * - * @author Priyanka Gontla - */ -//============================================================================= - -#ifndef ACE_FLAG_MANIP_H -#define ACE_FLAG_MANIP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/os_include/os_fcntl.h" /* For values passed to these methods */ - -#if defined (ACE_EXPORT_MACRO) -# undef ACE_EXPORT_MACRO -#endif -#define ACE_EXPORT_MACRO ACE_Export - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE -{ - // = Set/get/clear various flags related to I/O HANDLE. - /// Set flags associated with @a handle. - extern ACE_Export int set_flags (ACE_HANDLE handle, - int flags); - - /// Clear flags associated with @a handle. - extern ACE_Export int clr_flags (ACE_HANDLE handle, - int flags); - - /// Return the current setting of flags associated with @a handle. - ACE_NAMESPACE_INLINE_FUNCTION int get_flags (ACE_HANDLE handle); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Flag_Manip.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FLAG_MANIP_H */ - diff --git a/dep/include/ace/Flag_Manip.inl b/dep/include/ace/Flag_Manip.inl deleted file mode 100644 index 229a4ee596c..00000000000 --- a/dep/include/ace/Flag_Manip.inl +++ /dev/null @@ -1,26 +0,0 @@ -// -*- C++ -*- -// -// $Id: Flag_Manip.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_fcntl.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Return flags currently associated with handle. -ACE_INLINE int -ACE::get_flags (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE::get_flags"); - -#if defined (ACE_LACKS_FCNTL) - // ACE_OS::fcntl is not supported. It - // would be better to store ACE's notion of the flags - // associated with the handle, but this works for now. - ACE_UNUSED_ARG (handle); - return 0; -#else - return ACE_OS::fcntl (handle, F_GETFL, 0); -#endif /* ACE_LACKS_FCNTL */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Framework_Component.h b/dep/include/ace/Framework_Component.h deleted file mode 100644 index fecd8ccf3bb..00000000000 --- a/dep/include/ace/Framework_Component.h +++ /dev/null @@ -1,211 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Framework_Component.h - * - * $Id: Framework_Component.h 80826 2008-03-04 14:51:23Z wotte $ - * - * A prototype mechanism that allows framework components, singletons - * such as ACE_Reactor, ACE_Proactor, etc, to be registered with a - * central repository managed by the ACE_Object_Manager or - * ACE_Service_Config that will handle destruction. - * - * This technique obviates changing ACE_Object_Manager and - * ACE_Service_Config everytime a new framework is added. Which also - * means that unused framework components don't need to linked into - * the final application which is important for applications with - * stringent footprint requirements. - * - * Framework components need only provide a static method, - * close_singleton() and add the ACE_REGISTER_FRAMEWORK_COMPONENT macro - * call to their instance() methods in order to participate. Components - * that don't have a close_singleton() method can also participate via - * template specialization of ACE_Framework_Component_T. - * - * This design uses the External Polymorphism pattern to avoid having - * to derive all framework components from a common base class that - * has virtual methods (this is crucial to avoid unnecessary overhead), - * and is based on the dump debugging implementation found in - * . - * - * @author Don Hinton . - */ -//============================================================================= - -#ifndef ACE_FRAMEWORK_COMPONENT_H -#define ACE_FRAMEWORK_COMPONENT_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" -#include "ace/Thread_Mutex.h" - -#define ACE_DEFAULT_FRAMEWORK_REPOSITORY_SIZE 1024 - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Framework_Component - * - * @brief Base class that defines a uniform interface for all managed - * framework components. - */ -class ACE_Export ACE_Framework_Component -{ -public: - friend class ACE_Framework_Repository; - - /// Constructor. - ACE_Framework_Component (void *_this, - const ACE_TCHAR *dll_name = 0, - const ACE_TCHAR *name = 0); - - /// Close the contained singleton. - virtual void close_singleton (void) = 0; - -protected: - /// Destructor. - virtual ~ACE_Framework_Component (void); - -private: - // No copy possible - ACE_Framework_Component (const ACE_Framework_Component &); - void operator= (const ACE_Framework_Component &); - -private: - /// Pointer to the actual component. - const void *this_; - - /// Library associated with this component - const ACE_TCHAR *dll_name_; - - /// Component name - const ACE_TCHAR *name_; -}; - -/** - * @class ACE_Framework_Repository - * - * @brief Contains all framework components used by an application. - * - * This class contains a vector of ACE_Framework_Component *'s. On - * destruction, framework components are destroyed in the reverse order - * that they were added originally. - */ -class ACE_Export ACE_Framework_Repository -{ -public: - // This is just to silence a compiler warning about no public ctors - friend class ACE_Framework_Component; - - enum - { - DEFAULT_SIZE = ACE_DEFAULT_FRAMEWORK_REPOSITORY_SIZE - }; - - /// Close down the repository and free up dynamically allocated - /// resources. - ~ACE_Framework_Repository (void); - - /// Initialize the repository. - int open (int size = DEFAULT_SIZE); - - /// Close down the repository and free up dynamically allocated - /// resources, also called by dtor. - int close (void); - - /// Get pointer to a process-wide ACE_Framework_Repository. - static ACE_Framework_Repository *instance - (int size = ACE_Framework_Repository::DEFAULT_SIZE); - - /// Delete the dynamically allocated Singleton. - static void close_singleton (void); - - // = Search structure operations (all acquire locks as necessary). - - /// Insert a new component. Returns -1 when the repository is full - /// and 0 on success. - int register_component (ACE_Framework_Component *fc); - - /// Remove a component. Returns -1 on error or if component not found - /// and 0 on success. - int remove_component (const ACE_TCHAR *name); - - /// Remove all components associated with a particular dll. - int remove_dll_components (const ACE_TCHAR *dll_name); - - /// Return the current size of the repository. - int current_size (void) const; - - /// Return the total size of the repository. - int total_size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - /// Initialize the repository. - ACE_Framework_Repository (int size = ACE_Framework_Repository::DEFAULT_SIZE); - -private: - - /// Actually removes the dll components, must be called with locks held. - int remove_dll_components_i (const ACE_TCHAR *dll_name); - - /// Compact component_vector_ after components have been removed__maintains - /// order. - void compact (void); - - /// Disallow copying and assignment. - ACE_Framework_Repository (const ACE_Framework_Repository &); - ACE_Framework_Repository &operator= (const ACE_Framework_Repository &); - -private: - - /// Contains all the framework components. - ACE_Framework_Component **component_vector_; - - /// Current number of components. - int current_size_; - - /// Maximum number of components. - int total_size_; - - /// Pointer to a process-wide ACE_Framework_Repository. - static ACE_Framework_Repository *repository_; - - /// Flag set when repository is the process of shutting down. This - /// is necessary to keep from self-deadlocking since some of - /// the components might make calls back to the repository to - /// unload their components, e.g., ACE_DLL_Manager. - static sig_atomic_t shutting_down_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for the MT_SAFE Repository - ACE_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Framework_Component.inl" -#endif /* __ACE_INLINE__ */ - -// Include the templates classes at this point. -#include "ace/Framework_Component_T.h" - -#include /**/ "ace/post.h" -#endif /* ACE_FRAMEWORK_COMPONENT_H */ - diff --git a/dep/include/ace/Framework_Component.inl b/dep/include/ace/Framework_Component.inl deleted file mode 100644 index 1fb2de38b85..00000000000 --- a/dep/include/ace/Framework_Component.inl +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- -// -// $Id: Framework_Component.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" -#include "ace/Guard_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Framework_Component::ACE_Framework_Component (void *_this, - const ACE_TCHAR *dll_name, - const ACE_TCHAR *name) - : this_ (_this), - dll_name_ (ACE::strnew (dll_name ? dll_name : ACE_TEXT (""))), - name_ (ACE::strnew (name ? name : ACE_TEXT (""))) -{ - ACE_TRACE ("ACE_Framework_Component::ctor"); -} - -/***************************************************************/ - -ACE_INLINE int -ACE_Framework_Repository::current_size (void) const -{ - ACE_TRACE ("ACE_Framework_Repository::current_size"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, -1)); - return this->current_size_; -} - -ACE_INLINE int -ACE_Framework_Repository::total_size (void) const -{ - ACE_TRACE ("ACE_Framework_Repository::total_size"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, -1)); - return this->total_size_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Framework_Component_T.h b/dep/include/ace/Framework_Component_T.h deleted file mode 100644 index f8d365a86c0..00000000000 --- a/dep/include/ace/Framework_Component_T.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Framework_Component_T.h - * - * $Id: Framework_Component_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - */ -//============================================================================= - -#ifndef ACE_FRAMEWORK_COMPONENT_T_H -#define ACE_FRAMEWORK_COMPONENT_T_H -#include /**/ "ace/pre.h" -#include "ace/Framework_Component.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Framework_Component_T - * - * @brief This class inherits the interface of the abstract - * ACE_Framework_Component class and is instantiated with the - * implementation of the concrete component class @c class Concrete. - * - * This design is similar to the Adapter and Decorator patterns - * from the ``Gang of Four'' book. Note that @c class Concrete - * need not inherit from a common class since ACE_Framework_Component - * provides the uniform virtual interface! (implementation based on - * ACE_Dumpable_Adapter in . - */ -template -class ACE_Framework_Component_T : public ACE_Framework_Component -{ -public: - // = Initialization and termination methods. - - /// Constructor. - ACE_Framework_Component_T (Concrete *concrete); - - /// Destructor. - ~ACE_Framework_Component_T (void); - - /// Close the contained singleton. - void close_singleton (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -// This macro should be called in the instance() method -// of the Concrete class that will be managed. Along -// with the appropriate template instantiation. -#define ACE_REGISTER_FRAMEWORK_COMPONENT(CLASS, INSTANCE) \ - ACE_Framework_Repository::instance ()->register_component \ - (new ACE_Framework_Component_T (INSTANCE)); - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Framework_Component_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Framework_Component_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_FRAMEWORK_COMPONENT_T_H */ - diff --git a/dep/include/ace/Free_List.h b/dep/include/ace/Free_List.h deleted file mode 100644 index ba1f0e4dded..00000000000 --- a/dep/include/ace/Free_List.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Free_List.h - * - * $Id: Free_List.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Darrell Brunsch (brunsch@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_FREE_LIST_H -#define ACE_FREE_LIST_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/Default_Constants.h" -#include "ace/os_include/os_stddef.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Free_List - * - * @brief Implements a free list. - * - * This class maintains a free list of nodes of type T. - */ -template -class ACE_Free_List -{ -public: - /// Destructor - removes all the elements from the free_list. - virtual ~ACE_Free_List (void); - - /// Inserts an element onto the free list (if it isn't past the high - /// water mark). - virtual void add (T *element) = 0; - - /// Takes a element off the freelist and returns it. It creates - /// new elements if the size is at or below the low water mark. - virtual T *remove (void) = 0; - - /// Returns the current size of the free list. - virtual size_t size (void) = 0; - - /// Resizes the free list to @a newsize. - virtual void resize (size_t newsize) = 0; -}; - -/** - * @class ACE_Locked_Free_List - * - * @brief Implements a free list. - * - * This class maintains a free list of nodes of type T. It - * depends on the type T having a and - * method. It maintains a mutex so the freelist can be used in - * a multithreaded program . - */ -template -class ACE_Locked_Free_List : public ACE_Free_List -{ -public: - // = Initialization and termination. - /** - * Constructor takes a @a mode (i.e., ACE_FREE_LIST_WITH_POOL or - * ACE_PURE_FREE_LIST), a count of the number of nodes to - * , a low and high water mark ( and ) that - * indicate when to allocate more nodes, an increment value () - * that indicates how many nodes to allocate when the list must - * grow. - */ - ACE_Locked_Free_List (int mode = ACE_FREE_LIST_WITH_POOL, - size_t prealloc = ACE_DEFAULT_FREE_LIST_PREALLOC, - size_t lwm = ACE_DEFAULT_FREE_LIST_LWM, - size_t hwm = ACE_DEFAULT_FREE_LIST_HWM, - size_t inc = ACE_DEFAULT_FREE_LIST_INC); - - /// Destructor - removes all the elements from the free_list. - virtual ~ACE_Locked_Free_List (void); - - /// Inserts an element onto the free list (if it isn't past the high - /// water mark). - virtual void add (T *element); - - /// Takes a element off the freelist and returns it. It creates - /// new elements if the size is at or below the low water mark. - virtual T *remove (void); - - /// Returns the current size of the free list. - virtual size_t size (void); - - /// Resizes the free list to @a newsize. - virtual void resize (size_t newsize); - -protected: - /// Allocates @a n extra nodes for the freelist. - virtual void alloc (size_t n); - - /// Removes and frees @a n nodes from the freelist. - virtual void dealloc (size_t n); - - /// Free list operation mode, either ACE_FREE_LIST_WITH_POOL or - /// ACE_PURE_FREE_LIST. - int mode_; - - /// Pointer to the first node in the freelist. - T *free_list_; - - /// Low water mark. - size_t lwm_; - - /// High water mark. - size_t hwm_; - - /// Increment value. - size_t inc_; - - /// Keeps track of the size of the list. - size_t size_; - - /// Synchronization variable for ACE_Timer_Queue. - ACE_LOCK mutex_; - -private: - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Free_List (const ACE_Locked_Free_List &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Locked_Free_List &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Free_List.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Free_List.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_FREE_LIST_H */ - diff --git a/dep/include/ace/Functor.h b/dep/include/ace/Functor.h deleted file mode 100644 index bff4cf375b1..00000000000 --- a/dep/include/ace/Functor.h +++ /dev/null @@ -1,593 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Functor.h - * - * $Id: Functor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Non-templatized classes and class template specializations for - * implementing function objects that are used in various places - * in ACE. There are currently two major categories of function - * objects in ACE: GoF Command Pattern objects, and STL-style - * functors for comparison of container elements. The command objects - * are invoked via an execute () method, while the STL-style functors are - * invoked via an operator() () method. - * Non-templatized classes for implementing the GoF Command Pattern, - * also known as functors or function objects. - * - * - * @author Chris Gill - * @author Based on Command Pattern implementations originally done by - * @author Carlos O'Ryan - * @author Douglas C. Schmidt - * @author Sergio Flores-Gaitan - * @author and on STL-style functor implementations originally done by - * @author Irfan Pyarali - */ -//========================================================================== - -#ifndef ACE_FUNCTOR_H -#define ACE_FUNCTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/ACE_export.h" -#include "ace/Basic_Types.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -////////////////////////////////////////////////////////////// -// GOF Command Pattern Classes and Template Specializations // -////////////////////////////////////////////////////////////// - -/** - * @class ACE_Command_Base - * - * @brief Defines an abstract class that allows us to invoke commands - * without knowing anything about the implementation. - * - * This class declares an interface to execute a command - * independent of the effect of the command, or the objects used - * to implement it. - */ -class ACE_Export ACE_Command_Base -{ -public: - // = Initialization and termination methods. - /// Default constructor. - ACE_Command_Base (void); - - /// Virtual destructor. - virtual ~ACE_Command_Base (void); - - /** - * Invokes the method encapsulated by the command, passing along the - * passed argument (if any). Users of classes derived from this - * class must ensure that the resulting invocation can tolerate a - * null void pointer being passed, or otherwise ensure that this - * will never occur. - */ - virtual int execute (void *arg = 0) = 0; -}; - -//////////////////////////////////////////////////////////// -// STL-style Functor Classes and Template Specializations // -//////////////////////////////////////////////////////////// - -// Forward declaration since we are going to specialize that template -// here. The template itself requires this file so every user of the -// template should also see the specialization. -template class ACE_Hash; -template class ACE_Equal_To; -template class ACE_Less_Than; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a char - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (char t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a signed char - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (signed char t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing an unsigned char - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (unsigned char t) const; -}; - -#if 0 -// @@ ADD HASHES FOR ACE TYPES - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a 16-bit signed number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_INT16 t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a 16-bit unsigned number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_UINT16 t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a 32-bit signed number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_INT32 t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a 32-bit unsigned number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_UINT32 t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a 64-bit unsigned number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_UINT64 t) const; -}; - -// @@ DONE ADDING HASHES FOR ACE TYPES -#endif - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a short number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (short t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing an unsigned short number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (unsigned short t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing an int number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (int t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing an unsigned int number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (unsigned int t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a long number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (long t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing an unsigned long number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (unsigned long t) const; -}; - -#if !defined (ACE_LACKS_LONGLONG_T) && (ACE_SIZEOF_LONG < 8) -/** - * @class ACE_Hash - * - * @brief Function object for hashing a signed 64-bit number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (ACE_INT64 t) const; -}; -#endif /* !ACE_LACKS_LONGLONG_T && ACE_SIZEOF_LONG < 8 */ - -// We can do this even if ACE_LACKS_UNSIGNEDLONGLONG_T because there's an -// emulation for it in ACE_U_LongLong. -#if (ACE_SIZEOF_LONG < 8) -/** - * @class ACE_Hash - * - * @brief Function object for hashing an unsigned 64-bit number - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (const ACE_UINT64 &t) const; -}; -#endif /* ACE_SIZEOF_LONG < 8 */ - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a const string - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const char *t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a string - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const char *t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a void * - */ -template<> -class ACE_Export ACE_Hash -{ -public: - unsigned long operator () (const void *) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two const strings are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const char *lhs, - const char *rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two non-const - * strings are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const char *lhs, - const char *rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two unsigned - * 16 bit ints are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls built-in operators - int operator () (const ACE_UINT16 lhs, - const ACE_UINT16 rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two - * 16 bit ints are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls built-in operators - int operator () (const ACE_INT16 lhs, - const ACE_INT16 rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two unsigned - * 32 bit ints are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls built-in operators - int operator () (const ACE_UINT32 lhs, - const ACE_UINT32 rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two - * 32 bit ints are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls built-in operators - int operator () (const ACE_INT32 lhs, - const ACE_INT32 rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two unsigned - * 64 bit ints are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls built-in operators - int operator () (const ACE_UINT64 lhs, - const ACE_UINT64 rhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first const string - * is less than the second const string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const char *lhs, - const char *rhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first string - * is less than the second string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const char *lhs, - const char *rhs) const; -}; - -#if defined (ACE_HAS_WCHAR) - -# if ! defined (ACE_LACKS_NATIVE_WCHAR_T) -/** - * @class ACE_Hash - * - * @brief Function object for hashing a wchar_t - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Simply returns t - unsigned long operator () (wchar_t t) const; -}; -# endif /* ACE_LACKS_NATIVE_WCHAR_T */ -/** - * @class ACE_Hash - * - * @brief Function object for hashing a const string - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const wchar_t *t) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a string - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const wchar_t *t) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two const strings are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const wchar_t *lhs, - const wchar_t *rhs) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two non-const - * strings are equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const wchar_t *lhs, - const wchar_t *rhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first const string - * is less than the second const string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const wchar_t *lhs, - const wchar_t *rhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first string - * is less than the second string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const wchar_t *lhs, - const wchar_t *rhs) const; -}; - -#endif // ACE_HAS_WCHAR - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Functor.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_FUNCTOR_H */ - diff --git a/dep/include/ace/Functor.inl b/dep/include/ace/Functor.inl deleted file mode 100644 index c8477c2b8eb..00000000000 --- a/dep/include/ace/Functor.inl +++ /dev/null @@ -1,282 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Functor.inl - * - * $Id: Functor.inl 80826 2008-03-04 14:51:23Z wotte $ - * - * Inlinable method definitions for non-templatized classes - * and template specializations implementing the GOF Command Pattern, - * and STL-style functors. - * - * - * @author Chris Gill - * - * Based on Command Pattern implementations originally done by - * - * Carlos O'Ryan - * Douglas C. Schmidt - * Sergio Flores-Gaitan - * - * and on STL-style functor implementations originally done by - * Irfan Pyarali - */ -//============================================================================= - -#include "ace/ACE.h" -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -////////////////////////////////////////////////////////////// -// GOF Command Pattern Classes and Template Specializations // -////////////////////////////////////////////////////////////// - -// Default constructor. - -ACE_INLINE -ACE_Command_Base::ACE_Command_Base (void) -{ -} - -//////////////////////////////////////////////////////////// -// STL-style Functor Classes and Template Specializations // -//////////////////////////////////////////////////////////// - -ACE_INLINE unsigned long -ACE_Hash::operator () (char t) const -{ - return t; -} - -#if defined (ACE_HAS_WCHAR) && ! defined (ACE_LACKS_NATIVE_WCHAR_T) -ACE_INLINE unsigned long -ACE_Hash::operator () (wchar_t t) const -{ - return t; -} -#endif /* ACE_HAS_WCHAR && ! ACE_LACKS_NATIVE_WCHAR_T */ - -ACE_INLINE unsigned long -ACE_Hash::operator () (signed char t) const -{ - return t; -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (unsigned char t) const -{ - return t; -} - -#if 0 -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_INT16 t) const -{ - return t; -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_UINT16 t) const -{ - return t; -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_INT32 t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_UINT32 t) const -{ - return t; -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_UINT64 t) const -{ -#if (ACE_SIZEOF_LONG == 4) - return ACE_U64_TO_U32 (t); -#else - return static_cast (t); -#endif /* ACE_SIZEOF_LONG */ -} -#endif - -ACE_INLINE unsigned long -ACE_Hash::operator () (short t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (unsigned short t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (int t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (unsigned int t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (long t) const -{ - return static_cast (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (unsigned long t) const -{ - return t; -} - -// This #if needs to match the one in Functor.h -#if !defined (ACE_LACKS_LONGLONG_T) && (ACE_SIZEOF_LONG < 8) -ACE_INLINE unsigned long -ACE_Hash::operator () (ACE_INT64 t) const -{ - return static_cast (t); -} -#endif /* !ACE_LACKS_LONGLONG_T && ACE_SIZEOF_LONG < 8 */ - -#if (ACE_SIZEOF_LONG < 8) -ACE_INLINE unsigned long -ACE_Hash::operator () (const ACE_UINT64 &t) const -{ -#if (ACE_SIZEOF_LONG == 4) - return ACE_U64_TO_U32 (t); -#else - return static_cast (t); -#endif /* ACE_SIZEOF_LONG */ -} -#endif /* !ACE_LACKS_UNSIGNEDLONGLONG_T */ - -ACE_INLINE unsigned long -ACE_Hash::operator () (const char *t) const -{ - return ACE::hash_pjw (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (const char *t) const -{ - return ACE::hash_pjw (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (const void *t) const -{ - return static_cast (reinterpret_cast (t)); -} - -/***********************************************************************/ -ACE_INLINE int -ACE_Equal_To::operator () (const char *lhs, const char *rhs) const -{ - return !ACE_OS::strcmp (lhs, rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const char *lhs, const char *rhs) const -{ - return !ACE_OS::strcmp (lhs, rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_UINT16 lhs, const ACE_UINT16 rhs) const -{ - return (lhs == rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_INT16 lhs, const ACE_INT16 rhs) const -{ - return (lhs == rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_UINT32 lhs, const ACE_UINT32 rhs) const -{ - return (lhs == rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_INT32 lhs, const ACE_INT32 rhs) const -{ - return (lhs == rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_UINT64 lhs, const ACE_UINT64 rhs) const -{ - return (lhs == rhs); -} - -/****************************************************************************/ -ACE_INLINE int -ACE_Less_Than::operator () (const char *lhs, const char *rhs) const -{ - return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0; -} - -ACE_INLINE int -ACE_Less_Than::operator () (const char *lhs, const char *rhs) const -{ - return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0; -} - -#if defined (ACE_HAS_WCHAR) - -ACE_INLINE unsigned long -ACE_Hash::operator () (const wchar_t *t) const -{ - return ACE::hash_pjw (t); -} - -ACE_INLINE unsigned long -ACE_Hash::operator () (const wchar_t *t) const -{ - return ACE::hash_pjw (t); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const wchar_t *lhs, - const wchar_t *rhs) const -{ - return !ACE_OS::strcmp (lhs, rhs); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const wchar_t *lhs, - const wchar_t *rhs) const -{ - return !ACE_OS::strcmp (lhs, rhs); -} - -ACE_INLINE int -ACE_Less_Than::operator () (const wchar_t *lhs, const wchar_t *rhs) const -{ - return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0; -} - -ACE_INLINE int -ACE_Less_Than::operator () (const wchar_t *lhs, const wchar_t *rhs) const -{ - return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0; -} - -#endif // ACE_HAS_WCHAR - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Functor_String.h b/dep/include/ace/Functor_String.h deleted file mode 100644 index 6167bd5b5b2..00000000000 --- a/dep/include/ace/Functor_String.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Functor_String.h - * - * $Id: Functor_String.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Class template specializations for ACE_*String types implementing - * function objects that are used in various places in ATC. They - * could be placed in Functor.h. But we don't want to couple string - * types to the rest of ACE+TAO. Hence they are placed in a seperate - * file. - */ -//========================================================================== -#ifndef ACE_FUNCTOR_STRING_H -#define ACE_FUNCTOR_STRING_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/ACE_export.h" -#include "ace/SStringfwd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -//////////////////////////////////////////////////////////// -// STL-style Functor Classes and Template Specializations // -//////////////////////////////////////////////////////////// - -// Forward declaration since we are going to specialize that template -// here. The template itself requires this file so every user of the -// template should also see the specialization. -template class ACE_Hash; -template class ACE_Equal_To; -template class ACE_Less_Than; - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two ACE_CStrings are - * equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - int operator () (const ACE_CString &lhs, - const ACE_CString &rhs) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a ACE_CString - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const ACE_CString &lhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first const string - * is less than the second const string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const ACE_CString &lhs, - const ACE_CString &rhs) const; -}; - -#if defined (ACE_USES_WCHAR) - -/** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two ACE_CStrings are - * equal. - */ -template<> -class ACE_Export ACE_Equal_To -{ -public: - int operator () (const ACE_WString &lhs, - const ACE_WString &rhs) const; -}; - -/** - * @class ACE_Hash - * - * @brief Function object for hashing a ACE_WString - */ -template<> -class ACE_Export ACE_Hash -{ -public: - /// Calls ACE::hash_pjw - unsigned long operator () (const ACE_WString &lhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first const string - * is less than the second const string. - */ -template<> -class ACE_Export ACE_Less_Than -{ -public: - /// Simply calls ACE_OS::strcmp - int operator () (const ACE_WString &lhs, - const ACE_WString &rhs) const; -}; - -#endif /*ACE_USES_WCHAR*/ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Functor_String.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /*ACE_FUNCTOR_STRING_H*/ - diff --git a/dep/include/ace/Functor_String.inl b/dep/include/ace/Functor_String.inl deleted file mode 100644 index f4155044fce..00000000000 --- a/dep/include/ace/Functor_String.inl +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id: Functor_String.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" -#include "ace/String_Base.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE unsigned long -ACE_Hash::operator () (const ACE_CString &t) const -{ - return t.hash (); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_CString &lhs, - const ACE_CString &rhs) const -{ - return lhs == rhs; -} - -ACE_INLINE int -ACE_Less_Than::operator () (const ACE_CString &lhs, - const ACE_CString &rhs) const -{ - return (lhs < rhs); -} - -#if defined (ACE_USES_WCHAR) -ACE_INLINE unsigned long -ACE_Hash::operator () (const ACE_WString &t) const -{ - return t.hash (); -} - -ACE_INLINE int -ACE_Equal_To::operator () (const ACE_WString &lhs, - const ACE_WString &rhs) const -{ - return lhs == rhs; -} - -ACE_INLINE int -ACE_Less_Than::operator () (const ACE_WString &lhs, - const ACE_WString &rhs) const -{ - return (lhs < rhs); -} - -#endif /*ACE_USES_WCHAR*/ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Functor_T.h b/dep/include/ace/Functor_T.h deleted file mode 100644 index 13387119f53..00000000000 --- a/dep/include/ace/Functor_T.h +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Functor_T.h - * - * $Id: Functor_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Templatized classes for implementing function objects that are - * used in various places in ACE. There are currently two major - * categories of function objects in ACE: GOF Command Pattern - * objects, and STL-style functors for comparison of container - * elements. The command objects are invoked via an - * method, while the STL-style functors are invoked via an - * method. - * - * - * @author Chris Gill - * @author Based on Command Pattern implementations originally done by - * @author Carlos O'Ryan - * @author Douglas C. Schmidt - * @author Sergio Flores-Gaitan - * @author and on STL-style functor implementations originally done by - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_FUNCTOR_T_H -#define ACE_FUNCTOR_T_H -#include /**/ "ace/pre.h" - -#include "ace/Functor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Functor_String.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/////////////////////////////////// -// GOF Command Pattern Templates // -/////////////////////////////////// - -/** - * @class ACE_Command_Callback - * - * @brief Defines a class template that allows us to invoke a GOF - * command style callback to an object without knowing anything - * about the object except its type. - * - * This class declares an interface to execute operations, - * binding a RECEIVER object with an ACTION. The RECEIVER knows - * how to implement the operation. A class can invoke operations - * without knowing anything about it, or how it was implemented. - */ -template -class ACE_Command_Callback : public ACE_Command_Base -{ -public: - /// Constructor: sets the of the Command to recvr, and the - /// of the Command to . - ACE_Command_Callback (RECEIVER &recvr, ACTION action); - - /// Virtual destructor. - virtual ~ACE_Command_Callback (void); - - /// Invokes the method from the object . - virtual int execute (void *arg = 0); - -private: - /// Object where the method resides. - RECEIVER &receiver_; - - /// Method that is going to be invoked. - ACTION action_; -}; - -///////////////////////////////// -// STL-style Functor Templates // -///////////////////////////////// - -/** - * @class ACE_Hash - * - * @brief Function object for hashing - */ -template -class ACE_Hash -{ -public: - /// Simply calls t.hash () - unsigned long operator () (const TYPE &t) const; -}; - -/** - * @class ACE_Pointer_Hash - * - * @brief Function object for hashing pointers - */ -template -class ACE_Pointer_Hash -{ -public: - /// Simply returns t. - unsigned long operator () (TYPE t) const; -}; - -/** - * @class ACE_Equal_To - * - * @brief Function object for comparing two objects of - * the given type for equality. - */ -template -class ACE_Equal_To -{ -public: - /// Simply calls operator== - bool operator () (const TYPE &lhs, - const TYPE &rhs) const; -}; - -/** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first object of - * the given type is less than the second object of the same - * type. - */ -template -class ACE_Less_Than -{ -public: - /// Simply calls operator< - bool operator () (const TYPE &lhs, - const TYPE &rhs) const; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Functor_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Functor_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Functor_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_FUNCTOR_T_H */ - diff --git a/dep/include/ace/Functor_T.inl b/dep/include/ace/Functor_T.inl deleted file mode 100644 index 35cfed5b798..00000000000 --- a/dep/include/ace/Functor_T.inl +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -// -// $Id: Functor_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE unsigned long -ACE_Hash::operator () (const TYPE &t) const -{ - return t.hash (); -} - -template ACE_INLINE unsigned long -ACE_Pointer_Hash::operator () (TYPE t) const -{ -#if defined (ACE_WIN64) - // The cast below is legit... we only want a hash, and need not convert - // the hash back to a pointer. -# pragma warning(push) -# pragma warning(disable : 4311) /* Truncate pointer to unsigned long */ -#endif /* ACE_WIN64 */ - return reinterpret_cast (t); -#if defined (ACE_WIN64) -# pragma warning(pop) -#endif /* ACE_WIN64 */ -} - -template ACE_INLINE bool -ACE_Equal_To::operator () (const TYPE &lhs, - const TYPE &rhs) const -{ - return lhs == rhs; -} - -template ACE_INLINE bool -ACE_Less_Than::operator () (const TYPE &lhs, - const TYPE &rhs) const -{ - return lhs < rhs; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Future.h b/dep/include/ace/Future.h deleted file mode 100644 index d86efd5a485..00000000000 --- a/dep/include/ace/Future.h +++ /dev/null @@ -1,388 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Future.h - * - * $Id: Future.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Andres Kruse - * @author Douglas C. Schmidt - * @author Per Andersson and - * @author John Tucker - */ -//============================================================================= - -#ifndef ACE_FUTURE_H -#define ACE_FUTURE_H - -#include /**/ "ace/pre.h" - -#include "ace/Unbounded_Set.h" -#include "ace/Strategies_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -template class ACE_Future_Holder; -template class ACE_Future_Observer; -template class ACE_Future_Rep; -template class ACE_Future; - -/** - * @class ACE_Future_Holder - * - * @brief Implementation of object that holds an ACE_Future. - */ -template -class ACE_Future_Holder -{ -public: - ACE_Future_Holder (const ACE_Future &future); - ~ACE_Future_Holder (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - ACE_Future item_; - -protected: - ACE_Future_Holder (void); -}; - -/** - * @class ACE_Future_Observer - * - * @brief ACE_Future_Observer - * - * An ACE_Future_Observer object implements an object that is - * subscribed with an ACE_Future object so that it may be notified - * when the value of the ACE_Future object is written to by a writer - * thread. It uses the Observer pattern. - */ -template -class ACE_Future_Observer -{ -public: - /// Destructor - virtual ~ACE_Future_Observer (void); - - /// Called by the ACE_Future in which we are subscribed to when - /// its value is written to. - virtual void update (const ACE_Future &future) = 0; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -protected: - - /// Constructor - ACE_Future_Observer (void); -}; - -/** - * @class ACE_Future_Rep - * - * @internal - * - * @brief ACE_Future_Rep - * - * An ACE_Future_Rep object encapsules a pointer to an object - * of class T which is the result of an asynchronous method - * invocation. It is pointed to by ACE_Future object[s] and - * only accessible through them. - */ -template -class ACE_Future_Rep -{ -private: - friend class ACE_Future; - - /** - * Set the result value. The specified represents the - * future that invoked this method, which is used to notify - * the list of future observers. Returns 0 for success, -1 on error. - * This function only has an effect the first time it is called for - * the object. Subsequent calls return 0 (success) but have no effect. - */ - int set (const T &r, - ACE_Future &caller); - - /// Wait up to @a tv time to get the @a value. Note that @a tv must be - /// specified in absolute time rather than relative time. - int get (T &value, - ACE_Time_Value *tv) const; - - /** - * Attaches the specified observer to a subject (i.e., the ACE_Future_Rep). - * The update method of the specified subject will be invoked with a copy of - * the written-to ACE_Future as input when the result gets set. - * - * Returns 0 if the observer is successfully attached, 1 if the - * observer is already attached, and -1 if failures occur. - */ - int attach (ACE_Future_Observer *observer, - ACE_Future &caller); - - /** - * Detaches the specified observer from a subject (i.e., the ACE_Future_Rep). - * The update method of the specified subject will not be invoked when the - * ACE_Future_Reps result gets set. Returns 1 if the specified observer was - * actually attached to the subject prior to this call and 0 if was not. - * - * Returns 0 if the observer was successfully detached, and -1 if the - * observer was not attached in the first place. - */ - int detach (ACE_Future_Observer *observer); - - /** - * Type conversion. will block forever until the result is - * available. Note that this method is going away in a subsequent - * release since it doesn't distinguish between failure results and - * success results (exceptions should be used, but they aren't - * portable...). The method should be used instead since it - * separates the error value from the result, and also permits - * timeouts. - */ - operator T (); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Encapsulate reference count and object lifetime of instances. - - // These methods must go after the others to work around a bug with - // Borland's C++ Builder... - - /// Allocate a new ACE_Future_Rep instance, returning NULL if it - /// cannot be created. - static ACE_Future_Rep *internal_create (void); - - /// Create a ACE_Future_Rep and initialize the reference count. - static ACE_Future_Rep *create (void); - - /** - * Increase the reference count and return argument. Uses the - * attribute "value_ready_mutex_" to synchronize reference count - * updating. - * - * Precondition (rep != 0). - */ - static ACE_Future_Rep *attach (ACE_Future_Rep *&rep); - - /** - * Decreases the reference count and deletes rep if there are no - * more references to rep. - * - * Precondition (rep != 0) - */ - static void detach (ACE_Future_Rep *&rep); - - /** - * Decreases the rep's reference count and deletes rep if there - * are no more references to rep. Then assigns new_rep to rep. - * - * Precondition (rep != 0 && new_rep != 0) - */ - static void assign (ACE_Future_Rep *&rep, ACE_Future_Rep *new_rep); - - /// Is result available? - int ready (void) const; - - /// Pointer to the result. - T *value_; - - /// Reference count. - int ref_count_; - - typedef ACE_Future_Observer OBSERVER; - - typedef ACE_Unbounded_Set OBSERVER_COLLECTION; - - /// Keep a list of ACE_Future_Observers unread by client's reader thread. - OBSERVER_COLLECTION observer_collection_; - - // = Condition variable and mutex that protect the . - mutable ACE_Recursive_Thread_Mutex value_ready_mutex_; - mutable ACE_Condition_Recursive_Thread_Mutex value_ready_; - -private: - - ACE_Future_Rep (void); - -protected: - - ~ACE_Future_Rep (void); - -}; - -/** - * @class ACE_Future - * - * @brief This class implements a ``single write, multiple read'' - * pattern that can be used to return results from asynchronous - * method invocations. - */ -template -class ACE_Future -{ -public: - // = Initialization and termination methods. - /// Constructor. - ACE_Future (void); - - /// Copy constructor binds @a this and @a r to the same - /// ACE_Future_Rep. An ACE_Future_Rep is created if necessary. - ACE_Future (const ACE_Future &r); - - /// Constructor that initialises an ACE_Future to point to the - /// result @a r immediately. - ACE_Future (const T &r); - - /// Destructor. - ~ACE_Future (void); - - /// Assignment operator that binds @a this and @a r to the same - /// ACE_Future_Rep. An ACE_Future_Rep is created if necessary. - void operator = (const ACE_Future &r); - - /// Cancel an ACE_Future and assign the value @a r. It is used if a - /// client does not want to wait for the value to be produced. - int cancel (const T &r); - - /** - * Cancel an ACE_Future. Put the future into its initial - * state. Returns 0 on succes and -1 on failure. It is now possible - * to reuse the ACE_Future. But remember, the ACE_Future - * is now bound to a new ACE_Future_Rep. - */ - int cancel (void); - - /** - * Equality operator that returns @c true if both ACE_Future objects - * point to the same ACE_Future_Rep object. - * - * @note It also returns @c true if both objects have just been - * instantiated and not used yet. - */ - bool operator == (const ACE_Future &r) const; - - /// Inequality operator, which is the opposite of equality. - bool operator != (const ACE_Future &r) const; - - /** - * Make the result available. Is used by the server thread to give - * the result to all waiting clients. Returns 0 for success, -1 on failure. - * This function only has an effect the first time it is called for - * the object (actually, the first time the underlying ACE_Future_Rep has a - * value assigned to it). Subsequent calls return 0 (success) but have no - * effect. - */ - int set (const T &r); - - /** - * Wait to get the object's value. - * - * @param value Receives the value of this ACE_Future when it is set. - * @param tv Pointer to an ACE_Time_Value containing the absolute - * time to wait until for the value to be set. If @a tv - * is 0, the call waits indefinitely for the value to be - * set, unless an error occurs. - * - * @retval 0 Success; @a value contains the value of the ACE_Future. - * @retval -1 Error; check ACE_OS::last_error() for an error code. - */ - int get (T &value, - ACE_Time_Value *tv = 0) const; - - /** - * @deprecated Note that this method is going away in a subsequent - * release since it doesn't distinguish between failure - * results and success results (exceptions should be - * used, but they aren't portable...). - * Type conversion, which obtains the result of the asynchronous - * method invocation. Will block forever. The get() method should be - * used instead since it separates the error value from the result, - * and also permits timeouts. - */ - operator T (); - - /// Check if the result is available. - int ready (void) const; - - /** - * Attaches the specified observer to a subject (this ACE_Future). - * The update method of the specified subject will be invoked with a copy of - * the associated ACE_Future as input when the result gets set. If the - * result is already set when this method gets invoked, then the update - * method of the specified subject will be invoked immediately. - * - * @param observer The observer to attach to the subject. - * - * @retval 0 Success. - * @retval 1 The observer was already attached. - * @retval -1 Error; check ACE_OS::last_error() for an error code. - */ - int attach (ACE_Future_Observer *observer); - - /** - * Detaches the specified observer from a subject (this ACE_Future). - * The update method of the specified subject will not be invoked when the - * ACE_Future_Rep result gets set. - * - * @param observer The observer to attach to the subject. - * - * @retval 0 The observer was successfully detached. - * @retval -1 Error, including the observer not attached prior - * to calling this method. - */ - int detach (ACE_Future_Observer *observer); - - /// Dump the state of an object. - void dump (void) const; - - /** - * Get the underlying ACE_Future_Rep pointer. Note that this method should - * rarely, if ever, be used and that modifying the underlying - * ACE_Future_Rep should be done with extreme caution. - */ - ACE_Future_Rep *get_rep (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - // the ACE_Future_Rep - /// Protect operations on the . - typedef ACE_Future_Rep FUTURE_REP; - FUTURE_REP *future_rep_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Future.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Future.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_FUTURE_H */ - diff --git a/dep/include/ace/Future_Set.h b/dep/include/ace/Future_Set.h deleted file mode 100644 index b41fc673986..00000000000 --- a/dep/include/ace/Future_Set.h +++ /dev/null @@ -1,147 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Future_Set.h - * - * $Id: Future_Set.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author John Tucker - */ -//============================================================================= - -#ifndef ACE_FUTURE_SET_H -#define ACE_FUTURE_SET_H -#include /**/ "ace/pre.h" - -#include "ace/Thread.h" -#include "ace/Message_Queue.h" -#include "ace/Future.h" -#include "ace/Hash_Map_Manager_T.h" -#include "ace/Null_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Future_Set - * - * @brief This class implements a mechanism which allows the values of - * a collection of ACE_Future objects to be accessed by reader threads - * as they become available. The caller(s) provide the ACE_Future_Set - * (i.e. the observer...) with the collection of ACE_Future objects - * (i.e. the subjects...) that are to be observed using the - * the ACE_Future_Set::insert() method. The caller(s) may then iterate - * over the collection in the order in which they become readable using - * the ACE_Future_Set::next_readable() method. - */ -template -class ACE_Future_Set : public ACE_Future_Observer -{ -public: - // = Initialization and termination methods. - - /// Constructor. - ACE_Future_Set (ACE_Message_Queue *future_notification_queue_ = 0); - - /// Destructor. - ~ACE_Future_Set (void); - - /** - * Return 1 if their are no ACE_Future objects left on its queue and - * 0 otherwise. - * - * When an ACE_Future_Set has no ACE_Future>subjects to observe it is - * empty. The ACE_Future_Set is in the empty state when either the caller(s) - * have retrieved every readable ACE_Future subject assigned the - * ACE_Future_Set via the ACE_Future_Set::next_readable() method, - * or when the ACE_Future_Set has not been assigned any subjects. - */ - int is_empty (void) const; - - /** - * Enqueus the given ACE_Future into this objects queue when it is - * readable. - * - * Returns 0 if the future is successfully inserted, 1 if the - * future is already inserted, and -1 if failures occur. - */ - int insert (ACE_Future &future); - - /** - * Wait up to @a tv time to get the @a value. Note that @a tv must be - * specified in absolute time rather than relative time.); get the - * next ACE_Future that is readable. If @a tv = 0, the will block - * forever. - * - * If a readable future becomes available, then the input - * ACE_Future object param will be assigned with it and 1 will - * be returned. If the ACE_Future_Set is empty (i.e. see definition - * of ACE_Future_Set::is_empty()), then 0 is returned. - * - * When a readable ACE_Future object is retrieved via the - * ACE_Future_Set::next_readable() method, the ACE_Future_Set will - * remove that ACE_Future object from its list of subjects. - */ - int next_readable (ACE_Future &result, - ACE_Time_Value *tv = 0); - - /// Called by the ACE_Future subject in which we are subscribed to - /// when its value is written to. - virtual void update (const ACE_Future &future); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Future_Set &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Future_Set (const ACE_Future_Set &)) - - typedef ACE_Future FUTURE; - - typedef ACE_Future_Rep FUTURE_REP; - - typedef ACE_Future_Holder FUTURE_HOLDER; - - typedef ACE_Pointer_Hash FUTURE_REP_HASH; - - typedef ACE_Equal_To FUTURE_REP_COMPARE; - - typedef ACE_Hash_Map_Manager_Ex FUTURE_HASH_MAP; - - /// Map of , subjects, which have not been written to by - /// client's writer thread. - FUTURE_HASH_MAP future_map_; - - /// Message queue for notifying the reader thread of which - /// have been written to by client's writer thread. - ACE_Message_Queue *future_notification_queue_; - - /// Keeps track of whether we need to delete the message queue. - bool delete_queue_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Future_Set.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Future_Set.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_THREADS */ -#include /**/ "ace/post.h" -#endif /* ACE_FUTURE_SET_H */ - diff --git a/dep/include/ace/Get_Opt.h b/dep/include/ace/Get_Opt.h deleted file mode 100644 index e00518954e6..00000000000 --- a/dep/include/ace/Get_Opt.h +++ /dev/null @@ -1,495 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Get_Opt.h - * - * $Id: Get_Opt.h 81840 2008-06-05 13:46:45Z sma $ - * - * @author Douglas C. Schmidt - * @author Don Hinton (added long option support) - */ -//========================================================================== - -#ifndef ACE_GET_OPT_H -#define ACE_GET_OPT_H -#include /**/ "ace/pre.h" - -#include "ace/SStringfwd.h" -#include "ace/Containers.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#undef optind -#undef optarg -#undef opterr - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/* - * These definitions are for backward compatibility with previous versions. - * of ACE_Get_Opt. - */ - -/** - * @class ACE_Get_Opt - * - * @brief Iterator for parsing command-line arguments. - * - * This is a C++ wrapper for getopt(3c) and getopt_long(3c). - */ - -class ACE_Export ACE_Get_Opt -{ -public: - /// Mutually exclusive ordering values. - enum - { - /** - * REQUIRE_ORDER means that processing stops and @c EOF is - * returned as soon as a non-option argument is found. @c opt_ind() - * will return the index of the next @a argv element so the program - * can continue processing the rest of the @a argv elements. - */ - REQUIRE_ORDER = 1, - - /** - * PERMUTE_ARGS means the @a argv elements are reordered dynamically - * (permuted) so that all options appear first. When the elements are - * permuted, the order of the options and the following arguments are - * maintained. When the last option has been processed, @c EOF is - * returned and @c opt_ind() returns the index into the next non-option - * element. - */ - PERMUTE_ARGS = 2, - - /** - * RETURN_IN_ORDER means each @a argv element is processed in the - * order is it seen. If the element is not recognized as an option, '1' - * is returned and @c opt_arg() refers to the @a argv element found. - */ - RETURN_IN_ORDER = 3 - }; - - /// Mutually exclusive option argument mode used by long options. - enum OPTION_ARG_MODE - { - /// Doesn't take an argument. - NO_ARG = 0, - - /// Requires an argument, same as passing ":" after a short option - /// character in @a optstring. - ARG_REQUIRED = 1, - - /// Argument is optional, same as passing "::" after a short - /// option character in @a optstring. - ARG_OPTIONAL = 2 - }; - - /** - * Constructor initializes the command line to be parsed. All information - * for parsing must be supplied to this constructor. - * - * @param argc The number of @a argv elements to parse. - * @param argv Command line tokens, such as would be passed - * to @c main(). - * @param optstring Nul-terminated string containing the legitimate - * short option characters. A single colon ":" - * following an option character means the option - * requires an argument. A double colon "::" following - * an option character means the argument is optional. - * The argument is taken from the rest of the current - * @a argv element, or from the following @a argv - * element (only valid for required arguments; - * optional arguments must always reside in the same - * @a argv element). The argument value, if any is - * returned by the @c opt_arg() method. - * @a optstring can be extended by adding long options - * with corresponding short options via the - * @c long_option() method. If the short option - * already appears in @a optstring, the argument - * characteristics must match, otherwise it is added. - * See @c long_option() for more information. - * If 'W', followed by a semi-colon ';' appears in - * @a optstring, then any time a 'W' appears on the - * command line, the following argument is treated as - * a long option. For example, if the command line - * contains "program -W foo", "foo" is treated as a - * long option, that is, as if "program --foo" had - * been passed. - * The following characters can appear in @a optstring - * before any option characters, with the described - * effect: - * - '+' changes the @a ordering to @a REQUIRE_ORDER. - * - '-' changes the @a ordering to @a RETURN_IN_ORDER. - * - ':' changes the return value from @c operator() - * and get_opt() from '?' to ':' when an option - * requires an argument but none is specified. - * - * @param skip_args Optional (default 1). The specified number of - * initial elements in @a argv are skipped before - * parsing begins. Thus, the default prevents - * @a argv[0] (usually the command name) from being - * parsed. @a argc includes all @a argv elements, - * including any skipped elements. - * @param report_errors Optional, if non-zero then parsing errors cause - * an error message to be displayed from the - * @c operator() method before it returns. The - * error message is suppressed if this argument is 0. - * This setting also controls whether or not an error - * message is displayed in @c long_option() encounters - * an error. - * @param ordering Optional (default is @c PERMUTE_ARGS); determines - * how the @a argv elements are processed. This argument - * is overridden by two factors: - * -# The @c POSIXLY_CORRECT environment variable. If - * this environment variable is set, the ordering - * is changed to @c REQUIRE_ORDER. - * -# Leading characters in @a optstring (see above). - * Any leading ordering characters override both - * the @a ordering argument and any effect of the - * @c POSIXLY_CORRECT environment variable. - * @param long_only Optional. If non-zero, then long options can be - * specified using a single '-' on the command line. - * If the token is not a long option, it is processed - * as usual, that is, as a short option or set of - * short options. - * - * Multiple short options can be combined as long as only the last - * one can takes an argument. For example, if @a optstring is defined as - * @c "abc:" or @c "abc::" then the command line @e "program -abcxxx" short - * options @e a, @e b, and @e c are found with @e "xxx" as the argument for - * @e c. - * However, if the command line is specified as @e "program -acb" only - * options @e a and @e c are found with @e "b" as the argument for @e c. - * Also, for options with optional arguments, that is, those followed by - * "::", the argument must be in the same @a argv element, so "program -abc - * xxx" will only find "xxx" as the argument for @e c if @a optstring is - * specified as @c "abc:" not @c "abc::". - */ -#ifndef ACE_USES_WCHAR - ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const ACE_TCHAR *optstring = ACE_TEXT (""), - int skip_args = 1, - int report_errors = 0, - int ordering = PERMUTE_ARGS, - int long_only = 0); - -#else -private: - void ACE_Get_Opt_Init (const ACE_TCHAR *optstring); -public: - ACE_INLINE ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const ACE_TCHAR *optstring = ACE_TEXT (""), - int skip_args = 1, - int report_errors = 0, - int ordering = PERMUTE_ARGS, - int long_only = 0); - ACE_INLINE ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const char *optstring, - int skip_args = 1, - int report_errors = 0, - int ordering = PERMUTE_ARGS, - int long_only = 0); -#endif - /// Default dtor. - ~ACE_Get_Opt (void); - - /** - * Scan elements of @a argv (whose length is @a argc) for short option - * characters given in @a optstring or long options (with no short - * option equivalents). - * - * If an element of @a argv starts with '-', and is not exactly "-" - * or "--", then it is a short option element. The characters of this - * element (aside from the initial '-') are option characters. If - * it starts with "--" followed by other characters it is treated as - * a long option. If @c operator() is called repeatedly, it returns - * each of the option characters from each of the option elements. - * - * @return The parsed option character. The following characters have - * special significance. - * @retval 0 A long option was found - * @retval '\?' Either an unknown option character was found, or the - * option is known but requires an argument, none was - * specified, and @a optstring did not contain a leading - * colon. - * @retval ':' A known option character was found but it requires an - * argument and none was supplied, and the first character - * of @a optstring was a colon. @c opt_opt() indicates - * which option was specified. - * @retval '1' @c RETURN_IN_ORDER was specified and a non-option argument - * was found. - * @retval EOF No more option characters were found. @c opt_ind() will - * return the index in @a argv of the first @a argv element - * that is not an option. If @c PERMUTE_ARGS was - * specified, the @a argv elements have been permuted so that - * those that are not options now come last. - * - * @note The standards are unclear with respect to the conditions under - * which '?' and ':' are returned, so we scan the initial characters of - * @a optstring up unto the first short option character for '+', '-', - * and ':' in order to determine ordering and missing argument behavior. - */ - int operator () (void); - - /** - * For communication from @c operator() to the caller. When - * @c operator() finds an option that takes an argument, the argument - * value is returned from this method, otherwise it returns 0. - */ - ACE_TCHAR *opt_arg (void) const; - - /** - * Returns the most recently matched option character. Especially - * useful when operator() returns ':' for an unspecified argument - * that's required, since this allows the caller to learn what option - * was specified without its required argument. - */ - int opt_opt (void); - - /** - * Index in @a argv of the next element to be scanned. This is used - * for communication to and from the caller and for communication - * between successive calls to @c operator(). On entry to - * @c operator(), zero means this is the first call; initialize. - * - * When @c operator() returns @c EOF, this is the index of the first of - * the non-option elements that the caller should itself scan. - * - * Otherwise, @c opt_ind() communicates from one call to the next how - * much of @a argv has been scanned so far. - */ - int &opt_ind (void); - - /// Adds a long option with no corresponding short option. - /** - * If the @a name option is seen, @c operator() returns 0. - * - * @param name The long option to add. - * @param has_arg Defines the argument requirements for - * the new option. - * - * @retval 0 Success - * @retval -1 The long option can not be added. - */ - int long_option (const ACE_TCHAR *name, - OPTION_ARG_MODE has_arg = NO_ARG); - - /// Adds a long option with a corresponding short option. - /** - * @param name The long option to add. - * @param short_option A character, the short option that corresponds - * to @a name. - * @param has_arg Defines the argument requirements for - * the new option. If the short option has already - * been supplied in the @a optstring, @a has_arg - * must match or an error is returned; otherwise, the - * new short option is added to the @a optstring. - * - * @retval 0 Success - * @retval -1 The long option can not be added. - */ - int long_option (const ACE_TCHAR *name, - int short_option, - OPTION_ARG_MODE has_arg = NO_ARG); - - /// Returns the name of the long option found on the last call to - /// @c operator() or 0 if none was found. - const ACE_TCHAR *long_option (void) const; - - /// The number of arguments in the internal @c argv_. - int argc (void) const; - - /// Accessor for the internal @c argv_ pointer. - ACE_TCHAR **argv (void) const; - - /// Accessor for the @c last_option that was processed. This allows - /// applications to know if the found option was a short or long - /// option, and is especially useful in cases where it was invalid - /// and the caller wants to print out the invalid value. - const ACE_TCHAR *last_option (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Return the @a optstring. This is handy to verify that calls to - /// long_option added short options as expected. - const ACE_TCHAR *optstring (void) const; - -public: - /* - * The following five data members should be private, but that - * would break backwards compatibility. However, we recommend not - * writing code that uses these fields directly. - */ - - /// Holds the @a argc count. - /** - * @deprecated This is public for backwards compatibility only. - * It will be made private in a release of ACE past 5.3. Do not - * write code that relies on this member being public; use the - * @c argc() accessor method instead. - */ - int argc_; - - /// Holds the @a argv pointer. - /** - * @deprecated This is public for backwards compatibility only. - * It will be made private in a release of ACE past 5.3. Do not - * write code that relies on this member being public; use the - * @c argv() accessor method instead. - */ - ACE_TCHAR **argv_; - - /// Index in @c argv_ of the next element to be scanned. - /** - * @deprecated This is public for backwards compatibility only. - * It will be made private in a release of ACE past 5.3. Do not - * write code that relies on this member being public; use the - * @c opt_ind() accessor method instead. - */ - int optind; - - /// Callers store zero here to inhibit the error message for - /// unrecognized options. - /** - * @deprecated This is public for backwards compatibility only. - * It will be made private in a release of ACE past 5.3. Do not - * write code that relies on this member being public; use the - * @a report_errors argument to this class's constructor instead. - */ - int opterr; - - /// Points to the option argument when one is found on last call to - /// @c operator(). - /** - * @deprecated This is public for backwards compatibility only. - * It will be made private in a release of ACE past 5.3. Do not - * write code that relies on this member being public; use the - * @c opt_arg() accessor method instead. - */ - ACE_TCHAR *optarg; - -private: - /** - * @class ACE_Get_Opt_Long_Option This class is for internal use - * in the ACE_Get_Opt class, and is inaccessible to users. - */ - class ACE_Get_Opt_Long_Option - { - public: - /// ctor - ACE_Get_Opt_Long_Option (const ACE_TCHAR *name, - int has_arg, - int val = 0); - - /// Dtor. - ~ACE_Get_Opt_Long_Option (void); - - bool operator < (const ACE_Get_Opt_Long_Option &rhs); - - /// Long option name. - const ACE_TCHAR *name_; - - /// Contains value for . - int has_arg_; - - /// Contains a valid short option character or zero if it doesn't - /// have a corresponding short option. It can also contain a - /// non-printable value that cannot be passed to but - /// will be returned by . This is handy for - /// simplifying long option handling, see tests/Get_Opt_Test.cpp - /// for an example of this technique. - int val_; - }; - - /// Updates nextchar_. - int nextchar_i (void); - - /// Handles long options. - int long_option_i (void); - - /// Handles short options. - int short_option_i (void); - - /// If permuting args, this functions manages the nonopt_start_ and - /// nonopt_end_ indexes and makes calls to permute to actually - /// reorder the -elements. - void permute_args (void); - - /// Handles reordering -elements. - int permute (void); - - /// Set last_option. - void last_option (const ACE_TString &s); - - // Disallow copying and assignment. - ACE_Get_Opt (const ACE_Get_Opt &); - ACE_Get_Opt &operator= (const ACE_Get_Opt &); - -private: - - /// Holds the option string. - ACE_TString *optstring_; - - /// Treat all options as long options. - int long_only_; - - /// Keeps track of whether or not a colon was passed in . - /// This is used to determine the return value when required - /// arguments are missing. - int has_colon_; - - /// This is the last option, short or long, that was processed. This - /// is handy to have in cases where the option passed was invalid. - ACE_TString *last_option_; - - /** - * The next char to be scanned in the option-element in which the - * last option character we returned was found. This allows us to - * pick up the scan where we left off * - * If this is zero, or a null string, it means resume the scan - * by advancing to the next -element. - */ - ACE_TCHAR *nextchar_; - - /// Most recently matched short option character. - int optopt_; - - /// Keeps track of ordering mode (default ). - int ordering_; - - /// Index of the first non-option -element found (only valid - /// when permuting). - int nonopt_start_; - - /// Index of the -element following the last non-option element - /// (only valid when permuting). - int nonopt_end_; - - /// Points to the long_option found on last call to . - ACE_Get_Opt_Long_Option *long_option_; - - /// Array of long options. - ACE_Array long_opts_; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Get_Opt.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_GET_OPT_H */ - diff --git a/dep/include/ace/Get_Opt.inl b/dep/include/ace/Get_Opt.inl deleted file mode 100644 index e307fb5e400..00000000000 --- a/dep/include/ace/Get_Opt.inl +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- -// -// $Id: Get_Opt.inl 81840 2008-06-05 13:46:45Z sma $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE bool -ACE_Get_Opt::ACE_Get_Opt_Long_Option::operator < (const ACE_Get_Opt_Long_Option &rhs) -{ - return this->name_ < rhs.name_; -} - -ACE_INLINE int -ACE_Get_Opt::argc (void) const -{ - return this->argc_; -} - -ACE_INLINE ACE_TCHAR ** -ACE_Get_Opt::argv (void) const -{ - return this->argv_; -} - -ACE_INLINE ACE_TCHAR* -ACE_Get_Opt::opt_arg (void) const -{ - return this->optarg; -} - -ACE_INLINE int -ACE_Get_Opt::opt_opt (void) -{ - return this->optopt_; -} - -ACE_INLINE int & -ACE_Get_Opt::opt_ind (void) -{ - return this->optind; -} - -#ifdef ACE_USES_WCHAR -ACE_INLINE ACE_Get_Opt::ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const ACE_TCHAR *optstring, - int skip_args, - int report_errors, - int ordering, - int long_only) - : argc_ (argc), - argv_ (argv), - optind (skip_args), - opterr (report_errors), - optarg (0), - optstring_ (0), - long_only_ (long_only), - has_colon_ (0), - last_option_ (0), - nextchar_ (0), - optopt_ (0), - ordering_ (ordering), - nonopt_start_ (optind), - nonopt_end_ (optind), - long_option_ (0) -{ - ACE_Get_Opt_Init (optstring); -} - -ACE_INLINE ACE_Get_Opt::ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const char *optstring, - int skip_args, - int report_errors, - int ordering, - int long_only) - : argc_ (argc), - argv_ (argv), - optind (skip_args), - opterr (report_errors), - optarg (0), - optstring_ (), - long_only_ (long_only), - has_colon_ (0), - last_option_ (0), - nextchar_ (0), - optopt_ (0), - ordering_ (ordering), - nonopt_start_ (optind), - nonopt_end_ (optind), - long_option_ (0) -{ - ACE_Get_Opt_Init (ACE_TEXT_CHAR_TO_TCHAR (optstring)); -} -#endif - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Global_Macros.h b/dep/include/ace/Global_Macros.h deleted file mode 100644 index 4d8bb016842..00000000000 --- a/dep/include/ace/Global_Macros.h +++ /dev/null @@ -1,1119 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Global_Macros.h - * - * $Id: Global_Macros.h 82442 2008-07-28 13:11:29Z johnnyw $ - * - * @author Douglas C. Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - * - * This one is split from the famous OS.h - */ -//============================================================================= - -#ifndef ACE_GLOBAL_MACROS_H -#define ACE_GLOBAL_MACROS_H - -#include /**/ "ace/pre.h" - -// Included just keep compilers that see #pragma dierctive first -// happy. -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/config-lite.h" -#include "ace/Assert.h" // For ACE_ASSERT - -// Start Global Macros -# define ACE_BEGIN_DUMP ACE_TEXT ("\n====\n(%P|%t|%x)\n") -# define ACE_END_DUMP ACE_TEXT ("====\n") - -# if defined (ACE_NDEBUG) -# define ACE_DB(X) -# else -# define ACE_DB(X) X -# endif /* ACE_NDEBUG */ - -// ACE_NO_HEAP_CHECK macro can be used to suppress false report of -// memory leaks. It turns off the built-in heap checking until the -// block is left. The old state will then be restored Only used for -// Win32 (in the moment). -# if defined (ACE_WIN32) - -# if defined (_DEBUG) && !defined (ACE_HAS_WINCE) && !defined (__BORLANDC__) -# include /**/ - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Export ACE_No_Heap_Check -{ -public: - ACE_No_Heap_Check (void) - : old_state (_CrtSetDbgFlag (_CRTDBG_REPORT_FLAG)) - { _CrtSetDbgFlag (old_state & ~_CRTDBG_ALLOC_MEM_DF);} - ~ACE_No_Heap_Check (void) { _CrtSetDbgFlag (old_state);} -private: - int old_state; -}; - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -# define ACE_NO_HEAP_CHECK ACE_No_Heap_Check ____no_heap; -# else /* !_DEBUG */ -# define ACE_NO_HEAP_CHECK -# endif /* _DEBUG */ -# else /* !ACE_WIN32 */ -# define ACE_NO_HEAP_CHECK -# endif /* ACE_WIN32 */ - -// Turn a number into a string. -# define ACE_ITOA(X) #X - -// Create a string of a server address with a "host:port" format. -# define ACE_SERVER_ADDRESS(H,P) H ACE_TEXT(":") P - -// A couple useful inline functions for checking whether bits are -// enabled or disabled. - -// Efficiently returns the least power of two >= X... -# define ACE_POW(X) (((X) == 0)?1:(X-=1,X|=X>>1,X|=X>>2,X|=X>>4,X|=X>>8,X|=X>>16,(++X))) -# define ACE_EVEN(NUM) (((NUM) & 1) == 0) -# define ACE_ODD(NUM) (((NUM) & 1) == 1) -# define ACE_BIT_ENABLED(WORD, BIT) (((WORD) & (BIT)) != 0) -# define ACE_BIT_DISABLED(WORD, BIT) (((WORD) & (BIT)) == 0) -# define ACE_BIT_CMP_MASK(WORD, BIT, MASK) (((WORD) & (BIT)) == MASK) -# define ACE_SET_BITS(WORD, BITS) (WORD |= (BITS)) -# define ACE_CLR_BITS(WORD, BITS) (WORD &= ~(BITS)) - -# if !defined (ACE_ENDLESS_LOOP) -# define ACE_ENDLESS_LOOP -# endif /* ! ACE_ENDLESS_LOOP */ - -# if defined (ACE_NEEDS_FUNC_DEFINITIONS) - // It just evaporated ;-) Not pleasant. -# define ACE_UNIMPLEMENTED_FUNC(f) -# else -# define ACE_UNIMPLEMENTED_FUNC(f) f; -# endif /* ACE_NEEDS_FUNC_DEFINITIONS */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - // Easy way to designate that a class is used as a pseudo-namespace. - // Insures that g++ "friendship" anamolies are properly handled. - # define ACE_CLASS_IS_NAMESPACE(CLASSNAME) \ - private: \ - CLASSNAME (void); \ - CLASSNAME (const CLASSNAME&); \ - friend class ace_dewarn_gplusplus -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -// ---------------------------------------------------------------- - -//FUZZ: disable check_for_exception_sepc -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - #if defined (ACE_HAS_NO_THROW_SPEC) - # define ACE_THROW_SPEC(X) - #else - # if defined (ACE_HAS_EXCEPTIONS) - # if defined (ACE_WIN32) && defined (_MSC_VER) && \ - (_MSC_VER >= 1400) && (_MSC_VER <= 1500) - # define ACE_THROW_SPEC(X) throw(...) - # else - # define ACE_THROW_SPEC(X) throw X - # endif /* ACE_WIN32 && VC8 */ - # else /* ! ACE_HAS_EXCEPTIONS */ - # define ACE_THROW_SPEC(X) - # endif /* ! ACE_HAS_EXCEPTIONS */ - #endif /*ACE_HAS_NO_THROW_SPEC*/ -#endif /* ACE_LACKS_DEPRECATED_MACROS */ -//FUZZ: enable check_for_exception_sepc - -// ---------------------------------------------------------------- - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - /** - * This macro is deprecated - */ - #define ACE_NESTED_CLASS(TYPE, NAME) TYPE::NAME -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - /** - * @name CORBA namespace macros. - * - * CORBA namespace macros. - * - * @deprecated These macros were formerly used by TAO but are now - * deprecated, and only remain to retain some backward - * compatibility. They will be removed in a future ACE - * release. - */ - //@{ - #define ACE_CORBA_1(NAME) CORBA::NAME - #define ACE_CORBA_2(TYPE, NAME) CORBA::TYPE::NAME - #define ACE_CORBA_3(TYPE, NAME) CORBA::TYPE::NAME - //@} -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -// ---------------------------------------------------------------- - -// Convenient macro for testing for deadlock, as well as for detecting -// when mutexes fail. -#define ACE_GUARD_ACTION(MUTEX, OBJ, LOCK, ACTION, REACTION) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () != 0) { ACTION; } \ - else { REACTION; } -#define ACE_GUARD_REACTION(MUTEX, OBJ, LOCK, REACTION) \ - ACE_GUARD_ACTION(MUTEX, OBJ, LOCK, ;, REACTION) -#define ACE_GUARD(MUTEX, OBJ, LOCK) \ - ACE_GUARD_REACTION(MUTEX, OBJ, LOCK, return) -#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN) \ - ACE_GUARD_REACTION(MUTEX, OBJ, LOCK, return RETURN) -# define ACE_WRITE_GUARD(MUTEX,OBJ,LOCK) \ - ACE_Write_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) return; -# define ACE_WRITE_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN) \ - ACE_Write_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) return RETURN; -# define ACE_READ_GUARD(MUTEX,OBJ,LOCK) \ - ACE_Read_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) return; -# define ACE_READ_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN) \ - ACE_Read_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) return RETURN; - -// ---------------------------------------------------------------- - -# define ACE_DES_NOFREE(POINTER,CLASS) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~CLASS (); \ - } \ - } \ - while (0) - -# define ACE_DES_ARRAY_NOFREE(POINTER,SIZE,CLASS) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (&(POINTER)[i])->~CLASS (); \ - } \ - } \ - } \ - while (0) - -# define ACE_DES_FREE(POINTER,DEALLOCATOR,CLASS) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) - -# define ACE_DES_ARRAY_FREE(POINTER,SIZE,DEALLOCATOR,CLASS) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (&(POINTER)[i])->~CLASS (); \ - } \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) - -# if defined (ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR) -# define ACE_DES_NOFREE_TEMPLATE(POINTER,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - } \ - } \ - while (0) -# define ACE_DES_ARRAY_NOFREE_TEMPLATE(POINTER,SIZE,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (&(POINTER)[i])->~T_CLASS (); \ - } \ - } \ - } \ - while (0) - -#if defined (ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) -# define ACE_DES_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS T_PARAMETER (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#else -# define ACE_DES_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#endif /* defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) */ -# define ACE_DES_ARRAY_FREE_TEMPLATE(POINTER,SIZE,DEALLOCATOR,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (&(POINTER)[i])->~T_CLASS (); \ - } \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#if defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) -# define ACE_DES_FREE_TEMPLATE2(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#else -# define ACE_DES_FREE_TEMPLATE2(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#endif /* defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) */ -#if defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) -# define ACE_DES_FREE_TEMPLATE3(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#else -# define ACE_DES_FREE_TEMPLATE3(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#endif /* defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) */ -#if defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) -# define ACE_DES_FREE_TEMPLATE4(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3, T_PARAM4) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#else -# define ACE_DES_FREE_TEMPLATE4(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3, T_PARAM4) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -#endif /* defined(ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS) */ -# define ACE_DES_ARRAY_FREE_TEMPLATE2(POINTER,SIZE,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (&(POINTER)[i])->~T_CLASS (); \ - } \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# else /* ! ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR */ -# define ACE_DES_NOFREE_TEMPLATE(POINTER,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - (POINTER)->T_CLASS T_PARAMETER::~T_CLASS (); \ - } \ - } \ - while (0) -# define ACE_DES_ARRAY_NOFREE_TEMPLATE(POINTER,SIZE,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - (POINTER)[i].T_CLASS T_PARAMETER::~T_CLASS (); \ - } \ - } \ - } \ - while (0) -# define ACE_DES_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - POINTER->T_CLASS T_PARAMETER::~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# define ACE_DES_ARRAY_FREE_TEMPLATE(POINTER,SIZE,DEALLOCATOR,T_CLASS,T_PARAMETER) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - POINTER[i].T_CLASS T_PARAMETER::~T_CLASS (); \ - } \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# define ACE_DES_FREE_TEMPLATE2(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) \ - do { \ - if (POINTER) \ - { \ - POINTER->T_CLASS ::~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# define ACE_DES_FREE_TEMPLATE3(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3) \ - do { \ - if (POINTER) \ - { \ - POINTER->T_CLASS ::~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# define ACE_DES_FREE_TEMPLATE4(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2,T_PARAM3,T_PARAM4) \ - do { \ - if (POINTER) \ - { \ - POINTER->T_CLASS ::~T_CLASS (); \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# define ACE_DES_ARRAY_FREE_TEMPLATE2(POINTER,SIZE,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) \ - do { \ - if (POINTER) \ - { \ - for (size_t i = 0; \ - i < SIZE; \ - ++i) \ - { \ - POINTER[i].T_CLASS ::~T_CLASS (); \ - } \ - DEALLOCATOR (POINTER); \ - } \ - } \ - while (0) -# endif /* defined ! ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR */ - -/*******************************************************************/ - -/// Service Objects, i.e., objects dynamically loaded via the service -/// configurator, must provide a destructor function with the -/// following prototype to perform object cleanup. -typedef void (*ACE_Service_Object_Exterminator)(void *); - -/** @name Service Configurator macros - * - * The following macros are used to define helper objects used in - * ACE's Service Configurator framework, which is described in - * Chapter 5 of C++NPv2 . This - * framework implements the Component Configurator pattern, which is - * described in Chapter 2 of POSA2 . - * The intent of this pattern is to allow developers to dynamically - * load and configure services into a system. With a little help from - * this macros statically linked services can also be dynamically - * configured. - * - * More details about this component are available in the documentation - * of the ACE_Service_Configurator class and also - * ACE_Dynamic_Service. - * - * Notice that in all the macros the SERVICE_CLASS parameter must be - * the name of a class derived from ACE_Service_Object. - */ -//@{ -/// Declare a the data structure required to register a statically -/// linked service into the service configurator. -/** - * The macro should be used in the header file where the service is - * declared, its only argument is usually the name of the class that - * implements the service. - * - * @param SERVICE_CLASS The name of the class implementing the - * service. - */ -# define ACE_STATIC_SVC_DECLARE(SERVICE_CLASS) \ -extern ACE_Static_Svc_Descriptor ace_svc_desc_##SERVICE_CLASS ; - -/// As ACE_STATIC_SVC_DECLARE, but using an export macro for NT -/// compilers. -/** - * NT compilers require the use of explicit directives to export and - * import symbols from a DLL. If you need to define a service in a - * dynamic library you should use this version instead. - * Normally ACE uses a macro to inject the correct export/import - * directives on NT. Naturally it also the macro expands to a blank - * on platforms that do not require such directives. - * The first argument (EXPORT_NAME) is the prefix for this export - * macro, the full name is formed by appending _Export. - * ACE provides tools to generate header files that define the macro - * correctly on all platforms, please see - * $ACE_ROOT/bin/generate_export_file.pl - * - * @param EXPORT_NAME The export macro name prefix. - * @param SERVICE_CLASS The name of the class implementing the service. - */ -#define ACE_STATIC_SVC_DECLARE_EXPORT(EXPORT_NAME,SERVICE_CLASS) \ -extern EXPORT_NAME##_Export ACE_Static_Svc_Descriptor ace_svc_desc_##SERVICE_CLASS; - -/// Define the data structure used to register a statically linked -/// service into the Service Configurator. -/** - * The service configurator requires several arguments to build and - * control an statically linked service, including its name, the - * factory function used to construct the service, and some flags. - * All those parameters are configured in a single structure, an - * instance of this structure is statically initialized using the - * following macro. - * - * @param SERVICE_CLASS The name of the class that implements the - * service, must be derived (directly or indirectly) from - * ACE_Service_Object. - * @param NAME The name for this service, this name is used by the - * service configurator to match configuration options provided in - * the svc.conf file. - * @param TYPE The type of object. Objects can be streams or service - * objects. Please read the ACE_Service_Configurator and ASX - * documentation for more details. - * @param FN The name of the factory function, usually the - * ACE_SVC_NAME macro can be used to generate the name. The - * factory function is often defined using ACE_FACTORY_DECLARE and - * ACE_FACTORY_DEFINE. - * @param FLAGS Flags to control the ownership and lifecycle of the - * object. Please read the ACE_Service_Configurator documentation - * for more details. - * @param ACTIVE If not zero then a thread will be dedicate to the - * service. Please read the ACE_Service_Configurator documentation - * for more details. - */ -# define ACE_STATIC_SVC_DEFINE(SERVICE_CLASS, NAME, TYPE, FN, FLAGS, ACTIVE) \ -ACE_Static_Svc_Descriptor ace_svc_desc_##SERVICE_CLASS = { NAME, TYPE, FN, FLAGS, ACTIVE }; - -/// Automatically register a service with the service configurator -/** - * In some applications the services must be automatically registered - * with the service configurator, before main() starts. - * The ACE_STATIC_SVC_REQUIRE macro defines a class whose constructor - * register the service, it also defines a static instance of that - * class to ensure that the service is registered before main. - * - * On platforms that lack adequate support for static C++ objects the - * macro ACE_STATIC_SVC_REGISTER can be used to explicitly register - * the service. - * - * @todo One class per-Service_Object seems wasteful. It should be - * possible to define a single class and re-use it for all the - * service objects, just by passing the Service_Descriptor as an - * argument to the constructor. - */ -#if defined(ACE_LACKS_STATIC_CONSTRUCTORS) -# define ACE_STATIC_SVC_REQUIRE(SERVICE_CLASS)\ -class ACE_Static_Svc_##SERVICE_CLASS {\ -public:\ - ACE_Static_Svc_##SERVICE_CLASS() { \ - ACE_Service_Config::insert (\ - &ace_svc_desc_##SERVICE_CLASS); \ - } \ -}; -#define ACE_STATIC_SVC_REGISTER(SERVICE_CLASS)\ -ACE_Static_Svc_##SERVICE_CLASS ace_static_svc_##SERVICE_CLASS - -#else /* !ACE_LACKS_STATIC_CONSTRUCTORS */ - -# define ACE_STATIC_SVC_REQUIRE(SERVICE_CLASS)\ -class ACE_Static_Svc_##SERVICE_CLASS {\ -public:\ - ACE_Static_Svc_##SERVICE_CLASS() { \ - ACE_Service_Config::insert (\ - &ace_svc_desc_##SERVICE_CLASS); \ - } \ -};\ -static ACE_Static_Svc_##SERVICE_CLASS ace_static_svc_##SERVICE_CLASS; -#define ACE_STATIC_SVC_REGISTER(SERVICE_CLASS) do {} while (0) - -#endif /* !ACE_LACKS_STATIC_CONSTRUCTORS */ - -// Preprocessor symbols will not be expanded if they are -// concatenated. Force the preprocessor to expand them during the -// argument prescan by calling a macro that itself calls another that -// performs the actual concatenation. -#define ACE_PREPROC_CONCATENATE_IMPL(A,B) A ## B -#define ACE_PREPROC_CONCATENATE(A,B) ACE_PREPROC_CONCATENATE_IMPL(A,B) - -#if defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1 -// Preprocessor symbols will not be expanded if they are -// concatenated. Force the preprocessor to expand them during the -// argument prescan by calling a macro that itself calls another that -// performs the actual concatenation. -# define ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(PREFIX,VERSIONED_NAMESPACE,SERVICE_CLASS) PREFIX ## _ ## VERSIONED_NAMESPACE ## _ ## SERVICE_CLASS -#else -# define ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(PREFIX,VERSIONED_NAMESPACE,SERVICE_CLASS) PREFIX ## _ ## SERVICE_CLASS -#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ - -#define ACE_MAKE_SVC_CONFIG_FACTORY_NAME(VERSIONED_NAMESPACE,SERVICE_CLASS) ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(_make,VERSIONED_NAMESPACE,SERVICE_CLASS) -#define ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(VERSIONED_NAMESPACE,SERVICE_CLASS) ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(_gobble,VERSIONED_NAMESPACE,SERVICE_CLASS) - -/// Declare the factory method used to create dynamically loadable -/// services. -/** - * Once the service implementation is dynamically loaded the Service - * Configurator uses a factory method to create the object. - * This macro declares such a factory function with the proper - * interface and export macros. - * Normally used in the header file that declares the service - * implementation. - * - * @param CLS must match the prefix of the export macro used for this - * service. - * @param SERVICE_CLASS must match the name of the class that - * implements the service. - * - */ -# define ACE_FACTORY_DECLARE(CLS,SERVICE_CLASS) \ -extern "C" CLS##_Export ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object * \ -ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (ACE_Service_Object_Exterminator *); - -/// Define the factory method (and destructor) for a dynamically -/// loadable service. -/** - * Use with arguments matching ACE_FACTORY_DECLARE. - * Normally used in the .cpp file that defines the service - * implementation. - * - * This macro defines both the factory method and the function used to - * cleanup the service object. - * - * If this macro is used to define a factory function that need not be - * exported (for example, in a static service situation), CLS can be - * specified as ACE_Local_Service. - */ -# define ACE_Local_Service_Export - -#if defined (ACE_OPENVMS) -# define ACE_PREPROC_STRINGIFY(A) #A -# define ACE_MAKE_SVC_REGISTRAR_ARG(A) ACE_PREPROC_STRINGIFY(A), (void*)&A -# define ACE_FACTORY_DEFINE(CLS,SERVICE_CLASS) \ -void ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (void *p) { \ - ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object * _p = \ - static_cast< ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *> (p); \ - ACE_ASSERT (_p != 0); \ - delete _p; } \ -extern "C" CLS##_Export ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *\ -ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (ACE_Service_Object_Exterminator *gobbler) \ -{ \ - ACE_TRACE (#SERVICE_CLASS); \ - if (gobbler != 0) \ - *gobbler = (ACE_Service_Object_Exterminator) ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS); \ - return new SERVICE_CLASS; \ -} \ -ACE_Dynamic_Svc_Registrar ace_svc_reg_##SERVICE_CLASS \ - (ACE_MAKE_SVC_REGISTRAR_ARG(ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS))); -#else -# define ACE_FACTORY_DEFINE(CLS,SERVICE_CLASS) \ -void ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (void *p) { \ - ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object * _p = \ - static_cast< ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *> (p); \ - ACE_ASSERT (_p != 0); \ - delete _p; } \ -extern "C" CLS##_Export ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *\ -ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (ACE_Service_Object_Exterminator *gobbler) \ -{ \ - ACE_TRACE (#SERVICE_CLASS); \ - if (gobbler != 0) \ - *gobbler = (ACE_Service_Object_Exterminator) ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS); \ - return new SERVICE_CLASS; \ -} -#endif - -/** - * For service classes scoped within namespaces, use this macro in - * place of ACE_FACTORY_DEFINE. The third argument in this case is - * the fully scoped name of the class as it is to be - * instantiated. For example, given: - * namespace ACE - * { - * namespace Foo - * { - * class Bar : public ACE_Service_Object - * {}; - * }; - * }; - * - * ACE_FACTORY_DECLARE(ACE,ACE_Foo_Bar) - * - * you would then use: - * - * ACE_FACTORY_NAMESPACE_DEFINE(ACE,ACE_Foo_Bar,ACE::Foo::Bar) - * - * Note that in this example, the ACE_FACTORY_DECLARE is done outside - * the namespace scope. Then, the SERVICE_CLASS name is the same as - * the fully scoped class name, but with '::' replaced with '_'. Doing - * this will ensure unique generated signatures for the various C - * style functions. - */ -#if defined (ACE_OPENVMS) -# define ACE_PREPROC_STRINGIFY(A) #A -# define ACE_MAKE_SVC_REGISTRAR_ARG(A) ACE_PREPROC_STRINGIFY(A), (void*)&A -# define ACE_FACTORY_NAMESPACE_DEFINE(CLS,SERVICE_CLASS,NAMESPACE_CLASS) \ -void ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (void *p) { \ - ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object * _p = \ - static_cast< ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *> (p); \ - ACE_ASSERT (_p != 0); \ - delete _p; } \ -extern "C" CLS##_Export ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *\ -ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (ACE_Service_Object_Exterminator *gobbler) \ -{ \ - ACE_TRACE (#SERVICE_CLASS); \ - if (gobbler != 0) \ - *gobbler = (ACE_Service_Object_Exterminator) ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS); \ - return new NAMESPACE_CLASS; \ -} \ -ACE_Dynamic_Svc_Registrar ace_svc_reg_##SERVICE_CLASS \ - (ACE_MAKE_SVC_REGISTRAR_ARG(ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS))); -#else -# define ACE_FACTORY_NAMESPACE_DEFINE(CLS,SERVICE_CLASS,NAMESPACE_CLASS) \ -void ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (void *p) { \ - ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object * _p = \ - static_cast< ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *> (p); \ - ACE_ASSERT (_p != 0); \ - delete _p; } \ -extern "C" CLS##_Export ACE_VERSIONED_NAMESPACE_NAME::ACE_Service_Object *\ -ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (ACE_Service_Object_Exterminator *gobbler) \ -{ \ - ACE_TRACE (#SERVICE_CLASS); \ - if (gobbler != 0) \ - *gobbler = (ACE_Service_Object_Exterminator) ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS); \ - return new NAMESPACE_CLASS; \ -} -#endif - -/// The canonical name for a service factory method -# define ACE_SVC_NAME(SERVICE_CLASS) ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) - -/// The canonical way to invoke (i.e. construct) a service factory -/// method. -#define ACE_SVC_INVOKE(SERVICE_CLASS) ACE_SVC_NAME(SERVICE_CLASS) (0) - -//@} - -/** @name Helper macros for services defined in the netsvcs library. - * - * The ACE services defined in netsvcs use this helper macros for - * simplicity. - * - */ -//@{ -# define ACE_SVC_FACTORY_DECLARE(X) ACE_FACTORY_DECLARE (ACE_Svc, X) -# define ACE_SVC_FACTORY_DEFINE(X) ACE_FACTORY_DEFINE (ACE_Svc, X) -//@} - -#if defined (ACE_WIN32) -// These are used in SPIPE_Acceptor/Connector, but are ignored at runtime. -# if defined (ACE_HAS_WINCE) -# if !defined (PIPE_TYPE_MESSAGE) -# define PIPE_TYPE_MESSAGE 0 -# endif -# if !defined (PIPE_READMODE_MESSAGE) -# define PIPE_READMODE_MESSAGE 0 -# endif -# if !defined (PIPE_WAIT) -# define PIPE_WAIT 0 -# endif -# endif /* ACE_HAS_WINCE */ -#else /* !ACE_WIN32 */ -// Add some typedefs and macros to enhance Win32 conformance... -# if !defined (LPSECURITY_ATTRIBUTES) -# define LPSECURITY_ATTRIBUTES int -# endif /* !defined LPSECURITY_ATTRIBUTES */ -# if !defined (GENERIC_READ) -# define GENERIC_READ 0 -# endif /* !defined GENERIC_READ */ -# if !defined (FILE_SHARE_READ) -# define FILE_SHARE_READ 0 -# endif /* !defined FILE_SHARE_READ */ -# if !defined (OPEN_EXISTING) -# define OPEN_EXISTING 0 -# endif /* !defined OPEN_EXISTING */ -# if !defined (FILE_ATTRIBUTE_NORMAL) -# define FILE_ATTRIBUTE_NORMAL 0 -# endif /* !defined FILE_ATTRIBUTE_NORMAL */ -# if !defined (MAXIMUM_WAIT_OBJECTS) -# define MAXIMUM_WAIT_OBJECTS 0 -# endif /* !defined MAXIMUM_WAIT_OBJECTS */ -# if !defined (FILE_FLAG_OVERLAPPED) -# define FILE_FLAG_OVERLAPPED 0 -# endif /* !defined FILE_FLAG_OVERLAPPED */ -# if !defined (FILE_FLAG_SEQUENTIAL_SCAN) -# define FILE_FLAG_SEQUENTIAL_SCAN 0 -# endif /* FILE_FLAG_SEQUENTIAL_SCAN */ -# if !defined(FILE_FLAG_WRITE_THROUGH) -# define FILE_FLAG_WRITE_THROUGH 0 -# endif /* !defined FILE_FLAG_WRITE_THROUGH */ -# if !defined(PIPE_WAIT) -# define PIPE_WAIT 0 -# endif /* !defined PIPE_WAIT */ -# if !defined(PIPE_NOWAIT) -# define PIPE_NOWAIT 0 -# endif /* !defined PIPE_WAIT */ -# if !defined(PIPE_READMODE_BYTE) -# define PIPE_READMODE_BYTE 0 -# endif /* !defined PIPE_READMODE_BYTE */ -# if !defined(PIPE_READMODE_MESSAGE) -# define PIPE_READMODE_MESSAGE 0 -# endif /* !defined PIPE_READMODE_MESSAGE */ -# if !defined(PIPE_TYPE_BYTE) -# define PIPE_TYPE_BYTE 0 -# endif /* !defined PIPE_TYPE_BYTE */ -# if !defined(PIPE_TYPE_MESSAGE) -# define PIPE_TYPE_MESSAGE 0 -# endif /* !defined PIPE_TYPE_MESSAGE */ -#endif /* ACE_WIN32 */ - -// Some useful abstrations for expressions involving -// ACE_Allocator.malloc (). The difference between ACE_NEW_MALLOC* -// with ACE_ALLOCATOR* is that they call constructors also. - -#include "ace/OS_Errno.h" /* Need errno and ENOMEM */ - -# define ACE_ALLOCATOR_RETURN(POINTER,ALLOCATOR,RET_VAL) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return RET_VAL; } \ - } while (0) -# define ACE_ALLOCATOR(POINTER,ALLOCATOR) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return; } \ - } while (0) -# define ACE_ALLOCATOR_NORETURN(POINTER,ALLOCATOR) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; } \ - } while (0) - -# define ACE_NEW_MALLOC_RETURN(POINTER,ALLOCATOR,CONSTRUCTOR,RET_VAL) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return RET_VAL;} \ - else { (void) new (POINTER) CONSTRUCTOR; } \ - } while (0) -# define ACE_NEW_MALLOC(POINTER,ALLOCATOR,CONSTRUCTOR) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return;} \ - else { (void) new (POINTER) CONSTRUCTOR; } \ - } while (0) -# define ACE_NEW_MALLOC_NORETURN(POINTER,ALLOCATOR,CONSTRUCTOR) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM;} \ - else { (void) new (POINTER) CONSTRUCTOR; } \ - } while (0) - -/* ACE_Metrics */ -#if defined ACE_LACKS_ARRAY_PLACEMENT_NEW -# define ACE_NEW_MALLOC_ARRAY_RETURN(POINTER,ALLOCATOR,CONSTRUCTOR,COUNT,RET_VAL) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return RET_VAL;} \ - else { for (u_int i = 0; i < COUNT; ++i) \ - {(void) new (POINTER) CONSTRUCTOR; ++POINTER;} \ - POINTER -= COUNT;} \ - } while (0) -# define ACE_NEW_MALLOC_ARRAY(POINTER,ALLOCATOR,CONSTRUCTOR,COUNT) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return;} \ - else { for (u_int i = 0; i < COUNT; ++i) \ - {(void) new (POINTER) CONSTRUCTOR; ++POINTER;} \ - POINTER -= COUNT;} \ - } while (0) -#else /* ! defined ACE_LACKS_ARRAY_PLACEMENT_NEW */ -# define ACE_NEW_MALLOC_ARRAY_RETURN(POINTER,ALLOCATOR,CONSTRUCTOR,COUNT,RET_VAL) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return RET_VAL;} \ - else { (void) new (POINTER) CONSTRUCTOR [COUNT]; } \ - } while (0) -# define ACE_NEW_MALLOC_ARRAY(POINTER,ALLOCATOR,CONSTRUCTOR,COUNT) \ - do { POINTER = ALLOCATOR; \ - if (POINTER == 0) { errno = ENOMEM; return;} \ - else { (void) new (POINTER) CONSTRUCTOR [COUNT]; } \ - } while (0) -#endif /* defined ACE_LACKS_ARRAY_PLACEMENT_NEW */ - -// This is being placed here temporarily to help stablelize the builds, but will -// be moved out along with the above macros as part of the subsetting. dhinton -#if !defined (ACE_LACKS_NEW_H) -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# include /**/ -# else -# include /**/ -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ -#endif /* ! ACE_LACKS_NEW_H */ - -# define ACE_NOOP(x) - -#if defined (ACE_WIN32) && defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) -# define ACE_SEH_TRY __try -# define ACE_SEH_EXCEPT(X) __except(X) -# define ACE_SEH_FINALLY __finally -#else /* !ACE_WIN32 */ -# define ACE_SEH_TRY if (1) -# define ACE_SEH_EXCEPT(X) while (0) -# define ACE_SEH_FINALLY if (1) -#endif /* ACE_WIN32 */ - -// These should probably be put into a seperate header. - -// The following is necessary since many C++ compilers don't support -// typedef'd types inside of classes used as formal template -// arguments... ;-(. Luckily, using the C++ preprocessor I can hide -// most of this nastiness! - -# if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -// Handle ACE_Message_Queue. -# define ACE_SYNCH_DECL class _ACE_SYNCH -# define ACE_SYNCH_USE _ACE_SYNCH -# define ACE_SYNCH_MUTEX_T typename _ACE_SYNCH::MUTEX -# define ACE_SYNCH_CONDITION_T typename _ACE_SYNCH::CONDITION -# define ACE_SYNCH_SEMAPHORE_T typename _ACE_SYNCH::SEMAPHORE - -// Handle ACE_Malloc* -# define ACE_MEM_POOL_1 class _ACE_MEM_POOL -# define ACE_MEM_POOL_2 _ACE_MEM_POOL -# define ACE_MEM_POOL _ACE_MEM_POOL -# define ACE_MEM_POOL_OPTIONS typename _ACE_MEM_POOL::OPTIONS - -// Handle ACE_Svc_Handler -# define ACE_PEER_STREAM_1 class _ACE_PEER_STREAM -# define ACE_PEER_STREAM_2 _ACE_PEER_STREAM -# define ACE_PEER_STREAM _ACE_PEER_STREAM -# define ACE_PEER_STREAM_ADDR typename _ACE_PEER_STREAM::PEER_ADDR - -// Handle ACE_Acceptor -# define ACE_PEER_ACCEPTOR_1 class _ACE_PEER_ACCEPTOR -# define ACE_PEER_ACCEPTOR_2 _ACE_PEER_ACCEPTOR -# define ACE_PEER_ACCEPTOR _ACE_PEER_ACCEPTOR -# define ACE_PEER_ACCEPTOR_ADDR typename _ACE_PEER_ACCEPTOR::PEER_ADDR - -// Handle ACE_Connector -# define ACE_PEER_CONNECTOR_1 class _ACE_PEER_CONNECTOR -# define ACE_PEER_CONNECTOR_2 _ACE_PEER_CONNECTOR -# define ACE_PEER_CONNECTOR _ACE_PEER_CONNECTOR -# define ACE_PEER_CONNECTOR_ADDR typename ACE_PEER_CONNECTOR::PEER_ADDR -# define ACE_PEER_CONNECTOR_ADDR_ANY ACE_PEER_ADDR_TYPEDEF::sap_any - -// Handle ACE_SOCK_* -# define ACE_SOCK_ACCEPTOR ACE_SOCK_Acceptor -# define ACE_SOCK_CONNECTOR ACE_SOCK_Connector -# define ACE_SOCK_STREAM ACE_SOCK_Stream -# define ACE_SOCK_DGRAM ACE_SOCK_Dgram -# define ACE_SOCK_DGRAM_BCAST ACE_SOCK_Dgram_Bcast -# define ACE_SOCK_DGRAM_MCAST ACE_SOCK_Dgram_Mcast - -// Handle ACE_SOCK_SEQPACK_* -# define ACE_SOCK_SEQPACK_ACCEPTOR ACE_SOCK_SEQPACK_Acceptor -# define ACE_SOCK_SEQPACK_CONNECTOR ACE_SOCK_SEQPACK_Connector -# define ACE_SOCK_SEQPACK_ASSOCIATION ACE_SOCK_SEQPACK_Association - -// Handle ACE_MEM_* -# define ACE_MEM_ACCEPTOR ACE_MEM_Acceptor -# define ACE_MEM_CONNECTOR ACE_MEM_Connector -# define ACE_MEM_STREAM ACE_MEM_Stream - -// Handle ACE_LSOCK_* -# define ACE_LSOCK_ACCEPTOR ACE_LSOCK_Acceptor -# define ACE_LSOCK_CONNECTOR ACE_LSOCK_Connector -# define ACE_LSOCK_STREAM ACE_LSOCK_Stream - -// Handle ACE_TLI_* -# define ACE_TLI_ACCEPTOR ACE_TLI_Acceptor -# define ACE_TLI_CONNECTOR ACE_TLI_Connector -# define ACE_TLI_STREAM ACE_TLI_Stream - -// Handle ACE_SPIPE_* -# define ACE_SPIPE_ACCEPTOR ACE_SPIPE_Acceptor -# define ACE_SPIPE_CONNECTOR ACE_SPIPE_Connector -# define ACE_SPIPE_STREAM ACE_SPIPE_Stream - -// Handle ACE_UPIPE_* -# define ACE_UPIPE_ACCEPTOR ACE_UPIPE_Acceptor -# define ACE_UPIPE_CONNECTOR ACE_UPIPE_Connector -# define ACE_UPIPE_STREAM ACE_UPIPE_Stream - -// Handle ACE_FILE_* -# define ACE_FILE_CONNECTOR ACE_FILE_Connector -# define ACE_FILE_STREAM ACE_FILE_IO - -// Handle ACE_*_Memory_Pool. -# define ACE_MMAP_MEMORY_POOL ACE_MMAP_Memory_Pool -# define ACE_LITE_MMAP_MEMORY_POOL ACE_Lite_MMAP_Memory_Pool -# define ACE_SBRK_MEMORY_POOL ACE_Sbrk_Memory_Pool -# define ACE_SHARED_MEMORY_POOL ACE_Shared_Memory_Pool -# define ACE_LOCAL_MEMORY_POOL ACE_Local_Memory_Pool -# define ACE_PAGEFILE_MEMORY_POOL ACE_Pagefile_Memory_Pool - -# else /* TEMPLATES are broken in some form or another (i.e., most C++ compilers) */ - -// Handle ACE_Message_Queue. -# if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) -# define ACE_SYNCH_DECL class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T, class _ACE_SYNCH_SEMAPHORE_T -# define ACE_SYNCH_USE _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T, _ACE_SYNCH_SEMAPHORE_T -# else -# define ACE_SYNCH_DECL class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T -# define ACE_SYNCH_USE _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T -# endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ -# define ACE_SYNCH_MUTEX_T _ACE_SYNCH_MUTEX_T -# define ACE_SYNCH_CONDITION_T _ACE_SYNCH_CONDITION_T -# define ACE_SYNCH_SEMAPHORE_T _ACE_SYNCH_SEMAPHORE_T - -// Handle ACE_Malloc* -# define ACE_MEM_POOL_1 class _ACE_MEM_POOL, class _ACE_MEM_POOL_OPTIONS -# define ACE_MEM_POOL_2 _ACE_MEM_POOL, _ACE_MEM_POOL_OPTIONS -# define ACE_MEM_POOL _ACE_MEM_POOL -# define ACE_MEM_POOL_OPTIONS _ACE_MEM_POOL_OPTIONS - -// Handle ACE_Svc_Handler -# define ACE_PEER_STREAM_1 class _ACE_PEER_STREAM, class _ACE_PEER_ADDR -# define ACE_PEER_STREAM_2 _ACE_PEER_STREAM, _ACE_PEER_ADDR -# define ACE_PEER_STREAM _ACE_PEER_STREAM -# define ACE_PEER_STREAM_ADDR _ACE_PEER_ADDR - -// Handle ACE_Acceptor -# define ACE_PEER_ACCEPTOR_1 class _ACE_PEER_ACCEPTOR, class _ACE_PEER_ADDR -# define ACE_PEER_ACCEPTOR_2 _ACE_PEER_ACCEPTOR, _ACE_PEER_ADDR -# define ACE_PEER_ACCEPTOR _ACE_PEER_ACCEPTOR -# define ACE_PEER_ACCEPTOR_ADDR _ACE_PEER_ADDR - -// Handle ACE_Connector -# define ACE_PEER_CONNECTOR_1 class _ACE_PEER_CONNECTOR, class _ACE_PEER_ADDR -# define ACE_PEER_CONNECTOR_2 _ACE_PEER_CONNECTOR, _ACE_PEER_ADDR -# define ACE_PEER_CONNECTOR _ACE_PEER_CONNECTOR -# define ACE_PEER_CONNECTOR_ADDR _ACE_PEER_ADDR -# define ACE_PEER_CONNECTOR_ADDR_ANY ACE_PEER_CONNECTOR_ADDR::sap_any - -// Handle ACE_SOCK_* -# define ACE_SOCK_ACCEPTOR ACE_SOCK_Acceptor, ACE_INET_Addr -# define ACE_SOCK_CONNECTOR ACE_SOCK_Connector, ACE_INET_Addr -# define ACE_SOCK_STREAM ACE_SOCK_Stream, ACE_INET_Addr -# define ACE_SOCK_DGRAM ACE_SOCK_Dgram, ACE_INET_Addr -# define ACE_SOCK_DGRAM_BCAST ACE_SOCK_Dgram_Bcast, ACE_INET_Addr -# define ACE_SOCK_DGRAM_MCAST ACE_SOCK_Dgram_Mcast, ACE_INET_Addr - -// Handle ACE_SOCK_SEQPACK_* -# define ACE_SOCK_SEQPACK_ACCEPTOR ACE_SOCK_SEQPACK_Acceptor, ACE_Multihomed_INET_Addr -# define ACE_SOCK_SEQPACK_CONNECTOR ACE_SOCK_SEQPACK_Connector, ACE_Multihomed_INET_Addr -# define ACE_SOCK_SEQPACK_ASSOCIATION ACE_SOCK_SEQPACK_Association, ACE_Multihomed_INET_Addr - -// Handle ACE_MEM_* -# define ACE_MEM_ACCEPTOR ACE_MEM_Acceptor, ACE_MEM_Addr -# define ACE_MEM_CONNECTOR ACE_MEM_Connector, ACE_INET_Addr -# define ACE_MEM_STREAM ACE_MEM_Stream, ACE_INET_Addr - -// Handle ACE_LSOCK_* -# define ACE_LSOCK_ACCEPTOR ACE_LSOCK_Acceptor, ACE_UNIX_Addr -# define ACE_LSOCK_CONNECTOR ACE_LSOCK_Connector, ACE_UNIX_Addr -# define ACE_LSOCK_STREAM ACE_LSOCK_Stream, ACE_UNIX_Addr - -// Handle ACE_TLI_* -# define ACE_TLI_ACCEPTOR ACE_TLI_Acceptor, ACE_INET_Addr -# define ACE_TLI_CONNECTOR ACE_TLI_Connector, ACE_INET_Addr -# define ACE_TLI_STREAM ACE_TLI_Stream, ACE_INET_Addr - -// Handle ACE_SPIPE_* -# define ACE_SPIPE_ACCEPTOR ACE_SPIPE_Acceptor, ACE_SPIPE_Addr -# define ACE_SPIPE_CONNECTOR ACE_SPIPE_Connector, ACE_SPIPE_Addr -# define ACE_SPIPE_STREAM ACE_SPIPE_Stream, ACE_SPIPE_Addr - -// Handle ACE_UPIPE_* -# define ACE_UPIPE_ACCEPTOR ACE_UPIPE_Acceptor, ACE_SPIPE_Addr -# define ACE_UPIPE_CONNECTOR ACE_UPIPE_Connector, ACE_SPIPE_Addr -# define ACE_UPIPE_STREAM ACE_UPIPE_Stream, ACE_SPIPE_Addr - -// Handle ACE_FILE_* -# define ACE_FILE_CONNECTOR ACE_FILE_Connector, ACE_FILE_Addr -# define ACE_FILE_STREAM ACE_FILE_IO, ACE_FILE_Addr - -// Handle ACE_*_Memory_Pool. -# define ACE_MMAP_MEMORY_POOL ACE_MMAP_Memory_Pool, ACE_MMAP_Memory_Pool_Options -# define ACE_LITE_MMAP_MEMORY_POOL ACE_Lite_MMAP_Memory_Pool, ACE_MMAP_Memory_Pool_Options -# define ACE_SBRK_MEMORY_POOL ACE_Sbrk_Memory_Pool, ACE_Sbrk_Memory_Pool_Options -# define ACE_SHARED_MEMORY_POOL ACE_Shared_Memory_Pool, ACE_Shared_Memory_Pool_Options -# define ACE_LOCAL_MEMORY_POOL ACE_Local_Memory_Pool, ACE_Local_Memory_Pool_Options -# define ACE_PAGEFILE_MEMORY_POOL ACE_Pagefile_Memory_Pool, ACE_Pagefile_Memory_Pool_Options -# endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ - -// Work around compilers that don't like in-class static integral -// constants. Constants in this case are meant to be compile-time -// constants so that they may be used as template arguments, for -// example. BOOST provides a similar macro. -#ifndef ACE_LACKS_STATIC_IN_CLASS_CONSTANTS -# define ACE_STATIC_CONSTANT(TYPE, ASSIGNMENT) static TYPE const ASSIGNMENT -#else -# define ACE_STATIC_CONSTANT(TYPE, ASSIGNMENT) enum { ASSIGNMENT } -#endif /* !ACE_LACKS_STATIC_IN_CLASS_CONSTANTS */ - -#include /**/ "ace/post.h" - -#endif /*ACE_GLOBAL_MACROS_H*/ - diff --git a/dep/include/ace/Guard_T.h b/dep/include/ace/Guard_T.h deleted file mode 100644 index a70bdda713a..00000000000 --- a/dep/include/ace/Guard_T.h +++ /dev/null @@ -1,366 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Guard_T.h - * - * $Id: Guard_T.h 82508 2008-08-05 13:52:48Z johnnyw $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_GUARD_T_H -#define ACE_GUARD_T_H -#include /**/ "ace/pre.h" - -#include "ace/Lock.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Guard - * - * @brief This data structure is meant to be used within a method or - * function... It performs automatic aquisition and release of - * a parameterized synchronization object . - * - * The class given as an actual parameter must provide at - * the very least the , , , and - * methods. - */ -template -class ACE_Guard -{ -public: - - // = Initialization and termination methods. - ACE_Guard (ACE_LOCK &l); - - /// Implicitly and automatically acquire (or try to acquire) the - /// lock. If @a block is non-0 then the , else - /// it. - ACE_Guard (ACE_LOCK &l, bool block); - - /// Initialise the guard without implicitly acquiring the lock. The - /// parameter indicates whether the guard should release - /// the lock implicitly on destruction. The parameter is - /// ignored and is used here to disambiguate with the preceding - /// constructor. - ACE_Guard (ACE_LOCK &l, bool block, int become_owner); - - /// Implicitly release the lock. - ~ACE_Guard (void); - - // = Lock accessors. - - /// Explicitly acquire the lock. - int acquire (void); - - /// Conditionally acquire the lock (i.e., won't block). - int tryacquire (void); - - /// Explicitly release the lock, but only if it is held! - int release (void); - - /// Relinquish ownership of the lock so that it is not released - /// implicitly in the destructor. - void disown (void); - - // = Utility methods. - /// 1 if locked, 0 if couldn't acquire the lock - /// (errno will contain the reason for this). - int locked (void) const; - - /// Explicitly remove the lock. - int remove (void); - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - - /// Helper, meant for subclass only. - ACE_Guard (ACE_LOCK *lock): lock_ (lock), owner_ (0) {} - - /// Pointer to the ACE_LOCK we're guarding. - ACE_LOCK *lock_; - - /// Keeps track of whether we acquired the lock or failed. - int owner_; - -private: - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Guard &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Guard (const ACE_Guard &)) -}; - -/** - * @class ACE_Write_Guard - * - * @brief This class is similar to class ACE_Guard, though it - * acquires/releases a write lock automatically (naturally, the - * it is instantiated with must support the appropriate - * API). - */ -template -class ACE_Write_Guard : public ACE_Guard -{ -public: - // = Initialization method. - - /// Implicitly and automatically acquire a write lock. - ACE_Write_Guard (ACE_LOCK &m); - - /// Implicitly and automatically acquire (or try to acquire) a write - /// lock. - ACE_Write_Guard (ACE_LOCK &m, bool block); - - // = Lock accessors. - - /// Explicitly acquire the write lock. - int acquire_write (void); - - /// Explicitly acquire the write lock. - int acquire (void); - - /// Conditionally acquire the write lock (i.e., won't block). - int tryacquire_write (void); - - /// Conditionally acquire the write lock (i.e., won't block). - int tryacquire (void); - - // = Utility methods. - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -/** - * @class ACE_Read_Guard - * - * @brief This class is similar to class ACE_Guard, though it - * acquires/releases a read lock automatically (naturally, the - * it is instantiated with must support the appropriate - * API). - */ -template -class ACE_Read_Guard : public ACE_Guard -{ -public: - // = Initialization methods. - - /// Implicitly and automatically acquire a read lock. - ACE_Read_Guard (ACE_LOCK& m); - - /// Implicitly and automatically acquire (or try to acquire) a read - /// lock. - ACE_Read_Guard (ACE_LOCK &m, bool block); - - // = Lock accessors. - - /// Explicitly acquire the read lock. - int acquire_read (void); - - /// Explicitly acquire the read lock. - int acquire (void); - - /// Conditionally acquire the read lock (i.e., won't block). - int tryacquire_read (void); - - /// Conditionally acquire the read lock (i.e., won't block). - int tryacquire (void); - - // = Utility methods. - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) - -#define ACE_TSS_Guard ACE_Guard -#define ACE_TSS_Write_GUARD ACE_Write_Guard -#define ACE_TSS_Read_GUARD ACE_Read_Guard - -#else - /* ACE platform supports some form of threading and - thread-specific storage. */ - -/** - * @class ACE_TSS_Guard - * - * @brief This data structure is meant to be used within a method or - * function... It performs automatic aquisition and release of - * a synchronization object. Moreover, it ensures that the lock - * is released even if a thread exits via ! - */ -template -class ACE_TSS_Guard -{ -public: - // = Initialization and termination methods. - - /// Implicitly and automatically acquire the thread-specific lock. - ACE_TSS_Guard (ACE_LOCK &lock, bool block = true); - - /// Implicitly release the thread-specific lock. - ~ACE_TSS_Guard (void); - - // = Lock accessors. - - /// Explicitly acquire the thread-specific lock. - int acquire (void); - - /// Conditionally acquire the thread-specific lock (i.e., won't - /// block). - int tryacquire (void); - - /// Explicitly release the thread-specific lock. - int release (void); - - // = Utility methods. - /// Explicitly release the thread-specific lock. - int remove (void); - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - /// Helper, meant for subclass only. - ACE_TSS_Guard (void); - - /// Initialize the key. - void init_key (void); - - /// Called when thread exits to clean up the lock. - static void cleanup (void *ptr); - - /// Thread-specific key... - ACE_thread_key_t key_; - -private: - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_TSS_Guard &)) - ACE_UNIMPLEMENTED_FUNC (ACE_TSS_Guard (const ACE_TSS_Guard &)) -}; - -/** - * @class ACE_TSS_Write_Guard - * - * @brief This class is similar to class ACE_TSS_Guard, though it - * acquires/releases a write-lock automatically (naturally, the - * ACE_LOCK it is instantiated with must support the appropriate - * API). - */ -template -class ACE_TSS_Write_Guard : public ACE_TSS_Guard -{ -public: - // = Initialization method. - - /// Implicitly and automatically acquire the thread-specific write lock. - ACE_TSS_Write_Guard (ACE_LOCK &lock, bool block = true); - - // = Lock accessors. - - /// Explicitly acquire the thread-specific write lock. - int acquire_write (void); - - /// Explicitly acquire the thread-specific write lock. - int acquire (void); - - /// Conditionally acquire the thread-specific write lock (i.e., won't block). - int tryacquire_write (void); - - /// Conditionally acquire the thread-specific write lock (i.e., won't block). - int tryacquire (void); - - // = Utility methods. - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -/** - * @class ACE_TSS_Read_Guard - * - * @brief This class is similar to class , though it - * acquires/releases a read lock automatically (naturally, the - * it is instantiated with must support the - * appropriate API). - */ -template -class ACE_TSS_Read_Guard : public ACE_TSS_Guard -{ -public: - // = Initialization method. - /// Implicitly and automatically acquire the thread-specific read lock. - ACE_TSS_Read_Guard (ACE_LOCK &lock, bool block = true); - - // = Lock accessors. - /// Explicitly acquire the thread-specific read lock. - int acquire_read (void); - - /// Explicitly acquire the thread-specific read lock. - int acquire (void); - - /// Conditionally acquire the thread-specific read lock (i.e., won't - /// block). - int tryacquire_read (void); - - /// Conditionally acquire the thread-specific read lock (i.e., won't - /// block). - int tryacquire (void); - - // = Utility methods. - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#endif /* !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Guard_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Guard_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Guard_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_GUARD_T_H */ - diff --git a/dep/include/ace/Guard_T.inl b/dep/include/ace/Guard_T.inl deleted file mode 100644 index 5fb22b3bac7..00000000000 --- a/dep/include/ace/Guard_T.inl +++ /dev/null @@ -1,170 +0,0 @@ -// -*- C++ -*- -// -// $Id: Guard_T.inl 82508 2008-08-05 13:52:48Z johnnyw $ - -#include "ace/RW_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Guard::acquire (void) -{ - return this->owner_ = this->lock_->acquire (); -} - -template ACE_INLINE int -ACE_Guard::tryacquire (void) -{ - return this->owner_ = this->lock_->tryacquire (); -} - -template ACE_INLINE int -ACE_Guard::release (void) -{ - if (this->owner_ == -1) - return -1; - else - { - this->owner_ = -1; - return this->lock_->release (); - } -} - -template ACE_INLINE -ACE_Guard::ACE_Guard (ACE_LOCK &l) - : lock_ (&l), - owner_ (0) -{ - this->acquire (); -} - -template ACE_INLINE -ACE_Guard::ACE_Guard (ACE_LOCK &l, bool block) - : lock_ (&l), - owner_ (0) -{ - if (block) - this->acquire (); - else - this->tryacquire (); -} - -template ACE_INLINE -ACE_Guard::ACE_Guard (ACE_LOCK &l, bool /* block */, int become_owner) - : lock_ (&l), - owner_ (become_owner == 0 ? -1 : 0) -{ -} - -// Implicitly and automatically acquire (or try to acquire) the -// lock. - -template ACE_INLINE -ACE_Guard::~ACE_Guard (void) -{ - this->release (); -} - -template ACE_INLINE int -ACE_Guard::locked (void) const -{ - return this->owner_ != -1; -} - -template ACE_INLINE int -ACE_Guard::remove (void) -{ - return this->lock_->remove (); -} - -template ACE_INLINE void -ACE_Guard::disown (void) -{ - this->owner_ = -1; -} - -template ACE_INLINE -ACE_Write_Guard::ACE_Write_Guard (ACE_LOCK &m) - : ACE_Guard (&m) -{ - this->acquire_write (); -} - -template ACE_INLINE int -ACE_Write_Guard::acquire_write (void) -{ - return this->owner_ = this->lock_->acquire_write (); -} - -template ACE_INLINE int -ACE_Write_Guard::acquire (void) -{ - return this->owner_ = this->lock_->acquire_write (); -} - -template ACE_INLINE int -ACE_Write_Guard::tryacquire_write (void) -{ - return this->owner_ = this->lock_->tryacquire_write (); -} - -template ACE_INLINE int -ACE_Write_Guard::tryacquire (void) -{ - return this->owner_ = this->lock_->tryacquire_write (); -} - -template ACE_INLINE -ACE_Write_Guard::ACE_Write_Guard (ACE_LOCK &m, - bool block) - : ACE_Guard (&m) -{ - if (block) - this->acquire_write (); - else - this->tryacquire_write (); -} - -template ACE_INLINE int -ACE_Read_Guard::acquire_read (void) -{ - return this->owner_ = this->lock_->acquire_read (); -} - -template ACE_INLINE int -ACE_Read_Guard::acquire (void) -{ - return this->owner_ = this->lock_->acquire_read (); -} - -template ACE_INLINE int -ACE_Read_Guard::tryacquire_read (void) -{ - return this->owner_ = this->lock_->tryacquire_read (); -} - -template ACE_INLINE int -ACE_Read_Guard::tryacquire (void) -{ - return this->owner_ = this->lock_->tryacquire_read (); -} - -template ACE_INLINE -ACE_Read_Guard::ACE_Read_Guard (ACE_LOCK &m) - : ACE_Guard (&m) -{ - this->acquire_read (); -} - -template ACE_INLINE -ACE_Read_Guard::ACE_Read_Guard (ACE_LOCK &m, - bool block) - : ACE_Guard (&m) -{ - if (block) - this->acquire_read (); - else - this->tryacquire_read (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Handle_Gobbler.h b/dep/include/ace/Handle_Gobbler.h deleted file mode 100644 index ed7107a6302..00000000000 --- a/dep/include/ace/Handle_Gobbler.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Handle_Gobbler.h - * - * $Id: Handle_Gobbler.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kirthika Parameswaran - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_HANDLE_GOBBLER_H -#define ACE_HANDLE_GOBBLER_H -#include /**/ "ace/pre.h" - -#include "ace/Handle_Set.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Handle_Gobbler - * - * @brief This class gobbles up handles. - * - * This is useful when we need to control the number of handles - * available for a process. This class is mostly used for - * testing purposes. - */ -class ACE_Handle_Gobbler -{ -public: - - /// Destructor. Cleans up any remaining handles. - inline ~ACE_Handle_Gobbler (void); - - /** - * Handles are opened continously until the process runs out of - * them, and then handles are closed - * (freed) thereby making them usable in the future. - */ - inline int consume_handles (size_t n_handles_to_keep_available); - - /// Free up @a n_handles. - inline int free_handles (size_t n_handles); - - /// All remaining handles are closed. - inline void close_remaining_handles (void); - -private: - typedef ACE_Handle_Set HANDLE_SET; - - /// The container which holds the open descriptors. - HANDLE_SET handle_set_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include "ace/Handle_Gobbler.inl" - -#include /**/ "ace/post.h" -#endif /* ACE_HANDLE_GOBBLER_H */ - diff --git a/dep/include/ace/Handle_Gobbler.inl b/dep/include/ace/Handle_Gobbler.inl deleted file mode 100644 index 4b81218e6de..00000000000 --- a/dep/include/ace/Handle_Gobbler.inl +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- -// -// $Id: Handle_Gobbler.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Since this is only included in Handle_Gobbler.h, these should be -// inline, not ACE_INLINE. -// FUZZ: disable check_for_inline - -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_fcntl.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -inline void -ACE_Handle_Gobbler::close_remaining_handles (void) -{ - ACE_Handle_Set_Iterator iter (this->handle_set_); - for (ACE_HANDLE h = iter (); h != ACE_INVALID_HANDLE; h = iter ()) - ACE_OS::close (h); -} - -inline -ACE_Handle_Gobbler::~ACE_Handle_Gobbler (void) -{ - this->close_remaining_handles (); -} - -inline int -ACE_Handle_Gobbler::free_handles (size_t n_handles) -{ - ACE_Handle_Set_Iterator iter (this->handle_set_); - for (ACE_HANDLE h = iter (); - h != ACE_INVALID_HANDLE && n_handles > 0; - --n_handles, h = iter ()) - ACE_OS::close (h); - - return 0; -} - -inline int -ACE_Handle_Gobbler::consume_handles (size_t n_handles_to_keep_available) -{ - int result = 0; - -#if defined(ACE_WIN32) - // On Win32, this style of gobbling doesn't seem to work. - ACE_UNUSED_ARG(n_handles_to_keep_available); - -#else - - while (1) - { - ACE_HANDLE handle = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); - - if (handle == ACE_INVALID_HANDLE) - { - if (ACE::out_of_handles (errno)) - { - result = this->free_handles (n_handles_to_keep_available); - break; - } - else - { - result = -1; - break; - } - } - if (handle >= FD_SETSIZE) - break; - this->handle_set_.set_bit (handle); - } - -#endif /* ACE_WIN32 */ - - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Handle_Ops.h b/dep/include/ace/Handle_Ops.h deleted file mode 100644 index 16ee852725d..00000000000 --- a/dep/include/ace/Handle_Ops.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Handle_Ops.h - * - * $Id: Handle_Ops.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Handle operations. - */ -//============================================================================= - -#ifndef ACE_HANDLE_OPS_H -#define ACE_HANDLE_OPS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -// = Operations on HANDLEs. -namespace ACE -{ - /** - * Wait up to @a timeout amount of time to actively open a device. - * This method doesn't perform the @c connect, it just does the - * timed wait. - */ - extern ACE_Export ACE_HANDLE handle_timed_open ( - ACE_Time_Value *timeout, - const ACE_TCHAR *name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa = 0); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_HANDLE_OPS_H */ - diff --git a/dep/include/ace/Handle_Set.h b/dep/include/ace/Handle_Set.h deleted file mode 100644 index 6e33055b4f6..00000000000 --- a/dep/include/ace/Handle_Set.h +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Handle_Set.h - * - * $Id: Handle_Set.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_HANDLE_SET_H -#define ACE_HANDLE_SET_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_select.h" -#include "ace/os_include/os_limits.h" - -#if defined (__QNX__) - typedef long fd_mask; -#endif /* __QNX__ */ - -// Default size of the ACE Reactor. -#if defined (FD_SETSIZE) - int const ACE_FD_SETSIZE = FD_SETSIZE; -#else /* !FD_SETSIZE */ -# define ACE_FD_SETSIZE FD_SETSIZE -#endif /* ACE_FD_SETSIZE */ - -#if !defined (ACE_DEFAULT_SELECT_REACTOR_SIZE) -# define ACE_DEFAULT_SELECT_REACTOR_SIZE ACE_FD_SETSIZE -#endif /* ACE_DEFAULT_SELECT_REACTOR_SIZE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Handle_Set - * - * @brief C++ wrapper facade for the socket @c fd_set abstraction. - * - * This abstraction is a very efficient wrapper facade over - * @c fd_set. In particular, no range checking is performed, so - * it's important not to set or clear bits that are outside the - * @c ACE_DEFAULT_SELECT_REACTOR_SIZE. - */ -class ACE_Export ACE_Handle_Set -{ -public: - friend class ACE_Handle_Set_Iterator; - - // = Initialization and termination. - - enum - { - MAXSIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE - }; - - // = Initialization methods. - /// Constructor, initializes the bitmask to all 0s. - ACE_Handle_Set (void); - - /** - * Constructor, initializes the handle set from a given mask. - */ - ACE_Handle_Set (const fd_set &mask); - - // = Methods for manipulating bitsets. - /// Initialize the bitmask to all 0s and reset the associated fields. - void reset (void); - - /** - * Checks whether @a handle is enabled. No range checking is - * performed so @a handle must be less than - * @c ACE_DEFAULT_SELECT_REACTOR_SIZE. - */ - int is_set (ACE_HANDLE handle) const; - - /// Enables the @a handle. No range checking is performed so @a handle - /// must be less than @c ACE_DEFAULT_SELECT_REACTOR_SIZE. - void set_bit (ACE_HANDLE handle); - - /// Disables the @a handle. No range checking is performed so - /// @a handle must be less than @c ACE_DEFAULT_SELECT_REACTOR_SIZE. - void clr_bit (ACE_HANDLE handle); - - /// Returns a count of the number of enabled bits. - int num_set (void) const; - - /// Returns the number of the large bit. - ACE_HANDLE max_set (void) const; - - /** - * Rescan the underlying @c fd_set up to handle @a max to find the new - * (highest bit set) and (how many bits set) values. - * This is useful for evaluating the changes after the handle set has - * been manipulated in some way other than member functions; for example, - * after - ACE_Select_Reactor_Handle_Set dispatch_set_; - - /// Tracks handles that are waited for by . - ACE_Select_Reactor_Handle_Set ready_set_; - - /// Defined as a pointer to allow overriding by derived classes... - ACE_Timer_Queue *timer_queue_; - - /// Handle signals without requiring global/static variables. - ACE_Sig_Handler *signal_handler_; - - /// Callback object that unblocks the ACE_Select_Reactor if it's - /// sleeping. - ACE_Reactor_Notify *notify_handler_; - - /// Keeps track of whether we should delete the timer queue (if we - /// didn't create it, then we don't delete it). - bool delete_timer_queue_; - - /// Keeps track of whether we should delete the signal handler (if we - /// didn't create it, then we don't delete it). - bool delete_signal_handler_; - - /// Keeps track of whether we need to delete the notify handler (if - /// we didn't create it, then we don't delete it). - bool delete_notify_handler_; - - /// True if we've been initialized yet... - bool initialized_; - - /// Restart the event-loop method automatically when - /// /. Pass over both the *and* the - * @a mask to allow the caller to dictate which - * method the will invoke. The ACE_Time_Value - * indicates how long to blocking trying to notify the - * . If @a timeout == 0, the caller will block until - * action is possible, else will wait until the relative time - * specified in *@a timeout elapses). - */ - virtual int notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - - /** - * Set the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify pipe before breaking out of its loop. By default, - * this is set to -1, which means "iterate until the pipe is empty." - * Setting this to a value like "1 or 2" will increase "fairness" - * (and thus prevent starvation) at the expense of slightly higher - * dispatching overhead. - */ - virtual void max_notify_iterations (int); - - /** - * Get the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify pipe before breaking out of its loop. - */ - virtual int max_notify_iterations (void); - - /// Get the existing restart value. - virtual int restart (void); - - /// Set a new value for restart and return the original value. - virtual int restart (int r); - - /// Set position that the main ACE_Select_Reactor thread is requeued in the - /// list of waiters during a callback. - virtual void requeue_position (int); - - /// Get position that the main ACE_Select_Reactor thread is requeued in the - /// list of waiters during a callback. - virtual int requeue_position (void); - - // = Low-level wait_set mask manipulation methods. - /// GET/SET/ADD/CLR the dispatch mask "bit" bound with the and - /// @a mask. - virtual int mask_ops (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - int ops); - - /// GET/SET/ADD/CLR the dispatch MASK "bit" bound with the - /// and @a mask. - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - - // = Low-level ready_set mask manipulation methods. - /// GET/SET/ADD/CLR the ready "bit" bound with the and @a mask. - virtual int ready_ops (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - int ops); - - /// GET/SET/ADD/CLR the ready "bit" bound with the and @a mask. - virtual int ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask, - int ops); - - /// Wake up all threads in waiting in the event loop - virtual void wakeup_all_threads (void); - - // = Only the owner thread can perform a . - - /// Set the new owner of the thread and return the old owner. - virtual int owner (ACE_thread_t n_id, ACE_thread_t *o_id = 0); - - /// Return the current owner of the thread. - virtual int owner (ACE_thread_t *); - - // = Miscellaneous Handler operations. - - /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. - */ - virtual ACE_Event_Handler *find_handler (ACE_HANDLE handle); - - /** - * Check to see if is associated with a valid Event_Handler - * bound to @a mask. Return the @a eh associated with this @a handler - * if != 0. - */ - virtual int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **eh = 0); - - /** - * Check to see if @a signum is associated with a valid Event_Handler - * bound to a signal. Return the associated with this - * handler if != 0. - */ - virtual int handler (int signum, - ACE_Event_Handler ** = 0); - - /// Returns true if we've been successfully initialized, else false. - virtual bool initialized (void); - - /// Returns the current size of the Reactor's internal descriptor - /// table. - virtual size_t size (void) const; - - /** - * Returns a reference to the ACE_Reactor_Token that is - * used to serialize the internal processing logic. - * This can be useful for situations where you need to avoid - * deadlock efficiently when ACE_Event_Handlers are used in - * multiple threads. - */ - virtual ACE_Lock &lock (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Internal methods that do the actual work. - - // All of these methods assume that the token - // lock is held by the public methods that call down to them. - - /// Do the work of actually binding the and with the - /// @a mask. - virtual int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - - /// Register a set of . - virtual int register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Do the work of actually unbinding the and with the - /// @a mask. - virtual int remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask); - - /// Remove a set of . - virtual int remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask); - - /// Suspend the associated with - virtual int suspend_i (ACE_HANDLE handle); - - /// Check to see if the associated with is - /// suspended. Returns 0 if not, 1 if so. - virtual int is_suspended_i (ACE_HANDLE handle); - - /// Resume the associated with - virtual int resume_i (ACE_HANDLE handle); - - /// Implement the public handler method. - virtual ACE_Event_Handler *find_handler_i (ACE_HANDLE handle); - - /// Implement the public handler method. - virtual int handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask, - ACE_Event_Handler ** = 0); - - /// Implement the public handler method. - virtual int handler_i (int signum, ACE_Event_Handler ** = 0); - - /** - * Check if there are any HANDLEs enabled in the , and - * if so, update the and return the number ready. If - * there aren't any HANDLEs enabled return 0. - */ - virtual int any_ready (ACE_Select_Reactor_Handle_Set &handle_set); - - /// Implement the method, assuming that the Sig_Guard is - /// beign held - virtual int any_ready_i (ACE_Select_Reactor_Handle_Set &handle_set); - - /// Take corrective action when errors occur. - virtual int handle_error (void); - - /// Make sure the handles are all valid. - virtual int check_handles (void); - - /// Wait for events to occur. - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - - // = Dispatching methods. - - /** - * Template Method that dispatches ACE_Event_Handlers for time - * events, I/O events, and signal events. Returns the total number - * of ACE_Event_Handlers that were dispatched or -1 if something - * goes wrong. - */ - virtual int dispatch (int nfound, - ACE_Select_Reactor_Handle_Set &); - - /** - * Dispatch all timer handlers that have expired. Returns -1 if the - * state of the has changed, else 0. - * is set to the number of timer handlers - * dispatched. - */ - virtual int dispatch_timer_handlers (int &number_dispatched); - - /** - * Dispatch any notification handlers. Returns -1 if the state of - * the has changed, else returns number of handlers - * notified. - */ - virtual int dispatch_notification_handlers (ACE_Select_Reactor_Handle_Set &dispatch_set, - int &number_of_active_handles, - int &number_of_handlers_dispatched); - - /** - * Dispatch all the input/output/except handlers that are enabled in - * the . Updates and - * according to the behavior of the - * number Returns -1 if the state of the has changed, - * else 0. - */ - virtual int dispatch_io_handlers (ACE_Select_Reactor_Handle_Set &dispatch_set, - int &number_of_active_handles, - int &number_of_handlers_dispatched); - - /** - * Factors the dispatching of an io handle set (each WRITE, EXCEPT - * or READ set of handles). It updates the - * and invokes this->notify_handle - * for all the handles in using the @a mask, - * and parameters. Must return -1 if - * this->state_changed otherwise it must return 0. - */ - virtual int dispatch_io_set (int number_of_active_handles, - int &number_of_handlers_dispatched, - int mask, - ACE_Handle_Set& dispatch_mask, - ACE_Handle_Set& ready_mask, - ACE_EH_PTMF callback); - - /// Notify the appropriate in the context of the - /// associated with that a particular event has occurred. - virtual void notify_handle (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Handle_Set &, - ACE_Event_Handler *eh, - ACE_EH_PTMF callback); - - /// Enqueue ourselves into the list of waiting threads at the - /// appropriate point specified by . - virtual void renew (void); - - /// Synchronization token for the MT_SAFE ACE_Select_Reactor. - ACE_SELECT_REACTOR_TOKEN token_; - - /// Adapter used to return internal lock to outside world. - ACE_Lock_Adapter lock_adapter_; - - /// Release the token lock when a Win32 structured exception occurs. - int release_token (void); - - /// Stops the VC++ compiler from bitching about exceptions and destructors - int handle_events_i (ACE_Time_Value *max_wait_time = 0); - - /// This flag is used to keep track of whether we are actively handling - /// events or not. - sig_atomic_t deactivated_; - -private: - /// Deny access since member-wise won't work... - ACE_UNIMPLEMENTED_FUNC (ACE_Select_Reactor_T (const ACE_Select_Reactor_T &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Select_Reactor_T &operator= (const ACE_Select_Reactor_T &) ) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Select_Reactor_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Select_Reactor_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Select_Reactor_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_SELECT_REACTOR_T_H */ - diff --git a/dep/include/ace/Select_Reactor_T.inl b/dep/include/ace/Select_Reactor_T.inl deleted file mode 100644 index 05405a5b17b..00000000000 --- a/dep/include/ace/Select_Reactor_T.inl +++ /dev/null @@ -1,236 +0,0 @@ -// -*- C++ -*- -// -// $Id: Select_Reactor_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Reactor.h" -#include "ace/Signal.h" -#include "ace/Sig_Handler.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_INLINE int -ACE_Select_Reactor_T::resume_handler (ACE_Event_Handler *h) -{ - ACE_TRACE ("ACE_Select_Reactor_T::resume_handler"); - return this->resume_handler (h->get_handle ()); -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::resume_handler (const ACE_Handle_Set &handles) -{ - ACE_TRACE ("ACE_Select_Reactor_T::resume_handler"); - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->resume_i (h) == -1) - return -1; - - return 0; -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::suspend_handler (ACE_Event_Handler *h) -{ - ACE_TRACE ("ACE_Select_Reactor_T::suspend_handler"); - return this->suspend_handler (h->get_handle ()); -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::suspend_handler (const ACE_Handle_Set &handles) -{ - ACE_TRACE ("ACE_Select_Reactor_T::suspend_handler"); - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->suspend_i (h) == -1) - return -1; - - return 0; -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp, - ACE_Event_Handler **old_sh, - ACE_Sig_Action *old_disp) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler"); - return this->signal_handler_->register_handler (signum, - new_sh, new_disp, - old_sh, old_disp); -} - -#if defined (ACE_WIN32) - -template -ACE_INLINE int -ACE_Select_Reactor_T::register_handler (ACE_Event_Handler *, - ACE_HANDLE ) -{ - // Don't have an implementation for this yet... - ACE_NOTSUP_RETURN (-1); -} - -#endif /* ACE_WIN32 */ - -template -ACE_INLINE int -ACE_Select_Reactor_T::register_handler (ACE_HANDLE , - ACE_HANDLE , - ACE_Event_Handler *, - ACE_Reactor_Mask ) -{ - // Don't have an implementation for this yet... - ACE_NOTSUP_RETURN (-1); -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::handler (int signum, ACE_Event_Handler **handler) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handler"); - return this->handler_i (signum, handler); -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp, - int sigkey) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); - return this->signal_handler_->remove_handler (signum, new_disp, old_disp, sigkey); -} - -template -ACE_INLINE int -ACE_Select_Reactor_T::uses_event_associations (void) -{ - // Since the Select_Reactor does not do any event associations, this - // function always return 0. - return 0; -} - -// = The remaining methods in this file must be called with locks -// held. - -// Performs operations on the "ready" bits. - -template ACE_INLINE int -ACE_Select_Reactor_T::ready_ops (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Select_Reactor_T::ready_ops"); - return this->ready_ops (handler->get_handle (), mask, ops); -} - -// Performs operations on the "dispatch" masks. - -template ACE_INLINE int -ACE_Select_Reactor_T::mask_ops (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Select_Reactor_T::mask_ops"); - return this->mask_ops (handler->get_handle (), mask, ops); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::schedule_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::schedule_wakeup"); - return this->mask_ops (eh->get_handle (), mask, ACE_Reactor::ADD_MASK); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::cancel_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::cancel_wakeup"); - return this->mask_ops (eh->get_handle (), mask, ACE_Reactor::CLR_MASK); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::schedule_wakeup"); - return this->mask_ops (handle, mask, ACE_Reactor::ADD_MASK); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::cancel_wakeup"); - return this->mask_ops (handle, mask, ACE_Reactor::CLR_MASK); -} - -template ACE_INLINE ACE_Lock & -ACE_Select_Reactor_T::lock (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::lock"); - return this->lock_adapter_; -} - -template ACE_INLINE void -ACE_Select_Reactor_T::wakeup_all_threads (void) -{ - // Send a notification, but don't block if there's no one to receive - // it. - this->notify (0, ACE_Event_Handler::NULL_MASK, (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::alertable_handle_events (ACE_Time_Value *max_wait_time) -{ - return this->handle_events (max_wait_time); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::alertable_handle_events (ACE_Time_Value &max_wait_time) -{ - return this->handle_events (max_wait_time); -} - -template ACE_INLINE int -ACE_Select_Reactor_T::deactivated (void) -{ - return this->deactivated_; -} - -template ACE_INLINE void -ACE_Select_Reactor_T::deactivate (int do_stop) -{ - { - ACE_MT (ACE_GUARD (ACE_SELECT_REACTOR_TOKEN, - ace_mon, - this->token_)); - this->deactivated_ = do_stop; - } - - this->wakeup_all_threads (); -} - -template ACE_INLINE size_t -ACE_Select_Reactor_T::size (void) const -{ - return this->handler_rep_.size (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Semaphore.h b/dep/include/ace/Semaphore.h deleted file mode 100644 index 82709ab6beb..00000000000 --- a/dep/include/ace/Semaphore.h +++ /dev/null @@ -1,184 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Semaphore.h - * - * $Id: Semaphore.h 81014 2008-03-19 11:41:31Z johnnyw $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SEMAPHORE_H -#define ACE_SEMAPHORE_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_Semaphore - * - * @brief Wrapper for Dijkstra style general semaphores. - */ -class ACE_Export ACE_Semaphore -{ -public: - // = Initialization and termination. - /// Initialize the semaphore, with initial value of "count". - ACE_Semaphore (unsigned int count = 1, // By default make this unlocked. - int type = USYNC_THREAD, - const ACE_TCHAR *name = 0, - void * = 0, - int max = 0x7fffffff); - - /// Implicitly destroy the semaphore. - ~ACE_Semaphore (void); - - /** - * Explicitly destroy the semaphore. Note that only one thread - * should call this method since it doesn't protect against race - * conditions. - */ - int remove (void); - - /// Block the thread until the semaphore count becomes - /// greater than 0, then decrement it. - int acquire (void); - - /** - * Block the thread until the semaphore count becomes greater than 0 - * (at which point it is decremented) or until @a tv times out (in - * which case -1 is returned and @c errno == @c ETIME). Note that @a tv - * is assumed to be in "absolute" rather than "relative" time. The - * value of @a tv is updated upon return to show the actual - * (absolute) acquisition time. - * - * @note Solaris threads do not support timed semaphores. - * Therefore, if you're running on Solaris you might want to - * consider using the ACE POSIX pthreads implementation instead, - * which can be enabled by compiling ACE with - * -DACE_HAS_PTHREADS, rather than -DACE_HAS_STHREADS or - * -DACE_HAS_POSIX_SEM. - */ - int acquire (ACE_Time_Value &tv); - - /** - * If @a tv == 0 then call directly. Otherwise, Block - * the thread until the semaphore count becomes greater than 0 - * (at which point it is decremented) or until @a tv times out (in - * which case -1 is returned and @c errno == @c ETIME). Note that - * <*tv> is assumed to be in "absolute" rather than "relative" time. - * The value of <*tv> is updated upon return to show the actual - * (absolute) acquisition time. - * - * @note Solaris threads do not support timed semaphores. - * Therefore, if you're running on Solaris you might want to - * consider using the ACE POSIX pthreads implementation instead, - * which can be enabled by compiling ACE with - * -DACE_HAS_PTHREADS, rather than -DACE_HAS_STHREADS or - * -DACE_HAS_POSIX_SEM. */ - int acquire (ACE_Time_Value *tv); - - /** - * Conditionally decrement the semaphore if count is greater than 0 - * (i.e., won't block). Returns -1 on failure. If we "failed" - * because someone else already had the lock, @c errno is set to - * @c EBUSY. - */ - int tryacquire (void); - - /// Increment the semaphore by 1, potentially unblocking a waiting - /// thread. - int release (void); - - /// Increment the semaphore by @a release_count, potentially - /// unblocking waiting threads. - int release (unsigned int release_count); - - /** - * Acquire semaphore ownership. This calls and is only - * here to make the ACE_Semaphore interface consistent with the - * other synchronization APIs. - */ - int acquire_read (void); - - /** - * Acquire semaphore ownership. This calls and is only - * here to make the ACE_Semaphore interface consistent with the - * other synchronization APIs. - */ - int acquire_write (void); - - /** - * Conditionally acquire semaphore (i.e., won't block). This calls - * and is only here to make the ACE_Semaphore - * interface consistent with the other synchronization APIs. - * Returns -1 on failure. If we "failed" because someone else - * already had the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_read (void); - - /** - * Conditionally acquire semaphore (i.e., won't block). This calls - * and is only here to make the ACE_Semaphore - * interface consistent with the other synchronization APIs. - * Returns -1 on failure. If we "failed" because someone else - * already had the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_write (void); - - /** - * This is only here to make the ACE_Semaphore - * interface consistent with the other synchronization APIs. - * Assumes the caller has already acquired the semaphore using one of - * the above calls, and returns 0 (success) always. - */ - int tryacquire_write_upgrade (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Return the underlying lock. - const ACE_sema_t &lock (void) const; - -protected: - ACE_sema_t semaphore_; - - /// Keeps track of whether remove() has been called yet to avoid - /// multiple remove() calls, e.g., explicitly and implicitly in the - /// destructor. This flag isn't protected by a lock, so make sure - /// that you don't have multiple threads simultaneously calling - /// remove () on the same object, which is a bad idea anyway... - bool removed_; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_Semaphore &); - ACE_Semaphore (const ACE_Semaphore &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Semaphore.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SEMAPHORE_H */ - diff --git a/dep/include/ace/Semaphore.inl b/dep/include/ace/Semaphore.inl deleted file mode 100644 index e0162dc247b..00000000000 --- a/dep/include/ace/Semaphore.inl +++ /dev/null @@ -1,119 +0,0 @@ -// -*- C++ -*- -// -// $Id: Semaphore.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE const ACE_sema_t & -ACE_Semaphore::lock (void) const -{ -// ACE_TRACE ("ACE_Semaphore::lock"); - return this->semaphore_; -} - -ACE_INLINE int -ACE_Semaphore::remove (void) -{ -// ACE_TRACE ("ACE_Semaphore::remove"); - int result = 0; - if (!this->removed_) - { - this->removed_ = true; - result = ACE_OS::sema_destroy (&this->semaphore_); - } - return result; -} - -ACE_INLINE int -ACE_Semaphore::acquire (void) -{ -// ACE_TRACE ("ACE_Semaphore::acquire"); - return ACE_OS::sema_wait (&this->semaphore_); -} - -ACE_INLINE int -ACE_Semaphore::acquire (ACE_Time_Value &tv) -{ -// ACE_TRACE ("ACE_Semaphore::acquire"); - return ACE_OS::sema_wait (&this->semaphore_, tv); -} - -ACE_INLINE int -ACE_Semaphore::acquire (ACE_Time_Value *tv) -{ -// ACE_TRACE ("ACE_Semaphore::acquire"); - return ACE_OS::sema_wait (&this->semaphore_, tv); -} - -ACE_INLINE int -ACE_Semaphore::tryacquire (void) -{ -// ACE_TRACE ("ACE_Semaphore::tryacquire"); - return ACE_OS::sema_trywait (&this->semaphore_); -} - -ACE_INLINE int -ACE_Semaphore::release (void) -{ -// ACE_TRACE ("ACE_Semaphore::release"); - return ACE_OS::sema_post (&this->semaphore_); -} - -ACE_INLINE int -ACE_Semaphore::release (unsigned int release_count) -{ -// ACE_TRACE ("ACE_Semaphore::release"); - return ACE_OS::sema_post (&this->semaphore_, release_count); -} - -// Acquire semaphore ownership. This calls and is only -// here to make the interface consistent with the -// other synchronization APIs. - -ACE_INLINE int -ACE_Semaphore::acquire_read (void) -{ - return this->acquire (); -} - -// Acquire semaphore ownership. This calls and is only -// here to make the interface consistent with the -// other synchronization APIs. - -ACE_INLINE int -ACE_Semaphore::acquire_write (void) -{ - return this->acquire (); -} - -// Conditionally acquire semaphore (i.e., won't block). This calls -// and is only here to make the -// interface consistent with the other synchronization APIs. - -ACE_INLINE int -ACE_Semaphore::tryacquire_read (void) -{ - return this->tryacquire (); -} - -// Conditionally acquire semaphore (i.e., won't block). This calls -// and is only here to make the -// interface consistent with the other synchronization APIs. - -ACE_INLINE int -ACE_Semaphore::tryacquire_write (void) -{ - return this->tryacquire (); -} - -// This is only here to make the interface consistent -// with the other synchronization APIs. Assumes the caller has -// already acquired the semaphore using one of the above calls, and -// returns 0 (success) always. -ACE_INLINE int -ACE_Semaphore::tryacquire_write_upgrade (void) -{ - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Service_Config.h b/dep/include/ace/Service_Config.h deleted file mode 100644 index 9fba207fea5..00000000000 --- a/dep/include/ace/Service_Config.h +++ /dev/null @@ -1,681 +0,0 @@ -// -*- C++ -*- - -//==================================================================== -/** - * @file Service_Config.h - * - * $Id: Service_Config.h 81673 2008-05-09 19:09:43Z iliyan $ - * - * @author Douglas C. Schmidt - */ -//==================================================================== - -#ifndef ACE_SERVICE_CONFIG_H -#define ACE_SERVICE_CONFIG_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Default_Constants.h" -#include "ace/Intrusive_Auto_Ptr.h" -#include "ace/Service_Gestalt.h" -#include "ace/Synch_Traits.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_signal.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -class ACE_Service_Object; -class ACE_Service_Type; -class ACE_Service_Type_Impl; -class ACE_Service_Repository; -class ACE_Sig_Adapter; -class ACE_Allocator; -class ACE_Reactor; -class ACE_Thread_Manager; -class ACE_DLL; - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) -#define ACE_STATIC_SERVICE_DIRECTIVE(ident, parameters) \ - ACE_TEXT ("static ") \ - ACE_TEXT (ident) \ - ACE_TEXT (" \"") \ - ACE_TEXT (parameters) \ - ACE_TEXT ("\"") -#define ACE_DYNAMIC_SERVICE_DIRECTIVE(ident, libpathname, objectclass, parameters) \ - ACE_TEXT ("dynamic ") \ - ACE_TEXT (ident) \ - ACE_TEXT (" Service_Object * ") \ - ACE_TEXT (libpathname) \ - ACE_TEXT (":") \ - ACE_TEXT (objectclass) \ - ACE_TEXT ("() \"") \ - ACE_TEXT (parameters) \ - ACE_TEXT ("\"") -#define ACE_REMOVE_SERVICE_DIRECTIVE(ident) \ - ACE_TEXT ("remove ") \ - ACE_TEXT (ident) -class ACE_Svc_Conf_Param; -#else -#define ACE_STATIC_SERVICE_DIRECTIVE(ident, parameters) \ - ACE_TEXT ("") -#define ACE_DYNAMIC_SERVICE_DIRECTIVE(ident, libpathname, objectclass, parameters) \ - ACE_TEXT ("") \ - ACE_TEXT ("") -#define ACE_REMOVE_SERVICE_DIRECTIVE(ident) \ - ACE_TEXT ("") -class ACE_XML_Svc_Conf; -#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -extern "C" -{ - typedef ACE_Service_Object *(*ACE_SERVICE_ALLOCATOR) (ACE_Service_Object_Exterminator *); -} - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Static_Svc_Descriptor - * - * @brief Holds the information necessary to describe a statically linked - * Svc. - */ -class ACE_Static_Svc_Descriptor -{ -public: - /// Name of the service. - const ACE_TCHAR *name_; - - /// Type of service. - int type_; - - /// Factory function that allocates the service. - ACE_SERVICE_ALLOCATOR alloc_; - - /// Bitmask flags indicating how the framework should delete memory. - u_int flags_; - - /// Flag indicating whether the service starts out active. - int active_; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -public: - /// Compare two service descriptors for equality. - bool operator== (ACE_Static_Svc_Descriptor &) const; - - /// Compare two service descriptors for inequality. - bool operator!= (ACE_Static_Svc_Descriptor &) const; -}; - -/** - * @class ACE_Threading_Helper - * - * @brief Encapsulates responsibility for allocating, destroying and - * manipulating the value, associated with a thread-specific - * key. Relates to the ability of the created thread to inherit the - * parent thread's gestalt. Designed to be used as an instance member - * of @c ACE_Service_Config. - * - * Partial specialization over ACE_SYNCH_MUTEX is used to implement - * specific behavior in both multi- and single-threaded builds. - */ -template -class ACE_Threading_Helper -{ -}; - -/* - * Specialization for a multi threaded program - */ -template<> -class ACE_Export ACE_Threading_Helper -{ -public: - ACE_Threading_Helper (); - ~ACE_Threading_Helper (); - - void set (void*); - void* get (void); - -private: - /// Key for the thread-specific data, which is a simple pointer to - /// the thread's (currently-) global configuration context. - ACE_thread_key_t key_; -}; - -/* - * Specialization for a single threaded program - */ -template<> -class ACE_Export ACE_Threading_Helper -{ -public: - ACE_Threading_Helper (); - ~ACE_Threading_Helper (); - - void set (void*); - void* get (void); -}; - -#define ACE_Component_Config ACE_Service_Config - -/** - * @class ACE_Service_Config - * - * @brief Supplies common server operations for dynamic and static - * configuration of service. - * - * The ACE_Service_Config uses the Monostate pattern. Therefore, - * you can only have one of these instantiated per-process. It - * represents the process-wide collection of services, which is - * typicaly shared among all other configurable entities. The only - * ACE_Service_Config instance is registered with and owned by the - * ACE_Object_Manager. - * - * By contrast, the ACE_Service_Gestalt represents the collection - * of services, pertaining to a configurable entity. Typicaly, a - * "configurable entity" is an instance, which owns an instance of - * ACE_Service_Gestalt in order to ensure full controll over the - * services it needs. - * - * Another facet of ACE_Service_Config is that for a given thread, - * it provides access to its current, process-global - * ACE_Service_Gestalt instance through its curent() method. - * - * @note The signal_handler_ static member is allocated by the - * ACE_Object_Manager. The ACE_Service_Config constructor - * uses signal_handler_. Therefore, if the program has any - * static ACE_Service_Config objects, there might be - * initialization order problems. They can be minimized, but - * not eliminated, by _not_ #defining - * ACE_HAS_NONSTATIC_OBJECT_MANAGER. - */ -class ACE_Export ACE_Service_Config -{ - - /// The Instance, or the global (default) configuration context. - /// The monostate would forward the calls to that instance. The TSS - /// will point here - ACE_Intrusive_Auto_Ptr instance_; - - /// A helper instance to manage thread-specific key creation. - /// Dependent on the syncronization mutex ACE uses, the corresponding - /// partial template instantiation will perform the right services - /// that have to do with managing thread-specific storage. Note that, - /// for single-threaded builds they would do (next to) nothing. - ACE_Threading_Helper threadkey_; - -public: - - // = Initialization and termination methods. - - /** - * Initialize the Service Repository. Note that initialising @a - * signum to a negative number will prevent a signal handler being - * registered when the repository is opened. - */ - ACE_Service_Config (bool ignore_static_svcs = true, - size_t size = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE, - int signum = SIGHUP); - - /** - * Performs an open without parsing command-line arguments. The - * @a logger_key indicates where to write the logging output, which - * is typically either a STREAM pipe or a socket address. - */ - ACE_Service_Config (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY); - - /// Perform user-specified close activities and remove dynamic - /// memory. - virtual ~ACE_Service_Config (void); - -private: - - /** - * Performs an open without parsing command-line arguments. - * Implements whats different in the opening sequence - * for this class, as opposed to the base class. - * - * The @a logger_key indicates where to write the logging output, which - * is typically either a STREAM pipe or a socket address. If - * @a ignore_default_svc_conf_file is non-0 then the "svc.conf" file - * will be ignored. If @a ignore_debug_flag is non-0 then the - * application is responsible for setting the - * @c ACE_Log_Msg::priority_mask() appropriately. Returns number of - * errors that occurred on failure and 0 otherwise. - */ - virtual int open_i (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key, - bool ignore_static_svcs, - bool ignore_default_svc_conf_file, - bool ignore_debug_flag); - - /** - * Implements whats different in the command line parameter processing - * for this class, as opposed to the base class. - */ - virtual int parse_args_i (int argc, ACE_TCHAR *argv[]); - - /// = Static interfaces - - public: - /** - * Returns the process-wide global singleton instance. It would - * have been created and will be managed by the Object Manager. - */ - static ACE_Service_Config* singleton (void); - - /** - * Mutator for the currently active configuration context instance - * (gestalt). Intended for use by helper classes like @see - * ACE_Service_Config_Guard. Stack-based instances can be used to - * temporarily change which gestalt is seen as global by static - * initializers (especially those in DLLs loaded at run-time). - */ - static void current (ACE_Service_Gestalt*); - - /** - * Accessor for the "current" service gestalt - */ - static ACE_Service_Gestalt* current (void); - - /** - * This is what the static service initializators are hard-wired to - * use, so in order to avoid interface changes this method merely - * forwards to @c ACE_Service_Config::current. This enables us to - * enforce which Service Gestalt is used for services registering - * through static initializers. Especially important for DLL-based - * dynamic services, which can contain their own static services and - * static initializers. - * - * @deprecated Use current() instead. - */ - static ACE_Service_Gestalt* instance (void); - - /** - * Returns a process-wide global singleton instance in contrast with - * current (), which may return a different instance at different - * times, dependent on the context. Modifying this method's return - * value is strongly discouraged as it will circumvent the mechanism - * for dynamically loading services. If you must, use with extreme - * caution! - */ - static ACE_Service_Gestalt* global (void); - - /** - * Performs an open without parsing command-line arguments. The - * @a logger_key indicates where to write the logging output, which - * is typically either a STREAM pipe or a socket address. If - * @a ignore_static_svcs is true then static services are not loaded, - * otherwise, they are loaded. If @a ignore_default_svc_conf_file is - * non-0 then the configuration file will be ignored. - * Returns zero upon success, -1 if the file is not found or cannot - * be opened (errno is set accordingly), otherwise returns the - * number of errors encountered loading the services in the - * specified svc.conf configuration file. If @a ignore_debug_flag is - * non-0 then the application is responsible for setting the - * @c ACE_Log_Msg::priority_mask appropriately. - */ - static int open (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, - bool ignore_static_svcs = true, - bool ignore_default_svc_conf_file = false, - bool ignore_debug_flag = false); - - /** - * This is the primary entry point into the ACE_Service_Config (the - * constructor just handles simple initializations). It parses - * arguments passed in from @a argc and @a argv parameters. The - * arguments that are valid in a call to this method include: - * - * - '-b' Option to indicate that we should be a daemon. Note that when - * this option is used, the process will be daemonized before the - * service configuration file(s) are read. During daemonization, - * (on POSIX systems) the current directory will be changed to "/" - * so the caller should either fully specify the file names, or - * execute a @c chroot() to the appropriate directory. - * @sa ACE::daemonize(). - * - '-d' Turn on debugging mode - * - '-f' Specifies a configuration file name other than the default - * svc.conf. Can be specified multiple times to use multiple files. - * - '-k' Specifies the rendezvous point to use for the ACE distributed - * logger. - * - '-y' Explicitly enables the use of static services. This flag - * overrides the @a ignore_static_svcs parameter value. - * - '-n' Explicitly disables the use of static services. This flag - * overrides the @a ignore_static_svcs parameter value. - * - '-p' Specifies a pathname which is used to store the process id. - * - '-s' Specifies a signal number other than SIGHUP to trigger reprocessing - * of the configuration file(s). Ignored for platforms that do not - * have POSIX signals, such as Windows. - * - '-S' Specifies a service directive string. Enclose the string in quotes - * and escape any embedded quotes with a backslash. This option - * specifies service directives without the need for a configuration - * file. - * - * @param argc The number of commandline arguments. - * @param argv The array with commandline arguments - * @param logger_key Indicates where to write the logging output, - * which is typically either a STREAM pipe or a - * socket address. - * @param ignore_static_svcs If true then static services are not loaded, - * otherwise, they are loaded. - * @param ignore_default_svc_conf_file If non-0 then the @c svc.conf - * configuration file will be ignored. - * @param ignore_debug_flag If true then the application is responsible - * for setting the @c ACE_Log_Msg::priority_mask - * appropriately. - * - * @retval -1 The configuration file is not found or cannot - * be opened (errno is set accordingly). - * @retval 0 Success. - * @retval >0 The number of errors encountered while processing - * the service configuration file(s). - */ - static int open (int argc, - ACE_TCHAR *argv[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, - bool ignore_static_svcs = true, - bool ignore_default_svc_conf_file = false, - bool ignore_debug_flag = false); - - /// Tidy up and perform last rites when ACE_Service_Config is shut - /// down. This method calls close_svcs(). Returns 0. - static int close (void); - - /// Perform user-specified close hooks and possibly delete all of the - /// configured services in the . - static int fini_svcs (void); - - /// True if reconfiguration occurred. - static int reconfig_occurred (void); - - /// Indicate that reconfiguration occurred. - static void reconfig_occurred (int); - - /// Perform the reconfiguration process. - static void reconfigure (void); - - // = The following methods are static in order to enforce Singleton - // semantics for the Reactor, Service_Repository, Thread_Manager, - // and Acceptor/Connector Strategy factory. Other portions of the - // system may need to access them at some point or another... - - // = This is not strictly needed, anymore since the service configurator - // has been refactored to allow multiple service configuration - // instances (called gestalts). The interfaces, however were retained in for - // the sake of maintaining source-code compatibility. - - // = Accessors and mutators for process-wide Singletons. - - /// Returns a pointer to the list of statically linked services. - /// - /// @deprecated - Same as instance(), but still useful in legacy code, - /// (notably, one that can not be easily modified) which uses the following - /// idiom for registering static services: - /// - /// ACE_Service_Config::static_svcs ()->insert (...); - static ACE_Service_Gestalt* static_svcs (void); - - /// Insert a static service descriptor for processing on open_i(). The - /// corresponding ACE_STATIC_SVC_* macros were chaged to use this method - /// instead of obtaining a ptr to a container. See the note on static_svcs(). - /// Added to prevent exposing the internal storage representation of the - /// services repository and provide a better way of debugging service - /// loading and registration problems. - static int insert (ACE_Static_Svc_Descriptor *svc); - - // = Utility methods. - /// Dynamically link the shared object file and retrieve a pointer to - /// the designated shared object in this file. - static int initialize (const ACE_Service_Type *, - const ACE_TCHAR *parameters); - - /// Initialize and activate a statically @a svc_name service. - static int initialize (const ACE_TCHAR *svc_name, - const ACE_TCHAR *parameters); - - /// Resume a @a svc_name that was previously suspended or has not yet - /// been resumed (e.g., a static service). - static int resume (const ACE_TCHAR svc_name[]); - - /** - * Suspend @a svc_name. Note that this will not unlink the service - * from the daemon if it was dynamically linked, it will mark it as - * being suspended in the Service Repository and call the - * member function on the appropriate ACE_Service_Object. A - * service can be resumed later on by calling the member - * function... - */ - static int suspend (const ACE_TCHAR svc_name[]); - - /// Totally remove @a svc_name from the daemon by removing it - /// from the ACE_Reactor, and unlinking it if necessary. - static int remove (const ACE_TCHAR svc_name[]); - -#if defined (ACE_HAS_WINCE) && defined (ACE_USES_WCHAR) - // We must provide these function to bridge the Svc_Conf parser - // with ACE. - static int initialize (const ACE_Service_Type *, ACE_ANTI_TCHAR []); - static int initialize (const char svc_name[], ACE_ANTI_TCHAR parameters[]); - static int resume (const ACE_ANTI_TCHAR svc_name[]); - static int suspend (const ACE_ANTI_TCHAR svc_name[]); - static int remove (const ACE_ANTI_TCHAR svc_name[]); -#endif /* ACE_HAS_WINCE */ - - /// Dump the state of an object. - void dump (void) const; - - /// Set the signal_handler;for internal use by ACE_Object_Manager only. - static ACE_INLINE void signal_handler (ACE_Sig_Adapter *); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Process a file containing a list of service configuration - /// directives. - static int process_file (const ACE_TCHAR file[]); - - /// Process one service configuration @a directive, which is passed as - /// a string. Returns the number of errors that occurred. - static int process_directive (const ACE_TCHAR directive[]); - - /** - * Process one static service definition. Load a new static service - * into the ACE_Service_Repository. - * - * @param ssd Service descriptor, see the document of - * ACE_Static_Svc_Descriptor for more details. - * - * @param force_replace If set the new service descriptor replaces - * any previous instance in the ACE_Service_Repository. - * - * @return Returns -1 if the service cannot be 'loaded'. - */ - static int process_directive (const ACE_Static_Svc_Descriptor &ssd, - bool force_replace = false); - - /** - * Process (or re-process) service configuration requests that are - * provided in the svc.conf file(s). Returns the number of errors - * that occurred. - */ - static int process_directives (void); - - /// Handles signals to trigger reconfigurations. - static void handle_signal (int sig, siginfo_t *, ucontext_t *); - - /** - * Handle the command-line options intended for the - * ACE_Service_Config. Note that @c argv[0] is assumed to be the - * program name. - * The arguments that are valid in a call to this method are - * - '-b' Option to indicate that we should be a daemon - * - '-d' Turn on debugging mode - * - '-f' Option to read in the list of svc.conf file names - * - '-k' Option to read a wide string where in the logger output can - * be written - * - '-y' Turn on the flag for a repository of statically - * linked services - * - '-n' Need not have a repository of statically linked services - * - '-S' Option to read in the list of services on the command-line - * Please observe the difference between options '-f' that looks - * for a list of files and here a list of services. - */ - static int parse_args (int, ACE_TCHAR *argv[]); - -#if (ACE_USES_CLASSIC_SVC_CONF == 0) - static ACE_Service_Type *create_service_type (const ACE_TCHAR *n, - ACE_Service_Type_Impl *o, - ACE_DLL &dll, - int active); -#endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */ - - static ACE_Service_Type_Impl * - create_service_type_impl (const ACE_TCHAR *name, - int type, - void *symbol, - u_int flags, - ACE_Service_Object_Exterminator gobbler); - - /// @deprecated - /// Process service configuration requests that were provided on the - /// command-line. Returns the number of errors that occurred. - static int process_commandline_directives (void); - - /// Become a daemon. - static int start_daemon (void); - - // @deprecated - // Add the default statically-linked services to the - // ACE_Service_Repository. - static int load_static_svcs (void); - -protected: - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) - /// @deprecated - /// This is the implementation function that process_directives() - /// and process_directive() both call. Returns the number of errors - /// that occurred. - static int process_directives_i (ACE_Svc_Conf_Param *param); -#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - - // = Process-wide state. - -private: - - /// Have we called ACE_Service_Config::open() yet? - bool is_opened_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for open, etc. - mutable ACE_SYNCH_MUTEX lock_; -#endif /* ACE_MT_SAFE */ - - /// True if reconfiguration occurred. - static sig_atomic_t reconfig_occurred_; - - // = Set by command-line options. - /// Shall we become a daemon process? - static bool be_a_daemon_; - - /// Pathname of file to write process id. - static ACE_TCHAR *pid_file_name_; - - /// Number of the signal used to trigger reconfiguration. - static int signum_; - - /// Handles the reconfiguration signals. - static ACE_Sig_Adapter *signal_handler_; - - /// Pointer to the Singleton (ACE_Cleanup) Gestalt instance. - /// There is thread-specific global instance pointer, which is used to - /// temporarily change which Gestalt instance is used for static service - /// registrations. - /// - /// A specific use case is a thread, which loads a _dynamic_ service from - /// a DLL. If the said DLL also contains additional _static_ services, - /// those *must* be registered with the same configuration repository as - /// the dynamic service. Otherwise, the DLL's static services would be - /// registered with the global Gestalt and may outlive the DLL that - /// contains their code and perhaps the memory in which they are in. - /// This is a problem because if the DLL gets unloaded (as it will, if - /// it was loaded in an instance of Gestalt), the DLL's memory will be - /// deallocated, but the global service repository will still "think" - /// it must finalize the (DLL's) static services - with disastrous - /// consequences, occurring in the post-main code (at_exit()). - - /// This class needs the intimate access to be able to swap the - /// current TSS pointer for the global Gestalt. - friend class ACE_Service_Config_Guard; - - /// The helper needs intimate access (when building with no threads) - friend class ACE_Threading_Helper ; - friend class ACE_Threading_Helper ; -}; - -/** - * @class ACE_Service_Config_Guard - * - * @brief A guard class, designed to be instantiated on the stack. - * - * Instantiating it with a specific configuration ensures any references to - * ACE_Service_Config::instance(), even when occuring in static constructors, - * will allways access the designated configuration instance. - * This comes very handy when a dynamic service also registers any static - * services of its own and their static factories. - */ -class ACE_Export ACE_Service_Config_Guard -{ -public: - ACE_Service_Config_Guard (ACE_Service_Gestalt* psg); - ~ACE_Service_Config_Guard (void); - -private: - // Private AND not implemented to disable copying - ACE_Service_Config_Guard(const ACE_Service_Config_Guard&); - ACE_Service_Config_Guard& operator= (const ACE_Service_Config_Guard&); - -private: - ACE_Intrusive_Auto_Ptr saved_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Service_Config.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SERVICE_CONFIG_H */ - diff --git a/dep/include/ace/Service_Config.inl b/dep/include/ace/Service_Config.inl deleted file mode 100644 index acb38e27a7f..00000000000 --- a/dep/include/ace/Service_Config.inl +++ /dev/null @@ -1,202 +0,0 @@ -// -*- C++ -*- -// -// $Id: Service_Config.inl 81673 2008-05-09 19:09:43Z iliyan $ - -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// This is the primary entry point into the ACE_Service_Config (the -// constructor just handles simple initializations). -ACE_INLINE int -ACE_Service_Config::open (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key, - bool ignore_static_svcs, - bool ignore_default_svc_conf, - bool ignore_debug_flag) -{ - ACE_TRACE ("ACE_Service_Config::open"); - if (singleton()->open_i (program_name, - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag) == -1) - return -1; - - return current()->open (program_name, - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag); -} - -ACE_INLINE int -ACE_Service_Config::open (int argc, - ACE_TCHAR *argv[], - const ACE_TCHAR *logger_key, - bool ignore_static_svcs, - bool ignore_default_svc_conf, - bool ignore_debug_flag) -{ - ACE_TRACE ("ACE_Service_Config::open"); - if (singleton()->open_i (argv[0], - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag) == -1) - return -1; - - return current()->open (argc, - argv, - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag); -} - -// Handle the command-line options intended for the -// ACE_Service_Config. -ACE_INLINE int -ACE_Service_Config::parse_args (int argc, ACE_TCHAR *argv[]) -{ - return ACE_Service_Config::current ()->parse_args (argc, argv); -} - -/// Return the global configuration instance. Allways returns the same -/// instance -ACE_INLINE ACE_Service_Gestalt * -ACE_Service_Config::global (void) -{ - return ACE_Service_Config::singleton()->instance_.get (); -} - -/// Return the configuration instance, considered "global" in the -/// current thread. This may be the same as instance(), but on some -/// occasions, it may be a different one. For example, -/// ACE_Service_Config_Guard provides a way of temporarily replacing -/// the "current" configuration instance in the context of a thread. -ACE_INLINE ACE_Service_Gestalt * -ACE_Service_Config::instance (void) -{ - return ACE_Service_Config::current (); -} - -// This method has changed to return the gestalt instead of the -// container, underlying the service repository and defined -// ACE_Service_Gestalt::insert (ACE_Static_Svc_Descriptor*). This way -// the existing source code can keep using -// ACE_Service_Config::static_svcs(), however now it is not necessary -// to expose the repository storage *and* it is much easier to debug -// service registration problems. - -ACE_INLINE ACE_Service_Gestalt* -ACE_Service_Config::static_svcs (void) -{ - return ACE_Service_Config::current (); -} - -/// Compare two service descriptors for equality. -ACE_INLINE bool -ACE_Static_Svc_Descriptor::operator== (ACE_Static_Svc_Descriptor &d) const -{ - return ACE_OS::strcmp (name_, d.name_) == 0; -} - -/// Compare two service descriptors for inequality. -ACE_INLINE bool -ACE_Static_Svc_Descriptor::operator!= (ACE_Static_Svc_Descriptor &d) const -{ - return !(*this == d); -} - -ACE_INLINE void -ACE_Service_Config::signal_handler (ACE_Sig_Adapter *signal_handler) -{ - signal_handler_ = signal_handler; -} - -/// Initialize and activate a statically linked service. -ACE_INLINE int -ACE_Service_Config::initialize (const ACE_TCHAR *svc_name, - const ACE_TCHAR *parameters) -{ - ACE_TRACE ("ACE_Service_Config::initialize"); - return ACE_Service_Config::current ()->initialize (svc_name, - parameters); -} - -/// Dynamically link the shared object file and retrieve a pointer to -/// the designated shared object in this file. -ACE_INLINE int -ACE_Service_Config::initialize (const ACE_Service_Type *sr, - const ACE_TCHAR *parameters) -{ - ACE_TRACE ("ACE_Service_Config::initialize"); - return ACE_Service_Config::current ()->initialize (sr, parameters); -} - -/// Process a file containing a list of service configuration -/// directives. -ACE_INLINE int ACE_Service_Config::process_file (const ACE_TCHAR file[]) -{ - return ACE_Service_Config::current ()->process_file (file); -} - -/// -ACE_INLINE int -ACE_Service_Config::process_directive (const ACE_TCHAR directive[]) -{ - return ACE_Service_Config::current ()->process_directive (directive); -} - -/// Process service configuration requests as indicated in the queue of -/// svc.conf files. -ACE_INLINE int -ACE_Service_Config::process_directives (void) -{ - return ACE_Service_Config::current ()->process_directives (false); -} - -ACE_INLINE int -ACE_Service_Config::process_directive (const ACE_Static_Svc_Descriptor &ssd, - bool force_replace) -{ - return ACE_Service_Config::current ()->process_directive (ssd, force_replace); -} - -#if defined (ACE_HAS_WINCE) && defined (ACE_USES_WCHAR) -// We must provide these function to bridge Svc_Conf parser with ACE. - -ACE_INLINE int -ACE_Service_Config::initialize (const ACE_Service_Type *sp, ACE_ANTI_TCHAR parameters[]) -{ - return ACE_Service_Config::initialize (sp, ACE_TEXT_ANTI_TO_TCHAR (parameters)); -} - -ACE_INLINE int -ACE_Service_Config::initialize (const ACE_ANTI_TCHAR svc_name[], ACE_ANTI_TCHAR parameters[]) -{ - return ACE_Service_Config::initialize (ACE_TEXT_ANTI_TO_TCHAR (svc_name), - ACE_TEXT_ANTI_TO_TCHAR (parameters)); -} - -ACE_INLINE int -ACE_Service_Config::resume (const ACE_ANTI_TCHAR svc_name[]) -{ - return ACE_Service_Config::resume (ACE_TEXT_ANTI_TO_TCHAR (svc_name)); -} - -ACE_INLINE int -ACE_Service_Config::suspend (const ACE_ANTI_TCHAR svc_name[]) -{ - return ACE_Service_Config::suspend (ACE_TEXT_ANTI_TO_TCHAR (svc_name)); -} - -ACE_INLINE int -ACE_Service_Config::remove (const ACE_ANTI_TCHAR svc_name[]) -{ - return ACE_Service_Config::remove (ACE_TEXT_ANTI_TO_TCHAR (svc_name)); -} -#endif /* ACE_HAS_WINCE && !ACE_USES_WCHAR */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Service_Gestalt.h b/dep/include/ace/Service_Gestalt.h deleted file mode 100644 index 5ccfd940f5d..00000000000 --- a/dep/include/ace/Service_Gestalt.h +++ /dev/null @@ -1,506 +0,0 @@ -// -*- C++ -*- - -//==================================================================== -/** - * @file Service_Gestalt.h - * - * $Id: Service_Gestalt.h 81624 2008-05-06 17:14:57Z wotte $ - * - * @author Iliyan Jeliazkov - */ -//==================================================================== - -#ifndef ACE_SERVICE_GESTALT_H -#define ACE_SERVICE_GESTALT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/Default_Constants.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Auto_Ptr.h" -#include "ace/SString.h" -#include "ace/Unbounded_Queue.h" -#include "ace/Unbounded_Set.h" -#include "ace/Service_Repository.h" -#include "ace/Singleton.h" -#include "ace/OS_NS_signal.h" -#include "ace/Synch_Traits.h" -#include "ace/Atomic_Op.h" -#include "ace/Guard_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) -class ACE_Service_Type_Factory; -class ACE_Location_Node; -#else -class ACE_XML_Svc_Conf; -class ACE_DLL; -#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - -class ACE_Static_Svc_Descriptor; -class ACE_Svc_Conf_Param; - -/** - * @class ACE_Service_Gestalt - * - * @brief Supplies common server operations for dynamic and static - * configuration of services. - * - * The Gestalt embodies the concept of configuration context. On one - * hand, it is a flat namespace, where names correspond to a Service - * Object instance. A Gestalt owns the Service Repository instance, - * which in turn owns the Service Object instances. - * - * Another aspect of a Gestalt is its responsibility for - * record-keeping and accounting for the meta-data, necessary for - * locating, removing or instantiating a service. - * - * A repository underlies an instance of a gestalt and its lifetime - * may or may not be bounded by the lifetime of the gestalt, that owns - * it. This feature is important for the derived classes and the - * Service Config in particular. - * - */ -class ACE_Export ACE_Service_Gestalt -{ -private: - /// - /// Not implemented to enforce no copying - // - ACE_UNIMPLEMENTED_FUNC (ACE_Service_Gestalt(const ACE_Service_Gestalt&)) - ACE_UNIMPLEMENTED_FUNC (ACE_Service_Gestalt& operator=(const ACE_Service_Gestalt&)) - -public: - enum - { - MAX_SERVICES = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE - }; - - /// Constructor either associates the instance with the process-wide - /// singleton instance of ACE_Service_Repository, or creates and - /// manages its own instance of the specified size. - ACE_Service_Gestalt (size_t size = 1024, - bool svc_repo_is_owned = true, - bool no_static_svcs = true); - - /// Perform user-specified close activities and remove dynamic - /// memory. - ~ACE_Service_Gestalt (void); - - /// Dump the state of an object. - void dump (void) const; - - /** - * Performs an open without parsing command-line arguments. The - * @a logger_key indicates where to write the logging output, which - * is typically either a STREAM pipe or a socket address. If - * @a ignore_static_svcs is true then static services are not loaded, - * otherwise, they are loaded. If @a ignore_default_svc_conf_file is - * true then the configuration file will be ignored. - * Returns zero upon success, -1 if the file is not found or cannot - * be opened (errno is set accordingly), otherwise returns the - * number of errors encountered loading the services in the - * specified svc.conf configuration file. If @a ignore_debug_flag is - * true then the application is responsible for setting the - * appropriately. - */ - int open (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, - bool ignore_static_svcs = true, - bool ignore_default_svc_conf_file = false, - bool ignore_debug_flag = false); - - /** - * This is the primary entry point into the ACE_Service_Config (the - * constructor just handles simple initializations). It parses - * arguments passed in from @a argc and @a argv parameters. The - * arguments that are valid in a call to this method include: - * - * - '-b' Option to indicate that we should be a daemon. Note that when - * this option is used, the process will be daemonized before the - * service configuration file(s) are read. During daemonization, - * (on POSIX systems) the current directory will be changed to "/" - * so the caller should either fully specify the file names, or - * execute a @c chroot() to the appropriate directory. - * @sa ACE::daemonize(). - * - '-d' Turn on debugging mode - * - '-f' Specifies a configuration file name other than the default - * svc.conf. Can be specified multiple times to use multiple files. - * - '-k' Specifies the rendezvous point to use for the ACE distributed - * logger. - * - '-y' Explicitly enables the use of static services. This flag - * overrides the @a ignore_static_svcs parameter value. - * - '-n' Explicitly disables the use of static services. This flag - * overrides the @a ignore_static_svcs parameter value. - * - '-p' Specifies a pathname which is used to store the process id. - * - '-s' Specifies a signal number other than SIGHUP to trigger reprocessing - * of the configuration file(s). Ignored for platforms that do not - * have POSIX signals, such as Windows. - * - '-S' Specifies a service directive string. Enclose the string in quotes - * and escape any embedded quotes with a backslash. This option - * specifies service directives without the need for a configuration - * file. - * - * @param argc The number of commandline arguments. - * @param argv The array with commandline arguments - * @param logger_key Indicates where to write the logging output, - * which is typically either a STREAM pipe or a - * socket address. - * @param ignore_static_svcs If true then static services are not loaded, - * otherwise, they are loaded. - * @param ignore_default_svc_conf_file If false then the @c svc.conf - * configuration file will be ignored. - * @param ignore_debug_flag If false then the application is responsible - * for setting the @c ACE_Log_Msg::priority_mask - * appropriately. - * - * @retval -1 The configuration file is not found or cannot - * be opened (errno is set accordingly). - * @retval 0 Success. - * @retval >0 The number of errors encountered while processing - * the service configuration file(s). - */ - int open (int argc, - ACE_TCHAR *argv[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, - bool ignore_static_svcs = true, - bool ignore_default_svc_conf_file = false, - bool ignore_debug_flag = false); - - /// Has it been opened? Returns the difference between the times - /// open and close have been called on this instance - int is_opened (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Process one service configuration @a directive, which is passed as - /// a string. Returns the number of errors that occurred. - int process_directive (const ACE_TCHAR directive[]); - - /// Process one static service definition. - /** - * Load a new static service. - * - * @param ssd Service descriptor, see the document of - * ACE_Static_Svc_Descriptor for more details. - * - * @param force_replace If set the new service descriptor replaces - * any previous instance in the repository. - * - * @return Returns -1 if the service cannot be 'loaded'. - */ - int process_directive (const ACE_Static_Svc_Descriptor &ssd, - bool force_replace = false); - - /// Process a file containing a list of service configuration - /// directives. - int process_file (const ACE_TCHAR file[]); - - /** - * Locate an entry with @a name in the table. If @a ignore_suspended - * is set then only consider services marked as resumed. If the - * caller wants the located entry, pass back a pointer to the - * located entry via @a srp. If @a name is not found, -1 is returned. - * If @a name is found, but it is suspended and the caller wants to - * ignore suspended services a -2 is returned. - */ - int find (const ACE_TCHAR name[], - const ACE_Service_Type **srp = 0, - bool ignore_suspended = true) const; - - /** - * Handle the command-line options intended for the - * ACE_Service_Gestalt. Note that is assumed to be the - * program name. - * - * The arguments that are valid in a call to this method are - * - '-d' Turn on debugging mode - * - '-f' Option to read in the list of svc.conf file names - * - '-k' Option to read a wide string where in the logger output can - * be written - * - '-y' Turn on the flag for a repository of statically - * linked services - * - '-n' Need not have a repository of statically linked services - * - '-S' Option to read in the list of services on the command-line - * Please observe the difference between options '-f' that looks - * for a list of files and here a list of services. - */ - int parse_args (int, ACE_TCHAR *argv[]); - - /** - * Process (or re-process) service configuration requests that are - * provided in the svc.conf file(s). Returns the number of errors - * that occurred. - */ - int process_directives (bool ignore_default_svc_conf_file); - - /// Tidy up and perform last rites when ACE_Service_Config is shut - /// down. This method calls . Returns 0. - int close (void); - - // Registers a service descriptor for a static service object - int insert (ACE_Static_Svc_Descriptor *stsd); - - // = Utility methods. - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) - /// Dynamically link the shared object file and retrieve a pointer to - /// the designated shared object in this file. Also account for the - /// possiblity to have static services registered when loading the DLL, by - /// ensuring that the dynamic sevice is registered before any of its - /// subordibnate static services. Thus avoiding any finalization order - /// problems. - int initialize (const ACE_Service_Type_Factory *, - const ACE_TCHAR *parameters); -#endif /* (ACE_USES_CLASSIC_SVC_CONF == 1) */ - - /// Dynamically link the shared object file and retrieve a pointer to - /// the designated shared object in this file. - /// @deprecated - /// @note This is error-prone in the presense of dynamic services, - /// which in turn initialize their own static services. This method - /// will allow those static services to register *before* the dynamic - /// service that owns them. Upon finalization of the static services - /// the process will typically crash, because the dynamic service's - /// DLL may have been already released, together with the memory in - /// which the static services reside. It may not crash, for - /// instance, when the first static service to register is the same - /// as the dynamic service being loaded. You should be so lucky! - int initialize (const ACE_Service_Type *, - const ACE_TCHAR *parameters); - - /// Initialize and activate a statically @a svc_name service. - int initialize (const ACE_TCHAR *svc_name, - const ACE_TCHAR *parameters); - - /// Resume a @a svc_name that was previously suspended or has not yet - /// been resumed (e.g., a static service). - int resume (const ACE_TCHAR svc_name[]); - - /** - * Suspend @a svc_name. Note that this will not unlink the service - * from the daemon if it was dynamically linked, it will mark it as - * being suspended in the Service Repository and call the - * member function on the appropriate ACE_Service_Object. A - * service can be resumed later on by calling the member - * function... - */ - int suspend (const ACE_TCHAR svc_name[]); - - /// Totally remove @a svc_name from the daemon by removing it - /// from the ACE_Reactor, and unlinking it if necessary. - int remove (const ACE_TCHAR svc_name[]); - - /** - * Using the supplied name, finds and (if needed) returns a pointer to a - * static service descriptor. Returns 0 for success and -1 for failure - */ - int find_static_svc_descriptor (const ACE_TCHAR* name, - ACE_Static_Svc_Descriptor **ssd = 0) const; - - struct Processed_Static_Svc - { - Processed_Static_Svc (const ACE_Static_Svc_Descriptor *); - ~Processed_Static_Svc (void); - ACE_TCHAR * name_; - const ACE_Static_Svc_Descriptor *assd_; - }; - - /// Get the current ACE_Service_Repository held by this object. - ACE_Service_Repository* current_service_repository (void); - -protected: - - int parse_args_i (int, ACE_TCHAR *argv[], - bool& ignore_default_svc_conf_file); - - /** - * Performs an open without parsing command-line arguments. The - * @a logger_key indicates where to write the logging output, which - * is typically either a STREAM pipe or a socket address. If - * @a ignore_default_svc_conf_file is non-0 then the "svc.conf" file - * will be ignored. If @a ignore_debug_flag is non-0 then the - * application is responsible for setting the - * @c ACE_Log_Msg::priority_mask() appropriately. Returns number of - * errors that occurred on failure and 0 otherwise. - */ - int open_i (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, - bool ignore_static_svcs = true, - bool ignore_default_svc_conf_file = false, - bool ignore_debug_flag = false); - - /// Initialize the if necessary. - int init_svc_conf_file_queue (void); - - /// Add the default statically-linked services to the - /// ACE_Service_Repository. - int load_static_svcs (void); - - /// Process service configuration requests that were provided on the - /// command-line. Returns the number of errors that occurred. - int process_commandline_directives (void); - - /// Process a static directive without also inserting its descriptor - /// the global table. This avoids multiple additions when processing - /// directives in non-global gestalts. - int process_directive_i (const ACE_Static_Svc_Descriptor &ssd, - bool force_replace = false); - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) - /// This is the implementation function that process_directives() - /// and process_directive() both call. Returns the number of errors - /// that occurred. - int process_directives_i (ACE_Svc_Conf_Param *param); -#else - /// Helper function to dynamically link in the XML Service Configurator - /// parser. - ACE_XML_Svc_Conf* get_xml_svc_conf (ACE_DLL &d); -#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - - /// Dynamically link the shared object file and retrieve a pointer to - /// the designated shared object in this file. - int initialize_i (const ACE_Service_Type *sr, const ACE_TCHAR *parameters); - - const ACE_Static_Svc_Descriptor* find_processed_static_svc (const ACE_TCHAR*); - void add_processed_static_svc (const ACE_Static_Svc_Descriptor *); - - /// Performs the common initialization tasks for a new or previously - /// closed instance. Must not be virtual, as it is called from the - /// constructor. - int init_i (void); - -protected: - - // Maintain a queue of services to be configured from the - // command-line. - typedef ACE_Unbounded_Queue ACE_SVC_QUEUE; - typedef ACE_Unbounded_Queue_Iterator ACE_SVC_QUEUE_ITERATOR; - - // Maintain a set of the statically linked service descriptors. - typedef ACE_Unbounded_Set - ACE_STATIC_SVCS; - - typedef ACE_Unbounded_Set_Iterator - ACE_STATIC_SVCS_ITERATOR; - - typedef ACE_Unbounded_Set - ACE_PROCESSED_STATIC_SVCS; - - typedef ACE_Unbounded_Set_Iterator - ACE_PROCESSED_STATIC_SVCS_ITERATOR; - - friend class ACE_Dynamic_Service_Base; - friend class ACE_Service_Object; - friend class ACE_Service_Config; - friend class ACE_Service_Config_Guard; - -protected: - - /// Do we own the service repository instance, or have only been - /// given a ptr to the singleton? - bool svc_repo_is_owned_; - - /// Repository size is necessary, so that we can close (which may - /// destroy the repository instance), and then re-open again. - size_t svc_repo_size_; - - /// Keep track of the number of times the instance has been - /// initialized (opened). "If so, we can't allow to be called since - /// it's not reentrant" is the original motivation, but that does not seem - /// to be the case anymore. This variable is incremented by the - /// method and decremented by the - /// method. - int is_opened_; - - /// Indicates where to write the logging output. This is typically - /// either a STREAM pipe or a socket - const ACE_TCHAR *logger_key_; - - /// Should we avoid loading the static services? - bool no_static_svcs_; - - /// Queue of services specified on the command-line. - ACE_SVC_QUEUE* svc_queue_; - - /** Queue of svc.conf files specified on the command-line. - * @@ This should probably be made to handle unicode filenames... - */ - ACE_SVC_QUEUE* svc_conf_file_queue_; - - /// The service repository to hold the services. - ACE_Service_Repository* repo_; - - /// Repository of statically linked services. - ACE_STATIC_SVCS* static_svcs_; - - /// Repository of statically linked services for which process - /// directive was called, but the service is not already a member of - /// the static_svcs_ list. - ACE_PROCESSED_STATIC_SVCS* processed_static_svcs_; - - /// Support for intrusive reference counting - ACE_Atomic_Op refcnt_; - - public: - static void intrusive_add_ref (ACE_Service_Gestalt*); - static void intrusive_remove_ref (ACE_Service_Gestalt*); - -}; /* class ACE_Service_Gestalt */ - -/** - * @class ACE_Service_Type_Dynamic_Guard - * - * @brief A forward service declaration guard. - * - * Helps to resolve an issue with hybrid services, i.e. dynamic - * services, accompanied by static services in the same DLL. Only - * automatic instances of this class are supposed to exist. Those are - * created during (dynamic) service initialization and serve to: - * - * (a) Ensure the service we are loading is ordered last in the - * repository, following any other services it may cause to register, - * as part of its own registration. This is a common case when - * loading dynamic services from DLLs - there are often static - * initializers, which register static services. - * - * (b) The SDG instance destructor detects if the dynamic service - * initialized successfully and "fixes-up" all the newly registered - * static services to hold a reference to the DLL, from which they - * have originated. - */ -class ACE_Export ACE_Service_Type_Dynamic_Guard -{ -public: - ACE_Service_Type_Dynamic_Guard (ACE_Service_Repository &r, - ACE_TCHAR const *name); - - ~ACE_Service_Type_Dynamic_Guard (void); - -private: - ACE_Service_Repository & repo_; - size_t repo_begin_; - ACE_TCHAR const * const name_; - -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - ACE_Guard< ACE_Recursive_Thread_Mutex > repo_monitor_; -#endif -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Service_Gestalt.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SERVICE_GESTALT_H */ - diff --git a/dep/include/ace/Service_Gestalt.inl b/dep/include/ace/Service_Gestalt.inl deleted file mode 100644 index 6a87d6794a9..00000000000 --- a/dep/include/ace/Service_Gestalt.inl +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- -// -// $Id: Service_Gestalt.inl 81388 2008-04-23 14:02:05Z johnnyw $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// This is the primary entry point into the ACE_Service_Config (the -// constructor just handles simple initializations). - -ACE_INLINE int -ACE_Service_Gestalt::open (const ACE_TCHAR program_name[], - const ACE_TCHAR *logger_key, - bool ignore_static_svcs, - bool ignore_default_svc_conf, - bool ignore_debug_flag) -{ - ACE_TRACE ("ACE_Service_Gestalt::open"); - this->no_static_svcs_ = ignore_static_svcs; - - return this->open_i (program_name, - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag); -} - -ACE_INLINE int -ACE_Service_Gestalt::open (int argc, - ACE_TCHAR *argv[], - const ACE_TCHAR *logger_key, - bool ignore_static_svcs, - bool ignore_default_svc_conf, - bool ignore_debug_flag) -{ - ACE_TRACE ("ACE_Service_Gestalt::open"); - - this->no_static_svcs_ = ignore_static_svcs; - - if (this->parse_args_i (argc, - argv, - ignore_default_svc_conf) == -1) - return -1; - - return this->open_i (argv == 0 ? 0 : argv[0], - logger_key, - ignore_static_svcs, - ignore_default_svc_conf, - ignore_debug_flag); -} - -/// Searches for a service object declaration in the local repo, only - -ACE_INLINE int -ACE_Service_Gestalt::find (const ACE_TCHAR name[], - const ACE_Service_Type **srp, - bool ignore_suspended) const -{ - // Closing the gestalt will have disassociated it from the - // repository. If the repository used to be owned by the gestalt, it - // will also have been destroyed - so just check for repo_ before - // doing anything with it. - if (this->repo_ != 0) - return this->repo_->find (name, srp, ignore_suspended); - - return 0; -} - -ACE_INLINE ACE_Service_Repository* -ACE_Service_Gestalt::current_service_repository (void) -{ - return this->repo_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Service_Manager.h b/dep/include/ace/Service_Manager.h deleted file mode 100644 index 8238da7ef78..00000000000 --- a/dep/include/ace/Service_Manager.h +++ /dev/null @@ -1,121 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Service_Manager.h - * - * $Id: Service_Manager.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SERVICE_MANAGER_H -#define ACE_SERVICE_MANAGER_H -#include /**/ "ace/pre.h" - -#include "ace/SOCK_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Acceptor.h" -#include "ace/INET_Addr.h" -#include "ace/Service_Object.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Service_Manager - * - * @brief Provide a standard ACE service for managing all the services - * configured in an ACE_Service_Repository. - * - * This implementation is simple and just handles each client - * request one at a time. There are currently 3 types of requests: - * - List services: If the string "help" is sent, return a list of all - * the services supported by the Service Configurator. - * - Reconfigure: If the string "reconfigure" is sent trigger a - * reconfiguration, which will re-read the local file. - * - Process directive: If neither "help" nor "reconfigure" is sent, - * simply treat the incoming string as a process directive and pass - * it along to . This allows - * remote configuration via command-line instructions like - * % echo suspend My_Remote_Service | telnet hostname 3911 - * - * Each request is associated with a new connection, which is closed - * when the request is processed. In addition, you must be using the - * singleton in order to trigger - * reconfigurations. - */ -class ACE_Export ACE_Service_Manager : public ACE_Service_Object -{ -public: - // = Initialization and termination hooks. - /// Constructor. - ACE_Service_Manager (void); - - /// Destructor. - virtual ~ACE_Service_Manager (void); - -protected: - // = Perform the various meta-services. - - /// Trigger a reconfiguration of the Service Configurator by - /// re-reading its local file. - virtual int reconfigure_services (void); - - /// Determine all the services offered by this daemon and return the - /// information back to the client. - virtual int list_services (void); - - // = Dynamic linking hooks. - virtual int init (int argc, ACE_TCHAR *argv[]); - virtual int info (ACE_TCHAR **info_string, size_t length) const; - virtual int fini (void); - - // = Scheduling hooks. - virtual int suspend (void); - virtual int resume (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - int open (const ACE_INET_Addr &sia); - - // = Demultiplexing hooks. - virtual ACE_HANDLE get_handle (void) const; - virtual int handle_input (ACE_HANDLE fd); - virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask); - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - - /// Handle one request. - virtual void process_request (ACE_TCHAR *request); - - /// Connection to the client (we only support one client connection - /// at a time). - ACE_SOCK_Stream client_stream_; - - /// Acceptor instance. - ACE_SOCK_Acceptor acceptor_; - - /// Keep track whether we debug or not. - bool debug_; - - /// The signal used to trigger reconfiguration. - int signum_; - - /// Default port for the Acceptor to listen on. - static u_short DEFAULT_PORT_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* _SERVICE_MANAGER_H */ - diff --git a/dep/include/ace/Service_Object.h b/dep/include/ace/Service_Object.h deleted file mode 100644 index fd69ba76f17..00000000000 --- a/dep/include/ace/Service_Object.h +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Service_Object.h - * - * $Id: Service_Object.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SERVICE_OBJECT_H -#define ACE_SERVICE_OBJECT_H -#include /**/ "ace/pre.h" - -#include "ace/Shared_Object.h" -#include "ace/Svc_Conf_Tokens.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Event_Handler.h" -#include "ace/DLL.h" - -#include "ace/Service_Gestalt.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#define ACE_Component ACE_Service_Object - -/** - * @class ACE_Service_Object - * - * @brief Provide the abstract base class common to all service - * implementations. - * - * Classes that inherit from ACE_Service_Objects are capable - * of being registered with the ACE_Reactor (due to the - * ACE_Event_Handler, as well as being dynamically linked by - * the ACE_Service_Config (due to the ACE_Shared_Object). - */ -class ACE_Export ACE_Service_Object - : public ACE_Event_Handler, - public ACE_Shared_Object -{ -public: - // = Initialization and termination methods. - /// Constructor. - ACE_Service_Object (ACE_Reactor * = 0); - - /// Destructor. - virtual ~ACE_Service_Object (void); - - /// Temporarily disable a service without removing it completely. - virtual int suspend (void); - - /// Re-enable a previously suspended service. - virtual int resume (void); -}; - -// Forward decl. -class ACE_Service_Type_Impl; - -/** - * @class ACE_Service_Type - * - * @brief Keeps track of information related to the various - * ACE_Service_Type_Impl subclasses. - * - * This class acts as the interface of the "Bridge" pattern. - */ -class ACE_Export ACE_Service_Type -{ -public: - enum - { - /// Delete the payload object. - DELETE_OBJ = 1, - - /// Delete the enclosing object. - DELETE_THIS = 2 - }; - - enum - { - SERVICE_OBJECT = ACE_SVC_OBJ_T, - MODULE = ACE_MODULE_T, - STREAM = ACE_STREAM_T, - INVALID_TYPE = -1 - }; - - // = Initialization and termination methods. - ACE_Service_Type (const ACE_TCHAR *n, - ACE_Service_Type_Impl *o, - const ACE_DLL &dll, - bool active); - ACE_Service_Type (const ACE_TCHAR *n, - ACE_Service_Type_Impl *o, - ACE_SHLIB_HANDLE handle, - bool active); - ~ACE_Service_Type (void); - - const ACE_TCHAR *name (void) const; - void name (const ACE_TCHAR *); - - const ACE_Service_Type_Impl *type (void) const; - void type (const ACE_Service_Type_Impl *, bool active = true); - - /// Is this just a stub for the real thing? - bool is_forward_declaration (void) const; - - int suspend (void) const; - int resume (void) const; - bool active (void) const; - void active (bool turnon); - - /// Calls on - int fini (void); - - /// Check if the service has been fini'ed. - bool fini_called (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Get to the DLL's implentation - const ACE_DLL & dll (void) const; - - /// Sets the DLL - void dll (const ACE_DLL&); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Humanly readible name of svc. - const ACE_TCHAR *name_; - - /// Pointer to C++ object that implements the svc. - const ACE_Service_Type_Impl *type_; - - /// ACE_DLL representing the shared object file (non-zero if - /// dynamically linked). - mutable ACE_DLL dll_; - - /// true if svc is currently active, otherwise false. - bool active_; - - /// true if on has already been called, otherwise false. - bool fini_already_called_; -}; - -/** - * @class ACE_Service_Object_Ptr - * - * @brief This is a smart pointer that holds onto the associated - * ACE_Service_Object * until the current scope is left, at - * which point the object's hook is called and the - * service_object_ gets deleted. - * - * This class is similar to the Standard C++ Library class - * . It is used in conjunction with statically linked - * , as shown in the - * ./netsvcs/server/main.cpp example. - */ -class ACE_Export ACE_Service_Object_Ptr -{ -public: - // = Initialization and termination methods. - /// Acquire ownership of the @a so. - ACE_Service_Object_Ptr (ACE_Service_Object *so); - - /// Release the held ACE_Service_Object by calling its hook. - ~ACE_Service_Object_Ptr (void); - - /// Smart pointer to access the underlying ACE_Service_Object. - ACE_Service_Object *operator-> (); - -private: - /// Holds the service object until we're done. - ACE_Service_Object *service_object_; -}; - -#if defined (ACE_OPENVMS) -/** - * @class ACE_Dynamic_Svc_Registrar - * - * @brief Used to register Service allocator function by its full name. - */ -class ACE_Dynamic_Svc_Registrar -{ -public: - ACE_Dynamic_Svc_Registrar (const ACE_TCHAR* alloc_name, - void* svc_allocator); -}; -#endif - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Service_Object.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SERVICE_OBJECT_H */ - diff --git a/dep/include/ace/Service_Object.inl b/dep/include/ace/Service_Object.inl deleted file mode 100644 index 6283f3e9981..00000000000 --- a/dep/include/ace/Service_Object.inl +++ /dev/null @@ -1,79 +0,0 @@ -// -*- C++ -*- -// $Id: Service_Object.inl 81388 2008-04-23 14:02:05Z johnnyw $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_Service_Object_Ptr::ACE_Service_Object_Ptr (ACE_Service_Object *so) - : service_object_ (so) -{ -} - -ACE_INLINE ACE_Service_Object_Ptr::~ACE_Service_Object_Ptr (void) -{ - this->service_object_->fini (); - delete this->service_object_; -} - -ACE_INLINE ACE_Service_Object * -ACE_Service_Object_Ptr::operator-> () -{ - return this->service_object_; -} - -ACE_INLINE const ACE_TCHAR * -ACE_Service_Type::name (void) const -{ - ACE_TRACE ("ACE_Service_Type::name"); - return this->name_; -} - -ACE_INLINE const ACE_Service_Type_Impl * -ACE_Service_Type::type (void) const -{ - ACE_TRACE ("ACE_Service_Type::type"); - return this->type_; -} - -ACE_INLINE void -ACE_Service_Type::type (const ACE_Service_Type_Impl *o, bool enabled) -{ - ACE_TRACE ("ACE_Service_Type::type"); - this->type_ = o; - ((ACE_Service_Type *) this)->active_ = enabled; -} - -ACE_INLINE bool -ACE_Service_Type::active (void) const -{ - ACE_TRACE ("ACE_Service_Type::active"); - return this->active_; -} - -ACE_INLINE void -ACE_Service_Type::active (bool turnon) -{ - ACE_TRACE ("ACE_Service_Type::active"); - this->active_ = turnon; -} - -ACE_INLINE bool -ACE_Service_Type::fini_called (void) const -{ - ACE_TRACE ("ACE_Service_Type::fini_called"); - return this->fini_already_called_; -} - -ACE_INLINE const ACE_DLL & ACE_Service_Type::dll () const -{ - ACE_TRACE ("ACE_Service_Type::dll"); - return this->dll_; -} - -ACE_INLINE void ACE_Service_Type::dll (const ACE_DLL &adll) -{ - ACE_TRACE ("ACE_Service_Type::dll"); - this->dll_ = adll; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Service_Repository.h b/dep/include/ace/Service_Repository.h deleted file mode 100644 index 99bca07e8fb..00000000000 --- a/dep/include/ace/Service_Repository.h +++ /dev/null @@ -1,280 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Service_Repository.h - * - * $Id: Service_Repository.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SERVICE_REPOSITORY_H -#define ACE_SERVICE_REPOSITORY_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Default_Constants.h" -#include "ace/Recursive_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Service_Type; -class ACE_DLL; - -#define ACE_Component_Repository ACE_Service_Repository -/** - * @class ACE_Service_Repository - * - * @brief Contains all the services offered by a Service - * Configurator-based application. - * - * This class contains a vector of *'s and - * allows an administrative entity to centrally manage and - * control the behavior of application services. Note that if - * services are removed from the middle of the repository the - * order won't necessarily be maintained since the - * method performs compaction. However, the common case is not - * to remove services, so typically they are deleted in the - * reverse order that they were added originally. - */ -class ACE_Export ACE_Service_Repository -{ -public: - friend class ACE_Service_Repository_Iterator; - - enum - { - DEFAULT_SIZE = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE - }; - - // = Initialization and termination methods. - /// Initialize the repository. - ACE_Service_Repository (void); - - /// Initialize the repository. - ACE_Service_Repository (size_t size); - - /// Initialize the repository. - int open (size_t size = DEFAULT_SIZE); - - /// Close down the repository and free up dynamically allocated - /// resources. - ~ACE_Service_Repository (void); - - /// Close down the repository and free up dynamically allocated - /// resources. - int close (void); - - /// Finalize all the services by calling and deleting - /// dynamically allocated services. - int fini (void); - - /// Get pointer to a process-wide ACE_Service_Repository. - static ACE_Service_Repository * instance - (size_t size = ACE_Service_Repository::DEFAULT_SIZE); - - /// Set pointer to a process-wide ACE_Service_Repository and return - /// existing pointer. - static ACE_Service_Repository *instance (ACE_Service_Repository *); - - /// Delete the dynamically allocated Singleton. - static void close_singleton (void); - - // = Search structure operations (all acquire locks as necessary). - - /// Insert a new service record. Returns -1 when the service repository - /// is full and 0 on success. - int insert (const ACE_Service_Type *); - - /** - * Locate a named entry in the service table, optionally ignoring - * suspended entries. - * - * @param service_name The name of the service to search for. - * @param srp Optional; if not 0, it is a pointer to a location - * to receive the ACE_Service_Type pointer for the - * located service. Meaningless if this method - * returns -1. - * @param ignore_suspended If true, the search ignores suspended services. - * - * @retval 0 Named service was located. - * @retval -1 Named service was not found. - * @retval -2 Named service was found, but is suspended and - * @a ignore_suspended is true. - */ - int find (const ACE_TCHAR name[], - const ACE_Service_Type **srp = 0, - bool ignore_suspended = true) const; - - /// Remove an existing service record. If @a sr == 0, the service record - /// is deleted before control is returned to the caller. If @a sr != 0, - /// the service's record is removed from the repository, but not deleted; - /// *sr receives the service record pointer and the caller is responsible - /// for properly disposing of it. - int remove (const ACE_TCHAR[], ACE_Service_Type **sr = 0); - - // = Liveness control - /// Resume a service record. - int resume (const ACE_TCHAR[], const ACE_Service_Type ** = 0); - - /// Suspend a service record. - int suspend (const ACE_TCHAR[], const ACE_Service_Type ** = 0); - - /// Return the current size of the repository. - size_t current_size (void) const; - - /// Return the total size of the repository. - size_t total_size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - friend class ACE_Service_Type_Dynamic_Guard; - - /// Remove an existing service record. It requires @a sr != 0, which - /// receives the service record pointer and the caller is - /// responsible for properly disposing of it. - int remove_i (const ACE_TCHAR[], ACE_Service_Type **sr); - - /** - * Locate a named entry in the service table, optionally ignoring - * suspended entries. - * - * @param service_name The name of the service to search for. - * @param slot Receives the position index of the service if it - * is found. Contents are meaningless if this method - * returns -1. - * @param srp Optional; if not 0, it is a pointer to a location - * to receive the ACE_Service_Type pointer for the - * located service. Meaningless if this method - * returns -1. - * @param ignore_suspended If true, the search ignores suspended services. - * - * @retval 0 Named service was located; index in the table is set in - * @a slot. - * @retval -1 Named service was not found. - * @retval -2 Named service was found, but is suspended and - * @a ignore_suspended is true. - */ - int find_i (const ACE_TCHAR service_name[], - size_t &slot, - const ACE_Service_Type **srp = 0, - bool ignore_suspended = true) const; - - /// @brief Relocate (static) services to another DLL. - /// - /// If any have been registered in the context of a "forward - /// declaration" guard, those really aren't static services. Their - /// code is in the DLL's code segment, or in one of the dependent - /// DLLs. Therefore, such services need to be associated with the - /// proper DLL in order to prevent failures upon finalization. The - /// method locks the repo. - /// - /// Works by having the service type keep a reference to a specific - /// DLL. No locking, caller makes sure calling it is safe. You can - /// forcefully relocate any DLLs in the given range, not only the - /// static ones - but that will cause Very Bad Things (tm) to happen. - - int relocate_i (size_t begin, - size_t end, - const ACE_DLL &adll); - - /// Contains all the configured services. - const ACE_Service_Type **service_vector_; - - /// Current number of services. - size_t current_size_; - - /// Maximum number of services. - size_t total_size_; - - /// Pointer to a process-wide ACE_Service_Repository. - static ACE_Service_Repository *svc_rep_; - - /// Must delete the if true. - static bool delete_svc_rep_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Synchronization variable for the MT_SAFE Repository - mutable ACE_Recursive_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ -}; - -/** - * @class ACE_Service_Repository_Iterator - * - * @brief Iterate through the ACE_Service_Repository. - * - * Make sure not to delete entries as the iteration is going on - * since this class is not designed as a robust iterator. - */ -class ACE_Export ACE_Service_Repository_Iterator -{ -public: - // = Initialization and termination methods. - /// Constructor initializes the iterator. - ACE_Service_Repository_Iterator (ACE_Service_Repository &sr, - int ignored_suspended = 1); - - /// Destructor. - ~ACE_Service_Repository_Iterator (void); - -public: - // = Iteration methods. - - /// Pass back the that hasn't been seen in the repository. - /// Returns 0 when all items have been seen, else 1. - int next (const ACE_Service_Type *&next_item); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Move forward by one element in the repository. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - bool valid (void) const; - -private: - ACE_Service_Repository_Iterator (const ACE_Service_Repository_Iterator&); - - /// Reference to the Service Repository we are iterating over. - ACE_Service_Repository &svc_rep_; - - /// Next index location that we haven't yet seen. - size_t next_; - - /// Are we ignoring suspended services? - bool ignore_suspended_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Service_Repository.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* _SERVICE_REPOSITORY_H */ - diff --git a/dep/include/ace/Service_Repository.inl b/dep/include/ace/Service_Repository.inl deleted file mode 100644 index 621c837ef53..00000000000 --- a/dep/include/ace/Service_Repository.inl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id: Service_Repository.inl 80826 2008-03-04 14:51:23Z wotte $ - -// Returns a count of the number of currently valid entries (counting -// both resumed and suspended entries). - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -#include "ace/Guard_T.h" -#include "ace/Thread_Mutex.h" -#endif /* ACE_MT_SAFE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE size_t -ACE_Service_Repository::current_size (void) const -{ - ACE_TRACE ("ACE_Service_Repository::current_size"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_mon, - (ACE_Recursive_Thread_Mutex &) this->lock_, 0)); - return this->current_size_; -} - -// Returns a count of the total number of possible entries in the -// table. - -ACE_INLINE size_t -ACE_Service_Repository::total_size (void) const -{ - ACE_TRACE ("ACE_Service_Repository::total_size"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_mon, - (ACE_Recursive_Thread_Mutex &) this->lock_, 0)); - return this->total_size_; -} - -ACE_INLINE int -ACE_Service_Repository_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Service_Repository_Iterator::done"); - - return this->next_ >= this->svc_rep_.current_size_; -} - -ACE_INLINE -ACE_Service_Repository_Iterator::~ACE_Service_Repository_Iterator (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Service_Templates.h b/dep/include/ace/Service_Templates.h deleted file mode 100644 index 9262a51ffc8..00000000000 --- a/dep/include/ace/Service_Templates.h +++ /dev/null @@ -1,29 +0,0 @@ - -//============================================================================= -/** - * @file Service_Templates.h - * - * $Id: Service_Templates.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Priyanka Gontla - */ -//============================================================================= - -#ifndef ACE_SERVICE_TEMPLATES_H -#define ACE_SERVICE_TEMPLATES_H -#include /**/ "ace/pre.h" - -#include "ace/Svc_Conf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Auto_Ptr.h" -#include "ace/Thread_Manager.h" -#include "ace/Stream_Modules.h" -#include "ace/Stream.h" - -#include /**/ "ace/post.h" -#endif /* ACE_SERVICE_TEMPLATES_H */ - diff --git a/dep/include/ace/Service_Types.h b/dep/include/ace/Service_Types.h deleted file mode 100644 index e7ab9874ac2..00000000000 --- a/dep/include/ace/Service_Types.h +++ /dev/null @@ -1,207 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Service_Types.h - * - * $Id: Service_Types.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SERVICE_TYPE_H -#define ACE_SERVICE_TYPE_H - -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Service_Type_Impl - * - * @brief The abstract base class of the hierarchy that defines the - * contents of the ACE_Service_Repository. The subclasses of - * this class allow the configuration of ACE_Service_Objects, - * ACE_Modules, and ACE_Streams. - * - * This class provides the root of the implementation hierarchy - * of the "Bridge" pattern. It maintains a pointer to the - * appropriate type of service implementation, i.e., - * ACE_Service_Object, ACE_Module, or ACE_Stream. - */ -class ACE_Export ACE_Service_Type_Impl -{ -public: - // = Initialization and termination methods. - ACE_Service_Type_Impl (void *object, - const ACE_TCHAR *s_name, - u_int flags = 0, - ACE_Service_Object_Exterminator gobbler = 0); - virtual ~ACE_Service_Type_Impl (void); - - // = Pure virtual interface (must be defined by the subclass). - virtual int suspend (void) const = 0; - virtual int resume (void) const = 0; - virtual int init (int argc, ACE_TCHAR *argv[]) const = 0; - virtual int fini (void) const; - virtual int info (ACE_TCHAR **str, size_t len) const = 0; - - /// The pointer to the service. - void *object (void) const; - - /// Get the name of the service. - const ACE_TCHAR *name (void) const; - - /// Set the name of the service. - void name (const ACE_TCHAR *); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Name of the service. - const ACE_TCHAR *name_; - - /// Pointer to object that implements the service. This actually - /// points to an ACE_Service_Object, ACE_Module, or ACE_Stream. - void *obj_; - - /// Destroy function to deallocate obj_. - ACE_Service_Object_Exterminator gobbler_; - - /// Flags that control serivce behavior (particularly deletion). - u_int flags_; -}; - -/** - * @class ACE_Service_Object_Type - * - * @brief Define the methods for handling the configuration of - * ACE_Service_Objects. - */ -class ACE_Export ACE_Service_Object_Type : public ACE_Service_Type_Impl -{ -public: - // = Initialization method. - ACE_Service_Object_Type (void *so, - const ACE_TCHAR *name, - u_int flags = 0, - ACE_Service_Object_Exterminator gobbler = 0); - - ~ACE_Service_Object_Type (void); - - // = Implement the hooks for . - virtual int suspend (void) const; - virtual int resume (void) const; - virtual int init (int argc, ACE_TCHAR *argv[]) const; - virtual int fini (void) const; - virtual int info (ACE_TCHAR **str, size_t len) const; - -private: - /// Holds the initialization status (result of object->init()) - mutable int initialized_; -}; - -/** - * @class ACE_Module_Type - * - * @brief Define the methods for handling the configuration of - * ACE_Modules. - */ -class ACE_Export ACE_Module_Type : public ACE_Service_Type_Impl -{ -public: - // = Initialization method. - ACE_Module_Type (void *m, // Really an ACE_Module *. - const ACE_TCHAR *identifier, - u_int flags = 0); - - ~ACE_Module_Type (void); - - // = Implement the hooks for . - virtual int suspend (void) const; - virtual int resume (void) const; - virtual int init (int argc, ACE_TCHAR *argv[]) const; - virtual int fini (void) const; - virtual int info (ACE_TCHAR **str, size_t len) const; - - /// Get the link pointer. - ACE_Module_Type *link (void) const; - - /// Set the link pointer. - void link (ACE_Module_Type *); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the next ACE_Module_Type in an ACE_Stream_Type. - ACE_Module_Type *link_; -}; - -/** - * @class ACE_Stream_Type - * - * @brief Define the methods for handling the configuration of - * ACE_Streams. - */ -class ACE_Export ACE_Stream_Type : public ACE_Service_Type_Impl -{ -public: - // = Initialization method. - ACE_Stream_Type (void *s, // Really an ACE_Stream *. - const ACE_TCHAR *identifier, - u_int flags = 0); - - ~ACE_Stream_Type (void); - - // = Implement the hooks for . - virtual int suspend (void) const; - virtual int resume (void) const; - virtual int init (int argc, ACE_TCHAR *argv[]) const; - virtual int fini (void) const; - virtual int info (ACE_TCHAR **str, size_t len) const; - - /// Add a new ACE_Module to the top of the ACE_Stream. - int push (ACE_Module_Type *new_module); - - /// Search for @a module and remove it from the ACE_Stream. - int remove (ACE_Module_Type *module); - - /// Locate the ACE_Module with @a mod_name. - ACE_Module_Type *find (const ACE_TCHAR *mod_name) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the head of the ACE_Module list. - ACE_Module_Type *head_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Service_Types.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* _SERVICE_TYPE_H */ - diff --git a/dep/include/ace/Service_Types.inl b/dep/include/ace/Service_Types.inl deleted file mode 100644 index f7f93591562..00000000000 --- a/dep/include/ace/Service_Types.inl +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -// -// $Id: Service_Types.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE void * -ACE_Service_Type_Impl::object (void) const -{ - ACE_TRACE ("ACE_Service_Type_Impl::object"); - return this->obj_; -} - -ACE_INLINE const ACE_TCHAR * -ACE_Service_Type_Impl::name (void) const -{ - ACE_TRACE ("ACE_Service_Type_Impl::name"); - return this->name_; -} - -ACE_INLINE void -ACE_Service_Type_Impl::name (const ACE_TCHAR *n) -{ - ACE_TRACE ("ACE_Service_Type_Impl::name"); - - ACE::strdelete (const_cast (this->name_)); - this->name_ = ACE::strnew (n); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Shared_Memory.h b/dep/include/ace/Shared_Memory.h deleted file mode 100644 index af2060d5b1d..00000000000 --- a/dep/include/ace/Shared_Memory.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Shared_Memory.h - * - * $Id: Shared_Memory.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//========================================================================== - -#ifndef ACE_SHARED_MEMORY_H -#define ACE_SHARED_MEMORY_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Shared_Memory - * - * @brief This base class adapts both System V shared memory and "BSD" - * mmap to a common API. - * - * This is a very simple-minded wrapper, i.e., it really is only - * useful for allocating large contiguous chunks of shared - * memory. For a much more sophisticated version, please check - * out the class. - */ -class ACE_Export ACE_Shared_Memory -{ -public: - virtual ~ACE_Shared_Memory (void); - - // = Note that all the following methods are pure virtual. - virtual int close (void) = 0; - virtual int remove (void) = 0; - virtual void *malloc (size_t = 0) = 0; - virtual int free (void *p) = 0; - virtual size_t get_segment_size (void) const = 0; - virtual ACE_HANDLE get_id (void) const = 0; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SHARED_MEMORY_H */ - diff --git a/dep/include/ace/Shared_Memory_MM.h b/dep/include/ace/Shared_Memory_MM.h deleted file mode 100644 index 2a2d92afed5..00000000000 --- a/dep/include/ace/Shared_Memory_MM.h +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Shared_Memory_MM.h - * - * $Id: Shared_Memory_MM.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SHARED_MALLOC_MM_H -#define ACE_SHARED_MALLOC_MM_H -#include /**/ "ace/pre.h" - -#include "ace/Shared_Memory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Mem_Map.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Shared_Memory_MM - * - * @brief Shared memory wrapper based on MMAP. - * - * This class provides a very simple-minded shared memory manager. We - * strongly recommend that you do NOT use this class. Instead, please - * use @c ACE_Malloc, which has much more powerful capabilities. - */ -class ACE_Export ACE_Shared_Memory_MM : public ACE_Shared_Memory -{ -public: - // = Initialization and termination methods. - /// Default constructor. - ACE_Shared_Memory_MM (void); - - /// Constructor. - ACE_Shared_Memory_MM (ACE_HANDLE handle, - size_t length = static_cast (-1), - int prot = PROT_RDWR, - int share = ACE_MAP_PRIVATE, - char *addr = 0, - ACE_OFF_T pos = 0); - - /// Constructor. - ACE_Shared_Memory_MM (const ACE_TCHAR *file_name, - size_t length = static_cast (-1), - int flags = O_RDWR | O_CREAT, - int mode = ACE_DEFAULT_FILE_PERMS, - int prot = PROT_RDWR, - int share = ACE_MAP_SHARED, - char *addr = 0, ACE_OFF_T pos = 0); - - /// Open method. - int open (ACE_HANDLE handle, - size_t length = static_cast (-1), - int prot = PROT_RDWR, - int share = ACE_MAP_PRIVATE, - char *addr = 0, - ACE_OFF_T pos = 0); - - /// Open method. - int open (const ACE_TCHAR *file_name, - size_t length = static_cast (-1), - int flags = O_RDWR | O_CREAT, - int mode = ACE_DEFAULT_FILE_PERMS, - int prot = PROT_RDWR, - int share = ACE_MAP_SHARED, - char *addr = 0, - ACE_OFF_T pos = 0); - - /// Return the name of file that is mapped (if any). - const ACE_TCHAR *filename (void) const; - - /// Close down the shared memory segment. - virtual int close (void); - - /// Remove the shared memory segment and the underlying file. - virtual int remove (void); - - // = Allocation and deallocation methods. - /// Create a new chuck of memory containing @a size bytes. - virtual void *malloc (size_t size = 0); - - /// Free a chuck of memory allocated by - /// . - virtual int free (void *p); - - /// Return the size of the shared memory segment. - virtual size_t get_segment_size (void) const; - - /// Return the ID of the shared memory segment (i.e., an ACE_HANDLE). - virtual ACE_HANDLE get_id (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// This version is implemented with memory-mapped files. - ACE_Mem_Map shared_memory_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Shared_Memory_MM.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SHARED_MALLOC_MM_H */ - diff --git a/dep/include/ace/Shared_Memory_MM.inl b/dep/include/ace/Shared_Memory_MM.inl deleted file mode 100644 index 6e1f4b76616..00000000000 --- a/dep/include/ace/Shared_Memory_MM.inl +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -// -// $Id: Shared_Memory_MM.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Return the name of file that is mapped (if any). - -ACE_INLINE const ACE_TCHAR * -ACE_Shared_Memory_MM::filename (void) const -{ - return this->shared_memory_.filename (); -} - -ACE_INLINE int -ACE_Shared_Memory_MM::open (ACE_HANDLE handle, - size_t length, - int prot, - int share, - char *addr, - ACE_OFF_T pos) -{ - ACE_TRACE ("ACE_Shared_Memory_MM::open"); - return shared_memory_.map (handle, length, prot, share, addr, pos); -} - -ACE_INLINE int -ACE_Shared_Memory_MM::open (const ACE_TCHAR *file_name, - size_t len, - int flags, - int mode, - int prot, - int share, - char *addr, - ACE_OFF_T pos) -{ - ACE_TRACE ("ACE_Shared_Memory_MM::open"); - return shared_memory_.map (file_name, len, flags, mode, - prot, share, addr, pos); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Shared_Memory_Pool.h b/dep/include/ace/Shared_Memory_Pool.h deleted file mode 100644 index ea1a5e7d3c6..00000000000 --- a/dep/include/ace/Shared_Memory_Pool.h +++ /dev/null @@ -1,211 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Shared_Memory_Pool.h - * - * $Id: Shared_Memory_Pool.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Dougls C. Schmidt - * @author Prashant Jain - */ -//============================================================================= - -#ifndef ACE_SHARED_MEMORY_POOL_H -#define ACE_SHARED_MEMORY_POOL_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SYSV_SHMEM) - -#include "ace/ACE.h" -#include "ace/Event_Handler.h" -#include "ace/Sig_Handler.h" -#include "ace/os_include/sys/os_mman.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Shared_Memory_Pool_Options - * - * @brief Helper class for Shared Memory Pool constructor options. - * - * This should be a nested class, but that breaks too many - * compilers. - */ -class ACE_Export ACE_Shared_Memory_Pool_Options -{ -public: - /// Initialization method. - ACE_Shared_Memory_Pool_Options ( - const char *base_addr = ACE_DEFAULT_BASE_ADDR, - size_t max_segments = ACE_DEFAULT_MAX_SEGMENTS, - size_t file_perms = ACE_DEFAULT_FILE_PERMS, - ACE_OFF_T minimum_bytes = 0, - size_t segment_size = ACE_DEFAULT_SEGMENT_SIZE); - - /// Base address of the memory-mapped backing store. - const char *base_addr_; - - /// Number of shared memory segments to allocate. - size_t max_segments_; - - /// What the minimum bytes of the initial segment should be. - ACE_OFF_T minimum_bytes_; - - /// File permissions to use when creating/opening a segment. - size_t file_perms_; - - /// Shared memory segment size. - size_t segment_size_; -}; - -/** - * @class ACE_Shared_Memory_Pool - * - * @brief Make a memory pool that is based on System V shared memory - * (shmget(2) etc.). This implementation allows memory to be - * shared between processes. If your platform doesn't support - * System V shared memory (e.g., Win32 and many RTOS platforms - * do not) then you should use ACE_MMAP_Memory_Pool instead of this - * class. In fact, you should probably use ACE_MMAP_Memory_Pool on - * platforms that *do* support System V shared memory since it - * provides more powerful features, such as persistent backing store - * and greatly scalability. - */ -class ACE_Export ACE_Shared_Memory_Pool : public ACE_Event_Handler -{ -public: - typedef ACE_Shared_Memory_Pool_Options OPTIONS; - - /// Initialize the pool. - ACE_Shared_Memory_Pool (const ACE_TCHAR *backing_store_name = 0, - const OPTIONS *options = 0); - - virtual ~ACE_Shared_Memory_Pool (void); - - /// Ask system for initial chunk of local memory. - virtual void *init_acquire (size_t nbytes, - size_t &rounded_bytes, - int &first_time); - - /** - * Acquire at least @a nbytes from the memory pool. @a rounded_byes is - * the actual number of bytes allocated. Also acquires an internal - * semaphore that ensures proper serialization of Memory_Pool - * initialization across processes. - */ - virtual void *acquire (size_t nbytes, - size_t &rounded_bytes); - - /// Instruct the memory pool to release all of its resources. - virtual int release (int destroy = 1); - - /// Sync the memory region to the backing store starting at - /// @c this->base_addr_. - virtual int sync (ssize_t len = -1, int flags = MS_SYNC); - - /// Sync the memory region to the backing store starting at @a addr. - virtual int sync (void *addr, size_t len, int flags = MS_SYNC); - - /** - * Change the protection of the pages of the mapped region to @a prot - * starting at @c this->base_addr_ up to @a len bytes. If @a len == -1 - * then change protection of all pages in the mapped region. - */ - virtual int protect (ssize_t len = -1, int prot = PROT_RDWR); - - /// Change the protection of the pages of the mapped region to @a prot - /// starting at @a addr up to @a len bytes. - virtual int protect (void *addr, size_t len, int prot = PROT_RDWR); - - /// Return the base address of this memory pool, 0 if base_addr - /// never changes. - virtual void *base_addr (void) const; - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Implement the algorithm for rounding up the request to an - /// appropriate chunksize. - virtual size_t round_up (size_t nbytes); - - /** - * Commits a new shared memory segment if necessary after an - * or a signal. @a offset is set to the new offset into - * the backing store. - */ - virtual int commit_backing_store_name (size_t rounded_bytes, - ACE_OFF_T &offset); - - /// Keeps track of all the segments being used. - struct SHM_TABLE - { - /// Shared memory segment key. - key_t key_; - - /// Shared memory segment internal id. - int shmid_; - - /// Is the segment currently used.; - int used_; - }; - - /** - * Base address of the shared memory segment. If this has the value - * of 0 then the OS is free to select any address, otherwise this - * value is what the OS must try to use to map the shared memory - * segment. - */ - void *base_addr_; - - /// File permissions to use when creating/opening a segment. - size_t file_perms_; - - /// Number of shared memory segments in the table. - size_t max_segments_; - - /// What the minimim bytes of the initial segment should be. - ACE_OFF_T minimum_bytes_; - - /// Shared memory segment size. - size_t segment_size_; - - /// Base shared memory key for the segment. - key_t base_shm_key_; - - /// Find the segment that contains the @a searchPtr - virtual int find_seg (const void *const searchPtr, - ACE_OFF_T &offset, - size_t &counter); - - /// Determine how much memory is currently in use. - virtual int in_use (ACE_OFF_T &offset, - size_t &counter); - - /// Handles SIGSEGV. - ACE_Sig_Handler signal_handler_; - - /// Handle SIGSEGV and SIGBUS signals to remap shared memory - /// properly. - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* !ACE_LACKS_SYSV_SHMEM */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SHARED_MEMORY_POOL_H */ - diff --git a/dep/include/ace/Shared_Memory_SV.h b/dep/include/ace/Shared_Memory_SV.h deleted file mode 100644 index 2da27742f05..00000000000 --- a/dep/include/ace/Shared_Memory_SV.h +++ /dev/null @@ -1,101 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Shared_Memory_SV.h - * - * $Id: Shared_Memory_SV.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SHARED_MALLOC_SV_H -#define ACE_SHARED_MALLOC_SV_H -#include /**/ "ace/pre.h" - -#include "ace/Shared_Memory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SV_Shared_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Shared_Memory_SV - * - * @brief Shared memory wrapper based on System V shared memory. - * - * This class provides a very simple-minded shared memory manager. We - * strongly recommend that you do NOT use this class. Instead, please - * use @c ACE_Malloc, which has much more powerful capabilities. - */ -class ACE_Export ACE_Shared_Memory_SV : public ACE_Shared_Memory -{ -public: - enum - { - ACE_CREATE = IPC_CREAT, - ACE_OPEN = 0 - }; - - // = Initialization and termination methods. - ACE_Shared_Memory_SV (void); - ACE_Shared_Memory_SV (key_t id, - size_t length, - int create = ACE_Shared_Memory_SV::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS, - void *addr = 0, - int flags = 0); - - int open (key_t id, - size_t length, - int create = ACE_Shared_Memory_SV::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS, - void *addr = 0, - int flags = 0); - - /// Close down the shared memory segment. - virtual int close (void); - - /// Remove the underlying shared memory segment. - virtual int remove (void); - - // = Allocation and deallocation methods. - /// Create a new chuck of memory containing @a size bytes. - virtual void *malloc (size_t = 0); - - /// Free a chuck of memory allocated by . - virtual int free (void *p); - - /// Return the size of the shared memory segment. - virtual size_t get_segment_size (void) const; - - /// Return the ID of the shared memory segment (i.e., a System V - /// shared memory internal id). - virtual ACE_HANDLE get_id (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// This version is implemented with System V shared memory - /// segments. - ACE_SV_Shared_Memory shared_memory_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Shared_Memory_SV.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SHARED_MALLOC_SV_H */ - diff --git a/dep/include/ace/Shared_Memory_SV.inl b/dep/include/ace/Shared_Memory_SV.inl deleted file mode 100644 index 1a586701cc3..00000000000 --- a/dep/include/ace/Shared_Memory_SV.inl +++ /dev/null @@ -1,30 +0,0 @@ -// -*- C++ -*- -// -// $Id: Shared_Memory_SV.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_Shared_Memory_SV::open (key_t id, - size_t length, - int create, - int perms, - void *addr, - int flags) -{ - ACE_TRACE ("ACE_Shared_Memory_SV::open"); - return shared_memory_.open_and_attach (id, length, create, - perms, addr, flags); -} - -// The "do-nothing" constructor. - -ACE_INLINE -ACE_Shared_Memory_SV::ACE_Shared_Memory_SV (void) -{ - ACE_TRACE ("ACE_Shared_Memory_SV::ACE_Shared_Memory_SV"); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Shared_Object.h b/dep/include/ace/Shared_Object.h deleted file mode 100644 index 17f6dca54dd..00000000000 --- a/dep/include/ace/Shared_Object.h +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Shared_Object.h - * - * $Id: Shared_Object.h 81348 2008-04-14 09:00:32Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SHARED_OBJECT_H -#define ACE_SHARED_OBJECT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Shared_Object - * - * @brief Provide the abstract base class used to access dynamic - * linking facilities. - */ -class ACE_Export ACE_Shared_Object -{ -public: - /// Constructor - ACE_Shared_Object (void); - - /// Destructor - virtual ~ACE_Shared_Object (void); - - /// Initializes object when dynamic linking occurs. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Terminates object when dynamic unlinking occurs. - virtual int fini (void); - - /// Returns information on a service object. - virtual int info (ACE_TCHAR **info_string, size_t length = 0) const; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Shared_Object.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SHARED_OBJECT_H */ - diff --git a/dep/include/ace/Shared_Object.inl b/dep/include/ace/Shared_Object.inl deleted file mode 100644 index 4f5f0020604..00000000000 --- a/dep/include/ace/Shared_Object.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Shared_Object.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Shared_Object::ACE_Shared_Object (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Sig_Adapter.h b/dep/include/ace/Sig_Adapter.h deleted file mode 100644 index f0013ede558..00000000000 --- a/dep/include/ace/Sig_Adapter.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Sig_Adapter.h - * - * $Id: Sig_Adapter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SIG_ADAPTER_H -#define ACE_SIG_ADAPTER_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Event_Handler.h" -#include "ace/Signal.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Sig_Adapter - * - * @brief Provide an adapter that transforms various types of signal - * handlers into the scheme used by the ACE_Reactor. - */ -class ACE_Export ACE_Sig_Adapter : public ACE_Event_Handler -{ -public: - ACE_Sig_Adapter (ACE_Sig_Action &, int sigkey); - ACE_Sig_Adapter (ACE_Event_Handler *, int sigkey); - ACE_Sig_Adapter (ACE_Sig_Handler_Ex, int sigkey = 0); - ~ACE_Sig_Adapter (void); - - /// Returns this signal key that's used to remove this from the - /// ACE_Reactor's internal table. - int sigkey (void); - - /// Called by the to dispatch the signal handler. - virtual int handle_signal (int, siginfo_t *, ucontext_t *); - -private: - /// Key for this signal handler (used to remove it). - int sigkey_; - - /// Is this an external handler or an ACE handler? - enum - { - /// We're just wrapping an ACE_Event_Handler. - ACE_HANDLER, - /// An ACE_Sig_Action. - SIG_ACTION, - /// A normal C function. - C_FUNCTION - } type_; - - // = This should be a union, but C++ won't allow that because the - // has a constructor. - /// This is an external handler (ugh). - ACE_Sig_Action sa_; - - /// This is an ACE hander. - ACE_Event_Handler *eh_; - - /// This is a normal C function. - ACE_Sig_Handler_Ex sig_func_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SIG_ADAPTER_H */ - diff --git a/dep/include/ace/Sig_Handler.h b/dep/include/ace/Sig_Handler.h deleted file mode 100644 index ea58980154e..00000000000 --- a/dep/include/ace/Sig_Handler.h +++ /dev/null @@ -1,238 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Sig_Handler.h - * - * $Id: Sig_Handler.h 81388 2008-04-23 14:02:05Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SIGNAL_HANDLER_H -#define ACE_SIGNAL_HANDLER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Event_Handler.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Sig_Action; - -/** - * @class ACE_Sig_Handler - * - * @brief This is the main dispatcher of signals for ACE. It improves - * the existing UNIX signal handling mechanism by allowing C++ - * objects to handle signals in a way that avoids the use of - * global/static variables and functions. - * - * Using this class a program can register an ACE_Event_Handler - * with the ACE_Sig_Handler in order to handle a designated - * @a signum. When a signal occurs that corresponds to this - * @a signum, the @c handle_signal method of the registered - * ACE_Event_Handler is invoked automatically. - */ -class ACE_Export ACE_Sig_Handler -{ -public: - /// Default constructor. - ACE_Sig_Handler (void); - - /// Destructor - virtual ~ACE_Sig_Handler (void); - - // = Registration and removal methods. - /** - * Add a new ACE_Event_Handler and a new sigaction associated with - * @a signum. Passes back the existing ACE_Event_Handler and its - * sigaction if pointers are non-zero. Returns -1 on failure and >= - * 0 on success. - */ - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - - /** - * Remove the ACE_Event_Handler currently associated with - * @a signum. @a sigkey is ignored in this implementation since there - * is only one instance of a signal handler. Install the new - * disposition (if given) and return the previous disposition (if - * desired by the caller). Returns 0 on success and -1 if @a signum - * is invalid. - */ - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp = 0, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - - // Set/get signal status. - /// True if there is a pending signal. - static int sig_pending (void); - - /// Reset the value of so that no signal is pending. - static void sig_pending (int); - - // = Set/get the handler associated with a particular signal. - - /// Return the ACE_Sig_Handler associated with @a signum. - virtual ACE_Event_Handler *handler (int signum); - - /// Set a new ACE_Event_Handler that is associated with @a signum. - /// Return the existing handler. - virtual ACE_Event_Handler *handler (int signum, ACE_Event_Handler *); - - /** - * Callback routine registered with sigaction(2) that dispatches the - * method of the appropriate pre-registered - * ACE_Event_Handler. - */ - static void dispatch (int, siginfo_t *, - ucontext_t *); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = These methods and data members are shared by derived classes. - - /** - * Set a new ACE_Event_Handler that is associated with @a signum. - * Return the existing handler. Does not acquire any locks so that - * it can be called from a signal handler, such as . - */ - static ACE_Event_Handler *handler_i (int signum, - ACE_Event_Handler *); - - /** - * This implementation method is called by and - * @c dispatch. It doesn't do any locking so that it can be called - * within a signal handler, such as @c dispatch. It adds a new - * ACE_Event_Handler and a new sigaction associated with @a signum. - * Passes back the existing ACE_Event_Handler and its sigaction if - * pointers are non-zero. Returns -1 on failure and >= 0 on - * success. - */ - static int register_handler_i (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - - /// Check whether the SIGNUM is within the legal range of signals. - static int in_range (int signum); - - /// Keeps track of whether a signal is pending. - static sig_atomic_t sig_pending_; - -private: - /// Array used to store one user-defined Event_Handler for every - /// signal. - static ACE_Event_Handler *signal_handlers_[ACE_NSIG]; -}; - -/** - * @class ACE_Sig_Handlers - * - * @brief This is an alternative signal handling dispatcher for ACE. It - * allows a list of signal handlers to be registered for each - * signal. It also makes SA_RESTART the default mode. - * - * Using this class a program can register one or more - * ACE_Event_Handler with the ACE_Sig_Handler in order to - * handle a designated @a signum. When a signal occurs that - * corresponds to this @a signum, the methods of - * all the registered ACE_Event_Handlers are invoked - * automatically. - */ -class ACE_Export ACE_Sig_Handlers : public ACE_Sig_Handler -{ -public: - // = Registration and removal methods. - /** - * Add a new ACE_Event_Handler and a new sigaction associated with - * @a signum. Passes back the existing ACE_Event_Handler and its - * sigaction if pointers are non-zero. Returns -1 on failure and - * a that is >= 0 on success. - */ - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - - /** - * Remove an ACE_Event_Handler currently associated with @a signum. - * We remove the handler if (1) its sigkey> matches the @a sigkey - * passed as a parameter or (2) if we've been told to remove all the - * handlers, i.e., == -1. If a new disposition is given it - * is installed and the previous disposition is returned (if desired - * by the caller). Returns 0 on success and -1 if @a signum is - * invalid. - */ - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp = 0, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - - // = Set/get the handler associated with a particular signal. - - /// Return the head of the list of s associated with - /// SIGNUM. - virtual ACE_Event_Handler *handler (int signum); - - /** - * Set a new ACE_Event_Handler that is associated with SIGNUM at - * the head of the list of signals. Return the existing handler - * that was at the head. - */ - virtual ACE_Event_Handler *handler (int signum, - ACE_Event_Handler *); - - /** - * Callback routine registered with sigaction(2) that dispatches the - * method of all the pre-registered - * ACE_Event_Handlers for @a signum - */ - static void dispatch (int signum, siginfo_t *, ucontext_t *); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /** - * Keeps track of the id that uniquely identifies each registered - * signal handler. This id can be used to cancel a timer via the - * method. - */ - static int sigkey_; - - /// If this is true then a 3rd party library has registered a - /// handler... - static bool third_party_sig_handler_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Sig_Handler.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SIG_HANDLER_H */ - diff --git a/dep/include/ace/Sig_Handler.inl b/dep/include/ace/Sig_Handler.inl deleted file mode 100644 index de02c09ab16..00000000000 --- a/dep/include/ace/Sig_Handler.inl +++ /dev/null @@ -1,15 +0,0 @@ -// -*- C++ -*- -// -// $Id: Sig_Handler.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_INLINE -ACE_Sig_Handler::ACE_Sig_Handler (void) -{ -} - -ACE_INLINE int -ACE_Sig_Handler::in_range (int signum) -{ - ACE_TRACE ("ACE_Sig_Handler::in_range"); - return signum > 0 && signum < ACE_NSIG; -} diff --git a/dep/include/ace/Signal.h b/dep/include/ace/Signal.h deleted file mode 100644 index ae679ed7ae6..00000000000 --- a/dep/include/ace/Signal.h +++ /dev/null @@ -1,267 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Signal.h - * - * $Id: Signal.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SIGNAL_H -#define ACE_SIGNAL_H -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if defined (ACE_DONT_INCLUDE_ACE_SIGNAL_H) -# error ace/Signal.h was #included instead of signal.h by ace/OS_NS_signal.h: fix!!!! -#endif /* ACE_DONT_INCLUDE_ACE_SIGNAL_H */ - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_signal.h" - -// Type of the extended signal handler. -typedef void (*ACE_Sig_Handler_Ex) (int, siginfo_t *siginfo, ucontext_t *ucontext); - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Sig_Set - * - * @brief Provide a C++ wrapper for the C sigset_t interface. - * - * Handle signals via a more elegant C++ interface (e.g., - * doesn't require the use of global variables or global - * functions in an application). - */ -class ACE_Export ACE_Sig_Set -{ -public: - // = Initialization and termination methods. - /// Initialize with @a sigset. If @a sigset == 0 then fill - /// the set. - ACE_Sig_Set (sigset_t *sigset); - - /// Initialize with @a sigset. If @a sigset == 0 then fill - /// the set. - ACE_Sig_Set (ACE_Sig_Set *sigset); - - /// If @a fill == 0 then initialize the to be empty, else - /// full. - ACE_Sig_Set (int fill = 0); - - ~ACE_Sig_Set (void); - - /// Create a set that excludes all signals defined by the system. - int empty_set (void); - - /// Create a set that includes all signals defined by the system. - int fill_set (void); - - /// Adds the individual signal specified by @a signo to the set. - int sig_add (int signo); - - /// Deletes the individual signal specified by @a signo from the set. - int sig_del (int signo); - - /// Checks whether the signal specified by @a signo is in the set. - int is_member (int signo) const; - - /// Returns a pointer to the underlying @c sigset_t. - operator sigset_t *(); - - /// Returns a copy of the underlying @c sigset_t. - sigset_t sigset (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Set of signals. - sigset_t sigset_; -}; - -/** - * @class ACE_Sig_Action - * - * @brief C++ wrapper facade for the @c sigaction struct. - */ -class ACE_Export ACE_Sig_Action -{ -public: - // = Initialization methods. - /// Default constructor. Initializes everything to 0. - ACE_Sig_Action (void); - - /// Assigns the various fields of a @c sigaction struct but doesn't - /// register for signal handling via the @c sigaction function. - ACE_Sig_Action (ACE_SignalHandler handler, - sigset_t *sigmask = 0, - int flags = 0); - - /// Assigns the various fields of a @c sigaction struct but doesn't - /// register for signal handling via the @c sigaction function. - ACE_Sig_Action (ACE_SignalHandler handler, - const ACE_Sig_Set &sigmask, - int flags = 0); - - /** - * Assigns the various fields of a @c sigaction struct and registers - * the @a handler to process signal @a signum via the @c sigaction - * function. - */ - ACE_Sig_Action (ACE_SignalHandler handler, - int signum, - sigset_t *sigmask = 0, - int flags = 0); - - /** - * Assigns the various fields of a @c sigaction struct and registers - * the @a handler to process signal @a signum via the @c sigaction - * function. - */ - ACE_Sig_Action (ACE_SignalHandler handler, - int signum, - const ACE_Sig_Set &sigmask, - int flags = 0); - - // @@ The next two methods have a parameter as "signalss". Please do - // not change the argument name as "signals". This causes the - // following problem as reported by - // . - - // In the file Signal.h two of the functions have and argument name - // of signals. signals is a Qt macro (to do with their meta object - // stuff. - // We could as well have it as "signal", but I am nost sure whether - // that would cause a problem with something else - Bala - - /** - * Assigns the various fields of a @c sigaction struct and registers - * the @a handler to process all @a signalss via the @c sigaction - * function. - */ - ACE_Sig_Action (const ACE_Sig_Set &signalss, - ACE_SignalHandler handler, - const ACE_Sig_Set &sigmask, - int flags = 0); - - /** - * Assigns the various fields of a @c sigaction struct and registers - * the @a handler to process all @a signalss via the @c sigaction - * function. - */ - ACE_Sig_Action (const ACE_Sig_Set &signalss, - ACE_SignalHandler handler, - sigset_t *sigmask = 0, - int flags = 0); - - /// Copy constructor. - ACE_Sig_Action (const ACE_Sig_Action &s); - - /// Default dtor. - ~ACE_Sig_Action (void); - - // = Signal action management. - /// Register @c this as the current disposition and store old - /// disposition into @a oaction if it is non-NULL. - int register_action (int signum, - ACE_Sig_Action *oaction = 0); - - /// Assign the value of @a oaction to @c this and make it become the - /// new signal disposition. - int restore_action (int signum, - ACE_Sig_Action &oaction); - - /// Retrieve the current disposition into @c this. - int retrieve_action (int signum); - - /// Set current signal action. - void set (struct sigaction *); - - /// Get current signal action. - struct sigaction *get (void); - operator struct sigaction *(); - - /// Set current signal flags. - void flags (int); - - /// Get current signal flags. - int flags (void); - - /// Set current signal mask. - void mask (sigset_t *); - void mask (ACE_Sig_Set &); - - /// Get current signal mask. - sigset_t *mask (void); - - /// Set current signal handler (pointer to function). - void handler (ACE_SignalHandler); - - /// Get current signal handler (pointer to function). - ACE_SignalHandler handler (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Controls signal behavior. - struct sigaction sa_; -}; - -/** - * @class ACE_Sig_Guard - * - * @brief Hold signals in MASK for duration of a C++ statement block. - * Note that a "0" for mask causes all signals to be held. - */ -class ACE_Export ACE_Sig_Guard -{ -public: - // = Initialization and termination methods. - /// This is kind of conditional Guard, needed when guard should be - /// activated only when a spcific condition met. When condition == - /// true (default), Guard is activated - ACE_Sig_Guard (ACE_Sig_Set *mask = 0, bool condition = true); - - /// Restore blocked signals. - ~ACE_Sig_Guard (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Original signal mask. - ACE_Sig_Set omask_; - - /// Guard Condition - bool condition_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Signal.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_SIGNAL_HANDLER_H */ - diff --git a/dep/include/ace/Signal.inl b/dep/include/ace/Signal.inl deleted file mode 100644 index 858c33c26fb..00000000000 --- a/dep/include/ace/Signal.inl +++ /dev/null @@ -1,265 +0,0 @@ -// -*- C++ -*- -// -// $Id: Signal.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_signal.h" -#include "ace/config-all.h" -#include "ace/Trace.h" -#include "ace/Object_Manager_Base.h" -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Sig_Set::ACE_Sig_Set (sigset_t *ss) - // : sigset_ () -{ - ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set"); - - if (ss == 0) - ACE_OS::sigfillset (&this->sigset_); - else - // Structure assignment. - this->sigset_ = *ss; -} - -ACE_INLINE -ACE_Sig_Set::ACE_Sig_Set (int fill) - // : sigset_ () -{ - ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set"); - - if (fill) - ACE_OS::sigfillset (&this->sigset_); - else - ACE_OS::sigemptyset (&this->sigset_); -} - -ACE_INLINE -ACE_Sig_Set::ACE_Sig_Set (ACE_Sig_Set *ss) - // : sigset_ () -{ - ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set"); - - if (ss == 0) - ACE_OS::sigfillset (&this->sigset_); - else - this->sigset_ = ss->sigset_; -} - -ACE_INLINE int -ACE_Sig_Set::empty_set (void) -{ - ACE_TRACE ("ACE_Sig_Set::empty_set"); - return ACE_OS::sigemptyset (&this->sigset_); -} - -ACE_INLINE int -ACE_Sig_Set::fill_set (void) -{ - ACE_TRACE ("ACE_Sig_Set::fill_set"); - return ACE_OS::sigfillset (&this->sigset_); -} - -ACE_INLINE int -ACE_Sig_Set::sig_add (int signo) -{ - ACE_TRACE ("ACE_Sig_Set::sig_add"); - return ACE_OS::sigaddset (&this->sigset_, signo); -} - -ACE_INLINE int -ACE_Sig_Set::sig_del (int signo) -{ - ACE_TRACE ("ACE_Sig_Set::sig_del"); - return ACE_OS::sigdelset (&this->sigset_, signo); -} - -ACE_INLINE int -ACE_Sig_Set::is_member (int signo) const -{ - ACE_TRACE ("ACE_Sig_Set::is_member"); - return ACE_OS::sigismember (const_cast (&this->sigset_), signo); -} - -ACE_INLINE -ACE_Sig_Set::operator sigset_t *(void) -{ - ACE_TRACE ("ACE_Sig_Set::operator sigset_t *"); - return &this->sigset_; -} - -ACE_INLINE sigset_t -ACE_Sig_Set::sigset (void) const -{ - ACE_TRACE ("ACE_Sig_Set::sigset"); - return this->sigset_; -} - -ACE_INLINE int -ACE_Sig_Action::flags (void) -{ - ACE_TRACE ("ACE_Sig_Action::flags"); - return this->sa_.sa_flags; -} - -ACE_INLINE void -ACE_Sig_Action::flags (int flags) -{ - ACE_TRACE ("ACE_Sig_Action::flags"); - this->sa_.sa_flags = flags; -} - -ACE_INLINE sigset_t * -ACE_Sig_Action::mask (void) -{ - ACE_TRACE ("ACE_Sig_Action::mask"); - return &this->sa_.sa_mask; -} - -ACE_INLINE void -ACE_Sig_Action::mask (sigset_t *ss) -{ - ACE_TRACE ("ACE_Sig_Action::mask"); - if (ss != 0) - this->sa_.sa_mask = *ss; // Structure assignment -} - -ACE_INLINE void -ACE_Sig_Action::mask (ACE_Sig_Set &ss) -{ - ACE_TRACE ("ACE_Sig_Action::mask"); - this->sa_.sa_mask = ss.sigset (); // Structure assignment -} - -ACE_INLINE ACE_SignalHandler -ACE_Sig_Action::handler (void) -{ - ACE_TRACE ("ACE_Sig_Action::handler"); - return ACE_SignalHandler (this->sa_.sa_handler); -} - -ACE_INLINE void -ACE_Sig_Action::handler (ACE_SignalHandler handler) -{ - ACE_TRACE ("ACE_Sig_Action::handler"); -#if !defined(ACE_HAS_TANDEM_SIGNALS) - this->sa_.sa_handler = ACE_SignalHandlerV (handler); -#else - this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (handler); -#endif /* !ACE_HAS_TANDEM_SIGNALS */ -} - -#if 0 -ACE_INLINE ACE_SignalHandler -ACE_Sig_Action::sigaction (void) -{ - ACE_TRACE ("ACE_Sig_Action::sigaction"); - return ACE_SignalHandler (this->sa_.sa_sigaction); -} - -ACE_INLINE void -ACE_Sig_Action::sigaction (ACE_SignalHandler handler) -{ - ACE_TRACE ("ACE_Sig_Action::sigaction"); - this->sa_.sa_sigaction = (void (*)()) ACE_SignalHandlerV (handler); -} -#endif /* 0 */ - -ACE_INLINE void -ACE_Sig_Action::set (struct sigaction *sa) -{ - ACE_TRACE ("ACE_Sig_Action::set"); - this->sa_ = *sa; // Structure assignment. -} - -ACE_INLINE struct sigaction * -ACE_Sig_Action::get (void) -{ - ACE_TRACE ("ACE_Sig_Action::get"); - return &this->sa_; -} - -ACE_INLINE -ACE_Sig_Action::operator struct sigaction * () -{ - ACE_TRACE ("ACE_Sig_Action::operator struct sigaction *"); - return &this->sa_; -} - -ACE_INLINE -ACE_Sig_Action::ACE_Sig_Action (const ACE_Sig_Action &s) - // : sa_ () -{ - ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action"); - *this = s; // structure copy. -} - -ACE_INLINE int -ACE_Sig_Action::register_action (int signum, ACE_Sig_Action *oaction) -{ - ACE_TRACE ("ACE_Sig_Action::register_action"); - struct sigaction *sa = oaction == 0 ? 0 : oaction->get (); - - return ACE_OS::sigaction (signum, &this->sa_, sa); -} - -ACE_INLINE int -ACE_Sig_Action::retrieve_action (int signum) -{ - ACE_TRACE ("ACE_Sig_Action::retrieve_action"); - return ACE_OS::sigaction (signum, 0, &this->sa_); -} - -ACE_INLINE int -ACE_Sig_Action::restore_action (int signum, ACE_Sig_Action &oaction) -{ - ACE_TRACE ("ACE_Sig_Action::restore_action"); - this->sa_ = *oaction.get (); // Structure assignment - return ACE_OS::sigaction (signum, &this->sa_, 0); -} - -// Block out the signal MASK until the destructor is called. - -ACE_INLINE -ACE_Sig_Guard::ACE_Sig_Guard (ACE_Sig_Set *mask, - bool condition) - : omask_ () - , condition_ (condition) -{ - //ACE_TRACE ("ACE_Sig_Guard::ACE_Sig_Guard"); - if (!this->condition_) - return; - -#if defined (ACE_LACKS_UNIX_SIGNALS) - ACE_UNUSED_ARG (mask); -#else - // If MASK is 0 then block all signals! - if (mask == 0) - { -# if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) - ACE_OS::sigprocmask (SIG_BLOCK, - ACE_OS_Object_Manager::default_mask (), - (sigset_t *) this->omask_); -# else - ACE_OS::thr_sigsetmask (SIG_BLOCK, - ACE_OS_Object_Manager::default_mask (), - (sigset_t *) this->omask_); -# endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */ - } - else -# if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) - ACE_OS::sigprocmask (SIG_BLOCK, - (sigset_t *) *mask, - (sigset_t *) - this->omask_); -# else - ACE_OS::thr_sigsetmask (SIG_BLOCK, - (sigset_t *) *mask, - (sigset_t *) - this->omask_); -# endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */ -#endif /* ACE_LACKS_UNIX_SIGNALS */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Singleton.h b/dep/include/ace/Singleton.h deleted file mode 100644 index 2d9c8e937ef..00000000000 --- a/dep/include/ace/Singleton.h +++ /dev/null @@ -1,328 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Singleton.h - * - * $Id: Singleton.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @brief - * - * @author Tim Harrison - * @author Douglas C. Schmidt - * @author Chris Lahey - * @author Rich Christy - * @author David Levine - */ -//============================================================================= - -#ifndef ACE_SINGLETON_H -#define ACE_SINGLETON_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" -#include "ace/TSS_T.h" -#include "ace/Cleanup.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Singleton - * - * @brief A Singleton Adapter uses the Adapter pattern to turn ordinary - * classes into Singletons optimized with the Double-Checked - * Locking optimization pattern. - * - * This implementation is a slight variation on the GoF - * Singleton pattern. In particular, a single - * > instance is allocated here, - * not a instance. The reason for this is to allow - * registration with the ACE_Object_Manager, so that the - * Singleton can be cleaned up when the process exits. For this - * scheme to work, a (static) cleanup() function must be - * provided. ACE_Singleton provides one so that TYPE doesn't - * need to. - * If you want to make sure that only the singleton instance of - * is created, and that users cannot create their own - * instances of , do the following to class : - * (a) Make the constructor of private (or protected) - * (b) Make Singleton a friend of - * Here is an example: - * @verbatim - * class foo - * { - * friend class ACE_Singleton; - * private: - * foo () { cout << "foo constructed" << endl; } - * ~foo () { cout << "foo destroyed" << endl; } - * }; - * typedef ACE_Singleton FOO; - * @endverbatim - * - * @note The best types to use for ACE_LOCK are - * ACE_Recursive_Thread_Mutex and ACE_Null_Mutex. - * ACE_Recursive_Thread_Mutex should be used in multi-threaded - * programs in which it is possible for more than one thread to - * access the > instance. - * ACE_Null_Mutex can be used otherwise. The reason that these - * types of locks are best has to do with their allocation by - * the ACE_Object_Manager. Single ACE_Recursive_Thread_Mutex - * and ACE_Null_Mutex instances are used for all ACE_Singleton - * instantiations. However, other types of locks are allocated - * per ACE_Singleton instantiation. - */ -template -class ACE_Singleton : public ACE_Cleanup -{ -public: - /// Global access point to the Singleton. - static TYPE *instance (void); - - /// Cleanup method, used by to destroy the - /// ACE_Singleton. - virtual void cleanup (void *param = 0); - - /// Dump the state of the object. - static void dump (void); - -protected: - /// Default constructor. - ACE_Singleton (void); - - /// Contained instance. - TYPE instance_; - -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - /// Pointer to the Singleton (ACE_Cleanup) instance. - static ACE_Singleton *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ - - /// Get pointer to the Singleton instance. - static ACE_Singleton *&instance_i (void); -}; - -/** - * @class ACE_Unmanaged_Singleton - * - * @brief Same as ACE_Singleton, except does _not_ register with - * ACE_Object_Manager for destruction. - * - * This version of ACE_Singleton can be used if, for example, - * its DLL will be unloaded before the ACE_Object_Manager - * destroys the instance. Unlike with ACE_Singleton, the - * application is responsible for explicitly destroying the - * instance after it is no longer needed (if it wants to avoid - * memory leaks, at least). The close() static member function - * must be used to explicitly destroy the Singleton. - * Usage is the same as for ACE_Singleton, but note that if you - * you declare a friend, the friend class must still be an - * *ACE_Singleton*, not an ACE_Unmanaged_Singleton. - */ -template -class ACE_Unmanaged_Singleton : public ACE_Singleton -{ -public: - /// Global access point to the Singleton. - static TYPE *instance (void); - - /// Explicitly delete the Singleton instance. - static void close (void); - - /// Dump the state of the object. - static void dump (void); - -protected: - /// Default constructor. - ACE_Unmanaged_Singleton (void); - -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - /// Pointer to the Singleton (ACE_Cleanup) instance. - static ACE_Unmanaged_Singleton *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ - - /// Get pointer to the Singleton instance. - static ACE_Unmanaged_Singleton *&instance_i (void); -}; - -/** - * @class ACE_TSS_Singleton - * - * @brief This class uses the Adapter pattern to turn ordinary classes - * into Thread-specific Singletons optimized with the - * Double-Checked Locking optimization pattern. - * - * This implementation is another variation on the GoF Singleton - * pattern. In this case, a single > instance is allocated here, not a instance. - * Each call to the static method returns a Singleton - * whose pointer resides in thread-specific storage. As with - * ACE_Singleton, we use the ACE_Object_Manager so that the - * Singleton can be cleaned up when the process exits. For this - * scheme to work, a (static) cleanup() function must be - * provided. ACE_Singleton provides one so that TYPE doesn't - * need to. - */ -template -class ACE_TSS_Singleton : public ACE_Cleanup -{ -public: - /// Global access point to the singleton. - static TYPE *instance (void); - - /// Cleanup method, used by to destroy the - /// singleton. - virtual void cleanup (void *param = 0); - - /// Dump the state of the object. - static void dump (void); - -protected: - /// Default constructor. - ACE_TSS_Singleton (void); - - /// Contained instance. - ACE_TSS_TYPE (TYPE) instance_; - - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_TSS_Singleton &)) - ACE_UNIMPLEMENTED_FUNC (ACE_TSS_Singleton (const ACE_TSS_Singleton &)) - -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - /// Pointer to the Singleton (ACE_Cleanup) instance. - static ACE_TSS_Singleton *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ - - /// Get pointer to the TSS Singleton instance. - static ACE_TSS_Singleton *&instance_i (void); -}; - -/** - * @class ACE_Unmanaged_TSS_Singleton - * - * @brief Same as ACE_TSS_Singleton, except does _not_ register with - * ACE_Object_Manager for destruction. - * - * This version of ACE_TSS_Singleton can be used if, for example, its DLL will - * be unloaded before the ACE_Object_Manager destroys the instance. Unlike with - * ACE_Singleton, the application is responsible for explicitly destroying the - * instance after it is no longer needed (if it wants to avoid memory leaks, - * at least). The close() static member function must be used to explicitly - * destroy the Singleton. - */ -template -class ACE_Unmanaged_TSS_Singleton : public ACE_TSS_Singleton -{ -public: - /// Global access point to the singleton. - static TYPE *instance (void); - - /// Explicitly delete the singleton instance. - static void close (void); - - /// Dump the state of the object. - static void dump (void); - -protected: - /// Default constructor. - ACE_Unmanaged_TSS_Singleton (void); - -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - /// Pointer to the Singleton (ACE_Cleanup) instance. - static ACE_Unmanaged_TSS_Singleton *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ - - /// Get pointer to the Singleton instance. - static ACE_Unmanaged_TSS_Singleton *&instance_i (void); -}; - -/** - * @class ACE_DLL_Singleton_T - * - * @brief Same as ACE_Singleton, except that it registers for - * destruction with the ACE_Framework_Repository instead of - * with the ACE_Object_Manager directly. - * - * This version of ACE_Singleton should be used for singletons - * that live in a dll loaded either directly by ACE_DLL or indirectly - * by the ACE Service Configuration framework. Whenever ACE_DLL is ready - * to actually unload the dll, ACE_DLL_Singleton based dlls associated - * with that dll will be destroyed first. In fact, any singleton can - * safely use ACE_DLL_Singleton, even those that don't live in dlls. In - * that case, the singleton will be destroyed at normal program shutdown. - * - * The only additional requirement is that the contained class - * export name() and dll_name() methods. See ACE_DLL_Singleton_Adapter_T - * below for a convenient example of how to satisfy this - * requirement for the dll_name(). - * - * Usage is the same as for ACE_Singleton, but note that if you - * you declare a friend, the friend class must still be an - * *ACE_Singleton*, not an ACE_Unmanaged_Singleton. - */ -template -class ACE_DLL_Singleton_T -{ -public: - //void cleanup (void *param = 0); - - /// Global access point to the Singleton. - static TYPE *instance (void); - - /// Explicitly delete the Singleton instance. - static void close (void); - - static void close_singleton (void); - - /// Dump the state of the object. - static void dump (void); - - const ACE_TCHAR *dll_name (void); - - const ACE_TCHAR *name (void); - -protected: - /// Default constructor. - ACE_DLL_Singleton_T (void); - - /// Destructor. - ~ACE_DLL_Singleton_T (void); - - /// Contained instance. - TYPE instance_; - -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - /// Pointer to the Singleton instance. - static ACE_DLL_Singleton_T *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ - - /// Get pointer to the singleton instance. - static ACE_DLL_Singleton_T *&instance_i (void); -}; - -template -class ACE_DLL_Singleton_Adapter_T : public TYPE -{ -public: - const ACE_TCHAR *dll_name (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Singleton.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Singleton.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Singleton.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_SINGLETON_H */ - diff --git a/dep/include/ace/Singleton.inl b/dep/include/ace/Singleton.inl deleted file mode 100644 index 107a8b78c6d..00000000000 --- a/dep/include/ace/Singleton.inl +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -// -// $Id: Singleton.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Default constructors. -// -// Note: don't explicitly initialize "instance_", because TYPE may not -// have a default constructor. Let the compiler figure it out . . . - -template ACE_INLINE -ACE_Singleton::ACE_Singleton (void) -{ -} - -template ACE_INLINE -ACE_Unmanaged_Singleton::ACE_Unmanaged_Singleton (void) -{ -} - -template ACE_INLINE -ACE_TSS_Singleton::ACE_TSS_Singleton (void) -{ -} - -template ACE_INLINE -ACE_Unmanaged_TSS_Singleton::ACE_Unmanaged_TSS_Singleton (void) -{ -} - -template ACE_INLINE -ACE_DLL_Singleton_T::ACE_DLL_Singleton_T (void) -{ -} - -template -ACE_DLL_Singleton_T::~ACE_DLL_Singleton_T (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Sock_Connect.h b/dep/include/ace/Sock_Connect.h deleted file mode 100644 index 195dfcdf116..00000000000 --- a/dep/include/ace/Sock_Connect.h +++ /dev/null @@ -1,108 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Sock_Connect.h - * - * $Id: Sock_Connect.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Priyanka Gontla - * @author Based on code that existed formerly in ACE.h. - */ -//========================================================================== - -#ifndef ACE_SOCK_CONNECT_H -#define ACE_SOCK_CONNECT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Types.h" -#include "ace/os_include/netinet/os_in.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward Declarations -class ACE_INET_Addr; - -namespace ACE -{ - // = Socket connection establishment calls. - - /// Bind a new unused port to @a handle. - extern ACE_Export int bind_port (ACE_HANDLE handle, - ACE_UINT32 ip_addr = INADDR_ANY, - int address_family = AF_UNSPEC); - - /** - * Get our broadcast address based on our @a host_addr. If - * @a hostname is non-0 we'll use it to determine our IP address. If - * @a handle is not ACE_INVALID_HANDLE then we'll use this to - * determine our broadcast address, otherwise we'll have to create a - * socket internally (and free it). Returns -1 on failure and 0 on - * success. - */ - extern ACE_Export int get_bcast_addr ( - ACE_UINT32 &bcast_addr, - const ACE_TCHAR *hostname = 0, - ACE_UINT32 host_addr = 0, - ACE_HANDLE handle = ACE_INVALID_HANDLE); - - /// Get fully qualified host/domain name. - extern ACE_Export int get_fqdn (ACE_INET_Addr const & addr, - char hostname[], - size_t len); - - /** - * Return count and array of all configured IP interfaces on this - * host, rc = 0 on success (count == number of interfaces else -1). - * Caller is responsible for calling delete [] on @a addr_array. - */ - extern ACE_Export int get_ip_interfaces (size_t &count, - ACE_INET_Addr *&addr_array); - - /** - * Helper routine for get_ip_interfaces, differs by UNIX platform so - * put into own subroutine. perform some ioctls to retrieve ifconf - * list of ifreq structs. - */ - extern ACE_Export int count_interfaces (ACE_HANDLE handle, - size_t &how_many); - - /// Routine to return a handle from which @c ioctl requests can be - /// made. Caller must close the handle. - extern ACE_Export ACE_HANDLE get_handle (void); - - /// Returns @c true if IPv4 is enabled on the current host; @c false - /// if not. - /** - * This is an execution-time check. If ACE has not been compiled - * with @c ACE_HAS_IPV6, it always returns @c true. This function - * tries to create a @c PF_INET socket, returning @c true if it - * succeeds, and @c false if it fails. Caches the result so it only - gets checked once. - */ - extern ACE_Export bool ipv4_enabled (void); - - /** - * Returns 1 if IPv6 is enabled on the current host; 0 if not. - * This is an execution-time check. If ACE has not been compiled - * with ACE_HAS_IPV6, it always returns 0. If ACE_HAS_IPV6 is - * enabled, this function tries to create a PF_INET6 socket, - * returning 1 if it succeeds, and 0 if it fails. Caches the result - * so it only gets checked once. - */ - extern ACE_Export int ipv6_enabled (void); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SOCK_CONNECT_H */ - diff --git a/dep/include/ace/Stack_Trace.h b/dep/include/ace/Stack_Trace.h deleted file mode 100644 index b2fc0174ab6..00000000000 --- a/dep/include/ace/Stack_Trace.h +++ /dev/null @@ -1,108 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Stack_Trace.h - * - * $Id: Stack_Trace.h 81926 2008-06-12 14:43:09Z mitza $ - * - * @author Chris Cleeland (cleeland.ociweb.com) - */ -//============================================================================= - -#ifndef ACE_STACK_TRACE_H -#define ACE_STACK_TRACE_H - -#include /**/ "ace/pre.h" - -#include "ace/ACE_export.h" -#include "ace/Basic_Types.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -# ifndef ACE_STACK_TRACE_SYMBUFSIZ -# define ACE_STACK_TRACE_SYMBUFSIZ 4096 -# endif - -/** - * @class ACE_Stack_Trace - * - * @brief Encapsulate a string representation of a stack trace on supported platforms. - * Stack traces for code built with optimize=1 (or "Release" configs on Visual - * Studio) may be misleading (missng frames) due to inlining performed by the - * compiler, which is indepenent of the inline=0 / inline=1 build option and - * the __ACE_INLINE__ / ACE_NO_INLINE macros. - * - * A new conversion character, the question mark, was added to ACE_Log_Msg for stack - * trace logging. The %? conversion character was added as a convenience so that users - * need not instantiate an ACE_Stack_Trace instance solely for the purpose of printing - * it in an ACE logging message. The following are functionally equivalent: - * - * \code - * ACE_DEBUG((LM_DEBUG, "%?")); - * - * ACE_Stack_Trace st; - * ACE_DEBUG ((LM_DEBUG, "%s", st.c_str() )); - * \endcode - * - * These usage examples were shown in $ACE_ROOT/tests/Stack_Trace_Test.cpp. - * - * @note The stack trace functionality was currently supported on platforms: - * - Any platform using glibc as its runtime library, or where ACE_HAS_EXECINFO_H is defined - * (this covers Linux and Mac) and gcc version >= 3.3. - * - VxWorks, both kernel and RTP - * - Solaris - * - Windows 32 and 64 bit (Visual C++, excluding WinCE/mobile) - * - * @note Since stack trace buffer size has limitation(@c ACE_STACK_TRACE_SYMBUFSIZ), you will not - * get a complete stack trace if @c ACE_STACK_TRACE_SYMBUFSIZ value is less than actual stack - * trace data length. To get a complete stack trace, you need set @c ACE_STACK_TRACE_SYMBUFSIZ - * with a larger value that is enough for the stack trace data in your @c config.h file - * and rebuild ACE. - * - * @note Using ACE logging mechanism (%?) to log the stack trace also has ACE_MAXLOGMSGLEN size limitation. - * To get a complete stack trace, you could use different output method. Following is an example. - * - * \code - * ACE_Stack_Trace st; - * ACE_OS::printf("at [%s]\n", st.c_str()); - * \endcode - */ -class ACE_Export ACE_Stack_Trace -{ -public: - /** - * @brief Grab a snapshot of the current stack trace and hold it for later use. - * - * @param starting_frame_offset offset into the array of frames to start printing; 0 is the - * platform-specific offset for the first frame, positive numbers give less frames, negative give - * more frames - * @param num_frames the number of stack frames to include (0 indicates platform-specific maximum) - * - */ - explicit ACE_Stack_Trace (ssize_t starting_frame_offset = 0, size_t num_frames = 0); - - /** - * @brief Return buffer as a C-style string. - * @return C-style string with string representation of stack trace. - * @note Lifecycle of string follows lifecycle of ACE_Stack_Trace instance. - */ - const char* c_str() const; - - static const size_t SYMBUFSIZ = ACE_STACK_TRACE_SYMBUFSIZ; - -private: - char buf_[SYMBUFSIZ]; - size_t buflen_; - - static const char UNSUPPORTED[]; - static const char UNABLE_TO_GET_TRACE[]; - - void generate_trace (ssize_t starting_frame_offset, size_t num_frames); -}; - -#include /**/ "ace/post.h" -#endif /* ACE_STACK_TRACE_H */ - - diff --git a/dep/include/ace/Static_Object_Lock.h b/dep/include/ace/Static_Object_Lock.h deleted file mode 100644 index c1d533552cb..00000000000 --- a/dep/include/ace/Static_Object_Lock.h +++ /dev/null @@ -1,79 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Static_Object_Lock.h - * - * $Id: Static_Object_Lock.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author David L. Levine - * @author Matthias Kerkhoff - * @author Per Andersson - */ -//============================================================================= - -#ifndef ACE_STATIC_OBJECT_LOCK_H -#define ACE_STATIC_OBJECT_LOCK_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Recursive_Thread_Mutex; - -/** - * @class ACE_Static_Object_Lock - * - * @brief Provide an interface to access a global lock. - * - * This class is used to serialize the creation of static - * singleton objects. It really isn't needed any more, because - * anyone can access ACE_STATIC_OBJECT_LOCK directly. But, it - * is retained for backward compatibility. - */ -class ACE_Export ACE_Static_Object_Lock -{ -public: - /// Static lock access point. - static ACE_Recursive_Thread_Mutex *instance (void); - - /// For use only by ACE_Object_Manager to clean up lock if it - /// what dynamically allocated. - static void cleanup_lock (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -// hack to get around errors while compiling using split-cpp -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_IS_SPLITTING) -typedef ACE_Cleanup_Adapter ACE_Static_Object_Lock_Type; - -# if defined (__GNUC__) -// With g++, suppress the warning that this is unused. -static ACE_Static_Object_Lock_Type *ACE_Static_Object_Lock_lock __attribute__ ((unused)) = 0; -# else -static ACE_Static_Object_Lock_Type *ACE_Static_Object_Lock_lock = 0; -# endif /* __GNUC__ */ - -# endif /* ACE_IS_SPLITTING */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_STATIC_OBJECT_LOCK_H */ - diff --git a/dep/include/ace/Stats.h b/dep/include/ace/Stats.h deleted file mode 100644 index 3d1d2be7f69..00000000000 --- a/dep/include/ace/Stats.h +++ /dev/null @@ -1,222 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Stats.h - * - * $Id: Stats.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author David L. Levine - */ -//========================================================================== - -#ifndef ACE_STATS_H -#define ACE_STATS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Unbounded_Queue.h" -#include "ace/Log_Msg.h" -#include "ace/Basic_Stats.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Stats_Value - * - * @brief Helper class for ACE_Stats. - * - * Container struct for 64-bit signed quantity and its - * precision. It would be nicer to use a fixed-point class, but - * this is sufficient. Users typically don't need to use this - * class directly; see ACE_Stats below. - */ -class ACE_Export ACE_Stats_Value -{ -public: - /** - * Constructor, which requires precision in terms of number of - * decimal digits. The more variation in the data, and the greater - * the data values, the smaller the precision must be to avoid - * overflow in the standard deviation calculation. 3 might be a - * good value, or maybe 4. 5 will probably be too large for - * non-trivial data sets. - */ - ACE_Stats_Value (const u_int precision); - - /// Accessor for precision. - u_int precision (void) const; - - /// Set the whole_ field. - void whole (const ACE_UINT32); - - /// Accessor for the whole_ field. - ACE_UINT32 whole (void) const; - - /// Set the fractional_ field. - void fractional (const ACE_UINT32); - - /// Accessor for the fractional_ field. - ACE_UINT32 fractional (void) const; - - /// Calculates the maximum value of the fractional portion, given its - /// precision. - ACE_UINT32 fractional_field (void) const; - - /** - * Access the value as an _unsigned_ 64 bit quantity. It scales the - * value up by {precision} decimal digits, so that no precision will - * be lost. It assumes that {whole_} is >= 0. - */ - void scaled_value (ACE_UINT64 &) const; - - /// Print to stdout. - void dump (void) const; - -private: - - ACE_Stats_Value (void) {} - -private: - /// The integer portion of the value. - ACE_UINT32 whole_; - - /// The fractional portion of the value. - ACE_UINT32 fractional_; - - /** - * The number of decimal digits of precision represented by - * {fractional_}. Not declared const, so the only way to change it - * is via the assignment operator. - */ - u_int precision_; - -}; - -/** - * @class ACE_Stats - * - * @brief Provides simple statistical analysis. - * - * Simple statistical analysis package. Prominent features are: - * -# It does not use any floating point arithmetic. - * -# It handles positive and/or negative sample values. The - * sample value type is ACE_INT32. - * -# It uses 64 bit unsigned, but not 64 bit signed, quantities - * internally. - * -# It checks for overflow of internal state. - * -# It has no static variables of other than built-in types. - * - * Example usage: - * - * @verbatim - * ACE_Stats stats; - * for (u_int i = 0; i < n; ++i) - * { - * const ACE_UINT32 sample = ...; - * stats.sample (sample); - * } - * stats.print_summary (3); - * @endverbatim - */ -class ACE_Export ACE_Stats -{ -public: - /// Default constructor. - ACE_Stats (void); - - /// Provide a new sample. Returns 0 on success, -1 if it fails due - /// to running out of memory, or to rolling over of the sample count. - int sample (const ACE_INT32 value); - - /// Access the number of samples provided so far. - ACE_UINT32 samples (void) const; - - /// Value of the minimum sample provided so far. - ACE_INT32 min_value (void) const; - - /// Value of the maximum sample provided so far. - ACE_INT32 max_value (void) const; - - /** - * Access the mean of all samples provided so far. The fractional - * part is to the specified number of digits. E.g., 3 fractional - * digits specifies that the fractional part is in thousandths. - */ - void mean (ACE_Stats_Value &mean, - const ACE_UINT32 scale_factor = 1); - - /// Access the standard deviation, whole and fractional parts. See - /// description of {mean} method for argument descriptions. - int std_dev (ACE_Stats_Value &std_dev, - const ACE_UINT32 scale_factor = 1); - - /** - * Print summary statistics. If scale_factor is not 1, then the - * results are divided by it, i.e., each of the samples is scaled - * down by it. If internal overflow is reached with the specified - * scale factor, it successively tries to reduce it. Returns -1 if - * there is overflow even with a 0 scale factor. - */ - int print_summary (const u_int precision, - const ACE_UINT32 scale_factor = 1, - FILE * = stdout) const; - - /// Initialize internal state. - void reset (void); - - /// Utility division function, for ACE_UINT64 dividend. - static void quotient (const ACE_UINT64 dividend, - const ACE_UINT32 divisor, - ACE_Stats_Value "ient); - - /// Utility division function, for ACE_Stats_Value dividend. - static void quotient (const ACE_Stats_Value ÷nd, - const ACE_UINT32 divisor, - ACE_Stats_Value "ient); - - /** - * Sqrt function, which uses an oversimplified version of Newton's - * method. It's not fast, but it doesn't require floating point - * support. - */ - static void square_root (const ACE_UINT64 n, - ACE_Stats_Value &square_root); - - /// Print summary statistics to stdout. - void dump (void) const; - -protected: - /// Internal indication of whether there has been overflow. Contains - /// the errno corresponding to the cause of overflow. - u_int overflow_; - - /// Number of samples. - ACE_UINT32 number_of_samples_; - - /// Minimum sample value. - ACE_INT32 min_; - - /// Maximum sample value. - ACE_INT32 max_; - - /// The samples. - ACE_Unbounded_Queue samples_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/Stats.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ! ACE_STATS_H */ - diff --git a/dep/include/ace/Stats.inl b/dep/include/ace/Stats.inl deleted file mode 100644 index 4c76838c207..00000000000 --- a/dep/include/ace/Stats.inl +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- -// -// $Id: Stats.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Stats_Value::ACE_Stats_Value (const u_int precision) - : whole_ (0), - fractional_ (0), - precision_ (precision) -{ -} - -ACE_INLINE -u_int -ACE_Stats_Value::precision (void) const -{ - return precision_; -} - -ACE_INLINE -void -ACE_Stats_Value::whole (const ACE_UINT32 value) -{ - whole_ = value; -} - -ACE_INLINE -ACE_UINT32 -ACE_Stats_Value::whole (void) const -{ - return whole_; -} - -ACE_INLINE -void -ACE_Stats_Value::fractional (const ACE_UINT32 value) -{ - fractional_ = value; -} - -ACE_INLINE -ACE_UINT32 -ACE_Stats_Value::fractional (void) const -{ - return fractional_; -} - -ACE_INLINE -void -ACE_Stats_Value::scaled_value (ACE_UINT64 &sv) const -{ - sv = whole () * fractional_field () + fractional (); -} - -ACE_INLINE -void -ACE_Stats_Value::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("precision: %u digits; whole: %u, fractional: %u\n"), - precision_, whole_, fractional_)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_INLINE -ACE_Stats::ACE_Stats (void) -{ - reset (); -} - -ACE_INLINE -ACE_UINT32 -ACE_Stats::samples (void) const -{ - return number_of_samples_; -} - -ACE_INLINE -ACE_INT32 -ACE_Stats::min_value (void) const -{ - return min_; -} - -ACE_INLINE -ACE_INT32 -ACE_Stats::max_value (void) const -{ - return max_; -} - -ACE_INLINE -void -ACE_Stats::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - print_summary (3u); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Strategies.h b/dep/include/ace/Strategies.h deleted file mode 100644 index 0c31bc144c5..00000000000 --- a/dep/include/ace/Strategies.h +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Strategies.h - * - * $Id: Strategies.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_STRATEGIES_H -#define ACE_STRATEGIES_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Place holder for backward compatibility.. -#include "ace/Connection_Recycling_Strategy.h" -#include "ace/Hashable.h" -#include "ace/Notification_Strategy.h" -#include "ace/Reactor_Notification_Strategy.h" -#include "ace/Recyclable.h" -#include "ace/Refcountable.h" - -#include /**/ "ace/post.h" -#endif /*ACE_STRATEGIES_H*/ - diff --git a/dep/include/ace/Strategies_T.h b/dep/include/ace/Strategies_T.h deleted file mode 100644 index b962efc797f..00000000000 --- a/dep/include/ace/Strategies_T.h +++ /dev/null @@ -1,1076 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Strategies_T.h - * - * $Id: Strategies_T.h 81954 2008-06-15 13:24:16Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_STRATEGIES_T_H -#define ACE_STRATEGIES_T_H - -#include /**/ "ace/pre.h" - -#include "ace/Hash_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Reactor.h" -#include "ace/Thread_Manager.h" -#include "ace/Connection_Recycling_Strategy.h" -#include "ace/Refcountable.h" -#include "ace/Hashable.h" -#include "ace/Recyclable.h" -#include "ace/Reverse_Lock_T.h" - -// Needed for broken linkers that can't grok long symbols. -#define ACE_Refcounted_Hash_Recyclable ARHR - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Service_Repository; - -/** - * @class ACE_Recycling_Strategy - * - * @brief Defines the interface (and default implementation) for - * specifying a recycling strategy for a SVC_HANDLER. - * - * Acts as a consular to the Svc_Handler, preparing it for the - * tough times ahead when the Svc_Handler will be recycled. - */ -template -class ACE_Recycling_Strategy -{ -public: - - // Useful STL-style traits. - typedef typename SVC_HANDLER::addr_type addr_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - /// Virtual Destructor - virtual ~ACE_Recycling_Strategy (void); - - /// Tell the Svc_Handler something about the recycler, so that it can - /// reach the recycler when necessary. - virtual int assign_recycler (SVC_HANDLER *svc_handler, - ACE_Connection_Recycling_Strategy *recycler, - const void *recycling_act); - - /// This allows us to prepare the svc_handler for recycling. - virtual int prepare_for_recycling (SVC_HANDLER *svc_handler); -}; - -/** - * @class ACE_Creation_Strategy - * - * @brief Defines the interface for specifying a creation strategy for - * a SVC_HANDLER. - * - * The default behavior is to make a new SVC_HANDLER. However, - * subclasses can override this strategy to perform SVC_HANDLER - * creation in any way that they like (such as creating subclass - * instances of SVC_HANDLER, using a singleton, dynamically - * linking the handler, etc.). - */ -template -class ACE_Creation_Strategy -{ -public: - - // Useful STL-style traits. - typedef typename SVC_HANDLER::addr_type addr_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - // = Initialization and termination methods. - - /// Default constructor. - ACE_Creation_Strategy (ACE_Thread_Manager * = 0, - ACE_Reactor * = ACE_Reactor::instance ()); - - /// An ACE_Thread_Manager is useful when creating active objects and - /// the ACE_Reactor is used to initialize the service handler's reactor. - int open (ACE_Thread_Manager * = 0, - ACE_Reactor * = ACE_Reactor::instance ()); - - virtual ~ACE_Creation_Strategy (void); - - // = Factory method. - /** - * Create a SVC_HANDLER with the appropriate creation strategy. The - * default behavior of this method is to make a new SVC_HANDLER if - * @a sh == 0 (passing in the ), else @a sh is - * unchanged. Returns -1 on failure, else 0. - */ - virtual int make_svc_handler (SVC_HANDLER *&sh); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Pointer to a thread manager. - ACE_Thread_Manager *thr_mgr_; - - /// Pointer to an ACE_Reactor. - ACE_Reactor *reactor_; -}; - -/** - * @class ACE_Singleton_Strategy - * - * @brief Defines the interface for specifying a creation strategy for - * a SVC_HANDLER that always returns the same SVC_HANDLER (i.e., - * it's a Singleton). - * - * Note that this class takes over the ownership of the - * SVC_HANDLER passed into it as a parameter and it becomes - * responsible for deleting this object. - */ -template -class ACE_Singleton_Strategy : public ACE_Creation_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy base_type; - - // = Initialization and termination methods. - ACE_Singleton_Strategy (SVC_HANDLER * = 0, - ACE_Thread_Manager * = 0); - int open (SVC_HANDLER *, - ACE_Thread_Manager * = 0); - virtual ~ACE_Singleton_Strategy (void); - - // = Factory method. - /// Create a Singleton SVC_HANDLER by always returning the same - /// SVC_HANDLER. Returns -1 on failure, else 0. - virtual int make_svc_handler (SVC_HANDLER *&); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Pointer to the Singleton svc_handler. - SVC_HANDLER *svc_handler_; - - /// Keep track of whether we need to delete the SVC_HANDLER. - bool delete_svc_handler_; -}; - -/** - * @class ACE_DLL_Strategy - * - * @brief Defines the interface for specifying a creation strategy for - * a SVC_HANDLER based on dynamic linking of the SVC_HANDLER. - */ -template -class ACE_DLL_Strategy : public ACE_Creation_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy base_type; - - // = Intialization and termination methods. - - /// "Do-nothing" constructor. - ACE_DLL_Strategy (void); - - /// Initialize the DLL strategy based upon the service's DLL - /// information contained in the string. - ACE_DLL_Strategy (const ACE_TCHAR dll_name[], - const ACE_TCHAR factory_function[], - const ACE_TCHAR svc_name[], - ACE_Service_Repository *, - ACE_Thread_Manager * = 0); - - /// Initialize the DLL strategy based upon the service's DLL - /// information contained in the string. - int open (const ACE_TCHAR dll_name[], - const ACE_TCHAR factory_function[], - const ACE_TCHAR svc_name[], - ACE_Service_Repository *, - ACE_Thread_Manager * = 0); - - // = Factory method. - /// Create a SVC_HANDLER by dynamically linking it from a DLL. - /// Returns -1 on failure, else 0. - virtual int make_svc_handler (SVC_HANDLER *&); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - typedef ACE_Creation_Strategy inherited; - - /// Name of the DLL to dynamically link. - ACE_TCHAR dll_name_[MAXPATHLEN + 1]; - - /// Name of the factory function in the shared library to use to - /// obtain a pointer to the new SVC_HANDLER. - ACE_TCHAR factory_function_[MAXPATHLEN + 1]; - - /// Name of the service. - ACE_TCHAR svc_name_[MAXNAMELEN + 1]; - - /// Pointer to the . - ACE_Service_Repository *svc_rep_; -}; - -/** - * @class ACE_Concurrency_Strategy - * - * @brief Defines the interface for specifying a concurrency strategy - * for a SVC_HANDLER. - * - * Default behavior is to activate the SVC_HANDLER by calling - * its method (which allows the SVC_HANDLER to define its - * own concurrency strategy). However, subclasses can override - * this default strategy to do more sophisticated concurrency - * activations (such as creating the SVC_HANDLER as an active - * object via multi-threading or multi-processing). - */ -template -class ACE_Concurrency_Strategy -{ -public: - - // Useful STL-style traits. - typedef typename SVC_HANDLER::addr_type addr_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - /// Constructor - ACE_Concurrency_Strategy (int flags = 0); - - // = Factory method. - /** - * Activate the with an appropriate concurrency - * strategy. The default behavior of this method is to activate the - * SVC_HANDLER by calling its method (which allows the - * SVC_HANDLER to define its own concurrency strategy). - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler, - void *arg = 0); - - virtual ~ACE_Concurrency_Strategy (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - - /// Flags that are parsed to set options for the connected - /// SVC_HANDLER. - int flags_; -}; - -/** - * @class ACE_Reactive_Strategy - * - * @brief Defines the interface for specifying a reactive concurrency - * strategy for a SVC_HANDLER, where all upcalls to @c handle_*() - * methods run in the reactor's thread of control. - * - * This class provides a strategy that registers the - * SVC_HANDLER with a . - */ -template -class ACE_Reactive_Strategy : public ACE_Concurrency_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Concurrency_Strategy base_type; - - // = Intialization and termination methods. - /// "Do-nothing constructor" - ACE_Reactive_Strategy (int flags = 0); - - /// Initialize the strategy. - ACE_Reactive_Strategy (ACE_Reactor *reactor, - ACE_Reactor_Mask = ACE_Event_Handler::READ_MASK, - int flags = 0); - - /// Initialize the strategy. - virtual int open (ACE_Reactor *reactor, - ACE_Reactor_Mask = ACE_Event_Handler::READ_MASK, - int flags = 0); - - /// Destructor. - virtual ~ACE_Reactive_Strategy (void); - - // = Factory method. - /// Activate the by registering it with the - /// and then calling it's hook. - virtual int activate_svc_handler (SVC_HANDLER *svc_handler, - void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - typedef ACE_Concurrency_Strategy inherited; - - /// Pointer to the Reactor we'll use to register the SVC_HANDLER. - ACE_Reactor *reactor_; - - /// The mask that we pass to the when we register the - /// SVC_HANDLER. - ACE_Reactor_Mask mask_; -}; - -/** - * @class ACE_Thread_Strategy - * - * @brief Defines the interface for specifying a concurrency strategy - * for a SVC_HANDLER based on multithreading. - * - * This class provides a strategy that manages the creation of threads - * to handle requests from clients concurrently via a - * thread-per-connection model. It behaves as a "thread factory", - * spawning threads "on-demand" to run the service specified by a - * user-supplied SVC_HANDLER. - */ -template -class ACE_Thread_Strategy : public ACE_Concurrency_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Concurrency_Strategy base_type; - - // = Intialization and termination methods. - /// "Do-nothing constructor" - ACE_Thread_Strategy (int flags = 0); - - /// Initialize the strategy. - ACE_Thread_Strategy (ACE_Thread_Manager *tm, - long thr_flags, - int n_threads = 1, - int flags = 0); - - /// Initialize the strategy. - virtual int open (ACE_Thread_Manager *tm, - long thr_flags, - int n_threads = 1, - int flags = 0); - - virtual ~ACE_Thread_Strategy (void); - - // = Factory method. - /** - * Activate the @a svc_handler with an appropriate concurrency - * strategy. This method activates the SVC_HANDLER by first calling - * its method and then calling its method to turn - * it into an active object. - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler, - void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - typedef ACE_Concurrency_Strategy inherited; - - /// Thread manager for this class (must be provided). - ACE_Thread_Manager *thr_mgr_; - - /// Flags to pass into the method. - long thr_flags_; - - /// Number of threads to spawn. - int n_threads_; -}; - -/** - * @class ACE_Process_Strategy - * - * @brief Defines the interface for specifying a concurrency strategy - * for a @c SVC_HANDLER based on multiprocessing. - * - * This class provides a strategy that manages the creation of - * processes to handle requests from clients concurrently using a - * process-per-connection model. It behaves as a "process factory", - * using @c ACE::fork() to fork threads "on-demand" to run the service - * specified by a user-supplied @c SVC_HANDLER in a separate process. - */ -template -class ACE_Process_Strategy : public ACE_Concurrency_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Concurrency_Strategy base_type; - - // = Intialization and termination methods. - - /// Initialize the strategy. If @a avoid_zombies is non-0 then set a - /// flag to ACE::fork() to avoid zombies. - ACE_Process_Strategy (size_t n_processes = 1, - ACE_Event_Handler *acceptor = 0, - ACE_Reactor * = 0, - int avoid_zombies = 0); - - /// Initialize the strategy. If @a avoid_zombies is non-0 then set a - /// flag to ACE::fork() to avoid zombies. - virtual int open (size_t n_processes = 1, - ACE_Event_Handler *acceptor = 0, - ACE_Reactor * = 0, - int avoid_zombies = 0); - - virtual ~ACE_Process_Strategy (void); - - // = Factory method. - /** - * Activate the @a svc_handler with an appropriate concurrency - * strategy. This method activates the SVC_HANDLER by first forking - * and then calling the @c open() method of the SVC_HANDLER in the - * child. - */ - virtual int activate_svc_handler (SVC_HANDLER *svc_handler, - void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - typedef ACE_Concurrency_Strategy inherited; - - /// Number of processes to spawn. - size_t n_processes_; - - /** - * This is the @c Acceptor in the parent is listening on. We need to - * make sure that we remove it from the Reactor and close it down in - * the child. - */ - ACE_Event_Handler *acceptor_; - - /** - * This is the reactor the child is using in conjunction with the - * acceptor. We need to remove the acceptor from this reactor - * in the child. - */ - ACE_Reactor *reactor_; -}; - -/** - * @class ACE_Accept_Strategy - * - * @brief Defines the interface for specifying a passive connection - * acceptance strategy for a SVC_HANDLER. - * - * This class provides a strategy that manages passive - * connection acceptance of a client. - */ -template -class ACE_Accept_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_PEER_ACCEPTOR_ADDR addr_type; - typedef ACE_PEER_ACCEPTOR acceptor_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - // = Initialization and termination methods. - /// Default constructor. - ACE_Accept_Strategy (ACE_Reactor *reactor = ACE_Reactor::instance ()); - - /// Initialize the @c peer_acceptor_ with @a local_addr. - ACE_Accept_Strategy (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - int restart = 0, - ACE_Reactor *reactor = ACE_Reactor::instance ()); - - /// Initialize the with @a local_addr, indicating - /// whether to @a reuse_addr if it's already in use. - virtual int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - int reuse_addr = 0); - - /// Return the underlying ACE_HANDLE of the . - virtual ACE_HANDLE get_handle (void) const; - - /// Return a reference to the . - virtual ACE_PEER_ACCEPTOR &acceptor (void) const; - - virtual ~ACE_Accept_Strategy (void); - - // = Factory method. - /// The default behavior delegates to the method of the - /// PEER_ACCEPTOR. - virtual int accept_svc_handler (SVC_HANDLER *); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Factory that establishes connections passively. - ACE_PEER_ACCEPTOR peer_acceptor_; - - /// Pointer to the reactor used by the Acceptor. - ACE_Reactor *reactor_; - - /// Needed to reopen the socket if fails. - int reuse_addr_; - - /// Needed to reopen the socket if fails. - ACE_PEER_ACCEPTOR_ADDR peer_acceptor_addr_; -}; - -/** - * @class ACE_Connect_Strategy - * - * @brief Defines the interface for specifying an active - * connection establishment strategy for a SVC_HANDLER. - * - * This class provides a strategy that manages active - * connection establishment to a server. - */ -template -class ACE_Connect_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_PEER_CONNECTOR_ADDR addr_type; - typedef ACE_PEER_CONNECTOR connector_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - // = Initialization and termination methods. - /// Default constructor. - ACE_Connect_Strategy (void); - - /// Return a reference to the . - virtual ACE_PEER_CONNECTOR &connector (void) const; - - virtual ~ACE_Connect_Strategy (void); - - // = Factory method. - /// The default behavior delegates to the method of the - /// . - virtual int connect_svc_handler (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /** - * The default behavior delegates to the method of the - * . - * Please check the documentation in Connector.h for more details. - */ - virtual int connect_svc_handler (SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Factory that establishes connections actively. - ACE_PEER_CONNECTOR connector_; -}; - -/** - * @class ACE_Scheduling_Strategy - * - * @brief Defines the interface for specifying how to suspend and - * resume a service . - * - * This class provides a strategy that allows arbitrarily - * sophisticated service suspension and resumption. The default - * behavior is to do nothing... - */ -template -class ACE_Scheduling_Strategy -{ -public: - - // Useful STL-style traits. - typedef typename SVC_HANDLER::addr_type addr_type; - typedef SVC_HANDLER handler_type; - typedef typename SVC_HANDLER::stream_type stream_type; - - // = Initialization and termination methods. - - /// Constructor - ACE_Scheduling_Strategy (SVC_HANDLER * = 0); - - /// Destructor - virtual ~ACE_Scheduling_Strategy (void); - - // = Scheduling methods - - /// Suspend hook. - virtual int suspend (void); - - /// Resume hook. - virtual int resume (void); - - /// Dump the state of the object. - virtual void dump (void) const; -}; - -/** - * @class ACE_Schedule_All_Reactive_Strategy - * - * @brief Defines the interface for specifying how to suspend and - * resume a single-threaded reactive service . - * - * This class provides a strategy that suspends and resumes all - * the Event_Handlers in a Reactor in one fell swoop. - */ -template -class ACE_Schedule_All_Reactive_Strategy - : public ACE_Scheduling_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Scheduling_Strategy base_type; - - // = Initialization and termination methods. - /// Constructor - ACE_Schedule_All_Reactive_Strategy (SVC_HANDLER * = 0); - - // = Scheduling methods - - /// Suspend hook. - virtual int suspend (void); - - /// Resume hook. - virtual int resume (void); - - /// Dump the state of the object. - virtual void dump (void) const; - -protected: - - /// Reactor - ACE_Reactor *reactor_; -}; - -/** - * @class ACE_Schedule_All_Threaded_Strategy - * - * @brief Defines the interface for specifying how to suspend and - * resume a multithreaded service . - * - * This class provides a strategy that suspends and resumes all - * the Event_Handlers controlled by a Thread_Manager in one fell swoop. - */ -template -class ACE_Schedule_All_Threaded_Strategy - : public ACE_Scheduling_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Scheduling_Strategy base_type; - - // = Initialization and termination methods. - /// Constructor - ACE_Schedule_All_Threaded_Strategy (SVC_HANDLER * = 0); - - // = Scheduling methods - - /// Suspend hook. - virtual int suspend (void); - - /// Resume hook. - virtual int resume (void); - - /// Dump the state of the object. - virtual void dump (void) const; - -protected: - - /// Thread Manager - ACE_Thread_Manager *thr_mgr_; -}; - -/** - * @class ACE_NOOP_Creation_Strategy - * - * @brief Implements a no-op creation strategy in order to defer - * decisions regarding creation to some later point in time, such - * as in connect or accept strategy. - * - * An example of the use of this is in the - * ACE_Cached_Connect_Strategy, which only returns a single - * connection for a given endpoint. - */ -template -class ACE_NOOP_Creation_Strategy : public ACE_Creation_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy base_type; - - /// This is a no-op. - virtual int make_svc_handler (SVC_HANDLER *&); -}; - -/** - * @class ACE_NOOP_Concurrency_Strategy - * - * @brief Implements a no-op activation strategy in order to avoid - * calling open on a svc_handler multiple times. - * - * An example of the use of this is in the - * ACE_Cached_Connect_Strategy, which reuses svc_handlers. - * Therefore we don't want to call open on the recycled - * svc_handler more than once. - */ -template -class ACE_NOOP_Concurrency_Strategy - : public ACE_Concurrency_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Concurrency_Strategy base_type; - - // = Factory method. - /// This is a no-op. - virtual int activate_svc_handler (SVC_HANDLER *svc_handler, - void *arg = 0); -}; - -template -class ACE_Refcounted_Hash_Recyclable : public ACE_Refcountable, - public ACE_Hashable, - public ACE_Recyclable -{ -public: - /// Default constructor. - ACE_Refcounted_Hash_Recyclable (void); - - /// Constructor. - ACE_Refcounted_Hash_Recyclable (const T &t, - long refcount = 0, - ACE_Recyclable_State state = ACE_RECYCLABLE_UNKNOWN); - - /// Destructor - virtual ~ACE_Refcounted_Hash_Recyclable (void); - - /// Compares two instances. - bool operator== (const ACE_Refcounted_Hash_Recyclable &rhs) const; - bool operator!= (const ACE_Refcounted_Hash_Recyclable &rhs) const; - - T &subject (); - -protected: - /// Computes and returns hash value. - u_long hash_i (void) const; - - T t_; -}; - -/** - * @class ACE_Cached_Connect_Strategy - * - * @brief A connection strategy which caches connections to peers - * (represented by SVC_HANDLER instances), thereby allowing - * subsequent re-use of unused, but available, connections. - * - * is intended to be used as a - * plug-in connection strategy for ACE_Strategy_Connector. - * It's added value is re-use of established connections. - */ -template -class ACE_Cached_Connect_Strategy - : public ACE_Connection_Recycling_Strategy, - public ACE_Connect_Strategy -{ -public: - - // Useful STL-style traits. - typedef ACE_Creation_Strategy - creation_strategy_type; - typedef ACE_Connect_Strategy - connect_strategy_type; - typedef ACE_Concurrency_Strategy - concurrency_strategy_type; - typedef ACE_Recycling_Strategy recycling_strategy_type; - - // = Define some useful (old style) traits. - typedef ACE_Creation_Strategy - CREATION_STRATEGY; - typedef ACE_Concurrency_Strategy - CONCURRENCY_STRATEGY; - typedef ACE_Recycling_Strategy - RECYCLING_STRATEGY; - - // = Super class - typedef ACE_Connect_Strategy - CONNECT_STRATEGY; - - typedef ACE_Cached_Connect_Strategy SELF; - - /// Constructor - ACE_Cached_Connect_Strategy (ACE_Creation_Strategy *cre_s = 0, - ACE_Concurrency_Strategy *con_s = 0, - ACE_Recycling_Strategy *rec_s = 0, - MUTEX *mutex = 0, - bool delete_lock = false); - - /// Destructor - virtual ~ACE_Cached_Connect_Strategy (void); - - /// This methods allow you to change the strategies used by the - /// cached connector. - virtual int open (ACE_Creation_Strategy *cre_s, - ACE_Concurrency_Strategy *con_s, - ACE_Recycling_Strategy *rec_s); - - /// Template method for making a new - virtual int make_svc_handler (SVC_HANDLER *&sh); - - /// Template method for activating a new - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - - /// Template method for setting the recycler information of the - /// svc_handler. - virtual int assign_recycler (SVC_HANDLER *svc_handler, - ACE_Connection_Recycling_Strategy *recycler, - const void *recycling_act); - - /// Template method for preparing the svc_handler for recycling. - virtual int prepare_for_recycling (SVC_HANDLER *svc_handler); - - /** - * Checks to see if there is already a in the cache - * connected to the . If so, we return this pointer. - * Otherwise we establish the connection, put it into the cache, and - * return the SVC_HANDLER pointer. <[NOTE]>: the <{reuse_addr}> - * argument does NOT control re-use of addresses in the cache. - * Rather, if the underlying protocol requires a "dead time" prior - * to re-use of its addresses (TCP is a classic example of this), - * <{and}> the protocol provides a means by which to defeat the dead - * time, setting this argument to non-zero will defeat the dead-time - * requirement. <{Dev. Note: We might want to consider enhancing - * the interface at some point so that this also controls re-use of - * the cache.}> - */ - virtual int connect_svc_handler (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - virtual int connect_svc_handler (SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /// Remove from cache. - virtual int purge (const void *recycling_act); - - /// Add to cache. - virtual int cache (const void *recycling_act); - - /// Get/Set . - virtual int recycle_state (const void *recycling_act, - ACE_Recyclable_State new_state); - virtual ACE_Recyclable_State recycle_state (const void *recycling_act) const; - - /// Mark as closed. - virtual int mark_as_closed (const void *recycling_act); - - /** - * Mark as closed (non-locking version). This method needs to be public - * as it is used in the cleanup of handlers where teh locked version causes - * a deadlock. - */ - virtual int mark_as_closed_i (const void *recycling_act); - - /// Cleanup hint and reset <*act_holder> to zero if . - virtual int cleanup_hint (const void *recycling_act, - void **act_holder = 0); - - // = Traits for managing the map - typedef ACE_Refcounted_Hash_Recyclable - REFCOUNTED_HASH_RECYCLABLE_ADDRESS; - typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> - CONNECTION_MAP; - - typedef typename CONNECTION_MAP::ITERATOR CONNECTION_MAP_ITERATOR; - typedef typename CONNECTION_MAP::ENTRY CONNECTION_MAP_ENTRY; - - typedef ACE_Reverse_Lock REVERSE_MUTEX; - - // = Strategy accessors - virtual ACE_Creation_Strategy *creation_strategy (void) const; - virtual ACE_Recycling_Strategy *recycling_strategy (void) const; - virtual ACE_Concurrency_Strategy *concurrency_strategy (void) const; - -protected: - - /// Creates a new connection. - virtual int new_connection (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - - /// Find an idle handle. - int find (REFCOUNTED_HASH_RECYCLABLE_ADDRESS &search_addr, - CONNECTION_MAP_ENTRY *&entry); - - /// Remove from cache (non-locking version). - virtual int purge_i (const void *recycling_act); - - /// Add to cache (non-locking version). - virtual int cache_i (const void *recycling_act); - - /// Set (non-locking version). - virtual int recycle_state_i (const void *recycling_act, - ACE_Recyclable_State new_state); - - /// Get (non-locking version). - virtual ACE_Recyclable_State recycle_state_i (const void *recycling_act) const; - - /// Cleanup hint and reset <*act_holder> to zero if . - virtual int cleanup_hint_i (const void *recycling_act, - void **act_holder); - - // = Helpers - int check_hint_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - CONNECTION_MAP_ENTRY *&entry, - int &found); - - int find_or_create_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - CONNECTION_MAP_ENTRY *&entry, - int &found); - - virtual int connect_svc_handler_i ( - SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int &found); - - /// Table that maintains the cache of connected SVC_HANDLERs. - CONNECTION_MAP connection_map_; - - /// Mutual exclusion for this object. - MUTEX *lock_; - - /// Mutual exclusion for this object. - bool delete_lock_; - - /// Reverse lock. - REVERSE_MUTEX *reverse_lock_; - - // = Strategy objects. - - /// Creation strategy for an . - CREATION_STRATEGY *creation_strategy_; - - /// true if created the creation strategy and thus should - /// delete it, else false. - bool delete_creation_strategy_; - - /// Concurrency strategy for an . - CONCURRENCY_STRATEGY *concurrency_strategy_; - - /// true if created the concurrency strategy and thus should - /// delete it, else false. - bool delete_concurrency_strategy_; - - /// Recycling strategy for an . - RECYCLING_STRATEGY *recycling_strategy_; - - /// true if created the recycling strategy and thus should - /// delete it, else false. - bool delete_recycling_strategy_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Strategies_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Strategies_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Strategies_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_STRATEGIES_T_H */ - diff --git a/dep/include/ace/Strategies_T.inl b/dep/include/ace/Strategies_T.inl deleted file mode 100644 index f3ae267bc13..00000000000 --- a/dep/include/ace/Strategies_T.inl +++ /dev/null @@ -1,230 +0,0 @@ -// -*- C++ -*- -// -// $Id: Strategies_T.inl 81503 2008-04-28 18:28:15Z johnnyw $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Singleton_Strategy::ACE_Singleton_Strategy (SVC_HANDLER *sh, - ACE_Thread_Manager *tm) - : svc_handler_ (0), - delete_svc_handler_ (1) -{ - ACE_TRACE ("ACE_Singleton_Strategy::ACE_Singleton_Strategy"); - if (this->open (sh, tm) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Singleton_Strategy"))); -} - -template ACE_INLINE int -ACE_Creation_Strategy::open (ACE_Thread_Manager *thr_mgr, - ACE_Reactor *reactor) -{ - ACE_TRACE ("ACE_Creation_Strategy::open"); - this->thr_mgr_ = thr_mgr; - this->reactor_ = reactor; - return 0; -} - -template ACE_INLINE -ACE_Creation_Strategy::ACE_Creation_Strategy (ACE_Thread_Manager *thr_mgr, - ACE_Reactor *reactor) -{ - ACE_TRACE ("ACE_Creation_Strategy::ACE_Creation_Strategy"); - if (this->open (thr_mgr, reactor) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Creation_Strategy"))); -} - -template ACE_INLINE -ACE_DLL_Strategy::ACE_DLL_Strategy (const ACE_TCHAR dll_name[], - const ACE_TCHAR factory_function[], - const ACE_TCHAR svc_name[], - ACE_Service_Repository *svc_rep, - ACE_Thread_Manager *thr_mgr) -{ - ACE_TRACE ("ACE_DLL_Strategy::ACE_DLL_Strategy"); - if (this->open (dll_name, - factory_function, - svc_name, - svc_rep, - thr_mgr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("open"))); -} - -template ACE_INLINE -ACE_DLL_Strategy::ACE_DLL_Strategy (void) -{ - ACE_TRACE ("ACE_DLL_Strategy::ACE_DLL_Strategy"); -} - -template ACE_INLINE -ACE_Concurrency_Strategy::ACE_Concurrency_Strategy (int flags) - : flags_ (flags) -{ - ACE_TRACE ("ACE_Concurrency_Strategy::ACE_Concurrency_Strategy"); -} - -template ACE_INLINE -ACE_Reactive_Strategy::ACE_Reactive_Strategy (ACE_Reactor *reactor, - ACE_Reactor_Mask mask, - int flags) -{ - ACE_TRACE ("ACE_Reactive_Strategy::ACE_Reactive_Strategy"); - - if (this->open (reactor, - mask, - flags) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Reactive_Strategy::ACE_Reactive_Strategy"))); -} - -template ACE_INLINE -ACE_Reactive_Strategy::ACE_Reactive_Strategy (int flags) - : ACE_Concurrency_Strategy (flags), - reactor_ (0), - mask_ (ACE_Event_Handler::NULL_MASK) -{ - ACE_TRACE ("ACE_Reactive_Strategy::ACE_Reactive_Strategy"); -} - -template ACE_INLINE -ACE_Thread_Strategy::ACE_Thread_Strategy (ACE_Thread_Manager *thr_mgr, - long thr_flags, - int n_threads, - int flags) -{ - ACE_TRACE ("ACE_Thread_Strategy::ACE_Thread_Strategy"); - - if (this->open (thr_mgr, - thr_flags, - n_threads, - flags) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Thread_Strategy::ACE_Thread_Strategy"))); -} - -template ACE_INLINE -ACE_Thread_Strategy::ACE_Thread_Strategy (int flags) - : ACE_Concurrency_Strategy (flags), - thr_mgr_ (0), - thr_flags_ (0), - n_threads_ (1) -{ - ACE_TRACE ("ACE_Thread_Strategy::ACE_Thread_Strategy"); -} - -template ACE_INLINE -ACE_Accept_Strategy::ACE_Accept_Strategy (ACE_Reactor *reactor) - : reactor_ (reactor) -{ - ACE_TRACE ("ACE_Accept_Strategy::ACE_Accept_Strategy"); -} - -template ACE_INLINE -ACE_Connect_Strategy::ACE_Connect_Strategy (void) -{ - ACE_TRACE ("ACE_Connect_Strategy::ACE_Connect_Strategy"); -} - -template ACE_INLINE -ACE_Process_Strategy::ACE_Process_Strategy (size_t n_processes, - ACE_Event_Handler *acceptor, - ACE_Reactor *reactor, - int avoid_zombies) -{ - ACE_TRACE ("ACE_Process_Strategy::ACE_Process_Strategy"); - if (this->open (n_processes, - acceptor, - reactor, - avoid_zombies) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Process_Strategy"))); -} - -template ACE_INLINE -ACE_Scheduling_Strategy::ACE_Scheduling_Strategy (SVC_HANDLER *) -{ - ACE_TRACE ("ACE_Scheduling_Strategy::ACE_Scheduling_Strategy"); -} - -template ACE_INLINE -ACE_Schedule_All_Reactive_Strategy::ACE_Schedule_All_Reactive_Strategy - (SVC_HANDLER *scheduler) - : ACE_Scheduling_Strategy (scheduler) -{ - ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy::ACE_Schedule_All_Reactive_Strategy"); - - if (scheduler == 0 || scheduler->reactor () == 0) - this->reactor_ = ACE_Reactor::instance (); - else - this->reactor_ = scheduler->reactor (); -} - -template ACE_INLINE -ACE_Schedule_All_Threaded_Strategy::ACE_Schedule_All_Threaded_Strategy - (SVC_HANDLER *scheduler) - : ACE_Scheduling_Strategy (scheduler) -{ - ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy::ACE_Schedule_All_Threaded_Strategy"); - - if (scheduler == 0 || scheduler->thr_mgr () == 0) - this->thr_mgr_ = ACE_Thread_Manager::instance (); - else - this->thr_mgr_ = scheduler->thr_mgr (); -} - -template ACE_INLINE -ACE_Refcounted_Hash_Recyclable::ACE_Refcounted_Hash_Recyclable (void) - : ACE_Refcountable (0), - ACE_Hashable (), - ACE_Recyclable (ACE_RECYCLABLE_UNKNOWN), - t_ () -{ -} - -template ACE_INLINE -ACE_Refcounted_Hash_Recyclable::ACE_Refcounted_Hash_Recyclable (const T &t, - long refcount, - ACE_Recyclable_State state) - : ACE_Refcountable (refcount), - ACE_Hashable (), - ACE_Recyclable (state), - t_ (t) -{ -} - -template ACE_INLINE u_long -ACE_Refcounted_Hash_Recyclable::hash_i (void) const -{ - return this->t_.hash (); -} - -template ACE_INLINE T & -ACE_Refcounted_Hash_Recyclable::subject (void) -{ - return this->t_; -} - -template ACE_INLINE bool -ACE_Refcounted_Hash_Recyclable::operator== (const ACE_Refcounted_Hash_Recyclable &rhs) const -{ - return - this->recycle_state () == rhs.recycle_state () - && this->t_ == rhs.t_; -} - -template ACE_INLINE bool -ACE_Refcounted_Hash_Recyclable::operator!= (const ACE_Refcounted_Hash_Recyclable &rhs) const -{ - return !this->operator== (rhs); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Stream.h b/dep/include/ace/Stream.h deleted file mode 100644 index 9dc426fcf0f..00000000000 --- a/dep/include/ace/Stream.h +++ /dev/null @@ -1,242 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Stream.h - * - * $Id: Stream.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_STREAM_H -#define ACE_STREAM_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/IO_Cntl_Msg.h" -#include "ace/Message_Block.h" -#include "ace/Module.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decls. -template class ACE_Stream_Iterator; -class ACE_Time_Value; - -/** - * @class ACE_Stream - * - * @brief This class is the primary abstraction for the ASX framework. - * It is moduled after System V Stream. - * - * A Stream consists of a stack of , each of which - * contains two . Even though the methods in this - * class are virtual, this class isn't really intended for - * subclassing unless you know what you are doing. In - * particular, the ACE_Stream destructor calls , which - * won't be overridden properly unless you call it in a subclass - * destructor. - */ -template -class ACE_Stream -{ -public: - friend class ACE_Stream_Iterator; - - enum - { - /// Indicates that deletes the Tasks. Don't change this - /// value without updating the same enum in class ACE_Module... - M_DELETE = 3 - }; - - // = Initializatation and termination methods. - /** - * Create a Stream consisting of and as the Stream - * head and Stream tail, respectively. If these are 0 then the - * and are used, respectively. - * is the value past in to the methods of the tasks. - */ - ACE_Stream (void *arg = 0, - ACE_Module *head = 0, - ACE_Module *tail = 0); - - /** - * Create a Stream consisting of and as the Stream - * head and Stream tail, respectively. If these are 0 then the - * and are used, respectively. - * is the value past in to the methods of the tasks. - */ - virtual int open (void *arg, - ACE_Module *head = 0, - ACE_Module *tail = 0); - - /// Close down the stream and release all the resources. - virtual int close (int flags = M_DELETE); - - /// Close down the stream and release all the resources. - virtual ~ACE_Stream (void); - - // = ACE_Stream plumbing operations - - /// Add a new module right below the Stream head. The - /// hook methods of the in this ACE_Module - /// are invoked to initialize the tasks. - virtual int push (ACE_Module *mod); - - /// Remove the right below the Stream head and close it down. - // The hook methods of the in this ACE_Module - /// are invoked to cleanup the tasks. - virtual int pop (int flags = M_DELETE); - - /// Return the top module on the stream (right below the stream - /// head). - virtual int top (ACE_Module *&mod); - - /// Insert a new module below the named module . - virtual int insert (const ACE_TCHAR *prev_name, - ACE_Module *mod); - - /// Replace the named module with a new module . - virtual int replace (const ACE_TCHAR *replace_name, - ACE_Module *mod, - int flags = M_DELETE); - - /// Remove the named module from the stream. This bypasses the - /// strict LIFO ordering of and . - virtual int remove (const ACE_TCHAR *mod, - int flags = M_DELETE); - - /// Return current stream head. - virtual ACE_Module *head (void); - - /// Return current stream tail. - virtual ACE_Module *tail (void); - - /// Find a particular ACE_Module. - virtual ACE_Module *find (const ACE_TCHAR *mod); - - /// Create a pipe between two Streams. - virtual int link (ACE_Stream &); - - /// Remove a pipe formed between two Streams. - virtual int unlink (void); - - // = Blocking data transfer operations - /** - * Send the message @a mb down the stream, starting at the Module - * below the Stream head. Wait for upto @a timeout amount of - * absolute time for the operation to complete (or block forever if - * @a timeout == 0). - */ - virtual int put (ACE_Message_Block *mb, - ACE_Time_Value *timeout = 0); - - /** - * Read the message @a mb that is stored in the stream head. - * Wait for upto @a timeout amount of absolute time for the operation - * to complete (or block forever if @a timeout == 0). - */ - virtual int get (ACE_Message_Block *&mb, - ACE_Time_Value *timeout = 0); - - /// Send control message down the stream. - virtual int control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, - void *args); - - /// Synchronize with the final close of the stream. - virtual int wait (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Actually perform the unlinking of two Streams (must be called - /// with locks held). - int unlink_i (void); - - /// Actually perform the linking of two Streams (must be called with - /// locks held). - int link_i (ACE_Stream &); - - /// Must a new module onto the Stream. - int push_module (ACE_Module *, - ACE_Module * = 0, - ACE_Module * = 0); - - /// Pointer to the head of the stream. - ACE_Module *stream_head_; - - /// Pointer to the tail of the stream. - ACE_Module *stream_tail_; - - /// Pointer to an adjoining linked stream. - ACE_Stream *linked_us_; - - // = Synchronization objects used for thread-safe streams. - /// Protect the stream against race conditions. - ACE_SYNCH_MUTEX_T lock_; - - /// Use to tell all threads waiting on the close that we are done. - ACE_SYNCH_CONDITION_T final_close_; -}; - -/** - * @class ACE_Stream_Iterator - * - * @brief Iterate through an ACE_Stream. - */ -template -class ACE_Stream_Iterator -{ -public: - // = Initialization method. - ACE_Stream_Iterator (const ACE_Stream &sr); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the set. - /// Returns 0 when all items have been seen, else 1. - int next (const ACE_Module *&next_item); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - -private: - /// Next that we haven't yet seen. - ACE_Module *next_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Stream.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Stream.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Stream.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_STREAM_H */ - diff --git a/dep/include/ace/Stream.inl b/dep/include/ace/Stream.inl deleted file mode 100644 index 6263d431147..00000000000 --- a/dep/include/ace/Stream.inl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id: Stream.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE ACE_Module * -ACE_Stream::head (void) -{ - ACE_TRACE ("ACE_Stream::head"); - return this->stream_head_; -} - -template ACE_INLINE ACE_Module * -ACE_Stream::tail (void) -{ - ACE_TRACE ("ACE_Stream::tail"); - return this->stream_tail_; -} - -template ACE_INLINE int -ACE_Stream::wait (void) -{ - ACE_TRACE ("ACE_Stream::wait"); - return this->final_close_.wait (); -} - -template ACE_INLINE int -ACE_Stream_Iterator::next (const ACE_Module *&mod) -{ - ACE_TRACE ("ACE_Stream_Iterator::next"); - mod = this->next_; - return this->next_ != 0; -} - -template ACE_INLINE int -ACE_Stream_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Stream_Iterator::done"); - return this->next_ == 0; -} - -template int -ACE_Stream_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Stream_Iterator::advance"); - this->next_ = this->next_->next (); - return this->next_ != 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Stream_Modules.h b/dep/include/ace/Stream_Modules.h deleted file mode 100644 index 8b718b6013d..00000000000 --- a/dep/include/ace/Stream_Modules.h +++ /dev/null @@ -1,167 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Stream_Modules.h - * - * $Id: Stream_Modules.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -// This needs to go outside of the #if !defined() block. Don't ask... -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#ifndef ACE_STREAM_MODULES -#define ACE_STREAM_MODULES -#include /**/ "ace/pre.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Stream_Head - * - * @brief Standard task that acts as reader or writer at the head of - * an ACE_Stream. - * - * A ACE_Message_Block sent to this task (via its put() hook) triggers - * actions depending on the block type and whether the task is acting as - * a reader or a writer. If the block is of type ACE_Message_Block::MB_IOCTL, - * the block's is assumed to contain (beginning at its rd_ptr()) an - * ACE_IO_Cntl_Msg object and is processed accordingly. This is usually - * used to set the task's message queue high water and/or low water marks. - * - * When the block is not ACE_Message_Block::MB_IOCTL, processing depends on - * the ACE_Stream_Head's role in the module: - * - * - Reader: If the block is of type ACE_Message_Block::MB_FLUSH, the - * canonical_flush() method is called. - * (@see ACE_Stream::canonical_flush().) If the block is any other - * type, it is queued on this task's message queue. It would thus - * be available to caller's reading blocks from the containing - * stream. - * - Writer: The block is passed to the next module in the stream. - */ -template -class ACE_Stream_Head : public ACE_Task -{ -public: - /// Construction - ACE_Stream_Head (void); - - /// Destruction - ~ACE_Stream_Head (void); - - // = ACE_Task hooks - virtual int open (void *a = 0); - virtual int close (u_long flags = 0); - virtual int put (ACE_Message_Block *msg, ACE_Time_Value * = 0); - virtual int svc (void); - - // = Dynamic linking hooks - virtual int init (int argc, ACE_TCHAR *argv[]); - virtual int info (ACE_TCHAR **info_string, size_t length) const; - virtual int fini (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Performs canonical flushing at the ACE_Stream Head. - int control (ACE_Message_Block *); - int canonical_flush (ACE_Message_Block *); -}; - -/** - * @class ACE_Stream_Tail - * - * @brief Standard module that acts as the head of a stream. - */ -template -class ACE_Stream_Tail : public ACE_Task -{ -public: - /// Construction - ACE_Stream_Tail (void); - - /// Destruction - ~ACE_Stream_Tail (void); - - // = ACE_Task hooks - virtual int open (void *a = 0); - virtual int close (u_long flags = 0); - virtual int put (ACE_Message_Block *msg, ACE_Time_Value * = 0); - virtual int svc (void); - - // = Dynamic linking hooks - virtual int init (int argc, ACE_TCHAR *argv[]); - virtual int info (ACE_TCHAR **info_string, size_t length) const; - virtual int fini (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Performs canonical flushing at the ACE_Stream tail. - int control (ACE_Message_Block *); - int canonical_flush (ACE_Message_Block *); -}; - -/** - * @class ACE_Thru_Task - * - * @brief Standard module that acts as a "no op", simply passing on all - * data to its adjacent neighbor. - */ -template -class ACE_Thru_Task : public ACE_Task -{ -public: - /// Construction - ACE_Thru_Task (void); - - /// Destruction - ~ACE_Thru_Task (void); - - // = ACE_Task hooks - virtual int open (void *a = 0); - virtual int close (u_long flags = 0); - virtual int put (ACE_Message_Block *msg, ACE_Time_Value * = 0); - virtual int svc (void); - - // = Dynamic linking hooks - virtual int init (int argc, ACE_TCHAR *argv[]); - virtual int info (ACE_TCHAR **info_string, size_t length) const; - virtual int fini (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Stream_Modules.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Stream_Modules.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_STREAM_MODULES */ - diff --git a/dep/include/ace/String_Base.h b/dep/include/ace/String_Base.h deleted file mode 100644 index c3ecbd8148b..00000000000 --- a/dep/include/ace/String_Base.h +++ /dev/null @@ -1,613 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file String_Base.h - * - * $Id: String_Base.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) - * @author Nanbor Wang - */ -//============================================================================= - -#ifndef ACE_STRING_BASE_H -#define ACE_STRING_BASE_H - -#include /**/ "ace/pre.h" - -#include "ace/Global_Macros.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/String_Base_Const.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_String_Base - * - * @brief This class provides a wrapper facade for C strings. - * - * This class uses an ACE_Allocator to allocate memory. The - * user can make this a persistant class by providing an - * ACE_Allocator with a persistable memory pool. This class is - * optimized for efficiency, so it doesn't provide any internal - * locking. - * @note If an instance of this class is constructed from or - * assigned an empty string (with first element of '\0'), then it - * is not allocated new space. Instead, its internal - * representation is set equal to a global empty string. - * CAUTION: in cases when ACE_String_Base is constructed from a - * provided buffer with the release parameter set to false, - * ACE_String_Base is not guaranteed to be '\0' terminated. - * - * \li Do not use a "@c -1" magic number to refer to the "no position" - * condition. This was never the right thing to do. The "@c npos" - * constant should be used in such cases. - * \li Do not assign or pass string positions to or from signed types. - * Use the "@c size_type" @c typedef found in all ACE string - * classes. This typedef is analogous to the "@c size_type" - * @c typedef found in the standard C++ string class as well as - * many STL class templates. If you find yourself casting you're - * probably doing something wrong. - */ -template -class ACE_String_Base : public ACE_String_Base_Const -{ -public: - - using ACE_String_Base_Const::size_type; - - /** - * Default constructor. - * - * @param the_allocator ACE_Allocator associated with string - * @return Default ACE_String_Base string. - */ - ACE_String_Base (ACE_Allocator *the_allocator = 0); - - /** - * Constructor that copies @a s into dynamically allocated memory. - * - * if release == true then a new buffer is allocated internally, and - * s is copied to the internal buffer. - * if release == false then the s buffer is used directly. If s == 0 - * then it will _not_ be used, and instead the internal buffer - * is set to NULL_String_. - * - * @param s Zero terminated input string - * @param the_allocator ACE_Allocator associated with string - * @param release Allocator responsible(true)/not reponsible(false) for - * freeing memory. - * @return ACE_String_Base containing const CHAR *s - */ - ACE_String_Base (const CHAR *s, - ACE_Allocator *the_allocator = 0, - bool release = true); - - /** - * Constructor that copies @a len CHARs of @a s into dynamically - * allocated memory (will zero terminate the result). - * - * if release == true then a new buffer is allocated internally. - * s is copied to the internal buffer. - * if release == false then the s buffer is used directly. If s == 0 - * then it will _not_ be used, and instead the internal buffer - * is set to NULL_String_. - * - * @param s Non-zero terminated input string - * @param len Length of non-zero terminated input string - * @param the_allocator ACE_Allocator associated with string - * @param release Allocator responsible(true)/not reponsible(false) for - * freeing memory. - * @return ACE_String_Base containing const CHAR *s - */ - ACE_String_Base (const CHAR *s, - size_type len, - ACE_Allocator *the_allocator = 0, - bool release = true); - - /** - * Copy constructor. - * - * @param s Input ACE_String_Base string to copy - * @return Copy of input string @a s - */ - ACE_String_Base (const ACE_String_Base < CHAR > &s); - - /** - * Constructor that copies @a c into dynamically allocated memory. - * - * @param c Single input character. - * @param the_allocator ACE_Allocator associated with string - * @return ACE_String_Base containing CHAR 'c' - */ - ACE_String_Base (CHAR c, ACE_Allocator *the_allocator = 0); - - /** - * Constructor that allocates a len long string. - * - * Warning : This constructor was incorrectly documented in the past. - * It simply calls resize(len, c). - * It is probably not advisable to use the second parameter. See - * resize() for more information. - * - * @param len Amount of space to reserve for the string. - * @param c The array is filled with c's - * @param the_allocator ACE_Allocator associated with string - * @return Empty ACE_String_Base with room for len CHARs - */ - ACE_String_Base (size_type len, - CHAR c = 0, - ACE_Allocator *the_allocator = 0); - - /** - * Deletes the memory... - */ - ~ACE_String_Base (void); - - /** - * Return the character in the string (doesn't perform - * bounds checking). - * - * @param slot Index of the desired character - * @return The character at index @a slot - */ - const CHAR & operator[] (size_type slot) const; - - /** - * Return the character by reference in the string - * (doesn't perform bounds checking). - * - * @param slot Index of the desired character - * @return The character at index @a slot - */ - CHAR & operator[] (size_type slot); - - /** - * Assignment operator (does copy memory). - * - * @param s Input null-terminated CHAR string to assign to this object. - * @return Return a copy of the this string. - */ - ACE_String_Base < CHAR > &operator = (const CHAR * s); - - /** - * Assignment operator (does copy memory). - * - * @param s Input ACE_String_Base string to assign to this object. - * @return Return a copy of the this string. - */ - ACE_String_Base < CHAR > &operator = (const ACE_String_Base < CHAR > &s); - - /** - * Assignment alternative method (does not copy memory). - * - * @param s Input ACE_String_Base string to assign to this object. - * @return Return this string. - */ - ACE_String_Base < CHAR > &assign_nocopy (const ACE_String_Base < CHAR > &s); - - /** - * Copy @a s into this @a ACE_String_Base. - * - * If release == true then a new buffer is allocated internally if the - * existing one is not big enough to hold s. If the existing - * buffer is big enough, then it will be used. This means that - * set(*, 1) can be illegal when the string is constructed with a - * const char*. (e.g. ACE_String_Base("test", 0, false)). - * - * if release == false then the s buffer is used directly, and any - * existing buffer is destroyed. If s == 0 then it will _not_ be - * used, and instead the internal buffer is set to NULL_String_. - * - * @param s Null terminated input string - * @param release Allocator responsible(true)/not reponsible(false) for - * freeing memory. - */ - void set (const CHAR * s, bool release = true); - - /** - * Copy @a len bytes of @a s (will zero terminate the result). - * - * If release == true then a new buffer is allocated internally if the - * existing one is not big enough to hold s. If the existing - * buffer is big enough, then it will be used. This means that - * set(*, *, 1) is illegal when the string is constructed with a - * non-owned const char*. (e.g. ACE_String_Base("test", 0, 0)) - * - * If release == false then the s buffer is used directly, and any - * existing buffer is destroyed. If s == 0 then it will _not_ be - * used, and instead the internal buffer is set to NULL_String_. - * - * @param s Non-zero terminated input string - * @param len Length of input string 's' - * @param release Allocator responsible(true)/not reponsible(false) for - * freeing memory. - */ - void set (const CHAR * s, size_type len, bool release); - - /** - * Clear this string. Memory is _not_ freed if @a release is false. - * - * Warning: This method was incorrectly documented in the past, but - * the current implementation has been changed to match the documented - * behavior. - * - * Warning: clear(false) behaves like fast_clear() below. - * - * @param release Memory is freed if true, and not freed if false. - */ - void clear (bool release = false); - - /** - * A more specialized version of clear(): "fast clear". fast_clear() - * resets the string to 0 length. If the string owns the buffer - * (@arg release_== true): - * - the string buffer is not freed - * - the first character of the buffer is set to 0. - * - * If @arg release_ is false (this object does not own the buffer): - * - the buffer pointer is reset to the NULL_String_ and does not - * maintain a pointer to the caller-supplied buffer on return - * - the maximum string length is reset to 0. - * - * Warning : Calling clear(false) or fast_clear() can have unintended - * side-effects if the string was constructed (or set()) with an - * external buffer. The string will be disassociated with the buffer - * and the next append() or +=() will cause a new buffer to be - * allocated internally. - */ - void fast_clear (void); - - /** - * Return a substring given an offset and length. - * If length == @c npos use rest of str. Return empty substring if - * offset or offset/length are invalid. - * - * @param offset Index of first desired character of the substring. - * @param length How many characters to return starting at the offset. - * @return The string containing the desired substring - */ - ACE_String_Base < CHAR > substring (size_type offset, - size_type length = npos) const; - - /** - * Same as . - * - * @param offset Index of first desired character of the substring. - * @param length How many characters to return starting at the offset. - * @return The string containing the desired substring - */ - ACE_String_Base < CHAR > substr (size_type offset, - size_type length = npos) const; - - /** - * Concat operator (copies memory). - * - * @param s Input ACE_String_Base string to concatenate to this string. - * @return The combined string (input append to the end of the old). New - * string is zero terminated. - */ - ACE_String_Base < CHAR > &operator += (const ACE_String_Base < CHAR > &s); - - /** - * Concat operator (copies memory). - * - * @param s Input C string to concatenate to this string. - * @return The combined string (input append to the end of the old). New - * string is zero terminated. - */ - ACE_String_Base < CHAR >& operator += (const CHAR* s); - - /** - * Concat operator (copies memory). - * - * @param c Input CHAR to concatenate to this string. - * @return The combined string (input append to the end of the old). New - * string is zero terminated. - */ - ACE_String_Base < CHAR >& operator += (const CHAR c); - - /** - * Append function (copies memory). - * - * @param s Input CHAR array to concatenate to this string. - * @param slen The length of the array. - * @return The combined string (input append to the end of the old). New - * string is zero terminated. - */ - ACE_String_Base < CHAR >& append (const CHAR* s, size_type slen); - - /** - * Returns a hash value for this string. - * - * @return Hash value of string - */ - u_long hash (void) const; - - /** - * Return the length of the string. - * - * @return Length of stored string - */ - size_type length (void) const; - - /** - * Return the number of allocated CHARs in the string object. - * This may be greater than the current length of the string. - * - * @return Maximum number of CHAR units that can be stored, including - * any terminating nul that may be needed. - */ - size_t capacity (void) const; - - /** - * Return @c true if the length of the string is zero, else @c false. - */ - bool is_empty (void) const; - - /** - * Return @c true if the length of the string is zero, else @c - * false. We recommend using @c is_empty() instead since it's more - * consistent with the ACE container naming conventions. - */ - bool empty (void) const; - - /** - * Get a copy of the underlying representation. - * - * This method allocates memory for a copy of the string and returns - * a pointer to the new area. The caller is responsible for freeing - * the memory when finished; use delete [] - * - * @return Pointer reference to the string data. Returned string is - * zero terminated. - */ - CHAR *rep (void) const; - - /** - * Get at the underlying representation directly! - * _Don't_ even think about casting the result to (char *) and modifying it, - * if it has length 0! - * - * @return Pointer reference to the stored string data. No guarantee is - * that the string is zero terminated. - * - */ - const CHAR *fast_rep (void) const; - - /** - * Same as STL String's and . - */ - const CHAR *c_str (void) const; - - /** - * Comparison operator that will match substrings. Returns the - * slot of the first location that matches, else @c npos. - * - * @param s Input ACE_String_Base string - * @return Integer index value of the first location of string @a s or - * @c npos (not found). - */ - size_type strstr (const ACE_String_Base &s) const; - - /** - * Find starting at pos. Returns the slot of the first - * location that matches (will be >= pos), else @c npos. - * - * @param str Input ACE_String_Base string to search for in stored string. - * @param pos Starting index position to start searching for string @a str. - * @return Index value of the first location of string @a str else - * @c npos. - */ - size_type find (const ACE_String_Base &str, size_type pos = 0) const; - - /** - * Find @a s starting at pos. Returns the slot of the first - * location that matches (will be >= pos), else @c npos. - * - * @param s non-zero input string to search for in stored string. - * @param pos Starting index position to start searching for string @a str. - * @return Index value of the first location of string @a str else - * @c npos. - */ - size_type find (const CHAR *s, size_type pos = 0) const; - - /** - * Find @a c starting at pos. Returns the slot of the first - * location that matches (will be >= pos), else @c npos. - * - * @param c Input character to search for in stored string. - * @param pos Starting index position to start searching for string @a str. - * @return Index value of the first location of string @a str else - * @c npos. - */ - size_type find (CHAR c, size_type pos = 0) const; - - /** - * Find @a c starting at pos (counting from the end). Returns the - * slot of the first location that matches, else @c npos. - * - * @param c Input character to search for in stored string. - * @param pos Starting index position to start searching for string @a str. - * @return Index value of the first location of string @a str else - * @c npos. - */ - size_type rfind (CHAR c, size_type pos = npos) const; - - /** - * Equality comparison operator (must match entire string). - * - * @param s Input ACE_String_Base string to compare against stored string. - * @return @c true if equal, @c false otherwise. - */ - bool operator == (const ACE_String_Base &s) const; - - /** - * Equality comparison operator (must match entire string). - * - * @param s Null terminated string to compare against stored string. - * @return @c true if equal, @c false otherwise. - */ - bool operator == (const CHAR *s) const; - - /** - * Less than comparison operator. - * - * @param s Input ACE_String_Base string to compare against stored string. - * @return @c true if less than, @c false otherwise. - */ - bool operator < (const ACE_String_Base &s) const; - - /** - * Greater than comparison operator. - * - * @param s Input ACE_String_Base string to compare against stored string. - * @return @c true if greater than, @c false otherwise. - */ - bool operator > (const ACE_String_Base &s) const; - - /** - * Inequality comparison operator. - * - * @param s String to compare against stored string. - * @return @c true if not equal, @c false otherwise. - */ - bool operator != (const ACE_String_Base &s) const; - - /** - * Inequality comparison operator. - * - * @param s Null terminated string to compare against stored string. - * @return @c true if not equal, @c false otherwise. - */ - bool operator != (const CHAR *s) const; - - /** - * Performs a strncmp comparison. - * - * @param s Input ACE_String_Base string to compare against stored string. - * @return Integer value of result (less than 0, 0, greater than 0) - * depending on how input string @a s is to the stored string. - */ - int compare (const ACE_String_Base &s) const; - - /** - * Dump the state of an object. - */ - void dump (void) const; - - /** - * This method is designed for high-performance. Please use with - * care ;-) - * - * Warning : This method was documented incorrectly in the past. - * The original intention was to change the length of the string to - * len, and to fill the whole thing with c CHARs. - * However, what was actually done was to set the length of the - * string to zero, and fill the buffer with c's. The buffer was - * also not null-terminated unless c happened to be zero. - * Rather than fix the method to work as documented, the code is - * left as is, but the second parameter should probably not be used. - * - * fast_resize just adjusts the buffer if needed and sets the length, - * it doesn't fill the buffer, so is much faster. - * - * @param len The number of CHARs to reserve - * @param c The CHAR to use when filling the string. - */ - void resize (size_type len, CHAR c = 0); - void fast_resize (size_t len); - - /// Swap the contents of this @c ACE_String_Base with @a str. - /** - * @note This is non-throwing operation. - */ - void swap (ACE_String_Base & str); - - /** - * Declare the dynamic allocation hooks. - */ - ACE_ALLOC_HOOK_DECLARE; - -protected: - /** - * Pointer to a memory allocator. - */ - ACE_Allocator *allocator_; - - /** - * Length of the ACE_String_Base data (not counting the trailing '\0'). - */ - size_type len_; - - /** - * Length of the ACE_String_Base data buffer. Keeping track of the - * length allows to avoid unnecessary dynamic allocations. - */ - size_type buf_len_; - - /** - * Pointer to data. - */ - CHAR *rep_; - - /** - * Flag that indicates if we own the memory - */ - bool release_; - - /** - * Represents the "NULL" string to simplify the internal logic. - */ - static CHAR NULL_String_; -}; - -template < class CHAR > - ACE_String_Base < CHAR > operator + (const ACE_String_Base < CHAR > &, - const ACE_String_Base < CHAR > &); -template < class CHAR > - ACE_String_Base < CHAR > operator + (const ACE_String_Base < CHAR > &, - const CHAR *); -template < class CHAR > - ACE_String_Base < CHAR > operator + (const CHAR *, - const ACE_String_Base < CHAR > &); - -template < class CHAR > - ACE_String_Base < CHAR > operator + (const ACE_String_Base < CHAR > &t, - const CHAR c); - -template < class CHAR > - ACE_String_Base < CHAR > operator + (const CHAR c, - const ACE_String_Base < CHAR > &t); - -template - bool operator == (const CHAR *s, - const ACE_String_Base &t); - -template - bool operator != (const CHAR *s, - const ACE_String_Base &t); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/String_Base.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/String_Base.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("String_Base.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_STRING_BASE_H */ - diff --git a/dep/include/ace/String_Base.inl b/dep/include/ace/String_Base.inl deleted file mode 100644 index d0fa8ed7e64..00000000000 --- a/dep/include/ace/String_Base.inl +++ /dev/null @@ -1,158 +0,0 @@ -// -*- C++ -*- -// -// $Id: String_Base.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Malloc_Base.h" -#include "ace/Min_Max.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_String_Base::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_String_Base::dump"); -#endif /* ACE_HAS_DUMP */ -} - -// Assignment method (does not copy memory) -template ACE_INLINE ACE_String_Base & -ACE_String_Base::assign_nocopy (const ACE_String_Base &s) -{ - ACE_TRACE ("ACE_String_Base::assign_nocopy"); - this->set (s.rep_, s.len_, false); - return *this; -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::length (void) const -{ - ACE_TRACE ("ACE_String_Base::length"); - return this->len_; -} - -template ACE_INLINE size_t -ACE_String_Base::capacity (void) const -{ - ACE_TRACE ("ACE_String_Base::capacity"); - return this->buf_len_; -} - -template ACE_INLINE bool -ACE_String_Base::is_empty (void) const -{ - return this->len_ == 0; -} - -template ACE_INLINE bool -ACE_String_Base::empty (void) const -{ - return this->is_empty (); -} - -template ACE_INLINE ACE_String_Base -ACE_String_Base::substr ( - typename ACE_String_Base::size_type offset, - typename ACE_String_Base::size_type length) const -{ - ACE_TRACE ("ACE_String_Base::substr"); - return this->substring (offset, length); -} - -// Return the character in the string. - -template ACE_INLINE const CHAR & -ACE_String_Base::operator[] ( - typename ACE_String_Base::size_type slot) const -{ - ACE_TRACE ("ACE_String_Base::operator[]"); - return this->rep_[slot]; -} - -// Return the character in the string by reference. - -template ACE_INLINE CHAR & -ACE_String_Base::operator[] ( - typename ACE_String_Base::size_type slot) -{ - ACE_TRACE ("ACE_String_Base::operator[]"); - return this->rep_[slot]; -} - -template ACE_INLINE const CHAR * -ACE_String_Base::fast_rep (void) const -{ - return this->rep_; -} - -template ACE_INLINE const CHAR * -ACE_String_Base::c_str (void) const -{ - return this->rep_; -} - -// Less than comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator < (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator <"); - return compare (s) < 0; -} - -// Greater than comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator > (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator >"); - return compare (s) > 0; -} - -// Comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator!= (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator!="); - return !(*this == s); -} - -template ACE_INLINE bool -ACE_String_Base::operator!= (const CHAR *s) const -{ - return !(*this == s); -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::find (const ACE_String_Base&str, - typename ACE_String_Base::size_type pos) const -{ - ACE_TRACE ("ACE_String_Base::find"); - return this->find (str.rep_, pos); -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::strstr (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::strstr"); - return this->find (s.rep_); -} - -template ACE_INLINE bool -operator== (const CHAR *s, - const ACE_String_Base &t) -{ - return t == s; -} - -template ACE_INLINE bool -operator!= (const CHAR *s, - const ACE_String_Base &t) -{ - return !(t == s); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/String_Base_Const.h b/dep/include/ace/String_Base_Const.h deleted file mode 100644 index 434fc711370..00000000000 --- a/dep/include/ace/String_Base_Const.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file String_Base_Const.h - * - * $Id: String_Base_Const.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Nanbor Wang - */ -//============================================================================= - -#ifndef ACE_STRING_BASE_CONST_H -#define ACE_STRING_BASE_CONST_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" -#include "ace/Malloc_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_String_Base_Const - * - * @brief This class defines a constant for ACE_String_Base - * which originally was there to circumvent a bug in SunCC 6.0. - * This could be moved to ACE_String_Base but that - * adds a lot of footprint to the user applications which - * is not something we want. - */ -class ACE_Export ACE_String_Base_Const -{ -public: - - typedef ACE_Allocator::size_type size_type; - - /// Constant that denotes case where no such character position - /// exists. - static size_type const npos; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_STRING_BASE_CONST_H */ - diff --git a/dep/include/ace/Svc_Conf.h b/dep/include/ace/Svc_Conf.h deleted file mode 100644 index 60ffd572156..00000000000 --- a/dep/include/ace/Svc_Conf.h +++ /dev/null @@ -1,108 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Svc_Conf.h - * - * $Id: Svc_Conf.h 81332 2008-04-10 22:47:04Z iliyan $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_SVC_CONF_H -#define ACE_SVC_CONF_H - -#include /**/ "ace/pre.h" - -#include "ace/Service_Config.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Parse_Node.h" -#include "ace/Svc_Conf_Param.h" - -// Make sure the yacc(1) function declarations are _outside_ -// any ACE versioned namespace. The block below is verbatim -// from the template that comes with bison (ver. 2.3). - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int ace_yyparse (void *YYPARSE_PARAM); -#else -int ace_yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int ace_yyparse (void); -#else -int ace_yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) - -// The following yylex() declarations require support for reentrant -// parser generation (e.g. from GNU Bison). -#define YY_DECL extern "C" int ace_yylex (YYSTYPE *ace_yylval, void *YYLEX_PARAM) - -// Forward declarations -class ACE_Location_Node; -class ACE_Parse_Node; -class ACE_Static_Node; -class ACE_Service_Type_Factory; - -// The following definition for the YYSTYPE must occur before -// YY_DECL is declared since YY_DECL expands to function -// prototypes that use YYSTYPE. -typedef union -{ - int type_; - ACE_Location_Node *location_node_; - ACE_Parse_Node *parse_node_; - ACE_Static_Node *static_node_; - ACE_Service_Type_Factory *svc_record_; - ACE_TCHAR *ident_; -} YYSTYPE; - -#define YYSTYPE_IS_DECLARED - -// Forward declaration -struct ace_yy_buffer_state; - -/// Performs the lexical analysis -YY_DECL; - -/// Name of input stream -extern FILE *ace_yyin; - -/// Error handling routines required by YACC or BISON -extern void ace_yyerror (ACE_TCHAR const *); -extern void ace_yyerror (int yyerrno, int yylineno, ACE_TCHAR const *); - -/// Holds the lexeme for the current token -extern ACE_TCHAR *ace_yytext; - -/// Holds the length of the lexeme for the current token -extern int ace_yyleng; - -#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - -/// Factory that creates a new ACE_Service_Type_Impl. -extern ACE_Service_Type_Impl * -ace_create_service_type (ACE_TCHAR const *, - int, - void *, - unsigned int, - ACE_Service_Object_Exterminator = 0); - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SVC_CONF_H */ - diff --git a/dep/include/ace/Svc_Conf_Lexer.h b/dep/include/ace/Svc_Conf_Lexer.h deleted file mode 100644 index c1759577e7e..00000000000 --- a/dep/include/ace/Svc_Conf_Lexer.h +++ /dev/null @@ -1,71 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file Svc_Conf_Lexer.h - * - * $Id: Svc_Conf_Lexer.h 81312 2008-04-09 21:01:34Z iliyan $ - * - * This class is a hand-coded replacement for the lexer generated from - * Svc_Conf.l that correctly supports Unicode. - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef SVC_CONF_LEXER_H -#define SVC_CONF_LEXER_H - -#include /**/ "ace/pre.h" -#include "ace/Svc_Conf.h" - -#if (ACE_USES_CLASSIC_SVC_CONF == 1) -#include "ace/Encoding_Converter_Factory.h" - -class ACE_Encoding_Converter; - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** This class lexes the classic ACE Service Configurator language. - * The entry point is similar to what flex would generate. However, it - * is a static method in this class (which is really just name space). - */ -class ACE_Svc_Conf_Lexer -{ -public: - /// This is similar to the C function, ace_yylex, which a bison - /// generated parser expects. It returns information in the ace_yylval - /// parameter and uses input stored in the param parameter. - static int yylex (YYSTYPE* ace_yylval, - ACE_Svc_Conf_Param* param); - -private: - static size_t input(ACE_Svc_Conf_Param* param, char* buf, size_t max_size); - - static int scan (YYSTYPE* ace_yylval, ACE_Svc_Conf_Param* param); - -#if defined (ACE_USES_WCHAR) - static bool convert_to_utf8 ( - ACE_Svc_Conf_Param* param, - size_t skip_bytes, - ACE_Encoding_Converter_Factory::Encoding_Hint hint); - static bool convert_from_utf8 (ACE_Encoding_Converter* converter, - const char* source, - size_t source_size, - ACE_TCHAR* target, - size_t target_size, - size_t& length); - static ACE_Encoding_Converter_Factory::Encoding_Hint - locate_bom (char* source, - size_t source_size, - size_t& bytes_used); -#endif /* ACE_USES_WCHAR */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_CLASSIC_SVC_CONF = 1 */ - -#include /**/ "ace/post.h" - -#endif /* SVC_CONF_LEXER_H */ - diff --git a/dep/include/ace/Svc_Conf_Param.h b/dep/include/ace/Svc_Conf_Param.h deleted file mode 100644 index 3b96aae13b0..00000000000 --- a/dep/include/ace/Svc_Conf_Param.h +++ /dev/null @@ -1,141 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Svc_Conf_Param.h - * - * $Id: Svc_Conf_Param.h 81312 2008-04-09 21:01:34Z iliyan $ - * - * @author Iliyan Jeliazkov - * @author Based on code originally found in Svc_Conf.h by Doug - Schmidt and Ossama Othman. - */ -//============================================================================= - -#ifndef ACE_SVC_CONF_PARAM_H -#define ACE_SVC_CONF_PARAM_H - -#include /**/ "ace/pre.h" - -// Globally visible macros, type decls, and extern var decls for -// Service Configurator utility. - -#include "ace/Obstack.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -struct ace_yy_buffer_state; -class ACE_Service_Gestalt; - -extern void ace_yy_delete_buffer (ace_yy_buffer_state *buffer); - -/** - * @class ACE_Svc_Conf_Param - * - * @brief An instance of this object will be passed down to the - * yyparse() and yylex() functions. - * - * This is intended for internal use within ACE service configuration - * framework only. - * - * This class retains the state for a given parse/scan. It primarily - * makes it possible to hold the static object lock in the scanner - * for as short a period of time as possible. The resulting finer - * grained locking prevents deadlocks from occuring when scanning a - * `svc.conf' file and activating an ACE_Task, for example, as a - * result of processing the directives in that file. - */ -class ACE_Svc_Conf_Param -{ -public: - - enum SVC_CONF_PARAM_TYPE - { - /// The lexer will scan a file containing one or more directives. - SVC_CONF_FILE, - - /// The lexer will scan a string containing a directive. - SVC_CONF_DIRECTIVE - }; - - /// Constructor - ACE_Svc_Conf_Param (ACE_Service_Gestalt* config, FILE *file) - : type (SVC_CONF_FILE), - yyerrno (0), - yylineno (1), - buffer (0), - obstack (), - config (config) - { - source.file = file; - } - - /// Constructor - ACE_Svc_Conf_Param (ACE_Service_Gestalt* config, const ACE_TCHAR *directive) - : type (SVC_CONF_DIRECTIVE), - yyerrno (0), - yylineno (1), - buffer (0), - obstack (), - config (config) - { - source.directive = directive; - } - - ~ACE_Svc_Conf_Param (void) - { - ace_yy_delete_buffer (this->buffer); - } - -public: - - union - { - /// FILE stream from which directives will be scanned and parsed. - FILE *file; - - /// String containing directive that will be scanned and parsed. - const ACE_TCHAR *directive; - - } source; - - /// Discriminant use to determine which union member to use. - SVC_CONF_PARAM_TYPE type; - - /// Keeps track of the number of errors encountered so far. - int yyerrno; - - /// Keeps track of the current line number for error-handling routine. - int yylineno; - - /// Lexer buffer that corresponds to the current Service - /// Configurator file/direct scan. - ace_yy_buffer_state *buffer; - - /// Obstack used for efficient memory allocation when - /// parsing/scanning a service configurator directive. - ACE_Obstack_T obstack; - - /// A reference to the configuration - ACE_Service_Gestalt *config; -}; - -// Parameter that is passed down to the yyparse() function, and -// eventually to yylex(). -#define YYPARSE_PARAM ace_svc_conf_parameter - -#define YYLEX_PARAM YYPARSE_PARAM - -#define ACE_SVC_CONF_PARAM (static_cast (YYLEX_PARAM)) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SVC_CONF_PARAM_H */ - diff --git a/dep/include/ace/Svc_Conf_Token_Table.h b/dep/include/ace/Svc_Conf_Token_Table.h deleted file mode 100644 index 701032097be..00000000000 --- a/dep/include/ace/Svc_Conf_Token_Table.h +++ /dev/null @@ -1,83 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - $Id: Svc_Conf_Token_Table.h 82145 2008-06-24 11:03:50Z sma $ - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum ace_yytokentype { - ACE_DYNAMIC = 258, - ACE_STATIC = 259, - ACE_SUSPEND = 260, - ACE_RESUME = 261, - ACE_REMOVE = 262, - ACE_USTREAM = 263, - ACE_MODULE_T = 264, - ACE_STREAM_T = 265, - ACE_SVC_OBJ_T = 266, - ACE_ACTIVE = 267, - ACE_INACTIVE = 268, - ACE_PATHNAME = 269, - ACE_IDENT = 270, - ACE_STRING = 271 - }; -#endif -/* Tokens. */ -#define ACE_DYNAMIC 258 -#define ACE_STATIC 259 -#define ACE_SUSPEND 260 -#define ACE_RESUME 261 -#define ACE_REMOVE 262 -#define ACE_USTREAM 263 -#define ACE_MODULE_T 264 -#define ACE_STREAM_T 265 -#define ACE_SVC_OBJ_T 266 -#define ACE_ACTIVE 267 -#define ACE_INACTIVE 268 -#define ACE_PATHNAME 269 -#define ACE_IDENT 270 -#define ACE_STRING 271 - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define ace_yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - diff --git a/dep/include/ace/Svc_Conf_Tokens.h b/dep/include/ace/Svc_Conf_Tokens.h deleted file mode 100644 index 6be5c1c592c..00000000000 --- a/dep/include/ace/Svc_Conf_Tokens.h +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- -//==================================================================== -/** - * @file Svc_Conf_Tokens.h - * - * $Id: Svc_Conf_Tokens.h 81335 2008-04-11 01:53:36Z iliyan $ - * - * @author Iliyan Jeliazkov - */ -//==================================================================== - -#ifndef BISON_SVC_CONF_TAB_H -# define BISON_SVC_CONF_TAB_H - -/// This file "wraps" around the one produced by yacc(1) and ensures -/// that various symbols do not polute the global namespace. This -/// allows ACE-based applications to incorporate other yacc(1)-derived -/// parsers. - -# if !defined (YYSTYPE_IS_DECLARED) -# define YYSTYPE_IS_DECLARED 1 -# endif - -# include "ace/Svc_Conf_Token_Table.h" - -# undef YYSTYPE_IS_DECLARED - -#endif /* ifndef BISON_SVC_CONF_TAB_H */ - diff --git a/dep/include/ace/Svc_Handler.h b/dep/include/ace/Svc_Handler.h deleted file mode 100644 index f42cf42c4c0..00000000000 --- a/dep/include/ace/Svc_Handler.h +++ /dev/null @@ -1,346 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Svc_Handler.h - * - * $Id: Svc_Handler.h 81740 2008-05-20 17:56:02Z elliott_c $ - * - * @author Douglas Schmidt - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_SVC_HANDLER_H -#define ACE_SVC_HANDLER_H - -#include /**/ "ace/pre.h" - -#include "ace/Synch_Options.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Task.h" -#include "ace/Recyclable.h" -#include "ace/Reactor.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decls. -class ACE_Connection_Recycling_Strategy; - -// This enum is used as the flags parameter when calling the close() -// method on the ACE_Svc_Handler. -enum ACE_Svc_Handler_Close { NORMAL_CLOSE_OPERATION = 0x00, - CLOSE_DURING_NEW_CONNECTION = 0x01 - }; - -/** - * @class ACE_Svc_Handler - * - * @brief Defines the interface for a service that exchanges data with - * its connected peer. - * - * This class provides a well-defined interface that the - * Acceptor and Connector pattern factories use as their target. - * Typically, client applications will subclass ACE_Svc_Handler - * and do all the interesting work in the subclass. One thing - * that the ACE_Svc_Handler does contain is a PEER_STREAM - * endpoint that is initialized by an ACE_Acceptor or - * ACE_Connector when a connection is established successfully. - * This endpoint is used to exchange data between a - * ACE_Svc_Handler and the peer it is connected with. - */ -template -class ACE_Svc_Handler : public ACE_Task -{ -public: - - // Useful STL-style traits. - typedef ACE_PEER_STREAM_ADDR addr_type; - typedef ACE_PEER_STREAM stream_type; - - /** - * Constructor initializes the @a thr_mgr and @a mq by passing them - * down to the ACE_Task base class. The @a reactor is passed to - * the ACE_Event_Handler. - */ - ACE_Svc_Handler (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue *mq = 0, - ACE_Reactor *reactor = ACE_Reactor::instance ()); - - /// Destructor. - virtual ~ACE_Svc_Handler (void); - - /// Activate the client handler. This is typically called by the - /// ACE_Acceptor or ACE_Connector. - virtual int open (void * = 0); - - /** - * Object termination hook -- application-specific cleanup code goes - * here. This function is called by the idle() function if the object - * does not have a ACE_Connection_Recycling_Strategy associated with it. - * Also, due to this class's derivation from ACE_Task, close() is - * also called when a thread activated with this object exits. See - * ACE_Task::close() for further details. The default action of this - * function is to call handle_close() with the default arguments. - */ - virtual int close (u_long flags = 0); - - /** - * Call this method if you want to recycling the @c Svc_Handler - * instead of closing it. If the object does not have a recycler, - * it will be closed. - */ - virtual int idle (u_long flags = 0); - - /** - * Call this method if you want to get/set the state of the - * @c Svc_Handler. If the object does not have a recycler, this call - * will have no effect (and the accessor will return - * ACE_RECYCLABLE_UNKNOWN). - */ - virtual ACE_Recyclable_State recycle_state (void) const; - virtual int recycle_state (ACE_Recyclable_State new_state); - - /** - * When the svc_handle is no longer needed around as a hint, call - * this method. In addition, reset @c *act_holder to zero if - * @a act_holder != 0. - */ - virtual void cleanup_hint (void **act_holder = 0); - - // = Dynamic linking hooks. - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int init (int argc, ACE_TCHAR *argv[]); - - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int fini (void); - - /// Default version does no work and returns -1. Must be overloaded - /// by application developer to do anything meaningful. - virtual int info (ACE_TCHAR **info_string, size_t length) const; - - // = Demultiplexing hooks. - - /** - * Perform termination activities on the SVC_HANDLER. The default - * behavior is to close down the (to avoid descriptor leaks) - * and to this object (to avoid memory leaks)! If you - * don't want this behavior make sure you override this method... - */ - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Default behavior when timeouts occur is to close down the - /// by calling . - virtual int handle_timeout (const ACE_Time_Value &time, - const void *); - - /// Get the underlying handle associated with the . - virtual ACE_HANDLE get_handle (void) const; - - /// Set the underlying handle associated with the . - virtual void set_handle (ACE_HANDLE); - - /// Returns the underlying PEER_STREAM. Used by - /// and factories - ACE_PEER_STREAM &peer (void) const; - - /// Overloaded new operator. This method unobtrusively records if a - /// is allocated dynamically, which allows it to clean - /// itself up correctly whether or not it's allocated statically or - /// dynamically. - void *operator new (size_t n); - -#if defined (ACE_HAS_NEW_NOTHROW) - /// Overloaded new operator, nothrow_t variant. Unobtrusively records if a - /// is allocated dynamically, which allows it to clean - /// itself up correctly whether or not it's allocated statically or - /// dynamically. - void *operator new (size_t n, const ACE_nothrow_t&) throw(); -#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE) - void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */ -#endif - - /// This operator permits "placement new" on a per-object basis. - void * operator new (size_t n, void *p); - - /** - * Call this to free up dynamically allocated - * (otherwise you will get memory leaks). In general, you should - * call this method rather than since this method knows - * whether or not the object was allocated dynamically, and can act - * accordingly (i.e., deleting it if it was allocated dynamically). - */ - virtual void destroy (void); - - /** - * This really should be private so that users are forced to call - * . Unfortunately, the C++ standard doesn't allow there - * to be a public new and a private delete. It is a bad idea to - * call this method directly, so use instead, unless you - * know for sure that you've allocated the object dynamically. - */ - void operator delete (void *); - -#if !defined (ACE_LACKS_PLACEMENT_OPERATOR_DELETE) - /** - * This operator is necessary to complement the class-specific - * operator new above. Unfortunately, it's not portable to all C++ - * compilers... - */ - void operator delete (void *, void *); -#endif /* ACE_LACKS_PLACEMENT_OPERATOR_DELETE */ - - /// Close down the descriptor and unregister from the Reactor - void shutdown (void); - - /// Dump the state of an object. - void dump (void) const; - -public: - - // = The following methods are not suppose to be public. - - // Because friendship is *not* inherited in C++, these methods have - // to be public. - - // = Accessors to set/get the connection recycler. - - /// Set the recycler and the @a recycling_act that is used during - /// purging and caching. - virtual void recycler (ACE_Connection_Recycling_Strategy *recycler, - const void *recycling_act); - - /// Get the recycler. - virtual ACE_Connection_Recycling_Strategy *recycler (void) const; - - /// Get the recycling act. - virtual const void *recycling_act (void) const; - - /** - * Upcall made by the recycler when it is about to recycle the - * connection. This gives the object a chance to prepare itself for - * recycling. Return 0 if the object is ready for recycling, -1 on - * failures. - */ - virtual int recycle (void * = 0); - -protected: - /// Maintain connection with client. - ACE_PEER_STREAM peer_; - - /// Have we been dynamically created? - bool dynamic_; - - /// Keeps track of whether we are in the process of closing (required - /// to avoid circular calls to ). - bool closing_; - - /// Pointer to the connection recycler. - ACE_Connection_Recycling_Strategy *recycler_; - - /// Asynchronous Completion Token (ACT) to be used to when talking to - /// the recycler. - const void *recycling_act_; -}; - -/** - * @class ACE_Buffered_Svc_Handler - * - * @brief Defines the interface for a service that exchanges data with - * its connected peer and supports buffering. - * - * The buffering feature makes it possible to queue up - * ACE_Message_Blocks in an ACE_Message_Queue until (1) the - * queue is "full" or (2) a period of time elapses, at which - * point the queue is "flushed" via to the peer. - */ -template -class ACE_Buffered_Svc_Handler : public ACE_Svc_Handler -{ -public: - // = Initialization and termination methods. - /** - * Constructor initializes the @a thr_mgr and @a mq by passing them - * down to the ACE_Task base class. The @a reactor is passed to - * the ACE_Event_Handler. The @a max_buffer_size and - * @a relative_timeout are used to determine at what point to flush - * the @a mq. By default, there's no buffering at all. The - * @a relative_timeout value is interpreted to be in a unit that's - * relative to the current time returned by . - */ - ACE_Buffered_Svc_Handler (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue *mq = 0, - ACE_Reactor *reactor = ACE_Reactor::instance (), - size_t max_buffer_size = 0, - ACE_Time_Value *relative_timeout = 0); - - /// Destructor, which calls . - virtual ~ACE_Buffered_Svc_Handler (void); - - /** - * Insert the ACE_Message_Block chain rooted at @a message_block - * into the ACE_Message_Queue with the designated @a timeout. The - * method will be called if this causes the number of - * bytes to exceed the maximum buffer size or if the timeout period - * has elapsed. - */ - virtual int put (ACE_Message_Block *message_block, - ACE_Time_Value *timeout = 0); - - /// Flush the ACE_Message_Queue, which writes all the queued - /// ACE_Message_Blocks to the . - virtual int flush (void); - - /// This method is not currently implemented -- this is where the - /// integration with the would occur. - virtual int handle_timeout (const ACE_Time_Value &time, - const void *); - - /// Dump the state of an object. - void dump (void) const; - -protected: - /// Implement the flush operation on the ACE_Message_Queue, which - /// writes all the queued ACE_Message_Blocks to the . - /// Assumes that the caller holds the lock. - virtual int flush_i (void); - - /// Maximum size the can be before we have to flush - /// the buffer. - size_t maximum_buffer_size_; - - /// Current size in bytes of the contents. - size_t current_buffer_size_; - - /// Timeout value used to control when the buffer is flushed. - ACE_Time_Value next_timeout_; - - /// Interval of the timeout. - ACE_Time_Value interval_; - - /// Timeout pointer. - ACE_Time_Value *timeoutp_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Svc_Handler.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Svc_Handler.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_SVC_HANDLER_H */ - diff --git a/dep/include/ace/Synch.h b/dep/include/ace/Synch.h deleted file mode 100644 index 756b969ea6d..00000000000 --- a/dep/include/ace/Synch.h +++ /dev/null @@ -1,66 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Synch.h - * - * $Id: Synch.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Wrapper Facades for various synchronization mechanisms. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SYNCH_H -#define ACE_SYNCH_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (DO_NOT_INCLUDE_SYNCH_H) - -/* All the classes have been moved out into their own headers as part of - the compile-time and footprint reduction effort. */ - -#include "ace/Auto_Event.h" -#include "ace/Barrier.h" -#include "ace/Condition_Thread_Mutex.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" -#include "ace/Event.h" -#include "ace/Lock.h" -#include "ace/Manual_Event.h" -#include "ace/Mutex.h" -#include "ace/Null_Barrier.h" -#include "ace/Null_Condition.h" -#include "ace/Null_Mutex.h" -#include "ace/Null_Semaphore.h" -#include "ace/RW_Mutex.h" -#include "ace/RW_Thread_Mutex.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Semaphore.h" -#include "ace/Thread_Mutex.h" -#include "ace/Thread_Semaphore.h" -#include "ace/TSS_Adapter.h" - -// Include the templates here. -// FUZZ: disable check_for_synch_include -#include "ace/Synch_T.h" - -#if defined (ACE_LEGACY_MODE) -# include "ace/File_Lock.h" -# include "ace/Process_Semaphore.h" -# include "ace/Process_Mutex.h" -# include "ace/RW_Process_Mutex.h" -# include "ace/Test_and_Set.h" -#endif /* ACE_LEGACY_MODE */ - -#endif /* DO_NOT_INCLUDE_SYNCH_H */ - -#include /**/ "ace/post.h" -#endif /* ACE_SYNCH_H */ - diff --git a/dep/include/ace/Synch_Options.h b/dep/include/ace/Synch_Options.h deleted file mode 100644 index 6c39dd55218..00000000000 --- a/dep/include/ace/Synch_Options.h +++ /dev/null @@ -1,164 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Synch_Options.h - * - * $Id: Synch_Options.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SYNCH_OPTIONS_H -#define ACE_SYNCH_OPTIONS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Time_Value.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Synch_Options - * - * @brief Contains the values of options used to determine the - * synchronous and asynchronous behavior. - * - * The supported set of options is depicted in the following table. - * The Reactor column indicates whether or not the USE_REACTOR option is - * supplied. - * The Timeout column specifies the period of time specified by the object; - * Unused implies that USE_TIMEOUT is not included in the options and the - * default timeout value, ACE_Time_Value::zero, is specified, either - * explicitly or by default. - * - * - * - * - * - * - * - * - * - *
ReactorTimeoutBehavior
yesUnusedInfinite timeout (using Reactor); - * this is the default.
yestimeTry asynch transaction for the - * specified time (using Reactor)
yes0,0Poll; try, if EWOULDBLOCK, return - * immediately (using Reactor)
noUnusedBlock until completion (don't use Reactor)
notimeWait up to specified amount of time for - * completion (don't use Reactor)
no0,0Poll and return immediately
- */ -class ACE_Export ACE_Synch_Options -{ -public: - /// Options flags for controlling synchronization. - /** - * Note that these flags can be bit-wise "or'd" together if both - * options are desired. - */ - enum - { - /// Use the Reactor. - USE_REACTOR = 01, - /// Use the supplied timeout value. - USE_TIMEOUT = 02 - }; - - /** - * Initialize the object to default values unless specified otherwise. - * - * @param options Specifies the options to use; default is neither option - * (no reactor, no timeout). - * @param timeout Specifies the period of time to use for the operation's - * timeout. The default is ACE_Time_Value::zero, noted as - * 0,0 in the behavior options table. If a non-zero timeout - * is specified, the USE_TIMEOUT option is added to - * @a options. - * To use a zero timeout, USE_TIMEOUT must be explicitly - * specified in @a options. - * @param arg A completion tag that can be passed through the options; - * the class using ACE_Synch_Options can access this. - * ACE_Synch_Options makes no use of it internally. - */ - ACE_Synch_Options (unsigned long options = 0, - const ACE_Time_Value &timeout = ACE_Time_Value::zero, - const void *arg = 0); - - /// Initialize the object; arguments are the same as for the - /// constructor. - void set (unsigned long options = 0, - const ACE_Time_Value &timeout = ACE_Time_Value::zero, - const void *arg = 0); - - /// Returns true if the specified option(s) are enabled, false otherwise. - bool operator[] (unsigned long option) const; - - /// Adds the specified option(s) to the object; does not replace them. - void operator= (unsigned long option); - - /// Returns the "magic cookie" argument. - const void *arg (void) const; - - /// Set the "magic cookie" argument. - void arg (const void *); - - /// Returns a reference to the ACE_Time_Value. This value only makes - /// sense if (*this)[USE_TIMEOUT] is true. - const ACE_Time_Value &timeout (void) const; - - /// Set the timeout value. This method does not alter the options; in - /// particular, it doesn't add USE_TIMEOUT to the options when a non-zero - /// timeout is specified as the constructor and set() do. - void timeout (const ACE_Time_Value &tv); - - /** - * Returns a timeout pointer if (*this)[USE_TIMEOUT] is true, else 0. - * This should be used with care, e.g., the timeout pointer should not - * be stored in a manner that will lead to dangling pointers. - */ - const ACE_Time_Value *time_value (void) const; - - // = Static data members (singletons) - - /// This is the default setting for options, which will block - /// synchronously. - static ACE_Synch_Options defaults; - - /// This is the default synchronous setting. - static ACE_Synch_Options synch; - - /// This is the default asynchronous setting. - static ACE_Synch_Options asynch; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Keeps track of the enabled options. - unsigned long options_; - - /// Amount of time to wait for timeouts. - ACE_Time_Value timeout_; - - /** - * "Magic cookie" always passed in as an argument to the ACE_Reactor's - * schedule_timer() method. Used to communicate values for - * asynchronous programming. - */ - const void *arg_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_SYNCH_OPTIONS_H */ - diff --git a/dep/include/ace/Synch_T.h b/dep/include/ace/Synch_T.h deleted file mode 100644 index acd6da6eb86..00000000000 --- a/dep/include/ace/Synch_T.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Synch_T.h - * - * $Id: Synch_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SYNCH_T_H -#define ACE_SYNCH_T_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// FUZZ: disable check_for_synch_include -#include "ace/Synch.h" - -#include "ace/Lock_Adapter_T.h" -#include "ace/Reverse_Lock_T.h" -#include "ace/Guard_T.h" -#include "ace/TSS_T.h" -#include "ace/Condition_T.h" -#include "ace/Synch_Traits.h" - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Synch_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Synch_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_SYNCH_T_H */ - diff --git a/dep/include/ace/Synch_Traits.h b/dep/include/ace/Synch_Traits.h deleted file mode 100644 index c6649f9fdc8..00000000000 --- a/dep/include/ace/Synch_Traits.h +++ /dev/null @@ -1,153 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Synch_Traits.h - * - * $Id: Synch_Traits.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_SYNCH_TRAITS_H -#define ACE_SYNCH_TRAITS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" /* Need to know threads, template settings */ -#include "ace/Lock.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl -class ACE_Null_Mutex; -class ACE_Null_Condition; -class ACE_Null_Semaphore; -class ACE_Null_Mutex; -class ACE_Thread_Mutex; -class ACE_Process_Mutex; -class ACE_Recursive_Thread_Mutex; -class ACE_RW_Thread_Mutex; -class ACE_Condition_Thread_Mutex; -class ACE_Condition_Recursive_Thread_Mutex; -class ACE_Thread_Semaphore; - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -/** - * @class ACE_NULL_SYNCH - * - * @brief Implement a do nothing Synchronization wrapper that - * typedefs the @c ACE_Condition and @c ACE_Mutex to the - * @c Null* versions. - */ -class ACE_Export ACE_NULL_SYNCH -{ -public: - typedef ACE_Null_Mutex MUTEX; - typedef ACE_Null_Mutex NULL_MUTEX; - typedef ACE_Null_Mutex PROCESS_MUTEX; - typedef ACE_Null_Mutex RECURSIVE_MUTEX; - typedef ACE_Null_Mutex RW_MUTEX; - typedef ACE_Null_Condition CONDITION; - typedef ACE_Null_Condition RECURSIVE_CONDITION; - typedef ACE_Null_Semaphore SEMAPHORE; - typedef ACE_Null_Mutex NULL_SEMAPHORE; -}; - -#if defined (ACE_HAS_THREADS) - -class ACE_Process_Mutex; -class ACE_Condition_Recursive_Thread_Mutex; - -/** - * @class ACE_MT_SYNCH - * - * @brief Implement a default thread safe synchronization wrapper that - * typedefs the @c ACE_Condition and @c ACE_Mutex to the - * @c ACE_Condition and @c ACE_Mutex versions. - * - * @todo This should be a template, but SunC++ 4.0.1 complains about - * this. - */ -class ACE_Export ACE_MT_SYNCH -{ -public: - typedef ACE_Thread_Mutex MUTEX; - typedef ACE_Null_Mutex NULL_MUTEX; - typedef ACE_Process_Mutex PROCESS_MUTEX; - typedef ACE_Recursive_Thread_Mutex RECURSIVE_MUTEX; - typedef ACE_RW_Thread_Mutex RW_MUTEX; - typedef ACE_Condition_Thread_Mutex CONDITION; - typedef ACE_Condition_Recursive_Thread_Mutex RECURSIVE_CONDITION; - typedef ACE_Thread_Semaphore SEMAPHORE; - typedef ACE_Null_Semaphore NULL_SEMAPHORE; -}; - -#endif /* ACE_HAS_THREADS */ - -#define ACE_SYNCH_MUTEX ACE_SYNCH::MUTEX -#define ACE_SYNCH_NULL_MUTEX ACE_SYNCH::NULL_MUTEX -#define ACE_SYNCH_RECURSIVE_MUTEX ACE_SYNCH::RECURSIVE_MUTEX -#define ACE_SYNCH_RW_MUTEX ACE_SYNCH::RW_MUTEX -#define ACE_SYNCH_CONDITION ACE_SYNCH::CONDITION -#define ACE_SYNCH_RECURSIVE_CONDITION ACE_SYNCH::RECURSIVE_CONDITION -#define ACE_SYNCH_NULL_SEMAPHORE ACE_SYNCH::NULL_SEMAPHORE -#define ACE_SYNCH_SEMAPHORE ACE_SYNCH::SEMAPHORE - -#else /* !ACE_HAS_TEMPLATE_TYPEDEFS */ - -#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) -#define ACE_NULL_SYNCH ACE_Null_Mutex, ACE_Null_Condition, ACE_Null_Mutex -#define ACE_MT_SYNCH ACE_Thread_Mutex, ACE_Condition_Thread_Mutex, ACE_Thread_Semaphore -#else -#define ACE_NULL_SYNCH ACE_Null_Mutex, ACE_Null_Condition -#define ACE_MT_SYNCH ACE_Thread_Mutex, ACE_Condition_Thread_Mutex -#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ - -#if defined (ACE_HAS_THREADS) - -#define ACE_SYNCH_MUTEX ACE_Thread_Mutex -#define ACE_SYNCH_NULL_MUTEX ACE_Null_Mutex -#define ACE_SYNCH_RECURSIVE_MUTEX ACE_Recursive_Thread_Mutex -#define ACE_SYNCH_RW_MUTEX ACE_RW_Thread_Mutex -#define ACE_SYNCH_CONDITION ACE_Condition_Thread_Mutex -#define ACE_SYNCH_RECURSIVE_CONDITION ACE_Condition_Recursive_Thread_Mutex -#define ACE_SYNCH_SEMAPHORE ACE_Thread_Semaphore -#define ACE_SYNCH_NULL_SEMAPHORE ACE_Null_Semaphore - -#else /* ACE_HAS_THREADS */ - -#define ACE_SYNCH_MUTEX ACE_Null_Mutex -#define ACE_SYNCH_NULL_MUTEX ACE_Null_Mutex -#define ACE_SYNCH_RECURSIVE_MUTEX ACE_Null_Mutex -#define ACE_SYNCH_RW_MUTEX ACE_Null_Mutex -#define ACE_SYNCH_CONDITION ACE_Null_Condition -#define ACE_SYNCH_RECURSIVE_CONDITION ACE_Null_Condition -#define ACE_SYNCH_SEMAPHORE ACE_Null_Semaphore -#define ACE_SYNCH_NULL_SEMAPHORE ACE_Null_Mutex - -#endif /* ACE_HAS_THREADS */ -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ - -// These are available on *all* platforms -#define ACE_SYNCH_PROCESS_SEMAPHORE ACE_Process_Semaphore -#define ACE_SYNCH_PROCESS_MUTEX ACE_Process_Mutex - -#if defined (ACE_HAS_THREADS) -#define ACE_SYNCH ACE_MT_SYNCH -#else /* ACE_HAS_THREADS */ -#define ACE_SYNCH ACE_NULL_SYNCH -#endif /* ACE_HAS_THREADS */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_SYNCH_TRAITS_H */ - diff --git a/dep/include/ace/System_Time.h b/dep/include/ace/System_Time.h deleted file mode 100644 index 2b1c329108e..00000000000 --- a/dep/include/ace/System_Time.h +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file System_Time.h - * - * $Id: System_Time.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Prashant Jain - * @author Tim H. Harrison - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_SYSTEM_TIME_H -#define ACE_SYSTEM_TIME_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/os_include/os_time.h" /* For time_t. */ -#include "ace/os_include/os_limits.h" /* For MAXPATHLEN. */ -#include "ace/MMAP_Memory_Pool.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template class ACE_Malloc; -template class ACE_Allocator_Adapter; - -class ACE_Null_Mutex; -class ACE_Time_Value; -class ACE_MMAP_Memory_Pool; - -/** - * @class ACE_System_Time - * - * @brief Defines the timer services of the OS interface to access the - * system time either on the local host or on the central time - * server in the network. - */ -class ACE_Export ACE_System_Time -{ -public: - /** - * Enumeration types to specify mode of synchronization with master - * clock. Jump will set local system time directly (thus possibly - * producing time gaps or ambiguous local system times. Adjust will - * smoothly slow down or speed up the local system clock to reach - * the system time of the master clock. - */ - enum Sync_Mode { Jump, Adjust }; - - /// Default constructor. - ACE_System_Time (const ACE_TCHAR *poolname = 0); - - /// Default destructor. - ~ACE_System_Time (void); - - /// Get the local system time, i.e., the value returned by - /// ACE_OS::time(). - static int get_local_system_time (time_t & time_out); - - /// Get the local system time, i.e., the value returned by - /// ACE_OS::time(). - static int get_local_system_time (ACE_Time_Value &time_out); - - /// Get the system time of the central time server. - int get_master_system_time (time_t & time_out); - - /// Get the system time of the central time server. - int get_master_system_time (ACE_Time_Value &time_out); - - /// Synchronize local system time with the central time server using - /// specified mode. - int sync_local_system_time (ACE_System_Time::Sync_Mode mode); - -private: - typedef ACE_Malloc MALLOC; - typedef ACE_Allocator_Adapter ALLOCATOR; - - /// Our allocator (used for obtaining system time from shared memory). - ALLOCATOR * shmem_; - - /// The name of the pool used by the allocator. - ACE_TCHAR poolname_[MAXPATHLEN + 1]; - - /// Pointer to delta time kept in shared memory. - long * delta_time_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_SYSTEM_TIME_H */ - diff --git a/dep/include/ace/TLI.h b/dep/include/ace/TLI.h deleted file mode 100644 index 643b56418e9..00000000000 --- a/dep/include/ace/TLI.h +++ /dev/null @@ -1,116 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TLI.h - * - * $Id: TLI.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_TLI_H -#define ACE_TLI_H -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_TLI.h" - -#if defined (ACE_HAS_TLI) - -#include "ace/IPC_SAP.h" -#include "ace/Addr.h" -#include "ace/os_include/os_fcntl.h" - -// There's not a universal device name for TLI devices. If the platform -// needs something other than /dev/tcp, it needs to be set up in the config.h -// file as ACE_TLI_TCP_DEVICE. -#ifndef ACE_TLI_TCP_DEVICE -#define ACE_TLI_TCP_DEVICE "/dev/tcp" -#endif - -// There's not a universal device name for XTI/ATM devices. If the platform -// needs something other than /dev/xtisvc0, it needs to be set up in the -// config.h file as ACE_XTI_ATM_DEVICE. This may be FORE vendor specific and -// there may be no good default. -#ifndef ACE_XTI_ATM_DEVICE -#define ACE_XTI_ATM_DEVICE "/dev/xtisvc0" -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TLI - * - * @brief Defines the member functions for the base class of the - * ACE_TLI abstraction. - */ -class ACE_Export ACE_TLI : public ACE_IPC_SAP -{ -public: - // = Initialization and termination methods. - /// Initialize a TLI endpoint. - ACE_HANDLE open (const char device[], - int oflag = O_RDWR, - struct t_info *info = 0); - - /// Close a TLI endpoint and release resources. - int close (void); - - /// Set underlying protocol options. - int set_option (int level, int option, void *optval, int optlen); - - /// Get underlying protocol options. - int get_option (int level, int option, void *optval, int &optlen); - - // = Calls to underlying TLI operations. - int look (void) const; - int rcvdis (struct t_discon * = 0) const; - int snddis (struct t_call * = 0) const; - int sndrel (void) const; - int rcvrel (void) const; - - /// Return our local endpoint address. - int get_local_addr (ACE_Addr &) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Ensure we are an abstract class. - /// Default constructor. - ACE_TLI (void); - - /// Destructor. - ~ACE_TLI (void); - - /// Initialize a TLI endpoint. - ACE_TLI (const char device[], int oflag = O_RDWR, struct t_info *info = 0); - -private: -#if defined (ACE_HAS_SVR4_TLI) - // XTI/TLI option management. - struct t_optmgmt so_opt_req; - struct t_optmgmt so_opt_ret; -#endif /* ACE_HAS_SVR4_TLI */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/TLI.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TLI */ -#include /**/ "ace/post.h" -#endif /* ACE_TLI_H */ - diff --git a/dep/include/ace/TLI.inl b/dep/include/ace/TLI.inl deleted file mode 100644 index a8375130a8e..00000000000 --- a/dep/include/ace/TLI.inl +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -// -// $Id: TLI.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/TLI.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -int -ACE_TLI::look (void) const -{ - ACE_TRACE ("ACE_TLI::look"); - return ACE_OS::t_look (this->get_handle ()); -} - -ACE_INLINE -int -ACE_TLI::rcvdis (struct t_discon *discon) const -{ - ACE_TRACE ("ACE_TLI::rcvdis"); - return ACE_OS::t_rcvdis (this->get_handle (), discon); -} - -ACE_INLINE -int -ACE_TLI::snddis (struct t_call *call) const -{ - ACE_TRACE ("ACE_TLI::snddis"); - return ACE_OS::t_snddis (this->get_handle (), call); -} - -ACE_INLINE -int -ACE_TLI::rcvrel (void) const -{ - ACE_TRACE ("ACE_TLI::rcvrel"); - return ACE_OS::t_rcvrel (this->get_handle ()); -} - -ACE_INLINE -int -ACE_TLI::sndrel (void) const -{ - ACE_TRACE ("ACE_TLI::sndrel"); - return ACE_OS::t_sndrel (this->get_handle ()); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/TLI_Acceptor.h b/dep/include/ace/TLI_Acceptor.h deleted file mode 100644 index 87f73bb92ef..00000000000 --- a/dep/include/ace/TLI_Acceptor.h +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TLI_Acceptor.h - * - * $Id: TLI_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_TLI_ACCEPTOR_H -#define ACE_TLI_ACCEPTOR_H -#include /**/ "ace/pre.h" - -#include "ace/TLI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/TLI_Stream.h" -#include "ace/Default_Constants.h" - -#if defined (ACE_HAS_TLI) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward reference... -class ACE_TLI_Request_Queue; -class ACE_Time_Value; - -/** - * @class ACE_TLI_Acceptor - * - * @brief Defines the member functions for ACE_TLI_Acceptor abstraction. - * - * This class implements the algorithm described in Steve Rago's - * book on System V UNIX network programming. It basically - * makes TLI look like the C++ SOCK_SAP socket wrappers with - * respect to establishing passive-mode listener endpoints. - */ -class ACE_Export ACE_TLI_Acceptor : public ACE_TLI -{ -public: - friend class ACE_Request_Queue; - - // = Initialization and termination methods. - /// Default constructor. - ACE_TLI_Acceptor (void); - - /// Initiate a passive mode socket. - ACE_TLI_Acceptor (const ACE_Addr &remote_sap, - int reuse_addr = 0, - int oflag = O_RDWR, - struct t_info *info = 0, - int backlog = ACE_DEFAULT_BACKLOG, - const char device[] = ACE_TLI_TCP_DEVICE); - - /// Initiate a passive mode socket. - ACE_HANDLE open (const ACE_Addr &remote_sap, - int reuse_addr = 0, - int oflag = O_RDWR, - struct t_info *info = 0, - int backlog = ACE_DEFAULT_BACKLOG, - const char device[] = ACE_TLI_TCP_DEVICE); - - /// Close down the acceptor and release resources. - int close (void); - - // = Passive connection acceptance method. - - /** - * Accept a new data transfer connection. A @a timeout of 0 means - * block forever, a @a timeout of {0, 0} means poll. == 1 - * means "restart if interrupted." - */ - int accept (ACE_TLI_Stream &new_tli_sap, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0, - int rwflag = 1, - netbuf *udata = 0, - netbuf *opt = 0); - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_TLI_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Network "device" we are using. - const char *device_; - - /// Number of connections to queue. - int backlog_; - - /// Are we using "tirdwr" mod? - int rwflag_; - - /// Handle TLI accept insanity... - int handle_async_event (int restart, int rwflag); - - /// Used for queueing up pending requests. - ACE_TLI_Request_Queue *queue_; - - /// Used for handling disconnects - struct t_discon *disp_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TLI */ -#include /**/ "ace/post.h" -#endif /* ACE_TLI_ACCEPTOR_H */ - diff --git a/dep/include/ace/TLI_Connector.h b/dep/include/ace/TLI_Connector.h deleted file mode 100644 index 537ea879959..00000000000 --- a/dep/include/ace/TLI_Connector.h +++ /dev/null @@ -1,130 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TLI_Connector.h - * - * $Id: TLI_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_TLI_CONNECTOR_H -#define ACE_TLI_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include "ace/TLI_Stream.h" -#include "ace/Log_Msg.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TLI) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TLI_Connector - * - * @brief Defines an active connection factory for the ACE_TLI C++ - * wrappers. - */ -class ACE_Export ACE_TLI_Connector -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_TLI_Connector (void); - - /** - * Actively connect and produce a if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - */ - ACE_TLI_Connector (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0, - const char device[] = ACE_TLI_TCP_DEVICE, - struct t_info *info = 0, - int rw_flag = 1, - struct netbuf *udata = 0, - struct netbuf *opt = 0); - - /** - * Actively connect and produce a if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - */ - int connect (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0, - const char device[] = ACE_TLI_TCP_DEVICE, - struct t_info *info = 0, - int rw_flag = 1, - struct netbuf *udata = 0, - struct netbuf *opt = 0); - - /** - * Try to complete a non-blocking connection. - * If connection completion is successful then @a new_stream contains - * the connected ACE_SOCK_Stream. If @a remote_sap is non-NULL then it - * will contain the address of the connected peer. - */ - int complete (ACE_TLI_Stream &new_stream, - ACE_Addr *remote_sap, - ACE_Time_Value *tv); - - /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_TLI_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/TLI_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TLI */ -#include /**/ "ace/post.h" -#endif /* ACE_TLI_CONNECTOR_H */ - diff --git a/dep/include/ace/TLI_Connector.inl b/dep/include/ace/TLI_Connector.inl deleted file mode 100644 index 31bd3473509..00000000000 --- a/dep/include/ace/TLI_Connector.inl +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -// -// $Id: TLI_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_TLI_Connector::ACE_TLI_Connector (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - const char device[], - struct t_info *info, - int rw_flag, - struct netbuf *udata, - struct netbuf *opt) -{ - ACE_TRACE ("ACE_TLI_Connector::ACE_TLI_Connector"); - if (this->connect (new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - device, - info, - rw_flag, - udata, - opt) == -1 - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_TLI_Stream::ACE_TLI_Stream"))); -} - -ACE_INLINE -int -ACE_TLI_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/TLI_Stream.h b/dep/include/ace/TLI_Stream.h deleted file mode 100644 index 62fa9eb7311..00000000000 --- a/dep/include/ace/TLI_Stream.h +++ /dev/null @@ -1,141 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TLI_Stream.h - * - * $Id: TLI_Stream.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_TLI_STREAM_H -#define ACE_TLI_STREAM_H -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/TLI.h" - -#include "ace/INET_Addr.h" - -#if defined (ACE_HAS_TLI) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_TLI_Stream - * - * @brief Defines the member functions for ACE_TLI_Stream abstraction. - */ -class ACE_Export ACE_TLI_Stream : public ACE_TLI -{ -public: - friend class ACE_TLI_Acceptor; - friend class ACE_TLI_Connector; - - // = Initialization and termination methods. - /// Default constructor. - ACE_TLI_Stream (void); - - // = TLI-specific shutdown operations. - /// Close down and release resources. - int close (void); - - /// Send a release and then await the release from the other side. - int active_close (void); - - /// Acknowledge the release from the other side and then send the - /// release to the other side. - int passive_close (void); - - /// Return address of remotely connected peer. - int get_remote_addr (ACE_Addr &) const; - - // = timod bindings - /// Send an n byte buffer to the connected socket (uses t_snd(3)). - ssize_t send (const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout = 0) const; - - /// Recv an n byte buffer from the connected socket (uses t_rcv(3)). - ssize_t recv (void *buf, - size_t n, - int *flags, - const ACE_Time_Value *timeout = 0) const; - - /// Send exactly n bytes to the connected socket (uses t_snd(3)). - ssize_t send_n (const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0) const; - - /// Recv exactly n bytes from the connected socket (uses t_rcv(3)). - ssize_t recv_n (void *buf, - size_t n, - int *flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0) const; - - // = tirdwr bindings - /// Send an n byte buffer to the connected socket (uses write(2)). - ssize_t send (const void *buf, - size_t n, - const ACE_Time_Value *timeout = 0) const; - - /// Recv an n byte buffer from the connected socket (uses read(2)). - ssize_t recv (void *buf, - size_t n, - const ACE_Time_Value *timeout = 0) const; - - /// Send n bytes, keep trying until n are sent (uses write(2)). - ssize_t send_n (const void *buf, - size_t n, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0) const; - - /// Recv n bytes, keep trying until n are received (uses read (2)). - ssize_t recv_n (void *buf, - size_t n, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0) const; - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Indicates whether the tirdwr module should be pushed - int rwflag_; - - /// Get rwflag - int get_rwflag (void) const; - - /// Set rwflag - void set_rwflag (int value); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/TLI_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TLI */ -#include /**/ "ace/post.h" -#endif /* ACE_TLI_STREAM_H */ - diff --git a/dep/include/ace/TLI_Stream.inl b/dep/include/ace/TLI_Stream.inl deleted file mode 100644 index 1ef1a173e51..00000000000 --- a/dep/include/ace/TLI_Stream.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// -// $Id: TLI_Stream.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/TLI_Stream.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -void -ACE_TLI_Stream::set_rwflag (int value) -{ - ACE_TRACE ("ACE_TLI_Stream::set_rwflag"); - this->rwflag_ = value; -} - -ACE_INLINE -int -ACE_TLI_Stream::get_rwflag (void) const -{ - ACE_TRACE ("ACE_TLI_Stream::get_rwflag"); - return this->rwflag_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/TP_Reactor.h b/dep/include/ace/TP_Reactor.h deleted file mode 100644 index 5e4a07f3e1c..00000000000 --- a/dep/include/ace/TP_Reactor.h +++ /dev/null @@ -1,319 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TP_Reactor.h - * - * $Id: TP_Reactor.h 82393 2008-07-23 10:52:34Z johnnyw $ - * - * The ACE_TP_Reactor (aka, Thread Pool Reactor) uses the - * Leader/Followers pattern to demultiplex events among a pool of - * threads. When using a thread pool reactor, an application - * pre-spawns a fixed number of threads. When these threads - * invoke the ACE_TP_Reactor's handle_events() method, one thread - * will become the leader and wait for an event. The other - * follower threads will queue up waiting for their turn to become - * the leader. When an event occurs, the leader will pick a - * follower to become the leader and go on to handle the event. - * The consequence of using ACE_TP_Reactor is the amortization of - * the costs used to create threads. The context switching cost - * will also reduce. Moreover, the total resources used by - * threads are bounded because there are a fixed number of threads. - * - * @author Irfan Pyarali - * @author Nanbor Wang - */ -//============================================================================= - -#ifndef ACE_TP_REACTOR_H -#define ACE_TP_REACTOR_H - -#include /**/ "ace/pre.h" - -#include "ace/Select_Reactor.h" -#include "ace/Timer_Queue.h" /* Simple forward decl won't work... */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_EH_Dispatch_Info - * - * @brief This structure contains information of the activated event - * handler. - */ -class ACE_EH_Dispatch_Info -{ -public: - ACE_EH_Dispatch_Info (void); - - void set (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - ACE_EH_PTMF callback); - - bool dispatch (void) const; - - ACE_HANDLE handle_; - ACE_Event_Handler *event_handler_; - ACE_Reactor_Mask mask_; - ACE_EH_PTMF callback_; - int resume_flag_; - bool reference_counting_required_; - -private: - bool dispatch_; - - // Disallow copying and assignment. - ACE_EH_Dispatch_Info (const ACE_EH_Dispatch_Info &); - ACE_EH_Dispatch_Info &operator= (const ACE_EH_Dispatch_Info &); -}; - -/** - * @class ACE_TP_Token_Guard - * - * @brief A helper class that helps grabbing, releasing and waiting - * on tokens for a thread that tries calling handle_events (). - * - * In short, this class will be owned by one thread by creating on the - * stack. This class gives the status of the ownership of the token - * and manages the ownership - */ - -class ACE_TP_Token_Guard -{ -public: - - /// Constructor that will grab the token for us - ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token); - - /// Destructor. This will release the token if it hasnt been - /// released till this point - ~ACE_TP_Token_Guard (void); - - /// Release the token .. - void release_token (void); - - /// Returns whether the thread that created this object ownes the - /// token or not. - bool is_owner (void); - - /// A helper method that grabs the token for us, after which the - /// thread that owns that can do some actual work. - int acquire_read_token (ACE_Time_Value *max_wait_time = 0); - - /** - * A helper method that grabs the token for us, after which the - * thread that owns that can do some actual work. This differs from - * acquire_read_token() as it uses acquire () to get the token instead of - * acquire_read () - */ - int acquire_token (ACE_Time_Value *max_wait_time = 0); - -private: - - // Disallow default construction. - ACE_TP_Token_Guard (void); - - // Disallow copying and assignment. - ACE_TP_Token_Guard (const ACE_TP_Token_Guard &); - ACE_TP_Token_Guard &operator= (const ACE_TP_Token_Guard &); - -private: - - /// The Select Reactor token. - ACE_Select_Reactor_Token &token_; - - /// Flag that indicate whether the thread that created this object - /// owns the token or not. A value of false indicates that this class - /// hasnt got the token (and hence the thread) and a value of true - /// vice-versa. - bool owner_; - -}; - -/** - * @class ACE_TP_Reactor - * - * @brief Specialization of ACE_Select_Reactor to support thread-pool - * based event dispatching. - * - * One of the shortcomings of the ACE_Select_Reactor is that it - * does not support a thread pool-based event dispatching model, - * similar to the one in ACE_WFMO_Reactor. In ACE_Select_Reactor, only - * thread can call handle_events() at any given time. ACE_TP_Reactor - * removes this short-coming. - * - * ACE_TP_Reactor is a specialization of ACE_Select_Reactor to support - * thread pool-based event dispatching. This reactor takes advantage - * of the fact that events reported by @c select() are persistent if not - * acted upon immediately. It works by remembering the event handler - * which was just activated, suspending it for further I/O activities, - * releasing the internal lock (so that another thread can start waiting - * in the event loop) and then dispatching the event's handler outside the - * scope of the reactor lock. After the event handler has been dispatched - * the event handler is resumed for further I/O activity. - * - * This reactor implementation is best suited for situations when the - * callbacks to event handlers can take arbitrarily long and/or a number - * of threads are available to run the event loop. Note that I/O-processing - * callback code in event handlers (e.g. handle_input()) does not have to - * be modified or made thread-safe for this reactor. This is because - * before an I/O event is dispatched to an event handler, the handler is - * suspended; it is resumed by the reactor after the upcall completes. - * Therefore, multiple I/O events will not be made to one event handler - * multiple threads simultaneously. This suspend/resume protection does not - * apply to either timers scheduled with the reactor or to notifications - * requested via the reactor. When using timers and/or notifications you - * must provide proper protection for your class in the context of multiple - * threads. - */ -class ACE_Export ACE_TP_Reactor : public ACE_Select_Reactor -{ -public: - - /// Initialize ACE_TP_Reactor with the default size. - ACE_TP_Reactor (ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - bool mask_signals = true, - int s_queue = ACE_Select_Reactor_Token::FIFO); - - /** - * Initialize the ACE_TP_Reactor to manage - * @a max_number_of_handles. If @a restart is non-0 then the - * ACE_Reactor's @c handle_events() method will be restarted - * automatically when @c EINTR occurs. If @a sh or - * @a tq are non-0 they are used as the signal handler and - * timer queue, respectively. - */ - ACE_TP_Reactor (size_t max_number_of_handles, - int restart = 0, - ACE_Sig_Handler *sh = 0, - ACE_Timer_Queue *tq = 0, - bool mask_signals = true, - int s_queue = ACE_Select_Reactor_Token::FIFO); - - /** - * This event loop driver that blocks for @a max_wait_time before - * returning. It will return earlier if timer events, I/O events, - * or signal events occur. Note that @a max_wait_time can be 0, in - * which case this method blocks indefinitely until events occur. - * - * @a max_wait_time is decremented to reflect how much time this call - * took. For instance, if a time value of 3 seconds is passed to - * handle_events and an event occurs after 2 seconds, - * @a max_wait_time will equal 1 second. This can be used if an - * application wishes to handle events for some fixed amount of - * time. - * - * @return The total number of events that were dispatched; 0 if the - * @a max_wait_time elapsed without dispatching any handlers, or -1 - * if an error occurs (check @c errno for more information). - */ - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - - virtual int handle_events (ACE_Time_Value &max_wait_time); - - /// Does the reactor allow the application to resume the handle on - /// its own ie. can it pass on the control of handle resumption to - /// the application. The TP reactor has can allow applications to - /// resume handles. So return a positive value. - virtual int resumable_handler (void); - - /// Called from handle events - static void no_op_sleep_hook (void *); - - /// The ACE_TP_Reactor implementation does not have a single owner thread. - /// Attempts to set the owner explicitly are ignored. The reported owner - /// thread is the current Leader in the pattern. - virtual int owner (ACE_thread_t n_id, ACE_thread_t *o_id = 0); - - /// Return the thread ID of the current Leader. - virtual int owner (ACE_thread_t *t_id); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Internal methods that do the actual work. - - /// Template method from the base class. - virtual void clear_dispatch_mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /// Dispatch just 1 signal, timer, notification handlers - int dispatch_i (ACE_Time_Value *max_wait_time, - ACE_TP_Token_Guard &guard); - - /// Get the event that needs dispatching. It could be either a - /// signal, timer, notification handlers or return possibly 1 I/O - /// handler for dispatching. In the most common use case, this would - /// return 1 I/O handler for dispatching - int get_event_for_dispatching (ACE_Time_Value *max_wait_time); - -#if 0 - // @Ciju - // signal handling isn't in a production state yet. - // Commenting it out for now. - - /// Method to handle signals - /// @note It is just busted at this point in time. - int handle_signals (int &event_count, - ACE_TP_Token_Guard &g); -#endif // #if 0 - - /// Handle timer events - int handle_timer_events (int &event_count, - ACE_TP_Token_Guard &g); - - /// Handle notify events - int handle_notify_events (int &event_count, - ACE_TP_Token_Guard &g); - - /// handle socket events - int handle_socket_events (int &event_count, - ACE_TP_Token_Guard &g); - - /// This method shouldn't get called. - virtual void notify_handle (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Handle_Set &, - ACE_Event_Handler *eh, - ACE_EH_PTMF callback); -private: - - /// Get the handle of the notify pipe from the ready set if there is - /// an event in the notify pipe. - ACE_HANDLE get_notify_handle (void); - - /// Get socket event dispatch information. - int get_socket_event_info (ACE_EH_Dispatch_Info &info); - - /// Notify the appropriate in the context of the - /// associated with that a particular event has occurred. - int dispatch_socket_event (ACE_EH_Dispatch_Info &dispatch_info); - - /// Clear the @a handle from the read_set - void clear_handle_read_set (ACE_HANDLE handle); - - int post_process_socket_event (ACE_EH_Dispatch_Info &dispatch_info,int status); - -private: - /// Deny access since member-wise won't work... - ACE_TP_Reactor (const ACE_TP_Reactor &); - ACE_TP_Reactor &operator = (const ACE_TP_Reactor &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/TP_Reactor.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_TP_REACTOR_H */ - diff --git a/dep/include/ace/TP_Reactor.inl b/dep/include/ace/TP_Reactor.inl deleted file mode 100644 index 1a3f76deb23..00000000000 --- a/dep/include/ace/TP_Reactor.inl +++ /dev/null @@ -1,118 +0,0 @@ -// -*- C++ -*- -// -// $Id: TP_Reactor.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/************************************************************************/ -// Methods for ACE_EH_Dispatch_Info -/************************************************************************/ - -ACE_INLINE -ACE_EH_Dispatch_Info::ACE_EH_Dispatch_Info (void) : - handle_ (ACE_INVALID_HANDLE), - event_handler_ (0), - mask_ (ACE_Event_Handler::NULL_MASK), - callback_ (0), - resume_flag_ (ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER), - reference_counting_required_ (false), - dispatch_ (false) -{ -} - -ACE_INLINE void -ACE_EH_Dispatch_Info::set (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - ACE_EH_PTMF callback) -{ - this->dispatch_ = true; - - this->handle_ = handle; - this->event_handler_ = event_handler; - this->mask_ = mask; - this->callback_ = callback; - if (event_handler_) - { - this->resume_flag_ = event_handler->resume_handler (); - this->reference_counting_required_ = - (event_handler_->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED); - } - else - this->dispatch_ = false; -} - -ACE_INLINE bool -ACE_EH_Dispatch_Info::dispatch (void) const -{ - return this->dispatch_; -} - -/************************************************************************/ -// Methods for ACE_TP_Token_Guard -/************************************************************************/ - -ACE_INLINE -ACE_TP_Token_Guard::ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token) - - : token_ (token), - owner_ (false) -{ -} - -ACE_INLINE -ACE_TP_Token_Guard::~ACE_TP_Token_Guard (void) -{ - if (this->owner_) - { - ACE_MT (this->token_.release ()); - this->owner_ = false; - } -} - -ACE_INLINE void -ACE_TP_Token_Guard::release_token (void) -{ - if (this->owner_) - { - ACE_MT (this->token_.release ()); - - // We are not the owner anymore.. - this->owner_ = false; - } -} - -ACE_INLINE bool -ACE_TP_Token_Guard::is_owner (void) -{ - return this->owner_; -} - -/************************************************************************/ -// Methods for ACE_TP_Reactor -/************************************************************************/ - -ACE_INLINE void -ACE_TP_Reactor::no_op_sleep_hook (void *) -{ -} - -ACE_INLINE void -ACE_TP_Reactor::clear_handle_read_set (ACE_HANDLE handle) -{ - this->ready_set_.wr_mask_.clr_bit (handle); - this->ready_set_.ex_mask_.clr_bit (handle); - this->ready_set_.rd_mask_.clr_bit (handle); -} - -ACE_INLINE void -ACE_TP_Reactor::clear_dispatch_mask (ACE_HANDLE , - ACE_Reactor_Mask ) -{ - this->ready_set_.rd_mask_.reset (); - this->ready_set_.wr_mask_.reset (); - this->ready_set_.ex_mask_.reset (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/TSS_Adapter.h b/dep/include/ace/TSS_Adapter.h deleted file mode 100644 index 0729c1a7886..00000000000 --- a/dep/include/ace/TSS_Adapter.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file TSS_Adapter.h - * - * $Id: TSS_Adapter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Originally in Synch.h - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_TSS_ADAPTER_H -#define ACE_TSS_ADAPTER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TSS_Adapter - * - * @brief This class encapsulates a TSS object and its associated - * C++ destructor function. It is used by the ACE_TSS... - * methods (in Synch_T.cpp) in order to allow an extern - * "C" cleanup routine to be used. Needed by the "frigging" - * MVS C++ compiler. - * - * Objects of this class are stored in thread specific - * storage. ts_obj_ points to the "real" object and - * func_ is a pointer to the C++ cleanup function for ts_obj_. - */ -class ACE_Export ACE_TSS_Adapter -{ -public: - /// Initialize the adapter. - ACE_TSS_Adapter (void *object, ACE_THR_DEST f); - - /// Perform the cleanup operation. - void cleanup (void); - -//private: - - /// The real TS object. - void * const ts_obj_; - - /// The real cleanup routine for ts_obj; - ACE_THR_DEST func_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TSS_ADAPTER_H */ - diff --git a/dep/include/ace/TSS_T.h b/dep/include/ace/TSS_T.h deleted file mode 100644 index e00c1a0445e..00000000000 --- a/dep/include/ace/TSS_T.h +++ /dev/null @@ -1,254 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file TSS_T.h - * - * $Id: TSS_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_TSS_T_H -#define ACE_TSS_T_H -#include /**/ "ace/pre.h" - -#include "ace/Lock.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// This should probably go somewhere else, but it's only used here and -// in Thread_Manager. -// Note there is no ACE_TSS_SET because one would typicaly do -// 'ACE_TSS_GET()->xyz_ = value', so the macro would have been too -// complicated. -# if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) -# define ACE_TSS_TYPE(T) ACE_TSS< T > -# define ACE_TSS_GET(I, T) ((I)->operator T * ()) -# else -# define ACE_TSS_TYPE(T) T -# define ACE_TSS_GET(I, T) (I) -# endif /* ACE_HAS_THREADS && (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) */ - -#include "ace/Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TSS - * - * @brief Allows objects that are "physically" in thread specific - * storage (i.e., private to a thread) to be accessed as though - * they were "logically" global to a program. - * - * This class helps to maintain a separate copy of an object for each thread - * that needs access to it. All threads access a single instance of ACE_TSS - * to obtain a pointer to a thread-specific copy of a TYPE object. Using - * a pointer to TYPE in TSS instead of TYPE itself is useful because, - * in addition to avoiding copies on what may be a complex class, it allows - * assignment of objects to thread-specific data that have arbitrarily - * complex constructors. - * - * When the ACE_TSS object is destroyed, all threads's instances of the - * data are deleted. - * - * Modern compilers have no problem using a built-in type for @c TYPE. - * However, if you must use an older compiler that won't work with a built-in - * type, the ACE_TSS_Type_Adapter class template, below, can be used for - * adapting built-in types to work with ACE_TSS. - * - * @note Beware when creating static instances of this type - * (as with any other, btw). The unpredictable order of initialization - * across different platforms may cause a situation where one uses - * the instance before it is fully initialized. That's why typically - * instances of this type are dynamicaly allocated. On the stack it is - * typically allocated inside the ACE_Thread::svc() method which - * limits its lifetime appropriately. - * - */ -template -class ACE_TSS -{ -public: - /** - * Default constructor. Can also initialize this ACE_TSS instance, - * readying it for use by the calling thread as well as all other - * threads in the process. If the constructor does not initialize this - * object, the first access to it will perform the initialization, which - * could possibly (under odd error conditions) fail. - * - * @param ts_obj If non-zero, this object is initialized for use by - * all threads and @a ts_obj is used to set the - * thread-specific value for the calling thread. Other - * threads use the ts_object (TYPE *) method to set - * a specific value. - */ - ACE_TSS (TYPE *ts_obj = 0); - - /// Deregister this object from thread-specific storage administration. - /// Will cause all threads' copies of TYPE to be destroyed. - virtual ~ACE_TSS (void); - - /** - * Set the thread-specific object for the calling thread. - * If this object has not been initialized yet, this method performs the - * initialization. - * - * @param new_ts_obj The new value for the calling thread's copy of - * this object. - * - * @return The previous value of the calling thread's copy of this - * object; 0 if there was no previous value. This method also - * returns 0 on errors. To tell the difference between an error - * and a returned 0 pointer, it's recommended that one set errno - * to 0 prior to calling ts_object() and check for a new errno - * value if ts_object() returns 0. - */ - TYPE *ts_object (TYPE *new_ts_obj); - - /** @name Accessors - * - * All accessors return a pointer to the calling thread's copy of the - * TYPE data. The pointer may be 0 on error conditions or if the calling - * thread's copy of the data has not yet been set. See specific method - * descriptions for complete details. - */ - //@{ - /** - * Get the thread-specific object for this object. - * - * @return 0 if the object has never been initialized, otherwise returns - * the calling thread's copy of the data. The returned pointer - * may be 0 under odd error conditions; check errno for further - * information. - */ - TYPE *ts_object (void) const; - - /** - * Use a "smart pointer" to get the thread-specific data associated - * with this object. - * If this ACE_TSS object hasn't been initialized, this method - * will initialize it as a side-affect. If the calling thread has not - * set a value, a default-constructed instance of TYPE is allocated and it - * becomes the thread's instance. - * - * @return The calling thread's copy of the data. The returned pointer - * may be 0 under odd error conditions; check errno for further - * information. - */ - TYPE *operator-> () const; - - /** - * Obtain a pointer to the calling thread's TYPE object. - * If this ACE_TSS object hasn't been initialized, this method - * will initialize it as a side-affect. If the calling thread has not - * set a value, a default-constructed instance of TYPE is allocated and it - * becomes the thread's instance. - * - * @return The calling thread's copy of the data. The returned pointer - * may be 0 under odd error conditions; check errno for further - * information. - */ - operator TYPE *(void) const; - - //@} - - /// Hook for construction parameters. - virtual TYPE *make_TSS_TYPE (void) const; - - // = Utility methods. - - /// Dump the state of an object. - void dump (void) const; - - // ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - /// Actually implements the code that retrieves the object from - /// thread-specific storage. - TYPE *ts_get (void) const; - - /// Factors out common code for initializing TSS. This must NOT be - /// called with the lock held... - int ts_init (void); - -#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) - /// This implementation only works for non-threading systems... - TYPE *type_; -#else - /// Avoid race conditions during initialization. - ACE_Thread_Mutex keylock_; - - /// "First time in" flag. - volatile bool once_; - - /// Key for the thread-specific error data. - ACE_thread_key_t key_; - - /// "Destructor" that deletes internal TYPE * when thread exits. - static void cleanup (void *ptr); -#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */ - // = Disallow copying... - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_TSS &)) - ACE_UNIMPLEMENTED_FUNC (ACE_TSS (const ACE_TSS &)) -}; - -/** - * @class ACE_TSS_Type_Adapter - * - * @brief Adapter that allows built-in types to be used with ACE_TSS. - * - * Wraps a value of a built-in type, providing conversions to - * and from the type. Example use with ACE_TSS: - * ACE_TSS > i; - * *i = 37; - * ACE_OS::fprintf (stderr, "%d\n", *i); - * Unfortunately, though, some compilers have trouble with the - * implicit type conversions. This seems to work better: - * ACE_TSS > i; - * i->operator int & () = 37; - * ACE_OS::fprintf (stderr, "%d\n", i->operator int ()); - */ -template -class ACE_TSS_Type_Adapter -{ -public: - /// Constructor. Inlined here so that it should _always_ be inlined. - ACE_TSS_Type_Adapter (const TYPE value = 0): value_ (value) {} - - /// TYPE conversion. Inlined here so that it should _always_ be - /// inlined. - operator TYPE () const { return value_; }; - - /// TYPE & conversion. Inlined here so that it should _always_ be - /// inlined. - operator TYPE &() { return value_; }; - -private: - /// The wrapped value. - TYPE value_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/TSS_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/TSS_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("TSS_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TSS_T_H */ - diff --git a/dep/include/ace/TSS_T.inl b/dep/include/ace/TSS_T.inl deleted file mode 100644 index 571eab8f643..00000000000 --- a/dep/include/ace/TSS_T.inl +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -// -// $Id: TSS_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_TSS::ACE_TSS (TYPE *type) - : type_ (type) -{ -} - -template ACE_INLINE int -ACE_TSS::ts_init (void) -{ - return 0; -} - -template ACE_INLINE TYPE * -ACE_TSS::ts_object (void) const -{ - return this->type_; -} - -template ACE_INLINE TYPE * -ACE_TSS::ts_object (TYPE *type) -{ - this->type_ = type; - return this->type_; -} - -template ACE_INLINE TYPE * -ACE_TSS::ts_get (void) const -{ - return this->type_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ! (defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) */ diff --git a/dep/include/ace/TTY_IO.h b/dep/include/ace/TTY_IO.h deleted file mode 100644 index c7404e84af8..00000000000 --- a/dep/include/ace/TTY_IO.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TTY_IO.h - * - * $Id: TTY_IO.h 82271 2008-07-09 09:23:03Z olli $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TTY_IO_H -#define ACE_TTY_IO_H - -#include "ace/DEV_IO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_TTY_IO - * - * @brief Class definitions for platform specific TTY features. - * - * This class represents an example interface for a specific - * device (a serial line). It extends the capability of the - * underlying DEV_IO class by adding a control method that takes - * a special structure (Serial_Params) as argument to allow a - * comfortable user interface (away from that annoying termios - * structure, which is very specific to UNIX). - */ -class ACE_Export ACE_TTY_IO : public ACE_DEV_IO -{ -public: - enum Control_Mode - { - SETPARAMS, ///< Set control parameters. - GETPARAMS ///< Get control parameters. - }; - - struct ACE_Export Serial_Params - { - Serial_Params (void); - - /** Specifies the baudrate at which the communnication port operates. */ - int baudrate; - /** Specifies the minimum number of bytes in input buffer before XON char - is sent. Negative value indicates that default value should - be used (Win32). */ - int xonlim; - /** Specifies the maximum number of bytes in input buffer before XOFF char - is sent. Negative value indicates that default value should - be used (Win32). */ - int xofflim; - /** Specifies the minimum number of characters for non-canonical - read (POSIX). */ - unsigned int readmincharacters; - /** Specifies the time to wait before returning from read. Negative value - means infinite timeout. */ - int readtimeoutmsec; - /** Specifies the parity mode. POSIX supports "none", "even" and - "odd" parity. Additionally Win32 supports "mark" and "space" - parity modes. */ - const char *paritymode; - /** Enable & set CTS mode. Note that RTS & CTS are enabled/disabled - together on some systems (RTS/CTS is enabled if either - ctsenb or rtsenb is set). */ - bool ctsenb; - /** Enable & set RTS mode. Note that RTS & CTS are enabled/disabled - together on some systems (RTS/CTS is enabled if either - ctsenb or rtsenb is set). - - 0 = Disable RTS. - - 1 = Enable RTS. - - 2 = Enable RTS flow-control handshaking (Win32). - - 3 = Specifies that RTS line will be high if bytes are available - for transmission. After transmission RTS will be low (Win32). */ - unsigned char rtsenb; - /** Enable/disable software flow control on input. */ - bool xinenb; - /** Enable/disable software flow control on output. */ - bool xoutenb; - /** Specifies if device is a modem (POSIX). If not set modem status - lines are ignored. */ - bool modem; - /** Enable/disable receiver (POSIX). */ - bool rcvenb; - /** Controls whether DSR is disabled or enabled (Win32). */ - bool dsrenb; - /** Controls whether DTR is disabled or enabled. */ - bool dtrdisable; - /** Data bits. Valid values 5, 6, 7 and 8 data bits. - Additionally Win32 supports 4 data bits. */ - unsigned char databits; - /** Stop bits. Valid values are 1 and 2. */ - unsigned char stopbits; - }; - - /** Interface for reading/writing serial device parameters. */ - int control (Control_Mode cmd, Serial_Params *arg) const; - -#if defined (ACE_NEEDS_DEV_IO_CONVERSION) - /** This is necessary to pass ACE_TTY_IO as parameter to DEV_Connector. */ - operator ACE_DEV_IO &(); -#endif /* ACE_NEEDS_DEV_IO_CONVERSION */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_TTY_IO_H */ - diff --git a/dep/include/ace/Task.h b/dep/include/ace/Task.h deleted file mode 100644 index fb3c8604c2c..00000000000 --- a/dep/include/ace/Task.h +++ /dev/null @@ -1,308 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Task.h - * - * $Id: Task.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TASK_H -#define ACE_TASK_H -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Thread_Manager.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Task_Flags - * - * @brief These flags are used within the ACE_Task. - * - * These flags should be hidden within ACE_Task. Unfortunately, the - * HP/UX C++ compiler can't grok this... Fortunately, there's no - * code defined here, so we don't have to worry about multiple - * definitions. - */ -namespace ACE_Task_Flags -{ - enum - { - /// Identifies a Task as being the "reader" in a Module. - ACE_READER = 01, - /// Just flush data messages in the queue. - ACE_FLUSHDATA = 02, - /// Flush all messages in the Queue. - ACE_FLUSHALL = 04, - /// Flush read queue - ACE_FLUSHR = 010, - /// Flush write queue - ACE_FLUSHW = 020, - /// Flush both queues - ACE_FLUSHRW = 030 - }; -} - -/** - * @class ACE_Task_Base - * - * @brief Direct base class for the ACE_Task template. - * - * This class factors out the non-template code in order to - * reduce template bloat, as well as to make it possible for the - * ACE_Thread_Manager to store ACE_Task_Base *'s - * polymorphically. - */ -class ACE_Export ACE_Task_Base : public ACE_Service_Object -{ -public: - // = Initialization and termination methods. - /// Constructor. - ACE_Task_Base (ACE_Thread_Manager * = 0); - - /// Destructor. - virtual ~ACE_Task_Base (void); - - // = Initialization and termination hooks. - - // These methods should be overridden by subclasses if you'd like to - // provide -specific initialization and termination behavior. - - /// Hook called to initialize a task and prepare it for execution. - /// @a args can be used to pass arbitrary information into . - virtual int open (void *args = 0); - - /** - * Hook called from ACE_Thread_Exit when during thread exit and from - * the default implementation of . In general, this - * method shouldn't be called directly by an application, - * particularly if the is running as an Active Object. - * Instead, a special message should be passed into the via - * the method defined below, and the method should - * interpret this as a flag to shut down the . - */ - virtual int close (u_long flags = 0); - - /** - * Hook called during . The default - * implementation calls forwards the call to close(1). Please - * notice the changed value of the default argument of . - * This allows tasks to differ between the call has been originated - * from or from . Be aware that - * close(0) will be also called when a thread associated with the - * ACE_Task instance exits. - */ - virtual int module_closed (void); - - // = Immediate and deferred processing methods, respectively. - - // These methods should be overridden by subclasses if you'd like to - // provide -specific message processing behavior. - - /// A hook method that can be used to pass a message to a - /// task, where it can be processed immediately or queued for subsequent - /// processing in the hook method. - virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0); - - /// Run by a daemon thread to handle deferred processing. - virtual int svc (void); - - // = Active object activation method. - /** - * Turn the task into an active object, i.e., having @a n_threads of - * control, all running at the @a priority level (see below) with the - * same @a grp_id, all of which invoke . Returns -1 if - * failure occurs, returns 1 if Task is already an active object and - * @a force_active is false (i.e., do *not* create a new thread in - * this case), and returns 0 if Task was not already an active - * object and a thread is created successfully or thread is an - * active object and @a force_active is true. Note that if - * @a force_active is true and there are already threads spawned in - * this , the @a grp_id parameter is ignored and the @a grp_id - * of any newly activated thread(s) will inherit the existing - * @a grp_id of the existing thread(s) in the . - * - * The <{flags}> 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, THR_EXPLICIT_SCHED, - * THR_SCOPE_SYSTEM, THR_SCOPE_PROCESS - * = END - * If THR_SCHED_INHERIT is not desirable, applications should - * specifically pass in THR_EXPLICIT_SCHED. - * - * - * By default, or if <{priority}> is set to - * ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for - * the given scheduling policy (specified in <{flags}>, 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. - * - * If @a thread_handles != 0 it is assumed to be an array of @a n - * thread_handles that will be assigned the values of the thread - * handles being spawned. Returns -1 on failure (@c errno will - * explain...), otherwise returns the group id of the threads. - * - * Assigning @a task allows you to associate the newly spawned - * threads with an instance of ACE_Task_Base. If @a task == 0, then - * the new threads are associated automatically with @c this - * ACE_Task_Base. Setting the @a task argument to value other than - * @c this makes the thread manipulating methods, such as wait(), - * suspend(), resume(), useless. Threads spawned with user - * specified @a task value must therefore be manipulated thru - * ACE_Thread_Manager directly. - * - * If @a stack != 0 it is assumed to be an array of @a n pointers to - * the base of the stacks to use for the threads being spawned. - * Likewise, if @a stack_size != 0 it is assumed to be an array of - * @a n values indicating how big each of the corresponding @a stacks - * are. - * - * - */ - virtual int activate (long flags = THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, - int n_threads = 1, - int force_active = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_thread_t thread_ids[] = 0, - const char* thr_name[] = 0); - - /** - * Block until there are no more threads running in this task. - * This method will not wait for either detached or daemon threads; - * the threads must have been spawned with the @c THR_JOINABLE flag. - * Upon successful completion, the threads have been joined, so further - * attempts to join with any of the waited-for threads will fail. - * - * @retval 0 Success. - * @retval -1 Failure (consult errno for further information). - */ - virtual int wait (void); - - // = Suspend/resume a Task. - - // Note that these methods are not portable and should be avoided - // since they are inherently error-prone to use. They are only here - // for (the rare) applications that know how to use them correctly. - /// Suspend a task. - virtual int suspend (void); - /// Resume a suspended task. - virtual int resume (void); - - /// Get the current group id. - int grp_id (void) const; - - /// Set the current group id. - void grp_id (int); - - /// Get the thread manager associated with this Task. - ACE_Thread_Manager *thr_mgr (void) const; - - /// Set the thread manager associated with this Task. - void thr_mgr (ACE_Thread_Manager *); - - /// True if queue is a reader, else false. - int is_reader (void) const; - - /// True if queue is a writer, else false. - int is_writer (void) const; - - /** - * Returns the number of threads currently running within a task. - * If we're a passive object this value is 0, else it's greater than - * 0. - */ - size_t thr_count (void) const; - - /** - * Returns the thread ID of the thread whose exit caused this object's - * thread count to be decremented to 0. - * - * When a thread spawned in the context of this object (using activate()) - * returns from its svc() method ACE calls the close() hook. Before it does - * so, it decrements the number of active threads. If the number of threads - * is decremented to 0, the thread ID of the current thread is stored for - * access by this method. If the returned thread ID matches the calling - * thread's ID, the calling thread knows that there are no other threads - * still active in the ACE_Task. - * - * @retval ACE_thread_t of the last thread to close. 0 if the last thread - * is not yet known; for example, if no threads are active, or if - * multiple threads are active. - */ - ACE_thread_t last_thread (void) const; - - /// Routine that runs the service routine as a daemon thread. - static ACE_THR_FUNC_RETURN svc_run (void *); - - /// Cleanup hook that is called when a thread exits to gracefully - /// shutdown an ACE_Task. - static void cleanup (void *object, void *params); - -protected: - /** - * Count of the number of threads running within the task. If this - * value is greater than 0 then we're an active object and the value - * of is the number of active threads at this instant. - * If the value == 0, then we're a passive object. - */ - size_t thr_count_; - - /// Multi-threading manager. - ACE_Thread_Manager *thr_mgr_; - - /// ACE_Task flags. - u_long flags_; - - /// This maintains the group id of the Task. - int grp_id_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Protect the state of a Task during concurrent operations, but - /// only if we're configured as MT safe... - ACE_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ - - /// Holds the thread ID of the last thread to exit svc() in this object. - ACE_thread_t last_thread_id_; - -private: - - // = Disallow these operations. - ACE_Task_Base &operator= (const ACE_Task_Base &); - ACE_Task_Base (const ACE_Task_Base &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Task.inl" -#endif /* __ACE_INLINE__ */ - -// Include the ACE_Task templates classes at this point. -#include "ace/Task_T.h" - -#include /**/ "ace/post.h" -#endif /* ACE_TASK_H */ - diff --git a/dep/include/ace/Task.inl b/dep/include/ace/Task.inl deleted file mode 100644 index 9f70371e5f5..00000000000 --- a/dep/include/ace/Task.inl +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- -// -// $Id: Task.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Get the current group id. -ACE_INLINE int -ACE_Task_Base::grp_id (void) const -{ - ACE_TRACE ("ACE_Task_Base::grp_id"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, const_cast (this->lock_), -1)); - return this->grp_id_; -} - -// Set the current group id. - -ACE_INLINE void -ACE_Task_Base::grp_id (int identifier) -{ - ACE_TRACE ("ACE_Task_Base::grp_id"); - ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_)); - - // Cache the group id in the task and then set it in the - // Thread_Manager, if there is one. - this->grp_id_ = identifier; - if (this->thr_mgr ()) - this->thr_mgr ()->set_grp (this, identifier); -} - -ACE_INLINE ACE_Thread_Manager * -ACE_Task_Base::thr_mgr (void) const -{ - ACE_TRACE ("ACE_Task_Base::thr_mgr"); - return this->thr_mgr_; -} - -ACE_INLINE void -ACE_Task_Base::thr_mgr (ACE_Thread_Manager *thr_mgr) -{ - ACE_TRACE ("ACE_Task_Base::thr_mgr"); - this->thr_mgr_ = thr_mgr; -} - -ACE_INLINE int -ACE_Task_Base::is_reader (void) const -{ - ACE_TRACE ("ACE_Task_Base::is_reader"); - return (ACE_BIT_ENABLED (this->flags_, ACE_Task_Flags::ACE_READER)); -} - -ACE_INLINE int -ACE_Task_Base::is_writer (void) const -{ - ACE_TRACE ("ACE_Task_Base::is_writer"); - return (ACE_BIT_DISABLED (this->flags_, ACE_Task_Flags::ACE_READER)); -} - -// Return the count of the current number of threads. -ACE_INLINE size_t -ACE_Task_Base::thr_count (void) const -{ - ACE_TRACE ("ACE_Task_Base::thr_count"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, const_cast (this->lock_), 0)); - - return this->thr_count_; -} - -// Return the thread ID of the last thread to exit svc(). -ACE_INLINE ACE_thread_t -ACE_Task_Base::last_thread (void) const -{ - ACE_TRACE ("ACE_Task_Base::last_thread"); - return this->last_thread_id_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Task_Ex_T.h b/dep/include/ace/Task_Ex_T.h deleted file mode 100644 index 031b2a1f4f5..00000000000 --- a/dep/include/ace/Task_Ex_T.h +++ /dev/null @@ -1,206 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Task_Ex_T.h - * - * $Id: Task_Ex_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Kobi Cohen-Arazi - */ -//============================================================================= - -#ifndef ACE_TASK_EX_T_H -#define ACE_TASK_EX_T_H -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_Traits.h" -#include "ace/Task.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decls... -template class ACE_Module; - -/** - * @class ACE_Task_Ex - * - * @brief Primary interface for application message processing, as well - * as input and output message queueing. - * - * Unlike ACE_Task, these class doesn't have the ability to be a part of - * a Stream chain. I.e. You cannot (yet) chain modules based on ACE_Task_Ex. - * - * @todo: We can merge ACE_Task and ACE_Task_Ex to be one class. - * something like that: - * template - * class ACE_Task : public ACE_Task_Base - * { - * // use here the code from ACE_Task_Ex using ACE_Message_Queue_Ex - * }; - * - * Now specialized version of ACE_Task with ACE_Message_Block as its - * ACE_MESSAGE_TYPE... - * - * template - * class ACE_Task : public ACE_Task_Base - * { - * // put here the good old ACE_Task code - * }; - * - * When User (and legacy code) write ACE_Task, specialized ACE_Task - * code is in action. - */ -template -class ACE_Task_Ex : public ACE_Task_Base -{ -public: - friend class ACE_Module; - friend class ACE_Module_Type; - typedef ACE_Message_Queue_Ex MESSAGE_QUEUE_EX; - - // = Initialization/termination methods. - /** - * Initialize a Task, supplying a thread manager and a message - * queue. If the user doesn't supply a ACE_Message_Queue pointer - * then we'll allocate one dynamically. Otherwise, we'll use the - * one passed as a parameter. - */ - ACE_Task_Ex (ACE_Thread_Manager *thr_mgr = 0, - MESSAGE_QUEUE_EX *mq = 0); - - /// Destructor. - virtual ~ACE_Task_Ex (void); - - /// Gets the message queue associated with this task. - MESSAGE_QUEUE_EX *msg_queue (void); - - /// Sets the message queue associated with this task. - void msg_queue (MESSAGE_QUEUE_EX *); - -public: // Should be protected: - // = Message queue manipulation methods. - - // = Enqueue and dequeue methods. - - // For the following five method if @a timeout == 0, the caller will - // block until action is possible, else will wait until the - // <{absolute}> time specified in *@a timeout elapses). These calls - // will return, however, when queue is closed, deactivated, when a - // signal occurs, or if the time specified in timeout elapses, (in - // which case errno = EWOULDBLOCK). - - /// Insert message into the message queue. Note that @a timeout uses - /// <{absolute}> time rather than <{relative}> time. - int putq (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout = 0); - - /** - * Extract the first message from the queue (blocking). Note that - * @a timeout uses <{absolute}> time rather than <{relative}> time. - * Returns number of items in queue if the call succeeds or -1 otherwise. - */ - int getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *timeout = 0); - - /// Return a message to the queue. Note that @a timeout uses - /// <{absolute}> time rather than <{relative}> time. - int ungetq (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout = 0); - - /** - * Turn the message around and send it back down the Stream. Note - * that @a timeout uses <{absolute}> time rather than <{relative}> - * time. - */ - int reply (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout = 0); - - /** - * Transfer message to the adjacent ACE_Task_Ex in a ACE_Stream. Note - * that @a timeout uses <{absolute}> time rather than <{relative}> - * time. - */ - int put_next (ACE_MESSAGE_TYPE *msg, ACE_Time_Value *timeout = 0); - - /** - * Tests whether we can enqueue a message without blocking. - * @deprecated This method is deprecated and will go away in the future. - */ - int can_put (ACE_MESSAGE_TYPE *); - - // = ACE_Task utility routines to identify names et al. - /// Return the name of the enclosing Module if there's one associated - /// with the Task, else returns 0. - const ACE_TCHAR *name (void) const; - - // = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream). - /// Get next Task pointer. - ACE_Task *next (void); - - /// Set next Task pointer. - void next (ACE_Task *); - - /// Alwasy return 0. @todo FIXME - ACE_Task *sibling (void); - - /// Return the Task's Module if there is one, else returns 0. - ACE_Module *module (void) const; - - /** - * Flush the task's queue, i.e., free all of the enqueued - * message blocks and releases any threads blocked on the queue. - * Note that if this conflicts with the C++ iostream - * function, just rewrite the iostream function as ::. - */ - int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); - - // = Special routines corresponding to certain message types. - - /// Manipulate watermarks. - void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t); - - /// Queue of messages on the ACE_Task.. - MESSAGE_QUEUE_EX *msg_queue_; - - /// true if should delete Message_Queue, false otherwise. - bool delete_msg_queue_; - - /// Back-pointer to the enclosing module. - ACE_Module *mod_; - - /// Pointer to adjacent ACE_Task. - ACE_Task *next_; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task_Ex &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Task_Ex (const ACE_Task_Ex &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Task_Ex_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Task_Ex_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Task_Ex_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TASK_EX_H */ - diff --git a/dep/include/ace/Task_Ex_T.inl b/dep/include/ace/Task_Ex_T.inl deleted file mode 100644 index dd90bcd499a..00000000000 --- a/dep/include/ace/Task_Ex_T.inl +++ /dev/null @@ -1,109 +0,0 @@ -// -*- C++ -*- -// -// $Id: Task_Ex_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Task_Ex::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, - size_t wm_size) -{ - ACE_TRACE ("ACE_Task_Ex::water_marks"); - if (cmd == ACE_IO_Cntl_Msg::SET_LWM) - this->msg_queue_->low_water_mark (wm_size); - else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */ - this->msg_queue_->high_water_mark (wm_size); -} - -template ACE_INLINE int -ACE_Task_Ex::getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task_Ex::getq"); - return this->msg_queue_->dequeue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task_Ex::can_put (ACE_MESSAGE_TYPE *) -{ - ACE_TRACE ("ACE_Task_Ex::can_put"); - ACE_NOTSUP_RETURN (-1); -} - -template ACE_INLINE int -ACE_Task_Ex::putq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task_Ex::putq"); - return this->msg_queue_->enqueue_tail (mb, tv); -} - -template ACE_INLINE int -ACE_Task_Ex::ungetq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task_Ex::ungetq"); - return this->msg_queue_->enqueue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task_Ex::flush (u_long flag) -{ - ACE_TRACE ("ACE_Task_Ex::flush"); - if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) - return this->msg_queue_ != 0 && this->msg_queue_->close (); - else - return -1; // Note, need to be more careful about what we free... -} - -template ACE_INLINE void -ACE_Task_Ex::msg_queue (ACE_Message_Queue_Ex *mq) -{ - ACE_TRACE ("ACE_Task_Ex::msg_queue"); - if (this->delete_msg_queue_) - { - delete this->msg_queue_; - this->delete_msg_queue_ = false; - } - this->msg_queue_ = mq; -} - -template ACE_Message_Queue_Ex * -ACE_Task_Ex::msg_queue (void) -{ - ACE_TRACE ("ACE_Task_Ex::msg_queue"); - return this->msg_queue_; -} - -template ACE_INLINE int -ACE_Task_Ex::reply (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task_Ex::reply"); - ACE_UNUSED_ARG (mb); - ACE_UNUSED_ARG (tv); - return -1 ; // this->sibling ()->put_next (mb, tv); -} - -template ACE_INLINE ACE_Task * -ACE_Task_Ex::next (void) -{ - ACE_TRACE ("ACE_Task_Ex::next"); - return this->next_; -} - -template ACE_INLINE void -ACE_Task_Ex::next (ACE_Task *q) -{ - ACE_TRACE ("ACE_Task_Ex::next"); - this->next_ = q; -} - -// Transfer msg to the next ACE_Task_Ex. - -template ACE_INLINE int -ACE_Task_Ex::put_next ( - ACE_MESSAGE_TYPE * /* msg */, - ACE_Time_Value * /* tv */) -{ - ACE_TRACE ("ACE_Task_Ex::put_next"); - return -1; // this->next_ == 0 ? -1 : this->next_->put (msg, tv); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Task_T.h b/dep/include/ace/Task_T.h deleted file mode 100644 index 5cd703d29ac..00000000000 --- a/dep/include/ace/Task_T.h +++ /dev/null @@ -1,199 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Task_T.h - * - * $Id: Task_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TASK_T_H -#define ACE_TASK_T_H -#include /**/ "ace/pre.h" - -#include "ace/Message_Queue.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_Traits.h" -#include "ace/Task.h" -#include "ace/IO_Cntl_Msg.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decls... -template class ACE_Module; - -/** - * @class ACE_Task - * - * @brief Primary interface for application message processing, as well - * as input and output message queueing. - * - * This class serves as the basis for passive and active objects - * in ACE. - */ -template -class ACE_Task : public ACE_Task_Base -{ -public: - friend class ACE_Module; - friend class ACE_Module_Type; - - // = Initialization/termination methods. - /** - * Initialize a Task, supplying a thread manager and a message - * queue. If the user doesn't supply a ACE_Message_Queue pointer - * then we'll allocate one dynamically. Otherwise, we'll use the - * one passed as a parameter. - */ - ACE_Task (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue *mq = 0); - - /// Destructor. - virtual ~ACE_Task (void); - - /// Gets the message queue associated with this task. - ACE_Message_Queue *msg_queue (void); - - /// Sets the message queue associated with this task. - void msg_queue (ACE_Message_Queue *); - -public: // Should be protected: - // = Message queue manipulation methods. - - // = Enqueue and dequeue methods. - - // For the following five method if @a timeout == 0, the caller will - // block until action is possible, else will wait until the - // <{absolute}> time specified in *@a timeout elapses). These calls - // will return, however, when queue is closed, deactivated, when a - // signal occurs, or if the time specified in timeout elapses, (in - // which case errno = EWOULDBLOCK). - - /// Insert message into the message queue. Note that @a timeout uses - /// <{absolute}> time rather than <{relative}> time. - int putq (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - - /** - * Extract the first message from the queue (blocking). Note that - * @a timeout uses <{absolute}> time rather than <{relative}> time. - * Returns number of items in queue if the call succeeds or -1 otherwise. - */ - int getq (ACE_Message_Block *&mb, ACE_Time_Value *timeout = 0); - - /// Return a message to the queue. Note that @a timeout uses - /// <{absolute}> time rather than <{relative}> time. - int ungetq (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - - /** - * Turn the message around, sending it in the opposite direction in - * the stream. To do this, the message is put onto the task next in - * the stream after this task's sibling. - * - * @param ACE_Message_Block Pointer to the block that is used in the reply. - * @param timeout The absolute time at which the put operation used to - * send the message block to the next module in the stream - * will time out. If 0, this call blocks until it can be - * completed. - */ - int reply (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - - /** - * Transfer message to the adjacent ACE_Task in a ACE_Stream. Note - * that @a timeout uses <{absolute}> time rather than <{relative}> - * time. - */ - int put_next (ACE_Message_Block *msg, ACE_Time_Value *timeout = 0); - - /** - * Tests whether we can enqueue a message without blocking. - * - * @deprecated This method is deprecated and will go away in the future. - */ - int can_put (ACE_Message_Block *); - - // = ACE_Task utility routines to identify names et al. - /// Return the name of the enclosing Module if there's one associated - /// with the Task, else returns 0. - const ACE_TCHAR *name (void) const; - - // = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream). - /// Get next Task pointer. - ACE_Task *next (void); - - /// Set next Task pointer. - void next (ACE_Task *); - - /// Return the Task's sibling if there's one associated with the - /// Task's Module, else returns 0. - ACE_Task *sibling (void); - - /// Return the Task's Module if there is one, else returns 0. - ACE_Module *module (void) const; - - /** - * Flush the task's queue, i.e., free all of the enqueued - * message blocks and unblocks any threads waiting on the queue. - * Note that if this conflicts with the C++ iostream - * function, just rewrite the iostream function as ::. - */ - int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); - - // = Special routines corresponding to certain message types. - - /// Manipulate watermarks. - void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t); - - /// Queue of messages on the ACE_Task.. - ACE_Message_Queue *msg_queue_; - - /// true if should delete Message_Queue, false otherwise. - bool delete_msg_queue_; - - /// Back-pointer to the enclosing module. - ACE_Module *mod_; - - /// Pointer to adjacent ACE_Task. - ACE_Task *next_; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task &)) -}; - -#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT -template class ACE_Export ACE_Task; -template class ACE_Export ACE_Task; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Task_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Task_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Task_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TASK_T_H */ - diff --git a/dep/include/ace/Task_T.inl b/dep/include/ace/Task_T.inl deleted file mode 100644 index a441ca9d0b3..00000000000 --- a/dep/include/ace/Task_T.inl +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- -// -// $Id: Task_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Task::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, - size_t wm_size) -{ - ACE_TRACE ("ACE_Task::water_marks"); - if (cmd == ACE_IO_Cntl_Msg::SET_LWM) - this->msg_queue_->low_water_mark (wm_size); - else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */ - this->msg_queue_->high_water_mark (wm_size); -} - -template ACE_INLINE int -ACE_Task::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::getq"); - return this->msg_queue_->dequeue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task::can_put (ACE_Message_Block *) -{ - ACE_TRACE ("ACE_Task::can_put"); - ACE_NOTSUP_RETURN (-1); -} - -template ACE_INLINE int -ACE_Task::putq (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::putq"); - return this->msg_queue_->enqueue_tail (mb, tv); -} - -template ACE_INLINE int -ACE_Task::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::ungetq"); - return this->msg_queue_->enqueue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task::flush (u_long flag) -{ - ACE_TRACE ("ACE_Task::flush"); - if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) - return this->msg_queue_ != 0 && this->msg_queue_->close (); - else - return -1; // Note, need to be more careful about what we free... -} - -template ACE_INLINE void -ACE_Task::msg_queue (ACE_Message_Queue *mq) -{ - ACE_TRACE ("ACE_Task::msg_queue"); - if (this->delete_msg_queue_) - { - delete this->msg_queue_; - this->delete_msg_queue_ = false; - } - this->msg_queue_ = mq; -} - -template ACE_Message_Queue * -ACE_Task::msg_queue (void) -{ - ACE_TRACE ("ACE_Task::msg_queue"); - return this->msg_queue_; -} - -template ACE_INLINE int -ACE_Task::reply (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::reply"); - return this->sibling ()->put_next (mb, tv); -} - -template ACE_INLINE ACE_Task * -ACE_Task::next (void) -{ - ACE_TRACE ("ACE_Task::next"); - return this->next_; -} - -template ACE_INLINE void -ACE_Task::next (ACE_Task *q) -{ - ACE_TRACE ("ACE_Task::next"); - this->next_ = q; -} - -// Transfer msg to the next ACE_Task. - -template ACE_INLINE int -ACE_Task::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::put_next"); - return this->next_ == 0 ? -1 : this->next_->put (msg, tv); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Test_and_Set.h b/dep/include/ace/Test_and_Set.h deleted file mode 100644 index e75b5b31f93..00000000000 --- a/dep/include/ace/Test_and_Set.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Test_and_Set.h - * - * $Id: Test_and_Set.h 80826 2008-03-04 14:51:23Z wotte $ - */ -//============================================================================= - -#ifndef ACE_TEST_AND_SET_H -#define ACE_TEST_AND_SET_H - -#include /**/ "ace/pre.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Test_and_Set - * - * @brief Implements the classic ``test and set'' operation. - * - * - * This class keeps track of the status of , which can - * be set based on various events (such as receipt of a - * signal). This class is derived from ACE_Event_Handler so - * that it can be "signaled" by a Reactor when a signal occurs. - * We assume that is a data type that can be assigned the - * value 0 or 1. - */ -template -class ACE_Test_and_Set : public ACE_Event_Handler -{ -public: - ACE_Test_and_Set (TYPE initial_value = 0); - - /// Returns true if we are set, else false. - TYPE is_set (void) const; - - /// Sets the status, returning the original value of - /// . - TYPE set (TYPE); - - /// Called when object is signaled by OS (either via UNIX signals or - /// when a Win32 object becomes signaled). - virtual int handle_signal (int signum, - siginfo_t * = 0, - ucontext_t * = 0); - -private: - /// Keeps track of our state. - TYPE is_set_; - - /// Protect the state from race conditions. - ACE_LOCK lock_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Test_and_Set.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Test_and_Set.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TEST_AND_SET_H */ - diff --git a/dep/include/ace/Thread.h b/dep/include/ace/Thread.h deleted file mode 100644 index 6be139f9242..00000000000 --- a/dep/include/ace/Thread.h +++ /dev/null @@ -1,283 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Thread.h - * - * $Id: Thread.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas Schmidt - */ -//========================================================================== - -#ifndef ACE_THREAD_H -#define ACE_THREAD_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_Thread.h" -#include "ace/Thread_Adapter.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -struct cancel_state -{ - /// e.g., PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE, - /// PTHREAD_CANCELED. - int cancelstate; - - /// e.g., PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS. - int canceltype; -}; - -/** - * @class ACE_Thread - * - * @brief Provides a wrapper for threads. - * - * This class provides a common interface that is mapped onto - * POSIX Pthreads, Solaris threads, Win32 threads, VxWorks - * threads, or pSoS threads. Note, however, that it is - * generally a better idea to use the ACE_Thread_Manager - * programming API rather than the API since the - * thread manager is more powerful. - */ -class ACE_Export ACE_Thread -{ -public: - /** - * Creates a new thread having @a flags attributes and running @a func - * with (if is non-0 then @a func and - * are ignored and are obtained from ). - * and are set to the thread's ID and handle (?), - * respectively. The thread runs at @a priority priority (see - * below). - * - * The @a flags 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, THR_EXPLICIT_SCHED, - * THR_SCOPE_SYSTEM, THR_SCOPE_PROCESS - * = END - * - * By default, or if @a priority 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 when - * is called, so it must be allocated with global operator new. - */ - static int spawn (ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - ACE_thread_t *t_id = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack = 0, - size_t stack_size = ACE_DEFAULT_THREAD_STACKSIZE, - ACE_Thread_Adapter *thread_adapter = 0, - const char** thr_name = 0); - - /** - * Spawn N new threads, which execute @a func with argument @a arg (if - * @a thread_adapter is non-0 then @a func and @a args are ignored and - * are obtained from @a thread_adapter). If @a stack != 0 it is - * assumed to be an array of @a n pointers to the base of the stacks - * to use for the threads being spawned. Likewise, if @a stack_size - * != 0 it is assumed to be an array of @a n values indicating how - * big each of the corresponding @a stacks are. Returns the number - * of threads actually spawned (if this doesn't equal the number - * requested then something has gone wrong and @c errno will - * explain...). - * - * @see spawn() - */ - static size_t spawn_n (size_t n, - ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_Thread_Adapter *thread_adapter = 0, - const char* thr_name[] = 0); - - /** - * Spawn @a n new threads, which execute @a func with argument @a arg - * (if @a thread_adapter is non-0 then @a func and @a args are ignored - * and are obtained from @a thread_adapter). The thread_ids of - * successfully spawned threads will be placed into the - * buffer (which must be the same size as @a n). If @a stack != 0 it - * is assumed to be an array of @a n pointers to the base of the - * stacks to use for the threads being spawned. If @a stack_size != - * 0 it is assumed to be an array of @a n values indicating how big - * each of the corresponding @a stacks are. If @a thread_handles != 0 - * it is assumed to be an array of @a n thread_handles that will be - * assigned the values of the thread handles being spawned. Returns - * the number of threads actually spawned (if this doesn't equal the - * number requested then something has gone wrong and @c errno will - * explain...). - * - * @see spawn() - */ - static size_t spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *arg, - long flags, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_hthread_t thread_handles[] = 0, - ACE_Thread_Adapter *thread_adapter = 0, - const char* thr_name[] = 0); - - /** - * Wait for one or more threads to exit and reap their exit status. - * thr_join() returns successfully when the target thread terminates. - * - * @param thread_id is the ACE_thread_t ID of the thread to wait for. - * If @a thread_id is 0, join() waits for any - * undetached thread in the process to terminate - * on platforms that support this capability - * (for example, Solaris). - * @param departed points to a location that is set to the ID of the - * terminated thread if join() returns successfully. - * If @a departed is 0, it is ignored. - * @param status Points to the location that receives the joined - * thread's exit value. If @a status is 0, it is ignored. - * - * @retval 0 for success - * @retval -1 (with errno set) for failure. - */ - static int join (ACE_thread_t thread_id, - ACE_thread_t *departed, - ACE_THR_FUNC_RETURN *status); - - /// Wait for one thread to exit and reap its exit status. - static int join (ACE_hthread_t, - ACE_THR_FUNC_RETURN * = 0); - - /// Continue the execution of a previously suspended thread. - static int resume (ACE_hthread_t); - - /// Suspend the execution of a particular thread. - static int suspend (ACE_hthread_t); - - /// Get the priority of a particular thread. - static int getprio (ACE_hthread_t ht_id, int &priority); - - /// Get the priority and policy of a particular thread. - static int getprio (ACE_hthread_t ht_id, int &priority, int &policy); - - /// Set the priority of a particular thread. - static int setprio (ACE_hthread_t ht_id, int priority, int policy = -1); - - /// Send a signal to the thread. - static int kill (ACE_thread_t, int signum); - - /// Yield the thread to another. - static void yield (void); - - /** - * Return the unique kernel handle of the thread. Note that on - * Win32 this is actually a pseudohandle, which cannot be shared - * with other processes or waited on by threads. To locate the real - * handle, please use the ACE_Thread_Manager::thr_self() method. - */ - static void self (ACE_hthread_t &t_handle); - - /// Return the unique ID of the thread. - static ACE_thread_t self (void); - - /// Exit the current thread and return "status". - /// Should _not_ be called by main thread. - static void exit (ACE_THR_FUNC_RETURN status = 0); - - /// Get the LWP concurrency level of the process. - static int getconcurrency (void); - - /// Set the LWP concurrency level of the process. - static int setconcurrency (int new_level); - - /// Change and/or examine calling thread's signal mask. - static int sigsetmask (int how, - const sigset_t *sigset, - sigset_t *osigset = 0); - - /** - * Allocates a @a keyp that is used to identify data that is specific - * to each thread in the process. The key is global to all threads - * in the process. - */ - static int keycreate (ACE_thread_key_t *keyp, -#if defined (ACE_HAS_THR_C_DEST) - ACE_THR_C_DEST destructor, -#else - ACE_THR_DEST destructor, -#endif /* ACE_HAS_THR_C_DEST */ - void * = 0); - - /// Free up the key so that other threads can reuse it. - static int keyfree (ACE_thread_key_t key); - - /// Bind value to the thread-specific data key, @a key, for the calling - /// thread. - static int setspecific (ACE_thread_key_t key, - void *value); - - /// Stores the current value bound to @a key for the calling thread - /// into the location pointed to by @a valuep. - static int getspecific (ACE_thread_key_t key, - void **valuep); - - /// Disable thread cancellation. - static int disablecancel (struct cancel_state *old_state); - - /// Enable thread cancellation. - static int enablecancel (struct cancel_state *old_state, - int flag); - - /// Set the cancellation state. - static int setcancelstate (struct cancel_state &new_state, - struct cancel_state *old_state); - - /** - * Cancel a thread. - * @note This method is only portable on platforms, such as POSIX pthreads, - * that support thread cancellation. - */ - static int cancel (ACE_thread_t t_id); - - /// Test the cancel. - static void testcancel (void); - -private: - /// Ensure that we don't get instantiated. - ACE_Thread (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Thread.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_THREAD_H */ - diff --git a/dep/include/ace/Thread.inl b/dep/include/ace/Thread.inl deleted file mode 100644 index 87e47e13580..00000000000 --- a/dep/include/ace/Thread.inl +++ /dev/null @@ -1,286 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Allocates a that is used to identify data that is specific -// to each thread in the process. The key is global to all threads in -// the process. - -ACE_INLINE int -ACE_Thread::keycreate (ACE_thread_key_t *keyp, -#if defined (ACE_HAS_THR_C_DEST) - ACE_THR_C_DEST destructor, -#else - ACE_THR_DEST destructor, -#endif /* ACE_HAS_THR_C_DEST */ - void *inst) -{ - // ACE_TRACE ("ACE_Thread::keycreate"); - return ACE_OS::thr_keycreate (keyp, destructor, inst); -} - -// Free up the key so that other threads can reuse it. - -ACE_INLINE int -ACE_Thread::keyfree (ACE_thread_key_t key) -{ - ACE_TRACE ("ACE_Thread::keyfree"); - return ACE_OS::thr_keyfree (key); -} - -// Bind value to the thread-specific data key, , for the calling -// thread. - -ACE_INLINE int -ACE_Thread::setspecific (ACE_thread_key_t key, void *value) -{ - // ACE_TRACE ("ACE_Thread::setspecific"); - return ACE_OS::thr_setspecific (key, value); -} - -// Stores the current value bound to for the calling thread -// into the location pointed to by . - -ACE_INLINE int -ACE_Thread::getspecific (ACE_thread_key_t key, void **valuep) -{ - // ACE_TRACE ("ACE_Thread::getspecific"); - return ACE_OS::thr_getspecific (key, valuep); -} - -ACE_INLINE ACE_thread_t -ACE_Thread::self (void) -{ -// ACE_TRACE ("ACE_Thread::self"); - return ACE_OS::thr_self (); -} - -ACE_INLINE void -ACE_Thread::exit (ACE_THR_FUNC_RETURN status) -{ - ACE_TRACE ("ACE_Thread::exit"); - ACE_OS::thr_exit (status); -} - -ACE_INLINE void -ACE_Thread::yield (void) -{ - ACE_TRACE ("ACE_Thread::yield"); - ACE_OS::thr_yield (); -} - -ACE_INLINE int -ACE_Thread::spawn (ACE_THR_FUNC func, - void *arg, - long flags, - ACE_thread_t *t_id, - ACE_hthread_t *t_handle, - long priority, - void *thr_stack, - size_t thr_stack_size, - ACE_Thread_Adapter *thread_adapter, - const char** thr_name) -{ - ACE_TRACE ("ACE_Thread::spawn"); - - return ACE_OS::thr_create (func, - arg, - flags, - t_id, - t_handle, - priority, - thr_stack, - thr_stack_size, - thread_adapter, - thr_name); -} - -ACE_INLINE int -ACE_Thread::resume (ACE_hthread_t t_id) -{ - ACE_TRACE ("ACE_Thread::resume"); - return ACE_OS::thr_continue (t_id); -} - -ACE_INLINE int -ACE_Thread::suspend (ACE_hthread_t t_id) -{ - ACE_TRACE ("ACE_Thread::suspend"); - return ACE_OS::thr_suspend (t_id); -} - -ACE_INLINE int -ACE_Thread::kill (ACE_thread_t t_id, int signum) -{ - ACE_TRACE ("ACE_Thread::kill"); - return ACE_OS::thr_kill (t_id, signum); -} - -ACE_INLINE int -ACE_Thread::join (ACE_thread_t wait_for, - ACE_thread_t *departed, - ACE_THR_FUNC_RETURN *status) -{ - ACE_TRACE ("ACE_Thread::join"); - return ACE_OS::thr_join (wait_for, departed, status); -} - -ACE_INLINE int -ACE_Thread::join (ACE_hthread_t wait_for, - ACE_THR_FUNC_RETURN *status) -{ - ACE_TRACE ("ACE_Thread::join"); - return ACE_OS::thr_join (wait_for, status); -} - -ACE_INLINE int -ACE_Thread::getconcurrency (void) -{ - ACE_TRACE ("ACE_Thread::getconcurrency"); - return ACE_OS::thr_getconcurrency (); -} - -ACE_INLINE int -ACE_Thread::setconcurrency (int new_level) -{ - ACE_TRACE ("ACE_Thread::setconcurrency"); - return ACE_OS::thr_setconcurrency (new_level); -} - -ACE_INLINE int -ACE_Thread::sigsetmask (int how, - const sigset_t *sigset, - sigset_t *osigset) -{ - ACE_TRACE ("ACE_Thread::sigsetmask"); - return ACE_OS::thr_sigsetmask (how, sigset, osigset); -} - -ACE_INLINE int -ACE_Thread::disablecancel (struct cancel_state *old_state) -{ - ACE_TRACE ("ACE_Thread::disablecancel"); - int old_cstate = 0; - int result = ACE_OS::thr_setcancelstate (THR_CANCEL_DISABLE, - &old_cstate); - if (result == 0 && old_state != 0) - { - ACE_OS::memset (old_state, - 0, - sizeof (old_state)); - old_state->cancelstate = old_cstate; - } - - return result; -} - -ACE_INLINE int -ACE_Thread::enablecancel (struct cancel_state *old_state, - int flag) -{ - ACE_TRACE ("ACE_Thread::enablecancel"); - int old_cstate = 0; - int old_ctype = 0; - int result; - - result = ACE_OS::thr_setcancelstate (THR_CANCEL_ENABLE, - &old_cstate); - if (result != 0) - return result; - - result = ACE_OS::thr_setcanceltype (flag, - &old_ctype); - if (result != 0) - return result; - - if (old_state != 0) - { - old_state->cancelstate = old_cstate; - old_state->canceltype = old_ctype; - } - - return 0; -} - -ACE_INLINE int -ACE_Thread::setcancelstate (struct cancel_state &new_state, - struct cancel_state *old_state) -{ - ACE_TRACE ("ACE_Thread::setcancelstate"); - int old_cstate = 0; - int old_ctype = 0; - - if (new_state.cancelstate != 0 - && ACE_OS::thr_setcancelstate (new_state.cancelstate, - &old_cstate) != 0) - return -1; - - if (new_state.canceltype != 0 - && ACE_OS::thr_setcanceltype (new_state.canceltype, - &old_ctype) != 0) - { - int o_cstate; - - ACE_OS::thr_setcancelstate (old_cstate, - &o_cstate); - return -1; - } - - if (old_state != 0) - { - old_state->cancelstate = old_cstate; - old_state->canceltype = old_ctype; - } - - return 0; -} - -ACE_INLINE int -ACE_Thread::cancel (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread::cancel"); - - return ACE_OS::thr_cancel (t_id); -} - -ACE_INLINE void -ACE_Thread::testcancel (void) -{ - ACE_TRACE ("ACE_Thread::testcancel"); - - ACE_OS::thr_testcancel (); -} - -ACE_INLINE void -ACE_Thread::self (ACE_hthread_t &t_id) -{ -// ACE_TRACE ("ACE_Thread::self"); - ACE_OS::thr_self (t_id); -} - -ACE_INLINE int -ACE_Thread::getprio (ACE_hthread_t ht_id, int &priority) -{ - ACE_TRACE ("ACE_Thread::getprio"); - return ACE_OS::thr_getprio (ht_id, priority); -} - -ACE_INLINE int -ACE_Thread::getprio (ACE_hthread_t ht_id, int &priority, int &policy) -{ - ACE_TRACE ("ACE_Thread::getprio"); - return ACE_OS::thr_getprio (ht_id, priority, policy); -} - -ACE_INLINE int -ACE_Thread::setprio (ACE_hthread_t ht_id, int priority, int policy) -{ - ACE_TRACE ("ACE_Thread::setprio"); - return ACE_OS::thr_setprio (ht_id, priority, policy); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Thread_Adapter.h b/dep/include/ace/Thread_Adapter.h deleted file mode 100644 index 015557b8e0d..00000000000 --- a/dep/include/ace/Thread_Adapter.h +++ /dev/null @@ -1,101 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Thread_Adapter.h - * - * $Id: Thread_Adapter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_THREAD_ADAPTER_H -#define ACE_THREAD_ADAPTER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Base_Thread_Adapter.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -class ACE_Thread_Manager; -class ACE_Thread_Descriptor; - -/** - * @class ACE_Thread_Adapter - * - * @brief Converts a C++ function into a function that - * can be called from a thread creation routine - * (e.g., pthread_create() or _beginthreadex()) that expects an - * extern "C" entry point. This class also makes it possible to - * transparently provide hooks to register a thread with an - * ACE_Thread_Manager. - * - * This class is used in ACE_OS::thr_create(). In general, the - * thread that creates an object of this class is different from - * the thread that calls @c invoke() on this object. Therefore, - * the @c invoke() method is responsible for deleting itself. - */ -class ACE_Export ACE_Thread_Adapter : public ACE_Base_Thread_Adapter -{ -public: - /// Constructor. - ACE_Thread_Adapter (ACE_THR_FUNC user_func, - void *arg, - ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME, - ACE_Thread_Manager *thr_mgr = 0, - ACE_Thread_Descriptor *td = 0 -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector = 0, - ACE_SEH_EXCEPT_HANDLER handler = 0 -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ); - - /** - * Execute the with the . This function deletes - * @c this, thereby rendering the object useless after the call - * returns. - */ - virtual ACE_THR_FUNC_RETURN invoke (void); - - /// Accessor for the optional ACE_Thread_Manager. - ACE_Thread_Manager *thr_mgr (void); - -protected: - - /// Ensure that this object must be allocated on the heap. - ~ACE_Thread_Adapter (void); - -private: - - /// Called by invoke, mainly here to separate the SEH stuff because - /// SEH on Win32 doesn't compile with local vars with destructors. - virtual ACE_THR_FUNC_RETURN invoke_i (void); - -private: - - /// Optional thread manager. - ACE_Thread_Manager *thr_mgr_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_INLINED_OSCALLS) -# if defined (ACE_INLINE) -# undef ACE_INLINE -# endif /* ACE_INLINE */ -# define ACE_INLINE inline -# include "ace/Thread_Adapter.inl" -# endif /* ACE_HAS_INLINED_OSCALLS */ - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_ADAPTER_H */ - diff --git a/dep/include/ace/Thread_Adapter.inl b/dep/include/ace/Thread_Adapter.inl deleted file mode 100644 index 6def13be5ab..00000000000 --- a/dep/include/ace/Thread_Adapter.inl +++ /dev/null @@ -1,13 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread_Adapter.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_Thread_Manager * -ACE_Thread_Adapter::thr_mgr (void) -{ - return this->thr_mgr_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Thread_Control.h b/dep/include/ace/Thread_Control.h deleted file mode 100644 index f975aed88fc..00000000000 --- a/dep/include/ace/Thread_Control.h +++ /dev/null @@ -1,102 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Thread_Control.h - * - * $Id: Thread_Control.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_THREAD_CONTROL_H -#define ACE_THREAD_CONTROL_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Thread_Manager; - -/** - * @class ACE_Thread_Control - * - * @brief Used to keep track of a thread's activities within its entry - * point function. - * - * A ACE_Thread_Manager uses this class to ensure that threads - * it spawns automatically register and unregister themselves - * with it. - * This class can be stored in thread-specific storage using the - * ACE_TSS wrapper. When a thread exits the - * function deletes this object, thereby - * ensuring that it gets removed from its associated - * ACE_Thread_Manager. - */ -class ACE_Export ACE_Thread_Control -{ -public: - /// Initialize the thread control object. If @a insert != 0, then - /// register the thread with the Thread_Manager. - ACE_Thread_Control (ACE_Thread_Manager *tm = 0, - int insert = 0); - - /// Remove the thread from its associated and exit - /// the thread if is enabled. - ~ACE_Thread_Control (void); - - /// Remove this thread from its associated ACE_Thread_Manager and exit - /// the thread if @a do_thr_exit is enabled. - ACE_THR_FUNC_RETURN exit (ACE_THR_FUNC_RETURN status, - int do_thr_exit); - - /// Store the and use it to register ourselves for - /// correct shutdown. - int insert (ACE_Thread_Manager *tm, int insert = 0); - - /// Returns the current . - ACE_Thread_Manager *thr_mgr (void); - - /// Atomically set a new and return the old - /// . - ACE_Thread_Manager *thr_mgr (ACE_Thread_Manager *); - - /// Set the exit status (and return existing status). - ACE_THR_FUNC_RETURN status (ACE_THR_FUNC_RETURN status); - - /// Get the current exit status. - ACE_THR_FUNC_RETURN status (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the thread manager for this block of code. - ACE_Thread_Manager *tm_; - - /// Keeps track of the exit status for the thread. - ACE_THR_FUNC_RETURN status_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_INLINED_OSCALLS) -# if defined (ACE_INLINE) -# undef ACE_INLINE -# endif /* ACE_INLINE */ -# define ACE_INLINE inline -# include "ace/Thread_Control.inl" -# endif /* ACE_HAS_INLINED_OSCALLS */ - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_CONTROL_H */ - diff --git a/dep/include/ace/Thread_Control.inl b/dep/include/ace/Thread_Control.inl deleted file mode 100644 index 6ebd3ac2c56..00000000000 --- a/dep/include/ace/Thread_Control.inl +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread_Control.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Set the exit status. - -ACE_INLINE ACE_THR_FUNC_RETURN -ACE_Thread_Control::status (ACE_THR_FUNC_RETURN s) -{ - ACE_OS_TRACE ("ACE_Thread_Control::status"); - return this->status_ = s; -} - -// Get the exit status. - -ACE_INLINE ACE_THR_FUNC_RETURN -ACE_Thread_Control::status (void) -{ - ACE_OS_TRACE ("ACE_Thread_Control::status"); - return this->status_; -} - -// Returns the current . - -ACE_INLINE ACE_Thread_Manager * -ACE_Thread_Control::thr_mgr (void) -{ - ACE_OS_TRACE ("ACE_Thread_Control::thr_mgr"); - return this->tm_; -} - -// Atomically set a new and return the old -// . - -ACE_INLINE ACE_Thread_Manager * -ACE_Thread_Control::thr_mgr (ACE_Thread_Manager *tm) -{ - ACE_OS_TRACE ("ACE_Thread_Control::thr_mgr"); - ACE_Thread_Manager *o_tm = this->tm_; - this->tm_ = tm; - return o_tm; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Thread_Exit.h b/dep/include/ace/Thread_Exit.h deleted file mode 100644 index e21cc2bb2e4..00000000000 --- a/dep/include/ace/Thread_Exit.h +++ /dev/null @@ -1,111 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Thread_Exit.h - * - * $Id: Thread_Exit.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_THREAD_EXIT_H -#define ACE_THREAD_EXIT_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Thread_Control.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Thread_Exit - * - * @brief Keep exit information for a Thread in thread specific storage. - * so that the thread-specific exit hooks will get called no - * matter how the thread exits (e.g., via , C++ - * or Win32 exception, "falling off the end" of the thread entry - * point function, etc.). - * - * This clever little helper class is stored in thread-specific - * storage using the wrapper. When a thread exits the - * function deletes this object, thereby - * closing it down gracefully. - */ -class ACE_Export ACE_Thread_Exit -{ -public: - /// Capture the Thread that will be cleaned up automatically. - ACE_Thread_Exit (void); - - /// Set the ACE_Thread_Manager. - void thr_mgr (ACE_Thread_Manager *tm); - - /// Destructor calls the thread-specific exit hooks when a thread - /// exits. - ~ACE_Thread_Exit (void); - - /// Singleton access point. - static ACE_Thread_Exit *instance (void); - - /// Cleanup method, used by the ACE_Object_Manager to destroy the - /// singleton. - static void cleanup (void *instance); - -private: - /// Automatically add/remove the thread from the - /// ACE_Thread_Manager. - ACE_Thread_Control thread_control_; - - /** - * Used to detect whether we should create a new instance (or not) - * within the instance method -- we don't trust the instance_ ptr - * because the destructor may have run (if ACE::fini() was called). - * See bug #526. - * We don't follow the singleton pattern due to dependency issues. - */ - static bool is_constructed_; -}; - -/** - * @class ACE_Thread_Exit_Maybe - * - * @brief A version of ACE_Thread_Exit that is created dynamically - * under the hood if the flag is set to TRUE. - * - * Allows the appearance of a "smart pointer", but is not - * always created. - */ -class ACE_Export ACE_Thread_Exit_Maybe -{ -public: - /// Don't create an ACE_Thread_Exit instance by default. - ACE_Thread_Exit_Maybe (int flag = 0); - - /// Destroys the underlying ACE_Thread_Exit instance if it exists. - ~ACE_Thread_Exit_Maybe (void); - - /// Delegates to underlying instance. - ACE_Thread_Exit * operator -> (void) const; - - /// Returns the underlying instance. - ACE_Thread_Exit * instance (void) const; - -private: - - /// Holds the underlying instance. - ACE_Thread_Exit *instance_; - -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_EXIT_H */ - diff --git a/dep/include/ace/Thread_Hook.h b/dep/include/ace/Thread_Hook.h deleted file mode 100644 index 6e03b6300cb..00000000000 --- a/dep/include/ace/Thread_Hook.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Thread_Hook.h - * - * $Id: Thread_Hook.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_THREAD_HOOK_H -#define ACE_THREAD_HOOK_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/ACE_export.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Thread_Hook - * - * @brief This class makes it possible to provide user-defined "start" - * hooks that are called before the thread entry point function - * is invoked. - */ -class ACE_Export ACE_Thread_Hook -{ - -public: - - /// Destructor. - virtual ~ACE_Thread_Hook (void); - - /** - * This method can be overridden in a subclass to customize this - * pre-function call "hook" invocation that can perform - * initialization processing before the thread entry point @a func - * method is called back. The @a func and @a arg passed into the - * start hook are the same as those passed by the application that - * spawned the thread. - */ - virtual ACE_THR_FUNC_RETURN start (ACE_THR_FUNC func, - void *arg); - - /// sets the system wide thread hook, returns the previous thread - /// hook or 0 if none is set. - static ACE_Thread_Hook *thread_hook (ACE_Thread_Hook *hook); - - /// Returns the current system thread hook. - static ACE_Thread_Hook *thread_hook (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_HOOK_H */ - diff --git a/dep/include/ace/Thread_Manager.h b/dep/include/ace/Thread_Manager.h deleted file mode 100644 index 1e891351167..00000000000 --- a/dep/include/ace/Thread_Manager.h +++ /dev/null @@ -1,1265 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Thread_Manager.h - * - * $Id: Thread_Manager.h 82588 2008-08-11 13:37:41Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_THREAD_MANAGER_H -#define ACE_THREAD_MANAGER_H -#include /**/ "ace/pre.h" - -#include "ace/Thread.h" -#include "ace/Thread_Adapter.h" -#include "ace/Thread_Exit.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Condition_Thread_Mutex.h" -#include "ace/Unbounded_Queue.h" -#include "ace/Containers.h" -#include "ace/Free_List.h" -#include "ace/Singleton.h" -#include "ace/Log_Msg.h" -#include "ace/Synch_Traits.h" -#include "ace/Basic_Types.h" - -// The following macros control how a Thread Manager manages a pool of -// Thread_Descriptor. Currently, the default behavior is not to -// preallocate any thread descriptor and never (well, almost never) -// free up any thread descriptor until the Thread Manager gets -// destructed. Which means, once your system is stable, you rarely -// need to pay the price of memory allocation. On a deterministic -// system, which means, the number of threads spawned can be -// determined before hand, you can either redefine the memory pool -// size macros to suit your need or constructed the Thread_Manager -// accordingly. That way, you don't pay the price of memory -// allocation when the system is really doing its job. OTOH, on -// system with resources constraint, you may want to lower the size of -// ACE_DEFAULT_THREAD_MANAGER_HWM to avoid unused memory hanging -// around. - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_PREALLOC) -# define ACE_DEFAULT_THREAD_MANAGER_PREALLOC 0 -#endif /* ACE_DEFAULT_THREAD_MANAGER_PREALLOC */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_LWM) -# define ACE_DEFAULT_THREAD_MANAGER_LWM 1 -#endif /* ACE_DEFAULT_THREAD_MANAGER_LWM */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_INC) -# define ACE_DEFAULT_THREAD_MANAGER_INC 1 -#endif /* ACE_DEFAULT_THREAD_MANAGER_INC */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_HWM) -# define ACE_DEFAULT_THREAD_MANAGER_HWM ACE_DEFAULT_FREE_LIST_HWM -// this is a big number -#endif /* ACE_DEFAULT_THREAD_MANAGER_HWM */ - -// This is the synchronization mechanism used to prevent a thread -// descriptor gets removed from the Thread_Manager before it gets -// stash into it. If you want to disable this feature (and risk of -// corrupting the freelist,) you define the lock as ACE_Null_Mutex. -// Usually, if you can be sure that your threads will run for an -// extended period of time, you can safely disable the lock. - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_LOCK) -# define ACE_DEFAULT_THREAD_MANAGER_LOCK ACE_SYNCH_MUTEX -#endif /* ACE_DEFAULT_THREAD_MANAGER_LOCK */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -class ACE_Task_Base; -class ACE_Thread_Manager; -class ACE_Thread_Descriptor; - -/** - * @class ACE_At_Thread_Exit - * - * @brief Contains a method to be applied when a thread is terminated. - */ -class ACE_Export ACE_At_Thread_Exit -{ - friend class ACE_Thread_Descriptor; - friend class ACE_Thread_Manager; -public: - /// Default constructor - ACE_At_Thread_Exit (void); - - /// The destructor - virtual ~ACE_At_Thread_Exit (void); - - /// At_Thread_Exit has the ownership? - bool is_owner (void) const; - - /// Set the ownership of the At_Thread_Exit. - bool is_owner (bool owner); - - /// This At_Thread_Exit was applied? - bool was_applied (void) const; - - /// Set applied state of At_Thread_Exit. - bool was_applied (bool applied); - -protected: - /// The next At_Thread_Exit hook in the list. - ACE_At_Thread_Exit *next_; - - /// Do the apply if necessary - void do_apply (void); - - /// The apply method. - virtual void apply (void) = 0; - - /// The Thread_Descriptor where this at is registered. - ACE_Thread_Descriptor* td_; - - /// The at was applied? - bool was_applied_; - - /// The at has the ownership of this? - bool is_owner_; -}; - -class ACE_Export ACE_At_Thread_Exit_Func : public ACE_At_Thread_Exit -{ -public: - /// Constructor - ACE_At_Thread_Exit_Func (void *object, - ACE_CLEANUP_FUNC func, - void *param = 0); - - virtual ~ACE_At_Thread_Exit_Func (void); - -protected: - /// The object to be cleanup - void *object_; - - /// The cleanup func - ACE_CLEANUP_FUNC func_; - - /// A param if required - void *param_; - - /// The apply method - void apply (void); -}; - -/** - * @class ACE_Thread_Descriptor_Base - * - * @brief Basic information for thread descriptors. These information - * gets extracted out because we need it after a thread is - * terminated. - * - * @internal - */ -class ACE_Export ACE_Thread_Descriptor_Base : public ACE_OS_Thread_Descriptor -{ - - friend class ACE_Thread_Manager; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; -public: - ACE_Thread_Descriptor_Base (void); - ~ACE_Thread_Descriptor_Base (void); - - // = We need the following operators to make Borland happy. - - /// Equality operator. - bool operator== (const ACE_Thread_Descriptor_Base &rhs) const; - - /// Inequality operator. - bool operator!= (const ACE_Thread_Descriptor_Base &rhs) const; - - /// Group ID. - int grp_id (void) const; - - /// Current state of the thread. - ACE_UINT32 state (void) const; - - /// Return the pointer to an ACE_Task_Base or NULL if there's no - /// ACE_Task_Base associated with this thread.; - ACE_Task_Base *task (void) const; - -protected: - /// Reset this base thread descriptor. - void reset (void); - - /// Unique thread ID. - ACE_thread_t thr_id_; - - /// Unique handle to thread (used by Win32 and AIX). - ACE_hthread_t thr_handle_; - - /// Group ID. - int grp_id_; - - /// Current state of the thread. - ACE_UINT32 thr_state_; - - /// Pointer to an ACE_Task_Base or NULL if there's no - /// ACE_Task_Base. - ACE_Task_Base *task_; - - /// We need these pointers to maintain the double-linked list in a - /// thread managers. - ACE_Thread_Descriptor_Base *next_; - ACE_Thread_Descriptor_Base *prev_; -}; - -/** - * @class ACE_Thread_Descriptor - * - * @brief Information for controlling threads that run under the control - * of the . - */ -class ACE_Export ACE_Thread_Descriptor : public ACE_Thread_Descriptor_Base -{ - friend class ACE_At_Thread_Exit; - friend class ACE_Thread_Manager; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator; -public: - // = Initialization method. - ACE_Thread_Descriptor (void); - - // = Accessor methods. - /// Unique thread id. - ACE_thread_t self (void) const; - - /// Unique handle to thread (used by Win32 and AIX). - void self (ACE_hthread_t &); - - /// Dump the state of an object. - void dump (void) const; - - /** - * This cleanup function must be called only for ACE_TSS_cleanup. - * The ACE_TSS_cleanup delegate Log_Msg instance destruction when - * Log_Msg cleanup is called before terminate. - */ - void log_msg_cleanup(ACE_Log_Msg* log_msg); - - /** - * Register an At_Thread_Exit hook and the ownership is acquire by - * Thread_Descriptor, this is the usual case when the AT is dynamically - * allocated. - */ - int at_exit (ACE_At_Thread_Exit* cleanup); - - /// Register an At_Thread_Exit hook and the ownership is retained for the - /// caller. Normally used when the at_exit hook is created in stack. - int at_exit (ACE_At_Thread_Exit& cleanup); - - /** - * Register an object (or array) for cleanup at thread termination. - * "cleanup_hook" points to a (global, or static member) function - * that is called for the object or array when it to be destroyed. - * It may perform any necessary cleanup specific for that object or - * its class. "param" is passed as the second parameter to the - * "cleanup_hook" function; the first parameter is the object (or - * array) to be destroyed. Returns 0 on success, non-zero on - * failure: -1 if virtual memory is exhausted or 1 if the object (or - * arrayt) had already been registered. - */ - int at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param); - - /// Do nothing destructor to keep some compilers happy - ~ACE_Thread_Descriptor (void); - - /** - * Do nothing but to acquire the thread descriptor's lock and - * release. This will first check if the thread is registered or - * not. If it is already registered, there's no need to reacquire - * the lock again. This is used mainly to get newly spawned thread - * in synch with thread manager and prevent it from accessing its - * thread descriptor before it gets fully built. This function is - * only called from ACE_Log_Msg::thr_desc. - */ - void acquire_release (void); - void acquire (void); - void release (void); - - /** - * Set/get the @c next_ pointer. These are required by the - * ACE_Free_List. - */ - void set_next (ACE_Thread_Descriptor *td); - ACE_Thread_Descriptor *get_next (void) const; - -private: - /// Reset this thread descriptor. - void reset (ACE_Thread_Manager *tm); - - /// Pop an At_Thread_Exit from at thread termination list, apply the at - /// if apply is true. - void at_pop (int apply = 1); - - /// Push an At_Thread_Exit to at thread termination list and set the - /// ownership of at. - void at_push (ACE_At_Thread_Exit* cleanup, - bool is_owner = false); - - /// Run the AT_Thread_Exit hooks. - void do_at_exit (void); - - /// Terminate realize the cleanup process to thread termination - void terminate (void); - - /// Thread_Descriptor is the ownership of ACE_Log_Msg if log_msg_!=0 - /// This can occur because ACE_TSS_cleanup was executed before terminate. - ACE_Log_Msg *log_msg_; - - /// The AT_Thread_Exit list - ACE_At_Thread_Exit *at_exit_list_; - - /** - * Stores the cleanup info for a thread. - * @note This should be generalized to be a stack of ACE_Cleanup_Info's. - */ - ACE_Cleanup_Info cleanup_info_; - - /// Pointer to an ACE_Thread_Manager or NULL if there's no - /// ACE_Thread_Manager> - ACE_Thread_Manager* tm_; - - /// Registration lock to prevent premature removal of thread descriptor. - ACE_DEFAULT_THREAD_MANAGER_LOCK *sync_; - - /// Keep track of termination status. - bool terminated_; -}; - -// Forward declaration. -class ACE_Thread_Control; - -// This typedef should be (and used to be) inside the -// ACE_Thread_Manager declaration. But, it caused compilation -// problems on g++/VxWorks/i960 with -g. Note that -// ACE_Thread_Manager::THR_FUNC is only used internally in -// ACE_Thread_Manager, so it's not useful for anyone else. -// It also caused problems on IRIX5 with g++. -#if defined (__GNUG__) -typedef int (ACE_Thread_Manager::*ACE_THR_MEMBER_FUNC)(ACE_Thread_Descriptor *, int); -#endif /* __GNUG__ */ - -/** - * @class ACE_Thread_Manager - * - * @brief Manages a pool of threads. - * - * This class allows operations on groups of threads atomically. - * The default behavior of thread manager is to wait on - * all threads under it's management when it gets destructed. - * Therefore, remember to remove a thread from thread manager if - * you don't want it to wait for the thread. There are also - * functions to disable this default wait-on-exit behavior. - * However, if your program depends on turning this off to run - * correctly, you are probably doing something wrong. Rule of - * thumb, use ACE_Thread to manage your daemon threads. - * Notice that if there're threads which live beyond the scope of - * main(), you are sure to have resource leaks in your program. - * Remember to wait on threads before exiting your main program if that - * could happen in your programs. - */ -class ACE_Export ACE_Thread_Manager -{ -public: - friend class ACE_Thread_Control; - - // Allow ACE_THread_Exit to register the global TSS instance object. - friend class ACE_Thread_Exit; - friend class ACE_Thread_Descriptor; - -#if !defined (__GNUG__) - typedef int (ACE_Thread_Manager::*ACE_THR_MEMBER_FUNC)(ACE_Thread_Descriptor *, int); -#endif /* !__GNUG__ */ - - /// These are the various states a thread managed by the - /// ACE_Thread_Manager can be in. - enum - { - /// Uninitialized. - ACE_THR_IDLE = 0x00000000, - - /// Created but not yet running. - ACE_THR_SPAWNED = 0x00000001, - - /// Thread is active (naturally, we don't know if it's actually - /// *running* because we aren't the scheduler...). - ACE_THR_RUNNING = 0x00000002, - - /// Thread is suspended. - ACE_THR_SUSPENDED = 0x00000004, - - /// Thread has been cancelled (which is an indiction that it needs to - /// terminate...). - ACE_THR_CANCELLED = 0x00000008, - - /// Thread has shutdown, but the slot in the thread manager hasn't - /// been reclaimed yet. - ACE_THR_TERMINATED = 0x00000010, - - /// Join operation has been invoked on the thread by thread manager. - ACE_THR_JOINING = 0x10000000 - }; - - /** - * @brief Initialization and termination methods. - * - * Internally, ACE_Thread_Manager keeps a freelist for caching - * resources it uses to keep track of managed threads (not the - * threads themselves.) @a prealloc, @a lwm, @a inc, @hwm - * determine the initial size, the low water mark, increment step, - * and high water mark of the freelist. - * - * @sa ACE_Free_List - */ - ACE_Thread_Manager (size_t preaolloc = ACE_DEFAULT_THREAD_MANAGER_PREALLOC, - size_t lwm = ACE_DEFAULT_THREAD_MANAGER_LWM, - size_t inc = ACE_DEFAULT_THREAD_MANAGER_INC, - size_t hwm = ACE_DEFAULT_THREAD_MANAGER_HWM); - ~ACE_Thread_Manager (void); - -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) - /// Get pointer to a process-wide ACE_Thread_Manager. - static ACE_Thread_Manager *instance (void); - - /// Set pointer to a process-wide ACE_Thread_Manager and return - /// existing pointer. - static ACE_Thread_Manager *instance (ACE_Thread_Manager *); - - /// Delete the dynamically allocated Singleton - static void close_singleton (void); -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - - /// No-op. Currently unused. - int open (size_t size = 0); - - /** - * Release all resources. - * By default, this method will wait until all threads exit. - * However, when called from close_singleton(), most global resources - * are destroyed and thus, close() does not try to wait; it simply cleans - * up internal thread records (the thread descriptor list). - */ - int close (void); - - /** - * Create a new thread, which executes @a func with argument @a arg. - * - * @param func The function that is called in the spawned thread. - * - * @param arg The value passed to each spawned thread's @a func. - * - * @param flags Flags to control attributes of the spawned threads. - * @sa ACE_OS::thr_create() for descriptions of the - * possible flags values and their interactions. - * - * @param t_id Pointer to a location to receive the spawned thread's - * ID. If 0, the ID is not returned. - * - * @param t_handle Pointer to a location to receive the spawned thread's - * thread handle. If 0, the handle is not returned. - * - * @param priority The priority at which the thread is spawned. - * - * @param grp_id The thread group that the spawned thread is - * added to. If -1 is specified, a new thread group is - * created for the spawned thread. - * - * @param stack Pointers to the base of a pre-allocated stack space - * for the thread's stack. If 0, the platform allocates - * stack space for the thread. If a stack is specified, - * it is recommended that @a stack_size also be supplied - * to specify the size of the stack. - * Not all platforms support pre-allocated stacks. If - * @a stack is specified for a platform which does not - * allow pre-allocated stack space this parameter is - * ignored. - * - * @param stack_size Indicate how large the thread's stack should be, in - * bytes. If a pre-allocated stack pointer is passed in - * @a stack, @a stack_size indicates the size of that - * stack area. If no pre-allocated stack is passed, - * the stack size specified is passed to the - * operating system to request that it allocate a stack - * of the specified size. - * - * @param thr_name Pointer to a name to assign to the spawned thread. - * This is only meaningful for platforms that have a - * capacity to name threads (e.g., VxWorks and some - * varieties of Pthreads). This argument is ignored if - * specified as 0 and on platforms that do not have the - * capability to name threads. - * - * @retval -1 on failure; @c errno contains an error value. - * @retval The group id of the spawned thread. - */ - int spawn (ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, - ACE_thread_t *t_id = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack = 0, - size_t stack_size = ACE_DEFAULT_THREAD_STACKSIZE, - const char** thr_name = 0); - - /** - * Spawn a specified number of threads, all of which execute @a func - * with argument @a arg. - * - * @param n The number of threads to spawn. - * - * @param func The function that is called in the spawned thread. - * - * @param arg The value passed to each spawned thread's @a func. - * - * @param flags Flags to control attributes of the spawned threads. - * @sa ACE_OS::thr_create() for descriptions of the - * possible flags values and their interactions. - * - * @param priority The priority at which the threads are spawned. - * - * @param grp_id The thread group that the spawned threads are - * added to. If -1 is specified, a new thread group is - * created for the spawned threads. - * - * @param task The ACE_Task that the spawned threads are associated - * with. If 0, the threads are not associated with an - * ACE_Task. This argument is usually assigned by the - * ACE_Task_Base::activate() method to associate the - * spawned threads with the spawning ACE_Task object. - * - * @param thread_handles An array of @a n entries which will receive - * the thread handles of the spawned threads. - * - * @param stack An array of @a n pointers to pre-allocated stack space - * for each thread's stack. If specified as 0, the - * platform allocates stack space for each thread. If - * a stack is specified, it is recommended that a - * @a stack_size element also be supplied that specifies - * the size of the stack. - * Not all platforms support pre-allocated stacks. If - * @a stack is specified for a platform which does not - * allow pre-allocated stack space this parameter is - * ignored. - * - * @param stack_size An array of @a n values which indicate how large - * each thread's stack should be, in bytes. - * If pre-allocated stacks are passed in @a stacks, these - * sizes are for those stacks. If no pre-allocated stacks - * are passed, the stack sizes are specified to the - * operating system to request that it allocate stacks - * of the specified sizes. If an array entry is 0, the - * platform defaults are used for the corresponding thread. - * If a 0 array pointer is specified, platform defaults - * are used for all thread stack sizes. - * - * @param thr_name An array of names to assign to the spawned threads. - * This is only meaningful for platforms that have a - * capacity to name threads (e.g., VxWorks and some - * varieties of Pthreads). This argument is ignored if - * specified as 0 and on platforms that do not have the - * capability to name threads. - * - * ACE_Thread_Manager can manipulate threads in groups based on - * @a grp_id or @a task using functions such as kill_grp() or - * cancel_task(). - * - * @retval -1 on failure; @c errno contains an error value. - * @retval The group id of the threads. - */ - int spawn_n (size_t n, - ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - const char* thr_name[] = 0); - - /** - * Spawn a specified number of threads, all of which execute @a func - * with argument @a arg. - * - * @param thread_ids An array to receive the thread IDs of successfully - * spawned buffer. If 0, the thread IDs are not returned. - * If specified, the array must be at least @a n entries. - * - * @param n The number of threads to spawn. - * - * @param func The function that is called in the spawned thread. - * - * @param arg The value passed to each spawned thread's @a func. - * - * @param flags Flags to control attributes of the spawned threads. - * @sa ACE_OS::thr_create() for descriptions of the - * possible flags values and their interactions. - * - * @param priority The priority at which the threads are spawned. - * - * @param grp_id The thread group that the spawned threads are - * added to. If -1 is specified, a new thread group is - * created for the spawned threads. - * - * @param stack An array of @a n pointers to pre-allocated stack space - * for each thread's stack. If specified as 0, the - * platform allocates stack space for each thread. If - * a stack is specified, it is recommended that a - * @a stack_size element also be supplied that specifies - * the size of the stack. - * Not all platforms support pre-allocated stacks. If - * @a stack is specified for a platform which does not - * allow pre-allocated stack space this parameter is - * ignored. - * - * @param stack_size An array of @a n values which indicate how large - * each thread's stack should be, in bytes. - * If pre-allocated stacks are passed in @a stacks, these - * sizes are for those stacks. If no pre-allocated stacks - * are passed, the stack sizes are specified to the - * operating system to request that it allocate stacks - * of the specified sizes. If an array entry is 0, the - * platform defaults are used for the corresponding thread. - * If a 0 array pointer is specified, platform defaults - * are used for all thread stack sizes. - * - * @param thread_handles An array of @a n entries which will receive - * the thread handles of the spawned threads. - * - * @param task The ACE_Task that the spawned threads are associated - * with. If 0, the threads are not associated with an - * ACE_Task. This argument is usually assigned by the - * ACE_Task_Base::activate() method to associate the - * spawned threads with the spawning ACE_Task object. - * - * @param thr_name An array of names to assign to the spawned threads. - * This is only meaningful for platforms that have a - * capacity to name threads (e.g., VxWorks and some - * varieties of Pthreads). This argument is ignored if - * specified as 0 and on platforms that do not have the - * capability to name threads. - * - * ACE_Thread_Manager can manipulate threads in groups based on - * @a grp_id or @a task using functions such as kill_grp() or - * cancel_task(). - * - * @retval -1 on failure; @c errno contains an error value. - * @retval The group id of the threads. - - */ - int spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *arg, - long flags, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_hthread_t thread_handles[] = 0, - ACE_Task_Base *task = 0, - const char* thr_name[] = 0); - - /** - * Called to clean up when a thread exits. - * - * @param do_thread_exit If non-0 then ACE_Thread::exit is called to - * exit the thread - * @param status If ACE_Thread_Exit is called, this is passed as - * the exit value of the thread. - * Should _not_ be called by main thread. - */ - ACE_THR_FUNC_RETURN exit (ACE_THR_FUNC_RETURN status = 0, - bool do_thread_exit = true); - - /** - * Block until there are no more threads running in this thread - * manager or @c timeout expires. - * - * @param timeout is treated as "absolute" time by default, but this - * can be changed to "relative" time by setting the @c - * use_absolute_time to false. - * @param abandon_detached_threads If true, @c wait() will first - * check thru its thread list for - * threads with THR_DETACHED or - * THR_DAEMON flags set and remove - * these threads. Notice that - * unlike other @c wait_*() methods, - * by default, @c wait() does wait on - * all thread spawned by this - * thread manager no matter the detached - * flags are set or not unless it is - * called with @c - * abandon_detached_threads flag set. - * @param use_absolute_time If true then treat @c timeout as - * absolute time, else relative time. - * @return 0 on success * and -1 on failure. - * - * @note If this function is called while the @c - * ACE_Object_Manager is shutting down (as a result of program - * rundown via @c ACE::fini()), it will not wait for any threads to - * complete. If you must wait for threads spawned by this thread - * manager to complete and you are in a ACE rundown situation (such - * as your object is being destroyed by the @c ACE_Object_Manager) - * you can use @c wait_grp() instead. - */ - int wait (const ACE_Time_Value *timeout = 0, - bool abandon_detached_threads = false, - bool use_absolute_time = true); - - /// Join a thread specified by @a tid. Do not wait on a detached thread. - int join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status = 0); - - /** - * Block until there are no more threads running in a group. - * Returns 0 on success and -1 on failure. Notice that wait_grp - * will not wait on detached threads. - */ - int wait_grp (int grp_id); - - /** - * Return the "real" handle to the calling thread, caching it if - * necessary in TSS to speed up subsequent lookups. This is - * necessary since on some platforms (e.g., Windows) we can't get this - * handle via direct method calls. Notice that you should *not* - * close the handle passed back from this method. It is used - * internally by Thread Manager. On the other hand, you *have to* - * use this internal thread handle when working on Thread_Manager. - * Return -1 if fail. - */ - int thr_self (ACE_hthread_t &); - - /** - * Return the unique ID of the calling thread. - * Same as calling ACE_Thread::self(). - */ - ACE_thread_t thr_self (void); - - /** - * Returns a pointer to the current ACE_Task_Base we're executing - * in if this thread is indeed running in an ACE_Task_Base, else - * return 0. - */ - ACE_Task_Base *task (void); - - /** - * @name Suspend and resume methods - * - * Suspend/resume is not supported on all platforms. For example, Pthreads - * does not support these functions. - */ - //@{ - - /// Suspend all threads - int suspend_all (void); - - /// Suspend a single thread. - int suspend (ACE_thread_t); - - /// Suspend a group of threads. - int suspend_grp (int grp_id); - - /** - * True if @a t_id is inactive (i.e., suspended), else false. Always - * return false if @a t_id is not managed by the Thread_Manager. - */ - int testsuspend (ACE_thread_t t_id); - - /// Resume all stopped threads - int resume_all (void); - - /// Resume a single thread. - int resume (ACE_thread_t); - - /// Resume a group of threads. - int resume_grp (int grp_id); - - /** - * True if @a t_id is active (i.e., resumed), else false. Always - * return false if @a t_id is not managed by the Thread_Manager. - */ - int testresume (ACE_thread_t t_id); - - //@} - - // = Send signals to one or more threads without blocking. - /** - * Send @a signum to all stopped threads. Not supported on platforms - * that do not have advanced signal support, such as Win32. - */ - int kill_all (int signum); - /** - * Send the @a signum to a single thread. Not supported on platforms - * that do not have advanced signal support, such as Win32. - */ - int kill (ACE_thread_t, int signum); - /** - * Send @a signum to a group of threads, not supported on platforms - * that do not have advanced signal support, such as Win32. - */ - int kill_grp (int grp_id, int signum); - - // = Cancel methods, which provides a cooperative thread-termination mechanism (will not block). - /** - * Cancel's all the threads. - */ - int cancel_all (int async_cancel = 0); - - /** - * Cancel a single thread. - */ - int cancel (ACE_thread_t, int async_cancel = 0); - - /** - * Cancel a group of threads. - */ - int cancel_grp (int grp_id, int async_cancel = 0); - - /** - * True if @a t_id is cancelled, else false. Always return false if - * @a t_id is not managed by the Thread_Manager. - */ - int testcancel (ACE_thread_t t_id); - - /** - * True if @a t_id has terminated (i.e., is no longer running), - * but the slot in the thread manager hasn't been reclaimed yet, - * else false. Always return false if @a t_id is not managed by the - * Thread_Manager. - */ - int testterminate (ACE_thread_t t_id); - - /// Set group ids for a particular thread id. - int set_grp (ACE_thread_t, - int grp_id); - - /// Get group ids for a particular thread id. - int get_grp (ACE_thread_t, - int &grp_id); - - /** - * @name Task-related operations - */ - //@{ - /** - * Block until there are no more threads running in a specified task. - * This method will not wait for either detached or daemon threads; - * the threads must have been spawned with the @c THR_JOINABLE flag. - * Upon successful completion, the threads have been joined, so further - * attempts to join with any of the waited-for threads will fail. - * - * @param task The ACE_Task_Base object whose threads are to waited for. - * - * @retval 0 Success. - * @retval -1 Failure (consult errno for further information). - */ - int wait_task (ACE_Task_Base *task); - - /** - * Suspend all threads in an ACE_Task. - */ - int suspend_task (ACE_Task_Base *task); - - /** - * Resume all threads in an ACE_Task. - */ - int resume_task (ACE_Task_Base *task); - - /** - * Send a signal @a signum to all threads in an ACE_Task. - */ - int kill_task (ACE_Task_Base *task, int signum); - - /** - * Cancel all threads in an ACE_Task. If is non-0, - * then asynchronously cancel these threads if the OS platform - * supports cancellation. Otherwise, perform a "cooperative" - * cancellation. - */ - int cancel_task (ACE_Task_Base *task, int async_cancel = 0); - - //@} - - // = Collect thread handles in the thread manager. Notice that - // the collected information is just a snapshot. - /// Check if the thread is managed by the thread manager. Return true if - /// the thread is found, false otherwise. - int hthread_within (ACE_hthread_t handle); - int thread_within (ACE_thread_t tid); - - /// Returns the number of ACE_Task_Base in a group. - int num_tasks_in_group (int grp_id); - - /// Returns the number of threads in an ACE_Task_Base. - int num_threads_in_task (ACE_Task_Base *task); - - /** - * Returns a list of ACE_Task_Base pointers corresponding to the tasks - * that have active threads in a specified thread group. - * - * @param grp_id The thread group ID to obtain task pointers for. - * - * @param task_list is a pointer to an array to receive the list of pointers. - * The caller is responsible for supplying an array with at - * least @arg n entries. - * - * @param n The maximum number of ACE_Task_Base pointers to write - * in @arg task_list. - * - * @retval If successful, the number of pointers returned, which will be - * no greater than @arg n. Returns -1 on error. - * - * @note This method has no way to indicate if there are more than - * @arg n ACE_Task_Base pointers available. Therefore, it may be - * wise to guess a larger value of @arg n than one thinks in cases - * where the exact number of tasks is not known. - * - * @sa num_tasks_in_group(), task_all_list() - */ - ssize_t task_list (int grp_id, - ACE_Task_Base *task_list[], - size_t n); - - /** - * Returns in @a thread_list a list of up to @a n thread ids in an - * ACE_Task_Base. The caller must allocate the memory for - * @a thread_list. In case of an error, -1 is returned. If no - * requested values are found, 0 is returned, otherwise correct - * number of retrieved values are returned. - */ - ssize_t thread_list (ACE_Task_Base *task, - ACE_thread_t thread_list[], - size_t n); - - /** - * Returns in @a hthread_list a list of up to @a n thread handles in - * an ACE_Task_Base. The caller must allocate memory for - * @a hthread_list. In case of an error, -1 is returned. If no - * requested values are found, 0 is returned, otherwise correct - * number of retrieved values are returned. - */ - ssize_t hthread_list (ACE_Task_Base *task, - ACE_hthread_t hthread_list[], - size_t n); - - /** - * Returns in @a thread_list a list of up to @a n thread ids in a - * group @a grp_id. The caller must allocate the memory for - * @a thread_list. In case of an error, -1 is returned. If no - * requested values are found, 0 is returned, otherwise correct - * number of retrieved values are returned. - */ - ssize_t thread_grp_list (int grp_id, - ACE_thread_t thread_list[], - size_t n); - - /** - * Returns in @a hthread_list a list of up to @a n thread handles in - * a group @a grp_id. The caller must allocate memory for - * @a hthread_list. - */ - ssize_t hthread_grp_list (int grp_id, - ACE_hthread_t hthread_list[], - size_t n); - - /** - * Returns a list of ACE_Task_Base pointers corresponding to the tasks - * that have active threads managed by this instance. - * - * @param task_list is a pointer to an array to receive the list of pointers. - * The caller is responsible for supplying an array with at - * least @arg n entries. - * - * @param n The maximum number of ACE_Task_Base pointers to write - * in @arg task_list. - * - * @retval If successful, the number of pointers returned, which will be - * no greater than @arg n. Returns -1 on error. - * - * @note This method has no way to indicate if there are more than - * @arg n ACE_Task_Base pointers available. Therefore, it may be - * wise to guess a larger value of @arg n than one thinks in cases - * where the exact number of tasks is not known. - * - * @sa count_threads() - */ - ssize_t task_all_list (ACE_Task_Base *task_list[], - size_t n); - - /** - * Returns in @a thread_list a list of up to @a n thread ids. The - * caller must allocate the memory for @a thread_list. In case of an - * error, -1 is returned. If no requested values are found, 0 is - * returned, otherwise correct number of retrieved values are - * returned. - */ - ssize_t thread_all_list (ACE_thread_t thread_list[], - size_t n); - - /// Set group ids for a particular task. - int set_grp (ACE_Task_Base *task, int grp_id); - - /// Get group ids for a particular task. - int get_grp (ACE_Task_Base *task, int &grp_id); - - /// Return a count of the current number of threads active in the - /// . - size_t count_threads (void) const; - - /// Get the state of the thread. Returns false if the thread is not - /// managed by this thread manager. - int thr_state (ACE_thread_t id, ACE_UINT32& state); - - /** - * Register an At_Thread_Exit hook and the ownership is acquire by - * Thread_Descriptor, this is the usual case when the AT is dynamically - * allocated. - */ - int at_exit (ACE_At_Thread_Exit* cleanup); - - /// Register an At_Thread_Exit hook and the ownership is retained for the - /// caller. Normally used when the at_exit hook is created in stack. - int at_exit (ACE_At_Thread_Exit& cleanup); - - /** - * - ***** - * @deprecated This function is deprecated. Please use the previous two - * at_exit method. Notice that you should avoid mixing this method - * with the previous two at_exit methods. - ***** - * - * Register an object (or array) for cleanup at - * thread termination. "cleanup_hook" points to a (global, or - * static member) function that is called for the object or array - * when it to be destroyed. It may perform any necessary cleanup - * specific for that object or its class. "param" is passed as the - * second parameter to the "cleanup_hook" function; the first - * parameter is the object (or array) to be destroyed. - * "cleanup_hook", for example, may delete the object (or array). - * If == 0, the will _NOT_ get cleanup at - * thread exit. You can use this to cancel the previously added - * at_exit. - */ - int at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param); - - /// Access function to determine whether the Thread_Manager will - /// wait for its thread to exit or not when being closing down. - void wait_on_exit (int dowait); - int wait_on_exit (void); - - /// Dump the state of an object. - void dump (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - // = Accessors for ACE_Thread_Descriptors. - /** - * Get a pointer to the calling thread's own thread_descriptor. - * This must be called from a spawn thread. This function will - * fetch the info from TSS. - */ - ACE_Thread_Descriptor *thread_desc_self (void); - - /// Return a pointer to the thread's Thread_Descriptor, - /// 0 if fail. - ACE_Thread_Descriptor *thread_descriptor (ACE_thread_t); - - /// Return a pointer to the thread's Thread_Descriptor, - /// 0 if fail. - ACE_Thread_Descriptor *hthread_descriptor (ACE_hthread_t); - - /// Create a new thread (must be called with locks held). - int spawn_i (ACE_THR_FUNC func, - void *arg, - long flags, - ACE_thread_t * = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack = 0, - size_t stack_size = 0, - ACE_Task_Base *task = 0, - const char** thr_name = 0); - - /// Run the registered hooks when the thread exits. - void run_thread_exit_hooks (int i); - - /// Locate the index of the table slot occupied by . Returns - /// -1 if is not in the table doesn't contain . - ACE_Thread_Descriptor *find_thread (ACE_thread_t t_id); - - /// Locate the index of the table slot occupied by . Returns - /// -1 if is not in the table doesn't contain . - ACE_Thread_Descriptor *find_hthread (ACE_hthread_t h_id); - - /** - * Locate the thread descriptor address of the list occupied by - * @a task. Returns 0 if @a task is not in the table doesn't contain - * @a task. - */ - ACE_Thread_Descriptor *find_task (ACE_Task_Base *task, - size_t slot = 0); - - /// Insert a thread in the table (checks for duplicates). - int insert_thr (ACE_thread_t t_id, - ACE_hthread_t, - int grp_id = -1, - long flags = 0); - - /// Append a thread in the table (adds at the end, growing the table - /// if necessary). - int append_thr (ACE_thread_t t_id, ACE_hthread_t, - ACE_UINT32, - int grp_id, - ACE_Task_Base *task = 0, - long flags = 0, - ACE_Thread_Descriptor *td = 0); - - /// Remove thread from the table. - void remove_thr (ACE_Thread_Descriptor *td, - int close_handler); - - /// Remove all threads from the table. - void remove_thr_all (void); - - // = The following four methods implement a simple scheme for - // operating on a collection of threads atomically. - - /** - * Efficiently check whether @a thread is in a particular @a state. - * This call updates the TSS cache if possible to speed up - * subsequent searches. - */ - int check_state (ACE_UINT32 state, - ACE_thread_t thread, - int enable = 1); - - /// Apply @a func to all members of the table that match the @a task - int apply_task (ACE_Task_Base *task, - ACE_THR_MEMBER_FUNC func, - int = 0); - - /// Apply @a func to all members of the table that match the @a grp_id. - int apply_grp (int grp_id, - ACE_THR_MEMBER_FUNC func, - int arg = 0); - - /// Apply @a func to all members of the table. - int apply_all (ACE_THR_MEMBER_FUNC, - int = 0); - - /// Join the thread described in @a td. - int join_thr (ACE_Thread_Descriptor *td, - int = 0); - - /// Resume the thread described in @a td. - int resume_thr (ACE_Thread_Descriptor *td, - int = 0); - - /// Suspend the thread described in @a td. - int suspend_thr (ACE_Thread_Descriptor *td, - int = 0); - - /// Send signal @a signum to the thread described in @a td. - int kill_thr (ACE_Thread_Descriptor *td, - int signum); - - /// Set the cancellation flag for the thread described in @a td. - int cancel_thr (ACE_Thread_Descriptor *td, - int async_cancel = 0); - - /// Register a thread as terminated and put it into the . - int register_as_terminated (ACE_Thread_Descriptor *td); - - /// Setting the static ACE_TSS_TYPE (ACE_Thread_Exit) *thr_exit_ pointer. - static int set_thr_exit (ACE_TSS_TYPE (ACE_Thread_Exit) *ptr); - - /** - * Keeping a list of thread descriptors within the thread manager. - * Double-linked list enables us to cache the entries in TSS - * and adding/removing thread descriptor entries without - * affecting other thread's descriptor entries. - */ - ACE_Double_Linked_List thr_list_; - -#if !defined (ACE_HAS_VXTHREADS) - /// Collect terminated but not yet joined thread entries. - ACE_Double_Linked_List terminated_thr_list_; -#endif /* !ACE_HAS_VXTHREADS */ - - /// Collect pointers to thread descriptors of threads to be removed later. - ACE_Unbounded_Queue thr_to_be_removed_; - - /// Keeps track of the next group id to assign. - int grp_id_; - - /// Set if we want the Thread_Manager to wait on all threads before - /// being closed, reset otherwise. - int automatic_wait_; - - // = ACE_Thread_Mutex and condition variable for synchronizing termination. -#if defined (ACE_HAS_THREADS) - /// Serialize access to the . - ACE_Thread_Mutex lock_; - - /// Keep track of when there are no more threads. - ACE_Condition_Thread_Mutex zero_cond_; -#endif /* ACE_HAS_THREADS */ - - ACE_Locked_Free_List thread_desc_freelist_; - -private: -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) - /// Pointer to a process-wide ACE_Thread_Manager. - static ACE_Thread_Manager *thr_mgr_; - - /// Must delete the thr_mgr_ if true. - static bool delete_thr_mgr_; - - /// Global ACE_TSS (ACE_Thread_Exit) object ptr. - static ACE_TSS_TYPE (ACE_Thread_Exit) *thr_exit_; -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ -}; - -#if defined (ACE_THREAD_MANAGER_LACKS_STATICS) -#define ACE_THREAD_MANAGER_SINGLETON_DEFINE \ - ACE_Singleton; -typedef ACE_Singleton ACE_THREAD_MANAGER_SINGLETON; -#endif /* defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Thread_Manager.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_MANAGER_H */ - diff --git a/dep/include/ace/Thread_Manager.inl b/dep/include/ace/Thread_Manager.inl deleted file mode 100644 index 6be65a664fa..00000000000 --- a/dep/include/ace/Thread_Manager.inl +++ /dev/null @@ -1,307 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread_Manager.inl 82588 2008-08-11 13:37:41Z johnnyw $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_At_Thread_Exit::ACE_At_Thread_Exit (void) - : next_ (0), - td_ (0), - was_applied_ (false), - is_owner_ (true) -{ -} - -ACE_INLINE bool -ACE_At_Thread_Exit::was_applied() const -{ - return was_applied_; -} - -ACE_INLINE bool -ACE_At_Thread_Exit::was_applied (bool applied) -{ - was_applied_ = applied; - if (was_applied_) - td_ = 0; - return was_applied_; -} - -ACE_INLINE bool -ACE_At_Thread_Exit::is_owner() const -{ - return is_owner_; -} - -ACE_INLINE bool -ACE_At_Thread_Exit::is_owner (bool owner) -{ - is_owner_ = owner; - return is_owner_; -} - -ACE_INLINE void -ACE_At_Thread_Exit::do_apply (void) -{ - if (!this->was_applied_ && this->is_owner_) - td_->at_pop(); -} - -ACE_INLINE -ACE_At_Thread_Exit_Func::ACE_At_Thread_Exit_Func (void *object, - ACE_CLEANUP_FUNC func, - void *param) - : object_(object), - func_(func), - param_(param) -{ -} - -ACE_INLINE -ACE_Thread_Descriptor_Base::ACE_Thread_Descriptor_Base (void) - : ACE_OS_Thread_Descriptor (), - thr_id_ (ACE_OS::NULL_thread), - thr_handle_ (ACE_OS::NULL_hthread), - grp_id_ (0), - thr_state_ (ACE_Thread_Manager::ACE_THR_IDLE), - task_ (0), - next_ (0), - prev_ (0) -{ -} - -ACE_INLINE -ACE_Thread_Descriptor_Base::~ACE_Thread_Descriptor_Base (void) -{ -} - -ACE_INLINE bool -ACE_Thread_Descriptor_Base::operator== ( - const ACE_Thread_Descriptor_Base &rhs) const -{ - return - ACE_OS::thr_cmp (this->thr_handle_, rhs.thr_handle_) - && ACE_OS::thr_equal (this->thr_id_, rhs.thr_id_); -} - -ACE_INLINE bool -ACE_Thread_Descriptor_Base::operator!=(const ACE_Thread_Descriptor_Base &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE ACE_Task_Base * -ACE_Thread_Descriptor_Base::task (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::task"); - return this->task_; -} - -// Group ID. - -ACE_INLINE int -ACE_Thread_Descriptor_Base::grp_id (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::grp_id"); - return grp_id_; -} - -// Current state of the thread. -ACE_INLINE ACE_UINT32 -ACE_Thread_Descriptor_Base::state (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::state"); - return thr_state_; -} - -// Reset this base descriptor. -ACE_INLINE void -ACE_Thread_Descriptor_Base::reset (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::reset"); - this->thr_id_ = ACE_OS::NULL_thread; - this->thr_handle_ = ACE_OS::NULL_hthread; - this->grp_id_ = 0; - this->thr_state_ = ACE_Thread_Manager::ACE_THR_IDLE; - this->task_ = 0; - this->flags_ = 0; -} - -// Unique thread id. -ACE_INLINE ACE_thread_t -ACE_Thread_Descriptor::self (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor::self"); - return this->thr_id_; -} - -// Unique kernel-level thread handle. - -ACE_INLINE void -ACE_Thread_Descriptor::self (ACE_hthread_t &handle) -{ - ACE_TRACE ("ACE_Thread_Descriptor::self"); - handle = this->thr_handle_; -} - -ACE_INLINE void -ACE_Thread_Descriptor::log_msg_cleanup (ACE_Log_Msg* log_msg) - -{ - log_msg_ = log_msg; -} - -// Set the pointer -ACE_INLINE void -ACE_Thread_Descriptor::set_next (ACE_Thread_Descriptor *td) -{ - ACE_TRACE ("ACE_Thread_Descriptor::set_next"); - this->next_ = td; -} - -// Get the pointer -ACE_INLINE ACE_Thread_Descriptor * -ACE_Thread_Descriptor::get_next (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor::get_next"); - return static_cast (this->next_); -} - -// Reset this thread descriptor -ACE_INLINE void -ACE_Thread_Descriptor::reset (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_Thread_Descriptor::reset"); - this->ACE_Thread_Descriptor_Base::reset (); - this->at_exit_list_ = 0; - // Start the at_exit hook list. - this->tm_ = tm; - // Setup the Thread_Manager. - this->log_msg_ = 0; - this->terminated_ = false; -} - -ACE_INLINE ACE_Thread_Descriptor * -ACE_Thread_Manager::thread_desc_self (void) -{ - // This method must be called with lock held. - - // Try to get it from cache. - ACE_Thread_Descriptor *desc = ACE_LOG_MSG->thr_desc (); - -#if 1 - // ACE_ASSERT (desc != 0); - // Thread descriptor should always get cached. -#else - if (desc == 0) - { - ACE_thread_t id = ACE_OS::thr_self (); - - desc = this->find_thread (id); - - // Thread descriptor adapter might not have been put into the - // list yet. - if (desc != 0) - // Update the TSS cache. - ACE_LOG_MSG->thr_desc (desc); - } -#endif - return desc; -} - -// Return the unique ID of the thread. - -ACE_INLINE ACE_thread_t -ACE_Thread_Manager::thr_self (void) -{ - ACE_TRACE ("ACE_Thread_Manager::thr_self"); - return ACE_Thread::self (); -} - -ACE_INLINE ACE_Task_Base * -ACE_Thread_Manager::task (void) -{ - ACE_TRACE ("ACE_Thread_Manager::task"); - - ACE_Thread_Descriptor *td = this->thread_desc_self () ; - - if (td == 0) - return 0; - else - return td->task (); -} - -ACE_INLINE int -ACE_Thread_Manager::open (size_t) -{ - // Currently no-op. - return 0; -} - -ACE_INLINE int -ACE_Thread_Manager::at_exit (ACE_At_Thread_Exit* at) -{ - ACE_Thread_Descriptor *td = this->thread_desc_self (); - if (td == 0) - return -1; - else - return td->at_exit (at); -} - -ACE_INLINE int -ACE_Thread_Manager::at_exit (ACE_At_Thread_Exit& at) -{ - ACE_Thread_Descriptor *td = this->thread_desc_self (); - if (td == 0) - return -1; - else - return td->at_exit (at); -} - -ACE_INLINE int -ACE_Thread_Manager::at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param) -{ - ACE_Thread_Descriptor *td = this->thread_desc_self (); - if (td == 0) - return -1; - else - return td->at_exit (object, - cleanup_hook, - param); -} - -ACE_INLINE void -ACE_Thread_Manager::wait_on_exit (int do_wait) -{ - this->automatic_wait_ = do_wait; -} - -ACE_INLINE int -ACE_Thread_Manager::wait_on_exit (void) -{ - return this->automatic_wait_; -} - -ACE_INLINE int -ACE_Thread_Manager::register_as_terminated (ACE_Thread_Descriptor *td) -{ -#if defined (ACE_HAS_VXTHREADS) - ACE_UNUSED_ARG (td); -#else /* ! ACE_HAS_VXTHREADS */ - ACE_Thread_Descriptor_Base *tdb = 0; - ACE_NEW_RETURN (tdb, ACE_Thread_Descriptor_Base (*td), -1); - this->terminated_thr_list_.insert_tail (tdb); -#endif /* !ACE_HAS_VXTHREADS */ - return 0; -} - -ACE_INLINE size_t -ACE_Thread_Manager::count_threads (void) const -{ - return this->thr_list_.size (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Thread_Mutex.h b/dep/include/ace/Thread_Mutex.h deleted file mode 100644 index 0a1b1cae2af..00000000000 --- a/dep/include/ace/Thread_Mutex.h +++ /dev/null @@ -1,176 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Thread_Mutex.h - * - * $Id: Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_THREAD_MUTEX_H -#define ACE_THREAD_MUTEX_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_HAS_THREADS) -# include "ace/Null_Mutex.h" -#else /* ACE_HAS_THREADS */ -// ACE platform supports some form of threading. - -#include /**/ "ace/ACE_export.h" -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Thread_Mutex - * - * @brief ACE_Thread_Mutex wrapper (only valid for threads in the same - * process). - * - * This implementation is optimized for locking threads that are - * in the same process. It maps to s on NT - * and with set to on UNIX. - * ACE_Thread_Mutex is recursive on some platforms (like - * Win32). However, on most platforms (like Solaris) it is not - * recursive. To be totally safe and portable, developers - * should use ACE_Recursive_Thread_Mutex when they need a - * recursive mutex. - */ -class ACE_Export ACE_Thread_Mutex -{ - friend class ACE_Condition_Thread_Mutex; -public: - /// Constructor. - ACE_Thread_Mutex (const ACE_TCHAR *name = 0, - ACE_mutexattr_t *attributes = 0); - - /// Implicitly destroy the mutex. - ~ACE_Thread_Mutex (void); - - /** - * Explicitly destroy the mutex. Note that only one thread should - * call this method since it doesn't protect against race - * conditions. - */ - int remove (void); - - /// Acquire lock ownership (wait on queue if necessary). - int acquire (void); - - /** - * Block the thread until we acquire the mutex or until @a tv times - * out, in which case -1 is returned with @c errno == @c ETIME. Note - * that @a tv is assumed to be in "absolute" rather than "relative" - * time. The value of @a tv is updated upon return to show the - * actual (absolute) acquisition time. - */ - int acquire (ACE_Time_Value &tv); - - /** - * If @a tv == 0 the call directly. Otherwise, Block the - * thread until we acquire the mutex or until @a tv times out, in - * which case -1 is returned with @c errno == @c ETIME. Note that - * @a tv is assumed to be in "absolute" rather than "relative" time. - * The value of @a tv is updated upon return to show the actual - * (absolute) acquisition time. - */ - int acquire (ACE_Time_Value *tv); - - /** - * Conditionally acquire lock (i.e., don't wait on queue). Returns - * -1 on failure. If we "failed" because someone else already had - * the lock, @c errno is set to @c EBUSY. - */ - int tryacquire (void); - - /// Release lock and unblock a thread at head of queue. - int release (void); - - /** - * Acquire mutex ownership. This calls acquire() and is only here - * to make the ACE_Thread_Mutex interface consistent with the - * other synchronization APIs. - */ - int acquire_read (void); - - /** - * Acquire mutex ownership. This calls acquire() and is only here - * to make the ACE_Thread_Mutex interface consistent with the - * other synchronization APIs. - */ - int acquire_write (void); - - /** - * Conditionally acquire mutex (i.e., won't block). This calls - * tryacquire() and is only here to make the ACE_Thread_Mutex - * interface consistent with the other synchronization APIs. - * Returns -1 on failure. If we "failed" because someone else - * already had the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_read (void); - - /** - * Conditionally acquire mutex (i.e., won't block). This calls - * tryacquire() and is only here to make the ACE_Thread_Mutex - * interface consistent with the other synchronization APIs. - * Returns -1 on failure. If we "failed" because someone else - * already had the lock, @c errno is set to @c EBUSY. - */ - int tryacquire_write (void); - - /** - * This is only here to make the ACE_Thread_Mutex - * interface consistent with the other synchronization APIs. - * Assumes the caller has already acquired the mutex using one of - * the above calls, and returns 0 (success) always. - */ - int tryacquire_write_upgrade (void); - - /// Return the underlying mutex. - const ACE_thread_mutex_t &lock (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // protected: - /// Mutex type that supports single-process locking efficiently. - ACE_thread_mutex_t lock_; - - /// Keeps track of whether remove() has been called yet to avoid - /// multiple calls, e.g., explicitly and implicitly in the - /// destructor. This flag isn't protected by a lock, so make sure - /// that you don't have multiple threads simultaneously calling - /// on the same object, which is a bad idea anyway... - bool removed_; - -private: - // = Prevent assignment and initialization. - void operator= (const ACE_Thread_Mutex &); - ACE_Thread_Mutex (const ACE_Thread_Mutex &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Thread_Mutex.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* !ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/Thread_Mutex.inl b/dep/include/ace/Thread_Mutex.inl deleted file mode 100644 index ff744684c2b..00000000000 --- a/dep/include/ace/Thread_Mutex.inl +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread_Mutex.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE const ACE_thread_mutex_t & -ACE_Thread_Mutex::lock (void) const -{ -// ACE_TRACE ("ACE_Thread_Mutex::lock"); - return this->lock_; -} - -ACE_INLINE int -ACE_Thread_Mutex::acquire_read (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::acquire_read"); - return ACE_OS::thread_mutex_lock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::acquire_write (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::acquire_write"); - return ACE_OS::thread_mutex_lock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::tryacquire_read (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::tryacquire_read"); - return ACE_OS::thread_mutex_trylock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::tryacquire_write (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::tryacquire_write"); - return ACE_OS::thread_mutex_trylock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::tryacquire_write_upgrade (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::tryacquire_write_upgrade"); - return 0; -} - -ACE_INLINE int -ACE_Thread_Mutex::acquire (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::acquire"); - return ACE_OS::thread_mutex_lock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::acquire (ACE_Time_Value &tv) -{ - // ACE_TRACE ("ACE_Thread_Mutex::acquire"); - return ACE_OS::thread_mutex_lock (&this->lock_, tv); -} - -ACE_INLINE int -ACE_Thread_Mutex::acquire (ACE_Time_Value *tv) -{ - // ACE_TRACE ("ACE_Thread_Mutex::acquire"); - return ACE_OS::thread_mutex_lock (&this->lock_, tv); -} - -ACE_INLINE int -ACE_Thread_Mutex::tryacquire (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::tryacquire"); - return ACE_OS::thread_mutex_trylock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::release (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::release"); - return ACE_OS::thread_mutex_unlock (&this->lock_); -} - -ACE_INLINE int -ACE_Thread_Mutex::remove (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex::remove"); - int result = 0; - if (this->removed_ == false) - { - this->removed_ = true; - result = ACE_OS::thread_mutex_destroy (&this->lock_); - } - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Thread_Semaphore.h b/dep/include/ace/Thread_Semaphore.h deleted file mode 100644 index e6a9d008e68..00000000000 --- a/dep/include/ace/Thread_Semaphore.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Thread_Semaphore.h - * - * $Id: Thread_Semaphore.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Moved from Synch.h. - * - * @author Douglas C. Schmidt - */ -//========================================================================== - -#ifndef ACE_THREAD_SEMAPHORE_H -#define ACE_THREAD_SEMAPHORE_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_HAS_THREADS) -# include "ace/Null_Semaphore.h" -#else /* ACE_HAS_THREADS */ -// ACE platform supports some form of threading. - -#include "ace/Semaphore.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Thread_Semaphore - * - * @brief Wrapper for Dijkstra style general semaphores that work - * only within one process. - */ -class ACE_Export ACE_Thread_Semaphore : public ACE_Semaphore -{ -public: - /// Initialize the semaphore, with an initial value of @a count, - /// maximum value of @a max, and unlocked by default. - ACE_Thread_Semaphore (unsigned int count = 1, // By default make this unlocked. - const ACE_TCHAR *name = 0, - void * = 0, - int max = 0x7FFFFFFF); - - /// Default dtor. - ~ACE_Thread_Semaphore (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -/*****************************************************************************/ - -template class ACE_Malloc_Lock_Adapter_T; - -/** - * @class ACE_Malloc_Lock_Adapter_T - * - * @brief Template specialization of ACE_Malloc_Lock_Adapter_T for - * ACE_Thread_Semaphore. - * - * This is needed since the ctor for ACE_Thread_Semaphore doesn't match - * the standard form used by other lock strategy classes. - */ -template<> -class ACE_Export ACE_Malloc_Lock_Adapter_T -{ -public: - ACE_Thread_Semaphore * operator () (const ACE_TCHAR *name); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Thread_Semaphore.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* !ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_THREAD_SEMAPHORE_H */ - diff --git a/dep/include/ace/Thread_Semaphore.inl b/dep/include/ace/Thread_Semaphore.inl deleted file mode 100644 index b64ec3c08f5..00000000000 --- a/dep/include/ace/Thread_Semaphore.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Thread_Semaphore.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Thread_Semaphore::~ACE_Thread_Semaphore (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Throughput_Stats.h b/dep/include/ace/Throughput_Stats.h deleted file mode 100644 index 9f4a87fdc8f..00000000000 --- a/dep/include/ace/Throughput_Stats.h +++ /dev/null @@ -1,86 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Throughput_Stats.h - * - * $Id: Throughput_Stats.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author David L. Levine - */ -//========================================================================== - -#ifndef ACE_THROUGHPUT_STATS_H -#define ACE_THROUGHPUT_STATS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Stats.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/// A simple class to make throughput and latency analysis. -/** - * - * Keep the relevant information to perform throughput and latency - * analysis, including: - * -# Minimum, Average and Maximum latency - * -# Jitter for the latency - * -# Linear regression for throughput - * -# Accumulate results from several samples to obtain aggregated - * results, across several threads or experiments. - * - * @todo The idea behind this class was to use linear regression to - * determine if the throughput was linear or exhibited jitter. - * Unfortunately it never worked quite right, so only average - * throughput is computed. - */ -class ACE_Export ACE_Throughput_Stats : public ACE_Basic_Stats -{ -public: - /// Constructor - ACE_Throughput_Stats (void); - - /// Store one sample - void sample (ACE_UINT64 throughput, ACE_UINT64 latency); - - /// Update the values to reflect the stats in @a throughput - void accumulate (const ACE_Throughput_Stats &throughput); - - /// Print down the stats - void dump_results (const ACE_TCHAR* msg, ACE_UINT32 scale_factor); - - /// Dump the average throughput stats. - static void dump_throughput (const ACE_TCHAR *msg, - ACE_UINT32 scale_factor, - ACE_UINT64 elapsed_time, - ACE_UINT32 samples_count); -private: - /// The last throughput measurement. - ACE_UINT64 throughput_last_; - -#if 0 - /// These are the fields that we should keep to perform linear - /// regression - //@{ - ///@} - ACE_UINT64 throughput_sum_x_; - ACE_UINT64 throughput_sum_x2_; - ACE_UINT64 throughput_sum_y_; - ACE_UINT64 throughput_sum_y2_; - ACE_UINT64 throughput_sum_xy_; -#endif /* 0 */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ! ACE_THROUGHPUT_STATS_H */ - diff --git a/dep/include/ace/Time_Value.h b/dep/include/ace/Time_Value.h deleted file mode 100644 index ae75cc1c9de..00000000000 --- a/dep/include/ace/Time_Value.h +++ /dev/null @@ -1,381 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Time_Value.h - * - * $Id: Time_Value.h 81914 2008-06-11 13:56:11Z sma $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TIME_VALUE_H -#define ACE_TIME_VALUE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -# include "ace/os_include/os_time.h" - -// Define some helpful constants. -// Not type-safe, and signed. For backward compatibility. -#define ACE_ONE_SECOND_IN_MSECS 1000L -suseconds_t const ACE_ONE_SECOND_IN_USECS = 1000000; -#define ACE_ONE_SECOND_IN_NSECS 1000000000L - -// needed for ACE_UINT64 -#include "ace/Basic_Types.h" - -// This forward declaration is needed by the set() and FILETIME() functions -#if defined (ACE_LACKS_LONGLONG_T) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Export ACE_U_LongLong; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_LACKS_LONGLONG_T */ - -// ------------------------------------------------------------------- - -/** - * @class ACE_Time_Value - * - * @brief Operations on "timeval" structures, which express time in - * seconds (secs) and microseconds (usecs). - * - * This class centralizes all the time related processing in - * ACE. These time values are typically used in conjunction with OS - * mechanisms like or other calls that may have - * *their own* implementation-specific maximum time representations. - * Its primary use is in time computations such as those used by the - * dynamic subpriority strategies in the ACE_Dynamic_Message_Queue - * class. - */ - static const ACE_Time_Value max_time; - - // = Initialization methods. - - /// Default Constructor. - ACE_Time_Value (void); - - /// Constructor. - explicit ACE_Time_Value (time_t sec, suseconds_t usec = 0); - - // = Methods for converting to/from various time formats. - - /// Construct the ACE_Time_Value from a timeval. - explicit ACE_Time_Value (const struct timeval &t); - - /// Construct the ACE_Time_Value object from a timespec_t. - explicit ACE_Time_Value (const timespec_t &t); - -# if defined (ACE_WIN32) - /// Construct the ACE_Time_Value object from a Win32 FILETIME - explicit ACE_Time_Value (const FILETIME &ft); -# endif /* ACE_WIN32 */ - - /// Initializes the ACE_Time_Value from seconds and useconds. - void set (time_t sec, suseconds_t usec); - - /// Initializes the ACE_Time_Value from a double, which is assumed to be - /// in second format, with any remainder treated as microseconds. - void set (double d); - - /// Initializes the ACE_Time_Value from a timeval. - void set (const timeval &t); - - /// Initializes the ACE_Time_Value object from a timespec_t. - void set (const timespec_t &t); - -# if defined (ACE_WIN32) - /// Initializes the ACE_Time_Value object from a Win32 FILETIME. - void set (const FILETIME &ft); -# endif /* ACE_WIN32 */ - - /// Converts from ACE_Time_Value format into milliseconds format. - /** - * @return Sum of second field (in milliseconds) and microsecond field - * (in milliseconds). Note that this method can overflow if - * the second and microsecond field values are large, so use - * the msec (ACE_UINT64 &ms) method instead. - * - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - unsigned long msec (void) const; - - /// Converts from ACE_Time_Value format into milliseconds format. - /** - * @return Sum of second field (in milliseconds) and microsecond field - * (in milliseconds) and return them via the @param ms parameter. - * - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - void msec (ACE_UINT64 &ms) const; - - /// Converts from ACE_Time_Value format into milliseconds format. - /** - * @return Sum of second field (in milliseconds) and microsecond field - * (in milliseconds) and return them via the @param ms parameter. - * - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - void msec (ACE_UINT64 &ms) /* const */; - - /// Converts from milli-seconds format into ACE_Time_Value format. - /** - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - void msec (long); - - /// Converts from milli-seconds format into ACE_Time_Value format. - /** - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - void msec (int); // converted to long then calls above. - - /// Returns the value of the object as a timespec_t. - operator timespec_t () const; - - /// Returns the value of the object as a timeval. - operator timeval () const; - - /// Returns a pointer to the object as a timeval. - operator const timeval *() const; - -# if defined (ACE_WIN32) - /// Returns the value of the object as a Win32 FILETIME. - operator FILETIME () const; -# endif /* ACE_WIN32 */ - - // = The following are accessor/mutator methods. - - /// Get seconds. - /** - * @return The second field/component of this ACE_Time_Value. - * - * @note The semantics of this method differs from the msec() - * method. - */ - time_t sec (void) const; - - /// Set seconds. - void sec (time_t sec); - - /// Get microseconds. - /** - * @return The microsecond field/component of this ACE_Time_Value. - * - * @note The semantics of this method differs from the msec() - * method. - */ - suseconds_t usec (void) const; - - /// Set microseconds. - void usec (suseconds_t usec); - - /** - * @return Sum of second field (in microseconds) and microsecond field - * and return them via the @param usec parameter. - */ - void to_usec (ACE_UINT64 &usec) const; - - // = The following arithmetic methods operate on ACE_Time_Value's. - - /// Add @a tv to this. - ACE_Time_Value &operator += (const ACE_Time_Value &tv); - - /// Add @a tv to this. - ACE_Time_Value &operator += (time_t tv); - - /// Assign @ tv to this - ACE_Time_Value &operator = (const ACE_Time_Value &tv); - - /// Assign @ tv to this - ACE_Time_Value &operator = (time_t tv); - - /// Subtract @a tv to this. - ACE_Time_Value &operator -= (const ACE_Time_Value &tv); - - /// Substract @a tv to this. - ACE_Time_Value &operator -= (time_t tv); - - /** - \brief Multiply the time value by the @a d factor. - \note The result of the operator is valid for results from range - < (ACE_INT32_MIN, -999999), (ACE_INT32_MAX, 999999) >. Result - outside this range are saturated to a limit. - */ - ACE_Time_Value &operator *= (double d); - - /// Increment microseconds as postfix. - /** - * @note The only reason this is here is to allow the use of ACE_Atomic_Op - * with ACE_Time_Value. - */ - ACE_Time_Value operator++ (int); - - /// Increment microseconds as prefix. - /** - * @note The only reason this is here is to allow the use of ACE_Atomic_Op - * with ACE_Time_Value. - */ - ACE_Time_Value &operator++ (void); - - /// Decrement microseconds as postfix. - /** - * @note The only reason this is here is to allow the use of ACE_Atomic_Op - * with ACE_Time_Value. - */ - ACE_Time_Value operator-- (int); - - /// Decrement microseconds as prefix. - /** - * @note The only reason this is here is to allow the use of ACE_Atomic_Op - * with ACE_Time_Value. - */ - ACE_Time_Value &operator-- (void); - - /// Adds two ACE_Time_Value objects together, returns the sum. - friend ACE_Export ACE_Time_Value operator + (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// Subtracts two ACE_Time_Value objects, returns the difference. - friend ACE_Export ACE_Time_Value operator - (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 < @a tv2. - friend ACE_Export bool operator < (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 > @a tv2. - friend ACE_Export bool operator > (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 <= @a tv2. - friend ACE_Export bool operator <= (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 >= @a tv2. - friend ACE_Export bool operator >= (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 == @a tv2. - friend ACE_Export bool operator == (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - /// True if @a tv1 != @a tv2. - friend ACE_Export bool operator != (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2); - - //@{ - /// Multiplies the time value by @a d - friend ACE_Export ACE_Time_Value operator * (double d, - const ACE_Time_Value &tv); - - friend ACE_Export ACE_Time_Value operator * (const ACE_Time_Value &tv, - double d); - //@} - - /// Dump is a no-op. - /** - * The dump() method is a no-op. It's here for backwards compatibility - * only, but does not dump anything. Invoking logging methods here - * violates layering restrictions in ACE because this class is part - * of the OS layer and @c ACE_Log_Msg is at a higher level. - */ - void dump (void) const; - -# if defined (ACE_WIN32) - /// Const time difference between FILETIME and POSIX time. -# if defined (ACE_LACKS_LONGLONG_T) - static const ACE_U_LongLong FILETIME_to_timval_skew; -# else - static const DWORDLONG FILETIME_to_timval_skew; -# endif // ACE_LACKS_LONGLONG_T -# endif /* ACE_WIN32 */ - -private: - /// Put the timevalue into a canonical form. - void normalize (void); - - /// Store the values as a timeval. -#if defined (ACE_HAS_TIME_T_LONG_MISMATCH) - // Windows' timeval is non-conformant, so swap in a struct that conforms - // to the proper data types to represent the entire time range that this - // class's API can accept. - // Also, since this class can supply a pointer to a timeval that things - // like select() expect, we need the OS-defined one as well. To make this - // available, use a real timeval called ext_tv_ and set it up when needed. - // Since this is most often for relative times that don't approach 32 bits - // in size, reducing a time_t to fit should be no problem. - struct { - time_t tv_sec; - suseconds_t tv_usec; - } tv_; - timeval ext_tv_; -#else - timeval tv_; -#endif /* ACE_HAS_TIME_T_LONG_MISMATCH */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Time_Value.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - -#if defined (__MINGW32__) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// The MingW linker has problems with the exported statics -// zero and max_time with these two statics the linker will be able to -// resolve the static exported symbols. -static const ACE_Time_Value& __zero_time = ACE_Time_Value::zero; -static const ACE_Time_Value& __max_time = ACE_Time_Value::max_time; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* __MINGW32__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_TIME_VALUE_H */ - diff --git a/dep/include/ace/Time_Value.inl b/dep/include/ace/Time_Value.inl deleted file mode 100644 index 27433389323..00000000000 --- a/dep/include/ace/Time_Value.inl +++ /dev/null @@ -1,422 +0,0 @@ -// -*- C++ -*- -// -// $Id: Time_Value.inl 82610 2008-08-12 19:46:36Z parsons $ - -#include "ace/Truncate.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - -// Returns the value of the object as a timeval. - -ACE_INLINE -ACE_Time_Value::operator timeval () const -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator timeval"); -#if defined (ACE_HAS_TIME_T_LONG_MISMATCH) - // Recall that on some Windows we substitute another type for timeval in tv_ - ACE_Time_Value *me = const_cast (this); - me->ext_tv_.tv_sec = ACE_Utils::truncate_cast (this->tv_.tv_sec); - me->ext_tv_.tv_usec = ACE_Utils::truncate_cast (this->tv_.tv_usec); - return this->ext_tv_; -#else - return this->tv_; -#endif /* ACE_HAS_TIME_T_LONG_MISMATCH */ -} - -ACE_INLINE void -ACE_Time_Value::set (const timeval &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::set"); - this->tv_.tv_sec = tv.tv_sec; - this->tv_.tv_usec = tv.tv_usec; - - this->normalize (); -} - -ACE_INLINE -ACE_Time_Value::ACE_Time_Value (const struct timeval &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value"); - this->set (tv); -} - -ACE_INLINE -ACE_Time_Value::operator const timeval * () const -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator const timeval *"); -#if defined (ACE_HAS_TIME_T_LONG_MISMATCH) - // Recall that on some Windows we substitute another type for timeval in tv_ - ACE_Time_Value *me = const_cast (this); - me->ext_tv_.tv_sec = ACE_Utils::truncate_cast (this->tv_.tv_sec); - me->ext_tv_.tv_usec = ACE_Utils::truncate_cast (this->tv_.tv_usec); - return (const timeval *) &this->ext_tv_; -#else - return (const timeval *) &this->tv_; -#endif /* ACE_HAS_TIME_T_LONG_MISMATCH */ -} - -ACE_INLINE void -ACE_Time_Value::set (time_t sec, suseconds_t usec) -{ - // ACE_OS_TRACE ("ACE_Time_Value::set"); - this->tv_.tv_sec = sec; - this->tv_.tv_usec = usec; -#if __GNUC__ - if (__builtin_constant_p(sec) && - __builtin_constant_p(usec) && - (sec >= 0 && usec >= 0 && usec < ACE_ONE_SECOND_IN_USECS)) - return; -#endif - this->normalize (); -} - -ACE_INLINE void -ACE_Time_Value::set (double d) -{ - // ACE_OS_TRACE ("ACE_Time_Value::set"); - long l = (long) d; - this->tv_.tv_sec = l; - this->tv_.tv_usec = (suseconds_t) ((d - (double) l) * ACE_ONE_SECOND_IN_USECS + .5); - this->normalize (); -} - -// Initializes a timespec_t. Note that this approach loses precision -// since it converts the nano-seconds into micro-seconds. But then -// again, do any real systems have nano-second timer precision?! - -ACE_INLINE void -ACE_Time_Value::set (const timespec_t &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::set"); - - this->set (tv.tv_sec, - tv.tv_nsec / 1000); // Convert nanoseconds into microseconds. -} - -ACE_INLINE -ACE_Time_Value::ACE_Time_Value (void) - // : tv_ () -{ - // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value"); - this->set (0, 0); -} - -ACE_INLINE -ACE_Time_Value::ACE_Time_Value (time_t sec, suseconds_t usec) -{ - // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value"); - this->set (sec, usec); -} - -// Returns number of seconds. - -ACE_INLINE time_t -ACE_Time_Value::sec (void) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::sec"); - return this->tv_.tv_sec; -} - -// Sets the number of seconds. - -ACE_INLINE void -ACE_Time_Value::sec (time_t sec) -{ - // ACE_OS_TRACE ("ACE_Time_Value::sec"); - this->tv_.tv_sec = ACE_Utils::truncate_cast (sec); -} - -// Converts from Time_Value format into milli-seconds format. - -ACE_INLINE unsigned long -ACE_Time_Value::msec (void) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::msec"); - - // Note - we're truncating a value here, which can lose data. This is - // called out in the user documentation for this with a recommendation to - // use msec(ACE_UINT64&) instead, so just go ahead and truncate. - time_t secs = this->tv_.tv_sec * 1000 + this->tv_.tv_usec / 1000; - return ACE_Utils::truncate_cast (secs); -} - -ACE_INLINE void -ACE_Time_Value::msec (ACE_UINT64 &ms) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::msec"); - ms = ACE_Utils::truncate_cast (this->tv_.tv_sec); - ms *= 1000; - ms += (this->tv_.tv_usec / 1000); -} - -ACE_INLINE void -ACE_Time_Value::msec (ACE_UINT64 &ms) /*const*/ -{ - // ACE_OS_TRACE ("ACE_Time_Value::msec"); - const ACE_Time_Value *tv = this; - tv->msec (ms); -} - -// Converts from milli-seconds format into Time_Value format. - -ACE_INLINE void -ACE_Time_Value::msec (long milliseconds) -{ - // ACE_OS_TRACE ("ACE_Time_Value::msec"); - // Convert millisecond units to seconds; - long secs = milliseconds / 1000; - this->tv_.tv_sec = secs; - // Convert remainder to microseconds; - this->tv_.tv_usec = (milliseconds - (secs * 1000)) * 1000; -} - -// Converts from milli-seconds format into Time_Value format. - -ACE_INLINE void -ACE_Time_Value::msec (int milliseconds) -{ - ACE_Time_Value::msec (static_cast (milliseconds)); -} - -// Returns number of micro-seconds. - -ACE_INLINE suseconds_t -ACE_Time_Value::usec (void) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::usec"); - return this->tv_.tv_usec; -} - -// Sets the number of micro-seconds. - -ACE_INLINE void -ACE_Time_Value::usec (suseconds_t usec) -{ - // ACE_OS_TRACE ("ACE_Time_Value::usec"); - this->tv_.tv_usec = usec; -} - -ACE_INLINE void -ACE_Time_Value::to_usec (ACE_UINT64 & usec) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::to_usec"); - -#if defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - usec = ACE_U_LongLong (static_cast (this->tv_.tv_sec)); -#elif defined (ACE_LACKS_LONGLONG_T) - // No native 64-bit type, meaning time_t is most likely 32 bits. - usec = ACE_U_LongLong (this->tv_.tv_sec); -#else - usec = static_cast (this->tv_.tv_sec); -#endif /* ACE_LACKS_LONG_LONG_T */ - usec *= 1000000; - usec += this->tv_.tv_usec; -} - -ACE_INLINE ACE_Time_Value -operator * (double d, const ACE_Time_Value &tv) -{ - return ACE_Time_Value (tv) *= d; -} - -ACE_INLINE ACE_Time_Value -operator * (const ACE_Time_Value &tv, double d) -{ - return ACE_Time_Value (tv) *= d; -} - -// True if tv1 > tv2. - -ACE_INLINE bool -operator > (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator >"); - if (tv1.sec () > tv2.sec ()) - return 1; - else if (tv1.sec () == tv2.sec () - && tv1.usec () > tv2.usec ()) - return 1; - else - return 0; -} - -// True if tv1 >= tv2. - -ACE_INLINE bool -operator >= (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator >="); - if (tv1.sec () > tv2.sec ()) - return 1; - else if (tv1.sec () == tv2.sec () - && tv1.usec () >= tv2.usec ()) - return 1; - else - return 0; -} - -// Returns the value of the object as a timespec_t. - -ACE_INLINE -ACE_Time_Value::operator timespec_t () const -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator timespec_t"); - timespec_t tv; - tv.tv_sec = this->sec (); - // Convert microseconds into nanoseconds. - tv.tv_nsec = this->tv_.tv_usec * 1000; - return tv; -} - -// Initializes the ACE_Time_Value object from a timespec_t. - -ACE_INLINE -ACE_Time_Value::ACE_Time_Value (const timespec_t &tv) - // : tv_ () -{ - // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value"); - this->set (tv); -} - -// True if tv1 < tv2. - -ACE_INLINE bool -operator < (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator <"); - return tv2 > tv1; -} - -// True if tv1 >= tv2. - -ACE_INLINE bool -operator <= (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator <="); - return tv2 >= tv1; -} - -// True if tv1 == tv2. - -ACE_INLINE bool -operator == (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator =="); - return tv1.sec () == tv2.sec () - && tv1.usec () == tv2.usec (); -} - -// True if tv1 != tv2. - -ACE_INLINE bool -operator != (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator !="); - return !(tv1 == tv2); -} - -// Add TV to this. - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator+= (const ACE_Time_Value &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator+="); - this->sec (this->sec () + tv.sec ()); - this->usec (this->usec () + tv.usec ()); - this->normalize (); - return *this; -} - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator+= (time_t tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator+="); - this->sec (this->sec () + tv); - return *this; -} - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator= (const ACE_Time_Value &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator="); - this->sec (tv.sec ()); - this->usec (tv.usec ()); - return *this; -} - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator= (time_t tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator="); - this->sec (tv); - this->usec (0); - return *this; -} - -// Subtract TV to this. - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator-= (const ACE_Time_Value &tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator-="); - this->sec (this->sec () - tv.sec ()); - this->usec (this->usec () - tv.usec ()); - this->normalize (); - return *this; -} - -ACE_INLINE ACE_Time_Value & -ACE_Time_Value::operator-= (time_t tv) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator-="); - this->sec (this->sec () - tv); - return *this; -} - -// Adds two ACE_Time_Value objects together, returns the sum. - -ACE_INLINE ACE_Time_Value -operator + (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator +"); - ACE_Time_Value sum (tv1); - sum += tv2; - - return sum; -} - -// Subtracts two ACE_Time_Value objects, returns the difference. - -ACE_INLINE ACE_Time_Value -operator - (const ACE_Time_Value &tv1, - const ACE_Time_Value &tv2) -{ - // ACE_OS_TRACE ("operator -"); - ACE_Time_Value delta (tv1); - delta -= tv2; - - return delta; -} - -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Timeprobe.h b/dep/include/ace/Timeprobe.h deleted file mode 100644 index 4ec811e6317..00000000000 --- a/dep/include/ace/Timeprobe.h +++ /dev/null @@ -1,202 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timeprobe.h - * - * $Id: Timeprobe.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali - * - * If users want to use time probes, the ACE_COMPILE_TIMEPROBES - * flag must be defined when compiling ACE. This can be achieved - * by doing one of the following: - * - * . Use make probe = 1, if you are using the make utility. - * - * . Define ACE_COMPILE_TIMEPROBES in config.h - * - * . Define ACE_COMPILE_TIMEPROBES in the VC project file. - * - * . Other regular methods will also work. - * - * It is not necessary to define ACE_COMPILE_TIMEPROBES when using - * time probes, you simply need ACE_ENABLE_TIMEPROBES. You can use - * the ACE_TIMEPROBE_* macros to program the time probes, and use - * the ACE_ENABLE_TIMEPROBE to enable the time probes. If you - * define ACE_ENABLE_TIMEPROBE in your code, but forget to compile - * ACE with ACE_COMPILE_TIMEPROBES, you will end up with linker - * errors. - * - * Remember that ACE_COMPILE_TIMEPROBES means that the ACE library - * will contain code for time probes. This is only useful when - * compiling ACE. ACE_ENABLE_TIMEPROBES means that the - * ACE_TIMEPROBE_* macros should spring to life. - */ -//============================================================================= - -#ifndef ACE_TIMEPROBE_H -#define ACE_TIMEPROBE_H -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" -#include /**/ "ace/ACE_export.h" -#include "ace/Malloc_Allocator.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/* Enable ACE Timeprobes */ -#if defined (ACE_ENABLE_TIMEPROBES) - #if !defined (ACE_COMPILE_TIMEPROBES) - #define ACE_COMPILE_TIMEPROBES - #endif /* ACE_COMPILE_TIMEPROBES */ -#endif /* ACE_ENABLE_TIMEPROBES */ - -#if defined (ACE_COMPILE_TIMEPROBES) - -#include "ace/OS_NS_time.h" -#include "ace/OS_NS_Thread.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Event_Descriptions - * - * @brief Event Descriptions. - */ -class ACE_Export ACE_Event_Descriptions -{ -public: - /// Event descriptions - const char **descriptions_; - - /// Minimum id of this description set - u_long minimum_id_; - - /// Comparison - bool operator== (const ACE_Event_Descriptions &rhs) const; -}; - -/** - * @class ACE_timeprobe_t - * - * @brief Time probe record. - */ -class ACE_Export ACE_timeprobe_t -{ -public: - /// Events are record as strings or numbers. - union event - { - u_long event_number_; - const char *event_description_; - }; - - /// Type of event. - enum event_type - { - NUMBER, - STRING - }; - - /// Event. - event event_; - - /// Type of event. - event_type event_type_; - - /// Timestamp. - ACE_hrtime_t time_; - - /// Id of thread posting the time probe. - ACE_thread_t thread_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Timeprobe.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Synch_Traits.h" -#include "ace/Null_Mutex.h" -#include "ace/Singleton.h" -#include "ace/Timeprobe_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// If ACE_MT_TIMEPROBES is defined, use a Thread_Mutex to lock the -// internal state of ACE_Timerprobe. This allows multiple threads to -// use the same ACE_Timerprobe. -# if defined (ACE_MT_TIMEPROBES) -typedef ACE_SYNCH_MUTEX ACE_TIMEPROBE_MUTEX; -# else /* ACE_MT_TIMEPROBES */ -typedef ACE_SYNCH_NULL_MUTEX ACE_TIMEPROBE_MUTEX; -# endif /* ACE_MT_TIMEPROBES */ - -typedef ACE_New_Allocator ACE_TIMEPROBE_ALLOCATOR; - -typedef ACE_Timeprobe_Ex - ACE_TIMEPROBE_WITH_LOCKING; - -// If ACE_TSS_TIMEPROBES is defined, store the ACE_Timeprobe singleton -// in thread specific storage. This allows multiple threads to use -// their own instance of ACE_Timerprobe, without interfering with each -// other. - -# if defined (ACE_TSS_TIMEPROBES) -# define ACE_TIMEPROBE_SINGLETON_TYPE ACE_TSS_Singleton -# define ACE_TIMEPROBE_SINGLETON_LOCK_TYPE ACE_SYNCH_NULL_MUTEX -# else /* ACE_TSS_TIMEPROBES */ -# define ACE_TIMEPROBE_SINGLETON_TYPE ACE_Singleton -# define ACE_TIMEPROBE_SINGLETON_LOCK_TYPE ACE_SYNCH_MUTEX -# endif /* ACE_TSS_TIMEPROBES */ - -ACE_SINGLETON_DECLARE (ACE_TIMEPROBE_SINGLETON_TYPE, \ - ACE_TIMEPROBE_WITH_LOCKING, \ - ACE_TIMEPROBE_SINGLETON_LOCK_TYPE) - -typedef ACE_TIMEPROBE_SINGLETON_TYPE - ACE_TIMEPROBE_SINGLETON; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_COMPILE_TIMEPROBES */ - -// If ACE_ENABLE_TIMEPROBES is defined, the macros below will -// work. Otherwise, they just vanish. Using this macro, you can -// control which files/libraries are probed. -#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES) - -# define ACE_TIMEPROBE_RESET ACE_TIMEPROBE_SINGLETON::instance ()->reset () - -# define ACE_TIMEPROBE(id) ACE_TIMEPROBE_SINGLETON::instance ()->timeprobe (id) - -# define ACE_TIMEPROBE_PRINT ACE_TIMEPROBE_SINGLETON::instance ()->print_times () - -# define ACE_TIMEPROBE_PRINT_ABSOLUTE ACE_TIMEPROBE_SINGLETON::instance ()->print_absolute_times () - -# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) \ -static int ace_timeprobe_##descriptions##_return = \ - ACE_TIMEPROBE_SINGLETON::instance ()->event_descriptions \ - (descriptions, minimum_id) - -# define ACE_FUNCTION_TIMEPROBE(X) \ - ACE_Function_Timeprobe function_timeprobe \ - (*ACE_TIMEPROBE_SINGLETON::instance (), X) - -#else /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ - -# define ACE_TIMEPROBE_RESET -# define ACE_TIMEPROBE(id) -# define ACE_TIMEPROBE_PRINT -# define ACE_TIMEPROBE_PRINT_ABSOLUTE -# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) -# define ACE_FUNCTION_TIMEPROBE(X) - -#endif /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ -#include /**/ "ace/post.h" -#endif /* ACE_TIMEPROBE_H */ - diff --git a/dep/include/ace/Timeprobe.inl b/dep/include/ace/Timeprobe.inl deleted file mode 100644 index aa7a9240648..00000000000 --- a/dep/include/ace/Timeprobe.inl +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -// -// $Id: Timeprobe.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE bool -ACE_Event_Descriptions::operator== (const ACE_Event_Descriptions &rhs) const -{ - return this->minimum_id_ == rhs.minimum_id_ && - this->descriptions_ == rhs.descriptions_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Timeprobe_T.h b/dep/include/ace/Timeprobe_T.h deleted file mode 100644 index db69cb1da2b..00000000000 --- a/dep/include/ace/Timeprobe_T.h +++ /dev/null @@ -1,219 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timeprobe_T.h - * - * $Id: Timeprobe_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_TIMEPROBE_T_H -#define ACE_TIMEPROBE_T_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_COMPILE_TIMEPROBES) - -#include "ace/Unbounded_Set.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Timeprobe_Ex - * - * @brief This class is used to instrument code. This is accomplished - * by inserting time probes at different location in the code. - * ACE_Timeprobe then measures the time difference between two - * time probes. - * - * This class provides a lightweight implementation for - * measuring the time required to execute code between two time - * probes. When a time probe executes, it records the time, the - * id of the calling thread, and an event description. The - * event description can either be an unsigned long or a string - * (char *). If string are used, care must be taken cause only - * pointer copies are done and the string data is *not* copied. - * The recorded time probes can then be printed by calling - * . If you have used unsigned longs as event - * descriptions in any of your time probes, you must have - * provided an event description table that maps the unsigned - * longs to readable strings. This map is a simple array of - * strings, and the event number is used as the index into the - * array when looking for the event description. If you have - * only used strings for the event description, this map is not - * necessary. - * Multiple maps can also be used to chunk up the time probes. - * Each one can be added by calling . - * Different tables are used internally by consulting the - * minimum_id for each table. It is up to the user to make sure - * that multiple tables do not share the same event id range. - */ -template -class ACE_Timeprobe_Ex -{ -public: - - /// Self - typedef ACE_Timeprobe_Ex - SELF; - - /** - * ACE_Timeprobe - */ - typedef ACE_Timeprobe_Ex ACE_Timeprobe; - - /// We can hold multiple event description tables. - typedef ACE_Unbounded_Set - EVENT_DESCRIPTIONS; - - /// Create Timeprobes with @a size slots - ACE_Timeprobe_Ex (u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE); - - /// Create Timeprobes with @a size slots - ACE_Timeprobe_Ex (ALLOCATOR *allocator, - u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE); - /// Destructor. - ~ACE_Timeprobe_Ex (void); - - /// Record a time. @a event is used to describe this time probe. - void timeprobe (u_long event); - - /// Record a time. @a id is used to describe this time probe. - void timeprobe (const char *id); - - /// Record event descriptions. - int event_descriptions (const char **descriptions, - u_long minimum_id); - - /// Print the time probes. - void print_times (void); - - /// Print the time probes. - void print_absolute_times (void); - - /// Reset the slots. All old time probes will be lost. - void reset (void); - - void increase_size (u_long size); - - /// Not implemented (stupid MSVC won't let it be protected). - ACE_Timeprobe_Ex (const ACE_Timeprobe_Ex &); - - // = (Somewhat private) Accessors - - /// Event Descriptions - ACE_Unbounded_Set &event_descriptions (void); - - /// Sorted Event Descriptions. - ACE_Unbounded_Set &sorted_event_descriptions (void); - - /// Find description of event @a i - const char *find_description_i (u_long i); - - /// Sort event descriptions - void sort_event_descriptions_i (void); - - /// Time probe slots - ACE_timeprobe_t *timeprobes (void); - - /// Synchronization variable. - ACE_LOCK &lock (void); - - /// Max size of timestamp table - u_long max_size (void); - - /// Current size of timestamp table - u_long current_size (void); - -protected: - - /// Obtain an allocator pointer. If there is no allocator stored in - /// the instance, the singleton allocator in the current process is used. - ALLOCATOR * allocator (void); - - /// Event Descriptions - EVENT_DESCRIPTIONS event_descriptions_; - - /// Sorted Event Descriptions. - EVENT_DESCRIPTIONS sorted_event_descriptions_; - - /// Time probe slots - ACE_timeprobe_t *timeprobes_; - - /// Synchronization variable. - ACE_LOCK lock_; - - /// Max size of timestamp table - u_long max_size_; - - /// Current size of timestamp table - u_long current_size_; - - /// Flag indicating the report buffer has filled up, and is now - /// acting as a ring-buffer using modulus arithmetic: this saves the - /// max_size_ most recent time stamps and loses earlier ones until - /// drained. - u_short report_buffer_full_; - -private: - ALLOCATOR * allocator_; -}; - -// template -// class ACE_Timeprobe : public ACE_Timeprobe_Ex -// { -// public: -// // Initialize a ACE_Timeprobe with default size -// ACE_Timeprobe (ACE_Allocator *allocator = ACE_Allocator::instance()); - -// /// Create Timeprobes with @a size slots -// ACE_Timeprobe (ACE_Allocator *allocator = ACE_Allocator::instance(), -// u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE); -// }; - -/** - * @class ACE_Function_Timeprobe - * - * @brief Auto pointer like time probes. It will record on - * construction and on destruction. - */ -template -class ACE_Function_Timeprobe -{ -public: - /// Constructor. - ACE_Function_Timeprobe (Timeprobe &timeprobe, u_long event); - - /// Destructor. - ~ACE_Function_Timeprobe (void); - -protected: - /// Reference to timeprobe. - Timeprobe &timeprobe_; - - /// Event. - u_long event_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timeprobe_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timeprobe_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_COMPILE_TIMEPROBES */ -#include /**/ "ace/post.h" -#endif /* ACE_TIMEPROBE_T_H */ - diff --git a/dep/include/ace/Timer_Hash.h b/dep/include/ace/Timer_Hash.h deleted file mode 100644 index f7cc65c3bb7..00000000000 --- a/dep/include/ace/Timer_Hash.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Timer_Hash.h - * - * $Id: Timer_Hash.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_TIMER_HASH_H -#define ACE_TIMER_HASH_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Hash_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Timer_Heap_T.h" -#include "ace/Timer_List_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following typedef are here for ease of use - -typedef ACE_Timer_Hash_Upcall , - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Hash_Upcall; - -typedef ACE_Timer_List_T - ACE_Hash_Timer_List; - -typedef ACE_Timer_Heap_T - ACE_Hash_Timer_Heap; - -typedef ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List> - - ACE_Timer_Hash; - -typedef ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List> - ACE_Timer_Hash_Iterator; - -typedef ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap> - ACE_Timer_Hash_Heap; - -typedef ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap> - ACE_Timer_Hash_Heap_Iterator; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_HASH_H */ - diff --git a/dep/include/ace/Timer_Hash_T.h b/dep/include/ace/Timer_Hash_T.h deleted file mode 100644 index 882369cf5c9..00000000000 --- a/dep/include/ace/Timer_Hash_T.h +++ /dev/null @@ -1,343 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Timer_Hash_T.h - * - * $Id: Timer_Hash_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_TIMER_HASH_T_H -#define ACE_TIMER_HASH_T_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Free_List.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration. -template -class ACE_Timer_Hash_T; -template -class Hash_Token; - -/** - * @class ACE_Timer_Hash_Upcall - * - * @brief Functor for Timer_Hash - * - * This class calls up to the Timer Hash's functor from the - * timer queues in the hash table - */ -template -class ACE_Timer_Hash_Upcall -{ -public: - typedef ACE_Timer_Queue_T, - ACE_Null_Mutex> - TIMER_QUEUE; - - /// Default constructor (creates an invalid object, but needs to be here - /// so timer queues using this functor can be constructed) - ACE_Timer_Hash_Upcall (void); - - /// Constructor that specifies a Timer_Hash to call up to - ACE_Timer_Hash_Upcall (ACE_Timer_Queue_T *timer_hash); - - /// This method is called when a timer is registered. - int registration (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg); - - /// This method is called before the timer expires. - int preinvoke (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time, - const void *&upcall_act); - - /// This method is called when the timer expires. - int timeout (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time); - - /// This method is called after the timer expires. - int postinvoke (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time, - const void *upcall_act); - - /// This method is called when a handler is cancelled - int cancel_type (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - int dont_call, - int &requires_reference_counting); - - /// This method is called when a timer is cancelled - int cancel_timer (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - int dont_call, - int requires_reference_counting); - - /// This method is called when the timer queue is destroyed and - /// the timer is still contained in it - int deletion (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg); - -private: - /// Timer Queue to do the calling up to - ACE_Timer_Queue_T *timer_hash_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Hash_Upcall (const ACE_Timer_Hash_Upcall &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Hash_Upcall &)) -}; - -/** - * @class ACE_Timer_Hash_Iterator_T - * - * @brief Iterates over an ACE_Timer_Hash_T. - * - * This is a generic iterator that can be used to visit every - * node of a timer queue. Be aware that it doesn't transverse - * in the order of timeout values. - */ -template -class ACE_Timer_Hash_Iterator_T : public ACE_Timer_Queue_Iterator_T -{ -public: - /// Constructor. - ACE_Timer_Hash_Iterator_T (ACE_Timer_Hash_T &); - - /// Positions the iterator at the earliest node in the Timer Queue - virtual void first (void); - - /// Positions the iterator at the next node in the Timer Queue - virtual void next (void); - - /// Returns true when there are no more nodes in the sequence - virtual bool isdone (void) const; - - /// Returns the node at the current position in the sequence - virtual ACE_Timer_Node_T *item (void); - -protected: - /// Pointer to the ACE_Timer_Hash that we are iterating over. - ACE_Timer_Hash_T &timer_hash_; - - /// Current position in 's table - size_t position_; - - /// Current iterator used on 's bucket - ACE_Timer_Queue_Iterator_T, ACE_Null_Mutex> *iter_; -}; - -/** - * @class ACE_Timer_Hash_T - * - * @brief Provides a hash table of BUCKETs as an implementation for - * a timer queue. - * - * This implementation uses a hash table of BUCKETs. The hash - * is based on the time_value of the event. Unlike other Timer - * Queues, ACE_Timer_Hash does not expire events in order. - */ -template -class ACE_Timer_Hash_T : public ACE_Timer_Queue_T -{ -public: - /// Type of iterator - typedef ACE_Timer_Hash_Iterator_T - HASH_ITERATOR; - - /// Iterator is a friend - friend class ACE_Timer_Hash_Iterator_T; - - /// Type inherited from - typedef ACE_Timer_Queue_T INHERITED; - - // = Initialization and termination methods. - /** - * Default constructor. @a table_size determines the size of the - * hash table. @a upcall_functor is the instance of the FUNCTOR - * to be used by the buckets. If @a upcall_functor is 0, a default - * FUNCTOR will be created. - */ - ACE_Timer_Hash_T (size_t table_size, - FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - - /** - * Default constructor. @a upcall_functor is the instance of the - * FUNCTOR to be used by the queue. If @a upcall_functor is 0, Timer - * Hash will create a default FUNCTOR. @a freelist the freelist of - * timer nodes. If 0, then a default freelist will be created. The default - * size will be ACE_DEFAULT_TIMERS and there will be no preallocation. - */ - ACE_Timer_Hash_T (FUNCTOR *upcall_functor = 0, ACE_Free_List > *freelist = 0); - - /// Destructor - virtual ~ACE_Timer_Hash_T (void); - - /// True if queue is empty, else false. - virtual bool is_empty (void) const; - - /// Returns the time of the earlier node in the . - /// Must be called on a non-empty queue. - virtual const ACE_Time_Value &earliest_time (void) const; - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval); - - /** - * Cancel all timer associated with @a type. If is 0 - * then the will be invoked. Returns number of timers - * cancelled. If any valid timer is not cancelled before destruction - * of this instance of ACE_Timer_Hash_T then user will get a memory - * leak. - */ - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1); - - /** - * Cancel the single timer that matches the @a timer_id value (which - * was returned from the method). If act is non-NULL - * then it will be set to point to the ``magic cookie'' argument - * passed in when the timer was registered. This makes it possible - * to free up the memory and avoid memory leaks. If is - * 0 then the will be invoked. Returns 1 if cancellation - * succeeded and 0 if the @a timer_id wasn't found. If any valid - * timer is not cancelled before destruction of this instance of - * ACE_Timer_Hash_T then user will get a memory leak. - */ - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1); - - /** - * Run the for all timers whose values are <= - * . Also accounts for . Returns - * the number of timers canceled. - */ - virtual int expire (void); - - /** - * Run the for all timers whose values are <= @a current_time. - * This does not account for . Returns the number of - * timers canceled. - */ - virtual int expire (const ACE_Time_Value ¤t_time); - - /// Returns a pointer to this ACE_Timer_Queue's iterator. - virtual ACE_Timer_Queue_Iterator_T &iter (void); - - /// Removes the earliest node from the queue and returns it - virtual ACE_Timer_Node_T *remove_first (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Reads the earliest node from the queue and returns it. - virtual ACE_Timer_Node_T *get_first (void); - -protected: - /// Factory method that frees a previously allocated node. - virtual void free_node (ACE_Timer_Node_T *); - -private: - - /** - * Schedule @a type that will expire at @a future_time, - * which is specified in absolute time. If it expires then @a act is - * passed in as the value to the . If @a interval is != to - * ACE_Time_Value::zero then it is used to reschedule the @a type - * automatically, using relative time to the current . - * This method returns a that is a pointer to a token - * which stores information about the event. This can be - * used to cancel the timer before it expires. Returns -1 on - * failure. - */ - virtual long schedule_i (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval); - - /// Non-locking version of dispatch_info () - virtual int dispatch_info_i (const ACE_Time_Value ¤t_time, - ACE_Timer_Node_Dispatch_Info_T &info); - - /// Reschedule an "interval" ACE_Timer_Node. - virtual void reschedule (ACE_Timer_Node_T *); - - /// Finds the earliest node - void find_new_earliest (void); - - /// Keeps track of the size of the queue - size_t size_; - - /// Table of BUCKETS - BUCKET **table_; - - /// Keeps track of the size of table_ - size_t table_size_; - - /// Functor used for the table's timer queues - ACE_Timer_Hash_Upcall table_functor_; - - /// Index to the position with the earliest entry - size_t earliest_position_; - - /// Iterator used to expire timers. - HASH_ITERATOR *iterator_; - -#if defined (ACE_WIN64) - // Part of a hack... see comments in schedule(). - // This is, essentially, the upper 32 bits of a 64-bit pointer on Win64. - ptrdiff_t pointer_base_; -#endif - - /// Hash_Token is usually allocated in schedule but its - /// deallocation is problematic and token_list_ helps with this. - ACE_Locked_Free_List, ACE_Null_Mutex> token_list_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Hash_T (const ACE_Timer_Hash_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Hash_T &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timer_Hash_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Hash_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_HASH_T_H */ - diff --git a/dep/include/ace/Timer_Heap.h b/dep/include/ace/Timer_Heap.h deleted file mode 100644 index 61673974068..00000000000 --- a/dep/include/ace/Timer_Heap.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Timer_Heap.h - * - * $Id: Timer_Heap.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TIMER_HEAP_H -#define ACE_TIMER_HEAP_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Heap_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following typedefs are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_Heap_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Heap; - -typedef ACE_Timer_Heap_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Heap_Iterator; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_HEAP_H */ - diff --git a/dep/include/ace/Timer_Heap_T.h b/dep/include/ace/Timer_Heap_T.h deleted file mode 100644 index 904e596e616..00000000000 --- a/dep/include/ace/Timer_Heap_T.h +++ /dev/null @@ -1,339 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Heap_T.h - * - * $Id: Timer_Heap_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TIMER_HEAP_T_H -#define ACE_TIMER_HEAP_T_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Free_List.h" -#include "ace/Unbounded_Set.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration -template -class ACE_Timer_Heap_T; - -/** - * @class ACE_Timer_Heap_Iterator_T - * - * @brief Iterates over an ACE_Timer_Heap_T. - * - * This is a generic iterator that can be used to visit every - * node of a timer queue. Be aware that it doesn't transverse - * in the order of timeout values. - */ -template -class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T -{ -public: - /// Constructor. - ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T &); - - /// Destructor. - ~ACE_Timer_Heap_Iterator_T (void); - - /// Positions the iterator at the earliest node in the Timer Queue - virtual void first (void); - - /// Positions the iterator at the next node in the Timer Queue - virtual void next (void); - - /// Returns true when there are no more nodes in the sequence - virtual bool isdone (void) const; - - /// Returns the node at the current position in the sequence - virtual ACE_Timer_Node_T *item (void); - -protected: - /// Pointer to the ACE_Timer_Heap that we are iterating over. - ACE_Timer_Heap_T &timer_heap_; - - /// Position in the array where the iterator is at - size_t position_; -}; - -/** - * @class ACE_Timer_Heap_T - * - * @brief Provides a very fast and predictable timer implementation. - * - * This implementation uses a heap-based callout queue of - * absolute times. Therefore, in the average and worst case, - * scheduling, canceling, and expiring timers is O(log N) (where - * N is the total number of timers). In addition, we can also - * preallocate as many @c ACE_Timer_Node objects as there are slots - * in the heap. This allows us to completely remove the need for - * dynamic memory allocation, which is important for real-time - * systems. - */ -template -class ACE_Timer_Heap_T : public ACE_Timer_Queue_T -{ -public: - typedef ACE_Timer_Heap_Iterator_T HEAP_ITERATOR; - friend class ACE_Timer_Heap_Iterator_T; - - typedef ACE_Timer_Queue_T INHERITED; - - // = Initialization and termination methods. - /** - * The Constructor creates a heap with specified number of elements. - * This can also take in a upcall functor and freelist (if 0, then - * defaults will be created). - * - * @param size The maximum number of timers that can be - * inserted into the new object. - * @param preallocated Default false, true then all the memory - * for the @c ACE_Timer_Node objects will be pre-allocated. This saves - * time and is more predictable (though it requires more space). - * Otherwise, timer nodes are allocated as needed. - * @param freelist is the freelist of timer nodes. - * @param upcall_functor If 0 Timer Heap will create a default FUNCTOR. - */ - ACE_Timer_Heap_T (size_t size, - bool preallocated = false, - FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - - /** - * Default constructor. @c upcall_functor is the instance of the - * FUNCTOR to be used by the queue. If @c upcall_functor is 0, Timer - * Heap will create a default FUNCTOR. @c freelist is the freelist of - * timer nodes. If 0, then a default freelist will be created. The default - * size will be ACE_DEFAULT_TIMERS and there will be no preallocation. - */ - ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - - /// Destructor. - virtual ~ACE_Timer_Heap_T (void); - - /// True if heap is empty, else false. - virtual bool is_empty (void) const; - - /// Returns the time of the earliest node in the Timer_Queue. - /// Must be called on a non-empty queue. - virtual const ACE_Time_Value &earliest_time (void) const; - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval); - - /** - * Cancel all timers associated with @a type. If @a dont_call_handle_close - * is 0then the will be invoked. Returns number of timers - * cancelled. - */ - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1); - - /** - * Cancel the single timer that matches the @a timer_id value (which - * was returned from the method). If act is non-NULL - * then it will be set to point to the ``magic cookie'' argument - * passed in when the timer was registered. This makes it possible - * to free up the memory and avoid memory leaks. If @a dont_call_handle_close - * is 0 then the will be invoked. Returns 1 if cancellation - * succeeded and 0 if the @a timer_id wasn't found. - */ - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1); - - /// Returns a pointer to this ACE_Timer_Queue's iterator. - virtual ACE_Timer_Queue_Iterator_T &iter (void); - - /** - * Removes the earliest node from the queue and returns it. Note that - * the timer is removed from the heap, but is not freed, and its ID - * is not reclaimed. The caller is responsible for calling either - * @c reschedule() or @c free_node() after this function returns. Thus, - * this function is for support of @c ACE_Timer_Queue::expire and - * should not be used unadvisedly in other conditions. - */ - ACE_Timer_Node_T *remove_first (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Reads the earliest node from the queue and returns it. - virtual ACE_Timer_Node_T *get_first (void); - -protected: - - /** - * Schedule a timer that may optionally auto-reset. - * Schedule @a type that will expire at @a future_time, - * which is specified in absolute time. If it expires then @a act is - * passed in as the value to the . If @a interval is != to - * ACE_Time_Value::zero then it is used to reschedule the @a type - * automatically, using relative time to the current . - * This method returns a that uniquely identifies the the - * @a type entry in an internal list. This can be used to - * cancel the timer before it expires. The cancellation ensures - * that are unique up to values of greater than 2 - * billion timers. As long as timers don't stay around longer than - * this there should be no problems with accidentally deleting the - * wrong timer. Returns -1 on failure (which is guaranteed never to - * be a valid ). - */ - virtual long schedule_i (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval); - - /// Reschedule an "interval" ACE_Timer_Node. - virtual void reschedule (ACE_Timer_Node_T *); - - /// Factory method that allocates a new node (uses operator new if - /// we're *not* preallocating, otherwise uses an internal freelist). - virtual ACE_Timer_Node_T *alloc_node (void); - - /** - * Factory method that frees a previously allocated node (uses - * operator delete if we're *not* preallocating, otherwise uses an - * internal freelist). - */ - virtual void free_node (ACE_Timer_Node_T *); - -private: - /// Remove and return the @a sloth ACE_Timer_Node and restore the - /// heap property. - ACE_Timer_Node_T *remove (size_t slot); - - /// Insert @a new_node into the heap and restore the heap property. - void insert (ACE_Timer_Node_T *new_node); - - /** - * Doubles the size of the heap and the corresponding timer_ids array. - * If preallocation is used, will also double the size of the - * preallocated array of ACE_Timer_Nodes. - */ - void grow_heap (void); - - /// Restore the heap property, starting at @a slot. - void reheap_up (ACE_Timer_Node_T *new_node, - size_t slot, - size_t parent); - - /// Restore the heap property, starting at @a slot. - void reheap_down (ACE_Timer_Node_T *moved_node, - size_t slot, - size_t child); - - /// Copy @a moved_node into the @a slot slot of and move - /// @a slot into the corresponding slot in the array. - void copy (size_t slot, ACE_Timer_Node_T *moved_node); - - /** - * Returns a timer id that uniquely identifies this timer. This id - * can be used to cancel a timer via the method. The - * timer id returned from this method will never == -1 to avoid - * conflicts with other failure return values. - */ - long timer_id (void); - - /// Pops and returns a new timer id from the freelist. - long pop_freelist (void); - - /// Pushes @a old_id onto the freelist. - void push_freelist (long old_id); - - /// Maximum size of the heap. - size_t max_size_; - - /// Current size of the heap. - size_t cur_size_; - - /// Number of heap entries in transition (removed from the queue, but - /// not freed) and may be rescheduled or freed. - size_t cur_limbo_; - - /// Iterator used to expire timers. - HEAP_ITERATOR *iterator_; - - /** - * Current contents of the Heap, which is organized as a "heap" of - * ACE_Timer_Node *'s. In this context, a heap is a "partially - * ordered, almost complete" binary tree, which is stored in an - * array. - */ - ACE_Timer_Node_T **heap_; - - /** - * An array of "pointers" that allows each ACE_Timer_Node in the - * to be located in O(1) time. Basically, - * contains the slot in the array where an ACE_Timer_Node - * * with timer id \ resides. Thus, the timer id passed back from - * is really a slot into the array. The - * array serves two purposes: negative values are - * indications of free timer IDs, whereas positive values are - * "pointers" into the array for assigned timer IDs. - */ - ssize_t *timer_ids_; - - /// "Pointer" to the element in the array that was - /// last given out as a timer ID. - size_t timer_ids_curr_; - - /// Index representing the lowest timer ID that has been freed. When - /// the timer_ids_next_ value wraps around, it starts back at this - /// point. - size_t timer_ids_min_free_; - - /** - * If this is non-0, then we preallocate number of - * ACE_Timer_Node objects in order to reduce dynamic allocation - * costs. In auto-growing implementation, this points to the - * last array of nodes allocated. - */ - ACE_Timer_Node_T *preallocated_nodes_; - - /// This points to the head of the freelist, - /// which is organized as a stack. - ACE_Timer_Node_T *preallocated_nodes_freelist_; - - /// Set of pointers to the arrays of preallocated timer nodes. - /// Used to delete the allocated memory when required. - ACE_Unbounded_Set *> preallocated_node_set_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Heap_T (const ACE_Timer_Heap_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Heap_T &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timer_Heap_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Heap_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_HEAP_T_H */ - diff --git a/dep/include/ace/Timer_List.h b/dep/include/ace/Timer_List.h deleted file mode 100644 index 6265e348951..00000000000 --- a/dep/include/ace/Timer_List.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_List.h - * - * $Id: Timer_List.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_TIMER_LIST_H -#define ACE_TIMER_LIST_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_List_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following typedefs are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_List_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_List; - -typedef ACE_Timer_List_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_List_Iterator; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_LIST_H */ - diff --git a/dep/include/ace/Timer_List_T.h b/dep/include/ace/Timer_List_T.h deleted file mode 100644 index 66d148f81eb..00000000000 --- a/dep/include/ace/Timer_List_T.h +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Timer_List_T.h - * - * $Id: Timer_List_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TIMER_LIST_T_H -#define ACE_TIMER_LIST_T_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Forward declaration. -template -class ACE_Timer_List_T; - -/** - * @class ACE_Timer_List_Iterator_T - * - * @brief Iterates over an ACE_Timer_List. - * - * This is a generic iterator that can be used to visit every - * node of a timer queue. - */ -template -class ACE_Timer_List_Iterator_T -: public ACE_Timer_Queue_Iterator_T -{ -public: - typedef ACE_Timer_List_T List; - /// Constructor. - ACE_Timer_List_Iterator_T (List& lst); - - /// Destructor. - virtual ~ACE_Timer_List_Iterator_T (void); - - /// Positions the iterator at the earliest node in the Timer Queue - virtual void first (void); - - /// Positions the iterator at the next node in the Timer Queue - virtual void next (void); - - /// Returns true when there are no more nodes in the sequence - virtual bool isdone (void) const; - - /// Returns the node at the current position in the sequence - virtual ACE_Timer_Node_T *item (void); - -protected: - /// Pointer to the ACE_Timer_List that we are iterating over. - List& list_; - - /// Current position in the ACE_Timer_List - ACE_Timer_Node_T* current_node_; -}; - -/** - * @class ACE_Timer_List_T - * - * @brief Provides a simple implementation of timers. - * - * This implementation uses a linked list of absolute times. - * Therefore, in the average case, scheduling and canceling - * timers is O(N) (where N is the total number of timers) and - * expiring timers is O(K) (where K is the total number of timers - * that are < the current time of day). - * More clever implementations could use a delta-list, a heap, - * or timing wheels, etc. For instance, ACE_Timer_Heap - * is a subclass of ACE_Timer_List that implements a - * heap-based callout queue. For most applications, the - * ACE_Timer_Heap will perform substantially faster than the - * ACE_Timer_List. - */ -template -class ACE_Timer_List_T : public ACE_Timer_Queue_T -{ -public: - /// Type of iterator - typedef ACE_Timer_List_Iterator_T Iterator; - - /// Iterator is a friend - friend class ACE_Timer_List_Iterator_T; - - typedef ACE_Timer_Node_T Node; - /// Type inherited from - typedef ACE_Timer_Queue_T Base; - typedef ACE_Free_List FreeList; - - // = Initialization and termination methods. - /** - * Default constructor. @a upcall_functor is the instance of the - * FUNCTOR to be used by the list. If @a upcall_functor is 0, a - * default FUNCTOR will be created. @a freelist is the freelist of - * timer nodes. If 0, then a default freelist will be created. - */ - ACE_Timer_List_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0); - - /// Destructor - virtual ~ACE_Timer_List_T (void); - - /// True if queue is empty, else false. - virtual bool is_empty (void) const; - - /// Returns the time of the earlier node in the ACE_Timer_List. - /// Must be called on a non-empty queue. - virtual const ACE_Time_Value& earliest_time (void) const; - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_interval (long timer_id, - const ACE_Time_Value& interval); - - /** - * Cancel all timers associated with @a type. If dont_call_handle_close is 0 - * then the @a functor will be invoked. Returns the number of timers - * cancelled. - */ - virtual int cancel (const TYPE& type, - int dont_call_handle_close = 1); - - /** - * Cancel the single timer that matches the @a timer_id value (which - * was returned from the method). If act is non-NULL - * then it will be set to point to the ``magic cookie'' argument - * passed in when the timer was registered. This makes it possible - * to free up the memory and avoid memory leaks. If is - * 0 then the will be invoked. Returns 1 if cancellation - * succeeded and 0 if the @a timer_id wasn't found. - */ - virtual int cancel (long timer_id, - const void** act = 0, - int dont_call_handle_close = 1); - - /// Returns a pointer to this ACE_Timer_Queue's iterator. - virtual ACE_Timer_Queue_Iterator_T& iter (void); - - /// Removes the earliest node from the queue and returns it - virtual ACE_Timer_Node_T* remove_first (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Reschedule an "interval" ACE_Timer_Node_T. This should be private - /// but for now it needs to be public for - virtual void reschedule (ACE_Timer_Node_T *); - - /// Reads the earliest node from the queue and returns it. - virtual ACE_Timer_Node_T* get_first (void); - -private: - - /** - * Schedule @a type that will expire at @a future_time, which is - * specified in absolute time. If it expires then @a act is passed - * in as the value to the . If @a interval is != to - * ACE_Time_Value::zero then it is used to reschedule the @a type - * automatically, using relative time to the current . - * This method returns a that uniquely identifies the the - * @a type entry in an internal list. This can be used to - * cancel the timer before it expires. The cancellation ensures - * that are unique up to values of greater than 2 - * billion timers. As long as timers don't stay around longer than - * this there should be no problems with accidentally deleting the - * wrong timer. Returns -1 on failure (which is guaranteed never to - * be a valid ). - */ - virtual long schedule_i (const TYPE& type, - const void* act, - const ACE_Time_Value& future_time, - const ACE_Time_Value& interval); - - void schedule_i(ACE_Timer_Node_T* n, const ACE_Time_Value& exp); - - ACE_Timer_Node_T* find_node(long timer_id) const; - - void cancel_i (ACE_Timer_Node_T* n); - - void unlink (ACE_Timer_Node_T* n); - - ACE_Timer_Node_T* get_first_i(void) const; - -private: - - /// Pointer to linked list of . - ACE_Timer_Node_T* head_; - - /// Iterator used to expire timers. - Iterator* iterator_; - - /** - * Keeps track of the timer id that uniquely identifies each timer. - * This id can be used to cancel a timer via the - * method. - */ - long id_counter_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_List_T (const ACE_Timer_List_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_List_T &)) -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timer_List_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_List_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_LIST_T_H */ - diff --git a/dep/include/ace/Timer_Queue.h b/dep/include/ace/Timer_Queue.h deleted file mode 100644 index 0f5990ae546..00000000000 --- a/dep/include/ace/Timer_Queue.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Queue.h - * - * $Id: Timer_Queue.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef ACE_TIMER_QUEUE_H -#define ACE_TIMER_QUEUE_H - -#include /**/ "ace/pre.h" - -#include "ace/Synch_Traits.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Timer_Queuefwd.h" -#include "ace/Timer_Queue_T.h" -#if defined (ACE_HAS_THREADS) -# include "ace/Recursive_Thread_Mutex.h" -#else -# include "ace/Null_Mutex.h" -#endif /* ACE_HAS_THREADS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following typedef are here for ease of use and backward -// compatibility. -typedef ACE_Timer_Node_Dispatch_Info_T - ACE_Timer_Node_Dispatch_Info; - -typedef ACE_Timer_Node_T - ACE_Timer_Node; - -typedef ACE_Timer_Queue_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Queue_Iterator; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_TIMER_QUEUE_H */ - diff --git a/dep/include/ace/Timer_Queue_Adapters.h b/dep/include/ace/Timer_Queue_Adapters.h deleted file mode 100644 index 390aed19da0..00000000000 --- a/dep/include/ace/Timer_Queue_Adapters.h +++ /dev/null @@ -1,262 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Queue_Adapters.h - * - * $Id: Timer_Queue_Adapters.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt and - * Carlos O'Ryan - */ -//============================================================================= - -#ifndef ACE_TIMER_QUEUE_ADAPTERS_H -#define ACE_TIMER_QUEUE_ADAPTERS_H -#include /**/ "ace/pre.h" - -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Signal.h" -#include "ace/Sig_Handler.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" - -#if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) -# include "ace/Unbounded_Queue.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Command_Base; -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Sig_Set; - -/** - * @class ACE_Async_Timer_Queue_Adapter - * - * @brief Adapts an ACE timer queue to be driven asynchronously using signals. - * - * This implementation uses the ACE_OS::ualarm call, to generate - * the SIGARLM signal that is caught by this class. - * - * @note This adapter only works on platforms that support ualarm(). - * POSIX platforms generally do; Windows and some others do not. - * - * @todo This adapter does not automatically reschedule repeating timers. - */ -template -class ACE_Async_Timer_Queue_Adapter : public ACE_Event_Handler -{ -public: - typedef TQ TIMER_QUEUE; - - /// Constructor - /** - * Register the SIGALRM handler. If @a mask == 0 then block all - * signals when @c SIGALRM is run. Otherwise, just block the signals - * indicated in @a mask. - */ - ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask = 0); - - /// Schedule the timer according to the semantics of the - /// ACE_Timer_List. - /** - * This timer gets dispatched via a signal, rather than by a user - * calling expire(). Note that interval timers are not implemented - * yet. - */ - long schedule (ACE_Event_Handler *type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - - /// Cancel the @a timer_id and pass back the @a act if an address is - /// passed in. - int cancel (long timer_id, const void **act = 0); - - /// Dispatch all timers with expiry time at or before the current time. - /// Returns the number of timers expired. - int expire (void); - - /// Return a reference to the underlying timer queue. - TQ &timer_queue (void); - -private: - /// Perform the logic to compute the new ualarm(2) setting. - virtual int schedule_ualarm (void); - - /// Called back by @c SIGALRM handler. - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - - /// Handler for the @c SIGALRM signal, so that we can access our state - /// without requiring any global variables. - ACE_Sig_Handler sig_handler_; - - /// Implementation of the timer queue (e.g., ACE_Timer_List, - /// ACE_Timer_Heap, etc.). - TQ timer_queue_; - - /// Mask of signals to be blocked when we're servicing @c SIGALRM. - ACE_Sig_Set mask_; -}; - -/** - * @class ACE_Thread_Timer_Queue_Adapter - * - * @brief Adapts an ACE timer queue using a separate thread for dispatching. - * - * This implementation uses a separate thread to dispatch the timers. - * The base queue need not be thread safe; this class takes all the - * necessary locks. - * - * @note This is a case where template parameters will be useful, but - * (IMHO) the effort and portability problems discourage their - * use. - * - */ -template -class ACE_Thread_Timer_Queue_Adapter : public ACE_Task_Base -{ -public: - /// Trait for the underlying queue type. - typedef TQ TIMER_QUEUE; - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - /// Typedef for the position at which to enqueue a deferred - /// execution command. - enum COMMAND_ENQUEUE_POSITION {HEAD, TAIL}; - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - - /// Creates the timer queue. Activation of the task is the user's - /// responsibility. Optionally a pointer to a timer queue can be passed, - /// when no pointer is passed, a TQ is dynamically created - ACE_Thread_Timer_Queue_Adapter (ACE_Thread_Manager * = ACE_Thread_Manager::instance (), - TQ* timer_queue = 0); - - /// Destructor. - virtual ~ACE_Thread_Timer_Queue_Adapter (void); - - /// Schedule the timer according to the semantics of the ; wakes - /// up the dispatching thread. - long schedule (ACE_Event_Handler *handler, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - - /// Cancel the @a timer_id and return the @a act parameter if an - /// address is passed in. Also wakes up the dispatching thread. - int cancel (long timer_id, const void **act = 0); - - /// Runs the dispatching thread. - virtual int svc (void); - - /// Inform the dispatching thread that it should terminate. - virtual void deactivate (void); - - /// Access the locking mechanism, useful for iteration. - ACE_SYNCH_RECURSIVE_MUTEX &mutex (void); - - /// Set a user-specified timer queue. - int timer_queue (TQ *tq); - - /// Return the current . - TQ *timer_queue (void) const; - - /// Return the thread id of our active object. - ACE_thread_t thr_id (void) const; - - /** - * We override the default activate() method so that we can ensure - * that only a single thread is ever spawned. Otherwise, too many - * weird things can happen... - */ - virtual int activate (long flags = THR_NEW_LWP | THR_JOINABLE, - int n_threads = 1, - int force_active = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_thread_t thread_ids[] = 0, - const char* thr_name[] = 0); - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - /** - * Enqueues a command object for execution just before waiting on the next - * timer event. This allows deferred execution of commands that cannot - * be performed in the timer event handler context, such as registering - * or cancelling timers on platforms where the timer queue mutex is not - * recursive. - */ - int enqueue_command (ACE_Command_Base *command_, - COMMAND_ENQUEUE_POSITION pos = TAIL); - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - -private: - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - /// Dispatches all command objects enqueued in the most - /// recent event handler context. - int dispatch_commands (void); - - /// Queue of commands for deferred execution. - ACE_Unbounded_Queue command_queue_; - - /// The mutual exclusion mechanism for the command queue. - ACE_SYNCH_MUTEX command_mutex_; -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - - /// The underlying Timer_Queue. - TQ* timer_queue_; - - /// Keeps track of whether we should delete the timer queue (if we - /// didn't create it, then we don't delete it). - bool delete_timer_queue_; - - /// The mutual exclusion mechanism that is required to use the - /// . - ACE_SYNCH_RECURSIVE_MUTEX mutex_; - - /** - * The dispatching thread sleeps on this condition while waiting to - * dispatch the next timer; it is used to wake it up if there is a - * change on the timer queue. - */ - ACE_SYNCH_RECURSIVE_CONDITION condition_; - - /// When deactivate is called this variable turns to false and the - /// dispatching thread is signalled, to terminate its main loop. - bool active_; - - /// Thread id of our active object task. - ACE_thread_t thr_id_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "ace/Timer_Queue_Adapters.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Timer_Queue_Adapters.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -# pragma implementation ("Timer_Queue_Adapters.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_QUEUE_ADAPTERS_H */ - diff --git a/dep/include/ace/Timer_Queue_Adapters.inl b/dep/include/ace/Timer_Queue_Adapters.inl deleted file mode 100644 index 77011eacf8b..00000000000 --- a/dep/include/ace/Timer_Queue_Adapters.inl +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- -// -// $Id: Timer_Queue_Adapters.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE TQ * -ACE_Thread_Timer_Queue_Adapter::timer_queue (void) const -{ - return this->timer_queue_; -} - -template ACE_INLINE int -ACE_Thread_Timer_Queue_Adapter::timer_queue (TQ *tq) -{ - if (this->delete_timer_queue_) - delete this->timer_queue_; - this->timer_queue_ = tq; - this->delete_timer_queue_ = false; - return 0; -} - -template ACE_INLINE ACE_thread_t -ACE_Thread_Timer_Queue_Adapter::thr_id (void) const -{ - return this->thr_id_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Timer_Queue_T.h b/dep/include/ace/Timer_Queue_T.h deleted file mode 100644 index 8e5478b3245..00000000000 --- a/dep/include/ace/Timer_Queue_T.h +++ /dev/null @@ -1,563 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Queue_T.h - * - * $Id: Timer_Queue_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - * @author Irfan Pyarali and - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_TIMER_QUEUE_T_H -#define ACE_TIMER_QUEUE_T_H -#include /**/ "ace/pre.h" - -#include "ace/Free_List.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Event_Handler.h" -#include "ace/Time_Value.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Timer_Node_Dispatch_Info_T - * - * @brief Maintains generated dispatch information for Timer nodes. - * - */ -template -class ACE_Timer_Node_Dispatch_Info_T -{ -public: - /// The type of object held in the queue - TYPE type_; - - /// Asynchronous completion token associated with the timer. - const void *act_; - - /// Flag to check if the timer is recurring. - int recurring_timer_; -}; - -/** - * @class ACE_Timer_Node_T - * - * @brief Maintains the state associated with a Timer entry. - */ -template -class ACE_Timer_Node_T -{ -public: - /// Default constructor - ACE_Timer_Node_T (void); - - /// Destructor - ~ACE_Timer_Node_T (void); - - /// Useful typedef .. - typedef ACE_Timer_Node_Dispatch_Info_T DISPATCH_INFO; - - /// Singly linked list - void set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *n, - long timer_id); - - /// Doubly linked list version - void set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *p, - ACE_Timer_Node_T *n, - long timer_id); - - // = Accessors - - /// Get the type. - TYPE &get_type (void); - - /// Set the type. - void set_type (TYPE &type); - - /// Get the asynchronous completion token. - const void *get_act (void); - - /// Set the asynchronous completion token. - void set_act (void *act); - - /// Get the timer value. - const ACE_Time_Value &get_timer_value (void) const; - - /// Set the timer value. - void set_timer_value (const ACE_Time_Value &timer_value); - - /// Get the timer interval. - const ACE_Time_Value &get_interval (void) const; - - /// Set the timer interval. - void set_interval (const ACE_Time_Value &interval); - - /// Get the previous pointer. - ACE_Timer_Node_T *get_prev (void); - - /// Set the previous pointer. - void set_prev (ACE_Timer_Node_T *prev); - - /// Get the next pointer. - ACE_Timer_Node_T *get_next (void); - - /// Set the next pointer. - void set_next (ACE_Timer_Node_T *next); - - /// Get the timer_id. - long get_timer_id (void) const; - - /// Set the timer_id. - void set_timer_id (long timer_id); - - /// Get the dispatch info. The dispatch information is got - /// through . This form helps us in preventing allocation and - /// deleting data along the criticl path. - /// @@TODO: We may want to have a copying version too, so that our - /// interface will be complete.. - void get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T &info); - - /// Dump the state of an TYPE. - void dump (void) const; - -private: - /// Type of object stored in the Queue - TYPE type_; - - /// Asynchronous completion token associated with the timer. - const void *act_; - - /// Time until the timer expires. - ACE_Time_Value timer_value_; - - /// If this is a periodic timer this holds the time until the next - /// timeout. - ACE_Time_Value interval_; - - /// Pointer to previous timer. - ACE_Timer_Node_T *prev_; - - /// Pointer to next timer. - ACE_Timer_Node_T *next_; - - /// Id of this timer (used to cancel timers before they expire). - long timer_id_; -}; - -/** - * @class ACE_Timer_Queue_Iterator_T - * - * @brief Generic interface for iterating over a subclass of - * ACE_Timer_Queue. - * - * This is a generic iterator that can be used to visit every - * node of a timer queue. Be aware that it isn't guaranteed - * that the transversal will be in order of timeout values. - */ -template -class ACE_Timer_Queue_Iterator_T -{ -public: - // = Initialization and termination methods. - /// Constructor. - ACE_Timer_Queue_Iterator_T (void); - - /// Destructor. - virtual ~ACE_Timer_Queue_Iterator_T (void); - - /// Positions the iterator at the earliest node in the Timer Queue - virtual void first (void) = 0; - - /// Positions the iterator at the next node in the Timer Queue - virtual void next (void) = 0; - - /// Returns true when there are no more nodes in the sequence - virtual bool isdone (void) const = 0; - - /// Returns the node at the current position in the sequence - virtual ACE_Timer_Node_T *item (void) = 0; -}; - -/** - * @class ACE_Timer_Queue_T - * - * @brief Provides an interface to timers. - * - * This is an abstract base class that provides hook for - * implementing specialized policies such as ACE_Timer_List - * and ACE_Timer_Heap. - */ -template -class ACE_Timer_Queue_T -{ -public: - /// Type of Iterator. - typedef ACE_Timer_Queue_Iterator_T ITERATOR; - - // = Initialization and termination methods. - /** - * Default constructor. @a upcall_functor is the instance of the - * FUNCTOR to be used by the queue. If @a upcall_functor is 0, Timer - * Queue will create a default FUNCTOR. @a freelist the freelist of - * timer nodes. If 0, then a default freelist will be created. - */ - ACE_Timer_Queue_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - - /// Destructor - make virtual for proper destruction of inherited - /// classes. - virtual ~ACE_Timer_Queue_T (void); - - /// True if queue is empty, else false. - virtual bool is_empty (void) const = 0; - - /// Returns the time of the earlier node in the Timer_Queue. Must - /// be called on a non-empty queue. - virtual const ACE_Time_Value &earliest_time (void) const = 0; - - /** - * Schedule @a type that will expire at @a future_time, which is - * specified in absolute time. If it expires then @a act is passed - * in as the value to the . If @a interval is != to - * ACE_Time_Value::zero then it is used to reschedule the @a type - * automatically, using relative time to the current . - * This method returns a that uniquely identifies the the - * @a type entry in an internal list. This can be used to - * cancel the timer before it expires. The cancellation ensures - * that are unique up to values of greater than 2 - * billion timers. As long as timers don't stay around longer than - * this there should be no problems with accidentally deleting the - * wrong timer. Returns -1 on failure (which is guaranteed never to - * be a valid ). - */ - virtual long schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval) = 0; - - /** - * Cancel all timer associated with @a type. If - * @a dont_call_handle_close is 0 then the will be invoked, - * which typically invokes the hook. Returns number - * of timers cancelled. - */ - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1) = 0; - - /** - * Cancel the single timer that matches the @a timer_id value (which - * was returned from the method). If act is non-NULL - * then it will be set to point to the ``magic cookie'' argument - * passed in when the timer was registered. This makes it possible - * to free up the memory and avoid memory leaks. If - * @a dont_call_handle_close is 0 then the will be invoked, - * which typically calls the hook. Returns 1 if - * cancellation succeeded and 0 if the @a timer_id wasn't found. - */ - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1) = 0; - - /** - * Run the for all timers whose values are <= @a current_time. - * This does not account for . Returns the number of - * timers canceled. - */ - virtual int expire (const ACE_Time_Value ¤t_time); - - /** - * Get the dispatch information for a timer whose value is <= @a current_time. - * This does not account for . Returns 1 if - * there is a node whose value <= @a current_time else returns a 0. - * - */ - virtual int dispatch_info (const ACE_Time_Value ¤t_time, - ACE_Timer_Node_Dispatch_Info_T &info); - - /** - * Run the for all timers whose values are <= - * . Also accounts for . - * - * Depending on the resolution of the underlying OS the system calls - * like select()/poll() might return at time different than that is - * specified in the timeout. Suppose the OS guarantees a resolution of t ms. - * The timeline will look like - * - * A B - * | | - * V V - * |-------------|-------------|-------------|-------------| - * t t t t t - * - * - * If you specify a timeout value of A, then the timeout will not occur - * at A but at the next interval of the timer, which is later than - * that is expected. Similarly, if your timeout value is equal to B, - * then the timeout will occur at interval after B. Now depending upon the - * resolution of your timeouts and the accuracy of the timeouts - * needed for your application, you should set the value of - * . In the above case, if you want the timeout A to fire - * no later than A, then you should specify your to be - * A % t. - * - * The timeout value should be specified via the macro ACE_TIMER_SKEW - * in your config.h file. The default value is zero. - * - * Things get interesting if the t before the timeout value B is zero - * i.e your timeout is less than the interval. In that case, you are - * almost sure of not getting the desired timeout behaviour. Maybe you - * should look for a better OS :-) - * - * Returns the number of timers canceled. - */ - - /* virtual */ int expire (void); - - /** - * Returns the current time of day. This method allows different - * implementations of the timer queue to use special high resolution - * timers. - */ - /* virtual */ ACE_Time_Value gettimeofday (void); - - /// Allows applications to control how the timer queue gets the time - /// of day. - void gettimeofday (ACE_Time_Value (*gettimeofday)(void)); - - /// Determine the next event to timeout. Returns @a max if there are - /// no pending timers or if all pending timers are longer than max. - /// This method acquires a lock internally since it modifies internal state. - virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max); - - /** - * Determine the next event to timeout. Returns @a max if there are - * no pending timers or if all pending timers are longer than max. - * should be a pointer to storage for the timeout value, - * and this value is also returned. This method does not acquire a - * lock internally since it doesn't modify internal state. If you - * need to call this method when the queue is being modified - * concurrently, however, you should make sure to acquire the - * externally before making the call. - */ - virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max, - ACE_Time_Value *the_timeout); - - /// Set the timer skew for the Timer_Queue. - void timer_skew (const ACE_Time_Value &skew); - - /// Get the timer skew for the Timer_Queue. - const ACE_Time_Value &timer_skew (void) const; - - /// Synchronization variable used by the queue - ACE_LOCK &mutex (void); - - /// Accessor to the upcall functor - FUNCTOR &upcall_functor (void); - - /// Returns a pointer to this ACE_Timer_Queue's iterator. - virtual ITERATOR &iter (void) = 0; - - /// Removes the earliest node from the queue and returns it - virtual ACE_Timer_Node_T *remove_first (void) = 0; - - /// Dump the state of a object. - virtual void dump (void) const; - - /// Reads the earliest node from the queue and returns it. - virtual ACE_Timer_Node_T *get_first (void) = 0; - - /// Method used to return a timer node to the queue's ownership - /// after it is returned by a method like . - virtual void return_node (ACE_Timer_Node_T *); - - /// This method will call the preinvoke() on . - void preinvoke (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time, - const void *&upcall_act); - - /// This method will call the timeout() on . - void upcall (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time); - - /// This method will call the postinvoke() on . - void postinvoke (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time, - const void *upcall_act); - -protected: - - /// Schedule a timer. - virtual long schedule_i (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval) = 0; - - /// Reschedule an "interval" ACE_Timer_Node. - virtual void reschedule (ACE_Timer_Node_T *) = 0; - - /// Factory method that allocates a new node. - virtual ACE_Timer_Node_T *alloc_node (void); - - /// Factory method that frees a previously allocated node. - virtual void free_node (ACE_Timer_Node_T *); - - /// Non-locking version of dispatch_info () - virtual int dispatch_info_i (const ACE_Time_Value ¤t_time, - ACE_Timer_Node_Dispatch_Info_T &info); - - /// Synchronization variable for ACE_Timer_Queue. - /// @note The right name would be lock_, but HP/C++ will choke on that! - ACE_LOCK mutex_; - - /// Class that implements a free list - ACE_Free_List > *free_list_; - - /// Pointer to function that returns the current time of day. - ACE_Time_Value (*gettimeofday_)(void); - - /// Upcall functor - FUNCTOR *upcall_functor_; - - /// To delete or not to delete is the question? - bool const delete_upcall_functor_; - - /// Flag to delete only if the class created the - bool const delete_free_list_; - -private: - - /// Returned by . - ACE_Time_Value timeout_; - - /// Adjusts for timer skew in various clocks. - ACE_Time_Value timer_skew_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Queue_T (const ACE_Timer_Queue_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Queue_T &)) -}; - -/** - * @class ACE_Event_Handler_Handle_Timeout_Upcall - * - * @brief Functor for Timer_Queues. - * - * This class implements the functor required by the Timer - * Queue to call on ACE_Event_Handlers. - */ -template -class ACE_Event_Handler_Handle_Timeout_Upcall -{ -public: - typedef ACE_Timer_Queue_T, - ACE_LOCK> - TIMER_QUEUE; - - // = Initialization and termination methods. - /// Constructor. - ACE_Event_Handler_Handle_Timeout_Upcall (void); - - /// Destructor. - ~ACE_Event_Handler_Handle_Timeout_Upcall (void); - - /// This method is called when a timer is registered. - int registration (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg); - - /// This method is called before the timer expires. - int preinvoke (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time, - const void *&upcall_act); - - /// This method is called when the timer expires. - int timeout (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time); - - /// This method is called after the timer expires. - int postinvoke (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - int recurring_timer, - const ACE_Time_Value &cur_time, - const void *upcall_act); - - /// This method is called when a handler is cancelled - int cancel_type (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - int dont_call, - int &requires_reference_counting); - - /// This method is called when a timer is cancelled - int cancel_timer (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - int dont_call, - int requires_reference_counting); - - /// This method is called when the timer queue is destroyed and - /// the timer is still contained in it - int deletion (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg); - -private: - - /// Flag indicating that reference counting is required for this - /// event handler upcall. - int requires_reference_counting_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Event_Handler_Handle_Timeout_Upcall (const ACE_Event_Handler_Handle_Timeout_Upcall &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Event_Handler_Handle_Timeout_Upcall &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Timer_Queue_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timer_Queue_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Queue_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_QUEUE_T_H */ - diff --git a/dep/include/ace/Timer_Queue_T.inl b/dep/include/ace/Timer_Queue_T.inl deleted file mode 100644 index 7606a2e1f62..00000000000 --- a/dep/include/ace/Timer_Queue_T.inl +++ /dev/null @@ -1,222 +0,0 @@ -// -*- C++ -*- -// -// $Id: Timer_Queue_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Timer_Node_T::set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *n, - long timer_id) -{ - this->type_ = type; - this->act_ = a; - this->timer_value_ = t; - this->interval_ = i; - this->next_ = n; - this->timer_id_ = timer_id; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *p, - ACE_Timer_Node_T *n, - long timer_id) -{ - this->type_ = type; - this->act_ = a; - this->timer_value_ = t; - this->interval_ = i; - this->prev_ = p; - this->next_ = n; - this->timer_id_ = timer_id; -} - -template ACE_INLINE TYPE & -ACE_Timer_Node_T::get_type (void) -{ - return this->type_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_type (TYPE &type) -{ - this->type_ = type; -} - -template ACE_INLINE const void * -ACE_Timer_Node_T::get_act (void) -{ - return this->act_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_act (void *act) -{ - this->act_ = act; -} - -template ACE_INLINE const ACE_Time_Value & -ACE_Timer_Node_T::get_timer_value (void) const -{ - return this->timer_value_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_timer_value (const ACE_Time_Value &timer_value) -{ - this->timer_value_ = timer_value; -} - -template ACE_INLINE const ACE_Time_Value & -ACE_Timer_Node_T::get_interval (void) const -{ - return this->interval_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_interval (const ACE_Time_Value &interval) -{ - this->interval_ = interval; -} - -template ACE_INLINE ACE_Timer_Node_T * -ACE_Timer_Node_T::get_prev (void) -{ - return this->prev_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_prev (ACE_Timer_Node_T *prev) -{ - this->prev_ = prev; -} - -template ACE_INLINE ACE_Timer_Node_T * -ACE_Timer_Node_T::get_next (void) -{ - return this->next_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_next (ACE_Timer_Node_T *next) -{ - this->next_ = next; -} - -template ACE_INLINE long -ACE_Timer_Node_T::get_timer_id (void) const -{ - return this->timer_id_; -} - -template ACE_INLINE void -ACE_Timer_Node_T::set_timer_id (long timer_id) -{ - this->timer_id_ = timer_id; -} - -template ACE_INLINE void -ACE_Timer_Node_T::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T &info) -{ - // Yes, do a copy - info.type_ = this->type_; - info.act_ = this->act_; - info.recurring_timer_ = - this->interval_ > ACE_Time_Value::zero; -} - -template ACE_INLINE void -ACE_Timer_Queue_T::timer_skew (const ACE_Time_Value &skew) -{ - timer_skew_ = skew; -} - -template ACE_INLINE const ACE_Time_Value & -ACE_Timer_Queue_T::timer_skew (void) const -{ - return timer_skew_; -} - -template ACE_INLINE int -ACE_Timer_Queue_T::expire (void) -{ - if (!this->is_empty ()) - return this->expire (this->gettimeofday () + timer_skew_); - else - return 0; -} - -template int -ACE_Timer_Queue_T::dispatch_info (const ACE_Time_Value &cur_time, - ACE_Timer_Node_Dispatch_Info_T &info) -{ - ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0)); - - return this->dispatch_info_i (cur_time, info); -} - -template ACE_INLINE void -ACE_Timer_Queue_T::upcall (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time) -{ - this->upcall_functor ().timeout (*this, - info.type_, - info.act_, - info.recurring_timer_, - cur_time); -} - -template ACE_INLINE void -ACE_Timer_Queue_T::preinvoke (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time, - const void *&upcall_act) -{ - this->upcall_functor ().preinvoke (*this, - info.type_, - info.act_, - info.recurring_timer_, - cur_time, - upcall_act); -} - -template ACE_INLINE void -ACE_Timer_Queue_T::postinvoke (ACE_Timer_Node_Dispatch_Info_T &info, - const ACE_Time_Value &cur_time, - const void *upcall_act) -{ - this->upcall_functor ().postinvoke (*this, - info.type_, - info.act_, - info.recurring_timer_, - cur_time, - upcall_act); -} - -template ACE_INLINE ACE_Time_Value -ACE_Timer_Queue_T::gettimeofday (void) -{ - // Invoke gettimeofday via pointer to function. - return this->gettimeofday_ (); -} - -template ACE_INLINE void -ACE_Timer_Queue_T::gettimeofday (ACE_Time_Value (*gettimeofday)(void)) -{ - this->gettimeofday_ = gettimeofday; -} - -template ACE_INLINE FUNCTOR & -ACE_Timer_Queue_T::upcall_functor (void) -{ - return *this->upcall_functor_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Timer_Queuefwd.h b/dep/include/ace/Timer_Queuefwd.h deleted file mode 100644 index 5ee99ff1823..00000000000 --- a/dep/include/ace/Timer_Queuefwd.h +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Queuefwd.h - * - * $Id: Timer_Queuefwd.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Forward declarations and typedefs of ACE_Timer_Queue class. - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_TIMER_QUEUE_FWD_H -#define ACE_TIMER_QUEUE_FWD_H - -#include /**/ "ace/pre.h" - -#include "ace/Synch_Traits.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template class ACE_Timer_Queue_T; -template class ACE_Event_Handler_Handle_Timeout_Upcall; - -class ACE_Event_Handler; - -typedef ACE_Timer_Queue_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Queue; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_TIMER_QUEUE_FWD_H */ - diff --git a/dep/include/ace/Timer_Wheel.h b/dep/include/ace/Timer_Wheel.h deleted file mode 100644 index b8a7e9b03ac..00000000000 --- a/dep/include/ace/Timer_Wheel.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Wheel.h - * - * $Id: Timer_Wheel.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Darrell Brunsch (brunsch@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_TIMER_WHEEL_H -#define ACE_TIMER_WHEEL_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Wheel_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following typedefs are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_Wheel_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Wheel; - -typedef ACE_Timer_Wheel_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Wheel_Iterator; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_WHEEL_H */ - diff --git a/dep/include/ace/Timer_Wheel_T.h b/dep/include/ace/Timer_Wheel_T.h deleted file mode 100644 index 7222837011b..00000000000 --- a/dep/include/ace/Timer_Wheel_T.h +++ /dev/null @@ -1,227 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Timer_Wheel_T.h - * - * $Id: Timer_Wheel_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_TIMER_WHEEL_T_H -#define ACE_TIMER_WHEEL_T_H -#include /**/ "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration -template -class ACE_Timer_Wheel_T; - -/** - * @class ACE_Timer_Wheel_Iterator_T - * - * @brief Iterates over an ACE_Timer_Wheel. - * - * This is a generic iterator that can be used to visit every - * node of a timer queue. Be aware that it doesn't traverse - * in the order of timeout values. - */ -template -class ACE_Timer_Wheel_Iterator_T - : public ACE_Timer_Queue_Iterator_T -{ -public: - typedef ACE_Timer_Wheel_T Wheel; - typedef ACE_Timer_Node_T Node; - - /// Constructor - ACE_Timer_Wheel_Iterator_T (Wheel &); - - /// Destructor - ~ACE_Timer_Wheel_Iterator_T (void); - - /// Positions the iterator at the earliest node in the Timer Queue - virtual void first (void); - - /// Positions the iterator at the next node in the Timer Queue - virtual void next (void); - - /// Returns true when there are no more nodes in the sequence - virtual bool isdone (void) const; - - /// Returns the node at the current position in the sequence - virtual ACE_Timer_Node_T* item (void); - -protected: - /// Pointer to the ACE_Timer_List that we are iterating over. - Wheel& timer_wheel_; - - /// Current position in the timing wheel - u_int spoke_; - - /// Pointer to the position in the the th list - ACE_Timer_Node_T* current_node_; -private: - void goto_next(u_int start_spoke); -}; - -/** - * @class ACE_Timer_Wheel_T - * - * @brief Provides a Timing Wheel version of ACE_Timer_Queue. - * - * This implementation uses a hash table of ordered doubly- - * linked lists of absolute times. The enhancements over the - * @c ACE_Timer_List include adding a free list and the ability - * to preallocate nodes. Timer Wheel is based on the timing - * wheel implementation used in Adam M. Costello and - * George Varghese's paper "Redesigning the BSD Callout and - * Timer Facilities" - * (http://dworkin.wustl.edu/~varghese/PAPERS/newbsd.ps.Z) - */ -template -class ACE_Timer_Wheel_T : public ACE_Timer_Queue_T -{ -public: - /// Type of iterator - typedef ACE_Timer_Wheel_Iterator_T Iterator; - /// Iterator is a friend - friend class ACE_Timer_Wheel_Iterator_T; - typedef ACE_Timer_Node_T Node; - /// Type inherited from - typedef ACE_Timer_Queue_T Base; - typedef ACE_Free_List FreeList; - - /// Default constructor - ACE_Timer_Wheel_T (FUNCTOR* upcall_functor = 0, FreeList* freelist = 0); - - /// Constructor with opportunities to set the wheelsize and resolution - ACE_Timer_Wheel_T (u_int spoke_count, - u_int resolution, - size_t prealloc = 0, - FUNCTOR* upcall_functor = 0, - FreeList* freelist = 0); - - /// Destructor - virtual ~ACE_Timer_Wheel_T (void); - - /// True if queue is empty, else false. - virtual bool is_empty (void) const; - - /// Returns the time of the earlier node in the ACE_Timer_Wheel. - /// Must be called on a non-empty queue. - virtual const ACE_Time_Value& earliest_time (void) const; - - /// Changes the interval of a timer (and can make it periodic or non - /// periodic by setting it to ACE_Time_Value::zero or not). - virtual int reset_interval (long timer_id, - const ACE_Time_Value& interval); - - /// Cancel all timer associated with @a type. If is 0 - /// then the will be invoked. Returns number of timers - /// cancelled. - virtual int cancel (const TYPE& type, - int dont_call_handle_close = 1); - - // Cancel a timer, storing the magic cookie in act (if nonzero). - // Calls the functor if dont_call_handle_close is 0 and returns 1 - // on success - virtual int cancel (long timer_id, - const void** act = 0, - int dont_call_handle_close = 1); - - /// Run the for all timers whose values are <= - /// . Also accounts for . Returns - /// the number of timers canceled. - virtual int expire (void); - - // Run the for all timers whose values are <= @a current_time. - // This does not account for . Returns the number of - // timers canceled. - int expire (const ACE_Time_Value& current_time); - - /// Returns a pointer to this 's iterator. - virtual ACE_Timer_Queue_Iterator_T& iter (void); - - /// Removes the earliest node from the queue and returns it - virtual ACE_Timer_Node_T* remove_first (void); - - /// Dump the state of an object. - virtual void dump (void) const; - - /// Reads the earliest node from the queue and returns it. - virtual ACE_Timer_Node_T* get_first (void); - -protected: - - /// Schedules a timer. - virtual long schedule_i (const TYPE& type, - const void* act, - const ACE_Time_Value& future_time, - const ACE_Time_Value& interval); - -private: - // The following are documented in the .cpp file. - ACE_Timer_Node_T* get_first_i (void) const; - ACE_Timer_Node_T* remove_first_expired (const ACE_Time_Value& now); - void open_i (size_t prealloc, u_int spokes, u_int res); - virtual void reschedule (ACE_Timer_Node_T *); - ACE_Timer_Node_T* find_spoke_node(u_int spoke, long timer_id) const; - ACE_Timer_Node_T* find_node(long timer_id) const; - u_int calculate_spoke(const ACE_Time_Value& expire) const; - long generate_timer_id(u_int spoke); - void schedule_i (ACE_Timer_Node_T* n, u_int spoke, const ACE_Time_Value& expire); - void cancel_i (ACE_Timer_Node_T* n); - void unlink (ACE_Timer_Node_T* n); - void recalc_earliest(const ACE_Time_Value& last); - -private: - int power2bits (int n, int min_bits, int max_bits); - - /// Timing Wheel. - ACE_Timer_Node_T** spokes_; - /// Size of the timing wheel. - u_int spoke_count_; - /// Number of timer_id bits used for the spoke - int spoke_bits_; - /// Maximum number of timers per spoke - u_int max_per_spoke_; - /// Resolution (in microsoconds) of the timing wheel. - int res_bits_; - /// Index of the list with the earliest time - u_int earliest_spoke_; - /// Iterator used to expire timers. - Iterator* iterator_; - /// The total amount of time in one iteration of the wheel. (resolution * spoke_count) - ACE_Time_Value wheel_time_; - /// The total number of timers currently scheduled. - u_int timer_count_; - - // = Don't allow these operations for now, don't split into multiple lines - // breaks sun compilers - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Wheel_T (const ACE_Timer_Wheel_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Wheel_T &)) -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timer_Wheel_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Wheel_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TIMER_WHEEL_T_H */ - diff --git a/dep/include/ace/Token.h b/dep/include/ace/Token.h deleted file mode 100644 index 405ad28362f..00000000000 --- a/dep/include/ace/Token.h +++ /dev/null @@ -1,376 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Token.h - * - * $Id: Token.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Original author - * @author Karl-Heinz Dorn (kdorn@erlh.siemens.de) - * @author Ported to ACE by - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_TOKEN_H -#define ACE_TOKEN_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Null_Mutex.h" - -#if defined (ACE_HAS_THREADS) - -#include "ace/Thread_Mutex.h" - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || defined (ACE_HAS_VXTHREADS) -// If platforms support semaphores with timed wait, then we use semaphores instead of c.v. -# define ACE_TOKEN_USES_SEMAPHORE -#endif /* (ACE_WIN32 && !ACE_HAS_WINCE) || VXWORKS */ - -#if defined (ACE_TOKEN_USES_SEMAPHORE) -# include "ace/Semaphore.h" -#endif /* ACE_TOKEN_USES_SEMAPHORE */ - -#include "ace/Condition_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Time_Value; - -/** - * @class ACE_Token - * - * @brief Class that acquires, renews, and releases a synchronization - * token that is serviced in strict FIFO/LIFO ordering and that also - * supports (1) recursion and (2) readers/writer semantics. - * - * This class is a more general-purpose synchronization mechanism - * than many native OS mutexes. For example, it implements - * "recursive mutex" semantics, where a thread that owns the token - * can reacquire it without deadlocking. If the same thread calls - * multiple times, however, it must call an - * equal number of times before the token is actually released. - * Threads that are blocked awaiting the token are serviced in - * strict FIFO/LIFO order as other threads release the token (Solaris - * and Pthread mutexes don't strictly enforce an acquisition - * order). There are two lists within the class. Write - * acquires always have higher priority over read acquires. Which - * means, if you use both write/read operations, care must be - * taken to avoid starvation on the readers. Notice that the - * read/write acquire operations do not have the usual semantic of - * reader/writer locks. Only one reader can acquire the token at - * a time (which is different from the usual reader/writer locks - * where several readers can acquire a lock at the same time as - * long as there is no writer waiting for the lock). We choose - * the names to (1) borrow the semantic to give writers higher - * priority and (2) support a common interface for all locking - * classes in ACE. - */ -class ACE_Export ACE_Token -{ -public: - - /** - * Available queueing strategies. - */ - enum QUEUEING_STRATEGY - { - /// FIFO, First In, First Out. - FIFO = -1, - /// LIFO, Last In, First Out - LIFO = 0 - }; - - // = Initialization and termination. - - /// Constructor - ACE_Token (const ACE_TCHAR *name = 0, void * = 0); - - /// Destructor - virtual ~ACE_Token (void); - - // = Strategies - - /// Retrieve the current queueing strategy. - int queueing_strategy (void); - - /// Set the queueing strategy. - void queueing_strategy (int queueing_strategy); - - // = Synchronization operations. - - /** - * Acquire the token, sleeping until it is obtained or until the - * expiration of @a timeout, which is treated as "absolute" time. If - * some other thread currently holds the token then is - * called before our thread goes to sleep. This can be - * used by the requesting thread to unblock a token-holder that is - * sleeping, e.g., by means of writing to a pipe (the ACE - * ACE_Reactor uses this functionality). Return values: 0 if - * acquires without calling 1 if is - * called. 2 if the token is signaled. -1 if failure or timeout - * occurs (if timeout occurs errno == ETIME) If @a timeout == - * <&ACE_Time_Value::zero> then acquire has polling semantics (and - * does *not* call ). - */ - int acquire (void (*sleep_hook)(void *), - void *arg = 0, - ACE_Time_Value *timeout = 0); - - /** - * This behaves just like the previous method, except that - * it invokes the virtual function called that can be - * overridden by a subclass of ACE_Token. - */ - int acquire (ACE_Time_Value *timeout = 0); - - /** - * This should be overridden by a subclass to define the appropriate - * behavior before goes to sleep. By default, this is a - * no-op... - */ - virtual void sleep_hook (void); - - /** - * An optimized method that efficiently reacquires the token if no - * other threads are waiting. This is useful for situations where - * you don't want to degrade the quality of service if there are - * other threads waiting to get the token. If == - * -1 and there are other threads waiting to obtain the token we are - * queued according to the queueing strategy. If - * > -1 then it indicates how many entries to skip over before - * inserting our thread into the list of waiters (e.g., - * == 0 means "insert at front of the queue"). - * Renew has the rather odd semantics such that if there are other - * waiting threads it will give up the token even if the - * nesting_level_ > 1. I'm not sure if this is really the right - * thing to do (since it makes it possible for shared data to be - * changed unexpectedly) so use with caution... This method - * maintians the original token priority. As in , the - * @a timeout value is an absolute time. - */ - int renew (int requeue_position = 0, - ACE_Time_Value *timeout = 0); - - /// Become interface-compliant with other lock mechanisms (implements - /// a non-blocking ). - int tryacquire (void); - - /// Shuts down the ACE_Token instance. - int remove (void); - - /// Relinquish the token. If there are any waiters then the next one - /// in line gets it. - int release (void); - - /// Behaves like acquire() but at a lower priority. It should probably - /// be called acquire_yield() since the semantics aren't really - /// what's commonly expected for readers/writer locks. See the class - /// documentation above for more details. - int acquire_read (void); - - /// Behaves like acquire() but at a lower priority. It should probably - /// be called acquire_yield() since the semantics aren't really - /// what's commonly expected for readers/writer locks. See the class - /// documentation above for more details. - int acquire_read (void (*sleep_hook)(void *), - void *arg = 0, - ACE_Time_Value *timeout = 0); - - /// Calls acquire(). - int acquire_write (void); - - /// Calls acquire(). - int acquire_write (void (*sleep_hook)(void *), - void *arg = 0, - ACE_Time_Value *timeout = 0); - - /// Lower priority try_acquire(). - int tryacquire_read (void); - - /// Just calls . - int tryacquire_write (void); - - /// Assumes the caller has acquired the token and returns 0. - int tryacquire_write_upgrade (void); - - // = Accessor methods. - - /// Return the number of threads that are currently waiting to get - /// the token. - int waiters (void); - - /// Return the id of the current thread that owns the token. - ACE_thread_t current_owner (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// The following structure implements a LIFO/FIFO queue of waiter threads - /// that are asleep waiting to obtain the token. - struct ACE_Token_Queue_Entry - { - /// Constructor - ACE_Token_Queue_Entry (ACE_Thread_Mutex &m, - ACE_thread_t t_id); - - /// Constructor using a pre-allocated attributes - ACE_Token_Queue_Entry (ACE_Thread_Mutex &m, - ACE_thread_t t_id, - ACE_Condition_Attributes &attributes); - - /// Entry blocks on the token. - int wait (ACE_Time_Value *timeout, ACE_Thread_Mutex &lock); - - /// Notify (unblock) the entry. - int signal (void); - - /// Pointer to next waiter. - ACE_Token_Queue_Entry *next_; - - /// ACE_Thread id of this waiter. - ACE_thread_t thread_id_; - -#if defined (ACE_TOKEN_USES_SEMAPHORE) - /// ACE_Semaphore object used to wake up waiter when it can run again. - ACE_Semaphore cv_; -#else - /// ACE_Condition object used to wake up waiter when it can run again. - ACE_Condition_Thread_Mutex cv_; -#endif /* ACE_TOKEN_USES_SEMAPHORE */ - - /// Ok to run. - int runable_; - }; - -private: - enum ACE_Token_Op_Type - { - READ_TOKEN = 1, - WRITE_TOKEN - }; - - struct ACE_Token_Queue - { - /// Constructor - ACE_Token_Queue (void); - - /// Remove a waiter from the queue. - void remove_entry (ACE_Token_Queue_Entry *); - - /// Insert a waiter into the queue. - void insert_entry (ACE_Token_Queue_Entry &entry, - int requeue_position = -1); - - /// Head of the list of waiting threads. - ACE_Token_Queue_Entry *head_; - - /// Tail of the list of waiting threads. - ACE_Token_Queue_Entry *tail_; - }; - - /// Implements the and methods above. - int shared_acquire (void (*sleep_hook_func)(void *), - void *arg, - ACE_Time_Value *timeout, - ACE_Token_Op_Type op_type); - - /// Wake next in line for ownership. - void wakeup_next_waiter (void); - - /// A queue of writer threads. - ACE_Token_Queue writers_; - - /// A queue of reader threads. - ACE_Token_Queue readers_; - - /// ACE_Thread_Mutex used to lock internal data structures. - ACE_Thread_Mutex lock_; - - /// Current owner of the token. - ACE_thread_t owner_; - - /// Some thread (i.e., ) is using the token. We need this - /// extra variable to deal with POSIX pthreads madness... - int in_use_; - - /// Number of waiters. - int waiters_; - - /// Current nesting level. - int nesting_level_; - - /// The attributes for the condition variables, optimizes lock time. - ACE_Condition_Attributes attributes_; - - /// Queueing strategy, LIFO/FIFO. - int queueing_strategy_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#else - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Export ACE_Token -{ -public: - int queueing_strategy (void) { ACE_NOTSUP_RETURN (-1); } - void queueing_strategy (int /*queueing_strategy*/) { } - int acquire (ACE_Time_Value * = 0) { ACE_NOTSUP_RETURN (-1); } - int tryacquire (void) { ACE_NOTSUP_RETURN (-1); } - int remove (void) { ACE_NOTSUP_RETURN (-1); } - int release (void) { ACE_NOTSUP_RETURN (-1); } -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Export ACE_Noop_Token : public ACE_Null_Mutex -{ -public: - /// Queueing strategy - enum QUEUEING_STRATEGY - { - FIFO = -1, - LIFO = 0 - }; - - /// Get queueing strategy. - int queueing_strategy (void); - - /// Set queueing strategy. - void queueing_strategy (int queueing_strategy); - - int renew (int = 0, ACE_Time_Value * =0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Token.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_TOKEN_H */ - diff --git a/dep/include/ace/Token.inl b/dep/include/ace/Token.inl deleted file mode 100644 index f09a0e6f3de..00000000000 --- a/dep/include/ace/Token.inl +++ /dev/null @@ -1,176 +0,0 @@ -// -*- C++ -*- -// -// $Id: Token.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/config-macros.h" - -#if defined (ACE_HAS_THREADS) - -#include "ace/Guard_T.h" -#include "ace/Time_Value.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_Token::queueing_strategy (void) -{ - return this->queueing_strategy_; -} - -ACE_INLINE void -ACE_Token::queueing_strategy (int queueing_strategy) -{ - this->queueing_strategy_ = queueing_strategy == -1 ? -1 : 0; -} - -ACE_INLINE int -ACE_Token::remove (void) -{ - ACE_TRACE ("ACE_Token::remove"); - // Don't have an implementation for this yet... - ACE_NOTSUP_RETURN (-1); -} - -ACE_INLINE int -ACE_Token::tryacquire (void) -{ - ACE_TRACE ("ACE_Token::tryacquire"); - return this->shared_acquire - (0, 0, (ACE_Time_Value *) &ACE_Time_Value::zero, ACE_Token::WRITE_TOKEN); -} - -ACE_INLINE int -ACE_Token::waiters (void) -{ - ACE_TRACE ("ACE_Token::waiters"); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1); - - int const ret = this->waiters_; - return ret; -} - -ACE_INLINE ACE_thread_t -ACE_Token::current_owner (void) -{ - ACE_TRACE ("ACE_Token::current_owner"); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, this->owner_); - - return this->owner_; -} - -ACE_INLINE int -ACE_Token::acquire_read (void) -{ - ACE_TRACE ("ACE_Token::acquire_read"); - return this->shared_acquire - (0, 0, 0, ACE_Token::READ_TOKEN); -} - -ACE_INLINE int -ACE_Token::acquire_write (void) -{ - ACE_TRACE ("ACE_Token::acquire_write"); - return this->shared_acquire - (0, 0, 0, ACE_Token::WRITE_TOKEN); -} - -ACE_INLINE int -ACE_Token::tryacquire_read (void) -{ - ACE_TRACE ("ACE_Token::tryacquire_read"); - return this->shared_acquire - (0, 0, (ACE_Time_Value *) &ACE_Time_Value::zero, ACE_Token::READ_TOKEN); -} - -ACE_INLINE int -ACE_Token::acquire_read (void (*sleep_hook_func)(void *), - void *arg, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Token::acquire_read"); - return this->shared_acquire (sleep_hook_func, arg, timeout, ACE_Token::READ_TOKEN); -} - -ACE_INLINE int -ACE_Token::tryacquire_write (void) -{ - ACE_TRACE ("ACE_Token::tryacquire_write"); - return this->shared_acquire - (0, 0, (ACE_Time_Value *) &ACE_Time_Value::zero, ACE_Token::WRITE_TOKEN); -} - -ACE_INLINE int -ACE_Token::tryacquire_write_upgrade (void) -{ - ACE_TRACE ("ACE_Token::tryacquire_write_upgrade"); - return 0; -} - -ACE_INLINE int -ACE_Token::acquire_write (void (*sleep_hook_func)(void *), - void *arg, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Token::acquire_write"); - return this->shared_acquire (sleep_hook_func, arg, timeout, ACE_Token::WRITE_TOKEN); -} - -ACE_INLINE int -ACE_Token::ACE_Token_Queue_Entry::wait (ACE_Time_Value *timeout, ACE_Thread_Mutex &lock) -{ -#if defined (ACE_TOKEN_USES_SEMAPHORE) - lock.release (); - int const retv = (timeout == 0 ? - this->cv_.acquire () : - this->cv_.acquire (*timeout)); - lock.acquire (); - return retv; -#else - ACE_UNUSED_ARG (lock); - return this->cv_.wait (timeout); -#endif /* ACE_TOKEN_USES_SEMAPHORE */ -} - -ACE_INLINE int -ACE_Token::ACE_Token_Queue_Entry::signal (void) -{ - return -#if defined (ACE_TOKEN_USES_SEMAPHORE) - this->cv_.release (); -#else - this->cv_.signal (); -#endif /* ACE_TOKEN_USES_SEMAPHORE */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -/*****************************************************************************/ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_Noop_Token::queueing_strategy (void) -{ - return -1; -} - -ACE_INLINE void -ACE_Noop_Token::queueing_strategy (int /* queueing_strategy */) -{ -} - -ACE_INLINE int -ACE_Noop_Token::renew (int, ACE_Time_Value *) -{ - return 0; -} - -ACE_INLINE void -ACE_Noop_Token::dump (void) const -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Token_Collection.h b/dep/include/ace/Token_Collection.h deleted file mode 100644 index c238004756d..00000000000 --- a/dep/include/ace/Token_Collection.h +++ /dev/null @@ -1,242 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Token_Collection.h - * - * $Id: Token_Collection.h 80826 2008-03-04 14:51:23Z wotte $ - * - * The ACE_Token class offers methods for acquiring, renewing, - * and releasing a synchronization token on a per-token basis. The - * ACE_Token_Collection offers an interface for performing - * operations on groups of tokens as a whole, or on a single token - * within the collection. - * - * The atomic group operations are not yet implemented. - * - * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) - * @author Tim Harrison (harrison@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_TOKEN_COLLECTION_H -#define ACE_TOKEN_COLLECTION_H -#include /**/ "ace/pre.h" - -#include "ace/Map_Manager.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -#include "ace/Local_Tokens.h" -#include "ace/Null_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Token_Collection - * - * @brief Allows atomic token group operations AND - * provides a ACE_Token manager interface. - * - * There are two types of operations offered by - * ACE_Token_Collection. The first is atomic operations on - * collections of Token_Proxies. In this respect, the - * ACE_Token_Collection can be thought of as a single token - * consisting of multiple Token_Proxies. The second role of the - * ACE_Token_Collection is as a ACE_Token manager. - * ACE_Token_Collection allows individual operations on single - * members of a collection of Token_Proxies. This provides a - * single access point for operations on multiple tokens. - * - * @bug Although ACE_Token_Collection inherits from ACE_Token_Proxy, it - * can not be including in a collection. This is because - * returns zero for now. - * - */ -class ACE_Export ACE_Token_Collection : public ACE_Token_Proxy -{ -public: - /** - * @a debug print out verbose debugging messages. @a name will give a - * name to the collection. Collections don't really need names, but - * are sometimes useful for debugging. - */ - ACE_Token_Collection (bool debug = false, - const ACE_TCHAR *name = 0); - -// Collection Management operations - - /** - * Insert a Token into the collection. All ACE_Token type - * operations performed on the collection will also be performed on - * the new_proxy until it is removed. Note that no operations - * performed prior to the insertion will be performed. Returns: 0 - * on success, -1 on failure with @c errno == problem. If a token - * proxy already exists in the collection with the same name, the - * insertion will fail. Also, is copied. Note that during - * the copy, client_id's are *not* inherited. The client ID of the - * thread using the collection will be used. Client ID's can be - * changed explicity on each proxy using is_member. - */ - int insert (ACE_Token_Proxy &token); - - /** - * Removes the ACE_Token matching the given token_name from the - * collection. On success, extract returns 0. On failure - * (token_name was not in the collection,) extract returns -1. On - * success, the state of the token found is copied into proxy. - * The returned ACE_Token_Proxy* must be deleted by the user. - */ - int extract (const ACE_TCHAR *token_name, ACE_Token_Proxy *&proxy); - - /// Returns the proxy if true. 0 otherwise. - ACE_Token_Proxy *is_member (const ACE_TCHAR *token_name); - - /** - * Is the specified token in the collection? - * 1, yes. - * 0, no. - */ - int is_member (const ACE_Token_Proxy &token); - -// = Collective operation semantics. - -// For acquire, renew, and release, there are two interfaces. Once -// interface allows an operation on a single token in the -// collection. The collective interfaces perform atomic operations -// on the entire collection. For instance, a collective acquire -// will perform an acquire for each and every token in the -// collection or the operation will fail. Currently, these -// operations are performed with no ordering heuristics. That is, -// the Collection steps through the tokens in the order they were -// inserted. For each one it performs the operation (acquire, -// renew, or release). - - /** - * Acquire "atomically" all resources in the collection. This is - * only successfull if all tokens in the collection could be - * acquired. options contains the blocking semantics, timeout - * value, etc. Returns: 0 on success, -1 on failure with @c errno == - * problem. If and error or deadlock occurs for one of the tokens, - * all the tokens will be released and the method will return -1. - * Note that returning on detection of deadlock prevents livelock - * between competing collections. If a collection returns after - * detecting deadlock, it is the application's responsibility to not - * to blindly loop on the collection::acquire operation. In other - * words, once the collection reports deadlock, it is out of our - * hands. - */ - virtual int acquire (int notify = 0, - void (*sleep_hook)(void *) = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - /// Acquire the token corresponding to @a token_name. The other - /// parameters are passed to ::acquire. - virtual int acquire (const ACE_TCHAR *token_name, - int notify = 0, - void (*sleep_hook)(void *) = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - /// Try to acquire all tokens in collection. - virtual int tryacquire (void (*sleep_hook)(void *) = 0); - - /// Try to acquire @a token_name. - virtual int tryacquire (const ACE_TCHAR *token_name, - void (*sleep_hook)(void *) = 0); - - /** - * Renews "atomically" all resources in the collection. This is - * only successfull if all tokens in the collection could be - * renewed. options contains the blocking semantics, timeout - * value, etc. Returns: 0 on success, -1 on failure with @c errno == - * problem. - */ - virtual int renew (int requeue_position = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - /// Renew the token corresponding to @a token_name. The other - /// parameters are passed to ::renew. - virtual int renew (const ACE_TCHAR *token_name, - int requeue_position = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - /** - * Releases "atomically" all resources in the collection. This is - * only successfull if all tokens in the collection could be - * released. options contains the blocking semantics, timeout - * value, etc. Returns: 0 on success, -1 on failure with @c errno == - * problem. - */ - virtual int release (ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - /// Release the token corresponding to . The other - /// parameters are passed to ::release. - virtual int release (const ACE_TCHAR *token_name, - ACE_Synch_Options &options = - ACE_Synch_Options::defaults); - - ~ACE_Token_Collection (void); - - /// Dump the state of the class. - void dump (void) const; - - /// Return the name of the collection. Not very functionally - /// important, but sometimes a useful debugging tool. - virtual const ACE_TCHAR *name (void) const; - -protected: - - typedef ACE_Token_Name TOKEN_NAME; - - /// COLLECTION maintains a mapping from token names to ACE_Tokens* - typedef ACE_Map_Manager - COLLECTION; - - /// Allows iterations through collection_ - /** - * @deprecated Deprecated typedef. Use COLLECTION::ITERATOR trait instead. - */ - typedef COLLECTION::ITERATOR COLLECTION_ITERATOR; - - /// Allows iterations through collection_ - /** - * @deprecated Deprecated typedef. Use COLLECTION::ENTRY trait instead. - */ - typedef COLLECTION::ENTRY COLLECTION_ENTRY; - - /// COLLECTION maintains a mapping from token names to ACE_Tokens*. - COLLECTION collection_; - - /// Whether to print out debug messages or not. - bool debug_; - - /// Name of the collection. - ACE_TCHAR name_[ACE_MAXTOKENNAMELEN]; - - // = I'm not sure what these mean, but they have to be defined since they're - // pure virtual in ACE_Token_Proxy. - virtual ACE_Token_Proxy *clone (void) const; - virtual ACE_Tokens *create_token (const ACE_TCHAR *name); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Token_Collection.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TOKENS_LIBRARY */ - -#include /**/ "ace/post.h" -#endif /* ACE_TOKEN_COLLECTION_H */ - diff --git a/dep/include/ace/Token_Collection.inl b/dep/include/ace/Token_Collection.inl deleted file mode 100644 index 73f1e95d76e..00000000000 --- a/dep/include/ace/Token_Collection.inl +++ /dev/null @@ -1,17 +0,0 @@ -// -*- C++ -*- -// -// $Id: Token_Collection.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE const ACE_TCHAR * -ACE_Token_Collection::name (void) const -{ - return name_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TOKENS_LIBRARY */ diff --git a/dep/include/ace/Token_Invariants.h b/dep/include/ace/Token_Invariants.h deleted file mode 100644 index 1649e5937b3..00000000000 --- a/dep/include/ace/Token_Invariants.h +++ /dev/null @@ -1,246 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Token_Invariants.h - * - * $Id: Token_Invariants.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Tim Harrison (harrison@cs.wustl.edu) - * - * Allows applications to test that invariants are always - * satisfied. Can test mutexes and readers/writer locks. Does - * not test recursive acquisition. - * - * - */ -//============================================================================= - -#ifndef ACE_TOKEN_INVARIANTS_H -#define ACE_TOKEN_INVARIANTS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -#include "ace/Map_Manager.h" -#include "ace/Local_Tokens.h" -#include "ace/Null_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Mutex_Invariants - * - * @brief Mutex Invariants - * = INVARIANTS - * 1. Only one owner at a time. - */ -class ACE_Export ACE_Mutex_Invariants -{ -public: - /// Default construction. - ACE_Mutex_Invariants (void); - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int acquired (void); - - /// Updates internal database. - void releasing (void); - - // = Map_Manager operations. - - /// Copy construction. - ACE_Mutex_Invariants (const ACE_Mutex_Invariants &rhs); - - /// Copy. - void operator= (const ACE_Mutex_Invariants &rhs); - - /// Dump the state of the class. - void dump (void) const; - -private: - /// Number of owners. This had better be 0 >= owners_ <= 1; - int owners_; -}; - -/** - * @class ACE_RWLock_Invariants - * - * @brief RWLock Invariants - * - * Preserve the following invariants: - * -# Only one writer at a time. - * -# If there is an owning writer, there are no owning readers. - */ -class ACE_Export ACE_RWLock_Invariants -{ -public: - /// Default construction. - ACE_RWLock_Invariants (void); - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int writer_acquired (void); - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int reader_acquired (void); - - /// Updates internal database. - void releasing (void); - - // = Map_Manager operations. - - /// Copy construction. - ACE_RWLock_Invariants (const ACE_RWLock_Invariants &rhs); - - /// Copy. - void operator= (const ACE_RWLock_Invariants &rhs); - - /// Dump the state of the class. - void dump (void) const; - -private: - /// Number of owning writers. - int writers_; - - /// Number of owning readers. - int readers_; -}; - -/** - * @class ACE_Token_Invariant_Manager - * - * @brief Token Invariants - * - * The Token Invariant Manager allows applications to test that - * invariants are always satisfied. Currently, Token_Invariants - * can test mutexes and readers/writer locks. Does not test - * recursive acquisition. - * Note that this class does not ever clean its database. Until - * destroyed, it's size will forever increase. - */ -class ACE_Export ACE_Token_Invariant_Manager : public ACE_Cleanup -{ -public: - - /// Singleton access point. - static ACE_Token_Invariant_Manager *instance (void); - - // = Polymorphic methods. Just pass in the proxy and the method - // figures out the type of the token. - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int acquired (const ACE_Token_Proxy *proxy); - - /// Updates internal database. - void releasing (const ACE_Token_Proxy *proxy); - - // = Explicit methods. These to not require actual proxies in order - // to test a scenario. - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int mutex_acquired (const ACE_TCHAR *token_name); - - /// Updates internal database. - void mutex_releasing (const ACE_TCHAR *token_name); - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int reader_acquired (const ACE_TCHAR *token_name); - - /// Returns 1 on success, 0 when an invariant has been violated and - /// -1 on error. - int writer_acquired (const ACE_TCHAR *token_name); - - /// Updates internal database. - void rwlock_releasing (const ACE_TCHAR *token_name); - - /// Dump the state of the class. - void dump (void) const; - - // = The following two method should be in the protected part of the - // class. Bugs with certain compilers preclude this. - /// Prevent non-singleton construction. - ACE_Token_Invariant_Manager (void); - - /// Destruction. - virtual ~ACE_Token_Invariant_Manager (void); - -protected: - /// Return or create. - int get_mutex (const ACE_TCHAR *token_name, - ACE_Mutex_Invariants *&inv); - - /// Return or create. - int get_rwlock (const ACE_TCHAR *token_name, - ACE_RWLock_Invariants *&inv); - - /// ACE_Mutex_Token used to lock internal data structures. - ACE_TOKEN_CONST::MUTEX lock_; - - /// This may be changed to a template type. - typedef ACE_Token_Name TOKEN_NAME; - - /// COLLECTION maintains a mapping from token names to mutexes. - typedef ACE_Map_Manager - MUTEX_COLLECTION; - - /// Allows iterations through collection. - /** - * @deprecated Deprecated typedef. Use MUTEX_COLLECTION::ITERATOR trait - * instead. - */ - typedef MUTEX_COLLECTION::ITERATOR MUTEX_COLLECTION_ITERATOR; - - /// Allows iterations through collection. - /** - * @deprecated Deprecated typedef. Use MUTEX_COLLECTION::ENTRY trait - * instead. - */ - typedef MUTEX_COLLECTION::ENTRY MUTEX_COLLECTION_ENTRY; - - /// MUTEX_COLLECTION maintains a mapping from token names to mutexes. - MUTEX_COLLECTION mutex_collection_; - - /// COLLECTION maintains a mapping from token names to mutexes. - typedef ACE_Map_Manager - RWLOCK_COLLECTION; - - /// Allows iterations through collection. - /** - * @deprecated Deprecated typedef. Use RWLOCK_COLLECTION::ITERATOR trait - * instead. - */ - typedef RWLOCK_COLLECTION::ITERATOR RWLOCK_COLLECTION_ITERATOR; - - /// Allows iterations through collection. - /** - * @deprecated Deprecated typedef. Use RWLOCK_COLLECTION::ENTRY trait - * instead. - */ - typedef RWLOCK_COLLECTION::ENTRY RWLOCK_COLLECTION_ENTRY; - - /// MUTEX_COLLECTION maintains a mapping from token names to mutexes. - RWLOCK_COLLECTION rwlock_collection_; - - /// Singleton pointer. - static ACE_Token_Invariant_Manager *instance_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TOKENS_LIBRARY */ - -#include /**/ "ace/post.h" -#endif /* ACE_TOKEN_INVARIANTS_H */ - diff --git a/dep/include/ace/Token_Manager.h b/dep/include/ace/Token_Manager.h deleted file mode 100644 index 6a7c17d4167..00000000000 --- a/dep/include/ace/Token_Manager.h +++ /dev/null @@ -1,151 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Token_Manager.h - * - * $Id: Token_Manager.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Tim Harrison (harrison@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_TOKEN_MANAGER_H -#define ACE_TOKEN_MANAGER_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Local_Tokens.h" - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -#include "ace/Null_Mutex.h" -#include "ace/Map_Manager.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Local_Mutex; -class ACE_Mutex_Token; - -/** - * @class ACE_Token_Manager - * - * @brief Manages all tokens in a process space. - * - * Factory: Proxies use the token manager to obtain token - * references. This allows multiple proxies to reference the same - * logical token. - * Deadlock detection: Tokens use the manager to check for - * deadlock situations during acquires. - */ -class ACE_Export ACE_Token_Manager : public ACE_Cleanup -{ - - // To add a new type of token (e.g. semaphore), do the following - // steps: 1. Create a new derivation of ACE_Token. This class - // defines the semantics of the new Token. 2. Create a - // derivation of ACE_Token_Manager. You will only need to - // redefine make_mutex. -public: - ACE_Token_Manager (void); - virtual ~ACE_Token_Manager (void); - - /// Get the pointer to token manager singleton. - static ACE_Token_Manager *instance (void); - - /// Set the pointer to token manager singleton. - void instance (ACE_Token_Manager *); - - /** - * The Token manager uses ACE_Token_Proxy::token_id_ to look for - * an existing token. If none is found, the Token Manager calls - * ACE_Token_Proxy::create_token to create a new one. When - * finished, sets ACE_Token_Proxy::token_. @a token_name uniquely - * id's the token name. - */ - void get_token (ACE_Token_Proxy *, const ACE_TCHAR *token_name); - - /** - * Check whether acquire will cause deadlock or not. - * returns 1 if the acquire will _not_ cause deadlock. - * returns 0 if the acquire _will_ cause deadlock. - * This method ignores recursive acquisition. That is, it will not - * report deadlock if the client holding the token requests the - * token again. Thus, it assumes recursive mutexes. - */ - int check_deadlock (ACE_Token_Proxy *proxy); - int check_deadlock (ACE_Tokens *token, ACE_Token_Proxy *proxy); - - /// Notify the token manager that a token has been released. If as a - /// result, there is no owner of the token, the token is deleted. - void release_token (ACE_Tokens *&token); - - /** - * This is to allow Tokens to perform atomic transactions. The - * typical usage is to acquire this mutex, check for a safe_acquire, - * perform some queueing (if need be) and then release the lock. - * This is necessary since safe_acquire is implemented in terms of - * the Token queues. - */ - ACE_TOKEN_CONST::MUTEX &mutex (void); - - /// Dump the state of the class. - void dump (void) const; - - /// Turn debug mode on/off. - void debug (bool d); - -private: - /// Whether to print debug messages or not. - bool debug_; - - /// pointer to singleton token manager. - static ACE_Token_Manager *token_manager_; - - /// Return the token that the given client_id is waiting for, if any - ACE_Tokens *token_waiting_for (const ACE_TCHAR *client_id); - - /// ACE_Mutex_Token used to lock internal data structures. - ACE_TOKEN_CONST::MUTEX lock_; - - /// This may be changed to a template type. - typedef ACE_Token_Name TOKEN_NAME; - - /// COLLECTION maintains a mapping from token names to ACE_Tokens* - typedef ACE_Map_Manager - COLLECTION; - - /// Allows iterations through collection_ - /** - * @deprecated Deprecated typedef. Use COLLECTION::ITERATOR trait - * instead. - */ - typedef COLLECTION::ITERATOR COLLECTION_ITERATOR; - - /// Allows iterations through collection_ - /** - * @deprecated Deprecated typedef. Use COLLECTION::ENTRY trait - * instead. - */ - typedef COLLECTION::ENTRY COLLECTION_ENTRY; - - /// COLLECTION maintains a mapping from token names to ACE_Tokens*. - COLLECTION collection_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Token_Manager.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TOKENS_LIBRARY */ - -#include /**/ "ace/post.h" -#endif /* ACE_TOKEN_MANAGER_H */ - diff --git a/dep/include/ace/Token_Manager.inl b/dep/include/ace/Token_Manager.inl deleted file mode 100644 index a44778c89b2..00000000000 --- a/dep/include/ace/Token_Manager.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// -// $Id: Token_Manager.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_TOKEN_CONST::MUTEX & -ACE_Token_Manager::mutex (void) -{ - ACE_TRACE ("ACE_Token_Manager::mutex"); - return lock_; -} - -ACE_INLINE void -ACE_Token_Manager::debug (bool d) -{ - ACE_TRACE ("ACE_Token_Manager::debug"); - debug_ = d; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TOKENS_LIBRARY */ diff --git a/dep/include/ace/Token_Request_Reply.h b/dep/include/ace/Token_Request_Reply.h deleted file mode 100644 index 18bb0d493cf..00000000000 --- a/dep/include/ace/Token_Request_Reply.h +++ /dev/null @@ -1,270 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Token_Request_Reply.h - * - * $Id: Token_Request_Reply.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Define the format used to exchange messages between the - * ACE_Token Server and its clients. - * - * - * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) - * @author Tim Harrison (harrison@cs.wustl.edu) - */ -//============================================================================= - -#ifndef ACE_TOKEN_REQUEST_REPLY_H -#define ACE_TOKEN_REQUEST_REPLY_H -#include /**/ "ace/pre.h" - -#include "ace/Local_Tokens.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Specifies the size of the fixed length portion of -/// the Transfer structure in ACE_Token_Request -#define ACE_TOKEN_REQUEST_HEADER_SIZE 40 - -/** - * @class ACE_Token_Request - * - * @brief Message format for delivering requests to the ACE_Token Server. - * - * This class is implemented to minimize data copying. - * In particular, all marshaling is done in situ... - */ -class ACE_Export ACE_Token_Request -{ -public: - /// Operation types. - enum OPERATION - { - /// Acquire the token. - ACQUIRE, - /// Release the token. - RELEASE, - /// Renew the token. - RENEW, - /// Remove the token. - REMOVE, - // Try to acquire the token. - TRY_ACQUIRE - }; - - /// Default constructor. - ACE_Token_Request (void); - - /** - * @param token_type MUTEX, RWLOCK - * @param proxy_type MUTEX, RLOCK, WLOCK (acquires mean different things) - * @param operation method - * @param token_name - * @param client_id - * @param options We check USE_TIMEOUT and use the arg. - */ - ACE_Token_Request (int token_type, - int proxy_type, - ACE_UINT32 operation, - const ACE_TCHAR token_name[], - const ACE_TCHAR client_id[], - const ACE_Synch_Options &options); - - /// Get the length of the encoded/decoded message. - ACE_UINT32 length (void) const; - - /// Set the length of the encoded/decoded message. - void length (ACE_UINT32); - - /// Get the type of proxy - int proxy_type (void) const; - - /// Set the type of proxy - void proxy_type (int proxy_type); - - /// Get the type of token - int token_type (void) const; - - /// Set the type of token - void token_type (int token_type); - - /// Get the type of the operation. - ACE_UINT32 operation_type (void) const; - - /// Set the type of the operation. - void operation_type (ACE_UINT32); - - /// Get the requeue position. These should be used when renew - /// is the operation type. - ACE_UINT32 requeue_position (void) const; - - /// Set the requeue position. These should be used when renew - /// is the operation type. - void requeue_position (ACE_UINT32); - - /// Get notify. These should be used when acquire is the operation type. - ACE_UINT32 notify (void) const; - - /// Set notify. These should be used when acquire is the operation type. - void notify (ACE_UINT32); - - /// Get the timeout. - ACE_Synch_Options &options (void) const; - - /// Set the timeout. - void options (const ACE_Synch_Options &options); - - // = Set/get the name of the token and the client id. The set - // method is combined to make it easier on us. We're copying the - // names as a contiguous buffer. - ACE_TCHAR *token_name (void) const; - ACE_TCHAR *client_id (void) const; - void token_name (const ACE_TCHAR *token_name, const ACE_TCHAR *client_id); - - /// Encode the message before transmission. - int encode (void *&); - - /// Decode message after reception. This must be called to set the - /// internal options. - int decode (void); - - /// Print out the values of the message for debugging purposes. - void dump (void) const; - -private: - // = The 5 fields in the struct are transmitted to the server. - // The remaining 2 fields are not tranferred -- they are used only on - // the server-side to simplify lookups. - - struct Transfer - { - /// Length of entire request. - ACE_UINT32 length_; - - /// Type of the request (i.e., MUTEX, RLOCK, WLOCK... - ACE_UINT32 token_type_; - - /// Type of the request (i.e., MUTEX, RLOCK, WLOCK... - ACE_UINT32 proxy_type_; - - /// Type of the request (i.e., , , , and ). - ACE_UINT32 operation_type_; - - /// this only makes sense when operation type is renew - ACE_UINT32 requeue_position_; - - /// this only makes sense when operation type is renew - ACE_UINT32 notify_; - - // = ACE_Synch_Options stuff - - /// Indicates if we should block forever. If 1, then - /// and indicates how long we should wait. If 0, - /// then we block forever. - ACE_UINT32 use_timeout_; - - /// Max seconds willing to wait for token if not blocking forever. - ACE_UINT32 sec_; - - /// Max micro seconds to wait for token if not blocking forever. - ACE_UINT32 usec_; - - /// value returned in ; - ACE_UINT32 arg_; - - /// The data portion contains the including a 0 terminator, - /// a ':', then the including a 0 terminator - ACE_TCHAR data_[ACE_MAXTOKENNAMELEN + ACE_MAXCLIENTIDLEN + 3]; - } transfer_; - - /// Pointer to the beginning of the token name in this->data_. - ACE_TCHAR *token_name_; - - /// Pointer to the beginning of the client id in this->data_; - ACE_TCHAR *client_id_; - - /// Holds arg, sec, usec, etc. - ACE_Synch_Options options_; -}; - -/** - * @class ACE_Token_Reply - * - * @brief Message format for delivering replies from the ACE_Token Server. - * - * This class is implemented to minimize data copying. - * In particular, all marshaling is done in situ... - */ -class ACE_Export ACE_Token_Reply -{ -public: - /// Default constructor. - ACE_Token_Reply (void); - - /// Get the length of the encoded/decoded message. - ACE_UINT32 length (void) const; - - /// Set the length of the encoded/decoded message. - void length (ACE_UINT32); - - /// Get the errno of a reply. - ACE_UINT32 errnum (void) const; - - /// Set the errno of a reply. - void errnum (ACE_UINT32); - - /// Get the arg of a reply. - ACE_UINT32 arg (void) const; - - /// Set the arg of a reply. - void arg (ACE_UINT32); - - /// Encode the message before transfer. - int encode (void *&); - - /// Decode a message after reception. - int decode (void); - - /// Print out the values of the message for debugging purposes. - void dump (void) const; - -private: - // = The 2 fields in the struct are transmitted to the server. - - struct Transfer - { - /// Length of entire reply. - ACE_UINT32 length_; - - /// Indicates why error occurred if type_> == . - /// Typical reasons include: - /// @c EWOULDBLOCK (if client requested a non-blocking check for the token). - /// @c ETIME (if the client timed out after waiting for the token). - /// (if the token lock was removed out from underneath a waiter). - /// (attempt to renew a token that isn't owned by the client). - ACE_UINT32 errno_; - - /// magic cookie - ACE_UINT32 arg_; - - } transfer_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Token_Request_Reply.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_TOKENS_LIBRARY */ - -#include /**/ "ace/post.h" -#endif /* ACE_TOKEN_REQUEST_REPLY_H */ - diff --git a/dep/include/ace/Token_Request_Reply.inl b/dep/include/ace/Token_Request_Reply.inl deleted file mode 100644 index 4291bfa6089..00000000000 --- a/dep/include/ace/Token_Request_Reply.inl +++ /dev/null @@ -1,205 +0,0 @@ -// -*- C++ -*- -// -// $Id: Token_Request_Reply.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -#include "ace/Truncate.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// = Set/get the length of the encoded/decoded message. - -ACE_INLINE ACE_UINT32 -ACE_Token_Request::length (void) const -{ - return ntohl (this->transfer_.length_); -} - -ACE_INLINE void -ACE_Token_Request::length (ACE_UINT32 l) -{ - this->transfer_.length_ = htonl (l); -} - -// = Set/get the type of the message. -ACE_INLINE int -ACE_Token_Request::token_type (void) const -{ - return (int) ntohl (this->transfer_.token_type_); -} - -ACE_INLINE void -ACE_Token_Request::token_type (int t) -{ - this->transfer_.token_type_ = htonl ((ACE_UINT32) t); -} - -// = Set/get the type of the message. -ACE_INLINE int -ACE_Token_Request::proxy_type (void) const -{ - return (int) ntohl (this->transfer_.proxy_type_); -} - -ACE_INLINE void -ACE_Token_Request::proxy_type (int t) -{ - this->transfer_.proxy_type_ = htonl ((ACE_UINT32) t); -} - -// = Set/get the type of the message. -ACE_INLINE ACE_UINT32 -ACE_Token_Request::operation_type (void) const -{ - return ntohl (this->transfer_.operation_type_); -} - -ACE_INLINE void -ACE_Token_Request::operation_type (ACE_UINT32 t) -{ - this->transfer_.operation_type_ = htonl (t); -} - -// = Set/get the requeue position -ACE_INLINE ACE_UINT32 -ACE_Token_Request::requeue_position (void) const -{ - return ntohl (this->transfer_.requeue_position_); -} - -ACE_INLINE void -ACE_Token_Request::requeue_position (ACE_UINT32 rq) -{ - this->transfer_.requeue_position_ = htonl (rq); -} - -// = Set/get the requeue position -ACE_INLINE ACE_UINT32 -ACE_Token_Request::notify (void) const -{ - return ntohl (this->transfer_.notify_); -} - -ACE_INLINE void -ACE_Token_Request::notify (ACE_UINT32 rq) -{ - this->transfer_.notify_ = htonl (rq); -} - -// = Set/get the blocking semantics. -ACE_INLINE ACE_Synch_Options & -ACE_Token_Request::options (void) const -{ - return (ACE_Synch_Options &) options_; -} - -ACE_INLINE void -ACE_Token_Request::options (const ACE_Synch_Options &opt) -{ - // fight the friggin const from hell - ACE_Synch_Options *options = (ACE_Synch_Options *) &opt; - - transfer_.use_timeout_ = options->operator[](ACE_Synch_Options::USE_TIMEOUT); - if (transfer_.use_timeout_ == 1) - { - transfer_.usec_ = options->timeout ().usec (); - if (options->timeout ().sec () > (time_t) ACE_UINT32_MAX) - transfer_.sec_ = ACE_UINT32_MAX; - else - transfer_.sec_ = static_cast (options->timeout ().sec ()); - } - else - { - transfer_.usec_ = 0; - transfer_.sec_ = 0; - } -} - -// = Set/get the name of the token. -ACE_INLINE ACE_TCHAR * -ACE_Token_Request::token_name (void) const -{ - return token_name_; -} - -ACE_INLINE void -ACE_Token_Request::token_name (const ACE_TCHAR *token_name, - const ACE_TCHAR *client_id) -{ - size_t token_name_length = ACE_OS::strlen (token_name) + 1; // Add 1 for '\0'. - size_t client_id_length = ACE_OS::strlen (client_id) + 1; // Add 1 for '\0'. - - // Set up pointers and copy token_name and client_id into request. - token_name_ = this->transfer_.data_; - client_id_ = &this->token_name_[token_name_length + 1]; // Add 1 for ':'; - client_id_[-1] = ACE_TEXT (':'); // Insert the ':' before this->clientId_. - - (void) ACE_OS::memcpy (this->token_name_, - token_name, - token_name_length * sizeof (ACE_TCHAR)); - (void) ACE_OS::memcpy (this->client_id_, - client_id, - client_id_length * sizeof (ACE_TCHAR)); - - // Fixed length header size - size_t len = ACE_TOKEN_REQUEST_HEADER_SIZE; - - // ... then add in the amount of the variable-sized portion. - len += token_name_length + client_id_length + 1; - this->length (ACE_Utils::truncate_cast (len)); -} - -// = Set/get the id of the client. -ACE_INLINE ACE_TCHAR * -ACE_Token_Request::client_id (void) const -{ - return this->client_id_; -} - -// ************************************************************ -// ************************************************************ -// ************************************************************ - -// = Set/get the length of the encoded/decoded message. -ACE_INLINE ACE_UINT32 -ACE_Token_Reply::length (void) const -{ - return ntohl (this->transfer_.length_); -} - -ACE_INLINE void -ACE_Token_Reply::length (ACE_UINT32 l) -{ - this->transfer_.length_ = htonl (l); -} - -// = Set/get the errno of a failed reply. -ACE_INLINE ACE_UINT32 -ACE_Token_Reply::errnum (void) const -{ - return ntohl (this->transfer_.errno_); -} - -ACE_INLINE void -ACE_Token_Reply::errnum (ACE_UINT32 e) -{ - this->transfer_.errno_ = htonl (e); -} - -// = Set/get the length of the encoded/decoded message. -ACE_INLINE ACE_UINT32 -ACE_Token_Reply::arg (void) const -{ - return ntohl (this->transfer_.arg_); -} - -ACE_INLINE void -ACE_Token_Reply::arg (ACE_UINT32 arg) -{ - this->transfer_.arg_ = htonl (arg); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TOKENS_LIBRARY */ diff --git a/dep/include/ace/Trace.h b/dep/include/ace/Trace.h deleted file mode 100644 index f1c6aa86037..00000000000 --- a/dep/include/ace/Trace.h +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Trace.h - * - * $Id: Trace.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TRACE_H -#define ACE_TRACE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Trace - * - * @brief A C++ trace facility that keeps track of which methods are - * entered and exited. - * - * This class uses C++ constructors and destructors to automate - * the ACE_Trace nesting. In addition, thread-specific storage - * is used to enable multiple threads to work correctly. - */ -class ACE_Export ACE_Trace -{ -public: - // = Initialization and termination methods. - - /// Perform the first part of the trace, which prints out the string - /// N, the LINE, and the ACE_FILE as the function is entered. - ACE_Trace (const ACE_TCHAR *n, - int line = 0, - const ACE_TCHAR *file = ACE_TEXT ("")); - - /// Perform the second part of the trace, which prints out the NAME - /// as the function is exited. - ~ACE_Trace (void); - - // = Control the tracing level. - /// Determine if tracing is enabled (return == 1) or not (== 0) - static int is_tracing(void); - - /// Enable the tracing facility. - static void start_tracing (void); - - /// Disable the tracing facility. - static void stop_tracing (void); - - /// Change the nesting indentation level. - static void set_nesting_indent (int indent); - - /// Get the nesting indentation level. - static int get_nesting_indent (void); - - /// Dump the state of an object. - void dump (void) const; - -private: - // Keeps track of how deeply the call stack is nested (this is - // maintained in thread-specific storage to ensure correctness in - // multiple threads of control. - - /// Name of the method we are in. - const ACE_TCHAR *name_; - - /// Keeps track of how far to indent per trace call. - static int nesting_indent_; - - /// Is tracing enabled? - static int enable_tracing_; - - /// Default values. - enum - { - DEFAULT_INDENT = 3, - DEFAULT_TRACING = 1 - }; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_TRACE_H */ - diff --git a/dep/include/ace/Truncate.h b/dep/include/ace/Truncate.h deleted file mode 100644 index 0af5b022473..00000000000 --- a/dep/include/ace/Truncate.h +++ /dev/null @@ -1,1054 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Truncate.h - * - * $Id: Truncate.h 82623 2008-08-13 14:41:09Z johnnyw $ - * - * @author Steve Huston - * @author Ossama Othman - * @author Russell Mora - */ -//============================================================================= - -#ifndef ACE_TRUNCATE_H -#define ACE_TRUNCATE_H - -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Global_Macros.h" -#include "ace/If_Then_Else.h" -#include "ace/Numeric_Limits.h" - -#if defined (ACE_LACKS_LONGLONG_T) \ - || defined (__BORLANDC__) && __BORLANDC__ < 0x590 -# include "ace/Basic_Types.h" -#endif /* ACE_LACKS_LONGLONG_T || __BORLANDC__ < 0x590 */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE_Utils -{ - -#if !defined (__BORLANDC__) || __BORLANDC__ >= 0x590 - - template struct Sign_Check; - - // Specialize the unsigned signed cases. - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; -#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T)) -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; -#else - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 0); }; -#endif /* !ACE_LACKS_LONGLONG_T */ - - // Specialize the signed cases. - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; -#ifndef ACE_LACKS_LONGLONG_T -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - template<> struct Sign_Check { ACE_STATIC_CONSTANT (bool, is_signed = 1); }; -#endif /* !ACE_LACKS_LONGLONG_T */ - - // ----------------------------------------------------- - - /** - * @struct To_Unsigned - * - * @brief Retrieve unsigned counterpart to given type or value. - * - * Retrieve unsigned counterpart to given type or value. - */ - template struct To_Unsigned; - - template<> - struct To_Unsigned - { - typedef unsigned char unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; - - template<> - struct To_Unsigned - { - typedef unsigned short unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; - - template<> - struct To_Unsigned - { - typedef unsigned int unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; - - template<> - struct To_Unsigned - { - typedef unsigned long unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; - -#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T)) -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - template<> - struct To_Unsigned - { - typedef unsigned long long unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; -#else - template<> - struct To_Unsigned - { - typedef ACE_U_LongLong unsigned_type; - - unsigned_type operator() (unsigned_type x) { return x; } - }; -#endif /* !ACE_LACKS_LONGLONG_T */ - - // ---------------- - - template<> - struct To_Unsigned - { - typedef signed char signed_type; - typedef unsigned char unsigned_type; - - unsigned_type operator() (signed_type x) - { - return static_cast (x); - } - }; - - template<> - struct To_Unsigned - { - typedef signed short signed_type; - typedef unsigned short unsigned_type; - - unsigned_type operator() (signed_type x) - { - return static_cast (x); - } - }; - - template<> - struct To_Unsigned - { - typedef signed int signed_type; - typedef unsigned int unsigned_type; - - unsigned_type operator() (signed_type x) - { - return static_cast (x); - } - }; - - template<> - struct To_Unsigned - { - typedef signed long signed_type; - typedef unsigned long unsigned_type; - - unsigned_type operator() (signed_type x) - { - return static_cast (x); - } - }; - -#if !(defined(ACE_LACKS_LONGLONG_T) || defined(ACE_LACKS_UNSIGNEDLONGLONG_T)) -# ifdef __GNUC__ - // Silence g++ "-pedantic" warnings regarding use of "long long" - // type. - __extension__ -# endif /* __GNUC__ */ - template<> - struct To_Unsigned - { - typedef signed long long signed_type; - typedef unsigned long long unsigned_type; - - unsigned_type operator() (signed_type x) - { - return static_cast (x); - } - }; -#endif /* !ACE_LACKS_LONGLONG_T */ - - // ----------------------------------------------------- - - /** - * @struct Safe_Comparator - * - * @brief Conservative comparison of types that may not be safely - * promoted and/or converted to each other. - * - * The comparison operations provided by this structure perform - * negative value checking when necessary to prevent wrap-around - * when explicitly casting to an unsigned type. - * - * @internal This structure is not meant for general use. - */ - template struct Safe_Comparator; - - // LEFT: signed, RIGHT: unsigned - template - struct Safe_Comparator - { - static bool greater_than (LEFT lhs, RIGHT rhs) - { - // Prevent wrap-around when casting to unsigned. - if (lhs < 0) - return false; // since rhs is always positive - else - { - // Implicit promotion of unsigned LEFT and RIGHT types here. - return To_Unsigned() (lhs) > rhs; - } - } - }; - - // LEFT: unsigned, RIGHT: signed - template - struct Safe_Comparator - { - static bool greater_than (LEFT lhs, RIGHT rhs) - { - // Prevent wrap-around when casting to unsigned. - if (rhs < 0) - return true; // since lhs is always positive - else - { - // Implicit promotion of unsigned LEFT and RIGHT types here. - return lhs > To_Unsigned() (rhs); - } - } - }; - - // LEFT: unsigned, RIGHT: unsigned - template - struct Safe_Comparator - { - static bool greater_than (LEFT lhs, RIGHT rhs) - { - // Implicit promotion of unsigned LEFT and RIGHT types here. - return lhs > rhs; - } - }; - - // LEFT: signed, RIGHT: signed - template - struct Safe_Comparator - { - static bool greater_than (LEFT lhs, RIGHT rhs) - { - // Implicit promotion of signed LEFT and RIGHT types here. - return lhs > rhs; - } - }; - - // ----------------------------------------------------- - - /** - * @struct Fast_Comparator - * - * @brief Quick comparison of types that can be safely promoted - * and/or converted to each other. - * - * The comparison operations provided by this structure perform no - * negative value checking, meaning it is not applicable to all - * types. Check the value of the @c USABLE enumerator to determine - * if it applies to the types in question. - * - * @internal This structure is not meant for general use. - */ - template - struct Fast_Comparator - { - ACE_STATIC_CONSTANT ( - bool, - USE_LEFT = ((sizeof (LEFT) > sizeof (RIGHT) - && (Sign_Check::is_signed == 1 - || Sign_Check::is_signed == 0)) - - // The following is basically the case where LEFT - // and RIGHT are the same integral type. - || (sizeof (LEFT) == sizeof (RIGHT) - // Can't portably do - // Sign_Check::is_signed == - // Sign_Check::is_signed, - // i.e. comparison of anonymous enumerations, - // without triggering a compiler diagnostic - // so expand the comparison. - && ((Sign_Check::is_signed == 1 - && Sign_Check::is_signed == 1) - || (Sign_Check::is_signed == 0 - && Sign_Check::is_signed == 0))))); - - ACE_STATIC_CONSTANT ( - bool, - USE_RIGHT = (sizeof (RIGHT) > sizeof (LEFT) - && (Sign_Check::is_signed == 1 - || Sign_Check::is_signed == 0))); - - ACE_STATIC_CONSTANT (bool, USABLE = (USE_LEFT || USE_RIGHT)); - - typedef typename ACE::If_Then_Else< - USE_LEFT, - LEFT, - typename ACE::If_Then_Else< - USE_RIGHT, - RIGHT, - void>::result_type>::result_type promote_type; - - static bool greater_than (LEFT lhs, RIGHT rhs) - { - // The explicit cast is assumed to change the type of rhs without - // changing its value. - return - (static_cast (lhs) > static_cast (rhs)); - } - - }; - - // ----------------------------------------------------- - - /** - * @struct Comparator - * - * @brief Structure that provides optimal comparison operation for - * given types. - * - * The comparison operations provided by this structure are chosen - * at compile time based on the signs and sizes of types being - * compared. - * @par - * Comparisons of values with the same sign or those with types that - * can be promoted safely are done quickly, without any range - * checking. - * @par - * Comparisons of values of different types that cannot be safely - * promoted incur an additional check for a negative value to allow - * the compiler to perform the appropriate implicit unsigned type - * promotion. - * - * @note In general, the operations found in this structure should - * not be used to work around compiler diagnostics regarding - * comparison of signed and unsigned types. Verify that your - * types are correct before relying on those operations. - * - * @internal This structure is not meant for general use. - */ - template - struct Comparator - { - typedef typename ACE::If_Then_Else< - Fast_Comparator::USABLE, - Fast_Comparator, - Safe_Comparator::is_signed, - Sign_Check::is_signed> >::result_type comp_type; - }; - - // ----------------------------------------------------- - - /** - * @struct Truncator - * - * @brief Truncate value of type @c FROM to value of type @c TO. - * - * Truncate a value of type @c FROM to value of type @c TO, if the - * value is larger than the maximum of value of type @c TO. - */ - template - struct Truncator - { - ACE_STATIC_CONSTANT ( - bool, - // max FROM always greater than max TO - MAX_FROM_GT_MAX_TO = (sizeof(FROM) > sizeof (TO) - || (sizeof(FROM) == sizeof (TO) - && Sign_Check::is_signed == 0))); - - typedef typename ACE::If_Then_Else< - MAX_FROM_GT_MAX_TO, - FROM, - TO>::result_type comp_to_type; - - // Take advantage of knowledge that we're casting a positive value - // to a type large enough to hold it so that we can bypass - // negative value checks at compile-time. Otherwise fallback on - // the safer comparison. - typedef typename ACE::If_Then_Else< - MAX_FROM_GT_MAX_TO, - Fast_Comparator, - typename Comparator::comp_type>::result_type comparator; - - /// Truncate a value of type @c FROM to value of type @c TO, if - /// the value is larger than the maximum of value of type @c TO. - TO operator() (FROM val) - { - return - (comparator::greater_than (val, ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - - }; - - // Partial specialization for the case where the types are the same. - // No truncation is necessary. - template - struct Truncator - { - T operator() (T val) - { - return val; - } - }; - -#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - // Partial specialization for the case where we're casting from - // ACE_U_LongLong to a smaller integer. We assume that we're always - // truncating from ACE_U_LongLong to a smaller type. The partial - // specialization above handles the case where both the FROM and TO - // types are ACE_U_LongLong. - template - struct Truncator - { - TO operator() (ACE_U_LongLong const & val) - { - // If val less than or equal to ACE_Numeric_Limits::max(), - // val.lo() must be less than or equal to - // ACE_Numeric_Limits::max (), as well. - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val.lo ())); - } - }; -#endif /* ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */ - - // ----------------------------------------------------- - /** - * @struct Noop_Truncator - * - * @brief No-op truncation. - * - * This structure/functor performs no truncation since it assumes - * that @c sizeof(FROM) @c < @c sizeof(TO), meaning that - * @c numeric_limits::max() @c < @c numeric_limits::max(). - */ - template - struct Noop_Truncator - { - TO operator() (FROM val) - { - return static_cast (val); - } - }; - // ----------------------------------------------------- - - /** - * @class truncate_cast - * - * @brief Helper function to truncate an integral value to the - * maximum value of the given type. - * - * Very useful since ACE methods return @c int very often and - * the value's source is often a different-size integral - * type, such as @c size_t. This function hides the - * truncation logic and resolves compiler diagnostics. - * - * @internal Internal use only. - */ - template - inline TO truncate_cast (FROM val) - { - // If the size of FROM is less than the size of TO, "val" will - // never be greater than the maximum "TO" value, so there is no - // need to attempt to truncate. - typedef typename ACE::If_Then_Else< - (sizeof (FROM) < sizeof (TO)), - Noop_Truncator, - Truncator >::result_type truncator; - - return truncator() (val); - } - -#else - - // Borland can't handle the template meta-programming above so - // provide explicit specializations for a few types. More will be - // added if necessary. - - /** - * @deprecated Borland ACE_Utils::Truncator<> specializations should - * be removed. - */ - - template struct Truncator; - - //---------------------------------------------------------- - // sizeof(FROM) > sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - ACE_INT8 operator() (ACE_INT32 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT8 operator() (ACE_UINT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT8 operator() (ACE_INT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_INT8 operator() (ACE_UINT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG < 8 - template<> - struct Truncator - { - signed long operator() (ACE_INT64 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (ACE_INT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed long operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed long operator() (const ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_LONG < 8 */ - -#if defined (ACE_SIZEOF_INT) && ACE_SIZEOF_INT < 8 - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_INT64 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_INT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_INT < 8 */ - - //---------------------------------------------------------- - // sizeof(FROM) == sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - char operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - wchar_t operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed int operator() (unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (const unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (unsigned long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#if defined (ACE_SIZEOF_INT) && defined (ACE_SIZEOF_LONG) \ - && ACE_SIZEOF_INT == ACE_SIZEOF_LONG - - template<> - struct Truncator - { - unsigned long operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed int operator() (unsigned long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (signed long val) - { - return static_cast (val); -// This code causes asserts and compiler crashes with BCB6 Static and -// BCB2007 Static -// return -// (val > static_cast (ACE_Numeric_Limits::max ()) -// ? ACE_Numeric_Limits::max () -// : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (const signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_INT == ACE_SIZEOF_LONG */ - - template<> - struct Truncator - { - ACE_UINT64 operator() (ACE_INT64 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - //---------------------------------------------------------- - // sizeof(FROM) < sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_INT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_UINT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_UINT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_INT8 val) - { - return static_cast (val); - } - }; - -#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG < 8 - template<> - struct Truncator - { - ACE_INT64 operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (const signed long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (unsigned long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (unsigned long val) - { - return static_cast (val); - } - }; -#endif /* ACE_SIZEOF_LONG < 8 */ - -#if defined (ACE_SIZEOF_INT) && ACE_SIZEOF_INT < 8 - template<> - struct Truncator - { - ACE_INT64 operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (unsigned int val) - { - return static_cast (val); - } - }; -#endif /* ACE_SIZEOF_INT < 8 */ - - template<> - struct Truncator - { - unsigned long operator() (size_t val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - // Partial specialization for the case where the types are the same. - // No truncation is necessary. - template - struct Truncator - { - T operator() (T val) - { - return val; - } - }; - - // Partial specialization for the case where the types are the same, - // but the from type is const. No truncation is necessary. - // - // This is only necessary to workaround a problem with the BCB6 - // compiler. - template - struct Truncator - { - T operator() (T val) - { - return val; - } - }; - - // ------------------------------------- - - template - inline TO truncate_cast (FROM val) - { - typedef Truncator truncator; - - return truncator() (val); - } - -#endif /* !__BORLANDC__ || __BORLANDC__ >= 0x590 */ - -} // namespace ACE_Utils - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_TRUNCATE_H*/ - diff --git a/dep/include/ace/Typed_SV_Message.h b/dep/include/ace/Typed_SV_Message.h deleted file mode 100644 index 714907bbb22..00000000000 --- a/dep/include/ace/Typed_SV_Message.h +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Typed_SV_Message.h - * - * $Id: Typed_SV_Message.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//========================================================================== - -#ifndef ACE_TYPED_SV_MESSAGE_H -#define ACE_TYPED_SV_MESSAGE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Typed_SV_Message - * - * @brief Defines the header file for the C++ wrapper for System V - * message queues. - */ -template -class ACE_Typed_SV_Message -{ -public: - // = Initialization and termination methods. - ACE_Typed_SV_Message (long type = 0, - int length = sizeof (T), - int max_size = sizeof (T)); - ACE_Typed_SV_Message (const T &data, - long type = 0, - int length = sizeof (T), - int max_size = sizeof (T)); - ~ACE_Typed_SV_Message (void); - - /// Get the type of the message. - long type (void) const; - - /// Set the type of the message. - void type (long type); - - /// Get the length of the message. - int length (void) const; - - /// Set the length of the message. - void length (int l); - - /// Get the maximum size of the message. - int max_size (void) const; - - /// Set the maximum size of the message. - void max_size (int m); - - /// Get a pointer to the data in the message. - T &data (void); - - /// Set a pointer to the data in the message. - void data (const T &data); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Type of message. - long type_; - - /// Length of this message. - int length_; - - /// Maximum length of any message. - int max_; - - /// Data stored in a message. - T data_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Typed_SV_Message.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Typed_SV_Message.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Typed_SV_Message.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_TYPED_SV_MESSAGE_H */ - diff --git a/dep/include/ace/Typed_SV_Message.inl b/dep/include/ace/Typed_SV_Message.inl deleted file mode 100644 index 6d8ea702321..00000000000 --- a/dep/include/ace/Typed_SV_Message.inl +++ /dev/null @@ -1,96 +0,0 @@ -// -*- C++ -*- -// -// $Id: Typed_SV_Message.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/config-all.h" -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Typed_SV_Message::ACE_Typed_SV_Message (long t, - int l, - int m) - : type_ (t) -{ - ACE_TRACE ("ACE_Typed_SV_Message::ACE_Typed_SV_Message"); - this->length (l); - this->max_size (m); -} - -template ACE_INLINE -ACE_Typed_SV_Message::ACE_Typed_SV_Message (const T &d, - long t, - int l, - int m) - : type_ (t), - data_ (d) -{ - ACE_TRACE ("ACE_Typed_SV_Message::ACE_Typed_SV_Message"); - this->length (l); - this->max_size (m); -} - -template ACE_INLINE -ACE_Typed_SV_Message::~ACE_Typed_SV_Message (void) -{ - ACE_TRACE ("ACE_Typed_SV_Message::~ACE_Typed_SV_Message"); -} - -template ACE_INLINE long -ACE_Typed_SV_Message::type (void) const -{ - ACE_TRACE ("ACE_Typed_SV_Message::type"); - return this->type_; -} - -template ACE_INLINE void -ACE_Typed_SV_Message::type (long t) -{ - ACE_TRACE ("ACE_Typed_SV_Message::type"); - this->type_ = t; -} - -template ACE_INLINE int -ACE_Typed_SV_Message::length (void) const -{ - ACE_TRACE ("ACE_Typed_SV_Message::length"); - return this->length_; -} - -template ACE_INLINE void -ACE_Typed_SV_Message::length (int len) -{ - ACE_TRACE ("ACE_Typed_SV_Message::length"); - this->length_ = len + (sizeof *this - (sizeof this->type_ + sizeof this->data_)); -} - -template ACE_INLINE int -ACE_Typed_SV_Message::max_size (void) const -{ - ACE_TRACE ("ACE_Typed_SV_Message::max_size"); - return this->max_; -} - -template ACE_INLINE void -ACE_Typed_SV_Message::max_size (int m) -{ - ACE_TRACE ("ACE_Typed_SV_Message::max_size"); - this->max_ = m + (sizeof *this - (sizeof this->type_ + sizeof this->data_)); -} - -template T & -ACE_Typed_SV_Message::data (void) -{ - ACE_TRACE ("ACE_Typed_SV_Message::data"); - return this->data_; -} - -template void -ACE_Typed_SV_Message::data (const T &d) -{ - ACE_TRACE ("ACE_Typed_SV_Message::data"); - this->data_ = d; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Typed_SV_Message_Queue.h b/dep/include/ace/Typed_SV_Message_Queue.h deleted file mode 100644 index f5f336b010d..00000000000 --- a/dep/include/ace/Typed_SV_Message_Queue.h +++ /dev/null @@ -1,93 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Typed_SV_Message_Queue.h - * - * $Id: Typed_SV_Message_Queue.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_TYPED_MESSAGE_QUEUE_H -#define ACE_TYPED_MESSAGE_QUEUE_H -#include /**/ "ace/pre.h" - -#include "ace/SV_Message_Queue.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Typed_SV_Message.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Typed_SV_Message_Queue - * - * @brief Defines the header file for the C++ wrapper facade for typed message queues. - */ -template -class ACE_Typed_SV_Message_Queue -{ -public: - enum - { - ACE_CREATE = IPC_CREAT, - ACE_OPEN = 0, - ACE_NOWAIT = IPC_NOWAIT - }; - - // = Initialization and termination operations. - ACE_Typed_SV_Message_Queue (void); - ACE_Typed_SV_Message_Queue (key_t external_id, - int create = ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS); - int open (key_t external_id, - int create = ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS); - int close (void); - int remove (void); - ~ACE_Typed_SV_Message_Queue (void); - - /// Send method. - int send (const ACE_Typed_SV_Message &mb, int mflags = 0); - - /// Recv method. - int recv (ACE_Typed_SV_Message &mb, int mflags = 0); - - /// Return the id of the underlying ACE_SV_Message_Queue. - int get_id (void) const; - - /// Control the underlying message queue. - int control (int option, void *arg = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - ACE_SV_Message_Queue message_queue_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Typed_SV_Message_Queue.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Typed_SV_Message_Queue.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Typed_SV_Message_Queue.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_TYPED_MESSAGE_QUEUE_H */ - diff --git a/dep/include/ace/Typed_SV_Message_Queue.inl b/dep/include/ace/Typed_SV_Message_Queue.inl deleted file mode 100644 index 90539936e62..00000000000 --- a/dep/include/ace/Typed_SV_Message_Queue.inl +++ /dev/null @@ -1,80 +0,0 @@ -// -*- C++ -*- -// -// $Id: Typed_SV_Message_Queue.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/SV_Message_Queue.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::open (key_t external_id, - int create, - int perms) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::open"); - return this->message_queue_.open (external_id, create, perms); -} - -// What does it mean to close a message queue?! - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::close (void) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::close"); - return 1; -} - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::recv (ACE_Typed_SV_Message &mb, - int mflags) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::recv"); - - int length = - this->message_queue_.recv (reinterpret_cast (mb), - mb.max_size (), - mb.type (), - mflags); - if (length != -1) - mb.length (length); - - return length; -} - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::send (const ACE_Typed_SV_Message &mb, - int mflags) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::send"); - return - this->message_queue_.send ( - reinterpret_cast ( - const_cast &> (mb)), - mb.length (), - mflags); -} - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::remove (void) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::remove"); - - return this->message_queue_.remove (); -} - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::control (int option, - void *arg) -{ - ACE_TRACE ("ACE_Typed_SV_Message_Queue::control"); - - return this->message_queue_.control (option, arg); -} - -template ACE_INLINE int -ACE_Typed_SV_Message_Queue::get_id (void) const -{ - return this->message_queue_.get_id (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/UNIX_Addr.h b/dep/include/ace/UNIX_Addr.h deleted file mode 100644 index 253748dfa02..00000000000 --- a/dep/include/ace/UNIX_Addr.h +++ /dev/null @@ -1,117 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UNIX_Addr.h - * - * $Id: UNIX_Addr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_UNIX_ADDR_H -#define ACE_UNIX_ADDR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Addr.h" -#include "ace/Log_Msg.h" -#include "ace/ACE.h" -#include "ace/os_include/sys/os_un.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_UNIX_Addr - * - * @brief Defines the ``UNIX domain address family'' address format. - */ -class ACE_Export ACE_UNIX_Addr : public ACE_Addr -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_UNIX_Addr (void); - - /// Copy constructor. - ACE_UNIX_Addr (const ACE_UNIX_Addr &sa); - - /// Creates an ACE_UNIX_Addr from a string. - ACE_UNIX_Addr (const char rendezvous_point[]); - - /// Creates an ACE_INET_Addr from a sockaddr_un structure. - ACE_UNIX_Addr (const sockaddr_un *, int len); - - /// Creates an ACE_UNIX_Addr from another ACE_UNIX_Addr. - int set (const ACE_UNIX_Addr &sa); - - /// Creates an ACE_UNIX_Addr from a string. - int set (const char rendezvous_point[]); - - /// Creates an ACE_UNIX_Addr from a sockaddr_un structure. - int set (const sockaddr_un *, int len); - - /// Return a pointer to the underlying network address. - virtual void *get_addr (void) const; - - /// Set a pointer to the underlying network address. - virtual void set_addr (void *addr, int len); - - /// Transform the current address into string format. - virtual int addr_to_string (ACE_TCHAR addr[], size_t) const; - - /// Transform the string into the current addressing format. - virtual int string_to_addr (const char addr[]); - -#if defined (ACE_HAS_WCHAR) - /// Creates an ACE_UNIX_Addr from a string. - ACE_UNIX_Addr (const wchar_t rendezvous_point[]); - - /// Creates an ACE_UNIX_Addr from a string. - int set (const wchar_t rendezvous_point[]); -#endif /* ACE_HAS_WCHAR */ - - /// Compare two addresses for equality. - bool operator == (const ACE_UNIX_Addr &SAP) const; - - /// Compare two addresses for inequality. - bool operator != (const ACE_UNIX_Addr &SAP) const; - - /// Return the path name of the underlying rendezvous point. - const char *get_path_name (void) const; - - /// Computes and returns hash value. - virtual u_long hash (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Underlying socket address. - sockaddr_un unix_addr_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UNIX_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UNIX_ADDR_H */ - diff --git a/dep/include/ace/UNIX_Addr.inl b/dep/include/ace/UNIX_Addr.inl deleted file mode 100644 index 7262f0f4250..00000000000 --- a/dep/include/ace/UNIX_Addr.inl +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- -// -// $Id: UNIX_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/OS_NS_string.h" - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_HAS_WCHAR) -/// Creates an ACE_UNIX_Addr from a string. -ACE_INLINE -ACE_UNIX_Addr::ACE_UNIX_Addr (const wchar_t rendezvous_point[]) -{ - this->set (ACE_Wide_To_Ascii (rendezvous_point).char_rep ()); -} - -/// Creates an ACE_UNIX_Addr from a string. -ACE_INLINE int -ACE_UNIX_Addr::set (const wchar_t rendezvous_point[]) -{ - return this->set (ACE_Wide_To_Ascii (rendezvous_point).char_rep ()); -} -#endif /* ACE_HAS_WCHAR */ - -// Compare two addresses for equality. - -ACE_INLINE bool -ACE_UNIX_Addr::operator == (const ACE_UNIX_Addr &sap) const -{ - return ACE_OS::strncmp (this->unix_addr_.sun_path, - sap.unix_addr_.sun_path, - sizeof this->unix_addr_.sun_path) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE bool -ACE_UNIX_Addr::operator != (const ACE_UNIX_Addr &sap) const -{ - return !((*this) == sap); // This is lazy, of course... ;-) -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const char * -ACE_UNIX_Addr::get_path_name (void) const -{ - return this->unix_addr_.sun_path; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/dep/include/ace/UPIPE_Acceptor.h b/dep/include/ace/UPIPE_Acceptor.h deleted file mode 100644 index c180a16f2fb..00000000000 --- a/dep/include/ace/UPIPE_Acceptor.h +++ /dev/null @@ -1,99 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UPIPE_Acceptor.h - * - * $Id: UPIPE_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UPIPE_ACCEPTOR_H -#define ACE_UPIPE_ACCEPTOR_H -#include /**/ "ace/pre.h" - -#include "ace/UPIPE_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -#include "ace/SPIPE_Acceptor.h" -#include "ace/Thread_Manager.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_UPIPE_Acceptor - * - * @brief Defines the format and interface for the listener side of the - * ACE_UPIPE_Stream. - */ -class ACE_Export ACE_UPIPE_Acceptor : public ACE_SPIPE_Acceptor -{ -public: - // = Initialization and termination. - /// Default constructor. - ACE_UPIPE_Acceptor (void); - - /// Initialize passive endpoint. - ACE_UPIPE_Acceptor (const ACE_UPIPE_Addr &local_sap, - int reuse_addr = 0); - - /// Initialize passive endpoint. - int open (const ACE_UPIPE_Addr &local_sap, - int reuse_addr = 0); - - /// Close down and release resources. - ~ACE_UPIPE_Acceptor (void); - - /// Close down and release resources. - int close (void); - - /// Close down and release resources and remove the underlying SPIPE - /// rendezvous point. - int remove (void); - - // = Passive connection acceptance method. - /** - * Accept a new data transfer connection. A @a timeout of 0 means - * block forever, a @a timeout of {0, 0} means poll. @a restart == 1 - * means "restart if interrupted." - */ - int accept (ACE_UPIPE_Stream &server_stream, - ACE_UPIPE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Manage threads. - ACE_Thread_Manager tm; - - /// To confirm connection establishment. - ACE_Message_Block mb_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UPIPE_Acceptor.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UPIPE_ACCEPTOR_H */ - diff --git a/dep/include/ace/UPIPE_Acceptor.inl b/dep/include/ace/UPIPE_Acceptor.inl deleted file mode 100644 index 9432ad7bb88..00000000000 --- a/dep/include/ace/UPIPE_Acceptor.inl +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -// -// $Id: UPIPE_Acceptor.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_UPIPE_Acceptor::remove (void) -{ - ACE_TRACE ("ACE_UPIPE_Acceptor::remove"); - return this->ACE_SPIPE_Acceptor::remove (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/UPIPE_Addr.h b/dep/include/ace/UPIPE_Addr.h deleted file mode 100644 index ca1db7a67aa..00000000000 --- a/dep/include/ace/UPIPE_Addr.h +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UPIPE_Addr.h - * - * $Id: UPIPE_Addr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_UPIPE_ADDR_H -#define ACE_UPIPE_ADDR_H - -#include /**/ "ace/pre.h" - -#include "ace/SPIPE_Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -typedef ACE_SPIPE_Addr ACE_UPIPE_Addr; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ACE_UPIPE_ADDR_H */ - diff --git a/dep/include/ace/UPIPE_Connector.h b/dep/include/ace/UPIPE_Connector.h deleted file mode 100644 index 69beb1a965b..00000000000 --- a/dep/include/ace/UPIPE_Connector.h +++ /dev/null @@ -1,115 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UPIPE_Connector.h - * - * $Id: UPIPE_Connector.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer and Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UPIPE_CONNECTOR_H -#define ACE_UPIPE_CONNECTOR_H -#include /**/ "ace/pre.h" - -#include "ace/UPIPE_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_UPIPE_Connector - * - * @brief Defines an active connection factory for the - * ACE_UPIPE_STREAM wrappers. - */ -class ACE_Export ACE_UPIPE_Connector -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_UPIPE_Connector (void); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a addr is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * @a local_addr is reused, even if it hasn't been cleanedup yet. - * The @a flags and @a perms arguments are passed down to the open() - * method. - */ - ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, - const ACE_UPIPE_Addr &addr, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a addr is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the maximum amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * @a local_addr is reused, even if it hasn't been cleanedup yet. - * The @a flags and @a perms arguments are passed down to the open() - * method. - */ - int connect (ACE_UPIPE_Stream &new_stream, - const ACE_UPIPE_Addr &addr, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - - /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); - - // = Meta-type info - typedef ACE_UPIPE_Addr PEER_ADDR; - typedef ACE_UPIPE_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UPIPE_Connector.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UPIPE_CONNECTOR_H */ - diff --git a/dep/include/ace/UPIPE_Connector.inl b/dep/include/ace/UPIPE_Connector.inl deleted file mode 100644 index fa43dbea326..00000000000 --- a/dep/include/ace/UPIPE_Connector.inl +++ /dev/null @@ -1,34 +0,0 @@ -// -*- C++ -*- -// -// $Id: UPIPE_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Creates a Local ACE_UPIPE. -ACE_INLINE -ACE_UPIPE_Connector::ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, - const ACE_UPIPE_Addr &addr, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_UPIPE_Connector::ACE_UPIPE_Connector"); - if (this->connect (new_stream, addr, timeout, local_sap, - reuse_addr, flags, perms) == -1 - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("address %s, %p\n"), - addr.get_path_name (), - ACE_TEXT ("ACE_UPIPE_Connector"))); -} - -ACE_INLINE int -ACE_UPIPE_Connector::reset_new_handle (ACE_HANDLE /* handle */) -{ - // Nothing to do here since the handle is not a socket - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/UPIPE_Stream.h b/dep/include/ace/UPIPE_Stream.h deleted file mode 100644 index 89b8d793cf5..00000000000 --- a/dep/include/ace/UPIPE_Stream.h +++ /dev/null @@ -1,140 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UPIPE_Stream.h - * - * $Id: UPIPE_Stream.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Gerhard Lenzer - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UPIPE_STREAM_H -#define ACE_UPIPE_STREAM_H -#include /**/ "ace/pre.h" - -#include "ace/Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -#include "ace/SPIPE.h" -#include "ace/Message_Queue.h" -#include "ace/UPIPE_Addr.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_UPIPE_Stream - * - * @brief Defines the method that transfer data on a UPIPE. - */ -class ACE_Export ACE_UPIPE_Stream : public ACE_SPIPE -{ -public: - friend class ACE_UPIPE_Acceptor; - friend class ACE_UPIPE_Connector; - - typedef ACE_Stream MT_Stream; - - // = Initialization and Termination. - - ACE_UPIPE_Stream (void); - - virtual ~ACE_UPIPE_Stream (void); - - /// Shut down the UPIPE and release resources. - int close (void); - - /// Return the underlying I/O handle. - ACE_HANDLE get_handle (void) const; - - // = Send/recv ACE Message_Blocks. - /// Send a message through the message queue. Returns -1 on error, - /// else 0. - int send (ACE_Message_Block *mb_p, - ACE_Time_Value *timeout = 0); - - /// Recv a message from the message queue. Returns -1 on error, else - /// 0. - int recv (ACE_Message_Block *&mb_p, - ACE_Time_Value *timeout = 0); - - // = Send/recv char buffers. - /// Send a buffer of @a n bytes through the message queue. Returns -1 - /// on error, else number of bytes sent. - ssize_t send (const char *buffer, - size_t n, - ACE_Time_Value *timeout = 0); - - /// Recv a buffer of upto @a n bytes from the message queue. Returns - /// -1 on error, else number of bytes read. - ssize_t recv (char *buffer, - size_t n, - ACE_Time_Value *timeout = 0); - - /// Send a buffer of exactly @a n bytes to the message queue. Returns - /// -1 on error, else number of bytes written (which should == n). - ssize_t send_n (const char *buffer, - size_t n, - ACE_Time_Value *timeout = 0); - - /// Recv a buffer of exactly @a n bytes from the message queue. - /// Returns -1 on error, else the number of bytes read. - ssize_t recv_n (char *buffer, - size_t n, - ACE_Time_Value *timeout = 0); - - /// Perform control operations on the UPIPE_Stream. - int control (int cmd, void *val) const; - - /// Return the remote address we are connected to. - int get_remote_addr (ACE_UPIPE_Addr &remote_sap) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - // = Meta-type info - typedef ACE_UPIPE_Addr PEER_ADDR; - -private: - /// To hold the last ACE_Message_Block read out of the stream. Thus - /// allowing subsequent reads from one ACE_Message_Block - ACE_Message_Block *mb_last_; - - /// Address of who we are connected to. - ACE_UPIPE_Addr remote_addr_; - - /// Stream component used by the @c UPIPE_Acceptor and - /// @c UPIPE_Connector to link together two UPIPE_Streams. - MT_Stream stream_; - - /// Keep track of whether the sender and receiver have both shutdown. - int reference_count_; - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - /// Ensure that we are thread-safe. - ACE_Thread_Mutex lock_; -#endif /* ACE_MT_SAFE */ -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UPIPE_Stream.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_THREADS */ - -#include /**/ "ace/post.h" - -#endif /*ACE_UPIPE_STREAM_H */ - diff --git a/dep/include/ace/UPIPE_Stream.inl b/dep/include/ace/UPIPE_Stream.inl deleted file mode 100644 index 7a0d73c3179..00000000000 --- a/dep/include/ace/UPIPE_Stream.inl +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -// -// $Id: UPIPE_Stream.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_HANDLE -ACE_UPIPE_Stream::get_handle (void) const -{ - ACE_TRACE ("ACE_UPIPE_Stream::get_handle"); - return this->ACE_SPIPE::get_handle (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/UTF16_Encoding_Converter.h b/dep/include/ace/UTF16_Encoding_Converter.h deleted file mode 100644 index 231ce158dfa..00000000000 --- a/dep/include/ace/UTF16_Encoding_Converter.h +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file UTF16_Encoding_Converter.h - * - * $Id: UTF16_Encoding_Converter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class contains declarations for methods that convert between - * UTF-16 (both BE and LE) and UTF-8 - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef ACE_UTF16_ENCODING_CONVERTER_H -#define ACE_UTF16_ENCODING_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include "ace/Encoding_Converter.h" - -#if defined (ACE_USES_WCHAR) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** Convert from UTF-16 to UTF-8 and from UTF-8 to UTF-16. - * This class implements the ACE_Encoding_Converter interface. - */ -class ACE_UTF16_Encoding_Converter: public ACE_Encoding_Converter -{ -public: - /// The swap parameter determines whether we need to swap byte order on - /// the stream as each word is pulled off when converting to UTF-8. - ACE_UTF16_Encoding_Converter (bool swap = false); - - /// This is a do nothing destructor. - virtual ~ACE_UTF16_Encoding_Converter (void); - - /// Convert the source from UTF-16 to UTF-8 and store it in the - /// provided target buffer. - virtual Result to_utf8 (const void* source, - size_t source_size, - ACE_Byte* target, - size_t target_size, - bool strict = true); - - /// Convert the UTF-8 source into a UTF-16 encoding and store it - /// in the provided target buffer. - virtual Result from_utf8 (const ACE_Byte* source, - size_t source_size, - void* target, - size_t target_size, - bool strict = true); - - /// This factory helper method determines if the source stream is UTF-16 - /// encoded. If it is, allocate an ACE_UTF16_Encoding_Converter and - /// return it. The caller then owns the allocated object. - static ACE_UTF16_Encoding_Converter* encoded (const ACE_Byte* source, - size_t source_size); - -protected: - /// Determines if the source buffer is legal UTF-8 - bool is_legal_utf8 (const ACE_Byte* source, - size_t length) const; - - static ACE_UINT32 get_UNI_SUR_HIGH_START (void); - static ACE_UINT32 get_UNI_SUR_LOW_END (void); - static ACE_UINT32 get_UNI_REPLACEMENT_CHAR (void); - static const ACE_Byte* get_first_byte_mark (void); - static const ACE_Byte* get_trailing_bytes_for_utf8 (void); - static const ACE_UINT32* get_offsets_from_utf8 (void); - - bool swap_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UTF16_Encoding_Converter.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_USES_WCHAR */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UTF16_ENCODING_CONVERTER_H */ - diff --git a/dep/include/ace/UTF16_Encoding_Converter.inl b/dep/include/ace/UTF16_Encoding_Converter.inl deleted file mode 100644 index e5292757889..00000000000 --- a/dep/include/ace/UTF16_Encoding_Converter.inl +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- C++ -*- */ -// $Id: UTF16_Encoding_Converter.inl 80826 2008-03-04 14:51:23Z wotte $ - -// ====================================================================== -// -// The actual conversion methods are covered by the copyright information -// below. -// Chad Elliott 4/28/2005 -// -// Copyright 2001-2004 Unicode, Inc. -// -// Limitations on Rights to Redistribute This Code -// -// Unicode, Inc. hereby grants the right to freely use the information -// supplied in this file in the creation of products supporting the -// Unicode Standard, and to make copies of this file in any form -// for internal or external distribution as long as this notice -// remains attached. -// -// ====================================================================== - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE bool -ACE_UTF16_Encoding_Converter::is_legal_utf8 (const ACE_Byte* source, - size_t length) const -{ - ACE_Byte a; - const ACE_Byte* srcptr = source + length; - - switch (length) - { - default: - return false; - - // Everything else falls through when "true"... - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 2: if ((a = (*--srcptr)) > 0xBF) return false; - - switch (*source) - { - // no fall-through in this inner switch - case 0xE0: - if (a < 0xA0) - return false; - break; - case 0xED: - if (a > 0x9F) - return false; - break; - case 0xF0: - if (a < 0x90) - return false; - break; - case 0xF4: - if (a > 0x8F) - return false; - break; - default: - if (a < 0x80) - return false; - } - - case 1: - if (*source >= 0x80 && *source < 0xC2) - return false; - } - - if (*source > 0xF4) - return false; - - return true; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/UTF32_Encoding_Converter.h b/dep/include/ace/UTF32_Encoding_Converter.h deleted file mode 100644 index dc811d7251d..00000000000 --- a/dep/include/ace/UTF32_Encoding_Converter.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file UTF32_Encoding_Converter.h - * - * $Id: UTF32_Encoding_Converter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class contains declarations for methods that convert between - * UTF-32 (both BE and LE) and UTF-8 - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef ACE_UTF32_ENCODING_CONVERTER_H -#define ACE_UTF32_ENCODING_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include "ace/UTF16_Encoding_Converter.h" - -#if defined (ACE_USES_WCHAR) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** Convert from UTF-32 to UTF-8 and from UTF-8 to UTF-32. - * This class implements the ACE_Encoding_Converter interface. - */ -class ACE_UTF32_Encoding_Converter: public ACE_UTF16_Encoding_Converter -{ -public: - /// This class has some similarities to the UTF16 converter, so - /// we just construct our base class and pass the swap parameter. - ACE_UTF32_Encoding_Converter (bool swap = false); - - /// This is a do nothing destructor. - virtual ~ACE_UTF32_Encoding_Converter (void); - - /// Convert the source from UTF-32 to UTF-8 and store it in the - /// provided target buffer. - virtual Result to_utf8 (const void* source, - size_t source_size, - ACE_Byte* target, - size_t target_size, - bool strict = true); - - /// Convert the UTF-8 source into a UTF-32 encoding and store it - /// in the provided target buffer. - virtual Result from_utf8 (const ACE_Byte* source, - size_t source_size, - void* target, - size_t target_size, - bool strict = true); - - /// This factory helper method determines if the source stream is UTF-32 - /// encoded. If it is, allocate an ACE_UTF32_Encoding_Converter and - /// return it. The caller then owns the allocated object. - static ACE_UTF32_Encoding_Converter* encoded (const ACE_Byte* source, - size_t source_size); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UTF32_ENCODING_CONVERTER_H */ - diff --git a/dep/include/ace/UTF8_Encoding_Converter.h b/dep/include/ace/UTF8_Encoding_Converter.h deleted file mode 100644 index a38cffbc0ff..00000000000 --- a/dep/include/ace/UTF8_Encoding_Converter.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -//========================================================================= -/** - * @file UTF8_Encoding_Converter.h - * - * $Id: UTF8_Encoding_Converter.h 80826 2008-03-04 14:51:23Z wotte $ - * - * This class contains declarations for methods that convert between - * UTF-8 and the native ACE_TCHAR representation. - * - * @author Chad Elliott - */ -//========================================================================= - -#ifndef ACE_UTF8_ENCODING_CONVERTER_H -#define ACE_UTF8_ENCODING_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include "ace/Encoding_Converter.h" - -#if defined (ACE_USES_WCHAR) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** Convert from UTF-16 or UTF-32 to UTF-8. - * This class implements the ACE_Encoding_Converter interface. - */ -class ACE_UTF8_Encoding_Converter: public ACE_Encoding_Converter -{ -public: - /// Allocate the converter to be used by the from_utf8() method based - /// on the size of the native wide character. - ACE_UTF8_Encoding_Converter (void); - - /// De-allocate the native converter. - virtual ~ACE_UTF8_Encoding_Converter (void); - - /// Since the source *must be* UTF-8, there is no conversion required. - /// This method just copies the source to the target given that there - /// is enough space. - virtual Result to_utf8 (const void* source, - size_t source_size, - ACE_Byte* target, - size_t target_size, - bool strict = true); - - /// Utilize the native converter to convert the UTF-8 source into an - /// alternate encoding and store it in the provided target buffer. - virtual Result from_utf8 (const ACE_Byte* source, - size_t source_size, - void* target, - size_t target_size, - bool strict = true); - - /// This factory helper method determines if the source stream is UTF-8 - /// encoded. If it is, allocate an ACE_UTF8_Encoding_Converter and - /// return it. The caller then owns the allocated object. - static ACE_UTF8_Encoding_Converter* encoded (const ACE_Byte* source, - size_t source_size); - -private: - ACE_Encoding_Converter* native_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - -#include /**/ "ace/post.h" - -#endif /* ACE_UTF8_ENCODING_CONVERTER_H */ - diff --git a/dep/include/ace/UUID.h b/dep/include/ace/UUID.h deleted file mode 100644 index f2dceff3e51..00000000000 --- a/dep/include/ace/UUID.h +++ /dev/null @@ -1,240 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UUID.h - * - * $Id: UUID.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Andrew T. Finnel - * @author Yamuna Krishnmaurthy - */ -//============================================================================= - -#ifndef ACE_UUID_H -#define ACE_UUID_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" -#include "ace/Singleton.h" -#include "ace/Synch_Traits.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE_Utils -{ - /// Class to hold a MAC address - class ACE_Export UUID_Node - { - public: - - /// Constructor - UUID_Node (void); - - enum {NODE_ID_SIZE = 6}; - typedef u_char Node_ID[NODE_ID_SIZE]; - - Node_ID &node_ID (void); - void node_ID (Node_ID&); - - ///// Equality Operations - bool operator == (const UUID_Node& right) const; - bool operator != (const UUID_Node& right) const; - - ///// Relational Operations - //bool operator < (const UUID_Node& right) const; - - private: - Node_ID node_ID_; - }; - - /** - * @class ACE_UUID - * - * ACE_UUID represents a Universally Unique IDentifier (UUID) as - * described in (the expired) INTERNET-DRAFT specification entitled - * UUIDs and GUIDs. All instances of UUID are of the time-based - * variety. That is, the version number part of the timeHiAndVersion - * field is 1. - * - * The default constructor creates a nil UUID. - * - * UUIDs have value semantics. In addition, they may be compared for - * ordering and equality. - * - * Additionally in this implementation provisions have been made to include - * process and thread ids to make the UUIDs more unique. The variant 0xc0 - * has been added to facilitate this. - */ - class ACE_Export UUID - { - public: - - /// Constructor - UUID (void); - - /// Constructs a UUID from a string representation. - UUID (const ACE_CString& uuidString); - - UUID (const UUID &right); - - // Destructor - ~UUID (void); - - ACE_UINT32 time_low (void) const; - void time_low (ACE_UINT32); - - ACE_UINT16 time_mid (void) const; - void time_mid (ACE_UINT16); - - ACE_UINT16 time_hi_and_version (void) const; - void time_hi_and_version (ACE_UINT16); - - u_char clock_seq_hi_and_reserved (void) const; - void clock_seq_hi_and_reserved (u_char); - - u_char clock_seq_low (void) const; - void clock_seq_low (u_char); - - UUID_Node* node (void) const; - void node (UUID_Node*); - - ACE_CString* thr_id (void); - void thr_id (char*); - - ACE_CString* pid (void); - void pid (char*); - - /// Returns a string representation of the UUID - const ACE_CString* to_string (void); - - /// Set the value using a string - void from_string (const ACE_CString& uuid_string); - - static UUID NIL_UUID; - - /// Equality Operations - bool operator== (const UUID &right) const; - bool operator!= (const UUID &right) const; - - /// Relational Operations - //bool operator< (const UUID &right) const; - //bool operator> (const UUID &right) const; - //bool operator<= (const UUID &right) const; - //bool operator>= (const UUID &right) const; - - private: - void from_string_i (const ACE_CString& uuid_string); - - UUID& operator= (const UUID&); - - /// Data Members for Class Attributes - ACE_UINT32 time_low_; - ACE_UINT16 time_mid_; - ACE_UINT16 time_hi_and_version_; - u_char clock_seq_hi_and_reserved_; - u_char clock_seq_low_; - UUID_Node* node_; - bool node_release_; - ACE_CString thr_id_; - ACE_CString pid_; - - /// The string representation of the UUID. This is created and - /// updated only on demand. - ACE_CString *as_string_; - }; - - /** - * @class ACE_UUID_Generator - * - * Singleton class that generates UUIDs. - * - */ - class ACE_Export UUID_Generator - { - public: - - enum {ACE_UUID_CLOCK_SEQ_MASK = 0x3FFF}; - - UUID_Generator(); - ~UUID_Generator(); - - void init (void); - - /// Format timestamp, clockseq, and nodeID into an UUID of the - /// specified version and variant. For generating UUID's with - /// thread and process ids use variant=0xc0 - void generate_UUID (UUID&, ACE_UINT16 version=0x0001, u_char variant=0x80); - - /// Format timestamp, clockseq, and nodeID into a VI UUID. For - /// generating UUID's with thread and process ids use variant=0xc0 - UUID* generate_UUID (ACE_UINT16 version=0x0001, u_char variant=0x80); - - /// Type to represent UTC as a count of 100 nanosecond intervals - /// since 00:00:00.00, 15 October 1582. - typedef ACE_UINT64 UUID_Time; - - /// The locking strategy prevents multiple generators from accessing - /// the UUID_state at the same time. Get the locking strategy. - ACE_SYNCH_MUTEX* lock (void); - - /// Set a new locking strategy and return the old one. - void lock (ACE_SYNCH_MUTEX* lock, - bool release_lock); - - private: - - /// The system time when that last uuid was generated. - UUID_Time time_last_; - - /// Type to contain the UUID generator persistent state. This will - /// be kept in memory mapped shared memory - struct UUID_State - { - UUID_Time timestamp; - UUID_Node node; - ACE_UINT16 clock_sequence; - }; - - /// Obtain a UUID timestamp. Compensate for the fact that the time - /// obtained from getSystem time has a resolution less than 100ns. - void get_timestamp (UUID_Time& timestamp); - - /// Obtain a UUID timestamp and clock sequence. Compensate for the - /// fact that the time obtained from getSystem time has a - /// resolution less than 100ns. - void get_timestamp_and_clocksequence (UUID_Time& timestamp, - ACE_UINT16& clockSequence); - - /// Obtain the system time in UTC as a count of 100 nanosecond intervals - /// since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to - /// the Christian calendar). - void get_systemtime( UUID_Time& timeNow); - - /// The UUID generator persistent state. - UUID_State uuid_state_; - - ACE_SYNCH_MUTEX* lock_; - bool destroy_lock_; - }; - - typedef ACE_Singleton UUID_GENERATOR; - -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/UUID.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif // ACE_UUID_H - - diff --git a/dep/include/ace/UUID.inl b/dep/include/ace/UUID.inl deleted file mode 100644 index a60fb6ce17f..00000000000 --- a/dep/include/ace/UUID.inl +++ /dev/null @@ -1,200 +0,0 @@ -// -*- C++ -*- -// -//$Id: UUID.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE_Utils -{ - - /// Data Members for Class Attributes - ACE_INLINE ACE_UINT32 - UUID::time_low (void) const - { - return this->time_low_; - } - - ACE_INLINE void - UUID::time_low (ACE_UINT32 timelow) - { - this->time_low_ = timelow; - } - - ACE_INLINE ACE_UINT16 - UUID::time_mid (void) const - { - return this->time_mid_; - } - - ACE_INLINE void - UUID::time_mid (ACE_UINT16 time_mid) - { - this->time_mid_ = time_mid; - } - - ACE_INLINE ACE_UINT16 - UUID::time_hi_and_version (void) const - { - return this->time_hi_and_version_; - } - - ACE_INLINE void - UUID::time_hi_and_version (ACE_UINT16 time_hi_and_version) - { - this->time_hi_and_version_ = time_hi_and_version; - } - - ACE_INLINE u_char - UUID::clock_seq_hi_and_reserved (void) const - { - return this->clock_seq_hi_and_reserved_; - } - - ACE_INLINE void - UUID::clock_seq_hi_and_reserved (u_char clock_seq_hi_and_reserved) - { - this->clock_seq_hi_and_reserved_ = clock_seq_hi_and_reserved; - } - - ACE_INLINE u_char - UUID::clock_seq_low (void) const - { - return this->clock_seq_low_; - } - - ACE_INLINE void - UUID::clock_seq_low (u_char clock_seq_low) - { - this->clock_seq_low_ = clock_seq_low; - } - - ACE_INLINE UUID_Node* - UUID::node (void) const - { - return this->node_; - } - - ACE_INLINE void - UUID::node (UUID_Node* node) - { - if (node_release_) - delete node_; - - this->node_ = node; - node_release_ = false; - } - - ACE_INLINE ACE_CString* - UUID::thr_id (void) - { - return &this->thr_id_; - } - - ACE_INLINE void - UUID::thr_id (char* thr_id) - { - this->thr_id_ = thr_id; - } - - ACE_INLINE ACE_CString* - UUID::pid (void) - { - return &this->pid_; - } - - ACE_INLINE void - UUID::pid (char* pid) - { - this->pid_ = pid; - } - - ACE_INLINE void - UUID::from_string (const ACE_CString& uuidString) - { - this->from_string_i (uuidString); - } - - ACE_INLINE bool - UUID::operator == (const UUID &right) const - { - if ((this->time_low_ != right.time_low ()) || - (this->time_mid_ != right.time_mid ()) || - (this->time_hi_and_version_ != right.time_hi_and_version ()) || - (this->clock_seq_hi_and_reserved_ != right.clock_seq_hi_and_reserved ()) || - (this->clock_seq_low_ != right.clock_seq_low ()) || - (*this->node_ != *right.node ())) - return false; - - return true; - } - - ACE_INLINE bool - UUID::operator != (const UUID &right) const - { - return !(*this == right); - } - -// ACE_INLINE bool -//UUID::operator < (const UUID &rt) const -// { -// UUID right (rt); -// if ((timeLow_ < right.timeLow ()) || -// (timeMid_ < right.timeMid ()) || -// (timeHiAndVersion_ < right.timeHiAndVersion ()) || -// (clockSeqHiAndReserved_ < right.clockSeqHiAndReserved ()) || -// (clockSeqLow_ < right.clockSeqLow ()) || -// (node_ < right.node ())) -// { -// return true; -// } -// -// return false; -// } -// -// ACE_INLINE bool -// UUID::operator > (const UUID &right) const -// { -// return right < *this; -// } -// -// ACE_INLINE bool -// UUID::operator <= (const UUID &right) const -// { -// return !(*this > right); -// } -// -// ACE_INLINE bool -// UUID::operator >= (const UUID &right) const -// { -// return !(*this < right); -// } -// - ACE_INLINE bool - UUID_Node::operator == (const UUID_Node& rt) const - { - for (size_t i = 0; i < NODE_ID_SIZE; ++i) - if (node_ID_ [i] != rt.node_ID_ [i]) - return false; - - return true; - } - - ACE_INLINE bool - UUID_Node::operator != (const UUID_Node& right) const - { - return !(*this == right); - } - -// ACE_INLINE bool -// UUID_node::operator < (const UUID_node& rt) const -// { -// UUID_node right = rt; -// for (size_t i = 0; i < NODE_ID_SIZE; ++i) -// if (nodeID_ [i] < right.nodeID ()[i]) -// return true; -// -// return false; -// } -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Unbounded_Queue.h b/dep/include/ace/Unbounded_Queue.h deleted file mode 100644 index 0c16ac23388..00000000000 --- a/dep/include/ace/Unbounded_Queue.h +++ /dev/null @@ -1,298 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Unbounded_Queue.h - * - * $Id: Unbounded_Queue.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UNBOUNDED_QUEUE_H -#define ACE_UNBOUNDED_QUEUE_H -#include /**/ "ace/pre.h" - -#include "ace/Node.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Allocator; - -template -class ACE_Unbounded_Queue; - -/** - * @class ACE_Unbounded_Queue_Iterator - * - * @brief Implement an iterator over an unbounded queue. - */ -template -class ACE_Unbounded_Queue_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Queue_Iterator (ACE_Unbounded_Queue &q, int end = 0); - - // = Iteration methods. - - /// Pass back the @a next_item that hasn't been seen in the queue. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the queue have been seen, else 1. - int advance (void); - - /// Move to the first element in the queue. Returns 0 if the - /// queue is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the queue we're iterating over. - ACE_Unbounded_Queue &queue_; -}; - -/** - * @class ACE_Unbounded_Queue_Const_Iterator - * - * @brief Implement an iterator over an const unbounded queue. - */ -template -class ACE_Unbounded_Queue_Const_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Queue_Const_Iterator (const ACE_Unbounded_Queue &q, int end = 0); - - // = Iteration methods. - - /// Pass back the @a next_item that hasn't been seen in the queue. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the queue have been seen, else 1. - int advance (void); - - /// Move to the first element in the queue. Returns 0 if the - /// queue is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the queue we're iterating over. - const ACE_Unbounded_Queue &queue_; -}; - -/** - * @class ACE_Unbounded_Queue - * - * @brief A Queue of "infinite" length. - * - * This implementation of an unbounded queue uses a circular - * linked list with a dummy node. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Circular linked list - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * N/A - * - Insert/replace speed - * N/A - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * - */ -template -class ACE_Unbounded_Queue -{ -public: - friend class ACE_Unbounded_Queue_Iterator; - friend class ACE_Unbounded_Queue_Const_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Queue_Iterator ITERATOR; - typedef ACE_Unbounded_Queue_Const_Iterator CONST_ITERATOR; - - // = Initialization and termination methods. - /// Construction. Use user specified allocation strategy - /// if specified. - /** - * Initialize an empty queue using the strategy provided. - */ - ACE_Unbounded_Queue (ACE_Allocator *alloc = 0); - - /// Copy constructor. - /** - * Initialize the queue to be a copy of the provided queue. - */ - ACE_Unbounded_Queue (const ACE_Unbounded_Queue &); - - /// Assignment operator. - /** - * Perform a deep copy of rhs. - */ - void operator= (const ACE_Unbounded_Queue &); - - /// Destructor. - /** - * Clean up the memory for the queue. - */ - ~ACE_Unbounded_Queue (void); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Constant time check to see if the queue is empty. - */ - int is_empty (void) const; - - /// Returns 0. - /** - * The queue cannot be full, so it always returns 0. - */ - int is_full (void) const; - - // = Classic queue operations. - - /// Adds @a new_item to the tail of the queue. Returns 0 on success, - /// -1 on failure. - /** - * Insert an item at the end of the queue. - */ - int enqueue_tail (const T &new_item); - - /// Adds @a new_item to the head of the queue. Returns 0 on success, - /// -1 on failure. - /** - * Insert an item at the head of the queue. - */ - int enqueue_head (const T &new_item); - - /// Removes and returns the first @a item on the queue. Returns 0 on - /// success, -1 if the queue was empty. - /** - * Remove an item from the head of the queue. - */ - int dequeue_head (T &item); - - // = Additional utility methods. - - /// Reset the ACE_Unbounded_Queue to be empty and release all its - /// dynamically allocated resources. - /** - * Delete the queue nodes. - */ - void reset (void); - - /// Get the @a slot th element in the set. Returns -1 if the element - /// isn't in the range {0..#cur_size_ - 1}, else 0. - /** - * Find the item in the queue between 0 and the provided index of the - * queue. - */ - int get (T *&item, size_t slot = 0) const; - - /// Set the @a slot th element of the queue to @a item. - /** - * Set the @a slot th element in the set. Will pad out the set with - * empty nodes if @a slot is beyond the range {0..#cur_size_ - 1}. - * Returns -1 on failure, 0 if @a slot isn't initially in range, and - * 0 otherwise. - */ - int set (const T &item, size_t slot); - - /// The number of items in the queue. - /** - * Return the size of the queue. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // = STL-styled unidirectional iterator factory. - ACE_Unbounded_Queue_Iterator begin (void); - ACE_Unbounded_Queue_Iterator end (void); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - /// Delete all the nodes in the queue. - void delete_nodes (void); - - /// Copy nodes into this queue. - void copy_nodes (const ACE_Unbounded_Queue &); - - /// Pointer to the dummy node in the circular linked Queue. - ACE_Node *head_; - - /// Current size of the queue. - size_t cur_size_; - - /// Allocation Strategy of the queue. - ACE_Allocator *allocator_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Unbounded_Queue.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Unbounded_Queue.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Unbounded_Queue.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_UNBOUNDED_QUEUE_H */ - diff --git a/dep/include/ace/Unbounded_Queue.inl b/dep/include/ace/Unbounded_Queue.inl deleted file mode 100644 index 0758412b984..00000000000 --- a/dep/include/ace/Unbounded_Queue.inl +++ /dev/null @@ -1,27 +0,0 @@ -// -*- C++ -*- -// -// $Id: Unbounded_Queue.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE size_t -ACE_Unbounded_Queue::size (void) const -{ - return this->cur_size_; -} - -template ACE_INLINE int -ACE_Unbounded_Queue::is_empty (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Queue::is_full (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::is_full"); - return 0; // We should implement a "node of last resort for this..." -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Unbounded_Set.h b/dep/include/ace/Unbounded_Set.h deleted file mode 100644 index 44fb84068ee..00000000000 --- a/dep/include/ace/Unbounded_Set.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Unbounded_Set.h - * - * $Id: Unbounded_Set.h 81642 2008-05-07 19:30:35Z shuston $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UNBOUNDED_SET_H -#define ACE_UNBOUNDED_SET_H -#include /**/ "ace/pre.h" - -#include "ace/Unbounded_Set_Ex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Allocator; - -/** - * @struct ACE_Unbounded_Set_Default_Comparator - * @brief Simple comparator that evaluates equality using == operator. - */ -template -struct ACE_Unbounded_Set_Default_Comparator -{ - bool operator() (const T&lhs, const T&rhs) const; -}; - -template -class ACE_Unbounded_Set; - -/** - * @class ACE_Unbounded_Set_Iterator - * @brief Compatibility wrapper for ACE_Unbounded_Set_Ex_Iterator. - */ -template -class ACE_Unbounded_Set_Iterator : public - ACE_Unbounded_Set_Ex_Iterator > -{ -public: - typedef ACE_Unbounded_Set_Ex_Iterator > base_type; - - // = Initialization method. - ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, bool end = false); - - ACE_Unbounded_Set_Iterator (const base_type &s); -}; - -/** - * @class ACE_Unbounded_Set_Const_Iterator - * @brief Compatibility wrapper for ACE_Unbounded_Set_Ex_Const_Iterator. - */ -template -class ACE_Unbounded_Set_Const_Iterator : public - ACE_Unbounded_Set_Ex_Const_Iterator > -{ -public: - - typedef ACE_Unbounded_Set_Ex_Const_Iterator > base_type; - - // = Initialization method. - ACE_Unbounded_Set_Const_Iterator (const ACE_Unbounded_Set &s, - bool end = false); - - ACE_Unbounded_Set_Const_Iterator (const base_type &s); -}; - -/** - * @class ACE_Unbounded_Set - * @brief Compatibility wrapper for ACE_Unbounded_Set_Ex. - */ -template -class ACE_Unbounded_Set : public - ACE_Unbounded_Set_Ex > -{ -public: - ACE_Unbounded_Set (ACE_Allocator *alloc = 0); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Unbounded_Set.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Unbounded_Set.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Unbounded_Set.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_UNBOUNDED_SET_H */ - diff --git a/dep/include/ace/Unbounded_Set.inl b/dep/include/ace/Unbounded_Set.inl deleted file mode 100644 index 36190c6638c..00000000000 --- a/dep/include/ace/Unbounded_Set.inl +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id: Unbounded_Set.inl 81642 2008-05-07 19:30:35Z shuston $ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE bool -ACE_Unbounded_Set_Default_Comparator::operator () (const T &lhs, const T &rhs) const -{ - return lhs == rhs; -} - -template -ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, - bool end) - : base_type (s, end) -{ -} - -template -ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator (const base_type & s) - : base_type (s) -{ -} - -template -ACE_Unbounded_Set_Const_Iterator:: -ACE_Unbounded_Set_Const_Iterator (const ACE_Unbounded_Set &s, - bool end) - : base_type (s, end) -{ -} - -template -ACE_Unbounded_Set_Const_Iterator::ACE_Unbounded_Set_Const_Iterator (const base_type & s) - : base_type (s) -{ -} - -template -ACE_Unbounded_Set::ACE_Unbounded_Set (ACE_Allocator *alloc) - : ACE_Unbounded_Set_Ex > (alloc) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Unbounded_Set_Ex.h b/dep/include/ace/Unbounded_Set_Ex.h deleted file mode 100644 index ab16a54be86..00000000000 --- a/dep/include/ace/Unbounded_Set_Ex.h +++ /dev/null @@ -1,348 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Unbounded_Set_Ex.h - * - * $Id: Unbounded_Set_Ex.h 81624 2008-05-06 17:14:57Z wotte $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - -#ifndef ACE_UNBOUNDED_SET_EX_H -#define ACE_UNBOUNDED_SET_EX_H -#include /**/ "ace/pre.h" - -#include "ace/Node.h" -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -class ACE_Allocator; - -template -class ACE_Unbounded_Set_Ex_Iterator; - -template -class ACE_Unbounded_Set_Ex_Const_Iterator; - -template -class ACE_Unbounded_Set_Ex; - -/** - * @class ACE_Unbounded_Set_Ex_Iterator - * - * @brief Implement an iterator over an unbounded set. - */ -template -class ACE_Unbounded_Set_Ex_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Set_Ex_Iterator (ACE_Unbounded_Set_Ex &s, bool end = false); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Postfix advance. - ACE_Unbounded_Set_Ex_Iterator operator++ (int); - - /// Prefix advance. - ACE_Unbounded_Set_Ex_Iterator& operator++ (void); - - /// Returns a reference to the internal element @c this is pointing to. - T& operator* (void); - - /// Check if two iterators point to the same position - bool operator== (const ACE_Unbounded_Set_Ex_Iterator &) const; - bool operator!= (const ACE_Unbounded_Set_Ex_Iterator &) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the set we're iterating over. - ACE_Unbounded_Set_Ex *set_; -}; - -/** - * @class ACE_Unbounded_Set_Ex_Const_Iterator - * - * @brief Implement an const iterator over an unbounded set. - */ -template -class ACE_Unbounded_Set_Ex_Const_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex &s, - bool end = false); - - // = Iteration methods. - - /// Pass back the @a next_item that hasn't been seen in the Set. - /// @return Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Postfix advance. - ACE_Unbounded_Set_Ex_Const_Iterator operator++ (int); - - /// Prefix advance. - ACE_Unbounded_Set_Ex_Const_Iterator& operator++ (void); - - /// Returns a reference to the internal element @c this is pointing to. - T& operator* (void); - - /// Check if two iterators point to the same position - bool operator== (const ACE_Unbounded_Set_Ex_Const_Iterator &) const; - bool operator!= (const ACE_Unbounded_Set_Ex_Const_Iterator &) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the set we're iterating over. - const ACE_Unbounded_Set_Ex *set_; -}; - -/** - * @class ACE_Unbounded_Set_Ex - * - * @brief Implement a simple unordered set of of unbounded size. - * - * This implementation of an unordered set uses a circular - * linked list with a dummy node. This implementation does not - * allow duplicates, but it maintains FIFO ordering of insertions. - * - * This implementation may also be parameterized with a comparator - * functor, which must implement bool operator () (const T&, const T&) const, - * returning true if the given items are equivalent. The default comparator - * is sufficient for objects reliably compared with operator==. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Circular linked list - * - Duplicates allowed? - * No - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== const - * - */ -template -class ACE_Unbounded_Set_Ex -{ -public: - friend class ACE_Unbounded_Set_Ex_Iterator; - friend class ACE_Unbounded_Set_Ex_Const_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Set_Ex_Iterator ITERATOR; - typedef ACE_Unbounded_Set_Ex_Iterator iterator; - typedef ACE_Unbounded_Set_Ex_Const_Iterator CONST_ITERATOR; - typedef ACE_Unbounded_Set_Ex_Const_Iterator const_iterator; - typedef C COMP; - typedef ACE_Node NODE; - - // = Initialization and termination methods. - /// Constructor. Use user specified allocation strategy - /// if specified. - /** - * Initialize an empty set using the allocation strategy of the user if - * provided. - */ - ACE_Unbounded_Set_Ex (ACE_Allocator *alloc = 0); - - /** - * Initialize an empty set using the allocation strategy of the user if - * provided, and a given comparator functor. - */ - ACE_Unbounded_Set_Ex (const C &comparator, ACE_Allocator *alloc = 0); - - /// Copy constructor. - /** - * Initialize this set to be an exact copy of the set provided. - */ - ACE_Unbounded_Set_Ex (const ACE_Unbounded_Set_Ex &); - - /// Assignment operator. - /** - * Perform a deep copy of the rhs into the lhs. - */ - ACE_Unbounded_Set_Ex & operator= (const ACE_Unbounded_Set_Ex &); - - /// Destructor. - /** - * Destroy the nodes of the set. - */ - ~ACE_Unbounded_Set_Ex (void); - - // = Check boundary conditions. - - /// Returns @c true if the container is empty, otherwise returns @c false. - /** - * Constant time is_empty check. - */ - bool is_empty (void) const; - - /// Returns @c false. - /** - * Always returns @c false since the set can never fill up. - */ - bool is_full (void) const; - - // = Classic unordered set operations. - - /// Linear insertion of an item. - /** - * Insert @a new_item into the set (doesn't allow duplicates). - * Returns -1 if failures occur, 1 if item is already present, else - * 0. - */ - int insert (const T &new_item); - - /// Insert @a item at the tail of the set (doesn't check for - /// duplicates). - /** - * Constant time insert at the end of the set. - */ - int insert_tail (const T &item); - - /// Linear remove operation. - /** - * Remove first occurrence of @a item from the set. Returns 0 if - * it removes the item, -1 if it can't find the item, and -1 if a - * failure occurs. - */ - int remove (const T &item); - - /// Finds if @a item occurs in the set. Returns 0 if find succeeds, - /// else -1. - /** - * Performs a linear find operation. - */ - int find (const T &item) const; - - /// Size of the set. - /** - * Access the size of the set. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Reset the ACE_Unbounded_Set_Ex to be empty. - /** - * Delete the nodes of the set. - */ - void reset (void); - - // = STL-styled unidirectional iterator factory. - iterator begin (void); - iterator end (void); - const_iterator begin (void) const; - const_iterator end (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Delete all the nodes in the Set. - void delete_nodes (void); - - /// Copy nodes into this set. - void copy_nodes (const ACE_Unbounded_Set_Ex &); - - /// Head of the linked list of Nodes. - NODE *head_; - - /// Current size of the set. - size_t cur_size_; - - /// Allocation strategy of the set. - ACE_Allocator *allocator_; - - /// Comparator to be used - COMP comp_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Unbounded_Set_Ex.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Unbounded_Set_Ex.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Unbounded_Set_Ex.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_UNBOUNDED_SET_H */ - diff --git a/dep/include/ace/Unbounded_Set_Ex.inl b/dep/include/ace/Unbounded_Set_Ex.inl deleted file mode 100644 index 356a1f58f1d..00000000000 --- a/dep/include/ace/Unbounded_Set_Ex.inl +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- -// -// $Id: Unbounded_Set_Ex.inl 81624 2008-05-06 17:14:57Z wotte $ - -#include "ace/Global_Macros.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE bool -ACE_Unbounded_Set_Ex::is_empty (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE bool -ACE_Unbounded_Set_Ex::is_full (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::is_full"); - return 0; // We should implement a "node of last resort for this..." -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Value_Ptr.h b/dep/include/ace/Value_Ptr.h deleted file mode 100644 index f42beba0c99..00000000000 --- a/dep/include/ace/Value_Ptr.h +++ /dev/null @@ -1,168 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Value_Ptr.h - * - * $Id: Value_Ptr.h 80826 2008-03-04 14:51:23Z wotte $ - * - * Value_Ptr implementation based on code in Herb Sutter's book "More - * Exceptional C++". - * - * @author Ossama Othman - */ -//========================================================================== - -#ifndef ACE_VALUE_PTR_H -#define ACE_VALUE_PTR_H - -#include "ace/config-lite.h" - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE -{ - /** - * @struct VP_traits - * - * @brief @c Value_Ptr traits template structure. - * - * The @c Value_Ptr template class delegates some operations to this - * template traits structure. - * - * Specialize this trait template if cloning through copy - * construction is not sufficient. For example, to avoid slicing - * when copying an object through a base class pointer, one can - * implement a virtual "clone" method that can be used to - * polymorphically invoke the appropriate cloning operation(s). - * That virtual method would then be invoked by the @c VP_traits\<\> - * specialization. - */ - template - struct VP_traits - { - /// Copy the given object. - static T * clone (T const * p) { return new T (*p); } - }; - - /** - * @class Value_Ptr - * - * @brief Smart pointer implementation designed for use as a class - * member. - * - * Using a @c std::auto_ptr\<\> as a class member is sometimes - * problematic since ownership of memory is transferred when copying - * such members. This @c Value_Ptr class is explicitly designed to - * avoid such problems by performing copies of the underlying object - * rather than transfer ownership. This, for example, allows it to - * be readily used as a member in classes placed inside STL - * containers. - * - * @see Item 31 in "More Exceptional C++" by Herb Sutter. - */ - template - class Value_Ptr - { - public: - - /// Constructor. - explicit Value_Ptr (T * p = 0) : p_ (p) { } - - /// Destructor. - ~Value_Ptr (void) { delete this->p_; } - - /// Deference operator. - T & operator* (void) const { return *this->p_; } - - /// Pointer operator. - T * operator-> (void) const { return this->p_; } - - /// Non-throwing swap operation used to make assignment strongly - /// exception-safe. - /** - * @note As implemented, the swap operation may not work correctly - * for @c auto_ptr\<\>s, but why would one use an @c - * auto_ptr\<\> as the template argument for this particular - * template class!? - */ - void swap (Value_Ptr & other) { std::swap (this->p_, other.p_); } - - /// Copy constructor. - Value_Ptr (Value_Ptr const & other) - : p_ (create_from (other.p_)) { } - - /// Assignment operator. - Value_Ptr & operator= (Value_Ptr const & other) - { - // Strongly exception-safe. - Value_Ptr temp (other); - this->swap (temp); - return *this; - } - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - - // Compiler can't handle member templates so we lose converting - // copy operations. - - /// Converting copy constructor. - template - Value_Ptr (Value_Ptr const & other) - : p_ (create_from (other.p_)) { } - - /// Converting assignment operator. - template - Value_Ptr & operator= (Value_Ptr const & other) - { - // Strongly exception-safe. - Value_Ptr temp (other); - this->swap (temp); - return *this; - } - -#endif /* !ACE_LACKS_MEMBER_TEMPLATES */ - - private: - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - - /// Copying method invoked when copy constructing. - template - T * create_from (U const * p) const - { - return p ? VP_traits::clone (p) : 0; - } - -#else - - // Compiler can't handle member templates so we lose converting - // copy operations. - - /// Copying method invoked when copy constructing. - T * create_from (T const * p) const - { - return p ? VP_traits::clone (p) : 0; - } - -#endif /* !ACE_LACKS_MEMBER_TEMPLATES */ - - private: - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - template friend class Value_Ptr; -#endif /* !ACE_LACKS_MEMBER_TEMPLATES */ - - /// Object owned by this @c Value_Ptr. - T * p_; - - }; - -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_VALUE_PTR_H */ - diff --git a/dep/include/ace/Vector_T.h b/dep/include/ace/Vector_T.h deleted file mode 100644 index c8c6a5112ac..00000000000 --- a/dep/include/ace/Vector_T.h +++ /dev/null @@ -1,316 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file Vector_T.h - * - * $Id: Vector_T.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Craig L. Ching - * @author Gonzalo Diethelm - */ -//========================================================================== - -#ifndef ACE_VECTOR_T_H -#define ACE_VECTOR_T_H - -#include /**/ "ace/pre.h" - -#include "ace/Array.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/* - * Default size for an ACE_Vector. - */ -static const size_t ACE_VECTOR_DEFAULT_SIZE = 32; - -// Forward declaration. -template class ACE_Vector_Iterator; - -/** - * @class ACE_Vector - * - * @brief Defines an STL-like vector container. - * - * This is an STL-like template vector container, a wrapper around - * ACE_Array. It provides at least the basic std::vector look and - * feel: push_back(), clear(), resize(), capacity(). This template - * class uses the copy semantic paradigm, though it is okay to use - * reference counted smart pointers (see ACE_Ptr<T>) with this - * template class. - * - * Requirements and Performance Characteristics - * - Internal Structure - * ACE_Array - * - Duplicates allowed? - * Yes - * - Random access allowed? - * No - * - Search speed - * N/A - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * No - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - */ -template -class ACE_Vector : public ACE_Array -{ -public: - /** - * A short name for iterator for ACE_Vector. - */ - typedef ACE_Vector_Iterator Iterator; - - /** - * General constructor. - * - * @param init_size Initial size of the vector with the default - * value of DEFAULT_SIZE - * @param alloc Pointer to an ACE allocator. If it is NULL then the - * default ACE allocator is used - */ - ACE_Vector (const size_t init_size = DEFAULT_SIZE, - ACE_Allocator* alloc = 0); - - /** - * Destructor. - */ - ~ACE_Vector (); - - /** - * Returns the current vector capacity, that is, the currently - * allocated buffer size. - * - * @return Current buffer size of the vector - */ - size_t capacity (void) const; - - /** - * Returns the vector's dynamic size / actual current size of the - * vector. Do not confuse it with ACE_Array::size(), which returns - * the array's capacity. Unfortunately, ACE is not very consistent - * with the function names. - * - * @return Dynamic size / actual current size of the vector. - */ - size_t size (void) const; - - /** - * Clears out the vector. It does not reallocate the vector's - * buffer, it is just sets the vector's dynamic size to 0. - */ - void clear (void); - - /** - * Resizes the vector to the new capacity. If the vector's current - * capacity is smaller than the size to be specified, then the - * buffer gets reallocated. If the new capacity is less than the - * current capacity of the vector, the buffer size stays the same. - * - * @param new_size New capacity of the vector - * @param t A filler value (of the class T) for initializing the - * elements of the vector with. By default, if this - * parameter is not specified, the default value of the - * class T will be used (for more detail, see the - * initialization clause for this parameter). - */ - void resize (const size_t new_size, - const T& t); - - /** - * Appends a new element to the vector ("push back"). If the - * dynamic size of the vector is equal to the capacity of the vector - * (vector is at capacity), the vector automatically doubles its - * capacity. - * - * @param elem A reference to the new element to be appended. By - * default, this parameters gets initialized with the - * default value of the class T. - */ - void push_back (const T& elem); - - /** - * Deletes the last element from the vector ("pop back"). What this - * function really does is decrement the dynamic size of the - * vector. The vector's buffer does not get reallocated for - * performance. - */ - void pop_back (void); - - /** - * This function dumps the content of the vector. TO BE MOVED out - * of this class. It needs to be implemented as a global template - * function that accepts a const ACE_Vector<T>, in order to - * make instances of this class compile on Linux, AIX. G++ and xlC - * have template instantiation algoriths, which are different from - * the one in Visual C++. The algorithms try to instantiate ALL - * methods declared in the template class, regardless of whether the - * functions are used or not. That is, all of the classes, that are - * used as elements in ACE_Vector's, have to have the dump() methods - * defined in them (seems to be overkill). - * - * This function calls T::dump() for each element of the vector. - */ - void dump (void) const; - - // = Compare operators - - ///Equality comparison operator. - /** - * Compare this vector with @arg s for equality. Two vectors are equal - * if their sizes are equal and all the elements are equal. - */ - bool operator== (const ACE_Vector &s) const; - - ///Inequality comparison operator. - /** - * Compare this vector with @arg s for inequality such that @c *this != - * @arg s is always the complement of the boolean return value of - * @c *this == @arg s. - */ - bool operator!= (const ACE_Vector &s) const; - - void swap (ACE_Vector &rhs); - -protected: - - /** - * Dynamic size (length) of the vector. - */ - size_t length_; - - /** - * Current capacity (buffer size) of the vector. - */ - size_t curr_max_size_; - - friend class ACE_Vector_Iterator; -}; - -#if 0 -/* - * Not sure about including these functions, if for no other reason, - * because they polute the global namespace! - */ - -/** - * Compare two vectors in the range of [from_ndx..to_ndx]. This - * template function requires class T to have the bool operator!=() - * declared in the class. It is safe to define vectors of scalar data - * types, like int, double, etc., including class ACE_TString. - * - * @param v1 The first vector (out of the two) to be compared. - * @param v2 The Second vector (out of the two) to be compared. - * @param from_ndx Compare vector v1 and v2, starting with the - * "from_ndx" index . - * @param to_ndx Compare vector v1 and v2, from "from_ndx" to - * "to_ndx". - * @return Returns true if v1==v2 in the specified index range, - * returns false otherwise. Also, returns false in case if - * v1's size is not equal to v2's size. - */ -template -int compare (const ACE_Vector& v1, - const ACE_Vector& v2, - const size_t from_ndx, - const size_t to_ndx); - -/** - * Does a partial comparison of two vectors in the range of - * [from_ndx..to_ndx]. The only difference between this function and - * the template compare<T> function is that this function does - * not require v1 and v2 to be of equal size. - * - * @param v1 The first vector (out of the two) to be compared. - * @param v2 The Second vector (out of the two) to be compared. - * @param from_ndx Compare vector v1 and v2, starting with the - * "from_ndx" index . - * @param to_ndx Compare vector v1 and v2, from "from_ndx" to - * "to_ndx". - * @return Returns true if vector v1 and v2 are equal in the specified - * index range. - */ - -template -int partial_compare (const ACE_Vector& v1, - const ACE_Vector& v2, - const size_t from_ndx, - const size_t to_ndx); -#endif /* 0 */ -// **************************************************************** - -/** - * @class ACE_Vector_Iterator - * - * @brief Implement an iterator over an ACE_Vector. - * - * This iterator is safe in the face of vector element deletions. - * But it is NOT safe if the vector is resized via the assignment - * operator during iteration. That would be very odd, and dangerous. - */ -template -class ACE_Vector_Iterator -{ -public: - // = Initialization method. - ACE_Vector_Iterator (ACE_Vector &); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the vector. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the vector. Returns 0 when all the - /// items in the vector have been seen, else 1. - int advance (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the current item in the iteration. - size_t current_; - - /// Reference to the vector we're iterating over. - ACE_Vector &vector_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Vector_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Vector_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Vector_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* ACE_VECTOR_T_H */ - diff --git a/dep/include/ace/Vector_T.inl b/dep/include/ace/Vector_T.inl deleted file mode 100644 index 4b773109a84..00000000000 --- a/dep/include/ace/Vector_T.inl +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- -// -// $Id: Vector_T.inl 81478 2008-04-28 13:22:26Z schmidt $ - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE -ACE_Vector::ACE_Vector (const size_t init_size, - ACE_Allocator* alloc) - : ACE_Array (init_size == 0 ? DEFAULT_SIZE : init_size, alloc), - length_ (0) -{ - this->curr_max_size_ = this->max_size (); -} - -template ACE_INLINE -ACE_Vector::~ACE_Vector () -{ -} - -template ACE_INLINE -size_t ACE_Vector::capacity (void) const -{ - return curr_max_size_; -} - -template ACE_INLINE -size_t ACE_Vector::size (void) const -{ - return length_; -} - -template ACE_INLINE -void ACE_Vector::clear (void) -{ - length_ = 0; -} - -template ACE_INLINE -void ACE_Vector::pop_back (void) -{ - if (length_ > 0) - { - --length_; - ACE_Array::size (length_); - } -} - -// Compare this vector with for inequality. - -template ACE_INLINE bool -ACE_Vector::operator!= (const ACE_Vector &s) const -{ - return !(*this == s); -} - -template ACE_INLINE void -ACE_Vector::swap (ACE_Vector &rhs) -{ - ACE_Array::swap (rhs); - std::swap (this->length_, rhs.length_); - std::swap (this->curr_max_size_, rhs.curr_max_size_); -} - -// **************************************************************** - -template ACE_INLINE void -ACE_Vector_Iterator::dump (void) const -{ - // ACE_TRACE ("ACE_Vector_Iterator::dump"); -} - -template ACE_INLINE -ACE_Vector_Iterator::ACE_Vector_Iterator (ACE_Vector &v) - : current_ (0), - vector_ (v) -{ - // ACE_TRACE ("ACE_Vector_Iterator::ACE_Vector_Iterator"); -} - -template ACE_INLINE int -ACE_Vector_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Vector_Iterator::advance"); - - if (this->current_ < vector_.size ()) - { - ++this->current_; - return 1; - } - else - // Already finished iterating. - return 0; -} - -template ACE_INLINE int -ACE_Vector_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Vector_Iterator::done"); - - return this->current_ >= vector_.size (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Version.h b/dep/include/ace/Version.h deleted file mode 100644 index ff3f3e64074..00000000000 --- a/dep/include/ace/Version.h +++ /dev/null @@ -1,10 +0,0 @@ - -// -*- C++ -*- -// $Id: Version.h 82705 2008-09-15 11:08:20Z sma $ -// This is file was automatically generated by \$ACE_ROOT/bin/make_release. - -#define ACE_MAJOR_VERSION 5 -#define ACE_MINOR_VERSION 6 -#define ACE_BETA_VERSION 6 -#define ACE_VERSION "5.6.6" - diff --git a/dep/include/ace/Versioned_Namespace.h b/dep/include/ace/Versioned_Namespace.h deleted file mode 100644 index 8dc3f9ed3e1..00000000000 --- a/dep/include/ace/Versioned_Namespace.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Versioned_Namespace.h - * - * $Id$ - * - * Versioned namespace support. - * - * Useful for preventing conflicts when using a third party library. - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef ACE_VERSIONED_NAMESPACE_H -#define ACE_VERSIONED_NAMESPACE_H - -#ifndef ACE_CONFIG_MACROS_H -# error This header is only meant to be included by or after "ace/config-lite.h". -#endif /* !ACE_CONFIG_LITE_H */ - -#if defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1 - -# ifndef ACE_VERSIONED_NAMESPACE_NAME -//# include "ace/Version.h" - -// Preprocessor symbols will not be expanded if they are -// concatenated. Force the preprocessor to expand them during the -// argument prescan by calling a macro that itself calls another that -// performs the actual concatenation. -# define ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA) ACE_ ## MAJOR ## _ ## MINOR ## _ ## BETA -# define ACE_MAKE_VERSIONED_NAMESPACE_NAME(MAJOR,MINOR,BETA) ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA) -# define ACE_VERSIONED_NAMESPACE_NAME ACE_MAKE_VERSIONED_NAMESPACE_NAME(ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION) -# endif /* !ACE_VERSIONED_NAMESPACE_NAME */ - -# define ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_VERSIONED_NAMESPACE_NAME { -# define ACE_END_VERSIONED_NAMESPACE_DECL } \ - using namespace ACE_VERSIONED_NAMESPACE_NAME; - -#else - -# define ACE_VERSIONED_NAMESPACE_NAME -# define ACE_BEGIN_VERSIONED_NAMESPACE_DECL -# define ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_VERSIONED_NAMESPACE */ - -#endif /* !ACE_VERSIONED_NAMESPACE_H */ - diff --git a/dep/include/ace/WFMO_Reactor.h b/dep/include/ace/WFMO_Reactor.h deleted file mode 100644 index 4bd5a514dd1..00000000000 --- a/dep/include/ace/WFMO_Reactor.h +++ /dev/null @@ -1,1368 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file WFMO_Reactor.h - * - * $Id: WFMO_Reactor.h 81138 2008-03-28 09:18:15Z johnnyw $ - * - * @author Irfan Pyarali - * @author Tim Harrison - * @author Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_WFMO_REACTOR_H -#define ACE_WFMO_REACTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_WIN32) - -#include "ace/Signal.h" -#include "ace/Timer_Queue.h" -#include "ace/Event_Handler.h" -#include "ace/Auto_Event.h" -#include "ace/Manual_Event.h" -#include "ace/Condition_Thread_Mutex.h" -#include "ace/Lock_Adapter_T.h" -#include "ace/Reactor_Impl.h" -#include "ace/Message_Queue.h" -#include "ace/Process_Mutex.h" - -// If we don't have WinSOCK2, we need these defined -#if !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) -/* - * WinSock 2 extension -- bit values and indices for FD_XXX network events - */ -#define FD_READ_BIT 0 -#define FD_WRITE_BIT 1 -#define FD_OOB_BIT 2 -#define FD_ACCEPT_BIT 3 -#define FD_CONNECT_BIT 4 -#define FD_CLOSE_BIT 5 -#define FD_QOS_BIT 6 -#define FD_GROUP_QOS_BIT 7 - -#define FD_QOS (1 << FD_QOS_BIT) -#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) - -#define FD_MAX_EVENTS 8 -#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) - -#define WSAEVENT HANDLE - -typedef struct _WSANETWORKEVENTS -{ - long lNetworkEvents; - int iErrorCode[FD_MAX_EVENTS]; -} WSANETWORKEVENTS, FAR * LPWSANETWORKEVENTS; - -int WSAEventSelect (SOCKET s, - WSAEVENT hEventObject, - long lNetworkEvents); - -int WSAEnumNetworkEvents (SOCKET s, - WSAEVENT hEventObject, - LPWSANETWORKEVENTS lpNetworkEvents); - -#endif /* !defined ACE_HAS_WINSOCK2 */ - -class ACE_WFMO_Reactor_Test; // Must be out of versioned namespace. - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -class ACE_WFMO_Reactor; -class ACE_Handle_Set; - -/** - * @class ACE_Wakeup_All_Threads_Handler - * - * @brief This is a helper class whose sole purpose is to handle events - * on wakeup_all_threads_> - */ -class ACE_Export ACE_Wakeup_All_Threads_Handler : public ACE_Event_Handler -{ -public: - /// Called when the wakeup_all_threads_> - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); -}; - -/** - * @class ACE_WFMO_Reactor_Handler_Repository - * - * @internal This class is for internal ACE use only. - * - * @brief Used to map ACE_HANDLEs onto the appropriate - * ACE_Event_Handler * and other information. - */ -class ACE_Export ACE_WFMO_Reactor_Handler_Repository -{ -public: - friend class ACE_WFMO_Reactor; - friend class ACE_WFMO_Reactor_Test; - - /** - * @class Common_Info - * - * @brief This struct contains the necessary information for every - * entry. The reason the event is not in this - * structure is because we need to pass an event array into - * WaitForMultipleObjects and therefore keeping the events - * seperate makes sense. - */ - class Common_Info - { - public: - /// This indicates whether this entry is for I/O or for a regular - /// event - bool io_entry_; - - /// The assosiated - ACE_Event_Handler *event_handler_; - - /// The I/O handle related to the . This entry is - /// only valid if the flag is true. - ACE_HANDLE io_handle_; - - /** - * This is the set of events that the is - * interested in. This entry is only valid if the flag - * is true. - */ - long network_events_; - - /** - * This flag indicates that created the event on - * behalf of the user. Therefore we need to clean this up when the - * removes itself from . This entry - * is only valid if the flag is true. - */ - bool delete_event_; - - /// This is set when the entry needed to be deleted. - bool delete_entry_; - - /** - * These are the masks related to for the - * . This is only valid when is - * set. - */ - ACE_Reactor_Mask close_masks_; - - /// Constructor used for initializing the structure - Common_Info (void); - - /// Reset the state of the structure - void reset (void); - - /// Set the structure to these new values - void set (bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry, - ACE_Reactor_Mask close_masks); - - /// Set the structure to these new values - void set (Common_Info &common_info); - - /// Dump the state of an object. - void dump (void) const; - }; - - /** - * @class Current_Info - * - * @brief This structure inherits from the common structure to add - * information for current entries. - */ - class Current_Info : public Common_Info - { - public: - /// This is set when the entry needed to be suspended. - bool suspend_entry_; - - /// Default constructor - Current_Info (void); - - /// Reset the state of the structure - void reset (void); - - /// Set the structure to these new values - void set (bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry = false, - ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK, - bool suspend_entry = false); - - /// Set the structure to these new values - void set (Common_Info &common_info, - bool suspend_entry = false); - - /// Dump the state of an object. - void dump (ACE_HANDLE event_handle) const; - }; - - /** - * @class To_Be_Added_Info - * - * @brief This structure inherits from the common structure to add - * information for entries. - */ - class To_Be_Added_Info : public Common_Info - { - public: - /// Handle for the event - ACE_HANDLE event_handle_; - - /// This is set when the entry needed to be suspended. - bool suspend_entry_; - - /// Default constructor - To_Be_Added_Info (void); - - /// Reset the state of the structure - void reset (void); - - /// Set the structure to these new values - void set (ACE_HANDLE event_handle, - bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry = false, - ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK, - bool suspend_entry = false); - - /// Set the structure to these new values - void set (ACE_HANDLE event_handle, - Common_Info &common_info, - bool suspend_entry = false); - - /// Dump the state of an object. - void dump (void) const; - }; - - /** - * @class Suspended_Info - * - * @brief This structure inherits from the common structure to add - * information for suspended entries. - */ - class Suspended_Info : public Common_Info - { - public: - /// Handle for the event - ACE_HANDLE event_handle_; - - /// This is set when the entry needed to be resumed. - bool resume_entry_; - - /// Constructor used for initializing the structure - Suspended_Info (void); - - /// Reset the state of the structure - void reset (void); - - /// Set the structure to these new values - void set (ACE_HANDLE event_handle, - bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry = false, - ACE_Reactor_Mask close_masks = 0, - bool resume_entry = false); - - /// Set the structure to these new values - void set (ACE_HANDLE event_handle, - Common_Info &common_info, - bool resume_entry = false); - - /// Dump the state of an object. - void dump (void) const; - }; - - /// Constructor. - ACE_WFMO_Reactor_Handler_Repository (ACE_WFMO_Reactor &wfmo_reactor); - - /// Destructor. - virtual ~ACE_WFMO_Reactor_Handler_Repository (void); - - /// Initialize the repository of the approriate @a size. - int open (size_t size); - - /// Close down the handler repository. - int close (void); - - // = Search structure operations. - - /// Bind the to the ACE_HANDLE. This is for - /// the simple event entry. - int bind (ACE_HANDLE, ACE_Event_Handler *); - - /// Insert I/O entry into the system. This method - /// assumes that the lock are head *before* this method is invoked. - int bind_i (bool io_entry, - ACE_Event_Handler *event_handler, - long network_events, - ACE_HANDLE io_handle, - ACE_HANDLE event_handle, - bool delete_event); - - /// Remove the binding of ACE_HANDLE in accordance with the @a mask. - int unbind (ACE_HANDLE, - ACE_Reactor_Mask mask); - - /// Non-lock-grabbing version of - int unbind_i (ACE_HANDLE, - ACE_Reactor_Mask mask, - bool &changes_required); - - /// Remove all bindings of tuples. - void unbind_all (void); - - // = Sanity checking. - - // Check the to make sure it's a valid ACE_HANDLE - int invalid_handle (ACE_HANDLE handle) const; - - // = Accessors. - /// Maximum ACE_HANDLE value, plus 1. - DWORD max_handlep1 (void) const; - - /// Pointer to the beginning of the current array of ACE_HANDLE - /// *'s. - ACE_HANDLE *handles (void) const; - - /// Pointer to the beginning of the current array of - /// ACE_Event_Handler *'s. - Current_Info *current_info (void) const; - - /// Check if changes to the handle set are required. - virtual bool changes_required (void); - - /// Make changes to the handle set - virtual int make_changes (void); - - /// Check to see if @a slot has been scheduled for deletion - int scheduled_for_deletion (size_t slot) const; - - /** - * This method is used to calculate the network mask after a mask_op - * request to . Note that because the - * may already be in the handler repository, we may have to find the - * old event and the old network events - */ - int modify_network_events_i (ACE_HANDLE io_handle, - ACE_Reactor_Mask new_masks, - ACE_Reactor_Mask &old_masks, - long &new_network_events, - ACE_HANDLE &event_handle, - bool &delete_event, - int operation); - - /// This method is used to change the network mask left (if any) - /// after a remove request to - ACE_Reactor_Mask bit_ops (long &existing_masks, - ACE_Reactor_Mask to_be_removed_masks, - int operation); - - /// Temporarily suspend entry - int suspend_handler_i (ACE_HANDLE handle, - bool &changes_required); - - /// Resume suspended entry - int resume_handler_i (ACE_HANDLE handle, - bool &changes_required); - - /// Deletions and suspensions in current_info_ - int make_changes_in_current_infos (void); - - /// Deletions and resumptions in current_suspended_info_ - int make_changes_in_suspension_infos (void); - - /// Deletions in to_be_added_info_, or transfers to current_info_ or - /// current_suspended_info_ from to_be_added_info_ - int make_changes_in_to_be_added_infos (void); - - /// Removes the ACE_Event_Handler at @a slot from the table. - int remove_handler_i (size_t slot, - ACE_Reactor_Mask mask); - - /// Removes the ACE_Event_Handler at @a slot from the table. - int remove_suspended_handler_i (size_t slot, - ACE_Reactor_Mask mask); - - /// Removes the ACE_Event_Handler at @a slot from the table. - int remove_to_be_added_handler_i (size_t slot, - ACE_Reactor_Mask to_be_removed_masks); - - /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. - */ - ACE_Event_Handler *find_handler (ACE_HANDLE handle); - - /** - * Check to see if is associated with a valid Event_Handler - * bound to @a mask. Return the associated with this - * @a handler if != 0. - */ - int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler = 0); - - /** - * Check to see if is associated with a valid - * Event_Handler. Return Event_Handler and associated masks. - */ - ACE_Event_Handler *handler (ACE_HANDLE handle, - long &existing_masks); - - /// Dump the state of an object. - void dump (void) const; - -protected: - /// Reference to our . - ACE_WFMO_Reactor &wfmo_reactor_; - - /// Maximum number of handles. - size_t max_size_; - - /** - * Array of passed to . This - * is not part of the structure as the handle array needs to be - * passed directly to . - */ - ACE_HANDLE *current_handles_; - - /// Array of current entries in the table - Current_Info *current_info_; - - /// A count of the number of active handles. - DWORD max_handlep1_; - - /// Information for entries to be added - To_Be_Added_Info *to_be_added_info_; - - /// Number of records to be added - size_t handles_to_be_added_; - - /// Currently suspended handles - Suspended_Info *current_suspended_info_; - - /// Number of currently suspended handles - size_t suspended_handles_; - - /// Number of records to be suspended - size_t handles_to_be_suspended_; - - /// Number of records to be resumed - size_t handles_to_be_resumed_; - - /// Number of records to be deleted - size_t handles_to_be_deleted_; - -}; - -/** - * @class ACE_WFMO_Reactor_Notify - * - * @brief Unblock the from its event loop, passing - * it an optional ACE_Event_Handler to dispatch. - * - * This implementation is necessary for cases where the - * is run in a multi-threaded program. In - * this case, we need to be able to unblock - * when updates occur other than in the - * main thread. To do this, we signal an - * auto-reset event the is listening on. If - * an ACE_Event_Handler and ACE_Reactor_Mask is passed to - * , the appropriate method is dispatched. - */ -class ACE_Export ACE_WFMO_Reactor_Notify : public ACE_Reactor_Notify -{ -public: - /// Constructor - ACE_WFMO_Reactor_Notify (size_t max_notifies = 1024); - - /// Initialization. is stored to call . - virtual int open (ACE_Reactor_Impl *wfmo_reactor, - ACE_Timer_Queue *timer_queue, - int disable_notify = 0); - - /// No-op. - virtual int close (void); - - /** - * Special trick to unblock when updates - * occur. All we do is enqueue and @a mask onto the - * ACE_Message_Queue and wakeup the by signaling - * its handle. The ACE_Time_Value indicates how long - * to blocking trying to notify the . If @a timeout == - * 0, the caller will block until action is possible, else will wait - * until the relative time specified in @a timeout elapses). - */ - virtual int notify (ACE_Event_Handler *event_handler = 0, - ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value *timeout = 0); - - /// No-op. - virtual int dispatch_notifications (int &number_of_active_handles, - ACE_Handle_Set &rd_mask); - - /// Returns a handle to the . - virtual ACE_HANDLE get_handle (void) const; - - /// Returns the ACE_HANDLE of the notify pipe on which the reactor - /// is listening for notifications so that other threads can unblock - /// the - virtual ACE_HANDLE notify_handle (void); - - /// Handle one of the notify call on the . This could be - /// because of a thread trying to unblock the - virtual int dispatch_notify (ACE_Notification_Buffer &buffer); - - /// Verify whether the buffer has dispatchable info or not. - virtual int is_dispatchable (ACE_Notification_Buffer &buffer); - - /// Read one of the notify call on the into the - /// . This could be because of a thread trying to unblock - /// the - virtual int read_notify_pipe (ACE_HANDLE handle, - ACE_Notification_Buffer &buffer); - - /** - * Set the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify queue before breaking out of its - * loop. By default, this is set to - * -1, which means "iterate until the queue is empty." Setting this - * to a value like "1 or 2" will increase "fairness" (and thus - * prevent starvation) at the expense of slightly higher dispatching - * overhead. - */ - void max_notify_iterations (int); - - /** - * Get the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify queue before breaking out of its - * loop. - */ - int max_notify_iterations (void); - - /** - * Purge any notifications pending in this reactor for the specified - * ACE_Event_Handler object. If == 0, all notifications for all - * handlers are removed (but not any notifications posted just to wake up - * the reactor itself). Returns the number of notifications purged. - * Returns -1 on error. - */ - virtual int purge_pending_notifications (ACE_Event_Handler *, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - /// Dump the state of an object. - virtual void dump (void) const; - -private: - /// Pointer to the wfmo_reactor's timer queue. - ACE_Timer_Queue *timer_queue_; - - /** - * Called when the notification event waited on by - * is signaled. This dequeues all pending - * and dispatches them. - */ - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - - /// An auto event is used so that we can it to wakeup one - /// thread up (e.g., when the method is called). - ACE_Auto_Event wakeup_one_thread_; - - /// Message queue that keeps track of pending . - /// This queue must be thread-safe because it can be called by - /// multiple threads of control. - ACE_Message_Queue message_queue_; - - /** - * Keeps track of the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify queue before breaking out of its - * loop. By default, this is set to - * -1, which means "iterate until the queue is empty." - */ - int max_notify_iterations_; -}; - -/** - * @class ACE_WFMO_Reactor - * - * @brief An object oriented event demultiplexor and event handler. - * ACE_WFMO_Reactor is a Windows-only implementation of the ACE_Reactor - * interface that uses the WaitForMultipleObjects() event demultiplexer. - * - * Like the other ACE Reactors, ACE_WFMO_Reactor can schedule timers. - * It also reacts to signalable handles, such as events (see the documentation - * for WaitForMultipleObjects() for a complete list of signalable handle - * types). Therefore, I/O handles are not directly usable for registering - * for input, output, and exception notification. The exception to this - * is ACE_SOCK-based handles, which can be registered for input, output, and - * exception notification just as with other platforms. See Chapter 4 in - * C++NPv2 for complete details. - * - * Note that changes to the state of ACE_WFMO_Reactor are not - * instantaneous. Most changes (registration, removal, - * suspension, and resumption of handles, and changes in - * ownership) are made when the ACE_WFMO_Reactor reaches a stable - * state. Users should be careful, especially when removing - * handlers. This is because the ACE_WFMO_Reactor will call - * handle_close() on the handler when it is finally removed and - * not when remove_handler() is called. If the registered handler's pointer - * is not valid when ACE_WFMO_Reactor calls ACE_Event_Handler::handle_close(), - * use the DONT_CALL flag with remove_handler(). Preferably, use dynamically - * allocated event handlers and call "delete this" inside the handle_close() - * hook method. - * - * Note that although multiple threads can concurrently run the - * ACE_WFMO_Reactor event loop, the concept of the reactor "owner" is still - * important. Only the owner thread can expire timers and wait on the - * notifications handle. Thus, be careful to properly set the owner thread - * when spawning threads to run the event loop while you are using timers - * or notifications. - */ -class ACE_Export ACE_WFMO_Reactor : public ACE_Reactor_Impl -{ -public: - friend class ACE_WFMO_Reactor_Handler_Repository; - friend class ACE_WFMO_Reactor_Test; - - enum - { - /// Default size of the WFMO_Reactor's handle table. - /** - * Two slots will be added to the @a size parameter in the - * constructor and open methods which will store handles used for - * internal management purposes. - */ - DEFAULT_SIZE = MAXIMUM_WAIT_OBJECTS - 2 - }; - - // = Initialization and termination methods. - - /// Initialize ACE_WFMO_Reactor with the default size. - ACE_WFMO_Reactor (ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - ACE_Reactor_Notify * = 0); - - /** - * Initialize ACE_WFMO_Reactor with the specified size. - * - * @param size The maximum number of handles the reactor can - * register. The value should not exceed - * ACE_WFMO_Reactor::DEFAULT_SIZE. Two slots will be - * added to the @a size parameter which will store handles - * used for internal management purposes. - */ - ACE_WFMO_Reactor (size_t size, - int unused = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - ACE_Reactor_Notify * = 0); - - /** - * Initialize ACE_WFMO_Reactor with the specified size. - * - * @param size The maximum number of handles the reactor can - * register. The value should not exceed - * ACE_WFMO_Reactor::DEFAULT_SIZE. Two slots will be - * added to the @a size parameter which will store handles - * used for internal management purposes. - */ - virtual int open (size_t size = ACE_WFMO_Reactor::DEFAULT_SIZE, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify * = 0); - - /// Returns -1 (not used in this implementation); - virtual int current_info (ACE_HANDLE, size_t & /* size */); - - /// Use a user specified signal handler instead. - virtual int set_sig_handler (ACE_Sig_Handler *signal_handler); - - /// Set a user-specified timer queue. - virtual int timer_queue (ACE_Timer_Queue *tq); - - /// Return the current ACE_Timer_Queue. - virtual ACE_Timer_Queue *timer_queue (void) const; - - /// Close down the ACE_WFMO_Reactor and release all of its resources. - virtual int close (void); - - /// Close down the ACE_WFMO_Reactor and release all of its resources. - virtual ~ACE_WFMO_Reactor (void); - - // = Event loop drivers. - - /** - * This method is not currently implemented. We recommend that you - * use handle_events (ACE_Time_Value::zero) to get basically the - * same effect, i.e., it won't block the caller if there are no events. - */ - virtual int work_pending (const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero); - - /** - * This event loop driver blocks for up to @a max_wait_time before - * returning. It will return earlier if timer events, I/O events, - * or signal events occur. Note that @a max_wait_time can be 0, in - * which case this method blocks indefinitely until events occur. - * - * @a max_wait_time is decremented to reflect how much time this call - * took. For instance, if a time value of 3 seconds is passed to - * handle_events and an event occurs after 2 seconds, - * @a max_wait_time will equal 1 second. This can be used if an - * application wishes to handle events for some fixed amount of - * time. - * - * is used as the demultiplexing call - * - * Returns the total number of I/O and timer ACE_Event_Handlers - * that were dispatched, 0 if the @a max_wait_time elapsed without - * dispatching any handlers, or -1 if an error occurs. - * - * The only difference between and - * is that in the alertable case, TRUE is passed to - * for the option. - */ - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0); - - /** - * This method is just like the one above, except the - * @a max_wait_time value is a reference and can therefore never be - * NULL. - * - * The only difference between and - * is that in the alertable case, TRUE is passed to - * for the option. - */ - virtual int handle_events (ACE_Time_Value &max_wait_time); - virtual int alertable_handle_events (ACE_Time_Value &max_wait_time); - - // = Event handling control. - - /** - * Return the status of Reactor. If this function returns 0, the reactor is - * actively handling events. If it returns non-zero, and - * return -1 immediately. - */ - virtual int deactivated (void); - - /** - * Control whether the Reactor will handle any more incoming events or not. - * If == 1, the Reactor will be disabled. By default, a reactor - * is in active state and can be deactivated/reactived as wish. - */ - virtual void deactivate (int do_stop); - - // = Register and remove Handlers. - - /** - * Register an ACE_Event_Handler . Since no Event - * Mask is passed through this interface, it is assumed that the - * being passed in is an event handle and when the event - * becomes signaled, will call handle_signal on - * . If == the - * will call the method of - * to extract the underlying event handle. - */ - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle = ACE_INVALID_HANDLE); - - /** - * Register an ACE_Event_Handler . @a mask specifies - * the network events that the is interested in. If - * == the will - * call the method of to extract the - * underlying I/O handle. If the == - * , WFMO_Reactor will create an event for - * associating it with the I/O handle. When the is - * signalled, the appropriate callback will be invoked on - * the - */ - virtual int register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * This is a simple version of the above method - * where the I/O handle is passed in and the event handle will - * always be created by - */ - virtual int register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * This is a simple version of the above method - * where the I/O handle will always come from on the - * and the event handle will always be created by - * - */ - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /// Register with all the in the - /// . - virtual int register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * Register to handle the signal @a signum using the - * . Returns the that was previously registered - * (if any), along with the of the signal handler. - */ - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - - /// Registers to handle a set of signals using the - /// . - virtual int register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0); - - /** - * Removes from the . Note that - * the will call the method of - * to extract the underlying handle. If @a mask == - * ACE_Event_Handler::DONT_CALL then the method of - * the is not invoked. Note that the can - * either be the or the - */ - virtual int remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /** - * Removes from the . If @a mask == - * ACE_Event_Handler::DONT_CALL then the method of - * the is not invoked. Note that the can - * either be the or the - * - * For the case of I/O entries, this removes the @a mask binding of - * whose handle is from . If - * there are no more bindings for this then it is - * removed from the WFMO_Reactor. For simple event entries, mask is - * mostly ignored and the is always removed from - * - */ - virtual int remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - - /** - * Removes all the @a mask bindings for handles in the - * bind of . If there are no more bindings for any - * of these handles then they are removed from WFMO_Reactor. - */ - virtual int remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask); - - /** - * Remove the ACE_Event_Handler currently associated with @a signum. - * is ignored in this implementation since there is only - * one instance of a signal handler. Install the new disposition - * (if given) and return the previous disposition (if desired by the - * caller). Returns 0 on success and -1 if @a signum is invalid. - */ - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - - /// Calls for every signal in . - virtual int remove_handler (const ACE_Sig_Set &sigset); - - // = Suspend and resume Handlers. - - /// Suspend temporarily. Use - /// to get the handle. - virtual int suspend_handler (ACE_Event_Handler *event_handler); - - /// Suspend temporarily. - virtual int suspend_handler (ACE_HANDLE handle); - - /// Suspend all in handle set temporarily. - virtual int suspend_handler (const ACE_Handle_Set &handles); - - /// Suspend all temporarily. - virtual int suspend_handlers (void); - - /// Resume . Use to - /// get the handle. - virtual int resume_handler (ACE_Event_Handler *event_handler); - - /// Resume . - virtual int resume_handler (ACE_HANDLE handle); - - /// Resume all in handle set. - virtual int resume_handler (const ACE_Handle_Set &handles); - - /// Resume all . - virtual int resume_handlers (void); - - /// Does the reactor allow the application to resume the handle on - /// its own ie. can it pass on the control of handle resumption to - /// the application. A positive value indicates that the handlers - /// are application resumable. A value of 0 indicates otherwise. - virtual int resumable_handler (void); - - /** - * Return 1 if we any event associations were made by the reactor - * for the handles that it waits on, 0 otherwise. Since the - * WFMO_Reactor does use event associations, this function always - * return 1. - */ - virtual int uses_event_associations (void); - - // Timer management. - - /** - * Schedule an ACE_Event_Handler that will expire after an amount - * of time. The return value of this method, a timer_id value, - * uniquely identifies the event_handler in the ACE_Reactor's - * internal list of timers. - * This timer_id value can be used to cancel the timer - * with the cancel_timer() call. - * - * @see cancel_timer() - * @see reset_timer_interval() - * - * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of event_handler - * @param delay time interval after which the timer will expire - * @param interval time interval after which the timer will be automatically rescheduled - * @return -1 on failure, a timer_id value on success - */ - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - - /** - * Resets the interval of the timer represented by @a timer_id to - * @a interval, which is specified in relative time to the current - * . If @a interval is equal to - * ACE_Time_Value::zero, the timer will become a non-rescheduling - * timer. Returns 0 if successful, -1 if not. - */ - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - - /// Cancel all Event_Handlers that match the address of - /// . Returns number of handler's cancelled. - virtual int cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close = 1); - - /** - * Cancel the single Event_Handler that matches the @a timer_id value - * (which was returned from the schedule method). If arg is - * non-NULL then it will be set to point to the ``magic cookie'' - * argument passed in when the Event_Handler was registered. This - * makes it possible to free up the memory and avoid memory leaks. - * Returns 1 if cancellation succeeded and 0 if the @a timer_id - * wasn't found. - */ - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - - // = High-level Event_Handler scheduling operations - - /** - * Add @a masks_to_be_added to the 's entry in - * WFMO_Reactor. must already have been registered - * with WFMO_Reactor. - */ - virtual int schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added); - - /** - * Add @a masks_to_be_added to the @a handle's entry in WFMO_Reactor. - * The Event_Handler associated with must already have been - * registered with WFMO_Reactor. - */ - virtual int schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_added); - - /** - * Remove to the 's entry in - * WFMO_Reactor. The Event_Handler associated with must - * already have been registered with WFMO_Reactor. - */ - virtual int cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_deleted); - - /** - * Remove to the 's entry in - * WFMO_Reactor. The Event_Handler associated with must - * already have been registered with WFMO_Reactor. - */ - virtual int cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_deleted); - - // = Notification methods. - - /** - * Wakeup one thread if it is currently blocked - * in . The ACE_Time_Value indicates how - * long to blocking trying to notify the . If - * @a timeout == 0, the caller will block until action is possible, - * else will wait until the relative time specified in @a timeout - * elapses). - */ - virtual int notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - - /** - * Set the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify queue before breaking out of its - * loop. By default, this is set to - * -1, which means "iterate until the queue is empty." Setting this - * to a value like "1 or 2" will increase "fairness" (and thus - * prevent starvation) at the expense of slightly higher dispatching - * overhead. - */ - virtual void max_notify_iterations (int); - - /** - * Get the maximum number of times that the - * method will iterate and - * dispatch the that are passed in via the - * notify queue before breaking out of its - * loop. - */ - virtual int max_notify_iterations (void); - - /** - * Purge any notifications pending in this reactor for the specified - * ACE_Event_Handler object. Returns the number of notifications - * purged. Returns -1 on error. - */ - virtual int purge_pending_notifications (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - - // = Assorted helper methods. - - /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. - */ - ACE_Event_Handler *find_handler (ACE_HANDLE handle); - - /** - * Check to see if is associated with a valid Event_Handler - * bound to @a mask. Return the associated with this - * @a handler if != 0. - */ - virtual int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler = 0); - - /** - * Check to see if @a signum is associated with a valid Event_Handler - * bound to a signal. Return the associated with - * this @a handler if != 0. - */ - virtual int handler (int signum, - ACE_Event_Handler ** = 0); - - /// Returns true if WFMO_Reactor has been successfully initialized, else - /// false. - virtual bool initialized (void); - - /// Returns the current size of the WFMO_Reactor's internal - /// descriptor table. - virtual size_t size (void) const; - - /// Returns a reference to the WFMO_Reactor's internal lock. - virtual ACE_Lock &lock (void); - - /// Wake up all threads in WaitForMultipleObjects so that they can - /// reconsult the handle set - virtual void wakeup_all_threads (void); - - /** - * Transfers ownership of the WFMO_Reactor to the . The - * transfer will not complete until all threads are ready (just like - * the handle set). - */ - virtual int owner (ACE_thread_t new_owner, ACE_thread_t *old_owner = 0); - - /// Return the ID of the "owner" thread. - virtual int owner (ACE_thread_t *owner); - - /// Get the existing restart value. - virtual int restart (void); - - /// Set a new value for restart and return the original value. - virtual int restart (int r); - - /// Not implemented - virtual void requeue_position (int); - - /// Not implemented - virtual int requeue_position (void); - - // = Low-level wait_set mask manipulation methods. - - /** - * Modify @a masks of the 's entry in WFMO_Reactor - * depending upon . must already have - * been registered with WFMO_Reactor. - */ - virtual int mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks, - int operation); - - /** - * Modify @a masks of the 's entry in WFMO_Reactor depending - * upon . must already have been registered - * with WFMO_Reactor. - */ - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask masks, - int ops); - - // = Low-level ready_set mask manipulation methods. - - /// Not implemented - virtual int ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops); - - /// Not implemented - virtual int ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask, - int ops); - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - - /// Dump the state of an object. - virtual void dump (void) const; - -protected: - /// Registration workhorse - virtual int register_handler_i (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - - /// Event handling workhorse - virtual int event_handling (ACE_Time_Value *max_wait_time = 0, - int alertable = 0); - - /// Bit masking workhorse - virtual int mask_ops_i (ACE_HANDLE io_handle, - ACE_Reactor_Mask masks, - int operation); - - /// Return the ID of the "owner" thread. Does not do any locking. - virtual ACE_thread_t owner_i (void); - - /// Wait up to @a max_wait_time until it's ok to enter - /// WaitForMultipleObjects. Returns 1 (and holding lock_) if ok to wait; - /// -1 (and not holding lock_) if not. - virtual int ok_to_wait (ACE_Time_Value *max_wait_time, - int alertable); - - /// Wait for timer and I/O events to occur. - virtual DWORD wait_for_multiple_events (int timeout, - int alertable); - - /// Check for activity on remaining handles. - virtual DWORD poll_remaining_handles (DWORD slot); - - /// Expire timers. Only the owner thread does useful stuff in this - /// function. - virtual int expire_timers (void); - - /// Dispatches the timers and I/O handlers. - virtual int dispatch (DWORD wait_status); - - /// Protect against structured exceptions caused by user code when - /// dispatching handles - virtual int safe_dispatch (DWORD wait_status); - - /** - * Dispatches any active handles from handles_[@a slot] to - * handles_[active_handles_] using to poll - * through our handle set looking for active handles. - */ - virtual int dispatch_handles (DWORD slot); - - /// Dispatches a single handler. Returns 0 on success, -1 if the - /// handler was removed. - virtual int dispatch_handler (DWORD slot, - DWORD max_handlep1); - - /// Dispatches a single handler. Returns 0 on success, -1 if the - /// handler was removed. - virtual int simple_dispatch_handler (DWORD slot, - ACE_HANDLE event_handle); - - /// Dispatches a single handler. Returns 0 on success, -1 if the - /// handler was removed. - virtual int complex_dispatch_handler (DWORD slot, - ACE_HANDLE event_handle); - - /// Dispatches window messages. Noop for WFMO_Reactor. - virtual int dispatch_window_messages (void); - - virtual ACE_Reactor_Mask upcall (ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - WSANETWORKEVENTS &events); - - /// Used to caluculate the next timeout - virtual int calculate_timeout (ACE_Time_Value *time); - - /// Update the state of the handler repository - virtual int update_state (void); - - /// Check to see if we have a new owner - virtual int new_owner (void); - - /// Set owner to new owner - virtual int change_owner (void); - - /// Handle signals without requiring global/static variables. - ACE_Sig_Handler *signal_handler_; - - /// Keeps track of whether we should delete the signal handler (if we - /// didn't create it, then we don't delete it). - bool delete_signal_handler_; - - /// Defined as a pointer to allow overriding by derived classes... - ACE_Timer_Queue *timer_queue_; - - /// Keeps track of whether we should delete the timer queue (if we - /// didn't create it, then we don't delete it). - bool delete_timer_queue_; - - /// Keeps track of whether we should delete the handler repository - bool delete_handler_rep_; - - /// Used when is called. - ACE_Reactor_Notify *notify_handler_; - - /// Keeps track of whether we should delete the notify handler. - bool delete_notify_handler_; - - /** - * Synchronization for the ACE_WFMO_Reactor. - * - * A Process Mutex is used here because of two reasons: - * (a) The implementation of ACE_Thread_Mutex uses CriticalSections - * CriticalSections are not waitable using ::WaitForMultipleObjects - * (b) This is really not a process mutex because it is not - * named. No other process can use this mutex. - */ - ACE_Process_Mutex lock_; - - /// Adapter used to return internal lock to outside world. - ACE_Lock_Adapter lock_adapter_; - - /// Table that maps to 's. - ACE_WFMO_Reactor_Handler_Repository handler_rep_; - - /// A manual event used to block threads from proceeding into - /// WaitForMultipleObjects - ACE_Manual_Event ok_to_wait_; - - /** - * A manual event is used so that we can wake everyone up (e.g., - * when are bounded and unbound from the - * handler repository). - */ - ACE_Manual_Event wakeup_all_threads_; - - /// Used when is signaled - ACE_Wakeup_All_Threads_Handler wakeup_all_threads_handler_; - - /// The changing thread waits on this event, till all threads are not - /// active anymore - ACE_Auto_Event waiting_to_change_state_; - - /// Count of currently active threads - size_t active_threads_; - - /** - * The thread which is "owner" of the WFMO_Reactor. The owner - * concept is used because we don't want multiple threads to try to - * expire timers. Therefore the "owner" thread is the only one - * allowed to expire timers. Also, the owner thread is the only - * thread which waits on the notify handle. Note that the ownership - * can be transferred. - */ - ACE_thread_t owner_; - - /// The owner to be of the WFMO_Reactor - ACE_thread_t new_owner_; - - /// This is the thread which is responsible for the changing the - /// state of the handle set - ACE_thread_t change_state_thread_; - - /// This is an array of ACE_HANDLEs which keep track of the - /// and handles - ACE_HANDLE atomic_wait_array_ [2]; - - /// This flag is used to keep track of whether we are already closed. - bool open_for_business_; - - /// This flag is used to keep track of whether we are actively handling - /// events or not. - sig_atomic_t deactivated_; - -private: - /// Deny access since member-wise won't work... - ACE_WFMO_Reactor (const ACE_WFMO_Reactor &); - ACE_WFMO_Reactor &operator = (const ACE_WFMO_Reactor &); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/WFMO_Reactor.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_WIN32 */ -#include /**/ "ace/post.h" -#endif /* ACE_WFMO_REACTOR_H */ - diff --git a/dep/include/ace/WFMO_Reactor.inl b/dep/include/ace/WFMO_Reactor.inl deleted file mode 100644 index a155019d841..00000000000 --- a/dep/include/ace/WFMO_Reactor.inl +++ /dev/null @@ -1,1200 +0,0 @@ -// -*- C++ -*- -// -// $Id: WFMO_Reactor.inl 81138 2008-03-28 09:18:15Z johnnyw $ - -#include "ace/Handle_Set.h" -#include "ace/Reactor.h" -#include "ace/Thread.h" -#include "ace/Sig_Handler.h" -#include "ace/OS_NS_errno.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/************************************************************/ - -ACE_INLINE int -ACE_Wakeup_All_Threads_Handler::handle_signal (int /* signum */, - siginfo_t * /* siginfo */, - ucontext_t *) -{ - // This will get called when wakeup_all_threads_> event - // is signaled. There is nothing to be done here. - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) waking up to get updated handle set info\n"))); - return 0; -} - -#if defined (ACE_WIN32) - -/************************************************************/ - -ACE_INLINE -ACE_WFMO_Reactor_Handler_Repository::Common_Info::Common_Info (void) - : io_entry_ (false), - event_handler_ (0), - io_handle_ (ACE_INVALID_HANDLE), - network_events_ (0), - delete_event_ (false), - delete_entry_ (false), - close_masks_ (ACE_Event_Handler::NULL_MASK) -{ -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Common_Info::reset (void) -{ - this->event_handler_ = 0; - this->io_entry_ = false; - this->io_handle_ = ACE_INVALID_HANDLE; - this->network_events_ = 0; - this->delete_event_ = false; - this->delete_entry_ = false; - this->close_masks_ = ACE_Event_Handler::NULL_MASK; -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Common_Info::set (bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry, - ACE_Reactor_Mask close_masks) -{ - this->event_handler_ = event_handler; - this->io_entry_ = io_entry; - this->io_handle_ = io_handle; - this->network_events_ = network_events; - this->delete_event_ = delete_event; - this->delete_entry_ = delete_entry; - this->close_masks_ = close_masks; -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Common_Info::set (Common_Info &common_info) -{ - *this = common_info; -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Common_Info::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_WFMO_Reactor_Handler_Repository::Common_Info::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("I/O Entry = %d\n"), - this->io_entry_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Event Handler = %d\n"), - this->event_handler_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("I/O Handle = %d\n"), - this->io_handle_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Network Events = %d\n"), - this->network_events_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Delete Event = %d\n"), - this->delete_event_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Delete Entry = %d\n"), - this->delete_entry_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Close Masks = %d\n"), - this->close_masks_)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -/************************************************************/ - -ACE_INLINE -ACE_WFMO_Reactor_Handler_Repository::Current_Info::Current_Info (void) - : suspend_entry_ (false) -{ -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry, - ACE_Reactor_Mask close_masks, - bool suspend_entry) -{ - this->suspend_entry_ = suspend_entry; - Common_Info::set (io_entry, - event_handler, - io_handle, - network_events, - delete_event, - delete_entry, - close_masks); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (Common_Info &common_info, - bool suspend_entry) -{ - this->suspend_entry_ = suspend_entry; - Common_Info::set (common_info); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Current_Info::reset (void) -{ - this->suspend_entry_ = false; - Common_Info::reset (); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Current_Info::dump (ACE_HANDLE event_handle) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_WFMO_Reactor_Handler_Repository::Current_Info::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - Common_Info::dump (); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Event Handle = %d\n"), - event_handle)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Suspend Entry = %d\n"), - this->suspend_entry_)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#else /* !ACE_HAS_DUMP */ - ACE_UNUSED_ARG (event_handle); -#endif /* ACE_HAS_DUMP */ -} - -/************************************************************/ - -ACE_INLINE -ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::To_Be_Added_Info (void) - : event_handle_ (ACE_INVALID_HANDLE), - suspend_entry_ (false) -{ -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::set (ACE_HANDLE event_handle, - bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry, - ACE_Reactor_Mask close_masks, - bool suspend_entry) -{ - this->event_handle_ = event_handle; - this->suspend_entry_ = suspend_entry; - Common_Info::set (io_entry, - event_handler, - io_handle, - network_events, - delete_event, - delete_entry, - close_masks); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::set (ACE_HANDLE event_handle, - Common_Info &common_info, - bool suspend_entry) -{ - this->event_handle_ = event_handle; - this->suspend_entry_ = suspend_entry; - Common_Info::set (common_info); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::reset (void) -{ - this->event_handle_ = ACE_INVALID_HANDLE; - this->suspend_entry_ = false; - Common_Info::reset (); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - Common_Info::dump (); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Event Handle = %d\n"), - this->event_handle_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Suspend Entry = %d\n"), - this->suspend_entry_)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -/************************************************************/ - -ACE_INLINE -ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::Suspended_Info (void) - : event_handle_ (ACE_INVALID_HANDLE), - resume_entry_ (false) -{ -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::reset (void) -{ - this->event_handle_ = ACE_INVALID_HANDLE; - this->resume_entry_ = false; - Common_Info::reset (); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::set (ACE_HANDLE event_handle, - bool io_entry, - ACE_Event_Handler *event_handler, - ACE_HANDLE io_handle, - long network_events, - bool delete_event, - bool delete_entry, - ACE_Reactor_Mask close_masks, - bool resume_entry) -{ - this->event_handle_ = event_handle; - this->resume_entry_ = resume_entry; - Common_Info::set (io_entry, - event_handler, - io_handle, - network_events, - delete_event, - delete_entry, - close_masks); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::set (ACE_HANDLE event_handle, - Common_Info &common_info, - bool resume_entry) -{ - this->event_handle_ = event_handle; - this->resume_entry_ = resume_entry; - Common_Info::set (common_info); -} - -ACE_INLINE void -ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - Common_Info::dump (); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Event Handle = %d\n"), - this->event_handle_)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Resume Entry = %d\n"), - this->resume_entry_)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -/************************************************************/ - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::close (void) -{ - // Let all the handlers know that the is closing down - this->unbind_all (); - - return 0; -} - -ACE_INLINE ACE_HANDLE * -ACE_WFMO_Reactor_Handler_Repository::handles (void) const -{ - // This code is probably too subtle to be useful in the long run... - // The basic idea is that all threads wait on all user handles plus - // the handle. The owner thread additional - // waits on the handle. This is to ensure that only the - // thread get to expire timers and handle event on the - // notify pipe. - if (ACE_Thread::self () == this->wfmo_reactor_.owner_i ()) - return this->current_handles_; - else - return this->current_handles_ + 1; -} - -ACE_INLINE ACE_WFMO_Reactor_Handler_Repository::Current_Info * -ACE_WFMO_Reactor_Handler_Repository::current_info (void) const -{ - if (ACE_Thread::self () == this->wfmo_reactor_.owner_i ()) - return this->current_info_; - else - return this->current_info_ + 1; -} - -ACE_INLINE DWORD -ACE_WFMO_Reactor_Handler_Repository::max_handlep1 (void) const -{ - if (ACE_Thread::self () == this->wfmo_reactor_.owner_i ()) - return this->max_handlep1_; - else - return this->max_handlep1_ - 1; -} - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::scheduled_for_deletion (size_t slot) const -{ - if (ACE_Thread::self () == this->wfmo_reactor_.owner_i ()) - return this->current_info_[slot].delete_entry_ == true; - else - return this->current_info_[slot + 1].delete_entry_ == true; -} - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::invalid_handle (ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_WFMO_Reactor_Handler_Repository::invalid_handle"); - // It's too expensive to perform more exhaustive validity checks on - // Win32 due to the way that they implement SOCKET HANDLEs. - if (handle == ACE_INVALID_HANDLE) - { - errno = EINVAL; - return 1; - } - else - return 0; -} - -ACE_INLINE bool -ACE_WFMO_Reactor_Handler_Repository::changes_required (void) -{ - // Check if handles have be scheduled for additions or removal - return this->handles_to_be_added_ > 0 - || this->handles_to_be_deleted_ > 0 - || this->handles_to_be_suspended_ > 0 - || this->handles_to_be_resumed_ > 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::make_changes (void) -{ - // This method must ONLY be called by the - // change_state_thread_>. We therefore assume that - // there will be no contention for this method and hence no guards - // are neccessary. - - // Deletions and suspensions in current_info_ - this->make_changes_in_current_infos (); - - // Deletions and resumptions in current_suspended_info_ - this->make_changes_in_suspension_infos (); - - // Deletions in to_be_added_info_, or transfers to current_info_ or - // current_suspended_info_ from to_be_added_info_ - this->make_changes_in_to_be_added_infos (); - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - if (this->invalid_handle (handle)) - return -1; - - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->wfmo_reactor_.lock_, -1); - - bool changes_required = false; - int const result = this->unbind_i (handle, - mask, - changes_required); - - if (changes_required) - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wfmo_reactor_.wakeup_all_threads (); - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::reset_timer_interval - (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_WFMO_Reactor::reset_timer_interval"); - - if (0 != this->timer_queue_) - { - long result = this->timer_queue_->reset_interval - (timer_id, - interval); - - // Wakeup the owner thread so that it gets the latest timer values - this->notify (); - - return result; - } - - errno = ESHUTDOWN; - return -1; -} - -ACE_INLINE long -ACE_WFMO_Reactor::schedule_timer (ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &delay_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_WFMO_Reactor::schedule_timer"); - - if (0 != this->timer_queue_) - { - long result = this->timer_queue_->schedule - (handler, - arg, - timer_queue_->gettimeofday () + delay_time, - interval); - - // Wakeup the owner thread so that it gets the latest timer values - this->notify (); - - return result; - } - - errno = ESHUTDOWN; - return -1; -} - -ACE_INLINE int -ACE_WFMO_Reactor::cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_WFMO_Reactor::cancel_timer"); - if (0 != this->timer_queue_) - return this->timer_queue_->cancel (handler, dont_call_handle_close); - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_WFMO_Reactor::cancel_timer"); - if (0 != this->timer_queue_) - return this->timer_queue_->cancel (timer_id, arg, dont_call_handle_close); - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->handler_rep_.bind_i (0, - event_handler, - 0, - ACE_INVALID_HANDLE, - event_handle, - 0); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->register_handler_i (ACE_INVALID_HANDLE, - ACE_INVALID_HANDLE, - event_handler, - mask); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->register_handler_i (ACE_INVALID_HANDLE, - io_handle, - event_handler, - mask); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->register_handler_i (event_handle, - io_handle, - event_handler, - mask); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->register_handler_i (h, - ACE_INVALID_HANDLE, - handler, - mask) == -1) - return -1; - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::schedule_wakeup (ACE_HANDLE io_handle, - ACE_Reactor_Mask masks_to_be_added) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->mask_ops_i (io_handle, - masks_to_be_added, - ACE_Reactor::ADD_MASK); -} - -ACE_INLINE int -ACE_WFMO_Reactor::schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->mask_ops_i (event_handler->get_handle (), - masks_to_be_added, - ACE_Reactor::ADD_MASK); -} - -ACE_INLINE int -ACE_WFMO_Reactor::cancel_wakeup (ACE_HANDLE io_handle, - ACE_Reactor_Mask masks_to_be_removed) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->mask_ops_i (io_handle, - masks_to_be_removed, - ACE_Reactor::CLR_MASK); -} - -ACE_INLINE int -ACE_WFMO_Reactor::cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_removed) -{ - // This GUARD is necessary since we are updating shared state. - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->mask_ops_i (event_handler->get_handle (), - masks_to_be_removed, - ACE_Reactor::CLR_MASK); -} - -ACE_INLINE int -ACE_WFMO_Reactor::remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - return this->handler_rep_.unbind (event_handler->get_handle (), - mask); -} - -ACE_INLINE int -ACE_WFMO_Reactor::remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - return this->handler_rep_.unbind (handle, - mask); -} - -ACE_INLINE int -ACE_WFMO_Reactor::remove_handler (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - bool changes_required = false; - - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->handler_rep_.unbind_i (h, - mask, - changes_required) == -1) - return -1; - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::suspend_handler (ACE_HANDLE handle) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - bool changes_required = false; - int const result = - this->handler_rep_.suspend_handler_i (handle, - changes_required); - - if (changes_required) - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::suspend_handler (ACE_Event_Handler *event_handler) -{ - return this->suspend_handler (event_handler->get_handle ()); -} - -ACE_INLINE int -ACE_WFMO_Reactor::suspend_handler (const ACE_Handle_Set &handles) -{ - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - bool changes_required = false; - - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->handler_rep_.suspend_handler_i (h, - changes_required) == -1) - return -1; - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::suspend_handlers (void) -{ - bool error = false; - int result = 0; - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - // First suspend all current handles - bool changes_required = false; - - for (size_t i = 0; - i < this->handler_rep_.max_handlep1_ && !error; - i++) - { - result = - this->handler_rep_.suspend_handler_i (this->handler_rep_.current_handles_[i], - changes_required); - if (result == -1) - error = true; - } - - // Then suspend all to_be_added_handles - for (size_t i = 0; - i < this->handler_rep_.handles_to_be_added_ && !error; - i++) - { - if (this->handler_rep_.to_be_added_info_[i].io_entry_) - { - result = - this->handler_rep_.suspend_handler_i (this->handler_rep_.to_be_added_info_[i].io_handle_, - changes_required); - } - else - { - result = - this->handler_rep_.suspend_handler_i (this->handler_rep_.to_be_added_info_[i].event_handle_, - changes_required); - } - if (result == -1) - error = true; - } - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return error ? -1 : 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::resume_handler (ACE_HANDLE handle) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - bool changes_required = false; - int result = - this->handler_rep_.resume_handler_i (handle, changes_required); - - if (changes_required) - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::resume_handler (ACE_Event_Handler *event_handler) -{ - return this->resume_handler (event_handler->get_handle ()); -} - -ACE_INLINE int -ACE_WFMO_Reactor::resume_handler (const ACE_Handle_Set &handles) -{ - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - bool changes_required = false; - - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->handler_rep_.resume_handler_i (h, - changes_required) == -1) - return -1; - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::resume_handlers (void) -{ - bool error = false; - int result = 0; - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - bool changes_required = false; - for (size_t i = 0; - i < this->handler_rep_.suspended_handles_ && !error; - i++) - { - result = - this->handler_rep_.resume_handler_i (this->handler_rep_.current_suspended_info_[i].event_handle_, - changes_required); - if (result == -1) - error = true; - } - - // Then resume all to_be_added_handles - for (size_t i = 0; - i < this->handler_rep_.handles_to_be_added_ && !error; - i++) - { - if (this->handler_rep_.to_be_added_info_[i].io_entry_) - { - result = - this->handler_rep_.resume_handler_i (this->handler_rep_.to_be_added_info_[i].io_handle_, - changes_required); - } - else - { - result = - this->handler_rep_.resume_handler_i (this->handler_rep_.to_be_added_info_[i].event_handle_, - changes_required); - } - if (result == -1) - error = true; - } - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the handle set - this->wakeup_all_threads (); - - return error ? -1 : 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::uses_event_associations (void) -{ - // Since the WFMO_Reactor does use event associations, this function - // always return 1. - return 1; -} - -ACE_INLINE int -ACE_WFMO_Reactor::handle_events (ACE_Time_Value &how_long) -{ - return this->event_handling (&how_long, FALSE); -} - -ACE_INLINE int -ACE_WFMO_Reactor::alertable_handle_events (ACE_Time_Value &how_long) -{ - return this->event_handling (&how_long, TRUE); -} - -ACE_INLINE int -ACE_WFMO_Reactor::handle_events (ACE_Time_Value *how_long) -{ - return this->event_handling (how_long, FALSE); -} - -ACE_INLINE int -ACE_WFMO_Reactor::alertable_handle_events (ACE_Time_Value *how_long) -{ - return this->event_handling (how_long, TRUE); -} - -ACE_INLINE int -ACE_WFMO_Reactor::deactivated (void) -{ - return this->deactivated_; -} - -ACE_INLINE void -ACE_WFMO_Reactor::deactivate (int do_stop) -{ - this->deactivated_ = do_stop; - this->wakeup_all_threads (); -} - -ACE_INLINE int -ACE_WFMO_Reactor::owner (ACE_thread_t *t) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - *t = this->owner_i (); - return 0; -} - -ACE_INLINE ACE_thread_t -ACE_WFMO_Reactor::owner_i (void) -{ - return this->owner_; -} - -ACE_INLINE int -ACE_WFMO_Reactor::owner (ACE_thread_t new_owner, ACE_thread_t *old_owner) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, monitor, this->lock_, -1); - this->new_owner_ = new_owner; - - if (old_owner != 0) - *old_owner = this->owner_i (); - - // Wake up all threads in WaitForMultipleObjects so that they can - // reconsult the new owner responsibilities - this->wakeup_all_threads (); - - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::new_owner (void) -{ - return this->new_owner_ != ACE_thread_t (0); -} - -ACE_INLINE int -ACE_WFMO_Reactor::change_owner (void) -{ - this->owner_ = this->new_owner_; - this->new_owner_ = ACE_thread_t (0); - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::safe_dispatch (DWORD wait_status) -{ - int result = -1; - ACE_SEH_TRY - { - result = this->dispatch (wait_status); - } - ACE_SEH_FINALLY - { - this->update_state (); - } - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::dispatch_window_messages (void) -{ - return 0; -} - -ACE_INLINE void -ACE_WFMO_Reactor::wakeup_all_threads (void) -{ - this->wakeup_all_threads_.signal (); -} - -ACE_INLINE int -ACE_WFMO_Reactor::notify (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - return this->notify_handler_->notify (event_handler, mask, timeout); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp, - ACE_Event_Handler **old_sh, - ACE_Sig_Action *old_disp) -{ - return this->signal_handler_->register_handler (signum, - new_sh, new_disp, - old_sh, old_disp); -} - -ACE_INLINE int -ACE_WFMO_Reactor::register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp) -{ - int result = 0; - -#if (ACE_NSIG > 0) - for (int s = 1; s < ACE_NSIG; s++) - if (sigset.is_member (s) - && this->signal_handler_->register_handler (s, - new_sh, - new_disp) == -1) - result = -1; -#else - ACE_UNUSED_ARG (sigset); - ACE_UNUSED_ARG (new_sh); - ACE_UNUSED_ARG (new_disp); -#endif /* ACE_NSIG */ - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp, - int sigkey) -{ - return this->signal_handler_->remove_handler (signum, - new_disp, - old_disp, - sigkey); -} - -ACE_INLINE int -ACE_WFMO_Reactor::remove_handler (const ACE_Sig_Set &sigset) -{ - int result = 0; - -#if (ACE_NSIG > 0) - for (int s = 1; s < ACE_NSIG; s++) - if (sigset.is_member (s) - && this->signal_handler_->remove_handler (s) == -1) - result = -1; -#else - ACE_UNUSED_ARG (sigset); -#endif /* ACE_NSIG */ - - return result; -} - -ACE_INLINE int -ACE_WFMO_Reactor::handler (int signum, ACE_Event_Handler **eh) -{ - ACE_Event_Handler *handler = - this->signal_handler_->handler (signum); - - if (handler == 0) - return -1; - else if (eh != 0) - *eh = handler; - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int operation) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, monitor, this->lock_, -1); - - return this->mask_ops_i (event_handler->get_handle (), - mask, - operation); -} - -ACE_INLINE int -ACE_WFMO_Reactor::mask_ops (ACE_HANDLE io_handle, - ACE_Reactor_Mask mask, - int operation) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, monitor, this->lock_, -1); - - return this->mask_ops_i (io_handle, - mask, - operation); -} - -ACE_INLINE void -ACE_WFMO_Reactor::requeue_position (int) -{ - // Not implemented -} - -ACE_INLINE int -ACE_WFMO_Reactor::requeue_position (void) -{ - // Don't have an implementation for this yet... - ACE_NOTSUP_RETURN (-1); -} - -ACE_INLINE int -ACE_WFMO_Reactor::restart (void) -{ - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::restart (int) -{ - return 0; -} - -ACE_INLINE int -ACE_WFMO_Reactor::ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) -{ - // Don't have an implementation for this yet... - ACE_UNUSED_ARG (event_handler); - ACE_UNUSED_ARG (mask); - ACE_UNUSED_ARG (ops); - ACE_NOTSUP_RETURN (-1); -} - -ACE_INLINE int -ACE_WFMO_Reactor::ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask, - int ops) -{ - // Don't have an implementation for this yet... - ACE_UNUSED_ARG (handle); - ACE_UNUSED_ARG (ops); - ACE_NOTSUP_RETURN (-1); -} - -ACE_INLINE ACE_Event_Handler * -ACE_WFMO_Reactor::find_handler (ACE_HANDLE handle) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, 0); - - return this->handler_rep_.find_handler (handle); -} - -ACE_INLINE int -ACE_WFMO_Reactor::handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler) -{ - ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); - - return this->handler_rep_.handler (handle, - mask, - event_handler); -} - -ACE_INLINE bool -ACE_WFMO_Reactor::initialized (void) -{ - return this->open_for_business_; -} - -ACE_INLINE ACE_Lock & -ACE_WFMO_Reactor::lock (void) -{ - return this->lock_adapter_; -} - -ACE_INLINE size_t -ACE_WFMO_Reactor::size (void) const -{ - // Size of repository minus the 2 used for internal purposes - return this->handler_rep_.max_size_ - 2; -} -#else -ACE_INLINE bool -ACE_WFMO_Reactor_Handler_Repository::changes_required (void) -{ - return false; -} - -ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::make_changes (void) -{ - return 0; -} - -ACE_INLINE -ACE_WFMO_Reactor_Handler_Repository::~ACE_WFMO_Reactor_Handler_Repository (void) -{ -} - -#endif /* ACE_WIN32 */ - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/WIN32_Asynch_IO.h b/dep/include/ace/WIN32_Asynch_IO.h deleted file mode 100644 index f88ff3d45e6..00000000000 --- a/dep/include/ace/WIN32_Asynch_IO.h +++ /dev/null @@ -1,1936 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file WIN32_Asynch_IO.h - * - * $Id: WIN32_Asynch_IO.h 80826 2008-03-04 14:51:23Z wotte $ - * - * - * These classes only works on Win32 platforms. - * - * The implementation of ACE_Asynch_Transmit_File, - * ACE_Asynch_Accept, and ACE_Asynch_Connect are only supported if - * ACE_HAS_WINSOCK2 is defined or you are on WinNT 4.0 or higher. - * - * - * @author Irfan Pyarali - * @author Tim Harrison - * @author Alexander Babu Arulanthu - * @author Roger Tragin - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_WIN32_ASYNCH_IO_H -#define ACE_WIN32_ASYNCH_IO_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) && \ - (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 == 1)) - -#include "ace/Asynch_IO_Impl.h" -#include "ace/Addr.h" -#include "ace/Event_Handler.h" -#include "ace/Handle_Set.h" -#include "ace/Map_Manager.h" -#include "ace/Null_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration -class ACE_WIN32_Proactor; - -/** - * @class ACE_WIN32_Asynch_Result - * - * @brief An abstract class which adds information to the OVERLAPPED - * structure to make it more useful. - * - * An abstract base class from which you can obtain some basic - * information like the number of bytes transferred, the ACT - * associated with the asynchronous operation, indication of - * success or failure, etc. Subclasses may want to store more - * information that is particular to the asynchronous operation - * it represents. - */ -class ACE_Export ACE_WIN32_Asynch_Result : public virtual ACE_Asynch_Result_Impl, - public OVERLAPPED -{ - /// Factory class has special permissions. - friend class ACE_WIN32_Asynch_Accept; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Result (void); - - /// Simulate error value to use in the post_completion () - void set_error (u_long errcode); - - /// Simulate value to use in the post_completion () - void set_bytes_transferred (size_t nbytes); - -protected: - /// Constructor. - ACE_WIN32_Asynch_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - const void* act, - ACE_HANDLE event, - u_long offset, - u_long offset_high, - int priority, - int signal_number = 0); - - /// Proxy for the ACE_Handler that will be called back. - ACE_Handler::Proxy_Ptr handler_proxy_; - - /// ACT for this operation. - const void *act_; - - /// Bytes transferred by this operation. - size_t bytes_transferred_; - - /// Success indicator. - int success_; - - /// ACT associated with handle. - const void *completion_key_; - - /// Error if operation failed. - u_long error_; -}; - -/** - * @class ACE_WIN32_Asynch_Operation - * - * @brief This class abstracts out the common things needed for - * implementing Asynch_Operation for WIN32 platform. - * - */ -class ACE_Export ACE_WIN32_Asynch_Operation : public virtual ACE_Asynch_Operation_Impl -{ -public: - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - // = Access methods. - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -protected: - /// Constructor. - ACE_WIN32_Asynch_Operation (ACE_WIN32_Proactor *win32_proactor); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Operation (void); - - /// Win32 Proactor. - ACE_WIN32_Proactor *win32_proactor_; - - /// Proactor that this asynch IO is registered with. - ACE_Proactor *proactor_; - - /// Handler that will receive the callback. - ACE_Handler::Proxy_Ptr handler_proxy_; - - /// I/O handle used for reading. - ACE_HANDLE handle_; -}; - -/** - * @class ACE_WIN32_Asynch_Read_Stream_Result - * - * @brief This class provides concrete implementation for - * ACE_Asynch_Read_Stream::Result class. - */ -class ACE_Export ACE_WIN32_Asynch_Read_Stream_Result : public virtual ACE_Asynch_Read_Stream_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory class will have special permissions. - friend class ACE_WIN32_Asynch_Read_Stream; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// The number of bytes which were requested at the start of the - /// asynchronous read. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for reading. - ACE_HANDLE handle (void) const; - - // Base class operations. These operations are here to kill - // dominance warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - - /// Accessor for the scatter read flag - int scatter_enabled (void) const; - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Read_Stream factory. - ACE_WIN32_Asynch_Read_Stream_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0, - int scatter_enabled = 0); - - /// Proactor will call this method when the read completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_Stream_Result (void); - - /// Bytes requested when the asynchronous read was initiated. - size_t bytes_to_read_; - - /// Message block for reading the data into. - ACE_Message_Block &message_block_; - - /// I/O handle used for reading. - ACE_HANDLE handle_; - - /// Flag for scatter read - int scatter_enabled_; -}; - -/** - * @class ACE_WIN32_Asynch_Read_Stream - * - * @brief This class is a factory for starting off asynchronous reads - * on a stream. - * - * Once is called, multiple asynchronous s can - * started using this class. An ACE_Asynch_Read_Stream::Result - * will be passed back to the @a handler when the asynchronous - * reads completes through the - * callback. - */ -class ACE_Export ACE_WIN32_Asynch_Read_Stream : public virtual ACE_Asynch_Read_Stream_Impl, - public ACE_WIN32_Asynch_Operation -{ - -public: - /// Constructor. - ACE_WIN32_Asynch_Read_Stream (ACE_WIN32_Proactor *win32_proactor); - - /// This starts off an asynchronous read. Upto @a bytes_to_read will - /// be read and stored in the @a message_block. - int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - */ - int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number = 0); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_Stream (void); - - // Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -protected: - /// This is the method which does the real work and is there so that - /// the ACE_Asynch_Read_File class can use it too. - int shared_read (ACE_WIN32_Asynch_Read_Stream_Result *result); -}; - -/** - * @class ACE_WIN32_Asynch_Write_Stream_Result - * - * @brief This class provides concrete implementation for - * ACE_Asynch_Write_Stream::Result class. - */ -class ACE_Export ACE_WIN32_Asynch_Write_Stream_Result : public virtual ACE_Asynch_Write_Stream_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory class willl have special permissions. - friend class ACE_WIN32_Asynch_Write_Stream; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write (void) const; - - /// Message block that contains the data to be written. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for writing. - ACE_HANDLE handle (void) const; - - // = Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - - /// Accessor for the gather write flag - int gather_enabled (void) const; - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Write_Stream factory. - ACE_WIN32_Asynch_Write_Stream_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0, - int gather_enabled = 0); - - /// ACE_Proactor will call this method when the write completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Write_Stream_Result (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write_; - - /// Message block that contains the data to be written. - ACE_Message_Block &message_block_; - - /// I/O handle used for writing. - ACE_HANDLE handle_; - - /// Flag for gather write - int gather_enabled_; -}; - -/** - * @class ACE_WIN32_Asynch_Write_Stream - * - * @brief This class is a factory for starting off asynchronous writes - * on a stream. - * - * - * Once is called, multiple asynchronous s can - * started using this class. A ACE_Asynch_Write_Stream::Result - * will be passed back to the @a handler when the asynchronous - * write completes through the - * callback. - */ -class ACE_Export ACE_WIN32_Asynch_Write_Stream : public virtual ACE_Asynch_Write_Stream_Impl, - public ACE_WIN32_Asynch_Operation -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Write_Stream (ACE_WIN32_Proactor *win32_proactor); - - /// This starts off an asynchronous write. Upto @a bytes_to_write - /// will be written from the @a message_block. - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - */ - int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number = 0); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Write_Stream (void); - - // = Methods belonging to base class. - - // These methods are defined here to avoid VC++ warnings. They route - // the call to the base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -protected: - /// This is the method which does the real work and is there so that - /// the ACE_Asynch_Write_File class can use it too. - int shared_write (ACE_WIN32_Asynch_Write_Stream_Result *result); -}; - -/** - * @class ACE_WIN32_Asynch_Read_File_Result - * - * @brief This class provides concrete implementation for - * ACE_Asynch_Read_File::Result class. - */ -class ACE_Export ACE_WIN32_Asynch_Read_File_Result : public virtual ACE_Asynch_Read_File_Result_Impl, - public ACE_WIN32_Asynch_Read_Stream_Result -{ - /// Factory class will have special permissions. - friend class ACE_WIN32_Asynch_Read_File; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - // = These methods belong to ACE_WIN32_Asynch_Result class base - // class. These operations are here to kill some warnings. These - // methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - // The following methods belong to - // ACE_WIN32_Asynch_Read_Stream_Result. They are here to avoid VC++ - // dominance warnings. These methods route their call to the - // ACE_WIN32_Asynch_Read_Stream_Result base class. - - /// The number of bytes which were requested at the start of the - /// asynchronous read. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for reading. - ACE_HANDLE handle (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Read_File factory. - ACE_WIN32_Asynch_Read_File_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number = 0, - int scatter_enabled = 0); - - /// ACE_Proactor will call this method when the read completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_File_Result (void); -}; - -/** - * @class ACE_WIN32_Asynch_Read_File - * - * @brief This class is a factory for starting off asynchronous reads - * on a file. - * - * Once is called, multiple asynchronous s can - * started using this class. A ACE_Asynch_Read_File::Result - * will be passed back to the @a handler when the asynchronous - * reads completes through the - * callback. - * - * This class differs slightly from ACE_Asynch_Read_Stream as it - * allows the user to specify an offset for the read. - */ -class ACE_Export ACE_WIN32_Asynch_Read_File : public virtual ACE_Asynch_Read_File_Impl, - public ACE_WIN32_Asynch_Read_Stream -{ - -public: - /// Constructor. - ACE_WIN32_Asynch_Read_File (ACE_WIN32_Proactor *win32_proactor); - - /** - * This starts off an asynchronous read. Upto @a bytes_to_read will - * be read and stored in the @a message_block. The read will start - * at @a offset from the beginning of the file. - */ - int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with scatter support, through chaining of - * composite message blocks using the continuation field. - * @note Each data block payload must be at least the size of a - * system memory page and must be aligned on a system memory page - * size boundary - */ - int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number = 0); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_File (void); - - // = Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -private: - /** - * This method belongs to ACE_WIN32_Asynch_Read_Stream. It is here - * to avoid the compiler warnings. We forward this call to the - * ACE_WIN32_Asynch_Read_Stream class. - */ - int read (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with scatter support, through chaining of composite - * message blocks using the continuation field. - */ - int readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number = 0); -}; - -/** - * @class ACE_WIN32_Asynch_Write_File_Result - * - * @brief This class provides implementation for - * ACE_Asynch_Write_File_Result for WIN32 platforms. - * - * This class has all the information necessary for the - * @a handler to uniquiely identify the completion of the - * asynchronous write. - * - * This class differs slightly from - * ACE_Asynch_Write_Stream::Result as it calls back - * on the @a handler instead - * of . No additional state - * is required by this class as ACE_Asynch_Result can store - * the @a offset. - */ -class ACE_Export ACE_WIN32_Asynch_Write_File_Result : public virtual ACE_Asynch_Write_File_Result_Impl, - public ACE_WIN32_Asynch_Write_Stream_Result -{ - /// Factory class will have special permission. - friend class ACE_WIN32_Asynch_Write_File; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - // = Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - // The following methods belong to - // ACE_WIN32_Asynch_Read_Stream_Result. They are here to avoid VC++ - // warnings. These methods route their call to the - // ACE_WIN32_Asynch_Read_Stream_Result base class. - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write (void) const; - - /// Message block that contains the data to be written. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for writing. - ACE_HANDLE handle (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Write_File factory. - ACE_WIN32_Asynch_Write_File_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number = 0, - int gather_enabled = 0); - - /// ACE_Proactor will call this method when the write completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Write_File_Result (void); -}; - -/** - * @class ACE_WIN32_Asynch_Write_File - * - * @brief This class is a factory for starting off asynchronous writes - * on a file. - * - * Once is called, multiple asynchronous s can be - * started using this class. A ACE_Asynch_Write_File::Result - * will be passed back to the @a handler when the asynchronous - * writes completes through the - * callback. - */ -class ACE_Export ACE_WIN32_Asynch_Write_File : public virtual ACE_Asynch_Write_File_Impl, - public ACE_WIN32_Asynch_Write_Stream -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Write_File (ACE_WIN32_Proactor *win32_proactor); - - /** - * This starts off an asynchronous write. Upto @a bytes_to_write - * will be write and stored in the @a message_block. The write will - * start at @a offset from the beginning of the file. - */ - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with gather support, through chaining of - * composite message blocks using the continuation field. - * @note Each data block payload must be at least the size of a - * system memory page and must be aligned on a system memory page - * size boundary - */ - int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - const void *act, - int priority, - int signal_number = 0); - - /// Destrcutor. - virtual ~ACE_WIN32_Asynch_Write_File (void); - - // = Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -private: - /** - * This method belongs to ACE_WIN32_Asynch_Write_Stream. It is here - * to avoid compiler warnings. This method is forwarded to the - * ACE_WIN32_Asynch_Write_Stream class. - */ - int write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number = 0); - - /** - * Same as above but with gather support, through chaining of composite - * message blocks using the continuation field. - */ - int writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number = 0); -}; - -/** - * @class ACE_WIN32_Asynch_Accept_Result - * - * @brief This class implements ACE_Asynch_Accept::Result for WIN32 - * platform. - * - * This class has all the information necessary for the - * @a handler to uniquiely identify the completion of the - * asynchronous accept. - */ -class ACE_Export ACE_WIN32_Asynch_Accept_Result : public virtual ACE_Asynch_Accept_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory will have special permission. - friend class ACE_WIN32_Asynch_Accept; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// The number of bytes which were requested at the start of the - /// asynchronous accept. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data. - ACE_Message_Block &message_block (void) const; - - /// I/O handle used for accepting new connections. - ACE_HANDLE listen_handle (void) const; - - /// I/O handle for the new connection. - ACE_HANDLE accept_handle (void) const; - - // = Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Accept factory. - ACE_WIN32_Asynch_Accept_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE listen_handle, - ACE_HANDLE accept_handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// ACE_Proactor will call this method when the accept completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Accept_Result (void); - - /// Bytes requested when the asynchronous read was initiated. - size_t bytes_to_read_; - - /// Message block for reading the data into. - ACE_Message_Block &message_block_; - - /// I/O handle used for accepting new connections. - ACE_HANDLE listen_handle_; - - /// I/O handle for the new connection. - ACE_HANDLE accept_handle_; -}; - -/** - * @class ACE_WIN32_Asynch_Accept - * - * @brief This class is a factory for starting off asynchronous accepts - * on a listen handle. - * - * Once is called, multiple asynchronous s can - * started using this class. A ACE_Asynch_Accept::Result will - * be passed back to the @a handler when the asynchronous accept - * completes through the - * callback. - */ -class ACE_Export ACE_WIN32_Asynch_Accept : public virtual ACE_Asynch_Accept_Impl, - public ACE_WIN32_Asynch_Operation -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Accept (ACE_WIN32_Proactor *win32_proactor); - - /** - * This starts off an asynchronous accept. The asynchronous accept - * call also allows any initial data to be returned to the - * @a handler. Upto @a bytes_to_read will be read and stored in the - * @a message_block. The will be used for the - * call. If ( == INVALID_HANDLE), a new - * handle will be created. - * - * @a message_block must be specified. This is because the address of - * the new connection is placed at the end of this buffer. - */ - int accept (ACE_Message_Block &message_block, - size_t bytes_to_read, - ACE_HANDLE accept_handle, - const void *act, - int priority, - int signal_number = 0, - int addr_family = AF_INET); - - /// Destructor. - ~ACE_WIN32_Asynch_Accept (void); - - // Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; -}; - -/** - * @class ACE_WIN32_Asynch_Connect_Result - * - * @brief This is that class which will be passed back to the - * completion handler when the asynchronous connect completes. - * - * This class has all the information necessary for the - * completion handler to uniquiely identify the completion of the - * asynchronous connect. - */ -class ACE_Export ACE_WIN32_Asynch_Connect_Result : public virtual ACE_Asynch_Connect_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory classes will have special permissions. - friend class ACE_WIN32_Asynch_Connect; - - /// The Proactor constructs the Result class for faking results. - friend class ACE_WIN32_Proactor; - -public: - - /// I/O handle for the connection. - ACE_HANDLE connect_handle (void) const; - - // = Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * Returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post this object to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Connect factory. - ACE_WIN32_Asynch_Connect_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE connect_handle, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number); - - /// ACE_Proactor will call this method when the accept completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Connect_Result (void); - - /// Set the I/O handle for the new connection. - void connect_handle (ACE_HANDLE handle); - - ACE_HANDLE connect_handle_; -}; - -/** - * @class ACE_WIN32_Asynch_Connect - */ -class ACE_Export ACE_WIN32_Asynch_Connect : - public virtual ACE_Asynch_Connect_Impl, - public ACE_WIN32_Asynch_Operation, - public ACE_Event_Handler -{ -public: - - /// Constructor. - ACE_WIN32_Asynch_Connect (ACE_WIN32_Proactor * win32_proactor); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Connect (void); - - /** - * This open belongs to ACE_WIN32_Asynch_Operation. We forward - * this call to that method. We have put this here to avoid the - * compiler warnings. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor = 0); - - /** - * Start an asynchronous connect. - * - * @param connect_handle Handle to use for the connect. If the value - * ACE_INVALID_HANDLE, a new handle will be created. - * - * @retval 0 Success - * @retval -1 Error - */ - int connect (ACE_HANDLE connect_handle, - const ACE_Addr &remote_sap, - const ACE_Addr &local_sap, - int reuse_addr, - const void *act, - int priority, - int signal_number = 0); - - /** - * Cancel all pending pseudo-asynchronus requests - * Behavior as usual AIO request - */ - int cancel (void); - - /** - * Close performs cancellation of all pending requests - * and close the connect handle - */ - int close (void); - - /// Virtual from ACE_Event_Handler - ACE_HANDLE get_handle (void) const; - - /// Virtual from ACE_Event_Handler - void set_handle (ACE_HANDLE handle); - - /// Virtual from ACE_Event_Handler - int handle_input ( ACE_HANDLE handle); - int handle_output ( ACE_HANDLE handle); - int handle_exception ( ACE_HANDLE handle); - - /// Virtual from ACE_Event_Handler - int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) ; - - // = Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid dominace warnings. They route - // the call to the ACE_WIN32_Asynch_Operation base class. - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -private: - int connect_i (ACE_WIN32_Asynch_Connect_Result *result, - const ACE_Addr &remote_sap, - const ACE_Addr &local_sap, - int reuse_addr); - - int post_result (ACE_WIN32_Asynch_Connect_Result *result, bool flg_post); - - /// Cancel uncompleted connect operations. - /** - * @param flg_notify Indicates whether or not to send notification about - * canceled connect operations. If false, don't send - * notifications. If true, notify user about canceled - * connects. - * According WIN32 standards we should receive - * notifications on canceled AIO requests. - * - * @param set Receives the set of I/O handles on which asynchronous - * connect requests were canceled as a result of this - * method. The contents of @a set are completely - * replaced. - */ - int cancel_uncompleted (bool flg_notify, ACE_Handle_Set &set); - - /// true - Connect is registered in ACE_Asynch_Pseudo_Task - /// false - Accept is deregisted in ACE_Asynch_Pseudo_Task - bool flg_open_ ; - - typedef ACE_Map_Manager - MAP_MANAGER; - - /// Map of Result pointers that correspond to all the 's - /// pending. - MAP_MANAGER result_map_; - - /// The lock to protect the result map which is shared. The queue - /// is updated by main thread in the register function call and - /// through the auxillary thread in the asynch pseudo task. - ACE_SYNCH_MUTEX lock_; -}; - -/** - * @class ACE_WIN32_Asynch_Transmit_File_Result - * - * - * @brief This class implements ACE_Asynch_Transmit_File::Result for - * WIN32 platforms. - * - * This class has all the information necessary for the - * @a handler to uniquiely identify the completion of the - * asynchronous transmit file. - */ -class ACE_Export ACE_WIN32_Asynch_Transmit_File_Result : public virtual ACE_Asynch_Transmit_File_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory class will have special permission. - friend class ACE_WIN32_Asynch_Transmit_File; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// Socket used for transmitting the file. - ACE_HANDLE socket (void) const; - - /// File from which the data is read. - ACE_HANDLE file (void) const; - - /// Header and trailer data associated with this transmit file. - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer (void) const; - - /// The number of bytes which were requested at the start of the - /// asynchronous transmit file. - size_t bytes_to_write (void) const; - - /// Number of bytes per send requested at the start of the transmit - /// file. - size_t bytes_per_send (void) const; - - /// Flags which were passed into transmit file. - u_long flags (void) const; - - // Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Transmit_File factory. - ACE_WIN32_Asynch_Transmit_File_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE socket, - ACE_HANDLE file, - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - size_t bytes_per_send, - u_long flags, - const void *act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// Proactor will call this method when the write completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Transmit_File_Result (void); - - /// Network I/O handle. - ACE_HANDLE socket_; - - /// File I/O handle. - ACE_HANDLE file_; - - /// Header and trailer data associated with this transmit file. - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer_; - - /// The number of bytes which were requested at the start of the - /// asynchronous transmit file. - size_t bytes_to_write_; - - /// Number of bytes per send requested at the start of the transmit - /// file. - size_t bytes_per_send_; - - /// Flags which were passed into transmit file. - u_long flags_; -}; - -/** - * @class ACE_WIN32_Asynch_Transmit_File - * - * @brief This class is a factory for starting off asynchronous - * transmit files on a stream. - * - * Once is called, multiple asynchronous s - * can started using this class. A - * ACE_Asynch_Transmit_File::Result will be passed back to the - * @a handler when the asynchronous transmit file completes - * through the callback. - * - * The transmit_file function transmits file data over a - * connected network connection. The function uses the operating - * system's cache manager to retrieve the file data. This - * function provides high-performance file data transfer over - * network connections. This function would be of great use in - * a Web Server, Image Server, etc. - */ -class ACE_Export ACE_WIN32_Asynch_Transmit_File : public virtual ACE_Asynch_Transmit_File_Impl, - public ACE_WIN32_Asynch_Operation -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Transmit_File (ACE_WIN32_Proactor *win32_proactor); - - /** - * This starts off an asynchronous transmit file. The is a - * handle to an open file. is a pointer to a - * data structure that contains pointers to data to send before and - * after the file data is sent. Set this parameter to 0 if you only - * want to transmit the file data. Upto @a bytes_to_write will be - * written to the . If you want to send the entire file, - * let @a bytes_to_write = 0. @a bytes_per_send is the size of each - * block of data sent per send operation. Please read the Win32 - * documentation on what the flags should be. - */ - int transmit_file (ACE_HANDLE file, - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - size_t bytes_per_send, - u_long flags, - const void *act, - int priority, - int signal_number = 0); - - /// Destructor. - ~ACE_WIN32_Asynch_Transmit_File (void); - - // Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; -}; - -/** - * @class ACE_WIN32_Asynch_Read_Dgram_Result - * - * @brief This class provides concrete implementation for - * ACE_Asynch_Read_Dgram::Result class. - */ -class ACE_Export ACE_WIN32_Asynch_Read_Dgram_Result : public virtual ACE_Asynch_Read_Dgram_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory class will have special permissions. - friend class ACE_WIN32_Asynch_Read_Dgram; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// The number of bytes which were requested at the start of the - /// asynchronous read. - size_t bytes_to_read (void) const; - - /// Message block which contains the read data - ACE_Message_Block *message_block (void) const; - - /// The address of where the packet came from - int remote_address (ACE_Addr& addr) const; - - sockaddr *saddr () const; - - /// The flags used in the read - int flags (void) const; - - /// I/O handle used for reading. - ACE_HANDLE handle (void) const; - - // Base class operations. These operations are here to kill - // dominance warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Read_Dgram factory. - ACE_WIN32_Asynch_Read_Dgram_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_read, - int flags, - int protocol_family, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// Proactor will call this method when the read completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_Dgram_Result (void); - - /// Bytes requested when the asynchronous read was initiated. - size_t bytes_to_read_; - - /// Message block for reading the data into. - ACE_Message_Block *message_block_; - - /// The address of where the packet came from - ACE_Addr *remote_address_; - - int addr_len_; - - /// The flags used in the read - int flags_; - - /// I/O handle used for reading. - ACE_HANDLE handle_; -}; - -/** - * @class ACE_WIN32_Asynch_Read_Dgram - * - * @brief This class is a factory for starting off asynchronous reads - * on a UDP socket. - * - * Once is called, multiple asynchronous s can be - * started using this class. An ACE_Asynch_Read_Dgram::Result - * will be passed back to the @a handler when the asynchronous - * reads completes through the - * callback. - * - */ -class ACE_Export ACE_WIN32_Asynch_Read_Dgram : public virtual ACE_Asynch_Read_Dgram_Impl, - public ACE_WIN32_Asynch_Operation -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Read_Dgram (ACE_WIN32_Proactor *win32_proactor); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Read_Dgram (void); - - /** This starts off an asynchronous read. Upto - * total_size()> will be read and stored in the - * @a message_block. @a message_block's will be updated to reflect - * the added bytes if the read operation is successfully completed. - * Return code of 1 means immediate success and - * will contain number of bytes read. The - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the cont()> - * method. Up to ACE_IOV_MAX @a message_block's are supported. Upto - * size()> bytes will be read into each for - * a total of total_size()> bytes. All @a message_block's - * 's will be updated to reflect the added bytes for each - * @a message_block - */ - virtual ssize_t recv (ACE_Message_Block *message_block, - size_t &number_of_bytes_recvd, - int flags, - int protocol_family, - const void *act, - int priority, - int signal_number); - - // Methods belong to ACE_WIN32_Asynch_Operation base class. These - // methods are defined here to avoid VC++ warnings. They route the - // call to the ACE_WIN32_Asynch_Operation base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -protected: - /// Do-nothing constructor. - ACE_WIN32_Asynch_Read_Dgram (void); -}; - -/** - * @class ACE_WIN32_Asynch_Write_Dgram_Result - * - * @brief This class provides concrete implementation for - * ACE_Asynch_Write_Dgram::Result class. - */ -class ACE_Export ACE_WIN32_Asynch_Write_Dgram_Result : public virtual ACE_Asynch_Write_Dgram_Result_Impl, - public ACE_WIN32_Asynch_Result -{ - /// Factory class willl have special permissions. - friend class ACE_WIN32_Asynch_Write_Dgram; - - /// Proactor class has special permission. - friend class ACE_WIN32_Proactor; - -public: - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write (void) const; - - /// Message block which contains the sent data - ACE_Message_Block *message_block (void) const; - - /// The flags using in the write - int flags (void) const; - - /// I/O handle used for writing. - ACE_HANDLE handle (void) const; - - // = Base class operations. These operations are here to kill some - // warnings. These methods call the base class methods. - - /// Number of bytes transferred by the operation. - size_t bytes_transferred (void) const; - - /// ACT associated with the operation. - const void *act (void) const; - - /// Did the operation succeed? - int success (void) const; - - /** - * This returns the ACT associated with the handle when it was - * registered with the I/O completion port. This ACT is not the - * same as the ACT associated with the asynchronous operation. - */ - const void *completion_key (void) const; - - /// Error value if the operation fail. - u_long error (void) const; - - /// Event associated with the OVERLAPPED structure. - ACE_HANDLE event (void) const; - - /// This really make sense only when doing file I/O. - u_long offset (void) const; - - /// Offset_high associated with the OVERLAPPED structure. - u_long offset_high (void) const; - - /// The priority of the asynchronous operation. Currently, this is - /// not supported on Win32. - int priority (void) const; - - /// No-op. Returns 0. - int signal_number (void) const; - - /// Post @c this to the Proactor's completion port. - int post_completion (ACE_Proactor_Impl *proactor); - -protected: - /// Constructor is protected since creation is limited to - /// ACE_Asynch_Write_Stream factory. - ACE_WIN32_Asynch_Write_Dgram_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_write, - int flags, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// ACE_Proactor will call this method when the write completes. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Write_Dgram_Result (void); - - /// The number of bytes which were requested at the start of the - /// asynchronous write. - size_t bytes_to_write_; - - /// Message block used for the send. - ACE_Message_Block *message_block_; - - /// The flags using in the write - int flags_; - - /// I/O handle used for writing. - ACE_HANDLE handle_; -}; - -/** - * @class ACE_WIN32_Asynch_Write_Dgram - * - * @brief This class is a factory for starting off asynchronous writes - * on a UDP socket. - * - * - * Once is called, multiple asynchronous s can - * started using this class. A ACE_Asynch_Write_Stream::Result - * will be passed back to the @a handler when the asynchronous - * write completes through the - * callback. - */ -class ACE_Export ACE_WIN32_Asynch_Write_Dgram : public virtual ACE_Asynch_Write_Dgram_Impl, - public ACE_WIN32_Asynch_Operation -{ -public: - /// Constructor. - ACE_WIN32_Asynch_Write_Dgram (ACE_WIN32_Proactor *win32_proactor); - - /// Destructor. - virtual ~ACE_WIN32_Asynch_Write_Dgram (void); - - /** This starts off an asynchronous send. Upto - * total_length()> will be sent. @a message_block's - * will be updated to reflect the sent bytes if the send operation - * is successfully completed. - * Return code of 1 means immediate success and - * is updated to number of bytes sent. The - * method will still be called. Return code of 0 means the IO will - * complete proactively. Return code of -1 means there was an error, use - * errno to get the error code. - * - * Scatter/gather is supported on WIN32 by using the cont()> - * method. Up to ACE_IOV_MAX @a message_block's are supported. Upto - * length()> bytes will be sent from each - * for a total of total_length()> bytes. All - * @a message_block's 's will be updated to reflect the bytes sent - * from each @a message_block. - */ - virtual ssize_t send (ACE_Message_Block *message_block, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - const void *act, - int priority, - int signal_number); - - // = Methods belonging to base class. - - // These methods are defined here to avoid VC++ warnings. They route - // the call to the base class. - - /** - * Initializes the factory with information which will be used with - * each asynchronous call. If ( == ACE_INVALID_HANDLE), - * will be called on the @a handler to get the - * correct handle. - */ - int open (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor); - - /** - * This cancels all pending accepts operations that were issued by - * the calling thread. The function does not cancel asynchronous - * operations issued by other threads. - */ - int cancel (void); - - /// Return the underlying proactor. - ACE_Proactor* proactor (void) const; - -protected: - /// Do-nothing constructor. - ACE_WIN32_Asynch_Write_Dgram (void); -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO && ACE_HAS_WINSOCK2 */ -#include /**/ "ace/post.h" -#endif /* ACE_WIN32_ASYNCH_IO_H */ - diff --git a/dep/include/ace/WIN32_Proactor.h b/dep/include/ace/WIN32_Proactor.h deleted file mode 100644 index 49cec039b38..00000000000 --- a/dep/include/ace/WIN32_Proactor.h +++ /dev/null @@ -1,325 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file WIN32_Proactor.h - * - * $Id: WIN32_Proactor.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali (irfan@cs.wustl.edu) - * @author Tim Harrison (harrison@cs.wustl.edu) - * @author Alexander Babu Arulanthu - * @author Roger Tragin - * @author Alexander Libman - */ -//============================================================================= - -#ifndef ACE_WIN32_PROACTOR_H -#define ACE_WIN32_PROACTOR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_WIN32) && defined (ACE_HAS_WIN32_OVERLAPPED_IO) -// WIN32 implementation of the Proactor. - -#include "ace/WIN32_Asynch_IO.h" -#include "ace/Event_Handler.h" - -#include "ace/Proactor_Impl.h" -#include "ace/Asynch_Pseudo_Task.h" -#include "ace/Auto_Event.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -class ACE_WIN32_Asynch_Result; -class ACE_WIN32_Proactor_Timer_Handler; - -/** - * @class ACE_WIN32_Proactor - * - * @brief A manager for asynchronous event demultiplexing on Win32. - * - * See the Proactor pattern description at - * http://www.cs.wustl.edu/~schmidt/PDF/proactor.pdf for more - * details. - */ -class ACE_Export ACE_WIN32_Proactor : public ACE_Proactor_Impl -{ - friend class ACE_WIN32_Asynch_Connect; - -public: - /// A do nothing constructor. - ACE_WIN32_Proactor (size_t number_of_threads = 0, - bool used_with_reactor_event_loop = false); - - /// Virtual destruction. - virtual ~ACE_WIN32_Proactor (void); - - /// Close the IO completion port. - virtual int close (void); - - /// This method adds the @a handle to the I/O completion port. This - /// function is a no-op function for Unix systems. - virtual int register_handle (ACE_HANDLE handle, - const void *completion_key); - - /** - * Dispatch a single set of events. If @a wait_time elapses before - * any events occur, return 0. Return 1 on success i.e., when a - * completion is dispatched, non-zero (-1) on errors and errno is - * set accordingly. - */ - virtual int handle_events (ACE_Time_Value &wait_time); - - /** - * Block indefinitely until at least one event is dispatched. - * Dispatch a single set of events. Return 1 on success i.e., when a - * completion is dispatched, non-zero (-1) on errors and errno is - * set accordingly. - */ - virtual int handle_events (void); - - /** - * Post a result to the completion port of the Proactor. If errors - * occur, the result will be deleted by this method. If successful, - * the result will be deleted by the Proactor when the result is - * removed from the completion port. Therefore, the result should - * have been dynamically allocated and should be orphaned by the - * user once this method is called. - */ - virtual int post_completion (ACE_WIN32_Asynch_Result *result); - - /// Add wakeup dispatch threads (reinit). - int wake_up_dispatch_threads (void); - - /// Close all dispatch threads. - int close_dispatch_threads (int wait); - - /// Get number of thread used as a parameter to @c CreateIoCompletionPort. - size_t number_of_threads (void) const; - - /// Set number of thread used as a parameter to @c CreateIoCompletionPort. - void number_of_threads (size_t threads); - - /// Get the event handle. - virtual ACE_HANDLE get_handle (void) const; - - virtual ACE_Asynch_Read_Stream_Impl *create_asynch_read_stream (void); - virtual ACE_Asynch_Write_Stream_Impl *create_asynch_write_stream (void); - virtual ACE_Asynch_Read_File_Impl *create_asynch_read_file (void); - virtual ACE_Asynch_Write_File_Impl *create_asynch_write_file (void); - virtual ACE_Asynch_Read_Dgram_Impl *create_asynch_read_dgram (void); - virtual ACE_Asynch_Write_Dgram_Impl *create_asynch_write_dgram (void); - virtual ACE_Asynch_Accept_Impl *create_asynch_accept (void); - virtual ACE_Asynch_Connect_Impl *create_asynch_connect (void); - virtual ACE_Asynch_Transmit_File_Impl *create_asynch_transmit_file (void); - - // Methods used to create Asynch_IO_Result objects. We create the right - // objects here in these methods. - - virtual ACE_Asynch_Read_Stream_Result_Impl *create_asynch_read_stream_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Write_Stream_Result_Impl *create_asynch_write_stream_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Read_File_Result_Impl *create_asynch_read_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Write_File_Result_Impl *create_asynch_write_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// Create the correct implementation class for ACE_Asynch_Read_Dgram::Result. - virtual ACE_Asynch_Read_Dgram_Result_Impl *create_asynch_read_dgram_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_read, - int flags, - int protocol_family, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// Create the correct implementation class for ACE_Asynch_Write_Dgram::Result. - virtual ACE_Asynch_Write_Dgram_Result_Impl *create_asynch_write_dgram_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_write, - int flags, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Accept_Result_Impl *create_asynch_accept_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE listen_handle, - ACE_HANDLE accept_handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Connect_Result_Impl *create_asynch_connect_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE connect_handle, - const void *act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - virtual ACE_Asynch_Transmit_File_Result_Impl *create_asynch_transmit_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, - ACE_HANDLE socket, - ACE_HANDLE file, - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - size_t bytes_per_send, - u_long flags, - const void *act, - ACE_HANDLE event, - int priority, - int signal_number = 0); - - /// Create a timer result object which can be used with the Timer - /// mechanism of the Proactor. - virtual ACE_Asynch_Result_Impl *create_asynch_timer (const ACE_Handler::Proxy_Ptr &handler_proxy, - const void *act, - const ACE_Time_Value &tv, - ACE_HANDLE event, - int priority, - int signal_number = 0); - -protected: - /// Task to process pseudo-asynchronous operations - ACE_Asynch_Pseudo_Task & get_asynch_pseudo_task (void); - - /// Called when object is signaled by OS (either via UNIX signals or - /// when a Win32 object becomes signaled). - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - - /// Called when object is removed from the ACE_Reactor. - virtual int handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask); - - /** - * Dispatch a single set of events. If @a milli_seconds elapses - * before any events occur, return 0. Return 1 if a completion is - * dispatched. Return -1 on errors. - */ - virtual int handle_events (unsigned long milli_seconds); - - /// Protect against structured exceptions caused by user code when - /// dispatching handles. - void application_specific_code (ACE_WIN32_Asynch_Result *asynch_result, - size_t bytes_transferred, - const void *completion_key, - u_long error); - - /** - * Post @a how_many completions to the completion port so that all - * threads can wake up. This is used in conjunction with the - * run_event_loop(). - */ - virtual int post_wakeup_completions (int how_many); - - /// Handle for the completion port. Unix doesnt have completion - /// ports. - ACE_HANDLE completion_port_; - - /// This number is passed to the @c CreateIOCompletionPort system - /// call. - DWORD number_of_threads_; - - /// This event is used in conjunction with Reactor when we try to - /// integrate the event loops of Reactor and the Proactor. - ACE_Auto_Event event_; - - /// Flag that indicates whether we are used in conjunction with - /// Reactor. - bool const used_with_reactor_event_loop_; - - /// Handler to handle the wakeups. This works in conjunction with the - /// ACE_Proactor::run_event_loop(). - ACE_Handler wakeup_handler_; - - /// Pseudo-task for asynch connect ( NT/2000) - /// In future should removed in XP with ConnectEx support - ACE_Asynch_Pseudo_Task pseudo_task_; -}; - -/** - * @class ACE_WIN32_Asynch_Timer - * - * @brief This class is posted to the completion port when a timer - * expires. When the complete method of this object is - * called, the @a handler's handle_timeout method will be - * called. - */ -class ACE_WIN32_Asynch_Timer : public ACE_WIN32_Asynch_Result -{ - /// The factory method for this class is with the POSIX_Proactor - /// class. - friend class ACE_WIN32_Proactor; - -protected: - /// Constructor. - ACE_WIN32_Asynch_Timer (const ACE_Handler::Proxy_Ptr &handler_proxy, - const void *act, - const ACE_Time_Value &tv, - ACE_HANDLE event = ACE_INVALID_HANDLE, - int priority = 0, - int signal_number = 0); - - /// This method calls the @a handler's handle_timeout method. - virtual void complete (size_t bytes_transferred, - int success, - const void *completion_key, - u_long error = 0); - - /// Time value requested by caller - ACE_Time_Value time_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_WIN32 */ -#include /**/ "ace/post.h" -#endif /* ACE_PROACTOR_H */ - diff --git a/dep/include/ace/XML_Svc_Conf.h b/dep/include/ace/XML_Svc_Conf.h deleted file mode 100644 index c14e30035bc..00000000000 --- a/dep/include/ace/XML_Svc_Conf.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file XML_Svc_Conf.h - * - * $Id: XML_Svc_Conf.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Nanbor Wang - */ -//============================================================================= - -#ifndef ACE_XML_SVC_CONF_H -#define ACE_XML_SVC_CONF_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (ACE_USES_CLASSIC_SVC_CONF==0) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_XML_Svc_Conf - * - * @brief This abstract class defines the common operations - * ACE_Service_Config expects when using the XML Service Config Parser. - * - * When implementing a concret XML_Svc_Conf class, be sure to overload - * the new/delete function so the dynamically created concret XML_Svc_Conf - * instance can be deleted from the original heap in the DLL/SO. The - * concret XML_Svc_Conf implementation will be put into a DLL/SO that - * ACE applications can link to dynamically using the ACE_DLL class. - * This DLL should include an operation as follow: - * - * extern "C" ACE_XML_Svc_Conf_Parser * _ACEXML_create_XML_Svc_Conf_Object (void); - * - * - */ - -class ACE_Export ACE_XML_Svc_Conf -{ -public: - typedef ACE_XML_Svc_Conf *(*Factory)(void); - - virtual ~ACE_XML_Svc_Conf (void) = 0; - - virtual int parse_file (const ACE_TCHAR file[]) = 0; - - virtual int parse_string (const ACE_TCHAR str[]) = 0; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */ - -#include /**/ "ace/post.h" - -#endif /* ACE_XML_SVC_CONF_H */ - diff --git a/dep/include/ace/XTI_ATM_Mcast.h b/dep/include/ace/XTI_ATM_Mcast.h deleted file mode 100644 index b701d842b67..00000000000 --- a/dep/include/ace/XTI_ATM_Mcast.h +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file XTI_ATM_Mcast.h - * - * $Id: XTI_ATM_Mcast.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Joe Hoffert - */ -//============================================================================= - -#ifndef ACE_XTI_ATM_MCAST_H -#define ACE_XTI_ATM_MCAST_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_XTI_ATM) - -#include "ace/TLI_Connector.h" -#include "ace/ATM_Addr.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_XTI_ATM_Mcast - * - * @brief Defines an active connection factory for the ACE_TLI C++ - * wrappers to support XTI/ATM multicast. - */ -class ACE_Export ACE_XTI_ATM_Mcast : public ACE_TLI_Connector -{ -public: - // = Initialization methods. - /// Default constructor. - ACE_XTI_ATM_Mcast (void); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - */ - ACE_XTI_ATM_Mcast (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0, - const char device[] = ACE_XTI_ATM_DEVICE, - struct t_info *info = 0, - int rw_flag = 1, - struct netbuf *udata = 0, - struct netbuf *opt = 0); - - /** - * Actively connect and produce a @a new_stream if things go well. - * The @a remote_sap is the address that we are trying to connect - * with. The @a timeout is the amount of time to wait to connect. - * If it's 0 then we block indefinitely. If *timeout == {0, 0} then - * the connection is done using non-blocking mode. In this case, if - * the connection can't be made immediately the value of -1 is - * returned with @c errno == EWOULDBLOCK. If *timeout > {0, 0} then - * this is the amount of time to wait before timing out. If the - * time expires before the connection is made @c errno == ETIME. The - * @a local_sap is the value of local address to bind to. If it's - * the default value of ACE_Addr::sap_any then the user is letting - * the OS do the binding. If @a reuse_addr == 1 then the - * is reused, even if it hasn't been cleanedup yet. - */ - int connect (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0, - const char device[] = ACE_XTI_ATM_DEVICE, - struct t_info *info = 0, - int rw_flag = 1, - struct netbuf *udata = 0, - struct netbuf *opt = 0); - - /** - * Actively add a leaf to the currently connected stream (i.e., - * multicast). The @a remote_sap is the address of the leaf that we - * are trying to add. The @a timeout is the amount of time to wait to - * connect. If it's 0 then we block indefinitely. If *timeout == - * {0, 0} then the connection is done using non-blocking mode. In - * this case, if the connection can't be made immediately the value - * of -1 is returned with @c errno == EWOULDBLOCK. If *timeout > - * {0, 0} then this is the amount of time to wait before timing out. - * If the time expires before the connection is made @c errno == ETIME. - */ - int add_leaf (ACE_TLI_Stream ¤t_stream, - const ACE_Addr &remote_sap, - ACE_INT32 leaf_id, - ACE_Time_Value *timeout = 0); - - // = Meta-type info - typedef ACE_ATM_Addr PEER_ADDR; - typedef ACE_TLI_Stream PEER_STREAM; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/XTI_ATM_Mcast.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_XTI_ATM */ - -#include /**/ "ace/post.h" - -#endif /* ACE_XTI_ATM_MCAST_H */ - diff --git a/dep/include/ace/XTI_ATM_Mcast.inl b/dep/include/ace/XTI_ATM_Mcast.inl deleted file mode 100644 index b182bb41b20..00000000000 --- a/dep/include/ace/XTI_ATM_Mcast.inl +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -// -// $Id: XTI_ATM_Mcast.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - const char device[], - struct t_info *info, - int rw_flag, - struct netbuf *udata, - struct netbuf *opt) -{ - ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast"); - if (this->connect (new_stream, remote_sap, timeout, local_sap, reuse_addr, - flags, perms, device, - info, rw_flag, - udata, opt) == ACE_INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_TLI_Stream::ACE_TLI_Stream"))); -} - -// Connect the to the , waiting up to -// amount of time if necessary. This is simple a pass- -// through function to ACE_TLI_Connector::connect(). It is over- -// ridden to change the default device from TCP to XTI/ATM. - -ACE_INLINE -int -ACE_XTI_ATM_Mcast::connect (ACE_TLI_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - const char device[], - struct t_info *info, - int rw_flag, - struct netbuf *udata, - struct netbuf *opt) -{ - ACE_TRACE ("ACE_XTI_ATM_Mcast::connect"); - return ACE_TLI_Connector::connect(new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - device, - info, - rw_flag, - udata, - opt); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/ace_wchar.h b/dep/include/ace/ace_wchar.h deleted file mode 100644 index 75afa83968b..00000000000 --- a/dep/include/ace/ace_wchar.h +++ /dev/null @@ -1,386 +0,0 @@ -//* -*- C++ -*- */ - -//============================================================================= -/** - * @file ace_wchar.h - * - * $Id: ace_wchar.h 82441 2008-07-28 13:04:13Z johnnyw $ - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_WCHAR_H -#define ACE_WCHAR_H - -#include "ace/config-macros.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// These macros have been deprecated and should be replaced by their -// ACE_TEXT_* equivalents. These macros are just hacks and may not -// completely provide the old functionality. -#if defined (ACE_LEGACY_MODE) -// Convert the old unicode indicators -# if defined (ACE_HAS_MOSTLY_UNICODE_APIS) -# define ACE_USES_WCHAR -# endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ -# if defined (ACE_HAS_UNICODE) -# define ACE_HAS_WCHAR -# endif /* ACE_HAS_UNICODE */ - -// These are defined to get older stuff to compile -// FUZZ: disable check_for_tchar -# define ASYS_TCHAR ACE_TCHAR -# define ASYS_TEXT ACE_TEXT -# define ASYS_ONLY_MULTIBYTE_STRING ACE_TEXT_ALWAYS_CHAR -# define ASYS_MULTIBYTE_STRING ACE_TEXT_CHAR_TO_TCHAR -# define ASYS_WIDE_STRING ACE_TEXT_CHAR_TO_TCHAR -# define ACE_WIDE_STRING ACE_TEXT_CHAR_TO_TCHAR - -# if defined (ACE_USES_WCHAR) -# define ASYS_ONLY_WIDE_STRING(STRING) STRING -# else /* ACE_USES_WCHAR */ -# define ASYS_ONLY_WIDE_STRING(STRING) \ - ACE_Ascii_To_Wide (STRING).wchar_rep () -# endif /* ACE_USES_WCHAR */ - -# define ACE_TEXT_STRING ACE_TString - -#endif /* ACE_LEGACY_MODE */ - -#if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) -# if !defined (ACE_HAS_WCHAR) -# define ACE_HAS_WCHAR -# endif -# include /**/ -#endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */ - -#if defined (ACE_HAS_WCHAR) -# if defined (ACE_VXWORKS) -# include /**/ /* For wchar_t */ -# include /**/ /* For mbstowcs, etc. */ -# include /**/ /* For strlen */ -# if !defined (__RTP__) -# define wint_t unsigned int /* VxWorks has wchar_t but not wint_t */ -# else -# include /**/ -# include /**/ -# endif -# elif defined (ACE_OPENVMS) -# include /**/ -# include /**/ -# elif defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ - (ACE_HAS_STANDARD_CPP_LIBRARY != 0) -# include /**/ -# include /**/ -# elif defined (ACE_HAS_WINCE) -# include /**/ -# else -# include /**/ -# endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ -#endif /* ACE_HAS_WCHAR */ - -#if defined (ACE_HAS_ICONV) -# include /**/ -# if !defined (ACE_MAX_ICONV_BUFFER) -# define ACE_MAX_ICONV_BUFFER 16*1024 -# endif -#endif /* ACE_HAS_ICONV */ - -#if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) -using std::size_t; -#endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */ - -// This makes the somewhat dubious assumption that if a platform lacks -// a native wchar_t type, then it will typedef it as unsigned short. -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_NATIVE_WCHAR_T) -# if !defined (ACE_WSTRING_HAS_USHORT_SUPPORT) -# define ACE_WSTRING_HAS_USHORT_SUPPORT -# endif /* ACE_WSTRING_HAS_USHORT_SUPPORT */ -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_NATIVE_WCHAR_T */ - -// Set the default behaviour for ACE_TEXT_WIDE to use the L-prefix -#if !defined (ACE_USES_L_PREFIX) -# define ACE_USES_L_PREFIX 1 -#endif /* ACE_USES_L_PREFIX */ - -// Define the unicode/wchar related macros correctly - -# if !defined (ACE_TEXT_WIDE) -# if (ACE_USES_L_PREFIX == 1) -# define ACE_TEXT_WIDE_I(STRING) L##STRING -# else /* ACE_USES_L_PREFIX */ -# define ACE_TEXT_WIDE_I(STRING) STRING -# endif /* ACE_USES_L_PREFIX */ -# define ACE_TEXT_WIDE(STRING) ACE_TEXT_WIDE_I (STRING) -# endif /* ACE_TEXT_WIDE */ - -#if defined (ACE_USES_WCHAR) -typedef wchar_t ACE_TCHAR; -typedef char ACE_ANTI_TCHAR; -# define ACE_TEXT(STRING) ACE_TEXT_WIDE (STRING) -# if !defined (ACE_LACKS_DEPRECATED_MACROS) -# define ACE_LIB_TEXT(STRING) ACE_TEXT_WIDE (STRING) -# endif -# define ACE_TEXT_ALWAYS_CHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () -# define ACE_TEXT_ALWAYS_WCHAR(STRING) STRING -# define ACE_TEXT_CHAR_TO_TCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () -# define ACE_TEXT_WCHAR_TO_TCHAR(STRING) STRING -# define ACE_TEXT_ANTI_TO_TCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () -#else /* ACE_USES_WCHAR */ -typedef char ACE_TCHAR; -typedef wchar_t ACE_ANTI_TCHAR; -# define ACE_TEXT(STRING) STRING -# if !defined (ACE_LACKS_DEPRECATED_MACROS) -# define ACE_LIB_TEXT(STRING) STRING -# endif -# define ACE_TEXT_ALWAYS_CHAR(STRING) STRING -# define ACE_TEXT_ALWAYS_WCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () -# define ACE_TEXT_CHAR_TO_TCHAR(STRING) STRING -# define ACE_TEXT_WCHAR_TO_TCHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () -# define ACE_TEXT_ANTI_TO_TCHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () -#endif /* ACE_USES_WCHAR */ - -// The OS_String module defines some wide-char functions that are not -// universally available. In particular, they're not part of the -// XPG4 Worldwide Portability Interface wide-character string handling -// functions. So, if ACE_HAS_XPG4_MULTIBYTE_CHAR is defined, note that -// these functions are missing. -#if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) - -# if !defined (ACE_LACKS_ITOW) -# define ACE_LACKS_ITOW -# endif - -# if !defined (ACE_LACKS_WCSICMP) -# define ACE_LACKS_WCSICMP -# endif - -# if !defined (ACE_LACKS_WCSNICMP) -# define ACE_LACKS_WCSNICMP -# endif - -# if !defined (ACE_LACKS_WCSDUP) -# define ACE_LACKS_WCSDUP -# endif - -#endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */ - -#if defined ACE_HAS_WCHAR - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Wide_To_Ascii - * - * @brief A lightweight wchar* to char* string conversion class. - * - * The purpose of this class is to perform conversion from - * wchar* to char* strings. It is not intended for general - * purpose use. - */ -class ACE_Wide_To_Ascii -{ -public: - /// Ctor must take a wchar string. - ACE_Wide_To_Ascii (const wchar_t *s); - - /// Dtor will free up the memory. - ~ACE_Wide_To_Ascii (void); - - /// Return the internal char* representation. - char *char_rep (void); - - /// Converts an wchar_t string to ascii and returns a new string. - static char *convert (const wchar_t *wstr); - -private: - /// Internal pointer to the converted string. - char *s_; - -#if defined (ACE_HAS_ICONV) - static iconv_t ACE_Wide_To_Ascii_iconv_env; -#endif /* ACE_HAS_ICONV */ - - /// Disallow these operation. - ACE_Wide_To_Ascii (void); - ACE_Wide_To_Ascii (ACE_Wide_To_Ascii &); - ACE_Wide_To_Ascii& operator= (ACE_Wide_To_Ascii &); -}; - -/** - * @class ACE_Ascii_To_Wide - * - * @brief A lightweight char* to wchar* string conversion class. - * - * The purpose of this class is to perform conversion from - * char* to wchar* strings. It is not intended for general - * purpose use. - */ -class ACE_Ascii_To_Wide -{ -public: - /// Ctor must take a wchar string. - ACE_Ascii_To_Wide (const char *s); - - /// Dtor will free up the memory. - ~ACE_Ascii_To_Wide (void); - - /// Return the internal wchar* representation. - wchar_t *wchar_rep (void); - - /// Converts an char string to unicode/wide and returns a new string. - static wchar_t *convert (const char *str); - -private: - /// Internal pointer to the converted string. - wchar_t *s_; - -#if defined (ACE_HAS_ICONV) - static iconv_t ACE_Ascii_To_Wide_iconv_env; -#endif /* ACE_HAS_ICONV */ - - /// Disallow these operation. - ACE_Ascii_To_Wide (void); - ACE_Ascii_To_Wide (ACE_Ascii_To_Wide &); - ACE_Ascii_To_Wide operator= (ACE_Ascii_To_Wide &); -}; - -#if defined (ACE_LEGACY_MODE) -typedef ACE_Ascii_To_Wide ACE_OS_CString; -typedef ACE_Wide_To_Ascii ACE_OS_WString; -#endif /* ACE_LEGACY_MODE */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_WCHAR */ - -#if defined (ACE_WIN32) -#if defined (ACE_USES_WCHAR) -#define ACE_LPSTR LPWSTR -#define ACE_TEXT_SERVICE_TABLE_ENTRY SERVICE_TABLE_ENTRYW -#define ACE_TEXT_STARTUPINFO STARTUPINFOW -#define ACE_TEXT_WIN32_FIND_DATA WIN32_FIND_DATAW -#define ACE_TEXT_OSVERSIONINFO OSVERSIONINFOW -#define ACE_TEXT_EXPLICIT_ACCESS EXPLICIT_ACCESS_W - -#define ACE_TEXT_CreateEvent ::CreateEventW -#define ACE_TEXT_CreateFile ::CreateFileW -#define ACE_TEXT_CreateFileMapping ::CreateFileMappingW -#define ACE_TEXT_CreateMutex ::CreateMutexW -#define ACE_TEXT_CreateProcess ::CreateProcessW -#define ACE_TEXT_CreateSemaphore ::CreateSemaphoreW -#define ACE_TEXT_CreateService ::CreateServiceW -#define ACE_TEXT_ExpandEnvironmentStrings ::ExpandEnvironmentStringsW -#define ACE_TEXT_FindFirstChangeNotification ::FindFirstChangeNotificationW -#define ACE_TEXT_FindFirstFile ::FindFirstFileW -#define ACE_TEXT_FindNextFile ::FindNextFileW -#define ACE_TEXT_FormatMessage ::FormatMessageW -#define ACE_TEXT_FreeEnvironmentStrings ::FreeEnvironmentStringsW -#define ACE_TEXT_GetComputerName ::GetComputerNameW -#define ACE_TEXT_GetEnvironmentStrings ::GetEnvironmentStringsW -#define ACE_TEXT_GetFileAttributes ::GetFileAttributesW -#define ACE_TEXT_GetModuleFileName ::GetModuleFileNameW -#define ACE_TEXT_GetTempPath ::GetTempPathW -#define ACE_TEXT_GetUserName ::GetUserNameW -#define ACE_TEXT_GetUserNameEx ::GetUserNameExW -#define ACE_TEXT_GetVersionEx ::GetVersionExW -#define ACE_TEXT_LoadLibrary ::LoadLibraryW -#define ACE_TEXT_MoveFileEx ::MoveFileExW -#define ACE_TEXT_WaitNamedPipe ::WaitNamedPipeW -#define ACE_TEXT_OpenFileMapping ::OpenFileMappingW -#define ACE_TEXT_OpenSCManager ::OpenSCManagerW -#define ACE_TEXT_OpenService ::OpenServiceW -#define ACE_TEXT_OutputDebugString ::OutputDebugStringW -#define ACE_TEXT_RegisterEventSource ::RegisterEventSourceW -#define ACE_TEXT_RegisterServiceCtrlHandler ::RegisterServiceCtrlHandlerW -#define ACE_TEXT_RegConnectRegistry ::RegConnectRegistryW -#define ACE_TEXT_RegCreateKeyEx ::RegCreateKeyExW -#define ACE_TEXT_RegDeleteKey ::RegDeleteKeyW -#define ACE_TEXT_RegDeleteValue ::RegDeleteValueW -#define ACE_TEXT_RegEnumKeyEx ::RegEnumKeyExW -#define ACE_TEXT_RegEnumValue ::RegEnumValueW -#define ACE_TEXT_RegCreateKey ::RegCreateKeyW -#define ACE_TEXT_RegOpenKey ::RegOpenKeyW -#define ACE_TEXT_RegOpenKeyEx ::RegOpenKeyExW -#define ACE_TEXT_RegQueryValueEx ::RegQueryValueExW -#define ACE_TEXT_RegSetValueEx ::RegSetValueExW -#define ACE_TEXT_ReportEvent ::ReportEventW -#define ACE_TEXT_SearchPath ::SearchPathW -#define ACE_TEXT_StartService ::StartServiceW -#define ACE_TEXT_StartServiceCtrlDispatcher ::StartServiceCtrlDispatcherW -#define ACE_TEXT_SetFileSecurity ::SetFileSecurityW -#define ACE_TEXT_SetEntriesInAcl ::SetEntriesInAclW -#define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathW -#define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryW -#define ACE_TEXT_PdhAddCounter ::PdhAddCounterW - -#else /* ACE_USES_WCHAR */ -#define ACE_LPSTR LPSTR -#define ACE_TEXT_SERVICE_TABLE_ENTRY SERVICE_TABLE_ENTRYA -#define ACE_TEXT_STARTUPINFO STARTUPINFOA -#define ACE_TEXT_WIN32_FIND_DATA WIN32_FIND_DATAA -#define ACE_TEXT_OSVERSIONINFO OSVERSIONINFOA -#define ACE_TEXT_EXPLICIT_ACCESS EXPLICIT_ACCESS_A - -#define ACE_TEXT_CreateEvent ::CreateEventA -#define ACE_TEXT_CreateFile ::CreateFileA -#define ACE_TEXT_CreateFileMapping ::CreateFileMappingA -#define ACE_TEXT_CreateMutex ::CreateMutexA -#define ACE_TEXT_CreateProcess ::CreateProcessA -#define ACE_TEXT_CreateSemaphore ::CreateSemaphoreA -#define ACE_TEXT_CreateService ::CreateServiceA -#define ACE_TEXT_ExpandEnvironmentStrings ::ExpandEnvironmentStringsA -#define ACE_TEXT_FindFirstChangeNotification ::FindFirstChangeNotificationA -#define ACE_TEXT_FindFirstFile ::FindFirstFileA -#define ACE_TEXT_FindNextFile ::FindNextFileA -#define ACE_TEXT_FormatMessage ::FormatMessageA -#define ACE_TEXT_FreeEnvironmentStrings ::FreeEnvironmentStringsA -#define ACE_TEXT_GetComputerName ::GetComputerNameA -#define ACE_TEXT_GetEnvironmentStrings ::GetEnvironmentStringsA -#define ACE_TEXT_GetFileAttributes ::GetFileAttributesA -#define ACE_TEXT_GetModuleFileName ::GetModuleFileNameA -#define ACE_TEXT_GetTempPath ::GetTempPathA -#define ACE_TEXT_GetUserName ::GetUserNameA -#define ACE_TEXT_GetUserNameEx ::GetUserNameExA -#define ACE_TEXT_GetVersionEx ::GetVersionExA -#define ACE_TEXT_LoadLibrary ::LoadLibraryA -#define ACE_TEXT_MoveFileEx ::MoveFileExA -#define ACE_TEXT_WaitNamedPipe ::WaitNamedPipeA -#define ACE_TEXT_OpenFileMapping ::OpenFileMappingA -#define ACE_TEXT_OpenSCManager ::OpenSCManagerA -#define ACE_TEXT_OpenService ::OpenServiceA -#define ACE_TEXT_OutputDebugString ::OutputDebugStringA -#define ACE_TEXT_RegisterEventSource ::RegisterEventSourceA -#define ACE_TEXT_RegisterServiceCtrlHandler ::RegisterServiceCtrlHandlerA -#define ACE_TEXT_RegConnectRegistry ::RegConnectRegistryA -#define ACE_TEXT_RegCreateKeyEx ::RegCreateKeyExA -#define ACE_TEXT_RegDeleteKey ::RegDeleteKeyA -#define ACE_TEXT_RegDeleteValue ::RegDeleteValueA -#define ACE_TEXT_RegEnumKeyEx ::RegEnumKeyExA -#define ACE_TEXT_RegEnumValue ::RegEnumValueA -#define ACE_TEXT_RegCreateKey ::RegCreateKeyA -#define ACE_TEXT_RegOpenKey ::RegOpenKeyA -#define ACE_TEXT_RegOpenKeyEx ::RegOpenKeyExA -#define ACE_TEXT_RegQueryValueEx ::RegQueryValueExA -#define ACE_TEXT_RegSetValueEx ::RegSetValueExA -#define ACE_TEXT_ReportEvent ::ReportEventA -#define ACE_TEXT_SearchPath ::SearchPathA -#define ACE_TEXT_StartService ::StartServiceA -#define ACE_TEXT_StartServiceCtrlDispatcher ::StartServiceCtrlDispatcherA -#define ACE_TEXT_SetFileSecurity ::SetFileSecurityA -#define ACE_TEXT_SetEntriesInAcl ::SetEntriesInAclA -#define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathA -#define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryA -#define ACE_TEXT_PdhAddCounter ::PdhAddCounterA -#endif /* ACE_USES_WCHAR */ -#endif /* ACE_WIN32 */ - -#include "ace/ace_wchar.inl" - -#endif /* ACE_WCHAR_H */ - diff --git a/dep/include/ace/ace_wchar.inl b/dep/include/ace/ace_wchar.inl deleted file mode 100644 index 744b44f5e73..00000000000 --- a/dep/include/ace/ace_wchar.inl +++ /dev/null @@ -1,183 +0,0 @@ -// -*- C++ -*- -// -// $Id: ace_wchar.inl 80826 2008-03-04 14:51:23Z wotte $ - -// These are always inlined -// FUZZ: disable check_for_inline - -#if defined (ACE_HAS_WCHAR) - -#if !defined (ACE_WIN32) -# include /**/ // Need to see strlen() -#endif /* ACE_WIN32 */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -inline -ACE_Wide_To_Ascii::~ACE_Wide_To_Ascii (void) -{ - delete [] this->s_; -} - -inline char * -ACE_Wide_To_Ascii::char_rep (void) -{ - return this->s_; -} - -inline char * -ACE_Wide_To_Ascii::convert (const wchar_t *wstr) -{ - // Short circuit null pointer case - if (wstr == 0) - return 0; - -# if defined (ACE_WIN32) - UINT const cp = GetACP (); // Codepage - int const len = ::WideCharToMultiByte (cp, - 0, - wstr, - -1, - 0, - 0, - 0, - 0); -# elif defined (ACE_LACKS_WCSLEN) - const wchar_t * wtemp = wstr; - while ((*wtemp) != 0) // Hopefully the string is null terminated! - ++wtemp; - - int const len = wtemp - wstr + 1; -# else /* ACE_WIN32 */ - size_t const len = ::wcslen (wstr) + 1; -# endif /* ACE_WIN32 */ - -#if !defined (ACE_HAS_ICONV) - char *str = new char[len]; -#endif - -# if defined (ACE_WIN32) - ::WideCharToMultiByte (cp, 0, wstr, -1, str, len, 0, 0); -# elif defined (ACE_VXWORKS) - ::wcstombs (str, wstr, len); -# elif defined (ACE_HAS_ICONV) - wchar_t * wstri = const_cast (wstr); - size_t lensi = ACE_MAX_ICONV_BUFFER; - size_t lenwi = len * sizeof(wchar_t); - char buf[ACE_MAX_ICONV_BUFFER]; - char *stri = buf; - - size_t hr = iconv (ACE_Wide_To_Ascii_iconv_env, (char**)&wstri, &lenwi, &stri, &lensi); - if ((hr==size_t(-1))||(lensi==ACE_MAX_ICONV_BUFFER)) - { - char *str=new char[len]; - for (size_t i = 0; i < len; i++) - { - wchar_t *t = const_cast (wstr); - str[i] = static_cast (*(t + i)); - } - - return str; - } - char *str = new char[ACE_MAX_ICONV_BUFFER-lensi]; - ::memcpy(str, buf, ACE_MAX_ICONV_BUFFER-lensi); -# else /* ACE_HAS_ICONV */ - for (size_t i = 0; i < len; ++i) - { - wchar_t *t = const_cast (wstr); - str[i] = static_cast (*(t + i)); - } -# endif /* ACE_WIN32 */ - return str; -} - -inline -ACE_Wide_To_Ascii::ACE_Wide_To_Ascii (const wchar_t *s) -{ -#if defined(ACE_HAS_ICONV) - if (ACE_Wide_To_Ascii_iconv_env == 0) - { - ACE_Wide_To_Ascii_iconv_env = iconv_open("", "WCHAR_T"); - } -#endif - s_ = ACE_Wide_To_Ascii::convert (s); -} - -inline -ACE_Ascii_To_Wide::~ACE_Ascii_To_Wide (void) -{ - delete [] this->s_; -} - -inline wchar_t * -ACE_Ascii_To_Wide::wchar_rep (void) -{ - return this->s_; -} - -inline wchar_t * -ACE_Ascii_To_Wide::convert (const char *str) -{ - // Short circuit null pointer case - if (str == 0) - return 0; - -# if defined (ACE_WIN32) - UINT const cp = GetACP (); // Codepage - int const len = ::MultiByteToWideChar (cp, 0, str, -1, 0, 0); -# else /* ACE_WIN32 */ - size_t const len = strlen (str) + 1; -# endif /* ACE_WIN32 */ - -#if !defined (ACE_HAS_ICONV) - wchar_t *wstr = new wchar_t[len]; -#endif - -# if defined (ACE_WIN32) - ::MultiByteToWideChar (cp, 0, str, -1, wstr, len); -# elif defined (ACE_VXWORKS) - ::mbstowcs (wstr, str, len); -# elif defined (ACE_HAS_ICONV) /* ACE_VXWORKS */ - char *stri = const_cast(str); - size_t lensi = len; - size_t lenwi = ACE_MAX_ICONV_BUFFER; - wchar_t buf[ACE_MAX_ICONV_BUFFER/sizeof(wchar_t)]; - wchar_t *wstri=buf; - - size_t hr=iconv(ACE_Ascii_To_Wide_iconv_env, &stri, &lensi, (char**)&wstri, &lenwi); - if((hr==size_t(-1))||(lenwi==ACE_MAX_ICONV_BUFFER)){ - wchar_t *wstr=new wchar_t[len*sizeof(wchar_t)]; - for (size_t i = 0; i < len; i++){ - char *t = const_cast (str); - wstr[i] = static_cast (*((unsigned char*)t + i)); - } - - return wstr; - } - wchar_t *wstr=new wchar_t[(ACE_MAX_ICONV_BUFFER-lenwi)/sizeof(wchar_t)]; - ::memcpy(wstr,buf,ACE_MAX_ICONV_BUFFER-lenwi); -# else /* ACE_HAS_ICONV */ - for (size_t i = 0; i < len; ++i) - { - char *t = const_cast (str); - wstr[i] = static_cast (*((unsigned char*)(t + i))); - } -# endif /* ACE_WIN32 */ - return wstr; -} - -inline -ACE_Ascii_To_Wide::ACE_Ascii_To_Wide (const char *s) -{ -#if defined(ACE_HAS_ICONV) - if (ACE_Ascii_To_Wide_iconv_env == 0) - { - ACE_Ascii_To_Wide_iconv_env = iconv_open("WCHAR_T", ""); - } -#endif - s_ = ACE_Ascii_To_Wide::convert (s); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_WCHAR */ diff --git a/dep/include/ace/checked_iterator.h b/dep/include/ace/checked_iterator.h deleted file mode 100644 index 3f4c6c14a08..00000000000 --- a/dep/include/ace/checked_iterator.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -#ifndef ACE_CHECKED_ITERATOR_H -#define ACE_CHECKED_ITERATOR_H - -/** - * @file checked_iterator.h - * - * @brief Checked iterator factory function. - * - * Some compilers (e.g. MSVC++ >= 8) issue security related - * diagnostics if algorithms such as std::copy() are used in an unsafe - * way. Normally this isn't an issue if STL container iterators are - * used in conjuction with the standard algorithms. However, in cases - * where application-specific iterators are use with standard - * algorithms that could potentially overrun a buffer, extra care must - * be taken to prevent such an overrun. If supported, checked - * iterators can be used to address the potential destination buffer - * overrun. - * - * This header provides function templates that generate the - * appropriate checked iterator. In cases where checked iterators are - * not supported, the pointer passed to the function is returned - * instead. - * - * $Id: checked_iterator.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @internal The functions and types in this header are meant for - * internal use. They may change at any point between - * releases. - * - * @author Ossama Othman - */ - -# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) -// Checked iterators are currently only supported in MSVC++ 8 or better. -# include -# endif /* _MSC_VER >= 1400 */ - -# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000 && _MSC_FULL_VER < 160020506) -template -stdext::checked_array_iterator -ACE_make_checked_array_iterator (PTR buf, size_t len) -{ - return stdext::checked_array_iterator (buf, len); -} -# else -template -PTR -ACE_make_checked_array_iterator (PTR buf, size_t /* len */) -{ - // Checked iterators are unsupported. Just return the pointer to - // the buffer itself. - return buf; -} -# endif /* _MSC_VER >= 1400 */ - -#endif /* ACE_CHECKED_ITERATOR_H */ - diff --git a/dep/include/ace/config-WinCE.h b/dep/include/ace/config-WinCE.h deleted file mode 100644 index a7ba1a72a8a..00000000000 --- a/dep/include/ace/config-WinCE.h +++ /dev/null @@ -1,237 +0,0 @@ -// $Id: config-WinCE.h 81693 2008-05-14 12:35:01Z johnnyw $ - -// Note: For WinCE build, simply use: #include "ace/config-win32.h" -// It is same as config.h for Windows NT/2k so that you can -// share same files and directories for both WinCE and NT/2k -// builds, unless you add additional definition(s) for each -// specific build or change the output directory. - -#ifndef ACE_CONFIG_WINCE_H -#define ACE_CONFIG_WINCE_H - -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -# error Use config-win32.h in config.h instead of this header -#endif // ACE_CONFIG_WIN32_H - -#if !defined (UNDER_CE) -# error Define UNDER_CE to version (i.e. 300 = 3.0) -#endif // UNDER_CE - -#if (UNDER_CE < 300) -# error ACE requires Windows CE 3.0 and later. -#endif // UNDER_CE - -#if (UNDER_CE < 400) -// CE 3 doesn't have Winsock 2, but CE 4 does. -# if !defined (ACE_HAS_WINSOCK2) -# define ACE_HAS_WINSOCK2 0 -# endif -# define ACE_LACKS_ASSERT_H -# define ACE_LACKS_SEARCH_H -# define ACE_LACKS_WCHAR_H -# define ACE_LACKS_WCTYPE_H -# define ACE_LACKS_STDDEF_H -# define ACE_LACKS_PTRDIFF_T -#endif /* UNDER_CE < 400 */ - -#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_WINCE 1 -#endif - -#if defined (_MSC_VER) && (_MSC_VER < 1400) -// WinCE prior to Visual Studio 2005 integration doesn't have most of -// the standard C library time functions. It also doesn't define struct tm. -// SYSTEMTIME has pretty much the same info though, so we can map it when -// needed. Define struct tm here and use it when needed. This is taken -// from the standard C library. -# define ACE_LACKS_STRUCT_TM -#endif - -// We need these libraries to build: -#pragma comment(lib,"corelibc.lib") -#pragma comment(linker, "/nodefaultlib:oldnames.lib") - -// Only DLL version is supported on CE. -//#if defined (ACE_HAS_DLL) -//# undef ACE_HAS_DLL -//#endif // ACE_HAS_DLL -//#define ACE_HAS_DLL 1 - -// Need to define LD search path explicitly on CE because -// CE doesn't have environment variables and we can't get -// the information using getenv. -#define ACE_DEFAULT_LD_SEARCH_PATH ACE_TEXT (".\\;\\windows") - -#define ACE_LACKS_FCNTL_H -#define ACE_LACKS_SYS_TYPES_H -#define ACE_LACKS_GETCWD -#define ACE_LACKS_ASCTIME -#define ACE_LACKS_ASCTIME_R -#define ACE_LACKS_GMTIME -#define ACE_LACKS_GMTIME_R -#define ACE_LACKS_LOCALTIME -#define ACE_LACKS_PERROR -#define ACE_LACKS_STRFTIME -#define ACE_LACKS_WIN32_SETFILEPOINTEREX -#define ACE_LACKS_WIN32_SERVICES -#define ACE_LACKS_WIN32_SECURITY_DESCRIPTORS -#define ACE_LACKS_GETPROCESSTIMES -#define ACE_LACKS_PDH_H -#define ACE_LACKS_PDHMSG_H - -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 - -#define ACE_LACKS_MSG_WFMO -#define ACE_LACKS_UMASK - -// WinCE only supports the UNICODE API -#if !defined (ACE_USES_WCHAR) -# define ACE_USES_WCHAR -#endif /* ACE_USES_WCHAR */ - -#define ACE_USES_WINCE_SEMA_SIMULATION - -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER 1 - -// FILE stuff isn't always defined in CE -#if (_MSC_VER < 1400) && !defined (_FILE_DEFINED) - typedef void FILE; -# define _FILE_DEFINED -#endif /* _MSC_VER < 1400 && !_FILE_DEFINED */ - -// This was defined in previous versions of CE, but not 2.11 -#define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION - -#define ACE_MAIN WINAPI WinMain - -// SH3 cross-compiler can't handle inline functions correctly -// (along with other bugs.) -#if defined (SH3) -# define ACE_LACKS_INLINE_FUNCTIONS -#endif // SH3 && _DEBUG - -#ifndef ACE_DEFAULT_SERVER_HOST -# define ACE_DEFAULT_SERVER_HOST ACE_TEXT("localhost") -#endif // ACE_DEFAULT_SERVER_HOST - -// @@ Need to remap every function that uses any of these flags to -// Win32 API. These are for ANSI styled function and are not -// available on WinCE. - -#define _O_RDONLY 0x0000 // open for reading only -#define _O_WRONLY 0x0001 // open for writing only -#define _O_RDWR 0x0002 // open for reading and writing -#define _O_APPEND 0x0008 // writes done at eof - -#define _O_CREAT 0x0100 // create and open file -#define _O_TRUNC 0x0200 // open and truncate -#define _O_EXCL 0x0400 // open only if file doesn't already exist - -// O_TEXT files have sequences translated to on read()'s, -// and sequences translated to on write()'s -#define _O_TEXT 0x4000 // file mode is text (translated) -#define _O_BINARY 0x8000 // file mode is binary (untranslated) - -// macro to translate the C 2.0 name used to force binary mode for files -//#define _O_RAW _O_BINARY - -// Open handle inherit bit -//#define _O_NOINHERIT 0x0080 // child process doesn't inherit file - -// Temporary file bit - file is deleted when last handle is closed -#define _O_TEMPORARY 0x0040 // temporary file bit - -// temporary access hint -//#define _O_SHORT_LIVED 0x1000 // temporary storage file, try not to flush - -// sequential/random access hints -//#define _O_SEQUENTIAL 0x0020 // file access is primarily sequential -//#define _O_RANDOM 0x0010 // file access is primarily random - -// Non-ANSI names -#define O_RDONLY _O_RDONLY -#define O_WRONLY _O_WRONLY -#define O_RDWR _O_RDWR -#define O_APPEND _O_APPEND -#define O_CREAT _O_CREAT -#define O_TRUNC _O_TRUNC -#define O_EXCL _O_EXCL -#define O_TEXT _O_TEXT -#define O_BINARY _O_BINARY -#define O_TEMPORARY _O_TEMPORARY -//#define O_RAW _O_BINARY -//#define O_NOINHERIT _O_NOINHERIT -//#define O_SEQUENTIAL _O_SEQUENTIAL -//#define O_RANDOM _O_RANDOM - -// @@ NSIG value. This is definitely not correct. -#define NSIG 23 - -// @@ For some reason, WinCE forgot to define this. -// Need to find out what it is. (Used in MapViewOfFile ().) -#define FILE_MAP_COPY 0 - -#define ACE_LACKS_STRCASECMP // WinCE doesn't support _stricmp -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_ACCESS -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_EXEC -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_STRRCHR -#define ACE_LACKS_BSEARCH -#define ACE_LACKS_SOCKET_BUFSIZ -#define ACE_LACKS_ISATTY -#define ACE_LACKS_STRERROR -#define ACE_LACKS_SYSTEM -#define ACE_LACKS_SIGACTION -#define ACE_LACKS_PIPE - -//#define ACE_LACKS_CUSERID -//#define ACE_LACKS_CHDIR -#define ACE_LACKS_ENV -#define ACE_LACKS_HOSTNAME -#define ACE_LACKS_REALPATH -#define ACE_LACKS_READLINK -#define ACE_LACKS_SWAB -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETPROTOBYNAME - -#if defined (_WIN32_WCE_EMULATION) -// @@ For some reason, qsort isn't defined correctly (_stdcall vs _cdecl) -// under emulation. So for right now, exclude it. -# define ACE_LACKS_QSORT -#endif // _WIN32_WCE_EMULATION - -#if !defined (BUFSIZ) -# define BUFSIZ 1024 -#endif - -typedef void (__cdecl * __sighandler_t)(int); // keep Signal compilation happy -typedef long off_t; - -#define ACE_LACKS_MALLOC_H // We do have malloc.h, but don't use it. - -#define ACE_HAS_WINCE_BROKEN_ERRNO - -#define ACE_HAS_STRDUP_EMULATION - -// WinCE can't do fixed addresses for memory-mapped files. -#if defined (ACE_DEFAULT_BASE_ADDR) -# undef ACE_DEFAULT_BASE_ADDR -#endif -#define ACE_DEFAULT_BASE_ADDR 0 - -#define ACE_HAS_TSS_EMULATION - -// This is still true up thru VC8... -#define ACE_LACKS_ERRNO_H -#define ACE_LACKS_SIGNAL_H -#define ACE_LACKS_SYS_STAT_H - -#include /**/ "ace/post.h" - -#endif // ACE_CONFIG_WINCE_H - diff --git a/dep/include/ace/config-aix-5.x.h b/dep/include/ace/config-aix-5.x.h deleted file mode 100644 index 5c1972b5675..00000000000 --- a/dep/include/ace/config-aix-5.x.h +++ /dev/null @@ -1,334 +0,0 @@ -// $Id: config-aix-5.x.h 80826 2008-03-04 14:51:23Z wotte $ -// -// Config file for AIX 5.1 and higher. - -#ifndef ACE_CONFIG_AIX_5_X_H -#define ACE_CONFIG_AIX_5_X_H - -// This define is needed for building with Visual Age C++ 5 in incremental -// mode. In the batch mode build, platform_aix_ibm.GNU sets it. The incremental -// mode compiler won't be supported after ACE 5.3, so this will also go away -// in that timeframe, so don't worry about future AIX versions. -#if !defined (ACE_AIX_VERS) -# define ACE_AIX_VERS 501 -#endif - -// AIX 5.1 has AIO, but it doesn't have the same API as other POSIX -// systems, and the semantics of operations are a bit different. Will take -// some real work to get this going. -// AIX 5.2, however, has the POSIX API implemented. However, the libc functions -// to implement it aren't exported by default. You need to use smit to enable -// them. So, leave AIO disabled unless the user explicitly enables it. -// config-aix-4.x.h will set ACE_HAS_AIO_CALLS if config-posix.h senses the -// feature-test macros, so set up _ACE_DISABLE_AIO_CALLS_ if the user didn't -// set it. Then check for it after including config-aix-4.x.h and remove -// ACE_HAS_AIO_CALLS if so. -#if !defined (ACE_HAS_AIO_CALLS) -# define _ACE_DISABLE_AIO_CALLS_ -#endif - -// Both IBM and g++ compilers set _THREAD_SAFE if compiler is asked to compile -// threaded code (xlC_r, as opposed to xlC; and g++ -pthread) -#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) -# if defined (ACE_HAS_THREADS) -# undef ACE_HAS_THREADS -# endif -# if defined (_THREAD_SAFE) -# define ACE_HAS_THREADS 1 -// # else -// # define ACE_HAS_THREADS 0 -# endif /* _THREAD_SAFE */ -#endif /* !ACE_MT_SAFE || (ACE_MT_SAFE != 0) */ - -#if defined (__xlC__) || defined (__IBMCPP__) - // AIX xlC, IBM C/C++, and Visual Age C++ compilers - //******************************************************************** - // - -// Compiler does this with a builtin - it's not in libc. -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//# define ACE_HAS_ALLOCA - -// Compiler supports the ssize_t typedef. -# define ACE_HAS_SSIZE_T - - // Keep an eye on this as the compiler and standards converge... -# define ACE_LACKS_LINEBUFFERED_STREAMBUF -# define ACE_LACKS_PRAGMA_ONCE - - // C Set++ 3.1, IBM C/C++ 3.6, and Visual Age C++ 5 batch (__xlC__) -# if defined (__xlC__) -# if (__xlC__ < 0x0500) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -# endif /* __xlC__ < 0x0500 */ -# endif - - // These are for Visual Age C++ only -# if defined (__IBMCPP__) && (__IBMCPP__ >= 600) -# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS - // When using -qtempinc, we don't need to see template implementation - // source (though we do need a pragma to find the correct source file). - // However, without -qtempinc (either -qnotempinc or -qtemplateregistry) - // we do need to see the source. -# if defined (__TEMPINC__) -# if !defined ACE_TEMPLATES_REQUIRE_PRAGMA -# define ACE_TEMPLATES_REQUIRE_PRAGMA -# endif -# else -# if !defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# define ACE_TEMPLATES_REQUIRE_SOURCE -# endif -# endif /* __TEMPINC__ */ - -# undef WIFEXITED -# undef WEXITSTATUS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -# if (__IBMCPP__ >= 600) /* Visual Age 6 and XL C/C++ 7 and up */ -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_Proper_Export_Flag -# define ACE_Proper_Import_Flag -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE < CLASS, LOCK >; -# endif /* __IBMCPP__ >= 600 */ -# endif /* __IBMCPP__ */ - -#elif defined (__GNUG__) - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS - -# include "ace/config-g++-common.h" - // Denotes that GNU has cstring.h as standard, to redefine memchr(). -# define ACE_HAS_GNU_CSTRING_H -# define ACE_HAS_SSIZE_T - -# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)) -// We have to explicitly instantiate static template members prior to g++ 4.1 -# define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION -#endif /* g++ prior to 4.1 */ - -# if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0 - // ACE_MT_SAFE is #defined below, for all compilers. -# if !defined (_REENTRANT) -# define _REENTRANT -# endif /* _REENTRANT */ -# endif /* !ACE_MT_SAFE */ - -#else /* ! __xlC__ && ! __GNUG__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-aix-5.x.h -# endif /* __cplusplus */ -#endif /* ! __xlC__ && ! __GNUG__ */ - -// Compiling for AIX. -#ifndef AIX -# define AIX -#endif /* AIX */ - -// Pick up all the detectable settings. -#include "ace/config-posix.h" - -// Regardless of what config-posix.h may indicate, AIX 5.3 is the first -// to support sem_timedwait(). Prior to that, use the emulation. -#if defined (ACE_HAS_POSIX_SEM_TIMEOUT) && \ - (defined (ACE_AIX_VERS) && (ACE_AIX_VERS < 503)) -# undef ACE_HAS_POSIX_SEM_TIMEOUT -#endif /* ACE_HAS_POSIX_SEM_TIMEOUT && ACE_AIX_VERS < 503 */ - -#if defined (ACE_DLL_SUFFIX) -# undef ACE_DLL_SUFFIX -#endif -#define ACE_DLL_SUFFIX ".so" - -#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -#define ACE_HAS_SOCKLEN_T -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG - -// AIX has AIO, but the functions don't match those of other AIO-enabled -// platforms. If this is to work, it'll require some significant work, -// maybe moving the OS-abstraction stuff to an OS_AIO or some such thing. -//# define ACE_HAS_AIO_CALLS - -#define ACE_HAS_AIX_HI_RES_TIMER - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// OS has readdir and friends. -#define ACE_HAS_DIRENT - -// OS supports the getrusage() system call -#define ACE_HAS_GETRUSAGE - -#define ACE_HAS_GPERF - -#define ACE_HAS_H_ERRNO - -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_SYS_SYSCTL_H - -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_IP_MULTICAST - -// Lacks perfect filtering, must bind group address. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -#define ACE_HAS_MSG - -// Compiler/platform supports poll(). -#define ACE_HAS_POLL - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -#define ACE_HAS_POSIX_TIME -// ... but needs to include another header for it on 4.2+ -# define ACE_HAS_BROKEN_POSIX_TIME -// ... and needs another typedef -#define ACE_LACKS_TIMESPEC_T -#define ACE_HAS_SELECT_H - -#define ACE_HAS_REENTRANT_FUNCTIONS - -// Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_STRBUF_T - -// Compiler supports stropts.h -#define ACE_HAS_STREAMS -// #define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// AIX bzero() -#define ACE_HAS_STRINGS - -#define ACE_HAS_STRUCT_NETDB_DATA - -// Dynamic linking is in good shape on newer OS/patch levels. If you have -// trouble with the dynamic linking parts of ACE, and can't patch your OS -// up to latest levels, comment this out. -#define ACE_HAS_SVR4_DYNAMIC_LINKING -// This is tightly related to dynamic linking... -#define ACE_HAS_AUTOMATIC_INIT_FINI - -#define ACE_HAS_SVR4_GETTIMEOFDAY - -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_TIMOD_H -#define ACE_HAS_XTI -#define ACE_HAS_BROKEN_T_ERROR -#define ACE_TLI_TCP_DEVICE "/dev/xti/tcp" - -#define ACE_HAS_UALARM - -#define ACE_HAS_UCONTEXT_T - -#define ACE_HAS_UTIME - -// Platform has XPG4 wide character type and functions. However, the size -// of wchar_t changes for 32- vs. 64-bit builds (unsigned short vs. unsigned -// int, respectively). -#define ACE_HAS_XPG4_MULTIBYTE_CHAR -#ifdef __64BIT__ -# define ACE_SIZEOF_WCHAR 4 -#else -# define ACE_SIZEOF_WCHAR 2 -#endif /* __64BIT__ */ - -#define ACE_LACKS_NETINET_TCP_H - -// AIX uses LIBPATH to search for libraries -#define ACE_LD_SEARCH_PATH "LIBPATH" - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -//************************************************************** -// -// Threads related definitions. -// -// The threads on AIX are generally POSIX P1003.1c (ACE_HAS_PTHREADS). -// However, there is also a kernel thread ID (tid_t) that is used in -// ACE_Log_Msg (printing the thread ID). The tid_t is not the same as -// pthread_t, and can't derive one from the other - thread_self() gets -// the tid_t (kernel thread ID) if called from a thread. -// Thanks very much to Chris Lahey for straightening this out. - -#if defined (ACE_HAS_THREADS) -# if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -# endif - -# define ACE_HAS_PTHREADS -# define ACE_HAS_PTHREADS_UNIX98_EXT -# define ACE_HAS_PTHREAD_CONTINUE_NP -# define ACE_HAS_PTHREAD_SUSPEND_NP -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -# define ACE_HAS_SIGTHREADMASK -# define ACE_HAS_THREAD_SPECIFIC_STORAGE - -# define ACE_LACKS_THREAD_PROCESS_SCOPING -#else -# undef ACE_HAS_THREADS -#endif /* ACE_HAS_THREADS != 0 */ - -#define ACE_MALLOC_ALIGN 8 - -#if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500) && !defined(_UNIX95) -# define ACE_HAS_3_PARAM_WCSTOK -#endif /* (_XOPEN_SOURCE -0) >= 500 && !_UNIX95 */ - -#if defined (_ACE_DISABLE_AIO_CALLS_) -# if defined (ACE_HAS_AIO_CALLS) -# undef ACE_HAS_AIO_CALLS -# endif -# undef _ACE_DISABLE_AIO_CALLS_ -#endif - -// AIX's /usr/include/unistd.h sets _POSIX_SEMAPHORE to indicate the system -// supplies such a facility, but the headers don't enable it unless -// _XOPEN_SOURCE >= 500. So disable semaphores here if _XOPEN_SOURCE isn't -// up to snuff. -#if defined (ACE_HAS_POSIX_SEM) && \ - (!defined (_XOPEN_SOURCE) || (_XOPEN_SOURCE-0 < 500)) -# undef ACE_HAS_POSIX_SEM -#endif - -// I think this is correct, but needs to be verified... -Steve Huston -#define ACE_HAS_SIGTIMEDWAIT - -// AIX 5.1 has netinet/tcp.h -#undef ACE_LACKS_NETINET_TCP_H - -#define ACE_HAS_3_PARAM_READDIR_R -#define ACE_HAS_POSIX_GETPWNAM_R -#define ACE_HAS_SCANDIR -#define ACE_SCANDIR_CMP_USES_VOIDPTR -#define ACE_SCANDIR_SEL_LACKS_CONST -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_TIMEZONE /* Call tzset() to set timezone */ - -#endif /* ACE_CONFIG_AIX_5_X_H */ - diff --git a/dep/include/ace/config-all.h b/dep/include/ace/config-all.h deleted file mode 100644 index 927bd14919b..00000000000 --- a/dep/include/ace/config-all.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file config-all.h - * - * $Id: config-all.h 81661 2008-05-09 12:05:34Z johnnyw $ - * - * @author (Originally in OS.h)Doug Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - */ -//========================================================================== - -#ifndef ACE_CONFIG_ALL_H -#define ACE_CONFIG_ALL_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// This is used to indicate that a platform doesn't support a -// particular feature. -#if defined ACE_HAS_VERBOSE_NOTSUP - // Print a console message with the file and line number of the - // unsupported function. -# include "ace/OS_NS_stdio.h" -# define ACE_NOTSUP_RETURN(FAILVALUE) do { errno = ENOTSUP; ACE_OS::fprintf (stderr, ACE_TEXT ("ACE_NOTSUP: %s, line %d\n"), __FILE__, __LINE__); return FAILVALUE; } while (0) -# define ACE_NOTSUP do { errno = ENOTSUP; ACE_OS::fprintf (stderr, ACE_TEXT ("ACE_NOTSUP: %s, line %d\n"), __FILE__, __LINE__); return; } while (0) -#else /* ! ACE_HAS_VERBOSE_NOTSUP */ -# define ACE_NOTSUP_RETURN(FAILVALUE) do { errno = ENOTSUP ; return FAILVALUE; } while (0) -# define ACE_NOTSUP do { errno = ENOTSUP; return; } while (0) -#endif /* ! ACE_HAS_VERBOSE_NOTSUP */ - -// ---------------------------------------------------------------- - -# define ACE_TRACE_IMPL(X) ACE_Trace ____ (ACE_TEXT (X), __LINE__, ACE_TEXT (__FILE__)) - -// By default tracing is turned off. -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -#if (ACE_NTRACE == 1) -# define ACE_TRACE(X) -#else -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* ACE_NTRACE */ - -// By default we perform no tracing on the OS layer, otherwise the -// coupling between the OS layer and Log_Msg is too tight. But the -// application can override the default if they wish to. -#if !defined (ACE_OS_NTRACE) -# define ACE_OS_NTRACE 1 -#endif /* ACE_OS_NTRACE */ - -#if (ACE_OS_NTRACE == 1) -# define ACE_OS_TRACE(X) -#else -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define ACE_OS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* ACE_OS_NTRACE */ - -#if !defined (ACE_HAS_MONITOR_FRAMEWORK) -# define ACE_HAS_MONITOR_FRAMEWORK 1 -#endif - -#if !defined (ACE_HAS_MONITOR_POINTS) -# define ACE_HAS_MONITOR_POINTS 0 -#endif - -// These includes are here to avoid circular dependencies. -// Keep this at the bottom of the file. It contains the main macros. -#include "ace/OS_main.h" - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_ALL_H */ - diff --git a/dep/include/ace/config-borland-common.h b/dep/include/ace/config-borland-common.h deleted file mode 100644 index 5c80c872ad7..00000000000 --- a/dep/include/ace/config-borland-common.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -//$Id: config-borland-common.h 82294 2008-07-12 13:03:37Z johnnyw $ - -// The following configuration file contains defines for Borland compilers. - -#ifndef ACE_CONFIG_BORLAND_COMMON_H -#define ACE_CONFIG_BORLAND_COMMON_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class __declspec (dllimport) T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllimport) SINGLETON_TYPE ; - -// In later versions of C++Builder we will prefer inline functions by -// default. The debug configuration of ACE is built with functions -// out-of-line, so when linking your application against a debug ACE -// build, you can choose to use the out-of-line functions by adding -// ACE_NO_INLINE=1 to your project settings. -# if !defined (__ACE_INLINE__) -# define __ACE_INLINE__ 1 -# endif /* __ACE_INLINE__ */ - -# define ACE_CC_NAME ACE_TEXT ("Borland C++ Builder") -# define ACE_CC_MAJOR_VERSION (__BORLANDC__ / 0x100) -# define ACE_CC_MINOR_VERSION (__BORLANDC__ % 0x100) -# define ACE_CC_BETA_VERSION (0) - -# ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR_ARGS "-q -P- -o%s" -# endif - -# define ACE_EXPORT_NESTED_CLASSES 1 -# define ACE_HAS_CPLUSPLUS_HEADERS 1 -# define ACE_HAS_EXCEPTIONS -# define ACE_HAS_GNU_CSTRING_H 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL -# define ACE_HAS_SIG_ATOMIC_T -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR -# define ACE_HAS_STRING_CLASS 1 -# define ACE_HAS_TEMPLATE_TYPEDEFS 1 -# define ACE_HAS_USER_MODE_MASKS 1 -# define ACE_LACKS_ACE_IOSTREAM 1 -# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -# define ACE_LACKS_STRPTIME 1 -# if (__BORLANDC__ < 0x590) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE 1 -# endif -# define ACE_LACKS_PRAGMA_ONCE 1 -# define ACE_HAS_NEW_NOTHROW -# define ACE_TEMPLATES_REQUIRE_SOURCE 1 -# define ACE_SIZEOF_LONG_DOUBLE 10 -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Lu") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDC_LIB 0 -# define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) -# define ACE_LACKS_SWAB - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_BORLAND_COMMON_H */ - diff --git a/dep/include/ace/config-cray.h b/dep/include/ace/config-cray.h deleted file mode 100644 index 87fe263503d..00000000000 --- a/dep/include/ace/config-cray.h +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-cray.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_CONFIG_CRAY_H -#define ACE_CONFIG_CRAY_H -#include /**/ "ace/pre.h" - -/* - The following predefined macros are used within ACE ifdefs. - These are defined when using the Cray compilers. _CRAYMPP - is defined, for example, if you are running on a Cray T3E - massively parallel machine. Moreover, in the case of the T3E, - _CRAYT3E will be defined. This is used to determine the - ACE_SIZEOF defines for primitive types. - - _UNICOS is defined as either the major version of UNICOS being run, - e.g. 9 or 10 on the vector machines (e.g. C90, T90, J90, YMP, ...) - or the major+minor+level UNICOS/mk version, e.g. 2.0.3 => 203, - being run on an MPP machine. - - Summary: - - _CRAYMPP (defined only if running on MPP machine, e.g. T3E, UNICOS/mk) - _CRAYT3E (defined specifically if compiling on a Cray T3E) - _UNICOS (defined if running UNICOS or UNICOS/mk) - - Tested on UNICOS 10.0.0.5, UNICOS/mk 2.0.4.57 - Compiles on UNICOS 9.0.2.8, but some tests deadlock - - Contributed by Doug Anderson -*/ - -#if defined (_UNICOS) && !defined (MAXPATHLEN) -#define MAXPATHLEN 1023 -#endif /* _UNICOS */ - -#define ACE_DEFAULT_CLOSE_ALL_HANDLES 0 - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -#define ACE_HAS_CPLUSPLUS_HEADERS - -#define ACE_HAS_SSIZE_T - -#define ACE_HAS_SYSV_IPC - -#define ACE_MT_SAFE 1 - -#define ACE_HAS_THREADS - -#define ACE_HAS_PTHREADS - -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -#define ACE_HAS_POSIX_TIME - -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_HAS_POSIX_NONBLOCK - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_DIRENT - -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_IP_MULTICAST - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_HAS_NONCONST_READLINK - -#define ACE_HAS_CHARPTR_SOCKOPT - -#define ACE_HAS_NONCONST_GETBY - -// has man pages, but links with missing symbols and I can't find lib yet -/* #define ACE_HAS_REGEX */ - -#define ACE_HAS_SIG_MACROS - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -#if _UNICOS > 9 -# define ACE_HAS_SIGWAIT -#endif - -#define ACE_HAS_SIG_ATOMIC_T - -#define ACE_HAS_SIGISMEMBER_BUG - -#define ACE_HAS_MSG - -#define ACE_HAS_STRERROR - -#define ACE_HAS_GPERF - -// Special modifications that apply to UNICOS/mk -#if defined(_CRAYMPP) - -# define ACE_HAS_SIGINFO_T -# define ACE_HAS_UCONTEXT_T - -#endif - -// The Cray T90 supposedly supports SYSV SHMEM, but I was unable to get it -// working. Of course, all other Cray PVP and MPP systems do NOT support it, -// so it's probably good to just define like this for consistency -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_MMAP -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_MADVISE -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_PTHREAD_CLEANUP -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_THREAD_PROCESS_SCOPING - -#if !defined(_CRAYMPP) - -#define ACE_LACKS_PTHREAD_CANCEL -#define ACE_LACKS_PTHREAD_KILL - -#endif - -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_PRI_T -#define ACE_LACKS_GETPGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_READV -#define ACE_LACKS_RLIMIT - -// we probably want to fake not having this, since Cray memory mgmt is different -#define ACE_LACKS_SBRK - -#define ACE_LACKS_SETSCHED - -#define ACE_LACKS_SIGINFO_H - -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_WRITEV - -// Cray vector machines are "word" oriented, and modern ones are hard 64-bit. -// "char" is somewhat of a special case. Most problems arise when code thinks -// it can address 32-bit quantities and the like. MPP crays are typically -// byte oriented, e.g. T3E uses Alpha processors, so we don't need as much -// special treatment. - -#ifndef _CRAYMPP - -# define ACE_SIZEOF_CHAR 1 -# define ACE_SIZEOF_SHORT 8 -# define ACE_SIZEOF_INT 8 -# define ACE_SIZEOF_LONG 8 -# define ACE_SIZEOF_LONG_LONG 8 -# define ACE_SIZEOF_FLOAT 8 -# define ACE_SIZEOF_DOUBLE 8 -# define ACE_SIZEOF_LONG_DOUBLE 16 -# define ACE_SIZEOF_VOID_P 8 - -#elif defined(_CRAYT3E) - -# define ACE_SIZEOF_CHAR 1 -# define ACE_SIZEOF_SHORT 4 -# define ACE_SIZEOF_INT 8 -# define ACE_SIZEOF_LONG 8 -# define ACE_SIZEOF_LONG_LONG 8 -# define ACE_SIZEOF_FLOAT 4 -# define ACE_SIZEOF_DOUBLE 8 -# define ACE_SIZEOF_LONG_DOUBLE 8 -# define ACE_SIZEOF_VOID_P 8 - -#endif - -// Ones to check out at some point - -/* #define ACE_HAS_SYS_SIGLIST */ - -// C++ Compiler stuff to verify -/* #define ACE_NEW_THROWS_EXCEPTIONS */ -/* #define ACE_HAS_TEMPLATE_TYPEDEFS */ - -// thread issues to check out -/* #define ACE_LACKS_TIMEDWAIT_PROTOTYPES */ - -// Cray does seem to support it, in -lnsl and has tiuser.h header -/* #define ACE_HAS_TLI */ -/* #define ACE_HAS_TIUSER_H */ -/* #define ACE_HAS_TLI_PROTOTYPES */ -/* #define ACE_LACKS_T_ERRNO */ - -/* #define ACE_LACKS_NAMED_POSIX_SEM */ - -/* #define ACE_HAS_SYS_ERRLIST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_CRAY_H */ - diff --git a/dep/include/ace/config-cxx-common.h b/dep/include/ace/config-cxx-common.h deleted file mode 100644 index 6d467d64964..00000000000 --- a/dep/include/ace/config-cxx-common.h +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-cxx-common.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_CXX_COMMON_H -#define ACE_CXX_COMMON_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_CONFIG_INCLUDE_CXX_COMMON) -# error ace/config-cxx-common.h: ACE configuration error! Do not #include this file directly! -#endif - -#if defined (__DECCXX) -# if !defined (linux) -# define ACE_HAS_STRING_CLASS -# if (__DECCXX_VER >= 60090010) -# define ACE_HAS_STDCPP_STL_INCLUDES -# endif /* __DECCXX_VER < 60090010 */ -# endif /* ! linux */ - -# define DEC_CXX -# define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -# define ACE_LACKS_LINEBUFFERED_STREAMBUF -# define ACE_LACKS_SIGNED_CHAR -# define ACE_HAS_CPLUSPLUS_HEADERS -# define ACE_TEMPLATES_REQUIRE_SOURCE -# if (__DECCXX_VER >= 60090010) - // DEC CXX 6.0 supports exceptions, etc., by default. Exceptions - // are enabled by platform_osf1_4.x.GNU/wrapper_macros.GNU. -# if defined (ACE_HAS_EXCEPTIONS) -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_TEMPLATE_TYPEDEFS - -# define ACE_ENDLESS_LOOP \ - unsigned int ace_endless_loop____ = 0; if (ace_endless_loop____) break; - -# if defined (__USE_STD_IOSTREAM) -# define ACE_LACKS_CHAR_RIGHT_SHIFTS -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_UNBUFFERED_STREAMBUF -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# else /* ! __USE_STD_IOSTREAM */ -# define ACE_USES_OLD_IOSTREAMS -# endif /* ! __USE_STD_IOSTREAM */ - -// 9: nested comment not allowed. (/usr/include/pdsc.h!) (nestcomment) -// 177: variable was declared but never referenced (declbutnotref) -// 193: zero used for undefined preprocessing identifier (undpreid) -// 236: controlling expression is constant (boolexprconst) -// 401: base_class_with_nonvirtual_dtor (basclsnondto) -// 1016: expected type is incompatible with declared type of int (incint) -// 1136: conversion to smaller size integer could lose data (intconlosbit) - -# pragma message disable basclsnondto -# pragma message disable boolexprconst -# pragma message disable undpreid -# pragma message disable notusetmpfunprm -# pragma message disable bltinclnk - -# if (__DECCXX_VER >= 60190029) - // 6.1-029 and later support msg 1136. Disable it because it - // causes warnings from ACE and/or TAO. -# pragma message disable intconlosbit -# endif /* __DECCXX_VER >= 60190029 */ - -# if (__DECCXX_VER == 60190027) - // Seems that this version of cxx doesn't have reset -# define ACE_AUTO_PTR_LACKS_RESET -# endif /* __DECCXX_VER == 60190027 */ - -# if defined (DIGITAL_UNIX) && DIGITAL_UNIX >= 0x40D - // variable "PTHREAD_THIS_CATCH_NP" was declared but never referenced -# pragma message disable declbutnotref -# endif /* DIGITAL_UNIX >= 4.0f */ - -# else /* __DECCXX_VER < 60090010 */ -# define ACE_LACKS_PRAGMA_ONCE -# endif /* __DECCXX_VER < 60090010 */ -#else /* ! __DECCXX */ -# error ace/config-cxx-common.h can only be used with Compaq CXX! -#endif /* ! __DECCXX */ - -#include /**/ "ace/post.h" -#endif /* ACE_CXX_COMMON_H */ - diff --git a/dep/include/ace/config-cygwin32.h b/dep/include/ace/config-cygwin32.h deleted file mode 100644 index e6683e29795..00000000000 --- a/dep/include/ace/config-cygwin32.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-cygwin32.h 81809 2008-05-30 13:40:21Z vzykov $ - -// The following configuration file is designed to work for CygWin -// platforms using GNU C++. - -#ifndef ACE_CONFIG_CYGWIN32_H -#define ACE_CONFIG_CYGWIN32_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_MT_SAFE) -#define ACE_MT_SAFE 1 -#endif - -#define CYGWIN32 - -// We trust this file will get included before -#if !defined(FD_SETSIZE) -# define FD_SETSIZE 1024 -#endif - -#if !defined (ACE_IOV_MAX) -# define ACE_IOV_MAX 64 -#endif /* ACE_IOV_MAX */ - -// Define custom export macros for export/import of symbols from/of dll's -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; - -#define ACE_HAS_SELECT_H - -#define ACE_LACKS_PRAGMA_ONCE - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#include /**/ - -// Needed to differentiate between libc 5 and libc 6 (aka glibc). -// It's there on all libc 5 systems I checked. -#include /**/ - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -#define ACE_HAS_STRING_CLASS - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#else -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-cygwin32.h -# endif /* __cplusplus */ -#endif /* __GNUG__ */ - -#define ACE_HAS_VOIDPTR_SOCKOPT 1 -#define ACE_HAS_UALARM 1 -#define ACE_HAS_SYS_ERRLIST 1 -#define ACE_HAS_STRNLEN 1 -#define ACE_HAS_POSIX_GETPWNAM_R 1 -#define ACE_HAS_POSIX_NONBLOCK 1 -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_CLOCK_GETTIME 1 -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_HAS_MSG -#define ACE_DEFAULT_BASE_ADDR ((char *) 0x8000000) -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_SVR4_DYNAMIC_LINKING -//#define ACE_HAS_SYSV_IPC -#define ACE_HAS_VOIDPTR_MMAP -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_POLL -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 -#define ACE_HAS_SOCKADDR_MSG_NAME 1 -#define ACE_LACKS_PRI_T 1 -#define ACE_HAS_3_PARAM_READDIR_R - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you want ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_IP_MULTICAST - -#define ACE_HAS_BIG_FD_SET - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 - -#define ACE_DEFAULT_SELECT_REACTOR_SIZE 256 - -#define ACE_HAS_GETPAGESIZE - -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -#define ACE_HAS_SOCKLEN_T 1 - -#define ACE_HAS_GPERF - -#define ACE_HAS_DIRENT -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG - -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_FGETWC 1 -#define ACE_LACKS_NAMED_POSIX_SEM -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_MADVISE -#define ACE_LACKS_GETPGID_PROTOTYPE -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_ITOW 1 -#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T 1 -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_SYS_SYSCTL_H - -#define ACE_LACKS_FGETWS 1 -#define ACE_LACKS_FPUTWS 1 - -#define ACE_LACKS_WCSTOULL 1 - -#define ACE_HAS_AUTOMATIC_INIT_FINI - -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_SIG_C_FUNC 1 -#define ACE_HAS_SIG_ATOMIC_T - -#define ACE_HAS_POSIX_SEM - -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -// Cygwin DLL suffix is .dll -#define ACE_DLL_SUFFIX ACE_TEXT (".dll") - -// Cygwin runs on Windows, so we have to get the environment variable PATH and -// not LD_LIBRARY_PATH which is the default in ACE -#define ACE_LD_SEARCH_PATH ACE_TEXT ("PATH") - -#if ACE_MT_SAFE -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads (LinuxThreads implementation) -# define ACE_HAS_PTHREADS - -# define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS - -// Compiler/platform has thread-specific storage -# define ACE_HAS_THREAD_SPECIFIC_STORAGE - -# define ACE_HAS_PTHREADS_UNIX98_EXT -# define ACE_HAS_PTHREAD_CONTINUE 1 -# define ACE_HAS_PTHREAD_SUSPEND 1 - -# define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR -// Cygwin (see pthread.h): Not supported or implemented. -# define ACE_LACKS_SETSCHED -# define ACE_LACKS_SETDETACH -# define ACE_LACKS_PTHREAD_CANCEL -# define ACE_LACKS_THREAD_PROCESS_SCOPING -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_RWLOCKATTR_PSHARED -# define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 -# define ACE_LACKS_PTHREAD_YIELD 1 -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK - -// In the 1.5.9 release of Cygwin the pthread_kill gives an access violation -// so for the time being we say Cygwin doesn't support pthread_kill. -# define ACE_LACKS_PTHREAD_KILL - -#endif /* ACE_MT_SAFE */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_CYGWIN32_H */ - diff --git a/dep/include/ace/config-doxygen.h b/dep/include/ace/config-doxygen.h deleted file mode 100644 index d4e8a068e43..00000000000 --- a/dep/include/ace/config-doxygen.h +++ /dev/null @@ -1,121 +0,0 @@ -// -*- C++ -*- - -/** - * This is a configuration file to define all the macros that Doxygen - * needs - * - * @file config-doxygen.h - * - * $Id: config-doxygen.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - * @author Darrell Brunsch - * - */ -#ifndef ACE_CONFIG_DOXYGEN_H -#define ACE_CONFIG_DOXYGEN_H - -/// Make sure that we always turn inlining on. -#define __ACE_INLINE__ - -/// Make the wchar_t interfaces available. -#define ACE_HAS_WCHAR - -/// Make all the emulation versions of string operations visible -// #define ACE_LACKS_WCSTOK -#define ACE_LACKS_ITOW -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_STRRCHR -#define ACE_LACKS_WCSCAT -#define ACE_LACKS_WCSCHR -#define ACE_LACKS_WCSCMP -#define ACE_LACKS_WCSCPY -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSLEN -#define ACE_LACKS_WCSNCAT -#define ACE_LACKS_WCSNCMP -#define ACE_LACKS_WCSNCPY -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSPBRK -#define ACE_LACKS_WCSRCHR -#define ACE_LACKS_WCSCSPN -#define ACE_LACKS_WCSSPN -#define ACE_LACKS_WCSSTR - -/// Support for threads enables several important classes -#define ACE_HAS_THREADS - -/// Support for Win32 enables the WFMO_Reactor and several Async I/O -/// classes -#define ACE_WIN32 - -/// Enable support for POSIX Asynchronous I/O calls -#define ACE_HAS_AIO_CALLS - -/// Enable support for TLI interfaces -#define ACE_HAS_TLI - -/// Enable support for the SSL wrappers -#define ACE_HAS_SSL 1 - -/// Enable exceptions -#define ACE_HAS_EXCEPTIONS - -/// Enable timeprobes -#define ACE_COMPILE_TIMEPROBES - -/// Enable unicode to generate ACE_Registry_Name_Space -#define UNICODE - -/// These defines make sure that Svc_Conf_y.cpp and Svc_Conf_l.cpp are correctly -/// parsed -#define __cplusplus -#define ACE_YY_USE_PROTOS - -/// TAO features that should be documented too -#define TAO_HAS_RT_CORBA 1 -#define TAO_HAS_MINIMUM_CORBA 0 -#define TAO_HAS_AMI 1 -#define TAO_HAS_INTERCEPTORS 1 -#define TAO_HAS_SCIOP 1 -#define TAO_HAS_COIOP 1 -#define TAO_HAS_TRANSPORT_CURRENT 1 - -/// Generate token library documentation -#define ACE_HAS_TOKENS_LIBRARY - -/// Generate ACE ATM classes documentation -#define ACE_HAS_ATM - -/// Generate ACE XTI ATM class documentation -#define ACE_HAS_XTI_ATM - -/// Generate ACE_Dev_Poll_Reactor documentation -#define ACE_HAS_DEV_POLL - -/// Generate ACE_Event_Handler_T documentation -#define ACE_HAS_TEMPLATE_TYPEDEFS - -/// Generate ACE_Log_Msg_NT_Event_Log documentation -#define ACE_HAS_LOG_MSG_NT_EVENT_LOG - -/// Generate icmp documentation -#define ACE_HAS_ICMP_SUPPORT 1 - -/// Don't expand ACE_RCSID macro -#define ACE_USE_RCSID 0 - -/// Parse some ACE_SSL classes that depend on recent versions of -/// OpenSSL. -#define OPENSSL_VERSION_NUMBER 0x00905820L - -/// Enable IPv6 -#define ACE_HAS_IPV6 - -/// Enable netlink socket support -#define ACE_HAS_NETLINK - -#define ACE_HAS_IP_MULTICAST - -#endif /* ACE_CONFIG_DOXYGEN_H */ - diff --git a/dep/include/ace/config-freebsd.h b/dep/include/ace/config-freebsd.h deleted file mode 100644 index 6f4c5750f98..00000000000 --- a/dep/include/ace/config-freebsd.h +++ /dev/null @@ -1,284 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-freebsd.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for FreeBSD - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE - // Yes, we do have threads. -# define ACE_HAS_THREADS 1 -#else - // Set to 0 since that's what config-posix.h checks for. -# define ACE_HAS_THREADS 0 -#endif /* ACE_MT_SAFE */ - -#include "ace/config-posix.h" - -#include -// Make sure we source in the OS version. - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if (__FreeBSD_version < 220000) -#if defined (ACE_HAS_THREADS) -#error Threads are not supported. -#endif /* ACE_HAS_THREADS */ -#endif /* __FreeBSD_version < 220000 */ - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -// Platform specific directives -// gcc defines __FreeBSD__ automatically for us. -#ifdef ACE_HAS_THREADS -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ -#endif - -#define ACE_HAS_GPERF - -#if (__FreeBSD_version < 420000) -#define ACE_LACKS_GETPGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_PTHREAD_CANCEL -#endif /* __FreeBSD_version < 420000 */ - -#define ACE_HAS_ALT_CUSERID -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_SIG_MACROS -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_CHARPTR_DL - -#if (__FreeBSD_version < 400000) -#define ACE_LACKS_SIGSET -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_SETSCHED -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#endif - -#define ACE_NEEDS_SCHED_H - -#if (__FreeBSD_version < 400000) -enum schedparam_policy { - SCHED_RR, - SCHED_IO, - SCHED_FIFO, - SCHED_OTHER -}; -#endif - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -// This won't be necessary after it is fixed in the system include headers. -extern "C" { char * cuserid (char *s); } - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#if (__FreeBSD_version < 501000) -#define ACE_LACKS_STDINT_H -#endif - -#define ACE_HAS_SYSCTL -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#if (__FreeBSD_version >= 220000) -#define ACE_HAS_VASPRINTF -#endif - -#if (__FreeBSD_version >= 300000) -#define ACE_HAS_SIGINFO_T -#endif /* __FreeBSD_version >= 300000 */ - -#if (__FreeBSD_version >= 320000) -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#endif /* __FreeBSD_version >= 320000 */ - -#if (__FreeBSD_version >= 440000) -#define ACE_HAS_GETPROGNAME -#define ACE_HAS_SETPROGNAME -#endif - -#if (__FreeBSD_version < 501000) -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS -#endif - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_LOG2 -#define ACE_LACKS_SI_ADDR - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform supports SVR4 dynamic linking semantics.. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Lacks perfect filtering, must bind group address. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -// Compiler/platform has -//#define ACE_HAS_ALLOCA_H - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports sys_siglist array. -// *** This refers to (_sys_siglist) instead of (sys_siglist) -// #define ACE_HAS_SYS_SIGLIST - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG - -#if (__FreeBSD_version < 500100) -# define ACE_HAS_NONCONST_MSGSND -#endif - -// Thread specific settings -// Yes, we do have threads. -#ifdef ACE_HAS_THREADS -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif /* ! ACE_MT_SAFE */ -#endif /* ACE_HAS_THREADS */ - -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_DIRENT - -#define ACE_HAS_SIGWAIT - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#if (__FreeBSD_version > 400000) -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_SOCKLEN_T -#define ACE_HAS_GETIFADDRS -#define ACE_HAS_PTHREADS_UNIX98_EXT -#endif - -// Note, on FreeBSD 5, POSIX aio is now an optional kernel module which -// must be loaded. -// Read the aio(4) man page for what to do, otherwise any aio_* call -// will coredump. - -// By default use Proactor which does not use POSIX Real-time Signals. -#ifdef ACE_HAS_AIO_CALLS -# ifndef ACE_POSIX_AIOCB_PROACTOR -# define ACE_POSIX_AIOCB_PROACTOR -# endif /* ACE_POSIX_AIOCB_PROACTOR */ -#endif /* ACE_HAS_AIO_CALLS */ - -#define ACE_LACKS_STROPTS_H - -// Needed when ACE_HAS_WCHAR is defined. -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_ITOW -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_HAS_3_PARAM_READDIR_R - -#if (__FreeBSD_version >= 501000) -# define ACE_HAS_PTHREAD_SETSTACK -#endif - -#if (__FreeBSD_version < 700007) -# define ACE_HAS_SIGVAL_SIGVAL_INT -# define ACE_HAS_BROKEN_SIGEVENT_STRUCT -#endif - -#if (__FreeBSD_version >= 700028) -# define ACE_HAS_SCTP -# define ACE_HAS_LKSCTP -#endif - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-g++-common.h b/dep/include/ace/config-g++-common.h deleted file mode 100644 index ff365a5890d..00000000000 --- a/dep/include/ace/config-g++-common.h +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-g++-common.h 82495 2008-08-04 07:23:01Z johnnyw $ - -// This configuration file is designed to be included by another, -// specific configuration file. It provides config information common -// to all g++ platforms, including egcs. - -#ifndef ACE_GNUG_COMMON_H -#define ACE_GNUG_COMMON_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_STDCPP_STL_INCLUDES -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_TEMPLATES_REQUIRE_SOURCE - -#if ( __GNUC__ == 2 && __GNUC_MINOR__ < 97 ) - // gcc 2.97 and lower use old iostreams -# define ACE_USES_OLD_IOSTREAMS -#endif /* __GNUC__ >= 2.97 */ - -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS -#endif /* __GNUC__ >= 3.4 */ - -#if (__GNUC__ < 3) -# define ACE_LACKS_MEMBER_TEMPLATES -#endif /* __GNUC__ < 3 */ - -// __EXCEPTIONS is defined with -fexceptions, the egcs default. It -// is not defined with -fno-exceptions, the ACE default for g++. -// ACE_HAS_EXCEPTIONS is defined in -// include/makeinclude/wrapper_macros.GNU, so this really isn't -// necessary. Just in case . . . -#if defined (__EXCEPTIONS) && !defined (ACE_HAS_EXCEPTIONS) -# define ACE_HAS_EXCEPTIONS -#endif /* __EXCEPTIONS && ! ACE_HAS_EXCEPTIONS */ - -#if defined (ACE_HAS_EXCEPTIONS) -# define ACE_NEW_THROWS_EXCEPTIONS -# if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -// Versions of g++ prior to 3.3 had a buggy operator // new(nothrow)[](). -# define ACE_HAS_NEW_NOTHROW -# endif /* __GNUC__ >= 3.3 */ -#endif /* ACE_HAS_EXCEPTIONS */ - -#if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) -# define ACE_SIZEOF_LONG_DOUBLE 12 -#endif /* i386 */ - -#if !defined (__MINGW32__) && (defined (i386) || defined (__i386__)) - // If running an Intel, assume that it's a Pentium so that - // ACE_OS::gethrtime () can use the RDTSC instruction. If running a - // 486 or lower, be sure to comment this out. (If not running an - // Intel CPU, this #define will not be seen because of the i386 - // protection, so it can be ignored.) -# define ACE_HAS_PENTIUM -#endif /* i386 */ - -#if (defined (ACE_HAS_PENTIUM) || defined (__amd64__) || defined (__x86_64__)) -# define ACE_HAS_INTEL_ASSEMBLY -#endif - -// GNU g++ >= 4.x implements "#pragma once". -#if (__GNUC__ < 4) && !defined (ACE_LACKS_PRAGMA_ONCE) -// We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -// Take advantage of G++ (>= 4.x) visibility attributes to generate -// improved shared library binaries. -#if (__GNUC__ >= 4) && !defined (__MINGW32__) - -# if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0 -# undef ACE_HAS_CUSTOM_EXPORT_MACROS -# if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) -# undef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS -# endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ -# define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 0 -# else -# ifndef ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */ -# define ACE_Proper_Export_Flag __attribute__ ((visibility("default"))) -# define ACE_Proper_Import_Flag __attribute__ ((visibility("default"))) - -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -// Sadly, G++ 4.x silently ignores visibility attributes on -// template instantiations, which breaks singletons. -// As a workaround, we use the GCC visibility pragmas. -// And to make them fit in a macro, we use C99's _Pragma() -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17470 -// This has been fixed in GCC 4.1.1 with FC6 but not with SuSE 10.2 -// that gets shipped with GCC 4.1.2 so we assume that with GCC 4.2 -// this will be fixed on the head. With FC6 just set this define yourself -# ifndef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS -# define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 1 -# endif -# endif - -# if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) && ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS == 1 -# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class ACE_Proper_Export_Flag T -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class ACE_Proper_Export_Flag SINGLETON_TYPE ; -# else /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ -# define ACE_EXPORT_SINGLETON_DECLARATION(T) \ - _Pragma ("GCC visibility push(default)") \ - template class T \ - _Pragma ("GCC visibility pop") -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \ - _Pragma ("GCC visibility push(default)") \ - template class SINGLETON_TYPE; \ - _Pragma ("GCC visibility pop") -# endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ - -// Note that the "__extension__" is needed to prevent g++ from issuing -// an error when using its "-pedantic" command line flag. -# define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE; - -# endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */ -#endif /* __GNU__ >= 4 */ - -#if defined (ACE_HAS_GNU_REPO) - // -frepo causes unresolved symbols of basic_string left- and - // right-shift operators with ACE_HAS_STRING_CLASS. -# if defined (ACE_HAS_STRING_CLASS) -# undef ACE_HAS_STRING_CLASS -# endif /* ACE_HAS_STRING_CLASS */ -#endif /* ! ACE_HAS_GNU_REPO */ - -#include /**/ "ace/post.h" -#endif /* ACE_GNUG_COMMON_H */ - diff --git a/dep/include/ace/config-ghs-common.h b/dep/include/ace/config-ghs-common.h deleted file mode 100644 index bb169ba06ba..00000000000 --- a/dep/include/ace/config-ghs-common.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-ghs-common.h 80826 2008-03-04 14:51:23Z wotte $ - -// This configuration file is designed to be included by another, -// specific configuration file. It provides config information common -// to all Green Hills platforms. - -#ifndef ACE_GHS_COMMON_H -#define ACE_GHS_COMMON_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_CONFIG_INCLUDE_GHS_COMMON) -# error ace/config-ghs-common.h: ACE configuration error! Do not #include this file directly! -#endif - -#if defined (ghs) - -# if defined (sun) - // Need nonstatic Object_Manager on Solaris to prevent seg fault - // on startup. -# define ACE_HAS_NONSTATIC_OBJECT_MANAGER -# endif /* sun */ - -# if defined (__STANDARD_CXX) - // Green Hills 1.8.9, but not 1.8.8. -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_LACKS_AUTO_PTR -# define ACE_LACKS_CHAR_RIGHT_SHIFTS -# define ACE_LACKS_UNBUFFERED_STREAMBUF -# else -# define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA -# endif /* __STANDARD_CXX */ - -# define ACE_LACKS_LINEBUFFERED_STREAMBUF -# define ACE_LACKS_LONGLONG_T -# define ACE_LACKS_SIGNED_CHAR - -#else /* ! ghs */ -# error ace/config-ghs-common.h can only be used with Green Hills compilers! -#endif /* ! ghs */ - -#include /**/ "ace/post.h" -#endif /* ACE_GHS_COMMON_H */ - diff --git a/dep/include/ace/config-hpux-11.00.h b/dep/include/ace/config-hpux-11.00.h deleted file mode 100644 index 63f156dcfed..00000000000 --- a/dep/include/ace/config-hpux-11.00.h +++ /dev/null @@ -1,449 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-hpux-11.00.h 81992 2008-06-16 19:09:50Z wotte $ - -// The following configuration file is designed to work for HP -// platforms running HP-UX 11.00 using aC++ or gcc (2.95 and up). - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_SYS_SELECT_H - -#if defined (__GNUG__) - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -# define ACE_HAS_STRING_CLASS - -# include "ace/config-g++-common.h" - -#else - -// aC++... - -// Precompiler needs extra flags to ignore "invalid #pragma directive" -# ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR_ARGS "-E +W 67" -# endif -// Compiler supports C++ exception handling. It's on by default. If the -// +noeh compiler option is used to disable exceptions, the compiler defines -// __HPACC_NOEH. -# if !defined (__HPACC_NOEH) -# define ACE_HAS_EXCEPTIONS 1 -# endif - -// If the -AA compile option is used, the compiler defines _HP_NAMESPACE_STD. -// The -AA option enables the 2.0 standard C++ library. If not used, then -// we have the old, 1.2.1 C++ library. -# if defined (_HP_NAMESPACE_STD) -# if defined (ACE_HAS_STANDARD_CPP_LIBRARY) -# undef ACE_HAS_STANDARD_CPP_LIBRARY -# endif -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# undef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB -# endif -# if defined (RWSTD_NO_NAMESPACE) - namespace std {} using namespace std; -# else -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# endif /* RWSTD_NO_NAMESPACE */ -# else -# define ACE_USES_OLD_IOSTREAMS - // There's no support in ACE's use of numeric_limits for those that - // aren't in std:: -# define ACE_LACKS_NUMERIC_LIMITS -# endif /* _HP_NAMESPACE_STD */ - -// Compiler implements templates that support typedefs inside of classes -// used as formal arguments to a template class. -# define ACE_HAS_TEMPLATE_TYPEDEFS - -# define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -// Platform lacks streambuf "linebuffered ()". -# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 - -// Lack of (and broken) support for placement operator delete is a known -// bug by HP, up until aC++ A.03.55.02. -# if (__HP_aCC < 35502) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -# endif /* __HP_aCC < 35502 */ - -// Compiler's 'new' throws exceptions on failure, regardless of whether or -// not exception handling is enabled in the compiler options. Fortunately, -// new(nothrow_t) is offered. -# define ACE_NEW_THROWS_EXCEPTIONS -# define ACE_HAS_NEW_NOTHROW -# define ACE_HAS_NEW_NO_H 1 - -// Compiler's template mechanism must see source code (i.e., .C files). -# define ACE_TEMPLATES_REQUIRE_SOURCE - -// Compiler doesn't handle 'signed char' correctly (used in ace/IOStream.h) -# define ACE_LACKS_SIGNED_CHAR - -#endif /* __GNUG__, HP */ - -//********************************************************************* -// -// From here down is the compiler-INdependent OS settings. -// -//********************************************************************* - -// Compiling for HPUX. -#if !defined (HPUX) -#define HPUX -#endif /* HPUX */ -#define HPUX_11 - -#ifndef _HPUX_SOURCE -#define _HPUX_SOURCE -#endif - -#include /**/ - -// HP-UX is a POSIX-compliant system - see what's available. -#include "ace/config-posix.h" - -// config-posix.h sets up ACE_HAS_AIO_CALLS if the headers define the -// proper things. In HP-UX 11's case, the AIOCB Proactor works the best -// overall. If the user hasn't overridden it, select AIOCB. -#if defined (ACE_HAS_AIO_CALLS) -# if !defined (ACE_POSIX_AIOCB_PROACTOR) && !defined (ACE_POSIX_SIG_PROACTOR) -# define ACE_POSIX_AIOCB_PROACTOR -# endif /* !ACE_HAS_POSIX_AIOCB_PROACTOR && !ACE_POSIX_SIG_PROACTOR */ -#endif /* ACE_HAS_AIO_CALLS */ - -//////////////////////////////////////////////////////////////////////////// -// -// General OS information - see README for more details on what they mean -// -/////////////////////////////////////////////////////////////////////////// - -// HP/UX needs to have these addresses in a special range. -// If this is on a 64-bit model, the default is to use 64-bit addressing. -// It can also be set so that the mapped region is shareable with 32-bit -// programs. To enable the 32/64 sharing, comment out the first definition -// of ACE_DEFAULT_BASE_ADDR and uncomment the two lines after it. -#if defined (__LP64__) -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000001100000000) -//# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) -//# define ACE_OS_EXTRA_MMAP_FLAGS MAP_ADDR32 - -# define ACE_DEFAULT_BASE_ADDRL (0x0000001100000000) -//# define ACE_DEFAULT_BASE_ADDRL (0x80000000) -#else -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) -#endif /* __LP64__ */ - -// Preprocessor needs some help with data types -#if defined (__LP64__) -# define ACE_SIZEOF_LONG 8 -#else -# define ACE_SIZEOF_LONG 4 -#endif - -// Platform can do async I/O (aio_*) (set up in config-posix.h) -// ... but seems to require this in order to keep from hanging. Needs some -// investigation, maybe with HP. John Mulhern determined this value -// empirically. YMMV. If it does vary, set it up in your own config.h which -// then includes the ACE-supplied config. -#if !defined (ACE_INFINITE) -# define ACE_INFINITE 10000000 -#endif - -/* Compiler/platform correctly calls init()/fini() for shared libraries. */ -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 - -// Manually tweak the malloc control block paddings to properly align -// things. -#define ACE_MALLOC_PADDING 16 -#define ACE_MALLOC_ALIGN 8 -#define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 3 - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_SYS_PSTAT_H - -// But doesn't have a prototype for syscall() -#define ACE_LACKS_SYSCALL - -// Platform supports POSIX.1b clock_gettime () -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform has Dirent iterator functions. -#define ACE_HAS_DIRENT - -#define ACE_HAS_VSWPRINTF - -// Platform supports getpagesize() call -#define ACE_HAS_GETPAGESIZE -// But we define this just to be safe -#define ACE_PAGE_SIZE 4096 - -// Can run gperf on this platform (needed for TAO) -# define ACE_HAS_GPERF - -// Optimize ACE_Handle_Set for select(). -# define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -// At least for 11iv2, lacks perfect filtering. -#if (HPUX_VERS >= 1123) && !defined (ACE_LACKS_PERFECT_MULTICAST_FILTERING) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif - -/* Platform defines MAP_FAILED as a long constant. */ -#define ACE_HAS_LONG_MAP_FAILED 1 - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Platform's select() has non-const timeval argument -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -// Compiler/platform supports poll(). -#define ACE_HAS_POLL - -/* Platform supports "position-independent" features provided by - ACE_Based_Pointer<>. */ -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 - -/* Platform supports POSIX getpwnam_r() function */ -#define ACE_HAS_POSIX_GETPWNAM_R 1 - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Platform supports the POSIX struct timespec type -#define ACE_HAS_POSIX_TIME - -/* Platform has pread() and pwrite() support. */ -#define ACE_HAS_P_READ_WRITE 1 - -/* Platform will recurse infinitely on thread exits from TSS cleanup routines - (e.g., AIX) */ -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1 - -// Platform supports reentrant functions (all the POSIX *_r functions). -#define ACE_HAS_REENTRANT_FUNCTIONS -// ctime_r and asctime_r conform to POSIX.1c (2 param version) -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -// Platform offers scandir(), and requires no adjustments for its API. -#define ACE_HAS_SCANDIR - -// HP-UX 11 has reentrant netdb functions. The catch is that the old -// functions (gethostbyname, etc.) are thread-safe and the _r versions are -// not used and will be removed at some point. So, define things so -// the _r versions are not used. This will slow things down a bit due to -// the extra mutex lock in the ACE_NETDBCALL_RETURN macro, and will be fixed -// in the future (problem ID P64). -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS - -/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */ -#define ACE_LACKS_PRI_T 1 - -// Platform has shm_open -#define ACE_HAS_SHM_OPEN - -// Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T - -/* Compiler requires extern "C" functions for signals. */ -#define ACE_HAS_SIG_C_FUNC 1 - -// Platform's sigaction() function takes const sigaction* as 2nd parameter. -#define ACE_HAS_SIGACTION_CONSTP2 - -#define ACE_HAS_SSIZE_T - -// Platform supports SVR4 extended signals -#define ACE_HAS_SIGINFO_T - -/* Define to 1 if platform has sigsuspend(). */ -#define ACE_HAS_SIGSUSPEND 1 - -// Platform doesn't detect a signal out of range unless it's way out of range. -#define ACE_HAS_SIGISMEMBER_BUG - -/* Platform provides socklen_t type, such as Linux with glibc2. */ -#define ACE_HAS_SOCKLEN_T 1 - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -/* Platform/compiler supports _sys_errlist symbol */ -#define ACE_HAS_SYS_ERRLIST 1 - -#define ACE_HAS_UALARM - -// Platform supports ucontext_t (which is used in the extended signal API). -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Platform/compiler supports void * as second parameter to gettimeofday(). -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY - -/* Platform requires void * for mmap(). */ -#define ACE_HAS_VOIDPTR_MMAP 1 - -/* OS/compiler uses void * arg 4 setsockopt() rather than const char * */ -#define ACE_HAS_VOIDPTR_SOCKOPT 1 - -// Platform supports SVR4 dynamic linking semantics. -// When used, this requires -ldl on the ACE library link line. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Platform supports the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -/* Define to 1 if platform has the declaration of getrusage(). */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 - -// Platform has the sigwait function in a header file -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGTIMEDWAIT - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// accept() is thread-safe -#define ACE_HAS_THREAD_SAFE_ACCEPT - -// Platform lacks a typedef for timespec_t, but has struct timespec -#define ACE_LACKS_TIMESPEC_T - -// dlopen() takes a char* instead of const char* -#define ACE_HAS_CHARPTR_DL - -// lacks setegid and seteuid -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETEUID - -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_SYS_SYSCTL_H - -// @@ TODO: It looks like HP-UX provides strtoull and wcstoull -// but some more work is needed to plug them in correctly. -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -// Shared library name/path components -#if defined (__ia64) -# define ACE_DLL_SUFFIX ACE_TEXT (".so") -#else -# define ACE_DLL_SUFFIX ACE_TEXT (".sl") -#endif /* __ia64 */ -#if defined (__LP64__) -# define ACE_LD_SEARCH_PATH ACE_TEXT ("LD_LIBRARY_PATH") -#else -# define ACE_LD_SEARCH_PATH ACE_TEXT ("SHLIB_PATH") -#endif /* __LP64__ */ - -#if defined (_INCLUDE__STDC_A1_SOURCE) -# define ACE_HAS_3_PARAM_WCSTOK -#endif - -#define ACE_HAS_3_PARAM_READDIR_R - -////////////////////////////////////////////////////////////////////////// -// -// STREAMS information -// -////////////////////////////////////////////////////////////////////////// - -// Platform supports STREAMS -#define ACE_HAS_STREAMS -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T -// But the putmsg signature doesn't have it as const... -// Well, it really does, but it depends on preprocessor defines. -#define ACE_LACKS_CONST_STRBUF_PTR -/* Platform supports TLI timod STREAMS module */ -#define ACE_HAS_TIMOD_H 1 - -// Platform supports STREAM pipes -// This is possible, but not by default - need to rebuild the kernel to -// get them enabled - see pipe(2) and "STREAMS/UX for the HP 9000" -// #define ACE_HAS_STREAM_PIPES - -///////////////////////////////////////////////////////////////////////// -// -// TLI/XTI information -// -//////////////////////////////////////////////////////////////////////// - -// Platform supports XTI (includes TLI). -#define ACE_HAS_XTI -// HP-UX 11 conforms to the XPG4 spec, which ACE calls broken for the -// errmsg not being const... -#define ACE_HAS_BROKEN_T_ERROR -// The definitions of TCP_NODELAY and TCP_MAXSEG conflict between -// sys/xti.h and netinet/tcp.h. -#define ACE_HAS_CONFLICTING_XTI_MACROS -/* Platform provides header */ -#define ACE_HAS_SYS_XTI_H 1 - -///////////////////////////////////////////////////////////////////////// -// -// Threads information. -// -// Use of threads is controlled by the 'threads' argument to make. See -// include/makeinclude/platform_hpux_aCC.GNU for details. If it's not set, -// the default is to enable it, since kernel threads are always available -// on HP-UX 11, as opposed to 10.x where it was optional software. -// -//////////////////////////////////////////////////////////////////////// - -#if defined (ACE_HAS_THREADS) -# if (ACE_HAS_THREADS == 0) -# undef ACE_HAS_THREADS -# endif /* ACE_HAS_THREADS == 0 */ -#else -# define ACE_HAS_THREADS -#endif /* ACE_HAS_THREADS */ - -#if defined (ACE_HAS_THREADS) - -# if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -# endif - -// HP-UX doesn't define _POSIX_THREADS since it doesn't implement all -// features (lacks thread priority inheritance and protection), so -// config-posix.h doesn't get this one... -# define ACE_HAS_PTHREADS -# define ACE_HAS_PTHREADS_UNIX98_EXT -# define ACE_HAS_PTHREAD_CONTINUE -# define ACE_HAS_PTHREAD_RESUME_NP -# define ACE_HAS_PTHREAD_SUSPEND -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK -#endif /* ACE_HAS_THREADS */ - -#define ACE_HAS_POSIX_SEM - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses -#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-icc-common.h b/dep/include/ace/config-icc-common.h deleted file mode 100644 index 290d2b60fc6..00000000000 --- a/dep/include/ace/config-icc-common.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-icc-common.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_LINUX_ICC_COMMON_H -#define ACE_LINUX_ICC_COMMON_H -#include /**/ "ace/pre.h" - -# define ACE_HAS_CPLUSPLUS_HEADERS -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_STRING_CLASS - -#if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0 -# undef ACE_HAS_CUSTOM_EXPORT_MACROS -# if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) -# undef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS -# endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ -# define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 0 -#else -# ifndef ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */ -# define ACE_Proper_Export_Flag __attribute__ ((visibility("default"))) -# define ACE_Proper_Import_Flag __attribute__ ((visibility("default"))) - -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -// Sadly, G++ 4.x silently ignores visibility attributes on -// template instantiations, which breaks singletons. -// As a workaround, we use the GCC visibility pragmas. -// And to make them fit in a macro, we use C99's _Pragma() -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17470 -// This has been fixed in GCC 4.1.1 with FC6 but not with SuSE 10.2 -// that gets shipped with GCC 4.1.2 so we assume that with GCC 4.2 -// this will be fixed on the head. With FC6 just set this define yourself -# ifndef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS -# define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 1 -# endif -# endif - -# if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) && ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS == 1 -# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class ACE_Proper_Export_Flag T -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class ACE_Proper_Export_Flag SINGLETON_TYPE ; -# else /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ -# define ACE_EXPORT_SINGLETON_DECLARATION(T) \ - _Pragma ("GCC visibility push(default)") \ - template class T \ - _Pragma ("GCC visibility pop") -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \ - _Pragma ("GCC visibility push(default)") \ - template class SINGLETON_TYPE; \ - _Pragma ("GCC visibility pop") -# endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */ - -// Note that the "__extension__" is needed to prevent g++ from issuing -// an error when using its "-pedantic" command line flag. -# define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE; -#endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */ - -// __EXCEPTIONS is defined with -fexceptions, the egcs default. It -// is not defined with -fno-exceptions, the ACE default for g++. -// ACE_HAS_EXCEPTIONS is defined in -// include/makeinclude/wrapper_macros.GNU, so this really isn't -// necessary. Just in case . . . -# if defined (__EXCEPTIONS) && !defined (ACE_HAS_EXCEPTIONS) -# define ACE_HAS_EXCEPTIONS -# endif /* __EXCEPTIONS && ! ACE_HAS_EXCEPTIONS */ - -# if defined (ACE_HAS_EXCEPTIONS) -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ - -#if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) -# define ACE_SIZEOF_LONG_DOUBLE 12 -#endif /* i386 */ - -#if !defined (__MINGW32__) && (defined (i386) || defined (__i386__)) - // If running an Intel, assume that it's a Pentium so that - // ACE_OS::gethrtime () can use the RDTSC instruction. If running a - // 486 or lower, be sure to comment this out. (If not running an - // Intel CPU, this #define will not be seen because of the i386 - // protection, so it can be ignored.) -# define ACE_HAS_PENTIUM -#endif /* i386 */ - -#if (defined (ACE_HAS_PENTIUM) || defined (__amd64__) || defined (__x86_64__)) -# define ACE_HAS_INTEL_ASSEMBLY -#endif - -#if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -#define ACE_TEMPLATES_REQUIRE_SOURCE - -#if (__INTEL_COMPILER >= 910) -# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS -#endif - -#if defined (__ia64) -# define ACE_HAS_IA64INTRIN_H -# define ACE_HAS_INTRINSIC_INTERLOCKED -#else -# define ACE_HAS_IA32INTRIN_H -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_LINUX_ICC_COMMON_H */ - diff --git a/dep/include/ace/config-integritySCA.h b/dep/include/ace/config-integritySCA.h deleted file mode 100644 index be6ccd7a3a8..00000000000 --- a/dep/include/ace/config-integritySCA.h +++ /dev/null @@ -1,231 +0,0 @@ -// -*- C++ -*- - -#ifndef ACE_INT_CONFIG_H -#define ACE_INT_CONFIG_H - -/* - * This config.h file is for version 4.0.x of the - * Integrity RTOS with SCA from Green Hills Software - * http://www.ghs.com/products/rtos/integrity.html - * - * $Id: config-integritySCA.h 81935 2008-06-12 22:01:53Z jtc $ - */ - -#define ghs -/* compilation defines */ -#define ACE_LACKS_GETPGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID - -#ifndef ACE_HAS_EXCEPTIONS - #define ACE_HAS_EXCEPTIONS -#endif -#define ACE_NEW_THROWS_EXCEPTIONS -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#define ACE_TEMPLATES_REQUIRE_SOURCE 1 -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define TAO_USE_SEQUENCE_TEMPLATES -#define ACE_NEEDS_FUNC_DEFINITIONS -#define _REENTRANT -#define ACE_MT_SAFE 1 - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -#define ACE_HAS_SHM_OPEN - -/***** Operating System Defines *****/ - -/***** ANSI defines *****/ -#define ACE_LACKS_TEMPNAM /* believe it or not, this is ANSI C */ -#define ACE_HAS_STRERROR - -#define ACE_LACKS_SENDMSG - -/***** End Stack Defines *****/ - -/* SCA STUFF */ -#if defined(INTEGRITY_VERSION) && (INTEGRITY_VERSION >= 40108) -#define ACE_HAS_SIG_ATOMIC_T -#endif /* INTEGRITY_VERSION */ -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGACTION -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_HAS_SIG_C_FUNC -#define ACE_LACKS_SI_ADDR -#define ACE_HAS_AIO_CALLS - -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_DIRENT - -#define ACE_HAS_THREADS - -#define ACE_HAS_PTHREADS -/***** End Threading Defines *****/ - -/***** Hardware Defines *****/ -#define ACE_PAGE_SIZE 4096 -/***** End Hardware Defines *****/ - -/****** SYSV_IPC STUFF *****/ -#define ACE_LACKS_KEY_T - -/****** Posix Defines *****/ -#define ACE_LACKS_WAIT -#define ACE_LACKS_WAITPID -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_POSIX_SEM -#define ACE_HAS_STRDUP_EMULATION -#define ACE_HAS_MSG -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_EXEC -#define ACE_LACKS_FORK -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_PIPE -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RECVMSG -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_UNIX_DOMAIN_SOCKETS -#define ACE_LACKS_USER -#define ACE_LACKS_FILE_FCNTL -#define ACE_LACKS_FCNTL -#define ACE_LACKS_UMASK -#define ACE_LACKS_SEEK -#define ACE_LACKS_SHARED_MEMORY -#define ACE_LACKS_MSYNC -#define ACE_LACKS_PID_STUFF -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_IPC_H -#define ACE_LACKS_SETGID -#define ACE_LACKS_PIPE -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_UTSNAME_T -#define ACE_LACKS_UNAME -#define ACE_LACKS_UMASK -#define ACE_LACKS_ISATTY -#define ACE_LACKS_GETOPT -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_UNIX_SIGNALS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_PUTENV -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_SETSCHED -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_WRITEV -#define ACE_LACKS_READV -#define ACE_LACKS_SYSCONF -#define ACE_LACKS_GETOPT -/* below refers to fcntl style locking */ -#define ACE_LACKS_FILELOCKS - -#define ACE_LACKS_REALPATH -#define ACE_HAS_CONST_CHAR_SWAB -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -/***** Not tied to standards AFAIK ****/ -#define ACE_LACKS_MADVISE /* paging optimization not needed with INTEGRITY */ -#define ACE_LACKS_MALLOC_H /* netbsd's just includes stdlib.h */ -#define ACE_LACKS_MEMORY_H /* netbsd's just includes string.h */ -#define ACE_LACKS_INTTYPES_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_SEARCH_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_REGEX_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H - -/***** STUFF INTEGRITY 4.0.8 APPEARS TO SUPPORT ****/ -/* note, possibly untested with ace */ - -/***** TAO STUFF ****/ -#define TAO_USE_DOTTED_DECIMAL_ADDRESSES 1 - -#include - -#include - -typedef void (*__sighandler_t)(int); - -extern "C" -{ - inline int isatty(int) { return 0; } -} - -#ifdef ppc -#define ACE_HAS_POWERPC_TIMER -#endif - -/* MIKEC Addtions */ -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#include // needed to define iovec -#define ACE_LACKS_READLINK -#define ACE_LACKS_GETPPID -#define NSIG (SIGRTMAX+1) -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_USE_RCSID 0 -#define ACE_LACKS_CUSERID -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 0x5000 -#define fileno(file) ((file)->io_channel) //Hack to get Svc_Conf_l.cpp compiled -#define ACE_DEFAULT_THREAD_PRIORITY 127 -#define PRI_FIFO_MIN 1 -#define PRI_FIFO_MAX 127 -#define ACE_THR_PRI_FIFO_DEF 127 -#define PRI_RR_MIN 1 -#define PRI_RR_MAX 127 -#define ACE_THR_PRI_RR_DEF 127 -#define PRI_OTHER_MIN 1 -#define PRI_OTHER_MAX 127 -#define ACE_THR_PRI_OTHER_DEF 127 -#define ACE_PTHREAD_RETURN_ON_EXIT -#undef ACE_LACKS_UNLINK - -#define ACE_HAS_TIMED_MESSAGE_BLOCKS - -extern "C" { -int unlink(const char *); -} - -#define ACE_LACKS_SETSID -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_GETHOSTENT - -/* end MIKEC Addtions */ - -// Hack to avoid ensure that things defined in ind_io.h -// have the right linkage -#include - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-irix6.5.x-sgic++.h b/dep/include/ace/config-irix6.5.x-sgic++.h deleted file mode 100644 index a47126ff5f2..00000000000 --- a/dep/include/ace/config-irix6.5.x-sgic++.h +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -// $Id: config-irix6.5.x-sgic++.h 80826 2008-03-04 14:51:23Z wotte $ - -// Use this file for IRIX 6.5.x - -#ifndef ACE_CONFIG_IRIX65X_H -#define ACE_CONFIG_IRIX65X_H -#include /**/ "ace/pre.h" - -// Include IRIX 6.[234] configuration -#include "ace/config-irix6.x-sgic++.h" - -// Irix 6.5 man pages show that they exist -#undef ACE_LACKS_CONDATTR_PSHARED -#undef ACE_LACKS_MUTEXATTR_PSHARED - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_IRIX65X_H */ - diff --git a/dep/include/ace/config-irix6.x-common.h b/dep/include/ace/config-irix6.x-common.h deleted file mode 100644 index 49bc08f6c4e..00000000000 --- a/dep/include/ace/config-irix6.x-common.h +++ /dev/null @@ -1,257 +0,0 @@ -/* -*- C++ -*- */ -// -// $Id: config-irix6.x-common.h 81697 2008-05-14 18:33:11Z johnnyw $ -// -// This file contains the common configuration options for both -// SGI/MIPSPro C++ and g++ under IRIX 6.X -// -// For IRIX 6.2 there are several patches that should be applied to -// get reliable operation with multi-threading and exceptions. -// Specifically you should get a reasonable current IRIX, Compiler -// and POSIX patch-sets. - -// For IRIX 6.[34] it's less critical, but it's still recommended -// that you apply the applicable patch-sets (IRIX and Compiler I believe). - -// These patches are updated frequently, so you should ask your support -// contact or search SGI's web site (http://www.sgi.com) for the latest -// version. - -// Use this file for IRIX 6.[234] if you have the pthreads patches -// installed. - -#ifndef ACE_CONFIG_IRIX6X_COMMON_H - -#ifndef IRIX6 -# define IRIX6 -#endif - -#if ! defined(ACE_CONFIG_H) -#error "This file may only be included by config-irix6.x-sgic++.h, config-irix6.x-kcc.h or config-irix6.x-g++.h" -#endif - -// The Irix 6.x float.h doesn't allow us to distinguish between a -// double and a long double. So, we have to hard-code this. Thanks -// to Bob Laferriere for figuring it out. -#if defined (_MIPS_SIM) /* 6.X System */ -# include -# if defined (__GNUC__) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif defined (_MIPS_SIM_NABI32) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif defined (_MIPS_SIM_ABI32) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# define ACE_SIZEOF_LONG_DOUBLE 8 -# elif defined (_MIPS_SIM_ABI64) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif !defined (ACE_SIZEOF_LONG_DOUBLE) -# define ACE_SIZEOF_LONG_DOUBLE 8 -# endif -#else -# define ACE_SIZEOF_LONG_DOUBLE 8 /* 5.3 System */ -#endif - -// petern, Next part of it: - -// Platform supports getpagesize() call. -#define ACE_HAS_GETPAGESIZE - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! (like Irix 6.2) -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED - -#define ACE_LACKS_SUSECONDS_T - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Platform requires void * for mmap(). -#define ACE_HAS_VOIDPTR_MMAP - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Irix needs to define bzero() in this odd file -#define ACE_HAS_BSTRING - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#ifdef ACE_LACKS_PERFECT_MULTICAST_FILTERING - #undef ACE_LACKS_PERFECT_MULTICAST_FILTERING -#endif -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -//************************************************************** -// Not so sure how next lines should look like - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -//************************************************************** - -// IRIX 6.4 and below do not support reentrant netdb functions -// (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r, -// gethostbyname_r, getservbyname_r). -#if (ACE_IRIX_VERS <= 64) && !defined (ACE_HAS_NETDB_REENTRANT_FUNCTIONS) -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#endif /* ACE_HAS_NETDB_REENTRANT_FUNCTIONS */ - -#define ACE_HAS_DIRENT -// Unless the thread enabled version is used the readdir_r interface -// does not get defined in IRIX 6.2 -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_RWLOCK_T - -#define ACE_HAS_GPERF - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_BROKEN_DGRAM_SENDV - -#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -#define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 2 - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// IRIX 6.5 supports AIO -#define ACE_HAS_AIO_CALLS -#define ACE_POSIX_AIOCB_PROACTOR -#define ACE_HAS_SGIDLADD -#define ACE_HAS_P_READ_WRITE -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_STDINT_H -#define ACE_HAS_SYSENT_H -#define ACE_HAS_SYSINFO -#define ACE_HAS_SYS_SYSTEMINFO_H - -// Platform has support for multi-byte character support compliant -// with the XPG4 Worldwide Portability Interface wide-character -// classification. -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// We need to setup a very high address or Naming_Test won't run. -#define ACE_DEFAULT_BASE_ADDR ((char *) (1024U * 1024 * 1024)) - -#define ACE_LACKS_SIGNED_CHAR - -// Platform supports reentrant functions (i.e., all the POSIX *_r -// functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform does not support reentrant password file accessor functiions. -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS - -// uses ctime_r & asctime_r with only two parameters vs. three -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -#define ACE_HAS_UALARM - -// Scheduling functions are declared in -#define ACE_NEEDS_SCHED_H - -// Compile using multi-thread libraries by default -#if !defined (ACE_MT_SAFE) - #define ACE_MT_SAFE 1 -#endif /* ACE_MT_SAFE */ - -#if (ACE_MT_SAFE != 0) - -// Add threading support - -#define ACE_HAS_IRIX62_THREADS - -// Needed for the threading stuff? -#include /**/ -#define PTHREAD_MIN_PRIORITY PX_PRIO_MIN -#define PTHREAD_MAX_PRIORITY PX_PRIO_MAX - -// ACE supports threads. -#define ACE_HAS_THREADS - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! (like Irix 6.2) -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED - -// IRIX 6.2 supports a variant of POSIX Pthreads, supposedly POSIX 1c -#define ACE_HAS_PTHREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// The pthread_cond_timedwait call does not reset the timer. -#define ACE_LACKS_COND_TIMEDWAIT_RESET 1 - -// When threads are enabled READDIR_R is supported on IRIX. -#undef ACE_LACKS_READDIR_R - -#endif /* (ACE_MT_SAFE == 0) */ - -#endif /* ACE_CONFIG_IRIX6X_COMMON_H */ - diff --git a/dep/include/ace/config-irix6.x-g++.h b/dep/include/ace/config-irix6.x-g++.h deleted file mode 100644 index 91276bdbaad..00000000000 --- a/dep/include/ace/config-irix6.x-g++.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-irix6.x-g++.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for the SGI -// Indigo2EX running Irix 6.2 platform using the GNU C++ Compiler - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -#define ACE_HAS_STRING_CLASS - -#include "ace/config-g++-common.h" -#include "ace/config-irix6.x-common.h" - -// Denotes that GNU has cstring.h as standard -// which redefines memchr() -#define ACE_HAS_GNU_CSTRING_H - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-irix6.x-sgic++.h b/dep/include/ace/config-irix6.x-sgic++.h deleted file mode 100644 index d832995ea8c..00000000000 --- a/dep/include/ace/config-irix6.x-sgic++.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-irix6.x-sgic++.h 81935 2008-06-12 22:01:53Z jtc $ - -// Use this file for IRIX 6.[234] if you have the pthreads patches -// installed. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#include "ace/config-irix6.x-common.h" - -// This is the config file for IRIX 6.2, 6.4 and hopefully 6.3, using -// the SGI C++ compiler (7.1 or higher). - -// The following three should be enabled/disabled together. -#if _COMPILER_VERSION < 720 -#define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA -#endif /* _COMPILER_VERSION < 720 */ -#define ACE_TEMPLATES_REQUIRE_SOURCE -#define ACE_NEEDS_FUNC_DEFINITIONS - -// Platform supports STREAM pipes (note that this is disabled by -// default, see the manual page on pipe(2) to find out how to enable -// it). -// #define ACE_HAS_STREAM_PIPES - -#if defined (_COMPILER_VERSION) -# define ACE_CC_NAME ACE_TEXT ("SGI/MIPSPro") -# define ACE_CC_MAJOR_VERSION (_COMPILER_VERSION / 100) -# define ACE_CC_MINOR_VERSION (_COMPILER_VERSION % 100) -# define ACE_CC_BETA_VERSION (0) -#endif /* _COMPILER_VERSION */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-linux-common.h b/dep/include/ace/config-linux-common.h deleted file mode 100644 index 6743c53adfc..00000000000 --- a/dep/include/ace/config-linux-common.h +++ /dev/null @@ -1,449 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-linux-common.h 82516 2008-08-05 19:22:59Z shuston $ - -// Do not use this configuration file directly since it's designed to -// be included by another, specific configuration file, such as -// config-linux.h. It provides config information common to all Linux -// platforms. It automatically determines the CPU architecture, -// compiler (g++ or egcs), and libc (libc5 or glibc), and configures -// based on those. - -#ifndef ACE_LINUX_COMMON_H -#define ACE_LINUX_COMMON_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_BYTESEX_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Needed to differentiate between libc 5 and libc 6 (aka glibc). -#include - -#if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500) -# define ACE_HAS_PTHREADS_UNIX98_EXT -#endif /* _XOPEN_SOURCE - 0 >= 500 */ - -#if !defined (ACE_LACKS_LINUX_NPTL) - -# include "ace/config-posix.h" - - // Temporary fix because NPTL kernels do have shm_open but there is a problem - // with shm_open/shm_unlink pairing in ACE which needs to be fixed when I have time. -# if defined (ACE_HAS_SHM_OPEN) -# undef ACE_HAS_SHM_OPEN -# endif /* ACE_HAS_SHM_OPEN */ - -# if defined (ACE_USES_FIFO_SEM) - // Don't use this for Linux NPTL since this has complete - // POSIX semaphores which are more efficient -# undef ACE_USES_FIFO_SEM -# endif /* ACE_USES_FIFO_SEM */ - -# if defined (ACE_HAS_POSIX_SEM) - // Linux NPTL may not define the right POSIX macro - // but they have the actual runtime support for this stuff -# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && (((_POSIX_C_SOURCE - 0) >= 200112L) || (_XOPEN_SOURCE >= 600)) -# define ACE_HAS_POSIX_SEM_TIMEOUT -# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT && (((_POSIX_C_SOURCE - 0) >= 200112L) || (_XOPEN_SOURCE >= 600)) */ -# endif /* ACE_HAS_POSIX_SEM */ -#endif /* !ACE_LACKS_LINUX_NPTL */ - -// First the machine specific part - -#if defined (__powerpc__) || defined (__x86_64__) -# if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x40000000) -# endif /* ! ACE_DEFAULT_BASE_ADDR */ -#elif defined (__ia64) -# if !defined (ACE_DEFAULT_BASE_ADDR) -// Zero base address should work fine for Linux of IA-64: it just lets -// the kernel to choose the right value. -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000000000000000) -# endif /* ! ACE_DEFAULT_BASE_ADDR */ -#endif /* ! __powerpc__ && ! __ia64 */ - -// Then glibc/libc5 specific parts - -#if defined(__GLIBC__) -# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) -# define ACE_HAS_NONCONST_SETRLIMIT -# endif -# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 3) -# define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who -# define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource -# endif -# define ACE_HAS_SOCKLEN_T -# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG - - // glibc defines both of these, used in OS_String. -# if defined (_GNU_SOURCE) -# define ACE_HAS_STRNLEN -# define ACE_HAS_WCSNLEN - - // This is probably not a 100%-sure-fire check... Red Hat Linux 9 - // and Enterprise Linux 3 and up have a new kernel that can send signals - // across threads. This was not possible prior because there was no real - // difference between a process and a thread. With this, the - // ACE_POSIX_SIG_Proactor is the only chance of getting asynch I/O working. - // There are restrictions, such as all socket operations being silently - // converted to synchronous by the kernel, that make aio a non-starter - // for most Linux platforms at this time. But we'll start to crawl... -# define ACE_POSIX_SIG_PROACTOR -# endif - - // To avoid the strangeness with Linux's ::select (), which modifies - // its timeout argument, use ::poll () instead. -# define ACE_HAS_POLL - -// Don't define _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED in ACE to make -// getpgid() prototype visible. ACE shouldn't depend on feature test -// macros to make prototypes visible. -# define ACE_LACKS_GETPGID_PROTOTYPE - -// @note the following defines are necessary with glibc 2.0 (0.961212-5) -// on Alpha. I assume that they're necessary on Intel as well, -// but that may depend on the version of glibc that is used. -//# define ACE_HAS_DLFCN_H_BROKEN_EXTERN_C -# define ACE_HAS_VOIDPTR_SOCKOPT - -// Don't define _POSIX_SOURCE in ACE to make strtok() prototype -// visible. ACE shouldn't depend on feature test macros to make -// prototypes visible. -# define ACE_LACKS_STRTOK_R_PROTOTYPE -// @note end of glibc 2.0 (0.961212-5)-specific configuration. - -# if __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 - // These were suggested by Robert Hanzlik to get - // ACE to compile on Linux using glibc 2.1 and libg++/gcc 2.8. -# undef ACE_HAS_BYTESEX_H -# define ACE_HAS_SIGINFO_T -# define ACE_LACKS_SIGINFO_H -# define ACE_HAS_UCONTEXT_T - - // Pre-glibc (RedHat 5.2) doesn't have sigtimedwait. -# define ACE_HAS_SIGTIMEDWAIT -# endif /* __GLIBC__ 2.1+ */ -#else /* ! __GLIBC__ */ - // Fixes a problem with some non-glibc versions of Linux... -# define ACE_LACKS_MADVISE -# define ACE_LACKS_MSG_ACCRIGHTS -#endif /* ! __GLIBC__ */ - -// Don't define _LARGEFILE64_SOURCE in ACE to make llseek() or -// lseek64() prototype visible. ACE shouldn't depend on feature test -// macros to make prototypes visible. -#if __GLIBC__ > 1 -# if __GLIBC_MINOR__ == 0 -# define ACE_HAS_LLSEEK -# define ACE_LACKS_LLSEEK_PROTOTYPE -# else /* __GLIBC_MINOR__ > 0 */ -# define ACE_HAS_LSEEK64 -# define ACE_LACKS_LSEEK64_PROTOTYPE -# endif -#endif /* __GLIBC__ > 1 */ - -#if __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 -# define ACE_HAS_P_READ_WRITE -# define ACE_LACKS_PREAD_PROTOTYPE -// Use ACE's alternate cuserid() implementation since the use of the -// system cuserid() is discouraged. -# define ACE_HAS_ALT_CUSERID -#endif /* __GLIBC__ > 1 && __GLIBC_MINOR__ >= 0 */ - -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) -# define ACE_HAS_ISASTREAM_PROTOTYPE -# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE -# define ACE_HAS_CPU_SET_T -#endif /* __GLIBC__ > 2 || __GLIBC__ === 2 && __GLIBC_MINOR__ >= 3) */ - -// Then the compiler specific parts - -#if defined (__INTEL_COMPILER) -# include "ace/config-icc-common.h" -#elif defined (__GNUG__) - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS -# include "ace/config-g++-common.h" -#define ACE_CC_NAME ACE_TEXT ("g++") -#define ACE_CC_MAJOR_VERSION __GNUC__ -#define ACE_CC_MINOR_VERSION __GNUC_MINOR__ -//#define ACE_CC_BETA_VERSION 0 /* ??? */ -#elif defined (__DECCXX) -# define ACE_CONFIG_INCLUDE_CXX_COMMON -# include "ace/config-cxx-common.h" -#elif defined (__BORLANDC__) -# undef ACE_HAS_LLSEEK -# undef ACE_HAS_LSEEK64 -# undef ACE_LACKS_LLSEEK_PROTOTYPE -# undef ACE_LACKS_LSEEK64_PROTOTYPE -# include "ace/config-borland-common.h" -#elif defined (__SUNCC_PRO) -# include "ace/config-suncc-common.h" -#elif defined (__PGI) -// Portable group compiler -# define ACE_HAS_CPLUSPLUS_HEADERS -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_LACKS_SWAB -#elif defined (__GNUC__) -/** - * GNU C compiler. - * - * We need to recognize the GNU C compiler since TAO has at least one - * C source header and file - * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly - * include this - */ -#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && !__BORLANDC__ && !__PGI */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-linux-common.h -# endif /* __cplusplus */ -#endif /* ! __GNUG__*/ - -// Completely common part :-) - -// Platform/compiler has the sigwait(2) prototype -# define ACE_HAS_SIGWAIT - -# define ACE_HAS_SIGSUSPEND - -# define ACE_HAS_UALARM - -#if __GLIBC__ >= 2 -#ifndef ACE_HAS_POSIX_REALTIME_SIGNALS -#define ACE_HAS_POSIX_REALTIME_SIGNALS -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - -#ifndef ACE_HAS_AIO_CALLS -#define ACE_HAS_AIO_CALLS -#endif /* ACE_HAS_AIO_CALLS */ -#endif - -#if __GLIBC__ >= 2 -// glibc 2 and higher has wchar support -# define ACE_HAS_XPG4_MULTIBYTE_CHAR -# define ACE_HAS_VFWPRINTF -#endif - -#if __GLIBC__ < 2 -// These are present in glibc 2 and higher -# define ACE_LACKS_WCSTOK -# define ACE_LACKS_WCSDUP_PROTOTYPE -#endif /* __GLIBC__ < 2 */ - -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP - -#if __GLIBC__ >= 2 -# define ACE_HAS_3_PARAM_WCSTOK -#endif - -#define ACE_HAS_3_PARAM_READDIR_R - -#if !defined (ACE_DEFAULT_BASE_ADDR) -# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) -#endif /* ! ACE_DEFAULT_BASE_ADDR */ - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_SYS_SYSINFO_H -#define ACE_HAS_LINUX_SYSINFO - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_GETRUSAGE_PROTOTYPE - -#define ACE_HAS_BYTESWAP_H -#define ACE_HAS_BSWAP_16 -#define ACE_HAS_BSWAP_32 - -#if defined __GNUC__ && __GNUC__ >= 2 -# define ACE_HAS_BSWAP_64 -#endif - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// ONLY define this if you have config'd multicast into a 2.0.34 or -// prior kernel. It is enabled by default in 2.0.35 kernels. -#if !defined (ACE_HAS_IP_MULTICAST) -# define ACE_HAS_IP_MULTICAST -#endif /* ! ACE_HAS_IP_MULTICAST */ - -// At least for IPv4, Linux lacks perfect filtering. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -#define ACE_HAS_BIG_FD_SET - -// Linux defines struct msghdr in /usr/include/socket.h -#define ACE_HAS_MSG - -// Linux "improved" the interface to select() so that it modifies -// the struct timeval to reflect the amount of time not slept -// (see NOTES in Linux's select(2) man page). -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 - -#define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 - -#define ACE_HAS_GETPAGESIZE 1 - -#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) -// glibc supports wchar, but lacks fgetwc and ungetwc -# define ACE_LACKS_FGETWC -# define ACE_HAS_NONCONST_MSGSND -# define ACE_LACKS_STRNLEN_PROTOTYPE -#endif - -// glibc requires _XOPEN_SOURCE_EXTENDED to make this prototype -// visible, so force ACE to declare one. Yuk! -#ifndef _XOPEN_SOURCE_EXTENDED -# define ACE_LACKS_MKSTEMP_PROTOTYPE -#endif /* !_XOPEN_SOURCE_EXTENDED */ - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -// Platform supplies scandir() -#define ACE_HAS_SCANDIR -// Although the scandir man page says otherwise, this setting is correct. -#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR - -// A conflict appears when including both and -// with recent glibc headers. -//#define ACE_HAS_PROC_FS - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform/compiler supports global timezone variable. -#define ACE_HAS_TIMEZONE - -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Don't define _XOPEN_SOURCE in ACE to make strptime() prototype -// visible. ACE shouldn't depend on feature test macros to make -// prototypes visible. -#define ACE_LACKS_STRPTIME_PROTOTYPE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -#define ACE_HAS_POSIX_TIME - -#define ACE_HAS_GPERF - -#define ACE_HAS_DIRENT - -// Starting with FC9 rawhide this file is not available anymore but -// this define is set -#if defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1 -# define ACE_LACKS_STROPTS_H -# define ACE_LACKS_STRRECVFD -#endif - -#if !defined (ACE_LACKS_STROPTS_H) -# define ACE_HAS_STRBUF_T -#endif - -#if defined (__ia64) || defined(__alpha) || defined (__x86_64__) -// On 64 bit platforms, the "long" type is 64-bits. Override the -// default 32-bit platform-specific format specifiers appropriately. -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%lu") -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%ld") -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") -#endif /* __ia64 */ - -#define ACE_SIZEOF_WCHAR 4 - -#define ACE_LACKS_GETIPNODEBYADDR -#define ACE_LACKS_GETIPNODEBYNAME - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Linux implements sendfile(). -#define ACE_HAS_SENDFILE - -#define ACE_HAS_VOIDPTR_MMAP - -#if defined (ACE_LACKS_NETWORKING) -# include "ace/config-posix-nonetworking.h" -#else -# define ACE_HAS_NETLINK -# define ACE_HAS_GETIFADDRS -#endif - -#if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) -// Detect if getsockname() and getpeername() returns random values in -// the sockaddr_in::sin_zero field by evaluation of the kernel -// version. Since version 2.5.47 this problem is fixed. -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)) -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 0 -# else -# define ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO 1 -# endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,47)) */ -#endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ - -#if defined (ACE_HAS_EVENT_POLL) -// The sys_epoll interface was introduced in Linux kernel 2.5.45. -// Don't support backported versions since they appear to be buggy. -// The obsolete ioctl()-based interface is no longer supported. -#if 0 -// linux/version.h may not be accurate. It's not for Fedora Core 2... -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ -# if (LINUX_VERSION_CODE < KERNEL_VERSION (2,5,45)) -# undef ACE_HAS_EVENT_POLL -# error Disabling Linux epoll support. Kernel used in C library is too old. -# error Linux kernel 2.5.45 or better is required. -# endif /* LINUX_VERSION_CODE < KERNEL_VERSION (2,5,45) */ -#endif /* ACE_HAS_EVENT_POLL */ -#endif - -#if !defined (ACE_HAS_EVENT_POLL) && !defined (ACE_HAS_DEV_POLL) -# if !defined (ACE_LACKS_LINUX_VERSION_H) -# include -# endif /* !ACE_LACKS_LINUX_VERSION_H */ -# if (LINUX_VERSION_CODE > KERNEL_VERSION (2,6,0)) -# define ACE_HAS_EVENT_POLL -# endif -#endif - -#include /**/ "ace/post.h" - -#endif /* ACE_LINUX_COMMON_H */ - diff --git a/dep/include/ace/config-linux.h b/dep/include/ace/config-linux.h deleted file mode 100644 index 4c5dc3c4bdb..00000000000 --- a/dep/include/ace/config-linux.h +++ /dev/null @@ -1,76 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-linux.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for Linux -// platforms using GNU C++. - -#ifndef ACE_CONFIG_LINUX_H -#define ACE_CONFIG_LINUX_H -#include /**/ "ace/pre.h" - -#define ACE_PLATFORM_CONFIG config-linux.h - -#include "ace/config-linux-common.h" - -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE - -#if !defined (ACE_MT_SAFE) -#define ACE_MT_SAFE 1 // JCEJ 12/22/96 #1 -#endif - -#if ACE_MT_SAFE -// Yes, we do have threads. -#define ACE_HAS_THREADS -// And they're even POSIX pthreads (LinuxThreads implementation) -#define ACE_HAS_PTHREADS - -// On linux this is part of pthreads -# if (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L) -# if !defined (ACE_HAS_CLOCK_GETTIME) -# if !defined(__PGI) -# define ACE_HAS_CLOCK_GETTIME -# endif /* __PGI */ -# define ACE_HAS_CLOCK_SETTIME -# endif /* !ACE_HAS_CLOCK_GETTIME */ -# endif /* _POSIX_C_SOURCE >= 199309L */ - -#if !defined (ACE_HAS_PTHREADS_UNIX98_EXT) -# define ACE_LACKS_RWLOCK_T -#else -# define ACE_HAS_RECURSIVE_MUTEXES -#endif /* !ACE_HAS_PTHREADS_UNIX98_EXT */ - -#define ACE_HAS_THREAD_SPECIFIC_STORAGE // jcej 12/22/96 #2 - -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS // JCEJ 1/7-8/96 - -#if defined(__GLIBC__) -// Platform supports reentrant functions (i.e., all the POSIX *_r -// functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) - // Older versions of glibc lacked reentrant netdb functions -# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS - - // glibc < 2.1 lacks pthread_attr_setstacksize() -# define ACE_LACKS_PTHREAD_ATTR_SETSTACKSIZE -#endif /* (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) */ - -// uses ctime_r & asctime_r with only two parameters vs. three -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#endif - -#else -// AIO support pulls in the rt library, which pulls in the pthread -// library. Disable AIO in single-threaded builds. -# undef ACE_HAS_AIO_CALLS -#endif /* ACE_MT_SAFE */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_LINUX_H */ - diff --git a/dep/include/ace/config-lite.h b/dep/include/ace/config-lite.h deleted file mode 100644 index a8157bef1ec..00000000000 --- a/dep/include/ace/config-lite.h +++ /dev/null @@ -1,164 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file config-lite.h - * - * $Id: config-lite.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author (Originally in OS.h)Doug Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - * - * This file contains the contents of the old config-all.h in order to - * avoid a circular dependency problem caused by some of the new - * includes added to config-all.h, e.g., OS_main.h. - */ -//========================================================================== - -#ifndef ACE_CONFIG_LITE_H -#define ACE_CONFIG_LITE_H - -#include /**/ "ace/pre.h" - -#include "ace/config-macros.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Empty ACE_OS namespace to help identify compiler errors more -// easily. -- @@ Do we really need this? -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -namespace ACE_OS {} -ACE_END_VERSIONED_NAMESPACE_DECL - -// ============================================================================ -// UNICODE macros (to be added later) -// ============================================================================ - -// Get the unicode (i.e. ACE_TCHAR) defines -# include "ace/ace_wchar.h" - -// ============================================================================ -// at_exit declarations -// ============================================================================ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Marker for cleanup, used by ACE_Exit_Info. -extern int ace_exit_hook_marker; - -ACE_END_VERSIONED_NAMESPACE_DECL - -// For use by . -extern "C" -{ - typedef void (*ACE_EXIT_HOOK) (void); -} - -// Signature for registering a cleanup function that is used by the -// ACE_Object_Manager and the ACE_Thread_Manager. -# if defined (ACE_HAS_SIG_C_FUNC) -extern "C" { -# endif /* ACE_HAS_SIG_C_FUNC */ -typedef void (*ACE_CLEANUP_FUNC)(void *object, void *param) /* throw () */; -# if defined (ACE_HAS_SIG_C_FUNC) -} -# endif /* ACE_HAS_SIG_C_FUNC */ - -// ============================================================================ -// log_msg declarations -// ============================================================================ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) -typedef int (*ACE_SEH_EXCEPT_HANDLER)(void *); -// Prototype of win32 structured exception handler functions. -// They are used to get the exception handling expression or -// as exception handlers. -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - -class ACE_OS_Thread_Descriptor; -class ACE_OS_Log_Msg_Attributes; -typedef void (*ACE_INIT_LOG_MSG_HOOK) (ACE_OS_Log_Msg_Attributes &attr -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector - , ACE_SEH_EXCEPT_HANDLER handler -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ); -typedef void (*ACE_INHERIT_LOG_MSG_HOOK) (ACE_OS_Thread_Descriptor*, - ACE_OS_Log_Msg_Attributes &); - -typedef void (*ACE_CLOSE_LOG_MSG_HOOK) (void); - -typedef void (*ACE_SYNC_LOG_MSG_HOOK) (const ACE_TCHAR *prog_name); - -typedef ACE_OS_Thread_Descriptor *(*ACE_THR_DESC_LOG_MSG_HOOK) (void); - -ACE_END_VERSIONED_NAMESPACE_DECL - -/** - * @deprecated ACE_DECLARE_STL_REVERSE_ITERATORS is a crutch to be - * used until all C++ compiler supported by ACE support - * the standard reverse_iterator adapters. - * @internal ACE_DECLARE_STL_REVERSE_ITERATORS is not meant for use - * outside of ACE. - */ -// STL reverse_iterator declaration generator -// Make sure you include in the file you're using this -// generator, and that the following traits are available: -// -// iterator -// const_iterator -// value_type -// reference -// pointer -// const_reference -// const_pointer -// difference_type -// -// Once all C++ compilers support the standard reverse_iterator -// adapters, we can drop this generator macro or at least drop the -// MSVC++ or Sun Studio preprocessor conditional blocks. -#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x590 \ - && !defined (_STLPORT_VERSION) - // If we're not using the stlport4 C++ library (which has standard - // iterators), we need to ensure this is included in order to test - // the _RWSTD_NO_CLASS_PARTIAL_SPEC feature test macro below. -# include -#endif /* __SUNPRO_CC <= 0x580 */ -#if (defined (_MSC_VER) && (_MSC_VER <= 1310) && defined (_WIN64)) \ - || defined (ACE_HAS_BROKEN_STD_REVERSE_ITERATOR) - // VC 7.1 and the latest 64-bit platform SDK still don't define a standard - // compliant reverse_iterator adapter. -# define ACE_DECLARE_STL_REVERSE_ITERATORS \ - typedef std::reverse_iterator reverse_iterator; \ - typedef std::reverse_iterator const_reverse_iterator; -#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x590 \ - && defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) -# define ACE_DECLARE_STL_REVERSE_ITERATORS \ - typedef std::reverse_iterator reverse_iterator; \ - typedef std::reverse_iterator const_reverse_iterator; -#else -# define ACE_DECLARE_STL_REVERSE_ITERATORS \ - typedef std::reverse_iterator reverse_iterator; \ - typedef std::reverse_iterator const_reverse_iterator; -#endif /* _MSC_VER && _WIN64 */ - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_LITE_H */ - diff --git a/dep/include/ace/config-lynxos.h b/dep/include/ace/config-lynxos.h deleted file mode 100644 index baeafa88bb8..00000000000 --- a/dep/include/ace/config-lynxos.h +++ /dev/null @@ -1,163 +0,0 @@ -// $Id: config-lynxos.h 81780 2008-05-26 13:56:49Z olli $ - -// The following configuration file is designed to work for LynxOS, -// version 4.0.0 and later, using the GNU g++ compiler. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#include "ace/config-posix.h" - -#if defined (__x86__) -# define ACE_HAS_PENTIUM -#elif defined (__powerpc__) - // It looks like the default stack size is 15000. - // ACE's Recursive_Mutex_Test needs more. -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 - // This doesn't work on LynxOS 3.0.0, because it resets the TimeBaseRegister. - // # define ACE_HAS_POWERPC_TIMER -#endif /* __x86__ || __powerpc__ */ - -#define ACE_DEFAULT_BASE_ADDR ((char *) 0) -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_ALLOCA -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK 1 -#define ACE_HAS_BROKEN_SIGEVENT_STRUCT -#define ACE_HAS_CHARPTR_SHMAT -#define ACE_HAS_CHARPTR_SHMDT -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_GETPAGESIZE -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_GNU_CSTRING_H -#define ACE_HAS_GPERF -#define ACE_HAS_ICMP_SUPPORT 1 -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_LYNXOS_SIGNALS -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_CLOCK_SETTIME -#define ACE_HAS_NONCONST_MSGSND -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONCONST_SETRLIMIT -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_SCANDIR -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRBUF_T -#define ACE_HAS_STREAMS -#define ACE_HAS_STRERROR -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_SYS_SIGLIST -#define ACE_HAS_SYS_SOCKIO_H -#define ACE_HAS_TERMIOS -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_LACKS_ALPHASORT_PROTOTYPE -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_GETPGID -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MKSTEMP_PROTOTYPE -#define ACE_LACKS_MKTEMP_PROTOTYPE -#define ACE_LACKS_PUTENV_PROTOTYPE -#define ACE_LACKS_REALPATH -#define ACE_LACKS_RLIMIT_NOFILE -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SCANDIR_PROTOTYPE -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_SWAB_PROTOTYPE -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_VSNPRINTF -#define ACE_LACKS_WCHAR_H -#define ACE_MALLOC_ALIGN 8 -#define ACE_PAGE_SIZE 4096 -#define ACE_POSIX_SIG_PROACTOR -#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR - -// LynxOS has poll.h but it is unusable since implementation is not provided -#define ACE_LACKS_POLL_H - -#if ACE_MT_SAFE == 1 - // Platform supports threads. -# define ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_LACKS_NULL_PTHREAD_STATUS -# define ACE_LACKS_THREAD_PROCESS_SCOPING -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK -# if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0 -# define ACE_LACKS_SETDETACH -# define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR -# endif -#endif /* ACE_MT_SAFE */ - -#if __GNUC__ < 3 -# define ACE_LACKS_NUMERIC_LIMITS -#endif /* __GNUC__ < 3 */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -# define ACE_USE_RCSID 0 -#endif /* ! ACE_USE_RCSID */ - -// System include files are not in sys/, this gets rid of warning. -#define __NO_INCLUDE_WARN__ - -// "changes signedness" error (OS.i and many other files) -#define ACE_HAS_SOCKLEN_T -// LSOCK.cpp uses a macro from param.h, not included -#define ALIGNBYTES (sizeof(int) - 1) -#define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES) - -#if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0 -# define ACE_LACKS_GETOPT_PROTOTYPE -# define ACE_LACKS_INET_ATON_PROTOTYPE -# define ACE_LACKS_REGEX_H -# define ACE_LACKS_STRCASECMP_PROTOTYPE -# define ACE_LACKS_STRNCASECMP_PROTOTYPE -# define ACE_LACKS_SYS_SELECT_H -# define ACE_HAS_NONCONST_GETBY -#endif - -#if (ACE_LYNXOS_MAJOR > 4) || (ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR >= 2) -// LynxOS 4.2 additons -# define ACE_HAS_POSIX_SEM_TIMEOUT -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) -# define ACE_HAS_BROKEN_THREAD_KEYFREE -#endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-macosx-leopard.h b/dep/include/ace/config-macosx-leopard.h deleted file mode 100644 index 7351f938409..00000000000 --- a/dep/include/ace/config-macosx-leopard.h +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-macosx-leopard.h 81858 2008-06-07 03:31:22Z dai_y $ - -// This configuration file is designed to work with the MacOS X operating system. - -#ifndef ACE_CONFIG_MACOSX_LEOPARD_H -#define ACE_CONFIG_MACOSX_LEOPARD_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if !defined (ACE_SIZEOF_LONG_DOUBLE) -# if (__GNUC__ == 3 && __GNUC_MINOR__ == 3) - // Size of long double in GCC 3.3 is 8. -# define ACE_SIZEOF_LONG_DOUBLE 8 -# else // Else, the compiler is GCC4 - // For GCC4, the size is 16. -# define ACE_SIZEOF_LONG_DOUBLE 16 -# endif // GCC 3.3 -#endif // ACE_SIZEOF_LONG_DOUBLE - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#ifndef ACE_HAS_NONCONST_FD_ISSET -#define ACE_HAS_NONCONST_FD_ISSET -#endif - -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") - -#if !defined (__i386__) -# if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -# endif /* ACE_HAS_PENTIUM */ -#else // __i386__ -# define ACE_HAS_PENTIUM -#endif //__i386__ - -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -#define ACE_HAS_GPERF -#define ACE_HAS_POSIX_SEM - -#define ACE_HAS_SUNOS4_GETTIMEOFDAY - -#define ACE_LACKS_STROPTS_H - -// Platform provides header. -#define ACE_HAS_EXECINFO_H - -// Wcharness.... -#define ACE_HAS_WCHAR -#define ACE_SIZEOF_WCHAR 4 - -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSDUP - -// Mac lacks the following pthread features -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_CONDATTR_PSHARED -// -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -//Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -#define ACE_HAS_AIO_CALLS - -//Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - -#define ACE_LACKS_GETPGID -#define ACE_LACKS_RWLOCK_T - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -//? -#define ACE_LACKS_SIGSET - -#define ACE_NEEDS_SCHED_H - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -#define ACE_HAS_ALT_CUSERID - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler/platform provides the socklen_t type. -#define ACE_HAS_SOCKLEN_T - -// Defines the page size of the system. -#define ACE_HAS_GETPAGESIZE - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_MSQ_PROTOS -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE == 1 -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads -# define ACE_HAS_PTHREADS -# define ACE_HAS_PTHREADS_STD -# define ACE_HAS_PTHREAD_SCHEDPARAM -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -#endif /* ACE_MT_SAFE == 1 */ - -#define ACE_LACKS_THREAD_PROCESS_SCOPING - -#define ACE_HAS_DIRENT -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SEARCH_H - -#define ACE_LACKS_SETSCHED -//#define ACE_HAS_RECURSIVE_MUTEXES - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_GETIFADDRS -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_UNNAMED_SEMAPHORE - -// dlcompat package (not part of base Darwin) is needed for dlopen(). -// You may download directly from sourceforge and install or use fink -// Fink installer puts libraries in /sw/lib and headers in /sw/include -// In order to install dlcompat do the following: -// - download fink from http://fink.sf.net -// - type: -// fink install dlcompat -// as of Dec 2002, if you use fink you will need to uncomment the next line -// #define ACE_NEEDS_DL_UNDERSCORE -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") -#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") -//#define ACE_LACKS_DLCLOSE - -// gperf seems to need this -//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) -#error "Compiler must be upgraded, see http://developer.apple.com" -#endif /* __APPLE_CC__ */ - -#endif /* ACE_CONFIG_MACOSX_TIGER_H */ - diff --git a/dep/include/ace/config-macosx-panther.h b/dep/include/ace/config-macosx-panther.h deleted file mode 100644 index e2b3361752f..00000000000 --- a/dep/include/ace/config-macosx-panther.h +++ /dev/null @@ -1,192 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-macosx-panther.h 80826 2008-03-04 14:51:23Z wotte $ - -// This configuration file is designed to work with the MacOS X operating system. - -#ifndef ACE_CONFIG_MACOSX_H -#define ACE_CONFIG_MACOSX_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#define ACE_LACKS_SUSECONDS_T -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") - -#if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -#define ACE_HAS_GPERF -#define ACE_HAS_POSIX_SEM - -//#define ACE_HAS_SVR4_TLI - -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_WCHAR_H - -// -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -//Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -//Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - -//#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_LACKS_GETPGID -#define ACE_LACKS_RWLOCK_T - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -//? -#define ACE_LACKS_SIGSET - -#define ACE_NEEDS_SCHED_H - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -#define ACE_HAS_ALT_CUSERID - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -//#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_HAS_GETPAGESIZE - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_MSQ_PROTOS -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE == 1 -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads -# define ACE_HAS_PTHREADS -# define ACE_HAS_PTHREAD_SCHEDPARAM -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -#endif /* ACE_MT_SAFE == 1 */ - -# define ACE_LACKS_THREAD_PROCESS_SCOPING - -#define ACE_HAS_DIRENT -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SEARCH_H - -#define ACE_LACKS_SETSCHED -//#define ACE_HAS_RECURSIVE_MUTEXES - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_GETIFADDRS -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_UNNAMED_SEMAPHORE - -// dlcompat package (not part of base Darwin) is needed for dlopen(). -// You may download directly from sourceforge and install or use fink -// Fink installer puts libraries in /sw/lib and headers in /sw/include -// In order to install dlcompat do the following: -// - download fink from http://fink.sf.net -// - type: -// fink install dlcompat -// as of Dec 2002, if you use fink you will need to uncomment the next line -//#define ACE_NEEDS_DL_UNDERSCORE -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") -#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") -//#define ACE_LACKS_DLCLOSE - -// gperf seems to need this -//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) -#error "Compiler must be upgraded, see http://developer.apple.com" -#endif /* __APPLE_CC__ */ - -#endif /* ACE_CONFIG_MACOSX_H */ - diff --git a/dep/include/ace/config-macosx-tiger.h b/dep/include/ace/config-macosx-tiger.h deleted file mode 100644 index 447c834ac0c..00000000000 --- a/dep/include/ace/config-macosx-tiger.h +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-macosx-tiger.h 82344 2008-07-19 20:04:18Z johnnyw $ - -// This configuration file is designed to work with the MacOS X operating system. - -#ifndef ACE_CONFIG_MACOSX_TIGER_H -#define ACE_CONFIG_MACOSX_TIGER_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if !defined (ACE_SIZEOF_LONG_DOUBLE) -# if (__GNUC__ == 3 && __GNUC_MINOR__ == 3) - // Size of long double in GCC 3.3 is 8. -# define ACE_SIZEOF_LONG_DOUBLE 8 -# else // Else, the compiler is GCC4 - // For GCC4, the size is 16. -# define ACE_SIZEOF_LONG_DOUBLE 16 -# endif // GCC 3.3 -#endif // ACE_SIZEOF_LONG_DOUBLE - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") - -#if !defined (__i386__) -# if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -# endif /* ACE_HAS_PENTIUM */ -#else // __i386__ -# define ACE_HAS_PENTIUM -#endif //__i386__ - -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -#define ACE_HAS_GPERF -#define ACE_HAS_POSIX_SEM - -#define ACE_HAS_SUNOS4_GETTIMEOFDAY - -#define ACE_LACKS_STROPTS_H - -// Wcharness.... -#define ACE_HAS_WCHAR -#define ACE_SIZEOF_WCHAR 4 - -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSDUP - -// Mac lacks the following pthread features -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_CONDATTR_PSHARED -// -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -//Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -#define ACE_HAS_AIO_CALLS - -//Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - -#define ACE_LACKS_GETPGID -#define ACE_LACKS_RWLOCK_T - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -//? -#define ACE_LACKS_SIGSET - -#define ACE_NEEDS_SCHED_H - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -#define ACE_HAS_ALT_CUSERID - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler/platform provides the socklen_t type. -#define ACE_HAS_SOCKLEN_T - -// Defines the page size of the system. -#define ACE_HAS_GETPAGESIZE - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_MSQ_PROTOS -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE == 1 -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads -# define ACE_HAS_PTHREADS -# define ACE_HAS_PTHREAD_SCHEDPARAM -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -#endif /* ACE_MT_SAFE == 1 */ - -#define ACE_LACKS_THREAD_PROCESS_SCOPING - -#define ACE_HAS_DIRENT -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SEARCH_H - -#define ACE_LACKS_SETSCHED -//#define ACE_HAS_RECURSIVE_MUTEXES - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_GETIFADDRS -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_UNNAMED_SEMAPHORE - -// dlcompat package (not part of base Darwin) is needed for dlopen(). -// You may download directly from sourceforge and install or use fink -// Fink installer puts libraries in /sw/lib and headers in /sw/include -// In order to install dlcompat do the following: -// - download fink from http://fink.sf.net -// - type: -// fink install dlcompat -// as of Dec 2002, if you use fink you will need to uncomment the next line -// #define ACE_NEEDS_DL_UNDERSCORE -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") -#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") -//#define ACE_LACKS_DLCLOSE - -// gperf seems to need this -//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) -#error "Compiler must be upgraded, see http://developer.apple.com" -#endif /* __APPLE_CC__ */ - -#endif /* ACE_CONFIG_MACOSX_TIGER_H */ - diff --git a/dep/include/ace/config-macosx.h b/dep/include/ace/config-macosx.h deleted file mode 100644 index e8ec1af6e96..00000000000 --- a/dep/include/ace/config-macosx.h +++ /dev/null @@ -1,192 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-macosx.h 80826 2008-03-04 14:51:23Z wotte $ - -// This configuration file is designed to work with the MacOS X operating system, version 10.2 (Jaguar). - -#ifndef ACE_CONFIG_MACOSX_H -#define ACE_CONFIG_MACOSX_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") - -#if defined (ACE_HAS_PENTIUM) -# undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -#define ACE_HAS_GPERF -#define ACE_HAS_POSIX_SEM - -//#define ACE_HAS_SVR4_TLI - -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_WCHAR_H - -#define ACE_SYS_SELECT_NEEDS_UNISTD_H - -// -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -//Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -//Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - -//#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_LACKS_GETPGID -#define ACE_LACKS_RWLOCK_T - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -#define ACE_HAS_SYSCTL - -//? -#define ACE_LACKS_SIGSET - -#define ACE_NEEDS_SCHED_H - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -#define ACE_HAS_ALT_CUSERID - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -//#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -//#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_HAS_GETPAGESIZE - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_MSQ_PROTOS -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE == 1 -// Yes, we do have threads. -# define ACE_HAS_THREADS -// And they're even POSIX pthreads -# define ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_LACKS_THREAD_PROCESS_SCOPING -#endif /* ACE_MT_SAFE == 1 */ - -#define ACE_HAS_DIRENT -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SEARCH_H - -#define ACE_LACKS_SETSCHED -//#define ACE_HAS_RECURSIVE_MUTEXES - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#define ACE_HAS_SEMUN -#define ACE_HAS_SIGINFO_T -#define ACE_LACKS_SIGINFO_H -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_GETIFADDRS -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_UNNAMED_SEMAPHORE - -// dlcompat package (not part of base Darwin) is needed for dlopen(). -// You may download directly from sourceforge and install or use fink -// Fink installer puts libraries in /sw/lib and headers in /sw/include -// In order to install dlcompat do the following: -// - download fink from http://fink.sf.net -// - type: -// fink install dlcompat -// as of Dec 2002, if you use fink you will need to uncomment the next line -//#define ACE_NEEDS_DL_UNDERSCORE -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_LD_SEARCH_PATH ACE_TEXT ("DYLD_LIBRARY_PATH") -#define ACE_DLL_SUFFIX ACE_TEXT (".dylib") -#define ACE_LACKS_DLCLOSE - -// gperf seems to need this -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) -#error "Compiler must be upgraded, see http://developer.apple.com" -#endif /* __APPLE_CC__ */ - -#endif /* ACE_CONFIG_MACOSX_H */ - diff --git a/dep/include/ace/config-macros.h b/dep/include/ace/config-macros.h deleted file mode 100644 index 5d1067e6c13..00000000000 --- a/dep/include/ace/config-macros.h +++ /dev/null @@ -1,637 +0,0 @@ -// -*- C++ -*- - -//========================================================================== -/** - * @file config-macros.h - * - * $Id: config-macros.h 82495 2008-08-04 07:23:01Z johnnyw $ - * - * @author (Originally in OS.h)Doug Schmidt - * @author Jesper S. M|ller - * @author and a cast of thousands... - * - * This file contains the contents of the old config-lite.h header - * without C++ code (except for C++ code in macros). Specifically, - * only macros or C language constructs are found in this header. - * Allows configuration values and macros to be used by some C - * language sources. - */ -//========================================================================== - -#ifndef ACE_CONFIG_MACROS_H -#define ACE_CONFIG_MACROS_H - -#ifdef _WIN32 -#include "ace/config-win32.h" -#else -#include "ace/config.h" -#endif //_WIN32 - -#include "ace/Version.h" -#include "ace/Versioned_Namespace.h" - -// ACE_HAS_TLI is used to decide whether to try any XTI/TLI functionality -// so if it isn't set, set it. Capabilities and differences between -// XTI and TLI favor XTI, but when deciding to do anything, as opposed to -// ACE_NOTSUP_RETURN for example, ACE_HAS_TLI is the deciding factor. -#if !defined (ACE_HAS_TLI) -# if defined (ACE_HAS_XTI) -# define ACE_HAS_TLI -# endif /* ACE_HAS_XTI */ -#endif /* ACE_HAS_TLI */ - -#define ACE_BITS_PER_ULONG (8 * sizeof (u_long)) - -#if !defined (ACE_OSTREAM_TYPE) -# if defined (ACE_LACKS_IOSTREAM_TOTALLY) -# define ACE_OSTREAM_TYPE FILE -# else /* ! ACE_LACKS_IOSTREAM_TOTALLY */ -# define ACE_OSTREAM_TYPE ostream -# endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ -#endif /* ! ACE_OSTREAM_TYPE */ - -#if !defined (ACE_DEFAULT_LOG_STREAM) -# if defined (ACE_LACKS_IOSTREAM_TOTALLY) -# define ACE_DEFAULT_LOG_STREAM 0 -# else /* ! ACE_LACKS_IOSTREAM_TOTALLY */ -# define ACE_DEFAULT_LOG_STREAM (&cerr) -# endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ -#endif /* ! ACE_DEFAULT_LOG_STREAM */ - -// These two are only for backward compatibility. You should avoid -// using them if not necessary. -#if !defined (ACE_LACKS_DEPRECATED_MACROS) -/** - * @deprecated The ACE_SYNCH_1 macro is deprecated - */ -# define ACE_SYNCH_1 ACE_SYNCH_DECL -/** - * @deprecated The ACE_SYNCH_2 macro is deprecated - */ -# define ACE_SYNCH_2 ACE_SYNCH_USE -#endif - -// For Win32 compatibility... -# if !defined (ACE_WSOCK_VERSION) -# define ACE_WSOCK_VERSION 0, 0 -# endif /* ACE_WSOCK_VERSION */ - -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# define ACE_MT(X) X -# if !defined (_REENTRANT) -# define _REENTRANT -# endif /* _REENTRANT */ -# else -# define ACE_MT(X) -# endif /* ACE_MT_SAFE */ - -# if defined (ACE_HAS_PURIFY) -# define ACE_INITIALIZE_MEMORY_BEFORE_USE -# endif /* ACE_HAS_PURIFY */ - -# if defined (ACE_HAS_VALGRIND) -# define ACE_INITIALIZE_MEMORY_BEFORE_USE -# endif /* ACE_HAS_VALGRIND */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) -/** - * @deprecated The @c ACE_HAS_USING macros are deprecated - */ -# define ACE_USING using -#endif /* !ACE_LACKS_DEPRECATED_MACROS */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) -/** - * @deprecated The @c ACE_TYPENAME macros is deprecated. Use standard - * C++ keyword typename instead. - */ -# define ACE_TYPENAME typename -#endif /* !ACE_LACKS_DEPRECATED_MACROS */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) -/** - * @deprecated The @c ACE_TEMPLATE_SPECIALIZATION and - * @c ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION macros are - * deprecated. Use standard C++ template specialization - * syntax instead. - */ -# define ACE_TEMPLATE_SPECIALIZATION template<> -# define ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -#endif /* !ACE_LACKS_DEPRECATED_MACROS */ - -// ========================================================================= -// Perfect Multicast filting refers to RFC 3376, where a socket is only -// delivered dgrams for groups joined even if it didn't bind the group -// address. We turn this option off by default, although most OS's -// except for Windows and Solaris probably lack perfect filtering. -// ========================================================================= - -# if !defined (ACE_LACKS_PERFECT_MULTICAST_FILTERING) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 0 -# endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -// ========================================================================= -// Enable/Disable Features By Default -// ========================================================================= - -# if !defined (ACE_HAS_POSITION_INDEPENDENT_POINTERS) -# define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 -# endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS */ - -# if !defined (ACE_HAS_PROCESS_SPAWN) -# if !defined (ACE_LACKS_FORK) || \ - (defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP)) || \ - defined (ACE_WINCE) || defined (ACE_OPENVMS) -# define ACE_HAS_PROCESS_SPAWN 1 -# endif -# endif /* ACE_HAS_PROCESS_SPAWN */ - -# if !defined (ACE_HAS_DYNAMIC_LINKING) -# if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) || defined (ACE_WIN32) || defined (ACE_VXWORKS) || defined (__hpux) -# define ACE_HAS_DYNAMIC_LINKING 1 -# endif -# endif /* ACE_HAS_DYNAMIC_LINKING */ - -# if defined (ACE_USES_FIFO_SEM) -# if defined (ACE_HAS_POSIX_SEM) || defined (ACE_LACKS_MKFIFO) || defined (ACE_LACKS_FCNTL) -# undef ACE_USES_FIFO_SEM -# endif -# endif /* ACE_USES_FIFO_SEM */ - -// ========================================================================= -// RCSID Macros -// ========================================================================= - -// By default, DO NOT include RCS Id strings in object code. -#if ! defined (ACE_USE_RCSID) -# define ACE_USE_RCSID 0 -#endif /* #if ! defined (ACE_USE_RCSID) */ - -#if (defined (ACE_USE_RCSID) && (ACE_USE_RCSID != 0)) -# if ! defined (ACE_RCSID) - - // This hack has the following purposes: - // 1. To define the RCS id string variable as a static char*, so - // that there won't be any duplicate extern symbols at link - // time. - // 2. To have a RCS id string variable with a unique name for each - // file. - // 3. To avoid warnings of the type "variable declared and never - // used". - -# define ACE_RCSID(path, file, id) \ - static inline const char* get_rcsid_ ## path ## _ ## file (const char*) \ - { \ - return id ; \ - } \ - static const char* rcsid_ ## path ## _ ## file = \ - get_rcsid_ ## path ## _ ## file ( rcsid_ ## path ## _ ## file ) ; - -# endif /* #if ! defined (ACE_RCSID) */ -#else - - // RCS id strings are not wanted. -# if defined (ACE_RCSID) -# undef ACE_RCSID -# endif /* #if defined (ACE_RCSID) */ -# define ACE_RCSID(path, file, id) /* noop */ -#endif /* #if (defined (ACE_USE_RCSID) && (ACE_USE_RCSID != 0)) */ - -// ========================================================================= -// INLINE macros -// -// These macros handle all the inlining of code via the .i or .inl files -// ========================================================================= - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) && !defined (ACE_NO_INLINE) -# define ACE_NO_INLINE -#endif /* defined (ACE_LACKS_INLINE_FUNCTIONS) && !defined (ACE_NO_INLINE) */ - -// ACE inlining has been explicitly disabled. Implement -// internally within ACE by undefining __ACE_INLINE__. -#if defined (ACE_NO_INLINE) -# undef __ACE_INLINE__ -#endif /* ! ACE_NO_INLINE */ - -#if defined (__ACE_INLINE__) -# define ACE_INLINE inline -# if !defined (ACE_HAS_INLINED_OSCALLS) -# define ACE_HAS_INLINED_OSCALLS -# endif /* !ACE_HAS_INLINED_OSCALLS */ -#else -# define ACE_INLINE -#endif /* __ACE_INLINE__ */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - // ========================================================================= - // EXPLICIT macro - // ========================================================================= - - /** - * @deprecated explicit is deprecated. ACE requires C++ - * "explicit" keyword support. - */ - # define ACE_EXPLICIT explicit -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - // ========================================================================= - // MUTABLE macro - // ========================================================================= - - /** - * @deprecated ACE_MUTABLE is deprecated. ACE requires C++ "mutable" - * keyword support. - */ - # define ACE_MUTABLE mutable - # define ACE_CONST_WHEN_MUTABLE const -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -// ============================================================================ -// EXPORT macros -// -// Since Win32 DLL's do not export all symbols by default, they must be -// explicitly exported (which is done by *_Export macros). -// ============================================================================ - -// Win32 should have already defined the macros in config-win32-common.h -#if !defined (ACE_HAS_CUSTOM_EXPORT_MACROS) -# define ACE_Proper_Export_Flag -# define ACE_Proper_Import_Flag -# define ACE_EXPORT_SINGLETON_DECLARATION(T) -# define ACE_IMPORT_SINGLETON_DECLARATION(T) -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#else -// An export macro should at the very least have been defined. - -# ifndef ACE_Proper_Import_Flag -# define ACE_Proper_Import_Flag -# endif /* !ACE_Proper_Import_Flag */ - -# ifndef ACE_EXPORT_SINGLETON_DECLARATION -# define ACE_EXPORT_SINGLETON_DECLARATION(T) -# endif /* !ACE_EXPORT_SINGLETON_DECLARATION */ - -# ifndef ACE_IMPORT_SINGLETON_DECLARATION -# define ACE_IMPORT_SINGLETON_DECLARATION(T) -# endif /* !ACE_IMPORT_SINGLETON_DECLARATION */ - -# ifndef ACE_EXPORT_SINGLETON_DECLARE -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* !ACE_EXPORT_SINGLETON_DECLARE */ - -# ifndef ACE_IMPORT_SINGLETON_DECLARE -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* !ACE_IMPORT_SINGLETON_DECLARE */ - -#endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */ - -// This is a whim of mine -- that instead of annotating a class with -// ACE_Export in its declaration, we make the declaration near the TOP -// of the file with ACE_DECLARE_EXPORT. -// TS = type specifier (e.g., class, struct, int, etc.) -// ID = identifier -// So, how do you use it? Most of the time, just use ... -// ACE_DECLARE_EXPORT(class, someobject); -// If there are global functions to be exported, then use ... -// ACE_DECLARE_EXPORT(void, globalfunction) (int, ...); -// Someday, when template libraries are supported, we made need ... -// ACE_DECLARE_EXPORT(template class, sometemplate) ; -# define ACE_DECLARE_EXPORT(TS,ID) TS ACE_Export ID - -// ============================================================================ -// Cast macros -// -// These macros are used to choose between the old cast style and the new -// *_cast<> operators -// ============================================================================ - -# define ACE_sap_any_cast(TYPE) reinterpret_cast (const_cast (ACE_Addr::sap_any)) - -#if !defined (ACE_LACKS_DEPRECATED_MACROS) - /** - * @deprecated ACE_{static,reinterpret,dynamic,const}_cast@<@> is - * deprecated. Directly use standard C++ casts instead. - */ - # define ACE_static_cast(TYPE, EXPR) static_cast (EXPR) - # define ACE_static_cast_1_ptr(TYPE, T1, EXPR) static_cast *> (EXPR) - # define ACE_static_cast_2_ptr(TYPE, T1, T2, EXPR) static_cast *> (EXPR) - # define ACE_static_cast_3_ptr(TYPE, T1, T2, T3, EXPR) static_cast *> (EXPR) - # define ACE_static_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) static_cast *> (EXPR) - # define ACE_static_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast *> (EXPR) - # define ACE_static_cast_1_ref(TYPE, T1, EXPR) static_cast &> (EXPR) - # define ACE_static_cast_2_ref(TYPE, T1, T2, EXPR) static_cast &> (EXPR) - # define ACE_static_cast_3_ref(TYPE, T1, T2, T3, EXPR) static_cast &> (EXPR) - # define ACE_static_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) static_cast &> (EXPR) - # define ACE_static_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast &> (EXPR) - - # define ACE_const_cast(TYPE, EXPR) const_cast (EXPR) - # define ACE_const_cast_1_ptr(TYPE, T1, EXPR) const_cast *> (EXPR) - # define ACE_const_cast_2_ptr(TYPE, T1, T2, EXPR) const_cast *> (EXPR) - # define ACE_const_cast_3_ptr(TYPE, T1, T2, T3, EXPR) const_cast *> (EXPR) - # define ACE_const_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) const_cast *> (EXPR) - # define ACE_const_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) const_cast *> (EXPR) - # define ACE_const_cast_1_ref(TYPE, T1, EXPR) const_cast &> (EXPR) - # define ACE_const_cast_2_ref(TYPE, T1, T2, EXPR) const_cast &> (EXPR) - # define ACE_const_cast_3_ref(TYPE, T1, T2, T3, EXPR) const_cast &> (EXPR) - # define ACE_const_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) const_cast &> (EXPR) - # define ACE_const_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) const_cast &> (EXPR) - - # define ACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast (EXPR) - # define ACE_reinterpret_cast_1_ptr(TYPE, T1, EXPR) reinterpret_cast *> (EXPR) - # define ACE_reinterpret_cast_2_ptr(TYPE, T1, T2, EXPR) reinterpret_cast *> (EXPR) - # define ACE_reinterpret_cast_3_ptr(TYPE, T1, T2, T3, EXPR) reinterpret_cast *> (EXPR) - # define ACE_reinterpret_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) reinterpret_cast *> (EXPR) - # define ACE_reinterpret_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) reinterpret_cast *> (EXPR) - # define ACE_reinterpret_cast_1_ref(TYPE, T1, EXPR) reinterpret_cast &> (EXPR) - # define ACE_reinterpret_cast_2_ref(TYPE, T1, T2, EXPR) reinterpret_cast &> (EXPR) - # define ACE_reinterpret_cast_3_ref(TYPE, T1, T2, T3, EXPR) reinterpret_cast &> (EXPR) - # define ACE_reinterpret_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) reinterpret_cast &> (EXPR) - # define ACE_reinterpret_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) reinterpret_cast &> (EXPR) - - # define ACE_dynamic_cast(TYPE, EXPR) dynamic_cast (EXPR) - # define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) dynamic_cast *> (EXPR) - # define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) dynamic_cast *> (EXPR) - # define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) dynamic_cast *> (EXPR) - # define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast *> (EXPR) - # define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast *> (EXPR) - # define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) dynamic_cast &> (EXPR) - # define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) dynamic_cast &> (EXPR) - # define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) dynamic_cast &> (EXPR) - # define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast &> (EXPR) - # define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast &> (EXPR) -#endif /* ACE_LACKS_DEPRECATED_MACROS */ - -# if !defined (ACE_CAST_CONST) - // Sun CC 4.2, for example, requires const in reinterpret casts of - // data members in const member functions. But, other compilers - // complain about the useless const. This keeps everyone happy. -# if defined (__SUNPRO_CC) -# define ACE_CAST_CONST const -# else /* ! __SUNPRO_CC */ -# define ACE_CAST_CONST -# endif /* ! __SUNPRO_CC */ -# endif /* ! ACE_CAST_CONST */ - -// ============================================================================ -// Compiler Silencing macros -// -// Some compilers complain about parameters that are not used. This macro -// should keep them quiet. -// ============================================================================ - -#if !defined (ACE_UNUSED_ARG) -# if defined (__GNUC__) && ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))) -# define ACE_UNUSED_ARG(a) (void) (a) -# elif defined (__GNUC__) || defined (ghs) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) -// Some compilers complain about "statement with no effect" with (a). -// This eliminates the warnings, and no code is generated for the null -// conditional statement. @note that may only be true if -O is enabled, -// such as with GreenHills (ghs) 1.8.8. -# define ACE_UNUSED_ARG(a) do {/* null */} while (&a == 0) -# elif defined (__DMC__) - #define ACE_UNUSED_ID(identifier) - template - inline void ACE_UNUSED_ARG(const T& ACE_UNUSED_ID(t)) { } -# else /* ghs || __GNUC__ || ..... */ -# define ACE_UNUSED_ARG(a) (a) -# endif /* ghs || __GNUC__ || ..... */ -#endif /* !ACE_UNUSED_ARG */ - -#if defined (_MSC_VER) || defined(__sgi) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (ACE_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC >= 60500)) -# define ACE_NOTREACHED(a) -#else /* __sgi || ghs || ..... */ -# define ACE_NOTREACHED(a) a -#endif /* __sgi || ghs || ..... */ - -// ============================================================================ -// ACE_ALLOC_HOOK* macros -// -// Macros to declare and define class-specific allocation operators. -// ============================================================================ - -# if defined (ACE_HAS_ALLOC_HOOKS) -# define ACE_ALLOC_HOOK_DECLARE \ - void *operator new (size_t bytes); \ - void operator delete (void *ptr); - - // Note that these are just place holders for now. Some day they - // may be be replaced by . -# define ACE_ALLOC_HOOK_DEFINE(CLASS) \ - void *CLASS::operator new (size_t bytes) { return ::new char[bytes]; } \ - void CLASS::operator delete (void *ptr) { delete [] ((char *) ptr); } -# else -# define ACE_ALLOC_HOOK_DECLARE struct __Ace {} /* Just need a dummy... */ -# define ACE_ALLOC_HOOK_DEFINE(CLASS) -# endif /* ACE_HAS_ALLOC_HOOKS */ - -// ============================================================================ -/** - * ACE_OSCALL* macros - * - * @deprecated ACE_OSCALL_RETURN and ACE_OSCALL should not be used. - * Please restart system calls in your application code. - * See the @c sigaction(2) man page for documentation - * regarding enabling restartable system calls across - * signals via the @c SA_RESTART flag. - * - * The following two macros used ensure that system calls are properly - * restarted (if necessary) when interrupts occur. However, that - * capability was never enabled by any of our supported platforms. - * In fact, some parts of ACE would not function properly when that - * ability was enabled. Furthermore, they assumed that ability to - * restart system calls was determined statically. That assumption - * does not hold for modern platforms, where that ability is - * determined dynamically at run-time. - */ -// ============================================================================ - -#define ACE_OSCALL_RETURN(X,TYPE,FAILVALUE) \ - do \ - return (TYPE) (X); \ - while (0) -#define ACE_OSCALL(X,TYPE,FAILVALUE,RESULT) \ - do \ - RESULT = (TYPE) (X); \ - while (0) - -#if defined (ACE_WIN32) -# define ACE_WIN32CALL_RETURN(X,TYPE,FAILVALUE) \ - do { \ - TYPE ace_result_ = (TYPE) X; \ - if (ace_result_ == FAILVALUE) \ - ACE_OS::set_errno_to_last_error (); \ - return ace_result_; \ - } while (0) -# define ACE_WIN32CALL(X,TYPE,FAILVALUE,RESULT) \ - do { \ - RESULT = (TYPE) X; \ - if (RESULT == FAILVALUE) \ - ACE_OS::set_errno_to_last_error (); \ - } while (0) -#endif /* ACE_WIN32 */ - -// The C99 security-improved run-time returns an error value on failure; -// 0 on success. -#if defined (ACE_HAS_TR24731_2005_CRT) -# define ACE_SECURECRTCALL(X,TYPE,FAILVALUE,RESULT) \ - do { \ - errno_t ___ = X; \ - if (___ != 0) { errno = ___; RESULT = FAILVALUE; } \ - } while (0) -#endif /* ACE_HAS_TR24731_2005_CRT */ - -// ============================================================================ -// Fundamental types -// ============================================================================ - -#if defined (ACE_WIN32) - -typedef HANDLE ACE_HANDLE; -typedef SOCKET ACE_SOCKET; -# define ACE_INVALID_HANDLE INVALID_HANDLE_VALUE - -#else /* ! ACE_WIN32 */ - -typedef int ACE_HANDLE; -typedef ACE_HANDLE ACE_SOCKET; -# define ACE_INVALID_HANDLE -1 - -#endif /* ACE_WIN32 */ - -// Define the type that's returned from the platform's native thread -// functions. ACE_THR_FUNC_RETURN is the type defined as the thread -// function's return type, except when the thread function doesn't return -// anything (pSoS). The ACE_THR_FUNC_NO_RETURN_VAL macro is used to -// indicate that the actual thread function doesn't return anything. The -// rest of ACE uses a real type so there's no a ton of conditional code -// everywhere to deal with the possibility of no return type. -# if defined (ACE_VXWORKS) && !defined (ACE_HAS_PTHREADS) -# include /**/ -typedef int ACE_THR_FUNC_RETURN; -#define ACE_HAS_INTEGRAL_TYPE_THR_FUNC_RETURN -# elif defined (ACE_WIN32) -typedef DWORD ACE_THR_FUNC_RETURN; -#define ACE_HAS_INTEGRAL_TYPE_THR_FUNC_RETURN -# else -typedef void* ACE_THR_FUNC_RETURN; -# endif /* ACE_VXWORKS */ -typedef ACE_THR_FUNC_RETURN (*ACE_THR_FUNC)(void *); - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -typedef void (*ACE_THR_C_DEST)(void *); -#ifdef __cplusplus -} -#endif /* __cplusplus */ -typedef void (*ACE_THR_DEST)(void *); - -// Now some platforms have special requirements... -# if defined (ACE_VXWORKS) && !defined (ACE_HAS_PTHREADS) -typedef FUNCPTR ACE_THR_FUNC_INTERNAL; // where typedef int (*FUNCPTR) (...) -# else -typedef ACE_THR_FUNC ACE_THR_FUNC_INTERNAL; -# endif /* ACE_VXWORKS */ - -# ifdef __cplusplus -extern "C" -{ -# endif /* __cplusplus */ -# if defined (ACE_VXWORKS) && !defined (ACE_HAS_PTHREADS) -typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...) -# else -typedef ACE_THR_FUNC_RETURN (*ACE_THR_C_FUNC)(void *); -# endif /* ACE_VXWORKS */ -# ifdef __cplusplus -} -# endif /* __cplusplus */ - -// ============================================================================ -// Macros for controlling the lifetimes of dlls loaded by ACE_DLL--including -// all dlls loaded via the ACE Service Config framework. -// -// Please don't change these values or add new ones wantonly, since we use -// the ACE_BIT_ENABLED, etc..., macros to test them. -// ============================================================================ - -// Per-process policy that unloads dlls eagerly. -#define ACE_DLL_UNLOAD_POLICY_PER_PROCESS 0 -// Apply policy on a per-dll basis. If the dll doesn't use one of the macros -// below, the current per-process policy will be used. -#define ACE_DLL_UNLOAD_POLICY_PER_DLL 1 -// Don't unload dll when refcount reaches zero, i.e., wait for either an -// explicit unload request or program exit. -#define ACE_DLL_UNLOAD_POLICY_LAZY 2 -// Default policy allows dlls to control their own destinies, but will -// unload those that don't make a choice eagerly. -#define ACE_DLL_UNLOAD_POLICY_DEFAULT ACE_DLL_UNLOAD_POLICY_PER_DLL - -// Add this macro you one of your cpp file in your dll. X should -// be either ACE_DLL_UNLOAD_POLICY_DEFAULT or ACE_DLL_UNLOAD_POLICY_LAZY. -#define ACE_DLL_UNLOAD_POLICY(CLS,X) \ -extern "C" u_long CLS##_Export _get_dll_unload_policy (void) \ - { return X;} - -// ============================================================================ -// ACE_USES_CLASSIC_SVC_CONF macro -// ============================================================================ - -// For now, default is to use the classic svc.conf format. -#if !defined (ACE_USES_CLASSIC_SVC_CONF) -# if defined (ACE_HAS_CLASSIC_SVC_CONF) && defined (ACE_HAS_XML_SVC_CONF) -# error You can only use either CLASSIC or XML svc.conf, not both. -# endif -// Change the ACE_HAS_XML_SVC_CONF to ACE_HAS_CLASSIC_SVC_CONF when -// we switch ACE to use XML svc.conf as default format. -# if defined (ACE_HAS_XML_SVC_CONF) -# define ACE_USES_CLASSIC_SVC_CONF 0 -# else -# define ACE_USES_CLASSIC_SVC_CONF 1 -# endif /* ACE_HAS_XML_SVC_CONF */ -#endif /* ACE_USES_CLASSIC_SVC_CONF */ - -// ============================================================================ -// Default svc.conf file extension. -// ============================================================================ -#if defined (ACE_USES_CLASSIC_SVC_CONF) && (ACE_USES_CLASSIC_SVC_CONF == 1) -# define ACE_DEFAULT_SVC_CONF_EXT ".conf" -#else -# define ACE_DEFAULT_SVC_CONF_EXT ".conf.xml" -#endif /* ACE_USES_CLASSIC_SVC_CONF && ACE_USES_CLASSIC_SVC_CONF == 1 */ - -// ============================================================================ -// Miscellaneous macros -// ============================================================================ - -#if defined (ACE_USES_EXPLICIT_STD_NAMESPACE) -# define ACE_STD_NAMESPACE std -#else -# define ACE_STD_NAMESPACE -#endif - -#if !defined (ACE_OS_String) -# define ACE_OS_String ACE_OS -#endif /* ACE_OS_String */ -#if !defined (ACE_OS_Memory) -# define ACE_OS_Memory ACE_OS -#endif /* ACE_OS_Memory */ -#if !defined (ACE_OS_Dirent) -# define ACE_OS_Dirent ACE_OS -#endif /* ACE_OS_Dirent */ -#if !defined (ACE_OS_TLI) -# define ACE_OS_TLI ACE_OS -#endif /* ACE_OS_TLI */ - -// ------------------------------------------------------------------- -// Preprocessor symbols will not be expanded if they are -// concatenated. Force the preprocessor to expand them during the -// argument prescan by calling a macro that itself calls another that -// performs the actual concatenation. -#define ACE_PREPROC_CONCATENATE_IMPL(A,B) A ## B -#define ACE_PREPROC_CONCATENATE(A,B) ACE_PREPROC_CONCATENATE_IMPL(A,B) -// ------------------------------------------------------------------- - -#endif /* ACE_CONFIG_MACROS_H */ - diff --git a/dep/include/ace/config-minimal.h b/dep/include/ace/config-minimal.h deleted file mode 100644 index 5766987f07d..00000000000 --- a/dep/include/ace/config-minimal.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-minimal.h 80826 2008-03-04 14:51:23Z wotte $ - -// This configuration file is designed to build only the minimal -// ACE_OS adaptation layer. - -#ifndef ACE_CONFIG_MINIMAL_H -#define ACE_CONFIG_MINIMAL_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_MINIMAL_ACE_OS - -// Only instantiate the ACE_OS_Object_Manager. -#define ACE_MAIN_OBJECT_MANAGER \ - ACE_OS_Object_Manager ace_os_object_manager; - -#if !defined(ACE_USE_THREAD_MANAGER_ADAPTER) - // To prevent use of ACE_Thread_Exit functions in - // ACE_Thread_Adapter::invoke (). -# define ACE_USE_THREAD_MANAGER_ADAPTER -#endif /* ! ACE_USE_THREAD_MANAGER_ADAPTER */ - -#if defined (ACE_ASSERT) -# undef ACE_ASSERT -#endif /* ACE_ASSERT */ -#define ACE_ASSERT(x) - -#if defined (ACE_DEBUG) -# undef ACE_DEBUG -#endif /* ACE_DEBUG */ -#define ACE_DEBUG(x) - -#if defined (ACE_ERROR) -# undef ACE_ERROR -#endif /* ACE_ERROR */ -#define ACE_ERROR(x) - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_MINIMAL_H */ - diff --git a/dep/include/ace/config-mvs.h b/dep/include/ace/config-mvs.h deleted file mode 100644 index 22ddffee139..00000000000 --- a/dep/include/ace/config-mvs.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-mvs.h 81992 2008-06-16 19:09:50Z wotte $ - -// Config file for MVS with OpenEdition - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -// The following #defines are hacks to get around things -// that seem to be missing or different in MVS land -#define MAXPATHLEN 1024 /* sys/param.h not on MVS */ -#define NSIG 44 /* missing from Signal.h */ -#define MAXHOSTNAMELEN 256 /* missing form netdb.h */ -#define howmany __howmany /* MVS uses different names than most others */ -#define fd_mask __fd_mask -#define MAXNAMLEN __DIR_NAME_MAX -#if defined (log) /* log is a macro in math.h */ -# undef log /* conflicts with log function in ACE */ -#endif /* log */ - -#define ACE_MVS - -// Preprocesor requires an extra argument -#ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR_ARGS "-+ -E" -#endif - -// See the README file in this directory -// for a description of the following ACE_ macros - -#if __COMPILER_VER__ >= 0x21020000 /* OS/390 r2 or higher */ -# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -# define ACE_HAS_UCONTEXT_T -#else /* __COMPILER_VER__ < 0x21020000 */ -# define ACE_LACKS_UCONTEXT_H -#endif /* __COMPILER_VER__ < 0x21020000 */ - -#if __COMPILER_VER__ < 0x22060000 /* before OS/390 r2.6 */ -# define ACE_LACKS_LONGLONG_T -#endif /* __COMPILER_VER__ < 0x22060000 */ - -#define ERRMAX __sys_nerr - -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_HAS_BROKEN_CTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_GETPAGESIZE -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_LIMITED_RUSAGE_T -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSCALAR_THREAD_KEY_T -#define ACE_HAS_POLL -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_PTHREADS -#define ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP -#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_C_FUNC -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SIZET_SOCKET_LEN -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_STRBUF_T -#define ACE_HAS_STRINGS -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_HAS_THREADS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_THR_C_DEST -#define ACE_HAS_THR_C_FUNC -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_UTIME -#define ACE_HAS_VOIDPTR_MMAP -#define ACE_HAS_VOIDPTR_SOCKOPT -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_INET_ATON -#define ACE_LACKS_MSGBUF_T -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_IOSTREAM_FX -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_PARAM_H -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SCHED_H -#define ACE_LACKS_SETSCHED -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_SYS_NERR -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_SYSCTL_H -#define ACE_LACKS_SYSTIME_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_LACKS_TCP_H -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR -#define ACE_LACKS_TIMESPEC_T - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -#define ACE_NEEDS_DEV_IO_CONVERSION - -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_LONG_DOUBLE 16 -#define ACE_HAS_EBCDIC - -#define ACE_TEMPLATES_REQUIRE_SOURCE - -#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) -#define IN_MULTICAST(a) IN_CLASSD(a) -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-netbsd.h b/dep/include/ace/config-netbsd.h deleted file mode 100644 index b05b26e3963..00000000000 --- a/dep/include/ace/config-netbsd.h +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-netbsd.h 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H - -#ifndef ACE_MT_SAFE -#define ACE_MT_SAFE 1 -#endif - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# define ACE_HAS_THREADS 1 -# define ACE_HAS_PTHREADS 1 -# define ACE_HAS_PTHREADS_UNIX98_EXT 1 -# define ACE_HAS_PTHREAD_RESUME_NP 1 -# define ACE_HAS_PTHREAD_SUSPEND_NP 1 -# define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 -# define ACE_LACKS_PTHREAD_YIELD 1 -#endif /* ACE_MT_SAFE */ - -#define ACE_HAS_CLOCK_SETTIME 1 -#define ACE_HAS_CLOCK_GETTIME 1 -#define ACE_HAS_SETTIMEOFDAY 1 -#define ACE_HAS_GETTIMEOFDAY 1 -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 -#define ACE_HAS_3_PARAM_WCSTOK 1 -#define ACE_HAS_3_PARAM_READDIR_R 1 -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG 1 -#define ACE_HAS_ALT_CUSERID 1 -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 -#define ACE_HAS_CLOCK_GETTIME 1 -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 -#define ACE_HAS_DIRENT 1 -#define ACE_HAS_EXCEPTIONS 1 -#define ACE_HAS_GETIFADDRS 1 -#define ACE_HAS_GETPAGESIZE 1 -#define ACE_HAS_GETPROGNAME 1 -#define ACE_HAS_GETRUSAGE 1 -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 -#define ACE_HAS_GNU_CSTRING_H 1 -#define ACE_HAS_GPERF 1 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1 -#define ACE_HAS_IP_MULTICAST 1 -#define ACE_HAS_MSG 1 -#define ACE_HAS_NEW_NO_H 1 -#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 -#define ACE_HAS_ONLY_SCHED_OTHER 1 -#define ACE_HAS_POLL 1 -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 -#define ACE_HAS_POSIX_NONBLOCK 1 -#define ACE_HAS_POSIX_TIME 1 -#define ACE_HAS_P_READ_WRITE 1 -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1 -#define ACE_HAS_REENTRANT_FUNCTIONS 1 -#define ACE_HAS_SCANDIR 1 -#define ACE_HAS_SETPROGNAME 1 -#define ACE_HAS_SIGACTION_CONSTP2 1 -#define ACE_HAS_SIGINFO_T 1 -#define ACE_HAS_SIGSUSPEND 1 -#define ACE_HAS_SIGTIMEDWAIT 1 -#define ACE_HAS_SIGWAIT 1 -#define ACE_HAS_SIG_ATOMIC_T 1 -#define ACE_HAS_SIG_C_FUNC 1 -#define ACE_HAS_SOCKADDR_IN_SIN_LEN 1 -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN 1 -#define ACE_HAS_SOCKADDR_MSG_NAME 1 -#define ACE_HAS_SOCKLEN_T 1 -#define ACE_HAS_SSIZE_T 1 -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#define ACE_HAS_STDEXCEPT_NO_H 1 -#define ACE_HAS_STRERROR 1 -#define ACE_HAS_STRINGS 1 -#define ACE_HAS_STRING_CLASS 1 -#define ACE_HAS_SVR4_DYNAMIC_LINKING 1 -#define ACE_HAS_SYSV_IPC 1 -#define ACE_HAS_SYS_ERRLIST 1 -#define ACE_HAS_SYS_FILIO_H 1 -#define ACE_HAS_SYS_SIGLIST 1 -#define ACE_HAS_SYS_SOCKIO_H 1 -#define ACE_HAS_SYS_SYSCALL_H 1 -#define ACE_HAS_SYSCTL -#define ACE_HAS_TERMIOS 1 -#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1 -#define ACE_HAS_TIMEZONE 1 -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY 1 -#define ACE_HAS_UALARM 1 -#define ACE_HAS_UCONTEXT_T 1 -#define ACE_HAS_VOIDPTR_MMAP 1 -#define ACE_HAS_VOIDPTR_SOCKOPT 1 -#define ACE_HAS_WCHAR 1 -#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1 -#define ACE_IOCTL_TYPE_ARG2 u_long -#define ACE_LACKS_CONDATTR_PSHARED 1 -#define ACE_LACKS_GETHOSTENT 1 -#define ACE_LACKS_GETIPNODEBYADDR 1 -#define ACE_LACKS_GETIPNODEBYNAME 1 -#define ACE_LACKS_IOSTREAM_FX 1 -#define ACE_LACKS_ITOW 1 -#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -#define ACE_LACKS_LOG2 1 -#define ACE_LACKS_MSG_ACCRIGHTS 1 -#define ACE_LACKS_MUTEXATTR_PSHARED 1 -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#define ACE_LACKS_PRI_T 1 -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 -#define ACE_LACKS_PTHREAD_YIELD 1 -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_RWLOCKATTR_PSHARED 1 -#define ACE_LACKS_RWLOCK_T 1 -#define ACE_LACKS_SETSCHED 1 -#define ACE_LACKS_SIGINFO_H 1 -#define ACE_LACKS_STROPTS_H 1 -#define ACE_LACKS_STRRECVFD 1 -#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1 -#define ACE_LACKS_TIMESPEC_T 1 -#define ACE_LACKS_UNBUFFERED_STREAMBUF 1 -#define ACE_LACKS_WCSDUP 1 -#define ACE_LACKS_WCSICMP 1 -#define ACE_LACKS_WCSNICMP 1 -#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR 1 - -#if defined(__x86_64__) -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 8 -#define ACE_SIZEOF_LONG_DOUBLE 16 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_VOID_P 8 -#define ACE_SIZEOF_WCHAR 4 - -typedef unsigned long ACE_UINT64; -typedef signed long ACE_INT64; - -#define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%ld") -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") - -#elif defined(__i386__) - -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 4 -#define ACE_SIZEOF_LONG_DOUBLE 12 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_VOID_P 4 -#define ACE_SIZEOF_WCHAR 4 - -typedef unsigned long long ACE_UINT64; -typedef signed long long ACE_INT64; - -#else -# error unknown CPU architecture -#endif - -#endif /* ACE_CONFIG_H */ - -// Local Variables: -// mode:C++ -// End: - diff --git a/dep/include/ace/config-openbsd.h b/dep/include/ace/config-openbsd.h deleted file mode 100644 index 10b4f268bcb..00000000000 --- a/dep/include/ace/config-openbsd.h +++ /dev/null @@ -1,235 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-openbsd.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for OpenBSD -// platforms using GNU g++. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if defined (ACE_HAS_THREADS) -#include /**/ -#endif /* ACE_HAS_THREADS */ - -#include "ace/config-posix.h" - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#define ACE_SIZEOF_LONG_DOUBLE 12 - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - -// Platform specific directives -// gcc defines __OpenBSD__ automatically for us. -#include - -#if defined (ACE_HAS_THREADS) -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ - -// Check if pthreads and native exceptions are being used together. -// This causes SEGVs to tbe thrown somewhat randomly for some -// reason. According to newsgroup postings, it appears to be an -// OpenBSD or gcc bug. -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -#error "OpenBSD pthreads and native exceptions currently do not work. See OpenBSD bug #1750" -#endif /* ACE_USES_NATIVE_EXCEPTIONS */ - -#endif /* ACE_HAS_THREADS */ - -#define ACE_HAS_GPERF - -// Platform specific directives -/* Are the following true? */ -#define ACE_LACKS_GETPGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID - -#define ACE_HAS_ALT_CUSERID -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS - -#define ACE_LACKS_RWLOCK_T -#define ACE_HAS_SIG_MACROS -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_DIRENT - -// OpenBSD 3.6 -#if (OpenBSD < 200411) -# define ACE_USES_ASM_SYMBOL_IN_DLSYM -#endif - -#define ACE_LACKS_UCONTEXT_H - -// ucontext_t is in OpenBSD 3.5 and later. -#if (OpenBSD >= 200405) -# define ACE_HAS_UCONTEXT_T -#endif /* OpenBSD >= 200405 */ - -// OpenBSD has sigwait defined -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGINFO_T - -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -#define ACE_HAS_SOCKLEN_T - -#define ACE_HAS_POLL - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -// NetBSD appears to have a sigset_t type. -// #define ACE_LACKS_SIGSET - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_WCHAR_H - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// OpenBSD supports the getifaddrs interface -#define ACE_HAS_GETIFADDRS - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform supports SVR4 dynamic linking semantics.. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Lacks perfect filtering, must bind group address. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -// Compiler/platform has -//#define ACE_HAS_ALLOCA_H - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -#define ACE_HAS_SYSCTL - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// OpenBSD's dlsym call segfaults when passed an invalid handle. -// It seems as if most other OSs detect this and just report an -// error. -#define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE - -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#ifdef ACE_HAS_THREADS -// Thread specific settings - -// And they're even POSIX pthreads -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif /* ! ACE_MT_SAFE */ -#endif /* ACE_HAS_THREADS */ - -#define ACE_HAS_SIGWAIT - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_DIRENT - -#if !defined (ACE_HAS_THREADS) -// OpenBSD really has readdir_r () in single threaded mode, -// but the #ifdefs in OS.i select one with the wrong parameter -// sets if the ACE_HAS_POSIX_STD isn't defined (which is defined -// when ACE_HAS_THREADS is defined.) - -#define ACE_LACKS_READDIR_R - -#endif /* ! ACE_HAD_THREADS */ - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// OpenBSD 3.2 lacks sched_setscheduler (see /usr/src/lib/libc_r/TODO) -#define ACE_LACKS_SETSCHED - -// OpenBSD supports IPv6 by default, but ACE IPv6 code -// has compile errors. -//#define ACE_HAS_IPV6 - -#define ACE_HAS_3_PARAM_READDIR_R - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-openvms.h b/dep/include/ace/config-openvms.h deleted file mode 100644 index 90541513f35..00000000000 --- a/dep/include/ace/config-openvms.h +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-openvms.h 81935 2008-06-12 22:01:53Z jtc $ - -// The following configuration file is designed to work for OpenVMS 7.3-2 - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H - -#if !defined (ACE_USE_RCSID) -# define ACE_USE_RCSID 0 -#endif - -#ifdef __cplusplus -#pragma message disable CODCAUUNR -#pragma message disable CODEUNREACHABLE -//#pragma message disable DOLLARID -//#pragma message disable NOSIMPINT -//#pragma message disable NOSTDLONGLONG -#pragma message disable NARROWPTR -//#pragma message disable LONGEXTERN -#pragma message disable UNSCOMZER -#endif - -// Use a signed int to match POSIX -#define __SIGNED_INT_TIME_T - -#define ACE_OPENVMS __VMS_VER - -#define ACE_DLL_SUFFIX ACE_TEXT("") - -#define ACE_HAS_DUMP 1 - -// need this includes to ensure proper sequence of definitions so that -// f.i. HP C/C++ does not '#define ' memcpy, memmove etc. -#include -#include -#include -#undef clearerr -#undef memset -#undef memcpy -#undef memmove - -#if defined(__ia64__) - // on OpenVMS IA64 we need this get the singleton exported since we build - // ACE/TAO with the NOTEMPLATES export option which prohibits exporting - // of any template symbols unless explicitly exported - #define ACE_HAS_CUSTOM_EXPORT_MACROS - #define ACE_Proper_Export_Flag - #define ACE_Proper_Import_Flag - #define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T - #define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#else - #define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION -#endif - -#define ACE_DEFAULT_BASE_ADDR ((char*)(0x30000000)) - -#define ACE_MAX_UDP_PACKET_SIZE 65535 - -#define ACE_HAS_STDCPP_STL_INCLUDES 1 - -/* missing system headers */ -#define ACE_LACKS_STDINT_H 1 -#define ACE_LACKS_SYS_IPC_H 1 -#define ACE_LACKS_SYS_SEM_H 1 -#define ACE_LACKS_SEMAPHORE_H 1 -#define ACE_LACKS_SYS_SELECT_H 1 -#define ACE_LACKS_TERMIOS_H 1 -#define ACE_LACKS_SYS_SHM_H 1 -#define ACE_LACKS_SYS_MSG_H 1 -#define ACE_LACKS_REGEX_H 1 -#define ACE_LACKS_SEARCH_H 1 -#define ACE_LACKS_SCHED_H 1 -#define ACE_LACKS_SYS_SYSCTL_H 1 -#define ACE_LACKS_MALLOC_H 1 -#define ACE_LACKS_SYS_PARAM_H 1 -#define ACE_LACKS_SIGINFO_H 1 -#define ACE_LACKS_UCONTEXT_H 1 - -/* missing rtl functions */ -#define ACE_LACKS_SETPGID 1 -#define ACE_LACKS_SETREUID 1 -#define ACE_LACKS_SETREGID 1 -#define ACE_LACKS_FORK 1 -#define ACE_LACKS_GETPGID 1 -#define ACE_LACKS_SETSID 1 -#define ACE_LACKS_FCNTL 1 -#define ACE_LACKS_SETEGID 1 -#define ACE_LACKS_SETEUID 1 - -#define ACE_LACKS_REALPATH 1 - -#define ACE_LACKS_SYMLINKS 1 - -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS 1 - -#define ACE_HAS_P_READ_WRITE -#define ACE_HAS_CHARPTR_DL 1 -#define ACE_HAS_CLOCK_GETTIME 1 -#define ACE_HAS_CLOCK_SETTIME 1 -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY 1 -#define ACE_HAS_DIRENT 1 -#define ACE_HAS_GETPAGESIZE 1 -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 -#define ACE_HAS_3_PARAM_WCSTOK 1 -#define ACE_HAS_SIGSUSPEND 1 -#define ACE_HAS_SIG_MACROS 1 -#define ACE_HAS_SIGWAIT 1 -#define ACE_HAS_SIGTIMEDWAIT 1 - -#define ACE_HAS_SIG_C_FUNC 1 -#define ACE_HAS_SIGISMEMBER_BUG -#define ACE_HAS_STRNLEN 1 -#define ACE_HAS_STREAMS 1 -#define ACE_HAS_STRERROR 1 -#define ACE_HAS_UALARM 1 -#define ACE_HAS_VOIDPTR_MMAP 1 -#define ACE_HAS_VOIDPTR_SOCKOPT 1 -#define ACE_LACKS_LSTAT 1 -#define ACE_LACKS_MADVISE 1 -#define ACE_LACKS_MKFIFO 1 -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_READLINK 1 -#define ACE_LACKS_RLIMIT 1 -#define ACE_LACKS_RLIMIT_PROTOTYPE 1 -#define ACE_LACKS_SETSCHED -#define ACE_LACKS_SYSCALL 1 -#define ACE_LACKS_WCSTOULL 1 - -/* (missing) standard data types */ -#define ACE_LACKS_CONST_TIMESPEC_PTR 1 -#define ACE_LACKS_SUSECONDS_T 1 -#define ACE_HAS_IDTYPE_T 1 -#define ACE_HAS_SIGINFO_T 1 -#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1 -#define ACE_HAS_SIZET_SOCKET_LEN 1 -#define ACE_HAS_SSIZE_T 1 -#define ACE_LACKS_PRI_T 1 -#define ACE_LACKS_SEMBUF_T 1 -#define ACE_LACKS_STRRECVFD 1 -#define ACE_LACKS_T_ERRNO 1 - -/* POSIX threads ompatibilities */ -#define ACE_LACKS_RWLOCK_T 1 -#define ACE_LACKS_PTHREAD_KILL 1 -#define ACE_LACKS_THREAD_PROCESS_SCOPING 1 - -#define ACE_HAS_PTHREADS 1 -#define ACE_HAS_PTHREAD_PROCESS_ENUM 1 -#define ACE_LACKS_UNNAMED_SEMAPHORE 1 -#define ACE_MT_SAFE 1 -#define ACE_HAS_THREADS 1 -#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1 -#define ACE_HAS_THR_C_DEST 1 -#define ACE_HAS_THR_C_FUNC 1 -#define ACE_LACKS_PTHREAD_SIGMASK 1 -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE (64U*1024) -#define ACE_HAS_PTHREAD_SETCONCURRENCY 1 -#define ACE_HAS_PTHREAD_GETCONCURRENCY 1 -#define ACE_HAS_PTHREAD_SCHEDPARAM 1 - -/* language/platform conformance */ -#define ACE_NEW_THROWS_EXCEPTIONS 1 -#define ACE_TEMPLATES_REQUIRE_SOURCE 1 -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 -#define ACE_LACKS_UNIX_SIGNALS 1 - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 -#define ACE_HAS_CPLUSPLUS_HEADERS 1 -#define ACE_HAS_EXCEPTIONS 1 -#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 - -#define ACE_HAS_GPERF 1 -#define ACE_HAS_IP_MULTICAST 1 -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#define ACE_HAS_POSIX_NONBLOCK 1 -#define ACE_HAS_POSIX_TIME 1 -#define ACE_HAS_BROKEN_POSIX_TIME 1 -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#define ACE_HAS_STRING_CLASS 1 -#define ACE_HAS_SVR4_DYNAMIC_LINKING 1 - -#define ACE_HAS_TEMPLATE_TYPEDEFS 1 -#define ACE_LACKS_NAMED_POSIX_SEM 1 -#define ACE_LACKS_SYSV_SHMEM 1 -#define ACE_LACKS_UNIX_DOMAIN_SOCKETS 1 -#define ACE_LACKS_UNIX_SYSLOG 1 -#define ACE_LACKS_ALPHASORT 1 - -#endif - diff --git a/dep/include/ace/config-pharlap.h b/dep/include/ace/config-pharlap.h deleted file mode 100644 index e0751c32f1c..00000000000 --- a/dep/include/ace/config-pharlap.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-pharlap.h 81837 2008-06-04 22:48:08Z shuston $ - -// This configuration file is for use with the PharLap Realtime ETS Kernel. -// It has been tested with PharLap TNT Embedded ToolSuite version 9.1. - -#ifndef ACE_CONFIG_PHARLAP_H -#define ACE_CONFIG_PHARLAP_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_PHARLAP -// Some features are only available with the Realtime edition of ETS. -// Assume that if using ACE, the realtime version is also being used, but -// allow it to be turned off as well. -#ifndef ACE_HAS_PHARLAP_RT -# define ACE_HAS_PHARLAP_RT -#else -# if (ACE_HAS_PHARLAP_RT == 0) -# undef ACE_HAS_PHARLAP_RT -# endif -#endif - -// Fortunately, PharLap ETS offers much of the Win32 API. But it's still on -// Winsock 1.1 -#define ACE_HAS_WINSOCK2 0 - -// The TSS implementation doesn't pass muster on the TSS_Test, but it works -// well with ACE's TSS emulation. -#define ACE_HAS_TSS_EMULATION - -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_TCP_NODELAY -#define ACE_LACKS_MSG_WFMO -#define ACE_LACKS_WIN32_MOVEFILEEX -#define ACE_LACKS_WIN32_REGISTRY -#define ACE_LACKS_WIN32_SECURITY_DESCRIPTORS -#define ACE_LACKS_WIN32_SERVICES -#define ACE_LACKS_WIN32_SETFILEPOINTEREX - -// There's no host table, by default. So using "localhost" won't work. -// If your system does have the ability to use "localhost" and you want to, -// define it before including this file. -#if !defined (ACE_LOCALHOST) -# define ACE_LOCALHOST "127.0.0.1" -#endif /* ACE_LOCALHOST */ - -// The normal Windows default stack size doesn't hold for ETS. Set what you -// want explicitly. -#if !defined (ACE_DEFAULT_THREAD_STACKSIZE) -# define ACE_DEFAULT_THREAD_STACKSIZE (1024*1024) -#endif /* ACE_DEFAULT_THREAD_STACKSIZE */ - -// Don't know how to get the page size at execution time. This is most likely -// the correct value. -#define ACE_PAGE_SIZE 4096 - -#if defined (ACE_HAS_PHARLAP_RT) -# define ACE_HAS_IP_MULTICAST - // ETS winsock doesn't define IP level socket options -//# define IP_TOS 8 -#endif /* ACE_HAS_PHARLAP_RT */ - -// Let the config-win32.h file do its thing -#undef ACE_CONFIG_H -#include "ace/config-win32.h" -// Now remove things that desktop/server Windows has but Pharlap ETS doesn't. -#undef ACE_HAS_INTERLOCKED_EXCHANGEADD -#undef ACE_HAS_WCHAR - -// PharLap's exports apparantly define LockFile, but it's documented as -// unsupported. LockFileEx is not present. -#define ACE_LACKS_FILELOCKS - -#include /**/ -#if defined (ACE_HAS_PHARLAP_RT) -# include /**/ -#define ACE_LACKS_IP_ADD_MEMBERSHIP -#endif /* ACE_HAS_PHARLAP_RT */ - -// Although IN_CLASSD is defined in both winsock.h and winsock2.h, it ends -// up undefined for Pharlap ETS builds. If this is the case, set things up -// so nothing looks like class D. -#if !defined (IN_CLASSD) -# define IN_CLASSD(i) (0) -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_PHARLAP_H */ - diff --git a/dep/include/ace/config-posix-nonetworking.h b/dep/include/ace/config-posix-nonetworking.h deleted file mode 100644 index 492692179d8..00000000000 --- a/dep/include/ace/config-posix-nonetworking.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- C -*- */ -// $Id: config-posix-nonetworking.h 80826 2008-03-04 14:51:23Z wotte $ - -/* The following configuration file is designed to work for RTEMS - platforms using GNU C. -*/ - -#ifndef ACE_CONFIG_POSIX_NONETWORKING_H -#define ACE_CONFIG_POSIX_NONETWORKING_H - -// Missing header files -# define ACE_LACKS_SYS_UIO_H -# define ACE_LACKS_SYS_SOCKET_H -# define ACE_LACKS_NETINET_IN_H -# define ACE_LACKS_NETDB_H -# define ACE_LACKS_ARPA_INET_H -# define ACE_LACKS_SYS_SELECT_H -# define ACE_LACKS_NET_IF_H -# define ACE_LACKS_SYSLOG_H -# define ACE_LACKS_SYS_UN_H -# define ACE_LACKS_MEMORY_H -# define ACE_LACKS_SYS_SYSCTL_H -# define ACE_LACKS_NETINET_TCP_H - -// Missing types -# define ACE_LACKS_IOVEC -# define ACE_LACKS_IN_ADDR -# define ACE_LACKS_SOCKADDR_IN -# define ACE_LACKS_SOCKADDR_UN -# define ACE_LACKS_HOSTENT -# define ACE_LACKS_SOCKADDR -# define ACE_LACKS_IP_MREQ -# define ACE_LACKS_PROTOENT -# define ACE_LACKS_SERVENT -# define ACE_LACKS_IFREQ -# define ACE_LACKS_IFCONF -# define ACE_LACKS_LINGER - -// Missing methods -# define ACE_LACKS_GETHOSTBYADDR -# define ACE_LACKS_GETHOSTBYNAME -# define ACE_LACKS_GETIPNODEBYADDR -# define ACE_LACKS_LISTEN -# define ACE_LACKS_BIND -# define ACE_LACKS_NTOHL -# define ACE_LACKS_HTONL -# define ACE_LACKS_HTONS -# define ACE_LACKS_NTOHS -# define ACE_LACKS_SELECT -# define ACE_LACKS_SOCKET -# define ACE_LACKS_SHUTDOWN -# define ACE_LACKS_SETSOCKOPT -# define ACE_LACKS_INET_ATON -# define ACE_LACKS_INET_ADDR -# define ACE_LACKS_INET_NTOA -# define ACE_LACKS_GET_BCAST_ADDR -# define ACE_LACKS_GETHOSTENT -# define ACE_LACKS_GETSERVBYNAME -# define ACE_LACKS_ACCEPT -# define ACE_LACKS_CONNECT -# define ACE_LACKS_GETPEERNAME -# define ACE_LACKS_GETSOCKNAME -# define ACE_LACKS_GETSOCKOPT -# define ACE_LACKS_RECV -# define ACE_LACKS_SEND -# define ACE_LACKS_SENDTO -# define ACE_LACKS_RECVFROM -# define ACE_LACKS_RECVMSG -# define ACE_LACKS_SENDMSG -# define ACE_LACKS_GETHOSTBYADDR_R -# define ACE_LACKS_GETPROTOBYNAME -# define ACE_LACKS_GETPROTOBYNUMBER -# define ACE_LACKS_GETSERVBYNAME -# define ACE_LACKS_READV -# define ACE_LACKS_WRITEV -# define ACE_LACKS_SOCKETPAIR -# undef ACE_HAS_MSG - -// Missing OS features -# define ACE_LACKS_UNIX_SYSLOG -# define ACE_LACKS_TCP_NODELAY - -// Missing ACE features -# define ACE_DISABLE_NOTIFY_PIPE_DEFAULT 1 - -#endif /* ACE_CONFIG_POSIX_NONETWORKING_H */ - diff --git a/dep/include/ace/config-posix.h b/dep/include/ace/config-posix.h deleted file mode 100644 index a9cb744435b..00000000000 --- a/dep/include/ace/config-posix.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-posix.h 82517 2008-08-05 19:36:26Z shuston $ - -#ifndef ACE_CONFIG_POSIX_H -#define ACE_CONFIG_POSIX_H - -#include - -/* The following POSIX constants are defined after is - * included. They are documented in: - * http://www.opengroup.org/onlinepubs/007904975/basedefs/unistd.h.html - */ -#if defined(_POSIX_REALTIME_SIGNALS) && (_POSIX_REALTIME_SIGNALS-0 != -1 ) -# if !defined(ACE_HAS_POSIX_REALTIME_SIGNALS) -# define ACE_HAS_POSIX_REALTIME_SIGNALS -# endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ -#endif /* _POSIX_REALTIME_SIGNALS */ - -#if defined(_POSIX_ASYNCHRONOUS_IO) && (_POSIX_ASYNCHRONOUS_IO-0 != -1 ) -# if !defined(ACE_HAS_AIO_CALLS) -# define ACE_HAS_AIO_CALLS -# endif /* ACE_HAS_AIO_CALLS */ -#endif /* _POSIX_ASYNCHRONOUS_IO */ - -#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) -# if defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES-0 != -1 ) -# if !defined(ACE_HAS_POSIX_SEM) -# define ACE_HAS_POSIX_SEM -# endif /* ACE_HAS_POSIX_SEM */ -# if defined(ACE_HAS_POSIX_SEM) -# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && \ - (defined (_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS-0 != -1)) -# define ACE_HAS_POSIX_SEM_TIMEOUT -# endif /* ACE_HAS_POSIX_SEM_TIMEOUT && _POSIX_TIMEOUTS */ -# endif /* ACE_HAS_POSIX_SEM */ -# endif /* ACE_HAS_POSIX_SEM */ -#endif /* !ACE_MT_SAFE */ - -#if defined(_POSIX_SHARED_MEMORY_OBJECTS) && (_POSIX_SHARED_MEMORY_OBJECTS-0 != -1 ) -# if !defined(ACE_HAS_SHM_OPEN) -# define ACE_HAS_SHM_OPEN -# endif /* ACE_HAS_SHM_OPEN */ -#endif /* _POSIX_SHARED_MEMORY_OBJECTS */ - -// Check if threading enabled/disable through platform_macros -#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) -// Allow the user to disable use of threads by setting ACE_HAS_THREADS to 0 -// before including this file. The platform config (not macros) file can -// often detect that the compiler was invoked with or without threads support -// and set this accordingly. -# if defined (ACE_HAS_THREADS) && (ACE_HAS_THREADS == 0) -# undef ACE_HAS_THREADS -# else -# if defined(_POSIX_THREADS) && (_POSIX_THREADS-0 != -1 ) -# if !defined(ACE_HAS_THREADS) -# define ACE_HAS_THREADS -# endif /* ACE_HAS_THREADS */ - -# if !defined(ACE_HAS_PTHREADS) -# define ACE_HAS_PTHREADS -# endif /* ACE_HAS_PTHREADS */ - -# endif /* _POSIX_THREADS */ -# endif /* ACE_HAS_THREADS */ -#endif /* !ACE_MT_SAFE */ - -#if defined(_POSIX_MESSAGE_PASSING) && (_POSIX_MESSAGE_PASSING-0 != -1 ) -# if !defined(ACE_HAS_POSIX_MESSAGE_PASSING) -# define ACE_HAS_POSIX_MESSAGE_PASSING -# endif /* ACE_HAS_POSIX_MESSAGE_PASSING */ -#endif /* _POSIX_MESSAGE_PASSING */ - -#endif /* ACE_CONFIG_POSIX_H */ - diff --git a/dep/include/ace/config-qnx-neutrino.h b/dep/include/ace/config-qnx-neutrino.h deleted file mode 100644 index ef37758352a..00000000000 --- a/dep/include/ace/config-qnx-neutrino.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- -// $Id: config-qnx-neutrino.h 80826 2008-03-04 14:51:23Z wotte $ -// The following configuration file is designed to work for Neutrino -// 2.0 (Beta) with GNU C++ and the POSIX (pthread) threads package. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#define _POSIX_C_SOURCE 199506 -#define _QNX_SOURCE - -// These constants are in i386-nto/include/limits.h, but egcs -// picks up its own limits.h instead: -#define _POSIX_NAME_MAX 14 /* Max bytes in a filename */ -#define _POSIX_PATH_MAX 256 /* Num. bytes in pathname (excl. NULL) */ - -#if defined(__OPTIMIZE__) -# if defined(__X86__) - // string.h can't be used by ACE with __OPTIMIZE__. -# undef __OPTIMIZE__ -# include -# define __OPTIMIZE__ -# endif /* __X86__ */ -#endif /* __OPTIMIZE__ */ - -#include "ace/config-g++-common.h" - -// The following defines the Neutrino compiler. -// gcc should know to call g++ as necessary -#ifdef __GNUC__ -# define ACE_CC_NAME ACE_TEXT ("gcc") -#else -# define ACE_CC_NAME ACE_TEXT ("NTO compiler ??") -#endif - -// /usr/nto/include/float.h defines -// FLT_MAX_EXP 127 -// DBL_MAX_EXP 1023 -// ace expects 128 & 1024 respectively -// to set the following macros in ace/Basic_Types.h -// These macros are: -// #define ACE_SIZEOF_DOUBLE 8 -// #define ACE_SIZEOF_FLOAT 4 - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_DIRENT -#define ACE_HAS_GETPAGESIZE -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_INLINED_OSCALLS -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_MSG -#define ACE_HAS_MT_SAFE_MKTIME -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_POSIX_SEM -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_PTHREADS -#define ACE_HAS_P_READ_WRITE -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SELECT_H -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGISMEMBER_BUG -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_STRINGS -#define ACE_HAS_SVR4_GETTIMEOFDAY -#define ACE_HAS_TERMIOS -#define ACE_HAS_THREADS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_THR_C_DEST -#define ACE_HAS_THR_C_FUNC -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_VOIDPTR_MMAP -#define ACE_HAS_VOIDPTR_SOCKOPT -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_CUSERID -#define ACE_LACKS_FORK -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_NAMED_POSIX_SEM -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_POLL_H -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SOCKET_BUFSIZ -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_STREAM_MODULES -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TCP_NODELAY -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_T_ERRNO -#define ACE_LACKS_UALARM_PROTOTYPE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_UNIX_DOMAIN_SOCKETS -#define ACE_LACKS_U_LONGLONG_T -#define ACE_MT_SAFE 1 -#define ACE_NEEDS_FUNC_DEFINITIONS -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#define ACE_TEMPLATES_REQUIRE_SOURCE -#define ACE_THR_PRI_FIFO_DEF 10 -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-qnx-rtp-62x.h b/dep/include/ace/config-qnx-rtp-62x.h deleted file mode 100644 index 5ad3326b412..00000000000 --- a/dep/include/ace/config-qnx-rtp-62x.h +++ /dev/null @@ -1,130 +0,0 @@ -// -*- C++ -*- -// $Id: config-qnx-rtp-62x.h 80826 2008-03-04 14:51:23Z wotte $ -// The following configuration file is designed to work for QNX RTP 621 -// GNU C++ and the POSIX (pthread) threads package. You can get QNX -// RTP at http://get.qnx.com -#ifndef ACE_CONFIG_QNX_RTP_62x_H -#define ACE_CONFIG_QNX_RTP_62x_H -#include /**/ "ace/pre.h" -#include /**/ "ace/config-qnx-rtp-common.h" - -///////////////////////////////////////////////////////////////// -// Definition of the features that are available. -// -// ACE_HAS Section -///////////////////////////////////////////////////////////////// -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_HAS_3_PARAM_READDIR_R -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_ALT_CUSERID -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_DIRENT -#define ACE_HAS_GETPAGESIZE -#define ACE_HAS_GETIFADDRS -// Enable gperf, this is a hosted configuration. -#define ACE_HAS_GPERF -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_MSG -#define ACE_HAS_MT_SAFE_MKTIME -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_POSIX_SEM -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_PTHREADS -#define ACE_HAS_P_READ_WRITE -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SELECT_H -#define ACE_HAS_SHM_OPEN -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGISMEMBER_BUG -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKLEN_T -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_STRINGS -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_SVR4_GETTIMEOFDAY -#define ACE_HAS_TERMIOS -#define ACE_HAS_THREADS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_THR_C_DEST -#define ACE_HAS_THR_C_FUNC -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_VOIDPTR_MMAP -#define ACE_HAS_VOIDPTR_SOCKOPT - -///////////////////////////////////////////////////////////////// -// Definition of the features that are not available. -// -// ACE_LACKS Section -///////////////////////////////////////////////////////////////// -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_MADVISE -// lacks mqueue mgr or speed-up named sem by shm emulation -#define ACE_LACKS_NAMED_POSIX_SEM -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -// Multicast_Tests reports for NTO 621 frames from unsubscribed groups -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#define ACE_LACKS_POLL_H -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SOCKET_BUFSIZ -#define ACE_LACKS_STREAM_MODULES -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_T_ERRNO -#define ACE_LACKS_U_LONGLONG_T -#define ACE_LACKS_ALPHASORT - -#define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE. - -#define ACE_MT_SAFE 1 -#define ACE_NEEDS_FUNC_DEFINITIONS -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 64000 -#define ACE_THR_PRI_FIFO_DEF 10 -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -#define ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK 1 - -#define ACE_SIZEOF_WCHAR 4 - -// No prototypes -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSDUP -// The default value of FD_SETSIZE is 32, but actually x86 NTO -// supports by default at least 1000 descriptors in fd_set. -#if defined( FD_SETSIZE ) -#undef FD_SETSIZE -#endif -#define FD_SETSIZE 1000 -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_QNX_RTP_62x_H*/ - diff --git a/dep/include/ace/config-qnx-rtp-common.h b/dep/include/ace/config-qnx-rtp-common.h deleted file mode 100644 index ee832adf604..00000000000 --- a/dep/include/ace/config-qnx-rtp-common.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- -// $Id: config-qnx-rtp-common.h 80826 2008-03-04 14:51:23Z wotte $ -// several macros common to various qnx neutrino version. - -#ifndef ACE_CONFIG_QNX_RTP_COMMON_H -#define ACE_CONFIG_QNX_RTP_COMMON_H -#include /**/ "ace/pre.h" - -#define _POSIX_C_SOURCE 199506 -#define _QNX_SOURCE - -// These constants are in i386-nto/include/limits.h, but egcs -// picks up its own limits.h instead: -#define _POSIX_NAME_MAX 14 /* Max bytes in a filename */ -#define _POSIX_PATH_MAX 256 /* Num. bytes in pathname (excl. NULL) */ - -#if defined(__OPTIMIZE__) -# if defined(__X86__) - // string.h can't be used by ACE with __OPTIMIZE__. -# undef __OPTIMIZE__ -# include -# define __OPTIMIZE__ -# endif /* __X86__ */ -#endif /* __OPTIMIZE__ */ - -#include "ace/config-g++-common.h" - -// The following defines the Neutrino compiler. -// gcc should know to call g++ as necessary -#ifdef __GNUC__ -# define ACE_CC_NAME ACE_TEXT ("gcc") -#else -# define ACE_CC_NAME ACE_TEXT ("QNX-RTP compiler ??") -#endif - -// /usr/nto/include/float.h defines -// FLT_MAX_EXP 127 -// DBL_MAX_EXP 1023 -// ace expects 128 & 1024 respectively -// to set the following macros in ace/Basic_Types.h -// These macros are: -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_FLOAT 4 - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_QNX_RTP_COMMON_H */ - diff --git a/dep/include/ace/config-qnx-rtp-pre62x.h b/dep/include/ace/config-qnx-rtp-pre62x.h deleted file mode 100644 index af55eeb6cae..00000000000 --- a/dep/include/ace/config-qnx-rtp-pre62x.h +++ /dev/null @@ -1,152 +0,0 @@ -// -*- C++ -*- -// $Id: config-qnx-rtp-pre62x.h 80826 2008-03-04 14:51:23Z wotte $ -// The following configuration file is designed to work for QNX RTP -// GNU C++ and the POSIX (pthread) threads package. You can get QNX -// RTP at http://get.qnx.com - -#ifndef ACE_CONFIG_RTP_PRE62x_H -#define ACE_CONFIG_RTP_PRE62x_H -#include /**/ "ace/pre.h" -#include /**/ "ace/config-qnx-rtp-common.h" - -///////////////////////////////////////////////////////////////// -// Definition of the features that are available. -// -// ACE_HAS Section -///////////////////////////////////////////////////////////////// - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA -#define ACE_HAS_ALLOCA_H -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_DIRENT -#define ACE_HAS_GETPAGESIZE -// Enable gperf, this is a hosted configuration. -#define ACE_HAS_GPERF -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -//#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_INLINED_OSCALLS -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_MSG -#define ACE_HAS_MT_SAFE_MKTIME -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_POSIX_SEM -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_PTHREADS -#define ACE_HAS_P_READ_WRITE -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SELECT_H -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGISMEMBER_BUG -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -// #define ACE_HAS_SIZET_SOCKET_LEN -#define ACE_HAS_SOCKLEN_T -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_STRINGS -#define ACE_HAS_SVR4_GETTIMEOFDAY -#define ACE_HAS_TERMIOS -#define ACE_HAS_THREADS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_THR_C_DEST -#define ACE_HAS_THR_C_FUNC -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_VOIDPTR_MMAP -#define ACE_HAS_VOIDPTR_SOCKOPT - -///////////////////////////////////////////////////////////////// -// Definition of the features that are not available. -// -// ACE_LACKS Section -///////////////////////////////////////////////////////////////// -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_LACKS_NAMED_POSIX_SEM -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SOCKET_BUFSIZ -#define ACE_LACKS_SOCKETPAIR -// Even if the QNX RTP docs says that socket pair are -// available, there is actually no implementation of -// soket-pairs. -#define ACE_LACKS_STREAM_MODULES -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_ALPHASORT -//#define ACE_LACKS_TCP_NODELAY // Based on the QNX RTP documentation, this option seems to - // to be supported. -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_T_ERRNO -#define ACE_LACKS_UALARM_PROTOTYPE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_UNIX_DOMAIN_SOCKETS -#define ACE_LACKS_U_LONGLONG_T - -#define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE. - -#define ACE_MT_SAFE 1 -#define ACE_NEEDS_FUNC_DEFINITIONS -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 64000 -#define ACE_TEMPLATES_REQUIRE_SOURCE -#define ACE_THR_PRI_FIFO_DEF 10 -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -#define ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK 1 - -#define ACE_SIZEOF_WCHAR 4 - -// Not really, but the prototype returns wchar_t instead of wchar_t * -#define ACE_LACKS_WCSSTR - -// No prototypes -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSDUP - -// And these have prototypes but no implementation -#define ACE_LACKS_WCSLEN -#define ACE_LACKS_WCSNCMP -#define ACE_LACKS_WCSCPY -#define ACE_LACKS_WCSNCPY -#define ACE_LACKS_TOWLOWER -#define ACE_LACKS_TOWUPPER -#define ACE_LACKS_WCSCMP -#define ACE_LACKS_WCSCAT -#define ACE_LACKS_WCSNCAT -#define ACE_LACKS_WCSSPN -#define ACE_LACKS_WCSCHR -#define ACE_LACKS_WCSPBRK -#define ACE_LACKS_WCSRCHR - -#define ACE_LACKS_ACE_IOSTREAM - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_RTP_PRE62x_H */ - diff --git a/dep/include/ace/config-qnx-rtp.h b/dep/include/ace/config-qnx-rtp.h deleted file mode 100644 index a176efd8f3e..00000000000 --- a/dep/include/ace/config-qnx-rtp.h +++ /dev/null @@ -1,26 +0,0 @@ -// -*- C++ -*- -// $Id: config-qnx-rtp.h 80826 2008-03-04 14:51:23Z wotte $ -// The following configuration file is designed to work for QNX RTP -// GNU C++ and the POSIX (pthread) threads package. You can get QNX -// RTP at http://get.qnx.com. -// This header is intended to switch between configuration for -// various NTO versions. -#ifndef ACE_CONFIG_QNX_RTP_H -#define ACE_CONFIG_QNX_RTP_H -#include /**/ "ace/pre.h" - -#include -#if !defined(_NTO_VERSION) -# error "Could not detect QNX version from macro _NTO_VERSION" -#else -# define ACE_NTO_VERS _NTO_VERSION -# if ACE_NTO_VERS < 620 -# include /**/ "ace/config-qnx-rtp-pre62x.h" -# else -# include /**/ "ace/config-qnx-rtp-62x.h" -# endif -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_QNX_RTP_H */ - diff --git a/dep/include/ace/config-rtems.h b/dep/include/ace/config-rtems.h deleted file mode 100644 index 558a6e1007c..00000000000 --- a/dep/include/ace/config-rtems.h +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- C -*- */ -// $Id: config-rtems.h 80826 2008-03-04 14:51:23Z wotte $ - -/* The following configuration file is designed to work for RTEMS - platforms using GNU C. -*/ - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Needed to make some prototypes visible. -// #if ! defined (_GNU_SOURCE) -// #define _GNU_SOURCE -// #endif /* ! _GNU_SOURCE */ - -// First the machine specific part -// There are no known port specific issues with the RTEMS port of ACE. -// XXX Pentium and PowerPC have high res timer support in ACE. - -// Then the compiler specific parts -#if defined (__GNUG__) - // config-g-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS -# include "ace/config-g++-common.h" -#else /* ! __GNUG__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-rtems.h -# endif /* __cplusplus */ -#endif /* ! __GNUG__ */ - -#include "ace/config-posix.h" - -// Completely common part :-) - -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_REGEX_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_POLL_H -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_STRDUP -#define ACE_LACKS_STRTOK_R -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#define ACE_LACKS_REALPATH -#define ACE_LACKS_TEMPNAM - -// Temporarily, enabling this results in compile errors with -// rtems 4.6.6. -#define ACE_LACKS_WCHAR_H - -#if !defined (ACE_MT_SAFE) -#define ACE_MT_SAFE 1 -#endif - -#if ACE_MT_SAFE -# define ACE_HAS_THREADS -# define ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_PTHREAD_SCHEDPARAM -# define ACE_LACKS_THREAD_PROCESS_SCOPING -#else -# define ACE_HAS_POSIX_GETPWNAM_R -# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#endif - -#define ACE_HAS_ALT_CUSERID -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_3_PARAM_READDIR_R -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_DIRENT -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_MSG -#define ACE_HAS_MT_SAFE_MKTIME -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_GETPAGESIZE -#define ACE_HAS_POSIX_SEM -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY -#define ACE_HAS_SYS_ERRLIST -#define ACE_HAS_SYS_FILIO_H -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_LACKS_EXEC -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETPGID -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_READV -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RLIMIT_PROTOTYPE -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETREUID_PROTOTYPE -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREGID_PROTOTYPE -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_UCONTEXT_H -#define ACE_HAS_NONCONST_WRITEV -#define ACE_LACKS_WRITEV -#define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#define ACE_NEEDS_SCHED_H -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_TERMIOS - -// rtems 4.7 or higher -#if (__RTEMS_MAJOR__ > 4) || (__RTEMS_MAJOR__ == 4 && __RTEMS_MINOR__ > 6) -# define ACE_HAS_UALARM -#else -# define ACE_HAS_NOTSUP_SC_PAGESIZE -# define ACE_LACKS_SUSECONDS_T -# define ACE_LACKS_INTPTR_T -# undef ACE_HAS_SHM_OPEN -# undef ACE_HAS_AIO_CALLS -#endif - -// __RTEMS_REVISION__ could also be used but this is broken according -// to the rtems people - -#if !defined (_POSIX_REALTIME_SIGNALS) -# define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#endif - -#if defined (ACE_LACKS_NETWORKING) -# include "ace/config-posix-nonetworking.h" -#endif - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sco-5.0.0-nothread.h b/dep/include/ace/config-sco-5.0.0-nothread.h deleted file mode 100644 index 7d5c4f4ebef..00000000000 --- a/dep/include/ace/config-sco-5.0.0-nothread.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sco-5.0.0-nothread.h 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#include "ace/config-g++-common.h" -#include "ace/config-sco-5.0.0.h" - -#define ACE_HAS_GNU_CSTRING_H - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sco-5.0.0.h b/dep/include/ace/config-sco-5.0.0.h deleted file mode 100644 index 35c33a43fad..00000000000 --- a/dep/include/ace/config-sco-5.0.0.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sco-5.0.0.h 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CONFIG_SCO_5_0_0_H -#define ACE_CONFIG_SCO_5_0_0_H -#include /**/ "ace/pre.h" - -// Compiling for SCO. -#if !defined (SCO) -#define SCO -#endif /* SCO */ - -#if defined (SCO) && !defined (MAXPATHLEN) -#define MAXPATHLEN 1023 -#endif /* SCO */ - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_SIG_MACROS -#define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_STRRECVFD -#define ACE_NEEDS_FTRUNCATE -#define ACE_LACKS_MADVISE -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS - -#define ACE_DEFAULT_CLOSE_ALL_HANDLES 0 - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_NONCONST_MSGSND -#define ACE_HAS_BIG_FD_SET -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Compiler/platform contains the file. -//#define ACE_HAS_SYS_SYSCALL_H - -// Fixes a problem with HP/UX not wrapping the mmap(2) header files -// with extern "C". -//#define ACE_HAS_BROKEN_MMAP_H - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Header files lack t_errno for ACE_TLI. -//#define ACE_LACKS_T_ERRNO - -// Compiler/platform supports poll(). -// #define ACE_HAS_POLL - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler supports the ssize_t typedef. -//#define ACE_HAS_SSIZE_T - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Note, this only works if the flag is set above! -//#define ACE_HAS_GETRUSAGE - -// Platform uses int for select() rather than fd_set. -#define ACE_HAS_SELECT_H - -// Platform has prototypes for ACE_TLI. -#define ACE_HAS_TLI_PROTOTYPES -// Platform has the XLI version of ACE_TLI. -// #define ACE_HAS_XLI - -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -#define ACE_LACKS_STRCASECMP - -// #define ACE_HAS_POSIX_TIME -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_DIRENT -#define ACE_LACKS_READDIR_R -#define ACE_HAS_GPERF - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_SCO_5_0_0_H */ - diff --git a/dep/include/ace/config-suncc-common.h b/dep/include/ace/config-suncc-common.h deleted file mode 100644 index 31d424d76b5..00000000000 --- a/dep/include/ace/config-suncc-common.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-suncc-common.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_SUNCC_COMMON_H -#define ACE_SUNCC_COMMON_H -#include /**/ "ace/pre.h" - -# define ACE_HAS_CPLUSPLUS_HEADERS -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_STRING_CLASS -# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS -# define ACE_HAS_THR_C_DEST 1 -# define ACE_LACKS_SWAB -#if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0 -# undef ACE_HAS_CUSTOM_EXPORT_MACROS -#else -# ifndef ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */ -# define ACE_Proper_Export_Flag __attribute__ ((visibility("default"))) -# define ACE_Proper_Import_Flag -# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class ACE_Proper_Export_Flag T -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class ACE_Proper_Export_Flag SINGLETON_TYPE ; -# define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE; -#endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */ - -// __EXCEPTIONS is defined with -fexceptions, the egcs default. It -// is not defined with -fno-exceptions, the ACE default for g++. -// ACE_HAS_EXCEPTIONS is defined in -// include/makeinclude/wrapper_macros.GNU, so this really isn't -// necessary. Just in case . . . -# if defined (__EXCEPTIONS) && !defined (ACE_HAS_EXCEPTIONS) -# define ACE_HAS_EXCEPTIONS -# endif /* __EXCEPTIONS && ! ACE_HAS_EXCEPTIONS */ - -# if defined (ACE_HAS_EXCEPTIONS) -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ - -#if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) -# define ACE_SIZEOF_LONG_DOUBLE 12 -#endif /* i386 */ - -#if defined (i386) || defined (__i386__) - // If running an Intel, assume that it's a Pentium so that - // ACE_OS::gethrtime () can use the RDTSC instruction. If running a - // 486 or lower, be sure to comment this out. (If not running an - // Intel CPU, this #define will not be seen because of the i386 - // protection, so it can be ignored.) -# define ACE_HAS_PENTIUM -#endif /* i386 */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -#define ACE_TEMPLATES_REQUIRE_SOURCE - -#include /**/ "ace/post.h" -#endif /* ACE_SUNCC_COMMON_H */ - diff --git a/dep/include/ace/config-sunos5.10.h b/dep/include/ace/config-sunos5.10.h deleted file mode 100644 index 7ba78c2b3bd..00000000000 --- a/dep/include/ace/config-sunos5.10.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.10.h 81805 2008-05-30 10:14:59Z vzykov $ - -// The following configuration file is designed to work for SunOS 5.10 -// (Solaris 10) platforms using the SunC++ 5.x (Sun Studio 8-10), or g++ -// compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.9 config, then add any SunOS 5.10 updates below. -#include "ace/config-sunos5.9.h" - -// Solaris 10 can do sem_timedwait() (see ACE_OS::sema_wait). -#define ACE_HAS_POSIX_SEM_TIMEOUT - -#define ACE_HAS_SCANDIR - -// Solaris 10 offers a useable alphasort() unlike previous Solaris versions. -#if defined (ACE_LACKS_ALPHASORT) -# undef ACE_LACKS_ALPHASORT -#endif - -// Solaris 10 offers a useable log2() unlike previous Solaris versions. -#if defined (ACE_LACKS_LOG2) -# undef ACE_LACKS_LOG2 -#endif - -// Solaris 10 delivers pthread_attr_setstack -#if defined (ACE_LACKS_PTHREAD_ATTR_SETSTACK) -# undef ACE_LACKS_PTHREAD_ATTR_SETSTACK -#endif - -// Solaris 10 introduced printf() modifiers for [s]size_t types. -#if defined (ACE_SSIZE_T_FORMAT_SPECIFIER) -# undef ACE_SSIZE_T_FORMAT_SPECIFIER -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%zd") -#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER */ - -#if defined (ACE_SIZE_T_FORMAT_SPECIFIER) -# undef ACE_SIZE_T_FORMAT_SPECIFIER -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%zu") -#endif /* ACE_SIZE_T_FORMAT_SPECIFIER */ - -// Solaris 10 offers wcstoull() -#if defined (ACE_LACKS_WCSTOULL) -# undef ACE_LACKS_WCSTOULL -#endif /* ACE_LACKS_WCSTOULL */ - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.11.h b/dep/include/ace/config-sunos5.11.h deleted file mode 100644 index 3f78c9f94e6..00000000000 --- a/dep/include/ace/config-sunos5.11.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.11.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for SunOS 5.11 -// (Solaris 11) platforms using the SunC++ 5.x (Sun Studio 10-12), or g++ -// compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.10 config, then add any SunOS 5.11 updates below. -#include "ace/config-sunos5.10.h" - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.4-g++.h b/dep/include/ace/config-sunos5.4-g++.h deleted file mode 100644 index 9622a068232..00000000000 --- a/dep/include/ace/config-sunos5.4-g++.h +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.4-g++.h 81697 2008-05-14 18:33:11Z johnnyw $ - -// The following configuration file is designed to work for SunOS 5.4 -// platforms using the GNU g++ compiler. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -#define ACE_HAS_STRING_CLASS - -#include "ace/config-g++-common.h" -#define ACE_HAS_GNU_CSTRING_H - -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform supports pread() and pwrite() -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Sun has the wrong prototype for sendmsg. -#define ACE_HAS_NONCONST_SENDMSG - -// The SunOS 5.x version of rand_r is inconsistent with the header files... -#define ACE_HAS_BROKEN_RANDR - -// Platform supports system configuration information. -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -// Platform supports the POSIX regular expression library -#define ACE_HAS_REGEX - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform supports SunOS high resolution timers. -#define ACE_HAS_HI_RES_TIMER - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Platform supports the prusage_t struct. -#define ACE_HAS_PRUSAGE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Platform supports STREAM pipes. -#define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform supports SVR4 gettimeofday() prototype. -#define ACE_HAS_SVR4_GETTIMEOFDAY - -// Platform lacks pthread_sigaction -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK - -// Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST - -/* Turn off the following defines if you want to disable threading. */ -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -# if !defined (_REENTRANT) -# define _REENTRANT -# endif /* _REENTRANT */ -#endif /* !ACE_MT_SAFE */ - -// Platform supports Solaris threads. -#define ACE_HAS_STHREADS - -// Platform supports threads. -#define ACE_HAS_THREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform supports reentrant functions (i.e., all the POSIX *_r functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -/* end threading defines */ - -#define ACE_HAS_PRIOCNTL -#define ACE_NEEDS_LWP_PRIO_SET - -// Platform supports TLI timod STREAMS module. -#define ACE_HAS_TIMOD_H - -// Platform supports TLI tiuser header. -#define ACE_HAS_TIUSER_H - -// Platform provides TLI function prototypes. -#define ACE_HAS_TLI_PROTOTYPES - -// Platform supports TLI. -#define ACE_HAS_TLI - -// Use the poll() event demultiplexor rather than select(). -//#define ACE_USE_POLL - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 -#define ACE_HAS_IDTYPE_T -#define ACE_HAS_GPERF -#define ACE_HAS_DIRENT - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.4-sunc++-4.x.h b/dep/include/ace/config-sunos5.4-sunc++-4.x.h deleted file mode 100644 index 8714b8d72fc..00000000000 --- a/dep/include/ace/config-sunos5.4-sunc++-4.x.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.4-sunc++-4.x.h 81935 2008-06-12 22:01:53Z jtc $ - -// The following configuration file is designed to work for SunOS 5.4 -// platforms using the SunC++ 4.0.x compiler. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform supports pread() and pwrite() -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Sun has the wrong prototype for sendmsg. -#define ACE_HAS_NONCONST_SENDMSG - -// The SunOS 5.x version of rand_r is inconsistent with the header files... -#define ACE_HAS_BROKEN_RANDR - -// Platform supports system configuration information. -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -// Platform supports the POSIX regular expression library. -#define ACE_HAS_REGEX - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform supports SunOS high resolution timers. -#define ACE_HAS_HI_RES_TIMER - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Platform supports the prusage_t struct. -#define ACE_HAS_PRUSAGE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Platform supports STREAM pipes. -#define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform supports SVR4 gettimeofday() prototype. -#define ACE_HAS_SVR4_GETTIMEOFDAY - -// Compiler/platform supports SVR4 signal typedef. -#define ACE_HAS_SVR4_SIGNAL_T - -// Platform lacks pthread_sigaction -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK - -// Compiler/platform supports SVR4 ACE_TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST - -/* Turn off the following defines if you want to disable threading. */ -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Platform supports Solaris threads. -#define ACE_HAS_STHREADS - -// Platform supports threads. -#define ACE_HAS_THREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform supports reentrant functions (i.e., all the POSIX *_r functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -/* end threading defines */ - -#define ACE_HAS_PRIOCNTL -#define ACE_NEEDS_LWP_PRIO_SET - -// Reactor detects deadlock -// #define ACE_REACTOR_HAS_DEADLOCK_DETECTION - -// Platform supports ACE_TLI timod STREAMS module. -#define ACE_HAS_TIMOD_H - -// Platform supports ACE_TLI tiuser header. -#define ACE_HAS_TIUSER_H - -// Platform provides ACE_TLI function prototypes. -#define ACE_HAS_TLI_PROTOTYPES - -// Platform supports ACE_TLI. -#define ACE_HAS_TLI - -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_SIGNED_CHAR - -// Use the poll() event demultiplexor rather than select(). -//#define ACE_USE_POLL - -#define ACE_NEEDS_DEV_IO_CONVERSION - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 -#define ACE_HAS_IDTYPE_T - -#define ACE_HAS_GPERF -#define ACE_HAS_DIRENT - -# if defined (ACE_HAS_EXCEPTIONS) - // If exceptions are enabled and we are using Sun/CC then - // throws an exception instead of returning 0. -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.5.h b/dep/include/ace/config-sunos5.5.h deleted file mode 100644 index d1148c6b0c3..00000000000 --- a/dep/include/ace/config-sunos5.5.h +++ /dev/null @@ -1,417 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.5.h 81971 2008-06-16 12:15:00Z parsons $ - -// This configuration file is designed to work for SunOS 5.5 platforms -// using the following compilers: -// * Sun C++ 4.2 and later (including 5.x), patched as noted below -// * g++ 2.7.2 and later, including egcs -// * Green Hills 1.8.8 and later - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#define ACE_LACKS_STDINT_H - -// alphasort() is present on earlier Solaris versions but is marked as not for -// use on non-BSD systems and not supported for use in applications that use -// system libraries or with multiple threads. So it's mostly useless. -#define ACE_LACKS_ALPHASORT - -// Solaris doesn't support log2() -#define ACE_LACKS_LOG2 - -// SunOS 5.5 does not provide getloadavg() -#define ACE_LACKS_GETLOADAVG - -// Before we do anything, we should include to -// ensure that things are set up properly. -#include - -// Sun has the posix defines so let this file sort out what Sun delivers -#include "ace/config-posix.h" - -// Compiler version-specific settings: -#if defined (__SUNPRO_CC) -# if (__SUNPRO_CC < 0x410) - // The following might not be necessary, but I can't tell: my build - // with Sun C++ 4.0.1 never completes. -# define ACE_NEEDS_DEV_IO_CONVERSION -# elif (__SUNPRO_CC >= 0x420) -# if (__SUNPRO_CC >= 0x500) - // string.h and memory.h conflict for memchr definitions -# define ACE_LACKS_MEMORY_H - // If -compat=4 is turned on, the old 4.2 settings for iostreams are used, - // but the newer, explicit instantiation is used (above) -# if (__SUNPRO_CC_COMPAT >= 5) -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_THR_C_DEST -# endif /* __SUNPRO_CC_COMPAT >= 5 */ -# if defined (ACE_HAS_EXCEPTIONS) -# define ACE_HAS_NEW_NOTHROW -# else - // See /opt/SUNWspro_5.0/SC5.0/include/CC/stdcomp.h: -# define _RWSTD_NO_EXCEPTIONS 1 -# endif /* ! ACE_HAS_EXCEPTIONS */ -# elif (__SUNPRO_CC == 0x420) || (__SUNPRO_CC == 0x410) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -# endif /* __SUNPRO_CC >= 0x500 */ -# endif /* __SUNPRO_CC >= 0x420 */ - -# define ACE_CAST_CONST const -# define ACE_HAS_HI_RES_TIMER -# define ACE_HAS_SIG_C_FUNC /* Sun CC 5.0 needs this, 4.2 doesn't mind. */ -# define ACE_HAS_XPG4_MULTIBYTE_CHAR -# define ACE_LACKS_LINEBUFFERED_STREAMBUF -# define ACE_LACKS_SIGNED_CHAR - - // ACE_HAS_EXCEPTIONS precludes -noex in - // include/makeinclude/platform_macros.GNU. But beware, we have - // seen problems with exception handling on multiprocessor - // UltraSparcs: threaded executables core dump when threads exit. - // This problem does not seem to appear on single-processor UltraSparcs. - // And, it is solved with the application of patch - // 104631-02 "C++ 4.2: Jumbo Patch for C++ 4.2 on Solaris SPARC" - // to Sun C++ 4.2. - // To provide optimum performance, ACE_HAS_EXCEPTIONS is disabled by - // default. It can be enabled by adding "exceptions=1" to the "make" - // invocation. See include/makeinclude/platform_sunos5_sunc++.GNU - // for details. - -# if defined (ACE_HAS_EXCEPTIONS) - // If exceptions are enabled and we are using Sun/CC then - // throws an exception instead of returning 0. -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ - - /* If you want to disable threading with Sun CC, remove -mt - from your CFLAGS, e.g., using make threads=0. */ - -// Take advantage of Sun Studio 8 (Sun C++ 5.5) or better symbol -// visibility to generate improved shared library binaries. -# if (__SUNPRO_CC > 0x540) - -# if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0 -# undef ACE_HAS_CUSTOM_EXPORT_MACROS -# else -# ifndef ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */ -# define ACE_Proper_Export_Flag __symbolic -# define ACE_Proper_Import_Flag __global - -# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class ACE_Proper_Export_Flag T -# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class ACE_Proper_Export_Flag SINGLETON_TYPE ; - -// # define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T -// # define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE; - -# endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */ -# endif /* __SUNPRO_CC > 0x540 (> Sun C++ 5.4) */ - -#elif defined (__GNUG__) - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS -# include "ace/config-g++-common.h" -# define ACE_HAS_HI_RES_TIMER - // Denotes that GNU has cstring.h as standard, to redefine memchr(). -# define ACE_HAS_GNU_CSTRING_H -# define ACE_HAS_XPG4_MULTIBYTE_CHAR - -# if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0 - // ACE_MT_SAFE is #defined below, for all compilers. -# if !defined (_REENTRANT) - /* If you want to disable threading, comment out the following - line. Or, add -DACE_MT_SAFE=0 to your CFLAGS, e.g., using - make threads=0. */ -# define _REENTRANT -# endif /* _REENTRANT */ -# endif /* !ACE_MT_SAFE */ - -#elif defined (ghs) - -# if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0 - // ACE_MT_SAFE is #defined below, for all compilers. -# if !defined (_REENTRANT) - /* If you want to disable threading, comment out the following - line. Or, add -DACE_MT_SAFE=0 to your CFLAGS, e.g., using - make threads=0. */ -# define _REENTRANT -# endif /* _REENTRANT */ -# endif /* !ACE_MT_SAFE */ - -# define ACE_CONFIG_INCLUDE_GHS_COMMON -# include "ace/config-ghs-common.h" - - // To avoid warning about inconsistent declaration between Sun's - // stdlib.h and Green Hills' ctype.h. -# include - - // IOStream_Test never halts with Green Hills 1.8.9. -# define ACE_LACKS_ACE_IOSTREAM - -#else /* ! __SUNPRO_CC && ! __GNUG__ && ! ghs */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler in ace/config-sunos5.5.h -# endif /* __cplusplus */ -#endif /* ! __SUNPRO_CC && ! __GNUG__ && ! ghs */ - -#if !defined (__ACE_INLINE__) -// @note If you have link problems with undefined inline template -// functions with Sun C++, be sure that the #define of __ACE_INLINE__ -// below is not commented out. -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Platform supports the POSIX regular expression library. -// @note Please comment out the ACE_HAS_REGEX #define if you -// have link problems with g++ or egcs on SunOS 5.5. -#define ACE_HAS_REGEX - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// select()'s timeval arg is not declared as const and may be modified -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -// Platform supports pread() and pwrite() -#define ACE_HAS_P_READ_WRITE -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_UALARM -#define ACE_LACKS_UALARM_PROTOTYPE - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Platform supports system configuration information. -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// This setting was determined by running the autoconf tests. If it doesn't -// work uniformly, will need some tweaking, possibly based on other -// XPG feature-test macros. -#define ACE_HAS_CONST_CHAR_SWAB - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -// ACE_HAS_CLOCK_GETTIME requires linking with -lposix4. -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Platform supports the prusage_t struct. -#define ACE_HAS_PRUSAGE_T -#define ACE_HAS_GETRUSAGE - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Platform supports STREAM pipes. -#define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform supports SVR4 gettimeofday() prototype. -#define ACE_HAS_SVR4_GETTIMEOFDAY - -// Compiler/platform supports SVR4 ACE_TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST - -// SunOS 5.5.x does not support mkstemp -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_SYS_SYSCTL_H - -#if !(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4)) -# define ACE_HAS_CHARPTR_SHMDT -#endif - -// Platform has posix getpwnam_r -#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE - 0 >= 199506L) || \ - defined(_POSIX_PTHREAD_SEMANTICS) -# define ACE_HAS_POSIX_GETPWNAM_R -#endif /* _POSIX_C_SOURCE || _POSIX_PTHREAD_SEMANTICS */ - -#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 1) -#if defined (_REENTRANT) || \ - (defined (_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) || \ - defined (_POSIX_PTHREAD_SEMANTICS) - // Compile using multi-thread libraries. -# define ACE_HAS_THREADS - -# if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -# endif /* ACE_MT_SAFE */ - - // Platform supports POSIX pthreads *and* Solaris threads, by - // default! If you only want to use POSIX pthreads, add - // -D_POSIX_PTHREAD_SEMANTICS to your CFLAGS. Or, #define it right - // here. See the Intro (3) man page for information on - // -D_POSIX_PTHREAD_SEMANTICS. -# if defined (_POSIX_PTHREAD_SEMANTICS) -# define ACE_LACKS_RWLOCK_T -# else -# define ACE_HAS_STHREADS -# endif /* ! _POSIX_PTHREAD_SEMANTICS */ - -# define ACE_HAS_PTHREADS - // . . . but only supports SCHED_OTHER scheduling policy -# define ACE_HAS_ONLY_SCHED_OTHER -# define ACE_HAS_SIGWAIT -# define ACE_HAS_SIGTIMEDWAIT -# define ACE_HAS_SIGSUSPEND -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK - - // Compiler/platform has thread-specific storage -# define ACE_HAS_THREAD_SPECIFIC_STORAGE - - // Platform supports reentrant functions (i.e., all the POSIX *_r functions). -# define ACE_HAS_REENTRANT_FUNCTIONS - -# define ACE_NEEDS_LWP_PRIO_SET -# define ACE_HAS_THR_YIELD -# define ACE_LACKS_PTHREAD_YIELD -#endif /* _REENTRANT || _POSIX_C_SOURCE >= 199506L || \ - _POSIX_PTHREAD_SEMANTICS */ -#endif /* !ACE_MT_SAFE || ACE_MT_SAFE == 1 */ - -#define ACE_HAS_PRIOCNTL - -// Platform supports ACE_TLI timod STREAMS module. -#define ACE_HAS_TIMOD_H - -// Platform supports ACE_TLI tiuser header. -#define ACE_HAS_TIUSER_H - -// Platform provides ACE_TLI function prototypes. -#define ACE_HAS_TLI_PROTOTYPES - -// Platform has broken t_error() prototype. -#define ACE_HAS_BROKEN_T_ERROR - -// Platform supports ACE_TLI. -#define ACE_HAS_TLI - -#define ACE_HAS_GETPAGESIZE 1 - -#define ACE_HAS_STL_MAP_CONFLICT - -#define ACE_HAS_IDTYPE_T - -#define ACE_HAS_GPERF -#define ACE_HAS_DIRENT - -#if defined (__SUNPRO_CC) -# define ACE_CC_NAME ACE_TEXT ("SunPro C++") -# define ACE_CC_MAJOR_VERSION (__SUNPRO_CC >> 8) -# define ACE_CC_MINOR_VERSION (__SUNPRO_CC & 0x00ff) -# define ACE_CC_BETA_VERSION (0) -#elif defined (__GNUG__) -# define ACE_CC_MAJOR_VERSION __GNUC__ -# define ACE_CC_MINOR_VERSION __GNUC_MINOR__ -# define ACE_CC_BETA_VERSION (0) -# if __GNUC_MINOR__ >= 90 -# define ACE_CC_NAME ACE_TEXT ("egcs") -# else -# define ACE_CC_NAME ACE_TEXT ("g++") -# endif /* __GNUC_MINOR__ */ -#endif /* __GNUG__ */ - -#if defined (i386) && (_FILE_OFFSET_BITS==32) -# define ACE_HAS_X86_STAT_MACROS -#endif /* i386 && _FILE_OFFSET_BITS==32 */ - -#define ACE_MALLOC_ALIGN ((size_t)8) -#define ACE_LACKS_SETREUID_PROTOTYPE -#define ACE_LACKS_SETREGID_PROTOTYPE - -// Solaris does indeed implement the inet_aton() function, but it is -// found in `libresolv.*'. It doesn't seem worth it to link another -// library just for that function. Just use the emulation in ACE that -// has been used for years. -#define ACE_LACKS_INET_ATON - -// Solaris doesn't have wcstoull -#define ACE_LACKS_WCSTOULL - -#if defined (_LARGEFILE_SOURCE) || (_FILE_OFFSET_BITS==64) -#undef ACE_HAS_PROC_FS -#undef ACE_HAS_PRUSAGE_T -#endif /* (_LARGEFILE_SOURCE) || (_FILE_OFFSET_BITS==64) */ - -#if defined (_POSIX_PTHREAD_SEMANTICS) || (_FILE_OFFSET_BITS == 64) || (_POSIX_C_SOURCE - 0 >= 199506L) -# define ACE_HAS_3_PARAM_READDIR_R -#endif - -// Sum of the iov_len values can't be larger then SSIZE_MAX -#define ACE_HAS_SOCK_BUF_SIZE_MAX - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.6.h b/dep/include/ace/config-sunos5.6.h deleted file mode 100644 index 01855ba37c8..00000000000 --- a/dep/include/ace/config-sunos5.6.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.6.h 81935 2008-06-12 22:01:53Z jtc $ - -// The following configuration file is designed to work for SunOS 5.6 -// platforms using the SunC++ 4.x or g++ compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.5 config file, then add SunOS 5.6 updates below. - -#include "ace/config-sunos5.5.h" - -#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || \ - defined (__EXTENSIONS__) -// The asctime_r/ctime_r parameters change at POSIX.1c-1995 -# if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199506L) -# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -# endif /* POSIX_C_SOURCE >= 199506L */ -# define ACE_HAS_SIGWAIT -// Hack 'cuz _POSIX_C_SOURCE > 2 and -DEXTENSIONS hides this. -# define ACE_LACKS_MADVISE_PROTOTYPE -#endif /* _POSIX_C_SOURCE > 2 || __EXTENSIONS__ */ - -// Support for the SunC++ 5.2 compiler. -// Do not undefine for compat mode < 5 -#if defined (__SUNPRO_CC) && __SUNPRO_CC > 0x510 -#if defined (__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT >= 5) -#ifdef ACE_LACKS_ACE_IOSTREAM -#undef ACE_LACKS_ACE_IOSTREAM -#endif /* ACE_LACKS_ACE_IOSTREAM */ -#endif /* defined (__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT >= 5) */ - -#ifndef ACE_LACKS_UNBUFFERED_STREAMBUF -#define ACE_LACKS_UNBUFFERED_STREAMBUF 1 -#endif /* ACE_LACKS_UNBUFFERED_STREAMBUF */ -#ifndef ACE_TEMPLATES_REQUIRE_SOURCE -#define ACE_TEMPLATES_REQUIRE_SOURCE 1 -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ -#ifndef ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_HAS_TEMPLATE_TYPEDEFS 1 -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ -// Forte 7 seems to botch this one... -#if __SUNPRO_CC == 0x540 -#undef ACE_HAS_TEMPLATE_TYPEDEFS -#endif -#ifndef ACE_HAS_THR_C_DEST -#define ACE_HAS_THR_C_DEST 1 -#endif /* ACE_HAS_THR_C_DEST */ -#ifndef ACE_HAS_THR_C_FUNC -#define ACE_HAS_THR_C_FUNC 1 -#endif /* ACE_HAS_THR_C_FUNC */ -#ifndef ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 -#endif /* ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES */ -#ifndef ACE_HAS_SIG_C_FUNC -#define ACE_HAS_SIG_C_FUNC 1 -#endif /* ACE_HAS_SIG_C_FUNC */ -#ifndef ACE_HAS_STDCPP_STL_INCLUDES -#define ACE_HAS_STDCPP_STL_INCLUDES 1 -#endif /* ACE_HAS_STDCPP_STL_INCLUDES */ -#ifndef ACE_HAS_STRING_CLASS -#define ACE_HAS_STRING_CLASS 1 -#endif /* ACE_HAS_STRING_CLASS */ -#ifndef ACE_HAS_STANDARD_CPP_LIBRARY -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ -#ifndef ACE_HAS_STDCPP_STL_INCLUDES -#define ACE_HAS_STDCPP_STL_INCLUDES 1 -#endif /* ACE_HAS_STDCPP_STL_INCLUDES */ -#ifndef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ -#ifndef ACE_LACKS_IOSTREAM_FX -#define ACE_LACKS_IOSTREAM_FX 1 -#endif /* ACE_LACKS_IOSTREAM_FX */ -#ifndef ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -#endif /* ACE_LACKS_LINEBUFFERED_STREAMBUF */ - -#endif /* defined (__SUNPRO_CC) && __SUNPRO_CC > 0x510 */ - -// SunOS 5.6 and above support mkstemp -#undef ACE_LACKS_MKSTEMP - -// SunOS 5.6 has AIO calls. -#if !defined (ACE_HAS_AIO_CALLS) -#define ACE_HAS_AIO_CALLS -#endif /* ACE_HAS_AIO_CALLS */ - -#if !defined (ACE_HAS_POSIX_REALTIME_SIGNALS) -#define ACE_HAS_POSIX_REALTIME_SIGNALS -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - -#if !defined (ACE_HAS_POSIX_MESSAGE_PASSING) -#define ACE_HAS_POSIX_MESSAGE_PASSING -#endif /* ACE_HAS_POSIX_MESSAGE_PASSING */ - -#if !defined (ACE_HAS_POSIX_SEM) -#define ACE_HAS_POSIX_SEM -#endif /* ACE_HAS_POSIX_SEM */ - -// Sunos 5.6's aio_* with RT signals is broken. -#if !defined (ACE_POSIX_AIOCB_PROACTOR) -#define ACE_POSIX_AIOCB_PROACTOR -#endif /* ACE_POSIX_AIOCB_PROACTOR */ - -// SunOS 5.6 has a buggy select -#define ACE_HAS_LIMITED_SELECT - -// SunOS 5.6 introduced shm_open, but need to turn on POSIX.1b or higher -// to pick it up. -#if defined (_POSIX_C_SOURCE) && (_POSIX_C_SOURCE > 2) -# define ACE_HAS_SHM_OPEN -#else -# undef ACE_HAS_SHM_OPEN -#endif /* _POSIX_C_SOURCE > 2 */ - -// The struct msghdr is conditional on SunOS 5.6 based on _XPG4_2 -#if defined(_XPG4_2) -# define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#endif /* _XPG4_2 */ - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.7.h b/dep/include/ace/config-sunos5.7.h deleted file mode 100644 index b2b62b7e7bb..00000000000 --- a/dep/include/ace/config-sunos5.7.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.7.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for SunOS 5.7 -// (Solaris 7) platforms using the SunC++ 4.x, 5.x, or g++ compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.6 config file, then add SunOS 5.7 updates below. - -#include "ace/config-sunos5.6.h" - -// This may be true for earlier Solaris versions, but I can only verify -// it for Solaris 7 and later. -#define ACE_HAS_VFWPRINTF -#if defined (ACE_HAS_SHM_OPEN) -# define ACE_SHM_OPEN_REQUIRES_ONE_SLASH -#endif - -// Sun began distributing with SunOS 5.7 -#define ACE_HAS_SYS_LOADAVG_H - -// SunOS 5.7 has getloadavg() -#undef ACE_LACKS_GETLOADAVG - -#if defined (ghs) - // SunOS 5.7's /usr/include/sys/procfs_isa.h needs uint64_t, - // but /usr/include/sys/int_types.h doesn't #define it because - // _NO_LONGLONG is # -# undef ACE_HAS_PROC_FS -# undef ACE_HAS_PRUSAGE_T - -#elif defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) - // Wide character methods are in std:: when using SunCC 5.3 -# define ACE_WCHAR_IN_STD_NAMESPACE -#endif /* __GNUG__ || ghs */ - -// SunOS 5.7 supports SCHED_FIFO and SCHED_RR, as well as SCHED_OTHER. -#undef ACE_HAS_ONLY_SCHED_OTHER - -// SunOS 5.7 gets this right . . . -#undef ACE_HAS_BROKEN_T_ERROR - -// And doesn't need to set LWP priorities, as shown by -// performance-tests/Misc/preempt. -#undef ACE_NEEDS_LWP_PRIO_SET - -// SunOS 5.7 can support Real-Time Signals and POSIX4 AIO operations -// are supported. - -#if !defined (ACE_HAS_AIO_CALLS) -#define ACE_HAS_AIO_CALLS -#endif /* !ACE_HAS_AIO_CALLS */ - -#ifdef ACE_HAS_LIMITED_SELECT -#undef ACE_HAS_LIMITED_SELECT -#endif /* ACE_HAS_LIMITED_SELECT */ - -// SunOS 5.7 has socklen_t -#define ACE_HAS_SOCKLEN_T - -#if defined (__sparcv9) -#define _LP64 -#define ACE_SIZEOF_LONG 8 /* Needed to circumvent compiler bug #4294969 */ -#endif /* __sparcv9 */ - -#if (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)) /* XPG4 or XPG4v2 */ -// 2 parameter wcstok() -#else /* XPG4 or XPG4v2 */ -# define ACE_HAS_3_PARAM_WCSTOK -#endif - -// Solaris 7 started to support /dev/poll -#define ACE_HAS_DEV_POLL - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.8.h b/dep/include/ace/config-sunos5.8.h deleted file mode 100644 index 36ce6d4a81a..00000000000 --- a/dep/include/ace/config-sunos5.8.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.8.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for SunOS 5.8 -// (Solaris 8) platforms using the SunC++ 4.x, 5.x, 6.x, or g++ compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.7 config, then add any SunOS 5.8 updates below. -#include "ace/config-sunos5.7.h" - -#undef ACE_WCHAR_IN_STD_NAMESPACE - -// This may be true for versions prior to Solaris 8 as well, but I don't -// have any to try it on. -#if !defined (ACE_HAS_TIMEZONE) -# define ACE_HAS_TIMEZONE -#endif - -// The range of thread priorities for 5.8 differs from 5.7 in the -// minimum priority for the SCHED_OTHER policy (i.e., -// ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) -20 - -# if defined (_POSIX_PTHREAD_SEMANTICS) -# ifdef ACE_LACKS_RWLOCK_T -# undef ACE_LACKS_RWLOCK_T -# endif /* ACE_LACKS_RWLOCK_T */ -# endif /* _POSIX_PTHREAD_SEMANTICS */ - -// This is no longer the case for Sun 5.9 onwards -# undef ACE_HAS_X86_STAT_MACROS - -// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses -#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.9.h b/dep/include/ace/config-sunos5.9.h deleted file mode 100644 index 39b5721b527..00000000000 --- a/dep/include/ace/config-sunos5.9.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.9.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for SunOS 5.9 -// (Solaris 9) platforms using the SunC++ 5.x (Forte 6 and 7), or g++ -// compilers. - -#ifndef ACE_CONFIG_H - -// ACE_CONFIG_H is defined by one of the following #included headers. - -// #include the SunOS 5.8 config, then add any SunOS 5.9 updates below. -#include "ace/config-sunos5.8.h" - -#define ACE_HAS_SENDFILE -#define ACE_LACKS_THR_CONCURRENCY_FUNCS - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-tandem-nsk-mips-v2.h b/dep/include/ace/config-tandem-nsk-mips-v2.h deleted file mode 100644 index cb853c659f0..00000000000 --- a/dep/include/ace/config-tandem-nsk-mips-v2.h +++ /dev/null @@ -1,396 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-tandem-nsk-mips-v2.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_CONFIG_NSK_H -#define ACE_CONFIG_NSK_H - -#include /**/ "ace/pre.h" - -// The following configuration file contains defines for Tandem NSK -// platform, MIPS processor, version 2 C++ compiler. - -//========================================================================= -// Tandem NSK specific parts -//========================================================================= - -// Disable pthread renaming of symbols such as "open" and "close" -#define _CMA_NOWRAPPERS_ 1 - -// Get Handle_Set.cpp to generate correct bit operations for NSK platform -#define ACE_TANDEM_NSK_BIT_ORDER - -// Use facilities provided by T1248 version of pthreads. -// (If not defined, will use old version of pthreads.) -#define ACE_TANDEM_T1248_PTHREADS - -// Use all available T1248 thread aware wrapper functions for providing -// non-blocking I/O. -// [@note this causes a significant performance degradation] -//#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS - -// Need this include here because some symbols defined by pthreads -// (e.g. timespec_t) are needed before spthread.h is normally included -// by ACE -#ifdef ACE_TANDEM_T1248_PTHREADS -#include -#else -#include "pthread.h" -#include "dce/cma_dispatch_coop.h" -#endif - -// The following #defines are hacks to get around things -// that seem to be missing or different in Tandem land -#define NSIG 32 // missing from Signal.h - // note: on nsk TNS/R there is room in - // sigset_t for 128 signals but those - // above 31 are not valid. -typedef long fd_mask; // should be in select.h but no such file -#define NBBY 8 // must be consistent with value in sys/types.h -#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -#define MAXNAMLEN 248 // missing from dirent.h -#define ERRMAX 4218 // from errno.h - -// Following seems to be missing from G06.20 version of standard -// pthreads includes (it appeared in older version of standard pthreads) -// (SCHED_FIFO (aka cma_c_sched_fifo) used in Dynamic_Priority_Test) -#ifdef ACE_TANDEM_T1248_PTHREADS -typedef enum CMA_T_SCHED_POLICY { - cma_c_sched_fifo = 0, - cma_c_sched_rr = 1, - cma_c_sched_throughput = 2, - cma_c_sched_background = 3, - cma_c_sched_ada_low = 4 - } cma_t_sched_policy; -#endif - -// T1248 doesn't define these constants. They're defined in spt/cma.h -// (formerly dce/cma.h), but this header is not included or provided -// by T1248 G07-AAL. -#define cma_c_prio_fifo_min 16 -#define cma_c_prio_fifo_mid 24 -#define cma_c_prio_fifo_max 31 -#define cma_c_prio_rr_min 16 -#define cma_c_prio_rr_mid 24 -#define cma_c_prio_rr_max 31 -#define cma_c_prio_through_min 8 -#define cma_c_prio_through_mid 12 -#define cma_c_prio_through_max 15 -#define cma_c_prio_back_min 1 -#define cma_c_prio_back_mid 4 -#define cma_c_prio_back_max 7 - -// Enable NSK Pluggable Protocols -#define TAO_HAS_NSKPW 1 -#define TAO_HAS_NSKFS 1 - -//========================================================================= -// Platform specific parts -//========================================================================= - -// Platform lacks getpwnam_r() methods (e.g., SGI 6.2). -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS - -// Platform/compiler lacks {get,set}rlimit() function -#define ACE_LACKS_RLIMIT - -// The platform doesn't have mmap(2) -#define ACE_LACKS_MMAP - -// Platform lacks streambuf "linebuffered ()". [C++ iostream] -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -// Platform supports recvmsg and sendmsg -#define ACE_HAS_MSG - -// Platform defines ACE_HAS_MSG, but lacks msg_accrights{,len}. -#define ACE_LACKS_MSG_ACCRIGHTS - -// Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -// Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T - -// OS/compiler uses size_t * rather than int * for socket lengths -#define ACE_HAS_SIZET_SOCKET_LEN - -// OS/compiler uses void * arg 4 setsockopt() rather than const char * -#define ACE_HAS_VOIDPTR_SOCKOPT - -// The platform doesn't have mprotect(2) -#define ACE_LACKS_MPROTECT - -// Platform lacks msync() -#define ACE_LACKS_MSYNC - -// Platform does not support reentrant netdb functions (getprotobyname_r, -// getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support - -// Platform lacks madvise() -#define ACE_LACKS_MADVISE - -// Platform lacks pri_t -#define ACE_LACKS_PRI_T - -// Platform lacks a working sbrk() -#define ACE_LACKS_SBRK - -// Platform doesn't have syscall() prototype -#define ACE_LACKS_SYSCALL - -// Platform lacks the inet_aton() function. -#define ACE_LACKS_INET_ATON - -// Compiler/platform has Dirent iterator functions -#define ACE_HAS_DIRENT - -// Platform uses ACE_HAS_DIRENT but does not have readdir_r() -#define ACE_LACKS_READDIR_R - -// Platform supports getpagesize() call (otherwise, -// ACE_PAGE_SIZE must be defined) -#define ACE_HAS_GETPAGESIZE - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Platform's select() uses non-const timeval* -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -// Platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// Platform lacks named POSIX semaphores -#define ACE_LACKS_NAMED_POSIX_SEM - -// Platform has support for multi-byte character support compliant -// with the XPG4 Worldwide Portability Interface wide-character -// classification. -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// No wcsstr function available for this compiler -#define ACE_LACKS_WCSSTR - -// No wctype.h available for this compiler -#define ACE_LACKS_WCTYPE_H - -// Platform supports the POSIX regular expression library. -// [Note Tandem NSK platform does have regular expresson support but it -// does not follow the assumptions made by ACE. To use it would need -// to make some ACE modifications.] -//#define ACE_HAS_REGEX - -// Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - -// Platform doesn't have truncate() -#define ACE_LACKS_TRUNCATE - -// Platform lacks readers/writer locks. -#define ACE_LACKS_RWLOCK_T - -// Compiler's 'new' throws exception on failure (ANSI C++ behavior). -#define ACE_NEW_THROWS_EXCEPTIONS - -// Optimize ACE_Handle_Set::count_bits for select() operations (common -// case) -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform lacks setreuid() -#define ACE_LACKS_SETREUID - -// Platform lacks setregid() -#define ACE_LACKS_SETREGID - -// Compile using multi-thread libraries -#define ACE_MT_SAFE 1 - -// Platform supports System V IPC -#define ACE_HAS_SYSV_IPC - -// Platform lacks the socketpair() call -// [Needed due to failure of Pipe_Test. even though nsk platform -// has socketpair(), Pipe.cpp tries to set socket buf size but this -// is not allowed for AF_UNIX protocol on nsk.] -#define ACE_LACKS_SOCKET_BUFSIZ - -// Platform lacks the socketpair() call -#define ACE_LACKS_SOCKETPAIR - -// Platform limits the maximum socket message size. -#define ACE_HAS_SOCK_BUF_SIZE_MAX - -// hrtime_t is a basic type that doesn't require ACE_U64_TO_U32 conversion -#define ACE_HRTIME_T_IS_BASIC_TYPE - -// printf format specifiers for 64 bit integers -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") - -//========================================================================= -// Threads specific parts -//========================================================================= - -// Platform supports threads -#define ACE_HAS_THREADS - -// Platform supports POSIX Pthreads, of one form or another. This -// macro says the platform has a pthreads variety - should also define -// one of the below to say which one. Also may need some -// ACE_HAS_... thing for extensions. -#define ACE_HAS_PTHREADS - -// Standard pthreads supports only SCHED_FIFO -#define ACE_HAS_ONLY_SCHED_FIFO - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! -#define ACE_LACKS_CONDATTR_PSHARED - -// pthread_cond_timedwait does *not* reset the time argument when the -// lock is acquired. -#define ACE_LACKS_COND_TIMEDWAIT_RESET - -// Platform lacks pthread_attr_setsched() -#define ACE_LACKS_SETSCHED - -// Platform has pthread_mutexattr_setkind_np(). -#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP - -// Platform lacks pthread_mutexattr_setpshared(). -#define ACE_LACKS_MUTEXATTR_PSHARED - -// Platform lacks pthread_attr_setscope() -#define ACE_LACKS_THREAD_PROCESS_SCOPING - -// Platform lacks pthread_attr_setstackaddr -#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR - -// Defining ACE_HAS_UCONTEXT_T since G06.21 version of spthreads has -// a definition for it. -#ifdef ACE_TANDEM_T1248_PTHREADS -#define ACE_HAS_UCONTEXT_T -#endif - -//========================================================================= -// Include file characteristics -//========================================================================= - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform lacks malloc.h -#define ACE_LACKS_MALLOC_H - -// Platform lacks the siginfo.h include file -#define ACE_LACKS_SIGINFO_H - -// Platform doesn't define struct strrecvfd. -#define ACE_LACKS_STRRECVFD - -// Platform lacks the ucontext.h file -#define ACE_LACKS_UCONTEXT_H - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Platform supports the POSIX struct timespec type -#define ACE_HAS_POSIX_TIME - -// Platform/compiler supports timezone * as second parameter to gettimeofday() -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Platform has (which contains bzero() prototype) -#define ACE_HAS_STRINGS 1 - -// OS/compiler omits the const from the iovec parameter in the -// writev() prototype. -#define ACE_HAS_NONCONST_WRITEV - -// Platform lacks -#define ACE_LACKS_STDINT_H - -// Platform lacks -#define ACE_LACKS_INTTYPES_H - -// Platform lacks -#define ACE_LACKS_SYS_SELECT_H - -// Platform lacks -#define ACE_LACKS_DLFCN_H - -// Platform lacks -#define ACE_LACKS_SEMAPHORE_H - -// Platform lacks -#define ACE_LACKS_POLL_H - -//========================================================================= -// Compiler specific parts -//========================================================================= - -// Compiler supports C++ exception handling -#define ACE_HAS_EXCEPTIONS - -// Compiler/platform has correctly prototyped header files -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform does not support the unsigned long long datatype. -#define ACE_LACKS_LONGLONG_T - -// Compiler supports the ssize_t typedef -#define ACE_HAS_SSIZE_T - -// Platform/compiler supports Standard C++ Library -#define ACE_HAS_STANDARD_CPP_LIBRARY 0 - -// Compiler's template mechanism must see source code (i.e., -// .cpp files). -#define ACE_TEMPLATES_REQUIRE_SOURCE - -// Compiler implements templates that support typedefs inside -// of classes used as formal arguments to a template class. -#define ACE_HAS_TEMPLATE_TYPEDEFS - -// Platform has its standard c++ library in the namespace std. -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -// Compiler doesn't support static data member templates -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES - -// Platform lacks "signed char" type (broken!) -// Following will not be needed if use standard c library (G06.20 and later) -#define ACE_LACKS_SIGNED_CHAR - -//========================================================================= -// Build options -//========================================================================= - -// Disable the inclusion of RCS ids in the generated code. -#define ACE_USE_RCSID 0 - -// For debugging problems in os calls (but this doesn't work too well -// since output is not interleaved properly with output from ACE_TRACE -//# define ACE_OS_TRACE(X) ::printf(X) - -// Uncomment the following if timed message blocks are needed (e.g. -// for Dynamic_Priority_Test. Otherwise leave this disabled because -// enabling it adds overhead to message blocks and timed message blocks -// are "rarely used." -//#define ACE_HAS_TIMED_MESSAGE_BLOCKS - -// Uncomment the following if tokens library is needed. -//#define ACE_HAS_TOKENS_LIBRARY - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_NSK_H */ - diff --git a/dep/include/ace/config-tandem-nsk-mips-v3.h b/dep/include/ace/config-tandem-nsk-mips-v3.h deleted file mode 100644 index 88773d37f92..00000000000 --- a/dep/include/ace/config-tandem-nsk-mips-v3.h +++ /dev/null @@ -1,463 +0,0 @@ -// -*- C++ -*- -// -// $Id: config-tandem-nsk-mips-v3.h 81935 2008-06-12 22:01:53Z jtc $ - -#ifndef ACE_CONFIG_NSK_H -#define ACE_CONFIG_NSK_H - -#include /**/ "ace/pre.h" - -// The following configuration file contains defines for Tandem NSK -// platform, MIPS processor, version 3 C++ compiler. - -//========================================================================= -// Tandem NSK specific parts -//========================================================================= - -// Disable pthread renaming of symbols such as "open" and "close" -#define _CMA_NOWRAPPERS_ 1 - -// Get Handle_Set.cpp to generate correct bit operations for NSK platform -#define ACE_TANDEM_NSK_BIT_ORDER - -// Use facilities provided by T1248 version of pthreads. -// (If not defined, will use old version of pthreads.) -#define ACE_TANDEM_T1248_PTHREADS - -// Use all available T1248 thread aware wrapper functions for providing -// non-blocking I/O. -// [Note: this causes a significant performance degradation] -//#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS - -// Need this include here because some symbols defined by pthreads -// (e.g. timespec_t) are needed before spthread.h is normally included -// by ACE -#ifdef ACE_TANDEM_T1248_PTHREADS -#include -#else -#include "pthread.h" -#include "dce/cma_dispatch_coop.h" -#endif - -// The following #defines are hacks to get around things -// that seem to be missing or different in Tandem land -#define NSIG 32 // missing from Signal.h - // note: on nsk TNS/R there is room in - // sigset_t for 128 signals but those - // above 31 are not valid. -typedef long fd_mask; // should be in select.h but no such file -#define NBBY 8 // must be consistent with value in sys/types.h -#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -#define MAXNAMLEN 248 // missing from dirent.h -#define ERRMAX 4218 // from errno.h - -// Following seems to be missing from G06.20 version of standard -// pthreads includes (it appeared in older version of standard pthreads) -// (SCHED_FIFO (aka cma_c_sched_fifo) used in Dynamic_Priority_Test) -#ifdef ACE_TANDEM_T1248_PTHREADS -typedef enum CMA_T_SCHED_POLICY { - cma_c_sched_fifo = 0, - cma_c_sched_rr = 1, - cma_c_sched_throughput = 2, - cma_c_sched_background = 3, - cma_c_sched_ada_low = 4 - } cma_t_sched_policy; -#endif - -// T1248 doesn't define these constants. They're defined in spt/cma.h -// (formerly dce/cma.h), but this header is not included or provided -// by T1248 G07-AAL. -#define cma_c_prio_fifo_min 16 -#define cma_c_prio_fifo_mid 24 -#define cma_c_prio_fifo_max 31 -#define cma_c_prio_rr_min 16 -#define cma_c_prio_rr_mid 24 -#define cma_c_prio_rr_max 31 -#define cma_c_prio_through_min 8 -#define cma_c_prio_through_mid 12 -#define cma_c_prio_through_max 15 -#define cma_c_prio_back_min 1 -#define cma_c_prio_back_mid 4 -#define cma_c_prio_back_max 7 - -// Enable NSK Pluggable Protocols -#define TAO_HAS_NSKPW 1 -#define TAO_HAS_NSKFS 1 - -//========================================================================= -// Platform specific parts -//========================================================================= - -// Platform lacks getpwnam_r() methods (e.g., SGI 6.2). -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS - -// Platform/compiler lacks {get,set}rlimit() function -#define ACE_LACKS_RLIMIT - -// The platform doesn't have mmap(2) -#define ACE_LACKS_MMAP - -// Platform lacks streambuf "linebuffered ()". [C++ iostream] -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -// Platform supports recvmsg and sendmsg -#define ACE_HAS_MSG - -// Platform defines ACE_HAS_MSG, but lacks msg_accrights{,len}. -#define ACE_LACKS_MSG_ACCRIGHTS - -// Platform supports sigsuspend() -#define ACE_HAS_SIGSUSPEND - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -// Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T - -// OS/compiler uses size_t * rather than int * for socket lengths -#define ACE_HAS_SIZET_SOCKET_LEN - -// OS/compiler uses void * arg 4 setsockopt() rather than const char * -#define ACE_HAS_VOIDPTR_SOCKOPT - -// The platform doesn't have mprotect(2) -#define ACE_LACKS_MPROTECT - -// Platform lacks msync() -#define ACE_LACKS_MSYNC - -// Platform does not support reentrant netdb functions (getprotobyname_r, -// getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support - -// Platform lacks madvise() -#define ACE_LACKS_MADVISE - -// Platform lacks pri_t -#define ACE_LACKS_PRI_T - -// Platform lacks a working sbrk() -#define ACE_LACKS_SBRK - -// Platform doesn't have syscall() prototype -#define ACE_LACKS_SYSCALL - -// Platform lacks the inet_aton() function. -#define ACE_LACKS_INET_ATON - -// Compiler/platform has Dirent iterator functions -#define ACE_HAS_DIRENT - -// Platform uses ACE_HAS_DIRENT but does not have readdir_r() -#define ACE_LACKS_READDIR_R - -// Platform supports getpagesize() call (otherwise, -// ACE_PAGE_SIZE must be defined) -#define ACE_HAS_GETPAGESIZE - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Platform's select() uses non-const timeval* -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -// Platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// Platform lacks named POSIX semaphores -#define ACE_LACKS_NAMED_POSIX_SEM - -// Platform has support for multi-byte character support compliant -// with the XPG4 Worldwide Portability Interface wide-character -// classification. -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// No wcsstr function available for this compiler -#define ACE_LACKS_WCSSTR - -// No wctype.h available for this compiler -#define ACE_LACKS_WCTYPE_H - -// Platform supports the POSIX regular expression library. -// [Note Tandem NSK platform does have regular expresson support but it -// does not follow the assumptions made by ACE. To use it would need -// to make some ACE modifications.] -//#define ACE_HAS_REGEX - -// Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - -// Platform doesn't have truncate() -#define ACE_LACKS_TRUNCATE - -// Platform lacks readers/writer locks. -#define ACE_LACKS_RWLOCK_T - -// Compiler's 'new' throws exception on failure (ANSI C++ behavior). -#define ACE_NEW_THROWS_EXCEPTIONS - -// Optimize ACE_Handle_Set::count_bits for select() operations (common -// case) -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform lacks setreuid() -#define ACE_LACKS_SETREUID - -// Platform lacks setregid() -#define ACE_LACKS_SETREGID - -// Compile using multi-thread libraries -#define ACE_MT_SAFE 1 - -// Platform supports System V IPC -#define ACE_HAS_SYSV_IPC - -// Platform lacks the socketpair() call -// [Needed due to failure of Pipe_Test. even though nsk platform -// has socketpair(), Pipe.cpp tries to set socket buf size but this -// is not allowed for AF_UNIX protocol on nsk.] -#define ACE_LACKS_SOCKET_BUFSIZ - -// Platform lacks the socketpair() call -#define ACE_LACKS_SOCKETPAIR - -// Platform limits the maximum socket message size. -#define ACE_HAS_SOCK_BUF_SIZE_MAX - -// hrtime_t is a basic type that doesn't require ACE_U64_TO_U32 conversion -#define ACE_HRTIME_T_IS_BASIC_TYPE - -// printf format specifiers for 64 bit integers -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") - -// Use larger default buffer size for ease of interoperability -#define ACE_DEFAULT_CDR_BUFSIZE 4096 - -// Size of a wchar -#define ACE_SIZEOF_WCHAR 2 - -// Platform lacks time typedefs -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_USECONDS_T - -// Platform lacks setegid() and seteuid() -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETEUID - -// Platform lacks vsnprintf() -#define ACE_LACKS_VSNPRINTF - -// Platform lacks log2() -#define ACE_LACKS_LOG2 - -// Platform lacks alphasort() -#define ACE_LACKS_ALPHASORT - -//========================================================================= -// Threads specific parts -//========================================================================= - -// Platform supports threads -#define ACE_HAS_THREADS - -// Platform supports POSIX Pthreads, of one form or another. This -// macro says the platform has a pthreads variety - should also define -// one of the below to say which one. Also may need some -// ACE_HAS_... thing for extensions. -#define ACE_HAS_PTHREADS - -// Standard pthreads supports only SCHED_FIFO -#define ACE_HAS_ONLY_SCHED_FIFO - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! -#define ACE_LACKS_CONDATTR_PSHARED - -// pthread_cond_timedwait does *not* reset the time argument when the -// lock is acquired. -#define ACE_LACKS_COND_TIMEDWAIT_RESET - -// Platform lacks pthread_attr_setsched() -#define ACE_LACKS_SETSCHED - -// Platform has pthread_getschedparam and pthread_setschedparam -// even when ACE_LACKS_SETSCHED is defined. -#define ACE_HAS_PTHREAD_SCHEDPARAM - -// Platform has pthread_mutexattr_setkind_np(). -#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP - -// Platform lacks pthread_mutexattr_setpshared(). -#define ACE_LACKS_MUTEXATTR_PSHARED - -// Platform lacks pthread_attr_setscope() -#define ACE_LACKS_THREAD_PROCESS_SCOPING - -// Platform lacks pthread_attr_setstackaddr -#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR - -// Platform lacks pthread_attr_setstack -#define ACE_LACKS_PTHREAD_ATTR_SETSTACK - -// Defining ACE_HAS_UCONTEXT_T since G06.21 version of spthreads has -// a definition for it. -#ifdef ACE_TANDEM_T1248_PTHREADS -#define ACE_HAS_UCONTEXT_T -#endif - -//========================================================================= -// Include file characteristics -//========================================================================= - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform lacks malloc.h -#define ACE_LACKS_MALLOC_H - -// Platform lacks the siginfo.h include file -#define ACE_LACKS_SIGINFO_H - -// Platform doesn't define struct strrecvfd. -#define ACE_LACKS_STRRECVFD - -// Platform lacks the ucontext.h file -#define ACE_LACKS_UCONTEXT_H - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Platform supports the POSIX struct timespec type -#define ACE_HAS_POSIX_TIME - -// Platform/compiler supports timezone * as second parameter to gettimeofday() -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -// Platform has (which contains bzero() prototype) -#define ACE_HAS_STRINGS 1 - -// OS/compiler omits the const from the iovec parameter in the -// writev() prototype. -#define ACE_HAS_NONCONST_WRITEV - -// Platform lacks -#define ACE_LACKS_STDINT_H - -// Platform lacks -#define ACE_LACKS_INTTYPES_H - -// Platform lacks -#define ACE_LACKS_SYS_SELECT_H - -// Platform lacks -#define ACE_LACKS_DLFCN_H - -// Platform lacks -#define ACE_LACKS_SEMAPHORE_H - -// Platform lacks -#define ACE_LACKS_POLL_H - -// Platform lacks -#define ACE_LACKS_SYS_SYSCTL_H - -//========================================================================= -// Compiler specific parts -//========================================================================= - -// Compiler supports C++ exception handling -#define ACE_HAS_EXCEPTIONS 1 - -// Compiler/platform has correctly prototyped header files -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform does not support the unsigned long long datatype. -#define ACE_LACKS_UNSIGNEDLONGLONG_T - -// Compiler supports the ssize_t typedef -#define ACE_HAS_SSIZE_T - -// Platform/compiler supports Standard C++ Library -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 - -// Compiler's template mechanism must see source code (i.e., -// .cpp files). -#define ACE_TEMPLATES_REQUIRE_SOURCE - -// Compiler implements templates that support typedefs inside -// of classes used as formal arguments to a template class. -#define ACE_HAS_TEMPLATE_TYPEDEFS - -// Platform/Compiler supports a String class -#define ACE_HAS_STRING_CLASS -#define ACE_HAS_STDCPP_STL_INCLUDES - -// Platform has its standard c++ library in the namespace std. -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -// Compiler doesn't support static data member templates -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES - -// Platform lacks "signed char" type (broken!) -// Following will not be needed if use standard c library (G06.20 and later) -#define ACE_LACKS_SIGNED_CHAR - -// Compiler can handle any operators in namespace -#define ACE_ANY_OPS_USE_NAMESPACE - -// Platform lacks intptr_t typedef -#define ACE_LACKS_INTPTR_T - -//========================================================================= -// C++ version3 import/export macros -//========================================================================= - -// Define the export macros needed to export symbols outside a DLL -// The ACE_IMPORT_SINGLETON_DECLARE macro has been modified to not explicitly -// instantiate the class template. -#if defined(USE_EXPLICIT_EXPORT) -#define ACE_LACKS_INLINE_FUNCTIONS - -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag export$ -#define ACE_Proper_Import_Flag import$ -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class export$ T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class export$ SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class import$ T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class import$ SINGLETON_TYPE ; -#endif - -//========================================================================= -// Build options -//========================================================================= - -// Disable the inclusion of RCS ids in the generated code. -#define ACE_USE_RCSID 0 - -// For debugging problems in os calls (but this doesn't work too well -// since output is not interleaved properly with output from ACE_TRACE -//# define ACE_OS_TRACE(X) ::printf(X) - -// Uncomment the following if timed message blocks are needed (e.g. -// for Dynamic_Priority_Test. Otherwise leave this disabled because -// enabling it adds overhead to message blocks and timed message blocks -// are "rarely used." -//#define ACE_HAS_TIMED_MESSAGE_BLOCKS - -// Uncomment the following if tokens library is needed. -//#define ACE_HAS_TOKENS_LIBRARY - -// NonStop CORBA uses the XML Service Configurator -#define ACE_HAS_XML_SVC_CONF - -#define ACE_LD_SEARCH_PATH "_RLD_LIB_PATH" - -#include /**/ "ace/post.h" - -#endif /* ACE_CONFIG_NSK_H */ - diff --git a/dep/include/ace/config-tandem.h b/dep/include/ace/config-tandem.h deleted file mode 100644 index 2e1be04bc10..00000000000 --- a/dep/include/ace/config-tandem.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -*- C++ -*- */ -// Testing TANDEM -// $Id: config-tandem.h 81697 2008-05-14 18:33:11Z johnnyw $ - -// The following configuration file is designed to work for Tandems NonStop-UX -// 4.2MP platforms using the NCC 3.20 compiler. - -// Note this is a test version it might include several errors I -// have done a test and set/unset until I errors disappered. -// Some of the options that should be set aren't because of the simple fact -// that i haven't the time to check what is wrong. -// e.g. widecharacter are supported but a wcstok which only take 2 parameters -// are included by the compiler, to get the correct wcstok that takes 3 params -// we must set _XOPEN_SOURCE and we get ALOT of errors and warnings. -// So this config is done to get things to start to work it isn't finished. -// Janne (Jan.Perman@osd.Ericsson.se) - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#define ACE_HAS_IDTYPE_T -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Tandem doesn't include this although they are defined -// in sys/time.h and sys/resource.h -#define ACE_LACKS_RLIMIT_PROTOTYPE // jjpp -// Tandem has a function to set t_errno (set_t_errno) -#define ACE_HAS_SET_T_ERRNO // jjpp - -//Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// OS/compiler omits the const from the sendmsg() prototype. -#define ACE_HAS_NONCONST_SENDMSG - -//Platform supports system configuration information -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -//Platform supports the POSIX regular expression library -#define ACE_HAS_REGEX - -// Platform supports recvmsg and sendmsg -#define ACE_HAS_MSG - -//Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -//Platform provides header -#define ACE_HAS_SYSENT_H - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -//Platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files -#define ACE_HAS_CPLUSPLUS_HEADERS - -//Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -//Compiler/platform has -#define ACE_HAS_ALLOCA_H - -//Platform contains -#define ACE_HAS_POLL - -// Platform supports the POSIX struct timespec type -#define ACE_HAS_POSIX_TIME // As i understand it, but i'm in deep water -//Platform supports the SVR4 timestruc_t type - -// To get this to work a patch in sys/signal must be made -// typedef void SIG_FUNC_TYPE(int); -//#if defined (__cplusplus) -// void (*sa_handler)(int); -//#else -// ... -//#endif -//#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_TANDEM_SIGNALS -//Compiler/platform defines the sig_atomic_t typedef -#define ACE_HAS_SIG_ATOMIC_T -//Platform supports SVR4 extended signals -#define ACE_HAS_SIGINFO_T -//Platform supports ucontext_t (which is used in the extended signal API). -#define ACE_HAS_UCONTEXT_T - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT - -//Compiler/platform provides the sockio.h file -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef -#define ACE_HAS_SSIZE_T // Limits.h must be included - -//Platform supports STREAMS -#define ACE_HAS_STREAMS - -#define ACE_HAS_STREAM_PIPES -//Platform supports STREAM pipes - -//Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - -//Compiler/platform supports struct strbuf -#define ACE_HAS_STRBUF_T - -//Compiler/platform supports SVR4 dynamic linking semantics -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -//Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -//Platform provides header -#define ACE_HAS_SYS_FILIO_H - -//Platform supports TLI timod STREAMS module -#define ACE_HAS_TIMOD_H -//Platform supports TLI tiuser header -#define ACE_HAS_TIUSER_H - -//Platform supports TLI -#define ACE_HAS_TLI -//Platform provides TLI function prototypes -#define ACE_HAS_TLI_PROTOTYPES - -//Platform lacks streambuf "linebuffered ()". -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -// Platform lacks "signed char" type (broken!) -#define ACE_LACKS_SIGNED_CHAR - -#define ACE_PAGE_SIZE 4096 -// Defines the page size of the system (not used on Win32 or -// with ACE_HAS_GETPAGESIZE). - -/****** THREAD SPECIFIC **********/ -/* If you want to remove threading then comment out the following four #defines .*/ -#if !defined (ACE_MT_SAFE) - #define ACE_MT_SAFE 1 //Compile using multi-thread libraries -#endif -#define ACE_HAS_THREADS //Platform supports threads -#define ACE_HAS_STHREADS //Platform supports Solaris threads - -// Compiler/platform has threadspecific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -//Platform supports thr_keydelete (e.g,. UNIXWARE) - -#define ACE_HAS_THR_MINSTACK // Tandem uses thr_minstack instead of thr_min_stack -#define ACE_LACKS_PRI_T // Tandem lacks pri_t -#define ACE_HAS_THR_KEYDELETE - -//************************************* - -/*********************************/ - -/******* SIGNAL STUFF *******/ - -//Platform uses non-const char * in calls to gethostbyaddr, gethostbyname, -// getservbyname -#define ACE_HAS_NONCONST_GETBY -// Platform's select() uses non-const timeval* (only found on Linux right now) -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -// And on Tandem :-) -//Uses ctime_r & asctime_r with only two parameters vs. three. -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -//Platform has special header for select(). -#define ACE_HAS_SELECT_H -// Platform/compiler supports Standard C++ Library -#define ACE_HAS_STANDARD_CPP_LIBRARY -//Platform lacks madvise() (e.g., Linux) -#define ACE_LACKS_MADVISE -//Compiler/platform lacks strcasecmp() (e.g., DG/UX, UNIXWARE, VXWORKS) -#define ACE_LACKS_STRCASECMP - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-tru64.h b/dep/include/ace/config-tru64.h deleted file mode 100644 index db16845b529..00000000000 --- a/dep/include/ace/config-tru64.h +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-tru64.h 81935 2008-06-12 22:01:53Z jtc $ - -// The following configuration file is designed to work for the -// Digital UNIX V4.0a and later platforms. It relies on -// config-osf1-4.0.h, and adds deltas for newer platforms. - -#ifndef ACE_CONFIG_TRU64_H -#define ACE_CONFIG_TRU64_H -#include /**/ "ace/pre.h" - -#if !defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif /* ! ACE_MT_SAFE */ - -/*clearerr is not defined when _REENTRANT is not defined*/ -#if ACE_MT_SAFE == 0 -#define ACE_LACKS_CLEARERR -#endif /* ACE_MT_SAFE == 0 */ - -#include "ace/config-posix.h" - -// Configuration-specific #defines: -// 1) g++ or cxx -// 2) pthreads or DCE threads -#if defined (__GNUG__) - // g++ with pthreads - - // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so - // this must appear before its #include. -# define ACE_HAS_STRING_CLASS - -# include "ace/config-g++-common.h" - -# define ACE_HAS_GNU_CSTRING_H -# define ACE_HAS_REENTRANT_FUNCTIONS -#elif defined (__DECCXX) - -# define ACE_CONFIG_INCLUDE_CXX_COMMON -# include "ace/config-cxx-common.h" - -#elif defined (__rational__) -# define ACE_HAS_REENTRANT_FUNCTIONS -# define ACE_HAS_STRING_CLASS -# define ACE_LACKS_LINEBUFFERED_STREAMBUF -# define ACE_LACKS_SIGNED_CHAR - - // Exceptions are enabled by platform_osf1_4.0_rcc.GNU. -# define ACE_HAS_STDCPP_STL_INCLUDES -#else -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on Digital Unix -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! __DECCXX && ! __rational__ */ - -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define ACE_HAS_BROKEN_IF_HEADER -#define ACE_HAS_BROKEN_R_ROUTINES -#if (ACE_MT_SAFE != 0) -# define ACE_HAS_PTHREADS -# define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#endif /* ACE_MT_SAFE != 0 */ -#define ACE_LACKS_T_ERRNO -#if !defined (DIGITAL_UNIX) -# define DIGITAL_UNIX 0x400 -#endif /* ! DIGITAL_UNIX */ - -#define ACE_SIZEOF_LONG 8 - -#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) -#define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_NONCONST_SETRLIMIT -#define ACE_HAS_BROKEN_T_ERROR -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_GPERF -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_IP_MULTICAST -#define ACE_HAS_LLSEEK -#define ACE_HAS_LONG_MAP_FAILED -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_OSF1_GETTIMEOFDAY -#define ACE_HAS_OSF_TIMOD_H -#define ACE_HAS_POLL -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_PRIOCNTL -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRBUF_T -#define ACE_HAS_STREAMS -#define ACE_HAS_STRERROR -#define ACE_HAS_STRPTIME -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_SYS_SYSCALL_H -#define ACE_HAS_SYSV_IPC -#if (ACE_MT_SAFE == 0) -// clearerr is not defined when _REENTRANT is not defined -#define ACE_LACKS_CLEARERR -#else /* ACE_MT_SAFE != 0 */ -#define ACE_HAS_THREADS -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR -#endif /* ACE_MT_SAFE != 0 */ -#define ACE_HAS_TIUSER_H -#define ACE_HAS_XTI -#define ACE_HAS_TLI_PROTOTYPES -#define ACE_HAS_UALARM -#define ACE_HAS_UCONTEXT_T -#define ACE_LACKS_PRI_T -#define ACE_LACKS_RWLOCK_T -#define ACE_PAGE_SIZE 8192 -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -// DJT 6/10/96 All these broken macro's can now be removed with the -// approporiate ordering of the include files. The Platinum release -// now temporarily supports both forms. Platform's implementation of -// sendmsg() has a non-const msgheader parameter. -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_IDTYPE_T -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#if DIGITAL_UNIX >= 0x500 -# define ACE_HAS_XPG4_MULTIBYTE_CHAR 1 -#endif /* DIGITAL_UNIX >= 0x500 */ - -#if DIGITAL_UNIX >= 0x40E -# define ACE_LACKS_STDINT_H -#endif /* DIGITAL_UNIX >= 0x40E */ - -#if (DIGITAL_UNIX >= 0x400) && (DIGITAL_UNIX < 0x500) -#define ACE_LACKS_PREAD_PROTOTYPE -#endif /* (DIGITAL_UNIX >= 0x400) && (DIGITAL_UNIX < 0x500) */ - -// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses -#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_TRU64_H */ - diff --git a/dep/include/ace/config-unixware-7.1.0.h b/dep/include/ace/config-unixware-7.1.0.h deleted file mode 100644 index 44eef5d5973..00000000000 --- a/dep/include/ace/config-unixware-7.1.0.h +++ /dev/null @@ -1,412 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-unixware-7.1.0.h 82267 2008-07-08 16:39:19Z jtc $ - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H - -/* ACE configuration header file */ - -/* Include the commong gnu config file */ -#include "config-g++-common.h" - -/* For unixware 7.1 && g++ 2.91.57, see if this fixes my problem */ -#ifndef UNIXWARE_7_1 -#define UNIXWARE_7_1 -#endif - -/* Define if you have alloca, as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#define YYTEXT_POINTER 1 - -/* Define _REENTRANT if reentrant functions should be used. */ -#ifndef _REENTRANT -# define _REENTRANT 1 -#endif - -#define ACE_HAS_NEW_NO_H 1 -#define ACE_HAS_STDEXCEPT_NO_H 1 - -#define ACE_THREAD_MIN_PRIORITY 0 -#if defined (ACE_THREAD_MIN_PRIORITY) -# define PTHREAD_MIN_PRIORITY ACE_THREAD_MIN_PRIORITY -#endif /* #if defined (ACE_THREAD_MIN_PRIORITY) */ - -#define ACE_THREAD_MAX_PRIORITY 99 -#if defined (ACE_THREAD_MAX_PRIORITY) -# define PTHREAD_MAX_PRIORITY ACE_THREAD_MAX_PRIORITY -#endif /* #if defined (ACE_THREAD_MAX_PRIORITY) */ - -/* Specify sizes of given built-in types. If a size isn't defined here, - then ace/Basic_Types.h will attempt to deduce the size. */ -/* #undef ACE_SIZEOF_CHAR */ -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 4 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_VOID_P 4 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_LONG_DOUBLE 12 - -/* Enable ACE inlining */ -#define __ACE_INLINE__ 1 - -/* OS has priocntl (2) */ -#define ACE_HAS_PRIOCNTL 1 - -/* Platform has pread() and pwrite() support */ -#define ACE_HAS_P_READ_WRITE 1 - -/* Compiler/platform supports alloca() */ -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA 1 - -/* Compiler/platform correctly calls init()/fini() for shared libraries */ -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 - -/* Platform doesn't cast MAP_FAILED to a (void *). */ -/* #undef ACE_HAS_BROKEN_MAP_FAILED */ -/* Staller: oh yes, let's do this! */ -#define ACE_HAS_BROKEN_MAP_FAILED - -/* Prototypes for both signal() and struct sigaction are consistent. */ -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 - -/* Platform supports operations on directories via struct dirent, - readdir_r, etc. */ -#define ACE_HAS_DIRENT 1 - -/* Compiler supports C++ exception handling */ -// MM-Graz if ! defined inserted, to prevent warnings, because it is already -// defined in config-g++common.h -# if !defined (ACE_HAS_EXCEPTIONS) -#define ACE_HAS_EXCEPTIONS 1 -# endif - -/* Platform supports getpagesize() call (otherwise, ACE_PAGE_SIZE must be - defined, except on Win32) */ -#define ACE_HAS_GETPAGESIZE 1 - -/* Platform supports the getrusage() system call. */ -#define ACE_HAS_GETRUSAGE 1 - -/* Platform has a getrusage () prototype in sys/resource.h that differs from - the one in ace/OS.i. */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 - -/* Denotes that GNU has cstring.h as standard which redefines memchr() */ -#define ACE_HAS_GNU_CSTRING_H - -/* The GPERF utility is compiled for this platform */ -#define ACE_HAS_GPERF 1 - -/* Optimize ACE_Handle_Set::count_bits for select() operations (common case) */ -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1 - -/* Compiler/platform supports idtype_t. */ -#define ACE_HAS_IDTYPE_T 1 - -/* Platform supports IP multicast */ -#define ACE_HAS_IP_MULTICAST 1 - -/* Platform supports thr_keydelete (e.g,. UNIXWARE) */ -#define ACE_HAS_THR_KEYDELETE 1 - -/* Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). */ -#define ACE_HAS_THR_MINSTACK 1 - -/* Platform supports recvmsg and sendmsg */ -#define ACE_HAS_MSG 1 - -/* Platform's select() uses non-const timeval* (only found on Linux right - now) */ -#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 - -/* Uses ctime_r & asctime_r with only two parameters vs. three. */ -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 - -/* Platform is an Intel Pentium microprocessor. */ -/* There is a problem with the gethrtime() because of (apparently) a problem - with the inline assembly instruction. Hopefully there is a way to resolve - that with an improvement to the assembler -*/ -#ifdef ACE_HAS_PENTIUM -#undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -/* Platform contains */ -#define ACE_HAS_POLL 1 - -/* Platform supports POSIX O_NONBLOCK semantics */ -#define ACE_HAS_POSIX_NONBLOCK 1 - -/* Platform supports the POSIX struct timespec type */ -#define ACE_HAS_POSIX_TIME 1 - -/* Platform supports the /proc file system and defines tid_t - in */ -#define ACE_HAS_PROC_FS 1 - -/* Platform supports POSIX Threads */ -#define ACE_HAS_PTHREADS 1 - -/* pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and - PTHREAD_PROCESS_SHARED values */ -#define ACE_HAS_PTHREAD_PROCESS_ENUM 1 - -/* Platform will recurse infinitely on thread exits from TSS cleanup routines - (e.g., AIX) */ -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1 - -/* Platform supports reentrant functions (i.e., all the POSIX *_r - functions). */ -#define ACE_HAS_REENTRANT_FUNCTIONS 1 - -/* Platform has support for multi-byte character support compliant with the - XPG4 Worldwide Portability Interface wide-character classification. */ -#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1 - -/* Platform does not support reentrant netdb functions (getprotobyname_r, - getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). */ -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1 - -/* Platform supports the POSIX regular expression library */ -#define ACE_HAS_REGEX 1 - -/* Platform has special header for select(). */ -#define ACE_HAS_SELECT_H 1 - -/* Platform has a function to set t_errno (e.g., Tandem). */ -#define ACE_HAS_SET_T_ERRNO 1 - -/* Platform supports SVR4 extended signals */ -#define ACE_HAS_SIGINFO_T 1 - -/* Platform/compiler has the sigwait(2) prototype */ -#define ACE_HAS_SIGWAIT 1 - -/* Compiler/platform defines the sig_atomic_t typedef */ -#define ACE_HAS_SIG_ATOMIC_T 1 - -/* Platform supports new BSD inet_addr len field. */ -#define ACE_HAS_SOCKADDR_IN_SIN_LEN 1 - -/* OS/compiler uses size_t * rather than int * for socket lengths */ -#define ACE_HAS_SIZET_SOCKET_LEN 1 - -/* Compiler/platform provides the sys/sockio.h file */ -#define ACE_HAS_SYS_SOCKIO_H 1 - -/* Compiler supports the ssize_t typedef */ -#define ACE_HAS_SSIZE_T 1 - -/* Platform supports UNIX International Threads */ -#define ACE_HAS_STHREADS 1 - -/* Platform has thr_yield() */ -#define ACE_HAS_THR_YIELD 1 - -/* Compiler/platform supports struct strbuf */ -#define ACE_HAS_STRBUF_T 1 - -/* Platform supports STREAMS */ -#define ACE_HAS_STREAMS 1 - -/* Platform supports STREAM pipes */ -#define ACE_HAS_STREAM_PIPES 1 - -/* Compiler/platform supports strerror () */ -#define ACE_HAS_STRERROR 1 - -/* Platform/Compiler supports a String class (e.g., GNU or Win32). */ -#define ACE_HAS_STRING_CLASS 1 - -/* Platform has (which contains bzero() prototype) */ -#define ACE_HAS_STRINGS 1 - -/* Platform/compiler supports void * as second parameter to gettimeofday(). */ -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY 1 - -/* Compiler/platform supports SVR4 dynamic linking semantics */ -#define ACE_HAS_SVR4_DYNAMIC_LINKING 1 - -/* Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... */ -#define ACE_HAS_SVR4_TLI 1 - -/* Compiler/platform contains the file. */ -#define ACE_HAS_SYS_SYSCALL_H 1 - -/* Platform supports system configuration information */ -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO 1 - -/* Platform supports System V IPC (most versions of UNIX, but not Win32) */ -#define ACE_HAS_SYSV_IPC 1 - -/* Platform provides header */ -#define ACE_HAS_SYS_FILIO_H 1 - -/* Platform provides header */ -#define ACE_HAS_SYS_XTI_H 1 - -/* Platform has POSIX terminal interface. */ -#define ACE_HAS_TERMIOS 1 - -/* Platform supports threads */ -#define ACE_HAS_THREADS 1 - -/* Compiler/platform has thread-specific storage */ -#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1 - -/* Platform supports TLI timod STREAMS module */ -#define ACE_HAS_TIMOD_H 1 - -/* Platform supports TLI tiuser header */ -#define ACE_HAS_TIUSER_H 1 - -/* Platform supports TLI. Also see ACE_TLI_TCP_DEVICE. */ -#define ACE_HAS_TLI 1 - -/* Platform provides TLI function prototypes */ -#define ACE_HAS_TLI_PROTOTYPES 1 - -/* Platform supports ualarm() */ -#define ACE_HAS_UALARM 1 - -/* Platform supports ucontext_t (which is used in the extended signal API). */ -#define ACE_HAS_UCONTEXT_T 1 - -/* Platform has header file */ -#define ACE_HAS_UTIME 1 - -/* Platform requires void * for mmap(). */ -#define ACE_HAS_VOIDPTR_MMAP 1 - -/* Platform has XTI (X/Open-standardized superset of TLI). Implies - ACE_HAS_TLI but uses a different header file. */ -#define ACE_HAS_XTI 1 - -/* Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily - mean that the platform does not support iostreams. */ -#define ACE_LACKS_ACE_IOSTREAM 1 - -/* Platform does not have u_longlong_t typedef */ -#define ACE_LACKS_U_LONGLONG_T 1 - -/* Platform lacks madvise() (e.g., Linux) */ -#define ACE_LACKS_MADVISE 1 - -/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */ -#define ACE_LACKS_PRI_T 1 - -/* Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) */ -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 - -/* Platfrom lack pthread_yield() support. */ -#define ACE_LACKS_PTHREAD_YIELD 1 - -/* Platform lacks readers/writer locks. */ -#define ACE_LACKS_RWLOCK_T 1 - -/* MIT pthreads platform lacks the timedwait prototypes */ -#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1 - -/* Platform does not define timepec_t as a typedef for struct timespec. */ -#define ACE_LACKS_TIMESPEC_T 1 - -/* Compile using multi-thread libraries */ -#define ACE_MT_SAFE 1 - -/* Platform needs to #include to get thread scheduling defs. */ -#define ACE_NEEDS_SCHED_H 1 - -/*********************************************************************/ -/* Compiler's template mechanim must see source code (i.e., .cpp files). This - is used for GNU G++. */ -/* Staller -> make 0 */ -// #undef ACE_TEMPLATES_REQUIRE_SOURCE - -/*********************************************************************/ - -/* The OS/platform supports the poll() event demultiplexor */ -#define ACE_USE_POLL 1 - -/* Platform has its standard c++ library in the namespace std. */ -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -/* The number of bytes in a double. */ -#define SIZEOF_DOUBLE 8 - -/* The number of bytes in a float. */ -#define SIZEOF_FLOAT 4 - -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* The number of bytes in a long. */ -#define SIZEOF_LONG 4 - -/* The number of bytes in a long double. */ -#define SIZEOF_LONG_DOUBLE 12 - -/* The number of bytes in a long long. */ -#define SIZEOF_LONG_LONG 8 - -/* The number of bytes in a short. */ -#define SIZEOF_SHORT 2 - -/* The number of bytes in a signed char. */ -#define SIZEOF_SIGNED_CHAR 1 - -/* The number of bytes in a void *. */ -#define SIZEOF_VOID_P 4 - -/* Define if you have the execv function. */ -#define HAVE_EXECV 1 - -/* Define if you have the execve function. */ -#define HAVE_EXECVE 1 - -/* Define if you have the execvp function. */ -#define HAVE_EXECVP 1 - -/* Define if you have the header file. */ -#define HAVE_DIRENT_H 1 - -/* Define if you have the header file. */ -#define HAVE_FSTREAM 1 - -/* Define if you have the header file. */ -#define HAVE_IOMANIP 1 - -/* Define if you have the header file. */ -#define HAVE_IOSTREAM 1 - -/* Define if you have the header file. */ -#define HAVE_PWD_H 1 - -/* Name of package */ -#define PACKAGE "ace" - -/* Added by Staller */ -#define ENUM_BOOLEAN // See file /usr/local/lib/gcc-lib/i486-pc-sysv5/egcs-2.91.60/include/sys/types.h -#define howmany(x, y) (((x)+((y)-1))/(y)) -#define ACE_HAS_BROKEN_T_ERROR // make a nasty warning disappear in OS.i -#define __USLC__ 1 -#define __IOCTL_VERSIONED__ // By Carlo! - -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-unixware-7.1.0.udk.h b/dep/include/ace/config-unixware-7.1.0.udk.h deleted file mode 100644 index fc6006889e9..00000000000 --- a/dep/include/ace/config-unixware-7.1.0.udk.h +++ /dev/null @@ -1,456 +0,0 @@ -/* -*- C++ -*- */ -#ifndef ACE_CONFIG_UNIXWARE_UDK_H -#define ACE_CONFIG_UNIXWARE_UDK_H - -// $Id: config-unixware-7.1.0.udk.h 82267 2008-07-08 16:39:19Z jtc $ - -// Configuration for the unixware UDK compiler. derived from the unixware/g++ config -// which was itself derived from an autoconfig run. - -/* ACE configuration header file */ - -#define ACE_TEMPLATES_REQUIRE_SOURCE - -#ifndef UNIXWARE_7_1 -#define UNIXWARE_7_1 -#endif - -#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#define YYTEXT_POINTER 1 - -/* Define _REENTRANT if reentrant functions should be used. */ -#ifndef _REENTRANT -# define _REENTRANT 1 -#endif - -#define ACE_HAS_NEW_NO_H 1 -#define ACE_HAS_STDEXCEPT_NO_H 1 - -/* - * TODO: These two next #defines have an #undef before them, in - * case the variable being defined already had a value. - * The #undefs are being picked up by configure, and are commented out! - */ -#define ACE_THREAD_MIN_PRIORITY 0 -#if defined (ACE_THREAD_MIN_PRIORITY) -/* # undef PTHREAD_MIN_PRIORITY */ -# define PTHREAD_MIN_PRIORITY ACE_THREAD_MIN_PRIORITY -#endif /* #if defined (ACE_THREAD_MIN_PRIORITY) */ - -#define ACE_THREAD_MAX_PRIORITY 99 -#if defined (ACE_THREAD_MAX_PRIORITY) -/* # undef PTHREAD_MAX_PRIORITY */ -# define PTHREAD_MAX_PRIORITY ACE_THREAD_MAX_PRIORITY -#endif /* #if defined (ACE_THREAD_MAX_PRIORITY) */ - -/* UnixWare specific configuration parameters */ -/* #undef UNIXWARE */ -/* #undef UNIXWARE_2_0 */ -/* #undef UNIXWARE_2_1 */ - -/* Specify sizes of given built-in types. If a size isn't defined here, - then ace/Basic_Types.h will attempt to deduce the size. */ -/* #undef ACE_SIZEOF_CHAR */ -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 4 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_VOID_P 4 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_LONG_DOUBLE 12 - -/* Enable ACE inlining */ -#define __ACE_INLINE__ 1 - -/* Platform supports Asynchronous IO calls */ -/* #define ACE_HAS_AIO_CALLS */ - -/* Specify this if you don't want threads to inherit parent thread's - ACE_Log_Msg properties. */ -/* #undef ACE_THREADS_DONT_INHERIT_LOG_MSG */ - -/* OS has priocntl (2) */ -#define ACE_HAS_PRIOCNTL 1 - -/* Platform has pread() and pwrite() support */ -#define ACE_HAS_P_READ_WRITE 1 - -/* Compiler/platform correctly calls init()/fini() for shared libraries */ -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 - -/* Compiler handles explicit calling of template destructor correctly. - See "ace/OS.h" for details. */ -/* Staller: already defined by config-g++-common.h -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR 1 -*/ - -/* Platform doesn't cast MAP_FAILED to a (void *). */ -/* #undef ACE_HAS_BROKEN_MAP_FAILED */ -/* Staller: oh yes, let's do this! */ -#define ACE_HAS_BROKEN_MAP_FAILED - -/* Prototypes for both signal() and struct sigaction are consistent. */ -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 - -/* Compiler/platform has correctly prototyped header files */ -#define ACE_HAS_CPLUSPLUS_HEADERS - -/* Platform supports operations on directories via struct dirent, - readdir_r, etc. */ -#define ACE_HAS_DIRENT - -/* Compiler supports C++ exception handling */ -# if !defined (ACE_HAS_EXCEPTIONS) -#define ACE_HAS_EXCEPTIONS -# endif - -/* Platform supports getpagesize() call (otherwise, ACE_PAGE_SIZE must be - defined, except on Win32) */ -#define ACE_HAS_GETPAGESIZE - -/* Platform supports the getrusage() system call. */ -#define ACE_HAS_GETRUSAGE - -/* Platform has a getrusage () prototype in sys/resource.h that differs from - the one in ace/OS.i. */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE - -/* The GPERF utility is compiled for this platform */ -#define ACE_HAS_GPERF - -/* Optimize ACE_Handle_Set::count_bits for select() operations (common case) */ -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1 - -/* Compiler/platform supports SunOS high resolution timers */ -/* #undef ACE_HAS_HI_RES_TIMER */ - -/* Compiler/platform supports idtype_t. */ -#define ACE_HAS_IDTYPE_T - -/* Inline all the static class OS methods to remove call overhead */ -/* Note: This gets defined by OS.h if __ACE_INLINE__ is defined */ -/* #undef ACE_HAS_INLINED_OSCALLS */ - -/* Platform supports IP multicast */ -#define ACE_HAS_IP_MULTICAST - -/* Platform supports thr_keydelete (e.g,. UNIXWARE) */ -#define ACE_HAS_THR_KEYDELETE - -/* Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). */ -#define ACE_HAS_THR_MINSTACK - -/* Some files, such as ace/streams.h, want to include new style C++ stream - headers. These headers are iomanip, ios, iostream, istream, ostream, - fstream and streambuf. If _all_ of these headers aren't available, then - assume that only iostream.h and fstream.h are available. */ -/* #define ACE_USES_OLD_IOSTREAMS */ - -/* Platform supports recvmsg and sendmsg */ -#define ACE_HAS_MSG - -/* Platform's select() uses non-const timeval* (only found on Linux right - now) */ -#define ACE_HAS_NONCONST_SELECT_TIMEVAL - -/* Uses ctime_r & asctime_r with only two parameters vs. three. */ -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -/* Platform is an Intel Pentium microprocessor. */ -/* There is a problem with the gethrtime() because of (apparently) a problem - with the inline assembly instruction. Hopefully there is a way to resolve - that with an improvement to the assembler -*/ -#ifdef ACE_HAS_PENTIUM -//#undef ACE_HAS_PENTIUM -#endif /* ACE_HAS_PENTIUM */ - -/* Platform contains */ -#define ACE_HAS_POLL - -/* Platform supports POSIX O_NONBLOCK semantics */ -#define ACE_HAS_POSIX_NONBLOCK - -/* Platform supports the POSIX struct timespec type */ -#define ACE_HAS_POSIX_TIME - -/* Platform supports the /proc file system and defines tid_t - in */ -#define ACE_HAS_PROC_FS - -/* Platform supports POSIX Threads */ -#define ACE_HAS_PTHREADS - -/* pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and - PTHREAD_PROCESS_SHARED values */ -#define ACE_HAS_PTHREAD_PROCESS_ENUM - -/* Platform will recurse infinitely on thread exits from TSS cleanup routines - (e.g., AIX) */ -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS - -/* Platform supports reentrant functions (i.e., all the POSIX *_r - functions). */ -#define ACE_HAS_REENTRANT_FUNCTIONS - -/* Platform has support for multi-byte character support compliant with the - XPG4 Worldwide Portability Interface wide-character classification. */ -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -/* Platform does not support reentrant netdb functions (getprotobyname_r, - getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). */ -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS - -/* Platform supports the POSIX regular expression library */ -#define ACE_HAS_REGEX - -/* Platform has special header for select(). */ -#define ACE_HAS_SELECT_H - -/* Platform has a function to set t_errno (e.g., Tandem). */ -#define ACE_HAS_SET_T_ERRNO - -/* Platform supports SVR4 extended signals */ -#define ACE_HAS_SIGINFO_T - -/* Platform/compiler has the sigwait(2) prototype */ -#define ACE_HAS_SIGWAIT - -/* Compiler/platform defines the sig_atomic_t typedef */ -#define ACE_HAS_SIG_ATOMIC_T - -/* Platform supports new BSD inet_addr len field. */ -#define ACE_HAS_SOCKADDR_IN_SIN_LEN - -/* OS/compiler uses size_t * rather than int * for socket lengths */ -#define ACE_HAS_SIZET_SOCKET_LEN - -/* Compiler/platform provides the sys/sockio.h file */ -#define ACE_HAS_SYS_SOCKIO_H - -/* Compiler supports the ssize_t typedef */ -#define ACE_HAS_SSIZE_T - -/* Platform supports UNIX International Threads */ -#define ACE_HAS_STHREADS - -/* Platform has thr_yield() */ -#define ACE_HAS_THR_YIELD - -/* Platform/compiler supports Standard C++ Library */ -/* It seems that UDK provides std-like declarations for only portions - such as -*/ -#define ACE_HAS_STANDARD_CPP_LIBRARY 0 - -/* Compiler/platform supports struct strbuf */ -#define ACE_HAS_STRBUF_T - -/* Platform supports STREAMS */ -#define ACE_HAS_STREAMS - -/* Platform supports STREAM pipes */ -#define ACE_HAS_STREAM_PIPES - -/* Compiler/platform supports strerror () */ -#define ACE_HAS_STRERROR - -/* Platform/Compiler supports a String class (e.g., GNU or Win32). */ -#define ACE_HAS_STRING_CLASS - -/* Platform has (which contains bzero() prototype) */ -#define ACE_HAS_STRINGS - -/* Platform/compiler supports void * as second parameter to gettimeofday(). */ -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY - -/* Compiler/platform supports SVR4 dynamic linking semantics */ -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -/* Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... */ -#define ACE_HAS_SVR4_TLI - -/* Compiler/platform contains the file. */ -#define ACE_HAS_SYS_SYSCALL_H - -/* Platform supports system configuration information */ -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO 1 - -/* Platform supports System V IPC (most versions of UNIX, but not Win32) */ -#define ACE_HAS_SYSV_IPC 1 - -/* Platform provides header */ -#define ACE_HAS_SYS_FILIO_H 1 - -/* Platform provides header */ -#define ACE_HAS_SYS_XTI_H 1 - -/* Compiler implements templates that support typedefs inside of classes used - as formal arguments to a template class. */ -#define ACE_HAS_TEMPLATE_TYPEDEFS 1 - -/* Platform has POSIX terminal interface. */ -#define ACE_HAS_TERMIOS 1 - -/* Platform supports threads */ -#define ACE_HAS_THREADS 1 - -/* Compiler/platform has thread-specific storage */ -#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1 - -/* Platform supports TLI timod STREAMS module */ -#define ACE_HAS_TIMOD_H 1 - -/* Platform supports TLI tiuser header */ -#define ACE_HAS_TIUSER_H 1 - -/* Platform supports TLI. Also see ACE_TLI_TCP_DEVICE. */ -#define ACE_HAS_TLI 1 - -/* Platform provides TLI function prototypes */ -#define ACE_HAS_TLI_PROTOTYPES 1 - -/* Platform supports ualarm() */ -#define ACE_HAS_UALARM 1 - -/* Platform supports ucontext_t (which is used in the extended signal API). */ -#define ACE_HAS_UCONTEXT_T 1 - -/* Platform has header file */ -#define ACE_HAS_UTIME 1 - -/* Prints out console message in ACE_NOTSUP. Useful for tracking down origin - of ACE_NOTSUP. */ -/* #undef ACE_HAS_VERBOSE_NOTSUP */ - -/* Platform requires void * for mmap(). */ -#define ACE_HAS_VOIDPTR_MMAP 1 - -/* Platform has XTI (X/Open-standardized superset of TLI). Implies - ACE_HAS_TLI but uses a different header file. */ -#define ACE_HAS_XTI 1 - -/* Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily - mean that the platform does not support iostreams. */ -#define ACE_LACKS_ACE_IOSTREAM 1 - -/* Platform does not have u_longlong_t typedef */ -#define ACE_LACKS_U_LONGLONG_T 1 - -/* Platform lacks madvise() (e.g., Linux) */ -#define ACE_LACKS_MADVISE 1 - -/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */ -#define ACE_LACKS_PRI_T 1 - -/* Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) */ -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 - -/* Platfrom lack pthread_yield() support. */ -#define ACE_LACKS_PTHREAD_YIELD 1 - -/* Platform lacks readers/writer locks. */ -#define ACE_LACKS_RWLOCK_T 1 - -/* MIT pthreads platform lacks the timedwait prototypes */ -#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1 - -/* Platform does not define timepec_t as a typedef for struct timespec. */ -#define ACE_LACKS_TIMESPEC_T 1 - -/* Compile using multi-thread libraries */ -#define ACE_MT_SAFE 1 - -/* Platform needs to #include to get thread scheduling defs. */ -#define ACE_NEEDS_SCHED_H 1 - -/* The OS/platform supports the poll() event demultiplexor */ -#define ACE_USE_POLL 1 - -/* Platform has its standard c++ library in the namespace std. */ -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -/* The number of bytes in a double. */ -#define SIZEOF_DOUBLE 8 - -/* The number of bytes in a float. */ -#define SIZEOF_FLOAT 4 - -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* The number of bytes in a long. */ -#define SIZEOF_LONG 4 - -/* The number of bytes in a long double. */ -#define SIZEOF_LONG_DOUBLE 12 - -/* The number of bytes in a long long. */ -#define SIZEOF_LONG_LONG 8 - -/* The number of bytes in a short. */ -#define SIZEOF_SHORT 2 - -/* The number of bytes in a signed char. */ -#define SIZEOF_SIGNED_CHAR 1 - -/* The number of bytes in a void *. */ -#define SIZEOF_VOID_P 4 - -/* Define if you have the execv function. */ -#define HAVE_EXECV 1 - -/* Define if you have the execve function. */ -#define HAVE_EXECVE 1 - -/* Define if you have the execvp function. */ -#define HAVE_EXECVP 1 - -/* Define if you have the header file. */ -#define HAVE_DIRENT_H 1 - -/* Define if you have the header file. */ -#define HAVE_FSTREAM 1 - -/* Define if you have the header file. */ -#define HAVE_IOMANIP 1 - -/* Define if you have the header file. */ -#define HAVE_IOSTREAM 1 - -/* Define if you have the header file. */ -#define HAVE_PWD_H 1 - -/* Name of package */ -#define PACKAGE "ace" - -/* Version number of package */ -#define VERSION "4.6.37" - -/* Added by Staller */ -#define ENUM_BOOLEAN // See file /usr/local/lib/gcc-lib/i486-pc-sysv5/egcs-2.91.60/include/sys/types.h -/* Hat nix gebracht -#define ACE_DEFAULT_SELECT_REACTOR_SIZE 256 // this is like in linux config fileto avoid another error -*/ -#define howmany(x, y) (((x)+((y)-1))/(y)) -#define ACE_HAS_BROKEN_T_ERROR // let disappear a nasty warning from OS.i -#if !defined (__USLC__) -# define __USLC__ 1 -#endif - -#define __IOCTL_VERSIONED__ // By Carlo! -#endif /* ACE_UNIXWARE_UDK_H */ - diff --git a/dep/include/ace/config-visualage.h b/dep/include/ace/config-visualage.h deleted file mode 100644 index 6d967b52217..00000000000 --- a/dep/include/ace/config-visualage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-visualage.h 80826 2008-03-04 14:51:23Z wotte $ - -// This configuration file automatically includes the proper -// configurations for IBM's VisualAge C++ compiler on Win32 and AIX. - -#ifndef CONFIG_VISUALAGE_H -#define CONFIG_VISUALAGE_H -#include /**/ "ace/pre.h" - -#ifdef __TOS_WIN__ - #include "ace/config-win32.h" -#elif __TOS_AIX__ - #include "ace/config-aix-4.x.h" -#else - #include "PLATFORM NOT SPECIFIED" -#endif /* __TOS_WIN__ */ - -#include /**/ "ace/post.h" -#endif //CONFIG_VISUALAGE_H - diff --git a/dep/include/ace/config-vxworks.h b/dep/include/ace/config-vxworks.h deleted file mode 100644 index 52c2958654d..00000000000 --- a/dep/include/ace/config-vxworks.h +++ /dev/null @@ -1,56 +0,0 @@ -//* -*- C++ -*- */ -// $Id: config-vxworks.h 81046 2008-03-21 10:11:12Z johnnyw $ - -// The following configuration file is designed to work for VxWorks -// Based on ACE_VXWORKS it will select the correct config file - -#ifndef ACE_CONFIG_VXWORKS_H -#define ACE_CONFIG_VXWORKS_H -#include /**/ "ace/pre.h" - -// If ACE_VXWORKS is not defined try to figure out the VxWorks version -#if !defined (ACE_VXWORKS) -# include "vxWorks.h" -# if !defined (_WRS_VXWORKS_MAJOR) && !defined (_WRS_VXWORKS_MINOR) -# error You must define ACE_VXWORKS -# else -# if (_WRS_VXWORKS_MAJOR == 6) -# if (_WRS_VXWORKS_MINOR == 0) -# define ACE_VXWORKS 0x600 -# elif (_WRS_VXWORKS_MINOR == 1) -# define ACE_VXWORKS 0x610 -# elif (_WRS_VXWORKS_MINOR == 2) -# define ACE_VXWORKS 0x620 -# elif (_WRS_VXWORKS_MINOR == 3) -# define ACE_VXWORKS 0x630 -# elif (_WRS_VXWORKS_MINOR == 4) -# define ACE_VXWORKS 0x640 -# elif (_WRS_VXWORKS_MINOR == 5) -# define ACE_VXWORKS 0x650 -# elif (_WRS_VXWORKS_MINOR == 6) -# define ACE_VXWORKS 0x660 -# endif -# endif -# endif -#endif /* ! ACE_VXWORKS */ - -#if (ACE_VXWORKS == 0x551) -# include "ace/config-vxworks5.x.h" -#elif (ACE_VXWORKS == 0x620) -# include "ace/config-vxworks6.2.h" -#elif (ACE_VXWORKS == 0x630) -# include "ace/config-vxworks6.3.h" -#elif (ACE_VXWORKS == 0x640) -# include "ace/config-vxworks6.4.h" -#elif (ACE_VXWORKS == 0x650) -# include "ace/config-vxworks6.5.h" -#elif (ACE_VXWORKS == 0x660) -# include "ace/config-vxworks6.6.h" -#else -#error Unknown VxWorks version -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_H */ - - diff --git a/dep/include/ace/config-vxworks5.x.h b/dep/include/ace/config-vxworks5.x.h deleted file mode 100644 index eeb22490090..00000000000 --- a/dep/include/ace/config-vxworks5.x.h +++ /dev/null @@ -1,346 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks5.x.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 5.5.x platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with Tornado 2.2 or newer. -// 2) The Green Hills 1.8.8 and newer 1.8.9 compilers (not tested -// already for a long time) -// 3) The WindRiver Compiler (formerly known as Diab) - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x551 -#endif /* ! ACE_VXWORKS */ - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX - -# if !defined (ACE_MAIN) -# define ACE_MAIN ace_main -# endif /* ! ACE_MAIN */ - -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if (__GNUC__ == 2) -# define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 -# endif - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) - // GNU 3.3+ toolchain supports long long types but fails to define this so STL - // skips some definitions -# if !defined (_GLIBCPP_USE_LONG_LONG) -# define _GLIBCPP_USE_LONG_LONG -# endif -# endif /* (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) */ - -#elif defined (ghs) - // Processor type, if necessary. Green Hills defines "ppc". -# if defined (ppc) -# define ACE_HAS_POWERPC_TIMER -# define ACE_LACKS_CLEARERR -# endif /* ppc */ - -# define ACE_CONFIG_INCLUDE_GHS_COMMON -# include "ace/config-ghs-common.h" - -# define ACE_LACKS_UNISTD_H -# define ACE_LACKS_IOSTREAM_TOTALLY - -// Short-circuit the include of -// Green Hills has a problem with multiply defined functions -// with different parameters. -# define __INCineth - -#elif defined (__DCPLUSPLUS__) || defined (__DCC__) - // Diab 4.2a or later. -# if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -# endif /* ! ACE_LACKS_PRAGMA_ONCE */ - - // Diab doesn't support VxWorks' iostream libraries. -# define ACE_LACKS_IOSTREAM_TOTALLY -# define ACE_LACKS_ACE_IOSTREAM - -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 0 - -# define ACE_TEMPLATES_REQUIRE_SOURCE - -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R -#define ACE_MKDIR_LACKS_MODE -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_STAT -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_CHDIR -#define ACE_HAS_NONCONST_UNLINK -#define ACE_HAS_NONCONST_OPENDIR -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_IOCTL_INT_3_PARAM -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRDUP_EMULATION -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_ACCESS -#define ACE_LACKS_EXEC -#define ACE_LACKS_FCNTL -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_FSYNC -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETOPT -#define ACE_LACKS_GETPID -#define ACE_LACKS_GETPPID -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_KEY_T -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_NUMERIC_LIMITS -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETHOSTBYADDR -#define ACE_LACKS_GETHOSTBYNAME -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_SYSCONF -#define ACE_LACKS_SYS_SYSCTL_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_UMASK -#define ACE_LACKS_UTSNAME_T -#define ACE_LACKS_UNAME -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_VSNPRINTF -#define ACE_LACKS_WAIT -#define ACE_LACKS_WAITPID -#define ACE_LACKS_DUP2 -#define ACE_LACKS_DUP -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_INTPTR_T -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -#endif /* ! ACE_VXWORKS_SPARE */ - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_SETGID -#define ACE_LACKS_GETPGID - -#define ACE_LACKS_PIPE -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_INTTYPES_H -#define ACE_LACKS_UNISTD_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_TIME_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_WCHAR_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SEARCH_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_WCTYPE_H - -// Not sure if these should always be defined. -#define ACE_LACKS_SYS_UN_H - -// Some string things -#define ACE_LACKS_WCSCAT -#define ACE_LACKS_WCSCHR -#define ACE_LACKS_WCSCMP -#define ACE_LACKS_WCSCPY -#define ACE_LACKS_WCSCSPN -#define ACE_LACKS_WCSLEN -#define ACE_LACKS_WCSNCAT -#define ACE_LACKS_WCSNCMP -#define ACE_LACKS_WCSNCPY -#define ACE_LACKS_WCSPBRK -#define ACE_LACKS_WCSRCHR -#define ACE_LACKS_WCSSPN -#define ACE_LACKS_WCSSTR -#define ACE_LACKS_WCSTOK -#define ACE_LACKS_TOWLOWER -#define ACE_LACKS_TOWUPPER -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSTOD -#define ACE_LACKS_WCSTOL -#define ACE_LACKS_WCSTOUL -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_LACKS_SYMLINKS -#define ACE_LACKS_FGETWC -#define ACE_LACKS_FGETWS -#define ACE_LACKS_FPUTWS - -#if defined (ACE_HAS_VXWORKS551_PID) || (ACE_HAS_VXWORKS551_PCD) || (ACE_HAS_VXWORKS551_PNE) -# define ACE_HAS_VXWORKS551_MEDUSA -#endif - -#if defined (ACE_HAS_VXWORKS551_MEDUSA) -# define ACE_HAS_GETIFADDRS -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_LACKS_CONDATTR_PSHARED -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_HAS_VXTHREADS -# define ACE_LACKS_PTHREAD_H -# define ACE_LACKS_COND_T -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -// VxWorks does not have the pthread_mutex_timedlock operation, but there is -// an emulation for this when not using the pthread mapping -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_HAS_TSS_EMULATION -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) -// If running an Intel Pentium the -// ACE_OS::gethrtime () can use the RDTSC instruction. -# define ACE_HAS_PENTIUM -#endif - -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 -# define ACE_LACKS_LOG2 -# endif -# endif - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-vxworks6.2.h b/dep/include/ace/config-vxworks6.2.h deleted file mode 100644 index f7978b0036e..00000000000 --- a/dep/include/ace/config-vxworks6.2.h +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks6.2.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 6.2 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.2 - -#ifndef ACE_CONFIG_VXWORKS_6_2_H -#define ACE_CONFIG_VXWORKS_6_2_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x620 -#endif /* ! ACE_VXWORKS */ - -#if defined __RTP__ - // Fix wrong typedef in unistd.h (unsigned short) - #define _SUSECONDS_T - typedef long suseconds_t; -#endif -#include - -// Fix for including right typedef for pid_t in VxTypes.h (int) -#include - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if defined (__RTP__) && !defined (_HAS_C9X) -// Workaround for the fact that under RTP the log2 method can't be used -// without this define set, see TSR560446 -# if !defined (_C99) -# define _C99 -# endif -# endif - -#elif defined (__DCPLUSPLUS__) || defined (__DCC__) - // Diab 4.2a or later. -# if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -# endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_TEMPLATES_REQUIRE_SOURCE - -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -#if !defined __RTP__ -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 in kernel mode -# define ACE_LACKS_LOG2 -# endif -# endif -#endif - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_NONCONST_READV -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_IOCTL_INT_3_PARAM -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_HAS_SYSCTL -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_EXEC -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_KEY_T -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_PIPE -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_UMASK -#define ACE_LACKS_STRPTIME -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -#endif /* ! ACE_VXWORKS_SPARE */ -#define ACE_HAS_GETIFADDRS - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_SETGID - -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_FCNTL - -// Some string things -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_LACKS_SYMLINKS - -#if defined __RTP__ - // We are building for RTP mode - #if !defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_SVR4_DYNAMIC_LINKING - #endif - #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_REGEX_H - #define ACE_LACKS_PUTENV - #define ACE_HAS_SETENV - #define ACE_HAS_3_PARAM_WCSTOK - #define ACE_HAS_WCHAR - #define ACE_HAS_VFWPRINTF - #define ACE_SIZEOF_WCHAR 2 -#else - // We are building for kernel mode - #define ACE_LACKS_INTPTR_T - #define ACE_LACKS_SUSECONDS_T - #define ACE_LACKS_INTTYPES_H - #define ACE_LACKS_STDINT_H - #define ACE_LACKS_UNAME - #define ACE_LACKS_UTSNAME_T - #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS - #define ACE_LACKS_DLFCN_H - #define ACE_LACKS_WAIT - #define ACE_LACKS_WAITPID - #define ACE_LACKS_SYS_TIME_H - #define ACE_LACKS_SYS_SELECT_H - #define ACE_LACKS_STRINGS_H - #define ACE_MKDIR_LACKS_MODE - #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_SEARCH_H - #define ACE_LACKS_SYSCONF - #define ACE_LACKS_GETPID - #define ACE_LACKS_GETPPID - #define ACE_LACKS_WCHAR_H - #define ACE_LACKS_WCTYPE_H - #define ACE_LACKS_WCSCAT - #define ACE_LACKS_WCSCHR - #define ACE_LACKS_WCSCMP - #define ACE_LACKS_WCSCPY - #define ACE_LACKS_WCSCSPN - #define ACE_LACKS_WCSLEN - #define ACE_LACKS_WCSNCAT - #define ACE_LACKS_WCSNCMP - #define ACE_LACKS_WCSNCPY - #define ACE_LACKS_WCSPBRK - #define ACE_LACKS_WCSRCHR - #define ACE_LACKS_WCSSPN - #define ACE_LACKS_WCSSTR - #define ACE_LACKS_WCSTOK - #define ACE_LACKS_TOWLOWER - #define ACE_LACKS_TOWUPPER - #define ACE_LACKS_WCSTOD - #define ACE_LACKS_WCSTOL - #define ACE_LACKS_WCSTOUL - #define ACE_LACKS_FGETWC - #define ACE_LACKS_FGETWS - #define ACE_LACKS_FPUTWS - #if !defined (ACE_MAIN) - # define ACE_MAIN ace_main - #endif /* ! ACE_MAIN */ -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_CONDATTR_PSHARED -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_LACKS_PTHREAD_H -# define ACE_HAS_VXTHREADS -# if !defined __RTP__ -// Only when building for kernel mode we can use TSS emulation, in rtp mode -// we can't use the WIND_TCB struct anymore -# define ACE_HAS_TSS_EMULATION -# endif -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_LACKS_COND_T -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) -// If running an Intel Pentium the -// ACE_OS::gethrtime () can use the RDTSC instruction. -# define ACE_HAS_PENTIUM -#endif - -// VxWorks defines the CPU define MAP, undef it to prevent problems with -// application code -#if defined (MAP) -#undef MAP -#endif /* MAP */ - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#if defined (ACE_HAS_IP_MULTICAST) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_HAS_IP_MULTICAST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_2_H */ - diff --git a/dep/include/ace/config-vxworks6.3.h b/dep/include/ace/config-vxworks6.3.h deleted file mode 100644 index fe90626e3dc..00000000000 --- a/dep/include/ace/config-vxworks6.3.h +++ /dev/null @@ -1,318 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks6.3.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 6.3 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.3 - -#ifndef ACE_CONFIG_VXWORKS_6_3_H -#define ACE_CONFIG_VXWORKS_6_3_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x630 -#endif /* ! ACE_VXWORKS */ - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if defined (__RTP__) && !defined (_HAS_C9X) -// Workaround for the fact that under RTP the log2 method can't be used -// without this define set, see TSR560446 -# if !defined (_C99) -# define _C99 -# endif -# endif - -#elif defined (__DCC__) -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_TEMPLATES_REQUIRE_SOURCE -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -#if !defined __RTP__ -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 in kernel mode -# define ACE_LACKS_LOG2 -# endif -# endif -#endif - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_SWAB -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_HAS_SYSCTL -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_EXEC -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETIPNODEBYADDR -#define ACE_LACKS_GETIPNODEBYNAME_IPV6 -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_PIPE -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_UMASK -#define ACE_LACKS_STRPTIME -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_GETIFADDRS - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_SETGID - -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_FCNTL - -// Some string things -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_LACKS_SYMLINKS - -#if defined __RTP__ - // We are building for RTP mode - #if !defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_SVR4_DYNAMIC_LINKING - #endif - #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_REGEX_H - #define ACE_LACKS_PUTENV - #define ACE_HAS_SETENV - #define ACE_HAS_3_PARAM_WCSTOK - #define ACE_HAS_WCHAR - #define ACE_HAS_VFWPRINTF - #define ACE_SIZEOF_WCHAR 2 - #define ACE_HAS_SHM_OPEN - #if defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_AIO_CALLS - #endif - #define ACE_LACKS_STRCASECMP - // VxWorks seems to either not define this or define as zero up till now - #if !defined (IOV_MAX) || (IOV_MAX == 0) - #define ACE_IOV_MAX 16 - #endif -#else - // We are building for kernel mode - #define ACE_LACKS_SUSECONDS_T - #define ACE_LACKS_INTPTR_T - #define ACE_LACKS_INTTYPES_H - #define ACE_LACKS_STDINT_H - #define ACE_LACKS_UNAME - #define ACE_LACKS_UTSNAME_T - #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS - #define ACE_LACKS_DLFCN_H - #define ACE_LACKS_WAIT - #define ACE_LACKS_WAITPID - #define ACE_LACKS_SYS_TIME_H - #define ACE_LACKS_SYS_SELECT_H - #define ACE_MKDIR_LACKS_MODE - #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_SEARCH_H - #define ACE_LACKS_SYSCONF - #define ACE_LACKS_GETPID - #define ACE_LACKS_GETPPID - #define ACE_LACKS_WCHAR_H - #define ACE_LACKS_WCTYPE_H - #define ACE_LACKS_WCSCAT - #define ACE_LACKS_WCSCHR - #define ACE_LACKS_WCSCMP - #define ACE_LACKS_WCSCPY - #define ACE_LACKS_WCSCSPN - #define ACE_LACKS_WCSLEN - #define ACE_LACKS_WCSNCAT - #define ACE_LACKS_WCSNCMP - #define ACE_LACKS_WCSNCPY - #define ACE_LACKS_WCSPBRK - #define ACE_LACKS_WCSRCHR - #define ACE_LACKS_WCSSPN - #define ACE_LACKS_WCSSTR - #define ACE_LACKS_WCSTOK - #define ACE_LACKS_TOWLOWER - #define ACE_LACKS_TOWUPPER - #define ACE_LACKS_WCSTOD - #define ACE_LACKS_WCSTOL - #define ACE_LACKS_WCSTOUL - #define ACE_LACKS_FGETWC - #define ACE_LACKS_FGETWS - #define ACE_LACKS_FPUTWS - #define ACE_HAS_IOCTL_INT_3_PARAM - #define ACE_LACKS_MMAP - #define ACE_LACKS_MSYNC - #define ACE_LACKS_MPROTECT - #if !defined (ACE_MAIN) - # define ACE_MAIN ace_main - #endif /* ! ACE_MAIN */ -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_CONDATTR_PSHARED -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_LACKS_PTHREAD_H -# define ACE_HAS_VXTHREADS -# if !defined __RTP__ -// Only when building for kernel mode we can use TSS emulation, in rtp mode -// we can't use the WIND_TCB struct anymore -# define ACE_HAS_TSS_EMULATION -# if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -# endif /* ! ACE_VXWORKS_SPARE */ -# endif -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_LACKS_COND_T -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if defined (CPU) && (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) - // If running an Intel Pentium the - // ACE_OS::gethrtime () can use the RDTSC instruction. - # define ACE_HAS_PENTIUM -#endif - -// VxWorks defines the CPU define MAP, undef it to prevent problems with -// application code -#if defined (MAP) -#undef MAP -#endif /* MAP */ - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#if defined (ACE_HAS_IP_MULTICAST) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_HAS_IP_MULTICAST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_3_H */ - diff --git a/dep/include/ace/config-vxworks6.4.h b/dep/include/ace/config-vxworks6.4.h deleted file mode 100644 index 80c28ab624c..00000000000 --- a/dep/include/ace/config-vxworks6.4.h +++ /dev/null @@ -1,341 +0,0 @@ -//* -*- C++ -*- */ -// $Id: config-vxworks6.4.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 6.4 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.4 -// 2) The Diab compiler that is shipped with VxWorks 6.4 - -#ifndef ACE_CONFIG_VXWORKS_6_4_H -#define ACE_CONFIG_VXWORKS_6_4_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x640 -#endif /* ! ACE_VXWORKS */ - -#if !defined (__RTP__) - // Fix for wrong typedef of time_t in kernel mode - #ifndef _TIME_T - #define _TIME_T - typedef long time_t; - #endif -#endif - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if defined (__RTP__) && !defined (_HAS_C9X) -// Workaround for the fact that under RTP the log2 method can't be used -// without this define set, see TSR560446 -# if !defined (_C99) -# define _C99 -# endif -# endif - -#elif defined (__DCC__) -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_TEMPLATES_REQUIRE_SOURCE -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if defined __RTP__ - #if defined (_VX_CPU) && (_VX_CPU == _VX_PENTIUM || _VX_CPU == _VX_PENTIUM2 || _VX_CPU == _VX_PENTIUM3 || _VX_CPU == _VX_PENTIUM4) - // If running an Intel Pentium the - // ACE_OS::gethrtime () can use the RDTSC instruction. - # define ACE_HAS_PENTIUM - #endif -#else - #if defined (CPU) && (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) - // If running an Intel Pentium the - // ACE_OS::gethrtime () can use the RDTSC instruction. - # define ACE_HAS_PENTIUM - #endif -#endif - -#if !defined __RTP__ -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 in kernel mode -# define ACE_LACKS_LOG2 -# endif -# endif -#endif - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_3_PARAM_READDIR_R -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_SWAB -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_HAS_SYSCTL -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_EXEC -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETIPNODEBYADDR -#define ACE_LACKS_GETIPNODEBYNAME_IPV6 -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_PIPE -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_UMASK -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_TEMPNAM -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_GETIFADDRS - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_SETGID - -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_FCNTL - -// Some string things -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_LACKS_SYMLINKS - -#if defined __RTP__ - // We are building for RTP mode - #if !defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_SVR4_DYNAMIC_LINKING - #endif - #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_REGEX_H - #if defined ACE_HAS_PENTIUM - // Bug to workaround VxWorks 6.4 x86 - # define ACE_LACKS_PUTENV - #endif - #define ACE_HAS_SETENV - #define ACE_LACKS_STRCASECMP - #define ACE_HAS_3_PARAM_WCSTOK - #define ACE_HAS_WCHAR - #define ACE_HAS_VFWPRINTF - #define ACE_SIZEOF_WCHAR 2 - #define ACE_HAS_SHM_OPEN - #if defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_AIO_CALLS - #endif - // VxWorks seems to either not define this or define as zero up till now - #if !defined (IOV_MAX) || (IOV_MAX == 0) - #define ACE_IOV_MAX 16 - #endif -#else - // We are building for kernel mode - #define ACE_LACKS_SUSECONDS_T - #define ACE_LACKS_INTPTR_T - #define ACE_LACKS_INTTYPES_H - #define ACE_LACKS_STDINT_H - #define ACE_LACKS_UNAME - #define ACE_LACKS_UTSNAME_T - #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS - #define ACE_LACKS_DLFCN_H - #define ACE_LACKS_WAIT - #define ACE_LACKS_WAITPID - #define ACE_LACKS_SYS_TIME_H - #define ACE_LACKS_SYS_SELECT_H - #define ACE_MKDIR_LACKS_MODE - #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_SEARCH_H - #define ACE_LACKS_SYSCONF - #define ACE_LACKS_GETPPID - #define ACE_LACKS_WCHAR_H - #define ACE_LACKS_WCTYPE_H - #define ACE_LACKS_WCSCAT - #define ACE_LACKS_WCSCHR - #define ACE_LACKS_WCSCMP - #define ACE_LACKS_WCSCPY - #define ACE_LACKS_WCSCSPN - #define ACE_LACKS_WCSLEN - #define ACE_LACKS_WCSNCAT - #define ACE_LACKS_WCSNCMP - #define ACE_LACKS_WCSNCPY - #define ACE_LACKS_WCSPBRK - #define ACE_LACKS_WCSRCHR - #define ACE_LACKS_WCSSPN - #define ACE_LACKS_WCSSTR - #define ACE_LACKS_WCSTOK - #define ACE_LACKS_TOWLOWER - #define ACE_LACKS_TOWUPPER - #define ACE_LACKS_WCSTOD - #define ACE_LACKS_WCSTOL - #define ACE_LACKS_WCSTOUL - #define ACE_LACKS_FGETWC - #define ACE_LACKS_FGETWS - #define ACE_LACKS_FPUTWS - #define ACE_HAS_IOCTL_INT_3_PARAM - #define ACE_LACKS_MMAP - #define ACE_LACKS_MSYNC - #define ACE_LACKS_MPROTECT - #if !defined (ACE_MAIN) - # define ACE_MAIN ace_main - #endif /* ! ACE_MAIN */ -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# if !defined __RTP__ -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK -# endif -# define ACE_HAS_PTHREAD_ATTR_SETNAME -# define ACE_HAS_POSIX_SEM -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_CONDATTR_PSHARED -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_LACKS_PTHREAD_H -# define ACE_HAS_VXTHREADS -# if !defined __RTP__ -// Only when building for kernel mode we can use TSS emulation, in rtp mode -// we can't use the WIND_TCB struct anymore -# define ACE_HAS_TSS_EMULATION -# if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -# endif /* ! ACE_VXWORKS_SPARE */ -# endif -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_LACKS_COND_T -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// VxWorks defines the CPU define MAP, undef it to prevent problems with -// application code -#if defined (MAP) -#undef MAP -#endif /* MAP */ - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#if defined (ACE_HAS_IP_MULTICAST) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_HAS_IP_MULTICAST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_4_H */ - diff --git a/dep/include/ace/config-vxworks6.5.h b/dep/include/ace/config-vxworks6.5.h deleted file mode 100644 index d40f695774c..00000000000 --- a/dep/include/ace/config-vxworks6.5.h +++ /dev/null @@ -1,26 +0,0 @@ -//* -*- C++ -*- */ -// $Id: config-vxworks6.5.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for VxWorks -// 6.5 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.5 -// 2) The Diab compiler that is shipped with VxWorks 6.5 - -#ifndef ACE_CONFIG_VXWORKS_6_5_H -#define ACE_CONFIG_VXWORKS_6_5_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x650 -#endif /* ! ACE_VXWORKS */ - -#include "ace/config-vxworks6.4.h" - -#if defined (__RTP__) -# undef ACE_HAS_GETIFADDRS -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_5_H */ - - diff --git a/dep/include/ace/config-vxworks6.6.h b/dep/include/ace/config-vxworks6.6.h deleted file mode 100644 index a2058aa51c3..00000000000 --- a/dep/include/ace/config-vxworks6.6.h +++ /dev/null @@ -1,30 +0,0 @@ -//* -*- C++ -*- */ -// $Id: config-vxworks6.6.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for VxWorks -// 6.6 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.6 -// 2) The Diab compiler that is shipped with VxWorks 6.6 - -#ifndef ACE_CONFIG_VXWORKS_6_6_H -#define ACE_CONFIG_VXWORKS_6_6_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x660 -#endif /* ! ACE_VXWORKS */ - -#include "ace/config-vxworks6.5.h" - -#if defined (ACE_HAS_PENTIUM) -# define ACE_LACKS_LOG2 -#endif - -#if !defined (__RTP__) -# undef ACE_HAS_IOCTL_INT_3_PARAM -#endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_6_H */ - - diff --git a/dep/include/ace/config-win32-borland.h b/dep/include/ace/config-win32-borland.h deleted file mode 100644 index 371919cfdc4..00000000000 --- a/dep/include/ace/config-win32-borland.h +++ /dev/null @@ -1,126 +0,0 @@ -// -*- C++ -*- -//$Id: config-win32-borland.h 82643 2008-08-19 14:02:12Z johnnyw $ - -// The following configuration file contains defines for Borland compilers. - -#ifndef ACE_CONFIG_WIN32_BORLAND_H -#define ACE_CONFIG_WIN32_BORLAND_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#include "config-borland-common.h" - -// Automatically define WIN32 macro if the compiler tells us it is our -// target platform. -# if defined (__WIN32__) && !defined (WIN32) -# define WIN32 1 -# endif - -// When building a VCL application, the main VCL header file should be -// included before anything else. You can define ACE_HAS_VCL=1 in your -// project settings to have this file included for you automatically. -# if defined (ACE_HAS_VCL) && (ACE_HAS_VCL != 0) -# include /**/ -# endif - -# define ACE_CC_PREPROCESSOR "CPP32.EXE" - -# include "ace/config-win32-common.h" - -// Borland on win32 has swab -# undef ACE_LACKS_SWAB - -# define ACE_WSTRING_HAS_USHORT_SUPPORT 1 -# define ACE_HAS_DIRENT - -#ifdef ACE_USES_STD_NAMESPACE_FOR_STDC_LIB -#undef ACE_USES_STD_NAMESPACE_FOR_STDC_LIB -#define ACE_USES_STD_NAMESPACE_FOR_STDC_LIB 1 -#endif - -#define ACE_NEEDS_DL_UNDERSCORE - -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_LACKS_REGEX_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_INTTYPES_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_TIME_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_SYS_MMAN_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_SOCKET_H -#define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_NETDB_H -#define ACE_LACKS_NET_IF_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_SYS_IOCTL_H -#define ACE_LACKS_STROPTS_H - -#undef ACE_LACKS_STRUCT_DIR -#undef ACE_LACKS_CLOSEDIR -#undef ACE_LACKS_OPENDIR -#undef ACE_LACKS_READDIR -#undef ACE_LACKS_REWINDDIR - -#define ACE_HAS_WOPENDIR -#define ACE_HAS_WCLOSEDIR -#define ACE_HAS_WREADDIR -#define ACE_HAS_WREWINDDIR - -#define ACE_LACKS_STRRECVFD -#define ACE_USES_EXPLICIT_STD_NAMESPACE - -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -// must have _MT defined to include multithreading -// features from win32 headers -# if !defined(__MT__) -// *** DO NOT *** defeat this error message by defining __MT__ yourself. -// You must link with the multi threaded libraries. Add -tWM to your -// compiler options -# error You must link against multi-threaded libraries when using ACE (check your project settings) -# endif /* !_MT && !ACE_HAS_WINCE */ -#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ - -#if (__BORLANDC__ < 0x580) -# define ACE_LACKS_INTPTR_T -# define ACE_HAS_NONCONST_SWAB -# define ACE_HAS_NONCONST_FDOPEN -#endif - -#if (__BORLANDC__ < 0x610) -# define ACE_HAS_NONCONST_TEMPNAM -# define ACE_LACKS_STRTOULL -# define ACE_LACKS_WCSTOULL -#endif - -#if (__BORLANDC__ <= 0x610) -// Older Borland compilers can't handle assembly in inline methods or -// templates (E2211). When we build for pentium optimized and we are inlining -// then we disable inline assembly -# if defined (ACE_HAS_PENTIUM) && defined(__ACE_INLINE__) -# define ACE_LACKS_INLINE_ASSEMBLY -# endif -#endif - -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup -#define ACE_STRCASECMP_EQUIVALENT ::stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::strnicmp -#define ACE_HAS_ITOA 1 - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_BORLAND_H */ - diff --git a/dep/include/ace/config-win32-common.h b/dep/include/ace/config-win32-common.h deleted file mode 100644 index b7beb5ba228..00000000000 --- a/dep/include/ace/config-win32-common.h +++ /dev/null @@ -1,663 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-win32-common.h 82316 2008-07-15 01:28:39Z johnnyw $ - -#ifndef ACE_CONFIG_WIN32_COMMON_H -#define ACE_CONFIG_WIN32_COMMON_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -// Windows Mobile (CE) stuff is primarily further restrictions to what's -// in the rest of this file. Also, it defined ACE_HAS_WINCE, which is used -// in this file. -#if defined (_WIN32_WCE) -# include "ace/config-WinCE.h" -#endif /* _WIN32_WCE */ - -// Complain if WIN32 is not already defined. -#if !defined (WIN32) && !defined (ACE_HAS_WINCE) -# error Please define WIN32 in your project settings. -#endif - -#define ACE_WIN32 -#if defined (_WIN64) || defined (WIN64) -# define ACE_WIN64 - -// Use 64-bit file offsets by default in the WIN64 case, similar to -// what 64-bit UNIX systems do. -// -// Note that _FILE_OFFSET_BITS is not recognized by Windows. It is, -// however, recognized by ACE. -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif /* !_FILE_OFFSET_BITS */ -#endif /* _WIN64 || WIN64 */ - -#if !defined (_WIN32_WINNT) -# define _WIN32_WINNT 0x0501 // pretend it's at least Windows XP or Win2003 -#endif - -// If the invoking procedure turned off debugging by setting NDEBUG, then -// also set ACE_NDEBUG, unless the user has already set it. -#if defined (NDEBUG) -# if !defined (ACE_NDEBUG) -# define ACE_NDEBUG -# endif /* ACE_NDEBUG */ -#endif /* NDEBUG */ - -// Define ACE_HAS_MFC to 1, if you want ACE to use CWinThread. This should -// be defined, if your application uses MFC. -// Setting applies to : building ACE -// Runtime restrictions: MFC DLLs must be installed -// Additonal notes : If both ACE_HAS_MFC and ACE_MT_SAFE are -// defined, the MFC DLL (not the static lib) -// will be used from ACE. -#if !defined (ACE_HAS_MFC) -# define ACE_HAS_MFC 0 -#endif - -// ACE_USES_STATIC_MFC always implies ACE_HAS_MFC -#if defined (ACE_USES_STATIC_MFC) -# if defined (ACE_HAS_MFC) -# undef ACE_HAS_MFC -# endif -# define ACE_HAS_MFC 1 -#endif /* ACE_USES_STATIC_MFC */ - -// Define ACE_HAS_STRICT to 1 in your config.h file if you want to use -// STRICT type checking. It is disabled by default because it will -// break existing application code. However, if ACE_HAS_MFC is turned on, -// ACE_HAS_STRICT is required by MFC. -// Setting applies to : building ACE, linking with ACE -// Runtime restrictions: - -#if !defined (ACE_HAS_STRICT) -# define ACE_HAS_STRICT 0 -#endif - -// MFC itself defines STRICT. -#if defined (ACE_HAS_MFC) && (ACE_HAS_MFC != 0) -# undef ACE_HAS_STRICT -# define ACE_HAS_STRICT 1 -#endif - -// Turn off the following define if you want to disable threading. -// Compile using multi-thread libraries. -// Setting applies to : building ACE, linking with ACE -// Runtime restrictions: multithreaded runtime DLL must be installed -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Build ACE services as DLLs. If you write a library and want it to -// use ACE_Svc_Export, this will cause those macros to build dlls. If -// you want your ACE service to be a static library, comment out this -// line. As far as I know, the only reason to have a library be an -// ACE "service" is to leverage the ACE_Svc_Export macros. It's just -// as easy to define your own export macros. -// #if !defined (ACE_SVC_HAS_DLL) -// # define ACE_SVC_HAS_DLL 1 -// #endif - -// Define the special export macros needed to export symbols outside a dll -#if !defined(__BORLANDC__) -#define ACE_HAS_CUSTOM_EXPORT_MACROS 1 -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; -#endif /* !__BORLANDC__ */ - -// Define ACE_HAS_WINSOCK2 to 0 in your config.h file if you do *not* -// want to compile with WinSock 2.0. -// Setting applies to : building ACE -// Runtime restrictions: winsock2 must be installed. -// #define ACE_HAS_WINSOCK2 0 - -// By default, we use non-static object manager on Win32. That is, -// the object manager is allocated in main's stack memory. If this -// does not suit your need, i.e., if your programs depend on the use -// of static object manager, you neet to disable the behavior by adding -// -// #undef ACE_HAS_NONSTATIC_OBJECT_MANAGER -// -// in the config.h after including config-win32.h -// -// MFC users: the main function is defined within a MFC library and -// therefore, ACE won't be able to meddle with main function and -// instantiate the non-static object manager for you. To solve the -// problem, you'll need to instantiate the ACE_Object_Manager by -// either: -// -// 1. Using static object manager (as described above), however, using -// the non-static object manager is prefered, therefore, -// 2. Instantiate the non-static object manager yourself by either 1) -// call ACE::init () at the beginning and ACE::fini () at the end, -// _or_ 2) instantiate the ACE_Object_Manager in your CWinApp -// derived class. -// -// Optionally, you can #define -// ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER in your -// ace/config.h and always take care of the business by yourself. -// ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER has no effect when -// using static object managers. -#if !defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) -# define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#elif (ACE_HAS_NONSTATIC_OBJECT_MANAGER == 0) -# undef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */ - -#define ACE_HAS_GPERF - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -# define ACE_USE_RCSID 0 -#endif /* ! ACE_USE_RCSID */ - -// ---------------- platform features or lack of them ------------- - -// By default WIN32 has FD_SETSIZE of 64, which places the limit -// between 61 and 64 on the number of clients a server using the -// Select Reactor can support at the same time (i.e., 64 - standard in, -// out, error). Here we raise the limit to 1024. Adjust the definition -// below if you need to raise or lower it. - -#if !defined (FD_SETSIZE) -#define FD_SETSIZE 1024 -#endif /* FD_SETSIZE */ - -// Windows doesn't like 65536 ;-) If 65536 is specified, it is -// silently ignored by the OS, i.e., setsockopt does not fail, and you -// get stuck with the default size of 8k. -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65535 - -// It seems like Win32 does not have a limit on the number of buffers -// that can be transferred by the scatter/gather type of I/O -// functions, e.g., WSASend and WSARecv. We are setting this to be 64 -// for now. The typically use case is to create an I/O vector array -// of size ACE_IOV_MAX on the stack and then filled in. Note that we -// probably don't want too big a value for ACE_IOV_MAX since it may -// mostly go to waste or the size of the activation record may become -// excessively large. -#if !defined (ACE_IOV_MAX) -# define ACE_IOV_MAX 64 -#endif /* ACE_IOV_MAX */ - -#if !defined (ACE_HAS_WINCE) -// Platform supports pread() and pwrite() -# define ACE_HAS_P_READ_WRITE -#endif /* ! ACE_HAS_WINCE */ - -#if !defined (__MINGW32__) -# define ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS -#endif /* __MINGW32__ */ - -#define ACE_DEFAULT_THREAD_PRIORITY 0 - -#define ACE_HAS_DIRENT -#define ACE_HAS_MSG -#define ACE_HAS_RECURSIVE_MUTEXES -#define ACE_HAS_SOCKADDR_MSG_NAME -#define ACE_HAS_THREAD_SAFE_ACCEPT - -/* LACKS dir-related facilities */ -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_REWINDDIR -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_TELLDIR - -/* LACKS gid/pid/sid/uid facilities */ -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETPPID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_SETGID - -/* LACKS miscellaneous */ -#define ACE_LACKS_ALARM -#define ACE_LACKS_ARPA_INET_H -#define ACE_LACKS_DUP2 -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETOPT -#define ACE_LACKS_GETIPNODEBYNAME_IPV6 -#define ACE_LACKS_KILL -#define ACE_LACKS_INET_ATON -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MODE_MASKS -#define ACE_LACKS_PTHREAD_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READLINK -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_SBRK -#define ACE_LACKS_SCHED_H -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGACTION -#define ACE_LACKS_SIGSET -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_SYS_SYSCTL_H -#define ACE_LACKS_SYSCONF -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_UNISTD_H -#define ACE_LACKS_UNIX_SIGNALS -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_LACKS_UTSNAME_T -#define ACE_LACKS_UNAME -#define ACE_LACKS_WAIT -#define ACE_LACKS_IOVEC -#define ACE_LACKS_LOG2 - -#define ACE_HAS_PDH_H -#define ACE_HAS_PDHMSG_H - -#define ACE_HAS_VFWPRINTF - -#define ACE_MKDIR_LACKS_MODE - -#define ACE_SIZEOF_LONG_LONG 8 -// Green Hills Native x86 does not support __int64 keyword -// Neither does mingw32. -#if !defined (ACE_LACKS_LONGLONG_T) && !defined (__MINGW32__) -#define ACE_INT64_TYPE signed __int64 -#define ACE_UINT64_TYPE unsigned __int64 -#endif /* (ghs) */ - -#if defined (__MINGW32__) -#define ACE_INT64_TYPE signed long long -#define ACE_UINT64_TYPE unsigned long long -#endif - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Win32 has wide-char support. Use of the compiler-defined wchar_t type -// is controlled in compiler configs since it's a compiler switch. -#define ACE_HAS_WCHAR - -// Compiler/platform correctly calls init()/fini() for shared -// libraries. - applied for DLLs ? -//define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -//define ACE_HAS_POSIX_NONBLOCK - -// Platform contains . -//define ACE_HAS_POLL - -// Platform supports the /proc file system. -//define ACE_HAS_PROC_FS - -// Platform supports the rusage struct. -#define ACE_HAS_GETRUSAGE - -// Compiler/platform supports SVR4 signal typedef. -//define ACE_HAS_SVR4_SIGNAL_T - -// Platform provides header. -//define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -//define ACE_HAS_SYS_SIGLIST - -// Platform supports ACE_TLI timod STREAMS module. -//define ACE_HAS_TIMOD_H - -// Platform supports ACE_TLI tiuser header. -//define ACE_HAS_TIUSER_H - -// Platform provides ACE_TLI function prototypes. -// For Win32, this is not really true, but saves a lot of hassle! -#define ACE_HAS_TLI_PROTOTYPES - -// Platform supports ACE_TLI. -//define ACE_HAS_TLI - -// I'm pretty sure NT lacks these -#define ACE_LACKS_UNIX_DOMAIN_SOCKETS - -// Windows NT needs readv() and writev() -#define ACE_LACKS_WRITEV -#define ACE_LACKS_READV - -#define ACE_LACKS_COND_T -#define ACE_LACKS_RWLOCK_T - -#define ACE_LACKS_KEY_T - -// No system support for replacing any previous mappings. -#define ACE_LACKS_AUTO_MMAP_REPLACEMENT - -// ACE_HAS_PENTIUM is used to optimize some CDR operations; it's used for -// some other time-related things using g++, but not for VC. Current VC -// compilers set _M_IX86 > 400 by default so if you're not using a Pentium -// class CPU, set the project code generation options appropriately. -#if !defined(ACE_HAS_PENTIUM) && (_M_IX86 > 400) -# define ACE_HAS_PENTIUM -#endif - -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -// Platform supports threads. -# define ACE_HAS_THREADS - -// Platform supports Windows32 threads. -# define ACE_HAS_WTHREADS - -// Compiler/platform has thread-specific storage -# define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Win32 doesn't have fcntl -#define ACE_LACKS_FCNTL - -#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ - -#if !defined(_DEBUG) -// If we are making a release, and the user has not specified -// inline directives, we will default to inline -# if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ 1 -# endif /* __ACE_INLINE__ */ -#endif - -// If __ACE_INLINE__ is defined to be 0, we will undefine it -#if defined (__ACE_INLINE__) && (__ACE_INLINE__ == 0) -# undef __ACE_INLINE__ -#endif /* __ACE_INLINE__ */ - -// We are build ACE and want to use MFC (multithreaded) -#if defined(ACE_HAS_MFC) && (ACE_HAS_MFC != 0) && defined (_MT) -# if (ACE_HAS_DLL != 0) && defined(ACE_BUILD_DLL) && !defined (_WINDLL) -// force multithreaded MFC DLL -# define _WINDLL -# endif /* _AFXDLL */ -# if !defined (_AFXDLL) && !defined (ACE_USES_STATIC_MFC) -# define _AFXDLL -# endif /* _AFXDLL */ -#endif - -// and MFC's are mutually -// incompatible. is brain-dead about MFC; it doesn't check -// to see whether MFC stuff is anticipated or already in progress -// before doing its thing. ACE needs (practically always) , -// and winsock in turn needs support either from windows.h or from -// afxwin.h. One or the other, not both. -// -// The MSVC++ V4.0 environment defines preprocessor macros that -// indicate the programmer has chosen something from the -// Build-->Settings-->General-->MFC combo-box. defines a -// macro itself to protect against double inclusion. We'll take -// advantage of all this to select the proper support for winsock. - -// trl 26-July-1996 - -// This is necessary since MFC users apparently can't #include -// directly. -#if defined (ACE_HAS_MFC) && (ACE_HAS_MFC != 0) -# include /**/ /* He is doing MFC */ -// Windows.h will be included via afxwin.h->afx.h->afx_ver_.h->afxv_w32.h -// #define _INC_WINDOWS // Prevent winsock.h from including windows.h -#elif defined (ACE_HAS_WINCE) -# include /**/ -#endif - -#if !defined (_INC_WINDOWS) /* Already include windows.h ? */ -// Must define strict before including windows.h ! -# if defined (ACE_HAS_STRICT) && (ACE_HAS_STRICT != 0) && !defined (STRICT) -# define STRICT 1 -# endif /* ACE_HAS_STRICT */ - -# if !defined (WIN32_LEAN_AND_MEAN) && !defined (ACE_NO_WIN32_LEAN_AND_MEAN) -# define WIN32_LEAN_AND_MEAN -# endif /* WIN32_LEAN_AND_MEAN */ - -#endif /* !defined (_INC_WINDOWS) */ - -// Always use WS2 when available -#if !defined(ACE_HAS_WINSOCK2) -# define ACE_HAS_WINSOCK2 1 -#endif /* !defined(ACE_HAS_WINSOCK2) */ - -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) -# if !defined (_WINSOCK2API_) -// will also include windows.h, if not present -# include /**/ -// WinCE 4 doesn't define the Exxx values without the WSA prefix, so do that -// here. This is all lifted from the #if 0'd out part of winsock2.h. -# if defined (UNDER_CE) -# define EWOULDBLOCK WSAEWOULDBLOCK -# define EINPROGRESS WSAEINPROGRESS -# define EALREADY WSAEALREADY -# define ENOTSOCK WSAENOTSOCK -# define EDESTADDRREQ WSAEDESTADDRREQ -# define EMSGSIZE WSAEMSGSIZE -# define EPROTOTYPE WSAEPROTOTYPE -# define ENOPROTOOPT WSAENOPROTOOPT -# define EPROTONOSUPPORT WSAEPROTONOSUPPORT -# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -# define EOPNOTSUPP WSAEOPNOTSUPP -# define EPFNOSUPPORT WSAEPFNOSUPPORT -# define EAFNOSUPPORT WSAEAFNOSUPPORT -# define EADDRINUSE WSAEADDRINUSE -# define EADDRNOTAVAIL WSAEADDRNOTAVAIL -# define ENETDOWN WSAENETDOWN -# define ENETUNREACH WSAENETUNREACH -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOBUFS WSAENOBUFS -# define EISCONN WSAEISCONN -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# define ETOOMANYREFS WSAETOOMANYREFS -# define ETIMEDOUT WSAETIMEDOUT -# define ECONNREFUSED WSAECONNREFUSED -# define ELOOP WSAELOOP -# define ENAMETOOLONG WSAENAMETOOLONG -# define EHOSTDOWN WSAEHOSTDOWN -# define EHOSTUNREACH WSAEHOSTUNREACH -# define ENOTEMPTY WSAENOTEMPTY -# define EPROCLIM WSAEPROCLIM -# define EUSERS WSAEUSERS -# define EDQUOT WSAEDQUOT -# define ESTALE WSAESTALE -# define EREMOTE WSAEREMOTE -# endif /* UNDER_CE */ -# endif /* _WINSOCK2API */ - -# if defined (ACE_HAS_FORE_ATM_WS2) -# include /**/ -# endif /*ACE_HAS_FORE_ATM_WS2 */ - -// CE doesn't have Microsoft Winsock 2 extensions -# if !defined _MSWSOCK_ && !defined (ACE_HAS_WINCE) -# include /**/ -# endif /* _MSWSOCK_ */ - -# if defined (_MSC_VER) -# if defined (ACE_HAS_WINCE) -# pragma comment(lib, "ws2.lib") -# else -# pragma comment(lib, "ws2_32.lib") -# pragma comment(lib, "mswsock.lib") -# if defined (ACE_HAS_IPV6) -# pragma comment(lib, "iphlpapi.lib") -# endif -# endif /* ACE_HAS_WINCE */ -# endif /* _MSC_VER */ - -# define ACE_WSOCK_VERSION 2, 0 -#else -# if !defined (_WINSOCKAPI_) - // will also include windows.h, if not present -# include /**/ -# endif /* _WINSOCKAPI */ - -// PharLap ETS has its own winsock lib, so don't grab the one -// supplied with the OS. -# if defined (_MSC_VER) && !defined (UNDER_CE) && !defined (ACE_HAS_PHARLAP) -# pragma comment(lib, "wsock32.lib") -# endif /* _MSC_VER */ - -// We can't use recvmsg and sendmsg unless WinSock 2 is available -# define ACE_LACKS_RECVMSG -# define ACE_LACKS_SENDMSG - -// Version 1.1 of WinSock -# define ACE_WSOCK_VERSION 1, 1 -#endif /* ACE_HAS_WINSOCK2 */ - -// Platform supports IP multicast on Winsock 2 -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) -# define ACE_HAS_IP_MULTICAST -#endif /* ACE_HAS_WINSOCK2 */ - -#if !defined (ACE_HAS_WINCE) || defined (PPC) /* CE only on some CPUs */ -# define ACE_HAS_INTERLOCKED_EXCHANGEADD -#endif -#define ACE_HAS_WIN32_TRYLOCK - -#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) -# define ACE_HAS_SIGNAL_OBJECT_AND_WAIT - -// If CancelIO is undefined get the updated sp2-sdk from MS -# define ACE_HAS_CANCEL_IO -# define ACE_HAS_WIN32_OVERLAPPED_IO -# define ACE_HAS_WIN32_NAMED_PIPES -#endif /* !defined (ACE_USES_WINCE_SEMA_SIMULATION) && !ACE_HAS_PHARLAP */ - -#if !defined (ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION) -# define ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION EXCEPTION_CONTINUE_SEARCH -#endif /* ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION */ - -// ACE_HAS_QOS is defined in the qos.mpb base project. -// If qos=1 in default.features, then this macro will be defined. -#if defined (ACE_HAS_QOS) && !defined (ACE_HAS_WINSOCK2_GQOS) -# if defined (WINSOCK_VERSION) -# define ACE_HAS_WINSOCK2_GQOS 1 -# endif /* WINSOCK_VERSION */ -#endif /* ACE_HAS_WINSOCK2_GQOS */ - -// These are the defaults and can be overridden by a user's config.h -#if !defined (ACE_DEFAULT_FILE_PERMS) -# define ACE_DEFAULT_FILE_PERMS (FILE_SHARE_READ | FILE_SHARE_WRITE | \ - FILE_SHARE_DELETE) -// This alternate used to be used for pre-NT4 systems; may still be needed -// by knock-offs such as CE and Pharlap. -//# define ACE_DEFAULT_FILE_PERMS (FILE_SHARE_READ | FILE_SHARE_WRITE) -#endif /* !defined (ACE_DEFAULT_FILE_PERMS) */ - -#define ACE_SIZEOF_WCHAR 2 -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_LACKS_STRUCT_DIR -#define ACE_LACKS_OPENDIR -#define ACE_LACKS_CLOSEDIR -#define ACE_LACKS_READDIR -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_LSTAT -// Looks like Win32 has a non-const swab function -#define ACE_HAS_NONCONST_SWAB - -// If we are using winsock2 then the SO_REUSEADDR feature is broken -// SO_REUSEADDR=1 behaves like SO_REUSEPORT=1. (SO_REUSEPORT is an -// extension to sockets on some platforms) -// We define SO_REUSEPORT here so that ACE_OS::setsockopt() can still -// allow the user to specify that a socketaddr can *always* be reused. -#if defined (ACE_HAS_WINSOCK2) && ACE_HAS_WINSOCK2 != 0 && ! defined(SO_REUSEPORT) -#define SO_REUSEPORT 0x0400 // We just have to pick a value that won't conflict -#endif - -#if defined (ACE_WIN64) -// Data must be aligned on 8-byte boundaries, at a minimum. -# define ACE_MALLOC_ALIGN 8 -// Void pointers are 8 bytes -# define ACE_SIZEOF_VOID_P 8 -#endif /* ACE_WIN64 */ - -#if !defined (ACE_DISABLES_THREAD_LIBRARY_CALLS) -# define ACE_DISABLES_THREAD_LIBRARY_CALLS 0 -#endif /* ACE_DISABLES_THREAD_LIBRARY_CALLS */ - -#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) -# define ACE_HAS_LOG_MSG_NT_EVENT_LOG -#endif /* !ACE_HAS_WINCE && !ACE_HAS_PHARLAP */ - -#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_LLSEEK -#endif /* !ACE_HAS_WINCE */ - -// Needed for obtaining the MAC address -// I dont believe this will work under CE, notice the -// check for ACE_HAS_WINCE. -# if !defined (ACE_HAS_WINCE) -# include -# if defined (_MSC_VER) -# pragma comment(lib, "netapi32.lib") // needed for obtaing MACaddress -# endif -# endif /* !ACE_HAS_WINCE */ - -#if !defined (WINVER) -# define WINVER 0x0400 // pretend it's at least WinNT 4.0 -#endif - -/////////////////////////////////////// -// windows version-specific definitions -// see: http://msdn2.microsoft.com/en-us/library/aa383745.aspx -// -// For TSS information -// see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/thread_local_storage.asp - -#if (WINVER>=0x0600) -// Windows Server 2008 definitions go here -// Windows Vista defintions go here -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 1088 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#elif (WINVER>=0x0502) - // Windows Server 2003 SP1 definitions go here -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 1088 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#elif (WINVER>=0x0501) -// Windows XP definitions go here -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 1088 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#elif (WINVER>=0x0500) -// Windows 2000 definitions go here -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 1088 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#elif (WINVER>=0x0410) -// Windows 98 definitions go here -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 80 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#else -// antique windows -# if ! defined(ACE_DEFAULT_THREAD_KEYS) -# define ACE_DEFAULT_THREAD_KEYS 64 -# endif // ! defined(ACE_DEFAULT_THREAD_KEYS) -#endif - -#if !defined (ACE_DEFAULT_BACKLOG) -# define ACE_DEFAULT_BACKLOG SOMAXCONN -#endif /* ACE_DEFAULT_BACKLOG */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_COMMON_H */ - diff --git a/dep/include/ace/config-win32-dmc.h b/dep/include/ace/config-win32-dmc.h deleted file mode 100644 index ca855f5bc97..00000000000 --- a/dep/include/ace/config-win32-dmc.h +++ /dev/null @@ -1,111 +0,0 @@ -// -*- C++ -*- -// $Id: config-win32-dmc.h 81992 2008-06-16 19:09:50Z wotte $ - -// The following configuration file contains defines for Digital Mars compilers. - -#ifndef ACE_CONFIG_WIN32_DMC_H -#define ACE_CONFIG_WIN32_DMC_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#ifndef WIN32 -# define WIN32 -#endif /* WIN32 */ - -#undef _M_IX86 -// This turns on ACE_HAS_PENTIUM -#define _M_IX86 500 - -#if defined ACE_LACKS_STRUCT_DIR -# undef ACE_LACKS_STRUCT_DIR -#endif - -// Changed ACE_TEXT to ACE_TEXT in the following line -# define ACE_CC_NAME ACE_TEXT ("Digital Mars") -# define ACE_CC_MAJOR_VERSION (1) -# define ACE_CC_MINOR_VERSION (8) -# define ACE_CC_BETA_VERSION (9) -# ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR "DMC.EXE" -# define ACE_CC_PREPROCESSOR_ARGS "-E" -# endif - -// Microsoft's standard cpp library auto_ptr doesn't have reset (). -# define ACE_AUTO_PTR_LACKS_RESET - -#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) - -// This section below was extracted from config-win32-msvc -#define ACE_HAS_ITOA -#define ACE_ITOA_EQUIVALENT ::_itoa -#define ACE_STRCASECMP_EQUIVALENT ::_stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup -// This section above was extracted from config-win32-msvc - -# define ACE_EXPORT_NESTED_CLASSES 1 -# define ACE_HAS_CPLUSPLUS_HEADERS 1 -//# define ACE_HAS_EXCEPTIONS 1 -# define ACE_HAS_GNU_CSTRING_H 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 -# define ACE_HAS_SIG_ATOMIC_T 1 -# define ACE_HAS_STANDARD_CPP_LIBRARY 0 -# define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR 1 -# define ACE_HAS_STRING_CLASS 1 -# define ACE_HAS_TEMPLATE_TYPEDEFS 1 -# define ACE_HAS_USER_MODE_MASKS 1 -//# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -# define ACE_LACKS_STRPTIME 1 -//# define ACE_LACKS_PRAGMA_ONCE 1 -//# define ACE_NEW_THROWS_EXCEPTIONS 1 -# define ACE_SIZEOF_LONG_DOUBLE 10 -# define ACE_TEMPLATES_REQUIRE_SOURCE 1 -// Changed ACE_TEXT to ACE_TEXT in the following two lines -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_STRBUF_T -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_USES_OLD_IOSTREAMS -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_SYS_MMAN_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_SOCKET_H -#define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_SYS_IOCTL_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_NET_IF_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_NETDB_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_REGEX_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_LACKS_UNISTD_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_ACE_IOSTREAM -#define ACE_HAS_NONCONST_TEMPNAM - -// Typedefs which we expect DMC to do, but they don't do that -typedef long o_uid_t; -typedef long o_gid_t; - -#include "io.h" -#undef umask; -#undef tell; - -# if !defined (ACE_LD_DECORATOR_STR) && defined (_DEBUG) -# define ACE_LD_DECORATOR_STR ACE_TEXT ("d") -# endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_DMC_H */ - diff --git a/dep/include/ace/config-win32-ghs.h b/dep/include/ace/config-win32-ghs.h deleted file mode 100644 index 775488f3f7f..00000000000 --- a/dep/include/ace/config-win32-ghs.h +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- -// $Id: config-win32-ghs.h 81992 2008-06-16 19:09:50Z wotte $ - -// The following configuration file contains defines for Green Hills compilers. - -#ifndef ACE_CONFIG_WIN32_GHS_H -#define ACE_CONFIG_WIN32_GHS_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#ifndef WIN32 -# define WIN32 -#endif /* WIN32 */ - -#undef _M_IX86 -// This turns on ACE_HAS_PENTIUM -#define _M_IX86 500 -// GHS does not provide DLL support -#define ACE_HAS_DLL 0 -#define TAO_HAS_DLL 0 -#undef _DLL - -//Green Hills Native x86 does not support structural exceptions -# undef ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS -# undef ACE_HAS_WCHAR -# define ACE_CONFIG_INCLUDE_GHS_COMMON -# include "ace/config-ghs-common.h" - -// Changed ACE_TEXT to ACE_TEXT in the following line -# define ACE_CC_NAME ACE_TEXT ("Green Hills C++") -# define ACE_CC_MAJOR_VERSION (1) -# define ACE_CC_MINOR_VERSION (8) -# define ACE_CC_BETA_VERSION (9) -# ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR "GCX.EXE" -# define ACE_CC_PREPROCESSOR_ARGS "-E" -# endif - -// GHS uses Microsoft's standard cpp library, which has auto_ptr. -# undef ACE_LACKS_AUTO_PTR -// Microsoft's standard cpp library auto_ptr doesn't have reset (). -# define ACE_AUTO_PTR_LACKS_RESET - -#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) - -// This section below was extracted from config-win32-msvc -#define ACE_HAS_ITOA -#define ACE_ITOA_EQUIVALENT ::_itoa -#define ACE_STRCASECMP_EQUIVALENT ::_stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup -// This section above was extracted from config-win32-msvc - -# define ACE_EXPORT_NESTED_CLASSES 1 -# define ACE_HAS_CPLUSPLUS_HEADERS 1 -//# define ACE_HAS_EXCEPTIONS 1 -# define ACE_HAS_GNU_CSTRING_H 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 -# define ACE_HAS_SIG_ATOMIC_T 1 -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR 1 -# define ACE_HAS_STRING_CLASS 1 -# define ACE_HAS_TEMPLATE_TYPEDEFS 1 -# define ACE_HAS_USER_MODE_MASKS 1 -# define ACE_LACKS_ACE_IOSTREAM 1 -//# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -# define ACE_LACKS_STRPTIME 1 -//# define ACE_LACKS_PRAGMA_ONCE 1 -# define ACE_LACKS_STRRECVFD 1 -//# define ACE_NEW_THROWS_EXCEPTIONS 1 -# define ACE_SIZEOF_LONG_DOUBLE 10 -# define ACE_TEMPLATES_REQUIRE_SOURCE 1 -// Changed ACE_TEXT to ACE_TEXT in the following two lines -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -// Set the following to zero to placate SString.h ACE_WString CTOR -# undef ACE_WSTRING_HAS_USHORT_SUPPORT - -// Green Hills Native x86 does not support __int64 keyword -# define ACE_LACKS_LONGLONG_T - -/* need to ensure these are included before */ -# include -# include - -# if !defined (ACE_LD_DECORATOR_STR) && defined (_DEBUG) -# define ACE_LD_DECORATOR_STR ACE_TEXT ("d") -# endif - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_GHS_H */ - diff --git a/dep/include/ace/config-win32-interix.h b/dep/include/ace/config-win32-interix.h deleted file mode 100644 index d613444fadb..00000000000 --- a/dep/include/ace/config-win32-interix.h +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- -// $Id: config-win32-interix.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for Interix -// platforms using GNU g++ (Interix == Microsoft's Services for Unix) - -#ifndef ACE_CONFIG_WIN32_INTERIX_H -#define ACE_CONFIG_WIN32_INTERIX_H -#include /**/ "ace/pre.h" -#include - -# define ACE_LACKS_SENDMSG -# define ACE_LACKS_RECVMSG -# define ACE_LACKS_STDINT_H -# define ACE_LACKS_INTTYPES_H -# define ACE_LACKS_PRAGMA_ONCE -# define ACE_LACKS_RWLOCK_T -# define ACE_LACKS_GETPGID // Don't have getpgid(), have setpgid() though... -# define ACE_LACKS_UCONTEXT_H -# define ACE_HAS_REENTRANT_FUNCTIONS -# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS // Don't have gethostbyaddr_r and friends. -# define ACE_HAS_DIRENT -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL -# define ACE_HAS_SIGWAIT -# define ACE_HAS_SIGINFO_T - -#include "ace/config-g++-common.h" - -#define ACE_HAS_NEW_NOTHROW // Need to know 'new's failure semantics. - -#if defined (ACE_HAS_THREADS) -#define ACE_HAS_THREADS -#define ACE_HAS_PTHREADS -#define _THREAD_SAFE -#define ACE_MTSAFE 1 -#define ACE_MT_SAFE 1 -#define ACE_LACKS_PTHREAD_YIELD -#define ACE_HAS_MUTEX_TIMEOUTS -#else - error "You need to enable threads for this Interix port." -#endif /* ACE_HAS_THREADS */ - -// INTERIX has the following, just an issue with porting for the moment -#define ACE_LACKS_ACCESS -// END INTERIX has the following.... - -#define ACE_SIZEOF_LONG_DOUBLE 12 -#define ACE_PAGE_SIZE 4096 - -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_POSIX_TIME // Supports POSIX timers via struct timespec. -#define ACE_LACKS_TIMESPEC_T // Defines struct timespec but not timespec_t. -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SETSCHED -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_RTLD_LAZY_V -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SEMUN -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_SVR4_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_TERMIOS -#define ACE_HAS_SIGWAIT - -// Turns off the tracing feature. -#if !defined (ACE_NTRACE) -#define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// NOTE: In debugging some of the test apps they would all memory fault in using -// ACE_Errno_Guard. Upon inspection of that code it uses TSS to save ERRNO in -// a TSS pointer. Access to that pointer caused the fault. The work around here -// is to tell ACE we have TSS and use emulation. More investigation is needed to -// determine whether Interix TSS is broken or the correct semantics for usage under -// Interix simply need to be ported. -// To get around the issue ACE_HAS_TSS_EMULATION is defined to use TSS emulation -// however while many test programs that use TSS pass the TSS_Test program fails. -#define ACE_HAS_THREAD_SPECIFIC_STORAGE // We need thread specific storage even though... -#define ACE_HAS_TSS_EMULATION // It would appear to be broken in Interix! - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_INTERIX_H */ - -/* -The following tests do not run. -Dynamic_Priority_Test.log ACE_HAS_TIMED_MESSAGE_BLOCKS -Enum_Interfaces_Test.log -IOStream_Test.log ACE_IOSTREAM not supported on this platform -*/ - - diff --git a/dep/include/ace/config-win32-mingw.h b/dep/include/ace/config-win32-mingw.h deleted file mode 100644 index 259e5d927fd..00000000000 --- a/dep/include/ace/config-win32-mingw.h +++ /dev/null @@ -1,101 +0,0 @@ -// -*- C++ -*- -// $Id: config-win32-mingw.h 81693 2008-05-14 12:35:01Z johnnyw $ - -// -// The following configuration file is designed to work for win32 -// platforms using gcc/g++ with mingw32 (http://www.mingw.org). -// - -#ifndef ACE_CONFIG_WIN32_MINGW_H -#define ACE_CONFIG_WIN32_MINGW_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -# error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#define ACE_CC_NAME ACE_TEXT ("g++") -#define ACE_CC_PREPROCESSOR "cpp" -#define ACE_CC_PREPROCESOR_ARGS "" - -// Why all this is not in config-g++-common.h? -#define ACE_CC_MAJOR_VERSION __GNUC__ -#define ACE_CC_MINOR_VERSION __GNUC_MINOR__ -#define ACE_CC_BETA_VERSION (0) - -#if !defined(__MINGW32__) -# error You do not seem to be using mingw32 -#endif - -#include "ace/config-g++-common.h" - -#include /**/ <_mingw.h> -#include /**/ - -#define ACE_HAS_USER_MODE_MASKS - -#if (__MINGW32_MAJOR_VERSION < 2) -# error You need a newer version (>= 2.0) of mingw32/w32api -#endif - -#if (__MINGW32_MAJOR_VERSION >= 3) -# define ACE_HAS_SSIZE_T -# undef ACE_LACKS_STRUCT_DIR -# undef ACE_LACKS_OPENDIR -# undef ACE_LACKS_CLOSEDIR -# undef ACE_LACKS_READDIR -# undef ACE_LACKS_TELLDIR -# undef ACE_LACKS_SEEKDIR -# undef ACE_LACKS_REWINDDIR -#else -# define ACE_LACKS_DIRENT_H -#endif - -#undef ACE_LACKS_SIGSET - -#define ACE_LACKS_SIGSET_DEFINITIONS -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_STRPTIME -#define ACE_HAS_STRERROR -#define ACE_LACKS_POLL_H -#define ACE_LACKS_REGEX_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_SYS_MMAN_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_SOCKET_H -#define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_NETDB_H -#define ACE_LACKS_NET_IF_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_IOCTL_H -#define ACE_LACKS_PDH_H -#define ACE_LACKS_PDHMSG_H -#define ACE_HAS_NONCONST_WCSDUP -#define ACE_HAS_WINSOCK2_GQOS - -// We trust the user: He must have used -mpentiumpro or -mpentium -// if that is what he wants. -#if defined(pentiumpro) || defined(pentium) -# define ACE_HAS_PENTIUM -#endif - -#define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -#define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") - -#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) (STATUS)) - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_MINGW_H */ - diff --git a/dep/include/ace/config-win32-msvc-7.h b/dep/include/ace/config-win32-msvc-7.h deleted file mode 100644 index b2b45c6894b..00000000000 --- a/dep/include/ace/config-win32-msvc-7.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file config-win32-msvc-7.h - * - * $Id: config-win32-msvc-7.h 81935 2008-06-12 22:01:53Z jtc $ - * - * @brief Microsoft Visual C++ 7.0 configuration file. - * - * This file is the ACE configuration file for Microsoft Visual C++ version 7. - * - * @note Do not include this file directly, include config-win32.h instead. - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_CONFIG_WIN32_MSVC_7_H -#define ACE_CONFIG_WIN32_MSVC_7_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -// Visual C++ 7.0 (.NET) deprecated the old iostreams -#if !defined (ACE_HAS_STANDARD_CPP_LIBRARY) -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#endif - -#if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#endif - -// Win64 SDK compiler claims std::auto_ptr<>::reset not available. -#if defined (_WIN64) || defined (WIN64) -#define ACE_AUTO_PTR_LACKS_RESET -#endif - -#define ACE_HAS_ITOA -#define ACE_HAS_HEADER_ALLOCATED_CLASS_STATIC_CONST_INT_STOREAGE -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -#define ACE_ITOA_EQUIVALENT ::_itoa -#define ACE_STRCASECMP_EQUIVALENT ::_stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup - -#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_EXCEPTIONS) -#define ACE_HAS_EXCEPTIONS -#endif /* ACE_HAS_WINCE */ - -#define ACE_HAS_STRERROR -#define ACE_LACKS_STRPTIME - -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_STRRECVFD -#define ACE_HAS_CPLUSPLUS_HEADERS - -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_TEMPLATES_REQUIRE_SOURCE - -// Platform provides ACE_TLI function prototypes. -// For Win32, this is not really true, but saves a lot of hassle! -#define ACE_HAS_TLI_PROTOTYPES - -// Platform support linebuffered streaming is broken -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -#if !defined (ACE_HAS_WINCE) && !(defined (__INTEL_COMPILER) && (__INTEL_COMPILER == 900)) -# define ACE_HAS_INTRINSIC_INTERLOCKED -# define ACE_HAS_INTRINSIC_BYTESWAP -#endif - -#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY != 0) - -// Platform has its Standard C++ library in the namespace std -# if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - -// ace/iostream.h does not work with the standard cpp library (yet). -# if !defined (ACE_USES_OLD_IOSTREAMS) -# define ACE_LACKS_ACE_IOSTREAM -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -// Starting with MSVC 7.1, std::new throws std::bad_alloc on out-of-memory. -// Since we don't support MSVC 7.0, don't test for it. -# define ACE_NEW_THROWS_EXCEPTIONS -# define ACE_HAS_NEW_NOTHROW - -#else - -// iostream header lacks ipfx (), isfx (), etc., declarations -# define ACE_LACKS_IOSTREAM_FX - -#endif - -// There are too many instances of this warning to fix it right now. -// Maybe in the future. -// 'this' : used in base member initializer list -#pragma warning(disable:4355) - -// 'class1' : inherits 'class2::member' via dominance -#pragma warning(disable:4250) - -// C++ Exception Specification ignored -#pragma warning(disable:4290) - -// Disable warning of using Microsoft Extension. -#pragma warning(disable:4231) - -// 'function' : unreferenced local function has been removed -# pragma warning(disable:4505) - -// A template can not be exported. Only an instantiation may be exported. -#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT - -// At least for ACE_UNIMPLEMENTED_FUNC in class templates, this is needed to -// explicitly instantiate a template that has ACE_UNIMPLEMENTED_FUNC. -# define ACE_NEEDS_FUNC_DEFINITIONS - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_MSVC_7_H */ - diff --git a/dep/include/ace/config-win32-msvc-8.h b/dep/include/ace/config-win32-msvc-8.h deleted file mode 100644 index f35ba9f4f94..00000000000 --- a/dep/include/ace/config-win32-msvc-8.h +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file config-win32-msvc-8.h - * - * $Id: config-win32-msvc-8.h 81935 2008-06-12 22:01:53Z jtc $ - * - * @brief Microsoft Visual C++ 8.0 configuration file. - * - * This file is the ACE configuration file for Microsoft Visual C++ version 8. - * - * @note Do not include this file directly, include config-win32.h instead. - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_CONFIG_WIN32_MSVC_8_H -#define ACE_CONFIG_WIN32_MSVC_8_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#ifndef ACE_WIN32_VC8 -# define ACE_WIN32_VC8 -#endif - -// Visual C++ 8.0 (.NET) deprecated the old iostreams -#if !defined (ACE_HAS_STANDARD_CPP_LIBRARY) -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#endif - -#if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#endif - -// Windows' timeval is non-conformant (defined in terms of long instead of -// time_t) and VC8 (on desktop, not CE) changed time_t to a 64-bit value -// even when compiling a 32-bit application. Therefore, ace/Time_Value -// needs to rearrange a few things for this compiler. See Time_Value.h -// for complete details. -#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_TIME_T_LONG_MISMATCH -#endif - -#define ACE_HAS_ITOA -#define ACE_HAS_HEADER_ALLOCATED_CLASS_STATIC_CONST_INT_STOREAGE -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -#define ACE_ITOA_EQUIVALENT ::_itoa -#define ACE_STRCASECMP_EQUIVALENT ::_stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup - -#define ACE_HAS_EXCEPTIONS - -// Windows Mobile 5 doesn't do sig_atomic_t, but maybe future versions will. -# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x501) -# define ACE_HAS_SIG_ATOMIC_T -# endif /* !Win CE 5.0 or less */ - -#define ACE_HAS_STRERROR -#define ACE_LACKS_STRPTIME - -#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_INTRIN_H -# define ACE_HAS_INTRINSIC_INTERLOCKED -#endif - -#if !defined (_WIN32_WCE) || (_WIN32_WCE >= 0x501) -# define ACE_HAS_INTRINSIC_BYTESWAP -#endif - -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_STRRECVFD -#define ACE_HAS_CPLUSPLUS_HEADERS - -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_TEMPLATES_REQUIRE_SOURCE - -// Platform provides ACE_TLI function prototypes. -// For Win32, this is not really true, but saves a lot of hassle! -#define ACE_HAS_TLI_PROTOTYPES - -// Platform support linebuffered streaming is broken -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY != 0) - -// Platform has its Standard C++ library in the namespace std -# if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - -// ace/iostream.h does not work with the standard cpp library (yet). -# if !defined (ACE_USES_OLD_IOSTREAMS) -# define ACE_LACKS_ACE_IOSTREAM -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -// Starting with MSVC 7.1, std::new throws std::bad_alloc on out-of-memory. -#define ACE_NEW_THROWS_EXCEPTIONS -#define ACE_HAS_NEW_NOTHROW - -#else - -// iostream header lacks ipfx (), isfx (), etc., declarations -# define ACE_LACKS_IOSTREAM_FX - -#endif - -// There are too many instances of this warning to fix it right now. -// Maybe in the future. - -// Disable warning of using Microsoft Extension. -# pragma warning(disable:4231) - -// CE (at least thru Windows Mobile 5) doesn't have the new, secure CRT. -#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_TR24731_2005_CRT) -# define ACE_HAS_TR24731_2005_CRT -#endif - -//Detect Platform SDK 64-bit (AMD64) compiler using _MSC_FULL_VER -#if (defined (_WIN64) || defined (WIN64)) && _MSC_FULL_VER < 140050000 -# define ACE_AUTO_PTR_LACKS_RESET -# define ACE_MSVC_USES_DOUBLE_UNDERSCORE_STAT64 -# define ACE_HAS_BROKEN_STD_REVERSE_ITERATOR -# define ACE_LACKS_NUMERIC_LIMITS_64_BIT_TYPES -# undef ACE_HAS_TR24731_2005_CRT -# undef ACE_HAS_INTRIN_H -#endif - -// On CE w/o MFC config-WinCE.h needs to declare a placement new. This -// triggers a warning that there's no placement delete, which can be ignored. -#if defined (ACE_HAS_WINCE) && !defined (ACE_HAS_MFC) -# pragma warning(disable:4291) -#endif - -// A template can not be exported. Only an instantiation may be exported. -#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT - -// At least for ACE_UNIMPLEMENTED_FUNC in class templates, this is needed to -// explicitly instantiate a template that has ACE_UNIMPLEMENTED_FUNC. -# define ACE_NEEDS_FUNC_DEFINITIONS - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_MSVC_8_H */ - diff --git a/dep/include/ace/config-win32-msvc-9.h b/dep/include/ace/config-win32-msvc-9.h deleted file mode 100644 index ee8feef52e1..00000000000 --- a/dep/include/ace/config-win32-msvc-9.h +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file config-win32-msvc-9.h - * - * $Id: config-win32-msvc-9.h 81935 2008-06-12 22:01:53Z jtc $ - * - * @brief Microsoft Visual C++ 9.0 configuration file. - * - * This file is the ACE configuration file for Microsoft Visual C++ version 9. - * - * @note Do not include this file directly, include config-win32.h instead. - */ -//============================================================================= - -#ifndef ACE_CONFIG_WIN32_MSVC_9_H -#define ACE_CONFIG_WIN32_MSVC_9_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#ifndef ACE_WIN32_VC9 -# define ACE_WIN32_VC9 -#endif - -// Visual C++ 9.0 (.NET) deprecated the old iostreams -#if !defined (ACE_HAS_STANDARD_CPP_LIBRARY) -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#endif - -#if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#endif - -// Windows' timeval is non-conformant (defined in terms of long instead of -// time_t) and VC9 (on desktop, not CE) changed time_t to a 64-bit value -// even when compiling a 32-bit application. Therefore, ace/Time_Value -// needs to rearrange a few things for this compiler. See Time_Value.h -// for complete details. -#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_TIME_T_LONG_MISMATCH -#endif - -#define ACE_HAS_ITOA -#define ACE_HAS_HEADER_ALLOCATED_CLASS_STATIC_CONST_INT_STOREAGE -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - -#define ACE_ITOA_EQUIVALENT ::_itoa -#define ACE_STRCASECMP_EQUIVALENT ::_stricmp -#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp -#define ACE_WCSDUP_EQUIVALENT ::_wcsdup - -#define ACE_HAS_EXCEPTIONS - -// Windows Mobile 5 doesn't do sig_atomic_t, but maybe future versions will. -# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x501) -# define ACE_HAS_SIG_ATOMIC_T -# endif /* !Win CE 5.0 or less */ - -#define ACE_HAS_STRERROR -#define ACE_LACKS_STRPTIME - -// Evaluate this with a WinCE build; maybe things have improved since VC8. -//#if !defined (ACE_HAS_WINCE) -# define ACE_HAS_INTRIN_H -# define ACE_HAS_INTRINSIC_INTERLOCKED -//#endif - -#if !defined (_WIN32_WCE) || (_WIN32_WCE >= 0x501) -# define ACE_HAS_INTRINSIC_BYTESWAP -#endif - -#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES -#define ACE_LACKS_STRRECVFD -#define ACE_HAS_CPLUSPLUS_HEADERS - -#define ACE_HAS_TEMPLATE_TYPEDEFS -#define ACE_TEMPLATES_REQUIRE_SOURCE - -// Platform provides ACE_TLI function prototypes. -// For Win32, this is not really true, but saves a lot of hassle! -#define ACE_HAS_TLI_PROTOTYPES - -// Platform support linebuffered streaming is broken -#define ACE_LACKS_LINEBUFFERED_STREAMBUF - -#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY != 0) - -// Platform has its Standard C++ library in the namespace std -# if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - -// ace/iostream.h does not work with the standard cpp library (yet). -# if !defined (ACE_USES_OLD_IOSTREAMS) -# define ACE_LACKS_ACE_IOSTREAM -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -// Starting with MSVC 7.1, std::new throws std::bad_alloc on out-of-memory. -#define ACE_NEW_THROWS_EXCEPTIONS -#define ACE_HAS_NEW_NOTHROW - -#else - -// iostream header lacks ipfx (), isfx (), etc., declarations -# define ACE_LACKS_IOSTREAM_FX - -#endif - -// There are too many instances of this warning to fix it right now. -// Maybe in the future. - -// Disable warning of using Microsoft Extension. -# pragma warning(disable:4231) - -// 'class1' : inherits 'class2::member' via dominance -#pragma warning(disable:4250) - -// CE (at least thru Windows Mobile 5) doesn't have the new, secure CRT. -#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_TR24731_2005_CRT) -# define ACE_HAS_TR24731_2005_CRT -#endif - -// On CE w/o MFC config-WinCE.h needs to declare a placement new. This -// triggers a warning that there's no placement delete, which can be ignored. -#if defined (ACE_HAS_WINCE) && !defined (ACE_HAS_MFC) -# pragma warning(disable:4291) -#endif - -// A template can not be exported. Only an instantiation may be exported. -#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT - -// At least for ACE_UNIMPLEMENTED_FUNC in class templates, this is needed to -// explicitly instantiate a template that has ACE_UNIMPLEMENTED_FUNC. -# define ACE_NEEDS_FUNC_DEFINITIONS - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_MSVC_9_H */ - diff --git a/dep/include/ace/config-win32-msvc.h b/dep/include/ace/config-win32-msvc.h deleted file mode 100644 index 7abad321c7d..00000000000 --- a/dep/include/ace/config-win32-msvc.h +++ /dev/null @@ -1,170 +0,0 @@ -//============================================================================= -/** - * @file config-win32-msvc.h - * - * $Id: config-win32-msvc.h 82643 2008-08-19 14:02:12Z johnnyw $ - * - * @brief Microsoft Visual C++ configuration file. - * - * This file is the ACE configuration file for Microsoft Visual C++ versions - * 5.0, 6.0, and 7.0 (.NET) - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_CONFIG_WIN32_MSVC_H -#define ACE_CONFIG_WIN32_MSVC_H -#include /**/ "ace/pre.h" - -#ifndef ACE_CONFIG_WIN32_H -#error Use config-win32.h in config.h instead of this header -#endif /* ACE_CONFIG_WIN32_H */ - -#define ACE_CC_NAME ACE_TEXT ("Visual C++") -#ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR "CL.EXE" -# define ACE_CC_PREPROCESSOR_ARGS "-nologo -E" -#endif - -#define ACE_CC_MAJOR_VERSION (_MSC_VER / 100 - 6) -#define ACE_CC_MINOR_VERSION (_MSC_VER % 100) -#define ACE_CC_BETA_VERSION (0) - -#if !defined (ACE_LD_DECORATOR_STR) -# if defined (_DEBUG) -# define ACE_LD_DECORATOR_STR ACE_TEXT ("d") -# endif /* _DEBUG */ -#endif /* ACE_LD_DECORATOR_STR */ - -#if !defined(_NATIVE_WCHAR_T_DEFINED) - #define ACE_LACKS_NATIVE_WCHAR_T -#endif - -// Win Mobile still does thread exits differently than PC Windows. -#if defined (_WIN32_WCE) -# define ACE_ENDTHREADEX(STATUS) ExitThread ((DWORD) STATUS) -#else -# define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) -#endif /* _WIN32_WCE */ - -#if (_MSC_VER >= 1500) -# include "ace/config-win32-msvc-9.h" -#elif (_MSC_VER >= 1400) -# include "ace/config-win32-msvc-8.h" -#elif (_MSC_VER >= 1310) -# include "ace/config-win32-msvc-7.h" -#else -# error This version of Microsoft Visual C++ is not supported. -#endif - -// MFC changes the behavior of operator new at all MSVC versions from 6 up -// by throwing a static CMemoryException* instead of std::bad_alloc -// (see ace/OS_Memory.h). This MFC exception object needs to be cleaned up -// by calling its Delete() method. -#if defined (ACE_HAS_MFC) && (ACE_HAS_MFC == 1) -# if !defined (ACE_NEW_THROWS_EXCEPTIONS) -# define ACE_NEW_THROWS_EXCEPTIONS -# endif -# if defined (ACE_bad_alloc) -# undef ACE_bad_alloc -# endif -# define ACE_bad_alloc CMemoryException *e -# if defined (ACE_del_bad_alloc) -# undef ACE_del_bad_alloc -# endif -# define ACE_del_bad_alloc e->Delete(); -#endif /* ACE_HAS_MFC && ACE_HAS_MFC==1 */ - -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -// must have _MT defined to include multithreading -// features from win32 headers -# if !defined(_MT) && !defined (ACE_HAS_WINCE) -// *** DO NOT *** defeat this error message by defining _MT yourself. -// On MSVC, this is changed by selecting the Multithreaded -// DLL or Debug Multithreaded DLL in the Project Settings -// under C++ Code Generation. -# error You must link against multi-threaded libraries when using ACE (check your project settings) -# endif /* !_MT && !ACE_HAS_WINCE */ -#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ - -#include -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA 1 - -#define ACE_LACKS_DIRENT_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_INTTYPES_H -#define ACE_LACKS_NETDB_H -#define ACE_LACKS_NET_IF_H -#define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_IOCTL_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_MMAN_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_SYS_SOCKET_H -#define ACE_LACKS_SYS_TIME_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_UCONTEXT_H - -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_REGEX_H - -#define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -#define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") - -#define ACE_STRTOULL_EQUIVALENT ::_strtoui64 -#define ACE_WCSTOOULL_EQUIVALENT ::_wcstoui64 - -// Turn off warnings for /W4 -// To resume any of these warning: #pragma warning(default: 4xxx) -// which should be placed after these defines - -#if !defined (ALL_WARNINGS) && defined(_MSC_VER) && !defined(ghs) && !defined(__MINGW32__) -# pragma warning(disable: 4127) /* constant expression for TRACE/ASSERT */ -# pragma warning(disable: 4134) /* message map member fxn casts */ -# pragma warning(disable: 4511) /* private copy constructors are good to have */ -# pragma warning(disable: 4512) /* private operator= are good to have */ -# pragma warning(disable: 4514) /* unreferenced inlines are common */ -# pragma warning(disable: 4710) /* private constructors are disallowed */ -# pragma warning(disable: 4705) /* statement has no effect in optimized code */ -# pragma warning(disable: 4791) /* loss of debugging info in retail version */ -# pragma warning(disable: 4275) /* deriving exported class from non-exported */ -# pragma warning(disable: 4251) /* using non-exported as public in exported */ -# pragma warning(disable: 4786) /* identifier was truncated to '255' characters in the browser information */ -# pragma warning(disable: 4097) /* typedef-name used as synonym for class-name */ -# pragma warning(disable: 4800) /* converting int to boolean */ -# if defined (__INTEL_COMPILER) -# pragma warning(disable: 1744) /* field of class type without a DLL interface used in a class with a DLL interface */ -# pragma warning(disable: 1738) -# endif -#endif /* !ALL_WARNINGS && _MSV_VER && !ghs && !__MINGW32__ */ - -// STRICT type checking in WINDOWS.H enhances type safety for Windows -// programs by using distinct types to represent all the different -// HANDLES in Windows. So for example, STRICT prevents you from -// mistakenly passing an HPEN to a routine expecting an HBITMAP. -// Note that we only use this if we -# if defined (ACE_HAS_STRICT) && (ACE_HAS_STRICT != 0) -# if !defined (STRICT) /* may already be defined */ -# define STRICT -# endif /* !STRICT */ -# endif /* ACE_HAS_STRICT */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_MSVC_H */ - diff --git a/dep/include/ace/config-win32.h b/dep/include/ace/config-win32.h deleted file mode 100644 index 2cf39c60491..00000000000 --- a/dep/include/ace/config-win32.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file config-win32.h - * - * $Id: config-win32.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @brief Microsoft Windows configuration file. - * - * This file is the ACE configuration file for all of Microsoft Windows - * platforms that ACE runs on. Based on preprocessor definitions, it - * includes other more specific configuration files. - * - * @author Darrell Brunsch - */ -//============================================================================= - -#ifndef ACE_CONFIG_WIN32_H -#define ACE_CONFIG_WIN32_H -#include /**/ "ace/pre.h" - -// by derex ,I include the win32 specific header here, -// this violates the idea of this file a bit ;) -#define ACE_HAS_REACTOR_NOTIFICATION_QUEUE - -// Max amount of connections for non-epoll platforms -#ifndef FD_SETSIZE - #define FD_SETSIZE 4096 -#endif - -//disable some deprecate warnings on windows -#ifndef _CRT_NONSTDC_NO_WARNINGS - #define _CRT_NONSTDC_NO_WARNINGS -#endif - -#ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS -#endif - -#ifndef _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE -#endif - -#ifndef _CRT_NONSTDC_NO_DEPRECATE - #define _CRT_NONSTDC_NO_DEPRECATE -#endif - -#ifndef _WINDOWS - #define _WINDOWS -#endif - -// end custom config stuff - -// NOTE: Please do not add anything besides #include's here. Put other stuff -// (definitions, etc.) in the included headers - -// We need to ensure that for Borland vcl.h can be included before -// windows.h. So we will not include config-win32-common.h from here, -// but instead let it be included at the appropriate place in -// config-win32-borland.h. -#if !defined (__BORLANDC__) -# include "ace/config-win32-common.h" -#endif /* !__BORLANDC__ */ - -// Include the config-win32-* file specific to the compiler -#if defined (__BORLANDC__) -# include "ace/config-win32-borland.h" -#elif defined (_MSC_VER) -# include "ace/config-win32-msvc.h" -#elif defined (ghs) -# include "ace/config-win32-ghs.h" -#elif defined (__MINGW32__) -# include "ace/config-win32-mingw.h" -#elif defined (__DMC__) -# include "ace/config-win32-dmc.h" -#else -# error Compiler is not supported -#endif - -// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses -#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED - -// TODO remove this at some point when we add ACE::init and ACE::fini -// by derex -#ifdef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#undef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#endif //ACE_HAS_NONSTATIC_OBJECT_MANAGER - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_H */ - - diff --git a/dep/include/ace/iosfwd.h b/dep/include/ace/iosfwd.h deleted file mode 100644 index 1dc1c581213..00000000000 --- a/dep/include/ace/iosfwd.h +++ /dev/null @@ -1,99 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file iosfwd.h - * - * $Id: iosfwd.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Irfan Pyarali - * - * This file contains the portability ugliness for the Standard C++ - * Library. As implementations of the "standard" emerge, this file - * will need to be updated. - * - * This files deals with forward declaration for the stream - * classes. Remember that since the new Standard C++ Library code - * for streams uses templates, simple forward declaration will not - * work. - */ -//============================================================================= - -#ifndef ACE_IOSFWD_H -#define ACE_IOSFWD_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) - -#if defined (__APPLE_CC__) -// Should this really be here? dhinton -// FUZZ: disable check_for_streams_include -# include "ace/streams.h" -#endif - -#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ - (ACE_HAS_STANDARD_CPP_LIBRARY != 0) - -# if !defined (ACE_USES_OLD_IOSTREAMS) -# include /**/ -# else - // @note If these forward declarations don't work (e.g. aren't - // portable), we may have to include "ace/streams.h" as a last - // resort. Doing so would defeat the purpose of this header, - // unfortunately. - class ios; - class streambuf; - class istream; - class ostream; - class iostream; - class filebuf; - class ifstream; - class ofstream; - class fstream; -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) - -# if !defined (ACE_USES_OLD_IOSTREAMS) - // Make these available in the global name space - using std::ios; - using std::streambuf; - using std::istream; - using std::ostream; - using std::iostream; - using std::filebuf; - using std::ifstream; - using std::ofstream; - using std::fstream; -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - -#else /* ! ACE_HAS_STANDARD_CPP_LIBRARY */ - - class ios; - class streambuf; - class istream; - class ostream; - class iostream; - class filebuf; - class ifstream; - class ofstream; - class fstream; - -# endif /* ! ACE_HAS_STANDARD_CPP_LIBRARY */ - -#include /**/ "ace/post.h" - -#endif /* ACE_LACKS_IOSTREAM_TOTALLY */ - -#endif /* ACE_IOSFWD_H */ - diff --git a/dep/include/ace/os_include/arpa/os_inet.h b/dep/include/ace/os_include/arpa/os_inet.h deleted file mode 100644 index 37538c0824d..00000000000 --- a/dep/include/ace/os_include/arpa/os_inet.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_inet.h - * - * definitions for internet operations - * - * $Id: os_inet.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_ARPA_OS_INET_H -#define ACE_OS_INCLUDE_ARPA_OS_INET_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/netinet/os_in.h" - -#if !defined (ACE_LACKS_ARPA_INET_H) - extern "C" { -# include /**/ - } -#endif /* !ACE_LACKS_ARPA_INET_H */ - -#if defined (ACE_VXWORKS) -# include /**/ -#endif /* ACE_VXWORKS */ - -/** - * In some environments it is useful to swap the bytes on write, for - * instance: a fast server can be feeding a lot of slow clients that - * happen to have the wrong byte order. - * Because this is a rarely used feature we disable it by default to - * minimize footprint. - * This macro enables the functionality, but we still need a way to - * activate it on a per-connection basis. - */ -// #define ACE_ENABLE_SWAP_ON_WRITE - -/** - * In some environements we never need to swap bytes when reading, for - * instance embebbed systems (such as avionics) or homogenous - * networks. - * Setting this macro disables the capabilities to demarshall streams - * in the wrong byte order. - */ -// #define ACE_DISABLE_SWAP_ON_READ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_INET_ATON_PROTOTYPE) - int inet_aton (const char *, struct in_addr *); -#endif /* ACE_LACKS_INET_ATON_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_ARPA_OS_INET_H */ - diff --git a/dep/include/ace/os_include/net/os_if.h b/dep/include/ace/os_include/net/os_if.h deleted file mode 100644 index da099f89dc2..00000000000 --- a/dep/include/ace/os_include/net/os_if.h +++ /dev/null @@ -1,120 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_if.h - * - * sockets local interfaces - * - * $Id: os_if.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_NET_OS_IF_H -#define ACE_OS_INCLUDE_NET_OS_IF_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_NET_IF_H) - // This part if to avoid STL name conflict with the map structure - // in net/if.h. -# if defined (ACE_HAS_STL_MAP_CONFLICT) -# define map _Resource_Allocation_Map_ -# endif /* ACE_HAS_STL_MAP_CONFLICT */ - extern "C" { -# include /**/ - } -# if defined (ACE_HAS_STL_MAP_CONFLICT) -# undef map -# endif /* ACE_HAS_STL_MAP_CONFLICT */ -# if defined (HPUX) && defined (IOR) - /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h - and we don't want that definition. See IOP_IORC.h. - Thanks to Torsten Kopper for this patch.*/ -# undef IOR -# endif /* HPUX && IOR */ -#endif /* !ACE_LACKS_NET_IF_H */ - -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) -# include /**/ -#endif /* ACE_HAS_WINSOCK2 */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_HAS_BROKEN_IF_HEADER) - struct ifafilt; -#endif /* ACE_HAS_BROKEN_IF_HEADER */ - -#if defined (ACE_LACKS_IFREQ) -struct ifreq { -#define IFNAMSIZ 16 - char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - union { - struct sockaddr ifru_addr; - struct sockaddr ifru_dstaddr; - struct sockaddr ifru_broadaddr; - short ifru_flags; - int ifru_metric; - int ifru_mtu; - int ifru_phys; - int ifru_media; - caddr_t ifru_data; - int (*ifru_tap)(struct ifnet *, struct ether_header *, struct mbuf *); - } ifr_ifru; -#define ifr_addr ifr_ifru.ifru_addr /* address */ -#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ -#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -#define ifr_flags ifr_ifru.ifru_flags /* flags */ -#define ifr_metric ifr_ifru.ifru_metric /* metric */ -#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ -#define ifr_phys ifr_ifru.ifru_phys /* physical wire */ -#define ifr_media ifr_ifru.ifru_media /* physical media */ -#define ifr_data ifr_ifru.ifru_data /* for use by interface */ -#define ifr_tap ifr_ifru.ifru_tap /* tap function */ -}; -#endif /* ACE_LACKS_IFREQ */ - -#if defined (ACE_LACKS_IFCONF) -struct ifconf { - int ifc_len; - union { - caddr_t ifcu_buf; - struct ifreq *ifcu_req; - } ifc_ifcu; -#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ -#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ - }; -#endif /* ACE_LACKS_IFCONF */ - -#if !defined (IFF_UP) -# define IFF_UP 0x1 -#endif /* IFF_UP */ - -#if !defined (IFF_LOOPBACK) -# define IFF_LOOPBACK 0x8 -#endif /* IFF_LOOPBACK */ - -#if !defined (IFF_BROADCAST) -# define IFF_BROADCAST 0x2 -#endif /* IFF_BROADCAST */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_NET_OS_IF_H */ - diff --git a/dep/include/ace/os_include/netinet/os_in.h b/dep/include/ace/os_include/netinet/os_in.h deleted file mode 100644 index c90fb8fa8d4..00000000000 --- a/dep/include/ace/os_include/netinet/os_in.h +++ /dev/null @@ -1,186 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_in.h - * - * Internet address family - * - * $Id: os_in.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_NETINET_OS_IN_H -#define ACE_OS_INCLUDE_NETINET_OS_IN_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_inttypes.h" -#include "ace/os_include/sys/os_socket.h" - -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) -# include /**/ -#endif /* ACE_HAS_WINSOCK2 */ - -#if !defined (ACE_LACKS_NETINET_IN_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ - extern "C" { -# include /**/ - } -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -#endif /* !ACE_LACKS_NETINET_IN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# if defined (ACE_HAS_PHARLAP_RT) -# define ACE_IPPROTO_TCP SOL_SOCKET -# else -# define ACE_IPPROTO_TCP IPPROTO_TCP -# endif /* ACE_HAS_PHARLAP_RT */ - -# if !defined (ACE_HAS_IP_MULTICAST) && defined (ACE_LACKS_IP_ADD_MEMBERSHIP) - // Even if ACE_HAS_IP_MULTICAST is not defined, if IP_ADD_MEMBERSHIP - // is defined, assume that the ip_mreq struct is also defined - // (presumably in netinet/in.h). - struct ip_mreq - { - /// IP multicast address of group - struct in_addr imr_multiaddr; - /// Local IP address of interface - struct in_addr imr_interface; - }; -# endif /* ! ACE_HAS_IP_MULTICAST && ACE_LACKS_IP_ADD_MEMBERSHIP */ - -# if defined (ACE_LACKS_IN_ADDR) - struct in_addr - { - u_long s_addr; - }; -# endif /* ACE_LACKS_IN_ADDR */ - -# if defined (ACE_LACKS_SOCKADDR_IN) - struct sockaddr_in - { - short sin_family; // e.g. AF_INET - unsigned short sin_port; // e.g. htons(3490) - struct in_addr sin_addr; // see struct in_addr, below - char sin_zero[8]; // zero this if you want to - }; -# endif /* ACE_LACKS_SOCKADDR_IN */ - -# if defined (ACE_LACKS_SOCKADDR_UN) - struct sockaddr_un { - u_char sun_len; /* sockaddr len including null */ - u_char sun_family; /* AF_UNIX */ - char sun_path[104]; /* path name (gag) */ - }; -#endif /* ACE_LACKS_SOCKADDR_UN */ - -# if defined (ACE_LACKS_IP_MREQ) - struct ip_mreq - { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ - }; -# endif /* ACE_LACKS_IP_MREQ */ - -#if !defined (IPPORT_RESERVED) -# define IPPORT_RESERVED 1024 -#endif /* !IPPORT_RESERVED */ - -#if !defined (IPPORT_USERRESERVED) -# define IPPORT_USERRESERVED 5000 -#endif /* !IPPORT_USERRESERVED */ - -// Define INET loopback address constant if it hasn't been defined -// Dotted Decimal 127.0.0.1 == Hexidecimal 0x7f000001 -#if !defined (INADDR_LOOPBACK) -# define INADDR_LOOPBACK ((ACE_UINT32) 0x7f000001) -#endif /* INADDR_LOOPBACK */ - -// The INADDR_NONE address is generally 255.255.255.255. -#if !defined (INADDR_NONE) -# define INADDR_NONE ((ACE_UINT32) 0xffffffff) -#endif /* INADDR_NONE */ - -// Define INET string length constants if they haven't been defined -// -// for IPv4 dotted-decimal -#if !defined (INET_ADDRSTRLEN) -# define INET_ADDRSTRLEN 16 -#endif /* INET_ADDRSTRLEN */ -// -// for IPv6 hex string -#if !defined (INET6_ADDRSTRLEN) -# define INET6_ADDRSTRLEN 46 -#endif /* INET6_ADDRSTRLEN */ - -# if !defined (IP_DROP_MEMBERSHIP) -# define IP_DROP_MEMBERSHIP 0 -# endif /* IP_DROP_MEMBERSHIP */ - -# if !defined (IP_ADD_MEMBERSHIP) -# define IP_ADD_MEMBERSHIP 0 -# define ACE_LACKS_IP_ADD_MEMBERSHIP -# endif /* IP_ADD_MEMBERSHIP */ - -# if !defined (IP_DEFAULT_MULTICAST_TTL) -# define IP_DEFAULT_MULTICAST_TTL 0 -# endif /* IP_DEFAULT_MULTICAST_TTL */ - -# if !defined (IP_DEFAULT_MULTICAST_LOOP) -# define IP_DEFAULT_MULTICAST_LOOP 0 -# endif /* IP_DEFAULT_MULTICAST_LOOP */ - -# if !defined (IP_MULTICAST_IF) -# define IP_MULTICAST_IF 0 -# endif /* IP_MULTICAST_IF */ - -# if !defined (IP_MULTICAST_TTL) -# define IP_MULTICAST_TTL 1 -# endif /* IP_MULTICAST_TTL */ - -# if !defined (IP_MULTICAST_LOOP) -# define IP_MULTICAST_LOOP 2 -# endif /* IP_MULTICAST_LOOP */ - -# if !defined (IP_MAX_MEMBERSHIPS) -# define IP_MAX_MEMBERSHIPS 0 -# endif /* IP_MAX_MEMBERSHIP */ - -# if !defined (IPPROTO_IP) -# define IPPROTO_IP 0 -# endif /* IPPROTO_IP */ - -# if !defined (IPPROTO_TCP) -# define IPPROTO_TCP 6 -# endif /* IPPROTO_TCP */ - -# if !defined (INADDR_ANY) -# define INADDR_ANY (u_long)0x00000000 -# endif /* INADDR_ANY */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_NETINET_OS_IN_H */ - diff --git a/dep/include/ace/os_include/netinet/os_tcp.h b/dep/include/ace/os_include/netinet/os_tcp.h deleted file mode 100644 index 9f60cd91af8..00000000000 --- a/dep/include/ace/os_include/netinet/os_tcp.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_tcp.h - * - * definitions for the Internet Transmission Control Protocol (TCP) - * - * $Id: os_tcp.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_NETINET_OS_TCP_H -#define ACE_OS_INCLUDE_NETINET_OS_TCP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_NETINET_TCP_H) -# include /**/ -#endif /* !ACE_LACKS_NETIINET_TCP_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# if !defined (TCP_NODELAY) -# define TCP_NODELAY 0x01 -# endif /* TCP_NODELAY */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_NETINET_OS_TCP_H */ - diff --git a/dep/include/ace/os_include/os_aio.h b/dep/include/ace/os_include/os_aio.h deleted file mode 100644 index 2011403ff3c..00000000000 --- a/dep/include/ace/os_include/os_aio.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_aio.h - * - * asynchronous input and output (REALTIME) - * - * $Id: os_aio.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_AIO_H -#define ACE_OS_INCLUDE_OS_AIO_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Inclusion of the header may make visible symbols defined in -// the headers , , , and . - -#include "ace/os_include/os_signal.h" // for sigevent - -#if !defined (ACE_LACKS_AIO_H) -# include /**/ -#endif /* !ACE_LACKS_AIO_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_AIO_H */ - diff --git a/dep/include/ace/os_include/os_assert.h b/dep/include/ace/os_include/os_assert.h deleted file mode 100644 index 1c1ed53d852..00000000000 --- a/dep/include/ace/os_include/os_assert.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_assert.h - * - * verify program assertion - * - * $Id: os_assert.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ASSERT_H -#define ACE_OS_INCLUDE_OS_ASSERT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ASSERT_H) -# include /**/ -#endif /* !ACE_LACKS_ASSERT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_ASSERT_MACRO) -# define assert(expr) -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ASSERT_H */ - diff --git a/dep/include/ace/os_include/os_byteswap.h b/dep/include/ace/os_include/os_byteswap.h deleted file mode 100644 index fd1ff253fce..00000000000 --- a/dep/include/ace/os_include/os_byteswap.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_byteswap.h - * - * Byteswap methods - * - * $Id: os_byteswap.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_BYTESWAP_H -#define ACE_OS_INCLUDE_OS_BYTESWAP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_BYTESWAP_H) -# include /**/ -#endif /* !ACE_HAS_INTRIN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_BYTESWAP_H */ - diff --git a/dep/include/ace/os_include/os_complex.h b/dep/include/ace/os_include/os_complex.h deleted file mode 100644 index 27ce474b6dc..00000000000 --- a/dep/include/ace/os_include/os_complex.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_complex.h - * - * complex arithmetic - * - * $Id: os_complex.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_COMPLEX_H -#define ACE_OS_INCLUDE_OS_COMPLEX_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_COMPLEX_H) -# include /**/ -#endif /* !ACE_LACKS_COMPLEX_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_COMPLEX_H */ - diff --git a/dep/include/ace/os_include/os_cpio.h b/dep/include/ace/os_include/os_cpio.h deleted file mode 100644 index 09e536d521a..00000000000 --- a/dep/include/ace/os_include/os_cpio.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_cpio.h - * - * cpio archive values - * - * $Id: os_cpio.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_CPIO_H -#define ACE_OS_INCLUDE_OS_CPIO_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_CPIO_H) -# include /**/ -#endif /* !ACE_LACKS_CPIO_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_CPIO_H */ - diff --git a/dep/include/ace/os_include/os_ctype.h b/dep/include/ace/os_include/os_ctype.h deleted file mode 100644 index 61a3df06375..00000000000 --- a/dep/include/ace/os_include/os_ctype.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ctype.h - * - * character types - * - * $Id: os_ctype.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_CTYPE_H -#define ACE_OS_INCLUDE_OS_CTYPE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_CTYPE_H) -# include /**/ -#endif /* !ACE_LACKS_CTYPE_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -// @todo move the is* and is* emulation methods in ACE_OS here -// and let ACE_OS just call them. - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_CTYPE_H */ - diff --git a/dep/include/ace/os_include/os_dirent.h b/dep/include/ace/os_include/os_dirent.h deleted file mode 100644 index 4e81e94d1bf..00000000000 --- a/dep/include/ace/os_include/os_dirent.h +++ /dev/null @@ -1,109 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_dirent.h - * - * format of directory entries - * - * $Id: os_dirent.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_DIRENT_H -#define ACE_OS_INCLUDE_OS_DIRENT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" -#include "ace/os_include/os_limits.h" - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -# include "ace/os_include/os_unistd.h" // VxWorks needs this to compile -#endif /* ACE_VXWORKS */ - -#if !defined (ACE_LACKS_DIRENT_H) -# include /**/ -#endif /* !ACE_LACKS_DIRENT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if !defined (MAXNAMLEN) -# define MAXNAMLEN NAME_MAX -#endif /* !MAXNAMLEN */ - -// At least compile on some of the platforms without info yet. -#if !defined (ACE_HAS_DIRENT) -typedef int ACE_DIR; -struct dirent { -}; -#endif /* ACE_HAS_DIRENT */ - -#if defined (ACE_LACKS_STRUCT_DIR) -struct dirent { - unsigned short d_ino; - unsigned short d_off; - unsigned short d_reclen; - // This must be a ACE_TCHAR * and not a one element - // ACE_TCHAR array. It causes problems on wide - // character builds with Visual C++ 6.0. - ACE_TCHAR *d_name; -}; - -#define ACE_DIRENT dirent - -struct ACE_DIR { - /// The name of the directory we are looking into - ACE_TCHAR *directory_name_; - - /// Remember the handle between calls. - HANDLE current_handle_; - - /// The struct for the results - ACE_DIRENT *dirent_; - - /// The struct for intermediate results. - ACE_TEXT_WIN32_FIND_DATA fdata_; - - /// A flag to remember if we started reading already. - int started_reading_; -}; -#elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR) -#define ACE_DIRENT wdirent -typedef wDIR ACE_DIR; -#else -#define ACE_DIRENT dirent -typedef DIR ACE_DIR; -#endif /* ACE_LACKS_STRUCT_DIR */ - -#if defined (ACE_LACKS_SCANDIR_PROTOTYPE) -int scandir (const char *, - struct dirent ***, - int (*) (const struct dirent *), - int (*) (const void *, const void *)); -#endif /* ACE_LACKS_SCANDIR_PROTOTYPE */ - -#if defined (ACE_LACKS_ALPHASORT_PROTOTYPE) -int alphasort (const void *, const void *); -#endif /* ACE_LACKS_ALPHASORT_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_DIRENT_H */ - diff --git a/dep/include/ace/os_include/os_dlfcn.h b/dep/include/ace/os_include/os_dlfcn.h deleted file mode 100644 index f7691ad8a58..00000000000 --- a/dep/include/ace/os_include/os_dlfcn.h +++ /dev/null @@ -1,102 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_dlfcn.h - * - * dynamic linking - * - * $Id: os_dlfcn.h 82273 2008-07-09 14:21:45Z jtc $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_DLFCN_H -#define ACE_OS_INCLUDE_OS_DLFCN_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_DLFCN_H) -# include /**/ -#endif /* !ACE_LACKS_DLFCN_H */ - -#if defined (__hpux) -# if defined(__GNUC__) || __cplusplus >= 199707L -# include /**/ -# else -# include /**/ -# endif /* (g++ || HP aC++) vs. HP C++ */ -#endif /* __hpux */ - -#if defined (ACE_VXWORKS) && !defined (__RTP__) -# include /**/ /* for module load */ -# include /**/ /* for module unload */ -# include /**/ /* for findSymbol */ -# include /**/ /* for global symbol table */ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (_M_UNIX) - int _dlclose (void *); - char *_dlerror (void); - void *_dlopen (const char *, int); - void * _dlsym (void *, const char *); -#endif /* _M_UNIX */ - -/* Set the proper handle type for dynamically-loaded libraries. */ -/* Also define a default 'mode' for loading a library - the names and values */ -/* differ between OSes, so if you write code that uses the mode, be careful */ -/* of the platform differences. */ -#if defined (ACE_WIN32) - // Dynamic loading-related types - used for dlopen and family. - typedef HINSTANCE ACE_SHLIB_HANDLE; -# define ACE_SHLIB_INVALID_HANDLE 0 -# define ACE_DEFAULT_SHLIB_MODE 0 -#elif defined (ACE_HAS_SVR4_DYNAMIC_LINKING) - typedef void *ACE_SHLIB_HANDLE; -# define ACE_SHLIB_INVALID_HANDLE 0 - // This is needed to for dynamic_cast to work properly on objects passed to - // libraries. -# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY | RTLD_GLOBAL -#elif defined (__hpux) - typedef shl_t ACE_SHLIB_HANDLE; -# define ACE_SHLIB_INVALID_HANDLE 0 -# define ACE_DEFAULT_SHLIB_MODE BIND_DEFERRED | DYNAMIC_PATH -#else /* !ACE_WIN32 && !ACE_HAS_SVR4_DYNAMIC_LINKING && !__hpux */ - typedef void *ACE_SHLIB_HANDLE; -# define ACE_SHLIB_INVALID_HANDLE 0 -# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY -#endif /* ACE_WIN32 */ - -#if !defined (RTLD_LAZY) -#define RTLD_LAZY 1 -#endif /* !RTLD_LAZY */ - -#if !defined (RTLD_NOW) -#define RTLD_NOW 2 -#endif /* !RTLD_NOW */ - -#if !defined (RTLD_GLOBAL) -#define RTLD_GLOBAL 3 -#endif /* !RTLD_GLOBAL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_DLFCN_H */ - diff --git a/dep/include/ace/os_include/os_errno.h b/dep/include/ace/os_include/os_errno.h deleted file mode 100644 index 6534aa8c7c8..00000000000 --- a/dep/include/ace/os_include/os_errno.h +++ /dev/null @@ -1,154 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_errno.h - * - * system error numbers - * - * $Id: os_errno.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ERRNO_H -#define ACE_OS_INCLUDE_OS_ERRNO_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ERRNO_H) -# include /**/ -#endif /* !ACE_LACKS_ERRNO_H */ - -#if defined (ACE_VXWORKS) -// Needed for VxWorks to pickup errnoSet() -#include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_WIN32) - // error code mapping for windows -# define ETIME ERROR_SEM_TIMEOUT -# define EWOULDBLOCK WSAEWOULDBLOCK -# define EINPROGRESS WSAEINPROGRESS -# define EALREADY WSAEALREADY -# define ENOTSOCK WSAENOTSOCK -# define EDESTADDRREQ WSAEDESTADDRREQ -# define EMSGSIZE WSAEMSGSIZE -# define EPROTOTYPE WSAEPROTOTYPE -# define ENOPROTOOPT WSAENOPROTOOPT -# define EPROTONOSUPPORT WSAEPROTONOSUPPORT -# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -# define EOPNOTSUPP WSAEOPNOTSUPP -# define EPFNOSUPPORT WSAEPFNOSUPPORT -# define EAFNOSUPPORT WSAEAFNOSUPPORT -# define EADDRINUSE WSAEADDRINUSE -# define EADDRNOTAVAIL WSAEADDRNOTAVAIL -# define ENETDOWN WSAENETDOWN -# define ENETUNREACH WSAENETUNREACH -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOBUFS WSAENOBUFS -# define EISCONN WSAEISCONN -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# define ETOOMANYREFS WSAETOOMANYREFS -# define ETIMEDOUT WSAETIMEDOUT -# define ECONNREFUSED WSAECONNREFUSED -# define ELOOP WSAELOOP -# define EHOSTDOWN WSAEHOSTDOWN -# define EHOSTUNREACH WSAEHOSTUNREACH -# define EPROCLIM WSAEPROCLIM -# define EUSERS WSAEUSERS -# define EDQUOT WSAEDQUOT -# define ESTALE WSAESTALE -# define EREMOTE WSAEREMOTE - // Grrr! ENAMETOOLONG and ENOTEMPTY are already defined by the horrible - // 'standard' library. - // #define ENAMETOOLONG WSAENAMETOOLONG -# define EADDRINUSE WSAEADDRINUSE - - // CE needs this... -# if !defined (EPERM) -# define EPERM ERROR_ACCESS_DENIED -# endif -#endif /* ACE_WIN32 */ - -#if defined (ACE_HAS_H_ERRNO) -void herror (const char *str); -#endif /* ACE_HAS_H_ERRNO */ - -#if !defined (ACE_WIN32) && defined (ACE_LACKS_T_ERRNO) -extern int t_errno; -#endif /* ACE_WIN32 && ACE_LACKS_T_ERRNO */ - -#if !defined (ENOSYS) -# define ENOSYS EFAULT /* Operation not supported or unknown error. */ -#endif /* !ENOSYS */ - -#if !defined (ENOTSUP) -# define ENOTSUP ENOSYS /* Operation not supported. */ -#endif /* !ENOTSUP */ - -#if !defined (ESUCCESS) -# define ESUCCESS 0 -#endif /* !ESUCCESS */ - -#if !defined (EIDRM) -# define EIDRM 0 -#endif /* !EIDRM */ - -#if !defined (ENFILE) -# define ENFILE EMFILE /* No more socket descriptors are available. */ -#endif /* !ENFILE */ - -#if !defined (ECOMM) - // Not the same, but ECONNABORTED is provided on NT. -# define ECOMM ECONNABORTED -#endif /* ECOMM */ - -#if !defined (EDEADLK) -# define EDEADLK 1000 /* Some large number.... */ -#endif /* !EDEADLK */ - -#if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */ -# define ENXIO 6 -#endif /* ENXIO */ - -#if !defined (ETIMEDOUT) && defined (ETIME) -# define ETIMEDOUT ETIME -#endif /* ETIMEDOUT */ - -#if !defined (ETIME) && defined (ETIMEDOUT) -# define ETIME ETIMEDOUT -#endif /* ETIMED */ - -#if !defined (EBUSY) -# define EBUSY ETIME -#endif /* EBUSY */ - -#if !defined (ECANCELED) -# define ECANCELED 125 -#endif /* ECANCELED */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ERRNO_H */ - diff --git a/dep/include/ace/os_include/os_fcntl.h b/dep/include/ace/os_include/os_fcntl.h deleted file mode 100644 index ad5beeb9511..00000000000 --- a/dep/include/ace/os_include/os_fcntl.h +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_fcntl.h - * - * file control options - * - * $Id: os_fcntl.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FCNTL_H -#define ACE_OS_INCLUDE_OS_FCNTL_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_stat.h" -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_FCNTL_H) -# include /**/ -#endif /* !ACE_LACKS_FCNTL_H */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -// for creat(), open() -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (__BORLANDC__) -# define _O_CREAT O_CREAT -# define _O_EXCL O_EXCL -# define _O_TRUNC O_TRUNC - // 0x0800 is used for O_APPEND. 0x08 looks free. -# define _O_TEMPORARY 0x08 /* see fcntl.h */ -# define _O_RDWR O_RDWR -# define _O_WRONLY O_WRONLY -# define _O_RDONLY O_RDONLY -# define _O_APPEND O_APPEND -# define _O_BINARY O_BINARY -# define _O_TEXT O_TEXT -#endif /* __BORLANDC__ */ - -#if defined (__DMC__) -# define _O_TEMPORARY 0x08 /* see fcntl.h */ -#endif /* __DMC__ */ - -// defined Win32 specific macros for UNIX platforms -#if !defined (O_BINARY) -# define O_BINARY 0 -#endif /* O_BINARY */ -#if !defined (_O_BINARY) -# define _O_BINARY O_BINARY -#endif /* _O_BINARY */ -#if !defined (O_TEXT) -# define O_TEXT 0 -#endif /* O_TEXT */ -#if !defined (_O_TEXT) -# define _O_TEXT O_TEXT -#endif /* _O_TEXT */ -#if !defined (O_RAW) -# define O_RAW 0 -#endif /* O_RAW */ -#if !defined (_O_RAW) -# define _O_RAW O_RAW -#endif /* _O_RAW */ - -#if defined (ACE_WIN32) -# define O_NDELAY 1 -#endif /* ACE_WIN32 */ - -# if !defined (O_NONBLOCK) -# define O_NONBLOCK 1 -# endif /* O_NONBLOCK */ - -#if defined (ACE_HAS_POSIX_NONBLOCK) -# define ACE_NONBLOCK O_NONBLOCK -#else -# define ACE_NONBLOCK O_NDELAY -#endif /* ACE_HAS_POSIX_NONBLOCK */ - -# if !defined (F_GETFL) -# define F_GETFL 0 -# endif /* F_GETFL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FCNTL_H */ - diff --git a/dep/include/ace/os_include/os_fenv.h b/dep/include/ace/os_include/os_fenv.h deleted file mode 100644 index a178c04c91b..00000000000 --- a/dep/include/ace/os_include/os_fenv.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_fenv.h - * - * floating-point environment - * - * $Id: os_fenv.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FENV_H -#define ACE_OS_INCLUDE_OS_FENV_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_FENV_H) -# include /**/ -#endif /* !ACE_LACKS_FENV_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FENV_H */ - diff --git a/dep/include/ace/os_include/os_float.h b/dep/include/ace/os_include/os_float.h deleted file mode 100644 index 6b114a5dc3e..00000000000 --- a/dep/include/ace/os_include/os_float.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_float.h - * - * floating types - * - * $Id: os_float.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FLOAT_H -#define ACE_OS_INCLUDE_OS_FLOAT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_FLOAT_H) -# include /**/ -#endif /* !ACE_LACKS_FLOAT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FLOAT_H */ - diff --git a/dep/include/ace/os_include/os_fmtmsg.h b/dep/include/ace/os_include/os_fmtmsg.h deleted file mode 100644 index 391e8606e27..00000000000 --- a/dep/include/ace/os_include/os_fmtmsg.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_fmtmsg.h - * - * message display structures - * - * $Id: os_fmtmsg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FMTMSG_H -#define ACE_OS_INCLUDE_OS_FMTMSG_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_FMTMSG_H) -# include /**/ -#endif /* !ACE_LACKS_FMTMSG_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FMTMSG_H */ - diff --git a/dep/include/ace/os_include/os_fnmatch.h b/dep/include/ace/os_include/os_fnmatch.h deleted file mode 100644 index 2f592ef46e1..00000000000 --- a/dep/include/ace/os_include/os_fnmatch.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_fnmatch.h - * - * filename-matching types - * - * $Id: os_fnmatch.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FNMATCH_H -#define ACE_OS_INCLUDE_OS_FNMATCH_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_FNMATCH_H) -# include /**/ -#endif /* !ACE_LACKS_FNMATCH_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FNMATCH_H */ - diff --git a/dep/include/ace/os_include/os_ftw.h b/dep/include/ace/os_include/os_ftw.h deleted file mode 100644 index ab4655f241b..00000000000 --- a/dep/include/ace/os_include/os_ftw.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ftw.h - * - * file tree traversal - * - * $Id: os_ftw.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_FTW_H -#define ACE_OS_INCLUDE_OS_FTW_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_stat.h" - -#if !defined (ACE_LACKS_FTW_H) -# include /**/ -#endif /* !ACE_LACKS_FTW_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_FTW_H */ - diff --git a/dep/include/ace/os_include/os_glob.h b/dep/include/ace/os_include/os_glob.h deleted file mode 100644 index 2ffdbab53e6..00000000000 --- a/dep/include/ace/os_include/os_glob.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_glob.h - * - * pathname pattern-matching types - * - * $Id: os_glob.h 81692 2008-05-14 12:25:02Z johnnyw $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_GLOB_H -#define ACE_OS_INCLUDE_OS_GLOB_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_GLOB_H) -# include /**/ -#endif /* !ACE_LACKS_GLOB_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_GLOB_H */ - diff --git a/dep/include/ace/os_include/os_grp.h b/dep/include/ace/os_include/os_grp.h deleted file mode 100644 index bc0741e9de2..00000000000 --- a/dep/include/ace/os_include/os_grp.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_grp.h - * - * group structure - * - * $Id: os_grp.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_GRP_H -#define ACE_OS_INCLUDE_OS_GRP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" // for gid_t - -#if !defined (ACE_LACKS_GRP_H) -# include /**/ -#endif /* !ACE_LACKS_GRP_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_GRP_H */ - diff --git a/dep/include/ace/os_include/os_iconv.h b/dep/include/ace/os_include/os_iconv.h deleted file mode 100644 index 14a69870112..00000000000 --- a/dep/include/ace/os_include/os_iconv.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_iconv.h - * - * codeset conversion facility - * - * $Id: os_iconv.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ICONV_H -#define ACE_OS_INCLUDE_OS_ICONV_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_ICONV_H) -# include /**/ -#endif /* !ACE_LACKS_ICONV_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ICONV_H */ - diff --git a/dep/include/ace/os_include/os_intrin.h b/dep/include/ace/os_include/os_intrin.h deleted file mode 100644 index d56951b6b57..00000000000 --- a/dep/include/ace/os_include/os_intrin.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_intrin.h - * - * Intrinsic methods - * - * $Id: os_intrin.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_INTRIN_H -#define ACE_OS_INCLUDE_OS_INTRIN_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_INTRIN_H) -# include /**/ -#endif /* !ACE_HAS_INTRIN_H */ - -#if defined (ACE_HAS_IA64INTRIN_H) -# include /**/ -#endif /* !ACE_HAS_IA64INTRIN_H */ - -#if defined (ACE_HAS_IA32INTRIN_H) -# include /**/ -#endif /* !ACE_HAS_IA32INTRIN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (_MSC_VER) && (_MSC_VER < 1400) && !(defined (__INTEL_COMPILER) && (__INTEL_COMPILER == 900)) -// See http://msdn2.microsoft.com/en-us/library/f24ya7ct(VS.71).aspx -LONG __cdecl _InterlockedIncrement (LONG volatile *Addend); -LONG __cdecl _InterlockedDecrement (LONG volatile *Addend); -LONG __cdecl _InterlockedExchange (LONG volatile *Target, LONG Value); -LONG __cdecl _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value); -#endif //_MSC_VER - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_INTRIN_H */ - diff --git a/dep/include/ace/os_include/os_inttypes.h b/dep/include/ace/os_include/os_inttypes.h deleted file mode 100644 index 86105a723a6..00000000000 --- a/dep/include/ace/os_include/os_inttypes.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_inttypes.h - * - * fixed size integer types - * - * $Id: os_inttypes.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_INTTYPES_H -#define ACE_OS_INCLUDE_OS_INTTYPES_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stdint.h" - -#if !defined (ACE_LACKS_INTTYPES_H) -# include /**/ -#endif /* !ACE_LACKS_INTTYPES_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -// @todo if needbe, we can define the macros if they aren't available. - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_INTTYPES_H */ - diff --git a/dep/include/ace/os_include/os_iso646.h b/dep/include/ace/os_include/os_iso646.h deleted file mode 100644 index bccc85f17ad..00000000000 --- a/dep/include/ace/os_include/os_iso646.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_iso646.h - * - * alternative spellings - * - * $Id: os_iso646.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ISO646_H -#define ACE_OS_INCLUDE_OS_ISO646_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ISO646_H) -# include /**/ -#endif /* !ACE_LACKS_ISO646_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ISO646_H */ - diff --git a/dep/include/ace/os_include/os_kstat.h b/dep/include/ace/os_include/os_kstat.h deleted file mode 100644 index 5ca91673d8e..00000000000 --- a/dep/include/ace/os_include/os_kstat.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_kstat.h - * - * $Id: os_kstat.h 81692 2008-05-14 12:25:02Z johnnyw $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_KSTAT_H -#define ACE_OS_INCLUDE_OS_KSTAT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_KSTAT) -# define ACE_HAS_KSTAT_H -#endif /* ACE_HAS_KSTAT */ - -#if defined (ACE_HAS_KSTAT_H) -# include -#endif /* ACE_HAS_KSTAT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_KSTAT_H */ - diff --git a/dep/include/ace/os_include/os_langinfo.h b/dep/include/ace/os_include/os_langinfo.h deleted file mode 100644 index 29648b459d8..00000000000 --- a/dep/include/ace/os_include/os_langinfo.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_langinfo.h - * - * language information constants - * - * $Id: os_langinfo.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_LANGINFO_H -#define ACE_OS_INCLUDE_OS_LANGINFO_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_nl_types.h" - -#if !defined (ACE_LACKS_LANGINFO_H) -# include /**/ -#endif /* !ACE_LACKS_LANGINFO_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_LANGINFO_H */ - diff --git a/dep/include/ace/os_include/os_libgen.h b/dep/include/ace/os_include/os_libgen.h deleted file mode 100644 index 5692f5effe1..00000000000 --- a/dep/include/ace/os_include/os_libgen.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_libgen.h - * - * definitions for pattern matching functions - * - * $Id: os_libgen.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_LIBGEN_H -#define ACE_OS_INCLUDE_OS_LIBGEN_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_LIBGEN_H) -# include /**/ -#endif /* !ACE_LACKS_LIBGEN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_LIBGEN_H */ - diff --git a/dep/include/ace/os_include/os_limits.h b/dep/include/ace/os_include/os_limits.h deleted file mode 100644 index 87eb978d541..00000000000 --- a/dep/include/ace/os_include/os_limits.h +++ /dev/null @@ -1,144 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_limits.h - * - * implementation-defined constants - * - * $Id: os_limits.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_LIMITS_H -#define ACE_OS_INCLUDE_OS_LIMITS_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_unistd.h" -#include "ace/os_include/os_stdio.h" // for FILENAME_MAX on Windows - -#if !defined (ACE_LACKS_LIMITS_H) -# include /**/ -#endif /* !ACE_LACKS_LIMITS_H */ - -#if !defined (ACE_LACKS_SYS_PARAM_H) -# include /**/ -#endif /* ACE_LACKS_SYS_PARAM_H */ - -// On VxWorks 5.5.1 _POSIX_TIMER_MAX is defined in time.h -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if ! defined (howmany) -# define howmany(x, y) (((x)+((y)-1))/(y)) -#endif /* howmany */ - -#if !defined (NAME_MAX) -# if defined (MAXNAMLEN) -# define NAME_MAX MAXNAMLEN -# elif defined (MAXNAMELEN) -# define NAME_MAX MAXNAMELEN -# elif defined (FILENAME_MAX) -# define NAME_MAX FILENAME_MAX -# elif defined (_MAX_FNAME) -# define NAME_MAX _MAX_FNAME -# else /* _MAX_FNAME */ -# define NAME_MAX 256 -# endif /* MAXNAMLEN */ -#endif /* !NAME_MAX */ - -#if !defined (MAXNAMELEN) -# define MAXNAMELEN NAME_MAX -#endif /* MAXNAMELEN */ - -#if !defined (HOST_NAME_MAX) -# define HOST_NAME_MAX 256 -#endif /* !HOST_NAME_MAX */ - -// Note that we are using PATH_MAX instead of _POSIX_PATH_MAX, since -// _POSIX_PATH_MAX is the *minimun* maximum value for PATH_MAX and is -// defined by POSIX as 256. -#if !defined (PATH_MAX) -# if defined (_MAX_PATH) -# define PATH_MAX _MAX_PATH -# elif defined (MAX_PATH) -# define PATH_MAX MAX_PATH -# else /* !_MAX_PATH */ -# define PATH_MAX 1024 -# endif /* _MAX_PATH */ -#endif /* !PATH_MAX */ - -// Leaving this for backward compatibility, but PATH_MAX should always be -// used directly. -#if !defined (MAXPATHLEN) -# define MAXPATHLEN PATH_MAX -#endif /* !MAXPATHLEN */ - -// This is defined by XOPEN to be a minimum of 16. POSIX.1g -// also defines this value. platform-specific config.h can -// override this if need be. -#if !defined (IOV_MAX) -# define IOV_MAX 16 -#endif /* IOV_MAX */ - -#if !defined (ACE_IOV_MAX) -# define ACE_IOV_MAX IOV_MAX -#endif /* ACE_IOV_MAX */ - -#if defined (ACE_VXWORKS) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x660)) && !defined (__RTP__) -# if defined (PIPE_BUF) && (PIPE_BUF == -1) -# undef PIPE_BUF -# endif -#endif /* ACE_VXWORKS */ - -#if !defined (PIPE_BUF) -# define PIPE_BUF 5120 -#endif /* PIPE_BUF */ - -#if defined (ACE_HAS_POSIX_REALTIME_SIGNALS) - // = Giving unique ACE scoped names for some important - // RTSignal-Related constants. Becuase sometimes, different - // platforms use different names for these constants. - - // Number of realtime signals provided in the system. - // _POSIX_RTSIG_MAX is the upper limit on the number of real time - // signals supported in a posix-4 compliant system. -# if defined (_POSIX_RTSIG_MAX) -# define ACE_RTSIG_MAX _POSIX_RTSIG_MAX -# else /* not _POSIX_RTSIG_MAX */ - // POSIX-4 compilant system has to provide atleast 8 RT signals. - // @@ Make sure the platform does *not* define this constant with - // some other name. If yes, use that instead of 8. -# define ACE_RTSIG_MAX 8 -# endif /* _POSIX_RTSIG_MAX */ -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - - // The maximum number of concurrent timers per process. -# if !defined (_POSIX_TIMER_MAX) -# define _POSIX_TIMER_MAX 44 -# endif /* _POSIX_TIMER_MAX */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_LIMITS_H */ - diff --git a/dep/include/ace/os_include/os_local.h b/dep/include/ace/os_include/os_local.h deleted file mode 100644 index 64ff0d4d06f..00000000000 --- a/dep/include/ace/os_include/os_local.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_local.h - * - * category macros - * - * $Id: os_local.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_LOCAL_H -#define ACE_OS_INCLUDE_OS_LOCAL_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_LOCAL_H) -# include /**/ -#endif /* !ACE_LACKS_LOCAL_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_LOCAL_H */ - diff --git a/dep/include/ace/os_include/os_math.h b/dep/include/ace/os_include/os_math.h deleted file mode 100644 index 8a1fcd84790..00000000000 --- a/dep/include/ace/os_include/os_math.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_math.h - * - * mathematical declarations - * - * $Id: os_math.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_MATH_H -#define ACE_OS_INCLUDE_OS_MATH_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// FUZZ: disable check_for_math_include - -#if !defined (ACE_LACKS_MATH_H) -# include /**/ -#endif /* !ACE_LACKS_MATH_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_MATH_H */ - diff --git a/dep/include/ace/os_include/os_monetary.h b/dep/include/ace/os_include/os_monetary.h deleted file mode 100644 index 731dbc11210..00000000000 --- a/dep/include/ace/os_include/os_monetary.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_monetary.h - * - * monetary types - * - * $Id: os_monetary.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_MONETARY_H -#define ACE_OS_INCLUDE_OS_MONETARY_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_MONETARY_H) -# include /**/ -#endif /* !ACE_LACKS_MONETARY_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_MONETARY_H */ - diff --git a/dep/include/ace/os_include/os_mqueue.h b/dep/include/ace/os_include/os_mqueue.h deleted file mode 100644 index 186d10697e8..00000000000 --- a/dep/include/ace/os_include/os_mqueue.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_mqueue.h - * - * message queues (REALTIME) - * - * $Id: os_mqueue.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_MQUEUE_H -#define ACE_OS_INCLUDE_OS_MQUEUE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" - -#if !defined (ACE_LACKS_MQUEUE_H) -# include /**/ -#endif /* !ACE_LACKS_MQUEUE_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_MQUEUE_H */ - diff --git a/dep/include/ace/os_include/os_ndbm.h b/dep/include/ace/os_include/os_ndbm.h deleted file mode 100644 index f3decb0064f..00000000000 --- a/dep/include/ace/os_include/os_ndbm.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ndbm.h - * - * definitions for ndbm database operations - * - * $Id: os_ndbm.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_NDBM_H -#define ACE_OS_INCLUDE_OS_NDBM_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_NDBM_H) -# include /**/ -#endif /* !ACE_LACKS_NDBM_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_NDBM_H */ - diff --git a/dep/include/ace/os_include/os_netdb.h b/dep/include/ace/os_include/os_netdb.h deleted file mode 100644 index 7c08f6df081..00000000000 --- a/dep/include/ace/os_include/os_netdb.h +++ /dev/null @@ -1,109 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_netdb.h - * - * definitions for network database operations - * - * $Id: os_netdb.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_NETDB_H -#define ACE_OS_INCLUDE_OS_NETDB_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/netinet/os_in.h" -#include "ace/os_include/os_limits.h" - -#if !defined (ACE_LACKS_NETDB_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ - extern "C" { -# include /**/ - } -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -#endif /* !ACE_LACKS_NETDB_H */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_HOSTENT) -struct hostent { - char *h_name; /* official name of host */ - char **h_aliases; /* alias list */ - int h_addrtype; /* host address type */ - int h_length; /* length of address */ - char **h_addr_list; /* list of addresses from name server */ -#define h_addr h_addr_list[0] /* address, for backward compatibility */ -}; -#endif /* ACE_LACKS_HOSTENT */ - -#if defined (ACE_LACKS_PROTOENT) -struct protoent { - char *p_name; /* official protocol name */ - char **p_aliases; /* alias list */ - int p_proto; /* protocol # */ -}; -#endif /* ACE_LACKS_PROTOENT */ - -#if defined (ACE_LACKS_SERVENT) -struct servent { - char *s_name; /* official service name */ - char **s_aliases; /* alias list */ - int s_port; /* port # */ - char *s_proto; /* protocol to use */ -}; -#endif /* ACE_LACKS_SERVENT */ - -#if defined (ACE_HAS_STRUCT_NETDB_DATA) - typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)]; - typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)]; - typedef char ACE_PROTOENT_DATA[sizeof(struct protoent_data)]; -#else -# if !defined ACE_HOSTENT_DATA_SIZE -# define ACE_HOSTENT_DATA_SIZE (4*1024) -# endif /*ACE_HOSTENT_DATA_SIZE */ -# if !defined ACE_SERVENT_DATA_SIZE -# define ACE_SERVENT_DATA_SIZE (4*1024) -# endif /*ACE_SERVENT_DATA_SIZE */ -# if !defined ACE_PROTOENT_DATA_SIZE -# define ACE_PROTOENT_DATA_SIZE (2*1024) -# endif /*ACE_PROTOENT_DATA_SIZE */ - typedef char ACE_HOSTENT_DATA[ACE_HOSTENT_DATA_SIZE]; - typedef char ACE_SERVENT_DATA[ACE_SERVENT_DATA_SIZE]; - typedef char ACE_PROTOENT_DATA[ACE_PROTOENT_DATA_SIZE]; -#endif /* ACE_HAS_STRUCT_NETDB_DATA */ - -# if !defined(MAXHOSTNAMELEN) -# define MAXHOSTNAMELEN HOST_NAME_MAX -# endif /* MAXHOSTNAMELEN */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_NETDB_H */ - diff --git a/dep/include/ace/os_include/os_nl_types.h b/dep/include/ace/os_include/os_nl_types.h deleted file mode 100644 index 2b14f55c7ec..00000000000 --- a/dep/include/ace/os_include/os_nl_types.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_nl_types.h - * - * data types - * - * $Id: os_nl_types.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_NL_TYPES_H -#define ACE_OS_INCLUDE_OS_NL_TYPES_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_NL_TYPES_H) -# include /**/ -#endif /* !ACE_LACKS_nl_types_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_NL_TYPES_H */ - diff --git a/dep/include/ace/os_include/os_pdh.h b/dep/include/ace/os_include/os_pdh.h deleted file mode 100644 index 4dd5b582f31..00000000000 --- a/dep/include/ace/os_include/os_pdh.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_pdh.h - * - * definitions for the windows pdh API - * - * $Id: os_pdh.h 81614 2008-05-05 14:04:25Z johnnyw $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_PDH_H -#define ACE_OS_INCLUDE_OS_PDH_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H) -# include /**/ -#endif /* ACE_HAS_PDH_H && !ACE_LACKS_PDH_H */ - -#if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H) -# define ACE_HAS_WIN32_PDH -#endif - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_PDH_H */ - diff --git a/dep/include/ace/os_include/os_pdhmsg.h b/dep/include/ace/os_include/os_pdhmsg.h deleted file mode 100644 index 4bd09ba9d54..00000000000 --- a/dep/include/ace/os_include/os_pdhmsg.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_pdhmsg.h - * - * definitions for the windows pdh API - * - * $Id: os_pdhmsg.h 81693 2008-05-14 12:35:01Z johnnyw $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_PDHMSG_H -#define ACE_OS_INCLUDE_OS_PDHMSG_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_PDHMSG_H) && !defined (ACE_LACKS_PDHMSG_H) -# include /**/ -#endif /* ACE_HAS_PDH_H && !ACE_LACKS_PDH_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_PDHMSG_H */ - diff --git a/dep/include/ace/os_include/os_poll.h b/dep/include/ace/os_include/os_poll.h deleted file mode 100644 index e9597e5d50e..00000000000 --- a/dep/include/ace/os_include/os_poll.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_poll.h - * - * definitions for the poll() function - * - * $Id: os_poll.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_POLL_H -#define ACE_OS_INCLUDE_OS_POLL_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_POLL_H) -# include /**/ -#endif /* !ACE_LACKS_POLL_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_POLL_H */ - diff --git a/dep/include/ace/os_include/os_pthread.h b/dep/include/ace/os_include/os_pthread.h deleted file mode 100644 index c45fc4cf802..00000000000 --- a/dep/include/ace/os_include/os_pthread.h +++ /dev/null @@ -1,424 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_pthread.h - * - * threads - * - * $Id: os_pthread.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_PTHREAD_H -#define ACE_OS_INCLUDE_OS_PTHREAD_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_PRIOCNTL) - // Need to #include thread.h before #defining THR_BOUND, etc., - // when building without threads on SunOS 5.x. -# if defined (sun) -# include /**/ -# endif /* sun */ - - // Need to #include these before #defining USYNC_PROCESS on SunOS 5.x. -# include /**/ -# include /**/ -#endif /* ACE_HAS_PRIOCNTL */ - -#include "ace/os_include/sys/os_types.h" - -// This needs to go here *first* to avoid problems with AIX. -# if defined (ACE_HAS_PTHREADS) -# define ACE_DONT_INCLUDE_ACE_SIGNAL_H -# include "ace/os_include/os_signal.h" -# undef ACE_DONT_INCLUDE_ACE_SIGNAL_H -# if defined (DIGITAL_UNIX) -# define pthread_self __pthread_self -extern "C" pthread_t pthread_self (void); -# endif /* DIGITAL_UNIX */ -# endif /* ACE_HAS_PTHREADS */ - -#if !defined (ACE_LACKS_PTHREAD_H) - extern "C" { -# if defined (ACE_TANDEM_T1248_PTHREADS) -# include /**/ -# else -# include /**/ -# endif - } -#endif /* !ACE_LACKS_PTHREAD_H */ - -#if defined (ACE_HAS_PTHREAD_NP_H) -// FreeBSD declares _np (non-portable) pthread extensions in -# include /**/ -#endif - -// @todo: need to reoganize to put includes at the top and the rest of the -// code at the bottom. Also, move the classes out of this file. -#if defined (ACE_HAS_PTHREADS) -# define ACE_SCHED_OTHER SCHED_OTHER -# define ACE_SCHED_FIFO SCHED_FIFO -# define ACE_SCHED_RR SCHED_RR - -// Definitions for THREAD- and PROCESS-LEVEL priorities...some -// implementations define these while others don't. In order to -// further complicate matters, we don't redefine the default (*_DEF) -// values if they've already been defined, which allows individual -// programs to have their own ACE-wide "default". - -// PROCESS-level values -# if (defined (_POSIX_PRIORITY_SCHEDULING) || defined (ACE_TANDEM_T1248_PTHREADS)) \ - && !defined(_UNICOS) && !defined(UNIXWARE_7_1) -# define ACE_PROC_PRI_FIFO_MIN (sched_get_priority_min(SCHED_FIFO)) -# define ACE_PROC_PRI_RR_MIN (sched_get_priority_min(SCHED_RR)) -# if defined (HPUX) - // HP-UX's other is the SCHED_HPUX class, which uses historical - // values that have reverse semantics from POSIX (low value is - // more important priority). To use these in pthreads calls, - // the values need to be converted. The other scheduling classes - // don't need this special treatment. -# define ACE_PROC_PRI_OTHER_MIN \ - (sched_get_priority_min(SCHED_OTHER)) -# else -# define ACE_PROC_PRI_OTHER_MIN (sched_get_priority_min(SCHED_OTHER)) -# endif /* HPUX */ -# else /* UNICOS is missing a sched_get_priority_min() implementation, - SCO too */ -# define ACE_PROC_PRI_FIFO_MIN 0 -# define ACE_PROC_PRI_RR_MIN 0 -# define ACE_PROC_PRI_OTHER_MIN 0 -# endif - -# if defined (_POSIX_PRIORITY_SCHEDULING) && !defined(UNIXWARE_7_1) -# define ACE_PROC_PRI_FIFO_MAX (sched_get_priority_max(SCHED_FIFO)) -# define ACE_PROC_PRI_RR_MAX (sched_get_priority_max(SCHED_RR)) -# if defined (HPUX) -# define ACE_PROC_PRI_OTHER_MAX \ - (sched_get_priority_max(SCHED_OTHER)) -# else -# define ACE_PROC_PRI_OTHER_MAX (sched_get_priority_max(SCHED_OTHER)) -# endif /* HPUX */ -# else /* SCO missing sched_get_priority_max() implementation */ -# define ACE_PROC_PRI_FIFO_MAX 59 -# define ACE_PROC_PRI_RR_MAX 59 -# define ACE_PROC_PRI_OTHER_MAX 59 -# endif - -# if !defined(ACE_PROC_PRI_FIFO_DEF) -# define ACE_PROC_PRI_FIFO_DEF (ACE_PROC_PRI_FIFO_MIN + (ACE_PROC_PRI_FIFO_MAX - ACE_PROC_PRI_FIFO_MIN)/2) -# endif -# if !defined(ACE_PROC_PRI_RR_DEF) -# define ACE_PROC_PRI_RR_DEF (ACE_PROC_PRI_RR_MIN + (ACE_PROC_PRI_RR_MAX - ACE_PROC_PRI_RR_MIN)/2) -# endif -# if !defined(ACE_PROC_PRI_OTHER_DEF) -# define ACE_PROC_PRI_OTHER_DEF (ACE_PROC_PRI_OTHER_MIN + (ACE_PROC_PRI_OTHER_MAX - ACE_PROC_PRI_OTHER_MIN)/2) -# endif - -// THREAD-level values -# if defined(PRI_FIFO_MIN) && defined(PRI_FIFO_MAX) && defined(PRI_RR_MIN) && defined(PRI_RR_MAX) && defined(PRI_OTHER_MIN) && defined(PRI_OTHER_MAX) -# if !defined (ACE_THR_PRI_FIFO_MIN) -# define ACE_THR_PRI_FIFO_MIN (long) PRI_FIFO_MIN -# endif /* !ACE_THR_PRI_FIFO_MIN */ -# if !defined (ACE_THR_PRI_FIFO_MAX) -# define ACE_THR_PRI_FIFO_MAX (long) PRI_FIFO_MAX -# endif /* !ACE_THR_PRI_FIFO_MAX */ -# if !defined (ACE_THR_PRI_RR_MIN) -# define ACE_THR_PRI_RR_MIN (long) PRI_RR_MIN -# endif /* !ACE_THR_PRI_RR_MIN */ -# if !defined (ACE_THR_PRI_RR_MAX) -# define ACE_THR_PRI_RR_MAX (long) PRI_RR_MAX -# endif /* !ACE_THR_PRI_RR_MAX */ -# if !defined (ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) PRI_OTHER_MIN -# endif /* !ACE_THR_PRI_OTHER_MIN */ -# if !defined (ACE_THR_PRI_OTHER_MAX) -# define ACE_THR_PRI_OTHER_MAX (long) PRI_OTHER_MAX -# endif /* !ACE_THR_PRI_OTHER_MAX */ -# elif defined (AIX) - // AIX's priority range is 1 (low) to 127 (high). There aren't - // any preprocessor macros I can find. PRIORITY_MIN is for - // process priorities, as far as I can see, and does not apply - // to thread priority. The 1 to 127 range is from the - // pthread_attr_setschedparam man page (Steve Huston, 18-May-2001). -# if !defined (ACE_THR_PRI_FIFO_MIN) -# define ACE_THR_PRI_FIFO_MIN (long) 1 -# endif /* !ACE_THR_PRI_FIFO_MIN */ -# if !defined (ACE_THR_PRI_FIFO_MAX) -# define ACE_THR_PRI_FIFO_MAX (long) 127 -# endif /* !ACE_THR_PRI_FIFO_MAX */ -# if !defined (ACE_THR_PRI_RR_MIN) -# define ACE_THR_PRI_RR_MIN (long) 1 -# endif /* !ACE_THR_PRI_RR_MIN */ -# if !defined (ACE_THR_PRI_RR_MAX) -# define ACE_THR_PRI_RR_MAX (long) 127 -# endif /* !ACE_THR_PRI_RR_MAX */ -# if !defined (ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) 1 -# endif /* !ACE_THR_PRI_OTHER_MIN */ -# if !defined (ACE_THR_PRI_OTHER_MAX) -# define ACE_THR_PRI_OTHER_MAX (long) 127 -# endif /* !ACE_THR_PRI_OTHER_MAX */ -# elif defined (sun) -# if !defined (ACE_THR_PRI_FIFO_MIN) -# define ACE_THR_PRI_FIFO_MIN (long) 0 -# endif /* !ACE_THR_PRI_FIFO_MIN */ -# if !defined (ACE_THR_PRI_FIFO_MAX) -# define ACE_THR_PRI_FIFO_MAX (long) 59 -# endif /* !ACE_THR_PRI_FIFO_MAX */ -# if !defined (ACE_THR_PRI_RR_MIN) -# define ACE_THR_PRI_RR_MIN (long) 0 -# endif /* !ACE_THR_PRI_RR_MIN */ -# if !defined (ACE_THR_PRI_RR_MAX) -# define ACE_THR_PRI_RR_MAX (long) 59 -# endif /* !ACE_THR_PRI_RR_MAX */ -# if !defined (ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) 0 -# endif /* !ACE_THR_PRI_OTHER_MIN */ -# if !defined (ACE_THR_PRI_OTHER_MAX) -# define ACE_THR_PRI_OTHER_MAX (long) 127 -# endif /* !ACE_THR_PRI_OTHER_MAX */ -# else -# if !defined (ACE_THR_PRI_FIFO_MIN) -# define ACE_THR_PRI_FIFO_MIN (long) ACE_PROC_PRI_FIFO_MIN -# endif /* !ACE_THR_PRI_FIFO_MIN */ -# if !defined (ACE_THR_PRI_FIFO_MAX) -# define ACE_THR_PRI_FIFO_MAX (long) ACE_PROC_PRI_FIFO_MAX -# endif /* !ACE_THR_PRI_FIFO_MAX */ -# if !defined (ACE_THR_PRI_RR_MIN) -# define ACE_THR_PRI_RR_MIN (long) ACE_PROC_PRI_RR_MIN -# endif /* !ACE_THR_PRI_RR_MIN */ -# if !defined (ACE_THR_PRI_RR_MAX) -# define ACE_THR_PRI_RR_MAX (long) ACE_PROC_PRI_RR_MAX -# endif /* !ACE_THR_PRI_RR_MAX */ -# if !defined (ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) ACE_PROC_PRI_OTHER_MIN -# endif /* !ACE_THR_PRI_OTHER_MIN */ -# if !defined (ACE_THR_PRI_OTHER_MAX) -# define ACE_THR_PRI_OTHER_MAX (long) ACE_PROC_PRI_OTHER_MAX -# endif /* !ACE_THR_PRI_OTHER_MAX */ -# endif -# if !defined(ACE_THR_PRI_FIFO_DEF) -# define ACE_THR_PRI_FIFO_DEF ((ACE_THR_PRI_FIFO_MIN + ACE_THR_PRI_FIFO_MAX)/2) -# endif -# if !defined(ACE_THR_PRI_RR_DEF) -# define ACE_THR_PRI_RR_DEF ((ACE_THR_PRI_RR_MIN + ACE_THR_PRI_RR_MAX)/2) -# endif -# if !defined(ACE_THR_PRI_OTHER_DEF) -# define ACE_THR_PRI_OTHER_DEF ((ACE_THR_PRI_OTHER_MIN + ACE_THR_PRI_OTHER_MAX)/2) -# endif - // Typedefs to help compatibility with Windows NT and Pthreads. - typedef pthread_t ACE_hthread_t; - typedef pthread_t ACE_thread_t; - - // native TSS key type - typedef pthread_key_t ACE_OS_thread_key_t; - // TSS key type to be used by application -# if defined (ACE_HAS_TSS_EMULATION) - typedef u_int ACE_thread_key_t; -# else /* ! ACE_HAS_TSS_EMULATION */ - typedef ACE_OS_thread_key_t ACE_thread_key_t; -# endif /* ! ACE_HAS_TSS_EMULATION */ - -# if !defined (ACE_LACKS_COND_T) - typedef pthread_mutex_t ACE_mutex_t; - typedef pthread_cond_t ACE_cond_t; - typedef pthread_condattr_t ACE_condattr_t; - typedef pthread_mutexattr_t ACE_mutexattr_t; -# endif /* ! ACE_LACKS_COND_T */ - typedef pthread_mutex_t ACE_thread_mutex_t; - -# if !defined (PTHREAD_CANCEL_DISABLE) -# define PTHREAD_CANCEL_DISABLE 0 -# endif /* PTHREAD_CANCEL_DISABLE */ - -# if !defined (PTHREAD_CANCEL_ENABLE) -# define PTHREAD_CANCEL_ENABLE 0 -# endif /* PTHREAD_CANCEL_ENABLE */ - -# if !defined (PTHREAD_CANCEL_DEFERRED) -# define PTHREAD_CANCEL_DEFERRED 0 -# endif /* PTHREAD_CANCEL_DEFERRED */ - -# if !defined (PTHREAD_CANCEL_ASYNCHRONOUS) -# define PTHREAD_CANCEL_ASYNCHRONOUS 0 -# endif /* PTHREAD_CANCEL_ASYNCHRONOUS */ - -# define THR_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE -# define THR_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE -# define THR_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED -# define THR_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS - -# if !defined (PTHREAD_CREATE_JOINABLE) -# if defined (PTHREAD_CREATE_UNDETACHED) -# define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED -# else -# define PTHREAD_CREATE_JOINABLE 0 -# endif /* PTHREAD_CREATE_UNDETACHED */ -# endif /* PTHREAD_CREATE_JOINABLE */ - -# if !defined (PTHREAD_CREATE_DETACHED) -# define PTHREAD_CREATE_DETACHED 1 -# endif /* PTHREAD_CREATE_DETACHED */ - -# if !defined (PTHREAD_PROCESS_PRIVATE) && !defined (ACE_HAS_PTHREAD_PROCESS_ENUM) -# if defined (PTHREAD_MUTEXTYPE_FAST) -# define PTHREAD_PROCESS_PRIVATE PTHREAD_MUTEXTYPE_FAST -# else -# define PTHREAD_PROCESS_PRIVATE 0 -# endif /* PTHREAD_MUTEXTYPE_FAST */ -# endif /* PTHREAD_PROCESS_PRIVATE */ - -# if !defined (PTHREAD_PROCESS_SHARED) && !defined (ACE_HAS_PTHREAD_PROCESS_ENUM) -# if defined (PTHREAD_MUTEXTYPE_FAST) -# define PTHREAD_PROCESS_SHARED PTHREAD_MUTEXTYPE_FAST -# else -# define PTHREAD_PROCESS_SHARED 1 -# endif /* PTHREAD_MUTEXTYPE_FAST */ -# endif /* PTHREAD_PROCESS_SHARED */ - -# if !defined (ACE_HAS_STHREADS) -# if !defined (USYNC_THREAD) -# define USYNC_THREAD PTHREAD_PROCESS_PRIVATE -# endif /* ! USYNC_THREAD */ -# if !defined (USYNC_PROCESS) -# define USYNC_PROCESS PTHREAD_PROCESS_SHARED -# endif /* ! USYNC_PROCESS */ -# endif /* ACE_HAS_STHREADS */ - - /* MM-Graz: prevent warnings */ -# if !defined (UNIXWARE_7_1) -# undef THR_BOUND -# undef THR_NEW_LWP -# undef THR_DETACHED -# undef THR_SUSPENDED -# undef THR_DAEMON - -# define THR_BOUND 0x00000001 -# define THR_NEW_LWP 0x00000002 -# define THR_DETACHED 0x00000040 -# define THR_SUSPENDED 0x00000080 -# define THR_DAEMON 0x00000100 -# define THR_SCHED_FIFO 0x00020000 -# define THR_SCHED_RR 0x00040000 -# define THR_SCHED_DEFAULT 0x00080000 -# endif /* UNIXWARE_7_1 */ - -# define THR_JOINABLE 0x00010000 - -# if defined (ACE_HAS_IRIX62_THREADS) -# define THR_SCOPE_SYSTEM 0x00100000 -# else -# define THR_SCOPE_SYSTEM THR_BOUND -# endif /*ACE_HAS_IRIX62_THREADS*/ - -# define THR_SCOPE_PROCESS 0x00200000 -# define THR_INHERIT_SCHED 0x00400000 -# define THR_EXPLICIT_SCHED 0x00800000 -# define THR_SCHED_IO 0x01000000 - -# if !defined (ACE_HAS_STHREADS) -# if !defined (ACE_HAS_POSIX_SEM) && !defined (ACE_USES_FIFO_SEM) - -// This needs to be moved out of here. -#include /**/ "ace/ACE_export.h" -/** - * @class ACE_sema_t - * - * @brief This is used to implement semaphores for platforms that support - * POSIX pthreads, but do *not* support POSIX semaphores, i.e., - * it's a different type than the POSIX . - */ -class ACE_Export ACE_sema_t -{ -public: - /// Serialize access to internal state. - ACE_mutex_t lock_; - - /// Block until there are no waiters. - ACE_cond_t count_nonzero_; - - /// Count of the semaphore. - u_long count_; - - /// Number of threads that have called . - u_long waiters_; -}; -# endif /* !ACE_HAS_POSIX_SEM */ - -# if defined (ACE_LACKS_PTHREAD_YIELD) && defined (ACE_HAS_THR_YIELD) - // If we are on Solaris we can just reuse the existing - // implementations of these synchronization types. -# if !defined (ACE_LACKS_RWLOCK_T) && !defined (ACE_HAS_PTHREADS_UNIX98_EXT) -# include /**/ - typedef rwlock_t ACE_rwlock_t; -# endif /* !ACE_LACKS_RWLOCK_T */ -# include /**/ -# endif /* (ACE_LACKS_PTHREAD_YIELD) && defined (ACE_HAS_THR_YIELD) */ - -# else -# if !defined (ACE_HAS_POSIX_SEM) - typedef sema_t ACE_sema_t; -# endif /* !ACE_HAS_POSIX_SEM */ -# endif /* !ACE_HAS_STHREADS */ - -# if defined (ACE_HAS_PTHREADS_UNIX98_EXT) - typedef pthread_rwlock_t ACE_rwlock_t; -# endif /* ACE_HAS_PTHREADS_UNIX98_EXT */ - -# if defined (__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) - - // glibc 2.2.x or better has pthread_mutex_timedlock() -# ifndef ACE_HAS_MUTEX_TIMEOUTS -# define ACE_HAS_MUTEX_TIMEOUTS -# endif /* ACE_HAS_MUTEX_TIMEOUTS */ - - // Use new pthread_attr_setstack if XPG6 support is enabled. -# if defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) < 600 -# define ACE_LACKS_PTHREAD_ATTR_SETSTACK -# endif /* (_XOPEN_SOURCE - 0) < 600 */ - -# if !defined (_XOPEN_SOURCE) \ - || (defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) < 600) - // pthread_mutex_timedlock() prototype is not visible if _XOPEN_SOURCE - // is not >= 600 (i.e. for XPG6). - extern "C" int pthread_mutex_timedlock (pthread_mutex_t *mutex, - const struct timespec * abstime); -# endif /* _XOPEN_SOURCE && _XOPEN_SOURCE < 600 */ - -# endif /* linux && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) */ - -#elif defined (ACE_HAS_STHREADS) -# if !defined (ACE_THR_PRI_FIFO_MIN) -# define ACE_THR_PRI_FIFO_MIN (long) 0 -# endif /* !ACE_THR_PRI_FIFO_MIN */ -# if !defined (ACE_THR_PRI_FIFO_MAX) -# define ACE_THR_PRI_FIFO_MAX (long) 59 -# endif /* !ACE_THR_PRI_FIFO_MAX */ -# if !defined (ACE_THR_PRI_RR_MIN) -# define ACE_THR_PRI_RR_MIN (long) 0 -# endif /* !ACE_THR_PRI_RR_MIN */ -# if !defined (ACE_THR_PRI_RR_MAX) -# define ACE_THR_PRI_RR_MAX (long) 59 -# endif /* !ACE_THR_PRI_RR_MAX */ -# if !defined (ACE_THR_PRI_OTHER_MIN) -# define ACE_THR_PRI_OTHER_MIN (long) 0 -# endif /* !ACE_THR_PRI_OTHER_MIN */ -# if !defined (ACE_THR_PRI_OTHER_MAX) -# define ACE_THR_PRI_OTHER_MAX (long) 127 -# endif /* !ACE_THR_PRI_OTHER_MAX */ -#endif /* ACE_HAS_PTHREADS */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_PTHREAD_H */ - diff --git a/dep/include/ace/os_include/os_pwd.h b/dep/include/ace/os_include/os_pwd.h deleted file mode 100644 index f3cba066af9..00000000000 --- a/dep/include/ace/os_include/os_pwd.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_pwd.h - * - * password structure - * - * $Id: os_pwd.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_PWD_H -#define ACE_OS_INCLUDE_OS_PWD_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_PWD_H) -# include /**/ -#endif /* !ACE_LACKS_PWD_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if !defined (ACE_WIN32) -// VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined -// in pwd.h, and that redefinition is used here -# if defined (_AIX) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) - extern int _posix_getpwnam_r(const char *, struct passwd *, char *, - int, struct passwd **); -# endif /* AIX and VAC++ 4 */ -#endif /* !ACE_WIN32 */ - -#if defined (DIGITAL_UNIX) - extern int _Pgetpwnam_r (const char *, struct passwd *, - char *, size_t, struct passwd **); -#endif /* DIGITAL_UNIX */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_PWD_H */ - diff --git a/dep/include/ace/os_include/os_regex.h b/dep/include/ace/os_include/os_regex.h deleted file mode 100644 index 94606e45e58..00000000000 --- a/dep/include/ace/os_include/os_regex.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_regex.h - * - * regular expression matching types - * - * $Id: os_regex.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_REGEX_H -#define ACE_OS_INCLUDE_OS_REGEX_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_REGEX_H) -# include /**/ -#endif /* !ACE_LACKS_REGEX_H */ - -#if defined (ACE_HAS_REGEX) -# include /**/ -#endif /* ACE_HAS_REGEX */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_REGEX_H */ - diff --git a/dep/include/ace/os_include/os_sched.h b/dep/include/ace/os_include/os_sched.h deleted file mode 100644 index 15279dbeef3..00000000000 --- a/dep/include/ace/os_include/os_sched.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_sched.h - * - * execution scheduling (REALTIME) - * - * $Id: os_sched.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SCHED_H -#define ACE_OS_INCLUDE_OS_SCHED_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_time.h" - -#if !defined (ACE_LACKS_SCHED_H) -# include /**/ -#endif /* !ACE_LACKS_SCHED_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if !defined (__cpu_set_t_defined) || !defined (ACE_HAS_CPU_SET_T) -# define ACE_CPU_SETSIZE 1024 - typedef struct - { - ACE_UINT32 bit_array_[ACE_CPU_SETSIZE / (8 * sizeof (ACE_UINT32))]; - } cpu_set_t; -#endif /* !ACE_HAS_CPU_SET_T || !__cpu_set_t_defined */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SCHED_H */ - diff --git a/dep/include/ace/os_include/os_search.h b/dep/include/ace/os_include/os_search.h deleted file mode 100644 index b67d902e9af..00000000000 --- a/dep/include/ace/os_include/os_search.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_search.h - * - * search tables - * - * $Id: os_search.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SEARCH_H -#define ACE_OS_INCLUDE_OS_SEARCH_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SEARCH_H) -# include /**/ -#endif /* !ACE_LACKS_SEARCH_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SEARCH_H */ - diff --git a/dep/include/ace/os_include/os_semaphore.h b/dep/include/ace/os_include/os_semaphore.h deleted file mode 100644 index e6ae6b19b40..00000000000 --- a/dep/include/ace/os_include/os_semaphore.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_semaphore.h - * - * semaphores (REALTIME) - * - * $Id: os_semaphore.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SEMAPHORE_H -#define ACE_OS_INCLUDE_OS_SEMAPHORE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_time.h" - -#if !defined (ACE_LACKS_SEMAPHORE_H) -# include /**/ -#endif /* !ACE_LACKS_SEMAPHORE_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_HAS_POSIX_SEM) -# if !defined (SEM_FAILED) && !defined (ACE_LACKS_NAMED_POSIX_SEM) -# define SEM_FAILED ((sem_t *) -1) -# endif /* !SEM_FAILED */ - - typedef struct - { - /// Pointer to semaphore handle. This is allocated by ACE if we are - /// working with an unnamed POSIX semaphore or by the OS if we are - /// working with a named POSIX semaphore. - sem_t *sema_; - - /// Name of the semaphore (if this is non-NULL then this is a named - /// POSIX semaphore, else its an unnamed POSIX semaphore). - char *name_; - -# if defined (ACE_LACKS_NAMED_POSIX_SEM) - /// this->sema_ doesn't always get created dynamically if a platform - /// doesn't support named posix semaphores. We use this flag to - /// remember if we need to delete or not. - bool new_sema_; -# endif /* ACE_LACKS_NAMED_POSIX_SEM */ - -# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && !defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION) - /// Serialize access to internal state. - ACE_mutex_t lock_; - - /// Block until there are no waiters. - ACE_cond_t count_nonzero_; -# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT && !ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION */ - } ACE_sema_t; -#endif /* ACE_HAS_POSIX_SEM */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SEMAPHORE_H */ - diff --git a/dep/include/ace/os_include/os_setjmp.h b/dep/include/ace/os_include/os_setjmp.h deleted file mode 100644 index e5261965cd8..00000000000 --- a/dep/include/ace/os_include/os_setjmp.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_setjmp.h - * - * stack environment declarations - * - * $Id: os_setjmp.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SETJMP_H -#define ACE_OS_INCLUDE_OS_SETJMP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SETJMP_H) -# include /**/ -#endif /* !ACE_LACKS_SETJMP_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SETJMP_H */ - diff --git a/dep/include/ace/os_include/os_signal.h b/dep/include/ace/os_include/os_signal.h deleted file mode 100644 index 029e5553921..00000000000 --- a/dep/include/ace/os_include/os_signal.h +++ /dev/null @@ -1,254 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_signal.h - * - * signals - * - * $Id: os_signal.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SIGNAL_H -#define ACE_OS_INCLUDE_OS_SIGNAL_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SIGNAL_H) - extern "C" { -# include /**/ - } -#endif /* !ACE_LACKS_SIGNAL_H */ - -// This must come after signal.h is #included. -#if defined (SCO) -# define SIGIO SIGPOLL -# include /**/ -#endif /* SCO */ - -#if defined (ACE_HAS_SIGINFO_T) -# if !defined (ACE_LACKS_SIGINFO_H) -# if defined (__QNX__) || defined (__OpenBSD__) || defined (__INTERIX) -# include /**/ -# else /* __QNX__ || __OpenBSD__ */ -# include /**/ -# endif /* __QNX__ || __OpenBSD__ */ -# endif /* ACE_LACKS_SIGINFO_H */ -#endif /* ACE_HAS_SIGINFO_T */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) && !defined (__RTP__) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_SIGSET) - typedef u_int sigset_t; -#endif /* ACE_LACKS_SIGSET */ - -#if defined (ACE_HAS_SIG_MACROS) -# undef sigemptyset -# undef sigfillset -# undef sigaddset -# undef sigdelset -# undef sigismember -#endif /* ACE_HAS_SIG_MACROS */ - -// This must come after signal.h is #included. It's to counteract -// the sigemptyset and sigfillset #defines, which only happen -// when __OPTIMIZE__ is #defined (really!) on Linux. -#if defined (linux) && defined (__OPTIMIZE__) -# undef sigemptyset -# undef sigfillset -#endif /* linux && __OPTIMIZE__ */ - -#if !defined (ACE_HAS_SIG_ATOMIC_T) - typedef int sig_atomic_t; -#endif /* !ACE_HAS_SIG_ATOMIC_T */ - -# if !defined (SA_SIGINFO) -# define SA_SIGINFO 0 -# endif /* SA_SIGINFO */ - -# if !defined (SA_RESTART) -# define SA_RESTART 0 -# endif /* SA_RESTART */ - -#if !defined (SIGHUP) -# define SIGHUP 0 -#endif /* SIGHUP */ - -#if !defined (SIGINT) -# define SIGINT 0 -#endif /* SIGINT */ - -#if !defined (SIGSEGV) -# define SIGSEGV 0 -#endif /* SIGSEGV */ - -#if !defined (SIGIO) -# define SIGIO 0 -#endif /* SIGSEGV */ - -#if !defined (SIGUSR1) -# define SIGUSR1 0 -#endif /* SIGUSR1 */ - -#if !defined (SIGUSR2) -# define SIGUSR2 0 -#endif /* SIGUSR2 */ - -#if !defined (SIGCHLD) -# define SIGCHLD 0 -#endif /* SIGCHLD */ - -#if !defined (SIGCLD) -# define SIGCLD SIGCHLD -#endif /* SIGCLD */ - -#if !defined (SIGQUIT) -# define SIGQUIT 0 -#endif /* SIGQUIT */ - -#if !defined (SIGPIPE) -# define SIGPIPE 0 -#endif /* SIGPIPE */ - -#if !defined (SIGALRM) -# define SIGALRM 0 -#endif /* SIGALRM */ - -#if !defined (SIG_DFL) -# define SIG_DFL ((__sighandler_t) 0) -#endif /* SIG_DFL */ - -#if !defined (SIG_IGN) -# define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ -#endif /* SIG_IGN */ - -#if !defined (SIG_ERR) -# define SIG_ERR ((__sighandler_t) -1) /* error return from signal */ -#endif /* SIG_ERR */ - -// These are used by the and -// methods. They must be unique and cannot -// conflict with the value of . We make the numbers -// negative here so they won't conflict with other values like SIGIO, -// etc. -# define ACE_SIGIO -1 -# define ACE_SIGURG -2 -# define ACE_CLOEXEC -3 - -#if defined (ACE_VXWORKS) -# define ACE_NSIG (_NSIGS + 1) -#elif defined (__Lynx__) || defined (ACE_HAS_RTEMS) -# define ACE_NSIG (NSIG + 1) -#else - // All other platforms set NSIG to one greater than the - // highest-numbered signal. -# define ACE_NSIG NSIG -#endif /* __Lynx__ */ - -#if defined (ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES) - // Prototypes for both signal() and struct sigaction are consistent.. - typedef void (*ACE_SignalHandler)(int); - typedef void (*ACE_SignalHandlerV)(int); -#elif defined (ACE_HAS_LYNXOS_SIGNALS) || defined (ACE_HAS_TANDEM_SIGNALS) - typedef void (*ACE_SignalHandler)(...); - typedef void (*ACE_SignalHandlerV)(...); -#elif defined (ACE_HAS_SVR4_SIGNAL_T) - // SVR4 Signals are inconsistent (e.g., see struct sigaction).. - typedef void (*ACE_SignalHandler)(int); - typedef void (*ACE_SignalHandlerV)(void); -#elif defined (ACE_WIN32) - typedef void (__cdecl *ACE_SignalHandler)(int); - typedef void (__cdecl *ACE_SignalHandlerV)(int); -#elif defined (ACE_HAS_UNIXWARE_SVR4_SIGNAL_T) - typedef void (*ACE_SignalHandler)(int); - typedef void (*ACE_SignalHandlerV)(...); -#elif defined (INTEGRITY) - typedef void (*ACE_SignalHandler)(); - typedef void (*ACE_SignalHandlerV)(int); -#elif defined (ACE_HAS_RTEMS) - typedef void (*ACE_SignalHandler)(); - typedef void (*ACE_SignalHandlerV)(); -#else /* This is necessary for some older broken version of cfront */ -# if defined (SIG_PF) -# define ACE_SignalHandler SIG_PF -# else - typedef void (*ACE_SignalHandler)(int); -# endif /* SIG_PF */ - typedef void (*ACE_SignalHandlerV)(...); -#endif /* ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES */ - -#if defined (ACE_LACKS_SIGACTION) - struct sigaction - { - int sa_flags; - ACE_SignalHandlerV sa_handler; - sigset_t sa_mask; - }; -#endif /* ACE_LACKS_SIGACTION */ - -// Defining POSIX4 real-time signal range. -#if defined(ACE_HAS_POSIX_REALTIME_SIGNALS) -# define ACE_SIGRTMIN SIGRTMIN -# define ACE_SIGRTMAX SIGRTMAX -#else /* !ACE_HAS_POSIX_REALTIME_SIGNALS */ -# ifndef ACE_SIGRTMIN -# define ACE_SIGRTMIN 0 -# endif /* ACE_SIGRTMIN */ -# ifndef ACE_SIGRTMAX -# define ACE_SIGRTMAX 0 -# endif /* ACE_SIGRTMAX */ -#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ - -#if defined (DIGITAL_UNIX) - // sigwait is yet another macro on Digital UNIX 4.0, just causing - // trouble when introducing member functions with the same name. - // Thanks to Thilo Kielmann" for - // this fix. -# if defined (__DECCXX_VER) -# undef sigwait - // cxx on Digital Unix 4.0 needs this declaration. With it, - // <::_Psigwait> works with cxx -pthread. g++ does _not_ need - // it. - int _Psigwait __((const sigset_t *set, int *sig)); -# endif /* __DECCXX_VER */ -#elif !defined (ACE_HAS_SIGWAIT) -# if defined(ACE_HAS_RTEMS) - int sigwait (const sigset_t *set, int *sig); -# else - int sigwait (sigset_t *set); -# endif /* ACE_HAS_RTEMS */ -#endif /* ! DIGITAL_UNIX && ! ACE_HAS_SIGWAIT */ - -#if !defined (ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE) - int pthread_sigmask(int, const sigset_t *, sigset_t *); -#endif /*!ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include "ace/os_include/os_ucontext.h" - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SIGNAL_H */ - diff --git a/dep/include/ace/os_include/os_spawn.h b/dep/include/ace/os_include/os_spawn.h deleted file mode 100644 index ffa80163f50..00000000000 --- a/dep/include/ace/os_include/os_spawn.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_spawn.h - * - * spawn (ADVANCED REALTIME) - * - * $Id: os_spawn.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SPAWN_H -#define ACE_OS_INCLUDE_OS_SPAWN_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" -#include "ace/os_include/sys/os_types.h" -#include "ace/os_include/os_sched.h" - -#if !defined (ACE_LACKS_SPAWN_H) -# include /**/ -#endif /* !ACE_LACKS_SPAWN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SPAWN_H */ - diff --git a/dep/include/ace/os_include/os_stdarg.h b/dep/include/ace/os_include/os_stdarg.h deleted file mode 100644 index 7a9fcf5a928..00000000000 --- a/dep/include/ace/os_include/os_stdarg.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stdarg.h - * - * handle variable argument list - * - * $Id: os_stdarg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STDARG_H -#define ACE_OS_INCLUDE_OS_STDARG_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_STDARG_H) -# include /**/ -#endif /* !ACE_LACKS_STDARG_H */ - -#if !defined (va_copy) -#if defined (__va_copy) -#define va_copy(d, s) __va_copy((d),(s)) -#else -#define va_copy(d, s) memcpy((void *)&(d),(void *)&(s),sizeof(va_list)) -#endif -#endif - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDARG_H */ - diff --git a/dep/include/ace/os_include/os_stdbool.h b/dep/include/ace/os_include/os_stdbool.h deleted file mode 100644 index e739fddf26d..00000000000 --- a/dep/include/ace/os_include/os_stdbool.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stdbool.h - * - * boolean type and values - * - * $Id: os_stdbool.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STDBOOL_H -#define ACE_OS_INCLUDE_OS_STDBOOL_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_STDBOOL_H) -# include /**/ -#endif /* !ACE_LACKS_STDBOOL_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDBOOL_H */ - diff --git a/dep/include/ace/os_include/os_stddef.h b/dep/include/ace/os_include/os_stddef.h deleted file mode 100644 index 34e6001925f..00000000000 --- a/dep/include/ace/os_include/os_stddef.h +++ /dev/null @@ -1,98 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stddef.h - * - * standard type definitions - * - * $Id: os_stddef.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -// From http://www.UNIX-systems.org/single_unix_specification/ - -#ifndef ACE_OS_INCLUDE_OS_STDDEF_H -#define ACE_OS_INCLUDE_OS_STDDEF_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_STDDEF_H) -# include /**/ -#endif /* !ACE_LACKS_STDDEF_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -//FUZZ: disable check_for_NULL -// NULL pointer constant -#if defined (ACE_LACKS_NULL) -# undef NULL -# if defined(__cplusplus) -# define NULL 0 -# else -# define NULL ((void *)0) -# endif -#endif /* ACE_LACKS_NULL */ -//FUZZ: enable check_for_NULL - -/* - Integer constant expression of type size_t, the value of which is the offset - in bytes to the structure member (member-designator), from the beginning of - its structure (type). -*/ -#if defined (ACE_LACKS_OFFSETOF) -# undef offsetof -# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif /* ACE_LACKS_OFFSETOF */ - -// Signed integer type of the result of subtracting two pointers. -#if defined (ACE_LACKS_PTRDIFF_T) -# if !defined (ACE_PTRDIFF_T_TYPE) -# define ACE_PTRDIFF_T_TYPE unsigned long -# endif /* !ACE_PTRDIFF_T_TYPE */ - typedef ACE_PTRDIFF_T_TYPE ptrdiff_t; -#endif /* ACE_LACKS_PTRDIFF_T */ - -/* - Integer type whose range of values can represent distinct wide-character - codes for all members of the largest character set specified among the - locales supported by the compilation environment: the null character has - the code value 0 and each member of the portable character set has a code - value equal to its value when used as the lone character in an integer - character constant. -*/ -#if defined (ACE_LACKS_WCHAR_T) -# if !defined (ACE_WCHAR_T_TYPE) -# define ACE_WCHAR_T_TYPE long; -# endif /* !ACE_WCHAR_T_TYPE */ - typedef ACE_WCHAR_T_TYPE wchar_t; -#endif /* ACE_LACKS_WCHAR_T */ - -// Unsigned integer type of the result of the sizeof operator. -#if defined (ACE_LACKS_SIZE_T) -# if !defined (ACE_SIZE_T_TYPE) -# define ACE_SIZE_T_TYPE unsigned int; -# endif /* !ACE_SIZE_T_TYPE */ - typedef ACE_SIZE_T_TYPE size_t; -#endif /* ACE_LACKS_SIZE_T */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDDEF_H */ - diff --git a/dep/include/ace/os_include/os_stdint.h b/dep/include/ace/os_include/os_stdint.h deleted file mode 100644 index 3cd849de612..00000000000 --- a/dep/include/ace/os_include/os_stdint.h +++ /dev/null @@ -1,141 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stdint.h - * - * integer types - * - * $Id: os_stdint.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STDINT_H -#define ACE_OS_INCLUDE_OS_STDINT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_STDINT_H) -# include /**/ -#endif /* !ACE_LACKS_STDINT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -// BSD style types -#if defined (ACE_LACKS_SYS_TYPES_H) \ - || (defined (__GLIBC__) && !defined (_BSD_SOURCE)) - typedef unsigned char u_char; - typedef unsigned short u_short; - typedef unsigned int u_int; - typedef unsigned long u_long; - - typedef unsigned char uchar_t; - typedef unsigned short ushort_t; - typedef unsigned int uint_t; - typedef unsigned long ulong_t; -#endif /* ACE_LACKS_SYS_TYPES_H */ - -/* Define required types if missing */ - -#if defined (ACE_LACKS_INT8_T) -# if !defined (ACE_INT8_T_TYPE) -# define ACE_INT8_T_TYPE char -# endif /* !ACE_INT8_T_TYPE */ - typedef ACE_INT8_T_TYPE int8_t; -#endif /* ACE_LACKS_INT8_T */ - -#if defined (ACE_LACKS_UINT8_T) -# if !defined (ACE_UINT8_T_TYPE) -# define ACE_UINT8_T_TYPE unsigned char -# endif /* !ACE_UINT8_T_TYPE */ - typedef ACE_UINT8_T_TYPE int8_t; -#endif /* ACE_LACKS_UINT8_T */ - -#if defined (ACE_LACKS_INT16_T) -# if !defined (ACE_INT16_T_TYPE) -# define ACE_INT16_T_TYPE short -# endif /* !ACE_INT16_T_TYPE */ - typedef ACE_INT16_T_TYPE int16_t; -#endif /* ACE_LACKS_INT16_T */ - -#if defined (ACE_LACKS_UINT16_T) -# if !defined (ACE_UINT16_T_TYPE) -# define ACE_UINT16_T_TYPE unsigned short -# endif /* !ACE_UINT16_T_TYPE */ - typedef ACE_UINT16_T_TYPE int16_t; -#endif /* ACE_LACKS_UINT16_T */ - -#if defined (ACE_LACKS_INT32_T) -# if !defined (ACE_INT32_T_TYPE) -# define ACE_INT32_T_TYPE long -# endif /* !ACE_INT32_T_TYPE */ - typedef ACE_INT32_T_TYPE int32_t; -#endif /* ACE_LACKS_INT32_T */ - -#if defined (ACE_LACKS_UINT32_T) -# if !defined (ACE_UINT32_T_TYPE) -# define ACE_UINT32_T_TYPE unsigned long -# endif /* !ACE_UINT32_T_TYPE */ - typedef ACE_UINT32_T_TYPE int32_t; -#endif /* ACE_LACKS_UIN32_T */ - -// @todo pull in ACE class here -// 64 bit will be a problem, but stub it out for now -/* -If an implementation provides integer types with width 64 that meet -these requirements, then the following types are required: int64_t uint64_t - -In particular, this will be the case if any of the following are true: - -The implementation supports the _POSIX_V6_ILP32_OFFBIG programming -environment and the application is being built in the -_POSIX_V6_ILP32_OFFBIG programming environment (see the Shell and -Utilities volume of IEEE Std 1003.1-2001, c99, Programming Environments). - -The implementation supports the _POSIX_V6_LP64_OFF64 programming -environment and the application is being built in the -_POSIX_V6_LP64_OFF64 programming environment. - -The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming -environment and the application is being built in the -_POSIX_V6_LPBIG_OFFBIG programming environment. -*/ -#if defined (ACE_LACKS_INT64_T) -# if !defined (ACE_INT64_T_TYPE) -# define ACE_INT64_T_TYPE long -# endif /* !ACE_INT64_T_TYPE */ - typedef ACE_INT64_T_TYPE int64_t; -#endif /* ACE_LACKS_INT64_T */ - -#if defined (ACE_LACKS_UINT64_T) -# if !defined (ACE_UINT64_T_TYPE) -# define ACE_UINT64_T_TYPE unsigned long -# endif /* !ACE_UINT64_T_TYPE */ - typedef ACE_UINT64_T_TYPE int64_t; -#endif /* ACE_LACKS_UIN64_T */ - -// @todo move the ACE_INT## typedefs here so that ACE_INT64 will -// always be available. - -// @todo perhaps add macros - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDINT_H */ - diff --git a/dep/include/ace/os_include/os_stdio.h b/dep/include/ace/os_include/os_stdio.h deleted file mode 100644 index 23cec4d8eba..00000000000 --- a/dep/include/ace/os_include/os_stdio.h +++ /dev/null @@ -1,88 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stdio.h - * - * standard buffered input/output - * - * $Id: os_stdio.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STDIO_H -#define ACE_OS_INCLUDE_OS_STDIO_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// NOTE: stdarg.h must be #included before stdio.h on LynxOS. -#include "ace/os_include/os_stdarg.h" -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_STDIO_H) -# include /**/ -#endif /* !ACE_LACKS_STDIO_H */ - -#if defined (ACE_VXWORKS) -// for remove(), rename() -# include /**/ -// for remCurIdGet() -# include /**/ -# if defined (__RTP__) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x650)) -# define L_cuserid _PARM_L_cuserid -# endif -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# if defined (INTEGRITY) -# define ACE_MAX_USERID 32 -# elif defined (ACE_WIN32) -# define ACE_MAX_USERID 32 -# else -# if defined (_POSIX_SOURCE) && defined (L_cuserid) -# define ACE_MAX_USERID L_cuserid -# else -# define ACE_MAX_USERID 9 -# endif -# endif /* INTEGRITY */ - -#if defined (BUFSIZ) -# define ACE_STREAMBUF_SIZE BUFSIZ -#else -# define ACE_STREAMBUF_SIZE 1024 -#endif /* BUFSIZ */ - -#if defined (ACE_WIN32) - typedef OVERLAPPED ACE_OVERLAPPED; -#else - struct ACE_OVERLAPPED - { - unsigned long Internal; - unsigned long InternalHigh; - unsigned long Offset; - unsigned long OffsetHigh; - ACE_HANDLE hEvent; - }; -#endif /* ACE_WIN32 */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDIO_H */ - diff --git a/dep/include/ace/os_include/os_stdlib.h b/dep/include/ace/os_include/os_stdlib.h deleted file mode 100644 index 4813f4e2bcc..00000000000 --- a/dep/include/ace/os_include/os_stdlib.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stdlib.h - * - * standard library definitions - * - * $Id: os_stdlib.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STDLIB_H -#define ACE_OS_INCLUDE_OS_STDLIB_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" -#include "ace/os_include/sys/os_wait.h" - -#if defined (ACE_HAS_ALLOCA_H) -# include /**/ -#endif /* ACE_HAS_ALLOCA_H */ - -#if !defined (ACE_LACKS_STDLIB_H) -# include /**/ -#endif /* !ACE_LACKS_STDLIB_H */ - -#if defined (ACE_VXWORKS) && !defined (__RTP__) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - typedef u_int ACE_RANDR_TYPE; -#if defined (ACE_HAS_BROKEN_RANDR) - // The SunOS 5.4.X version of rand_r is inconsistent with the header - // files... - int rand_r (ACE_RANDR_TYPE seed); -#else -#endif /* ACE_HAS_BROKEN_RANDR */ - -#if defined (DIGITAL_UNIX) - extern int _Prand_r (unsigned int *seedptr); -#endif /* DIGITAL_UNIX */ - -#if defined (ACE_LACKS_PUTENV_PROTOTYPE) - int putenv (char *); -#endif /* ACE_LACKS_PUTENV_PROTOTYPE */ - -#if defined (ACE_LACKS_MKTEMP_PROTOTYPE) - char *mktemp (char *); -#endif /* ACE_LACKS_MKTEMP_PROTOTYPE */ - -#if defined (ACE_LACKS_MKSTEMP_PROTOTYPE) - int mkstemp(char *); -#endif /* ACE_LACKS_MKSTEMP_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STDLIB_H */ - diff --git a/dep/include/ace/os_include/os_string.h b/dep/include/ace/os_include/os_string.h deleted file mode 100644 index cfbc4fd2fcf..00000000000 --- a/dep/include/ace/os_include/os_string.h +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_string.h - * - * string operations - * - * $Id: os_string.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STRING_H -#define ACE_OS_INCLUDE_OS_STRING_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" - -// Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem. -#if defined (ACE_HAS_GNU_CSTRING_H) -// Define this file to keep /usr/include/memory.h from being included. -# include /**/ -#else -# if !defined (ACE_LACKS_MEMORY_H) -# include /**/ -# endif /* !ACE_LACKS_MEMORY_H */ -# if !defined (ACE_LACKS_STRING_H) -# include /**/ -# endif /* !ACE_LACKS_STRING_H */ -#endif /* ACE_HAS_GNU_CSTRING_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - // this looks fishy... dhinton -#if !defined (ACE_HAS_STRERROR) -# if defined (ACE_HAS_SYS_ERRLIST) - extern char *sys_errlist[]; -# define strerror(err) sys_errlist[err] -# else -# define strerror(err) "strerror is unsupported" -# endif /* ACE_HAS_SYS_ERRLIST */ -#endif /* !ACE_HAS_STRERROR */ - -#if defined (ACE_LACKS_STRTOK_R_PROTOTYPE) && !defined (_POSIX_SOURCE) - char *strtok_r (char *s, const char *delim, char **save_ptr); -#endif /* ACE_LACKS_STRTOK_R_PROTOTYPE */ - -#if defined (ACE_LACKS_STRNLEN_PROTOTYPE) - size_t strnlen(const char *s, size_t maxlen); -#endif /* ACE_LACKS_STRNLEN_PROTOTYPE */ - -#if defined (__BORLANDC__) && (__BORLANDC__ < 0x560) -# define _stricmp stricmp -# define _strnicmp strnicmp -#endif /* __BORLANDC__ */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STRING_H */ - diff --git a/dep/include/ace/os_include/os_strings.h b/dep/include/ace/os_include/os_strings.h deleted file mode 100644 index 8bfc768962f..00000000000 --- a/dep/include/ace/os_include/os_strings.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_strings.h - * - * string operations - * - * $Id: os_strings.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STRINGS_H -#define ACE_OS_INCLUDE_OS_STRINGS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_STRINGS_H) -# include /**/ -#endif /* !ACE_LACKS_STRINGS_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_STRCASECMP_PROTOTYPE) - int strcasecmp(const char *, const char *); -#endif /* ACE_LACKS_STRCASECMP_PROTOTYPE */ - -#if defined (ACE_LACKS_STRNCASECMP_PROTOTYPE) - int strncasecmp(const char *, const char *, size_t); -#endif /* ACE_LACKS_STRNCASECMP_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STRINGS_H */ - diff --git a/dep/include/ace/os_include/os_stropts.h b/dep/include/ace/os_include/os_stropts.h deleted file mode 100644 index 961bd37feaa..00000000000 --- a/dep/include/ace/os_include/os_stropts.h +++ /dev/null @@ -1,121 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stropts.h - * - * STREAMS interface (STREAMS) - * - * $Id: os_stropts.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_STROPTS_H -#define ACE_OS_INCLUDE_OS_STROPTS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_unistd.h" - -#if defined (ACE_HAS_TIMOD_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -# include /**/ -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -#elif defined (ACE_HAS_OSF_TIMOD_H) -# include /**/ -#endif /* ACE_HAS_TIMOD_H */ - -#if !defined (ACE_LACKS_SYS_IOCTL_H) -# include /**/ -#endif /* !ACE_LACKS_IOCTL_H */ - -#if defined (ACE_HAS_SYS_FILIO_H) -# include /**/ -#endif /* ACE_HAS_SYS_FILIO_H */ - -#if defined (ACE_HAS_SYS_SOCKIO_H) -# include /**/ -#endif /* ACE_HAS_SOCKIO_H */ - -// This is sorta counter intuitive, but this is how it was done in OS.h -// @todo: fix this... dhinton -#if defined (ACE_HAS_STREAMS) -# if defined (AIX) -# if !defined (_XOPEN_EXTENDED_SOURCE) -# define _XOPEN_EXTENDED_SOURCE -# endif /* !_XOPEN_EXTENDED_SOURCE */ -# endif /* AIX */ -#endif /* ACE_HAS_STREAMS */ - -#if !defined (ACE_LACKS_STROPTS_H) -# include /**/ -#endif /* !ACE_LACKS_STROPTS_H */ - -// This is sorta counter intuitive, but this is how it was done in OS.h -// @todo: fix this... dhinton -#if defined (ACE_HAS_STREAMS) -# if defined (AIX) -# undef _XOPEN_EXTENDED_SOURCE -# endif /* AIX */ -#endif /* ACE_HAS_STREAMS */ - -#if defined (ACE_VXWORKS) -// for ioctl() -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_STRRECVFD) - struct strrecvfd {}; -#endif /* ACE_LACKS_STRRECVFD */ - -# if !defined (SIOCGIFBRDADDR) -# define SIOCGIFBRDADDR 0 -# endif /* SIOCGIFBRDADDR */ - -# if !defined (SIOCGIFADDR) -# define SIOCGIFADDR 0 -# endif /* SIOCGIFADDR */ - -# if !defined (ACE_HAS_STRBUF_T) -struct strbuf -{ - /// No. of bytes in buffer. - int maxlen; - /// No. of bytes returned. - int len; - /// Pointer to data. - void *buf; -}; -# endif /* ACE_HAS_STRBUF_T */ - -// These prototypes are chronically lacking from many versions of UNIX. -#if !defined (ACE_WIN32) && !defined (ACE_HAS_ISASTREAM_PROTOTYPE) - int isastream (int); -#endif /* !ACE_WIN32 && ACE_HAS_ISASTREAM_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_STROPTS_H */ - diff --git a/dep/include/ace/os_include/os_syslog.h b/dep/include/ace/os_include/os_syslog.h deleted file mode 100644 index f1713b47780..00000000000 --- a/dep/include/ace/os_include/os_syslog.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_syslog.h - * - * definitions for system error logging - * - * $Id: os_syslog.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_SYSLOG_H -#define ACE_OS_INCLUDE_OS_SYSLOG_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SYSLOG_H) -# include /**/ -#endif /* !ACE_LACKS_SYSLOG_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_SYSLOG_H */ - diff --git a/dep/include/ace/os_include/os_tar.h b/dep/include/ace/os_include/os_tar.h deleted file mode 100644 index a0dc6ce2a76..00000000000 --- a/dep/include/ace/os_include/os_tar.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_tar.h - * - * extended tar definitions - * - * $Id: os_tar.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_TAR_H -#define ACE_OS_INCLUDE_OS_TAR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_TAR_H) -# include /**/ -#endif /* !ACE_LACKS_TAR_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_TAR_H */ - diff --git a/dep/include/ace/os_include/os_termios.h b/dep/include/ace/os_include/os_termios.h deleted file mode 100644 index d67aa4a1aa9..00000000000 --- a/dep/include/ace/os_include/os_termios.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_termios.h - * - * define values for termios - * - * $Id: os_termios.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_TERMIOS_H -#define ACE_OS_INCLUDE_OS_TERMIOS_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_TERMIOS_H) -# include /**/ -#endif /* !ACE_LACKS_TERMIOS_H */ - -#if defined (HPUX) -# include /**/ -#endif /* HPUX */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_TERMIOS_H */ - diff --git a/dep/include/ace/os_include/os_tgmath.h b/dep/include/ace/os_include/os_tgmath.h deleted file mode 100644 index 2b112a12875..00000000000 --- a/dep/include/ace/os_include/os_tgmath.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_tgmath.h - * - * type-generic macros - * - * $Id: os_tgmath.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_TGMATH_H -#define ACE_OS_INCLUDE_OS_TGMATH_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_math.h" -#include "ace/os_include/os_complex.h" - -#if !defined (ACE_LACKS_TGMATH_H) -# include /**/ -#endif /* !ACE_LACKS_TGMATH_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_TGMATH_H */ - diff --git a/dep/include/ace/os_include/os_time.h b/dep/include/ace/os_include/os_time.h deleted file mode 100644 index 3670f3b492d..00000000000 --- a/dep/include/ace/os_include/os_time.h +++ /dev/null @@ -1,124 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_time.h - * - * time types - * - * $Id: os_time.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_TIME_H -#define ACE_OS_INCLUDE_OS_TIME_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// @todo should we include anything from signal.h? -#include "ace/os_include/sys/os_types.h" - -// To get the proper select() signature, this is required for HP-UX, and -// maybe other platforms that offer both int and fdset forms of select(). -// For HP-UX, sys/time.h must be included before time.h, or -// _XOPEN_SOURCE_EXTENDED must be defined. It's not nice to require -// the preprocessor macro, so we force our select() preference this way. -#if !defined (ACE_LACKS_SYS_TIME_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_TIME_H */ - -#if !defined (ACE_LACKS_TIME_H) -# include /**/ -#endif /* !ACE_LACKS_TIME_H */ - -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) -using std::tm; -# if !defined (ACE_HAS_DINKUM_STL) -# if defined (ACE_WIN32) -using std::_timezone; -# else -using std::timezone; -# endif -# endif -using std::difftime; -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */ - -# if !defined (ACE_HAS_POSIX_TIME) -// Definition per POSIX. -typedef struct timespec -{ - /// Seconds - time_t tv_sec; - /// Nanoseconds - long tv_nsec; -} timespec_t; -# elif defined (ACE_HAS_BROKEN_POSIX_TIME) -# if defined (ACE_OPENVMS) -# include /**/ -# else -// OSF/1 defines struct timespec in - Tom Marrs -# include /**/ -# endif -# endif /* !ACE_HAS_POSIX_TIME */ - -# if defined(ACE_LACKS_TIMESPEC_T) -typedef struct timespec timespec_t; -# endif /* ACE_LACKS_TIMESPEC_T */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_HAS_BROKEN_CTIME) -# undef ctime -#endif /* ACE_HAS_BROKEN_CTIME */ - -// There are a lot of threads-related macro definitions in the config files. -// They came in at different times and from different places and platform -// requirements as threads evolved. They are probably not all needed - some -// overlap or are otherwise confused. This is an attempt to start -// straightening them out. -#if defined (ACE_HAS_PTHREADS) /* POSIX.1c threads (pthreads) */ - // ... and 2-parameter asctime_r and ctime_r -# if !defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) && \ - !defined (ACE_HAS_STHREADS) && !defined (ACE_VXWORKS) -# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -# endif -#endif /* ACE_HAS_PTHREADS */ - -#if defined (ACE_LACKS_STRPTIME_PROTOTYPE) && !defined (_XOPEN_SOURCE) - extern char *strptime (const char *s, const char *fmt, struct tm *tp); -#endif /* ACE_LACKS_STRPTIME_PROTOTYPE */ - -#if defined (ACE_LACKS_CONST_TIMESPEC_PTR) -typedef struct timespec * ACE_TIMESPEC_PTR; -#else -typedef const struct timespec * ACE_TIMESPEC_PTR; -#endif /* ACE_LACKS_CONST_TIMESPEC_PTR */ - -#if defined (DIGITAL_UNIX) - extern char *_Pctime_r (const time_t *, char *); - extern struct tm *_Plocaltime_r (const time_t *, struct tm *); - extern struct tm *_Pgmtime_r (const time_t *, struct tm *); - extern char *_Pasctime_r (const struct tm *, char *); -#endif /* DIGITAL_UNIX */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_TIME_H */ - diff --git a/dep/include/ace/os_include/os_trace.h b/dep/include/ace/os_include/os_trace.h deleted file mode 100644 index 0eacf9dc4bb..00000000000 --- a/dep/include/ace/os_include/os_trace.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_trace.h - * - * tracing - * - * $Id: os_trace.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_TRACE_H -#define ACE_OS_INCLUDE_OS_TRACE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_TRACE_H) -# include /**/ -#endif /* !ACE_LACKS_TRACE_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_TRACE_H */ - diff --git a/dep/include/ace/os_include/os_ucontext.h b/dep/include/ace/os_include/os_ucontext.h deleted file mode 100644 index 556bbdbbe45..00000000000 --- a/dep/include/ace/os_include/os_ucontext.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ucontext.h - * - * user context - * - * $Id: os_ucontext.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_UCONTEXT_H -#define ACE_OS_INCLUDE_OS_UCONTEXT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" - -#if !defined (ACE_LACKS_UCONTEXT_H) -# include /**/ -#endif /* !ACE_LACKS_ucontext_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# if !defined (ACE_HAS_UCONTEXT_T) -typedef int ucontext_t; -# endif /* ACE_HAS_UCONTEXT_T */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_UCONTEXT_H */ - diff --git a/dep/include/ace/os_include/os_ulimit.h b/dep/include/ace/os_include/os_ulimit.h deleted file mode 100644 index ad18c8a18d2..00000000000 --- a/dep/include/ace/os_include/os_ulimit.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ulimit.h - * - * ulimit commands - * - * $Id: os_ulimit.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ULIMIT_H -#define ACE_OS_INCLUDE_OS_ULIMIT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ULIMIT_H) -# include /**/ -#endif /* !ACE_LACKS_ULIMIT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ULIMIT_H */ - diff --git a/dep/include/ace/os_include/os_unistd.h b/dep/include/ace/os_include/os_unistd.h deleted file mode 100644 index 6e2d4a5c537..00000000000 --- a/dep/include/ace/os_include/os_unistd.h +++ /dev/null @@ -1,204 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_unistd.h - * - * standard symbolic constants and types - * - * $Id: os_unistd.h 81697 2008-05-14 18:33:11Z johnnyw $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_UNISTD_H -#define ACE_OS_INCLUDE_OS_UNISTD_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" -#include "ace/os_include/os_inttypes.h" - -#if defined (__BORLANDC__) -# include "ace/os_include/os_fcntl.h" -#endif /* __BORLANDC */ - -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) -# include /**/ -# include /**/ -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ - -#if defined (ACE_HAS_SYS_SYSTEMINFO_H) -# include /**/ -#endif /* ACE_HAS_SYS_SYSTEMINFO_H */ - -#if !defined (ACE_LACKS_UNISTD_H) -# include /**/ -#endif /* !ACE_LACKS_UNISTD_H */ - -#if defined (ACE_VXWORKS) -# if !defined (__RTP__) - // for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(), - // getwd(), and isatty() - # include /**/ -# endif -// for gethostname() -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_WIN32) -// The following are #defines and #includes that are specific to -// WIN32. -# if defined (ACE_HAS_WINCE) -# define ACE_STDIN _fileno (stdin) -# define ACE_STDOUT _fileno (stdout) -# define ACE_STDERR _fileno (stderr) -# else -# define ACE_STDIN GetStdHandle (STD_INPUT_HANDLE) -# define ACE_STDOUT GetStdHandle (STD_OUTPUT_HANDLE) -# define ACE_STDERR GetStdHandle (STD_ERROR_HANDLE) -# endif // ACE_HAS_WINCE -// The following are #defines and #includes that are specific to UNIX. -#else /* !ACE_WIN32 */ -# if defined (STDIN_FILENO) -# define ACE_STDIN STDIN_FILENO -# else -# define ACE_STDIN 0 -# endif -# if defined (STDOUT_FILENO) -# define ACE_STDOUT STDOUT_FILENO -# else -# define ACE_STDOUT 1 -# endif -# if defined (STDERR_FILENO) -# define ACE_STDERR STDERR_FILENO -# else -# define ACE_STDERR 2 -# endif -#endif /* ACE_WIN32 */ - -#if (!defined (_BSD_SOURCE) && \ - !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)) \ - || (defined (_XOPEN_SOURCE) && defined (__GNUC__)) - -# if defined (ACE_LACKS_SETREUID_PROTOTYPE) - extern int setreuid (uid_t ruid, uid_t euid); -# endif /* ACE_LACKS_SETREUID_PROTOTYPE */ - -# if defined (ACE_LACKS_SETREGID_PROTOTYPE) - extern int setregid (gid_t rgid, gid_t egid); -# endif /* ACE_LACKS_SETREGID_PROTOTYPE */ -#endif /* !_BSD_SOURCE && !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED - || _XOPEN_SOURCE && __GNUC__ */ - - // for use by access() -# if !defined (R_OK) -# define R_OK 04 /* Test for Read permission. */ -# endif /* R_OK */ - -# if !defined (W_OK) -# define W_OK 02 /* Test for Write permission. */ -# endif /* W_OK */ - -# if !defined (X_OK) -# if defined (ACE_WIN32) - /* Windows has no test for X_OK - use R_OK instead */ -# define X_OK R_OK /* Test for eXecute permission. */ -# else /* ACE_WIN32 */ -# define X_OK 01 /* Test for eXecute permission. */ -# endif /* ACE_WIN32 */ -# endif /* X_OK */ - -# if !defined (F_OK) -# define F_OK 0 /* Test for existence of File. */ -# endif /* F_OK */ - -#if defined (ACE_LACKS_UALARM_PROTOTYPE) - u_int ualarm (u_int usecs, u_int interval); -#endif /* ACE_LACKS_UALARM_PROTOTYPE */ - -#if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500 - // _XOPEN_SOURCE == 500 Single Unix conformance - // It seems that _XOPEN_SOURCE == 500 means that the prototypes are - // already defined in the system headers. - ssize_t pread (int fd, - void *buf, - size_t nbytes, - ACE_OFF_T offset); - - ssize_t pwrite (int fd, - const void *buf, - size_t n, - ACE_OFF_T offset); -#endif /* ACE_LACKS_PREAD_PROTOTYPE && (_XOPEN_SOURCE - 0) < 500 */ - -#if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \ - !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED) - pid_t getpgid (pid_t pid); -#endif /* ACE_LACKS_GETPGID_PROTOTYPE && - !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */ - -#if !defined (_LARGEFILE64_SOURCE) -# if defined (ACE_LACKS_LSEEK64_PROTOTYPE) && \ - defined (ACE_LACKS_LLSEEK_PROTOTYPE) -# error Define either ACE_LACKS_LSEEK64_PROTOTYPE or ACE_LACKS_LLSEEK_PROTOTYPE, not both! -# elif defined (ACE_LACKS_LSEEK64_PROTOTYPE) - ACE_LOFF_T lseek64 (int fd, ACE_LOFF_T offset, int whence); -# elif defined (ACE_LACKS_LLSEEK_PROTOTYPE) - ACE_LOFF_T llseek (int fd, ACE_LOFF_T offset, int whence); -# endif -#endif /* _LARGEFILE64_SOURCE */ - -#if defined (__BORLANDC__) -# if (__BORLANDC__ <= 0x540) -# define _getcwd getcwd -# define _chdir chdir -# undef _access -# define _access access -# endif -# define _isatty isatty -#endif /* __BORLANDC__ */ - -# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) - - ssize_t read_timedwait (ACE_HANDLE handle, - char *buf, - size_t n, - struct timespec *timeout); - - ssize_t write_timedwait (ACE_HANDLE handle, - const void *buf, - size_t n, - struct timespec *timeout); - -# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ - -#if defined (ACE_LACKS_SWAB_PROTOTYPE) - void swab(const void *, void *, ssize_t); -#endif /* ACE_LACKS_SWAB_PROTOTYPE */ - -#if defined (ACE_LACKS_GETOPT_PROTOTYPE) - int getopt(int, char * const [], const char *); -#endif /* ACE_LACKS_GETOPT_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_UNISTD_H */ - diff --git a/dep/include/ace/os_include/os_utime.h b/dep/include/ace/os_include/os_utime.h deleted file mode 100644 index 4cf719e34f9..00000000000 --- a/dep/include/ace/os_include/os_utime.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_utime.h - * - * access and modification times structure - * - * $Id: os_utime.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_UTIME_H -#define ACE_OS_INCLUDE_OS_UTIME_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_UTIME_H) -# include /**/ -#endif /* !ACE_LACKS_UTIME_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_UTIME_H */ - diff --git a/dep/include/ace/os_include/os_utmpx.h b/dep/include/ace/os_include/os_utmpx.h deleted file mode 100644 index 234351366fb..00000000000 --- a/dep/include/ace/os_include/os_utmpx.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_utmpx.h - * - * user accounting database definitions - * - * $Id: os_utmpx.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_UTMPX_H -#define ACE_OS_INCLUDE_OS_UTMPX_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_time.h" - -#if !defined (ACE_LACKS_UTMPX_H) -# include /**/ -#endif /* !ACE_LACKS_UTMPX_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_UTMPX_H */ - diff --git a/dep/include/ace/os_include/os_wchar.h b/dep/include/ace/os_include/os_wchar.h deleted file mode 100644 index a020715876f..00000000000 --- a/dep/include/ace/os_include/os_wchar.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_wchar.h - * - * wide-character handling - * - * $Id: os_wchar.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_WCHAR_H -#define ACE_OS_INCLUDE_OS_WCHAR_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// ctype.h, string.h, stdarg.h, stdio.h, stdlib.h, time.h -#include "ace/os_include/os_stdio.h" -#include "ace/os_include/os_stdlib.h" -#include "ace/os_include/os_time.h" -#include "ace/os_include/os_string.h" -#include "ace/os_include/os_ctype.h" - -#if !defined (ACE_LACKS_WCHAR_H) -# include /**/ -#endif /* !ACE_LACKS_WCHAR_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_WCHAR_H */ - diff --git a/dep/include/ace/os_include/os_wctype.h b/dep/include/ace/os_include/os_wctype.h deleted file mode 100644 index 5f385e0fc63..00000000000 --- a/dep/include/ace/os_include/os_wctype.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_wctype.h - * - * wide-character classification and mapping utilities - * - * $Id: os_wctype.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_WCTYPE_H -#define ACE_OS_INCLUDE_OS_WCTYPE_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// ctype.h, string.h, stdarg.h, stdio.h, stdlib.h, time.h -#include "ace/os_include/os_wchar.h" - -#if !defined (ACE_LACKS_WCTYPE_H) -# include /**/ -#endif /* !ACE_LACKS_WCTYPE_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_WCTYPE_H */ - diff --git a/dep/include/ace/os_include/os_wordexp.h b/dep/include/ace/os_include/os_wordexp.h deleted file mode 100644 index 885893861a2..00000000000 --- a/dep/include/ace/os_include/os_wordexp.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_wordexp.h - * - * word-expansion types - * - * $Id: os_wordexp.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_WORDEXP_H -#define ACE_OS_INCLUDE_OS_WORDEXP_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" // size_t - -#if !defined (ACE_LACKS_WORDEXP_H) -# include /**/ -#endif /* !ACE_LACKS_WORDEXP_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_WORDEXP_H */ - diff --git a/dep/include/ace/os_include/sys/os_ipc.h b/dep/include/ace/os_include/sys/os_ipc.h deleted file mode 100644 index 99401b724cb..00000000000 --- a/dep/include/ace/os_include/sys/os_ipc.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_ipc.h - * - * XSI interprocess communication access structure - * - * $Id: os_ipc.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_IPC_H -#define ACE_OS_INCLUDE_SYS_OS_IPC_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SYS_IPC_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_IPC_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_WIN32) -# define ACE_INVALID_SEM_KEY 0 -#else /* !ACE_WIN32 */ -# define ACE_INVALID_SEM_KEY -1 -#endif /* ACE_WIN32 */ - -#if !defined (IPC_PRIVATE) -# define IPC_PRIVATE ACE_INVALID_SEM_KEY -#endif /* IPC_PRIVATE */ - -#if !defined (IPC_STAT) -# define IPC_STAT 0 -#endif /* IPC_STAT */ - -#if !defined (IPC_CREAT) -# define IPC_CREAT 0 -#endif /* IPC_CREAT */ - -#if !defined (IPC_NOWAIT) -# define IPC_NOWAIT 0 -#endif /* IPC_NOWAIT */ - -#if !defined (IPC_RMID) -# define IPC_RMID 0 -#endif /* IPC_RMID */ - -#if !defined (IPC_EXCL) -# define IPC_EXCL 0 -#endif /* IPC_EXCL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_IPC_H */ - diff --git a/dep/include/ace/os_include/sys/os_loadavg.h b/dep/include/ace/os_include/sys/os_loadavg.h deleted file mode 100644 index 151f400e2c2..00000000000 --- a/dep/include/ace/os_include/sys/os_loadavg.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_loadavg.h - * - * loadavg functions - * - * $Id: os_loadavg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_LOADAVG_H -#define ACE_OS_INCLUDE_SYS_OS_LOADAVG_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_SYS_LOADAVG_H) -# include /**/ -#endif /* ACE_HAS_SYS_LOADAVG_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_LOADAVG_H */ - diff --git a/dep/include/ace/os_include/sys/os_mman.h b/dep/include/ace/os_include/sys/os_mman.h deleted file mode 100644 index c100d52fafe..00000000000 --- a/dep/include/ace/os_include/sys/os_mman.h +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_mman.h - * - * memory management declarations - * - * $Id: os_mman.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_MMAN_H -#define ACE_OS_INCLUDE_SYS_OS_MMAN_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if defined (ACE_LACKS_MMAP) -# define ACE_LACKS_SYS_MMAN_H -#endif /* ACE_LACKS_MMAP */ - -#if !defined (ACE_LACKS_SYS_MMAN_H) - // Fixes a problem with HP/UX. -# if defined (ACE_HAS_BROKEN_MMAP_H) - extern "C" { -# endif /* ACE_HAS_BROKEN_MMAP_H */ -# include /**/ -# if defined (ACE_HAS_BROKEN_MMAP_H) - } -# endif /* ACE_HAS_BROKEN_MMAP_H */ -#endif /* ACE_LACKS_SYS_MMAN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_SYS_MMAN_H) && !defined (ACE_WIN32) -# define PROT_READ 0 -# define PROT_WRITE 0 -# define PROT_EXEC 0 -# define PROT_NONE 0 -# define PROT_RDWR 0 -# define MAP_PRIVATE 0 -# define MAP_SHARED 0 -# define MAP_FIXED 0 -#elif defined (ACE_WIN32) - // These two may be used for internal flags soon: -# define MAP_PRIVATE 1 -# define MAP_SHARED 2 -# define MAP_FIXED 4 - // MMAP flags -# define PROT_READ PAGE_READONLY -# define PROT_WRITE PAGE_READWRITE -# define PROT_RDWR PAGE_READWRITE -/* If we can find suitable use for these flags, here they are: -PAGE_WRITECOPY -PAGE_EXECUTE -PAGE_EXECUTE_READ -PAGE_EXECUTE_READWRITE -PAGE_EXECUTE_WRITECOPY -PAGE_GUARD -PAGE_NOACCESS -PAGE_NOCACHE */ -#endif /* !ACE_LACKS_SYS_MMAN_H && !ACE_WIN32*/ - -# if !defined (ACE_MAP_PRIVATE) -# define ACE_MAP_PRIVATE MAP_PRIVATE -# endif /* ! ACE_MAP_PRIVATE */ - -# if !defined (ACE_MAP_SHARED) -# define ACE_MAP_SHARED MAP_SHARED -# endif /* ! ACE_MAP_SHARED */ - -# if !defined (ACE_MAP_FIXED) -# define ACE_MAP_FIXED MAP_FIXED -# endif /* ! ACE_MAP_FIXED */ - -# if !defined (MAP_FAILED) || defined (ACE_HAS_BROKEN_MAP_FAILED) -# undef MAP_FAILED -# define MAP_FAILED ((void *) -1) -# elif defined (ACE_HAS_LONG_MAP_FAILED) -# undef MAP_FAILED -# define MAP_FAILED ((void *) -1L) -# endif /* !MAP_FAILED || ACE_HAS_BROKEN_MAP_FAILED */ - -#if !defined (PROT_RDWR) -# define PROT_RDWR (PROT_READ|PROT_WRITE) -#endif /* PROT_RDWR */ - -# if defined (ACE_WIN32) - // Needed to map calls to NT transparently. -# define MS_ASYNC 0 -# define MS_INVALIDATE 0 -# endif /* ACE_WIN32 */ - -# if !defined (MS_SYNC) -# define MS_SYNC 0x0 -# endif /* !MS_SYNC */ - -#if !defined (ACE_LACKS_MADVISE) && defined (ACE_LACKS_MADVISE_PROTOTYPE) - extern "C" int madvise(caddr_t, size_t, int); -#endif /* !ACE_LACKS_MADVISE && ACE_LACKS_MADVISE_PROTOTYPE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_MMAN_H */ - diff --git a/dep/include/ace/os_include/sys/os_msg.h b/dep/include/ace/os_include/sys/os_msg.h deleted file mode 100644 index 57341dba97d..00000000000 --- a/dep/include/ace/os_include/sys/os_msg.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_msg.h - * - * XSI message queue structures - * - * $Id: os_msg.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_MSG_H -#define ACE_OS_INCLUDE_SYS_OS_MSG_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_ipc.h" - -#if !defined (ACE_LACKS_SYS_MSG_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_MSG_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - // Declare opaque type. Needed for ACE_OS wrappers on systems - // without SysV IPC. - struct msqid_ds; - -#if defined (ACE_LACKS_SYSV_MSQ_PROTOS) - int msgget (key_t, int); - int msgrcv (int, void *, size_t, long, int); - int msgsnd (int, const void *, size_t, int); - int msgctl (int, int, struct msqid_ds *); -#endif /* ACE_LACKS_SYSV_MSQ_PROTOS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_MSG_H */ - diff --git a/dep/include/ace/os_include/sys/os_pstat.h b/dep/include/ace/os_include/sys/os_pstat.h deleted file mode 100644 index 253b8127979..00000000000 --- a/dep/include/ace/os_include/sys/os_pstat.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_pstat.h - * - * pstat functions - * - * $Id: os_pstat.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_PSTAT_H -#define ACE_OS_INCLUDE_SYS_OS_PSTAT_H - -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_SYS_PSTAT_H) -# include /**/ -# include /**/ -#endif /* ACE_HAS_SYS_PSTAT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_PSTAT_H */ - diff --git a/dep/include/ace/os_include/sys/os_resource.h b/dep/include/ace/os_include/sys/os_resource.h deleted file mode 100644 index a724ed2e0eb..00000000000 --- a/dep/include/ace/os_include/sys/os_resource.h +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_resource.h - * - * definitions for XSI resource operations - * - * $Id: os_resource.h 81697 2008-05-14 18:33:11Z johnnyw $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_RESOURCE_H -#define ACE_OS_INCLUDE_SYS_OS_RESOURCE_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_time.h" -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SYS_RESOURCE_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_RESOURCE_H */ - -#if defined (ACE_HAS_SYS_SYSTEMINFO_H) -# include /**/ -#endif /* ACE_HAS_SYS_SYSTEMINFO_H */ - -#if defined (ACE_HAS_SYS_SYSCALL_H) -# include /**/ -#endif /* ACE_HAS_SYS_SYSCALL_H */ - -// prusage_t is defined in -#if defined (ACE_HAS_PROC_FS) -# include /**/ -#endif /* ACE_HAS_PROC_FS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -// There must be a better way to do this... -#if !defined (RLIMIT_NOFILE) && !defined (ACE_LACKS_RLIMIT_NOFILE) -# if defined (linux) || defined (AIX) || defined (SCO) -# if defined (RLIMIT_OFILE) -# define RLIMIT_NOFILE RLIMIT_OFILE -# else -# define RLIMIT_NOFILE 200 -# endif /* RLIMIT_OFILE */ -# endif /* defined (linux) || defined (AIX) || defined (SCO) */ -#endif /* RLIMIT_NOFILE */ - -#if defined (ACE_WIN32) -# define RUSAGE_SELF 1 - /// Fake the UNIX rusage structure. Perhaps we can add more to this - /// later on? - struct rusage - { - FILETIME ru_utime; - FILETIME ru_stime; - }; -#endif /* ACE_WIN32 */ - -#if defined (ACE_LACKS_RLIMIT_PROTOTYPE) - int getrlimit (int resource, struct rlimit *rlp); - int setrlimit (int resource, const struct rlimit *rlp); -#endif /* ACE_LACKS_RLIMIT_PROTOTYPE */ - -#if defined (ACE_HAS_PRUSAGE_T) - typedef prusage_t ACE_Rusage; -#elif defined (ACE_HAS_GETRUSAGE) - typedef rusage ACE_Rusage; -#else - typedef int ACE_Rusage; -#endif /* ACE_HAS_PRUSAGE_T */ - -#if !defined (ACE_WIN32) -// These prototypes are chronically lacking from many versions of UNIX. -# if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE) - int getrusage (int who, struct rusage *rusage); -# endif /* ! ACE_HAS_GETRUSAGE_PROTOTYPE */ - -# if defined (ACE_LACKS_SYSCALL) - int syscall (int, ACE_HANDLE, struct rusage *); -# endif /* ACE_LACKS_SYSCALL */ -#endif /* !ACE_WIN32 */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_RESOURCE_H */ - diff --git a/dep/include/ace/os_include/sys/os_select.h b/dep/include/ace/os_include/sys/os_select.h deleted file mode 100644 index f3e999831fd..00000000000 --- a/dep/include/ace/os_include/sys/os_select.h +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_select.h - * - * select types - * - * $Id: os_select.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SELECT_H -#define ACE_OS_INCLUDE_SYS_OS_SELECT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_time.h" -#include "ace/os_include/os_signal.h" -#include "ace/os_include/os_unistd.h" - -#if !defined (ACE_LACKS_SYS_SELECT_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_SELECT_H */ - -#if defined (ACE_VXWORKS) && defined (ACE_LACKS_SYS_SELECT_H) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_WIN32) - // This will help until we figure out everything: -# define NFDBITS 32 /* only used in unused functions... */ -#elif defined (__QNX__) -# if !defined (NFDBITS) -# define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -# endif /* ! NFDBITS */ -#endif /* ACE_WIN32 */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SELECT_H */ - diff --git a/dep/include/ace/os_include/sys/os_sem.h b/dep/include/ace/os_include/sys/os_sem.h deleted file mode 100644 index 92153e2fcea..00000000000 --- a/dep/include/ace/os_include/sys/os_sem.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_sem.h - * - * XSI semaphore facility - * - * $Id: os_sem.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SEM_H -#define ACE_OS_INCLUDE_SYS_OS_SEM_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_ipc.h" - -#if !defined (ACE_LACKS_SYS_SEM_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_SEM_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# if !defined (GETVAL) -# define GETVAL 0 -# endif /* GETVAL */ - -# if !defined (SETVAL) -# define SETVAL 0 -# endif /* SETVAL */ - -# if !defined (GETALL) -# define GETALL 0 -# endif /* GETALL */ - -# if !defined (SETALL) -# define SETALL 0 -# endif /* SETALL */ - -# if !defined (SEM_UNDO) -# define SEM_UNDO 0 -# endif /* SEM_UNDO */ - -#if defined (ACE_LACKS_SEMBUF_T) - struct sembuf - { - /// semaphore # - unsigned short sem_num; - - /// semaphore operation - short sem_op; - - /// operation flags - short sem_flg; - }; -#endif /* ACE_LACKS_SEMBUF_T */ - -#if !defined (ACE_HAS_SEMUN) || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) - union semun - { - /// value for SETVAL - int val; - /// buffer for IPC_STAT & IPC_SET - struct semid_ds *buf; - /// array for GETALL & SETALL - u_short *array; - }; -#endif /* !ACE_HAS_SEMUN || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SEM_H */ - diff --git a/dep/include/ace/os_include/sys/os_shm.h b/dep/include/ace/os_include/sys/os_shm.h deleted file mode 100644 index 83e32486cb6..00000000000 --- a/dep/include/ace/os_include/sys/os_shm.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_shm.h - * - * XSI shared memory facility - * - * $Id: os_shm.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SHM_H -#define ACE_OS_INCLUDE_SYS_OS_SHM_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_ipc.h" - -#if !defined (ACE_LACKS_SYS_SHM_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_SHM_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - // Declare opaque type. Needed for ACE_OS wrappers on systems - // without SysV IPC. - struct shmid_ds; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SHM_H */ - diff --git a/dep/include/ace/os_include/sys/os_socket.h b/dep/include/ace/os_include/sys/os_socket.h deleted file mode 100644 index cefc28c2134..00000000000 --- a/dep/include/ace/os_include/sys/os_socket.h +++ /dev/null @@ -1,308 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_socket.h - * - * main sockets header - * - * $Id: os_socket.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SOCKET_H -#define ACE_OS_INCLUDE_SYS_OS_SOCKET_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_uio.h" - -#if !defined (ACE_LACKS_SYS_SOCKET_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_SOCKET_H */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -# include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if !defined (ACE_HAS_MSG) && !defined (SCO) - struct msghdr {}; -#endif /* ACE_HAS_MSG */ - -#if defined (ACE_HAS_MSG) && defined (ACE_LACKS_MSG_ACCRIGHTS) -# if !defined (msg_accrights) -# undef msg_control -# define msg_accrights msg_control -# endif /* ! msg_accrights */ - -# if !defined (msg_accrightslen) -# undef msg_controllen -# define msg_accrightslen msg_controllen -# endif /* ! msg_accrightslen */ -#endif /* ACE_HAS_MSG && ACE_LACKS_MSG_ACCRIGHTS */ - -# if defined (ACE_LACKS_SOCKADDR) - struct sockaddr { - u_char sa_len; /* total length */ - u_char sa_family; /* address family */ - char sa_data[14]; /* actually longer; address value */ - }; -# endif /* ACE_LACKS_SOCKADDR */ - -# if defined (ACE_LACKS_LINGER) - struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time */ - }; -# endif /* ACE_LACKS_LINGER */ - -#if defined (ACE_WIN32) - struct msghdr - { - /// Optional address - sockaddr * msg_name; - - /// Size of address - int msg_namelen; - - /// Scatter/gather array - iovec *msg_iov; - - /// # elements in msg_iov - int msg_iovlen; - - /// Access rights sent/received - caddr_t msg_accrights; - - int msg_accrightslen; - }; -#endif /* ACE_WIN32 */ - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - // Control message size to pass a file descriptor. -# define ACE_BSD_CONTROL_MSG_LEN sizeof (struct cmsghdr) + sizeof (ACE_HANDLE) -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - -// Increase the range of "address families". Please note that this -// must appear _after_ the include of sys/socket.h, for the AF_FILE -// definition on Linux/glibc2. -#if !defined (AF_ANY) -# define AF_ANY (-1) -#endif /* AF_ANY */ - -#if !defined (AF_UNSPEC) -# define AF_UNSPEC 0 -#endif /* AF_UNSPEC */ - -#if !defined (AF_LOCAL) -# define AF_LOCAL 1 -#endif /* AF_LOCAL */ - -#if !defined (AF_UNIX) -# define AF_UNIX AF_LOCAL -#endif /* AF_UNIX */ - -#if !defined (AF_INET) -# define AF_INET 2 -#endif /* AF_INET */ - -#if !defined (PF_INET) -# define PF_INET AF_INET -#endif /* PF_INET */ - -#if !defined (PF_LOCAL) -# define PF_LOCAL AF_LOCAL -#endif /* PF_LOCAL */ - -#if !defined (PF_UNIX) -# define PF_UNIX PF_LOCAL -#endif /* PF_UNIX */ - -#if !defined (AF_MAX) -# define AF_MAX 29 -#endif /* AF_MAX */ - -#if !defined (PF_UNSPEC) -# define PF_UNSPEC 0 -#endif /* PF_UNSPEC */ - -#define AF_SPIPE (AF_MAX + 1) -#if !defined (AF_FILE) -# define AF_FILE (AF_MAX + 2) -#endif /* ! AF_FILE */ -#define AF_DEV (AF_MAX + 3) -#define AF_UPIPE (AF_SPIPE) - -#if !defined (MSG_OOB) -# define MSG_OOB 0x1 -#endif /* MSG_OOB */ - -#if !defined (MSG_PEEK) -# define MSG_PEEK 0x2 -#endif /* MSG_PEEK */ - -#if !defined (SOCK_STREAM) -# define SOCK_STREAM 1 -#endif /* SOCK_STREAM */ - -#if !defined (SOCK_DGRAM) -# define SOCK_DGRAM 2 -#endif /* SOCK_DGRAM */ - -#if !defined (SOCK_SEQPACKET) -# define SOCK_SEQPACKET 5 -#endif /* SOCK_SEQPACKET */ - -#if !defined (SOL_SOCKET) -# define SOL_SOCKET 0xffff -#endif /* SOL_SOCKET */ - -#if !defined (SO_REUSEADDR) -# define SO_REUSEADDR 0x0004 -#endif /* SO_REUSEADDR */ - -#if !defined (SO_LINGER) -# define SO_LINGER 0x0080 -#endif /* SO_LINGER */ - -#if !defined (SO_SNDBUF) -# define SO_SNDBUF 0x1001 -#endif /* SO_SNDBUF */ - -#if !defined (SO_RCVBUF) -# define SO_RCVBUF 0x1002 -#endif /* SO_RCVBUF */ - -#if !defined (SO_BROADCAST) -# define SO_BROADCAST 0x0020 -#endif /* SO_BROADCAST */ - -#if !defined (SO_ERROR) -# define SO_ERROR 0x1007 -#endif /* SO_ERROR */ - -#if !defined (SCM_RIGHTS) -# define SCM_RIGHTS 0x01 -#endif /* SCM_RIGHTS */ - -#if defined (ACE_HAS_IPV6) -# if defined (ACE_USES_IPV4_IPV6_MIGRATION) -# define ACE_ADDRESS_FAMILY_INET AF_UNSPEC -# define ACE_PROTOCOL_FAMILY_INET PF_UNSPEC -# else -# define ACE_ADDRESS_FAMILY_INET AF_INET6 -# define ACE_PROTOCOL_FAMILY_INET PF_INET6 -# endif /* ACE_USES_IPV4_IPV6_MIGRATION */ -#else /* !ACE_HAS_IPV6 */ -# define ACE_ADDRESS_FAMILY_INET AF_INET -# define ACE_PROTOCOL_FAMILY_INET PF_INET -#endif /* ACE_HAS_IPV6 */ - -#if !defined (ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE) -#define ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE SSIZE_MAX -#endif /* ACE_HAS_SOCK_BUF_SIZE_MAX_VALUE */ - -#if defined (ACE_HAS_SOCKLEN_T) -# if defined (__hpux) - /* - ** HP-UX supplies the socklen_t type unless some feature set less than - ** _XOPEN_SOURCE_EXTENDED is specifically requested. However, it only - ** actually uses the socklen_t type in supplied socket functions if - ** _XOPEN_SOURCE_EXTENDED is specifically requested. So, for example, - ** the compile options ACE usually uses (includes -mt) cause _HPUX_SOURCE - ** to be set, which sets _INCLUDE_XOPEN_SOURCE_EXTENDED (causing socklen_t - ** to be defined) but _not_ _XOPEN_SOURCE_EXTENDED (causing socket functions - ** to use int, not socklen_t). React to this situation here... - */ -# if defined (_XOPEN_SOURCE_EXTENDED) -typedef socklen_t ACE_SOCKET_LEN; -# else -typedef int ACE_SOCKET_LEN; -# endif /* _XOPEN_SOURCE_EXTENDED */ -# else -typedef socklen_t ACE_SOCKET_LEN; -# endif /* __hpux */ -#elif defined (ACE_HAS_SIZET_SOCKET_LEN) -typedef size_t ACE_SOCKET_LEN; -#else -typedef int ACE_SOCKET_LEN; -#endif /* ACE_HAS_SIZET_SOCKET_LEN */ - -#if defined (ACE_HAS_NETLINK) -# include /**/ -# include /**/ -# define ACE_PROTOCOL_FAMILY_NETLINK AF_NETLINK -#endif - -#if defined (ACE_HAS_LKSCTP) -extern "C" -{ -#include /**/ -#include /**/ -} -#endif /* ACE_HAS_LKSCTP */ - -# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) - - ssize_t recv_timedwait (ACE_HANDLE handle, - char *buf, - int len, - int flags, - struct timespec *timeout); - - ssize_t recvmsg_timedwait (ACE_HANDLE handle, - struct msghdr *msg, - int flags, - struct timespec *timeout); - - ssize_t recvfrom_timedwait (ACE_HANDLE handle, - char *buf, - int len, - int flags, - struct sockaddr *addr, - int *addrlen, - struct timespec *timeout); - - ssize_t send_timedwait (ACE_HANDLE handle, - const char *buf, - int len, - int flags, - struct timespec *timeout); - - ssize_t sendmsg_timedwait (ACE_HANDLE handle, - const struct msghdr *msg, - int flags, - struct timespec *timeout); - - ssize_t sendto_timedwait (ACE_HANDLE handle, - const char *buf, - int len, - int flags, - const struct sockaddr *addr, - int addrlen, - struct timespec *timeout); - -# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SOCKET_H */ - diff --git a/dep/include/ace/os_include/sys/os_stat.h b/dep/include/ace/os_include/sys/os_stat.h deleted file mode 100644 index edd43d3932a..00000000000 --- a/dep/include/ace/os_include/sys/os_stat.h +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_stat.h - * - * data returned by the stat() function - * - * $Id: os_stat.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_STAT_H -#define ACE_OS_INCLUDE_SYS_OS_STAT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) -# include /**/ -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ - -#if !defined (ACE_LACKS_SYS_STAT_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_STAT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_MODE_MASKS) -// MODE MASKS - -// the following macros are for POSIX conformance. - -# if !defined (ACE_HAS_USER_MODE_MASKS) -# define S_IRWXU 00700 /* read, write, execute: owner. */ -# define S_IRUSR 00400 /* read permission: owner. */ -# define S_IWUSR 00200 /* write permission: owner. */ -# define S_IXUSR 00100 /* execute permission: owner. */ -# endif /* ACE_HAS_USER_MODE_MASKS */ -# define S_IRWXG 00070 /* read, write, execute: group. */ -# define S_IRGRP 00040 /* read permission: group. */ -# define S_IWGRP 00020 /* write permission: group. */ -# define S_IXGRP 00010 /* execute permission: group. */ -# define S_IRWXO 00007 /* read, write, execute: other. */ -# define S_IROTH 00004 /* read permission: other. */ -# define S_IWOTH 00002 /* write permission: other. */ -# define S_IXOTH 00001 /* execute permission: other. */ - -// WinCE's S_IFLNK is defined with the other bits, below. -#if !defined (S_IFLNK) && !defined (ACE_HAS_WINCE) -#define S_IFLNK 0200000 -#endif /* S_IFLNK && !ACE_HAS_WINCE */ - -#endif /* ACE_LACKS_MODE_MASKS */ - -// Some systems (VxWorks) don't define S_ISLNK -#if !defined (S_ISLNK) -# if defined (S_IFLNK) -# define S_ISLNK(mode) (((mode)&S_IFLNK) == S_IFLNK) -# else -# define S_ISLNK(mode) 0 -# endif /* S_IFLNK */ -#endif /* S_ISLNK */ - -#if defined (ACE_HAS_WINCE) -# include "ace/Time_Value.h" - -// Translate the WinCE bits into names expected by our callers. -// The dwFileAttributes parameter doesn't have protection info, so -// S_IFMT is the whole thing. Since there are no symbolic links, S_IFLNK is 0. -# define S_IFMT 0xFFFF -# define S_IFDIR FILE_ATTRIBUTE_DIRECTORY -# define S_IFREG FILE_ATTRIBUTE_NORMAL -# define S_IFLNK 0 - - struct stat - { - /// always 0 on Windows platforms - dev_t st_dev; - - /// always 0 on Windows platforms - dev_t st_rdev; - - /// file attribute - unsigned short st_mode; - - /// number of hard links - short st_nlink; - - /// time of last access - ACE_Time_Value st_atime; - - /// time of last data modification - ACE_Time_Value st_mtime; - - /// time of creation - ACE_Time_Value st_ctime; - - /// file size, in bytes - ACE_OFF_T st_size; - - // Following members do not have direct conversion in Window platforms. - //u_long st_blksize; // optimal blocksize for I/O - //u_long st_flags; // user defined flags for file - }; -#endif /* ACE_HAS_WINCE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_STAT_H */ - diff --git a/dep/include/ace/os_include/sys/os_statvfs.h b/dep/include/ace/os_include/sys/os_statvfs.h deleted file mode 100644 index 6661aa437d9..00000000000 --- a/dep/include/ace/os_include/sys/os_statvfs.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_statvfs.h - * - * VFS File System information structure - * - * $Id: os_statvfs.h 81692 2008-05-14 12:25:02Z johnnyw $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_STATVFS_H -#define ACE_OS_INCLUDE_SYS_OS_STATVFS_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SYS_STATVFS_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_STATVFS_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_STATVFS_H */ - diff --git a/dep/include/ace/os_include/sys/os_sysctl.h b/dep/include/ace/os_include/sys/os_sysctl.h deleted file mode 100644 index 630c9de345b..00000000000 --- a/dep/include/ace/os_include/sys/os_sysctl.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_sysctl.h - * - * declarations for sysctl - * - * $Id: os_sysctl.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SYSCTL_H -#define ACE_OS_INCLUDE_SYS_OS_SYSCTL_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SYS_SYSCTL_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_SYSCTL_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SYSCTL_H */ - diff --git a/dep/include/ace/os_include/sys/os_sysinfo.h b/dep/include/ace/os_include/sys/os_sysinfo.h deleted file mode 100644 index 19d57e984f9..00000000000 --- a/dep/include/ace/os_include/sys/os_sysinfo.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_sysinfo.h - * - * $Id: os_sysinfo.h 81692 2008-05-14 12:25:02Z johnnyw $ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_SYSINFO_H -#define ACE_OS_INCLUDE_SYS_OS_SYSINFO_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_SYS_SYSINFO_H) -# include /**/ -#endif /* ACE_HAS_SYS_SYSINFO_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_SYSINFO_H */ - diff --git a/dep/include/ace/os_include/sys/os_time.h b/dep/include/ace/os_include/sys/os_time.h deleted file mode 100644 index 130a8265ac2..00000000000 --- a/dep/include/ace/os_include/sys/os_time.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_time.h - * - * time types - * - * $Id: os_time.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_TIME_H -#define ACE_OS_INCLUDE_SYS_OS_TIME_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SYS_TIME_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_TIME_H */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS == 0x620) -# include /**/ // VxWorks 6.2 defined timeval in time.h -#endif - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_HAS_SVR4_GETTIMEOFDAY) -# if !defined (SCO) - int gettimeofday (struct timeval *tp, void * = 0); -# else - int gettimeofday (struct timeval *tp); -# endif /* !SCO */ -#elif defined (ACE_HAS_OSF1_GETTIMEOFDAY) - int gettimeofday (struct timeval *tp, struct timezone * = 0); -#elif defined (ACE_HAS_VOIDPTR_GETTIMEOFDAY) -# define ACE_HAS_SVR4_GETTIMEOFDAY -#endif /* ACE_HAS_SVR4_GETTIMEOFDAY */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_TIME_H */ - diff --git a/dep/include/ace/os_include/sys/os_timeb.h b/dep/include/ace/os_include/sys/os_timeb.h deleted file mode 100644 index c8c0d74043c..00000000000 --- a/dep/include/ace/os_include/sys/os_timeb.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_timeb.h - * - * additional definitions for date and time - * - * $Id: os_timeb.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_TIMEB_H -#define ACE_OS_INCLUDE_SYS_OS_TIMEB_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SYS_TIMEB_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_TIMEB_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x560) -# define _ftime ftime -# define _timeb timeb -#endif /* __BORLANDC__ */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_TIMEB_H */ - diff --git a/dep/include/ace/os_include/sys/os_times.h b/dep/include/ace/os_include/sys/os_times.h deleted file mode 100644 index d6769f7eb8d..00000000000 --- a/dep/include/ace/os_include/sys/os_times.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_times.h - * - * file access and modification times structure - * - * $Id: os_times.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_TIMES_H -#define ACE_OS_INCLUDE_SYS_OS_TIMES_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" - -#if !defined (ACE_LACKS_SYS_TIMES_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_TIMES_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_TIMES_H */ - diff --git a/dep/include/ace/os_include/sys/os_types.h b/dep/include/ace/os_include/sys/os_types.h deleted file mode 100644 index 0377e024b69..00000000000 --- a/dep/include/ace/os_include/sys/os_types.h +++ /dev/null @@ -1,159 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_types.h - * - * data types - * - * $Id: os_types.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_TYPES_H -#define ACE_OS_INCLUDE_SYS_OS_TYPES_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_SYS_TYPES_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_TYPES_H */ - -#if defined (ACE_HAS_WINCE) -# include /**/ -#endif /* ACE_HAS_WINCE */ - -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) -using std::time_t; -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -typedef double ACE_timer_t; - -// todo: don't forget to clean this up! ;-) -#if !defined (ACE_HAS_CLOCK_GETTIME) && !(defined (_CLOCKID_T_) || defined (_CLOCKID_T)) - typedef int clockid_t; -# if !defined (CLOCK_REALTIME) -# define CLOCK_REALTIME 0 -# endif /* CLOCK_REALTIME */ -#endif /* ! ACE_HAS_CLOCK_GETTIME && ! _CLOCKID_T_ */ - -#if defined (ACE_HAS_WINCE) - -// CE's add-on for c-style fstat/stat functionalities. This struct is -// by no mean complete compared to what you usually find in UNIX -// platforms. Only members that have direct conversion using Win32's -// BY_HANDLE_FILE_INFORMATION are defined so that users can discover -// non-supported members at compile time. Time values are of type -// ACE_Time_Value for easy comparison. - -// Since CE does not have _stat by default as NT/2000 does, the 'stat' -// struct defined here will be used. Also note that CE file system -// struct is only for the CE 3.0 or later. -// Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0. - - typedef unsigned int dev_t; -#endif /* ACE_HAS_WINCE */ - -#if defined(ACE_WIN32) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64) - typedef __int64 ACE_OFF_T; -#else - typedef off_t ACE_OFF_T; -#endif - -#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG == 8 - typedef off_t ACE_LOFF_T; -#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || \ - (defined (ACE_OPENVMS) && defined (_LARGEFILE)) || defined(ACE_MVS) - typedef off_t ACE_LOFF_T; -#elif defined (__sgi) || defined (AIX) || defined (HPUX) || defined (__QNX__) - typedef off64_t ACE_LOFF_T; -#elif defined (__sun) - typedef offset_t ACE_LOFF_T; -#elif defined (WIN32) - typedef __int64 ACE_LOFF_T; -#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x660)) || \ - defined (ACE_LYNXOS_MAJOR) || \ - (defined (ACE_OPENVMS) && !defined (_LARGEFILE)) || \ - defined (__TANDEM) - typedef long long ACE_LOFF_T; -#else - typedef loff_t ACE_LOFF_T; -#endif - -#if defined (ACE_WIN32) -# if !defined (__BORLANDC__) - typedef DWORD nlink_t; -# if !defined(__MINGW32__) - typedef int mode_t; -# endif /* !__MINGW32__ */ - typedef long uid_t; - typedef long gid_t; -# endif /* __BORLANDC__ */ - typedef char *caddr_t; -#endif /* ACE_WIN32 */ - -#if defined (ACE_LACKS_KEY_T) -# if defined (ACE_WIN32) - // Win32 doesn't use numeric values to name its semaphores, it uses - // strings! - typedef char *key_t; -# else - typedef int key_t; -# endif /* ACE_WIN32 */ -#endif /* ACE_LACKS_KEY_T */ - -#if !defined (ACE_HAS_SSIZE_T) -# if defined (ACE_WIN64) - typedef SSIZE_T ssize_t; -# else - typedef int ssize_t; -# endif /* ACE_WIN64 */ -#endif /* ACE_HAS_SSIZE_T */ - -#if defined (ACE_WIN32) - typedef DWORD ACE_exitcode; -#else - typedef int ACE_exitcode; -#endif /* ACE_WIN32 */ - -#if defined (ACE_LACKS_SUSECONDS_T) - typedef long suseconds_t; -#endif - -#if defined (ACE_LACKS_USECONDS_T) - typedef unsigned long useconds_t; -#endif - -#if defined (ACE_WIN32) && !defined(__MINGW32__) - typedef int pid_t; -#endif /* ACE_WIN32 */ - -# if !defined (ACE_INVALID_PID) -# define ACE_INVALID_PID ((pid_t) -1) -# endif /* ACE_INVALID_PID */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_TYPES_H */ - diff --git a/dep/include/ace/os_include/sys/os_uio.h b/dep/include/ace/os_include/sys/os_uio.h deleted file mode 100644 index 72a2819e524..00000000000 --- a/dep/include/ace/os_include/sys/os_uio.h +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_uio.h - * - * definitions for vector I/O operations - * - * $Id: os_uio.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_UIO_H -#define ACE_OS_INCLUDE_SYS_OS_UIO_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_types.h" -#include "ace/os_include/os_limits.h" - -#if !defined (ACE_LACKS_SYS_UIO_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_UIO_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_LACKS_IOVEC) - /// The ordering of the fields in this struct is important. It has to - /// match those in WSABUF. - struct iovec - { - /// byte count to read/write - u_long iov_len; - /// data to be read/written - char *iov_base; - - // WSABUF is a Winsock2-only type. -# if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - operator WSABUF &(void) { return *((WSABUF *) this); } -# endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */ - }; -#endif /* ACE_LACKS_IOVEC */ - -# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) - - ssize_t readv_timedwait (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - struct timespec* timeout); - - ssize_t writev_timedwait (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - struct timespec *timeout); - -# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_UIO_H */ - diff --git a/dep/include/ace/os_include/sys/os_un.h b/dep/include/ace/os_include/sys/os_un.h deleted file mode 100644 index 88d86a232a6..00000000000 --- a/dep/include/ace/os_include/sys/os_un.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_un.h - * - * definitions for UNIX domain sockets - * - * $Id: os_un.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_UN_H -#define ACE_OS_INCLUDE_SYS_OS_UN_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/sys/os_socket.h" - -#if !defined (ACE_LACKS_SYS_UN_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_UN_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x600) -struct sockaddr_un { - short sun_family; // AF_UNIX. - char sun_path[108]; // path name. -}; -#endif /* ACE_VXWORKS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_UN_H */ - diff --git a/dep/include/ace/os_include/sys/os_utsname.h b/dep/include/ace/os_include/sys/os_utsname.h deleted file mode 100644 index 23748bb7160..00000000000 --- a/dep/include/ace/os_include/sys/os_utsname.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_utsname.h - * - * system name structure - * - * $Id: os_utsname.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_UTSNAME_H -#define ACE_OS_INCLUDE_SYS_OS_UTSNAME_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_SYS_UTSNAME_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_UTSNAME_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_UTSNAME_H */ - diff --git a/dep/include/ace/os_include/sys/os_wait.h b/dep/include/ace/os_include/sys/os_wait.h deleted file mode 100644 index fd42e2cdf90..00000000000 --- a/dep/include/ace/os_include/sys/os_wait.h +++ /dev/null @@ -1,98 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_wait.h - * - * declarations for waiting - * - * $Id: os_wait.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_SYS_OS_WAIT_H -#define ACE_OS_INCLUDE_SYS_OS_WAIT_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/os_include/os_signal.h" -#include "ace/os_include/sys/os_resource.h" - -#if !defined (ACE_LACKS_SYS_WAIT_H) -# include /**/ -#endif /* !ACE_LACKS_SYS_WAIT_H */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - // Wrapping around wait status macros for platforms that - // lack them. - -# if !defined (WCOREDUMP) -# define WCOREDUMP(stat) 0 -# endif /* WCOREDUMP */ - -# if !defined (WNOHANG) -# define WNOHANG 0100 -# endif /* !WNOHANG */ - - // If the value of WIFEXITED(stat) is non-zero, this macro evaluates - // to the exit code that the child process exit(3C), or the value - // that the child process returned from main. Peaceful exit code is - // 0. -# if !defined (WEXITSTATUS) -# define WEXITSTATUS(stat) stat -# endif /* WEXITSTATUS */ - -# if !defined (WIFCONTINUED) -# define WIFCONTINUED(stat) 0 -# endif /* WIFCONTINUED */ - - // Evaluates to a non-zero value if status was returned for a child - // process that terminated normally. 0 means status wasn't - // returned. -# if !defined (WIFEXITED) -# define WIFEXITED(stat) 1 -# endif /* WIFEXITED */ - - // Evaluates to a non-zero value if status was returned for a child - // process that terminated due to the receipt of a signal. 0 means - // status wasnt returned. -# if !defined (WIFSIGNALED) -# define WIFSIGNALED(stat) 0 -# endif /* WIFSIGNALED */ - -# if !defined (WIFSTOPPED) -# define WIFSTOPPED(stat) 0 -# endif /* WIFSTOPPED */ - -# if !defined (WSTOPSIG) -# define WSTOPSIG(stat) 0 -# endif /* WSTOPSIG */ - - // If the value of WIFSIGNALED(stat) is non-zero, this macro - // evaluates to the number of the signal that caused the - // termination of the child process. -# if !defined (WTERMSIG) -# define WTERMSIG(stat) 0 -# endif /* WTERMSIG */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_OS_WAIT_H */ - diff --git a/dep/include/ace/post.h b/dep/include/ace/post.h deleted file mode 100644 index 7c77af216ad..00000000000 --- a/dep/include/ace/post.h +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file post.h - * - * $Id: post.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Christopher Kohlhoff - * - * This file restores the original alignment rules. - */ -//============================================================================= - -// No header guard -#if defined (_MSC_VER) -# pragma pack (pop) -#elif defined (__BORLANDC__) -# pragma option pop -# pragma nopushoptwarn -# pragma nopackwarning -#endif - diff --git a/dep/include/ace/pre.h b/dep/include/ace/pre.h deleted file mode 100644 index 6984b22804e..00000000000 --- a/dep/include/ace/pre.h +++ /dev/null @@ -1,26 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file pre.h - * - * $Id: pre.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Christopher Kohlhoff - * - * This file saves the original alignment rules and changes the alignment - * boundary to ACE's default. - */ -//============================================================================= - -// No header guard -#if defined (_MSC_VER) -# pragma warning (disable:4103) -# pragma warning (disable:4005) -# pragma pack (push, 8) -#elif defined (__BORLANDC__) -# pragma option push -a8 -b -Ve- -Vx- -w-rvl -w-rch -w-ccc -w-obs -w-aus -w-pia -w-inl -w-sig -# pragma nopushoptwarn -# pragma nopackwarning -#endif - diff --git a/dep/include/ace/streams.h b/dep/include/ace/streams.h deleted file mode 100644 index 3401435b4b1..00000000000 --- a/dep/include/ace/streams.h +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file streams.h - * - * $Id: streams.h 82445 2008-07-28 13:40:01Z johnnyw $ - * - * @author Irfan Pyarali - * - * This file contains the portability ugliness for the Standard C++ - * Library. As implementations of the "standard" emerge, this file - * will need to be updated. - * - * This files deals with the streams includes. - * - * - */ -//============================================================================= - -#ifndef ACE_STREAMS_H -#define ACE_STREAMS_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Do this so the #pragma warning in the MSVC headers do not -// affect our #pragma warning settings -#if defined (_MSC_VER) -#pragma warning(push) -#endif /* _MSC_VER*/ - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) - -# if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ - (ACE_HAS_STANDARD_CPP_LIBRARY != 0) - -# if defined (_MSC_VER) -# pragma warning(disable: 4018 4114 4146 4245) -# pragma warning(disable: 4663 4664 4665 4511 4512) -# endif /* _MSC_VER */ - -# if defined (ACE_USES_OLD_IOSTREAMS) -# include /**/ -# include /**/ - // This has been commented as it is not needed and causes problems with Qt. - // (brunsch) But has been uncommented since it should be included. Qt - // probably should have some sort of macro that will prevent including this - // when it is used. -# include /**/ -# else -# include /**/ -# include /**/ -# include /**/ -# include /**/ -# include /**/ -# include /**/ -# include /**/ -# endif /* ACE_USES_OLD_IOSTREAMS */ - -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ - (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) - -# if !defined (ACE_USES_OLD_IOSTREAMS) - // Make these available in the global name space - using std::ios; - using std::ios_base; - using std::streambuf; - using std::istream; - using std::ostream; - using std::iostream; - using std::filebuf; - using std::ifstream; - using std::ofstream; - using std::fstream; - - using std::cin; - using std::cout; - using std::cerr; - using std::clog; - - using std::endl; - using std::ends; - using std::flush; - - using std::ws; - - using std::resetiosflags; - using std::setfill; - using std::setiosflags; - using std::setprecision; - using std::setw; - - using std::dec; - using std::hex; - using std::oct; -# endif /* ! ACE_USES_OLD_IOSTREAMS */ - -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - -# if defined (_MSC_VER) -# pragma warning(4: 4018 4114 4146 4245) -# pragma warning(4: 4663 4664 4665 4512 4511) -# endif /* _MSC_VER */ - -# else /* ! ACE_HAS_STANDARD_CPP_LIBRARY */ - -# include /**/ -# include /**/ -# include /**/ - -# if defined (ACE_WIN32) && !defined(__MINGW32__) -# if defined(_MSC_VER) // VSB -# include /**/ -# include /**/ -# include /**/ -# include /**/ -# endif /* _MSC_VER */ -# endif /* ACE_WIN32 && !__MINGW32__ */ - -# endif /* ! ACE_HAS_STANDARD_CPP_LIBRARY */ - -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -// Do this so the #pragma warning in the MSVC headers do not -// affect our #pragma warning settings -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* ACE_STREAMS_H */ - diff --git a/dep/include/ace/svc_export.h b/dep/include/ace/svc_export.h deleted file mode 100644 index 33fa67cd80b..00000000000 --- a/dep/include/ace/svc_export.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- -// $Id: svc_export.h 80826 2008-03-04 14:51:23Z wotte $ -// Definition for Win32 Export directives. - -// This file was generated by generate_export_file.pl -// but needed to be altered to support ACE_BUILD_SVC_DLL -// instead of ACE_SVC_BUILD_DLL which was already being -// used. - -// ------------------------------ -#if !defined (ACE_SVC_EXPORT_H) -#define ACE_SVC_EXPORT_H - -#include /**/ "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_SVC_HAS_DLL) -# define ACE_SVC_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_SVC_HAS_DLL */ - -#if !defined (ACE_SVC_HAS_DLL) -#define ACE_SVC_HAS_DLL 1 -#endif /* ! ACE_SVC_HAS_DLL */ - -#if defined (ACE_SVC_HAS_DLL) -# if (ACE_SVC_HAS_DLL == 1) -# if defined (ACE_BUILD_SVC_DLL) || defined (ACE_SVC_BUILD_DLL) -# define ACE_Svc_Export ACE_Proper_Export_Flag -# define ACE_SVC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# else -# define ACE_Svc_Export ACE_Proper_Import_Flag -# define ACE_SVC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# endif /* ACE_BUILD_SVC_DLL */ -# else -# define ACE_Svc_Export -# define ACE_SVC_SINGLETON_DECLARATION(T) -# endif /* ! ACE_SVC_HAS_DLL == 1 */ -#else -# define ACE_Svc_Export -# define ACE_SVC_SINGLETON_DECLARATION(T) -#endif /* ACE_SVC_HAS_DLL */ - -#endif /* ACE_SVC_EXPORT_H */ - -// End of auto generated file. - diff --git a/dep/include/bzip2/bzlib.h b/dep/include/bzip2/bzlib.h deleted file mode 100644 index c5b75d6d8ff..00000000000 --- a/dep/include/bzip2/bzlib.h +++ /dev/null @@ -1,282 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Public header file for the library. ---*/ -/*--- bzlib.h ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#ifndef _BZLIB_H -#define _BZLIB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define BZ_RUN 0 -#define BZ_FLUSH 1 -#define BZ_FINISH 2 - -#define BZ_OK 0 -#define BZ_RUN_OK 1 -#define BZ_FLUSH_OK 2 -#define BZ_FINISH_OK 3 -#define BZ_STREAM_END 4 -#define BZ_SEQUENCE_ERROR (-1) -#define BZ_PARAM_ERROR (-2) -#define BZ_MEM_ERROR (-3) -#define BZ_DATA_ERROR (-4) -#define BZ_DATA_ERROR_MAGIC (-5) -#define BZ_IO_ERROR (-6) -#define BZ_UNEXPECTED_EOF (-7) -#define BZ_OUTBUFF_FULL (-8) -#define BZ_CONFIG_ERROR (-9) - -typedef - struct { - char *next_in; - unsigned int avail_in; - unsigned int total_in_lo32; - unsigned int total_in_hi32; - - char *next_out; - unsigned int avail_out; - unsigned int total_out_lo32; - unsigned int total_out_hi32; - - void *state; - - void *(*bzalloc)(void *,int,int); - void (*bzfree)(void *,void *); - void *opaque; - } - bz_stream; - - -#ifndef BZ_IMPORT -#define BZ_EXPORT -#endif - -#ifndef BZ_NO_STDIO -/* Need a definitition for FILE */ -#include -#endif - -#ifdef _WIN32 -# include -# ifdef small - /* windows.h define small to char */ -# undef small -# endif -# ifdef BZ_EXPORT -# define BZ_API(func) WINAPI func -# define BZ_EXTERN extern -# else - /* import windows dll dynamically */ -# define BZ_API(func) (WINAPI * func) -# define BZ_EXTERN -# endif -#else -# define BZ_API(func) func -# define BZ_EXTERN extern -#endif - - -/*-- Core (low-level) library functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( - bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompress) ( - bz_stream* strm, - int action - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( - bz_stream *strm, - int verbosity, - int small - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( - bz_stream *strm - ); - - - -/*-- High(er) level library functions --*/ - -#ifndef BZ_NO_STDIO -#define BZ_MAX_UNUSED 5000 - -typedef void BZFILE; - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( - int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( - int* bzerror, - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( - int* bzerror, - BZFILE* b, - void** unused, - int* nUnused - ); - -BZ_EXTERN int BZ_API(BZ2_bzRead) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( - int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN void BZ_API(BZ2_bzWrite) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in_lo32, - unsigned int* nbytes_in_hi32, - unsigned int* nbytes_out_lo32, - unsigned int* nbytes_out_hi32 - ); -#endif - - -/*-- Utility functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity - ); - - -/*-- - Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - to support better zlib compatibility. - This code is not _officially_ part of libbzip2 (yet); - I haven't tested it, documented it, or considered the - threading-safeness of it. - If this code breaks, please contact both Yoshioka and me. ---*/ - -BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( - void - ); - -#ifndef BZ_NO_STDIO -BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( - const char *path, - const char *mode - ); - -BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( - int fd, - const char *mode - ); - -BZ_EXTERN int BZ_API(BZ2_bzread) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzwrite) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzflush) ( - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzclose) ( - BZFILE* b - ); - -BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( - BZFILE *b, - int *errnum - ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/*-------------------------------------------------------------*/ -/*--- end bzlib.h ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/include/g3dlite/G3D/AABox.h b/dep/include/g3dlite/G3D/AABox.h deleted file mode 100644 index 2e8da1f6098..00000000000 --- a/dep/include/g3dlite/G3D/AABox.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - @file AABox.h - - Axis-aligned box class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2004-01-10 - @edited 2009-02-10 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_AABOX_H -#define G3D_AABOX_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/debug.h" -#include "G3D/Array.h" -#include "G3D/Plane.h" - -namespace G3D { - -/** - An axis-aligned box. - */ -class AABox { -private: - friend class Intersect; - - /** Optional argument placeholder */ - static int dummy; - - Vector3 lo; - Vector3 hi; - -public: - - /** Does not initialize the fields */ - inline AABox() {} - - /** - Constructs a zero-area AABox at v. - */ - inline explicit AABox(const Vector3& v) { - lo = hi = v; - } - - /** Assumes that low is less than or equal to high along each dimension. - To have this automatically enforced, use - AABox(low.min(high), low.max(high)); - */ - inline AABox(const Vector3& low, const Vector3& high) { - set(low, high); - } - - /** Assumes that low is less than or equal to high along each dimension. - */ - inline void set(const Vector3& low, const Vector3& high) { - debugAssert( - (low.x <= high.x) && - (low.y <= high.y) && - (low.z <= high.z)); - lo = low; - hi = high; - } - - /** - Grows to include the bounds of a - */ - inline void merge(const AABox& a) { - lo = lo.min(a.lo); - hi = hi.max(a.hi); - } - - inline void merge(const Vector3& a) { - lo = lo.min(a); - hi = hi.max(a); - } - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - inline bool isFinite() const { - return lo.isFinite() && hi.isFinite(); - } - - inline const Vector3& low() const { - return lo; - } - - inline const Vector3& high() const { - return hi; - } - - /** - The largest possible finite box. - */ - static const AABox& maxFinite(); - - /** A large finite box. This is smaller than FLT_MAX - because it leaves room to add boxes together. */ - static const AABox& large(); - - static const AABox& inf(); - - static const AABox& zero(); - - /** - Returns the centroid of the box. - */ - inline Vector3 center() const { - return (lo + hi) * 0.5; - } - - Vector3 corner(int index) const; - - /** - Distance from corner(0) to the next corner along axis a. - */ - inline float extent(int a) const { - debugAssert(a < 3); - return hi[a] - lo[a]; - } - - - inline Vector3 extent() const { - return hi - lo; - } - - - /** - Splits the box into two AABoxes along the specified axis. low contains - the part that was closer to negative infinity along axis, high contains - the other part. Either may have zero volume. - */ - void split(const Vector3::Axis& axis, float location, AABox& low, AABox& high) const; - - /** - Conservative culling test for up to 32 planes. - Returns true if there exists a plane[p] for - which the entire object is in the negative half space - (opposite the plane normal). - - testMask and childMask - are used for optimizing bounding volume hierarchies. - The version of this method that produces childMask - is slower than the version without; it should only - be used for parent nodes. - - @param cullingPlaneIndex The index of the first plane for which - the entire object is in the negative half-space. The function - exits early when one plane is found. -1 when the function - returns false (i.e. when no plane culls the whole object). - - @param testMask If bit p is 0, the - bounding volume automatically passes the culling test for - plane[p] (i.e. it is known that the volume - is entirely within the positive half space). The function - must return false if testMask is 0 and test all planes - when testMask is -1 (0xFFFFFFFF). - - @param childMask Test mask for the children of this volume. - - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - /** less than or equal to containment */ - inline bool contains(const AABox& other) const { - return - (other.hi.x <= hi.x) && - (other.hi.y <= hi.y) && - (other.hi.z <= hi.z) && - (other.lo.x >= lo.x) && - (other.lo.y >= lo.y) && - (other.lo.z >= lo.z); - } - - inline bool contains( - const Vector3& point) const { - return - (point.x >= lo.x) && - (point.y >= lo.y) && - (point.z >= lo.z) && - (point.x <= hi.x) && - (point.y <= hi.y) && - (point.z <= hi.z); - } - - inline float area() const { - Vector3 diag = hi - lo; - return 2.0f * (diag.x * diag.y + diag.y * diag.z + diag.x * diag.z); - } - - inline float volume() const { - Vector3 diag = hi - lo; - return diag.x * diag.y * diag.z; - } - - Vector3 randomInteriorPoint() const; - - Vector3 randomSurfacePoint() const; - - /** Returns true if there is any overlap */ - bool intersects(const AABox& other) const; - - /** Returns true if there is any overlap. - @cite Jim Arvo's algorithm from Graphics Gems II*/ - bool intersects(const class Sphere& other) const; - - /** Return the intersection of the two boxes */ - AABox intersect(const AABox& other) const { - Vector3 H = hi.min(other.hi); - Vector3 L = lo.max(other.lo).min(H); - return AABox(L, H); - } - - inline size_t hashCode() const { - return lo.hashCode() + hi.hashCode(); - } - - inline bool operator==(const AABox& b) const { - return (lo == b.lo) && (hi == b.hi); - } - - inline bool operator!=(const AABox& b) const { - return !((lo == b.lo) && (hi == b.hi)); - } - - inline AABox operator+(const Vector3& v) const { - AABox out; - out.lo = lo + v; - out.hi = hi + v; - return out; - } - - inline AABox operator-(const Vector3& v) const { - AABox out; - out.lo = lo - v; - out.hi = hi - v; - return out; - } - - void getBounds(AABox& out) const { - out = *this; - } -}; - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::AABox& key) { return key.hashCode(); } -}; - - - -#endif diff --git a/dep/include/g3dlite/G3D/Any.h b/dep/include/g3dlite/G3D/Any.h deleted file mode 100644 index 49701202ca9..00000000000 --- a/dep/include/g3dlite/G3D/Any.h +++ /dev/null @@ -1,570 +0,0 @@ -/** - @file Any.h - - @author Morgan McGuire, Shawn Yarbrough, and Corey Taylor - @maintainer Morgan McGuire - - @created 2006-06-11 - @edited 2009-12-16 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Any_h -#define G3D_Any_h - -#include "G3D/platform.h" -#include "G3D/Table.h" -#include "G3D/Array.h" -#include "G3D/AtomicInt32.h" -#include - -// needed for Token -#include "G3D/TextInput.h" - -#ifdef verify -#undef verify -#endif - -namespace G3D { - -class TextOutput; - -/** -\brief Easy loading and saving of human-readable configuration files. - -Encodes typed, structured data and can serialize it to a human -readable format that is very similar to the Python language's data -syntax. Well-suited for quickly creating human-readable file formats, -especially since deserialization and serialization preserve comments and -an Any can tell you what file and line it came from. - -The class is designed so that copying Anys generally is fast, even if -it is a large array or table. This is because data is shared between -copies until it is mutated, at which point an actual copy occurs. - -\section Example -Sample File: -
-{
-   shape = "round",
-
-   # in meters
-   radius = 3.7,
-
-   position = Vector3(1.0, -1.0, 0.0),
-   texture = { format = "RGB8", size = (320, 200)}
-}
-
- -Sample code using: -
-Any x;
-x.load("ball.txt");
-if (x["shape"].string() == "round") {
-    x["density"] = 3;
-}
-x.save("ball.txt");
-
- -The custom serialization format was chosen to be terse, easy for -humans to read, and easy for machines to parse. It was specifically -chosen over formats like XML, YAML, JSON, S-expressions, and Protocol -Buffers, although there is no reason you could not write readers and -writers for G3D::Any that support those. - -G3D::Any assumes that structures do not contain cycles; it is an -error to create a structure like: - -
-Any x(Any::ARRAY);
-x.array().append(x);    // don't do this!
-
- -although no exception will be thrown at runtime during that append. - - -\section Parsing - -The primary use of Any is to create your own text file formats. -The Vector3 constructor is a good example of how to use the Any::verify -methods to provide good error checking while parsing such formats: - -
-Vector3::Vector3(const Any& any) {
-    any.verifyName("Vector3");
-    any.verifyType(Any::TABLE, Any::ARRAY);
-    any.verifySize(3);
-
-    if (any.type() == Any::ARRAY) {
-        x = any[0];
-        y = any[1];
-        z = any[2];
-    } else {
-        // Table
-        x = any["x"];
-        y = any["y"];
-        z = any["z"];
-    }
-}
-
- -\section BNF -Serialized format BNF: - -
-identifier  ::= (letter | "_") (letter | digit | "_")*
-identifier-op ::= "::" | "->" | "."
-
-identifier-exp ::= [identifier-op] identifier (identifier-op identifier)*
-
-comment     ::= "#"  "\n"
-separator   ::= "," | ";"
-
-number      ::= 
-string      ::= 
-boolean     ::= "True" | "False"
-none        ::= "None"
-array       ::= "(" [value ("," value)*] ")"
-pair        ::= (identifier | string) "=" value
-table       ::= "{" [pair (separator pair)*] "}"
-named-array ::= identifier-exp tuple
-named-table ::= identifier-exp dict
-
-value       ::= [comment] (none | number | boolean | string | array | table | named-array | named-table)
-
- -Except for single-line comments, whitespace is not significant. -All parsing is case-insensitive. - -The deserializer allows the substitution of [] for () when writing -tuples and ";" for ",". - -The serializer indents four spaces for each level of nesting. -Tables are written with the keys in alphabetic order. -*/ -class Any { -public: - - enum Type {NONE, BOOLEAN, NUMBER, STRING, ARRAY, TABLE}; - - static std::string toString(Type t); - - /** Where an Any came from in a file. Useful for throwing parsing errors */ - class Source { - public: - std::string filename; - int line; - int character; - - Source() : line(0), character(0) {} - - void set(const TextInput& ti, const Token& t) { - filename = ti.filename(); - line = t.line(); - character = t.character(); - } - }; - - typedef Array AnyArray; - typedef Table AnyTable; - -private: - - /** Called from deserialize() */ - static void deserializeComment(TextInput& ti, Token& token, std::string& comment); - - /** NONE, BOOLEAN, and NUMBER are stored directly in the Any */ - union SimpleValue { - bool b; - double n; - - inline SimpleValue() : n(0.0) {} - inline SimpleValue(bool x) : b(x) {} - inline SimpleValue(double x) : n(x) {} - }; - - class Data { - public: - /** ARRAY, TABLE, or STRING value only. NULL otherwise. */ - union Value { - std::string* s; - Array* a; - AnyTable* t; - inline Value() : s(NULL) {} - }; - - // Needed so that the destructor knows what is in Value - // and can call its destructor. - Type type; - - /** Always points to memory that is allocated with the Data, so - the destructor does not delete this. */ - Value value; - - std::string comment; - - std::string name; - - /** For STRING, ARRAY and TABLE types, m_value is shared between - multiple instances. Mutation is allowed only if the reference - count is exactly 1, otherwise the mutating instance must copy - the value. This is not used for other types. - */ - AtomicInt32 referenceCount; - - Source source; - - private: - - /** Called by create() */ - inline Data(Type t) : type(t), referenceCount(1) {} - - /** Called by destroy */ - ~Data(); - - public: - - /** Clones the argument */ - static Data* create(const Data* d); - static Data* create(Type t); - - /** Free d, invoking its destructor and freeing the memory for - the value. */ - static void destroy(Data* d); - - }; - - /** If not empty, this Any was created from operator[] on a table - and perhaps was not intended to exist. The name is needed to - format the error message if it is read from before it is - written to. - - The source of a placeholder object is that of the parent - object until it is written. - */ - std::string m_placeholderName; - - Type m_type; - SimpleValue m_simpleValue; - mutable Data* m_data; - - /** Called before every read operation to ensure that this object - is not a placeholder. */ - void beforeRead() const; - - /** Called before every write operation to wipe the placeholder - status. */ - void beforeWrite(); - - /** Decrements the reference count (if there is one). If the - reference count is zero after decrement, calls delete on @a m_data - and sets it to NULL. - */ - void dropReference(); - - /** Allocate the Data object if it does not exist */ - void ensureData(); - - /** If m_data is not NULL, ensure that it has a unique reference - and contains a valid m_data. This has a race condition if two - threads are both trying to modify the same Any - simultaneously.*/ - void ensureMutable(); - - /** Read an unnamed a TABLE or ARRAY. Token should be the open - paren token; it is the next token after the close on - return. Called from deserialize().*/ - void deserializeBody(TextInput& ti, Token& token); - - void deserialize(TextInput& ti, Token& token); - - /** Read the name of a named Array or Table. */ - static void deserializeName(TextInput& ti, Token& token, std::string& name); - - /** Read until a comma is consumed or a close paren is hit, and - return that token. Considers the passed in token to be the first - value read. */ - static void readUntilCommaOrClose(TextInput& ti, Token& token); - - /** Construct an Any that is a proxy for a table fetch from \a data. - This proxy can be copied exactly once on return from operator[].*/ - Any(const std::string& key, Data* data); - - inline bool isPlaceholder() const { - return ! m_placeholderName.empty(); - } - -public: - - /** Base class for all Any exceptions.*/ - class Exception { - public: - virtual ~Exception() {} - }; - - /** Thrown by operator[] when a key is not present in a const table. */ - class KeyNotFound : public ParseError { - public: - std::string key; - }; - - /** Thrown by operator[] when an array index is not present. */ - class IndexOutOfBounds : public Exception { - public: - int index; - int size; - inline IndexOutOfBounds() : index(0), size(0) {} - inline IndexOutOfBounds(int i, int s) : index(i), size(s) {} - }; - - /** NONE constructor */ - Any(); - - /** Deserialize */ - explicit Any(TextInput& t); - - Any(const Any& x); - - /** NUMBER constructor */ - Any(double x); - -#ifdef G3D_32BIT - /** NUMBER constructor */ - Any(int64 x); -#endif // G3D_32BIT - -#if 0 - /** NUMBER constructor */ - Any(int32 x); -#endif // 0 - - /** NUMBER constructor */ - Any(long x); - - /** NUMBER constructor */ - Any(int x); - - /** NUMBER constructor */ - Any(short x); - - /** BOOLEAN constructor */ - Any(bool x); - - /** STRING constructor */ - Any(const std::string& x); - - /** STRING constructor */ - Any(const char* x); - - /** \a t must be ARRAY or TABLE */ - Any(Type t, const std::string& name = ""); - - ~Any(); - - /** Removes the comment and name */ - Any& operator=(const Any& x); - - /** Removes the comment and name */ - Any& operator=(double x); - - /** Removes the comment and name */ - Any& operator=(int x); - - /** Removes the comment and name */ - Any& operator=(bool x); - - /** Removes the comment and name */ - Any& operator=(const std::string& x); - - /** Removes the comment and name */ - Any& operator=(const char* x); - - /** \a t must be ARRAY, TABLE, or NONE. Removes the comment and name */ - Any& operator=(Type t); - - Type type() const; - - /** Same as deserialize or load, but operates on a string instead - of a stream or file. - - \sa deserialize, load - */ - void parse(const std::string& src); - - std::string unparse() const; - - /** Comments appear before values when they are in serialized form.*/ - const std::string& comment() const; - void setComment(const std::string& c); - - /** True if this is the NONE value */ - bool isNone() const; - - /** Throws a ParseError exception if this is not a number */ - double number() const; - const std::string& string() const; - bool boolean() const; - - /** If this is named ARRAY or TABLE, returns the name. */ - const std::string& name() const; - - /** \brief Set the name used when serializing an ARRAY or TABLE. - - Only legal for ARRAY or TABLE. The \a name must begin with a letter - and contain only letters, numbers, underscores and scope operators. - -
-        a2z
-        hello
-        Foo::bar
-        color.red
-        this->that
-        __x
-        
- - - The scope operators "::", "->", and - ".", may have spaces around them. The name may not - contain parentheses. - */ - void setName(const std::string& name); - - /** Number of elements if this is an ARRAY or TABLE */ - int size() const; - int length() const; - - /** For an array, returns the ith element */ - const Any& operator[](int i) const; - Any& operator[](int i); - - /** Directly exposes the underlying data structure for an ARRAY. */ - const Array& array() const; - void append(const Any& v0); - void append(const Any& v0, const Any& v1); - void append(const Any& v0, const Any& v1, const Any& v2); - void append(const Any& v0, const Any& v1, const Any& v2, const Any& v3); - - /** Directly exposes the underlying data structure for table.*/ - const Table& table() const; - - /** For a table, returns the element for \a key. Throws KeyNotFound - exception if the element does not exist. - */ - const Any& operator[](const std::string& key) const; - - // Needed to prevent the operator[](int) overload from catching - // string literals - inline const Any& operator[](const char* key) const { - return operator[](std::string(key)); - } - - /** - Fetch an element from a table. This can be used as: - -
-        a["key"] = value;  (create the key if it did not exist)
-        
- - or - -
-        value = a["key"];  (throw an error if the key did not exist)
-        
- - Note: - In order to cause elements to be correctly created in the - first case while still providing "key not found" errors in the - second case, the Any returned is a special object that delays - the actual fetch until the following assignment or method - call. This means that in the event of an error, the exception - may be thrown from a line other than the actual fetch. Use - the Any::get() or the const Any::operator[]() methods to avoid - this behavior and ensure error-checking at fetch time. - */ - Any& operator[](const std::string& key); - - /** \copydoc Any::operator[](const std::string&) */ - inline Any& operator[](const char* key) { - return operator[](std::string(key)); - } - - /** For a table, returns the element for key \a x and \a - defaultVal if it does not exist. */ - const Any& get(const std::string& key, const Any& defaultVal) const; - - /** Returns true if this key is in the TABLE. Illegal to call on an object that is not a TABLE. */ - bool containsKey(const std::string& key) const; - - /** For a table, assigns the element for key k. */ - void set(const std::string& key, const Any& val); - - /** for an ARRAY, resizes and returns the last element */ - Any& next(); - - - /** True if the Anys are exactly equal, ignoring comments. Applies deeply on arrays and tables. */ - bool operator==(const Any& x) const; - bool operator!=(const Any& x) const; - - operator int() const; - operator float() const; - operator double() const; - operator bool() const; - operator std::string() const; - - /** Resize to \a n elements, where new elements are NIL - It is an error to call this method if this is not an Any::ARRAY */ - void resize(int n); - - /** - Clears all entries. - This must be a TABLE or ARRAY */ - void clear(); - - /** Parse from a file. - \sa deserialize, parse */ - void load(const std::string& filename); - - /** Uses the serialize method. */ - void save(const std::string& filename) const; - - void serialize(TextOutput& to) const; - /** Parse from a stream. - \sa load, parse */ - void deserialize(TextInput& ti); - - const Source& source() const; - - /** Throws a ParseError if \a value is false. Useful for quickly - creating parse rules in classes that deserialize from Any. - */ - void verify(bool value, const std::string& message = "") const; - - /** Verifies that the name begins with identifier \a n. It may contain - identifier operators after this */ - void verifyName(const std::string& n) const; - - /** Verifies that the type is \a t. */ - void verifyType(Type t) const; - - /** Throws an exception if the type is not \a t0 or \a t1. */ - void verifyType(Type t0, Type t1) const; - - /** Verifies that the size is between \a low and \a high, inclusive */ - void verifySize(int low, int high) const; - - /** Verifies that the size is exactly \a s */ - void verifySize(int s) const; - -private: - - void deserializeTable(TextInput& ti); - void deserializeArray(TextInput& ti,const std::string& term); - -}; // class Any - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/AnyVal.h b/dep/include/g3dlite/G3D/AnyVal.h deleted file mode 100644 index 8c1bc72f206..00000000000 --- a/dep/include/g3dlite/G3D/AnyVal.h +++ /dev/null @@ -1,512 +0,0 @@ -/** - @file AnyVal.h - @author Morgan McGuire - @created 2006-06-11 - @edited 2008-07-14 - */ - -#ifndef G3D_ANYVAL_H -#define G3D_ANYVAL_H - -#include "G3D/platform.h" -#include -#include "G3D/Array.h" -#include "G3D/TextInput.h" - -namespace G3D { -// Forward declarations for G3D types -class Vector2; -class Vector3; -class Vector4; -class Color1; -class Color3; -class Color4; -class Quat; -class Matrix2; -class Matrix3; -class Matrix4; -class CoordinateFrame; -class TextInput; -class TextOutput; -class BinaryInput; -class BinaryOutput; -class Rect2D; -class AABox; - -/** - \deprecated - Use the G3D::Any class instead. This is only provided for - backwards compatibility to G3D 7.xx. - - A generic value, useful for defining property trees that can - be loaded from and saved to disk. The values are intentionally - restricted to a small set. - - When written to files, the syntax is as follows. Note that you can - nest arrays and tables in order to create full tree (i.e., XML-like) - structures as configuration files: - - - - - - - - - - - - - - - - - - - - - - - -
NULLNil
doubleThe number in printf double format
booltrue or false
std::stringThe string in double-quotes (")
Rect2DR(x0,y0,x1,y1)
Color1C1(value)
Color3C3(r,g,b)
Color4C4(r,g,b,a)
Vector2V2(x,y)
Vector3V3(x,y,z)
Vector4V4(x,y,z,w)
QuatV(x,y,z,w)
AABoxAAB(low Vector3, high Vector3)
Matrix2M2(r0c0, r0c1, -
   
r1c0, r1c1)
Matrix3M3(r0c0, r0c1, r0c2, -
   
r1c0, r1c1, r1c2, -
   
r2c0, r2c1, r2c2)
Matrix4M4(r0c0, r0c1, r0c2, r0c3, -
   
r1c0, r1c1, r1c2, r1c3, -
   
r2c0, r2c1, r2c2, r2c3, -
   
r3c0, r3c1, r3c2, r3c3)
CoordinateFrameCF(r0c0, r0c1, r0c2, r0c3, -
   
r1c0, r1c1, r1c2, r1c3, -
   
r2c0, r2c1, r2c2, r2c3)
CoordinateFrameCF(V3(x, y, z), yaw deg, pitch deg, optional roll deg)
Array[element0, element1, ... , elementn-1]
Table{symbol0 = value0 -
 symbol1 = value1 -
 ... -
 symboln-1 = valuen-1}
- - See also boost::any for a more general purpose but slightly harder to use - "any" for C++. - - The semantics of operator[] and the get() methods are slightly different; - operator[] acts more like a scripting language that automatically extends - arrays and tables instead of generating errors. get() has more strict semantics, - like a C++ class. - - AnyVal uses copy-on-mutate, so that AnyVal a = b semantically copies b (like int a = b would), although in practice - it delays the copy until one is mutated so that it is still fast to "copy" large arrays and tables. - - Reading example: -
-    AnyVal property = AnyVal::fromFile("c:/tmp/test.txt"));
-
-    Vector3 vel = property["angular velocity"]
-
-    Using defaults to handle errors:
-       If there was no "enabled" value, this will return the default instead of failing
-    bool enabled = property["enabled"].boolean(true);
-
- 
- - Writing to a file: -
-    AnyVal dict(AnyVal::TABLE);
-
-    dict["enabled"] = AnyVal(true);
-    dict["weight"] = 100;
-    dict["angular velocity"] = Vector3(1, -3, 4.5);
-
-    TextOutput t("c:/tmp/test.txt");
-    dict.serialize(t);
-    t.commit();
-  
- - Example of a data file: -
-   {
-      heights = [1, 17, 32]
-      model = 
-        {
-           color = C3(1, 1, 1)
-           filename = "foo.md2"
-        }
-      position = V3(23, 14, 0)
-      name = "Elmer"
-   }
-  
- -

- What's the difference from boost::any? -
I think that AnyVal will be easier for novice C++ users. It addresses the problem that - even though G3D::TextInput makes reading configuration files extremely simple, many people - still don't use it. So AnyVal makes it ridiculously simple to read and write a tree of G3D - types to a file. - - AnyVal: -

-{
-AnyVal tree(TextInput("config.txt"));
-
-bool enabled = tree.get("enabled", false);
-Vector3 direction = tree.get("direction", Vector3::zero());
-...
-}
-
- -boost: -
-{
-bool enabled = false;
-Vector3 direction;
-Table tree;
-
- ...write lots of file parsing code...
-
-   if (tree.containsKey("enabled")) {
-      const boost::any& val = tree["enabled"];
-      try {
-        enabled = any_cast(val);
-      } catch(const boost::bad_any_cast &) {
-      }
-    }
-
-   if (tree.containsKey("direction")) {
-      const boost::any& val = tree["direction"];
-      try {
-        direction = any_cast(val);
-      } catch(const boost::bad_any_cast &) {
-      }
-    }
-   ...
-}
-
- -\deprecated - */ -class AnyVal { -public: - - /** Array and table values are all Any.*/ - enum Type { - NIL, - NUMBER, - BOOLEAN, - STRING, - VECTOR2, - VECTOR3, - VECTOR4, - MATRIX2, - MATRIX3, - MATRIX4, - QUAT, - COORDINATEFRAME, - COORDINATEFRAME2D, - CFRAME = COORDINATEFRAME, - CFRAME2D = COORDINATEFRAME2D, - COLOR1, - COLOR3, - COLOR4, - RECT2D, - AABOX2D = RECT2D, - AABOX, - ARRAY, - TABLE}; - - /** Base class for all AnyVal exceptions.*/ - class Exception { - public: - virtual ~Exception() {} - }; - - /** Thrown when an inappropriate operation is performed (e.g., operator[] on a number) */ - class WrongType : public Exception { - public: - Type expected; - Type actual; - WrongType() : expected(NIL), actual(NIL) {} - WrongType(Type e, Type a) : expected(e), actual(a) {} - }; - - /** Thrown by operator[] when a key is not present. */ - class KeyNotFound : public Exception { - public: - std::string key; - KeyNotFound() {} - KeyNotFound(const std::string& k) : key(k) {} - }; - - class IndexOutOfBounds : public Exception { - public: - int index; - int size; - IndexOutOfBounds() : index(0), size(0) {} - IndexOutOfBounds(int i, int s) : index(i), size(s) {} - }; - - /** Thrown when deserialize() when the input is incorrectly formatted. */ - class CorruptText : public Exception { - public: - std::string message; - - /** Token where the problem occurred.*/ - G3D::Token token; - - CorruptText() {} - CorruptText(const std::string& s, const G3D::Token& t) : message(s), token(t) {} - }; - -private: - - Type m_type; - void* m_value; - - /** For table and array types, *m_value is shared between multiple - instances. Mutation is allowed only if the reference count is - exactly 1, otherwise the mutating instance must copy the - value. This is not used for other types. - */ - int* m_referenceCount; - - /** Decrements the reference count (if there is one). If the - reference count is zero or does not exist. Calls delete on @a - m_value and sets it to NULL. - */ - void deleteValue(); - - /** Returns a copy of the value. */ - void* copyValue() const; - - /** Assumes isSharedType. Ensures that this has a unique reference */ - void makeMutable(); - - /** True if this is a shared value between multiple instances. */ - inline bool isShared() const { - return m_referenceCount && (*m_referenceCount > 1); - } - - /** True when m_value is a double pointer */ - inline bool isSharedType() const { - return (m_type == TABLE) || (m_type == ARRAY); - } - -public: - - AnyVal(); - - /** Deserialize */ - explicit AnyVal(G3D::TextInput& t); - - static AnyVal fromFile(const std::string& filename); - - void load(const std::string& filename); - - void save(const std::string& filename) const; - - ///** Deserialize */ - //explicit AnyVal(G3D::BinaryInput& t); - - /** Construct a number */ - AnyVal(double); - AnyVal(int); - - // Explicit to avoid ambiguity with the 'double' constructor - // when an integer type is constructed - AnyVal(bool); - AnyVal(const G3D::Vector2&); - AnyVal(const G3D::Vector3&); - AnyVal(const G3D::Vector4&); - - AnyVal(const G3D::Color1&); - AnyVal(const G3D::Color3&); - AnyVal(const G3D::Color4&); - - AnyVal(const std::string&); - AnyVal(const char*); - - AnyVal(const G3D::Quat&); - - AnyVal(const G3D::Rect2D&); - AnyVal(const G3D::AABox&); - - AnyVal(const G3D::CoordinateFrame&); - AnyVal(const G3D::Matrix2&); - AnyVal(const G3D::Matrix3&); - AnyVal(const G3D::Matrix4&); - - AnyVal(const AnyVal&); - - AnyVal(Type arrayOrTable); - - AnyVal& operator=(const AnyVal&); - - /** Frees the underlying storage */ - ~AnyVal(); - - Type type() const; - - bool isNil() const { - return type() == NIL; - } - - void serialize(G3D::TextOutput& t) const; - //void serialize(G3D::BinaryOutput& t) const; - void deserialize(G3D::TextInput& t); - //void deserialize(G3D::BinaryInput& t); - - /** Array dereference. If the index is out of bounds, IndexOutOfBounds is thrown */ - const AnyVal& operator[](int) const; - - /** Extend this array by one element. */ - void append(const AnyVal&); - - /** If the index is out of bounds, the array is resized. If the index is negative, - IndexOutOfBounds is thrown.*/ - AnyVal& operator[](int); - - /** If @a i is out of bounds or this is not an ARRAY, defaultVal is returned.*/ - const AnyVal& get(int i, const AnyVal& defaultVal) const; - - /** If out of bounds, IndexOutOfBounds is thrown. */ - const AnyVal& get(int i) const; - - /** Returns defaultVal if this is not a TABLE or the key is not found. */ - const AnyVal& get(const std::string& key, const AnyVal& defaultVal) const; - - /** Throws KeyNotFound exception if the key is not present.*/ - const AnyVal& get(const std::string& key) const; - - /** Table reference */ - const AnyVal& operator[](const std::string&) const; - - /** Table reference. If the element does not exist, it is created. */ - AnyVal& operator[](const std::string&); - - /** Table reference */ - const AnyVal& operator[](const char*) const; - - /** Table reference. If the element does not exist, it is created. */ - AnyVal& operator[](const char*); - - /** If this value is not a number throws a WrongType exception. */ - double number() const; - - /** If this value is not a number, returns defaultVal. */ - double number(double defaultVal) const; - - operator double () const { - return number(); - } - - operator float () const { - return (float)number(); - } - - bool boolean() const; - bool boolean(bool b) const; - - operator bool() const { - return boolean(); - } - - const std::string& string() const; - const std::string& string(const std::string& defaultVal) const; - - operator const std::string& () const { - return string(); - } - - const G3D::Rect2D& rect2D() const; - const G3D::Rect2D& rect2D(const G3D::Rect2D& defaultVal) const; - - operator const Rect2D& () const { - return rect2D(); - } - - const G3D::AABox& aabox() const; - const G3D::AABox& aabox(const G3D::AABox& defaultVal) const; - - operator const AABox& () const { - return aabox(); - } - - const G3D::Vector2& vector2() const; - const G3D::Vector2& vector2(const G3D::Vector2& defaultVal) const; - - operator const Vector2& () const { - return vector2(); - } - - const G3D::Vector3& vector3() const; - const G3D::Vector3& vector3(const G3D::Vector3& defaultVal) const; - - operator const Vector3& () { - return vector3(); - } - - const G3D::Vector4& vector4() const; - const G3D::Vector4& vector4(const G3D::Vector4& defaultVal) const; - - operator const Vector4& () const { - return vector4(); - } - - const G3D::Color1& color1() const; - const G3D::Color1& color1(const G3D::Color1& defaultVal) const; - - const G3D::Color3& color3() const; - const G3D::Color3& color3(const G3D::Color3& defaultVal) const; - - operator const Color3& () const { - return color3(); - } - - const G3D::Color4& color4() const; - const G3D::Color4& color4(const G3D::Color4& defaultVal) const; - - operator const Color4& () const { - return color4(); - } - - const G3D::CoordinateFrame& coordinateFrame() const; - const G3D::CoordinateFrame& coordinateFrame(const G3D::CoordinateFrame& defaultVal) const; - - operator const CoordinateFrame& () const { - return coordinateFrame(); - } - - const G3D::Matrix2& matrix2() const; - const G3D::Matrix2& matrix2(const G3D::Matrix2& defaultVal) const; - - operator const Matrix2& () const { - return matrix2(); - } - - const G3D::Matrix3& matrix3() const; - const G3D::Matrix3& matrix3(const G3D::Matrix3& defaultVal) const; - - operator const Matrix3& () const { - return matrix3(); - } - - const G3D::Matrix4& matrix4() const; - const G3D::Matrix4& matrix4(const G3D::Matrix4& defaultVal) const; - - operator const Matrix4& () const { - return matrix4(); - } - - const G3D::Quat& quat() const; - const G3D::Quat& quat(const G3D::Quat& defaultVal) const; - - operator const Quat& () const { - return quat(); - } - - std::string toString() const; - - /** Number of elements for an array or table.*/ - int size() const; - - /** For a table, returns the keys. */ - void getKeys(G3D::Array&) const; -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/AreaMemoryManager.h b/dep/include/g3dlite/G3D/AreaMemoryManager.h deleted file mode 100644 index d8d8f710359..00000000000 --- a/dep/include/g3dlite/G3D/AreaMemoryManager.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - @file AreaMemoryManager.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-01-20 - @edited 2009-05-29 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - - -#ifndef G3D_AreaMemoryManager_h -#define G3D_AreaMemoryManager_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Array.h" -#include "G3D/MemoryManager.h" - -namespace G3D { - -/** - \brief Allocates memory in large blocks and then frees it as an area. - - Useful for ensuring cache coherence and for reducing the time cost of - multiple allocations and deallocations. - - Not threadsafe - */ -class AreaMemoryManager : public MemoryManager { -private: - - class Buffer { - private: - uint8* m_first; - size_t m_size; - size_t m_used; - - public: - - Buffer(size_t size); - - ~Buffer(); - - /** Returns NULL if out of space */ - void* alloc(size_t s); - }; - - size_t m_sizeHint; - - /** The underlying array is stored in regular MemoryManager heap memory */ - Array m_bufferArray; - - AreaMemoryManager(size_t sizeHint); - -public: - - typedef ReferenceCountedPointer Ref; - - /** - \param sizeHint Total amount of memory expected to be allocated. - The allocator will allocate memory from the system in increments - of this size. - */ - static AreaMemoryManager::Ref create(size_t sizeHint = 10 * 1024 * 1024); - - /** Invokes deallocateAll. */ - ~AreaMemoryManager(); - - size_t bytesAllocated() const; - - /** Allocates memory out of the buffer pool. - @param s must be no larger than sizeHint */ - virtual void* alloc(size_t s); - - /** Ignored. */ - virtual void free(void* x); - - virtual bool isThreadsafe() const; - - /** Deletes all previously allocated memory. Because delete is not - invoked on objects in this memory, it is not safe to simply - free memory containing C++ objects that expect their destructors - to be called. */ - void deallocateAll(); -}; - -typedef AreaMemoryManager CoherentAllocator; -} - -#endif diff --git a/dep/include/g3dlite/G3D/Array.h b/dep/include/g3dlite/G3D/Array.h deleted file mode 100644 index cc9e1d9dd01..00000000000 --- a/dep/include/g3dlite/G3D/Array.h +++ /dev/null @@ -1,1274 +0,0 @@ -/** - @file Array.h - - @maintainer Morgan McGuire, graphics3d.com - @cite Portions written by Aaron Orenstein, a@orenstein.name - - @created 2001-03-11 - @edited 2009-05-29 - - Copyright 2000-2009, Morgan McGuire, http://graphics.cs.williams.edu - All rights reserved. - */ - -#ifndef G3D_Array_h -#define G3D_Array_h - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/System.h" -#include "G3D/MemoryManager.h" -#ifdef G3D_DEBUG -// For formatting error messages -# include "G3D/format.h" -#endif -#include -#include - -#ifdef _MSC_VER -# include - -# pragma warning (push) - // debug information too long -# pragma warning( disable : 4312) -# pragma warning( disable : 4786) -#endif - - -namespace G3D { - -/** - Constant for passing to Array::resize - */ -const bool DONT_SHRINK_UNDERLYING_ARRAY = false; - -/** Constant for Array::sort */ -const int SORT_INCREASING = 1; -/** Constant for Array::sort */ -const int SORT_DECREASING = -1; - -/** - \brief Dynamic 1D array tuned for performance. - - Objects must have a default constructor (constructor that - takes no arguments) in order to be used with this template. - You will get the error "no appropriate default constructor found" - if they do not. - - Do not use with objects that overload placement operator new, - since the speed of Array is partly due to pooled allocation. - - Array is highly optimized compared to std::vector. - Array operations are less expensive than on std::vector and for large - amounts of data, Array consumes only 1.5x the total size of the - data, while std::vector consumes 2.0x. The default - array takes up zero heap space. The first resize (or append) - operation grows it to a reasonable internal size so it is efficient - to append to small arrays. - - Then Array needs to copy - data internally on a resize operation it correctly invokes copy - constructors of the elements (the MSVC6 implementation of - std::vector uses realloc, which can create memory leaks for classes - containing references and pointers). Array provides a guaranteed - safe way to access the underlying data as a flat C array -- - Array::getCArray. Although (T*)std::vector::begin() can be used for - this purpose, it is not guaranteed to succeed on all platforms. - - To serialize an array, see G3D::serialize. - - The template parameter MIN_ELEMENTS indicates the smallest number of - elements that will be allocated. The default of 10 is designed to avoid - the overhead of repeatedly allocating the array as it grows from 1, to 2, and so on. - If you are creating a lot of small Arrays, however, you may want to set this smaller - to reduce the memory cost. Once the array has been allocated, it will never - deallocate the underlying array unless MIN_ELEMENTS is set to 0, MIN_BYTES is 0, and the array - is empty. - - Do not subclass an Array. - - \sa G3D::SmallArray - */ -template -class Array { -private: - /** 0...num-1 are initialized elements, num...numAllocated-1 are not */ - T* data; - - int num; - int numAllocated; - - MemoryManager::Ref m_memoryManager; - - /** \param n Number of elements - */ - void init(int n, const MemoryManager::Ref& m) { - m_memoryManager = m; - debugAssert(n >= 0); - this->num = 0; - this->numAllocated = 0; - data = NULL; - if (n > 0) { - resize(n); - } else { - data = NULL; - } - } - - void _copy(const Array &other) { - init(other.num, MemoryManager::create()); - for (int i = 0; i < num; i++) { - data[i] = other.data[i]; - } - } - - /** - Returns true iff address points to an element of this array. - Used by append. - */ - inline bool inArray(const T* address) { - return (address >= data) && (address < data + num); - } - - - /** Only compiled if you use the sort procedure. */ - static bool __cdecl compareGT(const T& a, const T& b) { - return a > b; - } - - - /** - Allocates a new array of size numAllocated (not a parameter to the method) - and then copies at most oldNum elements from the old array to it. Destructors are - called for oldNum elements of the old array. - */ - void realloc(int oldNum) { - T* oldData = data; - - // The allocation is separate from the constructor invocation because we don't want - // to pay for the cost of constructors until the newly allocated - // elements are actually revealed to the application. They - // will be constructed in the resize() method. - - data = (T*)m_memoryManager->alloc(sizeof(T) * numAllocated); - alwaysAssertM(data, "Memory manager returned NULL: out of memory?"); - - // Call the copy constructors - {const int N = G3D::min(oldNum, numAllocated); - const T* end = data + N; - T* oldPtr = oldData; - for (T* ptr = data; ptr < end; ++ptr, ++oldPtr) { - - // Use placement new to invoke the constructor at the location - // that we determined. Use the copy constructor to make the assignment. - const T* constructed = new (ptr) T(*oldPtr); - - (void)constructed; - debugAssertM(constructed == ptr, - "new returned a different address than the one provided by Array."); - }} - - // Call destructors on the old array (if there is no destructor, this will compile away) - {const T* end = oldData + oldNum; - for (T* ptr = oldData; ptr < end; ++ptr) { - ptr->~T(); - }} - - m_memoryManager->free(oldData); - } - -public: - - /** - G3D C++ STL style iterator variable. Call begin() to get - the first iterator, pre-increment (++i) the iterator to get to - the next value. Use dereference (*i) to access the element. - */ - typedef T* Iterator; - /** G3D C++ STL style const iterator in same style as Iterator. */ - typedef const T* ConstIterator; - - /** stl porting compatibility helper */ - typedef Iterator iterator; - /** stl porting compatibility helper */ - typedef ConstIterator const_iterator; - /** stl porting compatibility helper */ - typedef T value_type; - /** stl porting compatibility helper */ - typedef int size_type; - /** stl porting compatibility helper */ - typedef int difference_type; - - /** - C++ STL style iterator method. Returns the first iterator element. - Do not change the size of the array while iterating. - */ - Iterator begin() { - return data; - } - - ConstIterator begin() const { - return data; - } - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - ConstIterator end() const { - return data + num; - } - - Iterator end() { - return data + num; - } - - /** - The array returned is only valid until the next append() or resize call, or - the Array is deallocated. - */ - T* getCArray() { - return data; - } - - /** - The array returned is only valid until the next append() or resize call, or - the Array is deallocated. - */ - const T* getCArray() const { - return data; - } - - /** Creates a zero length array (no heap allocation occurs until resize). */ - Array() : num(0) { - init(0, MemoryManager::create()); - debugAssert(num >= 0); - } - - - /** Creates an array containing v0. */ - Array(const T& v0) { - init(1, MemoryManager::create()); - (*this)[0] = v0; - } - - /** Creates an array containing v0 and v1. */ - Array(const T& v0, const T& v1) { - init(2, MemoryManager::create()); - (*this)[0] = v0; - (*this)[1] = v1; - } - - /** Creates an array containing v0...v2. */ - Array(const T& v0, const T& v1, const T& v2) { - init(3, MemoryManager::create()); - (*this)[0] = v0; - (*this)[1] = v1; - (*this)[2] = v2; - } - - /** Creates an array containing v0...v3. */ - Array(const T& v0, const T& v1, const T& v2, const T& v3) { - init(4, MemoryManager::create()); - (*this)[0] = v0; - (*this)[1] = v1; - (*this)[2] = v2; - (*this)[3] = v3; - } - - /** Creates an array containing v0...v4. */ - Array(const T& v0, const T& v1, const T& v2, const T& v3, const T& v4) { - init(5, MemoryManager::create()); - (*this)[0] = v0; - (*this)[1] = v1; - (*this)[2] = v2; - (*this)[3] = v3; - (*this)[4] = v4; - } - - - /** - Copy constructor - */ - Array(const Array& other) : num(0) { - _copy(other); - debugAssert(num >= 0); - } - - /** - Destructor does not delete() the objects if T is a pointer type - (e.g. T = int*) instead, it deletes the pointers themselves and - leaves the objects. Call deleteAll if you want to dealocate - the objects referenced. Do not call deleteAll if T is not a pointer - type (e.g. do call Array::deleteAll, do not call Array::deleteAll). - */ - ~Array() { - // Invoke the destructors on the elements - for (int i = 0; i < num; i++) { - (data + i)->~T(); - } - - m_memoryManager->free(data); - // Set to 0 in case this Array is global and gets referenced during app exit - data = NULL; - num = 0; - numAllocated = 0; - } - - /** - Removes all elements. Use resize(0, false) or fastClear if you want to - remove all elements without deallocating the underlying array - so that future append() calls will be faster. - */ - void clear(bool shrink = true) { - resize(0, shrink); - } - - void clearAndSetMemoryManager(const MemoryManager::Ref& m) { - clear(); - debugAssert(data == NULL); - m_memoryManager = m; - } - - /** resize(0, false) - @deprecated*/ - void fastClear() { - clear(false); - } - - /** - Assignment operator. - */ - Array& operator=(const Array& other) { - debugAssert(num >= 0); - resize(other.num); for (int i = 0; i < num; ++i) { - data[i] = other[i]; - } - debugAssert(num >= 0); - return *this; - } - - Array& operator=(const std::vector& other) { - resize((int)other.size()); - for (int i = 0; i < num; ++i) { - data[i] = other[i]; - } - return *this; - } - - inline MemoryManager::Ref memoryManager() const { - return m_memoryManager; - } - - /** - Number of elements in the array. - */ - inline int size() const { - return num; - } - - /** - Number of elements in the array. (Same as size; this is just - here for convenience). - */ - inline int length() const { - return size(); - } - - /** - Swaps element index with the last element in the array then - shrinks the array by one. - */ - void fastRemove(int index, bool shrinkIfNecessary = false) { - debugAssert(index >= 0); - debugAssert(index < num); - data[index] = data[num - 1]; - resize(size() - 1, shrinkIfNecessary); - } - - - /** - Inserts at the specified index and shifts all other elements up by one. - */ - void insert(int n, const T& value) { - // Add space for the extra element - resize(num + 1, false); - - for (int i = num - 1; i > n; --i) { - data[i] = data[i - 1]; - } - data[n] = value; - } - - /** @param shrinkIfNecessary if false, memory will never be - reallocated when the array shrinks. This makes resizing much - faster but can waste memory. - */ - void resize(int n, bool shrinkIfNecessary = true) { - debugAssert(n >= 0); - if (num == n) { - return; - } - - int oldNum = num; - num = n; - - // Call the destructors on newly hidden elements if there are any - for (int i = num; i < oldNum; ++i) { - (data + i)->~T(); - } - - // Once allocated, always maintain MIN_ELEMENTS elements or 32 bytes, whichever is higher. - const int minSize = std::max(MIN_ELEMENTS, (int)(MIN_BYTES / sizeof(T))); - - if ((MIN_ELEMENTS == 0) && (MIN_BYTES == 0) && (n == 0) && shrinkIfNecessary) { - // Deallocate the array completely - numAllocated = 0; - m_memoryManager->free(data); - data = NULL; - return; - } - - if (num > numAllocated) { - // Grow the underlying array - - if (numAllocated == 0) { - // First allocation; grow to exactly the size requested to avoid wasting space. - numAllocated = n; - debugAssert(oldNum == 0); - realloc(oldNum); - } else { - - if (num < minSize) { - // Grow to at least the minimum size - numAllocated = minSize; - - } else { - - // Increase the underlying size of the array. Grow aggressively - // up to 64k, less aggressively up to 400k, and then grow relatively - // slowly (1.5x per resize) to avoid excessive space consumption. - // - // These numbers are tweaked according to performance tests. - - float growFactor = 3.0; - - int oldSizeBytes = numAllocated * sizeof(T); - if (oldSizeBytes > 400000) { - // Avoid bloat - growFactor = 1.5; - } else if (oldSizeBytes > 64000) { - // This is what std:: uses at all times - growFactor = 2.0; - } - - numAllocated = (num - numAllocated) + (int)(numAllocated * growFactor); - - if (numAllocated < minSize) { - numAllocated = minSize; - } - } - - realloc(oldNum); - } - - } else if ((num <= numAllocated / 3) && shrinkIfNecessary && (num > minSize)) { - // Shrink the underlying array - - // Only copy over old elements that still remain after resizing - // (destructors were called for others if we're shrinking) - realloc(iMin(num, oldNum)); - - } - - // Call the constructors on newly revealed elements. - // Do not use parens because we don't want the intializer - // invoked for POD types. - for (int i = oldNum; i < num; ++i) { - new (data + i) T; - } - } - - /** - Add an element to the end of the array. Will not shrink the underlying array - under any circumstances. It is safe to append an element that is already - in the array. - */ - inline void append(const T& value) { - - if (num < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(value); - ++num; - } else if (inArray(&value)) { - // The value was in the original array; resizing - // is dangerous because it may move the value - // we have a reference to. - T tmp = value; - append(tmp); - } else { - // Here we run the empty initializer where we don't have to, but - // this simplifies the computation. - resize(num + 1, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 1] = value; - } - } - - - inline void append(const T& v1, const T& v2) { - if (inArray(&v1) || inArray(&v2)) { - // Copy into temporaries so that the references won't break when - // the array resizes. - T t1 = v1; - T t2 = v2; - append(t1, t2); - } else if (num + 1 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - num += 2; - } else { - // Resize the array. Note that neither value is already in the array. - resize(num + 2, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 2] = v1; - data[num - 1] = v2; - } - } - - - inline void append(const T& v1, const T& v2, const T& v3) { - if (inArray(&v1) || inArray(&v2) || inArray(&v3)) { - T t1 = v1; - T t2 = v2; - T t3 = v3; - append(t1, t2, t3); - } else if (num + 2 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - new (data + num + 2) T(v3); - num += 3; - } else { - resize(num + 3, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 3] = v1; - data[num - 2] = v2; - data[num - 1] = v3; - } - } - - - inline void append(const T& v1, const T& v2, const T& v3, const T& v4) { - if (inArray(&v1) || inArray(&v2) || inArray(&v3) || inArray(&v4)) { - T t1 = v1; - T t2 = v2; - T t3 = v3; - T t4 = v4; - append(t1, t2, t3, t4); - } else if (num + 3 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - new (data + num + 2) T(v3); - new (data + num + 3) T(v4); - num += 4; - } else { - resize(num + 4, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 4] = v1; - data[num - 3] = v2; - data[num - 2] = v3; - data[num - 1] = v4; - } - } - - /** - Returns true if the given element is in the array. - */ - bool contains(const T& e) const { - for (int i = 0; i < size(); ++i) { - if ((*this)[i] == e) { - return true; - } - } - - return false; - } - - /** - Append the elements of array. Cannot be called with this array - as an argument. - */ - void append(const Array& array) { - debugAssert(this != &array); - int oldNum = num; - int arrayLength = array.length(); - - resize(num + arrayLength, false); - - for (int i = 0; i < arrayLength; i++) { - data[oldNum + i] = array.data[i]; - } - } - - /** - Pushes a new element onto the end and returns its address. - This is the same as A.resize(A.size() + 1, false); A.last() - */ - inline T& next() { - resize(num + 1, false); - return last(); - } - - /** - Pushes an element onto the end (appends) - */ - inline void push(const T& value) { - append(value); - } - - inline void push(const Array& array) { - append(array); - } - - /** Alias to provide std::vector compatibility */ - inline void push_back(const T& v) { - push(v); - } - - /** "The member function removes the last element of the controlled sequence, which must be non-empty." - For compatibility with std::vector. */ - inline void pop_back() { - pop(); - } - - /** - "The member function returns the storage currently allocated to hold the controlled - sequence, a value at least as large as size()" - For compatibility with std::vector. - */ - int capacity() const { - return numAllocated; - } - - /** - "The member function returns a reference to the first element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - T& front() { - return (*this)[0]; - } - - /** - "The member function returns a reference to the first element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - const T& front() const { - return (*this)[0]; - } - - /** - "The member function returns a reference to the last element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - T& back() { - return (*this)[size()-1]; - } - - /** - "The member function returns a reference to the last element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - const T& back() const { - return (*this)[size()-1]; - } - - /** - Removes the last element and returns it. By default, shrinks the underlying array. - */ - inline T pop(bool shrinkUnderlyingArrayIfNecessary = true) { - debugAssert(num > 0); - T temp = data[num - 1]; - resize(num - 1, shrinkUnderlyingArrayIfNecessary); - return temp; - } - - /** Pops the last element and discards it without returning anything. Faster than pop. - By default, does not shrink the underlying array.*/ - inline void popDiscard(bool shrinkUnderlyingArrayIfNecessary = false) { - debugAssert(num > 0); - resize(num - 1, shrinkUnderlyingArrayIfNecessary); - } - - - /** - "The member function swaps the controlled sequences between *this and str." - Note that this is slower than the optimal std implementation. - - For compatibility with std::vector. - */ - void swap(Array& str) { - Array temp = str; - str = *this; - *this = temp; - } - - - /** - Performs bounds checks in debug mode - */ - inline T& operator[](int n) { - debugAssertM((n >= 0) && (n < num), format("Array index out of bounds. n = %d, size() = %d", n, num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline T& operator[](unsigned int n) { - debugAssertM(n < (unsigned int)num, format("Array index out of bounds. n = %d, size() = %d", n, num)); - return data[n]; - } - - /** - Performs bounds checks in debug mode - */ - inline const T& operator[](int n) const { - debugAssert((n >= 0) && (n < num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline const T& operator[](unsigned int n) const { - debugAssert((n < (unsigned int)num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline T& randomElement() { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[iRandom(0, num - 1)]; - } - - inline const T& randomElement() const { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[iRandom(0, num - 1)]; - } - - /** - Returns the last element, performing a check in - debug mode that there is at least one element. - */ - inline const T& last() const { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[num - 1]; - } - - /** Returns element lastIndex() */ - inline T& last() { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[num - 1]; - } - - /** Returns size() - 1 */ - inline int lastIndex() const { - debugAssertM(num > 0, "Array is empty"); - return num - 1; - } - - inline int firstIndex() const { - debugAssertM(num > 0, "Array is empty"); - return 0; - } - - /** Returns element firstIndex(), performing a check in debug mode to ensure that there is at least one */ - inline T& first() { - debugAssertM(num > 0, "Array is empty"); - return data[0]; - } - - inline const T& first() const { - debugAssertM(num > 0, "Array is empty"); - return data[0]; - } - - /** Returns iFloor(size() / 2), throws an assertion in debug mode if the array is empty */ - inline int middleIndex() const { - debugAssertM(num > 0, "Array is empty"); - return num >> 1; - } - - /** Returns element middleIndex() */ - inline const T& middle() const { - debugAssertM(num > 0, "Array is empty"); - return data[num >> 1]; - } - - /** Returns element middleIndex() */ - inline T& middle() { - debugAssertM(num > 0, "Array is empty"); - return data[num >> 1]; - } - - /** - Calls delete on all objects[0...size-1] - and sets the size to zero. - */ - void deleteAll() { - for (int i = 0; i < num; i++) { - delete data[i]; - } - resize(0); - } - - /** - Returns the index of (the first occurance of) an index or -1 if - not found. Searches from the right. - */ - int rfindIndex(const T& value) const { - for (int i = num -1 ; i >= 0; --i) { - if (data[i] == value) { - return i; - } - } - return -1; - } - - /** - Returns the index of (the first occurance of) an index or -1 if - not found. - */ - int findIndex(const T& value) const { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return i; - } - } - return -1; - } - - /** - Finds an element and returns the iterator to it. If the element - isn't found then returns end(). - */ - Iterator find(const T& value) { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return data + i; - } - } - return end(); - } - - ConstIterator find(const T& value) const { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return data + i; - } - } - return end(); - } - - /** - Removes count elements from the array - referenced either by index or Iterator. - */ - void remove(Iterator element, int count = 1) { - debugAssert((element >= begin()) && (element < end())); - debugAssert((count > 0) && (element + count) <= end()); - Iterator last = end() - count; - - while(element < last) { - element[0] = element[count]; - ++element; - } - - resize(num - count); - } - - void remove(int index, int count = 1) { - debugAssert((index >= 0) && (index < num)); - debugAssert((count > 0) && (index + count <= num)); - - remove(begin() + index, count); - } - - /** - Reverse the elements of the array in place. - */ - void reverse() { - T temp; - - int n2 = num / 2; - for (int i = 0; i < n2; ++i) { - temp = data[num - 1 - i]; - data[num - 1 - i] = data[i]; - data[i] = temp; - } - } - - /** - Sort using a specific less-than function, e.g.: - -
-    bool __cdecl myLT(const MyClass& elem1, const MyClass& elem2) {
-        return elem1.x < elem2.x;
-    }
-    
- - Note that for pointer arrays, the const must come - after the class name, e.g., Array uses: - -
-    bool __cdecl myLT(MyClass*const& elem1, MyClass*const& elem2) {
-        return elem1->x < elem2->x;
-    }
-    
- - or a functor, e.g., -
-bool
-less_than_functor::operator()( const double& lhs, const double& rhs ) const
-{
-return( lhs < rhs? true : false );
-}
-
- */ - // void sort(bool (__cdecl *lessThan)(const T& elem1, const T& elem2)) { - // std::sort(data, data + num, lessThan); - //} - template - void sort(const LessThan& lessThan) { - // Using std::sort, which according to http://www.open-std.org/JTC1/SC22/WG21/docs/D_4.cpp - // was 2x faster than qsort for arrays around size 2000 on intel core2 with gcc - std::sort(data, data + num, lessThan); - } - - /** - Sorts the array in increasing order using the > or < operator. To - invoke this method on Array, T must override those operator. - You can overide these operators as follows: - - bool T::operator>(const T& other) const { - return ...; - } - bool T::operator<(const T& other) const { - return ...; - } - - */ - void sort(int direction = SORT_INCREASING) { - if (direction == SORT_INCREASING) { - std::sort(data, data + num); - } else { - std::sort(data, data + num, compareGT); - } - } - - /** - Sorts elements beginIndex through and including endIndex. - */ - void sortSubArray(int beginIndex, int endIndex, int direction = SORT_INCREASING) { - if (direction == SORT_INCREASING) { - std::sort(data + beginIndex, data + endIndex + 1); - } else { - std::sort(data + beginIndex, data + endIndex + 1, compareGT); - } - } - - void sortSubArray(int beginIndex, int endIndex, bool (__cdecl *lessThan)(const T& elem1, const T& elem2)) { - std::sort(data + beginIndex, data + endIndex + 1, lessThan); - } - - /** - The StrictWeakOrdering can be either a class that overloads the function call operator() or - a function pointer of the form bool (__cdecl *lessThan)(const T& elem1, const T& elem2) - */ - template - void sortSubArray(int beginIndex, int endIndex, StrictWeakOrdering& lessThan) { - std::sort(data + beginIndex, data + endIndex + 1, lessThan); - } - - /** Uses < and == to evaluate operator(); this is the default comparator for Array::partition. */ - class DefaultComparator { - public: - inline int operator()(const T& A, const T& B) const { - if (A < B) { - return 1; - } else if (A == B) { - return 0; - } else { - return -1; - } - } - }; - - /** The output arrays are resized with fastClear() so that if they are already of the same size - as this array no memory is allocated during partitioning. - - @param comparator A function, or class instance with an overloaded operator() that compares - two elements of type T and returns 0 if they are equal, -1 if the second is smaller, - and 1 if the first is smaller (i.e., following the conventions of std::string::compare). For example: - -
-        int compare(int A, int B) {
-            if (A < B) {
-                return 1;
-            } else if (A == B) {
-                return 0;
-            } else {
-                return -1;
-            }
-        }
-        
- */ - template - void partition( - const T& partitionElement, - Array& ltArray, - Array& eqArray, - Array& gtArray, - const Comparator& comparator) const { - - // Make sure all arrays are independent - debugAssert(<Array != this); - debugAssert(&eqArray != this); - debugAssert(>Array != this); - debugAssert(<Array != &eqArray); - debugAssert(<Array != >Array); - debugAssert(&eqArray != >Array); - - // Clear the arrays - ltArray.fastClear(); - eqArray.fastClear(); - gtArray.fastClear(); - - // Form a table of buckets for lt, eq, and gt - Array* bucket[3] = {<Array, &eqArray, >Array}; - - for (int i = 0; i < num; ++i) { - int c = comparator(partitionElement, data[i]); - debugAssertM(c >= -1 && c <= 1, "Comparator returned an illegal value."); - - // Insert into the correct bucket, 0, 1, or 2 - bucket[c + 1]->append(data[i]); - } - } - - /** - Uses < and == on elements to perform a partition. See partition(). - */ - void partition( - const T& partitionElement, - Array& ltArray, - Array& eqArray, - Array& gtArray) const { - - partition(partitionElement, ltArray, eqArray, gtArray, typename Array::DefaultComparator()); - } - - /** - Paritions the array into those below the median, those above the median, and those elements - equal to the median in expected O(n) time using quickselect. If the array has an even - number of different elements, the median for partition purposes is the largest value - less than the median. - - @param tempArray used for working scratch space - @param comparator see parition() for a discussion.*/ - template - void medianPartition( - Array& ltMedian, - Array& eqMedian, - Array& gtMedian, - Array& tempArray, - const Comparator& comparator) const { - - ltMedian.fastClear(); - eqMedian.fastClear(); - gtMedian.fastClear(); - - // Handle trivial cases first - switch (size()) { - case 0: - // Array is empty; no parition is possible - return; - - case 1: - // One element - eqMedian.append(first()); - return; - - case 2: - { - // Two element array; median is the smaller - int c = comparator(first(), last()); - - switch (c) { - case -1: - // first was bigger - eqMedian.append(last()); - gtMedian.append(first()); - break; - - case 0: - // Both equal to the median - eqMedian.append(first(), last()); - break; - - case 1: - // Last was bigger - eqMedian.append(first()); - gtMedian.append(last()); - break; - } - } - return; - } - - // All other cases use a recursive randomized median - - // Number of values less than all in the current arrays - int ltBoost = 0; - - // Number of values greater than all in the current arrays - int gtBoost = 0; - - // For even length arrays, force the gt array to be one larger than the - // lt array: - // [1 2 3] size = 3, choose half = (s + 1) /2 - // - int lowerHalfSize, upperHalfSize; - if (isEven(size())) { - lowerHalfSize = size() / 2; - upperHalfSize = lowerHalfSize + 1; - } else { - lowerHalfSize = upperHalfSize = (size() + 1) / 2; - } - const T* xPtr = NULL; - - // Maintain pointers to the arrays; we'll switch these around during sorting - // to avoid copies. - const Array* source = this; - Array* lt = <Median; - Array* eq = &eqMedian; - Array* gt = >Median; - Array* extra = &tempArray; - - while (true) { - // Choose a random element -- choose the middle element; this is theoretically - // suboptimal, but for loosly sorted array is actually the best strategy - - xPtr = &(source->middle()); - if (source->size() == 1) { - // Done; there's only one element left - break; - } - const T& x = *xPtr; - - // Note: partition (fast) clears the arrays for us - source->partition(x, *lt, *eq, *gt, comparator); - - int L = lt->size() + ltBoost + eq->size(); - int U = gt->size() + gtBoost + eq->size(); - if ((L >= lowerHalfSize) && - (U >= upperHalfSize)) { - - // x must be the partition median - break; - - } else if (L < lowerHalfSize) { - - // x must be smaller than the median. Recurse into the 'gt' array. - ltBoost += lt->size() + eq->size(); - - // The new gt array will be the old source array, unless - // that was the this pointer (i.e., unless we are on the - // first iteration) - Array* newGt = (source == this) ? extra : const_cast*>(source); - - // Now set up the gt array as the new source - source = gt; - gt = newGt; - - } else { - - // x must be bigger than the median. Recurse into the 'lt' array. - gtBoost += gt->size() + eq->size(); - - // The new lt array will be the old source array, unless - // that was the this pointer (i.e., unless we are on the - // first iteration) - Array* newLt = (source == this) ? extra : const_cast*>(source); - - // Now set up the lt array as the new source - source = lt; - lt = newLt; - } - } - - // Now that we know the median, make a copy of it (since we're about to destroy the array that it - // points into). - T median = *xPtr; - xPtr = NULL; - - // Partition the original array (note that this fast clears for us) - partition(median, ltMedian, eqMedian, gtMedian, comparator); - } - - /** - Computes a median partition using the default comparator and a dynamically allocated temporary - working array. If the median is not in the array, it is chosen to be the largest value smaller - than the true median. - */ - void medianPartition( - Array& ltMedian, - Array& eqMedian, - Array& gtMedian) const { - - Array temp; - medianPartition(ltMedian, eqMedian, gtMedian, temp, DefaultComparator()); - } - - - /** Redistributes the elements so that the new order is statistically independent - of the original order. O(n) time.*/ - void randomize() { - T temp; - - for (int i = size() - 1; i >= 0; --i) { - int x = iRandom(0, i); - - temp = data[i]; - data[i] = data[x]; - data[x] = temp; - } - } - - -}; - - -/** Array::contains for C-arrays */ -template bool contains(const T* array, int len, const T& e) { - for (int i = len - 1; i >= 0; --i) { - if (array[i] == e) { - return true; - } - } - return false; -} - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/AtomicInt32.h b/dep/include/g3dlite/G3D/AtomicInt32.h deleted file mode 100644 index 2d63f998355..00000000000 --- a/dep/include/g3dlite/G3D/AtomicInt32.h +++ /dev/null @@ -1,164 +0,0 @@ -/** - @file AtomicInt32.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2005-09-01 - @edited 2006-06-21 - */ -#ifndef G3D_ATOMICINT32_H -#define G3D_ATOMICINT32_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -#if defined(G3D_OSX) -# include -#endif - -namespace G3D { - -/** - An integer that may safely be used on different threads without - external locking. - - On Win32, Linux, FreeBSD, and Mac OS X this is implemented without locks. - - BETA API This is unsupported and may change - */ -class AtomicInt32 { -private: -# if defined(G3D_WIN32) - volatile long m_value; -# elif defined(G3D_OSX) - int32_t m_value; -# else - volatile int32 m_value; -# endif - - -public: - - /** Initial value is undefined. */ - AtomicInt32() {} - - /** Atomic set */ - explicit AtomicInt32(const int32 x) { - m_value = x; - } - - /** Atomic set */ - AtomicInt32(const AtomicInt32& x) { - m_value = x.m_value; - } - - /** Atomic set */ - const AtomicInt32& operator=(const int32 x) { - m_value = x; - return *this; - } - - /** Atomic set */ - void operator=(const AtomicInt32& x) { - m_value = x.m_value; - } - - /** Returns the current value */ - int32 value() const { - return m_value; - } - - /** Returns the old value, before the add. */ - int32 add(const int32 x) { -# if defined(G3D_WIN32) - - return InterlockedExchangeAdd(&m_value, x); - -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - - int32 old; - asm volatile ("lock; xaddl %0,%1" - : "=r"(old), "=m"(m_value) /* outputs */ - : "0"(x), "m"(m_value) /* inputs */ - : "memory", "cc"); - return old; - -# elif defined(G3D_OSX) - - int32 old = m_value; - OSAtomicAdd32(x, &m_value); - return old; - -# endif - } - - /** Returns old value. */ - int32 sub(const int32 x) { - return add(-x); - } - - void increment() { -# if defined(G3D_WIN32) - // Note: returns the newly incremented value - InterlockedIncrement(&m_value); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - add(1); -# elif defined(G3D_OSX) - // Note: returns the newly incremented value - OSAtomicIncrement32(&m_value); -# endif - } - - /** Returns zero if the result is zero after decrement, non-zero otherwise.*/ - int32 decrement() { -# if defined(G3D_WIN32) - // Note: returns the newly decremented value - return InterlockedDecrement(&m_value); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - unsigned char nz; - - asm volatile ("lock; decl %1;\n\t" - "setnz %%al" - : "=a" (nz) - : "m" (m_value) - : "memory", "cc"); - return nz; -# elif defined(G3D_OSX) - // Note: returns the newly decremented value - return OSAtomicDecrement32(&m_value); -# endif - } - - - /** Atomic test-and-set: if *this == comperand then *this := exchange else do nothing. - In both cases, returns the old value of *this. - - Performs an atomic comparison of this with the Comperand value. - If this is equal to the Comperand value, the Exchange value is stored in this. - Otherwise, no operation is performed. - - Under VC6 the sign bit may be lost. - */ - int32 compareAndSet(const int32 comperand, const int32 exchange) { -# if defined(G3D_WIN32) - return InterlockedCompareExchange(&m_value, exchange, comperand); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) || defined(G3D_OSX) - // Based on Apache Portable Runtime - // http://koders.com/c/fid3B6631EE94542CDBAA03E822CA780CBA1B024822.aspx - int32 ret; - asm volatile ("lock; cmpxchgl %1, %2" - : "=a" (ret) - : "r" (exchange), "m" (m_value), "0"(comperand) - : "memory", "cc"); - return ret; - - // Note that OSAtomicCompareAndSwap32 does not return a useful value for us - // so it can't satisfy the cmpxchgl contract. -# endif - } - -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/BinaryFormat.h b/dep/include/g3dlite/G3D/BinaryFormat.h deleted file mode 100644 index f6719a1c540..00000000000 --- a/dep/include/g3dlite/G3D/BinaryFormat.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - @file BinaryFormat.h - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @author 2005-06-03 - @edited 2005-06-03 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BINARYFORMAT_H -#define G3D_BINARYFORMAT_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -class Vector2; -class Vector2int16; -class Vector3; -class Vector3int16; -class Vector4; -class Vector4int16; -class Color3; -class Color3uint8; -class Color4; -class Color4uint8; - -/** - Some values like float16 and int128 have no current CPU data structure that implements them but are useful - for file formats and for GPUs. - - CHUNK_BINFMT data follows the protocol. - */ -// Must be packed int 16 bits for the chunk reader -// We can't name these just "INT8" etc. because some libraries #define names like that -enum BinaryFormat { - FIRST_BINFMT = 1000, - - BOOL8_BINFMT, - UINT8_BINFMT, INT8_BINFMT, UINT16_BINFMT, INT16_BINFMT, UINT32_BINFMT, INT32_BINFMT, UINT64_BINFMT, INT64_BINFMT, UINT128_BINFMT, INT128_BINFMT, - FLOAT16_BINFMT, FLOAT32_BINFMT, FLOAT64_BINFMT, - VECTOR2_BINFMT, VECTOR2INT16_BINFMT, - VECTOR3_BINFMT, VECTOR3INT16_BINFMT, - VECTOR4_BINFMT, VECTOR4INT16_BINFMT, - COLOR3_BINFMT, COLOR3UINT8_BINFMT, COLOR3INT16_BINFMT, - COLOR4_BINFMT, COLOR4UINT8_BINFMT, COLOR4INT16_BINFMT, - STRING_BINFMT, STRINGEVEN_BINFMT, STRING8_BINFMT, STRING16_BINFMT, STRING32_BINFMT, - - CHUNK_BINFMT, - - CUSTOM_BINFMT, - - LAST_BINFMT -}; - -} - -/** A macro that maps G3D types to format constants. - (e.g. binaryFormatOf(Vector3) == VECTOR3_BINFMT). -*/ -// This implementation is designed to meet the following constraints: -// 1. Work around the many MSVC++ partial template bugs -// 2. Work for primitive types (e.g. int) -#define binaryFormatOf(T) (G3D::_internal::_BinaryFormat::x()) - -namespace G3D { -namespace _internal { - - -template class _BinaryFormat { -public: - static BinaryFormat x() { - return CUSTOM_BINFMT; - } -}; -}} - - -/** - Macro to declare the underlying format (as will be returned by glFormatOf) - of a type. For example, - -
-    DECLARE_BINARYFORMATOF(Vector4, VECTOR4_BINFMT)
-  
- - Use this so you can make vertex arrays of your own classes and not just - the standard ones. - */ -#define DECLARE_BINARYFORMATOF(CType, EnumType) \ -namespace G3D { \ - namespace _internal { \ - template<> class _BinaryFormat { \ - public: \ - static BinaryFormat x() { \ - return EnumType; \ - } \ - }; \ - } \ -} - -DECLARE_BINARYFORMATOF( bool, BOOL8_BINFMT ) - -DECLARE_BINARYFORMATOF( uint8, UINT8_BINFMT ) -DECLARE_BINARYFORMATOF( int8, INT8_BINFMT ) -DECLARE_BINARYFORMATOF( uint16, UINT16_BINFMT ) -DECLARE_BINARYFORMATOF( int16, INT16_BINFMT ) -DECLARE_BINARYFORMATOF( uint32, UINT32_BINFMT ) -DECLARE_BINARYFORMATOF( int32, INT32_BINFMT ) -DECLARE_BINARYFORMATOF( uint64, UINT64_BINFMT ) -DECLARE_BINARYFORMATOF( int64, INT64_BINFMT ) - -DECLARE_BINARYFORMATOF( float32, FLOAT32_BINFMT ) -DECLARE_BINARYFORMATOF( float64, FLOAT64_BINFMT ) - -DECLARE_BINARYFORMATOF( Vector2, VECTOR2_BINFMT ) -DECLARE_BINARYFORMATOF( Vector2int16, VECTOR2INT16_BINFMT ) -DECLARE_BINARYFORMATOF( Vector3, VECTOR3_BINFMT ) -DECLARE_BINARYFORMATOF( Vector3int16, VECTOR3INT16_BINFMT ) -DECLARE_BINARYFORMATOF( Vector4, VECTOR4_BINFMT ) -DECLARE_BINARYFORMATOF( Vector4int16, VECTOR4INT16_BINFMT ) - -DECLARE_BINARYFORMATOF( Color3, COLOR3_BINFMT ) -DECLARE_BINARYFORMATOF( Color3uint8, COLOR3UINT8_BINFMT ) -DECLARE_BINARYFORMATOF( Color4, COLOR4_BINFMT ) -DECLARE_BINARYFORMATOF( Color4uint8, COLOR4UINT8_BINFMT ) - -namespace G3D { - -/** Returns -1 if the format is custom, otherwise the byte size - of a single element in this format.*/ -int32 byteSize(BinaryFormat f); - - -} //G3D - -#endif diff --git a/dep/include/g3dlite/G3D/BinaryInput.h b/dep/include/g3dlite/G3D/BinaryInput.h deleted file mode 100644 index 1dac93ea55e..00000000000 --- a/dep/include/g3dlite/G3D/BinaryInput.h +++ /dev/null @@ -1,441 +0,0 @@ -/** - @file BinaryInput.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-08-09 - @edited 2006-07-19 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BinaryInput_h -#define G3D_BinaryInput_h - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning(push) -# pragma warning( disable : 4127 ) -#endif - -#include -#include -#include -#include -#include -#include -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Color4.h" -#include "G3D/Color3.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/g3dmath.h" -#include "G3D/debug.h" -#include "G3D/System.h" - - -namespace G3D { - -#if defined(G3D_WIN32) || defined(G3D_LINUX) - // Allow writing of integers to non-word aligned locations. - // This is legal on x86, but not on other platforms. - #define G3D_ALLOW_UNALIGNED_WRITES -#endif - -/** - Sequential or random access byte-order independent binary file access. - Files compressed with zlib and beginning with an unsigned 32-bit int - size are transparently decompressed when the compressed = true flag is - specified to the constructor. - - For every readX method there are also versions that operate on a whole - Array, std::vector, or C-array. e.g. readFloat32(Array& array, n) - These methods resize the array or std::vector to the appropriate size - before reading. For a C-array, they require the pointer to reference - a memory block at least large enough to hold n elements. - - Most classes define serialize/deserialize methods that use BinaryInput, - BinaryOutput, TextInput, and TextOutput. There are text serializer - functions for primitive types (e.g. int, std::string, float, double) but not - binary serializers-- you must call the BinaryInput::readInt32 or - other appropriate function. This is because it would be very hard to - debug the error sequence: serialize(1.0, bo); ... float f; deserialize(f, bi); - in which a double is serialized and then deserialized as a float. - */ -class BinaryInput { -private: - - // The initial buffer will be no larger than this, but - // may grow if a large memory read occurs. 50 MB - enum {INITIAL_BUFFER_LENGTH = 50000000}; - - /** - is the file big or little endian - */ - G3DEndian m_fileEndian; - std::string m_filename; - - bool m_swapBytes; - - /** Next position to read from in bitString during readBits. */ - int m_bitPos; - - /** Bits currently being read by readBits. - Contains at most 8 (low) bits. Note that - beginBits/readBits actually consumes one extra byte, which - will be restored by writeBits.*/ - uint32 m_bitString; - - /** 1 when between beginBits and endBits, 0 otherwise. */ - int m_beginEndBits; - - /** When operating on huge files, we cannot load the whole file into memory. - This is the file position to which buffer[0] corresponds. - */ - int64 m_alreadyRead; - - /** - Length of the entire file, in bytes. - For the length of the buffer, see bufferLength - */ - int64 m_length; - - /** Length of the array referenced by buffer. May go past the end of the file!*/ - int64 m_bufferLength; - uint8* m_buffer; - - /** - Next byte in file, relative to buffer. - */ - int64 m_pos; - - /** - When true, the buffer is freed in the destructor. - */ - bool m_freeBuffer; - - /** Ensures that we are able to read at least minLength from startPosition (relative - to start of file). */ - void loadIntoMemory(int64 startPosition, int64 minLength = 0); - - /** Verifies that at least this number of bytes can be read.*/ - inline void prepareToRead(int64 nbytes) { - debugAssertM(m_length > 0, m_filename + " not found or corrupt."); - debugAssertM(m_pos + nbytes + m_alreadyRead <= m_length, "Read past end of file."); - - if (m_pos + nbytes > m_bufferLength) { - loadIntoMemory(m_pos + m_alreadyRead, nbytes); - } - } - - // Not implemented on purpose, don't use - BinaryInput(const BinaryInput&); - BinaryInput& operator=(const BinaryInput&); - bool operator==(const BinaryInput&); - - /** Buffer is compressed; replace it with a decompressed version */ - void decompress(); -public: - - /** false, constant to use with the copyMemory option */ - static const bool NO_COPY; - - /** - If the file cannot be opened, a zero length buffer is presented. - Automatically opens files that are inside zipfiles. - - @param compressed Set to true if and only if the file was - compressed using BinaryOutput's zlib compression. This has - nothing to do with whether the input is in a zipfile. - */ - BinaryInput( - const std::string& filename, - G3DEndian fileEndian, - bool compressed = false); - - /** - Creates input stream from an in memory source. - Unless you specify copyMemory = false, the data is copied - from the pointer, so you may deallocate it as soon as the - object is constructed. It is an error to specify copyMemory = false - and compressed = true. - - To decompress part of a file, you can follow the following paradigm: - -
-        BinaryInput master(...);
-
-        // read from master to point where compressed data exists.
-
-        BinaryInput subset(master.getCArray() + master.getPosition(), 
-                           master.length() - master.getPosition(),
-                           master.endian(), true, true);
-
-        // Now read from subset (it is ok for master to go out of scope)
-     
- */ - BinaryInput( - const uint8* data, - int64 dataLen, - G3DEndian dataEndian, - bool compressed = false, - bool copyMemory = true); - - virtual ~BinaryInput(); - - /** Change the endian-ness of the file. This only changes the - interpretation of the file for future read calls; the - underlying data is unmodified.*/ - void setEndian(G3DEndian endian); - - G3DEndian endian() const { - return m_fileEndian; - } - - std::string getFilename() const { - return m_filename; - } - - /** - Returns a pointer to the internal memory buffer. - May throw an exception for huge files. - */ - const uint8* getCArray() const { - if (m_alreadyRead > 0) { - throw "Cannot getCArray for a huge file"; - } - return m_buffer; - } - - /** - Performs bounds checks in debug mode. [] are relative to - the start of the file, not the current position. - Seeks to the new position before reading (and leaves - that as the current position) - */ - inline uint8 operator[](int64 n) { - setPosition(n); - return readUInt8(); - } - - /** - Returns the length of the file in bytes. - */ - inline int64 getLength() const { - return m_length; - } - - inline int64 size() const { - return getLength(); - } - - /** - Returns the current byte position in the file, - where 0 is the beginning and getLength() - 1 is the end. - */ - inline int64 getPosition() const { - return m_pos + m_alreadyRead; - } - - /** - Sets the position. Cannot set past length. - May throw a char* when seeking backwards more than 10 MB on a huge file. - */ - inline void setPosition(int64 p) { - debugAssertM(p <= m_length, "Read past end of file"); - m_pos = p - m_alreadyRead; - if ((m_pos < 0) || (m_pos > m_bufferLength)) { - loadIntoMemory(m_pos + m_alreadyRead); - } - } - - /** - Goes back to the beginning of the file. - */ - inline void reset() { - setPosition(0); - } - - inline int8 readInt8() { - prepareToRead(1); - return m_buffer[m_pos++]; - } - - inline bool readBool8() { - return (readInt8() != 0); - } - - inline uint8 readUInt8() { - prepareToRead(1); - return ((uint8*)m_buffer)[m_pos++]; - } - - uint16 inline readUInt16() { - prepareToRead(2); - - m_pos += 2; - if (m_swapBytes) { - uint8 out[2]; - out[0] = m_buffer[m_pos - 1]; - out[1] = m_buffer[m_pos - 2]; - return *(uint16*)out; - } else { - #ifdef G3D_ALLOW_UNALIGNED_WRITES - return *(uint16*)(&m_buffer[m_pos - 2]); - #else - uint8 out[2]; - out[0] = m_buffer[m_pos - 2]; - out[1] = m_buffer[m_pos - 1]; - return *(uint16*)out; - #endif - } - - } - - inline int16 readInt16() { - uint16 a = readUInt16(); - return *(int16*)&a; - } - - inline uint32 readUInt32() { - prepareToRead(4); - - m_pos += 4; - if (m_swapBytes) { - uint8 out[4]; - out[0] = m_buffer[m_pos - 1]; - out[1] = m_buffer[m_pos - 2]; - out[2] = m_buffer[m_pos - 3]; - out[3] = m_buffer[m_pos - 4]; - return *(uint32*)out; - } else { - #ifdef G3D_ALLOW_UNALIGNED_WRITES - return *(uint32*)(&m_buffer[m_pos - 4]); - #else - uint8 out[4]; - out[0] = m_buffer[m_pos - 4]; - out[1] = m_buffer[m_pos - 3]; - out[2] = m_buffer[m_pos - 2]; - out[3] = m_buffer[m_pos - 1]; - return *(uint32*)out; - #endif - } - } - - - inline int32 readInt32() { - uint32 a = readUInt32(); - return *(int32*)&a; - } - - uint64 readUInt64(); - - inline int64 readInt64() { - uint64 a = readUInt64(); - return *(int64*)&a; - } - - inline float32 readFloat32() { - union { - uint32 a; - float32 b; - }; - a = readUInt32(); - return b; - } - - inline float64 readFloat64() { - union { - uint64 a; - float64 b; - }; - a = readUInt64(); - return b; - } - - void readBytes(void* bytes, int64 n); - - /** - Reads an n character string. The string is not - required to end in NULL in the file but will - always be a proper std::string when returned. - */ - std::string readString(int64 n); - - /** - Reads until NULL or the end of the file is encountered. - */ - std::string readString(); - - /** - Reads until NULL or the end of the file is encountered. - If the string has odd length (including NULL), reads - another byte. - */ - std::string readStringEven(); - - - std::string readString32(); - - Vector4 readVector4(); - Vector3 readVector3(); - Vector2 readVector2(); - - Color4 readColor4(); - Color3 readColor3(); - - /** - Skips ahead n bytes. - */ - inline void skip(int64 n) { - setPosition(m_pos + m_alreadyRead + n); - } - - /** - Returns true if the position is not at the end of the file - */ - inline bool hasMore() const { - return m_pos + m_alreadyRead < m_length; - } - - /** Prepares for bit reading via readBits. Only readBits can be - called between beginBits and endBits without corrupting the - data stream. */ - void beginBits(); - - /** Can only be called between beginBits and endBits */ - uint32 readBits(int numBits); - - /** Ends bit-reading. */ - void endBits(); - -# define DECLARE_READER(ucase, lcase)\ - void read##ucase(lcase* out, int64 n);\ - void read##ucase(std::vector& out, int64 n);\ - void read##ucase(Array& out, int64 n); - - DECLARE_READER(Bool8, bool) - DECLARE_READER(UInt8, uint8) - DECLARE_READER(Int8, int8) - DECLARE_READER(UInt16, uint16) - DECLARE_READER(Int16, int16) - DECLARE_READER(UInt32, uint32) - DECLARE_READER(Int32, int32) - DECLARE_READER(UInt64, uint64) - DECLARE_READER(Int64, int64) - DECLARE_READER(Float32, float32) - DECLARE_READER(Float64, float64) -# undef DECLARE_READER -}; - - -} - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/BinaryOutput.h b/dep/include/g3dlite/G3D/BinaryOutput.h deleted file mode 100644 index d81ec56a67b..00000000000 --- a/dep/include/g3dlite/G3D/BinaryOutput.h +++ /dev/null @@ -1,421 +0,0 @@ -/** - @file BinaryOutput.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-08-09 - @edited 2008-01-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BINARYOUTPUT_H -#define G3D_BINARYOUTPUT_H - -#include "G3D/platform.h" -#include -#include -#include -#include -#include -#include "G3D/Color4.h" -#include "G3D/Color3.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/g3dmath.h" -#include "G3D/debug.h" -#include "G3D/BinaryInput.h" -#include "G3D/System.h" - -#ifdef _MSC_VER -# pragma warning (push) -// Conditional is constant (wrong in inline) -# pragma warning (disable : 4127) -#endif -namespace G3D { - -/** - Sequential or random access byte-order independent binary file access. - - The compress() call can be used to compress with zlib. - - Any method call can trigger an out of memory error (thrown as char*) - when writing to "" instead of a file. - - Compressed writing and seeking backwards is not supported for huge files - (i.e., BinaryOutput may have to dump the contents to disk if they - exceed available RAM). - */ -class BinaryOutput { -private: - std::string m_filename; - - bool m_committed; - - /** 0 outside of beginBits...endBits, 1 inside */ - int m_beginEndBits; - - /** The current string of bits being built up by beginBits...endBits. - This string is treated semantically, as if the lowest bit was - on the left and the highest was on the right.*/ - int8 m_bitString; - - /** Position (from the lowest bit) currently used in bitString.*/ - int m_bitPos; - - // True if the file endianess does not match the machine endian - bool m_swapBytes; - - G3DEndian m_fileEndian; - - uint8* m_buffer; - - /** Size of the elements used */ - int m_bufferLen; - - /** Underlying size of memory allocaded */ - int m_maxBufferLen; - - /** Next byte in file */ - int m_pos; - - /** is this initialized? */ - bool m_init; - - /** Number of bytes already written to the file.*/ - size_t m_alreadyWritten; - - bool m_ok; - - void reserveBytesWhenOutOfMemory(size_t bytes); - - void reallocBuffer(size_t bytes, size_t oldBufferLen); - - /** - Make sure at least bytes can be written, resizing if - necessary. - */ - inline void reserveBytes(int bytes) { - debugAssert(bytes > 0); - size_t oldBufferLen = (size_t)m_bufferLen; - - m_bufferLen = iMax(m_bufferLen, (m_pos + bytes)); - if (m_bufferLen > m_maxBufferLen) { - reallocBuffer(bytes, oldBufferLen); - } - } - - // Not implemented on purpose, don't use - BinaryOutput(const BinaryOutput&); - BinaryOutput& operator=(const BinaryOutput&); - bool operator==(const BinaryOutput&); - -public: - - /** - You must call setEndian() if you use this (memory) constructor. - */ - BinaryOutput(); - - /** - Doesn't actually open the file; commit() does that. - Use "" as the filename if you're going to commit - to memory. - */ - BinaryOutput( - const std::string& filename, - G3DEndian fileEndian); - - ~BinaryOutput(); - - /** Compresses the data in the buffer in place, - preceeding it with a little-endian uint32 indicating - the uncompressed size. - - Call immediately before commit(). - - Cannot be used for huge files (ones where the data - was already written to disk)-- will throw char*. - */ - void compress(); - - /** True if no errors have been encountered.*/ - bool ok() const; - - /** - Returns a pointer to the internal memory buffer. - */ - inline const uint8* getCArray() const { - return m_buffer; - } - - void setEndian(G3DEndian fileEndian); - - G3DEndian endian() const { - return m_fileEndian; - } - - std::string getFilename() const { - return m_filename; - } - - /** - Write the bytes to disk. It is ok to call this - multiple times; it will just overwrite the previous file. - - Parent directories are created as needed if they do - not exist. - - Not called from the destructor; you must call - it yourself. - - @param flush If true (default) the file is ready for reading when the method returns, otherwise - the method returns immediately and writes the file in the background. - */ - void commit(bool flush = true); - - /** - Write the bytes to memory (which must be of - at least size() bytes). - */ - void commit(uint8*); - - /** - A memory BinaryOutput may be reset so that it can be written to again - without allocating new memory. The underlying array will not be deallocated, - but the reset structure will act like a newly intialized one. - */ - void reset(); - - - inline int length() const { - return (int)m_bufferLen + (int)m_alreadyWritten; - } - - inline int size() const { - return length(); - } - - /** - Sets the length of the file to n, padding - with 0's past the current end. Does not - change the position of the next byte to be - written unless n < size(). - - Throws char* when resetting a huge file to be shorter - than its current length. - */ - inline void setLength(int n) { - n = n - (int)m_alreadyWritten; - - if (n < 0) { - throw "Cannot resize huge files to be shorter."; - } - - if (n < m_bufferLen) { - m_pos = n; - } - if (n > m_bufferLen) { - reserveBytes(n - m_bufferLen); - } - } - - /** - Returns the current byte position in the file, - where 0 is the beginning and getLength() - 1 is the end. - */ - inline int64 position() const { - return (int64)m_pos + (int64)m_alreadyWritten; - } - - - /** - Sets the position. Can set past length, in which case - the file is padded with zeros up to one byte before the - next to be written. - - May throw a char* exception when seeking backwards on a huge file. - */ - inline void setPosition(int64 p) { - p = p - (int64)m_alreadyWritten; - - if (p > m_bufferLen) { - setLength((int)(p + (int64)m_alreadyWritten)); - } - - if (p < 0) { - throw "Cannot seek more than 10 MB backwards on huge files."; - } - - m_pos = (int)p; - } - - - void writeBytes( - const void* b, - int count) { - - reserveBytes(count); - debugAssert(m_pos >= 0); - debugAssert(m_bufferLen >= count); - System::memcpy(m_buffer + m_pos, b, count); - m_pos += count; - } - - /** - Writes a signed 8-bit integer to the current position. - */ - inline void writeInt8(int8 i) { - reserveBytes(1); - m_buffer[m_pos] = *(uint8*)&i; - m_pos++; - } - - inline void writeBool8(bool b) { - writeInt8(b ? 1 : 0); - } - - inline void writeUInt8(uint8 i) { - reserveBytes(1); - m_buffer[m_pos] = i; - m_pos++; - } - - void writeUInt16(uint16 u); - - inline void writeInt16(int16 i) { - writeUInt16(*(uint16*)&i); - } - - void writeUInt32(uint32 u); - - inline void writeInt32(int32 i) { - debugAssert(m_beginEndBits == 0); - writeUInt32(*(uint32*)&i); - } - - void writeUInt64(uint64 u); - - inline void writeInt64(int64 i) { - writeUInt64(*(uint64*)&i); - } - - inline void writeFloat32(float32 f) { - debugAssert(m_beginEndBits == 0); - union { - float32 a; - uint32 b; - }; - a = f; - writeUInt32(b); - } - - inline void writeFloat64(float64 f) { - union { - float64 a; - uint64 b; - }; - a = f; - writeUInt64(b); - } - - /** - Write a string with NULL termination. - */ - inline void writeString(const std::string& s) { - writeString(s.c_str()); - } - - void writeString(const char* s); - - /** - Write a string, ensuring that the total length - including NULL is even. - */ - void writeStringEven(const std::string& s) { - writeStringEven(s.c_str()); - } - - void writeStringEven(const char* s); - - - void writeString32(const char* s); - - /** - Write a string with a 32-bit length field in front - of it. - */ - void writeString32(const std::string& s) { - writeString32(s.c_str()); - } - - void writeVector4(const Vector4& v); - - void writeVector3(const Vector3& v); - - void writeVector2(const Vector2& v); - - void writeColor4(const Color4& v); - - void writeColor3(const Color3& v); - - /** - Skips ahead n bytes. - */ - inline void skip(int n) { - if (m_pos + n > m_bufferLen) { - setLength((int)m_pos + (int)m_alreadyWritten + n); - } - m_pos += n; - } - - /** Call before a series of BinaryOutput::writeBits calls. Only writeBits - can be called between beginBits and endBits without corrupting the stream.*/ - void beginBits(); - - /** Write numBits from bitString to the output stream. Bits are numbered from - low to high. - - Can only be - called between beginBits and endBits. Bits written are semantically - little-endian, regardless of the actual endian-ness of the system. That is, - writeBits(0xABCD, 16) writes 0xCD to the first byte and - 0xAB to the second byte. However, if used with BinaryInput::readBits, the ordering - is transparent to the caller. - */ - void writeBits(uint32 bitString, int numBits); - - /** Call after a series of BinaryOutput::writeBits calls. This will - finish out with zeros the last byte into which bits were written.*/ - void endBits(); - - -# define DECLARE_WRITER(ucase, lcase)\ - void write##ucase(const lcase* out, int n);\ - void write##ucase(const std::vector& out, int n);\ - void write##ucase(const Array& out, int n); - - DECLARE_WRITER(Bool8, bool) - DECLARE_WRITER(UInt8, uint8) - DECLARE_WRITER(Int8, int8) - DECLARE_WRITER(UInt16, uint16) - DECLARE_WRITER(Int16, int16) - DECLARE_WRITER(UInt32, uint32) - DECLARE_WRITER(Int32, int32) - DECLARE_WRITER(UInt64, uint64) - DECLARE_WRITER(Int64, int64) - DECLARE_WRITER(Float32, float32) - DECLARE_WRITER(Float64, float64) -# undef DECLARE_WRITER - -}; - -} - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/BoundsTrait.h b/dep/include/g3dlite/G3D/BoundsTrait.h deleted file mode 100644 index 15e1418010c..00000000000 --- a/dep/include/g3dlite/G3D/BoundsTrait.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - @file BoundsTrait.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2008-10-01 - @edited 2008-10-01 - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BOUNDSTRAIT_H -#define G3D_BOUNDSTRAIT_H - -#include "G3D/platform.h" - -template -struct BoundsTrait{}; - -#endif - diff --git a/dep/include/g3dlite/G3D/Box.h b/dep/include/g3dlite/G3D/Box.h deleted file mode 100644 index 82af9125b05..00000000000 --- a/dep/include/g3dlite/G3D/Box.h +++ /dev/null @@ -1,195 +0,0 @@ -/** - @file Box.h - - Box class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - @created 2001-06-02 - @edited 2007-06-05 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BOX_H -#define G3D_BOX_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Array.h" -#include "G3D/Plane.h" - -namespace G3D { - -class CoordinateFrame; - -/** - An arbitrary 3D box, useful as a bounding box. - - - To construct a box from a coordinate frame, center and extent, use the idiom: - - Box box = cframe.toObjectSpace(Box(center - extent/2, center + extent/2)); - */ -class Box { -private: - - static int32 dummy; - - friend class CoordinateFrame; - - /** -
-       3    2       7    6
-    
-       0    1       4    5
-
-       front    back (seen through front)
-      
- */ - Vector3 _corner[8]; - - /** - Unit axes. - */ - Vector3 _axis[3]; - - Vector3 _center; - - /** - Extent along each axis. - */ - Vector3 _extent; - - float _area; - float _volume; - - void init( - const Vector3& min, - const Vector3& max); - -public: - - /** - Does not initialize the fields. - */ - Box(); - - /** - Constructs a box from two opposite corners. - */ - Box( - const Vector3& min, - const Vector3& max); - - static Box inf(); - - Box(class BinaryInput& b); - - Box(const class AABox& b); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** - Returns the object to world transformation for - this box. localFrame().worldToObject(...) takes - objects into the space where the box axes are - (1,0,0), (0,1,0), (0,0,1). Note that there - is no scaling in this transformation. - */ - CoordinateFrame localFrame() const; - - void getLocalFrame(CoordinateFrame& frame) const; - - /** - Returns the centroid of the box. - */ - inline Vector3 center() const { - return _center; - } - - - inline Vector3 corner(int i) const { - debugAssert(i < 8); - return _corner[i]; - } - - /** - Unit length. - */ - inline Vector3 axis(int a) const { - debugAssert(a < 3); - return _axis[a]; - } - - /** - Distance from corner(0) to the next corner - along the box's local axis a. - */ - inline float extent(int a) const { - debugAssert(a < 3); - return (float)_extent[a]; - } - - inline Vector3 extent() const { - return _extent; - } - - /** - Returns the four corners of a face (0 <= f < 6). - The corners are returned to form a counter clockwise quad facing outwards. - */ - void getFaceCorners( - int f, - Vector3& v0, - Vector3& v1, - Vector3& v2, - Vector3& v3) const; - - - /** - See AABox::culledBy - */ - bool culledBy - ( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy - ( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = -1) const; - - bool contains( - const Vector3& point) const; - - float area() const; - - float volume() const; - - void getRandomSurfacePoint(Vector3& P, Vector3& N = Vector3::ignore()) const; - - /** - Uniformly distributed on the interior (includes surface) - */ - Vector3 randomInteriorPoint() const; - - void getBounds(class AABox&) const; - - bool isFinite() const { - return G3D::isFinite(_volume); - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Box2D.h b/dep/include/g3dlite/G3D/Box2D.h deleted file mode 100644 index 80accad89dd..00000000000 --- a/dep/include/g3dlite/G3D/Box2D.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - @file Box2D.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2008-12-27 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Box2D_h -#define G3D_Box2D_h - -#include "G3D/platform.h" -#include "G3D/Vector2.h" - -namespace G3D { - -class CoordinateFrame; -typedef class CoordinateFrame CFrame; -class Rect2D; -typedef class Rect2D AABox2D; - -/** - 2D oriented box - @cite http://www.flipcode.com/archives/2D_OBB_Intersection.shtml - */ -class Box2D { -private: - /** Corners of the box, where 0 is the lower left. */ - Vector2 m_corner[4]; - - /** Two edges of the box extended away from corner[0], with length - = 1 / extentSquared */ - Vector2 m_axisin[2]; - - /** Two edges of the box extended away from corner[0], with unit length */ - Vector2 m_axis[2]; - - /** Centroid of the box */ - Vector2 m_center; - - /** origin[a] = m_corner[0].dot(m_axisin[a]); */ - float origin[2]; - - /** Surface area */ - float m_area; - - Vector2 m_extent; - - /** Returns true if other overlaps one dimension of this. */ - bool overlaps1Way(const Box2D& other) const; - - - /** Updates the axes after the m_corners move. Assumes the - m_corners actually form a rectangle. */ - void computeAxes(); - -public: - - /** - @param center World-space center - @param w Width along object-space x-axis - @param h Height along object-space y-axis - @param angle Counter-clockwise angle from object-space x-axis in radians - */ - Box2D(const Vector2& center = Vector2(0, 0), float w = 0, float h = 0, float angle = 0); - - Box2D(const AABox2D& b); - - Box2D(const Vector2& min, const Vector2& max); - - /** Transform @a b by @a frame, discarding the Z components, and - compute the new box.*/ - Box2D(const CFrame& frame, Box2D& b); - - inline bool contains(const Vector2& v) const { - // Take to object space: - const Vector2& p = v - m_center; - float x = p.dot(m_axisin[0]); - float y = p.dot(m_axisin[1]); - - // Must be within extent/2 on both axes in object space - return (abs(x) <= 0.5f) && (abs(y) <= 0.5f); - } - - /** @brief Distance from corner(0) to the next corner along the box's local axis a. */ - inline const Vector2& extent() const { - return m_extent; - } - - /** @brief Unit length vector along axis @a a */ - inline const Vector2& axis(int a) const { - debugAssert(a == 0 || a == 1); - return m_axis[a]; - } - - /** @brief Surface area */ - inline float area() const { - return m_area; - } - - inline const Vector2& corner(int i) const { - debugAssert(i >=0 && i <= 3); - return m_corner[i]; - } - - inline const Vector2& center() const { - return m_center; - } - - /** Returns true if the intersection of the boxes is non-empty. */ - inline bool overlaps(const Box2D& other) const { - return overlaps1Way(other) && other.overlaps1Way(*this); - } -}; - -} // G3D -#endif diff --git a/dep/include/g3dlite/G3D/BumpMapPreprocess.h b/dep/include/g3dlite/G3D/BumpMapPreprocess.h deleted file mode 100644 index 955f99e61b2..00000000000 --- a/dep/include/g3dlite/G3D/BumpMapPreprocess.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - \file BumpMapPreprocess.h - - \maintainer Morgan McGuire, http://graphics.cs.williams.edu - - \created 2010-01-28 - \edited 2010-01-28 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BumpMapPreprocess_h -#define G3D_BumpMapPreprocess_h - -#include "G3D/platform.h" - -namespace G3D { -class Any; - -/** -Not in the BumpMap class to avoid a circular dependency between Texture and BumpMap. -G3D::GImage::computeNormalMap(). -*/ -class BumpMapPreprocess { -public: - - /** If true, the elevations are box filtered after computing normals - and before uploading, which produces better results for parallax offset mapping - Defaults to false. */ - bool lowPassFilter; - - /** Height of the maximum ("white") value, in pixels, for the purpose of computing normals. - A value of 255 means that a 255 x 255 bump image with a full black-to-white gradient - will produce a 45-degree ramp (this also results in "cubic" voxels). - A negative value means to set zExtentPixels to -zExtentPixels * max(width, height). - The default is -0.02. - */ - float zExtentPixels; - - /** After computing normals, scale the height by |N.z|, a trick that reduces texture swim in steep areas for parallax offset - mapping. Defaults to false.*/ - bool scaleZByNz; - - BumpMapPreprocess() : lowPassFilter(false), zExtentPixels(-0.02f), scaleZByNz(false) {} - - BumpMapPreprocess(const Any& any); - - operator Any() const; - - bool operator==(const BumpMapPreprocess& other) const { - return - (lowPassFilter == other.lowPassFilter) && - (zExtentPixels == other.zExtentPixels) && - (scaleZByNz == other.scaleZByNz); - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Capsule.h b/dep/include/g3dlite/G3D/Capsule.h deleted file mode 100644 index baeea3aa82b..00000000000 --- a/dep/include/g3dlite/G3D/Capsule.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - @file Capsule.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-02-07 - @edited 2005-08-20 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CAPSULE_H -#define G3D_CAPSULE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Line; -class AABox; -/** - A shape formed by extruding a sphere along a line segment. - */ -class Capsule { -private: - Vector3 p1; - Vector3 p2; - - float _radius; -public: - - - /** Uninitialized */ - Capsule(); - Capsule(class BinaryInput& b); - Capsule(const Vector3& _p1, const Vector3& _p2, float _r); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** The line down the center of the capsule */ - Line axis() const; - - inline float radius() const { - return _radius; - } - - /** Argument may be 0 or 1 */ - inline Vector3 point(int i) const { - debugAssert(i == 0 || i == 1); - return (i == 0) ? p1 : p2; - } - - /** Distance between the sphere centers. The total extent of the cylinder is - 2r + h. */ - inline float height() const { - return (p1 - p2).magnitude(); - } - - inline Vector3 center() const { - return (p1 + p2) / 2.0; - } - - /** Get a reference frame in which the center of mass is the origin and Y is the axis of the capsule.*/ - void getReferenceFrame(class CoordinateFrame& cframe) const; - - /** - Returns true if the point is inside the capsule or on its surface. - */ - bool contains(const Vector3& p) const; - - float volume() const; - - float area() const; - - /** Get axis aligned bounding box */ - void getBounds(AABox& out) const; - - /** Random world space point with outward facing normal. */ - void getRandomSurfacePoint(Vector3& P, Vector3& N) const; - - /** Point selected uniformly at random over the volume. */ - Vector3 randomInteriorPoint() const; -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/CollisionDetection.h b/dep/include/g3dlite/G3D/CollisionDetection.h deleted file mode 100644 index c8fcf5534c2..00000000000 --- a/dep/include/g3dlite/G3D/CollisionDetection.h +++ /dev/null @@ -1,1205 +0,0 @@ -/** - @file CollisionDetection.h - - - Moving collision detection for simple primitives. - - @author Morgan McGuire, http://graphics.cs.williams.edu - @cite Spherical collision based on Paul Nettle's - ftp://ftp.3dmaileffects.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf - and comments by Max McGuire. Ray-sphere intersection by Eric Haines. - Box-Box intersection written by Kevin Egan. - Thanks to Max McGuire of Iron Lore for various bug fixes. - Box-Triangle by Tomas Akenine-Moller - - @created 2001-11-19 - @edited 2008-12-19 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLLISIONDETECTION_H -#define G3D_COLLISIONDETECTION_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/Box.h" -#include "G3D/Triangle.h" -#include "G3D/Array.h" -#include "G3D/Ray.h" -#include "G3D/Line.h" - -namespace G3D { - - -/** - Collision detection primitives and tools for building - higher order collision detection schemes. - - These routines provide moving and static collision detection. - Moving collision detection allows the calculation of collisions that - occur during a period of time -- as opposed to the intersection of - two static bodies. - - Moving collision detection routines detect collisions between - only static primitives and moving spheres or points. Since the - reference frame can be user defined, these functions can be used to - detect the collision between two moving bodies by subtracting - the velocity vector of one object from the velocity vector of the - sphere or point the detection is to occur with. This unified - velocity vector will act as if both objects are moving simultaneously. - - Collisions are detected for single-sided objects only. That is, - no collision is detected when leaving a primitive or passing - through a plane or triangle opposite the normal... except for the - point-sphere calculation or when otherwise noted. - - For a sphere, the collision location returned is the point in world - space where the surface of the sphere and the fixed object meet. - It is not the position of the center of the sphere at - the time of the collision. - - The collision normal returned is the surface normal to the fixed - object at the collision location. - -

- Static Collision Detection: (Neither object is moving) - - - - - - - - - - - - - - -
Vector3LineSegmentRay *LinePlaneTriangleSphereCylinderCapsuleAABoxBox
Vector3\link Vector3::operator== V3::==\endlink \link Vector3::fuzzyEq V3::fuzzy \endlink \link G3D::distance distance \endlink
LineSegment\link LineSegment::closestPoint LS::closestPoint\endlink \link LineSegment::distance LS::distance\endlink \link CollisionDetection::closestPointOnLineSegment CD\endlink
Ray *Ray::closestPoint Ray::distance
LineLine::closestPoint Line::distance\link CollisionDetection::closestPointsBetweenLineAndLine CD\endlink
Plane
Triangle
SphereSphere::contains\link CollisionDetection::collisionTimeForMovingPointFixedSphere CD \endlink, \link Ray::intersectionTime R::time\endlink
CylinderCylinder::contains
CapsuleCapsule::contains
AABoxAABox::contains\link CollisionDetection::fixedSolidBoxIntersectsFixedTriangle CD\endlink
BoxBox::contains(treat as Ray)\link CollisionDetection::collisionTimeForMovingPointFixedBox CD\endlink(treat as Ray)\link CollisionDetection::penetrationDepthForFixedBoxFixedPlane CD \endlink\link CollisionDetection::penetrationDepthForFixedBoxFixedPlane CD\endlink\link CollisionDetection::penetrationDepthForFixedSphereFixedBox CD\endlinkNone (use OPCODE)\link CollisionDetection::movingSpherePassesThroughFixedBox CD \endlink\link CollisionDetection::penetrationDepthForFixedBoxFixedBox CD\endlink\link CollisionDetection::penetrationDepthForFixedBoxFixedBox CD\endlink
- -

- Moving Collision Detection: - - * Note: Moving collision detection against certain primitives is equivalent to static collision - detection against a bigger primitive. Ray, Line Segment == ``moving Point''; Capsule ==``moving Sphere''; Plane == ``moving Line'' - - @deprecated Routines moving to the G3D::Intersect class in G3D 8.0 - */ -class CollisionDetection { -private: - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static Vector3 ignore; - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static bool ignoreBool; - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static Array ignoreArray; - - - // Static class! - CollisionDetection() {} - virtual ~CollisionDetection() {} - -public: - - /** - Converts an index [0, 15] to the corresponding separating axis. - Does not return normalized vector in the edge-edge case - (indices 6 through 15). - - @param separatingAxisIndex Separating axis. - @param box1 Box 1. - @param box2 Box 2. - - @return Axis that separates the two boxes. - */ - static Vector3 separatingAxisForSolidBoxSolidBox( - const int separatingAxisIndex, - const Box & box1, - const Box & box2); - - /** - Tests whether two boxes have axes that are parallel to - each other. If they are, axis1 and axis2 are set to be - the parallel axes for both box1 and box2 respectively. - - @param ca Dot products of each of the boxes axes - @param epsilon Fudge factor (small unit by which the dot - products may vary and still be considered - zero). - @param axis1 Parallel Axis 1. [Post Condition] - @param axis2 Parallel Axis 2. [Post Condition] - - @return true - If boxes have a parallel axis - @return false - otherwise. - */ - static bool parallelAxisForSolidBoxSolidBox( - const double* ca, - const double epsilon, - int & axis1, - int & axis2); - - /** - Calculates the projected distance between the two boxes along - the specified separating axis, negative distances correspond - to an overlap along that separating axis. The distance is not - divided by denominator dot(L, L), see - penetrationDepthForFixedSphereFixedBox() for more details - - @param separatingAxisIndex - @param a Box 1's bounding sphere vector - @param b Box 2's bounding sphere vector - @param D Vector between Box 1 and Box 2's center points - @param c Pointer to array of dot products of the axes of Box 1 - and Box 2. - @param ca Pointer to array of unsigned dot products of the axes - of Box 1 and Box 2. - @param ad Pointer to array of dot products of Box 1 axes and D. - @param bd Pointer to array of dot products of Box 2 axes and D. - - @return Projected distance between the two boxes along the - specified separating axis. - */ - static float projectedDistanceForSolidBoxSolidBox( - const int separatingAxisIndex, - const Vector3 & a, - const Vector3 & b, - const Vector3 & D, - const double* c, - const double* ca, - const double* ad, - const double* bd); - - - /** - Creates a set of standard information about two boxes in order to - solve for their collision. This information includes a vector to - the radius of the bounding sphere for each box, the vector between - each boxes' center and a series of dot products between differing - important vectors. These dot products include those between the axes - of both boxes (signed and unsigned values), and the dot products - between all the axes of box1 and the boxes' center vector and box2 - and the boxes' center vector. - - @pre The following space requirements must be met: - - c[] 9 elements - - ca[] 9 elements - - ad[] 3 elements - - bd[] 3 elements - - @cite dobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @note Links are out-dated. (Kept to preserve origin and authorship) - - @param box1 Box 1 - @param box2 Box 2 - @param a Box 1's bounding sphere vector - @param b Box 2's bounding sphere vector - @param D Vector between Box 1 and Box 2's center points - @param c Pointer to array of dot products of the axes of Box 1 - and Box 2. - @param ca Pointer to array of unsigned dot products of the axes - of Box 1 and Box 2. - @param ad Pointer to array of dot products of Box 1 axes and D. - @param bd Pointer to array of dot products of Box 2 axes and D. - */ - static void fillSolidBoxSolidBoxInfo( - const Box & box1, - const Box & box2, - Vector3 & a, - Vector3 & b, - Vector3 & D, - double* c, - double* ca, - double* ad, - double* bd); - - /** - Performs a simple bounding sphere check between two boxes to determine - whether these boxes could possibly intersect. This is a very - cheap operation (three dot products, two sqrts and a few others). If - it returns true, an intersection is possible, but not necessarily - guaranteed. - - @param a Vector from box A's center to an outer vertex - @param b Vector from box B's center to an outer vertex - @param D Distance between the centers of the two boxes - - @return true - if possible intersection - @return false - otherwise (This does not guarantee an intersection) - */ - static bool conservativeBoxBoxTest( - const Vector3 & a, - const Vector3 & b, - const Vector3 & D); - - /** - Determines whether two fixed solid boxes intersect. - - @note To speed up collision detection, the lastSeparatingAxis from - the previous time step can be passed in and that plane can be - checked first. If the separating axis was not saved, or if the - two boxes intersected then lastSeparatingAxis should equal -1. - - @cite Adobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @param box1 Box 1. - @param box2 Box 2. - @param lastSeparatingAxis Last separating axis. - (optimization - see note) - - @return true - Intersection. - @return false - otherwise. - */ - static bool fixedSolidBoxIntersectsFixedSolidBox( - const Box& box1, - const Box& box2, - const int lastSeparatingAxis = -1); - - /** - Calculates the closest points on two lines with each other. If the - lines are parallel then using the starting point, else calculate the - closest point on each line to the other. - - @note This is very similiar to calculating the intersection of two lines. - Logically then, the two points calculated would be identical if calculated - with inifinite precision, but with the finite precision of floating point - calculations, these values could (will) differ as the line slope approaches - zero or inifinity. - - @cite variables and algorithm based on derivation at the following website: - http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm - - @param line1 Line 1. - @param line2 Line 2. - @param closest1 Closest point on line 1. - @param closest2 Closest point on line 2. - */ - static void closestPointsBetweenLineAndLine( - const Line & line1, - const Line & line2, - Vector3 & closest1, - Vector3 & closest2); - - /** - Calculates the depth of penetration between two fixed boxes. - Contact normal faces away from box1 and into box2. If there is - contact, only one contact point is returned. The minimally - violated separating plane is computed - - if the separating axis corresponds to a face - the contact point is half way between the deepest vertex - and the face - - if the separating axis corresponds to two edges - the contact point is the midpoint of the smallest line - segment between the two edge lines - - @note This is very similiar to calculating the intersection of two lines. - Logically then, the two points calculated would be identical if calculated - with inifinite precision, but with the finite precision of floating point - calculations, these values could (will) differ as the line slope approaches - zero or inifinity. - - @cite adobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @param box1 Box 1 - @param box2 Box 2 - @param contactPoints Contact point between boxes. [Post Condition] - @param contactNormals Surface normal at contact point. [Post Condition] - @param lastSeparatingAxis Last separating axis. (Used for optimization) - - @return Depth of penetration between the two boxes. If there is no - intersection between the boxes, then a negative value is returned. - */ - static float penetrationDepthForFixedBoxFixedBox( - const Box& box1, - const Box& box2, - Array& contactPoints, - Array& contactNormals, - const int lastSeparatingAxis = -1); - - /** - Calculates the depth of penetration between two fixed spheres as well - as the deepest point of Sphere A that penetrates Sphere B. The normal - returned points away from the object A, although it may - represent a perpendicular to either the faces of object B or object A - depending on their relative orientations. - - @param sphereA Fixed Sphere A. - @param sphereB Fixed Sphere B. - @param contactPoints Sphere A's deepest point that penetrates Sphere B. - [Post Condition] - @param contactNormals Normal at penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedSphere( - const class Sphere& sphereA, - const Sphere& sphereB, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a fixed sphere and a fixed - box as well as the deepest point of the sphere that penetrates the box - and the normal at that intersection. - - @note There are three possible intersections between a sphere and box. - - Sphere completely contained in the box - - Sphere intersects one edge - - Sphere intersects one vertex - - The contact point and contact normal vary for each of these situations. - - Sphere contained in Box: - - Normal is based on side of least penetration (as is the depth calculation). - - Point is based on center of sphere - - Sphere intersects one edge - - Normal is based on vector from the box center to the point of depth. - - Point is closest point to the sphere on the line - - Sphere intersects one vertex - - Normal is based on vector from the box center to the vertex of penetration. - - Point is vertex of penetration. - - @cite Adapted from Jim Arvo's method in Graphics Gems - See also http://www.win.tue.nl/~gino/solid/gdc2001depth.pdf - - @param sphere Fixed Sphere. - @param box Fixed Box. - @param contactPoints Sphere point that penetrates the box. [Post Condition] - @param contactNormals Normal at the penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedBox( - const Sphere& sphere, - const Box& box, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a Fixed Sphere and a Fixed - Plane as well as the deepest point of the sphere that penetrates the plane - and the plane normal at that intersection. - - @param sphereA Fixed Sphere. - @param planeB Fixed Plane. - @param contactPoints Sphere point that penetrates the plane. - [Post Condition] - @param contactNormals Normal at penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedPlane( - const Sphere& sphereA, - const class Plane& planeB, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a fixed box and a fixed - plane as well as the vertexes of the box that penetrate the plane - and the plane normals at those intersections. - - @param box Fixed Box. - @param plane Fixed Plane. - @param contactPoints Box points that penetrate the plane. - [Post Condition] - @param contactNormals Normals at penetration points [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedBoxFixedPlane( - const Box& box, - const Plane& plane, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates time between the intersection of a moving point and a fixed - plane. - - @note This is only a one sided collision test. The side defined by - the plane's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param point Moving point. - @param velocity Point's velocity. - @param plane Fixed plane. - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param outNormal Plane's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedPlane( - const Vector3& point, - const Vector3& velocity, - const class Plane& plane, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2) { - return Ray::fromOriginAndDirection(orig, dir).intersectionTime(v0, v1, v2); - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - Vector3& location) { - float t = collisionTimeForMovingPointFixedTriangle(orig, dir, v0, v1, v2); - if (t < finf()) { - location = orig + dir * t; - } - return t; - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param tri Fixed triangle. - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param normal Triangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Triangle& tri, - Vector3& location = ignore, - Vector3& normal = ignore) { - - float t = collisionTimeForMovingPointFixedTriangle( - orig, dir, tri.vertex(0), tri.vertex(1), tri.vertex(2)); - - if ((t < finf()) && (&location != &ignore)) { - location = orig + dir * t; - normal = tri.normal(); - } - return t; - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param normal Triangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - Vector3& location, - Vector3& normal) { - float t = collisionTimeForMovingPointFixedTriangle(orig, dir, v0, v1, v2); - if (t < finf()) { - location = orig + dir * t; - normal = (v1 - v0).cross(v2 - v0).direction(); - } - return t; - } - - /** - If the ray origin is inside the box, returns inf() but inside - is set to true. - Beta API - - @cite Andrew Woo, from "Graphics Gems", Academic Press, 1990 - @cite Optimized code by Pierre Terdiman, 2000 (~20-30% faster on Celeron 500) - @cite Epsilon value added by Klaus Hartmann - @cite http://www.codercorner.com/RayAABB.cpp - */ - static float collisionTimeForMovingPointFixedAABox( - const Vector3& point, - const Vector3& velocity, - const class AABox& box, - Vector3& outLocation, - bool& inside = ignoreBool, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - Axis-Aligned Box (AABox). - - @note Avoids the sqrt from collisionTimeForMovingPointFixedAABox. - - @param point Moving point. - @param velocity Sphere's velocity. - @param box Fixed AAbox. - @param location Location of collision. [Post Condition] - @param Inside Does the ray originate inside the box? [Post Condition] - @param normal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static bool collisionLocationForMovingPointFixedAABox( - const Vector3& point, - const Vector3& velocity, - const class AABox& box, - Vector3& outLocation, - bool& inside = ignoreBool, - Vector3& normal = ignore); - - - /** - @brief Calculates intersection of a ray and a static - Axis-Aligned Box (AABox). - - @note Avoids the sqrt from collisionTimeForMovingPointFixedAABox; - early-out branches and operations optimized for Intel Core2 architecture. - - @param invDir 1/dir - @param location Location of collision. [Post Condition] - @param inside Does the ray originate inside the box? [Post Condition] - - @return True if the ray hits the box - */ - static bool __fastcall rayAABox( - const Ray& ray, - const Vector3& invDir, - const AABox& box, - const Vector3& boxCenter, - float boundingRadiusSquared, - Vector3& location, - bool& inside); - - /** - Calculates time between the intersection of a moving point and a fixed - sphere. - - @note When ray is starts inside the rectangle, the exiting intersection - is detected. - - @param point Moving point. - @param velocity Point's velocity. - @param sphere Fixed Sphere. - @param outLocation Location of collision. [Post Condition] - @param outNormal Sphere's surface normal to collision [Post Condition] - \param solid If true, rays inside the sphere immediately intersect (good for collision detection). If false, they hit the opposite side of the sphere (good for ray tracing). - - @return Time until collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedSphere( - const Vector3& point, - const Vector3& velocity, - const class Sphere& sphere, - Vector3& outLocation, - Vector3& outNormal = ignore, - bool solid = false); - - /** - Calculates time between the intersection of a moving point and a fixed - box. - - @note If the point is already inside the box, no collision: inf is returned. - - @param point Moving point. - @param velocity Sphere's velocity. - @param box Fixed box. - @param location Position of collision. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedBox( - const Vector3& point, - const Vector3& velocity, - const class Box& box, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - rectangle defined by the points v0, v1, v2, & v3. - - @note This is only a one sided collision test. The side defined by - the rectangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param point Moving point. - @param velocity Sphere's velocity. - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param location Location of collision [Post Condition] - @param outNormal Rectangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedRectangle( - const Vector3& point, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - capsule. - - @param point Moving point. - @param velocity Point's velocity. - @param capsule Fixed capsule. - @param outLocation Location of collision. [Post Condition] - @param outNormal Capsule's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedCapsule( - const Vector3& point, - const Vector3& velocity, - const class Capsule& capsule, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - triangle. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param plane Fixed Plane. - @param outLocation Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedPlane( - const class Sphere& sphere, - const Vector3& velocity, - const class Plane& plane, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - triangle. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param triangle Fixed Triangle. (collisions can happen on the back side of the triangle) - @param outLocation Location of collision, if collision occurs -- not center position of sphere - at the collision time. If there is interpenetration at the start, this point may be inside - the sphere. - @param b Barycentric coordinates. These are not valid unless collision occurs. - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedTriangle( - const class Sphere& sphere, - const Vector3& velocity, - const Triangle& triangle, - Vector3& outLocation, - float b[3] = (float*)&ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - rectangle defined by the points v0, v1, v2, & v3. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param outLocation Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedRectangle( - const class Sphere& sphere, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - box. - - @note This function will not detect an intersection between a moving object - that is already interpenetrating the fixed object. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param box Fixed box. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedBox( - const class Sphere& sphere, - const Vector3& velocity, - const class Box& box, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** Calculates time between the intersection of a moving sphere - and a fixed sphere. - - If they are already interpenetrating, returns 0 and @a - location is the closest point on the surface of the fixed sphere - to the center of the moving sphere. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param fixedSphere Fixed Sphere. - @param outLocation Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Moving sphere's surface normal to collision [Post Condition] - - @return Time until collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedSphere( - const Sphere& sphere, - const Vector3& velocity, - const Sphere& fixedSphere, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - capsule. - - @note This won't detect a collision if the sphere is already - interpenetrating the capsule. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param capsule Fixed capsule. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Capsule's surface normal to the collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedCapsule( - const class Sphere& sphere, - const Vector3& velocity, - const class Capsule& capsule, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Finds the direction of bounce that a sphere would have when it - intersects an object with the given time of collision, the - collision location and the collision normal. - - @note This function works like a pong style ball bounce. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param collisionTime Time of collision. - @param collisionLocation Collision location. - @param collisionNormal Surface collision normal. - - @return Direction of bounce. - */ - static Vector3 bounceDirection( - const class Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation, - const Vector3& collisionNormal); - - /** - Finds the direction of slide given a moving sphere, its velocity, the - time of collision and the collision location. This function works as - if the sphere intersects the surface and continues to hug it. - - @note The result will work well for calculating the movement of a player - who collides with an object and continues moving along the object instead - of just bouncing off it. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param collisionTime Time of collision - @param collisionLocation Collision location. - - @return Direction of slide. - */ - static Vector3 slideDirection( - const class Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation); - - /** - Finds the closest point on a line segment to a given point. - - @param v0 line vertex 1. - @param v1 line vertex 2. - @param point External point. - - @return Closests point to point on the line segment. - */ - static Vector3 closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& point); - - /** - Finds the closest point on a line segment to a given point. - - @note This is an optimization to closestPointOnLineSegment. Edge length - and direction can be used in this function if already pre-calculated. This - prevents doing the same work twice. - - @param v0 line vertex 0. - @param v1 line vertex 1. - @param edgeDirection The direction of the segment (unit length). - @param edgeLength The length of the segment. - @param point External point. - - @return Closests point to point on the line segment. - */ - static Vector3 closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& edgeDirection, - float edgeLength, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the triangle to an external point; - given a triangle defined by three points v0, v1, & v2, and the external point. - - @param v0 Triangle vertex 0. - @param v1 Triangle vertex 1. - @param v2 Triangle vertex 2. - @param point External point. - - @return Closests point to point on the perimeter of the - triangle. - */ - static Vector3 closestPointOnTrianglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the triangle to an external point; - given a triangle defined by the array of points v, its edge directions and - their lengths, as well as the external point. - - @note This is an optimization to closestPointToTrianglePerimeter. Edge length - and direction can be used in this function if already pre-calculated. This - prevents doing the same work twice. - - @param v Triangle vertices. - @param point External point. - @param edgeIndex The point lies on the edge between v[edgeIndex] and v[(edgeIndex + 1) % 3] - - @return Closest point to point on the perimeter of the - triangle. - */ - static Vector3 closestPointOnTrianglePerimeter( - const Vector3 v[3], - const Vector3 edgeDirection[3], - const float edgeLength[3], - const Vector3& point, - int& edgeIndex); - - /** - Tests whether a point is contained within the triangle defined by - v0, v1, and v2 and its plane's normal. - - @param v0 Triangle vertex 0. - @param v1 Triangle vertex 1. - @param v2 Triangle vertex 2. - @param normal Normal to triangle's plane. - @param point The point in question. - @param primaryAxis Primary axis of triangle. This will be detected - if not given. This parameter is provided as an optimization. - @param b Barycentric coordinates; b[i] is the weight on v[i] - - @return true - if point is inside the triangle. - @return false - otherwise - */ - static bool isPointInsideTriangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& normal, - const Vector3& point, - float b[3], - Vector3::Axis primaryAxis = Vector3::DETECT_AXIS); - - inline static bool isPointInsideTriangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& normal, - const Vector3& point, - Vector3::Axis primaryAxis = Vector3::DETECT_AXIS) { - - float b[3]; - return isPointInsideTriangle(v0, v1, v2, normal, point, b, primaryAxis); - } - - /** - Tests for the intersection of a moving sphere and a fixed box in a - given time limit. - - @note Returns true if any part of the sphere is inside the box - during the time period (inf means "ever"). Useful for - performing bounding-box collision detection. - - @param sphere Moving sphere. - @param velocity Velocity of moving sphere. - @param box Fixed box. - @param timeLimit Time limit for intersection test. - - @return true - if the two objects will touch. - @return false - if there is no intersection. - */ - static bool movingSpherePassesThroughFixedBox( - const Sphere& sphere, - const Vector3& velocity, - const Box& box, - double timeLimit = inf()); - - /** - Tests for the intersection of a moving sphere and a fixed sphere in a - given time limit. - - @note This function will not detect an intersection between a moving object - that is already interpenetrating the fixed object. - - @param sphere Moving sphere. - @param velocity Velocity of moving sphere. - @param fixedSphere Fixed sphere. - @param timeLimit Time limit for intersection test. - - @return true - if the two spheres will touch. - @return false - if there is no intersection. - */ - static bool movingSpherePassesThroughFixedSphere( - const Sphere& sphere, - const Vector3& velocity, - const Sphere& fixedSphere, - double timeLimit = inf()); - - /** - Tests for the intersection of two fixed spheres. - - @param sphere1 Fixed sphere 1. - @param sphere2 Fixed sphere 2. - - @return true - if the two spheres touch. - @return false - if there is no intersection. - */ - static bool fixedSolidSphereIntersectsFixedSolidSphere( - const Sphere& sphere1, - const Sphere& sphere2); - - /** - Tests for the intersection of a fixed sphere and a fixed box. - - @param sphere Fixed sphere. - @param box Fixed box. - - @return true - if the two objects touch. - @return false - if there is no intersection. - */ - static bool fixedSolidSphereIntersectsFixedSolidBox( - const Sphere& sphere, - const Box& box); - - static bool fixedSolidSphereIntersectsFixedTriangle( - const Sphere& sphere, - const Triangle& triangle); - - static bool fixedSolidBoxIntersectsFixedTriangle( - const AABox& box, - const Triangle& triangle); - - /** - Tests whether a point is inside a rectangle defined by the vertexes - v0, v1, v2, & v3, and the rectangle's plane normal. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3. - @param v3 Rectangle vertex 4. - @param normal Normal to rectangle's plane. - @param point The point in question. - - @return true - if point is inside the rectangle. - @return false - otherwise - */ - static bool isPointInsideRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& normal, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the rectangle to an - external point; given a rectangle defined by four points v0, v1, - v2, & v3, and the external point. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3. - @param v3 Rectangle vertex 4. - @param point External point. - - @return Closests point to point on the perimeter of the - rectangle. - */ - static Vector3 closestPointToRectanglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point); - - /** - Finds the closest point in the rectangle to an external point; Given - a rectangle defined by four points v0, v1, v2, & v3, and the external - point. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param point External point. - - @return Closet point in the rectangle to the external point. - */ - static Vector3 closestPointToRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point); -}; - -} // namespace - -#endif // G3D_COLLISIONDETECTION_H diff --git a/dep/include/g3dlite/G3D/Color1.h b/dep/include/g3dlite/G3D/Color1.h deleted file mode 100644 index 0f68c84b363..00000000000 --- a/dep/include/g3dlite/G3D/Color1.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - @file Color1.h - - Monochrome Color class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2007-01-31 - @edited 2009-03-20 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR1_H -#define G3D_COLOR1_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" -#include - -namespace G3D { - -/** - Monochrome color. This is just a float, but it has nice semantics - because a scaling by 255 automatically occurs when switching between - fixed point (Color1uint8) and floating point (Color1) formats. - */ -class Color1 { -private: - // Hidden operators - bool operator<(const Color1&) const; - bool operator>(const Color1&) const; - bool operator<=(const Color1&) const; - bool operator>=(const Color1&) const; - -public: - float value; - - /** - Initializes to 0 - */ - inline Color1() : value(0) {} - - Color1(class BinaryInput& bi); - - inline explicit Color1(float v) : value(v) { - } - - inline bool isZero() const { - return value == 0.0f; - } - - inline bool isOne() const { - return value == 1.0f; - } - - static const Color1& one(); - - static const Color1& zero(); - - /** Returns the value three times */ - class Color3 rgb() const; - - Color1 (const class Color1uint8& other); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - Color1 operator+ (const Color1& other) const { - return Color1(value + other.value); - } - - Color1 operator+ (const float other) const { - return Color1(value + other); - } - - Color1& operator+= (const Color1 other) { - value += other.value; - return *this; - } - - Color1& operator-= (const Color1 other) { - value -= other.value; - return *this; - } - - Color1 operator- (const Color1& other) const { - return Color1(value - other.value); - } - - Color1 operator- (const float other) const { - return Color1(value - other); - } - - Color1 operator- () const { - return Color1(-value); - } - - Color1 operator* (const Color1& other) const { - return Color1(value * other.value); - } - - Color1 operator* (const float other) const { - return Color1(value * other); - } - - Color1 operator/ (const Color1& other) const { - return Color1(value / other.value); - } - - Color1 operator/ (const float other) const { - return Color1(value / other); - } - - inline Color1 max(const Color1& other) const { - return Color1(G3D::max(value, other.value)); - } - - inline Color1 min(const Color1& other) const { - return Color1(G3D::min(value, other.value)); - } - - inline Color1 lerp(const Color1& other, float a) const { - return Color1(value + (other.value - value) * a); - - } - - inline size_t hashCode() const { - return (size_t)(value * 0xFFFFFF); - } -}; - -} - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Color1& key) { - return key.hashCode(); - } -}; - - -#endif diff --git a/dep/include/g3dlite/G3D/Color1uint8.h b/dep/include/g3dlite/G3D/Color1uint8.h deleted file mode 100644 index 092099d0d17..00000000000 --- a/dep/include/g3dlite/G3D/Color1uint8.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - @file Color1uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2007-01-30 - @edited 2007-01-30 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR1UINT8_H -#define G3D_COLOR1UINT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - Represents a Color1 as a packed integer. Convenient - for creating unsigned int vertex arrays. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color3(1,1,1) == Color3uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - - Note: - Conversion of a float32 to uint8 is accomplished by min(iFloor(f * 256)) and - back to float32 by u / 255.0f. This gives equal size intervals. -Consider a number line from 0 to 1 and a corresponding one from 0 to 255. If we use iRound(x * 255), then the mapping for three critical intervals are: - -

-let s = 0.5/255
-  float             int       size
-[0, s)           -> 0          s
-[s, s * 3)       -> 1         2*s
-(1 - s, 1]       -> 255        s
-
- -If we use max(floor(x * 256), 255), then we get: - -
-let s = 1/256
-  float             int           size
-[0, s)           -> 0               s
-[s, 2 * s)       -> 1               s
-(1 - s, 1]       -> 255             s
-
-and the intervals are all the same size, thus giving equal precision to all values. - */ -G3D_BEGIN_PACKED_CLASS(1) -class Color1uint8 { -private: - // Hidden operators - bool operator<(const Color1uint8&) const; - bool operator>(const Color1uint8&) const; - bool operator<=(const Color1uint8&) const; - bool operator>=(const Color1uint8&) const; - -public: - - uint8 value; - - Color1uint8() : value(0) {} - - explicit Color1uint8(const uint8 _v) : value(_v) {} - - Color1uint8(const class Color1& c); - - Color1uint8(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - inline bool operator==(const Color1uint8& other) const { - return value == other.value; - } - - inline bool operator!=(const Color1uint8& other) const { - return value != other.value; - } - -} -G3D_END_PACKED_CLASS(1) -} -#endif diff --git a/dep/include/g3dlite/G3D/Color3.h b/dep/include/g3dlite/G3D/Color3.h deleted file mode 100644 index bffe434fc27..00000000000 --- a/dep/include/g3dlite/G3D/Color3.h +++ /dev/null @@ -1,432 +0,0 @@ -/** - @file Color3.h - - Color class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite Portions based on Dave Eberly's Magic Software Library - at http://www.magic-software.com - - @created 2001-06-02 - @edited 2009-04-28 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Color3_h -#define G3D_Color3_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" -#include "G3D/Color1.h" -#include - -namespace G3D { -class Any; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Color3 { -private: - // Hidden operators - bool operator<(const Color3&) const; - bool operator>(const Color3&) const; - bool operator<=(const Color3&) const; - bool operator>=(const Color3&) const; - -public: - /** - Does not initialize fields. - */ - Color3(); - - /** \param any Must be in one of the following forms: - - Color3(#, #, #) - - Color3::fromARGB(#) - - Color3{r = #, g = #, b = #) - - Color3::one() - - Color3::zero() - */ - Color3(const Any& any); - - /** Converts the Color3 to an Any. */ - operator Any() const; - - explicit Color3(class BinaryInput& bi); - - Color3(float r, float g, float b); - Color3(float v) : r(v), g(v), b(v) {} - - explicit Color3(const class Vector3& v); - - explicit Color3(const float value[3]); - - /** Returns this color */ - const Color3& rgb() const { - return *this; - } - - /** - Initialize from another color. - */ - Color3 (const Color3& other); - - Color3 (const class Color3uint8& other); - - inline bool isZero() const { - return (r == 0.0f) && (g == 0.0f) && (b == 0.0f); - } - - inline bool isOne() const { - return (r == 1.0f) && (g == 1.0f) && (b == 1.0f); - } - - bool isFinite() const; - - /** - Initialize from an HTML-style color (e.g. 0xFF0000 == RED) - */ - static Color3 fromARGB(uint32); - - /** Returns one of the color wheel colors (e.g. RED, GREEN, CYAN). - Does not include white, black, or gray. */ - static const Color3& wheelRandom(); - - /** Generate colors according to the ANSI color set, mod 16. - \sa pastelMap */ - static Color3 ansiMap(uint32 i); - - /** - Generate colors using a hash such that adjacent values - are unlikely to have similar colors. - - Useful for rendering with - stable but arbitrary colors, e.g., when debugging a mesh - algorithm. - - \sa ansiMap - */ - static Color3 pastelMap(uint32 i); - - /** - * Channel value. - */ - float r, g, b; - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color3 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - const float& operator[] (int i) const; - float& operator[] (int i); - - // assignment and comparison - Color3& operator= (const Color3& rkVector); - bool operator== (const Color3& rkVector) const; - bool operator!= (const Color3& rkVector) const; - size_t hashCode() const; - - // arithmetic operations - Color3 operator+ (const Color3& rkVector) const; - Color3 operator- (const Color3& rkVector) const; - inline Color3 operator* (float s) const { - return Color3(r * s, g * s, b * s); - } - Color3 operator* (const Color3& rkVector) const; - inline Color3 operator/ (float fScalar) const { - return (*this) * (1.0f / fScalar); - } - Color3 operator- () const; - - // arithmetic updates - Color3& operator+= (const Color3& rkVector); - Color3& operator-= (const Color3& rkVector); - Color3& operator*= (const Color3& rkVector); - Color3& operator*= (float fScalar); - Color3& operator/= (float fScalar); - - bool fuzzyEq(const Color3& other) const; - bool fuzzyNe(const Color3& other) const; - - // vector operations - float length () const; - Color3 direction() const; - float squaredLength () const; - float dot (const Color3& rkVector) const; - float unitize (float fTolerance = 1e-06); - Color3 cross (const Color3& rkVector) const; - Color3 unitCross (const Color3& rkVector) const; - - inline Color3 pow(const Color3& other) const { - return Color3(::pow(r, other.r), ::pow(g, other.g), ::pow(b, other.b)); - } - - inline Color3 pow(float other) const { - return Color3(::pow(r, other), ::pow(g, other), ::pow(b, other)); - } - - inline Color3 max(const Color3& other) const { - return Color3(G3D::max(r, other.r), G3D::max(g, other.g), G3D::max(b, other.b)); - } - - inline Color3 min(const Color3& other) const { - return Color3(G3D::min(r, other.r), G3D::min(g, other.g), G3D::min(b, other.b)); - } - - /** Smallest element */ - inline float min() const { - return G3D::min(G3D::min(r, g), b); - } - - /** Largest element */ - inline float max() const { - return G3D::max(G3D::max(r, g), b); - } - - inline Color3 lerp(const Color3& other, float a) const { - return (*this) + (other - *this) * a; - - } - - inline float sum() const { - return r + g + b; - } - - inline float average() const { - return sum() / 3.0f; - } - - - /** - * Converts from HSV to RGB , note: toHSV(fromHSV(_hsv)) may not be _hsv, if it is at a grey point or black point. - * The components of _hsv should lie in the unit interval. - * @cite Alvy Ray Smith SIGGRAPH 1978 "Color Gamut Transform Pairs" - **/ - static Color3 fromHSV(const Vector3& _hsv); - static Vector3 toHSV(const Color3& _rgb); - - /** Duplicates the matlab jet colormap maps [0,1] --> (r,g,b) where blue is close to 0 and red is close to 1. */ - static Color3 jetColorMap(const float& val); - - /** Returns colors with maximum saturation and value @param hue [0, 1]*/ - static Color3 rainbowColorMap(float hue); - - std::string toString() const; - - /** Random unit vector */ - static Color3 random(); - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Color3& red(); - static const Color3& green(); - static const Color3& blue(); - static const Color3& purple(); - static const Color3& cyan(); - static const Color3& yellow(); - static const Color3& brown(); - static const Color3& orange(); - static const Color3& black(); - static const Color3& gray(); - static const Color3& white(); - - static const Color3& zero(); - static const Color3& one(); - - inline Color3 bgr() const { - return Color3(b, g, r); - } -}; - -inline G3D::Color3 operator* (float s, const G3D::Color3& c) { - return c * s; -} - -inline G3D::Color3 operator* (G3D::Color1& s, const G3D::Color3& c) { - return c * s.value; -} - -inline G3D::Color3 operator* (const G3D::Color3& c, G3D::Color1& s) { - return c * s.value; -} - - -//---------------------------------------------------------------------------- -inline Color3::Color3 () { -} - -//---------------------------------------------------------------------------- - -inline Color3::Color3(float fX, float fY, float fZ) { - r = fX; - g = fY; - b = fZ; -} - -//---------------------------------------------------------------------------- -inline Color3::Color3(const float afCoordinate[3]) { - r = afCoordinate[0]; - g = afCoordinate[1]; - b = afCoordinate[2]; -} - -//---------------------------------------------------------------------------- -inline Color3::Color3 (const Color3& rkVector) { - r = rkVector.r; - g = rkVector.g; - b = rkVector.b; -} - -//---------------------------------------------------------------------------- -inline float& Color3::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- - -inline const float& Color3::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- - -inline bool Color3::fuzzyEq(const Color3& other) const { - return G3D::fuzzyEq((*this - other).squaredLength(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Color3::fuzzyNe(const Color3& other) const { - return G3D::fuzzyNe((*this - other).squaredLength(), 0); -} - - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator= (const Color3& rkVector) { - r = rkVector.r; - g = rkVector.g; - b = rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline bool Color3::operator== (const Color3& rkVector) const { - return ( r == rkVector.r && g == rkVector.g && b == rkVector.b ); -} - -//---------------------------------------------------------------------------- -inline bool Color3::operator!= (const Color3& rkVector) const { - return ( r != rkVector.r || g != rkVector.g || b != rkVector.b ); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator+ (const Color3& rkVector) const { - return Color3(r + rkVector.r, g + rkVector.g, b + rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator- (const Color3& rkVector) const { - return Color3(r -rkVector.r, g - rkVector.g, b - rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator* (const Color3& rkVector) const { - return Color3(r * rkVector.r, g * rkVector.g, b * rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator- () const { - return Color3( -r, -g, -b); -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator+= (const Color3& rkVector) { - r += rkVector.r; - g += rkVector.g; - b += rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator-= (const Color3& rkVector) { - r -= rkVector.r; - g -= rkVector.g; - b -= rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator*= (float fScalar) { - r *= fScalar; - g *= fScalar; - b *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator*= (const Color3& rkVector) { - r *= rkVector.r; - g *= rkVector.g; - b *= rkVector.b; - return *this; -} -//---------------------------------------------------------------------------- -inline float Color3::squaredLength () const { - return r*r + g*g + b*b; -} - -//---------------------------------------------------------------------------- -inline float Color3::length () const { - return sqrtf(r*r + g*g + b*b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::direction () const { - float lenSquared = r * r + g * g + b * b; - - if (lenSquared != 1.0f) { - return *this / sqrtf(lenSquared); - } else { - return *this; - } -} - -//---------------------------------------------------------------------------- -inline float Color3::dot (const Color3& rkVector) const { - return r*rkVector.r + g*rkVector.g + b*rkVector.b; -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::cross (const Color3& rkVector) const { - return Color3(g*rkVector.b - b*rkVector.g, b*rkVector.r - r*rkVector.b, - r*rkVector.g - g*rkVector.r); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::unitCross (const Color3& rkVector) const { - Color3 kCross(g*rkVector.b - b*rkVector.g, b*rkVector.r - r*rkVector.b, - r*rkVector.g - g*rkVector.r); - kCross.unitize(); - return kCross; -} - - -} // namespace - - -template <> struct HashTrait { - static size_t hashCode(const G3D::Color3& key) { - return key.hashCode(); - } -}; - - -#endif diff --git a/dep/include/g3dlite/G3D/Color3uint8.h b/dep/include/g3dlite/G3D/Color3uint8.h deleted file mode 100644 index bd4b00d7fd6..00000000000 --- a/dep/include/g3dlite/G3D/Color3uint8.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - @file Color3uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2003-04-07 - @edited 2006-06-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR3UINT8_H -#define G3D_COLOR3UINT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - Represents a Color3 as a packed integer. Convenient - for creating unsigned int vertex arrays. Used by - G3D::GImage as the underlying format. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color3(1,1,1) == Color3uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - */ - -G3D_BEGIN_PACKED_CLASS(1) - -class Color3uint8 { -private: - // Hidden operators - bool operator<(const Color3uint8&) const; - bool operator>(const Color3uint8&) const; - bool operator<=(const Color3uint8&) const; - bool operator>=(const Color3uint8&) const; - -public: - uint8 r; - uint8 g; - uint8 b; - - Color3uint8() : r(0), g(0), b(0) {} - - Color3uint8(const uint8 _r, const uint8 _g, const uint8 _b) : r(_r), g(_g), b(_b) {} - - Color3uint8(const class Color3& c); - - Color3uint8(class BinaryInput& bi); - - inline static Color3uint8 fromARGB(uint32 i) { - Color3uint8 c; - c.r = (i >> 16) & 0xFF; - c.g = (i >> 8) & 0xFF; - c.b = i & 0xFF; - return c; - } - - inline Color3uint8 bgr() const { - return Color3uint8(b, g, r); - } - - /** - Returns the color packed into a uint32 - (the upper byte is 0xFF) - */ - inline uint32 asUInt32() const { - return (0xFF << 24) + ((uint32)r << 16) + ((uint32)g << 8) + b; - } - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color3 not having virtual functions - // (2) the data packed in a 3*sizeof(uint8) memory block - uint8& operator[] (int i) const { - debugAssert((unsigned int)i < 3); - return ((uint8*)this)[i]; - } - - operator uint8* () { - return (G3D::uint8*)this; - } - - operator const uint8* () const { - return (uint8*)this; - } - - bool operator==(const Color3uint8& other) const { - return (other.r == r) && (other.g == g) && (other.b == b); - } - - bool operator!=(const Color3uint8& other) const { - return (other.r != r) && (other.g != g) && (other.b != b); - } -} -G3D_END_PACKED_CLASS(1) - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Color4.h b/dep/include/g3dlite/G3D/Color4.h deleted file mode 100644 index d8858abbce2..00000000000 --- a/dep/include/g3dlite/G3D/Color4.h +++ /dev/null @@ -1,338 +0,0 @@ -/** - @file Color4.h - - Color class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite Portions based on Dave Eberly's Magic Software Library - at http://www.magic-software.com - - @created 2002-06-25 - @edited 2009-11-15 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Color4_h -#define G3D_Color4_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color3.h" -#include - -namespace G3D { - -class Any; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Color4 { -private: - // Hidden operators - bool operator<(const Color4&) const; - bool operator>(const Color4&) const; - bool operator<=(const Color4&) const; - bool operator>=(const Color4&) const; - -public: - - /** \param any Must be in one of the following forms: - - Color4(#, #, #, #) - - Color4::fromARGB(#) - - Color4{r = #, g = #, b = #, a = #) - */ - Color4(const Any& any); - - /** Converts the Color4 to an Any. */ - operator Any() const; - - /** - * Does not initialize fields. - */ - Color4 (); - - Color4(const Color3& c3, float a = 1.0); - - Color4(const class Color4uint8& c); - - Color4(class BinaryInput& bi); - - Color4(const class Vector4& v); - - Color4(float r, float g, float b, float a = 1.0); - - static const Color4& one(); - - Color4(float value[4]); - - /** - * Initialize from another color. - */ - Color4(const Color4& other); - - - inline bool isZero() const { - return (r == 0.0f) && (g == 0.0f) && (b == 0.0f) && (a == 0.0f); - } - - inline bool isOne() const { - return (r == 1.0f) && (g == 1.0f) && (b == 1.0f) && (a == 1.0f); - } - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - /** - Initialize from an HTML-style color (e.g. 0xFFFF0000 == RED) - */ - static Color4 fromARGB(uint32); - - /** - * Channel values. - */ - float r, g, b, a; - - inline Color3 rgb() const { - return Color3(r, g, b); - } - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b, v[3] = V.a - // - // WARNING. These member functions rely on - // (1) Color4 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - float& operator[] (int i) const; - - // assignment and comparison - Color4& operator= (const Color4& rkVector); - bool operator== (const Color4& rkVector) const; - bool operator!= (const Color4& rkVector) const; - size_t hashCode() const; - - // arithmetic operations - Color4 operator+ (const Color4& rkVector) const; - Color4 operator- (const Color4& rkVector) const; - Color4 operator* (float fScalar) const; - inline Color4 operator* (const Color4& k) const { - return Color4(r*k.r, g*k.g, b*k.b, a * k.a); - } - Color4 operator/ (float fScalar) const; - Color4 operator- () const; - friend Color4 operator* (double fScalar, const Color4& rkVector); - - // arithmetic updates - Color4& operator+= (const Color4& rkVector); - Color4& operator-= (const Color4& rkVector); - Color4& operator*= (float fScalar); - Color4& operator/= (float fScalar); - - bool fuzzyEq(const Color4& other) const; - bool fuzzyNe(const Color4& other) const; - - std::string toString() const; - - inline Color4 max(const Color4& other) const { - return Color4(G3D::max(r, other.r), G3D::max(g, other.g), G3D::max(b, other.b), G3D::max(a, other.a)); - } - - inline Color4 min(const Color4& other) const { - return Color4(G3D::min(r, other.r), G3D::min(g, other.g), G3D::min(b, other.b), G3D::min(a, other.a)); - } - - /** r + g + b + a */ - inline float sum() const { - return r + g + b + a; - } - - inline Color4 lerp(const Color4& other, float a) const { - return (*this) + (other - *this) * a; - - } - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Color4& zero(); - static const Color4& clear(); - - static const Color4& inf(); - static const Color4& nan(); - - inline bool isFinite() const { - return G3D::isFinite(r) && G3D::isFinite(g) && G3D::isFinite(b) && G3D::isFinite(a); - } - - inline Color3 bgr() const { - return Color3(b, g, r); - } -}; - -/** - Extends the c3 with alpha = 1.0 - */ -Color4 operator*(const Color3& c3, const Color4& c4); - - -inline Color4 operator*(const Color3& c3, const Color4& c4) { - return Color4(c3.r * c4.r, c3.g * c4.g, c3.b * c4.b, c4.a); -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4 () { - // For efficiency in construction of large arrays of vectors, the - // default constructor does not initialize the vector. -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4(const Color3& c3, float a) { - r = c3.r; - g = c3.g; - b = c3.b; - this->a = a; -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4( - float r, - float g, - float b, - float a) : - r(r), g(g), b(b), a(a) { -} - -//---------------------------------------------------------------------------- -inline Color4::Color4 (float afCoordinate[4]) { - r = afCoordinate[0]; - g = afCoordinate[1]; - b = afCoordinate[2]; - a = afCoordinate[3]; -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4( - const Color4& other) { - - r = other.r; - g = other.g; - b = other.b; - a = other.a; -} - -//---------------------------------------------------------------------------- - -inline float& Color4::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- - -inline bool Color4::fuzzyEq(const Color4& other) const { - Color4 dif = (*this - other); - return G3D::fuzzyEq(dif.r * dif.r + dif.g * dif.g + dif.b * dif.b + dif.a * dif.a, 0); -} - -//---------------------------------------------------------------------------- - -inline bool Color4::fuzzyNe(const Color4& other) const { - Color4 dif = (*this - other); - return G3D::fuzzyNe(dif.r * dif.r + dif.g * dif.g + dif.b * dif.b + dif.a * dif.a, 0); -} - - -//---------------------------------------------------------------------------- -inline Color4& Color4::operator= (const Color4& other) { - r = other.r; - g = other.g; - b = other.b; - a = other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline bool Color4::operator== (const Color4& other) const { - return ( r == other.r && g == other.g && b == other.b && a == other.a); -} - -//---------------------------------------------------------------------------- - -inline bool Color4::operator!= (const Color4& other) const { - return ( r != other.r || g != other.g || b != other.b || a != other.a); -} - -//---------------------------------------------------------------------------- -inline Color4 Color4::operator+ (const Color4& other) const { - return Color4(r + other.r, g + other.g, b + other.b, a + other.a); -} - -//---------------------------------------------------------------------------- -inline Color4 Color4::operator- (const Color4& other) const { - return Color4(r - other.r, g - other.g, b - other.b, a - other.a); -} - -//---------------------------------------------------------------------------- - -inline Color4 Color4::operator* (float fScalar) const { - return Color4(fScalar * r, fScalar * g, fScalar * b, fScalar * a); -} - -//---------------------------------------------------------------------------- - -inline Color4 Color4::operator- () const { - return Color4(-r, -g, -b, -a); -} - -//---------------------------------------------------------------------------- - -inline Color4 operator* (float fScalar, const Color4& other) { - return Color4(fScalar * other.r, fScalar * other.g, - fScalar * other.b, fScalar * other.a); -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator+= (const Color4& other) { - r += other.r; - g += other.g; - b += other.b; - a += other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator-= (const Color4& other) { - r -= other.r; - g -= other.g; - b -= other.b; - a -= other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator*= (float fScalar) { - r *= fScalar; - g *= fScalar; - b *= fScalar; - a *= fScalar; - return *this; -} - -} // namespace - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Color4& key) { - return key.hashCode(); - } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/Color4uint8.h b/dep/include/g3dlite/G3D/Color4uint8.h deleted file mode 100644 index ab8c0729276..00000000000 --- a/dep/include/g3dlite/G3D/Color4uint8.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - @file Color4uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2003-04-07 - @edited 2006-03-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef COLOR4UINT8_H -#define COLOR4UINT8_H - -#include "G3D/g3dmath.h" -#include "G3D/platform.h" -#include "G3D/Color3uint8.h" - -namespace G3D { - -/** - Represents a Color4 as a packed integer. Convenient - for creating unsigned int vertex arrays. Used by - G3D::GImage as the underlying format. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color4(1,1,1) == Color4uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - - */ -G3D_BEGIN_PACKED_CLASS(1) -class Color4uint8 { -private: - // Hidden operators - bool operator<(const Color4uint8&) const; - bool operator>(const Color4uint8&) const; - bool operator<=(const Color4uint8&) const; - bool operator>=(const Color4uint8&) const; - -public: - uint8 r; - uint8 g; - uint8 b; - uint8 a; - - Color4uint8() : r(0), g(0), b(0), a(0) {} - - Color4uint8(const class Color4& c); - - Color4uint8(const uint8 _r, const uint8 _g, const uint8 _b, const uint8 _a) : r(_r), g(_g), b(_b), a(_a) {} - - Color4uint8(const Color3uint8& c, const uint8 _a) : r(c.r), g(c.g), b(c.b), a(_a) {} - - Color4uint8(class BinaryInput& bi); - - inline static Color4uint8 fromARGB(uint32 i) { - Color4uint8 c; - c.a = (i >> 24) & 0xFF; - c.r = (i >> 16) & 0xFF; - c.g = (i >> 8) & 0xFF; - c.b = i & 0xFF; - return c; - } - - inline uint32 asUInt32() const { - return ((uint32)a << 24) + ((uint32)r << 16) + ((uint32)g << 8) + b; - } - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color4uint8 not having virtual functions - // (2) the data packed in a 3*sizeof(uint8) memory block - uint8& operator[] (int i) const { - return ((uint8*)this)[i]; - } - - operator uint8* () { - return (uint8*)this; - } - - operator const uint8* () const { - return (uint8*)this; - } - - - inline Color3uint8 bgr() const { - return Color3uint8(b, g, r); - } - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - inline Color3uint8 rgb() const { - return Color3uint8(r, g, b); - } - - bool operator==(const Color4uint8& other) const { - return *reinterpret_cast(this) == *reinterpret_cast(&other); - } - - bool operator!=(const Color4uint8& other) const { - return *reinterpret_cast(this) != *reinterpret_cast(&other); - } - -} -G3D_END_PACKED_CLASS(1) - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Cone.h b/dep/include/g3dlite/G3D/Cone.h deleted file mode 100644 index d801a9b348f..00000000000 --- a/dep/include/g3dlite/G3D/Cone.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - @file Cone.h - - Cone class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-02-23 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CONE_H -#define G3D_CONE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -/** - An infinite cone. - */ -class Cone { - -private: - Vector3 tip; - Vector3 direction; - - /** Angle from the center line to the edge. */ - float angle; - -public: - - /** - @param angle Angle from the center line to the edge, in radians - */ - Cone(const Vector3& tip, const Vector3& direction, float angle); - - /** - Forms the smallest cone that contains the box. Undefined if - the tip is inside or on the box. - */ - Cone(const Vector3& tip, const class Box& box); - - virtual ~Cone() {} - - /** - Returns true if the cone touches, intersects, or contains b. - - If c.intersects(s) and c.intersects(Sphere(s.center, s.radius * 2) - then the sphere s is entirely within cone c. - */ - bool intersects(const class Sphere& s) const; - - /** - True if v is a point inside the cone. - */ - bool contains(const class Vector3& v) const; -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/ConvexPolyhedron.h b/dep/include/g3dlite/G3D/ConvexPolyhedron.h deleted file mode 100644 index a6fdd62cf90..00000000000 --- a/dep/include/g3dlite/G3D/ConvexPolyhedron.h +++ /dev/null @@ -1,180 +0,0 @@ -/** - @file ConvexPolyhedron.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-11-11 - @edited 2006-04-10 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CONVEXPOLYHEDRON_H -#define G3D_CONVEXPOLYHEDRON_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Plane.h" -#include "G3D/Line.h" -#include "G3D/Array.h" - -namespace G3D { - -class DirectedEdge { -public: - Vector3 start; - Vector3 stop; -}; - -class ConvexPolygon { -private: - - friend class ConvexPolyhedron; - - Array _vertex; - -public: - - ConvexPolygon() {} - ConvexPolygon(const Vector3& v0, const Vector3& v1, const Vector3& v2); - ConvexPolygon(const Array& __vertex); - virtual ~ConvexPolygon() {} - - /** - Counter clockwise winding order. - */ - inline const Vector3& vertex(int i) const { - return _vertex[i]; - } - - inline void setVertex(int i, const Vector3& v) { - _vertex[i] = v; - } - - /** - Zero vertices indicates an empty polygon (zero area). - */ - inline int numVertices() const { - return _vertex.size(); - } - - inline void setNumVertices(int n) { - _vertex.resize(n); - } - - /** - O(n) in the number of edges - */ - bool isEmpty() const; - - /** - Cuts the polygon at the plane. If the polygon is entirely above or below - the plane, one of the returned polygons will be empty. - - @param above The part of the polygon above (on the side the - normal points to or in the plane) the plane - @param below The part of the polygon below the plane. - @param newEdge If a new edge was introduced, this is that edge (on the above portion; the below portion is the opposite winding. - */ - void cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below, DirectedEdge& newEdge); - void cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below); - - /** - When a cut plane grazes a vertex in the polygon, two near-identical vertices may be created. - The closeness of these two points can cause a number of problems, such as ConvexPolygon::normal() - returning an infinite vector. It should be noted, however, that not all applications are - sensitive to near-identical vertices. - - removeDuplicateVertices() detects and eliminates redundant vertices. - */ - void removeDuplicateVertices(); - - /** - O(n) in the number of edges - */ - float getArea() const; - - inline Vector3 normal() const { - debugAssert(_vertex.length() >= 3); - return (_vertex[1] - _vertex[0]).cross(_vertex[2] - _vertex[0]).direction(); - } - - /** - Returns the same polygon with inverse winding. - */ - ConvexPolygon inverse() const; -}; - - - -class ConvexPolyhedron { -public: - /** - Zero faces indicates an empty polyhedron - */ - Array face; - - ConvexPolyhedron() {} - ConvexPolyhedron(const Array& _face); - - /** - O(n) in the number of edges - */ - bool isEmpty() const; - - /** - O(n) in the number of edges - */ - float getVolume() const; - - /** - Cuts the polyhedron at the plane. If the polyhedron is entirely above or below - the plane, one of the returned polyhedra will be empty. - - @param above The part of the polyhedron above (on the side the - normal points to or in the plane) the plane - @param below The part of the polyhedron below the plane. - */ - void cut(const Plane& plane, ConvexPolyhedron &above, ConvexPolyhedron &below); -}; - -/** - - */ -class ConvexPolygon2D { -private: - - Array m_vertex; - -public: - - ConvexPolygon2D() {} - - /** - Points are counter-clockwise in a Y = down, X = right coordinate - system. - - @param reverse If true, the points are reversed (i.e. winding direction is changed) - before the polygon is created. - */ - ConvexPolygon2D(const Array& pts, bool reverse = false); - - inline int numVertices() const { - return m_vertex.size(); - } - - inline const Vector2& vertex(int index) const { - debugAssert((index >= 0) && (index <= m_vertex.size())); - return m_vertex[index]; - } - - /** @param reverseWinding If true, the winding direction of the polygon is reversed for this test.*/ - bool contains(const Vector2& p, bool reverseWinding = false) const; -}; - - -} // namespace -#endif diff --git a/dep/include/g3dlite/G3D/CoordinateFrame.h b/dep/include/g3dlite/G3D/CoordinateFrame.h deleted file mode 100644 index 7ed4d0acc65..00000000000 --- a/dep/include/g3dlite/G3D/CoordinateFrame.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - @file CoordinateFrame.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-03-04 - @edited 2009-04-29 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_CFrame_h -#define G3D_CFrame_h - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Array.h" -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) -#endif - - -namespace G3D { -class Any; - -/** - A rigid body RT (rotation-translation) transformation. - -CoordinateFrame abstracts a 4x4 matrix that maps object space to world space: - - v_world = C * v_object - -CoordinateFrame::rotation is the upper 3x3 submatrix, CoordinateFrame::translation -is the right 3x1 column. The 4th row is always [0 0 0 1], so it isn't stored. -So you don't have to remember which way the multiplication and transformation work, -it provides explicit toWorldSpace and toObjectSpace methods. Also, points, vectors -(directions), and surface normals transform differently, so they have separate methods. - -Some helper functions transform whole primitives like boxes in and out of object space. - -Convert to Matrix4 using CoordinateFrame::toMatrix4. You can construct a CoordinateFrame -from a Matrix4 using Matrix4::approxCoordinateFrame, however, because a Matrix4 is more -general than a CoordinateFrame, some information may be lost. - -@sa G3D::UprightFrame, G3D::PhysicsFrame, G3D::Matrix4, G3D::Quat -*/ -class CoordinateFrame { -public: - - /** Takes object space points to world space. */ - Matrix3 rotation; - - /** Takes object space points to world space. */ - Vector3 translation; - - /** \param any Must be in one of the following forms: - - CFrame((matrix3 expr), (vector3 expr)) - - CFrame::fromXYZYPRDegrees(#, #, #, #, #, #) - - CFrame { rotation = (matrix3 expr), translation = (vector3 expr) } - */ - CoordinateFrame(const Any& any); - - /** Converts the CFrame to an Any. */ - operator Any() const; - - inline bool operator==(const CoordinateFrame& other) const { - return (translation == other.translation) && (rotation == other.rotation); - } - - inline bool operator!=(const CoordinateFrame& other) const { - return !(*this == other); - } - - bool fuzzyEq(const CoordinateFrame& other) const; - - bool fuzzyIsIdentity() const; - - bool isIdentity() const; - - /** - Initializes to the identity coordinate frame. - */ - CoordinateFrame(); - - CoordinateFrame(const Vector3& _translation) : - rotation(Matrix3::identity()), translation(_translation) { - } - - CoordinateFrame(const Matrix3 &rotation, const Vector3 &translation) : - rotation(rotation), translation(translation) { - } - - CoordinateFrame(const Matrix3 &rotation) : - rotation(rotation), translation(Vector3::zero()) { - } - - CoordinateFrame(const class UprightFrame& f); - - static CoordinateFrame fromXYZYPRRadians(float x, float y, float z, float yaw = 0.0f, float pitch = 0.0f, float roll = 0.0f); - - /** Construct a coordinate frame from translation = (x,y,z) and - rotations (in that order) about Y, object space X, object space - Z. Note that because object-space axes are used, these are not - equivalent to Euler angles; they are known as Tait-Bryan - rotations and are more convenient for intuitive positioning.*/ - static CoordinateFrame fromXYZYPRDegrees(float x, float y, float z, float yaw = 0.0f, float pitch = 0.0f, float roll = 0.0f); - - CoordinateFrame(class BinaryInput& b); - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - CoordinateFrame(const CoordinateFrame &other) : - rotation(other.rotation), translation(other.translation) {} - - /** - Computes the inverse of this coordinate frame. - */ - inline CoordinateFrame inverse() const { - CoordinateFrame out; - out.rotation = rotation.transpose(); - out.translation = -out.rotation * translation; - return out; - } - - inline ~CoordinateFrame() {} - - /** See also Matrix4::approxCoordinateFrame */ - class Matrix4 toMatrix4() const; - - void getXYZYPRRadians(float& x, float& y, float& z, float& yaw, float& pitch, float& roll) const; - void getXYZYPRDegrees(float& x, float& y, float& z, float& yaw, float& pitch, float& roll) const; - - - /** - Produces an XML serialization of this coordinate frame. - @deprecated - */ - std::string toXML() const; - - /** - Returns the heading of the lookVector as an angle in radians relative to - the world -z axis. That is, a counter-clockwise heading where north (-z) - is 0 and west (-x) is PI/2. - - Note that the heading ignores the Y axis, so an inverted - object has an inverted heading. - */ - inline float getHeading() const { - Vector3 look = rotation.column(2); - float angle = -(float) atan2(-look.x, look.z); - return angle; - } - - /** - Takes the coordinate frame into object space. - this->inverse() * c - */ - inline CoordinateFrame toObjectSpace(const CoordinateFrame& c) const { - return this->inverse() * c; - } - - inline Vector4 toObjectSpace(const Vector4& v) const { - return this->inverse().toWorldSpace(v); - } - - inline Vector4 toWorldSpace(const Vector4& v) const { - return Vector4(rotation * Vector3(v.x, v.y, v.z) + translation * v.w, v.w); - } - - /** - Transforms the point into world space. - */ - inline Vector3 pointToWorldSpace(const Vector3& v) const { - return Vector3( - rotation[0][0] * v[0] + rotation[0][1] * v[1] + rotation[0][2] * v[2] + translation[0], - rotation[1][0] * v[0] + rotation[1][1] * v[1] + rotation[1][2] * v[2] + translation[1], - rotation[2][0] * v[0] + rotation[2][1] * v[1] + rotation[2][2] * v[2] + translation[2]); - } - - /** - Transforms the point into object space. Assumes that the rotation matrix is orthonormal. - */ - inline Vector3 pointToObjectSpace(const Vector3& v) const { - float p[3]; - p[0] = v[0] - translation[0]; - p[1] = v[1] - translation[1]; - p[2] = v[2] - translation[2]; - debugAssert(G3D::fuzzyEq(rotation.determinant(), 1.0f)); - return Vector3( - rotation[0][0] * p[0] + rotation[1][0] * p[1] + rotation[2][0] * p[2], - rotation[0][1] * p[0] + rotation[1][1] * p[1] + rotation[2][1] * p[2], - rotation[0][2] * p[0] + rotation[1][2] * p[1] + rotation[2][2] * p[2]); - } - - /** - Transforms the vector into world space (no translation). - */ - inline Vector3 vectorToWorldSpace(const Vector3& v) const { - return rotation * v; - } - - inline Vector3 normalToWorldSpace(const Vector3& v) const { - return rotation * v; - } - - class Ray toObjectSpace(const Ray& r) const; - - Ray toWorldSpace(const Ray& r) const; - - /** - Transforms the vector into object space (no translation). - */ - inline Vector3 vectorToObjectSpace(const Vector3 &v) const { - // Multiply on the left (same as rotation.transpose() * v) - return v * rotation; - } - - inline Vector3 normalToObjectSpace(const Vector3 &v) const { - // Multiply on the left (same as rotation.transpose() * v) - return v * rotation; - } - - void pointToWorldSpace(const Array& v, Array& vout) const; - - void normalToWorldSpace(const Array& v, Array& vout) const; - - void vectorToWorldSpace(const Array& v, Array& vout) const; - - void pointToObjectSpace(const Array& v, Array& vout) const; - - void normalToObjectSpace(const Array& v, Array& vout) const; - - void vectorToObjectSpace(const Array& v, Array& vout) const; - - class Box toWorldSpace(const class AABox& b) const; - - class Box toWorldSpace(const class Box& b) const; - - class Cylinder toWorldSpace(const class Cylinder& b) const; - - class Capsule toWorldSpace(const class Capsule& b) const; - - class Plane toWorldSpace(const class Plane& p) const; - - class Sphere toWorldSpace(const class Sphere& b) const; - - class Triangle toWorldSpace(const class Triangle& t) const; - - class Box toObjectSpace(const AABox& b) const; - - class Box toObjectSpace(const Box& b) const; - - class Plane toObjectSpace(const Plane& p) const; - - class Sphere toObjectSpace(const Sphere& b) const; - - Triangle toObjectSpace(const Triangle& t) const; - - /** Compose: create the transformation that is other followed by this.*/ - CoordinateFrame operator*(const CoordinateFrame &other) const { - return CoordinateFrame(rotation * other.rotation, - pointToWorldSpace(other.translation)); - } - - CoordinateFrame operator+(const Vector3& v) const { - return CoordinateFrame(rotation, translation + v); - } - - CoordinateFrame operator-(const Vector3& v) const { - return CoordinateFrame(rotation, translation - v); - } - - void lookAt(const Vector3& target); - - void lookAt( - const Vector3& target, - Vector3 up); - - /** The direction this camera is looking (its negative z axis)*/ - inline Vector3 lookVector() const { - return -rotation.column(2); - } - - /** Returns the ray starting at the camera origin travelling in direction CoordinateFrame::lookVector. */ - class Ray lookRay() const; - - /** Up direction for this camera (its y axis). */ - inline Vector3 upVector() const { - return rotation.column(1); - } - - inline Vector3 rightVector() const { - return rotation.column(0); - } - - /** - If a viewer looks along the look vector, this is the viewer's "left". - Useful for strafing motions and building alternative coordinate frames. - */ - inline Vector3 leftVector() const { - return -rotation.column(0); - } - - /** - Linearly interpolates between two coordinate frames, using - Quat::slerp for the rotations. - */ - CoordinateFrame lerp( - const CoordinateFrame& other, - float alpha) const; - -}; - -typedef CoordinateFrame CFrame; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/Crypto.h b/dep/include/g3dlite/G3D/Crypto.h deleted file mode 100644 index 56c816a4977..00000000000 --- a/dep/include/g3dlite/G3D/Crypto.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - @file Crypto.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - - @created 2006-03-29 - @edited 2006-04-06 - */ - -#ifndef G3D_CRYPTO_H -#define G3D_CRYPTO_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include - -namespace G3D { - -/** See G3D::Crypto::md5 */ -class MD5Hash { -private: - - uint8 value[16]; - -public: - - MD5Hash() { - for (int i = 0; i < 16; ++i) { - value[i] = 0; - } - } - - explicit MD5Hash(class BinaryInput& b); - - uint8& operator[](int i) { - return value[i]; - } - - const uint8& operator[](int i) const { - return value[i]; - } - - bool operator==(const MD5Hash& other) const { - bool match = true; - for (int i = 0; i < 16; ++i) { - match = match && (other.value[i] == value[i]); - } - return match; - } - - inline bool operator!=(const MD5Hash& other) const { - return !(*this == other); - } - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; -}; - - -/** Cryptography and hashing helper functions */ -class Crypto { -public: - - /** - Computes the CRC32 value of a byte array. CRC32 is designed to be a hash - function that produces different values for similar strings. - - This implementation is compatible with PKZIP and GZIP. - - Based on http://www.gamedev.net/reference/programming/features/crc32/ - */ - static uint32 crc32(const void* bytes, size_t numBytes); - - /** - Computes the MD5 hash (message digest) of a byte stream, as defined by - http://www.ietf.org/rfc/rfc1321.txt. - - @cite Based on implementation by L. Peter Deutsch, ghost@aladdin.com - */ - MD5Hash md5(const void* bytes, size_t numBytes); - - /** - Returns the nth prime less than 2000 in constant time. The first prime has index - 0 and is the number 2. - */ - static int smallPrime(int n); - - /** Returns 1 + the largest value that can be passed to smallPrime. */ - static int numSmallPrimes(); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Cylinder.h b/dep/include/g3dlite/G3D/Cylinder.h deleted file mode 100644 index 85eba77b794..00000000000 --- a/dep/include/g3dlite/G3D/Cylinder.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - @file Cylinder.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-02-07 - @edited 2005-09-26 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Cylinder_H -#define G3D_Cylinder_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Line; -class AABox; -/** - Right cylinder - */ -class Cylinder { -private: - Vector3 p1; - Vector3 p2; - - float mRadius; - -public: - - /** Uninitialized */ - Cylinder(); - Cylinder(class BinaryInput& b); - Cylinder(const Vector3& _p1, const Vector3& _p2, float _r); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** The line down the center of the Cylinder */ - Line axis() const; - - /** - A reference frame in which the center of mass is at the origin and - the Y-axis is the cylinder's axis. If the cylinder is transformed, this reference frame - may freely rotate around its axis.*/ - void getReferenceFrame(class CoordinateFrame& cframe) const; - - /** Returns point 0 or 1 */ - inline const Vector3& point(int i) const { - debugAssert(i >= 0 && i <= 1); - return (i == 0) ? p1 : p2; - } - - /** - Returns true if the point is inside the Cylinder or on its surface. - */ - bool contains(const Vector3& p) const; - - float area() const; - - float volume() const; - - float radius() const; - - /** Center of mass */ - inline Vector3 center() const { - return (p1 + p2) / 2.0f; - } - - inline float height() const { - return (p1 - p2).magnitude(); - } - - /** - Get close axis aligned bounding box. - With vertical world orientation, the top and bottom might not be very tight. */ - void getBounds(AABox& out) const; - - /** Random world space point with outward facing normal. */ - void getRandomSurfacePoint(Vector3& P, Vector3& N) const; - - /** Point selected uniformly at random over the volume. */ - Vector3 randomInteriorPoint() const; -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/EqualsTrait.h b/dep/include/g3dlite/G3D/EqualsTrait.h deleted file mode 100644 index 349cb5088fb..00000000000 --- a/dep/include/g3dlite/G3D/EqualsTrait.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - @file EqualsTrait.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2008-10-01 - @edited 2008-10-01 - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_EQUALSTRAIT_H -#define G3D_EQUALSTRAIT_H - -#include "G3D/platform.h" - -/** Default implementation of EqualsTrait. - @see G3D::Table for specialization requirements. -*/ -template struct EqualsTrait { - static bool equals(const Key& a, const Key& b) { - return a == b; - } -}; - -#endif - diff --git a/dep/include/g3dlite/G3D/G3D.h b/dep/include/g3dlite/G3D/G3D.h deleted file mode 100644 index 5b56b9c71dc..00000000000 --- a/dep/include/g3dlite/G3D/G3D.h +++ /dev/null @@ -1,162 +0,0 @@ -/** - @file G3D.h - - This header includes all of the G3D libraries in - appropriate namespaces. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-08-25 - @edited 2010-01-30 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_G3D_h -#define G3D_G3D_h - -#define NOMINMAX 1 -#ifdef min - #undef min -#endif -#ifdef max - #undef max -#endif - -#include "G3D/platform.h" -#include "G3D/units.h" -#include "G3D/ParseError.h" -#include "G3D/Random.h" -#include "G3D/Array.h" -#include "G3D/SmallArray.h" -#include "G3D/Queue.h" -#include "G3D/Crypto.h" -#include "G3D/format.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" -#include "G3D/Matrix2.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/PhysicsFrame.h" -#include "G3D/Plane.h" -#include "G3D/Line.h" -#include "G3D/Ray.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/Box2D.h" -#include "G3D/AABox.h" -#include "G3D/WrapMode.h" -#include "G3D/Cone.h" -#include "G3D/Quat.h" -#include "G3D/stringutils.h" -#include "G3D/prompt.h" -#include "G3D/Table.h" -#include "G3D/Set.h" -#include "G3D/GUniqueID.h" -#include "G3D/BinaryFormat.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/debug.h" -#include "G3D/g3dfnmatch.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/g3dmath.h" -#include "G3D/uint128.h" -#include "G3D/fileutils.h" -#include "G3D/ReferenceCount.h" -#include "G3D/Welder.h" -#include "G3D/GMutex.h" -#include "G3D/PrecomputedRandom.h" -#include "G3D/MemoryManager.h" -#include "G3D/AreaMemoryManager.h" -#include "G3D/BumpMapPreprocess.h" - -template struct HashTrait< G3D::ReferenceCountedPointer > { - static size_t hashCode(G3D::ReferenceCountedPointer key) { return reinterpret_cast( key.pointer() ); } -}; - -#include "G3D/GImage.h" -#include "G3D/CollisionDetection.h" -#include "G3D/Intersect.h" -#include "G3D/Log.h" -#include "G3D/serialize.h" -#include "G3D/TextInput.h" -#include "G3D/NetAddress.h" -#include "G3D/NetworkDevice.h" -#include "G3D/System.h" -#include "G3D/splinefunc.h" -#include "G3D/Spline.h" -#include "G3D/UprightFrame.h" -#include "G3D/LineSegment.h" -#include "G3D/Capsule.h" -#include "G3D/Cylinder.h" -#include "G3D/Triangle.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" -#include "G3D/Vector2int16.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3int32.h" -#include "G3D/Vector4int8.h" -#include "G3D/ConvexPolyhedron.h" -#include "G3D/MeshAlg.h" -#include "G3D/vectorMath.h" -#include "G3D/Rect2D.h" -#include "G3D/GCamera.h" -#include "G3D/GLight.h" -#include "G3D/KDTree.h" -#include "G3D/PointKDTree.h" -#include "G3D/TextOutput.h" -#include "G3D/MeshBuilder.h" -#include "G3D/Stopwatch.h" -#include "G3D/AtomicInt32.h" -#include "G3D/GThread.h" -#include "G3D/ThreadSet.h" -#include "G3D/RegistryUtil.h" -#include "G3D/Any.h" -#include "G3D/PointHashGrid.h" -#include "G3D/Map2D.h" -#include "G3D/Image1.h" -#include "G3D/Image1uint8.h" -#include "G3D/Image3.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image4.h" -#include "G3D/Image4uint8.h" -#include "G3D/filter.h" -#include "G3D/WeakCache.h" -#include "G3D/Pointer.h" -#include "G3D/Matrix.h" -#include "G3D/ImageFormat.h" - -#ifdef _MSC_VER -# pragma comment(lib, "zlib") -# pragma comment(lib, "ws2_32") -# pragma comment(lib, "winmm") -# pragma comment(lib, "imagehlp") -# pragma comment(lib, "gdi32") -# pragma comment(lib, "user32") -# pragma comment(lib, "kernel32") -# pragma comment(lib, "version") -# pragma comment(lib, "advapi32") -# pragma comment(lib, "png") -# pragma comment(lib, "jpeg") -# pragma comment(lib, "zip") -# ifdef _DEBUG - // Don't link against G3D when building G3D itself. -# ifndef G3D_BUILDING_LIBRARY_DLL -# pragma comment(lib, "G3Dd.lib") -# endif -# else - // Don't link against G3D when building G3D itself. -# ifndef G3D_BUILDING_LIBRARY_DLL -# pragma comment(lib, "G3D.lib") -# endif -# endif -#endif - -#endif - diff --git a/dep/include/g3dlite/G3D/G3DAll.h b/dep/include/g3dlite/G3D/G3DAll.h deleted file mode 100644 index 1176fe742e7..00000000000 --- a/dep/include/g3dlite/G3D/G3DAll.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - @file G3DAll.h - - Includes all G3D and GLG3D files and uses the G3D namespace. - - This requires OpenGL and SDL headers. If you don't want all of this, - \#include separately. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-01-01 - @edited 2006-08-13 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_G3DALL_H -#define G3D_G3DALL_H - -#include "G3D/G3D.h" -#include "GLG3D/GLG3D.h" - -using namespace G3D; - -#endif diff --git a/dep/include/g3dlite/G3D/G3DGameUnits.h b/dep/include/g3dlite/G3D/G3DGameUnits.h deleted file mode 100644 index e2bc2c811e8..00000000000 --- a/dep/include/g3dlite/G3D/G3DGameUnits.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - @file G3DGameUnits.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-10-05 - @edited 2006-11-10 - */ - -#ifndef G3D_GAMEUNITS_H -#define G3D_GAMEUNITS_H - -#include "G3D/platform.h" - -namespace G3D { -/** - Time, in seconds. - */ -typedef double GameTime; -typedef double SimTime; - -/** - Actual wall clock time in seconds. - */ -typedef double RealTime; - -enum AMPM {AM, PM}; - -/** \deprecated */ -enum {SECOND=1, MINUTE=60, HOUR = 60*60, DAY=24*60*60, SUNRISE=24*60*60/4, SUNSET=24*60*60*3/4, MIDNIGHT=0, METER=1, KILOMETER=1000}; - -/** - Converts a 12 hour clock time into the number of seconds since - midnight. Note that 12:00 PM is noon and 12:00 AM is midnight. - - Example: toSeconds(10, 00, AM) - */ -SimTime toSeconds(int hour, int minute, double seconds, AMPM ap); -SimTime toSeconds(int hour, int minute, AMPM ap); - -} - -#endif diff --git a/dep/include/g3dlite/G3D/GCamera.h b/dep/include/g3dlite/G3D/GCamera.h deleted file mode 100644 index 018fbc85d59..00000000000 --- a/dep/include/g3dlite/G3D/GCamera.h +++ /dev/null @@ -1,337 +0,0 @@ -/** - @file GCamera.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2005-07-20 - @edited 2009-04-20 -*/ - -#ifndef G3D_GCamera_H -#define G3D_GCamera_H - -#include "G3D/platform.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -class Matrix4; -class Rect2D; -class Any; - -/** - Abstraction of a pinhole camera. - - The area a camera sees is called a frustum. It is bounded by the - near plane, the far plane, and the sides of the view frame projected - into the scene. It has the shape of a pyramid with the top cut off. - - Cameras can project points from 3D to 2D. The "unit" projection - matches OpenGL. It maps the entire view frustum to a cube of unit - radius (i.e., edges of length 2) centered at the origin. The - non-unit projection then maps that cube to the specified pixel - viewport in X and Y and the range [0, 1] in Z. The projection is - reversable as long as the projected Z value is known. - - All viewport arguments are the pixel bounds of the viewport-- e.g., - RenderDevice::viewport(). - */ -class GCamera { - -public: - /** - Stores the direction of the field of view - */ - enum FOVDirection {HORIZONTAL, VERTICAL}; - -private: - - /** Full field of view (in radians) */ - float m_fieldOfView; - - /** Clipping plane, *not* imaging plane. Negative numbers. */ - float m_nearPlaneZ; - - /** Negative */ - float m_farPlaneZ; - - /** Stores the camera's location and orientation */ - CoordinateFrame m_cframe; - - /** Horizontal or Vertical */ - FOVDirection m_direction; - -public: - - /** Must be of the format produced by the Any cast, e.g., - -
-        GCamera {
-            coordinateFrame = CFrame::fromXYZYPRDegrees(-13.3f, 8.0f, -1.9f, 246.6f, -3),
-            nearPlaneZ = -0.5,
-            farPlaneZ = -50,
-            fovDirection = "HORIZONTAL",
-            fovAngleDegrees = 90
-        }
- - Missing fields are filled from the default GCamera constructor. - */ - GCamera(const Any& any); - - operator Any() const; - - class Frustum { - public: - class Face { - public: - /** Counter clockwise indices into vertexPos */ - int vertexIndex[4]; - - /** The plane containing the face. */ - Plane plane; - }; - - /** The vertices, in homogeneous space. If w == 0, - a vertex is at infinity. */ - Array vertexPos; - - /** The faces in the frustum. When the - far plane is at infinity, there are 5 faces, - otherwise there are 6. The faces are in the order - N,R,L,B,T,[F]. - */ - Array faceArray; - }; - - GCamera(); - - GCamera(const Matrix4& proj, const CFrame& frame); - - virtual ~GCamera(); - - /** Returns the current coordinate frame */ - const CoordinateFrame& coordinateFrame() const { - return m_cframe; - } - - /** Sets c to the camera's coordinate frame */ - void getCoordinateFrame(CoordinateFrame& c) const; - - /** Sets a new coordinate frame for the camera */ - void setCoordinateFrame(const CoordinateFrame& c); - - /** Sets \a P equal to the camera's projection matrix. This is the - matrix that maps points to the homogeneous clip cube that - varies from -1 to 1 on all axes. The projection matrix does - not include the camera transform. - - This is the matrix that a RenderDevice (or OpenGL) uses as the projection matrix. - @sa RenderDevice::setProjectionAndCameraMatrix, RenderDevice::setProjectionMatrix, Matrix4::perspectiveProjection - */ - void getProjectUnitMatrix(const Rect2D& viewport, Matrix4& P) const; - - /** Sets \a P equal to the matrix that transforms points to pixel - coordinates on the given viewport. A point correspoinding to - the top-left corner of the viewport in camera space will - transform to viewport.x0y0() and the bottom-right to viewport.x1y1(). */ - void getProjectPixelMatrix(const Rect2D& viewport, Matrix4& P) const; - - /** Converts projected points from OpenGL standards - (-1, 1) to normal 3D coordinate standards (0, 1) - - \deprecated - */ // TODO: Remove - Vector3 convertFromUnitToNormal(const Vector3& in, const Rect2D& viewport) const; - - /** - Sets the field of view, in radians. The - initial angle is toRadians(55). Must specify - the direction of the angle. - - This is the full angle, i.e., from the left side of the - viewport to the right side. - */ - void setFieldOfView(float angle, FOVDirection direction); - - /** Returns the current full field of view angle (from the left side of the - viewport to the right side) and direction */ - inline void getFieldOfView(float& angle, FOVDirection& direction) const { - angle = m_fieldOfView; - direction = m_direction; - } - - /** - Projects a world space point onto a width x height screen. The - returned coordinate uses pixmap addressing: x = right and y = - down. The resulting z value is 0 at the near plane, 1 at the far plane, - and is a linear compression of unit cube projection. - - If the point is behind the camera, Vector3::inf() is returned. - */ - Vector3 project(const G3D::Vector3& point, - const class Rect2D& viewport) const; - - /** - Projects a world space point onto a unit cube. The resulting - x,y,z values range between -1 and 1, where z is -1 - at the near plane and 1 at the far plane and varies hyperbolically in between. - - If the point is behind the camera, Vector3::inf() is returned. - */ - Vector3 projectUnit(const G3D::Vector3& point, - const class Rect2D& viewport) const; - - /** - Gives the world-space coordinates of screen space point v, where - v.x is in pixels from the left, v.y is in pixels from - the top, and v.z is on the range 0 (near plane) to 1 (far plane). - */ - Vector3 unproject(const Vector3& v, const Rect2D& viewport) const; - - /** - Gives the world-space coordinates of unit cube point v, where - v varies from -1 to 1 on all axes. The unproject first - transforms the point into a pixel location for the viewport, then calls unproject - */ - Vector3 unprojectUnit(const Vector3& v, const Rect2D& viewport) const; - - /** - Returns the pixel area covered by a shape of the given - world space area at the given z value (z must be negative). - */ - float worldToScreenSpaceArea(float area, float z, const class Rect2D& viewport) const; - - /** - Returns the world space 3D viewport corners. These - are at the near clipping plane. The corners are constructed - from the nearPlaneZ, viewportWidth, and viewportHeight. - "left" and "right" are from the GCamera's perspective. - */ - void getNearViewportCorners(const class Rect2D& viewport, - Vector3& outUR, Vector3& outUL, - Vector3& outLL, Vector3& outLR) const; - - /** - Returns the world space 3D viewport corners. These - are at the Far clipping plane. The corners are constructed - from the nearPlaneZ, farPlaneZ, viewportWidth, and viewportHeight. - "left" and "right" are from the GCamera's perspective. - */ - void getFarViewportCorners(const class Rect2D& viewport, - Vector3& outUR, Vector3& outUL, - Vector3& outLL, Vector3& outLR) const; - - /** - Returns the image plane depth, assumes imagePlane - is the same as the near clipping plane. - returns a positive number. - */ - float imagePlaneDepth() const; - - /** - Returns the world space ray passing through the center of pixel - (x, y) on the image plane. The pixel x and y axes are opposite - the 3D object space axes: (0,0) is the upper left corner of the screen. - They are in viewport coordinates, not screen coordinates. - - The ray origin is at the origin. To start it at the image plane, - move it forward by imagePlaneDepth/ray.direction.z - - Integer (x, y) values correspond to - the upper left corners of pixels. If you want to cast rays - through pixel centers, add 0.5 to x and y. - */ - Ray worldRay( - float x, - float y, - const class Rect2D& viewport) const; - - /** - Returns a negative z-value. - */ - inline float nearPlaneZ() const { - return m_nearPlaneZ; - } - - /** - Returns a negative z-value. - */ - inline float farPlaneZ() const { - return m_farPlaneZ; - } - - /** - Sets a new value for the far clipping plane - Expects a negative value - */ - inline void setFarPlaneZ(float z) { - debugAssert(z < 0); - m_farPlaneZ = z; - } - - /** - Sets a new value for the near clipping plane - Expects a negative value - */ - inline void setNearPlaneZ(float z) { - debugAssert(z < 0); - m_nearPlaneZ = z; - } - - /** - Returns the camera space width of the viewport at the near plane. - */ - float viewportWidth(const class Rect2D& viewport) const; - - /** - Returns the camera space height of the viewport at the near plane. - */ - float viewportHeight(const class Rect2D& viewport) const; - - void setPosition(const Vector3& t); - - /** Rotate the camera in place to look at the target. Does not - persistently look at that location when the camera moves; - i.e., if you move the camera and still want it to look at the - old target, you must call lookAt again after moving the - camera.)*/ - void lookAt(const Vector3& position, const Vector3& up = Vector3::unitY()); - - /** - Returns the clipping planes of the frustum, in world space. - The planes have normals facing into the view frustum. - - The plane order is guaranteed to be: - Near, Right, Left, Top, Bottom, [Far] - - If the far plane is at infinity, the resulting array will have - 5 planes, otherwise there will be 6. - - The viewport is used only to determine the aspect ratio of the screen; the - absolute dimensions and xy values don't matter. - */ - void getClipPlanes - ( - const Rect2D& viewport, - Array& outClip) const; - - /** - Returns the world space view frustum, which is a truncated pyramid describing - the volume of space seen by this camera. - */ - void frustum(const Rect2D& viewport, GCamera::Frustum& f) const; - - GCamera::Frustum frustum(const Rect2D& viewport) const; - - /** Read and Write camera parameters */ - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - -}; - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/GImage.h b/dep/include/g3dlite/G3D/GImage.h deleted file mode 100644 index 8ae11134fc9..00000000000 --- a/dep/include/g3dlite/G3D/GImage.h +++ /dev/null @@ -1,607 +0,0 @@ -/** - \file GImage.h - - See G3D::GImage for details. - - @cite JPEG compress/decompressor is the IJG library, used in accordance with their license. - @cite JPG code by John Chisholm, using the IJG Library - @cite TGA code by Morgan McGuire - @cite BMP code by John Chisholm, based on code by Edward "CGameProgrammer" Resnick mailto:cgp@gdnmail.net at ftp://ftp.flipcode.com/cotd/LoadPicture.txt - @cite PCX format described in the ZSOFT PCX manual http://www.nist.fss.ru/hr/doc/spec/pcx.htm#2 - @cite PNG compress/decompressor is the libpng library, used in accordance with their license. - @cite PPM code by Morgan McGuire based on http://netpbm.sourceforge.net/doc/ppm.html - - \maintainer Morgan McGuire, http://graphics.cs.williams.edu - - \created 2002-05-27 - \edited 2010-01-04 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_GImage_h -#define G3D_GImage_h - -#include "G3D/platform.h" -#include -#include "G3D/Array.h" -#include "G3D/g3dmath.h" -#include "G3D/stringutils.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" -#include "G3D/MemoryManager.h" -#include "G3D/BumpMapPreprocess.h" - -namespace G3D { -class BinaryInput; -class BinaryOutput; - - -/** - Interface to image compression & file formats. - - Supported formats (decode and encode): Color JPEG, PNG, - (Uncompressed)TGA 24, (Uncompressed)TGA 32, BMP 1, BMP 4, BMP 8, BMP - 24, PPM (P6), and PPM ASCII (P1, P2, P3), which includes PPM, PGM, - and PBM. 8-bit paletted PCX, 24-bit PCX, and ICO are supported for - decoding only. - - Sample usage: - - \verbatim - // Loading from disk: - G3D::GImage im1("test.jpg"); - - // Loading from memory: - G3D::GImage im2(data, length); - - // im.pixel is a pointer to RGB color data. If you want - // an alpha channel, call RGBtoRGBA or RGBtoARGB for - // conversion. - - // Saving to memory: - G3D::GImage im3(width, height); - // (Set the pixels of im3...) - uint8* data2; - int len2; - im3.encode(G3D::GImage::JPEG, data2, len2); - - // Saving to disk - im3.save("out.jpg"); - \endverbatim - - The free Image Magick Magick Wand API - (http://www.imagemagick.org/www/api/magick_wand.html) provides a more powerful - API for image manipulation and wider set of image load/save formats. It is - recommended over GImage (we don't include it directly in G3D because their license - is more restrictive than the BSD one). - - */ -class GImage { -private: - - /** Used exclusively for allocating m_byte; this may be an - implementation that allocates directly on a GPU.*/ - MemoryManager::Ref m_memMan; - uint8* m_byte; - - int m_channels; - int m_width; - int m_height; - -public: - - class Error { - public: - Error( - const std::string& reason, - const std::string& filename = "") : - reason(reason), filename(filename) {} - - std::string reason; - std::string filename; - }; - - /** PGM, PPM, and PBM all come in two versions and are classified as PPM_* files */ - enum Format {JPEG, BMP, TGA, PCX, ICO, PNG, - PPM_BINARY, PGM_BINARY = PPM_BINARY, - PPM_ASCII, PGM_ASCII = PPM_ASCII, - AUTODETECT, UNKNOWN}; - - - /** - The number of channels; either 3 (RGB) or 4 (RGBA) - */ - inline int channels() const { - return m_channels; - } - - inline int width() const { - return m_width; - } - - inline int height() const { - return m_height; - } - - inline const uint8* byte() const { - return m_byte; - } - - /** Returns a pointer to the underlying data, which is stored - in row-major order without row padding. - e.g., uint8* ptr = image.rawData(); - */ - template - inline const Type* rawData() const { - return (Type*)m_byte; - } - - /** \copybrief GImage::rawData() const */ - template - inline Type* rawData() { - return (Type*)m_byte; - } - - inline const Color1uint8* pixel1() const { - debugAssertM(m_channels == 1, format("Tried to call GImage::pixel1 on an image with %d channels", m_channels)); - return (Color1uint8*)m_byte; - } - - inline Color1uint8* pixel1() { - debugAssertM(m_channels == 1, format("Tried to call GImage::pixel1 on an image with %d channels", m_channels)); - return (Color1uint8*)m_byte; - } - - /** Returns a pointer to the upper left pixel - as Color4uint8. - */ - inline const Color4uint8* pixel4() const { - debugAssertM(m_channels == 4, format("Tried to call GImage::pixel4 on an image with %d channels", m_channels)); - return (Color4uint8*)m_byte; - } - - inline Color4uint8* pixel4() { - debugAssert(m_channels == 4); - return (Color4uint8*)m_byte; - } - - /** Returns a pointer to the upper left pixel - as Color3uint8. - */ - inline const Color3uint8* pixel3() const { - debugAssertM(m_channels == 3, format("Tried to call GImage::pixel3 on an image with %d channels", m_channels)); - return (Color3uint8*)m_byte; - } - - inline Color3uint8* pixel3() { - debugAssert(m_channels == 3); - return (Color3uint8*)m_byte; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color1uint8& pixel1(int x, int y) const { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel1()[x + y * m_width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline Color1uint8& pixel1(int x, int y) { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel1()[x + y * m_width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color3uint8& pixel3(int x, int y) const { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel3()[x + y * m_width]; - } - - inline Color3uint8& pixel3(int x, int y) { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel3()[x + y * m_width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color4uint8& pixel4(int x, int y) const { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel4()[x + y * m_width]; - } - - inline Color4uint8& pixel4(int x, int y) { - debugAssert(x >= 0 && x < m_width); - debugAssert(y >= 0 && y < m_height); - return pixel4()[x + y * m_width]; - } - - inline uint8* byte() { - return m_byte; - } - -private: - - void encodeBMP( - BinaryOutput& out) const; - - /** - The TGA file will be either 24- or 32-bit depending - on the number of channels. - */ - void encodeTGA( - BinaryOutput& out) const; - - /** - Converts this image into a JPEG - */ - void encodeJPEG( - BinaryOutput& out) const; - - /** - Converts this image into a JPEG - */ - void encodePNG( - BinaryOutput& out) const; - - void encodePPM( - BinaryOutput& out) const; - - void encodePPMASCII( - BinaryOutput& out) const; - - void decodeTGA( - BinaryInput& input); - - void decodeBMP( - BinaryInput& input); - - void decodeJPEG( - BinaryInput& input); - - void decodePCX( - BinaryInput& input); - - void decodeICO( - BinaryInput& input); - - void decodePNG( - BinaryInput& input); - - void decodePPM( - BinaryInput& input); - - void decodePPMASCII( - BinaryInput& input); - - /** - Given [maybe] a filename, memory buffer, and [maybe] a format, - returns the most likely format of this file. - */ - static Format resolveFormat( - const std::string& filename, - const uint8* data, - int dataLen, - Format maybeFormat); - - void _copy( - const GImage& other); - -public: - - /** Predicts the image file format of \a filename */ - static Format resolveFormat(const std::string& filename); - - void flipHorizontal(); - void flipVertical(); - void rotate90CW(int numTimes = 1); - - /** - Create an empty image of the given size. - \sa load() - */ - GImage( - int width = 0, - int height = 0, - int channels = 3, - const MemoryManager::Ref& m = MemoryManager::create()); - - /** - Load an encoded image from disk and decode it. - Throws GImage::Error if something goes wrong. - */ - GImage( - const std::string& filename, - Format format = AUTODETECT, - const MemoryManager::Ref& m = MemoryManager::create()); - - /** - Decodes an image stored in a buffer. - */ - GImage( - const unsigned char*data, - int length, - Format format = AUTODETECT, - const MemoryManager::Ref& m = MemoryManager::create()); - - GImage( - const GImage& other, - const MemoryManager::Ref& m = MemoryManager::create()); - - GImage& operator=(const GImage& other); - - /** - Returns a new GImage that has 4 channels. RGB is - taken from this GImage and the alpha from the red - channel of the supplied image. The new GImage is passed - as a reference parameter for speed. - */ - void insertRedAsAlpha(const GImage& alpha, GImage& output) const; - - /** - Returns a new GImage with 3 channels, removing - the alpha channel if there is one. The new GImage - is passed as a reference parameter for speed. - */ - void stripAlpha(GImage& output) const; - - /** - Loads an image from disk (clearing the old one first), - using the existing memory manager. - */ - void load( - const std::string& filename, - Format format = AUTODETECT); - - /** - Frees memory and resets to a 0x0 image. - */ - void clear(); - - /** - Deallocates the pixels. - */ - virtual ~GImage(); - - /** - Resizes the internal buffer to (\a width x \a height) with the - number of \a channels specified. - - \param zero If true, all data is set to 0 (black). - */ - void resize(int width, int height, int channels, bool zero = true); - - /** - Copies src sub-image data into dest at a certain offset. - The dest variable must already contain an image that is large - enough to contain the src sub-image at the specified offset. - Returns true on success and false if the src sub-image cannot - completely fit within dest at the specified offset. Both - src and dest must have the same number of channels. - */ - static bool pasteSubImage( - GImage& dest, - const GImage& src, - int destX, - int destY, - int srcX, - int srcY, - int srcWidth, - int srcHeight); - - /** - creates dest from src sub-image data. - Returns true on success and false if the src sub-image - is not within src. - */ - static bool copySubImage(GImage & dest, const GImage & src, - int srcX, int srcY, int srcWidth, int srcHeight); - - void convertToRGBA(); - - void convertToRGB(); - - /** Averages color channels if they exist */ - void convertToL8(); - - /** - Returns true if format is supported. Format - should be an extension string (e.g. "BMP"). - */ - static bool supportedFormat( - const std::string& format); - - /** - Converts a string to an enum, returns UNKNOWN if not recognized. - */ - static Format stringToFormat( - const std::string& format); - - /** - Encode and save to disk. - */ - void save( - const std::string& filename, - Format format = AUTODETECT) const; - - /** - The caller must delete the returned buffer. - TODO: provide a memory manager - */ - void encode( - Format format, - uint8*& outData, - int& outLength) const; - - /** - Does not commit the BinaryOutput when done. - */ - void encode( - Format format, - BinaryOutput& out) const; - - /** - Decodes the buffer into this image. - @param format Must be the correct format. - */ - void decode( - BinaryInput& input, - Format format); - - /** Returns the size of this object in bytes */ - int sizeInMemory() const; - - /** Ok for in == out */ - static void R8G8B8_to_Y8U8V8(int width, int height, const uint8* in, uint8* out); - - /** Ok for in == out */ - static void Y8U8V8_to_R8G8B8(int width, int height, const uint8* in, uint8* out); - - /** - @param in RGB buffer of numPixels * 3 bytes - @param out Buffer of numPixels * 4 bytes - @param numPixels Number of RGB pixels to convert - */ - static void RGBtoRGBA( - const uint8* in, - uint8* out, - int numPixels); - - static void RGBtoARGB( - const uint8* in, - uint8* out, - int numPixels); - - static void LtoRGB - (const uint8* in, - uint8* out, - int numPixels); - - static void LtoRGBA - (const uint8* in, - uint8* out, - int numPixels); - - /** Safe for in == out */ - static void RGBtoBGR( - const uint8* in, - uint8* out, - int numPixels); - - /** - Win32 32-bit HDC format. - */ - static void RGBtoBGRA( - const uint8* in, - uint8* out, - int numPixels); - - static void RGBAtoRGB( - const uint8* in, - uint8* out, - int numPixels); - /** - Uses the red channel of the second image as an alpha channel. - */ - static void RGBxRGBtoRGBA( - const uint8* colorRGB, - const uint8* alphaRGB, - uint8* out, - int numPixels); - - /** - Flips the image along the vertical axis. - Safe for in == out. - */ - static void flipRGBVertical( - const uint8* in, - uint8* out, - int width, - int height); - - static void flipRGBAVertical( - const uint8* in, - uint8* out, - int width, - int height); - - /** - Given a tangent space bump map, computes a new image where the - RGB channels are a tangent space normal map and the alpha channel - is the original bump map. Assumes the input image is tileable. - - In the resulting image, x = red = tangent, y = green = binormal, and z = blue = normal. - - Particularly useful as part of the idiom: -
- 	    GImage normal;
-	    computeNormalMap(GImage(filename), normal);
-	    return Texture::fromGImage(filename, normal);
-    
- - */ - static void computeNormalMap( - const class GImage& bump, - class GImage& normal, - const BumpMapPreprocess& preprocess = BumpMapPreprocess()); - - static void computeNormalMap - (int width, - int height, - int channels, - const uint8* src, - GImage& normal, - const BumpMapPreprocess& preprocess = BumpMapPreprocess()); - - /** - Bayer demosaicing using the filter proposed in - - HIGH-QUALITY LINEAR INTERPOLATION FOR DEMOSAICING OF BAYER-PATTERNED COLOR IMAGES - Henrique S. Malvar, Li-wei He, and Ross Cutler - - The filter wraps at the image boundaries. - - Assumes in != out. - */ - static void BAYER_G8B8_R8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_G8R8_B8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_R8G8_G8B8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_B8G8_G8R8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - - /** Fast conversion; the output has 1/2 the size of the input in each direction. Assumes in != out. - See G3D::BAYER_G8B8_R8G8_to_R8G8B8_MHC for a much better result. */ - static void BAYER_G8B8_R8G8_to_Quarter_R8G8B8 - (int inWidth, - int inHeight, - const uint8* in, - uint8* out); - - /** Attempt to undo fast conversion of G3D::BAYER_G8B8_R8G8_to_Quarter_R8G8B8; - the green channel will lose data. Assumes in != out - The input should have size 3 * inWidth * inHeight. The output should have size - 2 * inWidth * 2 * inHeight. - */ - static void Quarter_R8G8B8_to_BAYER_G8B8_R8G8 - (int inWidth, - int inHeight, - const uint8* in, - uint8* out); - - /** Overwrites every pixel with one of the two colors in a checkerboard pattern. - The fields used from the two colors depend on the current number of channels in @a im. - */ - static void makeCheckerboard - (GImage& im, - int checkerSize = 1, - const Color4uint8& color1 = Color4uint8(255,255,255,255), - const Color4uint8& color2 = Color4uint8(0,0,0,255)); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/GLight.h b/dep/include/g3dlite/G3D/GLight.h deleted file mode 100644 index 3a95f1a8114..00000000000 --- a/dep/include/g3dlite/G3D/GLight.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - @file GLight.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-11-12 - @edited 2009-11-08 -*/ - -#ifndef G3D_GLight_h -#define G3D_GLight_h - -#include "G3D/platform.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Color4.h" - -namespace G3D { -class Any; - -/** - A light representation that closely follows the OpenGL light format. - */ -class GLight { -public: - /** World space position (for a directional light, w = 0 */ - Vector4 position; - - /** For a spot or directional light, this is the "right vector" that will be used when constructing - a reference frame(). */ - Vector3 rightDirection; - - /** Direction in which the light faces, if a spot light. This is the "look vector" of the light source. */ - Vector3 spotDirection; - - /** In degrees. 180 = no cutoff (point/dir). Values less than 90 = spot light */ - float spotCutoff; - - /** If true, G3D::SuperShader will render a cone of light large - enough to encompass the entire square that bounds the cutoff - angle. This produces a square prism instead of a cone of light - when used with a G3D::ShadowMap. for an unshadowed light this - has no effect.*/ - bool spotSquare; - - /** Constant, linear, quadratic */ - float attenuation[3]; - - /** May be outside the range [0, 1] */ - Color3 color; - - /** If false, this light is ignored */ - bool enabled; - - /** If false, this light does not create specular highlights - (useful when using negative lights). */ - bool specular; - - /** If false, this light does not create diffuse illumination - (useful when rendering a specular-only pass). */ - bool diffuse; - - GLight(); - - /** Accepted forms: - - GLight::directional( vector3, color3, [bool, [bool]]) - - GLight::spot(vector3, vector3, #, color3, [#, [#, [#, [#, [bool, [bool]]]]) - - GLight::point(vector3, color3, [#, [#, [#, [#, [bool, [bool]]]]) - - GLight { [all fields] } - */ - GLight(const Any& any); - - /** Converts the Color3 to an Any. */ - operator Any() const; - - /** @param toLight will be normalized */ - static GLight directional(const Vector3& toLight, const Color3& color, bool specular = true, bool diffuse = true); - - static GLight point(const Vector3& pos, const Color3& color, float constAtt = 1, float linAtt = 0, float quadAtt = 0.5f, bool specular = true, bool diffuse = true); - - /** @param pointDirection Will be normalized. Points in the - direction that light propagates. - - @param cutOffAngleDegrees Must be on the range [0, 90]. This - is the angle from the point direction to the edge of the light - cone. I.e., a value of 45 produces a light with a 90-degree - cone of view. - */ - static GLight spot(const Vector3& pos, const Vector3& pointDirection, float cutOffAngleDegrees, - const Color3& color, float constAtt = 1, float linAtt = 0, float quadAtt = 0, - bool specular = true, bool diffuse = true); - - /** Returns the sphere within which this light has some noticable effect. May be infinite. - @param cutoff The value at which the light intensity is considered negligible. */ - class Sphere effectSphere(float cutoff = 30.0f / 255) const; - - /** Computes a reference frame (e.g., for use with G3D::ShadowMap */ - class CoordinateFrame frame() const; - - bool operator==(const GLight& other) const; - bool operator!=(const GLight& other) const; -}; - -} // namespace -#endif - diff --git a/dep/include/g3dlite/G3D/GMutex.h b/dep/include/g3dlite/G3D/GMutex.h deleted file mode 100644 index 3469b812736..00000000000 --- a/dep/include/g3dlite/G3D/GMutex.h +++ /dev/null @@ -1,123 +0,0 @@ -/** - @file GMutex.h - - @created 2005-09-22 - @edited 2009-03-25 - */ - -#ifndef G3D_GMutex_h -#define G3D_GMutex_h - -#include "G3D/platform.h" -#include "G3D/AtomicInt32.h" -#include "G3D/debugAssert.h" -#include - -#ifndef G3D_WIN32 -# include -# include -#endif - - -namespace G3D { - -/** - \brief A mutual exclusion lock that busy-waits when locking. - - On a machine with one (significant) thread per processor core, - a spinlock may be substantially faster than a mutex. - - \sa G3D::GThread, G3D::GMutex, G3D::AtomicInt32 - */ -class Spinlock { -private: - - AtomicInt32 x; - -public: - - inline Spinlock() : x(0) {} - - /** Busy waits until the lock is unlocked, then locks it - exclusively. Returns true if the lock succeeded on the first - try (indicating no contention). */ - inline bool lock() { - bool first = true; - while (x.compareAndSet(0, 1) == 1) { - first = false; -# ifdef G3D_WIN32 - Sleep(0); -# else - usleep(0); -# endif - } - return first; - } - - inline void unlock() { - x.compareAndSet(1, 0); - } - -}; - -/** - \brief Mutual exclusion lock used for synchronization. - - @sa G3D::GThread, G3D::AtomicInt32, G3D::Spinlock -*/ -class GMutex { -private: -# ifdef G3D_WIN32 - CRITICAL_SECTION m_handle; -# else - pthread_mutex_t m_handle; - pthread_mutexattr_t m_attr; -# endif - - // Not implemented on purpose, don't use - GMutex(const GMutex &mlock); - GMutex &operator=(const GMutex &); - bool operator==(const GMutex&); - -public: - GMutex(); - ~GMutex(); - - /** Locks the mutex or blocks until available. */ - void lock(); - - /** Locks the mutex if it not already locked. - Returns true if lock successful, false otherwise. */ - bool tryLock(); - - /** Unlocks the mutex. */ - void unlock(); -}; - - -/** - Automatically locks while in scope. -*/ -class GMutexLock { -private: - GMutex* m; - - // Not implemented on purpose, don't use - GMutexLock(const GMutexLock &mlock); - GMutexLock &operator=(const GMutexLock &); - bool operator==(const GMutexLock&); - -public: - GMutexLock(GMutex* mutex) { - m = mutex; - m->lock(); - } - - ~GMutexLock() { - m->unlock(); - } -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/GThread.h b/dep/include/g3dlite/G3D/GThread.h deleted file mode 100644 index 58437efc3fb..00000000000 --- a/dep/include/g3dlite/G3D/GThread.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - @file GThread.h - - @created 2005-09-22 - @edited 2007-01-31 - - */ - -#ifndef G3D_GTHREAD_H -#define G3D_GTHREAD_H - -#include "G3D/platform.h" -#include "G3D/ReferenceCount.h" -#include - -#ifndef G3D_WIN32 -# include -# include -#endif - - -namespace G3D { - -typedef ReferenceCountedPointer GThreadRef; - -/** - Platform independent thread implementation. You can either subclass and - override GThread::threadMain or call the create method with a method. - - Beware of reference counting and threads. If circular references exist between - GThread subclasses then neither class will ever be deallocated. Also, - dropping all pointers (and causing deallocation) of a GThread does NOT - stop the underlying process. - - @sa G3D::GMutex, G3D::Spinlock, G3D::AtomicInt32 -*/ -class GThread : public ReferenceCountedObject { -private: - // "Status" is a reserved work on FreeBSD - enum GStatus {STATUS_CREATED, STATUS_STARTED, STATUS_RUNNING, STATUS_COMPLETED}; - - // Not implemented on purpose, don't use - GThread(const GThread &); - GThread& operator=(const GThread&); - bool operator==(const GThread&); - -#ifdef G3D_WIN32 - static DWORD WINAPI internalThreadProc(LPVOID param); -#else - static void* internalThreadProc(void* param); -#endif //G3D_WIN32 - - volatile GStatus m_status; - - // Thread handle to hold HANDLE and pthread_t -#ifdef G3D_WIN32 - HANDLE m_handle; - HANDLE m_event; -#else - pthread_t m_handle; -#endif //G3D_WIN32 - - std::string m_name; - -protected: - - /** Overriden by the thread implementor */ - virtual void threadMain() = 0; - -public: - typedef ReferenceCountedPointer Ref; - enum SpawnBehavior {USE_NEW_THREAD, USE_CURRENT_THREAD}; - - GThread(const std::string& name); - - virtual ~GThread(); - - /** Constructs a basic GThread without requiring a subclass. - - @param proc The global or static function for the threadMain() */ - static GThreadRef create(const std::string& name, void (*proc)(void*), void* param = NULL); - - /** Starts the thread and executes threadMain(). Returns false if - the thread failed to start (either because it was already started - or because the OS refused). - - @param behavior If USE_CURRENT_THREAD, rather than spawning a new thread, this routine - runs threadMain on the current thread. - */ - bool start(SpawnBehavior behavior = USE_NEW_THREAD); - - /** Terminates the thread without notifying or - waiting for a cancelation point. */ - void terminate(); - - /** - Returns true if threadMain is currently executing. This will - only be set when the thread is actually running and might not - be set when start() returns. */ - bool running() const; - - /** True after start() has been called, even through the thread - may have already completed(), or be currently running().*/ - bool started() const; - - /** Returns true if the thread has exited. */ - bool completed() const; - - /** Waits for the thread to finish executing. */ - void waitForCompletion(); - - /** Returns thread name */ - inline const std::string& name() { - return m_name; - } -}; - - -} // namespace G3D - -#endif //G3D_GTHREAD_H diff --git a/dep/include/g3dlite/G3D/GUniqueID.h b/dep/include/g3dlite/G3D/GUniqueID.h deleted file mode 100644 index c8b775c2e66..00000000000 --- a/dep/include/g3dlite/G3D/GUniqueID.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - @file GUniqueID.h - @author Morgan McGuire, http://graphics.cs.williams.edu - */ -#ifndef G3D_GUNIQUEID_H -#define G3D_GUNIQUEID_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Table.h" - -namespace G3D { - -/** Globally unique identifiers. The probability of two different - programs generating the same value from UniqueID::create is - vanishingly small. - - UniqueIDs optionally contain a 10-bit application specific tag - that distinguishes their type. -*/ -class GUniqueID { -private: - - uint64 id; - -public: - - GUniqueID() : id(0) {} - - bool uninitialized() const { - return id == 0; - } - - uint16 tag() const { - return id >> 54; - } - - operator uint64() const { - return id; - } - - bool operator==(const GUniqueID& other) const { - return id == other.id; - } - - bool operator!=(const GUniqueID& other) const { - return id != other.id; - } - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - void serialize(class TextOutput& t) const; - - void deserialize(class TextInput& t); - - /** Create a new ID */ - static GUniqueID create(uint16 tag = 0); -}; - -} // G3D - -/** For Table and Set */ -template<> struct HashTrait { - static size_t hashCode(G3D::GUniqueID id) { return (size_t)(G3D::uint64)id; } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/HashTrait.h b/dep/include/g3dlite/G3D/HashTrait.h deleted file mode 100644 index ca35da48643..00000000000 --- a/dep/include/g3dlite/G3D/HashTrait.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - @file HashTrait.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2008-10-01 - @edited 2009-11-01 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_HashTrait_h -#define G3D_HashTrait_h - -#include "G3D/platform.h" -#include "G3D/Crypto.h" -#include "G3D/g3dmath.h" -#include "G3D/uint128.h" - -/** Must be specialized for custom types. - @see G3D::Table for specialization requirements. -*/ -template struct HashTrait{}; - -template struct HashTrait { - static size_t hashCode(const void* k) { return reinterpret_cast(k); } -}; - -#if 0 -template <> struct HashTrait { - static size_t hashCode(int k) { return static_cast(k); } -}; -#endif - -template <> struct HashTrait { - static size_t hashCode(G3D::int16 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(G3D::uint16 k) { return static_cast(k); } -}; - -//template <> struct HashTrait { -// static size_t hashCode(int k) { return static_cast(k); } -//}; - -template <> struct HashTrait { - static size_t hashCode(G3D::int32 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(G3D::uint32 k) { return static_cast(k); } -}; - -#if 0 -template <> struct HashTrait { - static size_t hashCode(G3D::uint32 k) { return static_cast(k); } -}; -#endif - -template <> struct HashTrait { - static size_t hashCode(G3D::int64 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(G3D::uint64 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(const std::string& k) { return static_cast(G3D::Crypto::crc32(k.c_str(), k.size())); } -}; - -template <> struct HashTrait { - // Use the FNV-1 hash (http://isthe.com/chongo/tech/comp/fnv/#FNV-1). - static size_t hashCode(G3D::uint128 key) { - static const G3D::uint128 FNV_PRIME_128(1 << 24, 0x159); - static const G3D::uint128 FNV_OFFSET_128(0xCF470AAC6CB293D2ULL, 0xF52F88BF32307F8FULL); - - G3D::uint128 hash = FNV_OFFSET_128; - G3D::uint128 mask(0, 0xFF); - for (int i = 0; i < 16; ++i) { - hash *= FNV_PRIME_128; - hash ^= (mask & key); - key >>= 8; - } - - G3D::uint64 foldedHash = hash.hi ^ hash.lo; - return static_cast((foldedHash >> 32) ^ (foldedHash & 0xFFFFFFFF)); - } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/Image1.h b/dep/include/g3dlite/G3D/Image1.h deleted file mode 100644 index 711e83f2079..00000000000 --- a/dep/include/g3dlite/G3D/Image1.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - @file Image1.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE1_H -#define G3D_IMAGE1_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color1.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image1Ref; - -/** - Luminance image with 32-bit floating point storage. - - See also G3D::Image1uint8, G3D::GImage. - */ -class Image1 : public Map2D { -public: - - typedef Image1 Type; - typedef ReferenceCountedPointer Ref; - typedef Color1 Storage; - typedef Color1 Compute; - -protected: - - Image1(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage1uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Image1uint8.h b/dep/include/g3dlite/G3D/Image1uint8.h deleted file mode 100644 index f32e022e92a..00000000000 --- a/dep/include/g3dlite/G3D/Image1uint8.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - @file Image1uint8.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE1UINT8_H -#define G3D_IMAGE1UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color1.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image1uint8Ref; - -/** - Compact storage for luminance 8-bit images. - - See also G3D::Image3, G3D::GImage - */ -class Image1uint8 : public Map2D { -public: - - typedef Image1uint8 Type; - typedef Image1uint8Ref Ref; - -protected: - - Image1uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage1(const ReferenceCountedPointer& im); - static Ref fromImage3uint8(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Image3.h b/dep/include/g3dlite/G3D/Image3.h deleted file mode 100644 index 13cb8fa7faf..00000000000 --- a/dep/include/g3dlite/G3D/Image3.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - @file Image3.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE3_H -#define G3D_IMAGE3_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color3.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image3Ref; - -/** - RGB image with 32-bit floating point storage for each channel. - - See also G3D::Image3uint8, G3D::GImage. - */ -class Image3 : public Map2D { -public: - - typedef Image3 Type; - typedef ReferenceCountedPointer Ref; - typedef Color3 Storage; - typedef Color3 Compute; - -protected: - - Image3(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage3uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Image3uint8.h b/dep/include/g3dlite/G3D/Image3uint8.h deleted file mode 100644 index d4fdbc169ca..00000000000 --- a/dep/include/g3dlite/G3D/Image3uint8.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - @file Image3uint8.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE3UINT8_H -#define G3D_IMAGE3UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color3.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image3uint8Ref; - -/** - Compact storage for RGB 8-bit per channel images. - - See also G3D::Image3, G3D::GImage - */ -class Image3uint8 : public Map2D { -public: - - typedef Image3uint8 Type; - typedef Image3uint8Ref Ref; - -protected: - - Image3uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage3(const ReferenceCountedPointer& im); - static Ref fromImage1uint8(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Extracts color channel 0 <= c <= 2 and returns it as a new monochrome image. */ - ReferenceCountedPointer getChannel(int c) const; -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Image4.h b/dep/include/g3dlite/G3D/Image4.h deleted file mode 100644 index 21d7f1e79b1..00000000000 --- a/dep/include/g3dlite/G3D/Image4.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - @file Image4.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE4_H -#define G3D_IMAGE4_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color4.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image4Ref; - -/** - RGBA image with 32-bit floating point storage for each channel. - - Whenever a method needs to convert from RGB to RGBA, A=1 is assumed. - - Bilinear interpolation on Image4 is about 8x faster than on - Image4uint8 due to the large cost of converting int->float on modern - machines. - - @sa G3D::Image4uint8, G3D::GImage. - */ -class Image4 : public Map2D { -public: - - typedef Image4 Type; - typedef ReferenceCountedPointer Ref; - typedef Color4 Storage; - typedef Color4 Compute; - -protected: - - Image4(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage4uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Image4uint8.h b/dep/include/g3dlite/G3D/Image4uint8.h deleted file mode 100644 index 46df6b490b4..00000000000 --- a/dep/include/g3dlite/G3D/Image4uint8.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - @file Image4uint8.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE4UINT8_H -#define G3D_IMAGE4UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color4.h" -#include "G3D/GImage.h" -#include "G3D/Image1uint8.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image4uint8Ref; - -/** - Compact storage for RGBA 8-bit per channel images. - - See also G3D::Image4, G3D::GImage - */ -class Image4uint8 : public Map2D { -public: - - typedef Image4uint8 Type; - typedef Image4uint8Ref Ref; - -protected: - - Image4uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage4(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Extracts color channel 0 <= c <= 3 and returns it as a new monochrome image. */ - ReferenceCountedPointer getChannel(int c) const; -}; - -} // G3D - -#endif diff --git a/dep/include/g3dlite/G3D/ImageFormat.h b/dep/include/g3dlite/G3D/ImageFormat.h deleted file mode 100644 index 7f098322d26..00000000000 --- a/dep/include/g3dlite/G3D/ImageFormat.h +++ /dev/null @@ -1,419 +0,0 @@ -/** - @file ImageFormat.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-05-23 - @edited 2010-01-01 -*/ - -#ifndef GLG3D_ImageFormat_H -#define GLG3D_ImageFormat_H - -#include "G3D/platform.h" -#include "G3D/Table.h" -#include "G3D/enumclass.h" - -namespace G3D { - -/** Information about common image formats. - Don't construct these; use the methods provided. - - For most formats, the number indicates the number of bits per channel and a suffix of "F" indicates - floating point. This does not hold for the YUV and DXT formats.*/ -class ImageFormat { -public: - - // Must update ImageFormat::name() when this enum changes. - enum Code { - CODE_NONE = -1, - CODE_L8, - CODE_L16, - CODE_L16F, - CODE_L32F, - - CODE_A8, - CODE_A16, - CODE_A16F, - CODE_A32F, - - CODE_LA4, - CODE_LA8, - CODE_LA16, - CODE_LA16F, - CODE_LA32F, - - CODE_RGB5, - CODE_RGB5A1, - CODE_RGB8, - CODE_RGB10, - CODE_RGB10A2, - CODE_RGB16, - CODE_RGB16F, - CODE_RGB32F, - CODE_R11G11B10F, - CODE_RGB9E5F, - - CODE_RGB8I, - CODE_RGB8UI, - - CODE_ARGB8, - CODE_BGR8, - - CODE_RG8, - CODE_RG8I, - CODE_RG8UI, - - CODE_RGBA8, - CODE_RGBA16, - CODE_RGBA16F, - CODE_RGBA32F, - - CODE_RGBA32UI, - - CODE_BAYER_RGGB8, - CODE_BAYER_GRBG8, - CODE_BAYER_GBRG8, - CODE_BAYER_BGGR8, - CODE_BAYER_RGGB32F, - CODE_BAYER_GRBG32F, - CODE_BAYER_GBRG32F, - CODE_BAYER_BGGR32F, - - CODE_HSV8, - CODE_HSV32F, - - CODE_YUV420_PLANAR, - CODE_YUV422, - CODE_YUV444, - - CODE_RGB_DXT1, - CODE_RGBA_DXT1, - CODE_RGBA_DXT3, - CODE_RGBA_DXT5, - - CODE_SRGB8, - CODE_SRGBA8, - - CODE_SL8, - CODE_SLA8, - - CODE_SRGB_DXT1, - CODE_SRGBA_DXT1, - CODE_SRGBA_DXT3, - CODE_SRGBA_DXT5, - - CODE_DEPTH16, - CODE_DEPTH24, - CODE_DEPTH32, - CODE_DEPTH32F, - - CODE_STENCIL1, - CODE_STENCIL4, - CODE_STENCIL8, - CODE_STENCIL16, - - CODE_DEPTH24_STENCIL8, - - CODE_NUM - }; - - enum ColorSpace { - COLOR_SPACE_NONE, - COLOR_SPACE_RGB, - COLOR_SPACE_HSV, - COLOR_SPACE_YUV, - COLOR_SPACE_SRGB - }; - - enum BayerPattern { - BAYER_PATTERN_NONE, - BAYER_PATTERN_RGGB, - BAYER_PATTERN_GRBG, - BAYER_PATTERN_GBRG, - BAYER_PATTERN_BGGR - }; - - /** Number of channels (1 for a depth texture). */ - int numComponents; - bool compressed; - - /** Useful for serializing. */ - Code code; - - ColorSpace colorSpace; - - /** If this is a Bayer format, what is the pattern. */ - BayerPattern bayerPattern; - - /** The OpenGL format equivalent to this one, e.g, GL_RGB8 Zero if there is no equivalent. This is actually a GLenum */ - int openGLFormat; - - /** The OpenGL base format equivalent to this one (e.g., GL_RGB, GL_ALPHA). Zero if there is no equivalent. */ - int openGLBaseFormat; - - int luminanceBits; - - /** Number of bits per pixel storage for alpha values; Zero for compressed textures and non-RGB. */ - int alphaBits; - - /** Number of bits per pixel storage for red values; Zero for compressed textures and non-RGB. */ - int redBits; - - /** Number of bits per pixel storage for green values; Zero for compressed textures and non-RGB. */ - int greenBits; - - /** Number of bits per pixel storage for blue values; Zero for compressed textures and non-RGB. */ - int blueBits; - - /** Number of bits per pixel */ - int stencilBits; - - /** Number of depth bits (for depth textures; e.g. shadow maps) */ - int depthBits; - - /** Amount of CPU memory per pixel when packed into an array, discounting any end-of-row padding. */ - int cpuBitsPerPixel; - - /** Amount of CPU memory per pixel when packed into an array, discounting any end-of-row padding. - @deprecated Use cpuBitsPerPixel*/ - int packedBitsPerTexel; - - /** - Amount of GPU memory per pixel on most graphics cards, for formats supported by OpenGL. This is - only an estimate--the actual amount of memory may be different on your actual card. - - This may be greater than the sum of the per-channel bits - because graphics cards need to pad to the nearest 1, 2, or - 4 bytes. - */ - int openGLBitsPerPixel; - - /** @deprecated Use openGLBitsPerPixel */ - int hardwareBitsPerTexel; - - /** The OpenGL bytes (type) format of the data buffer used with this texture format, e.g., GL_UNSIGNED_BYTE */ - int openGLDataFormat; - - /** True if there is no alpha channel for this texture. */ - bool opaque; - - /** True if the bit depths specified are for float formats. */ - bool floatingPoint; - - /** Human readable name of this format.*/ - const std::string& name() const; - - /** Takes the same values that name() returns */ - static const ImageFormat* fromString(const std::string& s); - -private: - - ImageFormat - (int numComponents, - bool compressed, - int glFormat, - int glBaseFormat, - int luminanceBits, - int alphaBits, - int redBits, - int greenBits, - int blueBits, - int depthBits, - int stencilBits, - int hardwareBitsPerTexel, - int packedBitsPerTexel, - int glDataFormat, - bool opaque, - bool floatingPoint, - Code code, - ColorSpace colorSpace, - BayerPattern bayerPattern = BAYER_PATTERN_NONE); - -public: - - static const ImageFormat* L8(); - - static const ImageFormat* L16(); - - static const ImageFormat* L16F(); - - static const ImageFormat* L32F(); - - static const ImageFormat* A8(); - - static const ImageFormat* A16(); - - static const ImageFormat* A16F(); - - static const ImageFormat* A32F(); - - static const ImageFormat* LA4(); - - static const ImageFormat* LA8(); - - static const ImageFormat* LA16(); - - static const ImageFormat* LA16F(); - - static const ImageFormat* LA32F(); - - static const ImageFormat* BGR8(); - - static const ImageFormat* RG8(); - static const ImageFormat* RG8I(); - static const ImageFormat* RG8UI(); - - static const ImageFormat* RGB5(); - - static const ImageFormat* RGB5A1(); - - static const ImageFormat* RGB8(); - - static const ImageFormat* RGB10(); - - static const ImageFormat* RGB10A2(); - - static const ImageFormat* RGB16(); - - static const ImageFormat* RGB16F(); - - static const ImageFormat* RGB32F(); - - static const ImageFormat* RGBA8(); - - static const ImageFormat* RGBA16(); - - static const ImageFormat* RGBA16F(); - - static const ImageFormat* RGBA32F(); - - static const ImageFormat* RGBA32UI(); - - static const ImageFormat* R11G11B10F(); - - static const ImageFormat* RGB9E5F(); - - static const ImageFormat* RGB8I(); - - static const ImageFormat* RGB8UI(); - - static const ImageFormat* RGB_DXT1(); - - static const ImageFormat* RGBA_DXT1(); - - static const ImageFormat* RGBA_DXT3(); - - static const ImageFormat* RGBA_DXT5(); - - static const ImageFormat* SRGB8(); - - static const ImageFormat* SRGBA8(); - - static const ImageFormat* SL8(); - - static const ImageFormat* SLA8(); - - static const ImageFormat* SRGB_DXT1(); - - static const ImageFormat* SRGBA_DXT1(); - - static const ImageFormat* SRGBA_DXT3(); - - static const ImageFormat* SRGBA_DXT5(); - - static const ImageFormat* DEPTH16(); - - static const ImageFormat* DEPTH24(); - - static const ImageFormat* DEPTH32(); - - static const ImageFormat* DEPTH32F(); - - static const ImageFormat* STENCIL1(); - - static const ImageFormat* STENCIL4(); - - static const ImageFormat* STENCIL8(); - - static const ImageFormat* STENCIL16(); - - static const ImageFormat* DEPTH24_STENCIL8(); - - static const ImageFormat* YUV420_PLANAR(); - - static const ImageFormat* YUV422(); - - static const ImageFormat* YUV444(); - - /** - NULL pointer; indicates that the G3D::Texture class should choose - either RGBA8 or RGB8 depending on the presence of an alpha channel - in the input. - */ - static const ImageFormat* AUTO() { return NULL; } - - /** Returns DEPTH16, DEPTH24, or DEPTH32 according to the bits - specified. You can use "glGetInteger(GL_DEPTH_BITS)" to match - the screen's format.*/ - static const ImageFormat* depth(int depthBits = 24); - - /** Returns STENCIL1, STENCIL4, STENCIL8 or STENCIL16 according to the bits - specified. You can use "glGetInteger(GL_STENCIL_BITS)" to match - the screen's format.*/ - static const ImageFormat* stencil(int bits = 8); - - /** Returns the matching ImageFormat* identified by the Code. May return NULL - if this format's code is reserved but not yet implemented by G3D. */ - static const ImageFormat* fromCode(ImageFormat::Code code); - - - - /** For use with ImageFormat::convert. */ - class BayerAlgorithm { - public: - enum Value { - NEAREST, - BILINEAR, - MHC, - HIGH_QUALITY = MHC - }; - private: - - Value value; - - public: - - G3D_DECLARE_ENUM_CLASS_METHODS(BayerAlgorithm); - }; - - /** Converts between arbitrary formats on the CPU. Not all format conversions are supported or directly supported. - Formats without direct conversions will attempt to convert through RGBA first. - - A conversion routine might only support source or destination padding or y inversion or none. - If support is needed and not available in any of the direct conversion routines, then no conversion is done. - - YUV422 expects data in YUY2 format (Y, U, Y2, v). Most YUV formats require width and heights that are multiples of 2. - - Returns true if a conversion was available, false if none occurred. - */ - static bool convert(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, - const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, - bool invertY = false, BayerAlgorithm bayerAlg = BayerAlgorithm::HIGH_QUALITY); - - /* Checks if a conversion between two formats is available. */ - static bool conversionAvailable(const ImageFormat* srcFormat, int srcRowPadBits, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY = false); -}; - -typedef ImageFormat TextureFormat; - -} - -template <> -struct HashTrait { - static size_t hashCode(const G3D::ImageFormat* key) { return reinterpret_cast(key); } -}; - - - -#endif diff --git a/dep/include/g3dlite/G3D/Intersect.h b/dep/include/g3dlite/G3D/Intersect.h deleted file mode 100644 index 4a3c8fb4540..00000000000 --- a/dep/include/g3dlite/G3D/Intersect.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - @file Intersect.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-06-29 - @edited 2009-06-29 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - - From the G3D Innovation Engine - http://g3d.sf.net - */ -#ifndef G3D_Intersect -#define G3D_Intersect - -#include "G3D/platform.h" -#include "G3D/Ray.h" -#include "G3D/AABox.h" - -namespace G3D { - -/** - @beta - */ -class Intersect { -public: - - /** \brief Returns true if the intersection of the ray and the solid box is non-empty. - - \cite "Fast Ray / Axis-Aligned Bounding Box Overlap Tests using Ray Slopes" - by Martin Eisemann, Thorsten Grosch, Stefan Müller and Marcus Magnor - Computer Graphics Lab, TU Braunschweig, Germany and - University of Koblenz-Landau, Germany - */ - static bool __fastcall rayAABox(const Ray& ray, const AABox& box); - - /** \brief Returns true if the intersection of the ray and the solid box is non-empty. - - \param time If there is an intersection, set to the time to that intersection. If the ray origin is inside the box, - this is a negative value indicating the distance backwards from the ray origin to the first intersection. - \a time is not set if there is no intersection. - - \cite Slope-Mul method from "Fast Ray / Axis-Aligned Bounding Box Overlap Tests using Ray Slopes" - by Martin Eisemann, Thorsten Grosch, Stefan Müller and Marcus Magnor - Computer Graphics Lab, TU Braunschweig, Germany and - University of Koblenz-Landau, Germany - */ - static bool __fastcall rayAABox(const Ray& ray, const AABox& box, float& time); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/KDTree.h b/dep/include/g3dlite/G3D/KDTree.h deleted file mode 100644 index 4785ef2baea..00000000000 --- a/dep/include/g3dlite/G3D/KDTree.h +++ /dev/null @@ -1,1667 +0,0 @@ -/** - @file KDTree.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2004-01-11 - @edited 2009-12-28 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_KDTREE_H -#define G3D_KDTREE_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/Triangle.h" -#include "G3D/Ray.h" -#include "G3D/GCamera.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/CollisionDetection.h" -#include "G3D/GCamera.h" -#include "G3D/BoundsTrait.h" -#include - -// If defined, in debug mode the tree is checked for consistency -// as a way of detecting corruption due to implementation bugs -// #define VERIFY_TREE - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector2& v, G3D::AABox& out) { out = G3D::AABox(G3D::Vector3(v, 0)); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector3& v, G3D::AABox& out) { out = G3D::AABox(v); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector4& v, G3D::AABox& out) { out = G3D::AABox(v.xyz()); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::AABox& v, G3D::AABox& out) { out = v; } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Sphere& s, G3D::AABox& out) { s.getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Box& b, G3D::AABox& out) { b.getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector2*& v, G3D::AABox& out) { out = G3D::AABox(G3D::Vector3(*v, 0)); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector3*& v, G3D::AABox& out) { out = G3D::AABox(*v); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector4*& v, G3D::AABox& out) { out = G3D::AABox(v->xyz()); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::AABox*& v, G3D::AABox& out) { out = *v; } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Sphere*& s, G3D::AABox& out) { s->getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Box*& b, G3D::AABox& out) { b->getBounds(out); } -}; - - -template<> struct BoundsTrait { - static void getBounds(const G3D::Triangle*& t, G3D::AABox& out) { t->getBounds(out); } -}; - -namespace G3D { - namespace _internal { - - /** - Wraps a pointer value so that it can be treated as the instance itself; - convenient for inserting pointers into a Table but using the - object equality instead of pointer equality. - */ - template - class Indirector { - public: - Type* handle; - - inline Indirector(Type* h) : handle(h) {} - - inline Indirector() : handle(NULL) {} - - /** Returns true iff the values referenced by the handles are equivalent. */ - inline bool operator==(const Indirector& m) const { - return *handle == *(m.handle); - } - - inline bool operator==(const Type& m) const { - return *handle == m; - } - - inline size_t hashCode() const { - return handle->hashCode(); - } - }; - } // namespace internal -} // namespace G3D - -template struct HashTrait > { - static size_t hashCode(const G3D::_internal::Indirector& key) { return key.hashCode(); } -}; - -namespace G3D { - -/** - A set that supports spatial queries using a KD tree (axis-aligned - BSP tree) for speed. - - KDTree allows you to quickly find objects in 3D that lie within - a box or along a ray. For large sets of objects it is much faster - than testing each object for a collision. - - KDTree is as powerful as but more general than a Quad Tree, Oct - Tree, or regular KD tree that cycles through axes, but less general than an unconstrained BSP tree - (which is much slower to create). - - Internally, objects - are arranged into a tree according to their - axis-aligned bounds. This increases the cost of insertion to - O(log n) but allows fast overlap queries. - - Template Parameters -
The template parameter T must be one for which - the following functions are all overloaded: - -
-  T::T(); // public constructor of no arguments
-  template <> struct HashTrait { static size_t hashCode(int key); };
-  template<> struct BoundsTrait { static void getBounds(const T& obj, G3D::AABox& out); };
- 
- - G3D provides these for common classes like G3D::Vector3 and G3D::Sphere. - If you use a custom class, or a pointer to a custom class, you will need - to define those functions. - - Moving %Set Members -
It is important that objects do not move without updating the - KDTree. If the axis-aligned bounds of an object are about - to change, KDTree::remove it before they change and - KDTree::insert it again afterward. For objects - where the hashCode and == operator are invariant with respect - to the 3D position, - you can use the KDTree::update method as a shortcut to - insert/remove an object in one step after it has moved. - - - Note: Do not mutate any value once it has been inserted into KDTree. Values - are copied interally. All KDTree iterators convert to pointers to constant - values to reinforce this. - - If you want to mutate the objects you intend to store in a KDTree - simply insert pointers to your objects instead of the objects - themselves, and ensure that the above operations are defined. (And - actually, because values are copied, if your values are large you may - want to insert pointers anyway, to save space and make the balance - operation faster.) - - Dimensions - Although designed as a 3D-data structure, you can use the KDTree - for data distributed along 2 or 1 axes by simply returning bounds - that are always zero along one or more dimensions. - -*/ -template< class T, - class BoundsFunc = BoundsTrait, - class HashFunc = HashTrait, - class EqualsFunc = EqualsTrait > -class KDTree { -protected: -#define TreeType KDTree - - /** Wrapper for a value that includes a cache of its bounds. - Except for the test value used in a set-query operation, there - is only ever one instance of the handle associated with any - value and the memberTable and Nodes maintain pointers to that - heap-allocated value. - */ - class Handle { - public: - /** The bounds of each object are constrained to AABox::large */ - AABox bounds; - - /** Center of bounds. We cache this value to avoid recomputing it - during the median sort, and because MSVC 6 std::sort goes into - an infinite loop if we compute the midpoint on the fly (possibly - a floating point roundoff issue, where B& point, - int beginIndex, - int endIndex) { - - Vector3 lo = Vector3::inf(); - Vector3 hi = -lo; - - debugAssertM(beginIndex <= endIndex, "No points"); - for (int p = beginIndex; p <= endIndex; ++p) { - // This code is written with the vector min and max expanded - // because otherwise it compiles incorrectly with -O3 on - // gcc 3.4 - - const Vector3& pLo = point[p]->bounds.low(); - const Vector3& pHi = point[p]->bounds.high(); - for (int a = 0; a < 3; ++a) { - lo[a] = G3D::min(lo[a], pLo[a]); - hi[a] = G3D::max(hi[a], pHi[a]); - } - } - - return AABox(lo, hi); - } - - /** Compares centers */ - class CenterComparator { - public: - Vector3::Axis sortAxis; - - CenterComparator(Vector3::Axis a) : sortAxis(a) {} - - inline int operator()(Handle* A, const Handle* B) const { - float a = A->center[sortAxis]; - float b = B->center[sortAxis]; - - if (a < b) { - return 1; - } else if (a > b) { - return -1; - } else { - return 0; - } - } - }; - - - /** Compares bounds for strict >, <, or overlap*/ - class BoundsComparator { - public: - Vector3::Axis sortAxis; - - BoundsComparator(Vector3::Axis a) : sortAxis(a) {} - - inline int operator()(Handle* A, const Handle* B) const { - const AABox& a = A->bounds; - const AABox& b = B->bounds; - - if (a.high()[sortAxis] < b.low()[sortAxis]) { - return 1; - } else if (a.low()[sortAxis] > b.high()[sortAxis]) { - return -1; - } else { - return 0; - } - } - }; - - - /** Compares bounds to the sort location */ - class Comparator { - public: - Vector3::Axis sortAxis; - float sortLocation; - - Comparator(Vector3::Axis a, float l) : sortAxis(a), sortLocation(l) {} - - inline int operator()(Handle* ignore, const Handle* handle) const { - (void)ignore; - const AABox& box = handle->bounds; - debugAssert(ignore == NULL); - - if (box.high()[sortAxis] < sortLocation) { - // Box is strictly below the sort location - return -1; - } else if (box.low()[sortAxis] > sortLocation) { - // Box is strictly above the sort location - return 1; - } else { - // Box overlaps the sort location - return 0; - } - } - }; - - // Using System::malloc with this class provided no speed improvement. - class Node { - public: - - /** Spatial bounds on all values at this node and its children, based purely on - the parent's splitting planes. May be infinite. */ - AABox splitBounds; - - Vector3::Axis splitAxis; - - /** Location along the specified axis */ - float splitLocation; - - /** child[0] contains all values strictly - smaller than splitLocation along splitAxis. - - child[1] contains all values strictly - larger. - - Both may be NULL if there are not enough - values to bother recursing. - */ - Node* child[2]; - - /** Array of values at this node (i.e., values - straddling the split plane + all values if - this is a leaf node). - - This is an array of pointers because that minimizes - data movement during tree building, which accounts - for about 15% of the time cost of tree building. - */ - Array valueArray; - - /** For each object in the value array, a copy of its bounds. - Packing these into an array at the node level - instead putting them in the valueArray improves - cache coherence, which is about a 3x performance - increase when performing intersection computations. - */ - Array boundsArray; - - /** Creates node with NULL children */ - Node() { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - splitBounds = AABox(-Vector3::inf(), Vector3::inf()); - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** - Doesn't clone children. - */ - Node(const Node& other) : valueArray(other.valueArray), boundsArray(other.boundsArray) { - splitAxis = other.splitAxis; - splitLocation = other.splitLocation; - splitBounds = other.splitBounds; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** Copies the specified subarray of pt into point, NULLs the children. - Assumes a second pass will set splitBounds. */ - Node(const Array& pt) : valueArray(pt) { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - - boundsArray.resize(valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - boundsArray[i] = valueArray[i]->bounds; - } - } - - /** Deletes the children (but not the values) */ - ~Node() { - for (int i = 0; i < 2; ++i) { - delete child[i]; - } - } - - /** Returns true if this node is a leaf (no children) */ - inline bool isLeaf() const { - return (child[0] == NULL) && (child[1] == NULL); - } - - - /** - Recursively appends all handles and children's handles - to the array. - */ - void getHandles(Array& handleArray) const { - handleArray.append(valueArray); - for (int i = 0; i < 2; ++i) { - if (child[i] != NULL) { - child[i]->getHandles(handleArray); - } - } - } - - void verifyNode(const Vector3& lo, const Vector3& hi) { - // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", - // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); - - debugAssertM(lo == splitBounds.low(), - format("lo = %s, splitBounds.lo = %s", - lo.toString().c_str(), splitBounds.low().toString().c_str())); - debugAssert(hi == splitBounds.high()); - - for (int i = 0; i < valueArray.length(); ++i) { - const AABox& b = valueArray[i]->bounds; - debugAssert(b == boundsArray[i]); - - for(int axis = 0; axis < 3; ++axis) { - debugAssert(b.low()[axis] <= b.high()[axis]); - debugAssert(b.low()[axis] >= lo[axis]); - debugAssert(b.high()[axis] <= hi[axis]); - } - } - - if (child[0] || child[1]) { - debugAssert(lo[splitAxis] < splitLocation); - debugAssert(hi[splitAxis] > splitLocation); - } - - Vector3 newLo = lo; - newLo[splitAxis] = splitLocation; - Vector3 newHi = hi; - newHi[splitAxis] = splitLocation; - - if (child[0] != NULL) { - child[0]->verifyNode(lo, newHi); - } - - if (child[1] != NULL) { - child[1]->verifyNode(newLo, hi); - } - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - static void serializeStructure(const Node* n, BinaryOutput& bo) { - if (n == NULL) { - bo.writeUInt8(0); - } else { - bo.writeUInt8(1); - n->splitBounds.serialize(bo); - serialize(n->splitAxis, bo); - bo.writeFloat32(n->splitLocation); - for (int c = 0; c < 2; ++c) { - serializeStructure(n->child[c], bo); - } - } - } - - /** Clears the member table */ - static Node* deserializeStructure(BinaryInput& bi) { - if (bi.readUInt8() == 0) { - return NULL; - } else { - Node* n = new Node(); - n->splitBounds.deserialize(bi); - deserialize(n->splitAxis, bi); - n->splitLocation = bi.readFloat32(); - for (int c = 0; c < 2; ++c) { - n->child[c] = deserializeStructure(bi); - } - return n; - } - } - - /** Returns the deepest node that completely contains bounds. */ - Node* findDeepestContainingNode(const AABox& bounds) { - - // See which side of the splitting plane the bounds are on - if (bounds.high()[splitAxis] < splitLocation) { - // Bounds are on the low side. Recurse into the child - // if it exists. - if (child[0] != NULL) { - return child[0]->findDeepestContainingNode(bounds); - } - } else if (bounds.low()[splitAxis] > splitLocation) { - // Bounds are on the high side, recurse into the child - // if it exists. - if (child[1] != NULL) { - return child[1]->findDeepestContainingNode(bounds); - } - } - - // There was no containing child, so this node is the - // deepest containing node. - return this; - } - - - /** Appends all members that intersect the box. - If useSphere is true, members that pass the box test - face a second test against the sphere. */ - void getIntersectingMembers( - const AABox& box, - const Sphere& sphere, - Array& members, - bool useSphere) const { - - // Test all values at this node - for (int v = 0; v < boundsArray.size(); ++v) { - const AABox& bounds = boundsArray[v]; - if (bounds.intersects(box) && - (! useSphere || bounds.intersects(sphere))) { - members.append(& (valueArray[v]->value)); - } - } - - // If the left child overlaps the box, recurse into it - if ((child[0] != NULL) && (box.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(box, sphere, members, useSphere); - } - - // If the right child overlaps the box, recurse into it - if ((child[1] != NULL) && (box.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(box, sphere, members, useSphere); - } - } - - /** - Recurse through the tree, assigning splitBounds fields. - */ - void assignSplitBounds(const AABox& myBounds) { - splitBounds = myBounds; - - AABox childBounds[2]; - myBounds.split(splitAxis, splitLocation, childBounds[0], childBounds[1]); - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - // Verify the split - for (int v = 0; v < boundsArray.size(); ++v) { - const AABox& bounds = boundsArray[v]; - debugAssert(myBounds.contains(bounds)); - } -# endif - - for (int c = 0; c < 2; ++c) { - if (child[c]) { - child[c]->assignSplitBounds(childBounds[c]); - } - } - } - - /** Returns true if the ray intersects this node */ - bool intersects(const Ray& ray, float distance) const { - // See if the ray will ever hit this node or its children - Vector3 location; - bool alreadyInsideBounds = false; - bool rayWillHitBounds = - CollisionDetection::collisionLocationForMovingPointFixedAABox( - ray.origin(), ray.direction(), splitBounds, location, alreadyInsideBounds); - - bool canHitThisNode = (alreadyInsideBounds || - (rayWillHitBounds && ((location - ray.origin()).squaredLength() < square(distance)))); - - return canHitThisNode; - } - - template - void intersectRay( - const Ray& ray, - RayCallback& intersectCallback, - float& distance, - bool intersectCallbackIsFast) const { - - if (! intersects(ray, distance)) { - // The ray doesn't hit this node, so it can't hit the children of the node. - return; - } - - // Test for intersection against every object at this node. - for (int v = 0; v < valueArray.size(); ++v) { - bool canHitThisObject = true; - - if (! intersectCallbackIsFast) { - // See if - Vector3 location; - const AABox& bounds = boundsArray[v]; - bool alreadyInsideBounds = false; - bool rayWillHitBounds = - CollisionDetection::collisionLocationForMovingPointFixedAABox( - ray.origin(), ray.direction(), bounds, location, alreadyInsideBounds); - - canHitThisObject = (alreadyInsideBounds || - (rayWillHitBounds && ((location - ray.origin()).squaredLength() < square(distance)))); - } - - if (canHitThisObject) { - // It is possible that this ray hits this object. Look for the intersection using the - // callback. - const T& value = valueArray[v]->value; - intersectCallback(ray, value, distance); - } - } - - // There are three cases to consider next: - // - // 1. the ray can start on one side of the splitting plane and never enter the other, - // 2. the ray can start on one side and enter the other, and - // 3. the ray can travel exactly down the splitting plane - - enum {NONE = -1}; - int firstChild = NONE; - int secondChild = NONE; - - if (ray.origin()[splitAxis] < splitLocation) { - - // The ray starts on the small side - firstChild = 0; - - if (ray.direction()[splitAxis] > 0) { - // The ray will eventually reach the other side - secondChild = 1; - } - - } else if (ray.origin()[splitAxis] > splitLocation) { - - // The ray starts on the large side - firstChild = 1; - - if (ray.direction()[splitAxis] < 0) { - secondChild = 0; - } - } else { - // The ray starts on the splitting plane - if (ray.direction()[splitAxis] < 0) { - // ...and goes to the small side - firstChild = 0; - } else if (ray.direction()[splitAxis] > 0) { - // ...and goes to the large side - firstChild = 1; - } - } - - // Test on the side closer to the ray origin. - if ((firstChild != NONE) && child[firstChild]) { - child[firstChild]->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - } - - if (ray.direction()[splitAxis] != 0) { - // See if there was an intersection before hitting the splitting plane. - // If so, there is no need to look on the far side and recursion terminates. - float distanceToSplittingPlane = (splitLocation - ray.origin()[splitAxis]) / ray.direction()[splitAxis]; - if (distanceToSplittingPlane > distance) { - // We aren't going to hit anything else before hitting the splitting plane, - // so don't bother looking on the far side of the splitting plane at the other - // child. - return; - } - } - - // Test on the side farther from the ray origin. - if ((secondChild != NONE) && child[secondChild]) { - child[secondChild]->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - } - - } - }; - - - /** - Recursively subdivides the subarray. - - Clears the source array as soon as it is no longer needed. - - Call assignSplitBounds() on the root node after making a tree. - */ - Node* makeNode( - Array& source, - int valuesPerNode, - int numMeanSplits, - Array& temp) { - - Node* node = NULL; - - if (source.size() <= valuesPerNode) { - // Make a new leaf node - node = new Node(source); - - // Set the pointers in the memberTable - for (int i = 0; i < source.size(); ++i) { - memberTable.set(Member(source[i]), node); - } - source.clear(); - - } else { - // Make a new internal node - node = new Node(); - - const AABox& bounds = computeBounds(source, 0, source.size() - 1); - const Vector3& extent = bounds.high() - bounds.low(); - - Vector3::Axis splitAxis = extent.primaryAxis(); - - float splitLocation; - - // Arrays for holding the children - Array lt, gt; - - if (numMeanSplits <= 0) { - - source.medianPartition(lt, node->valueArray, gt, temp, CenterComparator(splitAxis)); - - // Choose the split location to be the center of whatever fell in the center - splitLocation = node->valueArray[0]->center[splitAxis]; - - // Some of the elements in the lt or gt array might really overlap the split location. - // Move them as needed. - for (int i = 0; i < lt.size(); ++i) { - const AABox& bounds = lt[i]->bounds; - if ((bounds.low()[splitAxis] <= splitLocation) && (bounds.high()[splitAxis] >= splitLocation)) { - node->valueArray.append(lt[i]); - // Remove this element and process the new one that - // is swapped in in its place. - lt.fastRemove(i); --i; - } - } - - for (int i = 0; i < gt.size(); ++i) { - const AABox& bounds = gt[i]->bounds; - if ((bounds.low()[splitAxis] <= splitLocation) && (bounds.high()[splitAxis] >= splitLocation)) { - node->valueArray.append(gt[i]); - // Remove this element and process the new one that - // is swapped in in its place. - gt.fastRemove(i); --i; - } - } - - if ((node->valueArray.size() > (source.size() / 2)) && - (source.size() > 6)) { - // This was a bad partition; we ended up putting the splitting plane right in the middle of most of the - // objects. We could try to split on a different axis, or use a different partition (e.g., the extents mean, - // or geometric mean). This implementation falls back on the extents mean, since that case is already handled - // below. - numMeanSplits = 1; - } - } - - // Note: numMeanSplits may have been increased by the code in the previous case above in order to - // force a re-partition. - - if (numMeanSplits > 0) { - // Split along the mean - splitLocation = - bounds.high()[splitAxis] * 0.5f + - bounds.low()[splitAxis] * 0.5f; - - debugAssertM(isFinite(splitLocation), - "Internal error: split location must be finite."); - - source.partition(NULL, lt, node->valueArray, gt, Comparator(splitAxis, splitLocation)); - - // The Comparator ensures that elements are strictly on the correct side of the split - } - - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - debugAssert(lt.size() + node->valueArray.size() + gt.size() == source.size()); - // Verify that all objects ended up on the correct side of the split. - // (i.e., make sure that the Array partition was correct) - for (int i = 0; i < lt.size(); ++i) { - const AABox& bounds = lt[i]->bounds; - debugAssert(bounds.high()[splitAxis] < splitLocation); - } - - for (int i = 0; i < gt.size(); ++i) { - const AABox& bounds = gt[i]->bounds; - debugAssert(bounds.low()[splitAxis] > splitLocation); - } - - for (int i = 0; i < node->valueArray.size(); ++i) { - const AABox& bounds = node->valueArray[i]->bounds; - debugAssert(bounds.high()[splitAxis] >= splitLocation); - debugAssert(bounds.low()[splitAxis] <= splitLocation); - } -# endif - - // The source array is no longer needed - source.clear(); - - node->splitAxis = splitAxis; - node->splitLocation = splitLocation; - - // Update the bounds array and member table - node->boundsArray.resize(node->valueArray.size()); - for (int i = 0; i < node->valueArray.size(); ++i) { - Handle* v = node->valueArray[i]; - node->boundsArray[i] = v->bounds; - memberTable.set(Member(v), node); - } - - if (lt.size() > 0) { - node->child[0] = makeNode(lt, valuesPerNode, numMeanSplits - 1, temp); - } - - if (gt.size() > 0) { - node->child[1] = makeNode(gt, valuesPerNode, numMeanSplits - 1, temp); - } - - } - - return node; - } - - /** - Recursively clone the passed in node tree, setting - pointers for members in the memberTable as appropriate. - called by the assignment operator. - */ - Node* cloneTree(Node* src) { - Node* dst = new Node(*src); - - // Make back pointers - for (int i = 0; i < dst->valueArray.size(); ++i) { - memberTable.set(Member(dst->valueArray[i]), dst); - } - - // Clone children - for (int i = 0; i < 2; ++i) { - if (src->child[i] != NULL) { - dst->child[i] = cloneTree(src->child[i]); - } - } - - return dst; - } - - /** - Wrapper for a Handle; used to create a memberTable that acts like Table but - stores only Handle* internally to avoid memory copies. - */ - typedef _internal::Indirector Member; - - typedef Table MemberTable; - - /** Maps members to the node containing them */ - MemberTable memberTable; - - Node* root; - -public: - - /** To construct a balanced tree, insert the elements and then call - KDTree::balance(). */ - KDTree() : root(NULL) {} - - - KDTree(const KDTree& src) : root(NULL) { - *this = src; - } - - - KDTree& operator=(const KDTree& src) { - delete root; - // Clone tree takes care of filling out the memberTable. - root = cloneTree(src.root); - return *this; - } - - - ~KDTree() { - clear(); - } - - /** - Throws out all elements of the set. - */ - void clear() { - typedef typename Table<_internal::Indirector, Node*>::Iterator It; - - // Delete all handles stored in the member table - It cur = memberTable.begin(); - It end = memberTable.end(); - while (cur != end) { - delete cur->key.handle; - cur->key.handle = NULL; - ++cur; - } - memberTable.clear(); - - // Delete the tree structure itself - delete root; - root = NULL; - } - - int size() const { - return memberTable.size(); - } - - /** - Inserts an object into the set if it is not - already present. O(log n) time. Does not - cause the tree to be balanced. - */ - void insert(const T& value) { - if (contains(value)) { - // Already in the set - return; - } - - Handle* h = new Handle(value); - - if (root == NULL) { - // This is the first node; create a root node - root = new Node(); - } - - Node* node = root->findDeepestContainingNode(h->bounds); - - // Insert into the node - node->valueArray.append(h); - node->boundsArray.append(h->bounds); - - // Insert into the node table - Member m(h); - memberTable.set(m, node); - } - - /** Inserts each elements in the array in turn. If the tree - begins empty (no structure and no elements), this is faster - than inserting each element in turn. You still need to balance - the tree at the end.*/ - void insert(const Array& valueArray) { - if (root == NULL) { - // Optimized case for an empty tree; don't bother - // searching or reallocating the root node's valueArray - // as we incrementally insert. - root = new Node(); - root->valueArray.resize(valueArray.size()); - root->boundsArray.resize(root->valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - // Insert in opposite order so that we have the exact same - // data structure as if we inserted each (i.e., order is reversed - // from array). - Handle* h = new Handle(valueArray[i]); - int j = valueArray.size() - i - 1; - root->valueArray[j] = h; - root->boundsArray[j] = h->bounds; - memberTable.set(Member(h), root); - } - - } else { - // Insert at appropriate tree depth. - for (int i = 0; i < valueArray.size(); ++i) { - insert(valueArray[i]); - } - } - } - - - /** - Returns true if this object is in the set, otherwise - returns false. O(1) time. - */ - bool contains(const T& value) { - // Temporarily create a handle and member - Handle h(value); - return memberTable.containsKey(Member(&h)); - } - - - /** - Removes an object from the set in O(1) time. - It is an error to remove members that are not already - present. May unbalance the tree. - - Removing an element never causes a node (split plane) to be removed... - nodes are only changed when the tree is rebalanced. This behavior - is desirable because it allows the split planes to be serialized, - and then deserialized into an empty tree which can be repopulated. - */ - void remove(const T& value) { - debugAssertM(contains(value), - "Tried to remove an element from a " - "KDTree that was not present"); - - // Get the list of elements at the node - Handle h(value); - Member m(&h); - - Array& list = memberTable[m]->valueArray; - - Handle* ptr = NULL; - - // Find the element and remove it - for (int i = list.length() - 1; i >= 0; --i) { - if (list[i]->value == value) { - // This was the element. Grab the pointer so that - // we can delete it below - ptr = list[i]; - - // Remove the handle from the node - list.fastRemove(i); - - // Remove the corresponding bounds - memberTable[m]->boundsArray.fastRemove(i); - break; - } - } - - // Remove the member - memberTable.remove(m); - - // Delete the handle data structure - delete ptr; - ptr = NULL; - } - - - /** - If the element is in the set, it is removed. - The element is then inserted. - - This is useful when the == and hashCode methods - on T are independent of the bounds. In - that case, you may call update(v) to insert an - element for the first time and call update(v) - again every time it moves to keep the tree - up to date. - */ - void update(const T& value) { - if (contains(value)) { - remove(value); - } - insert(value); - } - - - /** - Rebalances the tree (slow). Call when objects - have moved substantially from their original positions - (which unbalances the tree and causes the spatial - queries to be slow). - - @param valuesPerNode Maximum number of elements to put at - a node. - - @param numMeanSplits numMeanSplits = 0 gives a - fully axis aligned BSP-tree, where the balance operation attempts to balance - the tree so that every splitting plane has an equal number of left - and right children (i.e. it is a median split along that axis). - This tends to maximize average performance. - - You can override this behavior by - setting a number of mean (average) splits. numMeanSplits = MAX_INT - creates a full oct-tree, which tends to optimize peak performance at the expense of - average performance. It tends to have better clustering behavior when - members are not uniformly distributed. - */ - void balance(int valuesPerNode = 5, int numMeanSplits = 3) { - if (root == NULL) { - // Tree is empty - return; - } - - // Get all handles and delete the old tree structure - Node* oldRoot = root; - for (int c = 0; c < 2; ++c) { - if (root->child[c] != NULL) { - root->child[c]->getHandles(root->valueArray); - - // Delete the child; this will delete all structure below it - delete root->child[c]; - root->child[c] = NULL; - } - } - - Array temp; - // Make a new root. Work with a copy of the value array because - // makeNode clears the source array as it progresses - Array copy(oldRoot->valueArray); - root = makeNode(copy, valuesPerNode, numMeanSplits, temp); - - // Throw away the old root node - delete oldRoot; - oldRoot = NULL; - - // Walk the tree, assigning splitBounds. We start with unbounded - // space. This will override the current member table. - const AABox& LARGE = AABox::large(); - root->assignSplitBounds(LARGE); - -# ifdef _DEBUG - { - // Ensure that the balanced tree is still correct - root->verifyNode(LARGE.low(), LARGE.high()); - } -# endif - } - - - /** Clear, set the contents to the values in the array, and then balance */ - void setContents(const Array& array, int valuesPerNode = 5, int numMeanSplits = 3) { - clear(); - insert(array); - balance(valuesPerNode, numMeanSplits); - } - - -protected: - - /** - @param parentMask The mask that this node returned from culledBy. - */ - static void getIntersectingMembers( - const Array& plane, - Array& members, - Node* node, - uint32 parentMask) { - - int dummy; - - if (parentMask == 0) { - // None of these planes can cull anything - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - members.append(& (node->valueArray[v]->value)); - } - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c]) { - getIntersectingMembers(plane, members, node->child[c], 0); - } - } - } else { - - // Test values at this node against remaining planes - for (int v = node->boundsArray.size() - 1; v >= 0; --v) { - if (! node->boundsArray[v].culledBy(plane, dummy, parentMask)) { - members.append(&(node->valueArray[v]->value)); - } - } - - uint32 childMask = 0xFFFFFF; - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c] && - ! node->child[c]->splitBounds.culledBy(plane, dummy, parentMask, childMask)) { - // This node was not culled - getIntersectingMembers(plane, members, node->child[c], childMask); - } - } - } - } - -public: - - /** - Returns all members inside the set of planes. - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Array& plane, Array& members) const { - if (root == NULL) { - return; - } - - getIntersectingMembers(plane, members, root, 0xFFFFFF); - } - - void getIntersectingMembers(const Array& plane, Array& members) const { - Array temp; - getIntersectingMembers(plane, temp, root, 0xFFFFFF); - for (int i = 0; i < temp.size(); ++i) { - members.append(*temp[i]); - } - } - - /** - Typically used to find all visible - objects inside the view frustum (see also GCamera::getClipPlanes)... i.e. all objects - not culled by frustum. - - Example: -
-        Array  visible;
-        tree.getIntersectingMembers(camera.frustum(), visible);
-        // ... Draw all objects in the visible array.
-      
- @param members The results are appended to this array. - */ - void getIntersectingMembers(const GCamera::Frustum& frustum, Array& members) const { - Array plane; - - for (int i = 0; i < frustum.faceArray.size(); ++i) { - plane.append(frustum.faceArray[i].plane); - } - - getIntersectingMembers(plane, members); - } - - void getIntersectingMembers(const GCamera::Frustum& frustum, Array& members) const { - Array temp; - getIntersectingMembers(frustum, temp); - for (int i = 0; i < temp.size(); ++i) { - members.append(*temp[i]); - } - } - - /** - C++ STL style iterator variable. See beginBoxIntersection(). - The iterator overloads the -> (dereference) operator, so this - acts like a pointer to the current member. - */ - // This iterator turns Node::getIntersectingMembers into a - // coroutine. It first translates that method from recursive to - // stack based, then captures the system state (analogous to a Scheme - // continuation) after each element is appended to the member array, - // and allowing the computation to be restarted. - class BoxIntersectionIterator { - private: - friend class TreeType; - - /** True if this is the "end" iterator instance */ - bool isEnd; - - /** The box that we're testing against. */ - AABox box; - - /** Node that we're currently looking at. Undefined if isEnd - is true. */ - Node* node; - - /** Nodes waiting to be processed */ - // We could use backpointers within the tree and careful - // state management to avoid ever storing the stack-- but - // it is much easier this way and only inefficient if the - // caller uses post increment (which they shouldn't!). - Array stack; - - /** The next index of current->valueArray to return. - Undefined when isEnd is true.*/ - int nextValueArrayIndex; - - BoxIntersectionIterator() : isEnd(true) {} - - BoxIntersectionIterator(const AABox& b, const Node* root) : - isEnd(root == NULL), box(b), - node(const_cast(root)), nextValueArrayIndex(-1) { - - // We intentionally start at the "-1" index of the current - // node so we can use the preincrement operator to move - // ourselves to element 0 instead of repeating all of the - // code from the preincrement method. Note that this might - // cause us to become the "end" instance. - ++(*this); - } - - public: - - inline bool operator!=(const BoxIntersectionIterator& other) const { - return ! (*this == other); - } - - bool operator==(const BoxIntersectionIterator& other) const { - if (isEnd) { - return other.isEnd; - } else if (other.isEnd) { - return false; - } else { - // Two non-end iterators; see if they match. This is kind of - // silly; users shouldn't call == on iterators in general unless - // one of them is the end iterator. - if ((box != other.box) || (node != other.node) || - (nextValueArrayIndex != other.nextValueArrayIndex) || - (stack.length() != other.stack.length())) { - return false; - } - - // See if the stacks are the same - for (int i = 0; i < stack.length(); ++i) { - if (stack[i] != other.stack[i]) { - return false; - } - } - - // We failed to find a difference; they must be the same - return true; - } - } - - /** - Pre increment. - */ - BoxIntersectionIterator& operator++() { - ++nextValueArrayIndex; - - bool foundIntersection = false; - while (! isEnd && ! foundIntersection) { - - // Search for the next node if we've exhausted this one - while ((! isEnd) && (nextValueArrayIndex >= node->valueArray.length())) { - // If we entered this loop, then the iterator has exhausted the elements at - // node (possibly because it just switched to a child node with no members). - // This loop continues until it finds a node with members or reaches - // the end of the whole intersection search. - - // If the right child overlaps the box, push it onto the stack for - // processing. - if ((node->child[1] != NULL) && - (box.high()[node->splitAxis] > node->splitLocation)) { - stack.push(node->child[1]); - } - - // If the left child overlaps the box, push it onto the stack for - // processing. - if ((node->child[0] != NULL) && - (box.low()[node->splitAxis] < node->splitLocation)) { - stack.push(node->child[0]); - } - - if (stack.length() > 0) { - // Go on to the next node (which may be either one of the ones we - // just pushed, or one from farther back the tree). - node = stack.pop(); - nextValueArrayIndex = 0; - } else { - // That was the last node; we're done iterating - isEnd = true; - } - } - - // Search for the next intersection at this node until we run out of children - while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { - if (box.intersects(node->boundsArray[nextValueArrayIndex])) { - foundIntersection = true; - } else { - ++nextValueArrayIndex; - // If we exhaust this node, we'll loop around the master loop - // to find a new node. - } - } - } - - return *this; - } - - private: - /** - Post increment (much slower than preincrement!). - Intentionally overloaded to preclude accidentally slow code. - */ - BoxIntersectionIterator operator++(int); - /*{ - BoxIntersectionIterator old = *this; - ++this; - return old; - }*/ - - public: - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - const T& operator*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return node->valueArray[nextValueArrayIndex]->value; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - T const * operator->() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex]->value); - } - - /** Overloaded cast operator so the iterator can masquerade as a pointer - to a member */ - operator T*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex]->value); - } - }; - - - /** - Iterates through the members that intersect the box - */ - BoxIntersectionIterator beginBoxIntersection(const AABox& box) const { - return BoxIntersectionIterator(box, root); - } - - BoxIntersectionIterator endBoxIntersection() const { - // The "end" iterator instance - return BoxIntersectionIterator(); - } - - /** - Appends all members whose bounds intersect the box. - See also KDTree::beginBoxIntersection. - */ - void getIntersectingMembers(const AABox& box, Array& members) const { - if (root == NULL) { - return; - } - root->getIntersectingMembers(box, Sphere(Vector3::zero(), 0), members, false); - } - - void getIntersectingMembers(const AABox& box, Array& members) const { - Array temp; - getIntersectingMembers(box, temp); - for (int i = 0; i < temp.size(); ++i) { - members.append(*temp[i]); - } - } - - - /** - Invoke a callback for every member along a ray until the closest intersection is found. - - @param callback either a function or an instance of a class with an overloaded operator() of the form: - - void callback(const Ray& ray, const T& object, float& distance). If the ray hits the object - before travelling distance distance, updates distance with the new distance to - the intersection, otherwise leaves it unmodified. A common example is: - -
-     class Entity {
-     public:
-
-                void intersect(const Ray& ray, float& maxDist, Vector3& outLocation, Vector3& outNormal) {
-                    float d = maxDist;
-
-                    // ... search for intersection distance d
-
-                    if ((d > 0) && (d < maxDist)) {
-                        // Intersection occured
-                        maxDist = d;
-                        outLocation = ...;
-                        outNormal = ...;
-                    }
-                }
-            };
-
-            // Finds the surface normal and location of the first intersection with the scene
-            class Intersection {
-            public:
-                Entity*     closestEntity;
-                Vector3     hitLocation;
-                Vector3     hitNormal;
-
-                void operator()(const Ray& ray, const Entity* entity, float& distance) {
-                    entity->intersect(ray, distance, hitLocation, hitNormal);
-                }
-            };
-
-            KDTree scene;
-
-            Intersection intersection;
-            float distance = finf();
-            scene.intersectRay(camera.worldRay(x, y), intersection, distance);
-          
- - - @param distance When the method is invoked, this is the maximum - distance that the tree should search for an intersection. On - return, this is set to the distance to the first intersection - encountered. - - @param intersectCallbackIsFast If false, each object's bounds are - tested before the intersectCallback is invoked. If the - intersect callback runs at the same speed or faster than - AABox-ray intersection, set this to true. - */ - template - void intersectRay( - const Ray& ray, - RayCallback& intersectCallback, - float& distance, - bool intersectCallbackIsFast = false) const { - - root->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - } - - - /** - @brief Finds all members whose bounding boxes intersect the sphere. The actual - elements may not intersect the sphere. - - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Sphere& sphere, Array& members) const { - if (root == NULL) { - return; - } - - AABox box; - sphere.getBounds(box); - root->getIntersectingMembers(box, sphere, members, true); - } - - void getIntersectingMembers(const Sphere& sphere, Array& members) const { - Array temp; - getIntersectingMembers(sphere, temp); - for (int i = 0; i < temp.size(); ++i) { - members.append(*temp[i]); - } - } - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - void serializeStructure(BinaryOutput& bo) const { - Node::serializeStructure(root, bo); - } - - /** Clears the member table */ - void deserializeStructure(BinaryInput& bi) { - clear(); - root = Node::deserializeStructure(bi); - } - - /** - Returns an array of all members of the set. See also KDTree::begin. - */ - void getMembers(Array& members) const { - Array temp; - memberTable.getKeys(temp); - for (int i = 0; i < temp.size(); ++i) { - members.append(*(temp.handle)); - } - } - - - /** If a value that is EqualsFunc to @a value is present, returns a pointer to the - version stored in the data structure, otherwise returns NULL. - */ - const T* getPointer(const T& value) const { - // Temporarily create a handle and member - Handle h(value); - const Member* member = memberTable.getKeyPointer(Member(&h)); - if (member == NULL) { - // Not found - return NULL; - } else { - return &(member->handle->value); - } - } - - - /** - C++ STL style iterator variable. See begin(). - Overloads the -> (dereference) operator, so this acts like a pointer - to the current member. - */ - class Iterator { - private: - friend class TreeType; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename Table::Iterator it; - - Iterator(const typename Table::Iterator& it) : it(it) {} - - public: - - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - private: - /** - Post increment (slower than preincrement). Intentionally unimplemented to prevent slow code. - */ - Iterator operator++(int);/* { - Iterator old = *this; - ++(*this); - return old; - }*/ - public: - - const T& operator*() const { - return it->key.handle->value; - } - - T* operator->() const { - return &(it->key.handle->value); - } - - operator T*() const { - return &(it->key.handle->value); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element (iteration - order is arbitrary). - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - Iterator end() const { - return Iterator(memberTable.end()); - } -#undef TreeType -}; - - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Line.h b/dep/include/g3dlite/G3D/Line.h deleted file mode 100644 index 3579a6becec..00000000000 --- a/dep/include/g3dlite/G3D/Line.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - @file Line.h - - Line class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2006-02-28 - */ - -#ifndef G3D_LINE_H -#define G3D_LINE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Plane; - -/** - An infinite 3D line. - */ -class Line { -protected: - - Vector3 _point; - Vector3 _direction; - - Line(const Vector3& point, const Vector3& direction) { - _point = point; - _direction = direction.direction(); - } - -public: - - /** Undefined (provided for creating Array only) */ - inline Line() {} - - Line(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - virtual ~Line() {} - - /** - Constructs a line from two (not equal) points. - */ - static Line fromTwoPoints(const Vector3 &point1, const Vector3 &point2) { - return Line(point1, point2 - point1); - } - - /** - Creates a line from a point and a (nonzero) direction. - */ - static Line fromPointAndDirection(const Vector3& point, const Vector3& direction) { - return Line(point, direction); - } - - /** - Returns the closest point on the line to point. - */ - Vector3 closestPoint(const Vector3& pt) const; - - /** - Returns the distance between point and the line - */ - double distance(const Vector3& point) const { - return (closestPoint(point) - point).magnitude(); - } - - /** Returns a point on the line */ - Vector3 point() const; - - /** Returns the direction (or negative direction) of the line */ - Vector3 direction() const; - - /** - Returns the point where the line and plane intersect. If there - is no intersection, returns a point at infinity. - */ - Vector3 intersection(const Plane &plane) const; - - - /** Finds the closest point to the two lines. - - @param minDist Returns the minimum distance between the lines. - - @cite http://objectmix.com/graphics/133793-coordinates-closest-points-pair-skew-lines.html - */ - Vector3 closestPoint(const Line& B, float& minDist) const; - - inline Vector3 closestPoint(const Line& B) const { - float m; - return closestPoint(B, m); - } -}; - -};// namespace - - -#endif diff --git a/dep/include/g3dlite/G3D/LineSegment.h b/dep/include/g3dlite/G3D/LineSegment.h deleted file mode 100644 index 70210ec7e00..00000000000 --- a/dep/include/g3dlite/G3D/LineSegment.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - @file LineSegment.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-02-08 - @edited 2008-02-02 - */ - -#ifndef G3D_LINESEGMENT_H -#define G3D_LINESEGMENT_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" - -namespace G3D { - -/** - An finite segment of an infinite 3D line. - */ -class LineSegment { -protected: - - Vector3 _point; - - /** Not normalized */ - Vector3 direction; - - LineSegment(const Vector3& __point, const Vector3& _direction) : _point(__point), direction(_direction) { - } - -public: - - inline LineSegment() : _point(Vector3::zero()), direction(Vector3::zero()) {} - - LineSegment(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - virtual ~LineSegment() {} - - /** - * Constructs a line from two (not equal) points. - */ - static LineSegment fromTwoPoints(const Vector3 &point1, const Vector3 &point2) { - return LineSegment(point1, point2 - point1); - } - - /** Call with 0 or 1 */ - Vector3 point(int i) const; - - inline float length() const { - return direction.magnitude(); - } - - /** - * Returns the closest point on the line segment to point. - */ - Vector3 closestPoint(const Vector3 &point) const; - - /** - Returns the distance between point and the line - */ - double distance(const Vector3& p) const { - return (closestPoint(p) - p).magnitude(); - } - - double distanceSquared(const Vector3& p) const { - return (closestPoint(p) - p).squaredMagnitude(); - } - - /** Returns true if some part of this segment is inside the sphere */ - bool intersectsSolidSphere(const class Sphere& s) const; - - Vector3 randomPoint() const; - -}; - - -class LineSegment2D { -private: - - Vector2 m_origin; - - /** Not normalized */ - Vector2 m_direction; - - /** Length of m_direction */ - float m_length; - -public: - - LineSegment2D() {} - - static LineSegment2D fromTwoPoints(const Vector2& p0, const Vector2& p1); - - /** Returns the intersection of these segements (including - testing endpoints), or Vector2::inf() if they do not intersect. */ - Vector2 intersection(const LineSegment2D& other) const; - - Vector2 point(int i) const; - - Vector2 closestPoint(const Vector2& Q) const; - - float distance(const Vector2& p) const; - - float length() const; -}; - -} // namespace - - -#endif diff --git a/dep/include/g3dlite/G3D/Log.h b/dep/include/g3dlite/G3D/Log.h deleted file mode 100644 index d252d0c1a17..00000000000 --- a/dep/include/g3dlite/G3D/Log.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - @file Log.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite Backtrace by Aaron Orenstein - @created 2001-08-04 - @edited 2005-11-04 - */ - -#ifndef G3D_LOG_H -#define G3D_LOG_H - -#include -#include -#include "G3D/platform.h" - -#ifndef G3D_WIN32 - #include -#endif - -namespace G3D { - -/** Prints to the common system log, log.txt, which is usually - in the working directory of the program. If your disk is - not writable or is slow, it will attempt to write to "c:/tmp/log.txt" or - "c:/temp/log.txt" on Windows systems instead. - - Unlike printf or debugPrintf, - this function guarantees that all output is committed before it returns. - This is very useful for debugging a crash, which might hide the last few - buffered print statements otherwise. - - Many G3D routines write useful warnings and debugging information to the - system log, which makes it a good first place to go when tracking down - a problem. - */ -void logPrintf(const char* fmt, ...); - -/** Does not flush the buffer; follow up with a logPrintf to force the flush. */ -void logLazyPrintf(const char* fmt, ...); - -/** - System log for debugging purposes. The first log opened - is the "common log" and can be accessed with the static - method common(). If you access common() and a common log - does not yet exist, one is created for you. - */ -class Log { -private: - - /** - Log messages go here. - */ - FILE* logFile; - - std::string filename; - - static Log* commonLog; - - int stripFromStackBottom; - -public: - - /** - @param stripFromStackBottom Number of call stacks to strip from the - bottom of the stack when printing a trace. Useful for hiding - routines like "main" and "WinMain". If the specified file cannot - be opened for some reason, tries to open "c:/tmp/log.txt" or - "c:/temp/log.txt" instead. - */ - Log(const std::string& filename = "log.txt", - int stripFromStackBottom = 0); - - virtual ~Log(); - - /** - Returns the handle to the file log. - */ - FILE* getFile() const; - - /** - Marks the beginning of a logfile section. - */ - void section(const std::string& s); - - /** - Given arguments like printf, writes characters to the debug text overlay. - */ - // We want G3D_CHECK_PRINTF_ARGS here, but that conflicts with the - // overload. - void __cdecl printf(const char* fmt, ...) G3D_CHECK_PRINTF_METHOD_ARGS; - - void __cdecl vprintf(const char*, va_list argPtr) G3D_CHECK_VPRINTF_METHOD_ARGS; - /** Does not flush */ - void __cdecl lazyvprintf(const char*, va_list argPtr) G3D_CHECK_VPRINTF_METHOD_ARGS; - - static Log* common(); - - static std::string getCommonLogFilename(); - - void print(const std::string& s); - - - void println(const std::string& s); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Map2D.h b/dep/include/g3dlite/G3D/Map2D.h deleted file mode 100644 index 9af9f7242c1..00000000000 --- a/dep/include/g3dlite/G3D/Map2D.h +++ /dev/null @@ -1,667 +0,0 @@ -/** - @file Map2D.h - - More flexible support than provided by G3D::GImage. - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2004-10-10 - @edited 2009-03-24 - */ -#ifndef G3D_Map2D_h -#define G3D_Map2D_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Array.h" -#include "G3D/vectorMath.h" -#include "G3D/Vector2int16.h" -#include "G3D/ReferenceCount.h" -#include "G3D/AtomicInt32.h" -#include "G3D/GThread.h" -#include "G3D/Rect2D.h" -#include "G3D/WrapMode.h" - -#include - -namespace G3D { -namespace _internal { - -/** The default compute type for a type is the type itself. */ -template class _GetComputeType { -public: - typedef Storage Type; -}; - -} // _internal -} // G3D - -// This weird syntax is needed to support VC6, which doesn't -// properly implement template overloading. -#define DECLARE_COMPUTE_TYPE(StorageType, ComputeType) \ -namespace G3D { \ - namespace _internal { \ - template<> class _GetComputeType < StorageType > { \ - public: \ - typedef ComputeType Type; \ - }; \ - } \ -} - -DECLARE_COMPUTE_TYPE( float32, float64) -DECLARE_COMPUTE_TYPE( float64, float64) - -DECLARE_COMPUTE_TYPE( int8, float32) -DECLARE_COMPUTE_TYPE( int16, float32) -DECLARE_COMPUTE_TYPE( int32, float64) -DECLARE_COMPUTE_TYPE( int64, float64) - -DECLARE_COMPUTE_TYPE( uint8, float32) -DECLARE_COMPUTE_TYPE( uint16, float32) -DECLARE_COMPUTE_TYPE( uint32, float64) -DECLARE_COMPUTE_TYPE( uint64, float64) - -DECLARE_COMPUTE_TYPE( Vector2, Vector2) -DECLARE_COMPUTE_TYPE( Vector2int16, Vector2) - -DECLARE_COMPUTE_TYPE( Vector3, Vector3) -DECLARE_COMPUTE_TYPE( Vector3int16, Vector3) - -DECLARE_COMPUTE_TYPE( Vector4, Vector4) - -DECLARE_COMPUTE_TYPE( Color3, Color3) -DECLARE_COMPUTE_TYPE( Color3uint8, Color3) - -DECLARE_COMPUTE_TYPE( Color4, Color4) -DECLARE_COMPUTE_TYPE( Color4uint8, Color4) -#undef DECLARE_COMPUTE_TYPE - -namespace G3D { - -/** - Map of values across a discrete 2D plane. Can be thought of as a generic class for 2D images, - allowing flexibility as to pixel format and convenient methods. - In fact, the "pixels" can be any values - on a grid that can be sensibly interpolated--RGB colors, scalars, 4D vectors, and so on. - - Other "image" classes in G3D: - - G3D::GImage - Supports file formats, fast, Color3uint8 and Color4uint8 formats. No interpolation. - - G3D::Texture::Ref - Represents image on the graphics card (not directly readable on the CPU). Supports 2D, 3D, and a variety of interpolation methods, loads file formats. - - G3D::Image3 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image4 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image3uint8 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image4uint8 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - There are two type parameters-- the first (@ Storage) is the type - used to store the "pixel" values efficiently and - the second (@a Compute) is - the type operated on by computation. The Compute::Compute(Storage&) constructor - is used to convert between storage and computation types. - @a Storage is often an integer version of @a Compute, for example - Map2D. By default, the computation type is: - -
-     Storage       Computation
-
-     uint8          float32
-     uint16         float32
-     uint32         float64
-     uint64         float64
-
-     int8           float32
-     int16          float32
-     int32          float64
-     int64          float64
-
-     float32        float64
-     float64        float64
-
-     Vector2        Vector2
-     Vector2int16   Vector2
-
-     Vector3        Vector3
-     Vector3int16   Vector3
-
-     Vector4        Vector4
-
-     Color3         Color3
-     Color3uint8    Color3
-
-     Color4         Color4
-     Color4uint8    Color4
-    
- Any other storage type defaults to itself as the computation type. - - The computation type can be any that - supports lerp, +, -, *, /, and an empty constructor. - - Assign value: - - im->set(x, y, 7); or - im->get(x, y) = 7; - - Read value: - - int c = im(x, y); - - Can also sample with nearest neighbor, bilinear, and bicubic - interpolation. - - Sampling follows OpenGL conventions, where - pixel values represent grid points and (0.5, 0.5) is half-way - between two vertical and two horizontal grid points. - To draw an image of dimensions w x h with nearest neighbor - sampling, render pixels from [0, 0] to [w - 1, h - 1]. - - Under the WrapMode::CLAMP wrap mode, the value of bilinear interpolation - becomes constant outside [1, w - 2] horizontally. Nearest neighbor - interpolation is constant outside [0, w - 1] and bicubic outside - [3, w - 4]. The class does not offer quadratic interpolation because - the interpolation filter could not center over a pixel. - - @author Morgan McGuire, http://graphics.cs.williams.edu - */ -template< typename Storage, -typename Compute = typename G3D::_internal::_GetComputeType::Type> -class Map2D : public ReferenceCountedObject { - -// -// It doesn't make sense to automatically convert from Compute back to Storage -// because the rounding rule (and scaling) is application dependent. -// Thus the interpolation methods all return type Compute. -// - -public: - - typedef Storage StorageType; - typedef Compute ComputeType; - typedef Map2D Type; - typedef ReferenceCountedPointer Ref; - -protected: - - Storage ZERO; - - /** Width, in pixels. */ - uint32 w; - - /** Height, in pixels. */ - uint32 h; - - WrapMode _wrapMode; - - /** 0 if no mutating method has been invoked - since the last call to setChanged(); */ - AtomicInt32 m_changed; - - Array data; - - /** Handles the exceptional cases from get */ - const Storage& slowGet(int x, int y, WrapMode wrap) { - switch (wrap) { - case WrapMode::CLAMP: - return fastGet(iClamp(x, 0, w - 1), iClamp(y, 0, h - 1)); - - case WrapMode::TILE: - return fastGet(iWrap(x, w), iWrap(y, h)); - - case WrapMode::ZERO: - return ZERO; - - case WrapMode::ERROR: - alwaysAssertM(((uint32)x < w) && ((uint32)y < h), - format("Index out of bounds: (%d, %d), w = %d, h = %d", - x, y, w, h)); - - // intentionally fall through - case WrapMode::IGNORE: - // intentionally fall through - default: - { - static Storage temp; - return temp; - } - } - } - -public: - - /** Unsafe access to the underlying data structure with no wrapping support; requires that (x, y) is in bounds. */ - inline const Storage& fastGet(int x, int y) const { - debugAssert(((uint32)x < w) && ((uint32)y < h)); - return data[x + y * w]; - } - - /** Unsafe access to the underlying data structure with no wrapping support; requires that (x, y) is in bounds. */ - inline void fastSet(int x, int y, const Storage& v) { - debugAssert(((uint32)x < w) && ((uint32)y < h)); - data[x + y * w] = v; - } - -protected: - - /** Given four control points and a value on the range [0, 1) - evaluates the Catmull-rom spline between the times of the - middle two control points */ - Compute bicubic(const Compute* ctrl, double s) const { - - // f = B * S * ctrl' - - // B matrix: Catmull-Rom spline basis - static const double B[4][4] = { - { 0.0, -0.5, 1.0, -0.5}, - { 1.0, 0.0, -2.5, 1.5}, - { 0.0, 0.5, 2.0, -1.5}, - { 0.0, 0.0, -0.5, 0.5}}; - - // S: Powers of the fraction - double S[4]; - double s2 = s * s; - S[0] = 1.0; - S[1] = s; - S[2] = s2; - S[3] = s2 * s; - - Compute sum(ZERO); - - for (int c = 0; c < 4; ++c) { - double coeff = 0.0; - for (int power = 0; power < 4; ++power) { - coeff += B[c][power] * S[power]; - } - sum += ctrl[c] * coeff; - } - - return sum; - } - - - Map2D(int w, int h, WrapMode wrap) : w(0), h(0), _wrapMode(wrap), m_changed(1) { - ZERO = Storage(Compute(Storage()) * 0); - resize(w, h); - } - -public: - - /** - Although Map2D is not threadsafe (except for the setChanged() method), - you can use this mutex to create your own threadsafe access to a Map2D. - Not used by the default implementation. - */ - GMutex mutex; - - static Ref create(int w = 0, int h = 0, WrapMode wrap = WrapMode::ERROR) { - return new Map2D(w, h, wrap); - } - - /** Resizes without clearing, leaving garbage. - */ - void resize(uint32 newW, uint32 newH) { - if ((newW != w) || (newH != h)) { - w = newW; - h = newH; - data.resize(w * h); - setChanged(true); - } - } - - /** - Returns true if this map has been written to since the last call to setChanged(false). - This is useful if you are caching a texture map other value that must be recomputed - whenever this changes. - */ - bool changed() { - return m_changed.value() != 0; - } - - /** Set/unset the changed flag. */ - void setChanged(bool c) { - m_changed = c ? 1 : 0; - } - - /** Returns a pointer to the underlying row-major data. There is no padding at the end of the row. - Be careful--this will be reallocated during a resize. You should call setChanged(true) if you mutate the array.*/ - Storage* getCArray() { - return data.getCArray(); - } - - - const Storage* getCArray() const { - return data.getCArray(); - } - - - /** Row-major array. You should call setChanged(true) if you mutate the array. */ - Array& getArray() { - return data; - } - - - const Array& getArray() const { - return data; - } - - /** is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode */ - inline bool inBounds(int x, int y) const { - return (((uint32)x < w) && ((uint32)y < h)); - } - - /** is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode */ - inline bool inBounds(const Vector2int16& v) const { - return inBounds(v.x, v.y); - } - - /** Get the value at (x, y). - - Note that the type of image->get(x, y) is - the storage type, not the computation - type. If the constructor promoting Storage to Compute rescales values - (as, for example Color3(Color3uint8&) does), this will not match the value - returned by Map2D::nearest. - */ - inline const Storage& get(int x, int y, WrapMode wrap) const { - if (((uint32)x < w) && ((uint32)y < h)) { - return data[x + y * w]; - } else { - // Remove the const to allow a slowGet on this object - // (we're returning a const reference so this is ok) - return const_cast(this)->slowGet(x, y, wrap); - } -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline const Storage& get(int x, int y) const { - return get(x, y, _wrapMode); - } - - inline const Storage& get(const Vector2int16& p) const { - return get(p.x, p.y, _wrapMode); - } - - inline const Storage& get(const Vector2int16& p, WrapMode wrap) const { - return get(p.x, p.y, wrap); - } - - inline Storage& get(int x, int y, WrapMode wrap) { - return const_cast(const_cast(this)->get(x, y, wrap)); -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline Storage& get(int x, int y) { - return const_cast(const_cast(this)->get(x, y)); -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline Storage& get(const Vector2int16& p) { - return get(p.x, p.y); - } - - /** Sets the changed flag to true */ - inline void set(const Vector2int16& p, const Storage& v) { - set(p.x, p.y, v); - } - - /** Sets the changed flag to true */ - void set(int x, int y, const Storage& v, WrapMode wrap) { - setChanged(true); - if (((uint32)x < w) && ((uint32)y < h)) { - // In bounds, wrapping isn't an issue. - data[x + y * w] = v; - } else { - const_cast(slowGet(x, y, wrap)) = v; - } - } - - void set(int x, int y, const Storage& v) { - set(x, y, v, _wrapMode); - } - - - void setAll(const Storage& v) { - for(int i = 0; i < data.size(); ++i) { - data[i] = v; - } - setChanged(true); - } - - /** flips if @a flip is true*/ - void maybeFlipVertical(bool flip) { - if (flip) { - flipVertical(); - } - } - - virtual void flipVertical() { - int halfHeight = h/2; - Storage* d = data.getCArray(); - for (int y = 0; y < halfHeight; ++y) { - int o1 = y * w; - int o2 = (h - y - 1) * w; - for (int x = 0; x < (int)w; ++x) { - int i1 = o1 + x; - int i2 = o2 + x; - Storage temp = d[i1]; - d[i1] = d[i2]; - d[i2] = temp; - } - } - setChanged(true); - } - - virtual void flipHorizontal() { - int halfWidth = w / 2; - Storage* d = data.getCArray(); - for (int x = 0; x < halfWidth; ++x) { - for (int y = 0; y < (int)h; ++y) { - int i1 = y * w + x; - int i2 = y * w + (w - x - 1); - Storage temp = d[i1]; - d[i1] = d[i2]; - d[i2] = temp; - } - } - setChanged(true); - } - - /** - Crops this map so that it only contains pixels between (x, y) and (x + w - 1, y + h - 1) inclusive. - */ - virtual void crop(int newX, int newY, int newW, int newH) { - alwaysAssertM(newX + newW <= (int)w, "Cannot grow when cropping"); - alwaysAssertM(newY + newH <= (int)h, "Cannot grow when cropping"); - alwaysAssertM(newX >= 0 && newY >= 0, "Origin out of bounds."); - - // Always safe to copy towards the upper left, provided - // that we're iterating towards the lower right. This lets us avoid - // reallocating the underlying array. - for (int y = 0; y < newH; ++y) { - for (int x = 0; x < newW; ++x) { - data[x + y * newW] = data[(x + newX) + (y + newY) * w]; - } - } - - resize(newW, newH); - } - - /** iRounds to the nearest x0 and y0. */ - virtual void crop(const Rect2D& rect) { - crop(iRound(rect.x0()), iRound(rect.y0()), iRound(rect.x1()) - iRound(rect.x0()), iRound(rect.y1()) - iRound(rect.y0())); - } - - /** Returns the nearest neighbor. Pixel values are considered - to be at the upper left corner, so image->nearest(x, y) == image(x, y) - */ - inline Compute nearest(float x, float y, WrapMode wrap) const { - int ix = iRound(x); - int iy = iRound(y); - return Compute(get(ix, iy, wrap)); - } - - inline Compute nearest(float x, float y) const { - return nearest(x, y, _wrapMode); - } - - inline Compute nearest(const Vector2& p) const { - return nearest(p.x, p.y); - } - - /** Returns the average value of all elements of the map */ - Compute average() const { - if ((w == 0) || (h == 0)) { - return ZERO; - } - - // To avoid overflows, compute the average of row averages - - Compute rowSum = ZERO; - for (unsigned int y = 0; y < h; ++y) { - Compute sum = ZERO; - int offset = y * w; - for (unsigned int x = 0; x < w; ++x) { - sum += Compute(data[offset + x]); - } - rowSum += sum * (1.0f / w); - } - - return rowSum * (1.0f / h); - } - - /** - Needs to access elements from (floor(x), floor(y)) - to (floor(x) + 1, floor(y) + 1) and will use - the wrap mode appropriately (possibly generating - out of bounds errors). - - Guaranteed to match nearest(x, y) at integers. */ - Compute bilinear(float x, float y, WrapMode wrap) const { - const int i = iFloor(x); - const int j = iFloor(y); - - const float fX = x - i; - const float fY = y - j; - - // Horizontal interpolation, first row - const Compute& t0 = get(i, j, wrap); - const Compute& t1 = get(i + 1, j, wrap); - - // Horizontal interpolation, second row - const Compute& t2 = get(i, j + 1, wrap); - const Compute& t3 = get(i + 1, j + 1, wrap); - - const Compute& A = lerp(t0, t1, fX); - const Compute& B = lerp(t2, t3, fX); - - // Vertical interpolation - return lerp(A, B, fY); - } - - Compute bilinear(float x, float y) const { - return bilinear(x, y, _wrapMode); - } - - inline Compute bilinear(const Vector2& p) const { - return bilinear(p.x, p.y, _wrapMode); - } - - inline Compute bilinear(const Vector2& p, WrapMode wrap) const { - return bilinear(p.x, p.y, wrap); - } - - /** - Uses Catmull-Rom splines to interpolate between grid - values. Guaranteed to match nearest(x, y) at integers. - */ - Compute bicubic(float x, float y, WrapMode wrap) const { - int i = iFloor(x); - int j = iFloor(y); - float fX = x - i; - float fY = y - j; - - Compute vsample[4]; - for (int v = 0; v < 4; ++v) { - - // Horizontal interpolation - Compute hsample[4]; - for (int u = 0; u < 4; ++u) { - hsample[u] = Compute(get(i + u - 1, j + v - 1, wrap)); - } - - vsample[v] = bicubic(hsample, fX); - } - - // Vertical interpolation - return bicubic(vsample, fY); - } - - Compute bicubic(float x, float y) const { - return bicubic(x, y, _wrapMode); - } - - inline Compute bicubic(const Vector2& p, WrapMode wrap) const { - return bicubic(p.x, p.y, wrap); - } - - inline Compute bicubic(const Vector2& p) const { - return bicubic(p.x, p.y, _wrapMode); - } - - /** Pixel width */ - inline int32 width() const { - return (int32)w; - } - - - /** Pixel height */ - inline int32 height() const { - return (int32)h; - } - - - /** Dimensions in pixels */ - Vector2int16 size() const { - return Vector2int16(w, h); - } - - /** Rectangle from (0, 0) to (w, h) */ - Rect2D rect2DBounds() const { - return Rect2D::xywh(0, 0, w, h); - } - - /** Number of bytes occupied by the image data and this structure */ - size_t sizeInMemory() const { - return data.size() * sizeof(Storage) + sizeof(*this); - } - - - WrapMode wrapMode() const { - return _wrapMode; - } - - - void setWrapMode(WrapMode m) { - _wrapMode = m; - } -}; - - - -} - -#endif // G3D_IMAGE_H diff --git a/dep/include/g3dlite/G3D/Matrix.h b/dep/include/g3dlite/G3D/Matrix.h deleted file mode 100644 index 3c5394d9a76..00000000000 --- a/dep/include/g3dlite/G3D/Matrix.h +++ /dev/null @@ -1,634 +0,0 @@ -/** - @file Matrix.h - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2005-10-23 - @edited 2007-07-18 - */ - -#ifndef G3D_MATRIX_H -#define G3D_MATRIX_H - -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/ReferenceCount.h" - -namespace G3D { - -/** - N x M matrix. - - The actual data is tracked internally by a reference counted pointer; - it is efficient to pass and assign Matrix objects because no data is actually copied. - This avoids the headache of pointers and allows natural math notation: - -
-    Matrix A, B, C;
-    // ...
-
-    C = A * f(B);
-    C = C.inverse();
-
-    A = Matrix::identity(4);
-    C = A;
-    C.set(0, 0, 2.0); // Triggers a copy of the data so that A remains unchanged.
-
-    // etc.
-
-  
- - The Matrix::debugNumCopyOps and Matrix::debugNumAllocOps counters - increment every time an operation forces the copy and allocation of matrices. You - can use these to detect slow operations when efficiency is a major concern. - - Some methods accept an output argument instead of returning a value. For example, - A = B.transpose() can also be invoked as B.transpose(A). - The latter may be more efficient, since Matrix may be able to re-use the storage of - A (if it has approximatly the right size and isn't currently shared with another matrix). - - @sa G3D::Matrix3, G3D::Matrix4, G3D::Vector2, G3D::Vector3, G3D::Vector4, G3D::CoordinateFrame - - @beta - */ -class Matrix { -public: - /** - Internal precision. Currently float, but this may become a templated class in the future - to allow operations like Matrix and Matrix. - - Not necessarily a plain-old-data type (e.g., could ComplexFloat), but must be something - with no constructor, that can be safely memcpyd, and that has a bit pattern of all zeros - when zero.*/ - typedef float T; - - /** Incremented every time the elements of a matrix are copied. Useful for profiling your - own code that uses Matrix to determine when it is slow due to copying.*/ - static int debugNumCopyOps; - - /** Incremented every time a new matrix object is allocated. Useful for profiling your - own code that uses Matrix to determine when it is slow due to allocation.*/ - static int debugNumAllocOps; - -private: -public: - - /** Used internally by Matrix. - - Does not throw exceptions-- assumes the caller has taken care of - argument checking. */ - class Impl : public ReferenceCountedObject { - public: - - static void* operator new(size_t size) { - return System::malloc(size); - } - - static void operator delete(void* p) { - System::free(p); - } - - ~Impl(); - - private: - friend class Matrix; - - /** elt[r][c] = the element. Pointers into data.*/ - T** elt; - - /** Row major data for the entire matrix. */ - T* data; - - /** The number of rows */ - int R; - - /** The number of columns */ - int C; - - int dataSize; - - /** If R*C is much larger or smaller than the current, deletes all previous data - and resets to random data. Otherwise re-uses existing memory and just resets - R, C, and the row pointers. */ - void setSize(int newRows, int newCols); - - inline Impl() : elt(NULL), data(NULL), R(0), C(0), dataSize(0) {} - - Impl(const Matrix3& M); - - Impl(const Matrix4& M); - - inline Impl(int r, int c) : elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - setSize(r, c); - } - - Impl& operator=(const Impl& m); - - inline Impl(const Impl& B) : elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - // Use the assignment operator - *this = B; - } - - void setZero(); - - inline void set(int r, int c, T v) { - debugAssert(r < R); - debugAssert(c < C); - elt[r][c] = v; - } - - inline const T& get(int r, int c) const { - debugAssert(r < R); - debugAssert(c < C); - return elt[r][c]; - } - - /** Multiplies this by B and puts the result in out. */ - void mul(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void add(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void add(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void sub(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void sub(T B, Impl& out) const; - - /** B - this */ - void lsub(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void arrayMul(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void mul(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void arrayDiv(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void div(T B, Impl& out) const; - - void negate(Impl& out) const; - - /** Slow way of computing an inverse; for reference */ - void inverseViaAdjoint(Impl& out) const; - - /** Use Gaussian elimination with pivots to solve for the inverse destructively in place. */ - void inverseInPlaceGaussJordan(); - - void adjoint(Impl& out) const; - - /** Matrix of all cofactors */ - void cofactor(Impl& out) const; - - /** - Cofactor [r][c] is defined as C[r][c] = -1 ^(r+c) * det(A[r][c]), - where A[r][c] is the (R-1)x(C-1) matrix formed by removing row r and - column c from the original matrix. - */ - T cofactor(int r, int c) const; - - /** Ok if out == this or out == B */ - void transpose(Impl& out) const; - - T determinant() const; - - /** Determinant computed without the given row and column */ - T determinant(int r, int c) const; - - void arrayLog(Impl& out) const; - - void arrayExp(Impl& out) const; - - void arraySqrt(Impl& out) const; - - void arrayCos(Impl& out) const; - - void arraySin(Impl& out) const; - - void swapRows(int r0, int r1); - - void swapAndNegateCols(int c0, int c1); - - void mulRow(int r, const T& v); - - void abs(Impl& out) const; - - /** Makes a (R-1)x(C-1) copy of this matrix */ - void withoutRowAndCol(int excludeRow, int excludeCol, Impl& out) const; - - bool anyNonZero() const; - - bool allNonZero() const; - - void setRow(int r, const T* vals); - - void setCol(int c, const T* vals); - }; -private: - - typedef ReferenceCountedPointer ImplRef; - - ImplRef impl; - - inline Matrix(ImplRef i) : impl(i) {} - inline Matrix(Impl* i) : impl(ImplRef(i)) {} - - /** Used by SVD */ - class SortRank { - public: - T value; - int col; - - inline bool operator>(const SortRank& x) const { - return x.value > value; - } - - inline bool operator<(const SortRank& x) const { - return x.value < value; - } - - inline bool operator>=(const SortRank& x) const { - return x.value >= value; - } - - inline bool operator<=(const SortRank& x) const { - return x.value <= value; - } - - inline bool operator==(const SortRank& x) const { - return x.value == value; - } - - inline bool operator!=(const SortRank& x) const { - return x.value != value; - } - }; - - Matrix vectorPseudoInverse() const; - Matrix partitionPseudoInverse() const; - Matrix colPartPseudoInverse() const; - Matrix rowPartPseudoInverse() const; - - Matrix col2PseudoInverse(const Matrix& B) const; - Matrix col3PseudoInverse(const Matrix& B) const; - Matrix col4PseudoInverse(const Matrix& B) const; - Matrix row2PseudoInverse(const Matrix& B) const; - Matrix row3PseudoInverse(const Matrix& B) const; - Matrix row4PseudoInverse(const Matrix& B) const; - -public: - - Matrix() : impl(new Impl(0, 0)) {} - - Matrix(const Matrix3& M) : impl(new Impl(M)) {} - - Matrix(const Matrix4& M) : impl(new Impl(M)) {} - - template - static Matrix fromDiagonal(const Array& d) { - Matrix D = zero(d.length(), d.length()); - for (int i = 0; i < d.length(); ++i) { - D.set(i, i, d[i]); - } - return D; - } - - static Matrix fromDiagonal(const Matrix& d); - - /** Returns a new matrix that is all zero. */ - Matrix(int R, int C) : impl(new Impl(R, C)) { - impl->setZero(); - } - - /** Returns a new matrix that is all zero. */ - static Matrix zero(int R, int C); - - /** Returns a new matrix that is all one. */ - static Matrix one(int R, int C); - - /** Returns a new identity matrix */ - static Matrix identity(int N); - - /** Uniformly distributed values between zero and one. */ - static Matrix random(int R, int C); - - /** The number of rows */ - inline int rows() const { - return impl->R; - } - - /** Number of columns */ - inline int cols() const { - return impl->C; - } - - /** Generally more efficient than A * B */ - Matrix& operator*=(const T& B); - - /** Generally more efficient than A / B */ - Matrix& operator/=(const T& B); - - /** Generally more efficient than A + B */ - Matrix& operator+=(const T& B); - - /** Generally more efficient than A - B */ - Matrix& operator-=(const T& B); - - /** No performance advantage over A * B because - matrix multiplication requires intermediate - storage. */ - Matrix& operator*=(const Matrix& B); - - /** Generally more efficient than A + B */ - Matrix& operator+=(const Matrix& B); - - /** Generally more efficient than A - B */ - Matrix& operator-=(const Matrix& B); - - /** Returns a new matrix that is a subset of this one, - from r1:r2 to c1:c2, inclusive.*/ - Matrix subMatrix(int r1, int r2, int c1, int c2) const; - - /** Matrix multiplication. To perform element-by-element multiplication, - see arrayMul. */ - inline Matrix operator*(const Matrix& B) const { - Matrix C(impl->R, B.impl->C); - impl->mul(*B.impl, *C.impl); - return C; - } - - /** See also A *= B, which is more efficient in many cases */ - inline Matrix operator*(const T& B) const { - Matrix C(impl->R, impl->C); - impl->mul(B, *C.impl); - return C; - } - - /** See also A += B, which is more efficient in many cases */ - inline Matrix operator+(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->add(*B.impl, *C.impl); - return C; - } - - /** See also A -= B, which is more efficient in many cases */ - inline Matrix operator-(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->sub(*B.impl, *C.impl); - return C; - } - - /** See also A += B, which is more efficient in many cases */ - inline Matrix operator+(const T& v) const { - Matrix C(impl->R, impl->C); - impl->add(v, *C.impl); - return C; - } - - /** See also A -= B, which is more efficient in many cases */ - inline Matrix operator-(const T& v) const { - Matrix C(impl->R, impl->C); - impl->sub(v, *C.impl); - return C; - } - - - Matrix operator>(const T& scalar) const; - - Matrix operator<(const T& scalar) const; - - Matrix operator>=(const T& scalar) const; - - Matrix operator<=(const T& scalar) const; - - Matrix operator==(const T& scalar) const; - - Matrix operator!=(const T& scalar) const; - - /** scalar B - this */ - inline Matrix lsub(const T& B) const { - Matrix C(impl->R, impl->C); - impl->lsub(B, *C.impl); - return C; - } - - inline Matrix arrayMul(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->arrayMul(*B.impl, *C.impl); - return C; - } - - Matrix3 toMatrix3() const; - - Matrix4 toMatrix4() const; - - Vector2 toVector2() const; - - Vector3 toVector3() const; - - Vector4 toVector4() const; - - /** Mutates this */ - void arrayMulInPlace(const Matrix& B); - - /** Mutates this */ - void arrayDivInPlace(const Matrix& B); - - // Declares an array unary method and its explicit-argument counterpart -# define DECLARE_METHODS_1(method)\ - inline Matrix method() const {\ - Matrix C(impl->R, impl->C);\ - impl->method(*C.impl);\ - return C;\ - }\ - void method(Matrix& out) const; - - - DECLARE_METHODS_1(abs) - DECLARE_METHODS_1(arrayLog) - DECLARE_METHODS_1(arrayExp) - DECLARE_METHODS_1(arraySqrt) - DECLARE_METHODS_1(arrayCos) - DECLARE_METHODS_1(arraySin) - DECLARE_METHODS_1(negate) - -# undef DECLARE_METHODS_1 - - inline Matrix operator-() const { - return negate(); - } - - /** - A-1 computed using the Gauss-Jordan algorithm, - for square matrices. - Run time is O(R3), where R is the - number of rows. - */ - inline Matrix inverse() const { - Impl* A = new Impl(*impl); - A->inverseInPlaceGaussJordan(); - return Matrix(A); - } - - inline T determinant() const { - return impl->determinant(); - } - - /** - AT - */ - inline Matrix transpose() const { - Impl* A = new Impl(cols(), rows()); - impl->transpose(*A); - return Matrix(A); - } - - /** Transpose in place; more efficient than transpose */ - void transpose(Matrix& out) const; - - inline Matrix adjoint() const { - Impl* A = new Impl(cols(), rows()); - impl->adjoint(*A); - return Matrix(A); - } - - /** - (ATA)-1AT) computed - using SVD. - - @param tolerance Use -1 for automatic tolerance. - */ - Matrix pseudoInverse(float tolerance = -1) const; - - /** Called from pseudoInverse when the matrix has size > 4 along some dimension.*/ - Matrix svdPseudoInverse(float tolerance = -1) const; - - /** - (ATA)-1AT) computed - using Gauss-Jordan elimination. - */ - inline Matrix gaussJordanPseudoInverse() const { - Matrix trans = transpose(); - return (trans * (*this)).inverse() * trans; - } - - /** Singular value decomposition. Factors into three matrices - such that @a this = @a U * fromDiagonal(@a d) * @a V.transpose(). - - The matrix must have at least as many rows as columns. - - Run time is O(C2*R). - - @param sort If true (default), the singular values - are arranged so that D is sorted from largest to smallest. - */ - void svd(Matrix& U, Array& d, Matrix& V, bool sort = true) const; - - void set(int r, int c, T v); - - void setCol(int c, const Matrix& vec); - - void setRow(int r, const Matrix& vec); - - Matrix col(int c) const; - - Matrix row(int r) const; - - T get(int r, int c) const; - - Vector2int16 size() const { - return Vector2int16(rows(), cols()); - } - - int numElements() const { - return rows() * cols(); - } - - void swapRows(int r0, int r1); - - /** Swaps columns c0 and c1 and negates both */ - void swapAndNegateCols(int c0, int c1); - - void mulRow(int r, const T& v); - - /** Returns true if any element is non-zero */ - bool anyNonZero() const; - - /** Returns true if all elements are non-zero */ - bool allNonZero() const; - - inline bool allZero() const { - return !anyNonZero(); - } - - inline bool anyZero() const { - return !allNonZero(); - } - - /** Serializes in Matlab source format */ - void serialize(TextOutput& t) const; - - std::string toString(const std::string& name) const; - - std::string toString() const { - static const std::string name = ""; - return toString(name); - } - - /** 2-norm squared: sum(squares). (i.e., dot product with itself) */ - double normSquared() const; - - /** 2-norm (sqrt(sum(squares)) */ - double norm() const; - - /** - Low-level SVD functionality. Useful for applications that do not want - to construct a Matrix but need to perform the SVD operation. - - this = U * D * V' - - Assumes that rows >= cols - - @return NULL on success, a string describing the error on failure. - @param U rows x cols matrix to be decomposed, gets overwritten with U, a rows x cols matrix with orthogonal columns. - @param D vector of singular values of a (diagonal of the D matrix). Length cols. - @param V returns the right orthonormal transformation matrix, size cols x cols - - @cite Based on Dianne Cook's implementation, which is adapted from - svdecomp.c in XLISP-STAT 2.1, which is code from Numerical Recipes - adapted by Luke Tierney and David Betz. The Numerical Recipes code - is adapted from Forsythe et al, who based their code on Golub and - Reinsch's original implementation. - */ - static const char* svdCore(float** U, int rows, int cols, float* D, float** V); - -}; - -} - -inline G3D::Matrix operator-(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M.lsub(v); -} - -inline G3D::Matrix operator*(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M * v; -} - -inline G3D::Matrix operator+(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M + v; -} - -inline G3D::Matrix abs(const G3D::Matrix& M) { - return M.abs(); -} - -#endif - diff --git a/dep/include/g3dlite/G3D/Matrix2.h b/dep/include/g3dlite/G3D/Matrix2.h deleted file mode 100644 index eaf4aefa220..00000000000 --- a/dep/include/g3dlite/G3D/Matrix2.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef G3D_MATRIX2_H -#define G3D_MATRIX2_H - -#include "G3D/platform.h" -#include "G3D/Vector2.h" - -namespace G3D { - -/** @beta */ -class Matrix2 { -private: - - float data[2][2]; - -public: - - inline Matrix2() { - data[0][0] = 1.0f; data[0][1] = 0.0f; - data[1][0] = 0.0f; data[1][1] = 1.0f; - } - - inline Matrix2(float v00, float v01, float v10, float v11) { - data[0][0] = v00; data[0][1] = v01; - data[1][0] = v10; data[1][1] = v11; - } - - inline Vector2 operator*(const Vector2& v) const { - return Vector2(data[0][0] * v[0] + data[0][1] * v[1], - data[1][0] * v[0] + data[1][1] * v[1]); - } - - inline Matrix2 inverse() const { - return Matrix2(data[0][0], data[1][0], - data[0][1], data[1][1]) * (1.0f / determinant()); - } - - inline Matrix2 transpose() const { - return Matrix2(data[0][0], data[1][0], - data[0][1], data[1][1]); - } - - inline float determinant() const { - return data[0][0] * data[1][1] - data[0][1] * data[1][0]; - } - - inline Matrix2 operator*(float f) const { - return Matrix2(data[0][0] * f, data[0][1] * f, - data[1][0] * f, data[1][1] * f); - } - - inline Matrix2 operator/(float f) const { - return Matrix2(data[0][0] / f, data[0][1] / f, - data[1][0] / f, data[1][1] / f); - } - - inline float* operator[](int i) { - debugAssert(i >= 0 && i <= 2); - return data[i]; - } - - inline const float* operator[](int i) const { - debugAssert(i >= 0 && i <= 1); - return data[i]; - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Matrix3.h b/dep/include/g3dlite/G3D/Matrix3.h deleted file mode 100644 index 06ec7e67474..00000000000 --- a/dep/include/g3dlite/G3D/Matrix3.h +++ /dev/null @@ -1,366 +0,0 @@ -/** - @file Matrix3.h - - 3x3 matrix class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @cite Portions based on Dave Eberly's Magic Software Library at
http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-04-05 - */ - -#ifndef G3D_Matrix3_h -#define G3D_Matrix3_h - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/debugAssert.h" - -#include - -namespace G3D { - -#ifdef _MSC_VER -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) -#endif - -class Any; - -/** - 3x3 matrix. Do not subclass. - */ -class Matrix3 { -private: - - float elt[3][3]; - - // Hidden operators - bool operator<(const Matrix3&) const; - bool operator>(const Matrix3&) const; - bool operator<=(const Matrix3&) const; - bool operator>=(const Matrix3&) const; - -public: - - Matrix3(const Any& any); - - operator Any() const; - - /** Initial values are undefined for performance. See also - Matrix3::zero(), Matrix3::identity(), Matrix3::fromAxisAngle, etc.*/ - inline Matrix3() {} - - Matrix3 (class BinaryInput& b); - Matrix3 (const float aafEntry[3][3]); - Matrix3 (const Matrix3& rkMatrix); - Matrix3 (float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22); - - bool fuzzyEq(const Matrix3& b) const; - - /** Constructs a matrix from a quaternion. - @cite Graphics Gems II, p. 351--354 - @cite Implementation from Watt and Watt, pg 362*/ - Matrix3(const class Quat& q); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** Returns true if column(0).cross(column(1)).dot(column(2)) > 0. */ - bool isRightHanded() const; - - /** - Sets all elements. - */ - void set(float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22); - - /** - * member access, allows use of construct mat[r][c] - */ - inline float* operator[] (int iRow) { - debugAssert(iRow >= 0); - debugAssert(iRow < 3); - return (float*)&elt[iRow][0]; - } - - inline const float* operator[] (int iRow) const { - debugAssert(iRow >= 0); - debugAssert(iRow < 3); - return (const float*)&elt[iRow][0]; - } - - inline operator float* () { - return (float*)&elt[0][0]; - } - - inline operator const float* () const{ - return (const float*)&elt[0][0]; - } - - Vector3 column(int c) const; - const Vector3& row(int r) const; - - void setColumn(int iCol, const Vector3 &vector); - void setRow(int iRow, const Vector3 &vector); - - // assignment and comparison - inline Matrix3& operator= (const Matrix3& rkMatrix) { - memcpy(elt, rkMatrix.elt, 9 * sizeof(float)); - return *this; - } - - bool operator== (const Matrix3& rkMatrix) const; - bool operator!= (const Matrix3& rkMatrix) const; - - // arithmetic operations - Matrix3 operator+ (const Matrix3& rkMatrix) const; - Matrix3 operator- (const Matrix3& rkMatrix) const; - /** Matrix-matrix multiply */ - Matrix3 operator* (const Matrix3& rkMatrix) const; - Matrix3 operator- () const; - - Matrix3& operator+= (const Matrix3& rkMatrix); - Matrix3& operator-= (const Matrix3& rkMatrix); - Matrix3& operator*= (const Matrix3& rkMatrix); - - /** - * matrix * vector [3x3 * 3x1 = 3x1] - */ - inline Vector3 operator* (const Vector3& v) const { - Vector3 kProd; - - for (int r = 0; r < 3; ++r) { - kProd[r] = - elt[r][0] * v[0] + - elt[r][1] * v[1] + - elt[r][2] * v[2]; - } - - return kProd; - } - - - /** - * vector * matrix [1x3 * 3x3 = 1x3] - */ - friend Vector3 operator* (const Vector3& rkVector, - const Matrix3& rkMatrix); - - /** - * matrix * scalar - */ - Matrix3 operator* (float fScalar) const; - - /** scalar * matrix */ - friend Matrix3 operator* (double fScalar, const Matrix3& rkMatrix); - friend Matrix3 operator* (float fScalar, const Matrix3& rkMatrix); - friend Matrix3 operator* (int fScalar, const Matrix3& rkMatrix); - - Matrix3& operator*= (float k); - Matrix3& operator/= (float k); - - -private: - /** Multiplication where out != A and out != B */ - static void _mul(const Matrix3& A, const Matrix3& B, Matrix3& out); -public: - - /** Optimized implementation of out = A * B. It is safe (but slow) to call - with A, B, and out possibly pointer equal to one another.*/ - // This is a static method so that it is not ambiguous whether "this" - // is an input or output argument. - inline static void mul(const Matrix3& A, const Matrix3& B, Matrix3& out) { - if ((&out == &A) || (&out == &B)) { - // We need a temporary anyway, so revert to the stack method. - out = A * B; - } else { - // Optimized in-place multiplication. - _mul(A, B, out); - } - } - -private: - static void _transpose(const Matrix3& A, Matrix3& out); -public: - - /** Optimized implementation of out = A.transpose(). It is safe (but slow) to call - with A and out possibly pointer equal to one another. - - Note that A.transpose() * v can be computed - more efficiently as v * A. - */ - inline static void transpose(const Matrix3& A, Matrix3& out) { - if (&A == &out) { - out = A.transpose(); - } else { - _transpose(A, out); - } - } - - /** Returns true if the rows and column L2 norms are 1.0 and the rows are orthogonal. */ - bool isOrthonormal() const; - - Matrix3 transpose () const; - bool inverse (Matrix3& rkInverse, float fTolerance = 1e-06) const; - Matrix3 inverse (float fTolerance = 1e-06) const; - float determinant () const; - - /** singular value decomposition */ - void singularValueDecomposition (Matrix3& rkL, Vector3& rkS, - Matrix3& rkR) const; - /** singular value decomposition */ - void singularValueComposition (const Matrix3& rkL, - const Vector3& rkS, const Matrix3& rkR); - - /** Gram-Schmidt orthonormalization (applied to columns of rotation matrix) */ - void orthonormalize(); - - /** orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12) */ - void qDUDecomposition (Matrix3& rkQ, Vector3& rkD, - Vector3& rkU) const; - - /** - Polar decomposition of a matrix. Based on pseudocode from Nicholas J - Higham, "Computing the Polar Decomposition -- with Applications Siam - Journal of Science and Statistical Computing, Vol 7, No. 4, October - 1986. - - Decomposes A into R*S, where R is orthogonal and S is symmetric. - - Ken Shoemake's "Matrix animation and polar decomposition" - in Proceedings of the conference on Graphics interface '92 - seems to be better known in the world of graphics, but Higham's version - uses a scaling constant that can lead to faster convergence than - Shoemake's when the initial matrix is far from orthogonal. - */ - void polarDecomposition(Matrix3 &R, Matrix3 &S) const; - - /** - * Matrix norms. - */ - float spectralNorm () const; - - float squaredFrobeniusNorm() const; - - float frobeniusNorm() const; - - float l1Norm() const; - - float lInfNorm() const; - - float diffOneNorm(const Matrix3 &y) const; - - /** matrix must be orthonormal */ - void toAxisAngle(Vector3& rkAxis, float& rfRadians) const; - - static Matrix3 fromDiagonal(const Vector3& d) { - return Matrix3(d.x, 0, 0, - 0, d.y, 0, - 0, 0, d.z); - } - - static Matrix3 fromAxisAngle(const Vector3& rkAxis, float fRadians); - - /** - * The matrix must be orthonormal. The decomposition is yaw*pitch*roll - * where yaw is rotation about the Up vector, pitch is rotation about the - * right axis, and roll is rotation about the Direction axis. - */ - bool toEulerAnglesXYZ (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesXZY (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesYXZ (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesYZX (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesZXY (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesZYX (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - static Matrix3 fromEulerAnglesXYZ (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesXZY (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesYXZ (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesYZX (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesZXY (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesZYX (float fYAngle, float fPAngle, float fRAngle); - - /** eigensolver, matrix must be symmetric */ - void eigenSolveSymmetric (float afEigenvalue[3], - Vector3 akEigenvector[3]) const; - - static void tensorProduct (const Vector3& rkU, const Vector3& rkV, - Matrix3& rkProduct); - std::string toString() const; - - static const float EPSILON; - - // Special values. - // The unguaranteed order of initialization of static variables across - // translation units can be a source of annoying bugs, so now the static - // special values (like Vector3::ZERO, Color3::WHITE, ...) are wrapped - // inside static functions that return references to them. - // These functions are intentionally not inlined, because: - // "You might be tempted to write [...] them as inline functions - // inside their respective header files, but this is something you - // must definitely not do. An inline function can be duplicated - // in every file in which it appears œóõ½ and this duplication - // includes the static object definition. Because inline functions - // automatically default to internal linkage, this would result in - // having multiple static objects across the various translation - // units, which would certainly cause problems. So you must - // ensure that there is only one definition of each wrapping - // function, and this means not making the wrapping functions inline", - // according to Chapter 10 of "Thinking in C++, 2nd ed. Volume 1" by Bruce Eckel, - // http://www.mindview.net/ - static const Matrix3& zero(); - static const Matrix3& identity(); - -protected: - - // support for eigensolver - void tridiagonal (float afDiag[3], float afSubDiag[3]); - bool qLAlgorithm (float afDiag[3], float afSubDiag[3]); - - // support for singular value decomposition - static const float ms_fSvdEpsilon; - static const int ms_iSvdMaxIterations; - static void bidiagonalize (Matrix3& kA, Matrix3& kL, - Matrix3& kR); - static void golubKahanStep (Matrix3& kA, Matrix3& kL, - Matrix3& kR); - - // support for spectral norm - static float maxCubicRoot (float afCoeff[3]); - -}; - - -//---------------------------------------------------------------------------- -/** v * M == M.transpose() * v */ -inline Vector3 operator* (const Vector3& rkPoint, const Matrix3& rkMatrix) { - Vector3 kProd; - - for (int r = 0; r < 3; ++r) { - kProd[r] = - rkPoint[0] * rkMatrix.elt[0][r] + - rkPoint[1] * rkMatrix.elt[1][r] + - rkPoint[2] * rkMatrix.elt[2][r]; - } - - return kProd; -} - - -} // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/Matrix4.h b/dep/include/g3dlite/G3D/Matrix4.h deleted file mode 100644 index 9ce87d875b8..00000000000 --- a/dep/include/g3dlite/G3D/Matrix4.h +++ /dev/null @@ -1,249 +0,0 @@ -/** - @file Matrix4.h - - 4x4 matrix class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-10-02 - @edited 2009-10-20 - */ - -#ifndef G3D_Matrix4_h -#define G3D_Matrix4_h - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (push) -# pragma warning( disable : 4127 ) -#endif - -#include "G3D/platform.h" -#include "G3D/debugAssert.h" -#include "G3D/Matrix3.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Any; - -/** - A 4x4 matrix. - - See also G3D::CoordinateFrame, G3D::Matrix3, G3D::Quat - */ -class Matrix4 { -private: - - float elt[4][4]; - - /** - Computes the determinant of the 3x3 matrix that lacks excludeRow - and excludeCol. - */ - float subDeterminant(int excludeRow, int excludeCol) const; - - // Hidden operators - bool operator<(const Matrix4&) const; - bool operator>(const Matrix4&) const; - bool operator<=(const Matrix4&) const; - bool operator>=(const Matrix4&) const; - -public: - /** Must be of the form: Matrix4(#, #, # .... #)*/ - Matrix4(const Any& any); - - operator Any() const; - - Matrix4( - float r1c1, float r1c2, float r1c3, float r1c4, - float r2c1, float r2c2, float r2c3, float r2c4, - float r3c1, float r3c2, float r3c3, float r3c4, - float r4c1, float r4c2, float r4c3, float r4c4); - - /** - init should be row major. - */ - Matrix4(const float* init); - - /** - a is the upper left 3x3 submatrix and b is the upper right 3x1 submatrix. The last row of the created matrix is (0,0,0,1). - */ - Matrix4(const class Matrix3& upper3x3, const class Vector3& lastCol = Vector3::zero()); - - Matrix4(const class CoordinateFrame& c); - - Matrix4(const double* init); - - Matrix4(); - - /** Produces an RT transformation that nearly matches this Matrix4. - Because a Matrix4 may not be precisely a rotation and translation, - this may introduce error. */ - class CoordinateFrame approxCoordinateFrame() const; - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Matrix4& identity(); - static const Matrix4& zero(); - - /** If this is a perspective projection matrix created by - Matrix4::perspectiveProjection, extract its parameters. */ - void getPerspectiveProjectionParameters - (float& left, - float& right, - float& bottom, - float& top, - float& nearval, - float& farval, - float updirection = -1.0f) const; - - inline float* operator[](int r) { - debugAssert(r >= 0); - debugAssert(r < 4); - return (float*)&elt[r]; - } - - inline const float* operator[](int r) const { - debugAssert(r >= 0); - debugAssert(r < 4); - return (const float*)&elt[r]; - } - - inline operator float* () { - return (float*)&elt[0][0]; - } - - inline operator const float* () const { - return (const float*)&elt[0][0]; - } - - Matrix4 operator*(const Matrix4& other) const; - - class Matrix3 upper3x3() const; - - /** Homogeneous multiplication. Let k = M * [v w]^T. result = k.xyz() / k.w */ - class Vector3 homoMul(const class Vector3& v, float w) const; - - /** - Constructs an orthogonal projection matrix from the given parameters. - Near and far are the NEGATIVE of the near and far plane Z values - (to follow OpenGL conventions). - - \param upDirection Use -1.0 for 2D Y increasing downwards (the G3D 8.x default convention), - 1.0 for 2D Y increasing upwards (the G3D 7.x default and OpenGL convention) - */ - static Matrix4 orthogonalProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval, - float upDirection = -1.0f); - - - /** \param upDirection Use -1.0 for 2D Y increasing downwards (the G3D 8.x default convention), - 1.0 for 2D Y increasing upwards (the G3D 7.x default and OpenGL convention) - */ - static Matrix4 orthogonalProjection( - const class Rect2D& rect, - float nearval, - float farval, - float upDirection = -1.0f); - - /** \param upDirection Use -1.0 for 2D Y increasing downwards (the G3D 8.x default convention), - 1.0 for 2D Y increasing upwards (the G3D 7.x default and OpenGL convention) - */ - static Matrix4 perspectiveProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval, - float upDirection = -1.0f); - - void setRow(int r, const class Vector4& v); - void setColumn(int c, const Vector4& v); - - const Vector4& row(int r) const; - Vector4 column(int c) const; - - Matrix4 operator*(const float s) const; - Vector4 operator*(const Vector4& vector) const; - - Matrix4 transpose() const; - - bool operator!=(const Matrix4& other) const; - bool operator==(const Matrix4& other) const; - - float determinant() const; - Matrix4 inverse() const; - - /** - Transpose of the cofactor matrix (used in computing the inverse). - Note: This is in fact only one type of adjoint. More generally, - an adjoint of a matrix is any mapping of a matrix which possesses - certain properties. This returns the so-called adjugate - or classical adjoint. - */ - Matrix4 adjoint() const; - Matrix4 cofactor() const; - - /** Serializes row-major */ - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - std::string toString() const; - - /** 3D scale matrix */ - inline static Matrix4 scale(const Vector3& v) { - return Matrix4(v.x, 0, 0, 0, - 0, v.y, 0, 0, - 0, 0, v.z, 0, - 0, 0, 0, 1); - } - - /** 3D scale matrix */ - inline static Matrix4 scale(float x, float y, float z) { - return scale(Vector3(x, y, z)); - } - - /** 3D scale matrix */ - inline static Matrix4 scale(float s) { - return scale(s,s,s); - } - - /** 3D translation matrix */ - inline static Matrix4 translation(const Vector3& v) { - return Matrix4(Matrix3::identity(), v); - } - - inline static Matrix4 translation(float x, float y, float z) { - return Matrix4(Matrix3::identity(), Vector3(x, y, z)); - } - - /** Create a rotation matrix that rotates \a deg degrees around the Y axis */ - inline static Matrix4 yawDegrees(float deg) { - return Matrix4(Matrix3::fromAxisAngle(Vector3::unitY(), toRadians(deg))); - } - - inline static Matrix4 pitchDegrees(float deg) { - return Matrix4(Matrix3::fromAxisAngle(Vector3::unitX(), toRadians(deg))); - } - - inline static Matrix4 rollDegrees(float deg) { - return Matrix4(Matrix3::fromAxisAngle(Vector3::unitZ(), toRadians(deg))); - } -}; - - - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/MemoryManager.h b/dep/include/g3dlite/G3D/MemoryManager.h deleted file mode 100644 index 15bf6d8be43..00000000000 --- a/dep/include/g3dlite/G3D/MemoryManager.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - @file MemoryManager.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2009-04-20 - @edited 2009-04-20 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_MemoryManager_h -#define G3D_MemoryManager_h - -#include "G3D/platform.h" -#include "G3D/ReferenceCount.h" - -namespace G3D { - -/** - Abstraction of memory management. - Default implementation uses G3D::System::malloc and is threadsafe. - - \sa CRTMemoryManager, AlignedMemoryManager, AreaMemoryManager */ -class MemoryManager : public ReferenceCountedObject { -protected: - - MemoryManager(); - -public: - - typedef ReferenceCountedPointer Ref; - - /** Return a pointer to \a s bytes of memory that are unused by - the rest of the program. The contents of the memory are - undefined */ - virtual void* alloc(size_t s); - - /** Invoke to declare that this memory will no longer be used by - the program. The memory manager is not required to actually - reuse or release this memory. */ - virtual void free(void* ptr); - - /** Returns true if this memory manager is threadsafe (i.e., alloc - and free can be called asychronously) */ - virtual bool isThreadsafe() const; - - /** Return the instance. There's only one instance of the default - MemoryManager; it is cached after the first creation. */ - static MemoryManager::Ref create(); -}; - -/** - Allocates memory on 16-byte boundaries. - \sa MemoryManager, CRTMemoryManager, AreaMemoryManager */ -class AlignedMemoryManager : public MemoryManager { -protected: - - AlignedMemoryManager(); - -public: - - typedef ReferenceCountedPointer Ref; - - - virtual void* alloc(size_t s); - - virtual void free(void* ptr); - - virtual bool isThreadsafe() const; - - static AlignedMemoryManager::Ref create(); -}; - - -/** MemoryManager implemented using the C runtime. */ -class CRTMemoryManager : public MemoryManager { -protected: - CRTMemoryManager(); - -public: - typedef ReferenceCountedPointer Ref; - virtual void* alloc(size_t s); - virtual void free(void* ptr); - virtual bool isThreadsafe() const; - - /** There's only one instance of this memory manager; it is - cached after the first creation. */ - static CRTMemoryManager::Ref create(); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/MeshAlg.h b/dep/include/g3dlite/G3D/MeshAlg.h deleted file mode 100644 index 1decea10105..00000000000 --- a/dep/include/g3dlite/G3D/MeshAlg.h +++ /dev/null @@ -1,683 +0,0 @@ -/** - @file MeshAlg.h - - Indexed Mesh algorithms. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-09-14 - @edited 2010-01-18 -*/ - -#ifndef G3D_MeshAlg_h -#define G3D_MeshAlg_h - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/SmallArray.h" -#include "G3D/constants.h" -#include "G3D/Image1.h" - -#ifdef G3D_WIN32 -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -#pragma warning (disable : 4127) -#endif - -namespace G3D { - -/** - Indexed mesh algorithms. You have to build your own mesh class. -

- No mesh class is provided with G3D because there isn't an "ideal" - mesh format-- one application needs keyframed animation, another - skeletal animation, a third texture coordinates, a fourth - cannot precompute information, etc. Instead of compromising, this - class implements the hard parts of mesh computation and you can write - your own ideal mesh class on top of it. - - \sa G3D::ArticulatedModel, G3D::IFSModel - */ -class MeshAlg { -public: - - /** \deprecated */ - typedef PrimitiveType Primitive; - - /** Adjacency information for a vertex. - Does not contain the vertex position or normal, - which are stored in the MeshAlg::Geometry object. - Vertexs must be stored in an array - parallel to (indexed in the same way as) - MeshAlg::Geometry::vertexArray. - */ - class Vertex { - public: - Vertex() {} - - /** - Array of edges adjacent to this vertex. - Let e = edgeIndex[i]. - edge[(e >= 0) ? e : ~e].vertexIndex[0] == this - vertex index. - - Edges may be listed multiple times if they are - degenerate. - */ - SmallArray edgeIndex; - - /** - Returns true if e or ~e is in the edgeIndex list. - */ - inline bool inEdge(int e) const { - return edgeIndex.contains(~e) || edgeIndex.contains(e); - } - - /** - Array of faces containing this vertex. Faces - may be listed multiple times if they are degenerate. - */ - SmallArray faceIndex; - - inline bool inFace(int f) const { - debugAssert(f >= 0); - return faceIndex.contains(f); - } - }; - - - /** - Oriented, indexed triangle. - */ - class Face { - public: - Face(); - - /** - Used by Edge::faceIndex to indicate a missing face. - This is a large negative value. - */ - static const int NONE; - - - /** - Vertices in the face in counter-clockwise order. - Degenerate faces may include the same vertex multiple times. - */ - int vertexIndex[3]; - - inline bool containsVertex(int v) const { - return contains(vertexIndex, 3, v); - } - - /** - Edge indices in counter-clockwise order. Edges are - undirected, so it is important to know which way - each edge is pointing in a face. This is encoded - using negative indices. - - If edgeIndex[i] >= 0 then this face - contains the directed edge - between vertex indices - edgeArray[face.edgeIndex[i]].vertexIndex[0] - and - edgeArray[face.edgeIndex[i]].vertexIndex[1]. - - If edgeIndex[i] < 0 then - ~edgeIndex[i] (i.e. the two's - complement of) is used and this face contains the directed - edge between vertex indices - edgeArray[~face.edgeIndex[i]].vertexIndex[0] - and - edgeArray[~face.edgeIndex[i]].vertexIndex[1]. - - Degenerate faces may include the same edge multiple times. - */ - // Temporarily takes on the value Face::NONE during adjacency - // computation to indicate an edge that has not yet been assigned. - int edgeIndex[3]; - - inline bool containsEdge(int e) const { - if (e < 0) { - e = ~e; - } - return contains(edgeIndex, 3, e) || contains(edgeIndex, 3, ~e); - } - - /** Contains the forward edge e if e >= 0 and the backward edge - ~e otherwise. */ - inline bool containsDirectedEdge(int e) const { - return contains(edgeIndex, 3, e); - } - }; - - - /** Oriented, indexed edge */ - class Edge { - public: - Edge(); - - /** Degenerate edges may include the same vertex times. */ - int vertexIndex[2]; - - inline bool containsVertex(int v) const { - return contains(vertexIndex, 2, v); - } - - /** - The edge is directed forward in face 0 - backward in face 1. Face index of MeshAlg::Face::NONE - indicates a boundary (a.k.a. crack, broken) edge. - */ - int faceIndex[2]; - - /** Returns true if f is contained in the faceIndex array in either slot. - To see if it is forward in that face, just check edge.faceIndex[0] == f.*/ - inline bool inFace(int f) const { - return contains(faceIndex, 2, f); - } - - /** - Returns true if either faceIndex is NONE. - */ - inline bool boundary() const { - return (faceIndex[0] == Face::NONE) || - (faceIndex[1] == Face::NONE); - } - - /** - Returns the reversed edge. - */ - inline Edge reverse() const { - Edge e; - e.vertexIndex[0] = vertexIndex[1]; - e.vertexIndex[1] = vertexIndex[0]; - e.faceIndex[0] = faceIndex[1]; - e.faceIndex[1] = faceIndex[0]; - return e; - } - }; - - - /** - Convenient for passing around the per-vertex data that changes under - animation. The faces and edges are needed to interpret - these values. - */ - class Geometry { - public: - /** Vertex positions */ - Array vertexArray; - - /** Vertex normals */ - Array normalArray; - - /** - Assignment is optimized using SSE. - */ - Geometry& operator=(const Geometry& src); - - void clear() { - vertexArray.clear(); - normalArray.clear(); - } - }; - - /** - Given a set of vertices and a set of indices for traversing them - to create triangles, computes other mesh properties. - - Colocated vertices are treated as separate. To have - colocated vertices collapsed (necessary for many algorithms, - like shadowing), weld the mesh before computing adjacency. - - Recent change: In version 6.00, colocated vertices were automatically - welded by this routine and degenerate faces and edges were removed. That - is no longer the case. - - Where two faces meet, there are two opposite directed edges. These - are collapsed into a single bidirectional edge in the edgeArray. - If four faces meet exactly at the same edge, that edge will appear - twice in the array, and so on. If an edge is a boundary of the mesh - (i.e. if the edge has only one adjacent face) it will appear in the - array with one face index set to MeshAlg::Face::NONE. - - @param vertexGeometry %Vertex positions to use when deciding colocation. - @param indexArray Order to traverse vertices to make triangles - @param faceArray Output - @param edgeArray Output. Sorted so that boundary edges are at the end of the array. - @param vertexArray Output - */ - static void computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array& vertexArray); - - /** - @deprecated Use the other version of computeAdjacency, which takes Array. - @param facesAdjacentToVertex Output adjacentFaceArray[v] is an array of - indices for faces touching vertex index v - */ - static void computeAdjacency( - const Array& vertexArray, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array< Array >& facesAdjacentToVertex); - - /** - Computes some basic mesh statistics including: min, max mean and median, - edge lengths; and min, mean, median, and max face area. - - @param vertexArray %Vertex positions to use when deciding colocation. - @param indexArray Order to traverse vertices to make triangles - @param minEdgeLength Minimum edge length - @param meanEdgeLength Mean edge length - @param medianEdgeLength Median edge length - @param maxEdgeLength Max edge length - @param minFaceArea Minimum face area - @param meanFaceArea Mean face area - @param medianFaceArea Median face area - @param maxFaceArea Max face area - */ - static void computeAreaStatistics( - const Array& vertexArray, - const Array& indexArray, - double& minEdgeLength, - double& meanEdgeLength, - double& medianEdgeLength, - double& maxEdgeLength, - double& minFaceArea, - double& meanFaceArea, - double& medianFaceArea, - double& maxFaceArea); - -private: - - /** Helper for weldAdjacency */ - static void weldBoundaryEdges( - Array& faceArray, - Array& edgeArray, - Array& vertexArray); - -public: - - /** - Computes tangent and binormal vectors, - which provide a (mostly) consistent - parameterization over the surface for - effects like bump mapping. In the resulting coordinate frame, - T = x (varies with texture s coordinate), B = y (varies with negative texture t coordinate), - and N = z for a right-handed coordinate frame. If a billboard is vertical on the screen - in view of the camera, the tangent space matches the camera's coordinate frame. - - The vertex, texCoord, tangent, and binormal - arrays are parallel arrays. - - The resulting tangent and binormal might not be exactly - perpendicular to each other. They are guaranteed to - be perpendicular to the normal. - - @cite Max McGuire - */ - static void computeTangentSpaceBasis( - const Array& vertexArray, - const Array& texCoordArray, - const Array& vertexNormalArray, - const Array& faceArray, - Array& tangent, - Array& binormal); - - /** @deprecated */ - static void computeNormals( - const Array& vertexArray, - const Array& faceArray, - const Array< Array >& adjacentFaceArray, - Array& vertexNormalArray, - Array& faceNormalArray); - - /** - Vertex normals are weighted by the area of adjacent faces. - Nelson Max showed this is superior to uniform weighting for - general meshes in jgt. - - @param vertexNormalArray Output. Unit length - @param faceNormalArray Output. Degenerate faces produce zero magnitude normals. Unit length - @see weld - */ - static void computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array& vertexArray, - Array& vertexNormalArray, - Array& faceNormalArray); - - /** Computes unit length normals in place using the other computeNormals methods. - If you already have a face array use another method; it will be faster. - @see weld*/ - static void computeNormals( - Geometry& geometry, - const Array& indexArray); - - /** - Computes face normals only. Significantly faster (especially if - normalize is false) than computeNormals. - @see weld - */ - static void computeFaceNormals( - const Array& vertexArray, - const Array& faceArray, - Array& faceNormals, - bool normalize = true); - - /** - Classifies each face as a backface or a front face relative - to the observer point P (which is at infinity when P.w = 0). - A face with normal exactly perpendicular to the observer vector - may be classified as either a front or a back face arbitrarily. - */ - static void identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& P, - Array& backface); - - /** A faster version of identifyBackfaces for the case where - face normals have already been computed */ - static void identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& P, - Array& backface, - const Array& faceNormals); - - /** - Welds nearby and colocated elements of the oldVertexArray together so that - newVertexArray contains no vertices within radius of one another. - Every vertex in newVertexPositions also appears in oldVertexPositions. - This is useful for downsampling meshes and welding cracks created by artist errors - or numerical imprecision. - - The two integer arrays map indices back and forth between the arrays according to: -

-     oldVertexArray[toOld[ni]] == newVertexArray[ni]
-     oldVertexArray[oi] == newVertexArray[toNew[ni]]
-     
- - Note that newVertexPositions is never longer than oldVertexPositions - and is shorter when vertices are welded. - - Welding with a large radius will effectively compute a lower level of detail for - the mesh. - - The welding method runs in roughly linear time in the length of oldVertexArray-- - a uniform spatial grid is used to achieve nearly constant time vertex collapses - for uniformly distributed vertices. - - It is sometimes desirable to keep the original vertex ordering but - identify the unique vertices. The following code computes - array canonical s.t. canonical[v] = first occurance of - a vertex near oldVertexPositions[v] in oldVertexPositions. - -
-        Array canonical(oldVertexPositions.size()), toNew, toOld;
-        computeWeld(oldVertexPositions, Array(), toNew, toOld, radius);
-        for (int v = 0; v < canonical.size(); ++v) {
-            canonical[v] = toOld[toNew[v]];
-        }
-     
- - See also G3D::MeshAlg::weldAdjacency. - - @cite The method is that described as the 'Grouper' in Baum, Mann, Smith, and Winget, - Making Radiosity Usable: Automatic Preprocessing and Meshing Techniques for - the Generation of Accurate Radiosity Solutions, Computer Graphics vol 25, no 4, July 1991. - - @deprecated Use weld. - */ - static void computeWeld( - const Array& oldVertexPositions, - Array& newVertexPositions, - Array& toNew, - Array& toOld, - double radius = fuzzyEpsilon); - - /** - Modifies the face, edge, and vertex arrays in place so that - colocated (within radius) vertices are treated as identical. - Note that the vertexArray and corresponding geometry will - contain elements that are no longer used. In the vertexArray, - these elements are initialized to MeshAlg::Vertex() but not - removed (because removal would change the indexing). - - This is a good preprocessing step for algorithms that are only - concerned with the shape of a mesh (e.g. cartoon rendering, fur, shadows) - and not the indexing of the vertices. - - Use this method when you have already computed adjacency information - and want to collapse colocated vertices within that data without - disturbing the actual mesh vertices or indexing scheme. - - If you have not computed adjacency already, use MeshAlg::computeWeld - instead and compute adjacency information after welding. - - @deprecated Use weld. - - @param faceArray Mutated in place. Size is maintained (degenerate - faces are not removed). - @param edgeArray Mutated in place. May shrink if boundary edges - are welded together. - @param vertexArray Mutated in place. Size is maintained (duplicate - vertices contain no adjacency info). - */ - static void weldAdjacency( - const Array& originalGeometry, - Array& faceArray, - Array& edgeArray, - Array& vertexArray, - double radius = fuzzyEpsilon); - - - /** - Counts the number of edges (in an edge array returned from - MeshAlg::computeAdjacency) that have only one adjacent face. - */ - static int countBoundaryEdges(const Array& edgeArray); - - - /** - Generates an array of integers from start to start + n - 1 that have run numbers - in series then omit the next skip before the next run. Useful for turning - a triangle list into an indexed face set. - - Example: -
-       createIndexArray(10, x);
-       // x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 
-
-       createIndexArray(5, x, 2);
-       // x = [2, 3, 4, 5, 6, 7] 
-
-       createIndexArray(6, x, 0, 2, 1);
-       // x = [0, 1, 3, 4, 6, 7]
-     
- */ - static void createIndexArray( - int n, - Array& array, - int start = 0, - int run = 1, - int skip = 0); - - /** - Computes a conservative, near-optimal axis aligned bounding box and sphere. - - @cite The bounding sphere uses the method from J. Ritter. An effcient bounding sphere. In Andrew S. Glassner, editor, Graphics Gems. Academic Press, Boston, MA, 1990. - - */ - static void computeBounds(const Array& vertex, class AABox& box, class Sphere& sphere); - - /** Computes bounds for a subset of the vertices. It is ok if vertices appear more than once in the index array. */ - static void computeBounds(const Array& vertex, const Array& index, class AABox& box, class Sphere& sphere); - - /** - In debug mode, asserts that the adjacency references between the - face, edge, and vertex array are consistent. - */ - static void debugCheckConsistency( - const Array& faceArray, - const Array& edgeArray, - const Array& vertexArray); - - /** - Generates a unit square in the X-Z plane composed of a grid of wCells x hCells - squares and then transforms it by xform. - - @param vertex Output vertices - @param texCoord Output texture coordinates - @param index Output triangle list indices - @param textureScale Lower-right texture coordinate - @param spaceCentered If true, the coordinates generated are centered at the origin before the transformation. - @param twoSided If true, matching top and bottom planes are generated. - \param elevation If non-NULL, values from this image are used as elevations. Apply an \a xform to adjust the scale - */ - static void generateGrid( - Array& vertex, - Array& texCoord, - Array& index, - int wCells = 10, - int hCells = 10, - const Vector2& textureScale = Vector2(1,1), - bool spaceCentered = true, - bool twoSided = true, - const CoordinateFrame& xform = CoordinateFrame(), - const Image1::Ref& elevation = NULL); - - /** Converts quadlist (QUADS), - triangle fan (TRIANGLE_FAN), - tristrip(TRIANGLE_STRIP), and quadstrip (QUAD_STRIP) indices into - triangle list (TRIANGLES) indices and appends them to outIndices. */ - template - static void toIndexedTriList( - const Array& inIndices, - MeshAlg::Primitive inType, - Array& outIndices) { - - debugAssert( - inType == PrimitiveType::TRIANGLE_STRIP || - inType == PrimitiveType::TRIANGLE_FAN || - inType == PrimitiveType::QUADS || - inType == PrimitiveType::QUAD_STRIP); - - const int inSize = inIndices.size(); - - switch(inType) { - case PrimitiveType::TRIANGLE_FAN: - { - debugAssert(inSize >= 3); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - for (IndexType i = 1, outIndex = N; i <= (inSize - 2); ++i, outIndex += 3) { - outIndices[outIndex] = inIndices[0]; - outIndices[outIndex + 1] = inIndices[i]; - outIndices[outIndex + 2] = inIndices[i + 1]; - } - - break; - } - - case PrimitiveType::TRIANGLE_STRIP: - { - debugAssert(inSize >= 3); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - bool atEven = false; - for (IndexType i = 0, outIndex = N; i <= (inSize - 2); ++i, outIndex += 3) { - if (atEven) { - outIndices[outIndex] = inIndices[i + 1]; - outIndices[outIndex + 1] = inIndices[i]; - outIndices[outIndex + 2] = inIndices[i + 2]; - atEven = false; - } else { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 2]; - atEven = true; - } - } - - break; - } - - case PrimitiveType::QUADS: - { - debugAssert(inIndices.size() >= 4); - - int N = outIndices.size(); - outIndices.resize(N + (inSize / 4) * 3); - - for (IndexType i = 0, outIndex = N; i <= (inSize - 4); i += 4, outIndex += 6) { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 3]; - outIndices[outIndex + 3] = inIndices[i + 1]; - outIndices[outIndex + 4] = inIndices[i + 2]; - outIndices[outIndex + 5] = inIndices[i + 3]; - } - - break; - } - - case PrimitiveType::QUAD_STRIP: - { - debugAssert(inIndices.size() >= 4); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - for (IndexType i = 0, outIndex = N; i <= (inSize - 2); i += 2, outIndex += 6) { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 2]; - outIndices[outIndex + 3] = inIndices[i + 2]; - outIndices[outIndex + 4] = inIndices[i + 1]; - outIndices[outIndex + 5] = inIndices[i + 3]; - } - break; - } - default: - alwaysAssertM(false, "Illegal argument"); - } - } - -protected: - - /** - Helper for computeAdjacency. If a directed edge with index e already - exists from i0 to i1 then e is returned. If a directed edge with index e - already exists from i1 to i0, ~e is returned (the complement) and - edgeArray[e] is set to f. Otherwise, a new edge is created from i0 to i1 - with first face index f and its index is returned. - - @param vertexArray Vertex positions to use when deciding colocation. - - @param area Area of face f. When multiple edges of the same direction - are found between the same vertices (usually because of degenerate edges) - the face with larger area is kept in the edge table. - */ - static int findEdgeIndex( - const Array& vertexArray, - Array& geometricEdgeArray, - int i0, int i1, int f, double area); -}; -} -#endif - diff --git a/dep/include/g3dlite/G3D/MeshBuilder.h b/dep/include/g3dlite/G3D/MeshBuilder.h deleted file mode 100644 index 9920d59d7d3..00000000000 --- a/dep/include/g3dlite/G3D/MeshBuilder.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - @file MeshBuilder.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-02-27 - @edited 2004-10-04 - */ -#ifndef G3D_MESHBUILDER_H -#define G3D_MESHBUILDER_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/Triangle.h" - -namespace G3D { - -/** - Allows creation of optimized watertight meshes from unoptimized polygon soups. - See also G3D::MeshAlg for algorithms that operate on the output. - */ -class MeshBuilder { -public: - - /** - Set setWeldRadius to AUTO_WELD to weld vertices closer than 1/2 - the smallest edge length in a model. - */ - enum {AUTO_WELD = -100}; - -private: - /** Indices of vertices in or near a grid cell. */ - typedef Array List; - - std::string name; - - /** - All of the triangles, as a long triangle list. - */ - Array triList; - - void centerTriList(); - void computeBounds(Vector3& min, Vector3& max); - - bool _twoSided; - - /** Collapse radius */ - double close; - -public: - - inline MeshBuilder(bool twoSided = false) : _twoSided(twoSided), close(AUTO_WELD) {} - - /** Writes the model to the arrays, which can then be used with - G3D::IFSModel::save and G3D::MeshAlg */ - void commit(std::string& name, Array& indexArray, Array& vertexArray); - - /** - Adds a new triangle to the model. (Counter clockwise) - */ - void addTriangle(const Vector3& a, const Vector3& b, const Vector3& c); - - /** - Adds two new triangles to the model. (Counter clockwise) - */ - void addQuad(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d); - - void addTriangle(const Triangle& t); - - void setName(const std::string& n); - - /** Vertices within this distance are considered identical. - Use AUTO_WELD (the default) to have the distance be a function of the model size.*/ - void setWeldRadius(double r) { - close = r; - } -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/NetAddress.h b/dep/include/g3dlite/G3D/NetAddress.h deleted file mode 100644 index 8ed20a06690..00000000000 --- a/dep/include/g3dlite/G3D/NetAddress.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef G3D_NETADDRESS_H -#define G3D_NETADDRESS_H - -#include "G3D/platform.h" -#include "G3D/Table.h" - -/** These control the version of Winsock used by G3D. - Version 2.0 is standard for G3D 6.09 and later. - Version 1.1 is standard for G3D 6.08 and earlier. - */ -#define G3D_WINSOCK_MAJOR_VERSION 2 -#define G3D_WINSOCK_MINOR_VERSION 0 - -#ifdef G3D_WIN32 -# if (G3D_WINSOCK_MAJOR_VERSION == 2) -# include -# elif (G3D_WINSOCK_MAJOR_VERSION == 1) -# include -# endif -#else -# include -# include -# include -# ifndef SOCKADDR_IN -# define SOCKADDR_IN struct sockaddr_in -# endif -# ifndef SOCKET -# define SOCKET int -# endif -#endif - -#include "G3D/g3dmath.h" - -namespace G3D { - -class NetAddress { -private: - friend class NetworkDevice; - friend class LightweightConduit; - friend class ReliableConduit; - - /** Host byte order */ - void init(uint32 host, uint16 port); - void init(const std::string& hostname, uint16 port); - NetAddress(const SOCKADDR_IN& a); - NetAddress(const struct in_addr& addr, uint16 port = 0); - - SOCKADDR_IN addr; - -public: - /** - In host byte order - */ - NetAddress(uint32 host, uint16 port = 0); - - /** - @param port Specified in host byte order (i.e., don't worry about endian issues) - */ - NetAddress(const std::string& hostname, uint16 port); - - /** - @param hostnameAndPort in the form "hostname:port" or "ip:port" - */ - NetAddress(const std::string& hostnameAndPort); - - /** - @deprecated Use G3D::NetworkDevice::broadcastAddressArray() - - @brief Creates a UDP broadcast address for use with a - G3D::LightweightConduit. - - UDP broadcast allows one machine to send a packet to all machines - on the same local network. The IP portion of the address is - 0xFFFFFFFF, which indicates "broadcast" to the underlying socket - API. This feature is not available with the connection-based TCP - protocol abstracted by G3D::ReliableConduit; use multisend - instead. - */ - static NetAddress broadcastAddress(uint16 port); - - NetAddress(); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** @brief Returns true if this is not an illegal address. */ - bool ok() const; - - /** @brief Returns a value in host format (i.e., don't worry about - endian issues) */ - inline uint32 ip() const { - return ntohl(addr.sin_addr.s_addr); - //return ntohl(addr.sin_addr.S_un.S_addr); - } - - inline uint16 port() const { - return ntohs(addr.sin_port); - } - - std::string ipString() const; - std::string toString() const; - -}; - -std::ostream& operator<<(std::ostream& os, const NetAddress&); - -} // namespace G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::NetAddress& key) { - return static_cast(key.ip() + (static_cast(key.port()) << 16)); - } -}; - -namespace G3D { - -/** - Two addresses may point to the same computer but be != because - they have different IP's. - */ -inline bool operator==(const NetAddress& a, const NetAddress& b) { - return (a.ip() == b.ip()) && (a.port() == b.port()); -} - - -inline bool operator!=(const NetAddress& a, const NetAddress& b) { - return !(a == b); -} - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/NetworkDevice.h b/dep/include/g3dlite/G3D/NetworkDevice.h deleted file mode 100644 index ea3290cbc09..00000000000 --- a/dep/include/g3dlite/G3D/NetworkDevice.h +++ /dev/null @@ -1,738 +0,0 @@ -/** - @file NetworkDevice.h - - These classes abstract networking from the socket level to a - serialized messaging style that is more appropriate for games. The - performance has been tuned for sending many small messages. The - message protocol contains a header that prevents them from being used - with raw UDP/TCP (e.g. connecting to an HTTP server). - - LightweightConduit and ReliableConduits have different interfaces - because they have different semantics. You would never want to - interchange them without rewriting the surrounding code. - - NetworkDevice creates conduits because they need access to a global - log pointer and because I don't want non-reference counted conduits - being created. - - Be careful with threads and reference counting. The reference - counters are not threadsafe, and are also not updated correctly if a - thread is explicitly killed. Since the conduits will be passed by - const XConduitRef& most of the time this doesn't appear as a major - problem. With non-blocking conduits, you should need few threads - anyway. - - LightweightConduits preceed each message with a 4-byte host order - unsigned integer that is the message type. This does not appear in - the message serialization/deserialization. - - ReliableConduits preceed each message with two 4-byte host order - unsigned integers. The first is the message type and the second - indicates the length of the rest of the data. The size does not - include the size of the header itself. The minimum message is 9 - bytes:a 4-byte type, a 4-byte header equal to "1", and one byte of data. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-11-22 - @edited 2006-11-25 - */ - -#ifndef G3D_NETWORKDEVICE_H -#define G3D_NETWORKDEVICE_H - -#include "G3D/platform.h" -#include "G3D/NetAddress.h" - -#include -#include -#include "G3D/g3dmath.h" - -#include "G3D/ReferenceCount.h" -#include "G3D/Array.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -class TextOutput; - -class Conduit : public ReferenceCountedObject { -protected: - friend class NetworkDevice; - friend class NetListener; - - uint64 mSent; - uint64 mReceived; - uint64 bSent; - uint64 bReceived; - - SOCKET sock; - - /** - Used for serialization. One per socket - to make this threadsafe. - */ - BinaryOutput binaryOutput; - - Conduit(); - -public: - - virtual ~Conduit(); - uint64 bytesSent() const; - uint64 messagesSent() const; - uint64 bytesReceived() const; - uint64 messagesReceived() const; - - /** - If true, receive will return true. - */ - virtual bool messageWaiting(); - - /** - Returns the type of the waiting message (i.e. the type supplied - with send). The return value is zero when there is no message - waiting. - - One way to use this is to have a Table mapping message types to - pre-allocated subclasses so receiving looks like: - -
-         // My base class for messages.
-         class Message {
-             virtual void serialize(BinaryOutput&) const;
-             virtual void deserialize(BinaryInput&);
-             virtual void process() = 0;
-         };
-
-         Message* m = table[conduit->waitingMessageType()];
-         conduit->receive(m);
-         m->process();
-     
- - Another is to simply switch on the message type: - -
-         switch (conduit->waitingMessageType()) {
-         case 0:
-            // No message
-            break;
-
-         case ENTITY_SPAWN_MSG:
-            {
-               EntitySpawnMsg m;
-               condiut->receive(m);
-               spawnEntity(m.id, m.position, m.modelID);
-            }
-            break;
-            ...
-         }
-      
- */ - virtual uint32 waitingMessageType() = 0; - - /** Returns true if the connection is ok. */ - bool ok() const; -}; - -typedef ReferenceCountedPointer ReliableConduitRef; - -#ifdef __GNUC__ -// Workaround for a known bug in gcc 4.x where htonl produces -// a spurrious warning. -// http://gcc.gnu.org/ml/gcc-bugs/2005-10/msg03270.html -uint32 gcchtonl(uint32); -#endif - -// Messaging and stream APIs must be supported on a single class because -// sometimes an application will switch modes on a single socket. For -// example, when transferring 3D level geometry during handshaking with -// a game server. -/** - A conduit that guarantees messages will arrive, intact and in order. - Create on the client using NetworkDevice::createReliableConduit and - on the server using NetListener::waitForConnection. Set the reference - counted pointer to NULL to disconnect. - - To construct a ReliableConduit: -
    -
  1. Create a G3D::NetworkDevice (if you are using G3D::GApp, it creates - one for you) on the client and on the server. -
  2. On the server, create a G3D::NetListener using - G3D::NetworkDevice::createListener -
  3. On the server, invoke G3D::NetListener::waitForConnection. -
  4. On the client, call G3D::NetworkDevice::createReliableConduit. - You will need the server's G3D::NetAddress. Consider using - G3D::Discovery::Client to find it via broadcasting. -
- - */ -class ReliableConduit : public Conduit { -private: - friend class NetworkDevice; - friend class NetListener; - - enum State {RECEIVING, HOLDING, NO_MESSAGE} state; - - NetAddress addr; - - /** - Type of the incoming message. - */ - uint32 messageType; - - /** - Total size of the incoming message (read from the header). - */ - uint32 messageSize; - - /** Shared buffer for receiving messages. */ - void* receiveBuffer; - - /** Total size of the receiveBuffer. */ - size_t receiveBufferTotalSize; - - /** Size occupied by the current message... so far. This will be - equal to messageSize when the whole message has arrived. - */ - size_t receiveBufferUsedSize; - - ReliableConduit(const NetAddress& addr); - - ReliableConduit(const SOCKET& sock, - const NetAddress& addr); - - template static void serializeMessage - (uint32 t, const T& m, BinaryOutput& b) { - - b.writeUInt32(t); - - // Reserve space for the 4 byte size header - b.writeUInt32(0); - - size_t L = b.length(); - m.serialize(b); - if ((size_t)b.length() == L) { - // No data was created by serialization. - // We need to send at least one byte because receive assumes that - // a zero length message is an error. - b.writeUInt8(0xFF); - } - - uint32 len = b.size() - 8; - - // We send the length first to tell recv how much data to read. - // Here we abuse BinaryOutput a bit and write directly into - // its buffer, violating the abstraction. - // Note that we write to the second set of 4 bytes, which is - // the size field. - uint32* lenPtr = ((uint32*)b.getCArray()) + 1; - #if defined(__GNUC__) - *lenPtr = gcchtonl(len); - #else - *lenPtr = htonl(len); - #endif - } - - - void sendBuffer(const BinaryOutput& b); - - /** Accumulates whatever part of the message (not the header) is - still waiting on the socket into the receiveBuffer during - state = RECEIVING mode. Closes the socket if anything goes - wrong. When receiveBufferUsedSize == messageSize, the entire - message has arrived. */ - void receiveIntoBuffer(); - - /** Receives the messageType and messageSize from the socket. */ - void receiveHeader(); - -public: - - /** - Client invokes this to connect to a server. The call blocks until the - conduit is opened. The conduit will not be ok() if it fails. - */ - static ReliableConduitRef create(const NetAddress& address); - - /** Closes the socket. */ - ~ReliableConduit(); - - - // The message is actually copied from the socket to an internal buffer during - // this call. Receive only deserializes. - virtual bool messageWaiting(); - - /** - Serializes the message and schedules it to be sent as soon as possible, - and then returns immediately. The message can be any class with - a serialize and deserialize method. On the receiving side, - use G3D::ReliableConduit::waitingMessageType() to detect the incoming - message and then invoke G3D::ReliableConduit::receive(msg) where msg - is of the same class as the message that was sent. - - The actual data sent across the network is preceeded by the - message type and the size of the serialized message as a 32-bit - integer. The size is sent because TCP is a stream protocol and - doesn't have a concept of discrete messages. - */ - template inline void send(uint32 type, const T& message) { - binaryOutput.reset(); - serializeMessage(type, message, binaryOutput); - sendBuffer(binaryOutput); - } - - /** Sends an empty message with the given type. Useful for sending - commands that have no parameters. */ - void send(uint32 type); - - /** Send the same message to a number of conduits. Useful for sending - data from a server to many clients (only serializes once). */ - template - inline static void multisend( - const Array& array, - uint32 type, - const T& m) { - - if (array.size() > 0) { - array[0]->binaryOutput.reset(); - serializeMessage(type, m, array[0]->binaryOutput); - - for (int i = 0; i < array.size(); ++i) { - array[i]->sendBuffer(array[0]->binaryOutput); - } - } - } - - virtual uint32 waitingMessageType(); - - /** - If a message is waiting, deserializes the waiting message into - message and returns true, otherwise returns false. You can - determine the type of the message (and therefore, the class - of message) using G3D::ReliableConduit::waitingMessageType(). - */ - template inline bool receive(T& message) { - if (! messageWaiting()) { - return false; - } - - debugAssert(state == HOLDING); - // Deserialize - BinaryInput b((uint8*)receiveBuffer, receiveBufferUsedSize, G3D_LITTLE_ENDIAN, BinaryInput::NO_COPY); - message.deserialize(b); - - // Don't let anyone read this message again. We leave the buffer - // allocated for the next caller, however. - receiveBufferUsedSize = 0; - state = NO_MESSAGE; - messageType = 0; - messageSize = 0; - - // Potentially read the next message. - messageWaiting(); - - return true; - } - - /** Removes the current message from the queue. */ - inline void receive() { - if (! messageWaiting()) { - return; - } - receiveBufferUsedSize = 0; - state = NO_MESSAGE; - messageType = 0; - messageSize = 0; - - // Potentially read the next message. - messageWaiting(); - } - - NetAddress address() const; -}; - - -typedef ReferenceCountedPointer LightweightConduitRef; - -/** - Provides fast but unreliable transfer of messages. On a LAN, - LightweightConduit will probably never drop messages but you - might get your messages out of order. On an internet - connection it might drop messages altogether. Messages are never - corrupted, however. LightweightConduit requires a little less setup - and overhead than ReliableConduit. ReliableConduit guarantees - message delivery and order but requires a persistent connection. - - To set up a LightweightConduit (assuming you have already made - subclasses of G3D::NetMessage based on your application's - pcommunication protocol): - -[Server Side] -
    -
  1. Call LightweightConduit::create(port, true, false), -where port is the port on which you will receive messages. - -
  2. Poll LightweightConduit::messageWaiting from your main loop. When -it is true (or, equivalently, when LightweightConduit::waitingMessageType -is non-zero) there is an incoming message. - -
  3. To read the incoming message, call LightweightConduit::receive with -the appropriate class type, which mist have a deserialize method. -LightweightConduit::waitingMessageType tells you what class is -needed (you make up your own message constants for your program; numbers -under 1000 are reserved for G3D's internal use). - -
  4. When done, simply set the G3D::LightweightConduitRef to NULL or let -it go out of scope and the conduit cleans itself up automatically. -
- -[Client Side] -
    -
  1. Call G3D::LightweightConduit::create(). If you will -broadcast to all servers on a LAN, set the third optional argument to -true (the default is false for no broadcast). You can also set up the -receive port as if it was a server to send and receive from a single -LightweightConduit. - -
  2. To send, call G3D::LightweightConduit::send with the target address -and a pointer to an instance of the message you want to send. - -
  3. When done, simply set the G3D::LightweightConduitRef to NULL or let -it go out of scope and the conduit cleans itself up automatically. - -
- */ -class LightweightConduit : public Conduit { -private: - friend class NetworkDevice; - - /** - True when waitingForMessageType has read the message - from the network into messageType/messageStream. - */ - bool alreadyReadMessage; - - /** - Origin of the received message. - */ - NetAddress messageSender; - - /** - The type of the last message received. - */ - uint32 messageType; - - /** - The message received (the type has already been read off). - */ - Array messageBuffer; - - LightweightConduit(uint16 receivePort, bool enableReceive, bool enableBroadcast); - - void sendBuffer(const NetAddress& a, BinaryOutput& b); - - /** Maximum transmission unit (packet size in bytes) for this socket. - May vary between sockets. */ - int MTU; - - - template - void serializeMessage( - uint32 type, - const T& m, - BinaryOutput& b) const { - - debugAssert(type != 0); - b.writeUInt32(type); - m.serialize(b); - b.writeUInt32(1); - - debugAssertM(b.size() < MTU, - format("This LightweightConduit is limited to messages of " - "%d bytes (Ethernet hardware limit; this is the " - "'UDP MTU')", maxMessageSize())); - - if (b.size() >= MTU) { - throw LightweightConduit::PacketSizeException( - format("This LightweightConduit is limited to messages of " - "%d bytes (Ethernet hardware limit; this is the " - "'UDP MTU')", maxMessageSize()), - b.size() - 4, // Don't count the type header - maxMessageSize()); - } - } - -public: - - static LightweightConduitRef create(uint16 receivePort, bool enableReceive, bool enableBroadcast); - - class PacketSizeException { - public: - std::string message; - int serializedPacketSize; - int maxMessageSize; - - inline PacketSizeException(const std::string& m, int s, int b) : - message(m), - serializedPacketSize(s), - maxMessageSize(b) {} - }; - - /** Closes the socket. */ - ~LightweightConduit(); - - /** The maximum length of a message that can be sent - (G3D places a small header at the front of each UDP packet; - this is already taken into account by the value returned). - */ - inline int maxMessageSize() const { - return MTU - 4; - } - - - template inline void send(const NetAddress& a, uint32 type, const T& msg) { - binaryOutput.reset(); - serializeMessage(type, msg, binaryOutput); - sendBuffer(a, binaryOutput); - } - - /** Send the same message to multiple addresses (only serializes once). - Useful when server needs to send to a known list of addresses - (unlike direct UDP broadcast to all addresses on the subnet) */ - template inline void send(const Array& a, uint32 type, const T& m) { - binaryOutput.reset(); - serializeMessage(type, m, binaryOutput); - - for (int i = 0; i < a.size(); ++i) { - sendBuffer(a[i], binaryOutput); - } - } - - bool receive(NetAddress& sender); - - template inline bool receive(NetAddress& sender, T& message) { - bool r = receive(sender); - if (r) { - BinaryInput b((messageBuffer.getCArray() + 4), - messageBuffer.size() - 4, - G3D_LITTLE_ENDIAN, BinaryInput::NO_COPY); - message.deserialize(b); - } - - return r; - } - - inline bool receive() { - static NetAddress ignore; - return receive(ignore); - } - - virtual uint32 waitingMessageType(); - - - virtual bool messageWaiting(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -typedef ReferenceCountedPointer NetListenerRef; - -/** - Runs on the server listening for clients trying to make reliable connections. - */ -class NetListener : public ReferenceCountedObject { -private: - - friend class NetworkDevice; - - SOCKET sock; - - /** Port is in host byte order. */ - NetListener(uint16 port); - -public: - - static NetListenerRef create(const uint16 port); - - ~NetListener(); - - /** Block until a connection is received. Returns NULL if - something went wrong. */ - ReliableConduitRef waitForConnection(); - - /** True if a client is waiting (i.e. waitForConnection will - return immediately). */ - bool clientWaiting() const; - - bool ok() const; -}; - - -/////////////////////////////////////////////////////////////////////////////// - -/** - @brief Abstraction of network (socket) functionality. - - An abstraction over sockets that provides a message-based network - infrastructure optimized for sending many small (~500 bytes) messages. - All functions always return immediately. - - Create only one NetworkDevice per process (a WinSock restriction). - - NetworkDevice is technically not thread safe. However, as long as - you use different conduits on different threads (or lock conduits - before sending), you will encounter no problems sharing the single - NetworkDevice across multiple threads. That is, do not invoke the same - Conduit's send or receive method on two threads at once. - - This assumes that the underlying WinSock/BSD sockets implementation - is thread safe. That is not guaranteed, but in practice seems - to always be true (see - http://tangentsoft.net/wskfaq/intermediate.html#threadsafety) - -
- - IP networks use "network byte order" (big-endian) for - communicating integers. "Host byte order" is the endian-ness of - the local machine (typically little-endian; see - System::endian). The C functions htonl() and ntohl() convert 32-bit - values between these formats. G3D only ever exposes host byte order, - so programmers rarely need to be aware of the distinction. - - */ -class NetworkDevice { -public: - - /** @brief Description of an ethernet or wireless ethernet adapter.*/ - class EthernetAdapter { - public: - /** Reverse-DNS of the ip address.*/ - std::string hostname; - - /** Name of the adapter */ - std::string name; - - /** IP address in host byte order.*/ - uint32 ip; - - /** Subnet mask in host byte order.*/ - uint32 subnet; - - /** UDP broadcast address in host byte order.*/ - uint32 broadcast; - - /** MAC (hardware) address, if known */ - uint8 mac[6]; - - EthernetAdapter(); - - /** Produces a text description of this adapter */ - void describe(TextOutput& t) const; - }; - -private: - - friend class Conduit; - friend class LightweightConduit; - friend class ReliableConduit; - friend class NetListener; - - bool initialized; - - Array m_adapterArray; - - /** Broadcast addresses available on this machine, - extracted from m_adapterArray.*/ - Array m_broadcastAddresses; - - /** Utility method. */ - void closesocket(SOCKET& sock) const; - - /** Utility method. Returns true on success.*/ - bool bind(SOCKET sock, const NetAddress& addr) const; - - /** The global instance */ - static NetworkDevice* s_instance; - - NetworkDevice(); - - bool init(); - - void _cleanup(); - - /** Called from init to update m_adapterArray and - m_broadcastAddresses. */ - void addAdapter(const EthernetAdapter& a); - -public: - - /** Prints an IP address to a string. - @param ip In host byte order.*/ - static std::string formatIP(uint32 ip); - - /** Prints a MAC address to a string. */ - static std::string formatMAC(const uint8 mac[6]); - - ~NetworkDevice(); - - /** Returns the available ethernet adapters for the current - machine that are online. Does not include the loopback adapter - for localhost.*/ - inline const Array& adapterArray() const { - return m_adapterArray; - } - - /** Returns the (unique) IP addresses for UDP broadcasting - extracted from adapterArray(). All are in host byte order. */ - inline const Array& broadcastAddressArray() const { - return m_broadcastAddresses; - } - - /** - Returns NULL if there was a problem initializing the network. - */ - static NetworkDevice* instance(); - - /** - Shuts down the network device (destroying the global instance). - */ - static void cleanup(); - - /** - Prints a human-readable description of this machine - to the text output stream. - */ - void describeSystem( - TextOutput& t); - - void describeSystem( - std::string& s); - - /** Returns the name (or one of the names) of this computer */ - std::string localHostName() const; - - /** There is often more than one address for the local host. This - returns all of them. - @deprecated Use adapterArray() - */ - void localHostAddresses(Array& array) const; -}; - - -#ifdef __GNUC__ -inline uint32 gcchtonl(uint32 x) { - // This pragma fools gcc into surpressing all error messages, - // including the bogus one that it creates for htonl -# pragma GCC system_header - return htonl(x); -} -#endif - -} // G3D namespace - -#ifndef _WIN32 -#undef SOCKADDR_IN -#undef SOCKET -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/ParseError.h b/dep/include/g3dlite/G3D/ParseError.h deleted file mode 100644 index f02948e3d29..00000000000 --- a/dep/include/g3dlite/G3D/ParseError.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - @file ParseError.h - - @maintainer Morgan McGuire - - @created 2009-11-15 - @edited 2009-11-15 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_ParseError_h -#define G3D_ParseError_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include - -namespace G3D { - -/** Thrown by TextInput, Any, and other parsers on unexpected input. */ -class ParseError { -public: - enum {UNKNOWN = -1}; - - /** Empty means unknown */ - std::string filename; - - /** For a binary file, the location of the parse error. -1 if unknown.*/ - int64 byte; - - /** For a text file, the line number is the line number of start of token which caused the exception. 1 is - the first line of the file. -1 means unknown. Note that you can use - TextInput::Settings::startingLineNumberOffset to shift the effective line - number that is reported by that class. - */ - int line; - - /** Character number (in the line) of the start of the token which caused the - exception. 1 is the character in the line. May be -1 if unknown. - */ - int character; - - std::string message; - - ParseError() : byte(UNKNOWN), line(UNKNOWN), character(UNKNOWN) {} - - virtual ~ParseError() {} - - ParseError(const std::string& f, int l, int c, const std::string& m) : - filename (f), byte(UNKNOWN), line(l), character(c), message(m) {} - - ParseError(const std::string& f, int64 b, const std::string& m) : - filename (f), byte(b), line(UNKNOWN), character(UNKNOWN), message(m) {} -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/PhysicsFrame.h b/dep/include/g3dlite/G3D/PhysicsFrame.h deleted file mode 100644 index a5a9305b83e..00000000000 --- a/dep/include/g3dlite/G3D/PhysicsFrame.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - @file PhysicsFrame.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-07-08 - @edited 2006-01-10 -*/ - -#ifndef G3D_PHYSICSFRAME_H -#define G3D_PHYSICSFRAME_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Matrix3.h" -#include "G3D/Quat.h" -#include "G3D/CoordinateFrame.h" -#include -#include - - -namespace G3D { - -/** - An RT transformation using a quaternion; suitable for - physics integration. - - This interface is in "Beta" and will change in the next release. - */ -class PhysicsFrame { -public: - - Quat rotation; - - /** - Takes object space points to world space. - */ - Vector3 translation; - - /** - Initializes to the identity frame. - */ - PhysicsFrame(); - - /** - Purely translational force - */ - PhysicsFrame(const Vector3& translation) : translation(translation) {} - - PhysicsFrame(const CoordinateFrame& coordinateFrame); - - /** Compose: create the transformation that is other followed by this.*/ - PhysicsFrame operator*(const PhysicsFrame& other) const; - - virtual ~PhysicsFrame() {} - - CoordinateFrame toCoordinateFrame() const; - - /** - Linear interpolation (spherical linear for the rotations). - */ - PhysicsFrame lerp( - const PhysicsFrame& other, - float alpha) const; - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/Plane.h b/dep/include/g3dlite/G3D/Plane.h deleted file mode 100644 index 360bcd2bc75..00000000000 --- a/dep/include/g3dlite/G3D/Plane.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - @file Plane.h - - Plane class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2004-07-18 -*/ - -#ifndef G3D_PLANE_H -#define G3D_PLANE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -/** - An infinite 2D plane in 3D space. - */ -class Plane { -private: - - /** normal.Dot(x,y,z) = distance */ - Vector3 _normal; - float _distance; - - /** - Assumes the normal has unit length. - */ - Plane(const Vector3& n, float d) : _normal(n), _distance(d) { - } - -public: - - Plane() : _normal(Vector3::unitY()), _distance(0) { - } - - /** - Constructs a plane from three points. - */ - Plane( - const Vector3& point0, - const Vector3& point1, - const Vector3& point2); - - /** - Constructs a plane from three points, where at most two are - at infinity (w = 0, not xyz = inf). - */ - Plane( - Vector4 point0, - Vector4 point1, - Vector4 point2); - - /** - The normal will be unitized. - */ - Plane( - const Vector3& __normal, - const Vector3& point); - - static Plane fromEquation(float a, float b, float c, float d); - - Plane(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - virtual ~Plane() {} - - /** - Returns true if point is on the side the normal points to or - is in the plane. - */ - inline bool halfSpaceContains(Vector3 point) const { - // Clamp to a finite range for testing - point = point.clamp(Vector3::minFinite(), Vector3::maxFinite()); - - // We can get away with putting values *at* the limits of the float32 range into - // a dot product, since the dot product is carried out on float64. - return _normal.dot(point) >= _distance; - } - - /** - Returns true if point is on the side the normal points to or - is in the plane. - */ - inline bool halfSpaceContains(const Vector4& point) const { - if (point.w == 0) { - return _normal.dot(point.xyz()) > 0; - } else { - return halfSpaceContains(point.xyz() / point.w); - } - } - - /** - Returns true if point is on the side the normal points to or - is in the plane. Only call on finite points. Faster than halfSpaceContains. - */ - inline bool halfSpaceContainsFinite(const Vector3& point) const { - debugAssert(point.isFinite()); - return _normal.dot(point) >= _distance; - } - - /** - Returns true if the point is nearly in the plane. - */ - inline bool fuzzyContains(const Vector3 &point) const { - return fuzzyEq(point.dot(_normal), _distance); - } - - inline const Vector3& normal() const { - return _normal; - } - - /** - Returns distance from point to plane. Distance is negative if point is behind (not in plane in direction opposite normal) the plane. - */ - inline float distance(const Vector3& x) const { - return (_normal.dot(x) - _distance); - } - - inline Vector3 closestPoint(const Vector3& x) const { - return x + (_normal * (-distance(x))); - } - - /** Returns normal * distance from origin */ - Vector3 center() const { - return _normal * _distance; - } - - /** - Inverts the facing direction of the plane so the new normal - is the inverse of the old normal. - */ - void flip(); - - /** - Returns the equation in the form: - - normal.Dot(Vector3(x, y, z)) + d = 0 - */ - void getEquation(Vector3 &normal, double& d) const; - void getEquation(Vector3 &normal, float& d) const; - - /** - ax + by + cz + d = 0 - */ - void getEquation(double& a, double& b, double& c, double& d) const; - void getEquation(float& a, float& b, float& c, float& d) const; - - std::string toString() const; -}; - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/PointHashGrid.h b/dep/include/g3dlite/G3D/PointHashGrid.h deleted file mode 100644 index 0db9e677321..00000000000 --- a/dep/include/g3dlite/G3D/PointHashGrid.h +++ /dev/null @@ -1,917 +0,0 @@ -/** - @file PointHashGrid.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2008-07-01 - @edited 2009-05-28 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. -*/ -#ifndef G3D_PointHashGrid_h -#define G3D_PointHashGrid_h - -#include "G3D/platform.h" -#include "G3D/EqualsTrait.h" -#include "G3D/HashTrait.h" -#include "G3D/Vector3.h" -#include "G3D/Vector3int32.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/SmallArray.h" - -namespace G3D { - -/** - Storage of data in a sparse 3D grid of point-based data. The - space cost for n elements is O(n). For data with - approximately uniform density (with respect to the radius hint), - the time cost of searching for neighbors is O(1). - - Value must be supported by a G3D::PositionTrait, - G3D::EqualsTrait, and G3D::HashFunc. overrides are provided for - common G3D classes like G3D::Vector3. -*/ -template, - class EqualsFunc = EqualsTrait, - class HashFunc = HashTrait > -class PointHashGrid { -private: - -#define ThisType PointHashGrid - - /** A value annotated with precomputed position and hash code.*/ - class Entry { - public: - Vector3 position; - Value value; - }; - - /** One cell of the grid. */ - typedef Array Cell; - typedef Table CellTable; - - /** The cube of +/-1 along each dimension. Initialized by initOffsetArray.*/ - Vector3int32 m_offsetArray[3*3*3]; - - /** Incremented every time the data structure is mutated. - Used by the iterators to determine if the data structure - has changed since iteration began. */ - int m_epoch; - - /** Extent of a cell along one dimension. */ - float m_cellWidth; - - /** 1.0 / cell width */ - float m_invCellWidth; - - /** Conservative bounds; the actual data may be smaller. */ - AABox m_bounds; - - /** Number of elements. */ - int m_size; - - /** Non-empty cells indexed by grid position. Actual 3D position is - position * m_cellWidth*/ - CellTable m_data; - - MemoryManager::Ref m_memoryManager; - - /** Intentionally unimplemented: prevent copy construction. */ - PointHashGrid(const ThisType&); - - - /** Intentionally unimplemented: prevent assignment. */ - PointHashGrid& operator=(const ThisType&); - - - /** Locate the cell and index within that cell containing v. Called by - remove() and contains(). */ - bool find(const Value& v, - Vector3int32& foundCellCoord, - Cell*& foundCell, - int& index) { - - Vector3 pos; - PosFunc::getPosition(v, pos); - - Vector3int32 cellCoord; - getCellCoord(pos, cellCoord); - for (int i = 0; i < 27; ++i) { - Vector3int32 c = cellCoord + m_offsetArray[i]; - Cell* cell = m_data.getPointer(c); - if (cell != NULL) { - // The cell exists - for (int j = 0; j < cell->size(); ++j) { - if (EqualsFunc::equals((*cell)[j].value, v)) { - foundCell = cell; - index = j; - foundCellCoord = c; - return true; - } - } - } - } - - // Not found - return false; - } - - /** Given a real-space position, returns the cell coord - containing it.*/ - inline void getCellCoord(const Vector3& pos, Vector3int32& cellCoord) const { - for (int a = 0; a < 3; ++a) { - cellCoord[a] = iFloor(pos[a] * m_invCellWidth); - } - } - - /** Initializes m_offsetArray. */ - void initOffsetArray() { - int i = 0; - Vector3int32 d; - for (d.x = -1; d.x <= +1; ++d.x) { - for (d.y = -1; d.y <= +1; ++d.y) { - for (d.z = -1; d.z <= +1; ++d.z) { - m_offsetArray[i] = d; - ++i; - } - } - } - - // Put (0, 0, 0) first, so that contains() is most likely to find - // the value quickly. - i = (1 * 3 + 1) * 3 + 1; - debugAssert(m_offsetArray[i] == Vector3int32(0,0,0)); - Vector3int32 temp = m_offsetArray[0]; - m_offsetArray[0] = m_offsetArray[i]; - m_offsetArray[i] = temp; - } - -public: - - /** - @param radiusHint the radius that will typically be used with - beginSphereIntersection and beginBoxIntersection. If two Values are equal, - their positions must be within this radius as well. - */ - PointHashGrid(float radiusHint, const MemoryManager::Ref& m = MemoryManager::create()) : m_size(0), m_memoryManager(m) { - initOffsetArray(); - m_data.clearAndSetMemoryManager(m_memoryManager); - - debugAssertM(radiusHint > 0, "Cell radius must be positive"); - m_cellWidth = radiusHint; - m_invCellWidth = 1.0f / m_cellWidth; - } - - /** - If radiusHint is negative, it is automatically chosen to put - about 5 values in each grid cell (which means about 27 * 5 - values for each beginIntersection call). - */ - PointHashGrid(const Array& init, float radiusHint = -1.0f, const MemoryManager::Ref& m = MemoryManager::create()) : m_size(0), m_memoryManager(m) { - initOffsetArray(); - m_data.clearAndSetMemoryManager(m_memoryManager); - - Vector3 lo(Vector3::inf()); - Vector3 hi(-lo); - - // Compute bounds - Array entry(init.size()); - for (int i = 0; i < entry.size(); ++i) { - const Value& value = init[i]; - Vector3 pos = m_posFunc(value); - - entry[i].value = value; - entry[i].hashCode = m_hashFunc(value); - entry[i].position = pos; - - lo = lo.min(pos); - hi = hi.max(pos); - } - - m_bounds = AABox(lo, hi); - - if (radiusHint <= 0) { - // Compute a good cell width based on the bounds. - // - // N numPerCell - // ----- = --------- - // volume r^3 - - float numPerCell = 5; - radiusHint = - (float)pow(numPerCell * m_bounds.volume() / init.size(), 1.0 / 3.0); - - if (radiusHint == 0) { - // Volume must have been zero because all points were colocated. - radiusHint = 0.1f; - } - } - - insert(init); - } - - /** Returns the number of elements. */ - inline int size() const { - return m_size; - } - - /** Returns a conservative bounding box around the contents. This is - conservative because it is not updated when elements are removed. */ - const AABox& conservativeBoxBounds() const { - return m_bounds; - } - - /** Insert @a v at position @a p given by getPosition(v, p). - Multiple elements that are equal may be inserted; all copies will be - in the data structure. */ - void insert(const Value& v) { - Vector3 pos; - PosFunc::getPosition(v, pos); - Vector3int32 cellCoord; - getCellCoord(pos, cellCoord); - - // See if the cell already exists - Cell& cell = m_data.getCreate(cellCoord); - - if (cell.size() == 0) { - // Use the same memory manager as for the whole class - cell.clearAndSetMemoryManager(m_memoryManager); - } - - Entry& entry = cell.next(); - entry.value = v; - entry.position = pos; - - // Update the bounds - if (size() == 0) { - m_bounds = AABox(pos); - } else { - m_bounds.merge(pos); - } - - ++m_size; - ++m_epoch; - } - - - /** Inserts all elements of the array. */ - void insert(const Array& v) { - for (int i = 0; i < v.size(); ++i) { - insert(v[i]); - } - } - - - /** If there are multiple copies of an element, you must - delete them multiple times. - - @param shrinkIfNecessary If true, deallocate underlying data - structures as they are emptied. False increases performace at - the cost of memory overhead for dynamic structures. - - @return true if the element was found. - */ - bool remove(const Value& v, bool shrinkIfNecessary = true) { - Cell* cell = NULL; - int index = 0; - Vector3int32 cellCoord; - - if (find(v, cellCoord, cell, index)) { - cell->fastRemove(index, shrinkIfNecessary); - --m_size; - ++m_epoch; - - if ((cell->size() == 0) && shrinkIfNecessary) { - // Remove the cell itself - - // Drop our pointer, which is about to dangle - cell = NULL; - bool success = m_data.remove(cellCoord); - debugAssertM(success, "Data structure corrupt: " - "tried to remove a cell that doesn't exist."); - } - - return true; - - } else { - return false; - } - } - - /** Removes all elements of @v. */ - void remove(const Array& v, bool shrink = true) { - for (int i = 0; i < v.size(); ++i) { - remove(v[i], shrink); - } - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - class Iterator { - private: - friend class ThisType; - - bool m_isEnd; - - const ThisType* m_grid; - - typename CellTable::Iterator m_tableIterator; - - /** Index within m_tableIterator->value of the current value. */ - int m_arrayIndex; - - const int m_epoch; - - /** End iterator. Note that the m_tableIterator is initialized to the end iterator - of a temporary value! This is ok because we'll never look at the value of the - m_tableIterator, since we're initializing the "end" Iterator.*/ - Iterator() : m_isEnd(true), m_grid(NULL), m_tableIterator(CellTable().end()), - m_arrayIndex(0), m_epoch(0) {} - - Iterator(const ThisType* grid) : - m_isEnd(false), - m_grid(grid), - m_tableIterator( grid->m_data.begin() ), - m_arrayIndex(0), - m_epoch(grid->m_epoch) { } - - private: - - const Value& value() const { - debugAssert(! m_isEnd); - debugAssertM(m_tableIterator->value.size() > m_arrayIndex, - "No more elements"); - return m_tableIterator->value[m_arrayIndex].value; - } - - public: - - inline bool operator!=(const Iterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return (m_isEnd != other.m_isEnd) || - (m_tableIterator != other.m_tableIterator) || - (m_arrayIndex != other.m_arrayIndex); - } - } - - bool operator==(const Iterator& other) const { - return !(*this != other); - } - - /** Preincrement */ - Iterator& operator++() { - debugAssert(! m_isEnd); - debugAssertM(m_epoch == m_grid->m_epoch, - "It is illegal to mutate the HashGrid " - "while iterating through it."); - - ++m_arrayIndex; - - if (m_arrayIndex >= m_tableIterator->value.size()) { - // Move on to the next cell - ++m_tableIterator; - m_arrayIndex = 0; - - // Check to see if we're at the end - m_isEnd = (m_tableIterator == m_grid->m_data.end()); - } - - return *this; - } - - /** Post increment (slower) */ - Iterator operator++(int) { - debugAssert(! m_isEnd); - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - }; // Iterator - - - /** Iterate through all members. It is an error to mutate the HashGrid - while iterating through it. Each member can be accessed by "dereferencing" - the iterator: - -
-        for (Grid::Iterator i = grid.begin(); i != grid.end(), ++i) {
-        const Value& = *i;
-        ...
-        }
-        
- */ - Iterator begin() const { - return Iterator(this); - } - - const Iterator& end() const { - static const Iterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - // Forward declaration required by older gcc versions for friend declaration in BoxIterator - class SphereIterator; - class BoxIterator { - private: - friend class ThisType; - friend class SphereIterator; - - bool m_isEnd; - - const ThisType* m_grid; - - /** Lower bound on the boxes covered, inclusive. */ - Vector3int32 m_lo; - - /** Upper bound on the boxes covered, inclusive.*/ - Vector3int32 m_hi; - - /** If true, test values against m_box before returning them.*/ - bool m_exact; - - /** The underlying box in 3D space */ - AABox m_box; - - /** The iterator winds through the 3D grid between m_lo and (m_lo + m_extent) in - Z,Y,X-major order. This is the index keeping track of how - far it has come */ - Vector3int32 m_current; - - /** The current cell. */ - Cell* m_cell; - - /** Index within m_cell of the current value */ - int m_arrayIndex; - - const int m_epoch; - - - /** Called from advance() */ - void advanceCell() { - do { - ++m_current.x; - if (m_current.x > m_hi.x) { - m_current.x = m_lo.x; - ++m_current.y; - if (m_current.y > m_hi.y) { - m_current.y = m_lo.y; - ++m_current.z; - if (m_current.z > m_hi.z) { - m_isEnd = true; - return; - } - } - } - - // Pick up the new cell - m_cell = m_grid->m_data.getPointer(m_current); - // Keep advancing if the cell does not exist - } while ((m_cell == NULL) || (m_cell->size() == 0)); - } - - /** Advance to the next value */ - void advance() { - debugAssert(! m_isEnd); - - do { - ++m_arrayIndex; - bool inConstructor = (m_cell == NULL); - if (inConstructor || m_arrayIndex >= m_cell->size()) { - advanceCell(); - m_arrayIndex = 0; - - if (m_isEnd) { - // Ran out of values - return; - } - debugAssert(m_cell != NULL); - } - - // Advance until we have a value that can be returned, either - // because we don't care about exactness or because it is - // guaranteed to be within the box. - } while (m_exact && ! m_box.contains(position())); - } - - - /** End iterator */ - BoxIterator() : m_isEnd(true), m_grid(NULL), m_exact(true), m_current(0,0,0), m_cell(NULL), m_arrayIndex(0), m_epoch(0) {} - - /** Begin iterator */ - BoxIterator(const ThisType* grid, bool exact, const AABox& box) : - m_isEnd(false), - m_grid(grid), - m_exact(exact), - m_box(box), - m_current(-1, 0 ,0), - m_cell(NULL), - m_arrayIndex(0), - m_epoch(grid->m_epoch) { - - m_grid->getCellCoord(box.low(), m_lo); - m_grid->getCellCoord(box.high(), m_hi); - - // Get to the first value - m_current = m_lo; - // Back up one so that advancing takes us to the first - --m_current.x; - advance(); - } - - const Value& value() const { - debugAssert(! m_isEnd); - return (*m_cell)[m_arrayIndex].value; - } - - /** Used by SphereIterator::advance() */ - const Vector3& position() const { - debugAssert(! m_isEnd); - return (*m_cell)[m_arrayIndex].position; - } - - // Intentionally unimplemented - BoxIterator& operator=(const BoxIterator&); - - public: - - inline bool operator!=(const BoxIterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return (m_isEnd != other.m_isEnd) || - (m_cell != other.m_cell) || - (m_arrayIndex != other.m_arrayIndex); - } - } - - bool operator==(const BoxIterator& other) const { - return !(*this != other); - } - - /** Preincrement */ - BoxIterator& operator++() { - debugAssert(! m_isEnd); - debugAssertM(m_epoch == m_grid->m_epoch, - "It is illegal to mutate the HashGrid " - "while iterating through it."); - - advance(); - - return *this; - } - - /** Post increment (slower) */ - BoxIterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - - bool hasMore() const { - return ! m_isEnd; - } - }; // BoxIterator - - /** - Finds all values whose positions are within @a box. It is an error to - mutate the PointHashGrid while iterating through it. - - @param exact If false, the iterator will execute more quickly but will likely return some - values that lie outside the box. Set exact = false if you are going to test the - results against the yourself box anyway. - */ - BoxIterator beginBoxIntersection(const AABox& box, bool exact = true) const { - return BoxIterator(this, exact, box); - } - - const BoxIterator& endBoxIntersection() const { - static const BoxIterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - class SphereIterator { - private: - - friend class ThisType; - - bool m_isEnd; - Sphere m_sphere; - BoxIterator m_boxIterator; - - SphereIterator() : m_isEnd(true) {} - - void advance() { - if (! m_boxIterator.hasMore()) { - m_isEnd = true; - return; - } - - while (! m_sphere.contains(m_boxIterator.position())) { - ++m_boxIterator; - - if (! m_boxIterator.hasMore()) { - m_isEnd = true; - return; - } - } - } - - static AABox getBoundingBox(const Sphere& s) { - AABox box; - s.getBounds(box); - return box; - } - - SphereIterator(const ThisType* grid, const Sphere& sphere) : - m_isEnd(false), - m_sphere(sphere), - m_boxIterator(grid, false, getBoundingBox(sphere)) { - - // Find the first element that is actually in the sphere, - // not just the box. - advance(); - } - - const Value& value() const { - return *m_boxIterator; - } - - // TODO: if the sphere is very big compared to radius, check each - // cell's box to see if the cell itself is actually inside the sphere - // before iterating through it, since there may be many boxes outside the sphere. - - // Intentionally unimplemented - SphereIterator& operator=(const SphereIterator&); - public: - - inline bool operator!=(const SphereIterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return - (m_isEnd != other.m_isEnd) || - (m_sphere != other.m_sphere) || - (m_boxIterator != other.m_boxIterator); - } - } - - bool operator==(const SphereIterator& other) const { - return !(*this != other); - } - - - - /** Preincrement */ - SphereIterator& operator++() { - debugAssert(! m_isEnd); - - ++m_boxIterator; - advance(); - - return *this; - } - - /** Post increment (slower) */ - SphereIterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - - bool hasMore() const { - return ! m_isEnd; - } - }; // SphereIterator - - /** - Finds all values whose positions are within @a sphere. It is an error - to mutate the HashGrid while iterating through it. - */ - SphereIterator beginSphereIntersection(const Sphere& sphere) const { - return SphereIterator(this, sphere); - } - - const SphereIterator& endSphereIntersection() const { - static const SphereIterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - /** - Dereference to access the bounds() and size() [element count] of the underlying - cell objet. - - Example: -
-       for(PointHashGrid::CellIterator iter = grid.beginCells(); iter != grid.endCells(); ++iter) {	
-       entriesFound += iter->size();
-       }
-       
- */ - class CellIterator { - private: - friend class ThisType; - - bool m_isEnd; - const ThisType* m_grid; - typename CellTable::Iterator m_tableIterator; - const int m_epoch; - - - Cell& cell() { - return m_tableIterator->value; - } - - public: - - class CellObject { - friend class CellIterator; - private: - const CellIterator* m_parent; - - CellObject() : m_parent(NULL) {} - - public: - - /** Returns the bounds on this cell */ - AABox bounds() const { - const Vector3int32& k = m_parent->m_tableIterator->key; - return AABox(Vector3(k) * m_parent->m_cellWidth, - Vector3(k + Vector3int32(1, 1, 1)) * m_parent->m_cellWidth); - } - - /** Number of elements inside this cell */ - int size() const { - debugAssert(! m_parent->m_isEnd); - return m_parent->m_tableIterator->value.size(); - } - }; - - private: - /** Used to make the indirection work.*/ - CellObject m_indirection; - - /** End iterator. Note that the m_tableIterator is initialized to the end iterator - of a temporary value! This is ok because we'll never look at the value of the - m_tableIterator, since we're initializing the "end" Iterator.*/ - CellIterator() : - m_isEnd(true), - m_grid(NULL), - m_tableIterator( CellTable().end() ), - m_epoch(0) {} - - CellIterator(const ThisType* grid) : - m_isEnd(false), - m_grid(grid), - m_tableIterator( grid->m_data.begin()), - m_epoch(grid->m_epoch) { - m_indirection.m_parent = this; - m_isEnd = ! m_tableIterator.hasMore(); - } - - // Intentionally unimplemented - CellIterator& operator=(const CellIterator&); - - public: - - const CellObject& operator*() const { return m_indirection; } - const CellObject* operator->() const { return &m_indirection; } - operator CellObject*() const { return &m_indirection; } - - inline bool operator!=(const CellIterator& other) const { - // != is called more often than == during iteration - return !( - (m_isEnd && other.m_isEnd) || - ((m_isEnd == other.m_isEnd) && - (m_tableIterator != other.m_tableIterator))); - } - - bool operator==(const CellIterator& other) const { - return !(*this != other); - } - - /** Preincrement */ - CellIterator& operator++() { - debugAssertM(m_epoch == m_grid->m_epoch, - "It is illegal to mutate the HashGrid while " - "iterating through it."); - ++m_tableIterator; - m_isEnd = ! m_tableIterator.hasMore(); - return *this; - } - - /** Post increment (slower) */ - CellIterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - bool hasMore() const { - return ! m_isEnd; - } - }; // CellIterator - - /** Iterates through the non-empty cells. This is intended primarily for - debugging and visualizing the data structure.*/ - CellIterator beginCells() const { - return CellIterator(this); - } - - const CellIterator& endCells() const { - static const CellIterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - /** Returns true if there is a value that is exactly equal to @a v. This will - check all neighboring cells to avoid roundoff error at cell boundaries. - */ - bool contains(const Value& v) const { - Cell* cell = NULL; - int index = 0; - Vector3int32 cellCoord; - return const_cast(this)->find(v, cellCoord, cell, index); - } - - /** Calls delete on all of the values, which are assumed to be pointers. - This is a helper to avoid requiring you to iterate through the data - structure, removing and deleting each one. Clears the PointHashGrid at the - end. - - Using objects (instead of pointers) or reference counted pointers is - recommended over using pointers and this deleteAll method.*/ - void deleteAll() { - for (Iterator it = begin(); it.hasMore(); ++it) { - delete *it; - } - clear(); - } - - void clearAndSetMemoryManager(const MemoryManager::Ref& m) { - ++m_epoch; - m_size = 0; - m_bounds = AABox(); - - m_data.clearAndSetMemoryManager(m); - m_memoryManager = m; - } - - /** Removes all data. - @param shrink If true, underlying structures are deallocated as - they are freed.*/ - void clear(bool shrink = true) { - m_size = 0; - m_bounds = AABox(); - if (! shrink) { - // Remove all data - for (CellIterator it = beginCells(); it.hasMore(); ++it) { - it.cell().clear(true); - } - } else { - m_data.clear(); - } - ++m_epoch; - } - - int debugGetDeepestBucketSize() const { - return m_data.debugGetDeepestBucketSize(); - } - - float debugGetAverageBucketSize() const { - return m_data.debugGetAverageBucketSize(); - } -#undef ThisType -}; - -} // G3D -#endif diff --git a/dep/include/g3dlite/G3D/PointKDTree.h b/dep/include/g3dlite/G3D/PointKDTree.h deleted file mode 100644 index 151cbd5f2f3..00000000000 --- a/dep/include/g3dlite/G3D/PointKDTree.h +++ /dev/null @@ -1,1185 +0,0 @@ -/** - @file PointKDTree.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2004-01-11 - @edited 2008-11-02 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - - */ - -#ifndef X_PointKDTree_H -#define X_PointKDTree_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/CollisionDetection.h" -#include "G3D/GCamera.h" -#include "G3D/PositionTrait.h" -#include - -namespace G3D { - -/** - A set data structure that supports spatial queries using an axis-aligned - BSP tree for speed. - - PointKDTree allows you to quickly find points in 3D that lie within - a box or sphere. For large sets of objects it is much faster - than testing each object for a collision. See also G3D::KDTree; this class - is optimized for point sets, e.g.,for use in photon mapping and mesh processing. - - Template Parameters - -
- -
The template parameter T must be one for which - the following functions are overloaded: - -
-      T::T(); (public constructor of no arguments)
-
-       template<> struct PositionTrait {
-         static void getPosition(const T& v, G3D::Vector3& p);};
-
-       template <> struct HashTrait {
-         static size_t hashCode(const T& key);};
-
-       template<> struct EqualsTrait {
-           static bool equals(const T& a, const T& b); };
-    
- -

- - G3D provides these for the Vector2, Vector3, and Vector4 classes. - If you use a custom class, or a pointer to a custom class, you will need - to define those functions. - - Moving %Set Members -

It is important that objects do not move without updating the - PointKDTree. If the position of an object is about - to change, PointKDTree::remove it before they change and - PointKDTree::insert it again afterward. For objects - where the hashCode and == operator are invariant with respect - to the 3D position, - you can use the PointKDTree::update method as a shortcut to - insert/remove an object in one step after it has moved. - - - Note: Do not mutate any value once it has been inserted into PointKDTree. Values - are copied interally. All PointKDTree iterators convert to pointers to constant - values to reinforce this. - - If you want to mutate the objects you intend to store in a PointKDTree - simply insert pointers to your objects instead of the objects - themselves, and ensure that the above operations are defined. (And - actually, because values are copied, if your values are large you may - want to insert pointers anyway, to save space and make the balance - operation faster.) - - Dimensions - Although designed as a 3D-data structure, you can use the PointKDTree - for data distributed along 2 or 1 axes by simply returning bounds - that are always zero along one or more dimensions. - -*/ -template, - class HashFunc = HashTrait, - class EqualsFunc = EqualsTrait > -class PointKDTree { -protected: -#define TreeType PointKDTree - - // Unlike the KDTree, the PointKDTree assumes that T elements are - // small and keeps the handle and cached position together instead of - // placing them in separate bounds arrays. Also note that a copy of T - // is kept in the member table and that there is no indirection. - class Handle { - private: - Vector3 m_position; - - public: - T value; - - inline Handle() {} - inline Handle(const T& v) : value(v) { - PositionFunc::getPosition(v, m_position); - } - - /** Used by makeNode to create fake handles for partitioning. */ - void setPosition(const Vector3& v) { - m_position = v; - } - - inline const Vector3& position() const { - return m_position; - } - }; - - /** Returns the bounds of the sub array. Used by makeNode. */ - static AABox computeBounds( - const Array& point) { - - if (point.size() == 0) { - return AABox(Vector3::inf(), Vector3::inf()); - } - - AABox bounds(point[0].position()); - - for (int p = 0; p < point.size(); ++p) { - bounds.merge(point[p].position()); - } - - return bounds; - } - - class Node { - public: - - /** Spatial bounds on all values at this node and its children, based purely on - the parent's splitting planes. May be infinite */ - AABox splitBounds; - - Vector3::Axis splitAxis; - - /** Location along the specified axis */ - float splitLocation; - - /** child[0] contains all values strictly - smaller than splitLocation along splitAxis. - - child[1] contains all values strictly - larger. - - Both may be NULL if there are not enough - values to bother recursing. - */ - Node* child[2]; - - /** Values if this is a leaf node). */ - Array valueArray; - - /** Creates node with NULL children */ - Node() { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - splitBounds = AABox(-Vector3::inf(), Vector3::inf()); - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** - Doesn't clone children. - */ - Node(const Node& other) : valueArray(other.valueArray) { - splitAxis = other.splitAxis; - splitLocation = other.splitLocation; - splitBounds = other.splitBounds; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** Copies the specified subarray of pt into point, NULLs the children. - Assumes a second pass will set splitBounds. */ - Node(const Array& pt) { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - valueArray = pt; - } - - - /** Deletes the children (but not the values) */ - ~Node() { - for (int i = 0; i < 2; ++i) { - delete child[i]; - } - } - - - /** Returns true if this node is a leaf (no children) */ - inline bool isLeaf() const { - return (child[0] == NULL) && (child[1] == NULL); - } - - - /** - Recursively appends all handles and children's handles - to the array. - */ - void getHandles(Array& handleArray) const { - handleArray.append(valueArray); - for (int i = 0; i < 2; ++i) { - if (child[i] != NULL) { - child[i]->getHandles(handleArray); - } - } - } - - - void verifyNode(const Vector3& lo, const Vector3& hi) { - // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", - // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); - - debugAssert(lo == splitBounds.low()); - debugAssert(hi == splitBounds.high()); - - for (int i = 0; i < valueArray.length(); ++i) { - const Vector3& b = valueArray[i].position(); - debugAssert(splitBounds.contains(b)); - } - - if (child[0] || child[1]) { - debugAssert(lo[splitAxis] < splitLocation); - debugAssert(hi[splitAxis] > splitLocation); - } - - Vector3 newLo = lo; - newLo[splitAxis] = splitLocation; - Vector3 newHi = hi; - newHi[splitAxis] = splitLocation; - - if (child[0] != NULL) { - child[0]->verifyNode(lo, newHi); - } - - if (child[1] != NULL) { - child[1]->verifyNode(newLo, hi); - } - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - static void serializeStructure(const Node* n, BinaryOutput& bo) { - if (n == NULL) { - bo.writeUInt8(0); - } else { - bo.writeUInt8(1); - n->splitBounds.serialize(bo); - serialize(n->splitAxis, bo); - bo.writeFloat32(n->splitLocation); - for (int c = 0; c < 2; ++c) { - serializeStructure(n->child[c], bo); - } - } - } - - /** Clears the member table */ - static Node* deserializeStructure(BinaryInput& bi) { - if (bi.readUInt8() == 0) { - return NULL; - } else { - Node* n = new Node(); - n->splitBounds.deserialize(bi); - deserialize(n->splitAxis, bi); - n->splitLocation = bi.readFloat32(); - for (int c = 0; c < 2; ++c) { - n->child[c] = deserializeStructure(bi); - } - } - } - - /** Returns the deepest node that completely contains bounds. */ - Node* findDeepestContainingNode(const Vector3& point) { - - // See which side of the splitting plane the bounds are on - if (point[splitAxis] < splitLocation) { - // Point is on the low side. Recurse into the child - // if it exists. - if (child[0] != NULL) { - return child[0]->findDeepestContainingNode(point); - } - } else if (point[splitAxis] > splitLocation) { - // Point is on the high side, recurse into the child - // if it exists. - if (child[1] != NULL) { - return child[1]->findDeepestContainingNode(point); - } - } - - // There was no containing child, so this node is the - // deepest containing node. - return this; - } - - /** Appends all members that intersect the box. - If useSphere is true, members are tested against the sphere instead. */ - void getIntersectingMembers( - const AABox& sphereBounds, - const Sphere& sphere, - Array& members) const { - - // Test all values at this node. Extract the - // underlying C array for speed - const int N = valueArray.size(); - const Handle* handleArray = valueArray.getCArray(); - - const float r2 = square(sphere.radius); - - // Copy the sphere center so that it is on the stack near the radius - const Vector3 center = sphere.center; - for (int v = 0; v < N; ++v) { - if ((center - handleArray[v].position()).squaredLength() <= r2) { - members.append(handleArray[v].value); - } - } - - // If the left child overlaps the box, recurse into it - if (child[0] && (sphereBounds.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(sphereBounds, sphere, members); - } - - // If the right child overlaps the box, recurse into it - if (child[1] && (sphereBounds.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(sphereBounds, sphere, members); - } - } - - /** Appends all members that intersect the box. - If useSphere is true, members are tested against the sphere instead. - - Implemented using both box and sphere tests to simplify the implementation - of a future beginSphereInteresection iterator using the same underlying - BoxIterator class. - */ - void getIntersectingMembers( - const AABox& box, - const Sphere& sphere, - Array& members, - bool useSphere) const { - - // Test all values at this node - for (int v = 0; v < valueArray.size(); ++v) { - if ((useSphere && sphere.contains(valueArray[v].position())) || - (! useSphere && box.contains(valueArray[v].position()))) { - members.append(valueArray[v].value); - } - } - - // If the left child overlaps the box, recurse into it - if ((child[0] != NULL) && (box.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(box, sphere, members, useSphere); - } - - // If the right child overlaps the box, recurse into it - if ((child[1] != NULL) && (box.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(box, sphere, members, useSphere); - } - } - - /** - Recurse through the tree, assigning splitBounds fields. - */ - void assignSplitBounds(const AABox& myBounds) { - splitBounds = myBounds; - -# ifdef G3D_DEBUG - if (child[0] || child[1]) { - debugAssert(splitBounds.high()[splitAxis] > splitLocation); - debugAssert(splitBounds.low()[splitAxis] < splitLocation); - } -# endif - - AABox childBounds[2]; - myBounds.split(splitAxis, splitLocation, childBounds[0], childBounds[1]); - - for (int c = 0; c < 2; ++c) { - if (child[c]) { - child[c]->assignSplitBounds(childBounds[c]); - } - } - } - }; - - class AxisComparator { - private: - Vector3::Axis sortAxis; - - public: - - AxisComparator(Vector3::Axis s) : sortAxis(s) {} - - inline int operator()(const Handle& A, const Handle& B) const { - if (A.position()[sortAxis] > B.position()[sortAxis]) { - return -1; - } else if (A.position()[sortAxis] < B.position()[sortAxis]) { - return 1; - } else { - return 0; - } - } - }; - - /** - Recursively subdivides the subarray. - - The source array will be cleared after it is used - - Call assignSplitBounds() on the root node after making a tree. - */ - Node* makeNode( - Array& source, - Array& temp, - int valuesPerNode, - int numMeanSplits) { - - Node* node = NULL; - - if (source.size() <= valuesPerNode) { - // Make a new leaf node - node = new Node(source); - - // Set the pointers in the memberTable - for (int i = 0; i < source.size(); ++i) { - memberTable.set(source[i].value, node); - } - - } else { - // Make a new internal node - node = new Node(); - - const AABox bounds = computeBounds(source); - const Vector3 extent = bounds.high() - bounds.low(); - - Vector3::Axis splitAxis = extent.primaryAxis(); - - float splitLocation; - - Array lt, gt; - - if (numMeanSplits <= 0) { - source.medianPartition(lt, node->valueArray, gt, temp, AxisComparator(splitAxis)); - splitLocation = node->valueArray[0].position()[splitAxis]; - - if ((node->valueArray.size() > source.size() / 2) && - (source.size() > 10)) { - // Our median split put an awful lot of points on the splitting plane. Try a mean - // split instead - numMeanSplits = 1; - } - } - - if (numMeanSplits > 0) { - // Compute the mean along the axis - - splitLocation = (bounds.high()[splitAxis] + - bounds.low()[splitAxis]) / 2.0; - - Handle splitHandle; - Vector3 v; - v[splitAxis] = splitLocation; - splitHandle.setPosition(v); - - source.partition(splitHandle, lt, node->valueArray, gt, AxisComparator(splitAxis)); - } - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - for (int i = 0; i < lt.size(); ++i) { - const Vector3& v = lt[i].position(); - debugAssert(v[splitAxis] < splitLocation); - } - for (int i = 0; i < gt.size(); ++i) { - debugAssert(gt[i].position()[splitAxis] > splitLocation); - } - for (int i = 0; i < node->valueArray.size(); ++i) { - debugAssert(node->valueArray[i].position()[splitAxis] == splitLocation); - } -# endif - - node->splitAxis = splitAxis; - node->splitLocation = splitLocation; - - // Throw away the source array to save memory - source.fastClear(); - - if (lt.size() > 0) { - node->child[0] = makeNode(lt, temp, valuesPerNode, numMeanSplits - 1); - } - - if (gt.size() > 0) { - node->child[1] = makeNode(gt, temp, valuesPerNode, numMeanSplits - 1); - } - - // Add the values stored at this interior node to the member table - for(int i = 0; i < node->valueArray.size(); ++i) { - memberTable.set(node->valueArray[i].value, node); - } - - } - - return node; - } - - /** - Recursively clone the passed in node tree, setting - pointers for members in the memberTable as appropriate. - called by the assignment operator. - */ - Node* cloneTree(Node* src) { - Node* dst = new Node(*src); - - // Make back pointers - for (int i = 0; i < dst->valueArray.size(); ++i) { - memberTable.set(dst->valueArray[i].value, dst); - } - - // Clone children - for (int i = 0; i < 2; ++i) { - if (src->child[i] != NULL) { - dst->child[i] = cloneTree(src->child[i]); - } - } - - return dst; - } - - /** Maps members to the node containing them */ - typedef Table MemberTable; - MemberTable memberTable; - - Node* root; - -public: - - /** To construct a balanced tree, insert the elements and then call - PointKDTree::balance(). */ - PointKDTree() : root(NULL) {} - - - PointKDTree(const PointKDTree& src) : root(NULL) { - *this = src; - } - - - PointKDTree& operator=(const PointKDTree& src) { - delete root; - // Clone tree takes care of filling out the memberTable. - root = cloneTree(src.root); - return *this; - } - - - ~PointKDTree() { - clear(); - } - - /** - Throws out all elements of the set and erases the structure of the tree. - */ - void clear() { - memberTable.clear(); - delete root; - root = NULL; - } - - /** Removes all elements of the set while maintaining the structure of the tree */ - void clearData() { - memberTable.clear(); - Array stack; - stack.push(root); - while (stack.size() > 0) { - Node* node = stack.pop(); - node->valueArray.fastClear(); - - for (int i = 0; i < 2; ++i) { - if (node->child[i] != NULL) { - stack.push(node->child[i]); - } - } - } - } - - - int size() const { - return memberTable.size(); - } - - /** - Inserts an object into the set if it is not - already present. O(log n) time. Does not - cause the tree to be balanced. - */ - void insert(const T& value) { - if (contains(value)) { - // Already in the set - return; - } - - Handle h(value); - - if (root == NULL) { - // This is the first node; create a root node - root = new Node(); - } - - Node* node = root->findDeepestContainingNode(h.position()); - - // Insert into the node - node->valueArray.append(h); - - // Insert into the node table - memberTable.set(value, node); - } - - /** Inserts each elements in the array in turn. If the tree - begins empty (no structure and no elements), this is faster - than inserting each element in turn. You still need to balance - the tree at the end.*/ - void insert(const Array& valueArray) { - // Pre-size the member table to avoid multiple allocations - memberTable.setSizeHint(valueArray.size() + size()); - - if (root == NULL) { - // Optimized case for an empty tree; don't bother - // searching or reallocating the root node's valueArray - // as we incrementally insert. - root = new Node(); - root->valueArray.resize(valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - // Insert in opposite order so that we have the exact same - // data structure as if we inserted each (i.e., order is reversed - // from array). - root->valueArray[valueArray.size() - i - 1] = Handle(valueArray[i]); - memberTable.set(valueArray[i], root); - } - } else { - // Insert at appropriate tree depth. - for (int i = 0; i < valueArray.size(); ++i) { - insert(valueArray[i]); - } - } - } - - - /** - Returns true if this object is in the set, otherwise - returns false. O(1) time. - */ - bool contains(const T& value) { - return memberTable.containsKey(value); - } - - - /** - Removes an object from the set in O(1) time. - It is an error to remove members that are not already - present. May unbalance the tree. - - Removing an element never causes a node (split plane) to be removed... - nodes are only changed when the tree is rebalanced. This behavior - is desirable because it allows the split planes to be serialized, - and then deserialized into an empty tree which can be repopulated. - */ - void remove(const T& value) { - debugAssertM(contains(value), - "Tried to remove an element from a " - "PointKDTree that was not present"); - - Array& list = memberTable[value]->valueArray; - - // Find the element and remove it - for (int i = list.length() - 1; i >= 0; --i) { - if (list[i].value == value) { - list.fastRemove(i); - break; - } - } - memberTable.remove(value); - } - - - /** - If the element is in the set, it is removed. - The element is then inserted. - - This is useful when the == and hashCode methods - on T are independent of the bounds. In - that case, you may call update(v) to insert an - element for the first time and call update(v) - again every time it moves to keep the tree - up to date. - */ - void update(const T& value) { - if (contains(value)) { - remove(value); - } - insert(value); - } - - - /** - Rebalances the tree (slow). Call when objects - have moved substantially from their original positions - (which unbalances the tree and causes the spatial - queries to be slow). - - @param valuesPerNode Maximum number of elements to put at - a node. - - @param numMeanSplits numMeanSplits = 0 gives a - fully axis aligned BSP-tree, where the balance operation attempts to balance - the tree so that every splitting plane has an equal number of left - and right children (i.e. it is a median split along that axis). - This tends to maximize average performance; all querries will return in the same amount of time. - - You can override this behavior by - setting a number of mean (average) splits. numMeanSplits = MAX_INT - creates a full oct-tree, which tends to optimize peak performance (some areas of the scene will terminate after few recursive splits) at the expense of - peak performance. - */ - void balance(int valuesPerNode = 40, int numMeanSplits = 3) { - if (root == NULL) { - // Tree is empty - return; - } - - Array handleArray; - root->getHandles(handleArray); - - // Delete the old tree - clear(); - - Array temp; - root = makeNode(handleArray, temp, valuesPerNode, numMeanSplits); - temp.fastClear(); - - // Walk the tree, assigning splitBounds. We start with unbounded - // space. - root->assignSplitBounds(AABox::maxFinite()); - -# ifdef _DEBUG - root->verifyNode(Vector3::minFinite(), Vector3::maxFinite()); -# endif - } - -private: - - /** - Returns the elements - - @param parentMask The mask that this node returned from culledBy. - */ - static void getIntersectingMembers( - const Array& plane, - Array& members, - Node* node, - uint32 parentMask) { - - int dummy; - - if (parentMask == 0) { - // None of these planes can cull anything - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - members.append(node->valueArray[v].value); - } - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c]) { - getIntersectingMembers(plane, members, node->child[c], 0); - } - } - } else { - - if (node->valueArray.size() > 0) { - // This is a leaf; check the points - debugAssertM(node->child[0] == NULL, "Malformed Point tree"); - debugAssertM(node->child[1] == NULL, "Malformed Point tree"); - - // Test values at this node against remaining planes - for (int p = 0; p < plane.size(); ++p) { - if ((parentMask >> p) & 1 != 0) { - // Test against this plane - const Plane& curPlane = plane[p]; - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - if (curPlane.halfSpaceContains(node->valueArray[v].position())) { - members.append(node->valueArray[v].value); - } - } - } - } - } else { - - uint32 childMask = 0xFFFFFF; - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c] && - ! node->child[c]->splitBounds.culledBy(plane, dummy, parentMask, childMask)) { - // This node was not culled - getIntersectingMembers(plane, members, node->child[c], childMask); - } - } - } - } - } - -public: - - /** - Returns all members inside the set of planes. - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Array& plane, Array& members) const { - if (root == NULL) { - return; - } - - getIntersectingMembers(plane, members, root, 0xFFFFFF); - } - - /** - Typically used to find all visible - objects inside the view frustum (see also GCamera::getClipPlanes)... i.e. all objects - not culled by frustum. - - Example: -
-        Array  visible;
-        tree.getIntersectingMembers(camera.frustum(), visible);
-        // ... Draw all objects in the visible array.
-      
- @param members The results are appended to this array. - */ - void getIntersectingMembers(const GCamera::Frustum& frustum, Array& members) const { - Array plane; - - for (int i = 0; i < frustum.faceArray.size(); ++i) { - plane.append(frustum.faceArray[i].plane); - } - - getIntersectingMembers(plane, members); - } - - /** - C++ STL style iterator variable. See beginBoxIntersection(). - The iterator overloads the -> (dereference) operator, so this - acts like a pointer to the current member. - */ - // This iterator turns Node::getIntersectingMembers into a - // coroutine. It first translates that method from recursive to - // stack based, then captures the system state (analogous to a Scheme - // continuation) after each element is appended to the member array, - // and allowing the computation to be restarted. - class BoxIntersectionIterator { - private: - friend class TreeType; - - /** True if this is the "end" iterator instance */ - bool isEnd; - - /** The box that we're testing against. */ - AABox box; - - /** Node that we're currently looking at. Undefined if isEnd - is true. */ - Node* node; - - /** Nodes waiting to be processed */ - // We could use backpointers within the tree and careful - // state management to avoid ever storing the stack-- but - // it is much easier this way and only inefficient if the - // caller uses post increment (which they shouldn't!). - Array stack; - - /** The next index of current->valueArray to return. - Undefined when isEnd is true.*/ - int nextValueArrayIndex; - - BoxIntersectionIterator() : isEnd(true) {} - - BoxIntersectionIterator(const AABox& b, const Node* root) : - isEnd(root == NULL), box(b), - node(const_cast(root)), nextValueArrayIndex(-1) { - - // We intentionally start at the "-1" index of the current - // node so we can use the preincrement operator to move - // ourselves to element 0 instead of repeating all of the - // code from the preincrement method. Note that this might - // cause us to become the "end" instance. - ++(*this); - } - - public: - - inline bool operator!=(const BoxIntersectionIterator& other) const { - return ! (*this == other); - } - - bool operator==(const BoxIntersectionIterator& other) const { - if (isEnd) { - return other.isEnd; - } else if (other.isEnd) { - return false; - } else { - // Two non-end iterators; see if they match. This is kind of - // silly; users shouldn't call == on iterators in general unless - // one of them is the end iterator. - if ((box != other.box) || (node != other.node) || - (nextValueArrayIndex != other.nextValueArrayIndex) || - (stack.length() != other.stack.length())) { - return false; - } - - // See if the stacks are the same - for (int i = 0; i < stack.length(); ++i) { - if (stack[i] != other.stack[i]) { - return false; - } - } - - // We failed to find a difference; they must be the same - return true; - } - } - - /** - Pre increment. - */ - BoxIntersectionIterator& operator++() { - ++nextValueArrayIndex; - - bool foundIntersection = false; - while (! isEnd && ! foundIntersection) { - - // Search for the next node if we've exhausted this one - while ((! isEnd) && (nextValueArrayIndex >= node->valueArray.length())) { - // If we entered this loop, then the iterator has exhausted the elements at - // node (possibly because it just switched to a child node with no members). - // This loop continues until it finds a node with members or reaches - // the end of the whole intersection search. - - // If the right child overlaps the box, push it onto the stack for - // processing. - if ((node->child[1] != NULL) && - (box.high()[node->splitAxis] > node->splitLocation)) { - stack.push(node->child[1]); - } - - // If the left child overlaps the box, push it onto the stack for - // processing. - if ((node->child[0] != NULL) && - (box.low()[node->splitAxis] < node->splitLocation)) { - stack.push(node->child[0]); - } - - if (stack.length() > 0) { - // Go on to the next node (which may be either one of the ones we - // just pushed, or one from farther back the tree). - node = stack.pop(); - nextValueArrayIndex = 0; - } else { - // That was the last node; we're done iterating - isEnd = true; - } - } - - // Search for the next intersection at this node until we run out of children - while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { - if (box.intersects(node->valueArray[nextValueArrayIndex].bounds)) { - foundIntersection = true; - } else { - ++nextValueArrayIndex; - // If we exhaust this node, we'll loop around the master loop - // to find a new node. - } - } - } - - return *this; - } - - /** - Post increment (much slower than preincrement!). - */ - BoxIntersectionIterator operator++(int) { - BoxIntersectionIterator old = *this; - ++this; - return old; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - const T& operator*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return node->valueArray[nextValueArrayIndex].value; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - T const * operator->() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex].value); - } - - /** Overloaded cast operator so the iterator can masquerade as a pointer - to a member */ - operator T*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex].value); - } - }; - - - /** - Iterates through the members that intersect the box - */ - BoxIntersectionIterator beginBoxIntersection(const AABox& box) const { - return BoxIntersectionIterator(box, root); - } - - BoxIntersectionIterator endBoxIntersection() const { - // The "end" iterator instance - return BoxIntersectionIterator(); - } - - /** - Appends all members whose bounds intersect the box. - See also PointKDTree::beginBoxIntersection. - */ - void getIntersectingMembers(const AABox& box, Array& members) const { - if (root == NULL) { - return; - } - root->getIntersectingMembers(box, Sphere(Vector3::zero(), 0), members, false); - } - - - /** - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Sphere& sphere, Array& members) const { - if (root == NULL) { - return; - } - - AABox box; - sphere.getBounds(box); - root->getIntersectingMembers(box, sphere, members); - - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - void serializeStructure(BinaryOutput& bo) const { - Node::serializeStructure(root, bo); - } - - /** Clears the member table */ - void deserializeStructure(BinaryInput& bi) { - clear(); - root = Node::deserializeStructure(bi); - } - - /** - Returns an array of all members of the set. See also PointKDTree::begin. - */ - void getMembers(Array& members) const { - memberTable.getKeys(members); - } - - - /** - C++ STL style iterator variable. See begin(). - Overloads the -> (dereference) operator, so this acts like a pointer - to the current member. - */ - class Iterator { - private: - friend class TreeType; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename MemberTable::Iterator it; - - Iterator(const typename MemberTable::Iterator& it) : it(it) {} - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const T& operator*() const { - return it->key; - } - - T* operator->() const { - return &(it->key); - } - - operator T*() const { - return &(it->key); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element (iteration - order is arbitrary). - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - Iterator end() const { - return Iterator(memberTable.end()); - } -#undef TreeType -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Pointer.h b/dep/include/g3dlite/G3D/Pointer.h deleted file mode 100644 index 6e35062a746..00000000000 --- a/dep/include/g3dlite/G3D/Pointer.h +++ /dev/null @@ -1,292 +0,0 @@ -/** - @file Pointer.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-05-16 - @edited 2009-03-26 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_Pointer_h -#define G3D_Pointer_h - -#include "G3D/debugAssert.h" -#include "G3D/ReferenceCount.h" - -namespace G3D { - -/** - Acts like a pointer to a value of type ValueType (i.e., - ValueType*), but can operate through accessor methods as well as on - a value in memory. This is useful for implementing scripting - languages and other applications that need to connect existing APIs - by reference. - - Because the accessors require values to be passed by value (instead of by reference) - this is primarily useful for objects whose memory size is small. - -
-   class Foo {
-   public:
-      void setEnabled(bool b);
-      bool getEnabled() const;
-   };
-
-   Foo  f;
-   bool b;
-   
-   Pointer p1(&b);
-   Pointer p2(&f, &Foo::getEnabled, &Foo::setEnabled);
-
-   *p1 = true;
-   *p2 = false;
-   *p2 = *p1; \/\/ Value assignment
-   p2 = p1; \/\/ Pointer aliasing
-
-   \/\/ Or, equivalently:
-   p1.setValue(true);
-   p2.setValue(false);
-
-   p2.setValue(p1.getValue());
-   p2 = p1;
-   
- - Note: Because of the way that dereference is implemented, you cannot pass *p through a function - that takes varargs (...), e.g., printf("%d", *p) will produce a compile-time error. Instead use - printf("%d",(bool)*p) or printf("%d", p.getValue()). - - */ -template -class Pointer { -private: - - class Interface { - public: - virtual ~Interface() {}; - virtual void set(ValueType b) = 0; - virtual ValueType get() const = 0; - virtual Interface* clone() const = 0; - virtual bool isNull() const = 0; - }; - - class Memory : public Interface { - private: - - ValueType* value; - - public: - - Memory(ValueType* value) : value(value) { - //debugAssert(value != NULL); - } - - virtual void set(ValueType v) { - *value = v; - } - - virtual ValueType get() const { - return *value; - } - - virtual Interface* clone() const { - return new Memory(value); - } - - virtual bool isNull() const { - return value == NULL; - } - }; - - template - class Accessor : public Interface { - private: - - T* object; - GetMethod getMethod; - SetMethod setMethod; - - public: - - Accessor(T* object, - GetMethod getMethod, - SetMethod setMethod) : object(object), getMethod(getMethod), setMethod(setMethod) { - debugAssert(object != NULL); - } - - virtual void set(ValueType v) { - (object->*setMethod)(v); - } - - virtual ValueType get() const { - return (object->*getMethod)(); - } - - virtual Interface* clone() const { - return new Accessor(object, getMethod, setMethod); - } - - virtual bool isNull() const { - return object == NULL; - } - }; - - - template - class RefAccessor : public Interface { - private: - - ReferenceCountedPointer object; - GetMethod getMethod; - SetMethod setMethod; - - public: - - RefAccessor( - const ReferenceCountedPointer& object, - GetMethod getMethod, - SetMethod setMethod) : object(object), getMethod(getMethod), setMethod(setMethod) { - - debugAssert(object != NULL); - } - - virtual void set(ValueType v) { - (object.pointer()->*setMethod)(v); - } - - virtual ValueType get() const { - return (object.pointer()->*getMethod)(); - } - - virtual Interface* clone() const { - return new RefAccessor(object, getMethod, setMethod); - } - - virtual bool isNull() const { - return object.isNull(); - } - }; - - - Interface* m_interface; - -public: - - Pointer() : m_interface(NULL) {}; - - /** Allows implicit cast from real pointer */ - Pointer(ValueType* v) : m_interface(new Memory(v)) {} - - inline bool isNull() const { - return (m_interface == NULL) || m_interface->isNull(); - } - - // Assignment - inline Pointer& operator=(const Pointer& r) { - delete m_interface; - if (r.m_interface != NULL) { - m_interface = r.m_interface->clone(); - } else { - m_interface = NULL; - } - return this[0]; - } - - Pointer(const Pointer& p) : m_interface(NULL) { - this[0] = p; - } - - template - Pointer(const ReferenceCountedPointer& object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - m_interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - m_interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - m_interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - m_interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - m_interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - m_interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - m_interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - m_interface(new Accessor(object, getMethod, setMethod)) {} - - ~Pointer() { - delete m_interface; - } - - inline const ValueType getValue() const { - debugAssert(m_interface != NULL); - return m_interface->get(); - } - - inline void setValue(const ValueType& v) { - debugAssert(m_interface != NULL); - m_interface->set(v); - } - - class IndirectValue { - private: - - friend class Pointer; - Pointer* pointer; - IndirectValue(Pointer* p) : pointer(p) {} - - public: - - void operator=(const ValueType& v) { - pointer->setValue(v); - } - - operator ValueType() const { - return pointer->getValue(); - } - - }; - - inline IndirectValue operator*() { - return IndirectValue(this); - } - - inline const ValueType operator*() const { - return getValue(); - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/PositionTrait.h b/dep/include/g3dlite/G3D/PositionTrait.h deleted file mode 100644 index 67a4f64138a..00000000000 --- a/dep/include/g3dlite/G3D/PositionTrait.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef G3D_POSITIONTRAIT_H -#define G3D_POSITIONTRAIT_H - -template -struct PositionTrait{}; - -#endif diff --git a/dep/include/g3dlite/G3D/PrecomputedRandom.h b/dep/include/g3dlite/G3D/PrecomputedRandom.h deleted file mode 100644 index 411d128c582..00000000000 --- a/dep/include/g3dlite/G3D/PrecomputedRandom.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - @file PrecomputedRandom.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-03-31 - @edited 2009-03-31 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_PrecomputedRandom_h -#define G3D_PrecomputedRandom_h - -#include "G3D/platform.h" -#include "G3D/Random.h" - -namespace G3D { - -/** Fast random numbers using a precomputed data table. - - e.g., generates cosHemi about 13x faster than Random. - This is useful for quickly generating seeded random - numbers for reproducibility. G3D::Random takes a long - time to seed; this is instantaneous (providing the - precomputed data is already available.) - - Not threadsafe.*/ -class PrecomputedRandom : public Random { -public: - /** Put the cosHemi and the uniform together so that when - alternating between them we stay in cache. This is also packed - into a good size for SIMD and GPU operations.*/ - class HemiUniformData { - public: - float cosHemiX; - float cosHemiY; - float cosHemiZ; - float uniform; - }; - - class SphereBitsData { - public: - float sphereX; - float sphereY; - float sphereZ; - uint32 bits; - }; - -protected: - - /** Array of 2^n elements. */ - const HemiUniformData* m_hemiUniform; - const SphereBitsData* m_sphereBits; - - /** 2^n - 1; the AND mask for computing a fast modulo */ - int m_modMask; - - int m_index; - - /** If true, free m_hemiUniform and m_sphereBits in destructor */ - bool m_freeData; - -public: - - /* - \param dataSize Must be a power of 2 - \param data Will NOT be deleted by the destructor. - */ - PrecomputedRandom(const HemiUniformData* data1, const SphereBitsData* data2, int dataSize, uint32 seed = 0xF018A4D2); - - /** - \param dataSize Number of random numbers that can be requested before periodicity. Must be a power of 2. - */ - PrecomputedRandom(int dataSize, uint32 seed = 0xF018A4D2); - - ~PrecomputedRandom(); - - /** Each bit is random. Subclasses can choose to override just - this method and the other methods will all work automatically. */ - virtual uint32 bits(); - - // integer is inherited - - /** Uniform random float on the range [min, max] */ - virtual float uniform(float low, float high); - - /** Uniform random float on the range [0, 1] */ - virtual float uniform(); - - // gaussian is inherited - - /** Returns 3D unit vectors distributed according to - a cosine distribution about the z axis. */ - virtual void cosHemi(float& x, float& y, float& z); - - /** Returns 3D unit vectors distributed according to a cosine - power distribution (\f$ \mbox{cos}^k \theta \f$) about - the z-axis. */ - virtual void cosPowHemi(const float k, float& x, float& y, float& z); - - // hemi is inherited - - /** Returns 3D unit vectors uniformly distributed on the sphere */ - virtual void sphere(float& x, float& y, float& z); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Quat.h b/dep/include/g3dlite/G3D/Quat.h deleted file mode 100644 index 9ef3d57b301..00000000000 --- a/dep/include/g3dlite/G3D/Quat.h +++ /dev/null @@ -1,725 +0,0 @@ -/** - @file Quat.h - - Quaternion - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-01-23 - @edited 2009-05-10 - */ - -#ifndef G3D_Quat_h -#define G3D_Quat_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Matrix3.h" -#include - -namespace G3D { - -/** - Unit quaternions are used in computer graphics to represent - rotation about an axis. Any 3x3 rotation matrix can - be stored as a quaternion. - - A quaternion represents the sum of a real scalar and - an imaginary vector: ix + jy + kz + w. A unit quaternion - representing a rotation by A about axis v has the form - [sin(A/2)*v, cos(A/2)]. For a unit quaternion, q.conj() == q.inverse() - is a rotation by -A about v. -q is the same rotation as q - (negate both the axis and angle). - - A non-unit quaterion q represents the same rotation as - q.unitize() (Dam98 pg 28). - - Although quaternion-vector operations (eg. Quat + Vector3) are - well defined, they are not supported by this class because - they typically are bugs when they appear in code. - - Do not subclass. - - BETA API -- subject to change - @cite Erik B. Dam, Martin Koch, Martin Lillholm, Quaternions, Interpolation and Animation. Technical Report DIKU-TR-98/5, Department of Computer Science, University of Copenhagen, Denmark. 1998. - */ -class Quat { -private: - // Hidden operators - bool operator<(const Quat&) const; - bool operator>(const Quat&) const; - bool operator<=(const Quat&) const; - bool operator>=(const Quat&) const; - -public: - - /** - q = [sin(angle / 2) * axis, cos(angle / 2)] - - In Watt & Watt's notation, s = w, v = (x, y, z) - In the Real-Time Rendering notation, u = (x, y, z), w = w - */ - float x, y, z, w; - - /** - Initializes to a zero degree rotation. - */ - inline Quat() : x(0), y(0), z(0), w(1) {} - - Quat( - const Matrix3& rot); - - inline Quat(float _x, float _y, float _z, float _w) : - x(_x), y(_y), z(_z), w(_w) {} - - /** Defaults to a pure vector quaternion */ - inline Quat(const Vector3& v, float _w = 0) : x(v.x), y(v.y), z(v.z), w(_w) { - } - - /** - The real part of the quaternion. - */ - inline const float& real() const { - return w; - } - - inline float& real() { - return w; - } - - /** Note: two quats can represent the Quat::sameRotation and not be equal. */ - bool fuzzyEq(const Quat& q) { - return G3D::fuzzyEq(x, q.x) && G3D::fuzzyEq(y, q.y) && G3D::fuzzyEq(z, q.z) && G3D::fuzzyEq(w, q.w); - } - - /** True if these quaternions represent the same rotation (note that every rotation is - represented by two values; q and -q). - */ - bool sameRotation(const Quat& q) { - return fuzzyEq(q) || fuzzyEq(-q); - } - - inline Quat operator-() const { - return Quat(-x, -y, -z, -w); - } - - /** - Returns the imaginary part (x, y, z) - */ - inline const Vector3& imag() const { - return *(reinterpret_cast(this)); - } - - inline Vector3& imag() { - return *(reinterpret_cast(this)); - } - - /** q = [sin(angle/2)*axis, cos(angle/2)] */ - static Quat fromAxisAngleRotation( - const Vector3& axis, - float angle); - - /** Returns the axis and angle of rotation represented - by this quaternion (i.e. q = [sin(angle/2)*axis, cos(angle/2)]) */ - void toAxisAngleRotation( - Vector3& axis, - double& angle) const; - - void toAxisAngleRotation( - Vector3& axis, - float& angle) const { - double d; - toAxisAngleRotation(axis, d); - angle = (float)d; - } - - Matrix3 toRotationMatrix() const; - - void toRotationMatrix( - Matrix3& rot) const; - - /** - Spherical linear interpolation: linear interpolation along the - shortest (3D) great-circle route between two quaternions. - - Note: Correct rotations are expected between 0 and PI in the right order. - - @cite Based on Game Physics -- David Eberly pg 538-540 - @param threshold Critical angle between between rotations at which - the algorithm switches to normalized lerp, which is more - numerically stable in those situations. 0.0 will always slerp. - */ - Quat slerp( - const Quat& other, - float alpha, - float threshold = 0.05f) const; - - /** Normalized linear interpolation of quaternion components. */ - Quat nlerp(const Quat& other, float alpha) const; - - /** - Negates the imaginary part. - */ - inline Quat conj() const { - return Quat(-x, -y, -z, w); - } - - inline float sum() const { - return x + y + z + w; - } - - inline float average() const { - return sum() / 4.0f; - } - - inline Quat operator*(float s) const { - return Quat(x * s, y * s, z * s, w * s); - } - - inline Quat& operator*=(float s) { - x *= s; - y *= s; - z *= s; - w *= s; - return *this; - } - - /** @cite Based on Watt & Watt, page 360 */ - friend Quat operator* (float s, const Quat& q); - - inline Quat operator/(float s) const { - return Quat(x / s, y / s, z / s, w / s); - } - - inline float dot(const Quat& other) const { - return (x * other.x) + (y * other.y) + (z * other.z) + (w * other.w); - } - - /** Note that q-1 = q.conj() for a unit quaternion. - @cite Dam99 page 13 */ - inline Quat inverse() const { - return conj() / dot(*this); - } - - Quat operator-(const Quat& other) const; - - Quat operator+(const Quat& other) const; - - /** - Quaternion multiplication (composition of rotations). - Note that this does not commute. - */ - Quat operator*(const Quat& other) const; - - /* (*this) * other.inverse() */ - Quat operator/(const Quat& other) const { - return (*this) * other.inverse(); - } - - - /** Is the magnitude nearly 1.0? */ - inline bool isUnit(float tolerance = 1e-5) const { - return abs(dot(*this) - 1.0f) < tolerance; - } - - - inline float magnitude() const { - return sqrtf(dot(*this)); - } - - inline Quat log() const { - if ((x == 0) && (y == 0) && (z == 0)) { - if (w > 0) { - return Quat(0, 0, 0, ::logf(w)); - } else if (w < 0) { - // Log of a negative number. Multivalued, any number of the form - // (PI * v, ln(-q.w)) - return Quat((float)pi(), 0, 0, ::logf(-w)); - } else { - // log of zero! - return Quat((float)nan(), (float)nan(), (float)nan(), (float)nan()); - } - } else { - // Partly imaginary. - float imagLen = sqrtf(x * x + y * y + z * z); - float len = sqrtf(imagLen * imagLen + w * w); - float theta = atan2f(imagLen, (float)w); - float t = theta / imagLen; - return Quat(t * x, t * y, t * z, ::logf(len)); - } - } - /** log q = [Av, 0] where q = [sin(A) * v, cos(A)]. - Only for unit quaternions - debugAssertM(isUnit(), "Log only defined for unit quaternions"); - // Solve for A in q = [sin(A)*v, cos(A)] - Vector3 u(x, y, z); - double len = u.magnitude(); - - if (len == 0.0) { - return - } - double A = atan2((double)w, len); - Vector3 v = u / len; - - return Quat(v * A, 0); - } - */ - - /** exp q = [sin(A) * v, cos(A)] where q = [Av, 0]. - Only defined for pure-vector quaternions */ - inline Quat exp() const { - debugAssertM(w == 0, "exp only defined for vector quaternions"); - Vector3 u(x, y, z); - float A = u.magnitude(); - Vector3 v = u / A; - return Quat(sinf(A) * v, cosf(A)); - } - - - /** - Raise this quaternion to a power. For a rotation, this is - the effect of rotating x times as much as the original - quaterion. - - Note that q.pow(a).pow(b) == q.pow(a + b) - @cite Dam98 pg 21 - */ - inline Quat pow(float x) const { - return (log() * x).exp(); - } - - inline void unitize() { - float mag2 = dot(*this); - if (! G3D::fuzzyEq(mag2, 1.0f)) { - *this *= rsq(mag2); - } - } - - /** - Returns a unit quaterion obtained by dividing through by - the magnitude. - */ - inline Quat toUnit() const { - Quat x = *this; - x.unitize(); - return x; - } - - /** - The linear algebra 2-norm, sqrt(q dot q). This matches - the value used in Dam's 1998 tech report but differs from the - n(q) value used in Eberly's 1999 paper, which is the square of the - norm. - */ - inline float norm() const { - return magnitude(); - } - - // access quaternion as q[0] = q.x, q[1] = q.y, q[2] = q.z, q[3] = q.w - // - // WARNING. These member functions rely on - // (1) Quat not having virtual functions - // (2) the data packed in a 4*sizeof(float) memory block - const float& operator[] (int i) const; - float& operator[] (int i); - - /** Generate uniform random unit quaternion (i.e. random "direction") - @cite From "Uniform Random Rotations", Ken Shoemake, Graphics Gems III. - */ - static Quat unitRandom(); - - void deserialize(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 wx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 wy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - Vector2 wz() const; - Vector2 xw() const; - Vector2 yw() const; - Vector2 zw() const; - Vector2 ww() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 wxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 wyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 wzx() const; - Vector3 xwx() const; - Vector3 ywx() const; - Vector3 zwx() const; - Vector3 wwx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 wxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 wyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 wzy() const; - Vector3 xwy() const; - Vector3 ywy() const; - Vector3 zwy() const; - Vector3 wwy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 wxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 wyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - Vector3 wzz() const; - Vector3 xwz() const; - Vector3 ywz() const; - Vector3 zwz() const; - Vector3 wwz() const; - Vector3 xxw() const; - Vector3 yxw() const; - Vector3 zxw() const; - Vector3 wxw() const; - Vector3 xyw() const; - Vector3 yyw() const; - Vector3 zyw() const; - Vector3 wyw() const; - Vector3 xzw() const; - Vector3 yzw() const; - Vector3 zzw() const; - Vector3 wzw() const; - Vector3 xww() const; - Vector3 yww() const; - Vector3 zww() const; - Vector3 www() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 wxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 wyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 wzxx() const; - Vector4 xwxx() const; - Vector4 ywxx() const; - Vector4 zwxx() const; - Vector4 wwxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 wxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 wyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 wzyx() const; - Vector4 xwyx() const; - Vector4 ywyx() const; - Vector4 zwyx() const; - Vector4 wwyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 wxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 wyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 wzzx() const; - Vector4 xwzx() const; - Vector4 ywzx() const; - Vector4 zwzx() const; - Vector4 wwzx() const; - Vector4 xxwx() const; - Vector4 yxwx() const; - Vector4 zxwx() const; - Vector4 wxwx() const; - Vector4 xywx() const; - Vector4 yywx() const; - Vector4 zywx() const; - Vector4 wywx() const; - Vector4 xzwx() const; - Vector4 yzwx() const; - Vector4 zzwx() const; - Vector4 wzwx() const; - Vector4 xwwx() const; - Vector4 ywwx() const; - Vector4 zwwx() const; - Vector4 wwwx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 wxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 wyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 wzxy() const; - Vector4 xwxy() const; - Vector4 ywxy() const; - Vector4 zwxy() const; - Vector4 wwxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 wxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 wyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 wzyy() const; - Vector4 xwyy() const; - Vector4 ywyy() const; - Vector4 zwyy() const; - Vector4 wwyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 wxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 wyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 wzzy() const; - Vector4 xwzy() const; - Vector4 ywzy() const; - Vector4 zwzy() const; - Vector4 wwzy() const; - Vector4 xxwy() const; - Vector4 yxwy() const; - Vector4 zxwy() const; - Vector4 wxwy() const; - Vector4 xywy() const; - Vector4 yywy() const; - Vector4 zywy() const; - Vector4 wywy() const; - Vector4 xzwy() const; - Vector4 yzwy() const; - Vector4 zzwy() const; - Vector4 wzwy() const; - Vector4 xwwy() const; - Vector4 ywwy() const; - Vector4 zwwy() const; - Vector4 wwwy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 wxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 wyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 wzxz() const; - Vector4 xwxz() const; - Vector4 ywxz() const; - Vector4 zwxz() const; - Vector4 wwxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 wxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 wyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 wzyz() const; - Vector4 xwyz() const; - Vector4 ywyz() const; - Vector4 zwyz() const; - Vector4 wwyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 wxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 wyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - Vector4 wzzz() const; - Vector4 xwzz() const; - Vector4 ywzz() const; - Vector4 zwzz() const; - Vector4 wwzz() const; - Vector4 xxwz() const; - Vector4 yxwz() const; - Vector4 zxwz() const; - Vector4 wxwz() const; - Vector4 xywz() const; - Vector4 yywz() const; - Vector4 zywz() const; - Vector4 wywz() const; - Vector4 xzwz() const; - Vector4 yzwz() const; - Vector4 zzwz() const; - Vector4 wzwz() const; - Vector4 xwwz() const; - Vector4 ywwz() const; - Vector4 zwwz() const; - Vector4 wwwz() const; - Vector4 xxxw() const; - Vector4 yxxw() const; - Vector4 zxxw() const; - Vector4 wxxw() const; - Vector4 xyxw() const; - Vector4 yyxw() const; - Vector4 zyxw() const; - Vector4 wyxw() const; - Vector4 xzxw() const; - Vector4 yzxw() const; - Vector4 zzxw() const; - Vector4 wzxw() const; - Vector4 xwxw() const; - Vector4 ywxw() const; - Vector4 zwxw() const; - Vector4 wwxw() const; - Vector4 xxyw() const; - Vector4 yxyw() const; - Vector4 zxyw() const; - Vector4 wxyw() const; - Vector4 xyyw() const; - Vector4 yyyw() const; - Vector4 zyyw() const; - Vector4 wyyw() const; - Vector4 xzyw() const; - Vector4 yzyw() const; - Vector4 zzyw() const; - Vector4 wzyw() const; - Vector4 xwyw() const; - Vector4 ywyw() const; - Vector4 zwyw() const; - Vector4 wwyw() const; - Vector4 xxzw() const; - Vector4 yxzw() const; - Vector4 zxzw() const; - Vector4 wxzw() const; - Vector4 xyzw() const; - Vector4 yyzw() const; - Vector4 zyzw() const; - Vector4 wyzw() const; - Vector4 xzzw() const; - Vector4 yzzw() const; - Vector4 zzzw() const; - Vector4 wzzw() const; - Vector4 xwzw() const; - Vector4 ywzw() const; - Vector4 zwzw() const; - Vector4 wwzw() const; - Vector4 xxww() const; - Vector4 yxww() const; - Vector4 zxww() const; - Vector4 wxww() const; - Vector4 xyww() const; - Vector4 yyww() const; - Vector4 zyww() const; - Vector4 wyww() const; - Vector4 xzww() const; - Vector4 yzww() const; - Vector4 zzww() const; - Vector4 wzww() const; - Vector4 xwww() const; - Vector4 ywww() const; - Vector4 zwww() const; - Vector4 wwww() const; -}; - -inline Quat exp(const Quat& q) { - return q.exp(); -} - -inline Quat log(const Quat& q) { - return q.log(); -} - -inline G3D::Quat operator*(double s, const G3D::Quat& q) { - return q * (float)s; -} - -inline G3D::Quat operator*(float s, const G3D::Quat& q) { - return q * s; -} - -inline float& Quat::operator[] (int i) { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline const float& Quat::operator[] (int i) const { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline Quat Quat::operator-(const Quat& other) const { - return Quat(x - other.x, y - other.y, z - other.z, w - other.w); -} - -inline Quat Quat::operator+(const Quat& other) const { - return Quat(x + other.x, y + other.y, z + other.z, w + other.w); -} - -} // Namespace G3D - -// Outside the namespace to avoid overloading confusion for C++ -inline G3D::Quat pow(const G3D::Quat& q, double x) { - return q.pow((float)x); -} - - -#endif diff --git a/dep/include/g3dlite/G3D/Quat.inl b/dep/include/g3dlite/G3D/Quat.inl deleted file mode 100644 index 9e4c861d93b..00000000000 --- a/dep/include/g3dlite/G3D/Quat.inl +++ /dev/null @@ -1,36 +0,0 @@ -/** - Quat.inl - - @cite Quaternion implementation based on Watt & Watt page 363. - Thanks to Max McGuire for slerp optimizations. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-01-23 - @edited 2004-03-04 - */ - -namespace G3D { - -inline float& Quat::operator[] (int i) { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline const float& Quat::operator[] (int i) const { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline Quat Quat::operator-(const Quat& other) const { - return Quat(x - other.x, y - other.y, z - other.z, w - other.w); -} - -inline Quat Quat::operator+(const Quat& other) const { - return Quat(x + other.x, y + other.y, z + other.z, w + other.w); -} - -} - diff --git a/dep/include/g3dlite/G3D/Queue.h b/dep/include/g3dlite/G3D/Queue.h deleted file mode 100644 index 36573265d1a..00000000000 --- a/dep/include/g3dlite/G3D/Queue.h +++ /dev/null @@ -1,364 +0,0 @@ -/** - @file Queue.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-07-09 - @edited 2008-12-20 - */ - -#ifndef G3D_QUEUE_H -#define G3D_QUEUE_H - -#include "G3D/platform.h" -#include "G3D/System.h" -#include "G3D/debug.h" - -namespace G3D { - -/** - Locate the indices of the break between of the two - sections of the circular queue. These are used to - construct two for loops that iterate over the whole - sequence without using the modulo operator. - - [0 ... secondEnd) [head .... firstEnd) - */ -#define FIND_ENDS \ - int firstEnd = head + num;\ - int secondEnd = 0;\ - if (firstEnd > numAllocated) {\ - secondEnd = firstEnd - numAllocated;\ - firstEnd = numAllocated;\ - } - - -/** - Dynamic queue that uses a circular buffer for performance. - - Faster than std::deque for objects with constructors. - */ -template -class Queue { -private: - // - // |<---- num ---->| - // [ | | | | | | | | | | | | | ] - // ^ - // | - // head - // - // - - /** - Only num elements are initialized. - */ - T* data; - - /** - Index of the next element to be dequeue-d in data. - */ - int head; - - /** - Number of elements (including head) that are visible and initialized. - */ - int num; - - /** - Size of data array in elements. - */ - int numAllocated; - - /** If a clear was needed, assumes it already occured */ - void _copy(const Queue& other) { - debugAssert(data == NULL); - data = (T*)System::malloc(sizeof(T) * other.numAllocated); - debugAssert(data); - head = other.head; - num = other.num; - numAllocated = other.numAllocated; - - FIND_ENDS; - - for (int i = head; i < firstEnd; ++i) { - new (data + i)T(other.data[i]); - } - - for (int i = 0; i < secondEnd; ++i) { - new (data + i)T(other.data[i]); - } - } - - - /** - Computes a data array index from a queue position. The queue position - may be negative. - */ - inline int index(int i) const { - return (head + i + numAllocated) % numAllocated; - } - - /** - Allocates newSize elements and repacks the array. - */ - void repackAndRealloc(int newSize) { - // TODO: shrink queue - T* old = data; - data = (T*)System::malloc(newSize * sizeof(T)); - debugAssert(data != NULL); - - FIND_ENDS; - - int j = 0; - for (int i = head; i < firstEnd; ++i, ++j) { - new (data + j)T(old[i]); - (old + i)->~T(); - } - - for (int i = 0; i < secondEnd; ++i, ++j) { - new (data + j)T(old[i]); - (old + i)->~T(); - } - - head = 0; - System::free(old); - numAllocated = newSize; - } - - /** - Ensure that there is at least one element between - the tail and head, wrapping around in the circular - buffer. - */ - inline void reserveSpace() { - if (num == numAllocated) { - repackAndRealloc(numAllocated * 3 + 20); - } - } - -public: - - Queue() : - data(NULL), - head(0), - num(0), - numAllocated(0) { - } - - - /** - Copy constructor - */ - Queue(const Queue& other) : data(NULL) { - _copy(other); - } - - - /** - Destructor does not delete() the objects if T is a pointer type - (e.g. T = int*) instead, it deletes the pointers themselves and - leaves the objects. Call deleteAll if you want to dealocate - the objects referenced. - */ - virtual ~Queue() { - clear(); - } - - /** - Insert a new element into the front of the queue - (a traditional queue only uses pushBack). - */ - inline void pushFront(const T& e) { - reserveSpace(); - - // Get the index of head-1 - int i = index(-1); - - // Call the constructor on the newly exposed element. - new (data + i)T(e); - - // Reassign the head to point to this index - head = i; - ++num; - } - - /** - Insert a new element at the end of the queue. - */ - inline void pushBack(const T& e) { - reserveSpace(); - - // Get the index of 1+tail - int i = index(num); - - // Initialize that element - new (data + i)T(e); - ++num; - } - - /** - pushBack - */ - inline void enqueue(const T& e) { - pushBack(e); - } - - - /** - Remove the last element from the queue. The queue will never - shrink in size. (A typical queue only uses popFront). - */ - inline T popBack() { - int tail = index(num - 1); - T result(data[tail]); - - // Call the destructor - (data + tail)->~T(); - --num; - - return result; - } - - /** - Remove the next element from the head of the queue. The queue will never - shrink in size. */ - inline T popFront() { - T result(data[head]); - // Call the destructor - (data + head)->~T(); - head = (head + 1) % numAllocated; - --num; - return result; - } - - - /** - popFront - */ - inline T dequeue() { - return popFront(); - } - - /** - Removes all elements (invoking their destructors). - - @param freeStorage If false, the underlying array is not deallocated - (allowing fast push in the future), however, the size of the Queue - is reported as zero. - - */ - void clear(bool freeStorage = true) { - - FIND_ENDS; - - // Invoke the destructors on the elements - int i; - for (i = head; i < firstEnd; ++i) { - (data + i)->~T(); - } - - for (i = 0; i < secondEnd; ++i) { - (data + i)->~T(); - } - - num = 0; - head = 0; - if (freeStorage) { - numAllocated = 0; - System::free(data); - data = NULL; - } - } - - /** Clear without freeing the underlying array. */ - void fastClear() { - clear(false); - } - - /** - Assignment operator. - */ - Queue& operator=(const Queue& other) { - clear(); - _copy(other); - return *this; - } - - /** - Number of elements in the queue. - */ - inline int size() const { - return num; - } - - /** - Number of elements in the queue. - */ - inline int length() const { - return size(); - } - - /** - Performs bounds checks in debug mode - */ - inline T& operator[](int n) { - debugAssert((n >= 0) && (n < num)); - return data[index(n)]; - } - - /** - Performs bounds checks in debug mode - */ - inline const T& operator[](int n) const { - debugAssert((n >= 0) && (n < num)); - return data[index(n)]; - } - - - /** Returns the back element */ - inline const T& last() const { - return (*this)[size() - 1]; - } - - inline T& last() { - return (*this)[size() - 1]; - } - - /** - Returns true if the given element is in the queue. - */ - bool contains(const T& e) const { - for (int i = 0; i < size(); ++i) { - if ((*this)[i] == e) { - return true; - } - } - - return false; - } - - /** - Calls delete on all objects[0...size-1] - and sets the queue size to zero. - */ - void deleteAll() { - FIND_ENDS; - - int i; - for (i = 0; i < secondEnd; ++i) { - delete data[i]; - } - - for (i = head; i < firstEnd; ++i) { - delete data[i]; - } - clear(); - } -}; - -#undef FIND_ENDS - -}; // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/Random.h b/dep/include/g3dlite/G3D/Random.h deleted file mode 100644 index 54491d06f1b..00000000000 --- a/dep/include/g3dlite/G3D/Random.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - @file Random.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-01-02 - @edited 2009-03-20 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_Random_h -#define G3D_Random_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/GMutex.h" - -namespace G3D { - -/** Random number generator. - - Threadsafe. - - Useful for generating consistent random numbers across platforms - and when multiple threads are involved. - - Uses the Fast Mersenne Twister (FMT-19937) algorithm. - - On average, uniform() runs about 2x-3x faster than rand(). - - @cite http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html - - On OS X, Random is about 10x faster than drand48() (which is - threadsafe) and 4x faster than rand() (which is not threadsafe). - */ -class Random { -protected: - - /** Constants (important for the algorithm; do not modify) */ - enum { - N = 624, - M = 397, - R = 31, - U = 11, - S = 7, - T = 15, - L = 18, - A = 0x9908B0DF, - B = 0x9D2C5680, - C = 0xEFC60000}; - - /** - Prevents multiple overlapping calls to generate(). - */ - Spinlock lock; - - /** State vector (these are the next N values that will be returned) */ - uint32* state; - - /** Index into state */ - int index; - - bool m_threadsafe; - - /** Generate the next N ints, and store them for readback later. - Called from bits() */ - virtual void generate(); - - /** For subclasses. The void* parameter is just to distinguish this from the - public constructor.*/ - Random(void*); - -public: - - /** \param threadsafe Set to false if you know that this random - will only be used on a single thread. This eliminates the - lock and improves performance on some platforms. - */ - Random(uint32 seed = 0xF018A4D2, bool threadsafe = true); - - virtual ~Random(); - - /** Each bit is random. Subclasses can choose to override just - this method and the other methods will all work automatically. */ - virtual uint32 bits(); - - /** Uniform random integer on the range [min, max] */ - virtual int integer(int min, int max); - - /** Uniform random float on the range [min, max] */ - virtual inline float uniform(float low, float high) { - // We could compute the ratio in double precision here for - // about 1.5x slower performance and slightly better - // precision. - return low + (high - low) * ((float)bits() / (float)0xFFFFFFFFUL); - } - - /** Uniform random float on the range [0, 1] */ - virtual inline float uniform() { - // We could compute the ratio in double precision here for - // about 1.5x slower performance and slightly better - // precision. - const float norm = 1.0f / (float)0xFFFFFFFFUL; - return (float)bits() * norm; - } - - /** Normally distributed reals. */ - virtual float gaussian(float mean, float stdev); - - /** Returns 3D unit vectors distributed according to - a cosine distribution about the z-axis. */ - virtual void cosHemi(float& x, float& y, float& z); - - /** Returns 3D unit vectors distributed according to a cosine - power distribution (\f$ \cos^k \theta \f$) about - the z-axis. */ - virtual void cosPowHemi(const float k, float& x, float& y, float& z); - - /** Returns 3D unit vectors uniformly distributed on the - hemisphere about the z-axis. */ - virtual void hemi(float& x, float& y, float& z); - - /** Returns 3D unit vectors uniformly distributed on the sphere */ - virtual void sphere(float& x, float& y, float& z); - - /** - A shared instance for when the performance and features but not - consistency of the class are desired. It is slightly (10%) - faster to use a distinct instance than to use the common one. - - Threadsafe. - */ - static Random& common(); -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Ray.h b/dep/include/g3dlite/G3D/Ray.h deleted file mode 100644 index 80df5828aff..00000000000 --- a/dep/include/g3dlite/G3D/Ray.h +++ /dev/null @@ -1,371 +0,0 @@ -/** - @file Ray.h - - Ray class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-07-12 - @edited 2009-06-29 - */ - -#ifndef G3D_Ray_h -#define G3D_Ray_h - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Triangle.h" - -namespace G3D { - -/** - A 3D Ray. - */ -class Ray { -private: - friend class Intersect; - - Vector3 m_origin; - - /** Unit length */ - Vector3 m_direction; - - /** 1.0 / direction */ - Vector3 m_invDirection; - - - // The following are for the "ray slope" optimization from - // "Fast Ray / Axis-Aligned Bounding Box Overlap Tests using Ray Slopes" - // by Martin Eisemann, Thorsten Grosch, Stefan Müller and Marcus Magnor - // Computer Graphics Lab, TU Braunschweig, Germany and - // University of Koblenz-Landau, Germany*/ - enum Classification {MMM, MMP, MPM, MPP, PMM, PMP, PPM, PPP, POO, MOO, OPO, OMO, OOP, OOM, OMM, OMP, OPM, OPP, MOM, MOP, POM, POP, MMO, MPO, PMO, PPO}; Classification classification; - // ray slope - float ibyj, jbyi, kbyj, jbyk, ibyk, kbyi; - // Precomputed components - float c_xy, c_xz, c_yx, c_yz, c_zx, c_zy; - -public: - - void set(const Vector3& origin, const Vector3& direction); - - inline const Vector3& origin() const { - return m_origin; - } - - /** Unit direction vector. */ - inline const Vector3& direction() const { - return m_direction; - } - - /** Component-wise inverse of direction vector. May have inf() components */ - inline const Vector3& invDirection() const { - return m_invDirection; - } - - inline Ray() { - set(Vector3::zero(), Vector3::unitX()); - } - - inline Ray(const Vector3& origin, const Vector3& direction) { - set(origin, direction); - } - - Ray(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** - Creates a Ray from a origin and a (nonzero) unit direction. - */ - static Ray fromOriginAndDirection(const Vector3& point, const Vector3& direction) { - return Ray(point, direction); - } - - /** Advances the origin along the direction by @a distance */ - inline Ray bump(float distance) const { - return Ray(m_origin + m_direction * distance, m_direction); - } - - /** Advances the origin along the @a bumpDirection by @a distance and returns the new ray*/ - inline Ray bump(float distance, const Vector3& bumpDirection) const { - return Ray(m_origin + bumpDirection * distance, m_direction); - } - - /** - Returns the closest point on the Ray to point. - */ - Vector3 closestPoint(const Vector3& point) const { - float t = m_direction.dot(point - m_origin); - if (t < 0) { - return m_origin; - } else { - return m_origin + m_direction * t; - } - } - - /** - Returns the closest distance between point and the Ray - */ - float distance(const Vector3& point) const { - return (closestPoint(point) - point).magnitude(); - } - - /** - Returns the point where the Ray and plane intersect. If there - is no intersection, returns a point at infinity. - - Planes are considered one-sided, so the ray will not intersect - a plane where the normal faces in the traveling direction. - */ - Vector3 intersection(const class Plane& plane) const; - - /** - Returns the distance until intersection with the sphere or the (solid) ball bounded by the sphere. - Will be 0 if inside the sphere, inf if there is no intersection. - - The ray direction is not normalized. If the ray direction - has unit length, the distance from the origin to intersection - is equal to the time. If the direction does not have unit length, - the distance = time * direction.length(). - - See also the G3D::CollisionDetection "movingPoint" methods, - which give more information about the intersection. - - \param solid If true, rays inside the sphere immediately intersect (good for collision detection). If false, they hit the opposite side of the sphere (good for ray tracing). - */ - float intersectionTime(const class Sphere& sphere, bool solid = false) const; - - float intersectionTime(const class Plane& plane) const; - - float intersectionTime(const class Box& box) const; - - float intersectionTime(const class AABox& box) const; - - /** - The three extra arguments are the weights of vertices 0, 1, and 2 - at the intersection point; they are useful for texture mapping - and interpolated normals. - */ - float intersectionTime( - const Vector3& v0, const Vector3& v1, const Vector3& v2, - const Vector3& edge01, const Vector3& edge02, - double& w0, double& w1, double& w2) const; - - /** - Ray-triangle intersection for a 1-sided triangle. Fastest version. - @cite http://www.acm.org/jgt/papers/MollerTrumbore97/ - http://www.graphics.cornell.edu/pubs/1997/MT97.html - */ - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge01, - const Vector3& edge02) const; - - - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2) const { - - return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0); - } - - - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - double& w0, - double& w1, - double& w2) const { - - return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0, w0, w1, w2); - } - - /* One-sided triangle - */ - inline float intersectionTime(const Triangle& triangle) const { - return intersectionTime( - triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), - triangle.edge01(), triangle.edge02()); - } - - inline float intersectionTime( - const Triangle& triangle, - double& w0, - double& w1, - double& w2) const { - return intersectionTime(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), - triangle.edge01(), triangle.edge02(), w0, w1, w2); - } - - /** Refracts about the normal - using G3D::Vector3::refractionDirection - and bumps the ray slightly from the newOrigin. */ - Ray refract( - const Vector3& newOrigin, - const Vector3& normal, - float iInside, - float iOutside) const; - - /** Reflects about the normal - using G3D::Vector3::reflectionDirection - and bumps the ray slightly from - the newOrigin. */ - Ray reflect( - const Vector3& newOrigin, - const Vector3& normal) const; -}; - - -#define EPSILON 0.000001 -#define CROSS(dest,v1,v2) \ - dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \ - dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \ - dest[2]=v1[0]*v2[1]-v1[1]*v2[0]; - -#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) - -#define SUB(dest,v1,v2) \ - dest[0]=v1[0]-v2[0]; \ - dest[1]=v1[1]-v2[1]; \ - dest[2]=v1[2]-v2[2]; - -inline float Ray::intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge1, - const Vector3& edge2) const { - - (void)vert1; - (void)vert2; - - // Barycenteric coords - float u, v; - - float tvec[3], pvec[3], qvec[3]; - - // begin calculating determinant - also used to calculate U parameter - CROSS(pvec, m_direction, edge2); - - // if determinant is near zero, ray lies in plane of triangle - const float det = DOT(edge1, pvec); - - if (det < EPSILON) { - return finf(); - } - - // calculate distance from vert0 to ray origin - SUB(tvec, m_origin, vert0); - - // calculate U parameter and test bounds - u = DOT(tvec, pvec); - if ((u < 0.0f) || (u > det)) { - // Hit the plane outside the triangle - return finf(); - } - - // prepare to test V parameter - CROSS(qvec, tvec, edge1); - - // calculate V parameter and test bounds - v = DOT(m_direction, qvec); - if ((v < 0.0f) || (u + v > det)) { - // Hit the plane outside the triangle - return finf(); - } - - - // Case where we don't need correct (u, v): - const float t = DOT(edge2, qvec); - - if (t >= 0.0f) { - // Note that det must be positive - return t / det; - } else { - // We had to travel backwards in time to intersect - return finf(); - } -} - - -inline float Ray::intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge1, - const Vector3& edge2, - double& w0, - double& w1, - double& w2) const { - - (void)vert1; - (void)vert2; - - // Barycenteric coords - float u, v; - - float tvec[3], pvec[3], qvec[3]; - - // begin calculating determinant - also used to calculate U parameter - CROSS(pvec, m_direction, edge2); - - // if determinant is near zero, ray lies in plane of triangle - const float det = DOT(edge1, pvec); - - if (det < EPSILON) { - return finf(); - } - - // calculate distance from vert0 to ray origin - SUB(tvec, m_origin, vert0); - - // calculate U parameter and test bounds - u = DOT(tvec, pvec); - if ((u < 0.0f) || (u > det)) { - // Hit the plane outside the triangle - return finf(); - } - - // prepare to test V parameter - CROSS(qvec, tvec, edge1); - - // calculate V parameter and test bounds - v = DOT(m_direction, qvec); - if ((v < 0.0f) || (u + v > det)) { - // Hit the plane outside the triangle - return finf(); - } - - float t = DOT(edge2, qvec); - - if (t >= 0) { - const float inv_det = 1.0f / det; - t *= inv_det; - u *= inv_det; - v *= inv_det; - - w0 = (1.0f - u - v); - w1 = u; - w2 = v; - - return t; - } else { - // We had to travel backwards in time to intersect - return finf(); - } -} - -#undef EPSILON -#undef CROSS -#undef DOT -#undef SUB - -}// namespace - -#endif diff --git a/dep/include/g3dlite/G3D/Rect2D.h b/dep/include/g3dlite/G3D/Rect2D.h deleted file mode 100644 index 2fb58c50465..00000000000 --- a/dep/include/g3dlite/G3D/Rect2D.h +++ /dev/null @@ -1,417 +0,0 @@ -/** - @file Rect2D.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-11-13 - @created 2009-11-16 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Rect2D_h -#define G3D_Rect2D_h - -// Linux defines this as a macro -#ifdef border -#undef border -#endif - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector2.h" - -#ifdef _MSC_VER -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) -#endif - - -namespace G3D { - -class Any; - -/** - If you are using this class for pixel rectangles, keep in mind that the last - pixel you can draw to is at x0() + width() - 1. - */ -class Rect2D { -private: - Vector2 min, max; - - /** - Returns true if the whole polygon is clipped. - @param p Value of the point - @param axis Index [0 or 1] of the axis to clip along? - @param clipGreater Are we clipping greater than or less than the line? - @param inPoly Polygon being clipped - @param outPoly The clipped polygon - */ - template - static bool clipSide2D( - const float p, bool clipGreater, int axis, - const Array& inPoly, Array& outPoly) { - - outPoly.clear(); - int i0 = -1; - - Vector2 pt1; - bool c1 = true; - - float negate = clipGreater ? -1 : 1; - - // Find a point that is not clipped - for (i0 = 0; (i0 < inPoly.length()) && c1; ++i0) { - pt1 = inPoly[i0]; - c1 = (negate * pt1[axis]) < (negate * p); - } - - // We incremented i0 one time to many - --i0; - - if (c1) { - // We could not find an unclipped point - return true; - } - - outPoly.append(pt1); - - // for each point in inPoly, - // if the point is outside the side and the previous one was also outside, continue - // if the point is outside the side and the previous one was inside, cut the line - // if the point is inside the side and the previous one was also inside, append the points - // if the point is inside the side and the previous one was outside, cut the line - for (int i = 1; i <= inPoly.length(); ++i) { - T pt2 = inPoly[(i + i0) % inPoly.length()]; - bool c2 = (negate * pt2[axis]) < (negate * p); - - if (c1 ^ c2) { - - if (!c1 && c2 && (i > 1)) { - // Unclipped to clipped trasition and not the first iteration - outPoly.append(pt1); - } - - // only one point is clipped, find where the line crosses the clipping plane - - - float alpha; - if (pt2[axis] == pt1[axis]) { - alpha = 0; - } else { - alpha = (p - pt1[axis]) / (pt2[axis] - pt1[axis]); - } - outPoly.append(pt1.lerp(pt2, alpha)); - } else if (! (c1 || c2) && (i != 1)) { - // neither point is clipped (don't do this the first time - // because we appended the first pt before the loop) - outPoly.append(pt1); - } - - pt1 = pt2; - c1 = c2; - } - - return false; - } - -public: - - /** \param any Must either Rect2D::xywh(#, #, #, #) or Rect2D::xyxy(#, #, #, #)*/ - Rect2D(const Any& any); - - /** Converts the Rect2D to an Any. */ - operator Any() const; - - Rect2D() : min(0, 0), max(0, 0) {} - - /** Creates a rectangle at 0,0 with the given width and height*/ - Rect2D(const Vector2& wh) : min(0, 0), max(wh.x, wh.y) {} - - /** Computes a rectangle that contains both @a a and @a b. - Note that even if @a or @b has zero area, its origin will be included.*/ - Rect2D(const Rect2D& a, const Rect2D& b) { - min = a.min.min(b.min); - max = a.max.max(b.max); - } - - /** @brief Uniformly random point on the interior */ - Vector2 randomPoint() const { - return Vector2(uniformRandom(0, max.x - min.x) + min.x, - uniformRandom(0, max.y - min.y) + min.y); - } - - float width() const { - return max.x - min.x; - } - - float height() const { - return max.y - min.y; - } - - float x0() const { - return min.x; - } - - float x1() const { - return max.x; - } - - float y0() const { - return min.y; - } - - float y1() const { - return max.y; - } - - /** Min, min corner */ - Vector2 x0y0() const { - return min; - } - - Vector2 x1y0() const { - return Vector2(max.x, min.y); - } - - Vector2 x0y1() const { - return Vector2(min.x, max.y); - } - - /** Max,max corner */ - Vector2 x1y1() const { - return max; - } - - /** Width and height */ - Vector2 wh() const { - return max - min; - } - - Vector2 center() const { - return (max + min) * 0.5; - } - - float area() const { - return width() * height(); - } - - bool isFinite() const { - return (min.isFinite() && max.isFinite()); - } - - Rect2D lerp(const Rect2D& other, float alpha) const { - Rect2D out; - - out.min = min.lerp(other.min, alpha); - out.max = max.lerp(other.max, alpha); - - return out; - } - - static Rect2D xyxy(float x0, float y0, float x1, float y1) { - Rect2D r; - - r.min.x = G3D::min(x0, x1); - r.min.y = G3D::min(y0, y1); - r.max.x = G3D::max(x0, x1); - r.max.y = G3D::max(y0, y1); - - return r; - } - - static Rect2D xyxy(const Vector2& v0, const Vector2& v1) { - Rect2D r; - - r.min = v0.min(v1); - r.max = v0.max(v1); - - return r; - } - - static Rect2D xywh(float x, float y, float w, float h) { - return xyxy(x, y, x + w, y + h); - } - - static Rect2D xywh(const Vector2& v, const Vector2& w) { - return xyxy(v.x, v.y, v.x + w.x, v.y + w.y); - } - - /** Constructs a Rect2D with infinite boundaries. - Use isFinite() to test either min or max. - */ - static Rect2D inf() { - return xyxy(Vector2::inf(), Vector2::inf()); - } - - bool contains(const Vector2& v) const { - return (v.x >= min.x) && (v.y >= min.y) && (v.x <= max.x) && (v.y <= max.y); - } - - bool contains(const Rect2D& r) const { - return (min.x <= r.min.x) && (min.y <= r.min.y) && - (max.x >= r.max.x) && (max.y >= r.max.y); - } - - /** True if there is non-zero area to the intersection between @a this and @a r. - Note that two rectangles that are adjacent do not intersect because there is - zero area to the overlap, even though one of them "contains" the corners of the other.*/ - bool intersects(const Rect2D& r) const { - return (min.x < r.max.x) && (min.y < r.max.y) && - (max.x > r.min.x) && (max.y > r.min.y); - } - - /** Like intersection, but counts the adjacent case as touching. */ - bool intersectsOrTouches(const Rect2D& r) const { - return (min.x <= r.max.x) && (min.y <= r.max.y) && - (max.x >= r.min.x) && (max.y >= r.min.y); - } - - Rect2D operator*(float s) const { - return xyxy(min.x * s, min.y * s, max.x * s, max.y * s); - } - - Rect2D operator/(float s) const { - return xyxy(min / s, max / s); - } - - Rect2D operator/(const Vector2& s) const { - return xyxy(min / s, max / s); - } - - Rect2D operator+(const Vector2& v) const { - return xyxy(min + v, max + v); - } - - Rect2D operator-(const Vector2& v) const { - return xyxy(min - v, max - v); - } - - bool operator==(const Rect2D& other) const { - return (min == other.min) && (max == other.max); - } - - bool operator!=(const Rect2D& other) const { - return (min != other.min) || (max != other.max); - } - - /** Returns the corners in the order: (min,min), (max,min), (max,max), (min,max). */ - Vector2 corner(int i) const { - debugAssert(i >= 0 && i < 4); - switch (i & 3) { - case 0: - return Vector2(min.x, min.y); - case 1: - return Vector2(max.x, min.y); - case 2: - return Vector2(max.x, max.y); - case 3: - return Vector2(min.x, max.y); - default: - // Should never get here - return Vector2(0, 0); - } - } - - - /** @deprecated - @sa expand() */ - Rect2D border(float delta) const { - return Rect2D::xywh(x0() + delta, - y0() + delta, - width() - 2.0f * delta, - height() - 2.0f * delta); - } - - /** Returns a new Rect2D that is bigger/smaller by the specified amount - (negative is shrink.) */ - Rect2D expand(float delta) const { - float newX = x0() - delta; - float newY = y0() - delta; - float newW = width() + 2.0f * delta; - float newH = height() + 2.0f * delta; - - if (newW < 0.0f) { - newX = (x0() + width()) / 2.0f; - newW = 0.0f; - } - - if (newH < 0.0f) { - newY = (y0() + height()) / 2.0f; - newH = 0.0f; - } - return Rect2D::xywh(newX, newY, newW, newH); - } - - /** - Clips so that the rightmost point of the outPoly is at rect.x1 (e.g. a 800x600 window produces - rightmost point 799, not 800). The results are suitable for pixel rendering if iRounded. - Templated so that it will work for Vector2,3,4 (the z and w components are interpolated linearly). - The template parameter must define T.lerp and contain x and y components. - - If the entire polygon is clipped by a single side, the result will be empty. - The result might also have zero area but not be empty. - */ - template - void clip(const Array& inPoly, Array& outPoly) const { - - const bool greaterThan = true; - const bool lessThan = false; - const int X = 0; - const int Y = 1; - - Array temp; - - bool entirelyClipped = - clipSide2D(x0(), lessThan, X, inPoly, temp) || - clipSide2D(x1(), greaterThan, X, temp, outPoly) || - clipSide2D(y0(), lessThan, Y, outPoly, temp) || - clipSide2D(y1(), greaterThan, Y, temp, outPoly); - - if (entirelyClipped) { - outPoly.clear(); - } - } - - - /** Returns the largest, centered Rect2D that can fit inside this - while maintaining the aspect ratio of x:y. Convenient for - displaying images in odd-shaped windows. - */ - Rect2D largestCenteredSubRect(float ww, float hh) const { - float textureAspect = hh / ww; - float viewAspect = height() / width(); - - if (viewAspect > textureAspect) { - // The view is too tall - float h = width() * textureAspect; - float y = (height() - h) / 2; - return Rect2D::xywh(0, y, width(), h) + corner(0); - } else { - // The view is too wide - float w = height() / textureAspect; - float x = (width() - w) / 2; - return Rect2D::xywh(x, 0, w, height()) + corner(0); - } - } - - /** - Returns the overlap region between the two rectangles. This may have zero area - if they do not intersect. See the two-Rect2D constructor for a way to compute - a union-like rectangle. - */ - Rect2D intersect(const Rect2D& other) const { - if (intersects(other)) { - return Rect2D::xyxy(min.max(other.min), max.min(other.max)); - }else{ - return Rect2D::xywh(0, 0, 0, 0); - } - } -}; - -typedef Rect2D AABox2D; -} - -#endif diff --git a/dep/include/g3dlite/G3D/ReferenceCount.h b/dep/include/g3dlite/G3D/ReferenceCount.h deleted file mode 100644 index 84591c6d8e5..00000000000 --- a/dep/include/g3dlite/G3D/ReferenceCount.h +++ /dev/null @@ -1,570 +0,0 @@ -/** - @file ReferenceCount.h - - Reference Counting Garbage Collector for C++ - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite Adapted and extended from Justin Miller's "RGC" class that appeared in BYTE magazine. - @cite See also http://www.jelovic.com/articles/cpp_without_memory_errors_slides.htm - - @created 2001-10-23 - @edited 2009-04-25 -*/ -#ifndef G3D_ReferenceCount_h -#define G3D_ReferenceCount_h - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/AtomicInt32.h" - -namespace G3D { - -#ifdef _MSC_VER -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) -#endif - -/** Base class for WeakReferenceCountedPointer */ -class _WeakPtr { -public: - inline virtual ~_WeakPtr() {} - -protected: - friend class ReferenceCountedObject; - - /** Called by ReferenceCountedObject to tell a weak pointer that its underlying object was collected. */ - virtual void objectCollected() = 0; -}; - -/** Used internally by ReferenceCountedObject */ -class _WeakPtrLinkedList { -public: - _WeakPtr* weakPtr; - _WeakPtrLinkedList* next; - - inline _WeakPtrLinkedList() : weakPtr(NULL), next(NULL) {} - - /** Inserts this node into the head of the list that previously had n as its head. */ - inline _WeakPtrLinkedList(_WeakPtr* p, _WeakPtrLinkedList* n) : weakPtr(p), next(n) {} -}; - -/** - Objects that are reference counted inherit from this. Subclasses - must have a public destructor (the default destructor is fine) - and publicly inherit ReferenceCountedObject. - - Multiple inheritance from a reference counted object is dangerous-- use - at your own risk. - - ReferenceCountedPointer and ReferenceCountedObject are threadsafe. - You can create and drop references on multiple threads without - violating integrity. WeakReferenceCountedPointer is not - threadsafe. Introducing a weak pointer destroys all thread safety, - even for strong pointers to the same object (this is inherent in the - design of the class; we cannot fix it without slowing down the - performance of reference counted objects.) - - Usage Example - -
-
-class Foo : public G3D::ReferenceCountedObject {
-public:
-    int x;
-};
-
-class Bar : public Foo {};
-
-typedef G3D::ReferenceCountedPointer FooRef;
-typedef G3D::WeakReferenceCountedPointer WeakFooRef;
-typedef G3D::ReferenceCountedPointer BarRef;
-
-
-int main(int argc, char *argv[]) {
-
-    WeakFooRef x;
-
-    {
-        FooRef a = new Foo();
-
-        // Reference count == 1
-
-        x = a;
-        // Weak references do not increase count
-
-        {
-            FooRef b = a;
-            // Reference count == 2
-        }
-
-        // Reference count == 1
-    }
-    // No more strong references; object automatically deleted.
-    // x is set to NULL automatically.
-
-    // Example of using dynamic cast on reference counted objects
-    BarRef b = new Bar();
-
-    // No cast needed to go down the heirarchy.
-    FooRef f = b;
-
-    // We can't cast the reference object because it is a class.
-    // Instead we must extract the pointer and cast that:
-    b = dynamic_cast(&*f);
-
-    return 0;
-}
-
- */ -class ReferenceCountedObject { -public: - - /** - The long name is to keep this from accidentally conflicting with - a subclass's variable name. Do not use or explicitly manipulate - this value--its type may change in the future and is not part - of the supported API. - */ - AtomicInt32 ReferenceCountedObject_refCount; - - /** - Linked list of all weak pointers that reference this (some may be - on the stack!). Do not use or explicitly manipulate this value. - */ - _WeakPtrLinkedList* ReferenceCountedObject_weakPointer; - -protected: - - ReferenceCountedObject(); - -public: - - /** Automatically called immediately before the object is deleted. - This is not called from the destructor because it needs to be invoked - before the subclass destructor. - */ - void ReferenceCountedObject_zeroWeakPointers(); - - virtual ~ReferenceCountedObject(); - - - /** - Note: copies will initially start out with 0 - references and 0 weak references like any other object. - */ - ReferenceCountedObject(const ReferenceCountedObject& notUsed); - - ReferenceCountedObject& operator=(const ReferenceCountedObject& other); -}; - - - -/** - Use ReferenceCountedPointer in place of T* in your program. - T must subclass ReferenceCountedObject. -@deprecated To be replaced by boost::shared_ptr in 7.0 - */ -template -class ReferenceCountedPointer { -private: - - T* m_pointer; - -public: - typedef T element_type; - - inline T* pointer() const { - return m_pointer; - } - -private: - - /** Nulls out the pointer and drops a reference. If the reference - count hits zero. */ - void zeroPointer() { - if (m_pointer != NULL) { - - ReferenceCountedObject* pointer = ((ReferenceCountedObject*)m_pointer); - debugAssert(G3D::isValidHeapPointer(m_pointer)); - debugAssertM(pointer->ReferenceCountedObject_refCount.value() > 0, - "Dangling reference detected."); - - // Only delete if this instance caused the count to hit - // exactly zero. If there is a race condition, the value - // may be zero after decrement returns, but only one of - // the instances will get a zero return value. - if (pointer->ReferenceCountedObject_refCount.decrement() == 0) { - // We held the last reference, so delete the object. - // This test is threadsafe because there is no way for - // the reference count to increase after the last - // reference was dropped (assuming the application does - // not voilate the class abstraction). - //debugPrintf(" delete 0x%x\n", m_pointer); - - // We must zero the weak pointers *before* deletion in case there - // are cycles of weak references. - // Note that since there are no strong references at this point, - // it is perfectly fair to zero the weak pointers anyway. - pointer->ReferenceCountedObject_zeroWeakPointers(); - delete pointer; - } - - m_pointer = NULL; - } - } - - /** Non-atomic (except for the referencec increment). Can only be - called in contexts like the copy constructor or initial - constructor where it is known that the reference count will - not hit zero on some other thread. */ - void setPointer(T* x) { - if (x != m_pointer) { - zeroPointer(); - - if (x != NULL) { - debugAssert(G3D::isValidHeapPointer(x)); - - m_pointer = x; - - // Note that the ref count can be zero if this is the - // first pointer to it - ReferenceCountedObject* pointer = (ReferenceCountedObject*)m_pointer; - debugAssertM(pointer->ReferenceCountedObject_refCount.value() >= 0, - "Negative reference count detected."); - pointer->ReferenceCountedObject_refCount.increment(); - } - } - } - -public: - - inline ReferenceCountedPointer() : m_pointer(NULL) {} - - /** - Allow silent cast to the base class. - -
-        SubRef  s = new Sub();
-        BaseRef b = s;
-      
- - i.e., compile-time subtyping rule - RCP<T> <: RCP<S> if T <: S - */ - template - inline ReferenceCountedPointer(const ReferenceCountedPointer& p) : - m_pointer(NULL) { - setPointer(p.pointer()); - } - -# if (! defined(MSC_VER) || (MSC_VER >= 1300)) - /** - Explicit cast to a subclass. Acts like dynamic cast; the result will be NULL if - the cast cannot succeed. Not supported on VC6. -
-        SubRef  s = new Sub();
-        BaseRef b = s;
-        s = b.downcast();   // Note that the template argument is the object type, not the pointer type.
-      
- */ - template - ReferenceCountedPointer downcast() { - return ReferenceCountedPointer(dynamic_cast(m_pointer)); - } - - template - const ReferenceCountedPointer downcast() const { - return ReferenceCountedPointer(dynamic_cast(m_pointer)); - } -# endif - - // We need an explicit version of the copy constructor as well or - // the default copy constructor will be used. - inline ReferenceCountedPointer(const ReferenceCountedPointer& p) : m_pointer(NULL) { - setPointer(p.m_pointer); - } - - /** Allows construction from a raw pointer. That object will thereafter be - reference counted -- do not call delete on it. - - Use of const allows downcast on const references */ - inline ReferenceCountedPointer(const T* p) : m_pointer(NULL) { - // only const constructor is defined to remove ambiguity using NULL - setPointer(const_cast(p)); - } - - - inline ~ReferenceCountedPointer() { - zeroPointer(); - } - - inline size_t hashCode() const { - return reinterpret_cast(m_pointer);; - } - - inline const ReferenceCountedPointer& operator=(const ReferenceCountedPointer& p) { - setPointer(p.m_pointer); - return *this; - } - - inline ReferenceCountedPointer& operator=(T* p) { - setPointer(p); - return *this; - } - - inline bool operator==(const ReferenceCountedPointer& y) const { - return (m_pointer == y.m_pointer); - } - - inline bool operator!=(const ReferenceCountedPointer& y) const { - return (m_pointer != y.m_pointer); - } - - bool operator < (const ReferenceCountedPointer& y) const { - return (m_pointer < y.m_pointer); - } - - bool operator > (const ReferenceCountedPointer& y) const { - return (m_pointer > y.m_pointer); - } - - bool operator <= (const ReferenceCountedPointer& y) const { - return (m_pointer <= y.m_pointer); - } - - bool operator >= (const ReferenceCountedPointer& y) const { - return (m_pointer >= y.m_pointer); - } - - inline T& operator*() const { - debugAssertM(m_pointer != NULL, "Dereferenced a NULL ReferenceCountedPointer"); - return (*m_pointer); - } - - inline T* operator->() const { - debugAssertM(m_pointer != NULL, "Dereferenced a NULL ReferenceCountedPointer"); - return m_pointer; - } - - inline bool isNull() const { - return (m_pointer == NULL); - } - - inline bool notNull() const { - return (m_pointer != NULL); - } - - // TODO: distinguish between last strong and last any pointer - /** - Returns true if this is the last reference to an object. - Useful for flushing memoization caches-- a cache that holds the last - reference is unnecessarily keeping an object alive. - - Not threadsafe. - - @deprecated Use WeakReferenceCountedPointer for caches - */ - inline int isLastReference() const { - return (m_pointer->ReferenceCountedObject_refCount.value() == 1); - } -}; - - -/** - A weak pointer allows the object it references to be garbage collected. - Weak pointers are commonly used in caches, where it is important to hold - a pointer to an object without keeping that object alive solely for the - cache's benefit (i.e., the object can be collected as soon as all - pointers to it outside the cache are gone). They are also convenient - for adding back-pointers in tree and list structures. - - Weak pointers may become NULL at any point (when their target is collected). - Therefore the only way to reference the target is to convert to a strong - pointer and then check that it is not NULL. - -@deprecated To be replaced by boost::weak_ptr in 7.0 - */ -template -class WeakReferenceCountedPointer : public _WeakPtr { -private: - - /** NULL if the object has been collected. */ - T* pointer; - -public: - /** - Creates a strong pointer, which prevents the object from being - garbage collected. The strong pointer may be NULL, which means - that the underlying. - */ - // There is intentionally no way to check if the - // WeakReferenceCountedPointer has a null reference without - // creating a strong pointer since there is no safe way to use - // that information-- the pointer could be collected by a - // subsequent statement. - ReferenceCountedPointer createStrongPtr() const { - // TODO: What if the object's destructor is called while we - // are in this method? - return ReferenceCountedPointer(pointer); - } - -private: - - /** Thread issues: safe because this is only called when another - object is guaranteed to keep p alive for the duration of this - call. */ - void setPointer(T* p) { - // TODO: must prevent the object from being collected while in - // this method - - zeroPointer(); - pointer = p; - - if (pointer != NULL) { - // TODO: threadsafe: must update the list atomically - - // Add myself to the head of my target's list of weak pointers - _WeakPtrLinkedList* head = - new _WeakPtrLinkedList - (this, - pointer->ReferenceCountedObject_weakPointer); - - pointer->ReferenceCountedObject_weakPointer = head; - } else { - - } - } - - - /** - Removes this from its target's list of weak pointers. Called - when the weak pointer goes out of scope. - - Thread issues: depends on the thread safety of createStrongPtr. - */ - void zeroPointer() { - // Grab a strong reference to prevent the object from being collected while we - // are traversing its list. - ReferenceCountedPointer strong = createStrongPtr(); - - // If the following test fails then the object was collected before we - // reached it. - if (strong.notNull()) { - debugAssertM(((ReferenceCountedObject*)pointer)->ReferenceCountedObject_weakPointer != NULL, - "Weak pointer exists without a backpointer from the object."); - - // Remove myself from my target's list of weak pointers - _WeakPtrLinkedList** node = &((ReferenceCountedObject*)pointer)->ReferenceCountedObject_weakPointer; - while ((*node)->weakPtr != this) { - node = &((*node)->next); - debugAssertM(*node != NULL, - "Weak pointer exists without a backpointer from the object (2)."); - } - - // Node must now point at the node for me. Remove node and - // close the linked list behind it. - _WeakPtrLinkedList* temp = *node; - *node = temp->next; - - // Now delete the node corresponding to me - delete temp; - } - - pointer = NULL; - } - -public: - - WeakReferenceCountedPointer() : pointer(0) {} - - /** - Allow compile time subtyping rule - RCP<T> <: RCP<S> if T <: S - */ - template - inline WeakReferenceCountedPointer(const WeakReferenceCountedPointer& p) : pointer(0) { - // Threadsafe: the object cannot be collected while the other pointer exists. - setPointer(p.pointer); - } - - template - inline WeakReferenceCountedPointer(const ReferenceCountedPointer& p) : pointer(0) { - // Threadsafe: the object cannot be collected while the other - // pointer exists. - setPointer(p.pointer()); - } - - // Gets called a *lot* when weak pointers are on the stack - WeakReferenceCountedPointer( - const WeakReferenceCountedPointer& weakPtr) : pointer(0) { - setPointer(weakPtr.pointer); - } - - WeakReferenceCountedPointer( - const ReferenceCountedPointer& strongPtr) : pointer(0) { - setPointer(strongPtr.pointer()); - } - - ~WeakReferenceCountedPointer() { - zeroPointer(); - } - - WeakReferenceCountedPointer& operator=(const WeakReferenceCountedPointer& other) { - // Threadsafe: the object cannot be collected while the other pointer exists. - - // I now point at other's target - setPointer(other.pointer); - - return *this; - } - - WeakReferenceCountedPointer& operator=(const ReferenceCountedPointer& other) { - - // Threadsafe: the object cannot be collected while the other pointer exists. - - // I now point at other's target - setPointer(other.pointer()); - - return *this; - } - - bool operator==(const WeakReferenceCountedPointer& other) const { - return pointer == other.pointer; - } - - bool operator!=(const WeakReferenceCountedPointer& other) const { - return pointer != other.pointer; - } - - bool operator < (const WeakReferenceCountedPointer& y) const { - return (pointer < y.pointer); - } - - bool operator > (const WeakReferenceCountedPointer& y) const { - return (pointer > y.pointer); - } - - bool operator <= (const WeakReferenceCountedPointer& y) const { - return (pointer <= y.pointer); - } - - bool operator >= (const ReferenceCountedPointer& y) const { - return (pointer >= y.pointer); - } - -protected: - - /** Invoked by the destructor on ReferenceCountedPointer. */ - void objectCollected() { - debugAssertM(pointer != NULL, - "Removed a weak pointer twice."); - pointer = NULL; - } - -}; - -} // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/RegistryUtil.h b/dep/include/g3dlite/G3D/RegistryUtil.h deleted file mode 100644 index 4b47be5f4bd..00000000000 --- a/dep/include/g3dlite/G3D/RegistryUtil.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - @file RegistryUtil.h - - @created 2006-04-06 - @edited 2006-04-06 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_REGISTRYUTIL_H -#define G3D_REGISTRYUTIL_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -// This file is only used on Windows -#ifdef G3D_WIN32 - -#include - -namespace G3D { - -/** - Provides generalized Windows registry querying. - - All key names are one string in the format: - "[base key]\[sub-keys]" - - A value must now be provided for every query. - An empty value string will use the (Default) value. - - [base key] can be any of the following: - HKEY_CLASSES_ROOT - HKEY_CURRENT_CONFIG - HKEY_CURRENT_USER - HKEY_LOCAL_MACHINE - HKEY_PERFORMANCE_DATA - HKEY_PERFORMANCE_NLSTEXT - HKEY_PERFORMANCE_TEXT - HKEY_USERS - - valueExists() should be used to validate a key+value before reading or writing - to ensure that a debug assert or false return is for a different error during - reads and writes. - - All read and write calls will assert when a key will not open for reasons other - that it does not exist. All read and write calls will assert when the value cannot - be read or written for any reason. -*/ -class RegistryUtil { - -public: - /** returns true if the key exists and the current user has permission to read */ - static bool keyExists(const std::string& key); - - /** returns true if the key exists and the current user has permission to read */ - static bool valueExists(const std::string& key, const std::string& value); - - /** returns false if the key could not be read for any reason. */ - static bool readInt32(const std::string& key, const std::string& value, int32& data); - - /** - Reads an arbitrary amount of data from a binary registry key. - returns false if the key could not be read for any reason. - - @beta - @param data pointer to the output buffer of sufficient size. Pass NULL as data in order to have available data size returned in dataSize. - @param dataSize size of the output buffer. When NULL is passed for data, contains the size of available data on successful return. - */ - static bool readBytes(const std::string& key, const std::string& value, uint8* data, uint32& dataSize); - - /** returns false if the key could not be read for any reason. */ - static bool readString(const std::string& key, const std::string& value, std::string& data); - - /** returns false if the key could not be written for any reason. */ - static bool writeInt32(const std::string& key, const std::string& value, int32 data); - - /** - Writes an arbitrary amount of data to a binary registry key. - returns false if the key could not be written for any reason. - - @param data pointer to the input buffer - @param dataSize size of the input buffer that should be written - */ - static bool writeBytes(const std::string& key, const std::string& value, const uint8* data, uint32 dataSize); - - /** returns false if the key could not be written for any reason. */ - static bool writeString(const std::string& key, const std::string& value, const std::string& data); - -}; - -} // namespace G3D - -#endif // G3D_WIN32 - -#endif // G3D_REGISTRYTUIL_H diff --git a/dep/include/g3dlite/G3D/Set.h b/dep/include/g3dlite/G3D/Set.h deleted file mode 100644 index 9a8e1b619bb..00000000000 --- a/dep/include/g3dlite/G3D/Set.h +++ /dev/null @@ -1,186 +0,0 @@ -/** - @file Set.h - - Hash set - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-12-09 - @edited 2009-06-10 - */ - -#ifndef G3D_Set_h -#define G3D_Set_h - -#include "G3D/platform.h" -#include "G3D/Table.h" -#include "G3D/MemoryManager.h" -#include -#include - -namespace G3D { - -/** - An unordered data structure that has at most one of each element. - Provides O(1) time insert, remove, and member test (contains). - - Set uses G3D::Table internally, which means that the template type T - must define a hashCode and operator== function. See G3D::Table for - a discussion of these functions. - */ -// There is not copy constructor or assignment operator defined because -// the default ones are correct for Set. -template, class EqualsFunc = EqualsTrait > -class Set { - - /** - If an object is a member, it is contained in - this table. - */ - Table memberTable; - -public: - - void clearAndSetMemoryManager(const MemoryManager::Ref& m) { - memberTable.clearAndSetMemoryManager(m); - } - - virtual ~Set() {} - - int size() const { - return (int)memberTable.size(); - } - - bool contains(const T& member) const { - return memberTable.containsKey(member); - } - - /** - Inserts into the table if not already present. - */ - void insert(const T& member) { - memberTable.set(member, true); - } - - /** - Returns true if the element was present and removed. Returns false - if the element was not present. - */ - bool remove(const T& member) { - return memberTable.remove(member); - } - - /** If @a member is present, sets @a removed to the element - being removed and returns true. Otherwise returns false - and does not write to @a removed. This is useful when building - efficient hashed data structures that wrap Set. - */ - bool getRemove(const T& member, T& removed) { - bool ignore; - return memberTable.getRemove(member, removed, ignore); - } - - /** If a value that is EqualsFunc to @a member is present, returns a pointer to the - version stored in the data structure, otherwise returns NULL. - */ - const T* getPointer(const T& member) const { - return memberTable.getKeyPointer(member); - } - - Array getMembers() const { - return memberTable.getKeys(); - } - - void getMembers(Array& keyArray) const { - memberTable.getKeys(keyArray); - } - - void clear() { - memberTable.clear(); - } - - void deleteAll() { - getMembers().deleteAll(); - clear(); - } - - /** - C++ STL style iterator variable. See begin(). - */ - class Iterator { - private: - friend class Set; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename Table::Iterator it; - - Iterator(const typename Table::Iterator& it) : it(it) {} - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool hasMore() const { - return it.hasMore(); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const T& operator*() const { - return it->key; - } - - T* operator->() const { - return &(it->key); - } - - operator T*() const { - return &(it->key); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element. - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - const Iterator end() const { - return Iterator(memberTable.end()); - } -}; - -} - -#endif - diff --git a/dep/include/g3dlite/G3D/SmallArray.h b/dep/include/g3dlite/G3D/SmallArray.h deleted file mode 100644 index 41f9959e264..00000000000 --- a/dep/include/g3dlite/G3D/SmallArray.h +++ /dev/null @@ -1,155 +0,0 @@ -/** - @file SmallArray.h - - @created 2009-04-26 - @edited 2009-04-26 - - Copyright 2000-2009, Morgan McGuire, http://graphics.cs.williams.edu - All rights reserved. - */ -#ifndef G3D_SmallArray_h -#define G3D_SmallArray_h - -#include "G3D/platform.h" -#include "G3D/Array.h" - -namespace G3D { - -/** Embeds \a N elements to reduce allocation time and increase - memory coherence when working with arrays of arrays. - Offers a limited subset of the functionality of G3D::Array.*/ -template -class SmallArray { -private: - int m_size; - - /** First N elements */ - T m_embedded[N]; - - /** Remaining elements */ - Array m_rest; - -public: - - SmallArray() : m_size(0) {} - - inline int size() const { - return m_size; - } - - void resize(int n, bool shrinkIfNecessary = true) { - m_rest.resize(std::max(0, n - N), shrinkIfNecessary); - m_size = n; - } - - void clear(bool shrinkIfNecessary = true) { - resize(0, shrinkIfNecessary); - } - - inline T& operator[](int i) { - debugAssert(i < m_size && i >= 0); - if (i < N) { - return m_embedded[i]; - } else { - return m_rest[i - N]; - } - } - - inline const T& operator[](int i) const { - debugAssert(i < m_size && i >= 0); - if (i < N) { - return m_embedded[i]; - } else { - return m_rest[i - N]; - } - } - - inline void push(const T& v) { - ++m_size; - if (m_size <= N) { - m_embedded[m_size - 1] = v; - } else { - m_rest.append(v); - } - } - - inline void append(const T& v) { - push(v); - } - - void fastRemove(int i) { - debugAssert(i < m_size && i >= 0); - if (i < N) { - if (m_size <= N) { - // Exclusively embedded - m_embedded[i] = m_embedded[m_size - 1]; - } else { - // Move one down from the rest array - m_embedded[i] = m_rest.pop(); - } - } else { - // Removing from the rest array - m_rest.fastRemove(i - N); - } - --m_size; - } - - T pop() { - debugAssert(m_size > 0); - if (m_size <= N) { - // Popping from embedded, don't need a temporary - --m_size; - return m_embedded[m_size]; - } else { - // Popping from rest - --m_size; - return m_rest.pop(); - } - } - - inline void popDiscard() { - debugAssert(m_size > 0); - if (m_size > N) { - m_rest.popDiscard(); - } - --m_size; - } - - inline T& next() { - ++m_size; - if (m_size <= N) { - return m_embedded[m_size - 1]; - } else { - return m_rest.next(); - } - } - - bool contains(const T& value) const { - for (int i = std::min(m_size, N) - 1; i >= 0; --i) { - if (m_embedded[i] == value) { - return true; - } - } - return m_rest.contains(value); - } - - template - SmallArray& operator=(const Array& src) { - resize(src.size()); - for (int i = 0; i < src.size(); ++i) { - (*this)[i] = src[i]; - } - return *this; - } - - inline const T& last() const { - return (*this)[size() - 1]; - } - - inline T& last() { - return (*this)[size() - 1]; - } -}; - -} -#endif diff --git a/dep/include/g3dlite/G3D/Sphere.h b/dep/include/g3dlite/G3D/Sphere.h deleted file mode 100644 index 595b61c4bf1..00000000000 --- a/dep/include/g3dlite/G3D/Sphere.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - @file Sphere.h - - Sphere class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2008-10-07 - */ - -#ifndef G3D_SPHERE_H -#define G3D_SPHERE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Array.h" -#include "G3D/Sphere.h" - -namespace G3D { - -/** - Sphere. - */ -class Sphere { -private: - - static int32 dummy; - -public: - Vector3 center; - float radius; - - Sphere() { - center = Vector3::zero(); - radius = 0; - } - - Sphere(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - Sphere( - const Vector3& center, - float radius) { - - this->center = center; - this->radius = radius; - } - - virtual ~Sphere() {} - - bool operator==(const Sphere& other) const { - return (center == other.center) && (radius == other.radius); - } - - bool operator!=(const Sphere& other) const { - return !((center == other.center) && (radius == other.radius)); - } - - /** - Returns true if point is less than or equal to radius away from - the center. - */ - bool contains(const Vector3& point) const; - - bool contains(const Sphere& other) const; - - /** - @deprecated Use culledBy(Array&) - */ - bool culledBy( - const class Plane* plane, - int numPlanes, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - @deprecated Use culledBy(Array&) - */ - bool culledBy( - const class Plane* plane, - int numPlanes, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - /** - See AABox::culledBy - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - virtual std::string toString() const; - - float volume() const; - - float area() const; - - /** - Uniformly distributed on the surface. - */ - Vector3 randomSurfacePoint() const; - - /** - Uniformly distributed on the interior (includes surface) - */ - Vector3 randomInteriorPoint() const; - - void getBounds(class AABox& out) const; - - bool intersects(const Sphere& other) const; - - /** Translates the sphere */ - Sphere operator+(const Vector3& v) const { - return Sphere(center + v, radius); - } - - /** Translates the sphere */ - Sphere operator-(const Vector3& v) const { - return Sphere(center - v, radius); - } - - /** Sets this to the smallest sphere that encapsulates both */ - void merge(const Sphere& s); -}; - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Sphere& key) { - return static_cast(key.center.hashCode() + (key.radius * 13)); - } -}; - - -#endif diff --git a/dep/include/g3dlite/G3D/Spline.h b/dep/include/g3dlite/G3D/Spline.h deleted file mode 100644 index fdd29e69ce9..00000000000 --- a/dep/include/g3dlite/G3D/Spline.h +++ /dev/null @@ -1,367 +0,0 @@ -/** - @file Spline.h - - @author Morgan McGuire, http://graphics.cs.williams.edu - */ - -#ifndef G3D_SPLINE_H -#define G3D_SPLINE_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" -#include "G3D/Matrix4.h" -#include "G3D/Vector4.h" - -namespace G3D { - -/** Common implementation code for all G3D::Spline template parameters */ -class SplineBase { -public: - - /** Times at which control points occur. Must have the same - number of elements as Spline::control. */ - Array time; - - /** If cyclic, then the control points will be assumed to wrap around. - If not cyclic, then the tangents at the ends of the spline - point to the final control points.*/ - bool cyclic; - - /** For a cyclic spline, this is the time elapsed between the last - control point and the first. If less than or equal to zero this is - assumed to be: - - (time[0] - time[1] + . - time[time.size() - 1] - time[time.size() - 2]) / 2. - */ - float finalInterval; - - SplineBase() : cyclic(true), finalInterval(-1) {} - - virtual ~SplineBase() {} - - /** See specification for Spline::finalInterval; this handles the - non-positive case. Returns 0 if not cyclic. */ - float getFinalInterval() const; - - /** Returns the amount of time covered by this spline in one - period. For a cyclic spline, this contains the final - interval.*/ - float duration() const; - - /** Computes the derivative spline basis from the control point version. */ - static Matrix4 computeBasis(); - -protected: - - /** Assumes that t0 <= s < tn. called by computeIndex. */ - void computeIndexInBounds(float s, int& i, float& u) const; - -public: - - /** - Given a time @a s, finds @a i and 0 <= @a u < 1 such that - @a s = time[@a i] * @a u + time[@a i + 1] * (1 - @a u). Note that - @a i may be outside the bounds of the time and control arrays; - use getControl to handle wraparound and extrapolation issues. - - This function takes expected O(1) time for control points with - uniform time sampled control points or for uniformly - distributed random time samples, but may take O( log time.size() ) time - in the worst case. - - Called from evaluate(). - */ - void computeIndex(float s, int& i, float& u) const; -}; - - -/** - Smooth parameteric curve implemented using a piecewise 3rd-order - Catmull-Rom spline curve. The spline is considered infinite and may - either continue linearly from the specified control points or cycle - through them. Control points are spaced uniformly in time at unit - intervals by default, but irregular spacing may be explicitly - specified. - - The dimension of the spline can be set by varying the Control - template parameter. For a 1D function, use Spline. For a - curve in the plane, Spline. Note that any template - parameter that supports operator+(Control) and operator*(float) can - be used; you can make splines out of G3D::Vector4, G3D::Matrix3, or - your own classes. - - To provide shortest-path interpolation, subclass G3D::Spline and - override ensureShortestPath(). To provide normalization of - interpolated points (e.g., projecting Quats onto the unit - hypersphere) override correct(). - - See Real Time Rendering, 2nd edition, ch 12 for a general discussion - of splines and their properties. - - @sa G3D::UprightSpline, G3D::QuatSpline - */ -template -class Spline : public SplineBase { -protected: - /** The additive identity control point. */ - Control zero; - -public: - - /** Control points. Must have the same number of elements as - Spline::time.*/ - Array control; - - Spline() { - static Control x; - // Hide the fact from C++ that we are using an - // uninitialized variable here by pointer arithmetic. - // This is ok because any type that is a legal control - // point also supports multiplication by float. - zero = *(&x) * 0.0f; - } - - /** Appends a control point at a specific time that must be - greater than that of the previous point. */ - void append(float t, const Control& c) { - debugAssertM((time.size() == 0) || (t > time.last()), - "Control points must have monotonically increasing times."); - time.append(t); - control.append(c); - debugAssert(control.size() == time.size()); - } - - - /** Appends control point spaced in time based on the previous - control point, or spaced at unit intervals if this is the - first control point. */ - void append(const Control& c) { - switch (time.size()) { - case 0: - append(0, c); - break; - - case 1: - if (time[0] == 0) { - append(1, c); - } else { - append(time[0], c); - } - break; - - default: - append(2 * time[time.size() - 1] - time[time.size() - 2], c); - } - debugAssert(control.size() == time.size()); - } - - /** Erases all control points and times, but retains the state of - cyclic and finalInterval. - */ - void clear() { - control.clear(); - time.clear(); - } - - - /** Number of control points */ - int size() const { - debugAssert(time.size() == control.size()); - return control.size(); - } - - - /** Returns the requested control point and time sample based on - array index. If the array index is out of bounds, wraps (for - a cyclic spline) or linearly extrapolates (for a non-cyclic - spline), assuming time intervals follow the first or last - sample recorded. - - Calls correct() on the control point if it was extrapolated. - - Returns 0 if there are no control points. - - @sa Spline::control and Spline::time for the underlying - control point array; Spline::computeIndex to find the index - given a time. - */ - void getControl(int i, float& t, Control& c) const { - int N = control.size(); - if (N == 0) { - c = zero; - t = 0; - } else if (cyclic) { - c = control[iWrap(i, N)]; - - if (i < 0) { - // Wrapped around bottom - - // Number of times we wrapped around the cyclic array - int wraps = (N + 1 - i) / N; - int j = (i + wraps * N) % N; - t = time[j] - wraps * duration(); - - } else if (i < N) { - - t = time[i]; - - } else { - // Wrapped around top - - // Number of times we wrapped around the cyclic array - int wraps = i / N; - int j = i % N; - t = time[j] + wraps * duration(); - } - - } else if (i < 0) { - // Are there enough points to extrapolate? - if (N >= 2) { - // Step away from control point 0 - float dt = time[1] - time[0]; - - // Extrapolate (note; i is negative) - c = control[1] * float(i) + control[0] * float(1 - i); - correct(c); - t = dt * i + time[0]; - - } else { - // Just clamp - c = control[0]; - - // Only 1 time; assume 1s intervals - t = time[0] + i; - } - - } else if (i >= N) { - if (N >= 2) { - float dt = time[N - 1] - time[N - 2]; - - // Extrapolate - c = control[N - 1] * float(i - N + 2) + control[N - 2] * -float(i - N + 1); - correct(c); - t = time[N - 1] + dt * (i - N + 1); - - } else { - // Return the last, clamping - c = control.last(); - // Only 1 time; assume 1s intervals - t = time[0] + i; - } - } else { - // In bounds - c = control[i]; - t = time[i]; - } - } - -protected: - - /** Returns a series of N control points and times, fixing - boundary issues. The indices may be assumed to be treated - cyclically. */ - void getControls(int i, float* T, Control* A, int N) const { - for (int j = 0; j < N; ++j) { - getControl(i + j, T[j], A[j]); - } - ensureShortestPath(A, N); - } - - /** - Mutates the array of N control points. It is useful to override this - method by one that wraps the values if they are angles or quaternions - for which "shortest path" interpolation is significant. - */ - virtual void ensureShortestPath(Control* A, int N) const { (void)A; (void) N;} - - /** Normalize or otherwise adjust this interpolated Control. */ - virtual void correct(Control& A) const { (void)A; } - -public: - - - /** - Return the position at time s. The spline is defined outside - of the time samples by extrapolation or cycling. - */ - Control evaluate(float s) const { - debugAssertM(control.size() == time.size(), "Corrupt spline: wrong number of control points."); - - /* - @cite http://www.gamedev.net/reference/articles/article1497.asp - Derivation of basis matrix follows. - - Given control points with positions p[i] at times t[i], 0 <= i <= 3, find the position - at time t[1] <= s <= t[2]. - - Let u = s - t[0] - Let U = [u^0 u^1 u^2 u^3] = [1 u u^2 u^3] - Let dt0 = t[0] - t[-1] - Let dt1 = t[1] - t[0] - Let dt2 = t[2] - t[1] - */ - - // Index of the first control point (i.e., the u = 0 point) - int i = 0; - // Fractional part of the time - float u = 0; - - computeIndex(s, i, u); - - Control p[4]; - float t[4]; - getControls(i - 1, t, p, 4); - float dt0 = t[1] - t[0]; - float dt1 = t[2] - t[1]; - float dt2 = t[3] - t[2]; - - static const Matrix4 basis = computeBasis(); - - // Powers of u - Vector4 uvec((float)(u*u*u), (float)(u*u), (float)u, 1.0f); - - // Compute the weights on each of the control points. - const Vector4& weights = uvec * basis; - - // Compute the weighted sum of the neighboring control points. - Control sum; - - const Control& p0 = p[0]; - const Control& p1 = p[1]; - const Control& p2 = p[2]; - const Control& p3 = p[3]; - - const Control& dp0 = p1 + (p0*-1.0f); - const Control& dp1 = p2 + (p1*-1.0f); - const Control& dp2 = p3 + (p2*-1.0f); - - // The factor of 1/2 from averaging two time intervals is - // already factored into the basis - - // tan1 = (dp0 / dt0 + dp1 / dt1) * ((dt0 + dt1) * 0.5); - // The last term normalizes for unequal time intervals - float x = (dt0 + dt1) * 0.5f; - float n0 = x / dt0; - float n1 = x / dt1; - float n2 = x / dt2; - const Control& dp1n1 = dp1 * n1; - const Control& tan1 = dp0 * n0 + dp1n1; - const Control& tan2 = dp1n1 + dp2 * n2; - - sum = - tan1 * weights[0]+ - p1 * weights[1] + - p2 * weights[2] + - tan2 * weights[3]; - - - correct(sum); - return sum; - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Stopwatch.h b/dep/include/g3dlite/G3D/Stopwatch.h deleted file mode 100644 index 3f2aa9c8d86..00000000000 --- a/dep/include/g3dlite/G3D/Stopwatch.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - @file Stopwatch.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2005-10-05 - @edited 2009-05-10 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Stopwatch_h -#define G3D_Stopwatch_h - -#include "G3D/platform.h" -#include "G3D/Queue.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - \brief Accurately measure durations and framerates. - - Example 1: For profiling code in the context of a rendering loop: -
-      sw.tick();
-      ...timed code...
-      sw.tock();
-
-      screenPrintf("%f\n", sw.smoothFPS());
-    
- - - Example 2: For profiling pieces of a sequence: -
-    Stopwatch sw;
-    slowOperation();
-    sw.after("slowOperation");
-    kdTree.balance();
-    sw.after("Balance tree");
-   
- */ -class Stopwatch { -private: - - std::string myName; - double startTime; - std::string prevMark; - double prevTime; - - /** True between tick and tock */ - bool inBetween; - - /** The initial cycle count. */ - uint64 cycleStart; - - /** The time at which tick was called. */ - RealTime timeStart; - - /** The time at which the previous tock was called, -1 if never. */ - RealTime lastTockTime; - - RealTime lastDuration; - int64 lastCycleCount; - - /** Frames per second. */ - double m_fps; - - /** Weighted fps */ - double emwaFPS; - double m_smoothFPS; - - /** Weighted duration */ - RealTime emwaDuration; - - /** The overhead for calling into the class. */ - int64 cycleOverhead; - - /** Called from the constructor. */ - void computeOverhead(); - -public: - - Stopwatch(const std::string& name = "Stopwatch"); - - /** Returns the number of times that tick was called per wall-clock second; - e.g. frames-per-second. */ - double FPS() const { - return m_fps; - } - - /** Amount of time between the most recent tick and tock calls. 0 if tick has - never been called. */ - RealTime elapsedTime() const { - return lastDuration; - } - - /** Time-smoothed value that is stable to the nearest 1%. - This is useful if you are displaying elapsed time in real-time - and want a stable number.*/ - RealTime smoothElapsedTime() const { - return emwaDuration; - } - - /** Time-smoothed value of fps that is stable to the nearest integer for fps > 10 and - to the first decimal place for fps <= 10. - This is useful if you - are displaying the frame rate in real-time and want a stable (readable) number.*/ - double smoothFPS() const { - return m_smoothFPS; - } - - /** The elapsed cycle time between tick and tock. An attempt is made to factor out all - tick/tock overhead, so that back-to-back calls should return zero. - Unreliable on non-x86 platforms.*/ - uint64 elapsedCycles() const { - return lastCycleCount; - } - - /** Call at the beginning of the period that you want timed. */ - void tick(); - - /** Call at the end of the period that you want timed. */ - void tock(); - - - /** Reset the start time used by after() and the emwa value.*/ - void reset(); - - /** Call after an operation has completed, with the name of the operation, to - print a debug message listing the time since the previous after() call. */ - void after(const std::string& s = ""); - -}; - -/** Because it is hard to remember the proper capitalization. */ -typedef Stopwatch StopWatch; - -} - -#endif - diff --git a/dep/include/g3dlite/G3D/System.h b/dep/include/g3dlite/G3D/System.h deleted file mode 100644 index 56ef9c8e3dc..00000000000 --- a/dep/include/g3dlite/G3D/System.h +++ /dev/null @@ -1,507 +0,0 @@ -/** - @file System.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @cite Rob Wyatt http://www.gamasutra.com/features/wyatts_world/19990709/processor_detection_01.htm - @cite Benjamin Jurke http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-ProcessorDetectionClass&forum=cotd&id=-1 - @cite Michael Herf http://www.stereopsis.com/memcpy.html - - @created 2003-01-25 - @edited 2008-10-14 - */ - -#ifndef G3D_System_h -#define G3D_System_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/BinaryFormat.h" -#include - -#ifdef G3D_OSX -# include -#endif - -namespace G3D { - -/** - Routine used by the demos to find the data. Searches in - ../data, ../../data, etc. up to 5 levels back. Checks - common locations like \verbatim c:\libraries\g3d-\data \endverbatim - and some hard-coded paths on the Brown University file - system. - - @deprecated - */ -std::string demoFindData(bool errorIfNotFound = true); - -/** G3D, SDL, and IJG libraries require license documentation - to be distributed with your program. This generates the - string that must appear in your documentation. - Your program can be commercial, closed-source under - any license you want. - @deprecated Use System::license -*/ -std::string license(); - -/** -@brief The order in which the bytes of an integer are stored on a -machine. - -Intel/AMD chips tend to be G3D_LITTLE_ENDIAN, Mac PPC's and Suns are -G3D_BIG_ENDIAN. However, this is primarily used to specify the byte -order of file formats, which are fixed. -*/ -enum G3DEndian { - G3D_BIG_ENDIAN, - G3D_LITTLE_ENDIAN -}; - -/** - @brief OS and processor abstraction. - - The first time any method is called the processor will be analyzed. - Future calls are then fast. - - Timing function overview: - System::getCycleCount - - actual cycle count - - System::getTick - - High-resolution time in seconds since program started - - System::getLocalTime - - High-resolution time in seconds since Jan 1, 1970 - (because it is stored in a double, this may be less - accurate than getTick) - */ -class System { -public: - /** - @param size Size of memory that the system was trying to allocate - - @param recoverable If true, the system will attempt to allocate again - if the callback returns true. If false, malloc is going to return - NULL and this invocation is just to notify the application. - - @return Return true to force malloc to attempt allocation again if the - error was recoverable. - */ - typedef bool (*OutOfMemoryCallback)(size_t size, bool recoverable); - -private: - - bool m_initialized; - int m_cpuSpeed; - bool m_hasCPUID; - bool m_hasRDTSC; - bool m_hasMMX; - bool m_hasSSE; - bool m_hasSSE2; - bool m_hasSSE3; - bool m_has3DNOW; - bool m_has3DNOW2; - bool m_hasAMDMMX; - std::string m_cpuVendor; - int m_numCores; - - /** this holds the data directory set by the application (currently - GApp) for use by findDataFile */ - std::string m_appDataDir; - - G3DEndian m_machineEndian; - std::string m_cpuArch; - std::string m_operatingSystem; - -# ifdef G3D_WIN32 - /** Used by getTick() for timing */ - LARGE_INTEGER m_start; - LARGE_INTEGER m_counterFrequency; -#else - struct timeval m_start; -#endif - - std::string m_version; - OutOfMemoryCallback m_outOfMemoryCallback; - -#ifdef G3D_OSX - /** In Cycles/Second */ - SInt32 m_OSXCPUSpeed; - double m_secondsPerNS; -#endif - - /** The Real-World time of System::getTick() time 0. Set by initTime */ - RealTime m_realWorldGetTickTime0; - - uint32 m_highestCPUIDFunction; - - /** @brief Used for the singleton instance only. */ - System(); - - /** @brief The singleton instance. - - Used instead of a global variable to ensure that the order of - intialization is correct, which is critical because other - globals may allocate memory using System::malloc. - */ - static System& instance(); - - enum CPUIDFunction { - CPUID_VENDOR_ID = 0x00000000, - CPUID_PROCESSOR_FEATURES = 0x00000001, - CPUID_NUM_CORES = 0x00000004, - CPUID_GET_HIGHEST_FUNCTION = 0x80000000, - CPUID_EXTENDED_FEATURES = 0x80000001}; - - /** Helper macro to call cpuid functions and return all values - - See http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/ - or http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf - - for description of the arguments. - */ - static void cpuid(CPUIDFunction func, uint32& areg, uint32& breg, uint32& creg, uint32& dreg); - - void init(); - - /** Called from init() */ - void getStandardProcessorExtensions(); - - /** Called from init() */ - void initTime(); - -public: - - /** Returns the speed of processor 0 in MHz. - Always returns 0 on linux.*/ - inline static int cpuSpeedMHz() { - return instance().m_cpuSpeed; - } - - /** Returns the number of logical processor cores (i.e., the - number of execution units for threads) */ - inline static int numCores() { - return instance().m_numCores; - } - - inline static bool hasCPUID() { - return instance().m_hasCPUID; - } - - inline static bool hasRDTSC() { - return instance().m_hasRDTSC; - } - - inline static bool hasSSE() { - return instance().m_hasSSE; - } - - inline static bool hasSSE2() { - return instance().m_hasSSE2; - } - - inline static bool hasSSE3() { - return instance().m_hasSSE3; - } - - inline static bool hasMMX() { - return instance().m_hasMMX; - } - - inline static bool has3DNow() { - return instance().m_has3DNOW; - } - - inline static const std::string& cpuVendor() { - return instance().m_cpuVendor; - } - - /** - Returns the endianness of this machine. - */ - inline static G3DEndian machineEndian() { - return instance().m_machineEndian; - } - - /** e.g., "Windows", "GNU/Linux" */ - inline static const std::string& operatingSystem() { - return instance().m_operatingSystem; - } - - /** e.g., 80686 */ - inline static const std::string& cpuArchitecture() { - return instance().m_cpuArch; - } - - /** - Returns the current date as a string in the form YYYY-MM-DD - */ - static std::string currentDateString(); - - /** - Guarantees that the start of the array is aligned to the - specified number of bytes. - */ - static void* alignedMalloc(size_t bytes, size_t alignment); - - /** - Uses pooled storage to optimize small allocations (1 byte to 5 - kilobytes). Can be 10x to 100x faster than calling ::malloc or - new. - - The result must be freed with free. - - Threadsafe on Win32. - - @sa calloc realloc OutOfMemoryCallback free - */ - static void* malloc(size_t bytes); - - static void* calloc(size_t n, size_t x); - - /** - Version of realloc that works with System::malloc. - */ - static void* realloc(void* block, size_t bytes); - - /** Returns a string describing how well System::malloc is using - its internal pooled storage. "heap" memory was slow to - allocate; the other data sizes are comparatively fast.*/ - static std::string mallocPerformance(); - static void resetMallocPerformanceCounters(); - - /** - Returns a string describing the current usage of the buffer pools used for - optimizing System::malloc. - */ - static std::string mallocStatus(); - - /** - Free data allocated with System::malloc. - - Threadsafe on Win32. - */ - static void free(void* p); - - /** - Frees memory allocated with alignedMalloc. - */ - static void alignedFree(void* ptr); - - /** An implementation of memcpy that may be up to 2x as fast as the C library - one on some processors. Guaranteed to have the same behavior as memcpy - in all cases. */ - static void memcpy(void* dst, const void* src, size_t numBytes); - - /** An implementation of memset that may be up to 2x as fast as the C library - one on some processors. Guaranteed to have the same behavior as memset - in all cases. */ - static void memset(void* dst, uint8 value, size_t numBytes); - - /** - Returns the fully qualified filename for the currently running executable. - - This is more reliable than arg[0], which may be intentionally set - to an incorrect value by a calling program, relative to a now - non-current directory, or obfuscated by sym-links. - - @cite Linux version written by Nicolai Haehnle , http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-getexename&forum=cotd&id=-1 - */ - static std::string currentProgramFilename(); - - /** Name of this program. Note that you can mutate this string to - set your app name explicitly.*/ - static std::string& appName(); - - /** G3D Version string */ - inline static const std::string& version() { - return instance().m_version; - } - - /** - @brief The optimization status of the G3D library (not the program compiled against it) - - Either "Debug" or "Release", depending on whether _DEBUG was - defined at compile-time for the library. - */ - static const std::string& build(); - - /** - Causes the current thread to yield for the specified duration - and consume almost no CPU. - The sleep will be extremely precise; it uses System::time() - to calibrate the exact yeild time. - */ - static void sleep(RealTime t); - - /** - Clears the console. - Console programs only. - */ - static void consoleClearScreen(); - - /** - Returns true if a key is waiting. - Console programs only. - */ - static bool consoleKeyPressed(); - - /** - Blocks until a key is read (use consoleKeyPressed to determine if - a key is waiting to be read) then returns the character code for - that key. - */ - static int consoleReadKey(); - - /** - The actual time (measured in seconds since - Jan 1 1970 midnight). - - Adjusted for local timezone and daylight savings - time. This is as accurate and fast as getCycleCount(). - */ - static RealTime time(); - - /** - To count the number of cycles a given operation takes: - -
-     unsigned long count;
-     System::beginCycleCount(count);
-     ...
-     System::endCycleCount(count);
-     // count now contains the cycle count for the intervening operation.
-     
- */ - /* static void beginCycleCount(uint64& cycleCount); - static void endCycleCount(uint64& cycleCount); - - static uint64 getCycleCount(); */ - - inline static void setOutOfMemoryCallback(OutOfMemoryCallback c) { - instance().m_outOfMemoryCallback = c; - } - - /** - When System::malloc fails to allocate memory because the system is - out of memory, it invokes this handler (if it is not NULL). - The argument to the callback is the amount of memory that malloc - was trying to allocate when it ran out. If the callback returns - true, System::malloc will attempt to allocate the memory again. - If the callback returns false, then System::malloc will return NULL. - - You can use outOfMemoryCallback to free data structures or to - register the failure. - */ - inline static OutOfMemoryCallback outOfMemoryCallback() { - return instance().m_outOfMemoryCallback; - } - - /** Set an environment variable for the current process */ - static void setEnv(const std::string& name, const std::string& value); - - /** Get an environment variable for the current process. Returns NULL if the variable doesn't exist. */ - static const char* getEnv(const std::string& name); - - /** - Prints a human-readable description of this machine - to the text output stream. Either argument may be NULL. - */ - static void describeSystem( - class TextOutput& t); - - static void describeSystem( - std::string& s); - - /** On Win32, returns the clipboard text contents. Does nothing on other - platforms (yet) */ - static std::string getClipboardText(); - - /** Copies the text to the clipboard on Win32. */ - static void setClipboardText(const std::string& s); - - /** - Tries to locate the resource by looking in related directories. - If found, returns the full path to the resource, otherwise - returns the empty string. - */ - static std::string findDataFile(const std::string& full, bool errorIfNotFound = true); - - /** - Sets the path that the application is using as its data directory. - Used by findDataDir as an initial search location. GApp sets this - upon constrution. - */ - static void setAppDataDir(const std::string& path); - -}; - -/* don't need that for MaNGOS, not portable to Win64... -#ifdef _MSC_VER - inline uint64 System::getCycleCount() { - uint32 timehi, timelo; - - // Use the assembly instruction rdtsc, which gets the current - // cycle count (since the process started) and puts it in edx:eax. - __asm - { - rdtsc; - mov timehi, edx; - mov timelo, eax; - } - - return ((uint64)timehi << 32) + (uint64)timelo; - } - -#elif defined(G3D_LINUX) - - inline uint64 System::getCycleCount() { - uint32 timehi, timelo; - - __asm__ __volatile__ ( - "rdtsc " - : "=a" (timelo), - "=d" (timehi) - : ); - - return ((uint64)timehi << 32) + (uint64)timelo; - } - -#elif defined(G3D_OSX) - - inline uint64 System::getCycleCount() { - //Note: To put off extra processing until the end, this does not - //return the actual clock cycle count. It is a bus cycle count. - //When endCycleCount() is called, it converts the two into a difference - //of clock cycles - - return (uint64) UnsignedWideToUInt64(UpTime()); - //return (uint64) mach_absolute_time(); - } - -#endif - -inline void System::beginCycleCount(uint64& cycleCount) { - cycleCount = getCycleCount(); -} - - -inline void System::endCycleCount(uint64& cycleCount) { -#ifndef G3D_OSX - cycleCount = getCycleCount() - cycleCount; -#else - AbsoluteTime end = UpTime(); - Nanoseconds diffNS = - AbsoluteDeltaToNanoseconds(end, UInt64ToUnsignedWide(cycleCount)); - cycleCount = - (uint64) ((double) (instance().m_OSXCPUSpeed) * - (double) UnsignedWideToUInt64(diffNS) * instance().m_secondsPerNS); -#endif -} - */ - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/Table.h b/dep/include/g3dlite/G3D/Table.h deleted file mode 100644 index 287efa94d97..00000000000 --- a/dep/include/g3dlite/G3D/Table.h +++ /dev/null @@ -1,924 +0,0 @@ -/** - @file Table.h - - Templated hash table class. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2001-04-22 - @edited 2010-01-28 - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Table_h -#define G3D_Table_h - -#include -#include - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/debug.h" -#include "G3D/System.h" -#include "G3D/g3dmath.h" -#include "G3D/EqualsTrait.h" -#include "G3D/HashTrait.h" -#include "G3D/MemoryManager.h" - -#ifdef _MSC_VER -# pragma warning (push) - // Debug name too long warning -# pragma warning (disable : 4786) -#endif - -namespace G3D { - -/** - An unordered data structure mapping keys to values. - - There are two ways of definining custom hash functions (G3D provides built-in ones for most classes): - -
- class Foo {
- public:
-     std::string     name;
-     int             index;
-     static size_t hashCode(const Foo& key) {
-          return HashTrait::hashCode(key.name) + key.index;
-     }
-  };
-
-  template<> struct HashTrait {
-       static size_t hashCode(const Foo& key) { return HashTrait::hashCode(key.name) + key.index; }
-  }; 
-
-
-  // Use Foo::hashCode
-  Table fooTable1;
-
-  // Use HashTrait
-  Table      fooTable2;
-  
- - - Key must be a pointer, an int, a std::string or provide overloads for: - -
-    template<> struct HashTrait {
-        static size_t hashCode(const Key& key) { return reinterpret_cast( ... ); }
-    }; 
-  
- - and one of - -
-    template<> struct EqualsTrait{
-         static bool equals(const Key& a, const Key& b) { return ... ; }
-    };
-
-
-    bool operator==(const Key&, const Key&);
-  
- - G3D pre-defines HashTrait specializations for common types (like int and std::string). - If you use a Table with a different type you must write those functions yourself. For example, - an enum would use: - -
-    template<> struct HashTrait {
-        static size_t equals(const MyEnum& key) const { return reinterpret_cast( key ); }
-    };
-  
- - And rely on the default enum operator==. - - - Periodically check that debugGetLoad() is low (> 0.1). When it gets near - 1.0 your hash function is badly designed and maps too many inputs to - the same output. - */ -template, class EqualsFunc = EqualsTrait > -class Table { -public: - - /** - The pairs returned by iterator. - */ - class Entry { - public: - Key key; - Value value; - Entry() {} - Entry(const Key& k) : key(k) {} - Entry(const Key& k, const Value& v) : key(k), value(v) {} - bool operator==(const Entry &peer) const { return (key == peer.key && value == peer.value); } - bool operator!=(const Entry &peer) const { return !operator==(peer); } - }; - -private: - - typedef Table ThisType; - - /** - Linked list nodes used internally by HashTable. - */ - class Node { - public: - Entry entry; - size_t hashCode; - Node* next; - - private: - - // Private to require use of the allocator - Node(const Key& k, const Value& v, size_t h, Node* n) - : entry(k, v), hashCode(h), next(n) { - } - - Node(const Key& k, size_t h, Node* n) - : entry(k), hashCode(h), next(n) { - } - - public: - - static Node* create(const Key& k, const Value& v, size_t h, Node* n, MemoryManager::Ref& mm) { - Node* node = (Node*)mm->alloc(sizeof(Node)); - return new (node) Node(k, v, h, n); - } - - static Node* create(const Key& k, size_t hashCode, Node* n, MemoryManager::Ref& mm) { - Node* node = (Node*)mm->alloc(sizeof(Node)); - return new (node) Node(k, hashCode, n); - } - - static void destroy(Node* n, MemoryManager::Ref& mm) { - n->~Node(); - mm->free(n); - } - - /** - Clones a whole chain; - */ - Node* clone(MemoryManager::Ref& mm) { - return create(this->entry.key, this->entry.value, hashCode, (next == NULL) ? NULL : next->clone(mm), mm); - } - }; - - void checkIntegrity() const { -# ifdef G3D_DEBUG - debugAssert(m_bucket == NULL || isValidHeapPointer(m_bucket)); - for (size_t b = 0; b < m_numBuckets; ++b) { - Node* node = m_bucket[b]; - debugAssert(node == NULL || isValidHeapPointer(node)); - while (node != NULL) { - debugAssert(node == NULL || isValidHeapPointer(node)); - node = node->next; - } - } -# endif - } - - /** Number of elements in the table.*/ - size_t m_size; - - /** - Array of Node*. - - We don't use Array because Table is lower-level than Array. - Some elements may be NULL. - */ - Node** m_bucket; - - /** - Length of the m_bucket array. - */ - size_t m_numBuckets; - - MemoryManager::Ref m_memoryManager; - - void* alloc(size_t s) const { - return m_memoryManager->alloc(s); - } - - void free(void* p) const { - return m_memoryManager->free(p); - } - - /** - Re-hashes for a larger m_bucket size. - */ - void resize(size_t newSize) { - - // Hang onto the old m_bucket array - Node** oldBucket = m_bucket; - - // Allocate a new m_bucket array with the new size - m_bucket = (Node**)alloc(sizeof(Node*) * newSize); - // Set all pointers to NULL - System::memset(m_bucket, 0, newSize * sizeof(Node*)); - debugAssertM(m_bucket != NULL, "MemoryManager::alloc returned NULL. Out of memory."); - // Move each node to its new hash location - for (size_t b = 0; b < m_numBuckets; ++b) { - Node* node = oldBucket[b]; - - // There is a linked list of nodes at this m_bucket - while (node != NULL) { - // Hang onto the old next pointer - Node* nextNode = node->next; - - // Insert at the head of the list for m_bucket[i] - size_t i = node->hashCode % newSize; - node->next = m_bucket[i]; - m_bucket[i] = node; - - // Move on to the next node - node = nextNode; - } - - // Drop the old pointer for cleanliness when debugging - oldBucket[b] = NULL; - } - - // Delete the old storage - free(oldBucket); - this->m_numBuckets = newSize; - - checkIntegrity(); - } - - - void copyFrom(const ThisType& h) { - if (&h == this) { - return; - } - - debugAssert(m_bucket == NULL); - m_size = h.m_size; - m_numBuckets = h.m_numBuckets; - m_bucket = (Node**)alloc(sizeof(Node*) * m_numBuckets); - // No need to NULL elements since we're about to overwrite them - - for (size_t b = 0; b < m_numBuckets; ++b) { - if (h.m_bucket[b] != NULL) { - m_bucket[b] = h.m_bucket[b]->clone(m_memoryManager); - } else { - m_bucket[b] = NULL; - } - } - - checkIntegrity(); - } - - /** - Frees the heap structures for the nodes. - */ - void freeMemory() { - checkIntegrity(); - - for (size_t b = 0; b < m_numBuckets; b++) { - Node* node = m_bucket[b]; - while (node != NULL) { - Node* next = node->next; - Node::destroy(node, m_memoryManager); - node = next; - } - m_bucket[b] = NULL; - } - free(m_bucket); - m_bucket = NULL; - m_numBuckets = 0; - m_size = 0; - } - -public: - - /** - Creates an empty hash table using the default MemoryManager. - */ - Table() : m_bucket(NULL) { - m_memoryManager = MemoryManager::create(); - m_numBuckets = 0; - m_size = 0; - m_bucket = NULL; - checkIntegrity(); - } - - /** Changes the internal memory manager to m */ - void clearAndSetMemoryManager(const MemoryManager::Ref& m) { - clear(); - debugAssert(m_bucket == NULL); - m_memoryManager = m; - } - - /** - Recommends that the table resize to anticipate at least this number of elements. - */ - void setSizeHint(size_t n) { - size_t s = n * 3; - if (s > m_numBuckets) { - resize(s); - } - } - - /** - Destroys all of the memory allocated by the table, but does not - call delete on keys or values if they are pointers. If you want to - deallocate things that the table points at, use getKeys() and Array::deleteAll() - to delete them. - */ - virtual ~Table() { - freeMemory(); - } - - /** Uses the default memory manager */ - Table(const ThisType& h) { - m_memoryManager = MemoryManager::create(); - m_numBuckets = 0; - m_size = 0; - m_bucket = NULL; - this->copyFrom(h); - checkIntegrity(); - } - - - Table& operator=(const ThisType& h) { - // No need to copy if the argument is this - if (this != &h) { - // Free the existing nodes - freeMemory(); - this->copyFrom(h); - checkIntegrity(); - } - return *this; - } - - /** - Returns the length of the deepest m_bucket. - */ - size_t debugGetDeepestBucketSize() const { - size_t deepest = 0; - - for (size_t b = 0; b < m_numBuckets; b++) { - size_t count = 0; - Node* node = m_bucket[b]; - while (node != NULL) { - node = node->next; - ++count; - } - - if (count > deepest) { - deepest = count; - } - } - - return deepest; - } - - /** - Returns the average size of non-empty buckets. - */ - float debugGetAverageBucketSize() const { - size_t num = 0; - size_t count = 0; - - for (size_t b = 0; b < m_numBuckets; b++) { - Node* node = m_bucket[b]; - if (node != NULL) { - ++num; - while (node != NULL) { - node = node->next; - ++count; - } - } - } - - return (float)((double)count / num); - } - - /** - A small load (close to zero) means the hash table is acting very - efficiently most of the time. A large load (close to 1) means - the hash table is acting poorly-- all operations will be very slow. - A large load will result from a bad hash function that maps too - many keys to the same code. - */ - double debugGetLoad() const { - return debugGetDeepestBucketSize() / (double)size(); - } - - /** - Returns the number of buckets. - */ - size_t debugGetNumBuckets() const { - return m_numBuckets; - } - - /** - C++ STL style iterator variable. See begin(). - */ - class Iterator { - private: - friend class Table; - - /** - Bucket index. - */ - size_t index; - - /** - Linked list node. - */ - Node* node; - ThisType* table; - size_t m_numBuckets; - Node** m_bucket; - bool isDone; - - /** - Creates the end iterator. - */ - Iterator(const ThisType* table) : table(const_cast(table)) { - isDone = true; - } - - Iterator(const ThisType* table, size_t m_numBuckets, Node** m_bucket) : - table(const_cast(table)), - m_numBuckets(m_numBuckets), - m_bucket(m_bucket) { - - if (m_numBuckets == 0) { - // Empty table - isDone = true; - return; - } - - index = 0; - node = m_bucket[index]; - isDone = false; - findNext(); - } - - /** - Finds the next element, setting isDone if one can't be found. - Looks at the current element first. - */ - void findNext() { - while (node == NULL) { - index++; - if (index >= m_numBuckets) { - isDone = true; - break; - } else { - node = m_bucket[index]; - } - } - } - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - if (other.isDone || isDone) { - // Common case; check against isDone. - return (isDone == other.isDone) && (other.table == table); - } else { - return - (table == other.table) && - (node == other.node) && - (index == other.index); - } - } - - /** - Pre increment. - */ - Iterator& operator++() { - node = node->next; - findNext(); - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Entry& operator*() const { - return node->entry; - } - - Entry* operator->() const { - return &(node->entry); - } - - operator Entry*() const { - return &(node->entry); - } - - bool hasMore() const { - return ! isDone; - } - }; - - - /** - C++ STL style iterator method. Returns the first Entry, which - contains a key and value. Use preincrement (++entry) to get to - the next element. Do not modify the table while iterating. - */ - Iterator begin() const { - return Iterator(this, m_numBuckets, m_bucket); - } - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - const Iterator end() const { - return Iterator(this); - } - - /** - Removes all elements - */ - void clear() { - freeMemory(); - m_numBuckets = 0; - m_size = 0; - m_bucket = NULL; - } - - - /** - Returns the number of keys. - */ - size_t size() const { - return m_size; - } - - - /** - If you insert a pointer into the key or value of a table, you are - responsible for deallocating the object eventually. Inserting - key into a table is O(1), but may cause a potentially slow rehashing. - */ - void set(const Key& key, const Value& value) { - getCreateEntry(key).value = value; - } - -private: - - /** Helper for remove() and getRemove() */ - bool remove(const Key& key, Key& removedKey, Value& removedValue, bool updateRemoved) { - if (m_numBuckets == 0) { - return false; - } - size_t code = HashFunc::hashCode(key); - size_t b = code % m_numBuckets; - - // Go to the m_bucket - Node* n = m_bucket[b]; - - if (n == NULL) { - return false; - } - - Node* previous = NULL; - - // Try to find the node - do { - if ((code == n->hashCode) && EqualsFunc::equals(n->entry.key, key)) { - // This is the node; remove it - - // Replace the previous's next pointer - if (previous == NULL) { - m_bucket[b] = n->next; - } else { - previous->next = n->next; - } - - if (updateRemoved) { - removedKey = n->entry.key; - removedValue = n->entry.value; - } - // Delete the node - Node::destroy(n, m_memoryManager); - --m_size; - return true; - } - - previous = n; - n = n->next; - } while (n != NULL); - - return false; - //alwaysAssertM(false, "Tried to remove a key that was not in the table."); - } - -public: - - /** If @a member is present, sets @a removed to the element - being removed and returns true. Otherwise returns false - and does not write to @a removed. */ - bool getRemove(const Key& key, Key& removedKey, Value& removedValue) { - return remove(key, removedKey, removedValue, true); - } - - /** - Removes an element from the table if it is present. - @return true if the element was found and removed, otherwise false - */ - bool remove(const Key& key) { - Key x; - Value v; - return remove(key, x, v, false); - } - -private: - - Entry* getEntryPointer(const Key& key) const { - if (m_numBuckets == 0) { - return NULL; - } - - size_t code = HashFunc::hashCode(key); - size_t b = code % m_numBuckets; - - Node* node = m_bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - return &(node->entry); - } - node = node->next; - } - - return NULL; - } - -public: - - /** If a value that is EqualsFunc to @a member is present, returns a pointer to the - version stored in the data structure, otherwise returns NULL. - */ - const Key* getKeyPointer(const Key& key) const { - const Entry* e = getEntryPointer(key); - if (e == NULL) { - return NULL; - } else { - return &(e->key); - } - } - - /** - Returns the value associated with key. - @deprecated Use get(key, val) or getPointer(key) - */ - Value& get(const Key& key) const { - Entry* e = getEntryPointer(key); - debugAssertM(e != NULL, "Key not found"); - return e->value; - } - - - /** Returns a pointer to the element if it exists, or NULL if it does not. - Note that if your value type is a pointer, the return value is - a pointer to a pointer. Do not remove the element while holding this - pointer. - - It is easy to accidentally mis-use this method. Consider making - a Table and using get(key, val) instead, which makes you manage - the memory for the values yourself and is less likely to result in - pointer errors. - */ - Value* getPointer(const Key& key) const { - if (m_numBuckets == 0) { - return NULL; - } - - size_t code = HashFunc::hashCode(key); - size_t b = code % m_numBuckets; - - Node* node = m_bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - // found key - return &(node->entry.value); - } - node = node->next; - } - - // Failed to find key - return NULL; - } - - /** - If the key is present in the table, val is set to the associated value and returns true. - If the key is not present, returns false. - */ - bool get(const Key& key, Value& val) const { - Value* v = getPointer(key); - if (v != NULL) { - val = *v; - return true; - } else { - return false; - } - } - - - - /** Called by getCreate() and set() - - \param created Set to true if the entry was created by this method. - */ - Entry& getCreateEntry(const Key& key, bool& created) { - created = false; - - if (m_numBuckets == 0) { - resize(10); - } - - size_t code = HashFunc::hashCode(key); - size_t b = code % m_numBuckets; - - // Go to the m_bucket - Node* n = m_bucket[b]; - - // No m_bucket, so this must be the first - if (n == NULL) { - m_bucket[b] = Node::create(key, code, NULL, m_memoryManager); - ++m_size; - created = true; - return m_bucket[b]->entry; - } - - size_t bucketLength = 1; - - // Sometimes a bad hash code will cause all elements - // to collide. Detect this case and don't rehash when - // it occurs; nothing good will come from the rehashing. - bool allSameCode = true; - - // Try to find the node - do { - allSameCode = allSameCode && (code == n->hashCode); - - if ((code == n->hashCode) && EqualsFunc::equals(n->entry.key, key)) { - // This is the a pre-existing node - return n->entry; - } - - n = n->next; - ++bucketLength; - } while (n != NULL); - - const size_t maxBucketLength = 3; - // (Don't bother changing the size of the table if all entries - // have the same hashcode--they'll still collide) - if ((bucketLength > maxBucketLength) && - ! allSameCode && - (m_numBuckets < m_size * 15)) { - - // This m_bucket was really large; rehash if all elements - // don't have the same hashcode the number of buckets is - // reasonable. - - // Back off the scale factor as the number of buckets gets - // large - float f = 3.0f; - if (m_numBuckets > 1000000) { - f = 1.5f; - } else if (m_numBuckets > 100000) { - f = 2.0f; - } - int newSize = iMax((int)(m_numBuckets * f) + 1, (int)(m_size * f)); - resize(newSize); - } - - // Not found; insert at the head. - b = code % m_numBuckets; - m_bucket[b] = Node::create(key, code, m_bucket[b], m_memoryManager); - ++m_size; - created = true; - return m_bucket[b]->entry; - } - - Entry& getCreateEntry(const Key& key) { - bool ignore; - return getCreateEntry(key, ignore); - } - - - /** Returns the current value that key maps to, creating it if necessary.*/ - Value& getCreate(const Key& key) { - return getCreateEntry(key).value; - } - - /** \param created True if the element was created. */ - Value& getCreate(const Key& key, bool& created) { - return getCreateEntry(key, created).value; - } - - - /** - Returns true if key is in the table. - */ - bool containsKey(const Key& key) const { - if (m_numBuckets == 0) { - return false; - } - - size_t code = HashFunc::hashCode(key); - size_t b = code % m_numBuckets; - - Node* node = m_bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - return true; - } - node = node->next; - } while (node != NULL); - - return false; - } - - - /** - Short syntax for get. - */ - inline Value& operator[](const Key &key) const { - return get(key); - } - - /** - Returns an array of all of the keys in the table. - You can iterate over the keys to get the values. - @deprecated - */ - Array getKeys() const { - Array keyArray; - getKeys(keyArray); - return keyArray; - } - - void getKeys(Array& keyArray) const { - keyArray.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - for (size_t i = 0; i < m_numBuckets; i++) { - Node* node = m_bucket[i]; - while (node != NULL) { - keyArray.append(node->entry.key); - node = node->next; - } - } - } - - /** - Calls delete on all of the keys and then clears the table. - */ - void deleteKeys() { - for (size_t i = 0; i < m_numBuckets; i++) { - Node* node = m_bucket[i]; - while (node != NULL) { - delete node->entry.key; - node = node->next; - } - } - clear(); - } - - /** - Calls delete on all of the values. This is unsafe-- - do not call unless you know that each value appears - at most once. - - Does not clear the table, so you are left with a table - of NULL pointers. - */ - void deleteValues() { - for (size_t i = 0; i < m_numBuckets; ++i) { - Node* node = m_bucket[i]; - while (node != NULL) { - delete node->entry.value; - node->entry.value = NULL; - node = node->next; - } - } - } -}; - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/dep/include/g3dlite/G3D/TextInput.h b/dep/include/g3dlite/G3D/TextInput.h deleted file mode 100644 index 33eb8c48e53..00000000000 --- a/dep/include/g3dlite/G3D/TextInput.h +++ /dev/null @@ -1,801 +0,0 @@ -/** - @file TextInput.h - - Simple text lexer/tokenizer. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @cite Based on a lexer written by Aaron Orenstein. - - @created 2002-11-27 - @edited 2009-11-24 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TextInput_h -#define G3D_TextInput_h - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Set.h" -#include "G3D/ParseError.h" -#include -#include -#include -#include - -namespace G3D { - -/** - For use with TextInput. - */ -class Token { -public: - - /** - More detailed type information than Type. - */ - enum ExtendedType { - DOUBLE_QUOTED_TYPE, - SINGLE_QUOTED_TYPE, - SYMBOL_TYPE, - FLOATING_POINT_TYPE, - INTEGER_TYPE, - BOOLEAN_TYPE, - LINE_COMMENT_TYPE, - BLOCK_COMMENT_TYPE, - NEWLINE_TYPE, - END_TYPE - }; - - /** - Strings are enclosed in quotes, symbols are not. - */ - enum Type { - STRING = DOUBLE_QUOTED_TYPE, - SYMBOL = SYMBOL_TYPE, - NUMBER = FLOATING_POINT_TYPE, - BOOLEAN = BOOLEAN_TYPE, - COMMENT = LINE_COMMENT_TYPE, - NEWLINE = NEWLINE_TYPE, - END = END_TYPE - }; - -private: - - friend class TextInput; - - /** - Holds the actual value, which might be any type. If a number, it will be - parsed at runtime. - */ - std::string _string; - - bool _bool; - int _line; - int _character; - Type _type; - ExtendedType _extendedType; - -public: - - Token() : - _string(""), - _bool(false), - _line(0), - _character(0), - _type(END), - _extendedType(END_TYPE) {} - - Token(Type t, ExtendedType e, const std::string& s, int L, int c) - : _string(s), _bool(false), _line(L), _character(c), _type(t), _extendedType(e) {} - - Token(Type t, ExtendedType e, const std::string& s, bool b, int L, int c) - : _string(s), _bool(b), _line(L), _character(c), _type(t), _extendedType(e) {} - - Type type() const { - return _type; - } - - ExtendedType extendedType() const { - return _extendedType; - } - - /** - The value of a single or double quote string (not including the quotes), - the name of a symbol, or the exact textual representation of a number as - parsed from the input. - */ - const std::string& string() const { - return _string; - } - - bool boolean() const { - return _bool; - } - - /** - Starting line of the input from which this token was parsed. Starts - at 1. - */ - int line() const { - return _line; - } - - /** - Starting character position in the input line from which this token was - parsed. Starts at 1. - */ - int character() const { - return _character; - } - - /** Return the numeric value for a number type, or zero if this is - not a number type. - */ - double number() const; -}; - - -/** - A simple style tokenizer for reading text files. TextInput handles a - superset of C++,Java, Matlab, and Bash code text including single - line comments, block comments, quoted strings with escape sequences, - and operators. TextInput recognizes several categories of tokens, - which are separated by white space, quotation marks, or the end of a - recognized operator: - -
    -
  • Token::SINGLE_QUOTED_TYPE string of characters surrounded by single quotes, e.g., 'x', '\\0', 'foo'. -
  • Token::DOUBLE_QUOTED_TYPE string of characters surrounded by double quotes, e.g., "x", "abc\txyz", "b o b". -
  • Token::SYMBOL_TYPE legal C++ operators, keywords, and identifiers. e.g., >=, Foo, _X, class, { -
  • Token::INTEGER_TYPE numbers without decimal places or exponential notation. e.g., 10, 0x17F, 32, 0, -155 -
  • Token::FLOATING_POINT_TYPE numbers with decimal places or exponential notation. e.g., 1e3, -1.2, .4, 0.5 -
  • Token::BOOLEAN_TYPE special symbols like "true" and "false"; the exact details can be configured in TextInput::Settings -
  • Token::LINE_COMMENT_TYPE (disabled by default); generated for line comments as specified by TextInput::Settings -
  • Token::BLOCK_COMMENT_TYPE (disabled by default); generated for c-style block comments as specified by TextInput::Settings -
  • Token::NEWLINE_TYPE (disabled by default); generated for any of "\\r", "\\n" or "\\r\\n" -
- -

The special ".." and "..." tokens are always recognized in - addition to normal C++ operators. Additional tokens can be made - available by changing the Settings. - - Negative numbers are handled specially because of the ambiguity between unary minus and negative numbers-- - see the note on TextInput::read. - - TextInput does not have helper functions for types with non-obvious - formatting, or helpers that would be redundant. Use the serialize - methods instead for parsing specific types like int, Vector3, and - Color3. - - Inside quoted strings escape sequences are converted. Thus the - string token for ["a\\nb"] is 'a', followed by a newline, followed by - 'b'. Outside of quoted strings, escape sequences are not converted, - so the token sequence for [a\\nb] is symbol 'a', symbol '\\', symbol - 'nb' (this matches what a C++ parser would do). The exception is - that a specified TextInput::Settings::otherCommentCharacter preceeded - by a backslash is assumed to be an escaped comment character and is - returned as a symbol token instead of being parsed as a comment - (this is what a LaTex or VRML parser would do). - - Examples - -

-  TextInput ti(TextInput::FROM_STRING, "name = \"Max\", height = 6");
-
-  Token t;
-
-  t = ti.read(); 
-  debugAssert(t.type == Token::SYMBOL);
-  debugAssert(t.sval == "name");
-
-  ti.read();
-  debugAssert(t.type == Token::SYMBOL);
-  debugAssert(t.sval == "=");
-
-  std::string name = ti.read().sval;
-  ti.read();
-  
- -
-  TextInput ti(TextInput::FROM_STRING, "name = \"Max\", height = 6");
-  ti.readSymbols("name", "=");
-  std::string name = ti.readString();
-  ti.readSymbols(",", "height", "=");
-  double height = ti. readNumber();
-  
- - Assumes that the file is not modified once opened. - */ -class TextInput { -public: - - /** Tokenizer configuration options. */ - class Settings { - public: - /** If true, C-style slash-star marks a multi-line comment. - - See generateCommentTokens for rules on how this is applied. - - Default is true. - */ - bool cppBlockComments; - - /** If true, // begins a single line comment. - - See generateCommentTokens for rules on how this is applied. - - Default is true. - */ - bool cppLineComments; - - /** If true, otherCommentCharacter and otherCommentCharacter2 - are used to begin single line comments in the same way - cppLineComments is. - - See generateCommentTokens for rules on how this is applied. - - Default is true. - */ - bool otherLineComments; - - /** If true, \\r, \\n, \\t, \\0, \\\\ and other escape sequences inside - strings are converted to the equivalent C++ escaped character. - If false, backslashes are treated literally. It is convenient to - set to false if reading Windows paths, for example, like - c:\\foo\\bar. - - Default is true. - */ - bool escapeSequencesInStrings; - - /** If not '\\0', specifies a character that begins single line - comments ('#' and '%' are popular choices). This is independent - of the cppLineComments flag. If the character appears in text with - a backslash in front of it, it is considered escaped and is not - treated as a comment character. - - Default is '\\0'. - */ - char otherCommentCharacter; - - /** Another (optional) 1-comment character. Useful for files that - support multiple comment syntaxes. Default is '\\0'. - */ - char otherCommentCharacter2; - - /** If true, comments enabled by cppBlockComments, cppLineComments - and otherLineComments will generate their respective tokens. - If false, the same settings will enable parsing and ignoring - comments - - Default is false. - */ - bool generateCommentTokens; - - /** If true, newlines will generate tokens. - If false, newlines will be discarded as whitespace when parsed - outside of other tokens. - - Default is false. - */ - bool generateNewlineTokens; - - /** If true, "-1" parses as the number -1 instead of the - symbol "-" followed by the number 1. Default is true.*/ - bool signedNumbers; - - /** If true, strings can be marked with single quotes (e.g., - 'aaa'). If false, the quote character is parsed as a - symbol. Default is true. Backquote (`) is always parsed - as a symbol. */ - bool singleQuotedStrings; - - /** The character to use as a single quote. Defaults to "'" (backquote), - occasionally useful to set to "`" (forward quote) or to "," (comma) for - reading CSV files. */ - char singleQuoteCharacter; - - /** If set to a non-empty string, that string will be used in - place of the real file name (or in place of a pseudonym - constructed from the buffer if given FROM_STRING) in - tokens and exceptions. - - Default is empty. - */ - std::string sourceFileName; - - - /** Added to the line number reported by peekLineNumber and in - exceptions. Useful for concatenating files that are - parsed separately. Default is zero. */ - int startingLineNumberOffset; - - /** - Parse -1.#IND00 as the floating point number returned by - nan(), -1.#INF00 as -inf(), and 1.#INF00 as inf(). Note - that the C99 standard specifies that a variety of formats - like "NaN" and "nan" are to be used; these are easier to - parse yourself and not currently supported by readNumber. - - An alternative to specifying msvcSpecials is to read numbers as: -
-            Token x = t.read();
-            Token y = t.peek();
-            if ((x.string() == "-1.") && 
-                (y.string() == "#INF00") && 
-                (y.character() == x.character() + 3) &&
-                (y.line() == x.line()) {
-                t.read();
-                return nan();
-            }
-            // ... similar cases for inf
-          
- - If the single-comment character was #, the floating point - special format overrides the comment and will be parsed - instead. - - If signedNumbers is false msvcSpecials will not be parsed. - - Default is true. */ - bool msvcSpecials; - - /** - Parse the following set of useful proof symbols: - - => - ::> - <:: - :> - <: - |- - ::= - := - <- - - Default is false. - */ - bool proofSymbols; - - /** - When parsing booleans and msvcSpecials, is case significant? - Default is {true} - */ - bool caseSensitive; - - /** All symbols that will become the 'true' boolean token. See also caseSensitive. - Clear this value to disable parsing of true booleans. - - Default is {true}. - */ - Set trueSymbols; - - /** See trueSymbols. Default is {false}*/ - Set falseSymbols; - - Settings(); - }; - -private: - - std::deque stack; - - /** - Characters to be tokenized. - */ - Array buffer; - - /** - Offset of current character (the next character to consumed) in - input buffer. - */ - int currentCharOffset; - - /** - Line number of next character to be consumed from the input buffer. (1 - indicates first line of input.) - - Note that this is the line number of the @e next character to be - consumed from the input, not the line number of the @e last character - consumed! - */ - int lineNumber; - - /** - Character number (within the line) of the next character to be consumed - from the input buffer. (1 indicates first character of the line). - - Note that this is the character number of the @e next character to be - consumed from the input, not the character number of the @e last - character consumed! - */ - int charNumber; - - /** Configuration options. This includes the file name that will be - reported in tokens and exceptions. */ - Settings options; - - void init(); - - /** - Consumes the next character from the input buffer, and returns that - character. Updates lineNumber and charNumber to reflect the location of - the next character in the input buffer. - - Note: you shouldn't be using the return value of this function in most - cases. In general, you should peekInputChar() to get the next - character, determine what to do with it, then consume it with this - function (or with eatAndPeekInputChar()). Given that usage, in most - instances you already know what this function would return! - */ - int eatInputChar(); - - /** - Returns the next character from the input buffer, without consuming any - characters. Can also be used to look deeper into the input buffer. - Does not modify lineNumber or charNumber. - - @param distance Index of the character in the input buffer to peek at, - relative to the next character. Default is 0, for the next character in - the input buffer. - */ - int peekInputChar(int distance = 0); - - /** - Helper function to consume the next character in the input buffer and - peek at the one following (without consuming it). - */ - inline int eatAndPeekInputChar() { - eatInputChar(); - return peekInputChar(0); - } - - /** - Read the next token, returning an END token if no more input is - available. - */ - Token nextToken(); - - /** - Helper for nextToken. Appends characters to t._string until the end - delimiter is reached. - - When called, the next character in the input buffer should be first the - first character after the opening delimiter character. - */ - void parseQuotedString(unsigned char delimiter, Token& t); - -public: - - class TokenException : public ParseError { - public: - /** Name of file being parsed when exception occurred. - \deprecated Use filename - */ - std::string sourceFile; - - virtual ~TokenException() {} - - protected: - - TokenException( - const std::string& src, - int ln, - int ch); - - }; - - /** While parsing a number of the form 1.\#IN?00, ? was - not 'D' or 'F'. */ - class BadMSVCSpecial : public TokenException { - public: - - BadMSVCSpecial( - const std::string& src, - int ln, - int ch); - }; - - /** Thrown by the read methods. */ - class WrongTokenType : public TokenException { - public: - Token::Type expected; - Token::Type actual; - - WrongTokenType( - const std::string& src, - int ln, - int ch, - Token::Type e, - Token::Type a); - }; - - class WrongSymbol : public TokenException { - public: - std::string expected; - std::string actual; - - WrongSymbol( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a); - }; - - - /** String read from input did not match expected string. */ - class WrongString : public TokenException { - public: - std::string expected; - std::string actual; - - WrongString( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a); - }; - - TextInput(const std::string& filename, const Settings& settings = Settings()); - - enum FS {FROM_STRING}; - /** Creates input directly from a string. The first argument must be - TextInput::FROM_STRING. - */ - TextInput(FS fs, const std::string& str, const Settings& settings = Settings()); - - /** Returns true while there are tokens remaining. */ - bool hasMore(); - - /** Read the next token (which will be the END token if ! hasMore()). - - Signed numbers can be handled in one of two modes. If the option - TextInput::Settings::signedNumbers is true, - A '+' or '-' immediately before a number is prepended onto that number and - if there is intervening whitespace, it is read as a separate symbol. - - If TextInput::Settings::signedNumbers is false, - read() does not distinguish between a plus or minus symbol next - to a number and a positive/negative number itself. For example, "x - 1" and "x -1" - will be parsed the same way by read(). - - In both cases, readNumber() will contract a leading "-" or "+" onto - a number. - */ - Token read(); - - /** Calls read() until the result is not a newline or comment */ - Token readSignificant(); - - /** Read one token (or possibly two) as a number or throws - WrongTokenType, and returns the number. - - If the first token in the input is a number, it is returned directly. - - If TextInput::Settings::signedNumbers is false and the input stream - contains a '+' or '-' symbol token immediately followed by a number - token, both tokens will be consumed and a single token will be - returned by this method. - - WrongTokenType will be thrown if one of the input conditions - described above is not satisfied. When an exception is thrown, no - tokens are consumed. - */ - double readNumber(); - - bool readBoolean(); - - /** Reads a string token or throws WrongTokenType, and returns the token. - - Use this method (rather than readString) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a string. When an exception is thrown, no tokens are - consumed. - */ - Token readStringToken(); - - /** Like readStringToken, but returns the token's string. - - Use this method (rather than readStringToken) if you want the token's - value but don't really care about its location in the input. Use of - readStringToken is encouraged for better error reporting. - */ - std::string readString(); - - /** Reads a specific string token or throws either WrongTokenType or - WrongString. If the next token in the input is a string matching @p - s, it will be consumed. - - Use this method if you want to match a specific string from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a string. WrongString will be thrown if the next token in the - input stream is a string but does not match the @p s parameter. When - an exception is thrown, no tokens are consumed. - */ - void readString(const std::string& s); - - /** Reads a comment token or throws WrongTokenType, and returns the token. - - Use this method (rather than readComment) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a comment. When an exception is thrown, no tokens are - consumed. - */ - Token readCommentToken(); - - /** Like readCommentToken, but returns the token's string. - - Use this method (rather than readCommentToken) if you want the token's - value but don't really care about its location in the input. Use of - readCommentToken is encouraged for better error reporting. - */ - std::string readComment(); - - /** Reads a specific comment token or throws either WrongTokenType or - WrongString. If the next token in the input is a comment matching @p - s, it will be consumed. - - Use this method if you want to match a specific comment from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a comment. WrongString will be thrown if the next token in the - input stream is a comment but does not match the @p s parameter. When - an exception is thrown, no tokens are consumed. - */ - void readComment(const std::string& s); - - /** Reads a newline token or throws WrongTokenType, and returns the token. - - Use this method (rather than readNewline) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a newline. When an exception is thrown, no tokens are - consumed. - */ - Token readNewlineToken(); - - /** Like readNewlineToken, but returns the token's string. - - Use this method (rather than readNewlineToken) if you want the token's - value but don't really care about its location in the input. Use of - readNewlineToken is encouraged for better error reporting. - */ - std::string readNewline(); - - /** Reads a specific newline token or throws either WrongTokenType or - WrongString. If the next token in the input is a newline matching @p - s, it will be consumed. - - Use this method if you want to match a specific newline from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a newline. WrongString will be thrown if the next token in the - input stream is a newlin but does not match the @p s parameter. When - an exception is thrown, no tokens are consumed. - */ - void readNewline(const std::string& s); - - /** Reads a symbol token or throws WrongTokenType, and returns the token. - - Use this method (rather than readSymbol) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a symbol. When an exception is thrown, no tokens are - consumed. - */ - Token readSymbolToken(); - - /** Like readSymbolToken, but returns the token's string. - - Use this method (rather than readSymbolToken) if you want the token's - value but don't really care about its location in the input. Use of - readSymbolToken is encouraged for better error reporting. - */ - std::string readSymbol(); - - /** Reads a specific symbol token or throws either WrongTokenType or - WrongSymbol. If the next token in the input is a symbol matching @p - symbol, it will be consumed. - - Use this method if you want to match a specific symbol from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a symbol. WrongSymbol will be thrown if the next token in the - input stream is a symbol but does not match the @p symbol parameter. - When an exception is thrown, no tokens are consumed. - */ - void readSymbol(const std::string& symbol); - - - /** Read a series of two specific symbols. See readSymbol. */ - inline void readSymbols(const std::string& s1, const std::string& s2) { - readSymbol(s1); - readSymbol(s2); - } - - /** Read a series of three specific symbols. See readSymbol. */ - inline void readSymbols( - const std::string& s1, - const std::string& s2, - const std::string& s3) { - readSymbol(s1); - readSymbol(s2); - readSymbol(s3); - } - - /** Read a series of four specific symbols. See readSymbol. */ - inline void readSymbols( - const std::string& s1, - const std::string& s2, - const std::string& s3, - const std::string& s4) { - readSymbol(s1); - readSymbol(s2); - readSymbol(s3); - readSymbol(s4); - } - - /** Return a copy of the next token in the input stream, but don't remove - it from the input stream. - */ - Token peek(); - - /** Returns the line number for the @e next token. See also peek. */ - int peekLineNumber(); - - /** Returns the character number (relative to the line) for the @e next - token in the input stream. See also peek. - */ - int peekCharacterNumber(); - - /** Take a previously read token and push it back at the front of the - input stream. - - Can be used in the case where more than one token of read-ahead is - needed (i.e., when peek doesn't suffice). - */ - void push(const Token& t); - - /** Returns the filename from which this input is drawn, or the first few - characters of the string if created from a string. - If settings::filename is non-empty that will replace the - true filename.*/ - const std::string& filename() const; -}; - -void deserialize(bool& b, TextInput& ti); -void deserialize(int& b, TextInput& ti); -void deserialize(uint8& b, TextInput& ti); -void deserialize(double& b, TextInput& ti); -void deserialize(float& b, TextInput& ti); -void deserialize(std::string& b, TextInput& ti); - -} // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/TextOutput.h b/dep/include/g3dlite/G3D/TextOutput.h deleted file mode 100644 index 4c22b7d5653..00000000000 --- a/dep/include/g3dlite/G3D/TextOutput.h +++ /dev/null @@ -1,249 +0,0 @@ -/** - @file TextOutput.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2004-06-21 - @edited 2006-10-24 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TEXTOUTPUT_H -#define G3D_TEXTOUTPUT_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include - -namespace G3D { - -/** - Convenient formatting of ASCII text written to a file. -

- - The core writeString, writeNumber, and writeSymbol methods map to TextInput's - methods. Number and Symbol each print an additional space that is used to - separate adjacent tokens. - - TextOutput::printf allows arbitrary text to be conveniently dumped - en-masse. Use [de]serialize(bool, TextOutput) and other overloads to read/write - primitive types in a standardized manner and - -

- When a word-wrap line break occurs, all whitespace between words is replaced - with a single newline (the newline may be two characters-- see - G3D::TextOutput::Options::NewlineStyle). Word wrapping occurs against - the number of columns specified by Options::numColumns, minus the current - indent level. - - Indenting adds the specified number of spaces immediately after a newline. - If a newline was followed by spaces in the original string, these are added - to the indent spaces. Indenting will indent blank lines and will leave - indents after the last newline of a file (if the indent level is non-zero at the end). - -

Serialization/Marshalling -

Text serialization is accomplished using TextOutput by defining the pair of - methods: - -
-  void serialize(TextOutput& to) const;
-  void deserialize(TextInput& ti);
-  
- - See also G3D::TextInput. - -

- BETA API -

This API is subject to change in future versions. - */ -class TextOutput { -public: - - class Settings { - public: - /** - WRAP_NONE Word wrapping is disabled - WRAP_WITHOUT_BREAKING Word-wrap, but don't break continuous lines that - are longer than numColumns (default) - WRAP_ALWAYS Wrap even if it means breaking a continuous line or - a quoted string. - - Word wrapping is only allowed at whitespaces ('\\n', '\\r', '\\t', ' '); it - will not occur after commas, punctuation, minus signs, or any other characters - */ - enum WordWrapMode {WRAP_NONE, WRAP_WITHOUT_BREAKING, WRAP_ALWAYS}; - - /** Defaults to WRAP_WITHOUT_BREAKING */ - WordWrapMode wordWrap; - - /** Is word-wrapping allowed to insert newlines inside double quotes? - Default: false */ - bool allowWordWrapInsideDoubleQuotes; - - /** Number of columns for word wrapping. Default: 8 */ - int numColumns; - - /** Number of spaces in each indent. Default: 4 */ - int spacesPerIndent; - - /** Style of newline used by word wrapping and by (optional) conversion. - default: Windows: NEWLINE_WINDOWS, Linux, OS X: NEWLINE_UNIX. - */ - enum NewlineStyle {NEWLINE_WINDOWS, NEWLINE_UNIX}; - - NewlineStyle newlineStyle; - - /** If true, all newlines are converted to NewlineStyle regardless of - how they start out. Default: true. */ - bool convertNewlines; - - /** Used by writeBoolean */ - std::string trueSymbol; - - /** Used by writeBoolean */ - std::string falseSymbol; - - Settings() : - wordWrap(WRAP_WITHOUT_BREAKING), - allowWordWrapInsideDoubleQuotes(false), - numColumns(80), - spacesPerIndent(4), - convertNewlines(true), - trueSymbol("true"), - falseSymbol("false") { - #ifdef G3D_WIN32 - newlineStyle = NEWLINE_WINDOWS; - #else - newlineStyle = NEWLINE_UNIX; - #endif - } - }; - -private: - - /** Used by indentAndAppend to tell when we are writing the - first character of a new line. - - So that push/popIndent work correctly, we cannot indent - immediately after writing a newline. Instead we must - indent on writing the first character after that - newline. - */ - bool startingNewLine; - - /** Number of characters at the end of the buffer since the last newline */ - int currentColumn; - - /** True if we have seen an open " and no close ".*/ - bool inDQuote; - - /** Empty if there is none */ - std::string filename; - - Array data; - - Settings option; - - /** Number of indents to prepend before each line. Always set using setIndentLevel.*/ - int indentLevel; - - void setIndentLevel(int i); - - /** Actual number of spaces to indent. */ - int indentSpaces; - - /** the newline character(s) */ - std::string newline; - - void setOptions(const Settings& _opt); - - /** Converts to the desired newlines. Called from vprintf */ - void convertNewlines(const std::string& in, std::string& out); - - /** Called from vprintf */ - void wordWrapIndentAppend(const std::string& str); - - /** Appends the character to data, indenting whenever a newline is encountered. - Called from wordWrapIndentAppend */ - void indentAppend(char c); - -public: - - explicit TextOutput(const std::string& filename, const Settings& options = Settings()); - - /** Constructs a text output that can later be commited to a string instead of a file.*/ - explicit TextOutput(const Settings& options = Settings()); - - /** Commit to the filename specified on the constructor. - Not called from the destructor; you must call - it yourself. - @param flush If true (default) the file is ready for reading when the method returns, otherwise - the method returns immediately and writes the file in the background.*/ - void commit(bool flush = true); - - /** Commits to this string */ - void commitString(std::string& string); - - /** Increase indent level by 1 */ - void pushIndent(); - - void popIndent(); - - /** Produces a new string that contains the output */ - std::string commitString(); - - /** Writes a quoted string. Special characters in the string (e.g., \\, \\t, \\n) are escaped so that - TextInput will produce the identical string on reading.*/ - void writeString(const std::string& string); - - void writeBoolean(bool b); - - void writeNumber(double n); - - void writeNumber(int n); - - void writeNewline(); - void writeNewlines(int numLines); - - /** The symbol is written without quotes. Symbols are required to begin with a - letter or underscore and contain only letters, underscores, and numbers - or be a C++ symbol (e.g. "{", "(", "++", etc.) - so that they may be properly parsed by TextInput::readSymbol. Symbols are - printed with a trailing space.*/ - void writeSymbol(const std::string& string); - - /** Convenient idiom for writing multiple symbols in a row, e.g. - writeSymbols("name", "="); The empty symbols are not written. - */ - void writeSymbols( - const std::string& a, - const std::string& b = "", - const std::string& c = "", - const std::string& d = "", - const std::string& e = "", - const std::string& f = ""); - - /** Normal printf conventions. Note that the output will be reformatted - for word-wrapping and newlines */ - void __cdecl printf(const char* fmt, ...) - G3D_CHECK_PRINTF_METHOD_ARGS; - - // Can't pass by reference because that confuses va_start - void __cdecl printf(const std::string fmt, ...); - void __cdecl vprintf(const char* fmt, va_list argPtr) - G3D_CHECK_VPRINTF_METHOD_ARGS; -}; - -// Primitive serializers -void serialize(const bool& b, TextOutput& to); -void serialize(const int& b, TextOutput& to); -void serialize(const uint8& b, TextOutput& to); -void serialize(const double& b, TextOutput& to); -void serialize(const float& b, TextOutput& to); -void serialize(const std::string& b, TextOutput& to); -void serialize(const char* b, TextOutput& to); - -} - -#endif diff --git a/dep/include/g3dlite/G3D/ThreadSet.h b/dep/include/g3dlite/G3D/ThreadSet.h deleted file mode 100644 index 121f1415a1d..00000000000 --- a/dep/include/g3dlite/G3D/ThreadSet.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef G3D_THREADSET_H -#define G3D_THREADSET_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/ReferenceCount.h" -#include "G3D/GThread.h" -#include "G3D/GMutex.h" - -namespace G3D { - -/** Manages a set of threads. All methods are threadsafe except for - the iterator begin/end. - - @beta*/ -class ThreadSet : public ReferenceCountedObject { -public: - /** Intended to allow future use with a template parameter.*/ - typedef GThread Thread; - - typedef ReferenceCountedPointer ThreadRef; - typedef ReferenceCountedPointer Ref; - typedef Array::Iterator Iterator; - typedef Array::ConstIterator ConstIterator; - -private: - - /** Protects m_thread */ - GMutex m_lock; - - /** Threads in the set */ - Array m_thread; - -public: - - /** Total number of threads (some of which may be completed). */ - int size() const; - - /** Number of threads that have been started */ - int numStarted() const; - - /** Start all threads that are not currently started. - - @param lastThreadBehavior If USE_CURRENT_THREAD, takes the last unstarted thread and executes it manually on - the current thread. This helps to take full advantage of the machine when - running a large number of jobs and avoids the overhead of a thread start for single-thread groups. - Note that this forces start() to block until - that thread is complete. - */ - void start(GThread::SpawnBehavior lastThreadBehavior = GThread::USE_NEW_THREAD) const; - - /** Terminate all threads that are currently started */ - void terminate() const; - - /** Waits until all started threads have completed. */ - void waitForCompletion() const; - - /** Remove all (not stopping them) */ - void clear(); - - /** Removes completed threads and returns the new size.*/ - int removeCompleted(); - - /** Inserts a new thread, if it is not already present, and - returns the new number of threads.*/ - int insert(const ThreadRef& t); - - /** Removes a thread. Returns true if the thread was present and - removed. */ - bool remove(const ThreadRef& t); - - bool contains(const ThreadRef& t) const; - - /** It is an error to mutate the ThreadSet while iterating through it. */ - Iterator begin(); - - Iterator end(); - - ConstIterator begin() const; - - ConstIterator end() const; -}; - - -} // namespace G3D - -#endif diff --git a/dep/include/g3dlite/G3D/Triangle.h b/dep/include/g3dlite/G3D/Triangle.h deleted file mode 100644 index 590dbaad946..00000000000 --- a/dep/include/g3dlite/G3D/Triangle.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - @file Triangle.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-04-05 - @edited 2008-10-06 - - @cite Random point method by Greg Turk, Generating random points in triangles. In A. S. Glassner, ed., Graphics Gems, pp. 24-28. Academic Press, 1990 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TRIANGLE_H -#define G3D_TRIANGLE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/BoundsTrait.h" -#include "G3D/debugAssert.h" -#include - -namespace G3D { - -/** - A generic triangle representation. This should not be used - as the underlying triangle for creating models; it is intended - for providing fast property queries but requires a lot of - storage and is mostly immutable. - */ -class Triangle { -private: - friend class CollisionDetection; - friend class Ray; - - Vector3 _vertex[3]; - - /** edgeDirection[i] is the normalized vector v[i+1] - v[i] */ - Vector3 edgeDirection[3]; - float edgeMagnitude[3]; - Plane _plane; - Vector3::Axis _primaryAxis; - - /** vertex[1] - vertex[0] */ - Vector3 _edge01; - - /** vertex[2] - vertex[0] */ - Vector3 _edge02; - - float _area; - - void init(const Vector3& v0, const Vector3& v1, const Vector3& v2); - -public: - - Triangle(class BinaryInput& b); - void serialize(class BinaryOutput& b); - void deserialize(class BinaryInput& b); - - Triangle(); - - Triangle(const Vector3& v0, const Vector3& v1, const Vector3& v2); - - ~Triangle(); - - /** 0, 1, or 2 */ - inline const Vector3& vertex(int n) const { - debugAssert((n >= 0) && (n < 3)); - return _vertex[n]; - } - - /** vertex[1] - vertex[0] */ - inline const Vector3& edge01() const { - return _edge01; - } - - /** vertex[2] - vertex[0] */ - inline const Vector3& edge02() const { - return _edge02; - } - - float area() const; - - Vector3::Axis primaryAxis() const { - return _primaryAxis; - } - - const Vector3& normal() const; - - /** Barycenter */ - Vector3 center() const; - - const Plane& plane() const; - - /** Returns a random point in the triangle. */ - Vector3 randomPoint() const; - - inline void getRandomSurfacePoint - (Vector3& P, - Vector3& N = Vector3::ignore()) const { - P = randomPoint(); - N = normal(); - } - - /** - For two triangles to be equal they must have - the same vertices in the same order. - That is, vertex[0] == vertex[0], etc. - */ - inline bool operator==(const Triangle& other) const { - for (int i = 0; i < 3; ++i) { - if (_vertex[i] != other._vertex[i]) { - return false; - } - } - - return true; - } - - inline size_t hashCode() const { - return - _vertex[0].hashCode() + - (_vertex[1].hashCode() >> 2) + - (_vertex[2].hashCode() >> 3); - } - - void getBounds(class AABox&) const; - - /** - @brief Intersect the ray at distance less than @a distance. - - @param distance Set to the maximum distance (can be G3D::inf()) - to search for an intersection. On return, this is the smaller - of the distance to the intersection, if one exists, and the original - value. - - @param baryCoord If a triangle is hit before @a distance, a - the barycentric coordinates of the hit location on the triangle. - Otherwise, unmodified. - - @return True if there was an intersection before the original distance. - */ - bool intersect(const class Ray& ray, float& distance, float baryCoord[3]) const; -}; - -} // namespace G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::Triangle& key) { return key.hashCode(); } -}; - - -template<> struct BoundsTrait { - static void getBounds(const G3D::Triangle& t, G3D::AABox& out) { t.getBounds(out); } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/UprightFrame.h b/dep/include/g3dlite/G3D/UprightFrame.h deleted file mode 100644 index ad5157cb14b..00000000000 --- a/dep/include/g3dlite/G3D/UprightFrame.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - @file UprightFrame.h - - @author Morgan McGuire, http://graphics.cs.williams.edu - */ - -#ifndef G3D_UPRIGHTFRAME_H -#define G3D_UPRIGHTFRAME_H - -#include "G3D/platform.h" -#include "G3D/Spline.h" -#include "G3D/Vector3.h" -#include "G3D/CoordinateFrame.h" - -namespace G3D { - -/** - Coordinate frame expressed in Euler angles. - Unlike a G3D::Quat, UprightFrame always keeps the reference frame from rolling about its own z axis. - Particularly useful for cameras. - - @sa G3D::CoordinateFrame, G3D::Matrix4, G3D::PhysicsFrame, G3D::UprightSpline, G3D::UprightSplineManipulator - */ -class UprightFrame { -public: - - Vector3 translation; - - /** -pi/2 < pitch < pi/2 in radians about the X-axis */ - float pitch; - - /** In radians about the Y-axis */ - float yaw; - - inline UprightFrame(const Vector3& t = Vector3::zero(), float p = 0, float y = 0) - : translation(t), pitch(p), yaw(y) {} - - UprightFrame(const CoordinateFrame& cframe); - - CoordinateFrame toCoordinateFrame() const; - - /** Supports implicit cast to CoordinateFrame */ - inline operator CoordinateFrame() const { - return toCoordinateFrame(); - } - - /** Required for use with spline */ - UprightFrame operator+(const UprightFrame& other) const; - - /** Required for use with spline */ - UprightFrame operator*(const float k) const; - - /** - Unwraps the yaw values in the elements of the array such that - they still represent the same angles but strictly increase/decrease - without wrapping about zero. For use with Spline - */ - static void unwrapYaw(UprightFrame* a, int N); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); -}; - -/** Shortest-path linear velocity spline for camera positions. Always keeps the camera from rolling. -@sa G3D::UprightSplineManipulator, G3D::UprightFrame -*/ -class UprightSpline : public Spline { -protected: - - virtual void ensureShortestPath(UprightFrame* A, int N) const { - UprightFrame::unwrapYaw(A, N); - } - -public: - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/Vector2.h b/dep/include/g3dlite/G3D/Vector2.h deleted file mode 100644 index dba7353785e..00000000000 --- a/dep/include/g3dlite/G3D/Vector2.h +++ /dev/null @@ -1,454 +0,0 @@ -/** - @file Vector2.h - - 2D vector class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2008-11-30 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_VECTOR2_H -#define G3D_VECTOR2_H - -#include - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/Vector2int16.h" -#include "G3D/Random.h" - -namespace G3D { - -class Vector2; -class Vector3; -class Vector4; -class Any; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector2 { -private: - // Hidden operators - bool operator<(const Vector2&) const; - bool operator>(const Vector2&) const; - bool operator<=(const Vector2&) const; - bool operator>=(const Vector2&) const; - -public: - float x; - float y; - - /** \param any Must either Vector2(#, #) or Vector2 {x = #, y = #}*/ - Vector2(const Any& any); - - /** Converts the Vector2 to an Any. */ - operator Any() const; - - /** Creates the zero vector */ - Vector2(); - Vector2(class TextInput& t); - Vector2(class BinaryInput& b); - Vector2(float x, float y); - Vector2(float coordinate[2]); - Vector2(double coordinate[2]); - Vector2(const Vector2& other); - Vector2(const Vector2int16& other); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - void serialize(class TextOutput& t) const; - void deserialize(class TextInput& t); - - float& operator[](int i); - const float& operator[](int i) const; - - // assignment and comparison - Vector2& operator=(const Vector2& other); - bool operator==(const Vector2& other) const; - bool operator!=(const Vector2& other) const; - size_t hashCode() const; - bool fuzzyEq(const Vector2& other) const; - bool fuzzyNe(const Vector2& other) const; - - /** Returns true if this vector has finite length */ - bool isFinite() const; - - /** Returns true if this vector has length == 0 */ - bool isZero() const; - - /** Returns true if this vector has length == 1 */ - bool isUnit() const; - - // arithmetic operations - Vector2 operator+(const Vector2& v) const; - Vector2 operator-(const Vector2& v) const; - Vector2 operator*(float s) const; - - /** Array (pointwise) multiplication */ - Vector2 operator*(const Vector2& v) const; - - /** Array division */ - Vector2 operator/(const Vector2& v) const; - Vector2 operator/(float s) const; - - /** Unary minus */ - Vector2 operator-() const; - - /** x + y */ - inline float sum() const { - return x + y; - } - - /** - Linear interpolation - */ - inline Vector2 lerp(const Vector2& v, float alpha) const { - return (*this) + (v - *this) * alpha; - } - - inline Vector2 clamp(const Vector2& low, const Vector2& high) const { - return Vector2( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y)); - } - - inline Vector2 clamp(float low, float high) const { - return Vector2( - (float)G3D::clamp(x, low, high), - (float)G3D::clamp(y, low, high)); - } - - // arithmetic updates - Vector2& operator+=(const Vector2&); - Vector2& operator-=(const Vector2&); - Vector2& operator*=(float); - Vector2& operator/=(float); - Vector2& operator*=(const Vector2&); - Vector2& operator/=(const Vector2&); - - // vector operations - - /** */ - float length() const; - - /** Returns a unit-length vector */ - Vector2 direction() const; - - /** - Potentially less accurate but faster than direction(). - Only works if System::hasSSE is true. - */ - Vector2 fastDirection() const { - return direction(); - } - - float squaredLength() const; - float dot(const Vector2& s) const; - - /** - Make this vector have unit length and return the old length. - If the vector length was less than tolerance, do not normalize. - */ - float unitize(float fTolerance = 1e-06); - - Vector2 min(const Vector2& v) const; - Vector2 max(const Vector2& v) const; - - /** Uniformly distributed random vector on the unit sphere */ - static Vector2 random(Random& r = Random::common()); - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Vector2& zero(); - static const Vector2& one(); - static const Vector2& unitX(); - static const Vector2& unitY(); - static const Vector2& inf(); - static const Vector2& nan(); - /** smallest (most negative) representable vector */ - static const Vector2& minFinite(); - /** Largest representable vector */ - static const Vector2& maxFinite(); - - std::string toString() const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 xy() const; - Vector2 yy() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - -}; - -inline Vector2 operator*(double s, const Vector2& v) { - return v * (float)s; -} - -inline Vector2 operator*(float s, const Vector2& v) { - return v * s; -} - -inline Vector2 operator*(int s, const Vector2& v) { - return v * (float)s; -} - - -inline Vector2::Vector2 () : x(0.0f), y(0.0f) { -} - - -inline Vector2::Vector2(float _x, float _y) : x(_x), y(_y) { -} - - -inline Vector2::Vector2 (float afCoordinate[2]) { - x = afCoordinate[0]; - y = afCoordinate[1]; -} - - - -inline Vector2::Vector2 (double afCoordinate[2]) { - x = (float)afCoordinate[0]; - y = (float)afCoordinate[1]; -} - - -inline Vector2::Vector2 (const Vector2& rkVector) { - x = rkVector.x; - y = rkVector.y; -} - - -inline Vector2::Vector2 (const Vector2int16& v) : x(v.x), y(v.y) { -} - - -inline float& Vector2::operator[] (int i) { - return ((float*)this)[i]; -} - - -inline const float& Vector2::operator[] (int i) const { - return ((float*)this)[i]; -} - - -inline Vector2& Vector2::operator= (const Vector2& rkVector) { - x = rkVector.x; - y = rkVector.y; - return *this; -} - - -inline bool Vector2::operator== (const Vector2& rkVector) const { - return ( x == rkVector.x && y == rkVector.y); -} - - -inline bool Vector2::operator!= (const Vector2& rkVector) const { - return ( x != rkVector.x || y != rkVector.y); -} - - -inline Vector2 Vector2::operator+ (const Vector2& rkVector) const { - return Vector2(x + rkVector.x, y + rkVector.y); -} - - -inline Vector2 Vector2::operator- (const Vector2& rkVector) const { - return Vector2(x - rkVector.x, y - rkVector.y); -} - - -inline Vector2 Vector2::operator* (float fScalar) const { - return Vector2(fScalar*x, fScalar*y); -} - - - -inline Vector2 Vector2::operator- () const { - return Vector2( -x, -y); -} - - - -inline Vector2& Vector2::operator+= (const Vector2& rkVector) { - x += rkVector.x; - y += rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator-= (const Vector2& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - return *this; -} - - - - -inline Vector2& Vector2::operator*= (const Vector2& rkVector) { - x *= rkVector.x; - y *= rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator/= (const Vector2& rkVector) { - x /= rkVector.x; - y /= rkVector.y; - return *this; -} - - -inline Vector2 Vector2::operator* (const Vector2& rkVector) const { - return Vector2(x * rkVector.x, y * rkVector.y); -} - - - -inline Vector2 Vector2::operator/ (const Vector2& rkVector) const { - return Vector2(x / rkVector.x, y / rkVector.y); -} - - -inline float Vector2::squaredLength () const { - return x*x + y*y; -} - - -inline float Vector2::length () const { - return sqrtf(x*x + y*y); -} - - -inline Vector2 Vector2::direction () const { - float lenSquared = x * x + y * y; - - if (lenSquared != 1.0f) { - return *this / sqrtf(lenSquared); - } else { - return *this; - } -} - - - -inline float Vector2::dot (const Vector2& rkVector) const { - return x*rkVector.x + y*rkVector.y; -} - - - -inline Vector2 Vector2::min(const Vector2 &v) const { - return Vector2(G3D::min(v.x, x), G3D::min(v.y, y)); -} - - - -inline Vector2 Vector2::max(const Vector2 &v) const { - return Vector2(G3D::max(v.x, x), G3D::max(v.y, y)); -} - - - -inline bool Vector2::fuzzyEq(const Vector2& other) const { - return G3D::fuzzyEq((*this - other).squaredLength(), 0); -} - - - -inline bool Vector2::fuzzyNe(const Vector2& other) const { - return G3D::fuzzyNe((*this - other).squaredLength(), 0); -} - - - -inline bool Vector2::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y); -} - - - -inline bool Vector2::isZero() const { - return (x == 0.0f) && (y == 0.0f); -} - - - -inline bool Vector2::isUnit() const { - return squaredLength() == 1.0f; -} - -} // namespace G3D - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Vector2& key) { - return key.hashCode(); - } -}; - - -// Intentionally outside namespace to avoid operator overloading confusion -inline G3D::Vector2 operator*(double s, const G3D::Vector2& v) { - return v * (float)s; -} -inline G3D::Vector2 operator*(int s, const G3D::Vector2& v) { - return v * (float)s; -} - -#endif diff --git a/dep/include/g3dlite/G3D/Vector2.inl b/dep/include/g3dlite/G3D/Vector2.inl deleted file mode 100644 index 4f7c55a39cf..00000000000 --- a/dep/include/g3dlite/G3D/Vector2.inl +++ /dev/null @@ -1,18 +0,0 @@ -/** - @file Vector2.inl - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite Portions by Laura Wollstadt, graphics3d.com - - @cite Portions based on Dave Eberly'x Magic Software Library - at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-01-14 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -} - diff --git a/dep/include/g3dlite/G3D/Vector2int16.h b/dep/include/g3dlite/G3D/Vector2int16.h deleted file mode 100644 index ba72266d75a..00000000000 --- a/dep/include/g3dlite/G3D/Vector2int16.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - @file Vector2int16.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2003-08-09 - @edited 2004-01-03 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR2INT16_H -#define VECTOR2INT16_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -namespace G3D { - -/** - \class Vector2int16 - A Vector2 that packs its fields into uint16s. - */ -G3D_BEGIN_PACKED_CLASS(2) -class Vector2int16 { -private: - // Hidden operators - bool operator<(const Vector2int16&) const; - bool operator>(const Vector2int16&) const; - bool operator<=(const Vector2int16&) const; - bool operator>=(const Vector2int16&) const; - -public: - G3D::int16 x; - G3D::int16 y; - - Vector2int16() : x(0), y(0) {} - Vector2int16(G3D::int16 _x, G3D::int16 _y) : x(_x), y(_y){} - Vector2int16(const class Vector2& v); - Vector2int16(class BinaryInput& bi); - - inline G3D::int16& operator[] (int i) { - debugAssert(((unsigned int)i) <= 1); - return ((G3D::int16*)this)[i]; - } - - inline const G3D::int16& operator[] (int i) const { - debugAssert(((unsigned int)i) <= 1); - return ((G3D::int16*)this)[i]; - } - - inline Vector2int16 operator+(const Vector2int16& other) const { - return Vector2int16(x + other.x, y + other.y); - } - - inline Vector2int16 operator-(const Vector2int16& other) const { - return Vector2int16(x - other.x, y - other.y); - } - - inline Vector2int16 operator*(const Vector2int16& other) const { - return Vector2int16(x * other.x, y * other.y); - } - - inline Vector2int16 operator*(const int s) const { - return Vector2int16(x * s, y * s); - } - - inline Vector2int16& operator+=(const Vector2int16& other) { - x += other.x; - y += other.y; - return *this; - } - - /** Shifts both x and y */ - inline Vector2int16 operator>>(const int s) const { - return Vector2int16(x >> s, y >> s); - } - - /** Shifts both x and y */ - inline Vector2int16 operator<<(const int s) const { - return Vector2int16(x << s, y << s); - } - - inline Vector2int16& operator-=(const Vector2int16& other) { - x -= other.x; - y -= other.y; - return *this; - } - - inline Vector2int16& operator*=(const Vector2int16& other) { - x *= other.x; - y *= other.y; - return *this; - } - - Vector2int16 clamp(const Vector2int16& lo, const Vector2int16& hi); - - inline bool operator== (const Vector2int16& rkVector) const { - return ((int32*)this)[0] == ((int32*)&rkVector)[0]; - } - - inline bool operator!= (const Vector2int16& rkVector) const { - return ((int32*)this)[0] != ((int32*)&rkVector)[0]; - } - - Vector2int16 max(const Vector2int16& v) const { - return Vector2int16(iMax(x, v.x), iMax(y, v.y)); - } - - Vector2int16 min(const Vector2int16& v) const { - return Vector2int16(iMin(x, v.x), iMin(y, v.y)); - } - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); -} -G3D_END_PACKED_CLASS(2) - -} - -template<> struct HashTrait { - static size_t hashCode(const G3D::Vector2int16& key) { return static_cast(key.x + ((int)key.y << 16)); } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/Vector3.h b/dep/include/g3dlite/G3D/Vector3.h deleted file mode 100644 index 4825efb9985..00000000000 --- a/dep/include/g3dlite/G3D/Vector3.h +++ /dev/null @@ -1,798 +0,0 @@ -/** - @file Vector3.h - - 3D vector class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2009-11-01 - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Vector3_h -#define G3D_Vector3_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Random.h" -#include "G3D/Vector2.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/PositionTrait.h" -#include "G3D/Vector2.h" -#include -#include - -namespace G3D { - -class Vector2; -class Vector4; -class Vector4int8; -class Vector3int32; -class Any; - -/** - Swizzles - Vector classes have swizzle operators, e.g. v.xy(), that - allow selection of arbitrary sub-fields. These cannot be used as write - masks. Examples - -
-Vector3 v(1, 2, 3);
-Vector3 j;
-Vector2 b;
-
-b = v.xz();
-j = b.xx();
-
- - - Warning - - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector3 { -public: - - // coordinates - float x, y, z; - -private: - - // Hidden operators - bool operator<(const Vector3&) const; - bool operator>(const Vector3&) const; - bool operator<=(const Vector3&) const; - bool operator>=(const Vector3&) const; - -public: - /** Initializes to zero */ - Vector3(); - - /** \param any Must either Vector3(#, #, #) or Vector3 {x = #, y = #, z = #}*/ - Vector3(const Any& any); - - /** Converts the Vector3 to an Any. */ - operator Any() const; - - /** Divides by 127 */ - Vector3(const Vector4int8&); - Vector3(const class Vector3int32& v); - explicit Vector3(class BinaryInput& b); - Vector3(float _x, float _y, float _z); - explicit Vector3(const class Vector2& v, float _z); - explicit Vector3(float coordinate[3]); - explicit Vector3(double coordinate[3]); - Vector3(const class Vector3int16& v); - explicit Vector3(class TextInput& t); - explicit Vector3(const class Color3& c); - - /** Format is three float32's */ - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** Format is "(%f, %f, %f)" */ - void serialize(class TextOutput& t) const; - void deserialize(class TextInput& t); - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z - // - // WARNING. These member functions rely on - // (1) Vector3 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - const float& __fastcall operator[] (int i) const; - float& operator[] (int i); - - enum Axis {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, DETECT_AXIS=-1}; - - /** - Returns the largest dimension. Particularly convenient for determining - which plane to project a triangle onto for point-in-polygon tests. - */ - Axis primaryAxis() const; - - // assignment and comparison - Vector3& __fastcall operator= (const Vector3& rkVector); - bool operator== (const Vector3& rkVector) const; - bool operator!= (const Vector3& rkVector) const; - size_t hashCode() const; - bool fuzzyEq(const Vector3& other) const; - bool fuzzyNe(const Vector3& other) const; - - /** Returns true if this vector has finite length. */ - bool isFinite() const; - - /** Returns true if this vector has length ~= 0 */ - bool isZero() const; - - /** Returns true if this vector has length ~= 1 */ - bool isUnit() const; - - // arithmetic operations - Vector3 __fastcall operator+ (const Vector3& v) const; - Vector3 __fastcall operator- (const Vector3& v) const; - Vector3 __fastcall operator* (float s) const; - inline Vector3 __fastcall operator/ (float s) const { - return *this * (1.0f / s); - } - Vector3 __fastcall operator* (const Vector3& v) const; - Vector3 __fastcall operator/ (const Vector3& v) const; - Vector3 __fastcall operator- () const; - - // arithmetic updates - Vector3& __fastcall operator+= (const Vector3& v); - Vector3& __fastcall operator-= (const Vector3& v); - Vector3& __fastcall operator*= (float s); - inline Vector3& __fastcall operator/= (float s) { - return (*this *= (1.0f / s)); - } - Vector3& __fastcall operator*= (const Vector3& v); - Vector3& __fastcall operator/= (const Vector3& v); - - /** Same as magnitude */ - float length() const; - - float magnitude() const; - - /** - The result is a nan vector if the length is almost zero. - */ - Vector3 direction() const; - - /** - Potentially less accurate but faster than direction(). - Only works if System::hasSSE is true. - */ - Vector3 fastDirection() const; - - /** - Reflect this vector about the (not necessarily unit) normal. - Assumes that both the before and after vectors point away from - the base of the normal. - - Note that if used for a collision or ray reflection you - must negate the resulting vector to get a direction pointing - away from the collision. - -
-       V'    N      V
-                 
-         r   ^   -,
-          \  |  /
-            \|/
-     
- - See also Vector3::reflectionDirection - */ - Vector3 reflectAbout(const Vector3& normal) const; - - /** - See also G3D::Ray::reflect. - The length is 1. -
-       V'    N       V
-                 
-         r   ^    /
-          \  |  /
-            \|'-
-     
- */ - Vector3 reflectionDirection(const Vector3& normal) const; - - - /** - Returns Vector3::zero() if the length is nearly zero, otherwise - returns a unit vector. - */ - inline Vector3 directionOrZero() const { - float mag = magnitude(); - if (G3D::fuzzyEq(mag, 0.0f)) { - return Vector3::zero(); - } else if (G3D::fuzzyEq(mag, 1.0f)) { - return *this; - } else { - return *this * (1.0f / mag); - } - } - - /** - Returns the direction of a refracted ray, - where iExit is the index of refraction for the - previous material and iEnter is the index of refraction - for the new material. Like Vector3::reflectionDirection, - the result has length 1 and is - pointed away from the intersection. - - Returns Vector3::zero() in the case of total internal refraction. - - @param iOutside The index of refraction (eta) outside - (on the positive normal side) of the surface. - - @param iInside The index of refraction (eta) inside - (on the negative normal side) of the surface. - - See also G3D::Ray::refract. -
-              N      V
-                  
-              ^    /
-              |  /
-              |'-
-          __--
-     V'<--
-     
- */ - Vector3 refractionDirection( - const Vector3& normal, - float iInside, - float iOutside) const; - - /** Synonym for direction */ - inline Vector3 unit() const { - return direction(); - } - - /** Returns a normalized vector. May be computed with lower - precision than unit */ - inline Vector3 fastUnit() const { - return fastDirection(); - } - - /** Same as squaredMagnitude */ - float squaredLength() const; - - float squaredMagnitude () const; - - float __fastcall dot(const Vector3& rkVector) const; - - float unitize(float tolerance = 1e-06); - - /** Cross product. Note that two cross products in a row - can be computed more cheaply: v1 x (v2 x v3) = (v1 dot v3) v2 - (v1 dot v2) v3. - */ - Vector3 __fastcall cross(const Vector3& rkVector) const; - Vector3 unitCross(const Vector3& rkVector) const; - - /** - Returns a matrix such that v.cross() * w = v.cross(w). -
-     [ 0  -v.z  v.y ]
-     [ v.z  0  -v.x ]
-     [ -v.y v.x  0  ]
-     
- */ - class Matrix3 cross() const; - - Vector3 __fastcall min(const Vector3 &v) const; - Vector3 __fastcall max(const Vector3 &v) const; - - /** Smallest element */ - inline float min() const { - return G3D::min(G3D::min(x, y), z); - } - - /** Largest element */ - inline float max() const { - return G3D::max(G3D::max(x, y), z); - } - - std::string toString() const; - - inline Vector3 clamp(const Vector3& low, const Vector3& high) const { - return Vector3( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y), - G3D::clamp(z, low.z, high.z)); - } - - inline Vector3 clamp(float low, float high) const { - return Vector3( - G3D::clamp(x, low, high), - G3D::clamp(y, low, high), - G3D::clamp(z, low, high)); - } - - /** - Linear interpolation - */ - inline Vector3 lerp(const Vector3& v, float alpha) const { - return (*this) + (v - *this) * alpha; - } - - /** Gram-Schmidt orthonormalization. */ - static void orthonormalize (Vector3 akVector[3]); - - /** \brief Random unit vector, uniformly distributed on the sphere. - - Distribution rendered by G3D::DirectionHistogram: - \image html vector3-random.png - */ - static Vector3 random(Random& r = Random::common()); - - /** \brief Random unit vector, distributed according to \f$\max(\cos \theta,0)\f$. - - That is, so that the probability of \f$\vec{V}\f$ is proportional - to \f$\max(\vec{v} \cdot \vec{n}, 0)\f$. Useful in photon mapping for - Lambertian scattering. - - Distribution rendered by G3D::DirectionHistogram: - \image html vector3-coshemirandom.png - - \param n Unit vector at the center of the distribution. - - @cite Henrik Wann Jensen, Realistic Image Synthesis using Photon Mapping eqn 2.24 - */ - static Vector3 cosHemiRandom(const Vector3& n, Random& r = Random::common()); - - /** \brief Random unit vector, distributed according to \f$\max(\cos^k \theta,0)\f$. - - That is, so that the probability of \f$\vec{V}\f$ is - proportional to \f$\max((\vec{v} \cdot \vec{n})^k, 0)\f$. - Useful in photon mapping for glossy scattering. - - Distribution rendered by G3D::DirectionHistogram: - \image html vector3-cospowhemirandom.png - - \param n Unit vector at the center of the distribution. - - @cite Ashikhmin and Shirley, An anisotropic Phong BRDF model, Journal of Graphics Tools, 2002 - */ - static Vector3 cosPowHemiRandom(const Vector3& n, const float k, Random& r = Random::common()); - - /** - \brief Random vector distributed over the hemisphere about normal. - - Distribution rendered by G3D::DirectionHistogram: - \image html vector3-hemirandom.png - */ - static Vector3 hemiRandom(const Vector3& normal, Random& r = Random::common()); - - /** Input W must be initialize to a nonzero vector, output is {U,V,W} - an orthonormal basis. A hint is provided about whether or not W - is already unit length. - @deprecated Use getTangents - */ - static void generateOrthonormalBasis (Vector3& rkU, Vector3& rkV, - Vector3& rkW, bool bUnitLengthW = true); - - inline float sum() const { - return x + y + z; - } - - inline float average() const { - return sum() / 3.0f; - } - - // Special values. - static const Vector3& zero(); - static const Vector3& one(); - static const Vector3& unitX(); - static const Vector3& unitY(); - static const Vector3& unitZ(); - static const Vector3& inf(); - static const Vector3& nan(); - - /** Smallest (most negative) representable vector */ - static const Vector3& minFinite(); - - /** Largest representable vector */ - static const Vector3& maxFinite(); - - - /** Creates two orthonormal tangent vectors X and Y such that - if Z = this, X x Y = Z.*/ - inline void getTangents(Vector3& X, Vector3& Y) const { - debugAssertM(G3D::fuzzyEq(length(), 1.0f), - "makeAxes requires Z to have unit length"); - - // Choose another vector not perpendicular - X = (abs(x) < 0.9f) ? Vector3::unitX() : Vector3::unitY(); - - // Remove the part that is parallel to Z - X -= *this * this->dot(X); - X /= X.length(); - - Y = this->cross(X); - } - - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - - /** Can be passed to ignore a vector3 parameter */ - static Vector3& ignore(); -}; - -inline G3D::Vector3 operator*(float s, const G3D::Vector3& v) { - return v * s; -} - -inline G3D::Vector3 operator*(double s, const G3D::Vector3& v) { - return v * (float)s; -} - -inline G3D::Vector3 operator*(int s, const G3D::Vector3& v) { - return v * (float)s; -} - -std::ostream& operator<<(std::ostream& os, const Vector3&); - - -void serialize(const Vector3::Axis& a, class BinaryOutput& bo); -void deserialize(Vector3::Axis& a, class BinaryInput& bo); - - -//---------------------------------------------------------------------------- -inline Vector3::Vector3() : x(0.0f), y(0.0f), z(0.0f) { -} - -//---------------------------------------------------------------------------- - -inline Vector3::Vector3 (float fX, float fY, float fZ) : x(fX), y(fY), z(fZ) { -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (float V[3]) : x(V[0]), y(V[1]), z(V[2]){ -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (double V[3]) : x((float)V[0]), y((float)V[1]), z((float)V[2]){ -} - -//---------------------------------------------------------------------------- -inline const float& Vector3::operator[] (int i) const { - return ((float*)this)[i]; -} - -inline float& Vector3::operator[] (int i) { - return ((float*)this)[i]; -} - - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator= (const Vector3& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyEq(const Vector3& other) const { - return G3D::fuzzyEq((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyNe(const Vector3& other) const { - return G3D::fuzzyNe((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator== (const Vector3& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator!= (const Vector3& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator+ (const Vector3& rkVector) const { - return Vector3(x + rkVector.x, y + rkVector.y, z + rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- (const Vector3& rkVector) const { - return Vector3(x - rkVector.x, y - rkVector.y, z - rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator* (const Vector3& rkVector) const { - return Vector3(x * rkVector.x, y * rkVector.y, z * rkVector.z); -} - -inline Vector3 Vector3::operator*(float f) const { - return Vector3(x * f, y * f, z * f); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator/ (const Vector3& rkVector) const { - return Vector3(x / rkVector.x, y / rkVector.y, z / rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- () const { - return Vector3(-x, -y, -z); -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator+= (const Vector3& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator-= (const Vector3& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (const Vector3& rkVector) { - x *= rkVector.x; - y *= rkVector.y; - z *= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator/= (const Vector3& rkVector) { - x /= rkVector.x; - y /= rkVector.y; - z /= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredMagnitude () const { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredLength () const { - return squaredMagnitude(); -} - -//---------------------------------------------------------------------------- -inline float Vector3::magnitude() const { - return ::sqrtf(x*x + y*y + z*z); -} - -//---------------------------------------------------------------------------- -inline float Vector3::length() const { - return magnitude(); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::direction () const { - const float lenSquared = squaredMagnitude(); - const float invSqrt = 1.0f / sqrtf(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- - -inline Vector3 Vector3::fastDirection () const { - float lenSquared = x * x + y * y + z * z; - float invSqrt = rsq(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- -inline float Vector3::dot (const Vector3& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::cross (const Vector3& rkVector) const { - return Vector3(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::unitCross (const Vector3& rkVector) const { - Vector3 kCross(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); - kCross.unitize(); - return kCross; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::min(const Vector3 &v) const { - return Vector3(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::max(const Vector3 &v) const { - return Vector3(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::isZero() const { - return G3D::fuzzyEq(squaredMagnitude(), 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isUnit() const { - return G3D::fuzzyEq(squaredMagnitude(), 1.0f); -} - -} // namespace G3D - - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Vector3& key) { - return key.hashCode(); - } -}; - - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector2& v, G3D::Vector3& p) { p = G3D::Vector3(v, 0); } -}; - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector3& v, G3D::Vector3& p) { p = v; } -}; - - -#endif diff --git a/dep/include/g3dlite/G3D/Vector3.inl b/dep/include/g3dlite/G3D/Vector3.inl deleted file mode 100644 index 9211c2a70fd..00000000000 --- a/dep/include/g3dlite/G3D/Vector3.inl +++ /dev/null @@ -1,249 +0,0 @@ -/** - @file Vector3.inl - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - @created 2001-06-02 - @edited 2004-05-21 - Copyright 2000-2004, Morgan McGuire. - All rights reserved. - */ - -//---------------------------------------------------------------------------- -#ifdef SSE - // If you receive an error on this line, it is because you do not have the file - // xmmintrin.h needed for MMX & SSE extensions. Download and install - // - // http://download.microsoft.com/download/vstudio60ent/SP5/Wideband-Full/WIN98Me/EN-US/vs6sp5.exe - // and - // http://download.microsoft.com/download/vb60ent/Update/6/W9X2KXP/EN-US/vcpp5.exe - // - // to get this file. -# include -#endif - -inline unsigned int hashCode(const G3D::Vector3& v) { - return v.hashCode(); -} - -namespace G3D { - -//---------------------------------------------------------------------------- -inline Vector3::Vector3() : x(0.0f), y(0.0f), z(0.0f) { -} - -//---------------------------------------------------------------------------- - -inline Vector3::Vector3 (float fX, float fY, float fZ) : x(fX), y(fY), z(fZ) { -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (float V[3]) : x(V[0]), y(V[1]), z(V[2]){ -} -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (double V[3]) : x((float)V[0]), y((float)V[1]), z((float)V[2]){ -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (const Vector3& V) : x(V.x), y(V.y), z(V.z) { -} - -//---------------------------------------------------------------------------- - -//inline Vector3::Vector3 (const __m128& m) { - // Cast from SSE packed floats -// *this = *(Vector3*)&m; -//} - -//---------------------------------------------------------------------------- -inline const float& Vector3::operator[] (int i) const { - return ((float*)this)[i]; -} - -inline float& Vector3::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator= (const Vector3& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyEq(const Vector3& other) const { - return G3D::fuzzyEq((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyNe(const Vector3& other) const { - return G3D::fuzzyNe((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator== (const Vector3& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator!= (const Vector3& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator+ (const Vector3& rkVector) const { - return Vector3(x + rkVector.x, y + rkVector.y, z + rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- (const Vector3& rkVector) const { - return Vector3(x - rkVector.x, y - rkVector.y, z - rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator* (const Vector3& rkVector) const { - return Vector3(x * rkVector.x, y * rkVector.y, z * rkVector.z); -} - -inline Vector3 Vector3::operator*(float f) const { - return Vector3(x * f, y * f, z * f); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator/ (const Vector3& rkVector) const { - return Vector3(x / rkVector.x, y / rkVector.y, z / rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- () const { - return Vector3(-x, -y, -z); -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator+= (const Vector3& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator-= (const Vector3& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (const Vector3& rkVector) { - x *= rkVector.x; - y *= rkVector.y; - z *= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator/= (const Vector3& rkVector) { - x /= rkVector.x; - y /= rkVector.y; - z /= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredMagnitude () const { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredLength () const { - return squaredMagnitude(); -} - -//---------------------------------------------------------------------------- -inline float Vector3::magnitude() const { - return sqrtf(x*x + y*y + z*z); -} - -//---------------------------------------------------------------------------- -inline float Vector3::length() const { - return magnitude(); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::direction () const { - float lenSquared = squaredMagnitude(); - float invSqrt = 1.0f / sqrtf(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- - -inline Vector3 Vector3::fastDirection () const { - float lenSquared = x * x + y * y + z * z; - float invSqrt = rsq(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- -inline float Vector3::dot (const Vector3& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::cross (const Vector3& rkVector) const { - return Vector3(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::unitCross (const Vector3& rkVector) const { - Vector3 kCross(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); - kCross.unitize(); - return kCross; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::min(const Vector3 &v) const { - return Vector3(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::max(const Vector3 &v) const { - return Vector3(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::isZero() const { - return G3D::fuzzyEq(squaredMagnitude(), 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isUnit() const { - return G3D::fuzzyEq(squaredMagnitude(), 1.0f); -} - -} // namespace diff --git a/dep/include/g3dlite/G3D/Vector3int16.h b/dep/include/g3dlite/G3D/Vector3int16.h deleted file mode 100644 index 3197ea49d1a..00000000000 --- a/dep/include/g3dlite/G3D/Vector3int16.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - @file Vector3int16.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2003-04-07 - @edited 2003-06-24 - Copyright 2000-2004, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR3INT16_H -#define VECTOR3INT16_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -#ifdef _MSC_VER -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -#pragma warning (disable : 4127) -#endif - - -namespace G3D { - -/** - \class Vector3int16 - A Vector3 that packs its fields into uint16s. - */ -G3D_BEGIN_PACKED_CLASS(2) -class Vector3int16 { -private: - // Hidden operators - bool operator<(const Vector3int16&) const; - bool operator>(const Vector3int16&) const; - bool operator<=(const Vector3int16&) const; - bool operator>=(const Vector3int16&) const; - -public: - G3D::int16 x; - G3D::int16 y; - G3D::int16 z; - - Vector3int16() : x(0), y(0), z(0) {} - Vector3int16(G3D::int16 _x, G3D::int16 _y, G3D::int16 _z) : x(_x), y(_y), z(_z) {} - Vector3int16(const class Vector3& v); - Vector3int16(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - inline G3D::int16& operator[] (int i) { - debugAssert(i <= 2); - return ((G3D::int16*)this)[i]; - } - - inline const G3D::int16& operator[] (int i) const { - debugAssert(i <= 2); - return ((G3D::int16*)this)[i]; - } - - inline Vector3int16 operator+(const Vector3int16& other) const { - return Vector3int16(x + other.x, y + other.y, z + other.z); - } - - inline Vector3int16 operator-(const Vector3int16& other) const { - return Vector3int16(x - other.x, y - other.y, z - other.z); - } - - inline Vector3int16 operator*(const Vector3int16& other) const { - return Vector3int16(x * other.x, y * other.y, z * other.z); - } - - inline Vector3int16 operator*(const int s) const { - return Vector3int16(int16(x * s), int16(y * s), int16(z * s)); - } - - inline Vector3int16& operator+=(const Vector3int16& other) { - x += other.x; - y += other.y; - z += other.y; - return *this; - } - - inline Vector3int16& operator-=(const Vector3int16& other) { - x -= other.x; - y -= other.y; - z -= other.z; - return *this; - } - - inline Vector3int16& operator*=(const Vector3int16& other) { - x *= other.x; - y *= other.y; - z *= other.z; - return *this; - } - - inline bool operator== (const Vector3int16& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); - } - - inline bool operator!= (const Vector3int16& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); - } - - Vector3int16 max(const Vector3int16& v) const { - return Vector3int16(std::max(x, v.x), std::max(y, v.y), std::max(z, v.z)); - } - - Vector3int16 min(const Vector3int16& v) const { - return Vector3int16(std::min(x, v.x), std::min(y, v.y), std::min(z, v.z)); - } - - std::string toString() const; -} -G3D_END_PACKED_CLASS(2) - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector3int16& key) { return static_cast(key.x + ((int)key.y << 5) + ((int)key.z << 10)); } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/Vector3int32.h b/dep/include/g3dlite/G3D/Vector3int32.h deleted file mode 100644 index 2f256ea0300..00000000000 --- a/dep/include/g3dlite/G3D/Vector3int32.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - @file Vector3int32.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2008-07-01 - @edited 2008-07-01 - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR3INT32_H -#define VECTOR3INT32_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -namespace G3D { - -/** - \ Vector3int32 - A Vector3 that packs its fields into uint32s. - */ -G3D_BEGIN_PACKED_CLASS(4) -class Vector3int32 { -private: - // Hidden operators - bool operator<(const Vector3int32&) const; - bool operator>(const Vector3int32&) const; - bool operator<=(const Vector3int32&) const; - bool operator>=(const Vector3int32&) const; - -public: - G3D::int32 x; - G3D::int32 y; - G3D::int32 z; - - Vector3int32() : x(0), y(0), z(0) {} - Vector3int32(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {} - Vector3int32(const class Vector3int16& v); - Vector3int32(const class Vector3& v); - Vector3int32(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - inline G3D::int32& operator[] (int i) { - debugAssert(i <= 2); - return ((G3D::int32*)this)[i]; - } - - inline const G3D::int32& operator[] (int i) const { - debugAssert(i <= 2); - return ((G3D::int32*)this)[i]; - } - - inline Vector3int32 operator+(const Vector3int32& other) const { - return Vector3int32(x + other.x, y + other.y, z + other.z); - } - - inline Vector3int32 operator-(const Vector3int32& other) const { - return Vector3int32(x - other.x, y - other.y, z - other.z); - } - - inline Vector3int32 operator*(const Vector3int32& other) const { - return Vector3int32(x * other.x, y * other.y, z * other.z); - } - - inline Vector3int32 operator*(const int s) const { - return Vector3int32(x * s, y * s, z * s); - } - - inline Vector3int32& operator+=(const Vector3int32& other) { - x += other.x; - y += other.y; - z += other.y; - return *this; - } - - inline Vector3int32& operator-=(const Vector3int32& other) { - x -= other.x; - y -= other.y; - z -= other.z; - return *this; - } - - inline Vector3int32& operator*=(const Vector3int32& other) { - x *= other.x; - y *= other.y; - z *= other.z; - return *this; - } - - inline bool operator== (const Vector3int32& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); - } - - inline bool operator!= (const Vector3int32& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); - } - - Vector3int32 max(const Vector3int32& v) const { - return Vector3int32(iMax(x, v.x), iMax(y, v.y), iMax(z, v.z)); - } - - Vector3int32 min(const Vector3int32& v) const { - return Vector3int32(iMin(x, v.x), iMin(y, v.y), iMin(z, v.z)); - } - - std::string toString() const; -} -G3D_END_PACKED_CLASS(4) - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector3int32& key) { - // Mask for the top bit of a uint32 - const G3D::uint32 top = (1UL << 31); - // Mask for the bottom 10 bits of a uint32 - const G3D::uint32 bot = 0x000003FF; - return static_cast(((key.x & top) | ((key.y & top) >> 1) | ((key.z & top) >> 2)) | - (((key.x & bot) << 19) ^ ((key.y & bot) << 10) ^ (key.z & bot))); - } -}; - -#endif diff --git a/dep/include/g3dlite/G3D/Vector4.h b/dep/include/g3dlite/G3D/Vector4.h deleted file mode 100644 index 5e511451f86..00000000000 --- a/dep/include/g3dlite/G3D/Vector4.h +++ /dev/null @@ -1,716 +0,0 @@ -/** - @file Vector4.h - - Homogeneous vector class. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-07-09 - @edited 2008-11-01 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Vector4_h -#define G3D_Vector4_h - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/PositionTrait.h" -#include - -namespace G3D { - -class Vector2; -class Vector3; -class Vector4; -class Vector4int8; -class Any; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector4 { -private: - // Hidden operators - bool operator<(const Vector4&) const; - bool operator>(const Vector4&) const; - bool operator<=(const Vector4&) const; - bool operator>=(const Vector4&) const; - -public: - - /** \param any Must either Vector4(#, #, #, #) or Vector3 {x = #, y = #, z = #, w =#}*/ - Vector4(const Any& any); - - /** Converts the Vector4 to an Any. */ - operator Any() const; - - // construction - Vector4(); - Vector4(float fX, float fY, float fZ, float fW); - Vector4(float afCoordinate[4]); - Vector4(const Vector4& rkVector); - Vector4(const class Color4& c); - Vector4(const Vector3& rkVector, float fW); - Vector4(const Vector2& v1, const Vector2& v2); - Vector4(const Vector2& v1, float fz, float fw); - - /** Divides by 127 when converting */ - Vector4(const Vector4int8&); - - Vector4(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - // coordinates - float x, y, z, w; - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z, etc. - // - // WARNING. These member functions rely on - // (1) Vector4 not having virtual functions - // (2) the data packed in a 4*sizeof(float) memory block - float& operator[] (int i); - const float& operator[] (int i) const; - - // assignment and comparison - Vector4& operator= (const Vector4& rkVector); - bool operator== (const Vector4& rkVector) const; - bool operator!= (const Vector4& rkVector) const; - - static const Vector4& zero(); - - inline void set(float _x, float _y, float _z, float _w) { - x = _x; - y = _y; - z = _z; - w = _w; - } - - inline void set(const Vector3& v, float _w) { - x = v.x; - y = v.y; - z = v.z; - w = _w; - } - - inline void set(const Vector2& v, float _z, float _w) { - x = v.x; - y = v.y; - z = _z; - w = _w; - } - - size_t hashCode() const; - bool fuzzyEq(const Vector4& other) const; - bool fuzzyNe(const Vector4& other) const; - - static const Vector4& inf(); - static const Vector4& nan(); - - /** sqrt(this->dot(*this)) */ - float length() const; - float squaredLength() const; - - inline float sum() const { - return x + y + z + w; - } - - /** Returns true if this vector has finite length */ - bool isFinite() const; - - /** Returns true if this vector has length == 0 */ - bool isZero() const; - - /** Returns true if this vector has length == 1 */ - bool isUnit() const; - - // arithmetic operations - Vector4 operator+ (const Vector4& rkVector) const; - Vector4 operator- (const Vector4& rkVector) const; - - inline Vector4 operator*(const Vector4& rkVector) const { - return Vector4(x * rkVector.x, y * rkVector.y, z * rkVector.z, w * rkVector.w); - } - - inline Vector4 operator/(const Vector4& rkVector) const { - return Vector4(x / rkVector.x, y / rkVector.y, z / rkVector.z, w / rkVector.w); - } - - Vector4 operator*(const class Matrix4& M) const; - - Vector4 operator* (float fScalar) const; - Vector4 operator/ (float fScalar) const; - Vector4 operator- () const; - friend Vector4 operator* (float, const Vector4& rkVector); - - // arithmetic updates - Vector4& operator+= (const Vector4& rkVector); - Vector4& operator-= (const Vector4& rkVector); - Vector4& operator*= (float fScalar); - Vector4& operator/= (float fScalar); - - inline Vector4 clamp(const Vector4& low, const Vector4& high) const { - return Vector4( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y), - G3D::clamp(z, low.z, high.z), - G3D::clamp(w, low.w, high.w)); - } - - inline Vector4 clamp(float low, float high) const { - return Vector4( - G3D::clamp(x, low, high), - G3D::clamp(y, low, high), - G3D::clamp(z, low, high), - G3D::clamp(w, low, high)); - } - - float dot (const Vector4& rkVector) const; - - Vector4 min(const Vector4& v) const; - Vector4 max(const Vector4& v) const; - - std::string toString() const; - - /** - Linear interpolation - */ - Vector4 lerp(const Vector4& v, float alpha) const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 wx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 wy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - Vector2 wz() const; - Vector2 xw() const; - Vector2 yw() const; - Vector2 zw() const; - Vector2 ww() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 wxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 wyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 wzx() const; - Vector3 xwx() const; - Vector3 ywx() const; - Vector3 zwx() const; - Vector3 wwx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 wxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 wyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 wzy() const; - Vector3 xwy() const; - Vector3 ywy() const; - Vector3 zwy() const; - Vector3 wwy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 wxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 wyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - Vector3 wzz() const; - Vector3 xwz() const; - Vector3 ywz() const; - Vector3 zwz() const; - Vector3 wwz() const; - Vector3 xxw() const; - Vector3 yxw() const; - Vector3 zxw() const; - Vector3 wxw() const; - Vector3 xyw() const; - Vector3 yyw() const; - Vector3 zyw() const; - Vector3 wyw() const; - Vector3 xzw() const; - Vector3 yzw() const; - Vector3 zzw() const; - Vector3 wzw() const; - Vector3 xww() const; - Vector3 yww() const; - Vector3 zww() const; - Vector3 www() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 wxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 wyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 wzxx() const; - Vector4 xwxx() const; - Vector4 ywxx() const; - Vector4 zwxx() const; - Vector4 wwxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 wxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 wyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 wzyx() const; - Vector4 xwyx() const; - Vector4 ywyx() const; - Vector4 zwyx() const; - Vector4 wwyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 wxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 wyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 wzzx() const; - Vector4 xwzx() const; - Vector4 ywzx() const; - Vector4 zwzx() const; - Vector4 wwzx() const; - Vector4 xxwx() const; - Vector4 yxwx() const; - Vector4 zxwx() const; - Vector4 wxwx() const; - Vector4 xywx() const; - Vector4 yywx() const; - Vector4 zywx() const; - Vector4 wywx() const; - Vector4 xzwx() const; - Vector4 yzwx() const; - Vector4 zzwx() const; - Vector4 wzwx() const; - Vector4 xwwx() const; - Vector4 ywwx() const; - Vector4 zwwx() const; - Vector4 wwwx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 wxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 wyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 wzxy() const; - Vector4 xwxy() const; - Vector4 ywxy() const; - Vector4 zwxy() const; - Vector4 wwxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 wxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 wyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 wzyy() const; - Vector4 xwyy() const; - Vector4 ywyy() const; - Vector4 zwyy() const; - Vector4 wwyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 wxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 wyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 wzzy() const; - Vector4 xwzy() const; - Vector4 ywzy() const; - Vector4 zwzy() const; - Vector4 wwzy() const; - Vector4 xxwy() const; - Vector4 yxwy() const; - Vector4 zxwy() const; - Vector4 wxwy() const; - Vector4 xywy() const; - Vector4 yywy() const; - Vector4 zywy() const; - Vector4 wywy() const; - Vector4 xzwy() const; - Vector4 yzwy() const; - Vector4 zzwy() const; - Vector4 wzwy() const; - Vector4 xwwy() const; - Vector4 ywwy() const; - Vector4 zwwy() const; - Vector4 wwwy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 wxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 wyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 wzxz() const; - Vector4 xwxz() const; - Vector4 ywxz() const; - Vector4 zwxz() const; - Vector4 wwxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 wxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 wyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 wzyz() const; - Vector4 xwyz() const; - Vector4 ywyz() const; - Vector4 zwyz() const; - Vector4 wwyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 wxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 wyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - Vector4 wzzz() const; - Vector4 xwzz() const; - Vector4 ywzz() const; - Vector4 zwzz() const; - Vector4 wwzz() const; - Vector4 xxwz() const; - Vector4 yxwz() const; - Vector4 zxwz() const; - Vector4 wxwz() const; - Vector4 xywz() const; - Vector4 yywz() const; - Vector4 zywz() const; - Vector4 wywz() const; - Vector4 xzwz() const; - Vector4 yzwz() const; - Vector4 zzwz() const; - Vector4 wzwz() const; - Vector4 xwwz() const; - Vector4 ywwz() const; - Vector4 zwwz() const; - Vector4 wwwz() const; - Vector4 xxxw() const; - Vector4 yxxw() const; - Vector4 zxxw() const; - Vector4 wxxw() const; - Vector4 xyxw() const; - Vector4 yyxw() const; - Vector4 zyxw() const; - Vector4 wyxw() const; - Vector4 xzxw() const; - Vector4 yzxw() const; - Vector4 zzxw() const; - Vector4 wzxw() const; - Vector4 xwxw() const; - Vector4 ywxw() const; - Vector4 zwxw() const; - Vector4 wwxw() const; - Vector4 xxyw() const; - Vector4 yxyw() const; - Vector4 zxyw() const; - Vector4 wxyw() const; - Vector4 xyyw() const; - Vector4 yyyw() const; - Vector4 zyyw() const; - Vector4 wyyw() const; - Vector4 xzyw() const; - Vector4 yzyw() const; - Vector4 zzyw() const; - Vector4 wzyw() const; - Vector4 xwyw() const; - Vector4 ywyw() const; - Vector4 zwyw() const; - Vector4 wwyw() const; - Vector4 xxzw() const; - Vector4 yxzw() const; - Vector4 zxzw() const; - Vector4 wxzw() const; - Vector4 xyzw() const; - Vector4 yyzw() const; - Vector4 zyzw() const; - Vector4 wyzw() const; - Vector4 xzzw() const; - Vector4 yzzw() const; - Vector4 zzzw() const; - Vector4 wzzw() const; - Vector4 xwzw() const; - Vector4 ywzw() const; - Vector4 zwzw() const; - Vector4 wwzw() const; - Vector4 xxww() const; - Vector4 yxww() const; - Vector4 zxww() const; - Vector4 wxww() const; - Vector4 xyww() const; - Vector4 yyww() const; - Vector4 zyww() const; - Vector4 wyww() const; - Vector4 xzww() const; - Vector4 yzww() const; - Vector4 zzww() const; - Vector4 wzww() const; - Vector4 xwww() const; - Vector4 ywww() const; - Vector4 zwww() const; - Vector4 wwww() const; - -}; - - -//---------------------------------------------------------------------------- -inline Vector4::Vector4() { - x = y = z = w = 0; -} - -//---------------------------------------------------------------------------- - -inline Vector4::Vector4 (float fX, float fY, float fZ, float fW) { - x = fX; - y = fY; - z = fZ; - w = fW; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4 (float afCoordinate[4]) { - x = afCoordinate[0]; - y = afCoordinate[1]; - z = afCoordinate[2]; - w = afCoordinate[3]; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; -} -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector3& rkVector, float fW) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = fW; -} - -//---------------------------------------------------------------------------- -inline float& Vector4::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline const float& Vector4::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator= (const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator== (const Vector4& rkVector) const { - return ( (x == rkVector.x) && (y == rkVector.y) && (z == rkVector.z) && (w == rkVector.w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator!= (const Vector4& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z || w != rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator+ (const Vector4& rkVector) const { - return Vector4(x + rkVector.x, y + rkVector.y, z + rkVector.z, w + rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- (const Vector4& rkVector) const { - return Vector4(x - rkVector.x, y - rkVector.y, z - rkVector.z, w - rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator* (float fScalar) const { - return Vector4(fScalar*x, fScalar*y, fScalar*z, fScalar*w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- () const { - return Vector4( -x, -y, -z, -w); -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator+= (const Vector4& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - w += rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator-= (const Vector4& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - w -= rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const { - return (*this) + (v - *this) * alpha; -} - - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - w *= fScalar; - return *this; -} - - -//---------------------------------------------------------------------------- -inline float Vector4::dot(const Vector4& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w; -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::min(const Vector4 &v) const { - return Vector4(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z), G3D::min(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::max(const Vector4 &v) const { - return Vector4(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z), G3D::max(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::isZero() const { - return (x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (w == 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z) && G3D::isFinite(w); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isUnit() const { - return squaredLength() == 1.0; -} - -//---------------------------------------------------------------------------- - -inline float Vector4::length() const { - return sqrtf(squaredLength()); -} - -//---------------------------------------------------------------------------- - -inline float Vector4::squaredLength() const { - return x * x + y * y + z * z + w * w; -} - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector4& key) { return key.hashCode(); } -}; - - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector4& v, G3D::Vector3& p) { p = v.xyz(); } -}; - -inline G3D::Vector4 operator* (float s, const G3D::Vector4& v) { - return v * s; -} - -#endif diff --git a/dep/include/g3dlite/G3D/Vector4.inl b/dep/include/g3dlite/G3D/Vector4.inl deleted file mode 100644 index 576cca83b56..00000000000 --- a/dep/include/g3dlite/G3D/Vector4.inl +++ /dev/null @@ -1,191 +0,0 @@ -/** - @file Vector4.inl - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-07-09 - @edited 2003-02-10 - */ - -//---------------------------------------------------------------------------- - -inline unsigned int hashCode(const G3D::Vector4& v) { - return v.hashCode(); -} - -namespace G3D { - -//---------------------------------------------------------------------------- -inline Vector4::Vector4() { - x = y = z = w = 0; -} - -//---------------------------------------------------------------------------- - -inline Vector4::Vector4 (float fX, float fY, float fZ, float fW) { - x = fX; - y = fY; - z = fZ; - w = fW; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4 (float afCoordinate[4]) { - x = afCoordinate[0]; - y = afCoordinate[1]; - z = afCoordinate[2]; - w = afCoordinate[3]; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; -} -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector3& rkVector, float fW) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = fW; -} - -//---------------------------------------------------------------------------- -inline float& Vector4::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline const float& Vector4::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Vector4::operator float* () { - return (float*)this; -} - -inline Vector4::operator const float* () const { - return (float*)this; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator= (const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator== (const Vector4& rkVector) const { - return ( (x == rkVector.x) && (y == rkVector.y) && (z == rkVector.z) && (w == rkVector.w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator!= (const Vector4& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z || w != rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator+ (const Vector4& rkVector) const { - return Vector4(x + rkVector.x, y + rkVector.y, z + rkVector.z, w + rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- (const Vector4& rkVector) const { - return Vector4(x - rkVector.x, y - rkVector.y, z - rkVector.z, w - rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator* (float fScalar) const { - return Vector4(fScalar*x, fScalar*y, fScalar*z, fScalar*w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- () const { - return Vector4( -x, -y, -z, -w); -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator+= (const Vector4& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - w += rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator-= (const Vector4& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - w -= rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const { - return (*this) + (v - *this) * alpha; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - w *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline float Vector4::dot(const Vector4& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w; -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::min(const Vector4 &v) const { - return Vector4(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z), G3D::min(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::max(const Vector4 &v) const { - return Vector4(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z), G3D::max(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::isZero() const { - return (x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (w == 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z) && G3D::isFinite(w); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isUnit() const { - return squaredLength() == 1.0; -} - -//---------------------------------------------------------------------------- - -inline float Vector4::length() const { - return sqrtf(squaredLength()); -} - -//---------------------------------------------------------------------------- - -inline float Vector4::squaredLength() const { - return x * x + y * y + z * z + w * w; -} - -} - diff --git a/dep/include/g3dlite/G3D/Vector4int8.h b/dep/include/g3dlite/G3D/Vector4int8.h deleted file mode 100644 index 544b693e8b3..00000000000 --- a/dep/include/g3dlite/G3D/Vector4int8.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - @file Vector4int8.h - - Homogeneous vector class. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-02-09 - @edited 2007-02-09 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTOR4INT8_H -#define G3D_VECTOR4INT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -class Vector3; -class Vector4; - -/** - Homogeneous vector stored efficiently in four signed int8s. - - */ -class Vector4int8 { -private: - // Hidden operators - bool operator<(const Vector4int8&) const; - bool operator>(const Vector4int8&) const; - bool operator<=(const Vector4int8&) const; - bool operator>=(const Vector4int8&) const; - - - /** For fast operations, treat this packed data structure as - an int32 */ - inline uint32& asInt32() { - return *reinterpret_cast(this); - } - - inline const uint32& asInt32() const { - return *reinterpret_cast(this); - } - -public: - // construction - inline Vector4int8() : x(0), y(0), z(0), w(0) {} - - /** Multiplies the source by 127 and clamps to (-128, 127) when converting */ - Vector4int8(const Vector4& source); - - /** Multiplies the source by 127 and clamps to (-128, 127) when converting */ - Vector4int8(const Vector3& source, int8 w); - - inline Vector4int8(int8 x, int8 y, int8 z, int8 w) : x(x), y(y), z(z), w(w) {} - - Vector4int8(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - // coordinates - int8 x, y, z, w; - - inline operator int8* () { - return reinterpret_cast(this); - } - - inline operator const int8* () const { - return reinterpret_cast(this); - } - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z, etc. - // - // WARNING. These member functions rely on - // (1) Vector4int8 not having virtual functions - // (2) the data packed in a 4*sizeof(int8) memory block - inline int8& operator[] (int i) { - debugAssert(i >= 0 && i <= 4); - return ((int8*)this)[i]; - } - - const int8& operator[] (int i) const { - debugAssert(i >= 0 && i <= 4); - return ((const int8*)this)[i]; - } - - // assignment and comparison - Vector4int8& operator= (const Vector4int8& other) { - asInt32() = other.asInt32(); - return *this; - } - - inline bool operator== (const Vector4int8& other) const { - return asInt32() == other.asInt32(); - } - - inline bool operator!= (const Vector4int8& other) const { - return ! (*this == other); - } - - inline unsigned int hashCode() const { - return asInt32(); - } -}; - -} // namespace G3D - - -#endif diff --git a/dep/include/g3dlite/G3D/WeakCache.h b/dep/include/g3dlite/G3D/WeakCache.h deleted file mode 100644 index f9fdc4bbd5b..00000000000 --- a/dep/include/g3dlite/G3D/WeakCache.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - @file WeakCache.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2007-05-16 - @edited 2007-05-16 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_WEAKCACHE_H -#define G3D_WEAKCACHE_H - -#include "G3D/ReferenceCount.h" -#include "G3D/Table.h" - -namespace G3D { - -/** - A cache that does not prevent its members from being garbage collected. - Useful to avoid loading or computing an expression twice. Useful - for memoization and dynamic programming. - - Maintains a table of weak pointers. Weak pointers do not prevent - an object from being garbage collected. If the object is garbage - collected, the cache removes its reference. - - There are no "contains" or "iterate" methods because elements can be - flushed from the cache at any time if they are garbage collected. - - Example: -
-      WeakCache textureCache;
-
-      TextureRef loadTexture(std::string s) {
-          TextureRef t = textureCache[s];
-
-          if (t.isNull()) {
-              t = Texture::fromFile(s);
-              textureCache.set(s, t);
-          }
-
-          return t;
-      }
-      
-      
-    
- */ -template -class WeakCache { - typedef WeakReferenceCountedPointer ValueWeakRef; - -private: - - Table table; - -public: - /** - Returns NULL if the object is not in the cache - */ - ValueRef operator[](const Key& k) { - if (table.containsKey(k)) { - ValueWeakRef w = table[k]; - ValueRef s = w.createStrongPtr(); - if (s.isNull()) { - // This object has been collected; clean out its key - table.remove(k); - } - return s; - } else { - return NULL; - } - } - - void set(const Key& k, ValueRef v) { - table.set(k, v); - } - - /** Removes k from the cache or does nothing if it is not currently in the cache.*/ - void remove(const Key& k) { - if (table.containsKey(k)) { - table.remove(k); - } - } -}; - -#if 0 // To turn off all WeakCaching -template -class WeakCache { -private: - - Table table; - -public: - /** - Returns NULL if the object is not in the cache - */ - ValueRef operator[](const Key& k) { - if (table.containsKey(k)) { - return table[k]; - } else { - return NULL; - } - } - - void set(const Key& k, ValueRef v) { - table.set(k, v); - } - - /** Removes k from the cache or does nothing if it is not currently in the cache.*/ - void remove(const Key& k) { - if (table.containsKey(k)) { - table.remove(k); - } - } -}; -#endif - -} -#endif - diff --git a/dep/include/g3dlite/G3D/Welder.h b/dep/include/g3dlite/G3D/Welder.h deleted file mode 100644 index 2c2554da7b6..00000000000 --- a/dep/include/g3dlite/G3D/Welder.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef G3D_Welder_h -#define G3D_Welder_h - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" - -namespace G3D { - -class Any; - -class Welder { -private: - - Welder() {} - -public: - - class Settings { - public: - /** Surfaces with normals that are within this angle of each - other are considered to be curved. Default value is toRadians(70.0f).*/ - float normalSmoothingAngle; - float vertexWeldRadius; - float textureWeldRadius; - float normalWeldRadius; - - inline Settings(float normalSmoothAngle = toRadians(70.0f)) : - normalSmoothingAngle(normalSmoothAngle), - vertexWeldRadius(0.0001f), - textureWeldRadius(0.0001f), - normalWeldRadius(0.01f) {} - - - Settings(const Any& any); - operator Any() const; - }; - -/** - Mutates geometry, texCoord, and indexArray so that the output has collocated vertices collapsed (welded). - - @param vertices Input and output - @param textureCoords Input and output - @param normals Output only - @param indices Input and output. This is an array of trilist indices. - @param oldToNewIndex Output argument - @param normalSmoothingAngle Varies from 0 (flat shading) to toRadians(180) for extremely smooth shading. Default is toRadians(70) - */ - static void weld( - Array& vertices, - Array& textureCoords, - Array& normals, - Array*>& indices, - const Settings& settings); - - /** - Mutates geometry, texCoord, and indexArray so that the output has collocated vertices collapsed (welded). - - @param vertices Input and output - @param textureCoords Input and output - @param normals Output only - @param indices Input and output. This is an array of trilist indices. - @param oldToNewIndex Output argument - @param normalSmoothingAngle Varies from 0 (flat shading) to toRadians(180) for extremely smooth shading. Default is toRadians(70) - */ - inline static void weld( - Array& vertices, - Array& textureCoords, - Array& normals, - Array& indices, - const Settings& settings) { - - Array*> meta; - meta.append(&indices); - weld(vertices, textureCoords, normals, meta, settings); - } -}; - -} - -#endif diff --git a/dep/include/g3dlite/G3D/WrapMode.h b/dep/include/g3dlite/G3D/WrapMode.h deleted file mode 100644 index 8ef38a77c23..00000000000 --- a/dep/include/g3dlite/G3D/WrapMode.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - @file WrapMode.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-04-17 - @edited 2007-04-17 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_WrapMode_h -#define G3D_WrapMode_h - -#include "G3D/platform.h" -#include "G3D/enumclass.h" - -#ifdef IGNORE -# undef IGNORE -#endif -#ifdef ZERO -# undef ZERO -#endif -#ifdef ERROR -# undef ERROR -#endif - -namespace G3D { - -/** - Describes the behavior of G3D::Texture, G3D::Map2D, G3D::Image3, - etc. when accessing an out-of-bounds pixel. Not all classes support - all modes. - - Refer to these as scoped enums, e.g., WrapMode m = WrapMode::CLAMP;. - - WrapMode::IGNORE silently discards attempts to write to out - of bounds locations and returns an undefined value for reading - from out of bounds locations. - - WrapMode::ERROR generates an error when the - pixel indices are out of bounds - - WrapMode::CLAMP makes out of bounds pixels equal to the last in-range pixel along that dimension. - - WrapMode::TILE computes out of bounds pixels modulo the dimension - - WrapMode::ZERO treats out of bounds values as the zero value, which varies in definition - according to the class used. For example, with a G3D::Texture, ZERO = Color4(0,0,0,0). - - Uses the "Intelligent Enum" design pattern - http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4001/ - */ -class WrapMode { -public: - /** Don't use this enum; use WrapMode instances instead. */ - enum Value { - CLAMP, - TILE, - ZERO, - IGNORE, - ERROR - }; - -private: - - Value value; - -public: - - G3D_DECLARE_ENUM_CLASS_METHODS(WrapMode); - - inline const char* toString() const { - static const char* s[] = {"CLAMP", "TILE", "ZERO", "IGNORE", "ERROR"}; - return s[value]; - } - - inline explicit WrapMode(const std::string& x) : value(ERROR) { - static const char* s[] = {"CLAMP", "TILE", "ZERO", "IGNORE", "ERROR"}; - for (int i = 0; i < 5; ++i) { - if (x == s[i]) { - value = (Value)i; - } - } - } -}; - -} // namespace G3D - -G3D_DECLARE_ENUM_CLASS_HASHCODE(G3D::WrapMode); - -#endif diff --git a/dep/include/g3dlite/G3D/constants.h b/dep/include/g3dlite/G3D/constants.h deleted file mode 100644 index dd5cb3649e5..00000000000 --- a/dep/include/g3dlite/G3D/constants.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - @file G3D/constants.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2009-05-20 - @edited 2009-05-20 -*/ -#ifndef G3D_constants_h -#define G3D_constants_h - -#include "G3D/platform.h" -#include "G3D/enumclass.h" - -namespace G3D { - -/** These are defined to have the same value as the equivalent OpenGL - constant. */ -class PrimitiveType { -public: - enum Value { - POINTS = 0x0000, - LINES = 0x0001, - LINE_STRIP = 0x0003, - TRIANGLES = 0x0004, - TRIANGLE_STRIP = 0x0005, - TRIANGLE_FAN = 0x0006, - QUADS = 0x0007, - QUAD_STRIP = 0x0008 - }; - -private: - - Value value; - -public: - - G3D_DECLARE_ENUM_CLASS_METHODS(PrimitiveType); -}; - - -/** Values for SuperSurface::GPUGeom::refractionHint. */ -class RefractionQuality { -public: - enum Value { - /** No refraction; a translucent object will appear as if it had the same index of refraction - as the surrounding medium and objects will be undistorted in the background. */ - NONE = 0, - - /** Use a static environment map (cube or paraboloid) for computing transmissivity.*/ - STATIC_ENV = 25, - - /** Use a dynamically rendered 2D environment map; distort the background. This looks good for many scenes - but avoids the cost of rendering a cube map for DYNAMIC_ENV. */ - DYNAMIC_FLAT = 50, - - /** Use a dynamically rendered 2D environment map that is re-captured per transparent object. This works well - for transparent objects that are separated by a significant camera space z distance but overlap in screen space.*/ - DYNAMIC_FLAT_MULTILAYER = 55, - - /** Render a dynamic environment map */ - DYNAMIC_ENV = 75, - - /** Use the best method available, ideally true ray tracing. */ - BEST = 100 - }; - -private: - - /** Used for to/from string conversion. Last is the emtpy string as a sentinel */ - static const std::string str[7]; - static const Value enm[6]; - Value value; - -public: - G3D_DECLARE_ENUM_CLASS_METHODS(RefractionQuality); - - RefractionQuality(const class Any&); - RefractionQuality& operator=(const Any&); - operator Any() const; - const std::string& toString() const; -}; - - -/** Values for SuperSurface::GPUGeom::mirrorHint. */ -class MirrorQuality { -public: - - enum Value { - /** Reflections are black */ - NONE = 0, - - /** Use a static environment map. This is what most games use */ - STATIC_ENV = 25, - - /** Planar reflection, typically for water or glass windows. This assumes that the mirror is flat; - it is distinct from RefractionQuality::DYNAMIC_FLAT, which assumes the background is flat.*/ - DYNAMIC_PLANAR = 50, - - /** Render a dynamic environment map. */ - DYNAMIC_ENV = 75, - - /** Use the best method available, ideally true ray tracing. */ - BEST = 100 - }; - -private: - - /** Used for to/from string conversion. Last is the emtpy string as a sentinel */ - static const std::string str[6]; - static const Value enm[5]; - - Value value; - -public: - G3D_DECLARE_ENUM_CLASS_METHODS(MirrorQuality); - MirrorQuality(const class Any&); - MirrorQuality& operator=(const Any&); - operator Any() const; - const std::string& toString() const; -}; - -} // namespace G3D - -G3D_DECLARE_ENUM_CLASS_HASHCODE(G3D::PrimitiveType) -G3D_DECLARE_ENUM_CLASS_HASHCODE(G3D::RefractionQuality) -G3D_DECLARE_ENUM_CLASS_HASHCODE(G3D::MirrorQuality) - -#endif - diff --git a/dep/include/g3dlite/G3D/debug.h b/dep/include/g3dlite/G3D/debug.h deleted file mode 100644 index a7697fe9c01..00000000000 --- a/dep/include/g3dlite/G3D/debug.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - @file debug.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-08-26 - @edited 2006-02-16 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_DEBUG_H -#define G3D_DEBUG_H - -#include "G3D/platform.h" -#ifdef _MSC_VER - #include -#endif - -#include "G3D/debugPrintf.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -#ifdef _MSC_VER - // Turn off 64-bit warnings -# pragma warning(push) -# pragma warning( disable : 4312) -# pragma warning( disable : 4267) -# pragma warning( disable : 4311) -#endif - - -/** - Useful for debugging purposes. - */ -inline bool isValidHeapPointer(const void* x) { - #ifdef _MSC_VER - return - (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee); - #else - return x != NULL; - #endif -} - -/** - Returns true if the pointer is likely to be - a valid pointer (instead of an arbitrary number). - Useful for debugging purposes. - */ -inline bool isValidPointer(const void* x) { - #ifdef _MSC_VER - return x != ((void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee); - #else - return x != NULL; - #endif -} - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -} - -#endif diff --git a/dep/include/g3dlite/G3D/debugAssert.h b/dep/include/g3dlite/G3D/debugAssert.h deleted file mode 100644 index 432e97e679d..00000000000 --- a/dep/include/g3dlite/G3D/debugAssert.h +++ /dev/null @@ -1,233 +0,0 @@ -/** - @file debugAssert.h - - debugAssert(expression); - debugAssertM(expression, message); - - @cite - John Robbins, Microsoft Systems Journal Bugslayer Column, Feb 1999. - - http://msdn.microsoft.com/library/periodic/period99/feb99_BUGSLAYE_BUGSLAYE.htm - - @cite - Douglas Cox, An assert() Replacement, Code of The Day, flipcode, Sept 19, 2000 - - http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-AssertReplace&forum=cotd&id=-1 - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-08-26 - @edited 2006-01-12 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_DEBUGASSERT_H -#define G3D_DEBUGASSERT_H - -#include -#include "G3D/platform.h" - -#include - -#ifdef _MSC_VER -// conditional expression is constant -# pragma warning (disable : 4127) -#endif - -#ifdef G3D_LINUX - // Needed so we can define a global display - // pointer for debugAssert. -#if SOMEONE_MADE_THIS_USEFUL - #include - #include - #include -#endif -#endif - - -/** - @def debugBreak() - - Break at the current location (i.e. don't push a procedure stack frame - before breaking). - */ - -/** - @def debugAssert(exp) - Breaks if the expression is false. If G3D_DEBUG_NOGUI is defined, prompts at - the console, otherwise pops up a dialog. The user may then break (debug), - ignore, or halt the program. - - The assertion is also posted to the clipboard under Win32. - */ - -/** - @def debugAssertM(exp, msg) - Breaks if the expression is false and displays a message. If G3D_DEBUG_NOGUI - is defined, prompts at the console, otherwise pops up a dialog. The user may - then break (debug), ignore, or halt the program. - - The assertion is also posted to the clipboard under Win32. - */ - -/** - @def alwaysAssertM(exp, msg) - Same as debugAssertM except that it asserts in release builds as well. - */ - -namespace G3D { -typedef bool (*AssertionHook)( - const char* _expression, - const std::string& message, - const char* filename, - int lineNumber, - bool useGuiPrompt); - -/** - Allows customization of the global function invoked when a debugAssert fails. - The initial value is G3D::_internal::_handleDebugAssert_. G3D will invoke - rawBreak if the hook returns true. If NULL, assertions are not handled. -*/ -void setAssertionHook(AssertionHook hook); - -AssertionHook assertionHook(); - -/** - Called by alwaysAssertM in case of failure in release mode. If returns - true then the program exits with -1 (you can replace this with your own - version that throws an exception or has other failure modes). - */ -void setFailureHook(AssertionHook hook); -AssertionHook failureHook(); - -namespace _internal { - extern AssertionHook _debugHook; - extern AssertionHook _failureHook; -} // internal -} // G3D - -/** - @def __debugPromptShowDialog__ - @internal - */ - -#ifdef G3D_DEBUG - -# if defined(_MSC_VER) -# define rawBreak() ::DebugBreak(); -# elif defined(__i386__) - // gcc on intel -# define rawBreak() __asm__ __volatile__ ( "int $3" ); -# else - // some other gcc -# define rawBreak() ::abort() -# endif - - -# define debugBreak() G3D::_internal::_releaseInputGrab_(); rawBreak(); G3D::_internal::_restoreInputGrab_(); -# define debugAssert(exp) debugAssertM(exp, "Debug assertion failure") - - #ifdef G3D_DEBUG_NOGUI - #define __debugPromptShowDialog__ false - #else - #define __debugPromptShowDialog__ true - #endif - - #define debugAssertM(exp, message) do { \ - if (!(exp)) { \ - G3D::_internal::_releaseInputGrab_(); \ - if ((G3D::_internal::_debugHook != NULL) && \ - G3D::_internal::_debugHook((const char*)(#exp), message, __FILE__, __LINE__, __debugPromptShowDialog__)) { \ - rawBreak(); \ - } \ - G3D::_internal::_restoreInputGrab_(); \ - } \ - } while (0) - - #define alwaysAssertM debugAssertM - -#else // Release - #ifdef G3D_DEBUG_NOGUI - #define __debugPromptShowDialog__ false - #else - #define __debugPromptShowDialog__ true - #endif - - // In the release build, just define away assertions. - #define rawBreak() do {} while (0) - #define debugAssert(exp) do {} while (0) - #define debugAssertM(exp, message) do {} while (0) - #define debugBreak() do {} while (0) - - // But keep the 'always' assertions - #define alwaysAssertM(exp, message) { \ - if (!(exp)) { \ - G3D::_internal::_releaseInputGrab_(); \ - if ((G3D::_internal::_failureHook != NULL) && \ - G3D::_internal::_failureHook(#exp, message, __FILE__, __LINE__, __debugPromptShowDialog__)) { \ - ::exit(-1); \ - } \ - G3D::_internal::_restoreInputGrab_(); \ - } \ - } - -#endif // if debug - - - -namespace G3D { namespace _internal { - -#ifdef G3D_LINUX -#if SOMEONE_MADE_THIS_USEFUL - /** - A pointer to the X11 display. Initially NULL. If set to a - non-null value (e.g. by SDLWindow), debugAssert attempts to use - this display to release the mouse/input grab when an assertion - fails. - */ - extern Display* x11Display; - - /** - A pointer to the X11 window. Initially NULL. If set to a - non-null value (e.g. by SDLWindow), debugAssert attempts to use - this window to release the mouse/input grab when an assertion - fails. - */ - extern Window x11Window; -#endif -#endif - -/** - Pops up an assertion dialog or prints an assertion - - ignoreAlways - return result of pressing the ignore button. - useGuiPrompt - if true, shows a dialog - */ -bool _handleDebugAssert_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool useGuiPrompt); - -bool _handleErrorCheck_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool useGuiPrompt); - -/** Attempts to give the user back their mouse and keyboard if they - were locked to the current window. - @internal*/ -void _releaseInputGrab_(); - -/** Attempts to restore the state before _releaseInputGrab_. - @internal*/ -void _restoreInputGrab_(); - -}; }; // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/debugPrintf.h b/dep/include/g3dlite/G3D/debugPrintf.h deleted file mode 100644 index b42151cae9e..00000000000 --- a/dep/include/g3dlite/G3D/debugPrintf.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - @file debugPrintf.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-08-26 - @edited 2007-07-20 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_DEBUGPRINTF_H -#define G3D_DEBUGPRINTF_H - -#include "G3D/platform.h" -#include -#include -#include "G3D/format.h" -#include - -namespace G3D { - -typedef void (*ConsolePrintHook)(const std::string&); - -namespace _internal { - extern ConsolePrintHook _consolePrintHook; -} - -/** Called by consolePrintf after the log and terminal have been written to. - Used by GConsole to intercept printing routines.*/ -void setConsolePrintHook(ConsolePrintHook h); - -ConsolePrintHook consolePrintHook(); - -/** - Sends output to the log and to the last GConsole instantiated. - - Guarantees that the output has been flushed by the time the routine - returns. - @sa G3D::logPrintf, G3D::screenPrintf - @return The string that was printed - */ -std::string __cdecl consolePrintf(const char* fmt ...) G3D_CHECK_PRINTF_ARGS; -std::string consolePrint(const std::string&); - -/** - Under visual studio, appears in the VS debug pane. - On unix-based operating systems the output is sent to stderr. - - Also sends output to the console (G3D::consolePrintf) if there is a consolePrintHook, - and log (G3D::logPrintf), and flushes before returning. - - @return The string that was printed -*/ -std::string __cdecl debugPrintf(const char* fmt ...) G3D_CHECK_PRINTF_ARGS; -std::string debugPrint(const std::string&); - -} // namespace G3D - -#endif - diff --git a/dep/include/g3dlite/G3D/enumclass.h b/dep/include/g3dlite/G3D/enumclass.h deleted file mode 100644 index c7dfe45f14f..00000000000 --- a/dep/include/g3dlite/G3D/enumclass.h +++ /dev/null @@ -1,147 +0,0 @@ -/** - @file G3D/enumclass.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2007-01-27 - @edited 2007-07-20 -*/ -#ifndef G3D_enumclass_h -#define G3D_enumclass_h - -#include "G3D/HashTrait.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -/** -\def G3D_DECLARE_ENUM_CLASS_METHODS - - \brief Creates a series of methods that turn a class into a scoped enumeration. - - Uses the "Intelligent Enum" design pattern - http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4001/ - - Enum classes are initialized to their zero value by default. - - See GLG3D/GKey.h for an example. - \sa G3D_DECLARE_ENUM_CLASS_HASHCODE - */ -#define G3D_DECLARE_ENUM_CLASS_METHODS(Classname)\ - inline Classname(char v) : value((Value)v) {}\ -\ - inline Classname() : value((Value)0) {}\ -\ - inline Classname(const Value v) : value(v) {}\ -\ - explicit inline Classname(int v) : value((Value)v) {}\ -\ - /** Support cast back to the Value type, which is needed to allow implicit assignment inside unions. */\ - /*inline operator Value() const { - return value; - }*/\ -\ - inline operator int() const {\ - return (int)value;\ - }\ -\ - inline bool operator== (const Classname other) const {\ - return value == other.value;\ - }\ -\ - inline bool operator== (const Classname::Value other) const {\ - return value == other;\ - }\ -\ - inline bool operator!= (const Classname other) const {\ - return value != other.value;\ - }\ -\ - inline bool operator!= (const Classname::Value other) const {\ - return value != other;\ - }\ -\ - inline bool operator< (const Classname other) const {\ - return value < other.value;\ - }\ -\ - inline bool operator> (const Classname other) const {\ - return value > other.value;\ - }\ -\ - inline bool operator>= (const Classname other) const {\ - return value >= other.value;\ - }\ -\ - inline bool operator<= (const Classname other) const {\ - return value <= other.value;\ - }\ -\ - inline bool operator< (const Value other) const {\ - return value < other;\ - }\ -\ - inline bool operator> (const Value other) const {\ - return value > other;\ - }\ -\ - inline bool operator<= (const Value other) const {\ - return value <= other;\ - }\ -\ - inline bool operator>= (const Value other) const {\ - return value >= other;\ - }\ -\ - inline Classname& operator-- () {\ - value = (Value)((int)value - 1);\ - return *this;\ - }\ -\ - inline Classname& operator++ () {\ - value = (Value)((int)value + 1);\ - return *this;\ - }\ -\ - inline Classname& operator+= (const int x) {\ - value = (Value)((int)value + x);\ - return *this;\ - }\ -\ - inline Classname& operator-= (const int x) {\ - value = (Value)((int)value - x);\ - return *this;\ - }\ -\ - inline Classname operator+ (const int x) const {\ - return Classname((int)value + x);\ - }\ -\ - inline Classname operator- (const int x) const {\ - return Classname((int)value - x);\ - }\ -\ - inline unsigned int hashCode() const {\ - return (unsigned int)value;\ - }\ -\ - inline void serialize(BinaryOutput& b) const {\ - b.writeInt32(value);\ - }\ -\ - inline void deserialize(BinaryInput& b) {\ - value = (Value)b.readInt32();\ - } - -/** \def G3D_DECLARE_ENUM_CLASS_HASHCODE -*/ -#define G3D_DECLARE_ENUM_CLASS_HASHCODE(Classname)\ -template <> struct HashTrait \ -{ \ - static size_t hashCode(Classname::Value key) { return static_cast(key); } \ -}; \ - \ -template <> struct HashTrait \ -{ \ - static size_t hashCode(Classname key) { return static_cast(key.hashCode()); } \ -}; - -#endif diff --git a/dep/include/g3dlite/G3D/fileutils.h b/dep/include/g3dlite/G3D/fileutils.h deleted file mode 100644 index 9e49777d93a..00000000000 --- a/dep/include/g3dlite/G3D/fileutils.h +++ /dev/null @@ -1,254 +0,0 @@ -/** - @file fileutils.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @author 2002-06-06 - @edited 2010-02-06 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_fileUtils_h -#define G3D_fileUtils_h - -#include "G3D/platform.h" -#include -#include -#include "G3D/Array.h" -#include "G3D/Set.h" -#include "G3D/g3dmath.h" - -#ifdef G3D_WIN32 -// For chdir, mkdir, etc. -# include -#endif - -namespace G3D { - - namespace _internal { - extern Set currentFilesUsed; - } - -/** Returns all the files used by G3D and GLG3D during the current execution. */ -Array filesUsed(); - -std::string readWholeFile( - const std::string& filename); - - -/** Reads from a zip file and decompresses the desired contents - into memory. Does not support recursive zip calls (i.e. a .zip - stored within another .zip) - - @param file the path, of the format C:\\...\\something.zip\\...\\desiredfile.ext - @param data a pointer to the memory where the file will be stored - @param length the size of the file decompressed to memory */ -void zipRead(const std::string& file, - void*& data, - size_t& length); - - -/** Closes the contents of a zip file that had been decompressed to - memory. Must be called in tandem with zipRead() to avoid memory - leaks. - - @param data the pointer to the decompressed file in memory */ -void zipClose(void* data); - - -/** - @param flush If true (default), the file is ready for reading as soon - as the function returns. If false, the function returns immediately and - writes the file in the background. - */ -void writeWholeFile( - const std::string& filename, - const std::string& str, - bool flush = true); - -/** - Creates the directory (which may optionally end in a /) - and any parents needed to reach it. - */ -void createDirectory( - const std::string& dir); - -/** - Fully qualifies a filename. The filename may contain wildcards, - in which case the wildcards will be preserved in the returned value. - */ -std::string resolveFilename(const std::string& filename); - -/** - Appends all files matching filespec to the files array. The names - will not contain paths unless includePath == true. These may be - relative to the current directory unless the filespec is fully qualified - (can be done with resolveFilename). - Wildcards can only appear to the right of the last slash in filespec. - Works with .zip files used as paths, if filespec is passed in the form - C:\\...\\something.zip\\* Does not work recursively with zipfiles (a - .zip within a .zip will not work) - */ -void getFiles( - const std::string& filespec, - Array& files, - bool includePath = false); - -/** - Appends all directories matching filespec to the files array. The names - will not contain paths unless includePath == true. These may be - relative to the current directory unless the filespec is fully qualified - (can be done with resolveFilename). - Does not append special directories "." or "..". - Works with .zip files used as paths, if filespec is passed in the form - C:\\...\\something.zip\\* Does not work recursively with zipfiles (a - .zip within a .zip will not work) - */ -void getDirs( - const std::string& filespec, - Array& files, - bool includePath = false); - - -/** Returns true if the specified path exists and is a directory */ -bool isDirectory(const std::string& filespec); - - -/** Returns true if the specified filename exists and is a zipfile */ -bool isZipfile(const std::string& filename); - - -/** Returns the length of the file. If - filename specifies a path that contains a zipfile, but the - contents within are specified correctly, returns the - uncompressed size of the requested file. Returns -1 if - the file does not exist. - - @param filename the path to test, may contain .zip -*/ -int64 fileLength(const std::string& filename); - -/** - Copies the file - */ -void copyFile( - const std::string& source, - const std::string& dest); - -/** Returns a temporary file that is open for read/write access. This - tries harder than the ANSI tmpfile, so it may succeed when that fails. */ -FILE* createTempFile(); - -/** - Returns true if the given file (or directory) exists. - - \param filename the path to test. must not end in a trailing slash. - \param lookInZipfiles if the path does not exist, calls zipfileExists() - \param trustCache If true and \a lookInZipfiles is true, cache directory and zipfile contents - so that subsequent calls to the same directory are fast. - - \sa G3D::clearFileSystemCache, G3D::zipfileExists - */ -bool fileExists -(const std::string& filename, - bool lookInZipfiles = true, - bool trustCache = true); - - -/** Clears the cache used by fileExists */ -void clearFileSystemCache(); - -/** - Returns true if the given file (or directory) exists - within a zipfile. Called if fileExists initially - returns false and the lookInZipfiles flag has been set. - Must not end in a trailing slash. Does not work for recursive - zipfiles (.zips within another .zip) - - @param filename the path to test - @param outZipfile the path to the .zip file - @param outInternalFile the path (within the .zip) where the desired file is located, if valid - - */ -bool zipfileExists -(const std::string& filename, - std::string& outZipfile, - std::string& outInternalFile); - -bool zipfileExists(const std::string& filename); - -/** - Parses a filename into four useful pieces. - - Examples: - - c:\\a\\b\\d.e - root = "c:\\" - path = "a" "b" - base = "d" - ext = "e" - - /a/b/d.e - root = "/" - path = "a" "b" - base = "d" - ext = "e" - - /a/b - root = "/" - path = "a" - base = "b" - ext = "e" - - */ -void parseFilename( - const std::string& filename, - std::string& drive, - Array& path, - std::string& base, - std::string& ext); - - -/** - Returns the part of the filename that includes the base and ext from - parseFilename (i.e. everything to the right of the path). - */ -std::string filenameBaseExt(const std::string& filename); - -/** - Returns the extension on a filename. - */ -std::string filenameExt(const std::string& filename); - - -/** Returns the portion of a filename to the left of the last period - and to the right of the last slash or colon. - */ -std::string filenameBase(const std::string& filename); - -/** Creates a unique filename base in the current directory using the - specified prefix and suffix.*/ -std::string generateFilenameBase(const std::string& prefix = "", const std::string& suffix = ""); - -/** - Returns the drive (if Win32) and path from a filename, including - a slash if there was one. - filenamePath(f) + filenameBaseExt(f) == f - */ -std::string filenamePath(const std::string& filename); - -/** Returns true if '*' or '?' appears in the string */ -bool filenameContainsWildcards(const std::string& filename); - -/** Returns true if dst does not exist or src is newer than dst. Works on both files and directories. */ -bool fileIsNewer(const std::string& src, const std::string& dst); - -/** Appends file onto dirname, ensuring a / if needed. */ -std::string pathConcat(const std::string& dirname, const std::string& file); - -} // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/filter.h b/dep/include/g3dlite/G3D/filter.h deleted file mode 100644 index 609477b79c9..00000000000 --- a/dep/include/g3dlite/G3D/filter.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - @file G3D/filter.h - - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2007-03-01 - @edited 2007-03-01 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_FILTER_H -#define G3D_FILTER_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" - -namespace G3D { -/** - Generates a set of 1D gaussian filter coefficients of size N. The coefficients - are centered on element (N-1)/2 and have standard deviation given by std. The coefficients - are normalized such that the sum across coeff is 1.0. - - Matches the results returned by Matlab fspecial('gaussian', [1, N], std) - */ -void gaussian1D(Array& coeff, int N = 5, float std = 0.5f); -} - -#endif diff --git a/dep/include/g3dlite/G3D/format.h b/dep/include/g3dlite/G3D/format.h deleted file mode 100644 index 3c7f0678876..00000000000 --- a/dep/include/g3dlite/G3D/format.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - @file format.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @author 2000-09-09 - @edited 2005-11-03 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_FORMAT_H -#define G3D_FORMAT_H - -#include "G3D/platform.h" -#include -#include -#include - -namespace G3D { - -/** - Produces a string from arguments of the style of printf. This avoids - problems with buffer overflows when using sprintf and makes it easy - to use the result functionally. This function is fast when the resulting - string is under 160 characters (not including terminator) and slower - when the string is longer. - */ -std::string __cdecl format( - const char* fmt - ...) G3D_CHECK_PRINTF_ARGS; - -/** - Like format, but can be called with the argument list from a ... function. - */ -std::string vformat( - const char* fmt, - va_list argPtr) G3D_CHECK_VPRINTF_ARGS; - - -} // namespace - -#endif diff --git a/dep/include/g3dlite/G3D/g3dfnmatch.h b/dep/include/g3dlite/G3D/g3dfnmatch.h deleted file mode 100644 index 464b3927eee..00000000000 --- a/dep/include/g3dlite/G3D/g3dfnmatch.h +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - *The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - *This product includes software developed by the University of - *California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - *@(#)fnmatch.h8.1 (Berkeley) 6/2/93 - * - * From FreeBSD fnmatch.h 1.7 - * $Id: g3dfnmatch.h,v 1.1 2010/02/06 06:51:28 morgan3d Exp $ - */ -#ifndef G3D_g3dfnmatch_h -#define G3D_g3dfnmatch_h - -#include "G3D/platform.h" - -namespace G3D { - -#if defined(G3D_WIN32) - -# if ! defined(FNM_NOMATCH) -# define FNM_NOMATCH 1 /* Match failed. */ -# define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ -# define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ -# define FNM_PERIOD 0x04 /* Period must be matched by period. */ -# define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ -# define FNM_CASEFOLD 0x10 /* Case insensitive search. */ -# define FNM_PREFIX_DIRS 0x20 /* Directory prefixes of pattern match too. */ -# endif - -#else - - // On non-windows systems, include fnmatch directly -# include -#endif - - -/** - Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. - Compares a filename or pathname to a pattern. - -The fnmatch() function checks whether the string argument matches the pattern argument, which is a shell wildcard pattern. -The flags argument modifies the behaviour; it is the bitwise OR of zero or more of the following flags: - -- FNM_NOESCAPE If this flag is set, treat backslash as an ordinary character, instead of an escape character. -- FNM_PATHNAME If this flag is set, match a slash in string only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash. -- FNM_PERIOD If this flag is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both FNM_PATHNAME is set and the period immediately follows a slash. -- FNM_FILE_NAME This is a GNU synonym for FNM_PATHNAME. -- FNM_LEADING_DIR If this flag (a GNU extension) is set, the pattern is considered to be matched if it matches an initial segment of string which is followed by a slash. This flag is mainly for the internal use of glibc and is only implemented in certain cases. -- FNM_CASEFOLD If this flag (a GNU extension) is set, the pattern is matched case-insensitively. - -\return Zero if \a string matches \a pattern, FNM_NOMATCH if there is no match or another non-zero value if there is an error - - */ -int g3dfnmatch(const char *pattern, const char *string, int flags); -} -#endif diff --git a/dep/include/g3dlite/G3D/g3dmath.h b/dep/include/g3dlite/G3D/g3dmath.h deleted file mode 100644 index d16214ebb37..00000000000 --- a/dep/include/g3dlite/G3D/g3dmath.h +++ /dev/null @@ -1,845 +0,0 @@ -/** - @file g3dmath.h - - Math util class. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @cite highestBit by Jukka Liimatta - - @created 2001-06-02 - @edited 2009-04-07 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_g3dmath_h -#define G3D_g3dmath_h - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (push) -# pragma warning (disable : 4127) -// disable: "C++ exception handler used" -# pragma warning (disable : 4530) -#endif - -#include "G3D/platform.h" -#include -#include -#include -#include - -#ifdef _MSC_VER - // Visual Studio is missing inttypes.h -# ifndef PRId64 -# define PRId64 "I64d" -# endif -#else -#include -#endif - -/*These defines enable functionality introduced with the 1999 ISO C -**standard. They must be defined before the inclusion of math.h to -**engage them. If optimisation is enabled, these functions will be -**inlined. With optimisation switched off, you have to link in the -**maths library using -lm. -*/ - -#define _ISOC9X_SOURCE1 -#define _ISOC99_SOURCE1 -#define __USE_ISOC9X1 -#define __USE_ISOC991 - -#include - -#include "G3D/debug.h" - -#undef min -#undef max - -namespace G3D { - -#ifdef _MSC_VER -inline double __fastcall drand48() { - return ::rand() / double(RAND_MAX); -} - -#if !defined(_WIN64) - -/** - Win32 implementation of the C99 fast rounding routines. - - @cite routines are - Copyright (C) 2001 Erik de Castro Lopo - - Permission to use, copy, modify, distribute, and sell this file for any - purpose is hereby granted without fee, provided that the above copyright - and this permission notice appear in all copies. No representations are - made about the suitability of this software for any purpose. It is - provided "as is" without express or implied warranty. -*/ - -__inline long int lrint (double flt) { - int intgr; - - _asm { - fld flt - fistp intgr - }; - - return intgr; -} - -__inline long int lrintf(float flt) { - int intgr; - - _asm { - fld flt - fistp intgr - }; - - return intgr; -} - -#else - - __inline long int lrint (double flt) { - return (long int)floor(flt+0.5f); - } - - __inline long int lrintf(float flt) { - return (long int)floorf(flt+0.5f); - } - -#endif - -#endif - - -#define fuzzyEpsilon (0.00001f) -/** - This value should not be tested against directly, instead - G3D::isNan() and G3D::isFinite() will return reliable results. */ -double inf(); - -/** This value should not be tested against directly, instead - G3D::isNan() and G3D::isFinite() will return reliable results. */ -double nan(); - -float finf(); - -float fnan(); - -inline double pi() { - return 3.1415926535898; -} - -inline double halfPi() { - return 1.57079633; -} - -inline double twoPi() { - return 6.28318531; -} - -typedef signed char int8; -typedef unsigned char uint8; -typedef short int16; -typedef unsigned short uint16; -typedef int int32; -typedef unsigned int uint32; - -#ifdef _MSC_EXTENSIONS - typedef __int64 int64; - typedef unsigned __int64 uint64; -#elif ! defined(_MSC_VER) - typedef int64_t int64; - typedef uint64_t uint64; -#else - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef float float32; -typedef double float64; - -int iAbs(int iValue); -int iCeil(double fValue); - -/** - Clamps the value to the range [low, hi] (inclusive) - */ -int iClamp(int val, int low, int hi); -int16 iClamp(int16 val, int16 low, int16 hi); -double clamp(double val, double low, double hi); -float clamp(float val, float low, float hi); - -/** - Returns a + (b - a) * f; - */ -inline double lerp(double a, double b, double f) { - return a + (b - a) * f; -} - -inline float lerp(float a, float b, float f) { - return a + (b - a) * f; -} - -/** - Wraps the value to the range [0, hi) (exclusive - on the high end). This is like the clock arithmetic - produced by % (modulo) except the result is guaranteed - to be positive. - */ -int iWrap(int val, int hi); - -int iFloor(double fValue); - -int iSign(int iValue); -int iSign(double fValue); - -inline int iSign(float f) { - return iSign((double)f); -} - - -/** - Fast round to integer using the lrint routine. - Typically 6x faster than casting to integer. - */ -inline int iRound(double fValue) { - return lrint(fValue); -} - -/** - Fast round to integer using the lrint routine. - Typically 6x faster than casting to integer. - */ -inline int iRound(float f) { - return lrintf(f); -} - -/** - Returns a random number uniformly at random between low and hi - (inclusive). - @deprecated Use Random::integer - */ -int iRandom(int low, int hi); - -double abs (double fValue); -double aCos (double fValue); -double aSin (double fValue); -double aTan (double fValue); -double aTan2 (double fY, double fX); -double sign (double fValue); -double square (double fValue); - -/** - Returns true if the argument is a finite real number. - */ -bool isFinite(double x); - -/** - Returns true if the argument is NaN (not a number). - You can't use x == nan to test this because all - comparisons against nan return false. - */ -bool isNaN(double x); -bool isNaN(float x); -inline bool isNaN(int x) { - (void)x; - return false; -} - -/** - Computes x % 3. - */ -int iMod3(int x); - -/** - Uniform random number between low and hi, inclusive. [low, hi] - @deprecated - @sa Random::uniform - */ -float uniformRandom(float low = 0.0f, float hi = 1.0f); - -/** - Normally distributed random number. - - @deprecated - @sa Random::gaussian - */ -float gaussRandom(float mean = 0.0f, float stdev = 1.0f); - - -/** Returns x5 */ -template -inline T pow5(T x) { - const T y = x * x; - return y * y * x; -} - - -template -inline T min(const T& x, const T& y) { - return std::min(x, y); -} - -template -inline T min(const T& x, const T& y, const T& z) { - return std::min(std::min(x, y), z); -} - -template -inline T min(const T& x, const T& y, const T& z, const T& w) { - return std::min(std::min(x, y), std::min(z, w)); -} - -template -inline T max(const T& x, const T& y) { - return std::max(x, y); -} - -template -inline T max(const T& x, const T& y, const T& z) { - return std::max(std::max(x, y), z); -} - -template -inline T max(const T& x, const T& y, const T& z, const T& w) { - return std::max(std::max(x, y), std::max(z, w)); -} - -int iMin(int x, int y); -int iMax(int x, int y); - -double square(double x); -double sumSquares(double x, double y); -double sumSquares(double x, double y, double z); -double distance(double x, double y); -double distance(double x, double y, double z); - -/** - Returnes the 0-based index of the highest 1 bit from - the left. -1 means the number was 0. - - @cite Based on code by jukka@liimatta.org - */ -int highestBit(uint32 x); - -/** - Note that fuzzyEq(a, b) && fuzzyEq(b, c) does not imply - fuzzyEq(a, c), although that will be the case on some - occasions. - */ -bool fuzzyEq(double a, double b); - -/** True if a is definitely not equal to b. - Guaranteed false if a == b. - Possibly false when a != b.*/ -bool fuzzyNe(double a, double b); - -/** Is a strictly greater than b? (Guaranteed false if a <= b). - (Possibly false if a > b) */ -bool fuzzyGt(double a, double b); - -/** Is a near or greater than b? */ -bool fuzzyGe(double a, double b); - -/** Is a strictly less than b? (Guaranteed false if a >= b)*/ -bool fuzzyLt(double a, double b); - -/** Is a near or less than b? */ -bool fuzzyLe(double a, double b); - -/** - Computes 1 / sqrt(x). - */ -inline float rsq(float x) { - return 1.0f / sqrtf(x); -} - -/** - Return the next power of 2 higher than the input - If the input is already a power of 2, the output will be the same - as the input. - */ -int ceilPow2(unsigned int in); - -/** Returns 2^x */ -inline int pow2(unsigned int x) { - return 1 << x; -} - -inline double log2(double x) { - return ::log(x) * 1.442695; -} - -inline float log2(float x) { - return ::logf(x) * 1.442695f; -} - -inline double log2(int x) { - return log2((double)x); -} - - -/** - * True if num is a power of two. - */ -bool isPow2(int num); - -bool isOdd(int num); -bool isEven(int num); - -double toRadians(double deg); -double toDegrees(double rad); - -/** - Returns true if x is not exactly equal to 0.0f. - */ -inline bool any(float x) { - return x != 0; -} - -/** - Returns true if x is not exactly equal to 0.0f. - */ -inline bool all(float x) { - return x != 0; -} - -/** - v / v (for DirectX/Cg support) - */ -inline float normalize(float v) { - return v / v; -} - -/** - a * b (for DirectX/Cg support) - */ -inline float dot(float a, float b) { - return a * b; -} - - -/** - a * b (for DirectX/Cg support) - */ -inline float mul(float a, float b) { - return a * b; -} - -/** - 2^x - */ -inline double exp2(double x) { - return pow(2.0, x); -} - -inline float exp2(float x) { - return powf(2.0f, x); -} - -/** @deprecated Use rsq */ -inline double rsqrt(double x) { - return 1.0 / sqrt(x); -} - -/** @deprecated Use rsq */ -inline float rsqrt(float x) { - // TODO: default this to using the SSE2 instruction - return 1.0 / sqrtf(x); -} - -/** - sin(x)/x - */ -inline double sinc(double x) { - double r = sin(x) / x; - - if (isNaN(r)) { - return 1.0; - } else { - return r; - } -} - -/** - Computes a floating point modulo; the result is t wrapped to the range [lo, hi). - */ -inline float wrap(float t, float lo, float hi) { - if ((t >= lo) && (t < hi)) { - return t; - } - - debugAssert(hi > lo); - - float interval = hi - lo; - - return t - interval * iFloor((t - lo) / interval); -} - - -inline double wrap(double t, double lo, double hi) { - if ((t >= lo) && (t < hi)) { - return t; - } - - debugAssert(hi > lo); - - double interval = hi - lo; - - return t - interval * iFloor((t - lo) / interval); -} - -inline double wrap(double t, double hi) { - return wrap(t, 0.0, hi); -} - - -inline bool isFinite(double x) { - return ! isNaN(x) && (x < G3D::inf()) && (x > -G3D::inf()); -} - -inline bool isFinite(float x) { - return ! isNaN(x) && (x < G3D::finf()) && (x > -G3D::finf()); -} - -//---------------------------------------------------------------------------- -inline int iAbs (int iValue) { - return ( iValue >= 0 ? iValue : -iValue ); -} - -//---------------------------------------------------------------------------- -inline int iCeil (double fValue) { - return int(::ceil(fValue)); -} - -//---------------------------------------------------------------------------- - -inline int iClamp(int val, int low, int hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -//---------------------------------------------------------------------------- - -inline int16 iClamp(int16 val, int16 low, int16 hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -//---------------------------------------------------------------------------- - -inline double clamp(double val, double low, double hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -inline float clamp(float val, float low, float hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} -//---------------------------------------------------------------------------- - -inline int iWrap(int val, int hi) { - if (val < 0) { - return ((val % hi) + hi) % hi; - } else { - return val % hi; - } -} - -//---------------------------------------------------------------------------- -inline int iFloor (double fValue) { - return int(::floor(fValue)); -} - -//---------------------------------------------------------------------------- -inline int iSign (int iValue) { - return ( iValue > 0 ? + 1 : ( iValue < 0 ? -1 : 0 ) ); -} - -inline int iSign (double fValue) { - return ( fValue > 0.0 ? + 1 : ( fValue < 0.0 ? -1 : 0 ) ); -} - -//---------------------------------------------------------------------------- -inline double abs (double fValue) { - return double(::fabs(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aCos (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) - return double(::acos(fValue)); - else - return 0.0; - } else { - return pi(); - } -} - -//---------------------------------------------------------------------------- -inline double aSin (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) { - return double(::asin(fValue)); - } else { - return -halfPi(); - } - } else { - return halfPi(); - } -} - -//---------------------------------------------------------------------------- -inline double aTan (double fValue) { - return double(::atan(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aTan2 (double fY, double fX) { - return double(::atan2(fY, fX)); -} - -//---------------------------------------------------------------------------- -inline double sign (double fValue) { - if (fValue > 0.0) { - return 1.0; - } - - if (fValue < 0.0) { - return -1.0; - } - - return 0.0; -} - -inline float sign (float fValue) { - if (fValue > 0.0f) { - return 1.0f; - } - - if (fValue < 0.0f) { - return -1.0f; - } - - return 0.0f; -} - - -inline float uniformRandom(float low, float hi) { - return (hi - low) * float(::rand()) / float(RAND_MAX) + low; -} - -inline double square(double x) { - return x * x; -} - -inline float square(float x) { - return x * x; -} - -inline int square(int x) { - return x * x; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y) { - return x*x + y*y; -} - -//---------------------------------------------------------------------------- -inline float sumSquares(float x, float y) { - return x*x + y*y; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y, double z) { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline float sumSquares(float x, float y, float z) { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y) { - return sqrt(sumSquares(x, y)); -} - -//---------------------------------------------------------------------------- -inline float distance(float x, float y) { - return sqrt(sumSquares(x, y)); -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y, double z) { - return sqrt(sumSquares(x, y, z)); -} - -//---------------------------------------------------------------------------- -inline float distance(float x, float y, float z) { - return sqrt(sumSquares(x, y, z)); -} - -//---------------------------------------------------------------------------- - -/** @deprecated use G3D::min */ -inline int iMin(int x, int y) { - return (x >= y) ? y : x; -} - -//---------------------------------------------------------------------------- -/** @deprecated use G3D::min */ -inline int iMax(int x, int y) { - return (x >= y) ? x : y; -} - -//---------------------------------------------------------------------------- -inline int ceilPow2(unsigned int in) { - in -= 1; - - in |= in >> 16; - in |= in >> 8; - in |= in >> 4; - in |= in >> 2; - in |= in >> 1; - - return in + 1; -} - -inline bool isPow2(int num) { - return ((num & -num) == num); -} - -inline bool isOdd(int num) { - return (num & 1) == 1; -} - -inline bool isEven(int num) { - return (num & 1) == 0; -} - -inline double toRadians(double deg) { - return deg * pi() / 180.0; -} - -inline double toDegrees(double rad) { - return rad * 180.0 / pi(); -} - -inline float toRadians(float deg) { - return deg * (float)pi() / 180.0f; -} - -inline float toDegrees(float rad) { - return rad * 180.0f / (float)pi(); -} - -inline float toRadians(int deg) { - return deg * (float)pi() / 180.0f; -} - -inline float toDegrees(int rad) { - return rad * 180.0f / (float)pi(); -} -/** - Computes an appropriate epsilon for comparing a and b. - */ -inline double eps(double a, double b) { - // For a and b to be nearly equal, they must have nearly - // the same magnitude. This means that we can ignore b - // since it either has the same magnitude or the comparison - // will fail anyway. - (void)b; - const double aa = abs(a) + 1.0; - if (aa == inf()) { - return fuzzyEpsilon; - } else { - return fuzzyEpsilon * aa; - } -} - -inline bool fuzzyEq(double a, double b) { - return (a == b) || (abs(a - b) <= eps(a, b)); -} - -inline bool fuzzyNe(double a, double b) { - return ! fuzzyEq(a, b); -} - -inline bool fuzzyGt(double a, double b) { - return a > b + eps(a, b); -} - -inline bool fuzzyGe(double a, double b) { - return a > b - eps(a, b); -} - -inline bool fuzzyLt(double a, double b) { - return a < b - eps(a, b); -} - -inline bool fuzzyLe(double a, double b) { - return a < b + eps(a, b); -} - -inline int iMod3(int x) { - return x % 3; -} - -/** - Given a 32-bit integer, returns the integer with the bytes in the opposite order. - */ -inline uint32 flipEndian32(const uint32 x) { - return (x << 24) | ((x & 0xFF00) << 8) | - ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); -} - -/** - Given a 16-bit integer, returns the integer with the bytes in the opposite order. - */ -inline uint16 flipEndian16(const uint16 x) { - return (x << 8) | ((x & 0xFF00) >> 8); -} - - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif - diff --git a/dep/include/g3dlite/G3D/g3dmath.inl b/dep/include/g3dlite/G3D/g3dmath.inl deleted file mode 100644 index 9bf661a7ebc..00000000000 --- a/dep/include/g3dlite/G3D/g3dmath.inl +++ /dev/null @@ -1,288 +0,0 @@ -/** - @file g3dmath.inl - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-06-02 - @edited 2006-01-14 - */ - -#include - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (push) -# pragma warning( disable : 4127 ) -#endif - -namespace G3D { - -inline bool isNaN(double x) { - bool b1 = (x < 0.0); - bool b2 = (x >= 0.0); - bool b3 = !(b1 || b2); - return b3; -} - -inline bool isFinite(double x) { - return ! isNaN(x) && (x < G3D::inf()) && (x > -G3D::inf()); -} - -//---------------------------------------------------------------------------- -inline int iAbs (int iValue) { - return ( iValue >= 0 ? iValue : -iValue ); -} - -//---------------------------------------------------------------------------- -inline int iCeil (double fValue) { - return int(::ceil(fValue)); -} - -//---------------------------------------------------------------------------- - -inline int iClamp(int val, int low, int hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -//---------------------------------------------------------------------------- - -inline double clamp(double val, double low, double hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -inline float clamp(float val, float low, float hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} -//---------------------------------------------------------------------------- - -inline int iWrap(int val, int hi) { - if (val < 0) { - return ((val % hi) + hi) % hi; - } else { - return val % hi; - } -} - -//---------------------------------------------------------------------------- -inline int iFloor (double fValue) { - return int(::floor(fValue)); -} - -//---------------------------------------------------------------------------- -inline int iSign (int iValue) { - return ( iValue > 0 ? + 1 : ( iValue < 0 ? -1 : 0 ) ); -} - -inline int iSign (double fValue) { - return ( fValue > 0.0 ? + 1 : ( fValue < 0.0 ? -1 : 0 ) ); -} - -//---------------------------------------------------------------------------- -inline double abs (double fValue) { - return double(::fabs(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aCos (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) - return double(::acos(fValue)); - else - return 0.0; - } else { - return G3D_PI; - } -} - -//---------------------------------------------------------------------------- -inline double aSin (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) { - return double(::asin(fValue)); - } else { - return -G3D_HALF_PI; - } - } else { - return G3D_HALF_PI; - } -} - -//---------------------------------------------------------------------------- -inline double aTan (double fValue) { - return double(::atan(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aTan2 (double fY, double fX) { - return double(::atan2(fY, fX)); -} - -//---------------------------------------------------------------------------- -inline double sign (double fValue) { - if (fValue > 0.0) { - return 1.0; - } - - if (fValue < 0.0) { - return -1.0; - } - - return 0.0; -} - -inline double G3D_DEPRECATED unitRandom () { - return double(::rand()) / double(RAND_MAX); -} - -inline float uniformRandom(float low, float hi) { - return (hi - low) * float(::rand()) / float(RAND_MAX) + low; -} - -//---------------------------------------------------------------------------- -inline double G3D_DEPRECATED symmetricRandom () { - return 2.0 * double(::rand()) / double(RAND_MAX) - 1.0; -} - -//---------------------------------------------------------------------------- -inline double square(double x) { - return x * x; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y) { - return x*x + y*y; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y, double z) { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y) { - return sqrt(sumSquares(x, y)); -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y, double z) { - return sqrt(sumSquares(x, y, z)); -} - -//---------------------------------------------------------------------------- - -/** @deprecated use G3D::min */ -inline int iMin(int x, int y) { - return (x >= y) ? y : x; -} - -//---------------------------------------------------------------------------- -/** @deprecated use G3D::min */ -inline int iMax(int x, int y) { - return (x >= y) ? x : y; -} - -//---------------------------------------------------------------------------- -inline int ceilPow2(unsigned int in) { - in -= 1; - - in |= in >> 16; - in |= in >> 8; - in |= in >> 4; - in |= in >> 2; - in |= in >> 1; - - return in + 1; -} - -inline bool isPow2(int num) { - return ((num & -num) == num); -} - -inline bool isOdd(int num) { - return (num & 1) == 1; -} - -inline bool isEven(int num) { - return (num & 1) == 0; -} - -inline double toRadians(double deg) { - return deg * G3D_PI / 180.0; -} - -inline double toDegrees(double rad) { - return rad * 180.0 / G3D_PI; -} - -/** - Computes an appropriate epsilon for comparing a and b. - */ -inline double eps(double a, double b) { - // For a and b to be nearly equal, they must have nearly - // the same magnitude. This means that we can ignore b - // since it either has the same magnitude or the comparison - // will fail anyway. - (void)b; - const double aa = abs(a) + 1; - if (aa == inf()) { - return fuzzyEpsilon; - } else { - return fuzzyEpsilon * aa; - } -} - -inline bool fuzzyEq(double a, double b) { - return (a == b) || (abs(a - b) <= eps(a, b)); -} - -inline bool fuzzyNe(double a, double b) { - return ! fuzzyEq(a, b); -} - -inline bool fuzzyGt(double a, double b) { - return a > b + eps(a, b); -} - -inline bool fuzzyGe(double a, double b) { - return a > b - eps(a, b); -} - -inline bool fuzzyLt(double a, double b) { - return a < b - eps(a, b); -} - -inline bool fuzzyLe(double a, double b) { - return a < b + eps(a, b); -} - -inline int iMod3(int x) { - return x % 3; -} - -} // namespace G3D - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (pop) -#endif diff --git a/dep/include/g3dlite/G3D/platform.h b/dep/include/g3dlite/G3D/platform.h deleted file mode 100644 index 11ba0127a16..00000000000 --- a/dep/include/g3dlite/G3D/platform.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - @file platform.h - - \#defines for platform specific issues. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-06-09 - @edited 2010-01-11 - */ - -#ifndef G3D_platform_h -#define G3D_platform_h - -/** - The version number of G3D in the form: MmmBB -> - version M.mm [beta BB] - */ -#define G3D_VER 80004 - -// fatal error for unsupported architectures -#if defined(__powerpc__) -# error PowerPC is not supported by G3D! -#endif - -#if defined(G3D_RELEASEDEBUG) -# define G3D_DEBUGRELEASE -#endif - -#if defined(G3D_DEBUGRELEASE) && defined(_DEBUG) -# undef _DEBUG -#endif - -/** @def G3D_DEBUG() - Defined if G3D is built in debug mode. */ -#if !defined(G3D_DEBUG) && (defined(_DEBUG) || defined(G3D_DEBUGRELEASE)) -# define G3D_DEBUG -#endif - -#ifndef _MSC_VER -/// Fast call is a register-based optimized calling convention supported only by Visual C++ -#define __fastcall - -#endif - -#ifdef _MSC_VER - #define G3D_WIN32 -#elif defined(__FreeBSD__) || defined(__OpenBSD__) - #define G3D_FREEBSD - #define G3D_LINUX -#elif defined(__linux__) - #define G3D_LINUX -#elif defined(__APPLE__) - #define G3D_OSX - - // Prevent OS X fp.h header from being included; it defines - // pi as a constant, which creates a conflict with G3D -#define __FP__ -#else - #error Unknown platform -#endif - -// Detect 64-bit under various compilers -#if (defined(_M_X64) || defined(_WIN64) || defined(__LP64__) || defined(_LP64)) -# define G3D_64BIT - #if defined(WIN32) - #include - #endif -#else -# define G3D_32BIT -#endif - -// Strongly encourage inlining on gcc -#ifdef __GNUC__ -#define inline __inline__ -#endif - - -// Verify that the supported compilers are being used and that this is a known -// processor. - -#ifdef G3D_LINUX -# ifndef __GNUC__ -# error G3D only supports the gcc compiler on Linux. -# endif -#endif - -#ifdef G3D_OSX -# ifndef __GNUC__ -# error G3D only supports the gcc compiler on OS X. -# endif - -# if defined(__i386__) -# define G3D_OSX_INTEL -# elif defined(__PPC__) -# define G3D_OSX_PPC -# else -# define G3D_OSX_UNKNOWN -# endif - -#endif - - -#ifdef _MSC_VER -// Microsoft Visual C++ 8.0 ("Express") = 1400 -// Microsoft Visual C++ 7.1 ("2003") _MSC_VER = 1310 -// Microsoft Visual C++ 7.0 ("2002") _MSC_VER = 1300 -// Microsoft Visual C++ 6.0 _MSC_VER = 1200 -// Microsoft Visual C++ 5.0 _MSC_VER = 1100 - -// Turn off warnings about deprecated C routines -# pragma warning (disable : 4996) - -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) - -/** @def G3D_DEPRECATED() - Creates deprecated warning. */ -# define G3D_DEPRECATED __declspec(deprecated) - -// Prevent Winsock conflicts by hiding the winsock API -# ifndef _WINSOCKAPI_ -# define _G3D_INTERNAL_HIDE_WINSOCK_ -# define _WINSOCKAPI_ -# endif - -// Disable 'name too long for browse information' warning -# pragma warning (disable : 4786) -// TODO: remove -# pragma warning (disable : 4244) - -# define restrict - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_PRINTF_ARGS - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_VPRINTF_ARGS - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_PRINTF_METHOD_ARGS - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_VPRINTF_METHOD_ARGS - - // On MSVC, we need to link against the multithreaded DLL version of - // the C++ runtime because that is what SDL and ZLIB are compiled - // against. This is not the default for MSVC, so we set the following - // defines to force correct linking. - // - // For documentation on compiler options, see: - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.md.2c_2f.ml.2c_2f.mt.2c_2f.ld.asp - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_Compiler_Reference.asp - // - - // DLL runtime - #ifndef _DLL - #define _DLL - #endif - - // Multithreaded runtime - #ifndef _MT - #define _MT 1 - #endif - - // Ensure that we aren't forced into the static lib - #ifdef _STATIC_CPPLIB - #undef _STATIC_CPPLIB - #endif - - #ifdef _DEBUG - #pragma comment (linker, "/NODEFAULTLIB:LIBCMTD.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPMTD.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPD.LIB") - #pragma comment (linker, "/DEFAULTLIB:MSVCPRTD.LIB") - #pragma comment(linker, "/NODEFAULTLIB:LIBCD.LIB") - #pragma comment(linker, "/DEFAULTLIB:MSVCRTD.LIB") - #else - #pragma comment(linker, "/NODEFAULTLIB:LIBC.LIB") - #pragma comment(linker, "/DEFAULTLIB:MSVCRT.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCMT.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPMT.LIB") - #pragma comment(linker, "/NODEFAULTLIB:LIBCP.LIB") - #pragma comment (linker, "/DEFAULTLIB:MSVCPRT.LIB") - #endif - - // Now set up external linking - -# ifdef _DEBUG - // zlib was linked against the release MSVCRT; force - // the debug version. -# pragma comment(linker, "/NODEFAULTLIB:MSVCRT.LIB") -# endif - - -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN 1 -# endif - - -# define NOMINMAX 1 -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0500 -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# undef NOMINMAX - -# ifdef _G3D_INTERNAL_HIDE_WINSOCK_ -# undef _G3D_INTERNAL_HIDE_WINSOCK_ -# undef _WINSOCKAPI_ -# endif - - -/** @def G3D_START_AT_MAIN() - Defines necessary wrapper around WinMain on Windows to allow transfer of execution to main(). */ -# define G3D_START_AT_MAIN()\ -int WINAPI G3D_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw);\ -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {\ - return G3D_WinMain(hInst, hPrev, szCmdLine, sw);\ -} - -#else - -/** @def G3D_START_AT_MAIN() - Defines necessary wrapper around WinMain on Windows to allow transfer of execution to main(). */ -# define G3D_START_AT_MAIN() - -#endif // win32 - -#ifdef __GNUC__ - -# include - -# if __STDC_VERSION__ < 199901 -# define restrict __restrict__ -# endif - -/** @def G3D_DEPRECATED() - Creates deprecated warning. */ -# define G3D_DEPRECATED __attribute__((__deprecated__)) - -// setup function calling conventions -# if defined(__i386__) && ! defined(__x86_64__) - -# ifndef __cdecl -# define __cdecl __attribute__((cdecl)) -# endif - -# ifndef __stdcall -# define __stdcall __attribute__((stdcall)) -# endif - -# elif defined(__x86_64__) - -# ifndef __cdecl -# define __cdecl -# endif - -# ifndef __stdcall -# define __stdcall -# endif -# endif // calling conventions - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3))) - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0))) - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2))) - -/** @def G3D_CHECK_PRINTF_METHOD_ARGS() - Enables printf parameter validation on gcc. */ -# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0))) -#endif - - -/** - @def STR(expression) - - Creates a string from the expression. Frequently used with G3D::Shader - to express shading programs inline. - - STR(this becomes a string)\verbatim
\endverbatim evaluates the same as \verbatim\endverbatim"this becomes a string"
- */
-#define STR(x) #x
-
-/** @def PRAGMA(expression)
-    \#pragma may not appear inside a macro, so this uses the pragma operator
-    to create an equivalent statement.*/
-#ifdef _MSC_VER
-// Microsoft's version http://msdn.microsoft.com/en-us/library/d9x1s805.aspx
-#    define PRAGMA(x) __pragma(x)
-#else
-// C99 standard http://www.delorie.com/gnu/docs/gcc/cpp_45.html
-#    define PRAGMA(x) _Pragma(#x)
-#endif
-
-/** @def G3D_BEGIN_PACKED_CLASS(byteAlign)
-    Switch to tight alignment
-    See G3D::Color3uint8 for an example.*/
-#ifdef _MSC_VER
-#    define G3D_BEGIN_PACKED_CLASS(byteAlign)  PRAGMA( pack(push, byteAlign) )
-#else
-#    define G3D_BEGIN_PACKED_CLASS(byteAlign)
-#endif
-
-/** @def G3D_END_PACKED_CLASS(byteAlign)
-    End switch to tight alignment
-    See G3D::Color3uint8 for an example.*/
-#ifdef _MSC_VER
-#    define G3D_END_PACKED_CLASS(byteAlign)  ; PRAGMA( pack(pop) )
-#elif defined(__GNUC__)
-#    define G3D_END_PACKED_CLASS(byteAlign)  __attribute((aligned(byteAlign))) ;
-#else
-#    define G3D_END_PACKED_CLASS(byteAlign)  ;
-#endif
-
-
-// Header guard
-#endif
diff --git a/dep/include/g3dlite/G3D/prompt.h b/dep/include/g3dlite/G3D/prompt.h
deleted file mode 100644
index c6df628099e..00000000000
--- a/dep/include/g3dlite/G3D/prompt.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/** 
- @file prompt.h
- 
- @maintainer Morgan McGuire, http://graphics.cs.williams.edu
- @cite   Windows GUI code by Max McGuire
-
- @created 2001-08-26
- @edited  2006-08-13
- */
-
-#ifndef G3D_PROMPT_H
-#define G3D_PROMPT_H
-
-#include "platform.h"
-#include 
-
-namespace G3D {
-
-/**
-  Prints a prompt to stdout and waits for user input.  The return value is
-  the number of the user's choice (the first is 0, if there are no
-  choices, returns 0). 
- 
-  @param useGui Under Win32, use a GUI, not stdout prompt.
-  @param windowTitle The title for the prompt window
-  @param promptx The text string to prompt the user with
-  @param choice  An array of strings that are the choices the user may make
-  @param numChoices The length of choice.
-
-  @cite Windows dialog interface by Max McGuire, mmcguire@ironlore.com
-  @cite Font setting code by Kurt Miller, kurt@flipcode.com
- */
-int prompt(
-    const char*     windowTitle,
-    const char*     promptx,
-    const char**    choice,
-    int             numChoices,
-    bool            useGui);
-
-/**
-  Prints a prompt and waits for user input.  The return value is
-  the number of the user's choice (the first is 0, if there are no
-  choices, returns 0).
-  

Uses GUI under Win32, stdout prompt otherwise. - */ -inline int prompt( - const char* windowTitle, - const char* promptx, - const char** choice, - int numChoices) { - - return prompt(windowTitle, promptx, choice, numChoices, true); -} - - -/** - Displays a GUI prompt with "Ok" as the only choice. - */ -void msgBox( - const std::string& message, - const std::string& title = "Message"); - - -}; // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/serialize.h b/dep/include/g3dlite/G3D/serialize.h deleted file mode 100644 index 2382c0ee0fd..00000000000 --- a/dep/include/g3dlite/G3D/serialize.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef G3D_SERIALIZE_H -#define G3D_SERIALIZE_H - -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Array.h" - -namespace G3D { - - -template -void serialize(const Array& array, BinaryOutput& b) { - b.writeInt32(array.size()); - for (int i = 0; i < array.size(); ++i) { - serialize(array[i], b); - } -} - -template -void deserialize(Array& array, BinaryInput& b) { - int N = b.readInt32(); - array.resize(N); - for (int i = 0; i < array.size(); ++i) { - deserialize(array[i], b); - } -} - -} - -#endif diff --git a/dep/include/g3dlite/G3D/splinefunc.h b/dep/include/g3dlite/G3D/splinefunc.h deleted file mode 100644 index 3f3a018c292..00000000000 --- a/dep/include/g3dlite/G3D/splinefunc.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - @file spline.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2004-07-25 - @edited 2007-05-05 - */ - -#ifndef G3D_SPLINEFUNC_H -#define G3D_SPLINEFUNC_H - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - Interpolates a property according to a piecewise linear spline. This provides - C0 continuity but the derivatives are not smooth. -

- Example: - - const double times[] = {MIDNIGHT, SUNRISE - HOUR, SUNRISE, SUNRISE + sunRiseAndSetTime / 4, SUNRISE + sunRiseAndSetTime, SUNSET - sunRiseAndSetTime, SUNSET - sunRiseAndSetTime / 2, SUNSET, SUNSET + HOUR/2, DAY}; - const Color3 color[] = {Color3(0, .0, .1), Color3(0, .0, .1), Color3::black(), Color3::black(), Color3::white() * .25, Color3::white() * .25, Color3(.5, .2, .2), Color3(.05, .05, .1), Color3(0, .0, .1), Color3(0, .0, .1)}; - ambient = linearSpline(time, times, color, 10); - - - See also G3D::Spline - - @param x The spline is a function of x; this is the sample to choose. - @param controlX controlX[i], controlY[i] is a control points. It is assumed - that controlX are strictly increasing. XType must support - the "<" operator and a subtraction operator that returns - a number. - @param controlY YType must support multiplication and addition. - @param numControl The number of control points. - */ -template -YType linearSpline(double x, const XType* controlX, const YType* controlY, int numControl) { - debugAssert(numControl >= 1); - - // Off the beginning - if ((numControl == 1) || (x < controlX[0])) { - return controlY[0]; - } - - for (int i = 1; i < numControl; ++i) { - if (x < controlX[i]) { - const double alpha = (double)(controlX[i] - x) / (controlX[i] - controlX[i - 1]); - return controlY[i] * (1 - alpha) + controlY[i - 1] * alpha; - } - } - - // Off the end - return controlY[numControl - 1]; -} - - - /** See also G3D::Spline*/ -template YType cyclicCatmullRomSpline( - double t, - const YType* controlY, - int numPoints) { - - debugAssert(numPoints >= 3); - - t = wrap(t, numPoints); - - // Find the indices of adjacent control points - int i = iFloor(t); - - // Compute the distance from the control point - t = t - i; - - // Shift back one point for correct indexing - i += numPoints - 1; - - // Pick up four control points - const YType& P0 = controlY[(i + 0) % numPoints]; - const YType& P1 = controlY[(i + 1) % numPoints]; - const YType& P2 = controlY[(i + 2) % numPoints]; - const YType& P3 = controlY[(i + 3) % numPoints]; - - return 0.5 * ((2 * P1) + - (-P0 + P2) * t + - (2*P0 - 5*P1 + 4*P2 - P3) * t*t + - (-P0 + 3*P1- 3*P2 + P3) * t*t*t); -} - -/** - A cubic spline with regularly spaced - control points. The spline interpolates - the control points. The spline - will wrap from the last point back to the first. - - The t parameter is on the range [0, controlY.size()], - where integers correspond to control points exactly. - - See also G3D::Spline - - @cite http://www.mvps.org/directx/articles/catmull/ -*/ -template YType cyclicCatmullRomSpline( - double t, - const Array& controlY) { - - int numPoints = controlY.size(); - return cyclicCatmullRomSpline(t, controlY.getCArray(), numPoints); -} - -} - -#endif - - diff --git a/dep/include/g3dlite/G3D/stringutils.h b/dep/include/g3dlite/G3D/stringutils.h deleted file mode 100644 index e15a757a7a6..00000000000 --- a/dep/include/g3dlite/G3D/stringutils.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - @file stringutils.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @author 2000-09-09 - @edited 2008-08-05 - */ - -#ifndef G3D_STRINGUTILS_H -#define G3D_STRINGUTILS_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include - -namespace G3D { - -extern const char* NEWLINE; - -/** Separates a comma-separated line, properly escaping commas within - double quotes (") and super quotes ("""). This matches Microsoft Excel's - CSV output. - - \param stripQuotes If true, strips leading and trailing " and """ - - \sa G3D::stringSplit, G3D::TextInput, G3D::readWholeFile -*/ -void parseCommaSeparated(const std::string s, Array& array, bool stripQuotes = true); - -/** - Returns true if the test string begins with the pattern string. - */ -bool beginsWith( - const std::string& test, - const std::string& pattern); - -/** - Returns true if the test string ends with the pattern string. - */ -bool endsWith( - const std::string& test, - const std::string& pattern); - -/** - Produces a new string that is the input string - wrapped at a certain number of columns (where - the line is broken at the latest space before the - column limit.) Platform specific NEWLINEs - are inserted to wrap. - */ -std::string wordWrap( - const std::string& input, - int numCols); - -/** - A comparison function for passing to Array::sort. - */ -int stringCompare( - const std::string& s1, - const std::string& s2); - -int stringPtrCompare( - const std::string* s1, - const std::string* s2); - -/** - Returns a new string that is an uppercase version of x. - */ -std::string toUpper( - const std::string& x); - -std::string toLower( - const std::string& x); - -/** - Splits x at each occurance of splitChar. - */ -G3D::Array stringSplit( - const std::string& x, - char splitChar); - -/** - joinChar is not inserted at the beginning or end, just in between - elements. - */ -std::string stringJoin( - const G3D::Array& a, - char joinChar); - -std::string stringJoin( - const G3D::Array& a, - const std::string& joinStr); - -/** - Strips whitespace from both ends of the string. - */ -std::string trimWhitespace( - const std::string& s); - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isWhiteSpace(const unsigned char c) { - return isspace(c) != 0; -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isNewline(const unsigned char c) { - return (c == '\n') || (c == '\r'); -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isDigit(const unsigned char c) { - return isdigit(c) != 0; -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isLetter(const unsigned char c) { - return isalpha(c) != 0; -} - -inline bool isSlash(const unsigned char c) { - return (c == '\\') || (c == '/'); -} - -inline bool isQuote(const unsigned char c) { - return (c == '\'') || (c == '\"'); -} - -}; // namespace - -#endif - diff --git a/dep/include/g3dlite/G3D/uint128.h b/dep/include/g3dlite/G3D/uint128.h deleted file mode 100644 index da1af3ec272..00000000000 --- a/dep/include/g3dlite/G3D/uint128.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - @file uint128.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @author Kyle Whitson - - @created 2008-07-17 - @edited 2008-07-17 - */ - -#ifndef G3D_UINT128_H -#define G3D_UINT128_H - -#include "G3D/g3dmath.h" - -namespace G3D { - -/** Limited functionality 128-bit unsigned integer. This is primarily to support FNV hashing and other - cryptography applications. See the GMP library for high-precision C++ math support. */ -class uint128 { -public: - - G3D::uint64 hi; - G3D::uint64 lo; - - uint128(const uint64& lo); - - uint128(const uint64& hi, const uint64& lo); - - uint128& operator+=(const uint128& x); - - uint128& operator*=(const uint128& x); - - uint128& operator^=(const uint128& x); - - uint128& operator&=(const uint128& x); - - uint128& operator|=(const uint128& x); - - bool operator==(const uint128& x); - - uint128& operator>>=(const int x); - - uint128& operator<<=(const int x); - - uint128 operator&(const uint128& x); - -}; -} - -#endif diff --git a/dep/include/g3dlite/G3D/units.h b/dep/include/g3dlite/G3D/units.h deleted file mode 100644 index 2e30304dc62..00000000000 --- a/dep/include/g3dlite/G3D/units.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - @file units.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-08-21 - @edited 2009-08-21 - */ -#ifndef G3D_units_h -#define G3D_units_h - -#include "G3D/platform.h" - -namespace G3D { -/** Use using namespace G3D::units; to include all units - into your program. The units system is specifically designed not to - be general but to support commonly used units efficiently and - clearly. See http://en.wikipedia.org/wiki/SI_prefix for interesting facts - about SI/metric units and full definitions.*/ -namespace units { - -/** 1e-9 m */ -inline float nanometers() { - return 1e-9f; -} - -/** 1e-6 m */ -inline float micrometers() { - return 1e-6f; -} - -/** 0.001 m */ -inline float millimeters() { - return 0.001f; -} - -/** 0.01 m */ -inline float centimeters() { - return 0.01f; -} - -/** SI base unit of distance measure. */ -inline float meters() { - return 1.0f; -} - -/** 1000 m */ -inline float kilometers() { - return 100.0f; -} - -/** 0.0254 m */ -inline float inches() { - return 0.0254f; -} - -/** 0.3048 m */ -inline float feet() { - return 0.3048f; -} - -/** 0.9144 m */ -inline float yards() { - return 0.9144f; -} - -/** 1609.344 m */ -inline float miles() { - return 1609.344f; -} - -///////////////////////////////////////////////////////////// - -/** SI base unit of angular measure. */ -inline float radians() { - return 1.0f; -} - -/** pi/180 */ -inline float degrees() { - return 0.0174532925f; -} - -////////////////////////////////////////////////////////////// - -/** 1e-9 s */ -inline float nanoseconds() { - return 1e-9f; -} - -/** 1e-3 s */ -inline float milliseconds() { - return 1e-3f; -} - -/** Base unit of time */ -inline float seconds() { - return 1.0; -} - -/** 60 s */ -inline float minutes() { - return 60.0f; -} - -/** 3600 s */ -inline float hours() { - return 3600.0f; -} - -/** 86400 s */ -inline float days() { - return 86400.0f; -} - -/** 31556926 s */ -inline float years() { - return 31556926.0f; -} - -/////////////////////////////////////////// - -} -} - -#endif diff --git a/dep/include/g3dlite/G3D/vectorMath.h b/dep/include/g3dlite/G3D/vectorMath.h deleted file mode 100644 index ac6d2b32e9d..00000000000 --- a/dep/include/g3dlite/G3D/vectorMath.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - @file vectorMath.h - - Function aliases for popular vector methods. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created: 2001-06-02 - @edited: 2004-02-02 - Copyright 2000-2004, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTORMATH_H -#define G3D_VECTORMATH_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" - - -namespace G3D { - - -inline Matrix4 mul(const Matrix4& a, const Matrix4& b) { - return a * b; -} - -inline Vector4 mul(const Matrix4& m, const Vector4& v) { - return m * v; -} - -inline Vector3 mul(const Matrix3& m, const Vector3& v) { - return m * v; -} - -inline Matrix3 mul(const Matrix3& a, const Matrix3& b) { - return a * b; -} - -inline float dot(const Vector2& a, const Vector2& b) { - return a.dot(b); -} - -inline float dot(const Vector3& a, const Vector3& b) { - return a.dot(b); -} - -inline float dot(const Vector4& a, const Vector4& b) { - return a.dot(b); -} - -inline Vector2 normalize(const Vector2& v) { - return v / v.length(); -} - -inline Vector3 normalize(const Vector3& v) { - return v / v.magnitude(); -} - -inline Vector4 normalize(const Vector4& v) { - return v / v.length(); -} - -inline Vector2 abs(const Vector2& v) { - return Vector2(::fabsf(v.x), ::fabsf(v.y)); -} - -inline Vector3 abs(const Vector3& v) { - return Vector3(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z)); -} - -inline Vector4 abs(const Vector4& v) { - return Vector4(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z), ::fabsf(v.w)); -} - -inline bool all(const Vector2& v) { - return (v.x != 0) && (v.y != 0); -} - -inline bool all(const Vector3& v) { - return (v.x != 0) && (v.y != 0) && (v.z != 0); -} - -inline bool all(const Vector4& v) { - return (v.x != 0) && (v.y != 0) && (v.z != 0) && (v.w != 0); -} - -inline bool any(const Vector2& v) { - return (v.x != 0) || (v.y != 0); -} - -inline bool any(const Vector3& v) { - return (v.x != 0) || (v.y != 0) || (v.z != 0); -} - -inline bool any(const Vector4& v) { - return (v.x != 0) || (v.y != 0) || (v.z != 0) || (v.w != 0); -} - -inline Vector2 clamp(const Vector2& v, const Vector2& a, const Vector2& b) { - return v.clamp(a, b); -} - -inline Vector3 clamp(const Vector3& v, const Vector3& a, const Vector3& b) { - return v.clamp(a, b); -} - -inline Vector4 clamp(const Vector4& v, const Vector4& a, const Vector4& b) { - return v.clamp(a, b); -} - -inline Vector2 lerp(const Vector2& v1, const Vector2& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector3 lerp(const Vector3& v1, const Vector3& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector4 lerp(const Vector4& v1, const Vector4& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color1 lerp(const Color1& v1, const Color1& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color3 lerp(const Color3& v1, const Color3& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color4 lerp(const Color4& v1, const Color4& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector3 cross(const Vector3& v1, const Vector3& v2) { - return v1.cross(v2); -} - -inline double determinant(const Matrix3& m) { - return m.determinant(); -} - -inline double determinant(const Matrix4& m) { - return m.determinant(); -} - -inline Vector2 min(const Vector2& v1, const Vector2& v2) { - return v1.min(v2); -} - -inline Vector3 min(const Vector3& v1, const Vector3& v2) { - return v1.min(v2); -} - -inline Vector4 min(const Vector4& v1, const Vector4& v2) { - return v1.min(v2); -} - -inline Color3 min(const Color3& v1, const Color3& v2) { - return v1.min(v2); -} - -inline Color4 min(const Color4& v1, const Color4& v2) { - return v1.min(v2); -} - -inline Vector2 max(const Vector2& v1, const Vector2& v2) { - return v1.max(v2); -} - -inline Vector3 max(const Vector3& v1, const Vector3& v2) { - return v1.max(v2); -} - -inline Vector4 max(const Vector4& v1, const Vector4& v2) { - return v1.max(v2); -} - -inline Color3 max(const Color3& v1, const Color3& v2) { - return v1.max(v2); -} - -inline Color4 max(const Color4& v1, const Color4& v2) { - return v1.max(v2); -} - -inline Vector2 sign(const Vector2& v) { - return Vector2((float)sign(v.x), (float)sign(v.y)); -} - -inline Vector3 sign(const Vector3& v) { - return Vector3((float)sign(v.x), (float)sign(v.y), (float)sign(v.z)); -} - -inline Vector4 sign(const Vector4& v) { - return Vector4((float)sign(v.x), (float)sign(v.y), (float)sign(v.z), (float)sign(v.w)); -} - -inline float length(float v) { - return ::fabsf(v); -} - -inline float length(const Vector2& v) { - return v.length(); -} - -inline float length(const Vector3& v) { - return v.magnitude(); -} - -inline float length(const Vector4& v) { - return v.length(); -} - -/** - Computes the log of each component. Useful for - inverting the monitor gamma function or simulating - perceptual response. - */ -inline Color3 log(const Color3& c) { - return Color3(::logf(c.r), ::logf(c.g), ::logf(c.b)); -} - -} - -#endif diff --git a/dep/include/jemalloc/internal/arena.h b/dep/include/jemalloc/internal/arena.h deleted file mode 100644 index bb4ce2a54f7..00000000000 --- a/dep/include/jemalloc/internal/arena.h +++ /dev/null @@ -1,537 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Subpages are an artificially designated partitioning of pages. Their only - * purpose is to support subpage-spaced size classes. - * - * There must be at least 4 subpages per page, due to the way size classes are - * handled. - */ -#define LG_SUBPAGE 8 -#define SUBPAGE ((size_t)(1U << LG_SUBPAGE)) -#define SUBPAGE_MASK (SUBPAGE - 1) - -/* Return the smallest subpage multiple that is >= s. */ -#define SUBPAGE_CEILING(s) \ - (((s) + SUBPAGE_MASK) & ~SUBPAGE_MASK) - -#ifdef JEMALLOC_TINY - /* Smallest size class to support. */ -# define LG_TINY_MIN LG_SIZEOF_PTR -#endif - -/* - * Maximum size class that is a multiple of the quantum, but not (necessarily) - * a power of 2. Above this size, allocations are rounded up to the nearest - * power of 2. - */ -#define LG_QSPACE_MAX_DEFAULT 7 - -/* - * Maximum size class that is a multiple of the cacheline, but not (necessarily) - * a power of 2. Above this size, allocations are rounded up to the nearest - * power of 2. - */ -#define LG_CSPACE_MAX_DEFAULT 9 - -/* - * RUN_MAX_OVRHD indicates maximum desired run header overhead. Runs are sized - * as small as possible such that this setting is still honored, without - * violating other constraints. The goal is to make runs as small as possible - * without exceeding a per run external fragmentation threshold. - * - * We use binary fixed point math for overhead computations, where the binary - * point is implicitly RUN_BFP bits to the left. - * - * Note that it is possible to set RUN_MAX_OVRHD low enough that it cannot be - * honored for some/all object sizes, since there is one bit of header overhead - * per object (plus a constant). This constraint is relaxed (ignored) for runs - * that are so small that the per-region overhead is greater than: - * - * (RUN_MAX_OVRHD / (reg_size << (3+RUN_BFP)) - */ -#define RUN_BFP 12 -/* \/ Implicit binary fixed point. */ -#define RUN_MAX_OVRHD 0x0000003dU -#define RUN_MAX_OVRHD_RELAX 0x00001800U - -/* - * The minimum ratio of active:dirty pages per arena is computed as: - * - * (nactive >> opt_lg_dirty_mult) >= ndirty - * - * So, supposing that opt_lg_dirty_mult is 5, there can be no less than 32 - * times as many active pages as dirty pages. - */ -#define LG_DIRTY_MULT_DEFAULT 5 - -typedef struct arena_chunk_map_s arena_chunk_map_t; -typedef struct arena_chunk_s arena_chunk_t; -typedef struct arena_run_s arena_run_t; -typedef struct arena_bin_s arena_bin_t; -typedef struct arena_s arena_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Each element of the chunk map corresponds to one page within the chunk. */ -struct arena_chunk_map_s { - union { - /* - * Linkage for run trees. There are two disjoint uses: - * - * 1) arena_t's runs_avail_{clean,dirty} trees. - * 2) arena_run_t conceptually uses this linkage for in-use - * non-full runs, rather than directly embedding linkage. - */ - rb_node(arena_chunk_map_t) rb_link; - /* - * List of runs currently in purgatory. arena_chunk_purge() - * temporarily allocates runs that contain dirty pages while - * purging, so that other threads cannot use the runs while the - * purging thread is operating without the arena lock held. - */ - ql_elm(arena_chunk_map_t) ql_link; - } u; - -#ifdef JEMALLOC_PROF - /* Profile counters, used for large object runs. */ - prof_thr_cnt_t *prof_cnt; -#endif - - /* - * Run address (or size) and various flags are stored together. The bit - * layout looks like (assuming 32-bit system): - * - * ???????? ???????? ????---- ----dzla - * - * ? : Unallocated: Run address for first/last pages, unset for internal - * pages. - * Small: Run page offset. - * Large: Run size for first page, unset for trailing pages. - * - : Unused. - * d : dirty? - * z : zeroed? - * l : large? - * a : allocated? - * - * Following are example bit patterns for the three types of runs. - * - * p : run page offset - * s : run size - * c : size class (used only if prof_promote is true) - * x : don't care - * - : 0 - * + : 1 - * [DZLA] : bit set - * [dzla] : bit unset - * - * Unallocated (clean): - * ssssssss ssssssss ssss---- ----dz-- - * xxxxxxxx xxxxxxxx xxxx---- -----Zxx - * ssssssss ssssssss ssss---- ----dZ-- - * - * Unallocated (dirty): - * ssssssss ssssssss ssss---- ----D--- - * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * ssssssss ssssssss ssss---- ----D--- - * - * Small: - * pppppppp pppppppp pppp---- ----d--a - * pppppppp pppppppp pppp---- -------a - * pppppppp pppppppp pppp---- ----d--a - * - * Large: - * ssssssss ssssssss ssss++++ ++++D-la - * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * -------- -------- -------- ----D-la - * - * Large (sampled, size <= PAGE_SIZE): - * ssssssss ssssssss sssscccc ccccD-la - * - * Large (not sampled, size == PAGE_SIZE): - * ssssssss ssssssss ssss++++ ++++D-la - */ - size_t bits; -#ifdef JEMALLOC_PROF -#define CHUNK_MAP_CLASS_SHIFT 4 -#define CHUNK_MAP_CLASS_MASK ((size_t)0xff0U) -#endif -#define CHUNK_MAP_FLAGS_MASK ((size_t)0xfU) -#define CHUNK_MAP_DIRTY ((size_t)0x8U) -#define CHUNK_MAP_ZEROED ((size_t)0x4U) -#define CHUNK_MAP_LARGE ((size_t)0x2U) -#define CHUNK_MAP_ALLOCATED ((size_t)0x1U) -#define CHUNK_MAP_KEY CHUNK_MAP_ALLOCATED -}; -typedef rb_tree(arena_chunk_map_t) arena_avail_tree_t; -typedef rb_tree(arena_chunk_map_t) arena_run_tree_t; - -/* Arena chunk header. */ -struct arena_chunk_s { - /* Arena that owns the chunk. */ - arena_t *arena; - - /* Linkage for the arena's chunks_dirty list. */ - ql_elm(arena_chunk_t) link_dirty; - - /* - * True if the chunk is currently in the chunks_dirty list, due to - * having at some point contained one or more dirty pages. Removal - * from chunks_dirty is lazy, so (dirtied && ndirty == 0) is possible. - */ - bool dirtied; - - /* Number of dirty pages. */ - size_t ndirty; - - /* Map of pages within chunk that keeps track of free/large/small. */ - arena_chunk_map_t map[1]; /* Dynamically sized. */ -}; -typedef rb_tree(arena_chunk_t) arena_chunk_tree_t; - -struct arena_run_s { -#ifdef JEMALLOC_DEBUG - uint32_t magic; -# define ARENA_RUN_MAGIC 0x384adf93 -#endif - - /* Bin this run is associated with. */ - arena_bin_t *bin; - - /* Stack of available freed regions, or NULL. */ - void *avail; - - /* Next region that has never been allocated, or run boundary. */ - void *next; - - /* Number of free regions in run. */ - unsigned nfree; -}; - -struct arena_bin_s { - /* - * All operations on runcur, runs, and stats require that lock be - * locked. Run allocation/deallocation are protected by the arena lock, - * which may be acquired while holding one or more bin locks, but not - * vise versa. - */ - malloc_mutex_t lock; - - /* - * Current run being used to service allocations of this bin's size - * class. - */ - arena_run_t *runcur; - - /* - * Tree of non-full runs. This tree is used when looking for an - * existing run when runcur is no longer usable. We choose the - * non-full run that is lowest in memory; this policy tends to keep - * objects packed well, and it can also help reduce the number of - * almost-empty chunks. - */ - arena_run_tree_t runs; - - /* Size of regions in a run for this bin's size class. */ - size_t reg_size; - - /* Total size of a run for this bin's size class. */ - size_t run_size; - - /* Total number of regions in a run for this bin's size class. */ - uint32_t nregs; - -#ifdef JEMALLOC_PROF - /* - * Offset of first (prof_cnt_t *) in a run header for this bin's size - * class, or 0 if (opt_prof == false). - */ - uint32_t cnt0_offset; -#endif - - /* Offset of first region in a run for this bin's size class. */ - uint32_t reg0_offset; - -#ifdef JEMALLOC_STATS - /* Bin statistics. */ - malloc_bin_stats_t stats; -#endif -}; - -struct arena_s { -#ifdef JEMALLOC_DEBUG - uint32_t magic; -# define ARENA_MAGIC 0x947d3d24 -#endif - - /* This arena's index within the arenas array. */ - unsigned ind; - - /* - * All non-bin-related operations on this arena require that lock be - * locked. - */ - malloc_mutex_t lock; - -#ifdef JEMALLOC_STATS - arena_stats_t stats; -# ifdef JEMALLOC_TCACHE - /* - * List of tcaches for extant threads associated with this arena. - * Stats from these are merged incrementally, and at exit. - */ - ql_head(tcache_t) tcache_ql; -# endif -#endif - -#ifdef JEMALLOC_PROF - uint64_t prof_accumbytes; -#endif - - /* List of dirty-page-containing chunks this arena manages. */ - ql_head(arena_chunk_t) chunks_dirty; - - /* - * In order to avoid rapid chunk allocation/deallocation when an arena - * oscillates right on the cusp of needing a new chunk, cache the most - * recently freed chunk. The spare is left in the arena's chunk trees - * until it is deleted. - * - * There is one spare chunk per arena, rather than one spare total, in - * order to avoid interactions between multiple threads that could make - * a single spare inadequate. - */ - arena_chunk_t *spare; - - /* Number of pages in active runs. */ - size_t nactive; - - /* - * Current count of pages within unused runs that are potentially - * dirty, and for which madvise(... MADV_DONTNEED) has not been called. - * By tracking this, we can institute a limit on how much dirty unused - * memory is mapped for each arena. - */ - size_t ndirty; - - /* - * Approximate number of pages being purged. It is possible for - * multiple threads to purge dirty pages concurrently, and they use - * npurgatory to indicate the total number of pages all threads are - * attempting to purge. - */ - size_t npurgatory; - - /* - * Size/address-ordered trees of this arena's available runs. The trees - * are used for first-best-fit run allocation. The dirty tree contains - * runs with dirty pages (i.e. very likely to have been touched and - * therefore have associated physical pages), whereas the clean tree - * contains runs with pages that either have no associated physical - * pages, or have pages that the kernel may recycle at any time due to - * previous madvise(2) calls. The dirty tree is used in preference to - * the clean tree for allocations, because using dirty pages reduces - * the amount of dirty purging necessary to keep the active:dirty page - * ratio below the purge threshold. - */ - arena_avail_tree_t runs_avail_clean; - arena_avail_tree_t runs_avail_dirty; - - /* - * bins is used to store trees of free regions of the following sizes, - * assuming a 16-byte quantum, 4 KiB page size, and default - * JEMALLOC_OPTIONS. - * - * bins[i] | size | - * --------+--------+ - * 0 | 2 | - * 1 | 4 | - * 2 | 8 | - * --------+--------+ - * 3 | 16 | - * 4 | 32 | - * 5 | 48 | - * : : - * 8 | 96 | - * 9 | 112 | - * 10 | 128 | - * --------+--------+ - * 11 | 192 | - * 12 | 256 | - * 13 | 320 | - * 14 | 384 | - * 15 | 448 | - * 16 | 512 | - * --------+--------+ - * 17 | 768 | - * 18 | 1024 | - * 19 | 1280 | - * : : - * 27 | 3328 | - * 28 | 3584 | - * 29 | 3840 | - * --------+--------+ - * 30 | 4 KiB | - * 31 | 6 KiB | - * 33 | 8 KiB | - * : : - * 43 | 28 KiB | - * 44 | 30 KiB | - * 45 | 32 KiB | - * --------+--------+ - */ - arena_bin_t bins[1]; /* Dynamically sized. */ -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern size_t opt_lg_qspace_max; -extern size_t opt_lg_cspace_max; -extern ssize_t opt_lg_dirty_mult; -extern uint8_t const *small_size2bin; - -/* Various bin-related settings. */ -#ifdef JEMALLOC_TINY /* Number of (2^n)-spaced tiny bins. */ -# define ntbins ((unsigned)(LG_QUANTUM - LG_TINY_MIN)) -#else -# define ntbins 0 -#endif -extern unsigned nqbins; /* Number of quantum-spaced bins. */ -extern unsigned ncbins; /* Number of cacheline-spaced bins. */ -extern unsigned nsbins; /* Number of subpage-spaced bins. */ -extern unsigned nbins; -#ifdef JEMALLOC_TINY -# define tspace_max ((size_t)(QUANTUM >> 1)) -#endif -#define qspace_min QUANTUM -extern size_t qspace_max; -extern size_t cspace_min; -extern size_t cspace_max; -extern size_t sspace_min; -extern size_t sspace_max; -#define small_maxclass sspace_max - -#define nlclasses (chunk_npages - arena_chunk_header_npages) - -#ifdef JEMALLOC_TCACHE -void arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, - size_t binind -# ifdef JEMALLOC_PROF - , uint64_t prof_accumbytes -# endif - ); -#endif -#ifdef JEMALLOC_PROF -void arena_prof_accum(arena_t *arena, uint64_t accumbytes); -#endif -void *arena_malloc_small(arena_t *arena, size_t size, bool zero); -void *arena_malloc_large(arena_t *arena, size_t size, bool zero); -void *arena_malloc(size_t size, bool zero); -void *arena_palloc(arena_t *arena, size_t alignment, size_t size, - size_t alloc_size); -size_t arena_salloc(const void *ptr); -#ifdef JEMALLOC_PROF -void arena_prof_promoted(const void *ptr, size_t size); -size_t arena_salloc_demote(const void *ptr); -prof_thr_cnt_t *arena_prof_cnt_get(const void *ptr); -void arena_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt); -#endif -void arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, - arena_chunk_map_t *mapelm); -void arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr); -#ifdef JEMALLOC_STATS -void arena_stats_merge(arena_t *arena, size_t *nactive, size_t *ndirty, - arena_stats_t *astats, malloc_bin_stats_t *bstats, - malloc_large_stats_t *lstats); -#endif -void *arena_ralloc(void *ptr, size_t size, size_t oldsize); -bool arena_new(arena_t *arena, unsigned ind); -bool arena_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ARENA_C_)) -JEMALLOC_INLINE void -arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) -{ - size_t pageind; - arena_chunk_map_t *mapelm; - - assert(arena != NULL); - assert(arena->magic == ARENA_MAGIC); - assert(chunk->arena == arena); - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - assert((mapelm->bits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapelm->bits & CHUNK_MAP_LARGE) == 0) { - /* Small allocation. */ -#ifdef JEMALLOC_TCACHE - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - tcache_dalloc_small(tcache, ptr); - else { -#endif - arena_run_t *run; - arena_bin_t *bin; - - run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapelm->bits >> - PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % - run->bin->reg_size == 0); - bin = run->bin; - malloc_mutex_lock(&bin->lock); - arena_dalloc_bin(arena, chunk, ptr, mapelm); - malloc_mutex_unlock(&bin->lock); -#ifdef JEMALLOC_TCACHE - } -#endif - } else { -#ifdef JEMALLOC_TCACHE - size_t size = mapelm->bits & ~PAGE_MASK; - - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - if (size <= tcache_maxclass) { - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - tcache_dalloc_large(tcache, ptr, size); - else { - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); - } - } else { - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); - } -#else - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); -#endif - } -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/base.h b/dep/include/jemalloc/internal/base.h deleted file mode 100644 index e353f309bd2..00000000000 --- a/dep/include/jemalloc/internal/base.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern malloc_mutex_t base_mtx; - -void *base_alloc(size_t size); -extent_node_t *base_node_alloc(void); -void base_node_dealloc(extent_node_t *node); -bool base_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/chunk.h b/dep/include/jemalloc/internal/chunk.h deleted file mode 100644 index 1f6abf782f1..00000000000 --- a/dep/include/jemalloc/internal/chunk.h +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Size and alignment of memory chunks that are allocated by the OS's virtual - * memory system. - */ -#define LG_CHUNK_DEFAULT 22 - -/* Return the chunk address for allocation address a. */ -#define CHUNK_ADDR2BASE(a) \ - ((void *)((uintptr_t)(a) & ~chunksize_mask)) - -/* Return the chunk offset of address a. */ -#define CHUNK_ADDR2OFFSET(a) \ - ((size_t)((uintptr_t)(a) & chunksize_mask)) - -/* Return the smallest chunk multiple that is >= s. */ -#define CHUNK_CEILING(s) \ - (((s) + chunksize_mask) & ~chunksize_mask) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern size_t opt_lg_chunk; -#ifdef JEMALLOC_SWAP -extern bool opt_overcommit; -#endif - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -/* Protects stats_chunks; currently not used for any other purpose. */ -extern malloc_mutex_t chunks_mtx; -/* Chunk statistics. */ -extern chunk_stats_t stats_chunks; -#endif - -extern size_t chunksize; -extern size_t chunksize_mask; /* (chunksize - 1). */ -extern size_t chunk_npages; -extern size_t arena_chunk_header_npages; -extern size_t arena_maxclass; /* Max size class for arenas. */ - -void *chunk_alloc(size_t size, bool *zero); -void chunk_dealloc(void *chunk, size_t size); -bool chunk_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - -#include "jemalloc/internal/chunk_swap.h" -#include "jemalloc/internal/chunk_dss.h" -#include "jemalloc/internal/chunk_mmap.h" diff --git a/dep/include/jemalloc/internal/chunk_dss.h b/dep/include/jemalloc/internal/chunk_dss.h deleted file mode 100644 index 6be4ad1f212..00000000000 --- a/dep/include/jemalloc/internal/chunk_dss.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifdef JEMALLOC_DSS -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -/* - * Protects sbrk() calls. This avoids malloc races among threads, though it - * does not protect against races with threads that call sbrk() directly. - */ -extern malloc_mutex_t dss_mtx; - -void *chunk_alloc_dss(size_t size, bool *zero); -bool chunk_dealloc_dss(void *chunk, size_t size); -bool chunk_dss_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_DSS */ diff --git a/dep/include/jemalloc/internal/chunk_mmap.h b/dep/include/jemalloc/internal/chunk_mmap.h deleted file mode 100644 index 8fb90b77c9b..00000000000 --- a/dep/include/jemalloc/internal/chunk_mmap.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -void *chunk_alloc_mmap(size_t size); -void chunk_dealloc_mmap(void *chunk, size_t size); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/chunk_swap.h b/dep/include/jemalloc/internal/chunk_swap.h deleted file mode 100644 index d50cb197449..00000000000 --- a/dep/include/jemalloc/internal/chunk_swap.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifdef JEMALLOC_SWAP -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern malloc_mutex_t swap_mtx; -extern bool swap_enabled; -extern bool swap_prezeroed; -extern size_t swap_nfds; -extern int *swap_fds; -#ifdef JEMALLOC_STATS -extern size_t swap_avail; -#endif - -void *chunk_alloc_swap(size_t size, bool *zero); -bool chunk_dealloc_swap(void *chunk, size_t size); -bool chunk_swap_enable(const int *fds, unsigned nfds, bool prezeroed); -bool chunk_swap_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_SWAP */ diff --git a/dep/include/jemalloc/internal/ckh.h b/dep/include/jemalloc/internal/ckh.h deleted file mode 100644 index c39ea5c75ef..00000000000 --- a/dep/include/jemalloc/internal/ckh.h +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct ckh_s ckh_t; -typedef struct ckhc_s ckhc_t; - -/* Typedefs to allow easy function pointer passing. */ -typedef void ckh_hash_t (const void *, unsigned, size_t *, size_t *); -typedef bool ckh_keycomp_t (const void *, const void *); - -/* Maintain counters used to get an idea of performance. */ -/* #define CKH_COUNT */ -/* Print counter values in ckh_delete() (requires CKH_COUNT). */ -/* #define CKH_VERBOSE */ - -/* - * There are 2^LG_CKH_BUCKET_CELLS cells in each hash table bucket. Try to fit - * one bucket per L1 cache line. - */ -#define LG_CKH_BUCKET_CELLS (LG_CACHELINE - LG_SIZEOF_PTR - 1) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Hash table cell. */ -struct ckhc_s { - const void *key; - const void *data; -}; - -struct ckh_s { -#ifdef JEMALLOC_DEBUG -#define CKH_MAGIG 0x3af2489d - uint32_t magic; -#endif - -#ifdef CKH_COUNT - /* Counters used to get an idea of performance. */ - uint64_t ngrows; - uint64_t nshrinks; - uint64_t nshrinkfails; - uint64_t ninserts; - uint64_t nrelocs; -#endif - - /* Used for pseudo-random number generation. */ -#define CKH_A 12345 -#define CKH_C 12347 - uint32_t prn_state; - - /* Total number of items. */ - size_t count; - - /* - * Minimum and current number of hash table buckets. There are - * 2^LG_CKH_BUCKET_CELLS cells per bucket. - */ - unsigned lg_minbuckets; - unsigned lg_curbuckets; - - /* Hash and comparison functions. */ - ckh_hash_t *hash; - ckh_keycomp_t *keycomp; - - /* Hash table with 2^lg_curbuckets buckets. */ - ckhc_t *tab; -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -bool ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, - ckh_keycomp_t *keycomp); -void ckh_delete(ckh_t *ckh); -size_t ckh_count(ckh_t *ckh); -bool ckh_iter(ckh_t *ckh, size_t *tabind, void **key, void **data); -bool ckh_insert(ckh_t *ckh, const void *key, const void *data); -bool ckh_remove(ckh_t *ckh, const void *searchkey, void **key, - void **data); -bool ckh_search(ckh_t *ckh, const void *seachkey, void **key, void **data); -void ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2); -bool ckh_string_keycomp(const void *k1, const void *k2); -void ckh_pointer_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2); -bool ckh_pointer_keycomp(const void *k1, const void *k2); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/ctl.h b/dep/include/jemalloc/internal/ctl.h deleted file mode 100644 index 7bbf21e0e85..00000000000 --- a/dep/include/jemalloc/internal/ctl.h +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct ctl_node_s ctl_node_t; -typedef struct ctl_arena_stats_s ctl_arena_stats_t; -typedef struct ctl_stats_s ctl_stats_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct ctl_node_s { - bool named; - union { - struct { - const char *name; - /* If (nchildren == 0), this is a terminal node. */ - unsigned nchildren; - const ctl_node_t *children; - } named; - struct { - const ctl_node_t *(*index)(const size_t *, size_t, - size_t); - } indexed; - } u; - int (*ctl)(const size_t *, size_t, void *, size_t *, void *, - size_t); -}; - -struct ctl_arena_stats_s { - bool initialized; - size_t pactive; - size_t pdirty; -#ifdef JEMALLOC_STATS - arena_stats_t astats; - - /* Aggregate stats for small size classes, based on bin stats. */ - size_t allocated_small; - uint64_t nmalloc_small; - uint64_t ndalloc_small; - uint64_t nrequests_small; - - malloc_bin_stats_t *bstats; /* nbins elements. */ - malloc_large_stats_t *lstats; /* nlclasses elements. */ -#endif -}; - -struct ctl_stats_s { -#ifdef JEMALLOC_STATS - size_t allocated; - size_t active; - size_t mapped; - struct { - size_t current; /* stats_chunks.curchunks */ - uint64_t total; /* stats_chunks.nchunks */ - size_t high; /* stats_chunks.highchunks */ - } chunks; - struct { - size_t allocated; /* huge_allocated */ - uint64_t nmalloc; /* huge_nmalloc */ - uint64_t ndalloc; /* huge_ndalloc */ - } huge; -#endif - ctl_arena_stats_t *arenas; /* (narenas + 1) elements. */ -#ifdef JEMALLOC_SWAP - size_t swap_avail; -#endif -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -int ctl_byname(const char *name, void *oldp, size_t *oldlenp, void *newp, - size_t newlen); -int ctl_nametomib(const char *name, size_t *mibp, size_t *miblenp); - -int ctl_bymib(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -bool ctl_boot(void); - -#define xmallctl(name, oldp, oldlenp, newp, newlen) do { \ - if (JEMALLOC_P(mallctl)(name, oldp, oldlenp, newp, newlen) \ - != 0) { \ - malloc_write(": Invalid xmallctl(\""); \ - malloc_write(name); \ - malloc_write("\", ...) call\n"); \ - abort(); \ - } \ -} while (0) - -#define xmallctlnametomib(name, mibp, miblenp) do { \ - if (JEMALLOC_P(mallctlnametomib)(name, mibp, miblenp) != 0) { \ - malloc_write( \ - ": Invalid xmallctlnametomib(\""); \ - malloc_write(name); \ - malloc_write("\", ...) call\n"); \ - abort(); \ - } \ -} while (0) - -#define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do { \ - if (JEMALLOC_P(mallctlbymib)(mib, miblen, oldp, oldlenp, newp, \ - newlen) != 0) { \ - malloc_write( \ - ": Invalid xmallctlbymib() call\n"); \ - abort(); \ - } \ -} while (0) - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - diff --git a/dep/include/jemalloc/internal/extent.h b/dep/include/jemalloc/internal/extent.h deleted file mode 100644 index 33a4e9a3852..00000000000 --- a/dep/include/jemalloc/internal/extent.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct extent_node_s extent_node_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Tree of extents. */ -struct extent_node_s { -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) - /* Linkage for the size/address-ordered tree. */ - rb_node(extent_node_t) link_szad; -#endif - - /* Linkage for the address-ordered tree. */ - rb_node(extent_node_t) link_ad; - -#ifdef JEMALLOC_PROF - /* Profile counters, used for huge objects. */ - prof_thr_cnt_t *prof_cnt; -#endif - - /* Pointer to the extent that this tree node is responsible for. */ - void *addr; - - /* Total region size. */ - size_t size; -}; -typedef rb_tree(extent_node_t) extent_tree_t; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) -rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t) -#endif - -rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t) - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - diff --git a/dep/include/jemalloc/internal/hash.h b/dep/include/jemalloc/internal/hash.h deleted file mode 100644 index d12cdb8359f..00000000000 --- a/dep/include/jemalloc/internal/hash.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -uint64_t hash(const void *key, size_t len, uint64_t seed); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(HASH_C_)) -/* - * The following hash function is based on MurmurHash64A(), placed into the - * public domain by Austin Appleby. See http://murmurhash.googlepages.com/ for - * details. - */ -JEMALLOC_INLINE uint64_t -hash(const void *key, size_t len, uint64_t seed) -{ - const uint64_t m = 0xc6a4a7935bd1e995; - const int r = 47; - uint64_t h = seed ^ (len * m); - const uint64_t *data = (const uint64_t *)key; - const uint64_t *end = data + (len/8); - const unsigned char *data2; - - assert(((uintptr_t)key & 0x7) == 0); - - while(data != end) { - uint64_t k = *data++; - - k *= m; - k ^= k >> r; - k *= m; - - h ^= k; - h *= m; - } - - data2 = (const unsigned char *)data; - switch(len & 7) { - case 7: h ^= ((uint64_t)(data2[6])) << 48; - case 6: h ^= ((uint64_t)(data2[5])) << 40; - case 5: h ^= ((uint64_t)(data2[4])) << 32; - case 4: h ^= ((uint64_t)(data2[3])) << 24; - case 3: h ^= ((uint64_t)(data2[2])) << 16; - case 2: h ^= ((uint64_t)(data2[1])) << 8; - case 1: h ^= ((uint64_t)(data2[0])); - h *= m; - } - - h ^= h >> r; - h *= m; - h ^= h >> r; - - return h; -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/huge.h b/dep/include/jemalloc/internal/huge.h deleted file mode 100644 index 3cf32f7506d..00000000000 --- a/dep/include/jemalloc/internal/huge.h +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#ifdef JEMALLOC_STATS -/* Huge allocation statistics. */ -extern uint64_t huge_nmalloc; -extern uint64_t huge_ndalloc; -extern size_t huge_allocated; -#endif - -/* Protects chunk-related data structures. */ -extern malloc_mutex_t huge_mtx; - -void *huge_malloc(size_t size, bool zero); -void *huge_palloc(size_t alignment, size_t size); -void *huge_ralloc(void *ptr, size_t size, size_t oldsize); -void huge_dalloc(void *ptr); -size_t huge_salloc(const void *ptr); -#ifdef JEMALLOC_PROF -prof_thr_cnt_t *huge_prof_cnt_get(const void *ptr); -void huge_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt); -#endif -bool huge_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/jemalloc_internal.h b/dep/include/jemalloc/internal/jemalloc_internal.h deleted file mode 100644 index 03782dd6690..00000000000 --- a/dep/include/jemalloc/internal/jemalloc_internal.h +++ /dev/null @@ -1,561 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include -#ifndef SIZE_T_MAX -# define SIZE_T_MAX SIZE_MAX -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define JEMALLOC_MANGLE -#include "../jemalloc.h" - -#ifdef JEMALLOC_LAZY_LOCK -#include -#endif - -#define RB_COMPACT -#include "jemalloc/internal/rb.h" -#include "jemalloc/internal/qr.h" -#include "jemalloc/internal/ql.h" - -extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); - -/* - * Define a custom assert() in order to reduce the chances of deadlock during - * assertion failure. - */ -#ifdef JEMALLOC_DEBUG -# define assert(e) do { \ - if (!(e)) { \ - char line_buf[UMAX2S_BUFSIZE]; \ - malloc_write(": "); \ - malloc_write(__FILE__); \ - malloc_write(":"); \ - malloc_write(umax2s(__LINE__, 10, line_buf)); \ - malloc_write(": Failed assertion: "); \ - malloc_write("\""); \ - malloc_write(#e); \ - malloc_write("\"\n"); \ - abort(); \ - } \ -} while (0) -#else -#define assert(e) -#endif - -/* - * jemalloc can conceptually be broken into components (arena, tcache, etc.), - * but there are circular dependencies that cannot be broken without - * substantial performance degradation. In order to reduce the effect on - * visual code flow, read the header files in multiple passes, with one of the - * following cpp variables defined during each pass: - * - * JEMALLOC_H_TYPES : Preprocessor-defined constants and psuedo-opaque data - * types. - * JEMALLOC_H_STRUCTS : Data structures. - * JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes. - * JEMALLOC_H_INLINES : Inline functions. - */ -/******************************************************************************/ -#define JEMALLOC_H_TYPES - -#define ZU(z) ((size_t)z) - -#ifndef __DECONST -# define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - -#ifdef JEMALLOC_DEBUG - /* Disable inlining to make debugging easier. */ -# define JEMALLOC_INLINE -# define inline -#else -# define JEMALLOC_ENABLE_INLINE -# define JEMALLOC_INLINE static inline -#endif - -/* Size of stack-allocated buffer passed to strerror_r(). */ -#define STRERROR_BUF 64 - -/* Minimum alignment of allocations is 2^LG_QUANTUM bytes. */ -#ifdef __i386__ -# define LG_QUANTUM 4 -#endif -#ifdef __ia64__ -# define LG_QUANTUM 4 -#endif -#ifdef __alpha__ -# define LG_QUANTUM 4 -#endif -#ifdef __sparc64__ -# define LG_QUANTUM 4 -#endif -#if (defined(__amd64__) || defined(__x86_64__)) -# define LG_QUANTUM 4 -#endif -#ifdef __arm__ -# define LG_QUANTUM 3 -#endif -#ifdef __mips__ -# define LG_QUANTUM 3 -#endif -#ifdef __powerpc__ -# define LG_QUANTUM 4 -#endif -#ifdef __s390x__ -# define LG_QUANTUM 4 -#endif - -#define QUANTUM ((size_t)(1U << LG_QUANTUM)) -#define QUANTUM_MASK (QUANTUM - 1) - -/* Return the smallest quantum multiple that is >= a. */ -#define QUANTUM_CEILING(a) \ - (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) - -#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) - -/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ -#if (!defined(PIC) && !defined(NO_TLS)) -# define NO_TLS -#endif - -/* - * Maximum size of L1 cache line. This is used to avoid cache line aliasing. - * In addition, this controls the spacing of cacheline-spaced size classes. - */ -#define LG_CACHELINE 6 -#define CACHELINE ((size_t)(1U << LG_CACHELINE)) -#define CACHELINE_MASK (CACHELINE - 1) - -/* Return the smallest cacheline multiple that is >= s. */ -#define CACHELINE_CEILING(s) \ - (((s) + CACHELINE_MASK) & ~CACHELINE_MASK) - -/* - * Page size. STATIC_PAGE_SHIFT is determined by the configure script. If - * DYNAMIC_PAGE_SHIFT is enabled, only use the STATIC_PAGE_* macros where - * compile-time values are required for the purposes of defining data - * structures. - */ -#define STATIC_PAGE_SIZE ((size_t)(1U << STATIC_PAGE_SHIFT)) -#define STATIC_PAGE_MASK ((size_t)(STATIC_PAGE_SIZE - 1)) - -#ifdef DYNAMIC_PAGE_SHIFT -# define PAGE_SHIFT lg_pagesize -# define PAGE_SIZE pagesize -# define PAGE_MASK pagesize_mask -#else -# define PAGE_SHIFT STATIC_PAGE_SHIFT -# define PAGE_SIZE STATIC_PAGE_SIZE -# define PAGE_MASK STATIC_PAGE_MASK -#endif - -/* Return the smallest pagesize multiple that is >= s. */ -#define PAGE_CEILING(s) \ - (((s) + PAGE_MASK) & ~PAGE_MASK) - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_TYPES -/******************************************************************************/ -#define JEMALLOC_H_STRUCTS - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_STRUCTS -/******************************************************************************/ -#define JEMALLOC_H_EXTERNS - -extern bool opt_abort; -#ifdef JEMALLOC_FILL -extern bool opt_junk; -#endif -#ifdef JEMALLOC_SYSV -extern bool opt_sysv; -#endif -#ifdef JEMALLOC_XMALLOC -extern bool opt_xmalloc; -#endif -#ifdef JEMALLOC_FILL -extern bool opt_zero; -#endif - -#ifdef DYNAMIC_PAGE_SHIFT -extern size_t pagesize; -extern size_t pagesize_mask; -extern size_t lg_pagesize; -#endif - -/* Number of CPUs. */ -extern unsigned ncpus; - -extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ -#ifndef NO_TLS -/* - * Map of pthread_self() --> arenas[???], used for selecting an arena to use - * for allocations. - */ -extern __thread arena_t *arenas_map JEMALLOC_ATTR(tls_model("initial-exec")); -#endif -/* - * Arenas that are used to service external requests. Not all elements of the - * arenas array are necessarily used; arenas are created lazily as needed. - */ -extern arena_t **arenas; -extern unsigned narenas; - -arena_t *arenas_extend(unsigned ind); -#ifndef NO_TLS -arena_t *choose_arena_hard(void); -#endif - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_EXTERNS -/******************************************************************************/ -#define JEMALLOC_H_INLINES - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_write(const char *s); -arena_t *choose_arena(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -/* - * Wrapper around malloc_message() that avoids the need for - * JEMALLOC_P(malloc_message)(...) throughout the code. - */ -JEMALLOC_INLINE void -malloc_write(const char *s) -{ - - JEMALLOC_P(malloc_message)(NULL, s); -} - -/* - * Choose an arena based on a per-thread value (fast-path code, calls slow-path - * code if necessary). - */ -JEMALLOC_INLINE arena_t * -choose_arena(void) -{ - arena_t *ret; - - /* - * We can only use TLS if this is a PIC library, since for the static - * library version, libc's malloc is used by TLS allocation, which - * introduces a bootstrapping issue. - */ -#ifndef NO_TLS - ret = arenas_map; - if (ret == NULL) { - ret = choose_arena_hard(); - assert(ret != NULL); - } -#else - if (isthreaded && narenas > 1) { - unsigned long ind; - - /* - * Hash pthread_self() to one of the arenas. There is a prime - * number of arenas, so this has a reasonable chance of - * working. Even so, the hashing can be easily thwarted by - * inconvenient pthread_self() values. Without specific - * knowledge of how pthread_self() calculates values, we can't - * easily do much better than this. - */ - ind = (unsigned long) pthread_self() % narenas; - - /* - * Optimistially assume that arenas[ind] has been initialized. - * At worst, we find out that some other thread has already - * done so, after acquiring the lock in preparation. Note that - * this lazy locking also has the effect of lazily forcing - * cache coherency; without the lock acquisition, there's no - * guarantee that modification of arenas[ind] by another thread - * would be seen on this CPU for an arbitrary amount of time. - * - * In general, this approach to modifying a synchronized value - * isn't a good idea, but in this case we only ever modify the - * value once, so things work out well. - */ - ret = arenas[ind]; - if (ret == NULL) { - /* - * Avoid races with another thread that may have already - * initialized arenas[ind]. - */ - malloc_mutex_lock(&arenas_lock); - if (arenas[ind] == NULL) - ret = arenas_extend((unsigned)ind); - else - ret = arenas[ind]; - malloc_mutex_unlock(&arenas_lock); - } - } else - ret = arenas[0]; -#endif - - assert(ret != NULL); - return (ret); -} -#endif - -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void *imalloc(size_t size); -void *icalloc(size_t size); -void *ipalloc(size_t alignment, size_t size); -size_t isalloc(const void *ptr); -void *iralloc(void *ptr, size_t size); -void idalloc(void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -JEMALLOC_INLINE void * -imalloc(size_t size) -{ - - assert(size != 0); - - if (size <= arena_maxclass) - return (arena_malloc(size, false)); - else - return (huge_malloc(size, false)); -} - -JEMALLOC_INLINE void * -icalloc(size_t size) -{ - - if (size <= arena_maxclass) - return (arena_malloc(size, true)); - else - return (huge_malloc(size, true)); -} - -JEMALLOC_INLINE void * -ipalloc(size_t alignment, size_t size) -{ - void *ret; - size_t ceil_size; - - /* - * Round size up to the nearest multiple of alignment. - * - * This done, we can take advantage of the fact that for each small - * size class, every object is aligned at the smallest power of two - * that is non-zero in the base two representation of the size. For - * example: - * - * Size | Base 2 | Minimum alignment - * -----+----------+------------------ - * 96 | 1100000 | 32 - * 144 | 10100000 | 32 - * 192 | 11000000 | 64 - * - * Depending on runtime settings, it is possible that arena_malloc() - * will further round up to a power of two, but that never causes - * correctness issues. - */ - ceil_size = (size + (alignment - 1)) & (-alignment); - /* - * (ceil_size < size) protects against the combination of maximal - * alignment and size greater than maximal alignment. - */ - if (ceil_size < size) { - /* size_t overflow. */ - return (NULL); - } - - if (ceil_size <= PAGE_SIZE || (alignment <= PAGE_SIZE - && ceil_size <= arena_maxclass)) - ret = arena_malloc(ceil_size, false); - else { - size_t run_size; - - /* - * We can't achieve subpage alignment, so round up alignment - * permanently; it makes later calculations simpler. - */ - alignment = PAGE_CEILING(alignment); - ceil_size = PAGE_CEILING(size); - /* - * (ceil_size < size) protects against very large sizes within - * PAGE_SIZE of SIZE_T_MAX. - * - * (ceil_size + alignment < ceil_size) protects against the - * combination of maximal alignment and ceil_size large enough - * to cause overflow. This is similar to the first overflow - * check above, but it needs to be repeated due to the new - * ceil_size value, which may now be *equal* to maximal - * alignment, whereas before we only detected overflow if the - * original size was *greater* than maximal alignment. - */ - if (ceil_size < size || ceil_size + alignment < ceil_size) { - /* size_t overflow. */ - return (NULL); - } - - /* - * Calculate the size of the over-size run that arena_palloc() - * would need to allocate in order to guarantee the alignment. - */ - if (ceil_size >= alignment) - run_size = ceil_size + alignment - PAGE_SIZE; - else { - /* - * It is possible that (alignment << 1) will cause - * overflow, but it doesn't matter because we also - * subtract PAGE_SIZE, which in the case of overflow - * leaves us with a very large run_size. That causes - * the first conditional below to fail, which means - * that the bogus run_size value never gets used for - * anything important. - */ - run_size = (alignment << 1) - PAGE_SIZE; - } - - if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), alignment, ceil_size, - run_size); - } else if (alignment <= chunksize) - ret = huge_malloc(ceil_size, false); - else - ret = huge_palloc(alignment, ceil_size); - } - - assert(((uintptr_t)ret & (alignment - 1)) == 0); - return (ret); -} - -JEMALLOC_INLINE size_t -isalloc(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - -#ifdef JEMALLOC_PROF - ret = arena_salloc_demote(ptr); -#else - ret = arena_salloc(ptr); -#endif - } else - ret = huge_salloc(ptr); - - return (ret); -} - -JEMALLOC_INLINE void * -iralloc(void *ptr, size_t size) -{ - size_t oldsize; - - assert(ptr != NULL); - assert(size != 0); - - oldsize = isalloc(ptr); - - if (size <= arena_maxclass) - return (arena_ralloc(ptr, size, oldsize)); - else - return (huge_ralloc(ptr, size, oldsize)); -} - -JEMALLOC_INLINE void -idalloc(void *ptr) -{ - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) - arena_dalloc(chunk->arena, chunk, ptr); - else - huge_dalloc(ptr); -} -#endif - -#undef JEMALLOC_H_INLINES -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/jemalloc_internal.h.in b/dep/include/jemalloc/internal/jemalloc_internal.h.in deleted file mode 100644 index 2c3f32f126d..00000000000 --- a/dep/include/jemalloc/internal/jemalloc_internal.h.in +++ /dev/null @@ -1,561 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include -#ifndef SIZE_T_MAX -# define SIZE_T_MAX SIZE_MAX -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define JEMALLOC_MANGLE -#include "../jemalloc@install_suffix@.h" - -#ifdef JEMALLOC_LAZY_LOCK -#include -#endif - -#define RB_COMPACT -#include "jemalloc/internal/rb.h" -#include "jemalloc/internal/qr.h" -#include "jemalloc/internal/ql.h" - -extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); - -/* - * Define a custom assert() in order to reduce the chances of deadlock during - * assertion failure. - */ -#ifdef JEMALLOC_DEBUG -# define assert(e) do { \ - if (!(e)) { \ - char line_buf[UMAX2S_BUFSIZE]; \ - malloc_write(": "); \ - malloc_write(__FILE__); \ - malloc_write(":"); \ - malloc_write(umax2s(__LINE__, 10, line_buf)); \ - malloc_write(": Failed assertion: "); \ - malloc_write("\""); \ - malloc_write(#e); \ - malloc_write("\"\n"); \ - abort(); \ - } \ -} while (0) -#else -#define assert(e) -#endif - -/* - * jemalloc can conceptually be broken into components (arena, tcache, etc.), - * but there are circular dependencies that cannot be broken without - * substantial performance degradation. In order to reduce the effect on - * visual code flow, read the header files in multiple passes, with one of the - * following cpp variables defined during each pass: - * - * JEMALLOC_H_TYPES : Preprocessor-defined constants and psuedo-opaque data - * types. - * JEMALLOC_H_STRUCTS : Data structures. - * JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes. - * JEMALLOC_H_INLINES : Inline functions. - */ -/******************************************************************************/ -#define JEMALLOC_H_TYPES - -#define ZU(z) ((size_t)z) - -#ifndef __DECONST -# define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - -#ifdef JEMALLOC_DEBUG - /* Disable inlining to make debugging easier. */ -# define JEMALLOC_INLINE -# define inline -#else -# define JEMALLOC_ENABLE_INLINE -# define JEMALLOC_INLINE static inline -#endif - -/* Size of stack-allocated buffer passed to strerror_r(). */ -#define STRERROR_BUF 64 - -/* Minimum alignment of allocations is 2^LG_QUANTUM bytes. */ -#ifdef __i386__ -# define LG_QUANTUM 4 -#endif -#ifdef __ia64__ -# define LG_QUANTUM 4 -#endif -#ifdef __alpha__ -# define LG_QUANTUM 4 -#endif -#ifdef __sparc64__ -# define LG_QUANTUM 4 -#endif -#if (defined(__amd64__) || defined(__x86_64__)) -# define LG_QUANTUM 4 -#endif -#ifdef __arm__ -# define LG_QUANTUM 3 -#endif -#ifdef __mips__ -# define LG_QUANTUM 3 -#endif -#ifdef __powerpc__ -# define LG_QUANTUM 4 -#endif -#ifdef __s390x__ -# define LG_QUANTUM 4 -#endif - -#define QUANTUM ((size_t)(1U << LG_QUANTUM)) -#define QUANTUM_MASK (QUANTUM - 1) - -/* Return the smallest quantum multiple that is >= a. */ -#define QUANTUM_CEILING(a) \ - (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) - -#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) - -/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ -#if (!defined(PIC) && !defined(NO_TLS)) -# define NO_TLS -#endif - -/* - * Maximum size of L1 cache line. This is used to avoid cache line aliasing. - * In addition, this controls the spacing of cacheline-spaced size classes. - */ -#define LG_CACHELINE 6 -#define CACHELINE ((size_t)(1U << LG_CACHELINE)) -#define CACHELINE_MASK (CACHELINE - 1) - -/* Return the smallest cacheline multiple that is >= s. */ -#define CACHELINE_CEILING(s) \ - (((s) + CACHELINE_MASK) & ~CACHELINE_MASK) - -/* - * Page size. STATIC_PAGE_SHIFT is determined by the configure script. If - * DYNAMIC_PAGE_SHIFT is enabled, only use the STATIC_PAGE_* macros where - * compile-time values are required for the purposes of defining data - * structures. - */ -#define STATIC_PAGE_SIZE ((size_t)(1U << STATIC_PAGE_SHIFT)) -#define STATIC_PAGE_MASK ((size_t)(STATIC_PAGE_SIZE - 1)) - -#ifdef DYNAMIC_PAGE_SHIFT -# define PAGE_SHIFT lg_pagesize -# define PAGE_SIZE pagesize -# define PAGE_MASK pagesize_mask -#else -# define PAGE_SHIFT STATIC_PAGE_SHIFT -# define PAGE_SIZE STATIC_PAGE_SIZE -# define PAGE_MASK STATIC_PAGE_MASK -#endif - -/* Return the smallest pagesize multiple that is >= s. */ -#define PAGE_CEILING(s) \ - (((s) + PAGE_MASK) & ~PAGE_MASK) - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_TYPES -/******************************************************************************/ -#define JEMALLOC_H_STRUCTS - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_STRUCTS -/******************************************************************************/ -#define JEMALLOC_H_EXTERNS - -extern bool opt_abort; -#ifdef JEMALLOC_FILL -extern bool opt_junk; -#endif -#ifdef JEMALLOC_SYSV -extern bool opt_sysv; -#endif -#ifdef JEMALLOC_XMALLOC -extern bool opt_xmalloc; -#endif -#ifdef JEMALLOC_FILL -extern bool opt_zero; -#endif - -#ifdef DYNAMIC_PAGE_SHIFT -extern size_t pagesize; -extern size_t pagesize_mask; -extern size_t lg_pagesize; -#endif - -/* Number of CPUs. */ -extern unsigned ncpus; - -extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ -#ifndef NO_TLS -/* - * Map of pthread_self() --> arenas[???], used for selecting an arena to use - * for allocations. - */ -extern __thread arena_t *arenas_map JEMALLOC_ATTR(tls_model("initial-exec")); -#endif -/* - * Arenas that are used to service external requests. Not all elements of the - * arenas array are necessarily used; arenas are created lazily as needed. - */ -extern arena_t **arenas; -extern unsigned narenas; - -arena_t *arenas_extend(unsigned ind); -#ifndef NO_TLS -arena_t *choose_arena_hard(void); -#endif - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_EXTERNS -/******************************************************************************/ -#define JEMALLOC_H_INLINES - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_write(const char *s); -arena_t *choose_arena(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -/* - * Wrapper around malloc_message() that avoids the need for - * JEMALLOC_P(malloc_message)(...) throughout the code. - */ -JEMALLOC_INLINE void -malloc_write(const char *s) -{ - - JEMALLOC_P(malloc_message)(NULL, s); -} - -/* - * Choose an arena based on a per-thread value (fast-path code, calls slow-path - * code if necessary). - */ -JEMALLOC_INLINE arena_t * -choose_arena(void) -{ - arena_t *ret; - - /* - * We can only use TLS if this is a PIC library, since for the static - * library version, libc's malloc is used by TLS allocation, which - * introduces a bootstrapping issue. - */ -#ifndef NO_TLS - ret = arenas_map; - if (ret == NULL) { - ret = choose_arena_hard(); - assert(ret != NULL); - } -#else - if (isthreaded && narenas > 1) { - unsigned long ind; - - /* - * Hash pthread_self() to one of the arenas. There is a prime - * number of arenas, so this has a reasonable chance of - * working. Even so, the hashing can be easily thwarted by - * inconvenient pthread_self() values. Without specific - * knowledge of how pthread_self() calculates values, we can't - * easily do much better than this. - */ - ind = (unsigned long) pthread_self() % narenas; - - /* - * Optimistially assume that arenas[ind] has been initialized. - * At worst, we find out that some other thread has already - * done so, after acquiring the lock in preparation. Note that - * this lazy locking also has the effect of lazily forcing - * cache coherency; without the lock acquisition, there's no - * guarantee that modification of arenas[ind] by another thread - * would be seen on this CPU for an arbitrary amount of time. - * - * In general, this approach to modifying a synchronized value - * isn't a good idea, but in this case we only ever modify the - * value once, so things work out well. - */ - ret = arenas[ind]; - if (ret == NULL) { - /* - * Avoid races with another thread that may have already - * initialized arenas[ind]. - */ - malloc_mutex_lock(&arenas_lock); - if (arenas[ind] == NULL) - ret = arenas_extend((unsigned)ind); - else - ret = arenas[ind]; - malloc_mutex_unlock(&arenas_lock); - } - } else - ret = arenas[0]; -#endif - - assert(ret != NULL); - return (ret); -} -#endif - -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void *imalloc(size_t size); -void *icalloc(size_t size); -void *ipalloc(size_t alignment, size_t size); -size_t isalloc(const void *ptr); -void *iralloc(void *ptr, size_t size); -void idalloc(void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -JEMALLOC_INLINE void * -imalloc(size_t size) -{ - - assert(size != 0); - - if (size <= arena_maxclass) - return (arena_malloc(size, false)); - else - return (huge_malloc(size, false)); -} - -JEMALLOC_INLINE void * -icalloc(size_t size) -{ - - if (size <= arena_maxclass) - return (arena_malloc(size, true)); - else - return (huge_malloc(size, true)); -} - -JEMALLOC_INLINE void * -ipalloc(size_t alignment, size_t size) -{ - void *ret; - size_t ceil_size; - - /* - * Round size up to the nearest multiple of alignment. - * - * This done, we can take advantage of the fact that for each small - * size class, every object is aligned at the smallest power of two - * that is non-zero in the base two representation of the size. For - * example: - * - * Size | Base 2 | Minimum alignment - * -----+----------+------------------ - * 96 | 1100000 | 32 - * 144 | 10100000 | 32 - * 192 | 11000000 | 64 - * - * Depending on runtime settings, it is possible that arena_malloc() - * will further round up to a power of two, but that never causes - * correctness issues. - */ - ceil_size = (size + (alignment - 1)) & (-alignment); - /* - * (ceil_size < size) protects against the combination of maximal - * alignment and size greater than maximal alignment. - */ - if (ceil_size < size) { - /* size_t overflow. */ - return (NULL); - } - - if (ceil_size <= PAGE_SIZE || (alignment <= PAGE_SIZE - && ceil_size <= arena_maxclass)) - ret = arena_malloc(ceil_size, false); - else { - size_t run_size; - - /* - * We can't achieve subpage alignment, so round up alignment - * permanently; it makes later calculations simpler. - */ - alignment = PAGE_CEILING(alignment); - ceil_size = PAGE_CEILING(size); - /* - * (ceil_size < size) protects against very large sizes within - * PAGE_SIZE of SIZE_T_MAX. - * - * (ceil_size + alignment < ceil_size) protects against the - * combination of maximal alignment and ceil_size large enough - * to cause overflow. This is similar to the first overflow - * check above, but it needs to be repeated due to the new - * ceil_size value, which may now be *equal* to maximal - * alignment, whereas before we only detected overflow if the - * original size was *greater* than maximal alignment. - */ - if (ceil_size < size || ceil_size + alignment < ceil_size) { - /* size_t overflow. */ - return (NULL); - } - - /* - * Calculate the size of the over-size run that arena_palloc() - * would need to allocate in order to guarantee the alignment. - */ - if (ceil_size >= alignment) - run_size = ceil_size + alignment - PAGE_SIZE; - else { - /* - * It is possible that (alignment << 1) will cause - * overflow, but it doesn't matter because we also - * subtract PAGE_SIZE, which in the case of overflow - * leaves us with a very large run_size. That causes - * the first conditional below to fail, which means - * that the bogus run_size value never gets used for - * anything important. - */ - run_size = (alignment << 1) - PAGE_SIZE; - } - - if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), alignment, ceil_size, - run_size); - } else if (alignment <= chunksize) - ret = huge_malloc(ceil_size, false); - else - ret = huge_palloc(alignment, ceil_size); - } - - assert(((uintptr_t)ret & (alignment - 1)) == 0); - return (ret); -} - -JEMALLOC_INLINE size_t -isalloc(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - -#ifdef JEMALLOC_PROF - ret = arena_salloc_demote(ptr); -#else - ret = arena_salloc(ptr); -#endif - } else - ret = huge_salloc(ptr); - - return (ret); -} - -JEMALLOC_INLINE void * -iralloc(void *ptr, size_t size) -{ - size_t oldsize; - - assert(ptr != NULL); - assert(size != 0); - - oldsize = isalloc(ptr); - - if (size <= arena_maxclass) - return (arena_ralloc(ptr, size, oldsize)); - else - return (huge_ralloc(ptr, size, oldsize)); -} - -JEMALLOC_INLINE void -idalloc(void *ptr) -{ - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) - arena_dalloc(chunk->arena, chunk, ptr); - else - huge_dalloc(ptr); -} -#endif - -#undef JEMALLOC_H_INLINES -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/mb.h b/dep/include/jemalloc/internal/mb.h deleted file mode 100644 index 1707aa91d68..00000000000 --- a/dep/include/jemalloc/internal/mb.h +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void mb_write(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(MB_C_)) -#ifdef __i386__ -/* - * According to the Intel Architecture Software Developer's Manual, current - * processors execute instructions in order from the perspective of other - * processors in a multiprocessor system, but 1) Intel reserves the right to - * change that, and 2) the compiler's optimizer could re-order instructions if - * there weren't some form of barrier. Therefore, even if running on an - * architecture that does not need memory barriers (everything through at least - * i686), an "optimizer barrier" is necessary. - */ -JEMALLOC_INLINE void -mb_write(void) -{ - -# if 0 - /* This is a true memory barrier. */ - asm volatile ("pusha;" - "xor %%eax,%%eax;" - "cpuid;" - "popa;" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -#else - /* - * This is hopefully enough to keep the compiler from reordering - * instructions around this one. - */ - asm volatile ("nop;" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -#endif -} -#elif (defined(__amd64_) || defined(__x86_64__)) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("sfence" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#elif defined(__powerpc__) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("eieio" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#elif defined(__sparc64__) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("membar #StoreStore" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#else -/* - * This is much slower than a simple memory barrier, but the semantics of mutex - * unlock make this work. - */ -JEMALLOC_INLINE void -mb_write(void) -{ - malloc_mutex_t mtx; - - malloc_mutex_init(&mtx); - malloc_mutex_lock(&mtx); - malloc_mutex_unlock(&mtx); -} -#endif -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/mutex.h b/dep/include/jemalloc/internal/mutex.h deleted file mode 100644 index 108bfa8abfd..00000000000 --- a/dep/include/jemalloc/internal/mutex.h +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef pthread_mutex_t malloc_mutex_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#ifdef JEMALLOC_LAZY_LOCK -extern bool isthreaded; -#else -# define isthreaded true -#endif - -bool malloc_mutex_init(malloc_mutex_t *mutex); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_mutex_lock(malloc_mutex_t *mutex); -bool malloc_mutex_trylock(malloc_mutex_t *mutex); -void malloc_mutex_unlock(malloc_mutex_t *mutex); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_MUTEX_C_)) -JEMALLOC_INLINE void -malloc_mutex_lock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - pthread_mutex_lock(mutex); -} - -JEMALLOC_INLINE bool -malloc_mutex_trylock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - return (pthread_mutex_trylock(mutex) != 0); - else - return (false); -} - -JEMALLOC_INLINE void -malloc_mutex_unlock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - pthread_mutex_unlock(mutex); -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/prof.h b/dep/include/jemalloc/internal/prof.h deleted file mode 100644 index 6e71552d85e..00000000000 --- a/dep/include/jemalloc/internal/prof.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifdef JEMALLOC_PROF -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct prof_bt_s prof_bt_t; -typedef struct prof_cnt_s prof_cnt_t; -typedef struct prof_thr_cnt_s prof_thr_cnt_t; -typedef struct prof_ctx_s prof_ctx_t; -typedef struct prof_s prof_t; - -/* Option defaults. */ -#define LG_PROF_BT_MAX_DEFAULT 2 -#define LG_PROF_SAMPLE_DEFAULT 0 -#define LG_PROF_INTERVAL_DEFAULT 30 - -/* - * Hard limit on stack backtrace depth. Note that the version of - * prof_backtrace() that is based on __builtin_return_address() necessarily has - * a hard-coded number of backtrace frame handlers, so increasing - * LG_PROF_BT_MAX requires changing prof_backtrace(). - */ -#define LG_PROF_BT_MAX 7 /* >= LG_PROF_BT_MAX_DEFAULT */ -#define PROF_BT_MAX (1U << LG_PROF_BT_MAX) - -/* Initial hash table size. */ -#define PROF_CKH_MINITEMS 64 - -/* Size of memory buffer to use when writing dump files. */ -#define PROF_DUMP_BUF_SIZE 65536 - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct prof_bt_s { - /* Backtrace, stored as len program counters. */ - void **vec; - unsigned len; -}; - -#ifdef JEMALLOC_PROF_LIBGCC -/* Data structure passed to libgcc _Unwind_Backtrace() callback functions. */ -typedef struct { - prof_bt_t *bt; - unsigned nignore; - unsigned max; -} prof_unwind_data_t; -#endif - -struct prof_cnt_s { - /* - * Profiling counters. An allocation/deallocation pair can operate on - * different prof_thr_cnt_t objects that are linked into the same - * prof_ctx_t sets_ql, so it is possible for the cur* counters to go - * negative. In principle it is possible for the *bytes counters to - * overflow/underflow, but a general solution would require some form - * of 128-bit counter solution; this implementation doesn't bother to - * solve that problem. - */ - int64_t curobjs; - int64_t curbytes; - uint64_t accumobjs; - uint64_t accumbytes; -}; - -struct prof_thr_cnt_s { - /* Linkage into prof_ctx_t's sets_ql. */ - ql_elm(prof_thr_cnt_t) link; - - /* - * Associated context. If a thread frees an object that it did not - * allocate, it is possible that the context is not cached in the - * thread's hash table, in which case it must be able to look up the - * context, insert a new prof_thr_cnt_t into the thread's hash table, - * and link it into the prof_ctx_t's sets_ql. - */ - prof_ctx_t *ctx; - - /* - * Threads use memory barriers to update the counters. Since there is - * only ever one writer, the only challenge is for the reader to get a - * consistent read of the counters. - * - * The writer uses this series of operations: - * - * 1) Increment epoch to an odd number. - * 2) Update counters. - * 3) Increment epoch to an even number. - * - * The reader must assure 1) that the epoch is even while it reads the - * counters, and 2) that the epoch doesn't change between the time it - * starts and finishes reading the counters. - */ - unsigned epoch; - - /* Profiling counters. */ - prof_cnt_t cnts; -}; - -struct prof_ctx_s { - /* Protects cnt_merged and sets_ql. */ - malloc_mutex_t lock; - - /* Temporary storage for aggregation during dump. */ - prof_cnt_t cnt_dump; - - /* When threads exit, they merge their stats into cnt_merged. */ - prof_cnt_t cnt_merged; - - /* - * List of profile counters, one for each thread that has allocated in - * this context. - */ - ql_head(prof_thr_cnt_t) cnts_ql; -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_prof; -/* - * Even if opt_prof is true, sampling can be temporarily disabled by setting - * opt_prof_active to false. No locking is used when updating opt_prof_active, - * so there are no guarantees regarding how long it will take for all threads - * to notice state changes. - */ -extern bool opt_prof_active; -extern size_t opt_lg_prof_bt_max; /* Maximum backtrace depth. */ -extern size_t opt_lg_prof_sample; /* Mean bytes between samples. */ -extern ssize_t opt_lg_prof_interval; /* lg(prof_interval). */ -extern bool opt_prof_udump; /* High-water memory dumping. */ -extern bool opt_prof_leak; /* Dump leak summary at exit. */ - -/* - * Profile dump interval, measured in bytes allocated. Each arena triggers a - * profile dump when it reaches this threshold. The effect is that the - * interval between profile dumps averages prof_interval, though the actual - * interval between dumps will tend to be sporadic, and the interval will be a - * maximum of approximately (prof_interval * narenas). - */ -extern uint64_t prof_interval; - -/* - * If true, promote small sampled objects to large objects, since small run - * headers do not have embedded profile context pointers. - */ -extern bool prof_promote; - -bool prof_init(prof_t *prof, bool master); -void prof_destroy(prof_t *prof); - -prof_thr_cnt_t *prof_alloc_prep(size_t size); -prof_thr_cnt_t *prof_cnt_get(const void *ptr); -void prof_malloc(const void *ptr, prof_thr_cnt_t *cnt); -void prof_realloc(const void *ptr, prof_thr_cnt_t *cnt, const void *old_ptr, - size_t old_size, prof_thr_cnt_t *old_cnt); -void prof_free(const void *ptr); -void prof_idump(void); -bool prof_mdump(const char *filename); -void prof_udump(void); -void prof_boot0(void); -bool prof_boot1(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_PROF */ diff --git a/dep/include/jemalloc/internal/ql.h b/dep/include/jemalloc/internal/ql.h deleted file mode 100644 index a9ed2393f0c..00000000000 --- a/dep/include/jemalloc/internal/ql.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * List definitions. - */ -#define ql_head(a_type) \ -struct { \ - a_type *qlh_first; \ -} - -#define ql_head_initializer(a_head) {NULL} - -#define ql_elm(a_type) qr(a_type) - -/* List functions. */ -#define ql_new(a_head) do { \ - (a_head)->qlh_first = NULL; \ -} while (0) - -#define ql_elm_new(a_elm, a_field) qr_new((a_elm), a_field) - -#define ql_first(a_head) ((a_head)->qlh_first) - -#define ql_last(a_head, a_field) \ - ((ql_first(a_head) != NULL) \ - ? qr_prev(ql_first(a_head), a_field) : NULL) - -#define ql_next(a_head, a_elm, a_field) \ - ((ql_last(a_head, a_field) != (a_elm)) \ - ? qr_next((a_elm), a_field) : NULL) - -#define ql_prev(a_head, a_elm, a_field) \ - ((ql_first(a_head) != (a_elm)) ? qr_prev((a_elm), a_field) \ - : NULL) - -#define ql_before_insert(a_head, a_qlelm, a_elm, a_field) do { \ - qr_before_insert((a_qlelm), (a_elm), a_field); \ - if (ql_first(a_head) == (a_qlelm)) { \ - ql_first(a_head) = (a_elm); \ - } \ -} while (0) - -#define ql_after_insert(a_qlelm, a_elm, a_field) \ - qr_after_insert((a_qlelm), (a_elm), a_field) - -#define ql_head_insert(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) != NULL) { \ - qr_before_insert(ql_first(a_head), (a_elm), a_field); \ - } \ - ql_first(a_head) = (a_elm); \ -} while (0) - -#define ql_tail_insert(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) != NULL) { \ - qr_before_insert(ql_first(a_head), (a_elm), a_field); \ - } \ - ql_first(a_head) = qr_next((a_elm), a_field); \ -} while (0) - -#define ql_remove(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) == (a_elm)) { \ - ql_first(a_head) = qr_next(ql_first(a_head), a_field); \ - } \ - if (ql_first(a_head) != (a_elm)) { \ - qr_remove((a_elm), a_field); \ - } else { \ - ql_first(a_head) = NULL; \ - } \ -} while (0) - -#define ql_head_remove(a_head, a_type, a_field) do { \ - a_type *t = ql_first(a_head); \ - ql_remove((a_head), t, a_field); \ -} while (0) - -#define ql_tail_remove(a_head, a_type, a_field) do { \ - a_type *t = ql_last(a_head, a_field); \ - ql_remove((a_head), t, a_field); \ -} while (0) - -#define ql_foreach(a_var, a_head, a_field) \ - qr_foreach((a_var), ql_first(a_head), a_field) - -#define ql_reverse_foreach(a_var, a_head, a_field) \ - qr_reverse_foreach((a_var), ql_first(a_head), a_field) diff --git a/dep/include/jemalloc/internal/qr.h b/dep/include/jemalloc/internal/qr.h deleted file mode 100644 index fe22352fedd..00000000000 --- a/dep/include/jemalloc/internal/qr.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Ring definitions. */ -#define qr(a_type) \ -struct { \ - a_type *qre_next; \ - a_type *qre_prev; \ -} - -/* Ring functions. */ -#define qr_new(a_qr, a_field) do { \ - (a_qr)->a_field.qre_next = (a_qr); \ - (a_qr)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_next(a_qr, a_field) ((a_qr)->a_field.qre_next) - -#define qr_prev(a_qr, a_field) ((a_qr)->a_field.qre_prev) - -#define qr_before_insert(a_qrelm, a_qr, a_field) do { \ - (a_qr)->a_field.qre_prev = (a_qrelm)->a_field.qre_prev; \ - (a_qr)->a_field.qre_next = (a_qrelm); \ - (a_qr)->a_field.qre_prev->a_field.qre_next = (a_qr); \ - (a_qrelm)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_after_insert(a_qrelm, a_qr, a_field) \ - do \ - { \ - (a_qr)->a_field.qre_next = (a_qrelm)->a_field.qre_next; \ - (a_qr)->a_field.qre_prev = (a_qrelm); \ - (a_qr)->a_field.qre_next->a_field.qre_prev = (a_qr); \ - (a_qrelm)->a_field.qre_next = (a_qr); \ - } while (0) - -#define qr_meld(a_qr_a, a_qr_b, a_field) do { \ - void *t; \ - (a_qr_a)->a_field.qre_prev->a_field.qre_next = (a_qr_b); \ - (a_qr_b)->a_field.qre_prev->a_field.qre_next = (a_qr_a); \ - t = (a_qr_a)->a_field.qre_prev; \ - (a_qr_a)->a_field.qre_prev = (a_qr_b)->a_field.qre_prev; \ - (a_qr_b)->a_field.qre_prev = t; \ -} while (0) - -/* qr_meld() and qr_split() are functionally equivalent, so there's no need to - * have two copies of the code. */ -#define qr_split(a_qr_a, a_qr_b, a_field) \ - qr_meld((a_qr_a), (a_qr_b), a_field) - -#define qr_remove(a_qr, a_field) do { \ - (a_qr)->a_field.qre_prev->a_field.qre_next \ - = (a_qr)->a_field.qre_next; \ - (a_qr)->a_field.qre_next->a_field.qre_prev \ - = (a_qr)->a_field.qre_prev; \ - (a_qr)->a_field.qre_next = (a_qr); \ - (a_qr)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_foreach(var, a_qr, a_field) \ - for ((var) = (a_qr); \ - (var) != NULL; \ - (var) = (((var)->a_field.qre_next != (a_qr)) \ - ? (var)->a_field.qre_next : NULL)) - -#define qr_reverse_foreach(var, a_qr, a_field) \ - for ((var) = ((a_qr) != NULL) ? qr_prev(a_qr, a_field) : NULL; \ - (var) != NULL; \ - (var) = (((var) != (a_qr)) \ - ? (var)->a_field.qre_prev : NULL)) diff --git a/dep/include/jemalloc/internal/rb.h b/dep/include/jemalloc/internal/rb.h deleted file mode 100644 index ee9b009d235..00000000000 --- a/dep/include/jemalloc/internal/rb.h +++ /dev/null @@ -1,973 +0,0 @@ -/*- - ******************************************************************************* - * - * cpp macro implementation of left-leaning 2-3 red-black trees. Parent - * pointers are not used, and color bits are stored in the least significant - * bit of right-child pointers (if RB_COMPACT is defined), thus making node - * linkage as compact as is possible for red-black trees. - * - * Usage: - * - * #include - * #include - * #define NDEBUG // (Optional, see assert(3).) - * #include - * #define RB_COMPACT // (Optional, embed color bits in right-child pointers.) - * #include - * ... - * - ******************************************************************************* - */ - -#ifndef RB_H_ -#define RB_H_ - -#if 0 -__FBSDID("$FreeBSD: head/lib/libc/stdlib/rb.h 204493 2010-02-28 22:57:13Z jasone $"); -#endif - -#ifdef RB_COMPACT -/* Node structure. */ -#define rb_node(a_type) \ -struct { \ - a_type *rbn_left; \ - a_type *rbn_right_red; \ -} -#else -#define rb_node(a_type) \ -struct { \ - a_type *rbn_left; \ - a_type *rbn_right; \ - bool rbn_red; \ -} -#endif - -/* Root structure. */ -#define rb_tree(a_type) \ -struct { \ - a_type *rbt_root; \ - a_type rbt_nil; \ -} - -/* Left accessors. */ -#define rbtn_left_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_left) -#define rbtn_left_set(a_type, a_field, a_node, a_left) do { \ - (a_node)->a_field.rbn_left = a_left; \ -} while (0) - -#ifdef RB_COMPACT -/* Right accessors. */ -#define rbtn_right_get(a_type, a_field, a_node) \ - ((a_type *) (((intptr_t) (a_node)->a_field.rbn_right_red) \ - & ((ssize_t)-2))) -#define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) a_right) \ - | (((uintptr_t) (a_node)->a_field.rbn_right_red) & ((size_t)1))); \ -} while (0) - -/* Color accessors. */ -#define rbtn_red_get(a_type, a_field, a_node) \ - ((bool) (((uintptr_t) (a_node)->a_field.rbn_right_red) \ - & ((size_t)1))) -#define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) ((((intptr_t) \ - (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)) \ - | ((ssize_t)a_red)); \ -} while (0) -#define rbtn_red_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) \ - (a_node)->a_field.rbn_right_red) | ((size_t)1)); \ -} while (0) -#define rbtn_black_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((intptr_t) \ - (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)); \ -} while (0) -#else -/* Right accessors. */ -#define rbtn_right_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_right) -#define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ - (a_node)->a_field.rbn_right = a_right; \ -} while (0) - -/* Color accessors. */ -#define rbtn_red_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_red) -#define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ - (a_node)->a_field.rbn_red = (a_red); \ -} while (0) -#define rbtn_red_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_red = true; \ -} while (0) -#define rbtn_black_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_red = false; \ -} while (0) -#endif - -/* Node initializer. */ -#define rbt_node_new(a_type, a_field, a_rbt, a_node) do { \ - rbtn_left_set(a_type, a_field, (a_node), &(a_rbt)->rbt_nil); \ - rbtn_right_set(a_type, a_field, (a_node), &(a_rbt)->rbt_nil); \ - rbtn_red_set(a_type, a_field, (a_node)); \ -} while (0) - -/* Tree initializer. */ -#define rb_new(a_type, a_field, a_rbt) do { \ - (a_rbt)->rbt_root = &(a_rbt)->rbt_nil; \ - rbt_node_new(a_type, a_field, a_rbt, &(a_rbt)->rbt_nil); \ - rbtn_black_set(a_type, a_field, &(a_rbt)->rbt_nil); \ -} while (0) - -/* Internal utility macros. */ -#define rbtn_first(a_type, a_field, a_rbt, a_root, r_node) do { \ - (r_node) = (a_root); \ - if ((r_node) != &(a_rbt)->rbt_nil) { \ - for (; \ - rbtn_left_get(a_type, a_field, (r_node)) != &(a_rbt)->rbt_nil;\ - (r_node) = rbtn_left_get(a_type, a_field, (r_node))) { \ - } \ - } \ -} while (0) - -#define rbtn_last(a_type, a_field, a_rbt, a_root, r_node) do { \ - (r_node) = (a_root); \ - if ((r_node) != &(a_rbt)->rbt_nil) { \ - for (; rbtn_right_get(a_type, a_field, (r_node)) != \ - &(a_rbt)->rbt_nil; (r_node) = rbtn_right_get(a_type, a_field, \ - (r_node))) { \ - } \ - } \ -} while (0) - -#define rbtn_rotate_left(a_type, a_field, a_node, r_node) do { \ - (r_node) = rbtn_right_get(a_type, a_field, (a_node)); \ - rbtn_right_set(a_type, a_field, (a_node), \ - rbtn_left_get(a_type, a_field, (r_node))); \ - rbtn_left_set(a_type, a_field, (r_node), (a_node)); \ -} while (0) - -#define rbtn_rotate_right(a_type, a_field, a_node, r_node) do { \ - (r_node) = rbtn_left_get(a_type, a_field, (a_node)); \ - rbtn_left_set(a_type, a_field, (a_node), \ - rbtn_right_get(a_type, a_field, (r_node))); \ - rbtn_right_set(a_type, a_field, (r_node), (a_node)); \ -} while (0) - -/* - * The rb_proto() macro generates function prototypes that correspond to the - * functions generated by an equivalently parameterized call to rb_gen(). - */ - -#define rb_proto(a_attr, a_prefix, a_rbt_type, a_type) \ -a_attr void \ -a_prefix##new(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##first(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##last(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##next(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##prev(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##search(a_rbt_type *rbtree, a_type *key); \ -a_attr a_type * \ -a_prefix##nsearch(a_rbt_type *rbtree, a_type *key); \ -a_attr a_type * \ -a_prefix##psearch(a_rbt_type *rbtree, a_type *key); \ -a_attr void \ -a_prefix##insert(a_rbt_type *rbtree, a_type *node); \ -a_attr void \ -a_prefix##remove(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##iter(a_rbt_type *rbtree, a_type *start, a_type *(*cb)( \ - a_rbt_type *, a_type *, void *), void *arg); \ -a_attr a_type * \ -a_prefix##reverse_iter(a_rbt_type *rbtree, a_type *start, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg); - -/* - * The rb_gen() macro generates a type-specific red-black tree implementation, - * based on the above cpp macros. - * - * Arguments: - * - * a_attr : Function attribute for generated functions (ex: static). - * a_prefix : Prefix for generated functions (ex: ex_). - * a_rb_type : Type for red-black tree data structure (ex: ex_t). - * a_type : Type for red-black tree node data structure (ex: ex_node_t). - * a_field : Name of red-black tree node linkage (ex: ex_link). - * a_cmp : Node comparison function name, with the following prototype: - * int (a_cmp *)(a_type *a_node, a_type *a_other); - * ^^^^^^ - * or a_key - * Interpretation of comparision function return values: - * -1 : a_node < a_other - * 0 : a_node == a_other - * 1 : a_node > a_other - * In all cases, the a_node or a_key macro argument is the first - * argument to the comparison function, which makes it possible - * to write comparison functions that treat the first argument - * specially. - * - * Assuming the following setup: - * - * typedef struct ex_node_s ex_node_t; - * struct ex_node_s { - * rb_node(ex_node_t) ex_link; - * }; - * typedef rb_tree(ex_node_t) ex_t; - * rb_gen(static, ex_, ex_t, ex_node_t, ex_link, ex_cmp) - * - * The following API is generated: - * - * static void - * ex_new(ex_t *extree); - * Description: Initialize a red-black tree structure. - * Args: - * extree: Pointer to an uninitialized red-black tree object. - * - * static ex_node_t * - * ex_first(ex_t *extree); - * static ex_node_t * - * ex_last(ex_t *extree); - * Description: Get the first/last node in extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * Ret: First/last node in extree, or NULL if extree is empty. - * - * static ex_node_t * - * ex_next(ex_t *extree, ex_node_t *node); - * static ex_node_t * - * ex_prev(ex_t *extree, ex_node_t *node); - * Description: Get node's successor/predecessor. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : A node in extree. - * Ret: node's successor/predecessor in extree, or NULL if node is - * last/first. - * - * static ex_node_t * - * ex_search(ex_t *extree, ex_node_t *key); - * Description: Search for node that matches key. - * Args: - * extree: Pointer to an initialized red-black tree object. - * key : Search key. - * Ret: Node in extree that matches key, or NULL if no match. - * - * static ex_node_t * - * ex_nsearch(ex_t *extree, ex_node_t *key); - * static ex_node_t * - * ex_psearch(ex_t *extree, ex_node_t *key); - * Description: Search for node that matches key. If no match is found, - * return what would be key's successor/predecessor, were - * key in extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * key : Search key. - * Ret: Node in extree that matches key, or if no match, hypothetical - * node's successor/predecessor (NULL if no successor/predecessor). - * - * static void - * ex_insert(ex_t *extree, ex_node_t *node); - * Description: Insert node into extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : Node to be inserted into extree. - * - * static void - * ex_remove(ex_t *extree, ex_node_t *node); - * Description: Remove node from extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : Node in extree to be removed. - * - * static ex_node_t * - * ex_iter(ex_t *extree, ex_node_t *start, ex_node_t *(*cb)(ex_t *, - * ex_node_t *, void *), void *arg); - * static ex_node_t * - * ex_reverse_iter(ex_t *extree, ex_node_t *start, ex_node *(*cb)(ex_t *, - * ex_node_t *, void *), void *arg); - * Description: Iterate forward/backward over extree, starting at node. - * If extree is modified, iteration must be immediately - * terminated by the callback function that causes the - * modification. - * Args: - * extree: Pointer to an initialized red-black tree object. - * start : Node at which to start iteration, or NULL to start at - * first/last node. - * cb : Callback function, which is called for each node during - * iteration. Under normal circumstances the callback function - * should return NULL, which causes iteration to continue. If a - * callback function returns non-NULL, iteration is immediately - * terminated and the non-NULL return value is returned by the - * iterator. This is useful for re-starting iteration after - * modifying extree. - * arg : Opaque pointer passed to cb(). - * Ret: NULL if iteration completed, or the non-NULL callback return value - * that caused termination of the iteration. - */ -#define rb_gen(a_attr, a_prefix, a_rbt_type, a_type, a_field, a_cmp) \ -a_attr void \ -a_prefix##new(a_rbt_type *rbtree) { \ - rb_new(a_type, a_field, rbtree); \ -} \ -a_attr a_type * \ -a_prefix##first(a_rbt_type *rbtree) { \ - a_type *ret; \ - rbtn_first(a_type, a_field, rbtree, rbtree->rbt_root, ret); \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##last(a_rbt_type *rbtree) { \ - a_type *ret; \ - rbtn_last(a_type, a_field, rbtree, rbtree->rbt_root, ret); \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##next(a_rbt_type *rbtree, a_type *node) { \ - a_type *ret; \ - if (rbtn_right_get(a_type, a_field, node) != &rbtree->rbt_nil) { \ - rbtn_first(a_type, a_field, rbtree, rbtn_right_get(a_type, \ - a_field, node), ret); \ - } else { \ - a_type *tnode = rbtree->rbt_root; \ - assert(tnode != &rbtree->rbt_nil); \ - ret = &rbtree->rbt_nil; \ - while (true) { \ - int cmp = (a_cmp)(node, tnode); \ - if (cmp < 0) { \ - ret = tnode; \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - break; \ - } \ - assert(tnode != &rbtree->rbt_nil); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##prev(a_rbt_type *rbtree, a_type *node) { \ - a_type *ret; \ - if (rbtn_left_get(a_type, a_field, node) != &rbtree->rbt_nil) { \ - rbtn_last(a_type, a_field, rbtree, rbtn_left_get(a_type, \ - a_field, node), ret); \ - } else { \ - a_type *tnode = rbtree->rbt_root; \ - assert(tnode != &rbtree->rbt_nil); \ - ret = &rbtree->rbt_nil; \ - while (true) { \ - int cmp = (a_cmp)(node, tnode); \ - if (cmp < 0) { \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - ret = tnode; \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - break; \ - } \ - assert(tnode != &rbtree->rbt_nil); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##search(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - int cmp; \ - ret = rbtree->rbt_root; \ - while (ret != &rbtree->rbt_nil \ - && (cmp = (a_cmp)(key, ret)) != 0) { \ - if (cmp < 0) { \ - ret = rbtn_left_get(a_type, a_field, ret); \ - } else { \ - ret = rbtn_right_get(a_type, a_field, ret); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##nsearch(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - a_type *tnode = rbtree->rbt_root; \ - ret = &rbtree->rbt_nil; \ - while (tnode != &rbtree->rbt_nil) { \ - int cmp = (a_cmp)(key, tnode); \ - if (cmp < 0) { \ - ret = tnode; \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - ret = tnode; \ - break; \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##psearch(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - a_type *tnode = rbtree->rbt_root; \ - ret = &rbtree->rbt_nil; \ - while (tnode != &rbtree->rbt_nil) { \ - int cmp = (a_cmp)(key, tnode); \ - if (cmp < 0) { \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - ret = tnode; \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - ret = tnode; \ - break; \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr void \ -a_prefix##insert(a_rbt_type *rbtree, a_type *node) { \ - struct { \ - a_type *node; \ - int cmp; \ - } path[sizeof(void *) << 4], *pathp; \ - rbt_node_new(a_type, a_field, rbtree, node); \ - /* Wind. */ \ - path->node = rbtree->rbt_root; \ - for (pathp = path; pathp->node != &rbtree->rbt_nil; pathp++) { \ - int cmp = pathp->cmp = a_cmp(node, pathp->node); \ - assert(cmp != 0); \ - if (cmp < 0) { \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } else { \ - pathp[1].node = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - } \ - } \ - pathp->node = node; \ - /* Unwind. */ \ - for (pathp--; (uintptr_t)pathp >= (uintptr_t)path; pathp--) { \ - a_type *cnode = pathp->node; \ - if (pathp->cmp < 0) { \ - a_type *left = pathp[1].node; \ - rbtn_left_set(a_type, a_field, cnode, left); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* Fix up 4-node. */ \ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, cnode, tnode); \ - cnode = tnode; \ - } \ - } else { \ - return; \ - } \ - } else { \ - a_type *right = pathp[1].node; \ - rbtn_right_set(a_type, a_field, cnode, right); \ - if (rbtn_red_get(a_type, a_field, right)) { \ - a_type *left = rbtn_left_get(a_type, a_field, cnode); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - /* Split 4-node. */ \ - rbtn_black_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, right); \ - rbtn_red_set(a_type, a_field, cnode); \ - } else { \ - /* Lean left. */ \ - a_type *tnode; \ - bool tred = rbtn_red_get(a_type, a_field, cnode); \ - rbtn_rotate_left(a_type, a_field, cnode, tnode); \ - rbtn_color_set(a_type, a_field, tnode, tred); \ - rbtn_red_set(a_type, a_field, cnode); \ - cnode = tnode; \ - } \ - } else { \ - return; \ - } \ - } \ - pathp->node = cnode; \ - } \ - /* Set root, and make it black. */ \ - rbtree->rbt_root = path->node; \ - rbtn_black_set(a_type, a_field, rbtree->rbt_root); \ -} \ -a_attr void \ -a_prefix##remove(a_rbt_type *rbtree, a_type *node) { \ - struct { \ - a_type *node; \ - int cmp; \ - } *pathp, *nodep, path[sizeof(void *) << 4]; \ - /* Wind. */ \ - nodep = NULL; /* Silence compiler warning. */ \ - path->node = rbtree->rbt_root; \ - for (pathp = path; pathp->node != &rbtree->rbt_nil; pathp++) { \ - int cmp = pathp->cmp = a_cmp(node, pathp->node); \ - if (cmp < 0) { \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } else { \ - pathp[1].node = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - if (cmp == 0) { \ - /* Find node's successor, in preparation for swap. */ \ - pathp->cmp = 1; \ - nodep = pathp; \ - for (pathp++; pathp->node != &rbtree->rbt_nil; \ - pathp++) { \ - pathp->cmp = -1; \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } \ - break; \ - } \ - } \ - } \ - assert(nodep->node == node); \ - pathp--; \ - if (pathp->node != node) { \ - /* Swap node with its successor. */ \ - bool tred = rbtn_red_get(a_type, a_field, pathp->node); \ - rbtn_color_set(a_type, a_field, pathp->node, \ - rbtn_red_get(a_type, a_field, node)); \ - rbtn_left_set(a_type, a_field, pathp->node, \ - rbtn_left_get(a_type, a_field, node)); \ - /* If node's successor is its right child, the following code */\ - /* will do the wrong thing for the right child pointer. */\ - /* However, it doesn't matter, because the pointer will be */\ - /* properly set when the successor is pruned. */\ - rbtn_right_set(a_type, a_field, pathp->node, \ - rbtn_right_get(a_type, a_field, node)); \ - rbtn_color_set(a_type, a_field, node, tred); \ - /* The pruned leaf node's child pointers are never accessed */\ - /* again, so don't bother setting them to nil. */\ - nodep->node = pathp->node; \ - pathp->node = node; \ - if (nodep == path) { \ - rbtree->rbt_root = nodep->node; \ - } else { \ - if (nodep[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, nodep[-1].node, \ - nodep->node); \ - } else { \ - rbtn_right_set(a_type, a_field, nodep[-1].node, \ - nodep->node); \ - } \ - } \ - } else { \ - a_type *left = rbtn_left_get(a_type, a_field, node); \ - if (left != &rbtree->rbt_nil) { \ - /* node has no successor, but it has a left child. */\ - /* Splice node out, without losing the left child. */\ - assert(rbtn_red_get(a_type, a_field, node) == false); \ - assert(rbtn_red_get(a_type, a_field, left)); \ - rbtn_black_set(a_type, a_field, left); \ - if (pathp == path) { \ - rbtree->rbt_root = left; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - left); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - left); \ - } \ - } \ - return; \ - } else if (pathp == path) { \ - /* The tree only contained one node. */ \ - rbtree->rbt_root = &rbtree->rbt_nil; \ - return; \ - } \ - } \ - if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - /* Prune red node, which requires no fixup. */ \ - assert(pathp[-1].cmp < 0); \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - &rbtree->rbt_nil); \ - return; \ - } \ - /* The node to be pruned is black, so unwind until balance is */\ - /* restored. */\ - pathp->node = &rbtree->rbt_nil; \ - for (pathp--; (uintptr_t)pathp >= (uintptr_t)path; pathp--) { \ - assert(pathp->cmp != 0); \ - if (pathp->cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp->node, \ - pathp[1].node); \ - assert(rbtn_red_get(a_type, a_field, pathp[1].node) \ - == false); \ - if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - a_type *right = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - a_type *rightleft = rbtn_left_get(a_type, a_field, \ - right); \ - a_type *tnode; \ - if (rbtn_red_get(a_type, a_field, rightleft)) { \ - /* In the following diagrams, ||, //, and \\ */\ - /* indicate the path to the removed node. */\ - /* */\ - /* || */\ - /* pathp(r) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - /* */\ - rbtn_black_set(a_type, a_field, pathp->node); \ - rbtn_rotate_right(a_type, a_field, right, tnode); \ - rbtn_right_set(a_type, a_field, pathp->node, tnode);\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - } else { \ - /* || */\ - /* pathp(r) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - /* */\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - } \ - /* Balance restored, but rotation modified subtree */\ - /* root. */\ - assert((uintptr_t)pathp > (uintptr_t)path); \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - return; \ - } else { \ - a_type *right = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - a_type *rightleft = rbtn_left_get(a_type, a_field, \ - right); \ - if (rbtn_red_get(a_type, a_field, rightleft)) { \ - /* || */\ - /* pathp(b) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, rightleft); \ - rbtn_rotate_right(a_type, a_field, right, tnode); \ - rbtn_right_set(a_type, a_field, pathp->node, tnode);\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subree root, which may actually be the tree */\ - /* root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - a_type *tnode; \ - rbtn_red_set(a_type, a_field, pathp->node); \ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - pathp->node = tnode; \ - } \ - } \ - } else { \ - a_type *left; \ - rbtn_right_set(a_type, a_field, pathp->node, \ - pathp[1].node); \ - left = rbtn_left_get(a_type, a_field, pathp->node); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - a_type *tnode; \ - a_type *leftright = rbtn_right_get(a_type, a_field, \ - left); \ - a_type *leftrightleft = rbtn_left_get(a_type, a_field, \ - leftright); \ - if (rbtn_red_get(a_type, a_field, leftrightleft)) { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (r) (b) */\ - /* \ */\ - /* (b) */\ - /* / */\ - /* (r) */\ - a_type *unode; \ - rbtn_black_set(a_type, a_field, leftrightleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - unode); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - rbtn_right_set(a_type, a_field, unode, tnode); \ - rbtn_rotate_left(a_type, a_field, unode, tnode); \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (r) (b) */\ - /* \ */\ - /* (b) */\ - /* / */\ - /* (b) */\ - assert(leftright != &rbtree->rbt_nil); \ - rbtn_red_set(a_type, a_field, leftright); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - rbtn_black_set(a_type, a_field, tnode); \ - } \ - /* Balance restored, but rotation modified subtree */\ - /* root, which may actually be the tree root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - } \ - return; \ - } else if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* || */\ - /* pathp(r) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, pathp->node); \ - rbtn_red_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subtree root. */\ - assert((uintptr_t)pathp > (uintptr_t)path); \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(r) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - rbtn_red_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, pathp->node); \ - /* Balance restored. */ \ - return; \ - } \ - } else { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subtree root, which may actually be the tree */\ - /* root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - rbtn_red_set(a_type, a_field, left); \ - } \ - } \ - } \ - } \ - /* Set root. */ \ - rbtree->rbt_root = path->node; \ - assert(rbtn_red_get(a_type, a_field, rbtree->rbt_root) == false); \ -} \ -a_attr a_type * \ -a_prefix##iter_recurse(a_rbt_type *rbtree, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - if (node == &rbtree->rbt_nil) { \ - return (&rbtree->rbt_nil); \ - } else { \ - a_type *ret; \ - if ((ret = a_prefix##iter_recurse(rbtree, rbtn_left_get(a_type, \ - a_field, node), cb, arg)) != &rbtree->rbt_nil \ - || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##iter_start(a_rbt_type *rbtree, a_type *start, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - int cmp = a_cmp(start, node); \ - if (cmp < 0) { \ - a_type *ret; \ - if ((ret = a_prefix##iter_start(rbtree, start, \ - rbtn_left_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } else if (cmp > 0) { \ - return (a_prefix##iter_start(rbtree, start, \ - rbtn_right_get(a_type, a_field, node), cb, arg)); \ - } else { \ - a_type *ret; \ - if ((ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##iter(a_rbt_type *rbtree, a_type *start, a_type *(*cb)( \ - a_rbt_type *, a_type *, void *), void *arg) { \ - a_type *ret; \ - if (start != NULL) { \ - ret = a_prefix##iter_start(rbtree, start, rbtree->rbt_root, \ - cb, arg); \ - } else { \ - ret = a_prefix##iter_recurse(rbtree, rbtree->rbt_root, cb, arg);\ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter_recurse(a_rbt_type *rbtree, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - if (node == &rbtree->rbt_nil) { \ - return (&rbtree->rbt_nil); \ - } else { \ - a_type *ret; \ - if ((ret = a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_right_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter_start(a_rbt_type *rbtree, a_type *start, \ - a_type *node, a_type *(*cb)(a_rbt_type *, a_type *, void *), \ - void *arg) { \ - int cmp = a_cmp(start, node); \ - if (cmp > 0) { \ - a_type *ret; \ - if ((ret = a_prefix##reverse_iter_start(rbtree, start, \ - rbtn_right_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } else if (cmp < 0) { \ - return (a_prefix##reverse_iter_start(rbtree, start, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } else { \ - a_type *ret; \ - if ((ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter(a_rbt_type *rbtree, a_type *start, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - a_type *ret; \ - if (start != NULL) { \ - ret = a_prefix##reverse_iter_start(rbtree, start, \ - rbtree->rbt_root, cb, arg); \ - } else { \ - ret = a_prefix##reverse_iter_recurse(rbtree, rbtree->rbt_root, \ - cb, arg); \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} - -#endif /* RB_H_ */ diff --git a/dep/include/jemalloc/internal/stats.h b/dep/include/jemalloc/internal/stats.h deleted file mode 100644 index cbf035ff2b9..00000000000 --- a/dep/include/jemalloc/internal/stats.h +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#define UMAX2S_BUFSIZE 65 - -#ifdef JEMALLOC_STATS -typedef struct tcache_bin_stats_s tcache_bin_stats_t; -typedef struct malloc_bin_stats_s malloc_bin_stats_t; -typedef struct malloc_large_stats_s malloc_large_stats_t; -typedef struct arena_stats_s arena_stats_t; -#endif -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -typedef struct chunk_stats_s chunk_stats_t; -#endif - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#ifdef JEMALLOC_STATS - -#ifdef JEMALLOC_TCACHE -struct tcache_bin_stats_s { - /* - * Number of allocation requests that corresponded to the size of this - * bin. - */ - uint64_t nrequests; -}; -#endif - -struct malloc_bin_stats_s { - /* - * Current number of bytes allocated, including objects currently - * cached by tcache. - */ - size_t allocated; - - /* - * Total number of allocation/deallocation requests served directly by - * the bin. Note that tcache may allocate an object, then recycle it - * many times, resulting many increments to nrequests, but only one - * each to nmalloc and ndalloc. - */ - uint64_t nmalloc; - uint64_t ndalloc; - - /* - * Number of allocation requests that correspond to the size of this - * bin. This includes requests served by tcache, though tcache only - * periodically merges into this counter. - */ - uint64_t nrequests; - -#ifdef JEMALLOC_TCACHE - /* Number of tcache fills from this bin. */ - uint64_t nfills; - - /* Number of tcache flushes to this bin. */ - uint64_t nflushes; -#endif - - /* Total number of runs created for this bin's size class. */ - uint64_t nruns; - - /* - * Total number of runs reused by extracting them from the runs tree for - * this bin's size class. - */ - uint64_t reruns; - - /* High-water mark for this bin. */ - size_t highruns; - - /* Current number of runs in this bin. */ - size_t curruns; -}; - -struct malloc_large_stats_s { - /* - * Total number of allocation/deallocation requests served directly by - * the arena. Note that tcache may allocate an object, then recycle it - * many times, resulting many increments to nrequests, but only one - * each to nmalloc and ndalloc. - */ - uint64_t nmalloc; - uint64_t ndalloc; - - /* - * Number of allocation requests that correspond to this size class. - * This includes requests served by tcache, though tcache only - * periodically merges into this counter. - */ - uint64_t nrequests; - - /* High-water mark for this size class. */ - size_t highruns; - - /* Current number of runs of this size class. */ - size_t curruns; -}; - -struct arena_stats_s { - /* Number of bytes currently mapped. */ - size_t mapped; - - /* - * Total number of purge sweeps, total number of madvise calls made, - * and total pages purged in order to keep dirty unused memory under - * control. - */ - uint64_t npurge; - uint64_t nmadvise; - uint64_t purged; - - /* Per-size-category statistics. */ - size_t allocated_large; - uint64_t nmalloc_large; - uint64_t ndalloc_large; - uint64_t nrequests_large; - - /* - * One element for each possible size class, including sizes that - * overlap with bin size classes. This is necessary because ipalloc() - * sometimes has to use such large objects in order to assure proper - * alignment. - */ - malloc_large_stats_t *lstats; -}; -#endif /* JEMALLOC_STATS */ - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -struct chunk_stats_s { -# ifdef JEMALLOC_STATS - /* Number of chunks that were allocated. */ - uint64_t nchunks; -# endif - - /* High-water mark for number of chunks allocated. */ - size_t highchunks; - - /* - * Current number of chunks allocated. This value isn't maintained for - * any other purpose, so keep track of it in order to be able to set - * highchunks. - */ - size_t curchunks; -}; -#endif /* JEMALLOC_STATS */ - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_stats_print; - -char *umax2s(uintmax_t x, unsigned base, char *s); -#ifdef JEMALLOC_STATS -void malloc_cprintf(void (*write)(void *, const char *), void *cbopaque, - const char *format, ...) JEMALLOC_ATTR(format(printf, 3, 4)); -void malloc_printf(const char *format, ...) - JEMALLOC_ATTR(format(printf, 1, 2)); -#endif -void stats_print(void (*write)(void *, const char *), void *cbopaque, - const char *opts); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_STATS -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -#endif /* JEMALLOC_STATS */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/internal/tcache.h b/dep/include/jemalloc/internal/tcache.h deleted file mode 100644 index c76597fafab..00000000000 --- a/dep/include/jemalloc/internal/tcache.h +++ /dev/null @@ -1,380 +0,0 @@ -#ifdef JEMALLOC_TCACHE -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct tcache_bin_s tcache_bin_t; -typedef struct tcache_s tcache_t; - -/* - * Absolute maximum number of cache slots for each small bin in the thread - * cache. This is an additional constraint beyond that imposed as: twice the - * number of regions per run for this size class. - * - * This constant must be an even number. - */ -#define TCACHE_NSLOTS_SMALL_MAX 200 - -/* Number of cache slots for large size classes. */ -#define TCACHE_NSLOTS_LARGE 20 - -/* (1U << opt_lg_tcache_maxclass) is used to compute tcache_maxclass. */ -#define LG_TCACHE_MAXCLASS_DEFAULT 15 - -/* - * (1U << opt_lg_tcache_gc_sweep) is the approximate number of allocation - * events between full GC sweeps (-1: disabled). Integer rounding may cause - * the actual number to be slightly higher, since GC is performed - * incrementally. - */ -#define LG_TCACHE_GC_SWEEP_DEFAULT 13 - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct tcache_bin_s { -# ifdef JEMALLOC_STATS - tcache_bin_stats_t tstats; -# endif - unsigned low_water; /* Min # cached since last GC. */ - unsigned high_water; /* Max # cached since last GC. */ - unsigned ncached; /* # of cached objects. */ - unsigned ncached_max; /* Upper limit on ncached. */ - void *avail; /* Chain of available objects. */ -}; - -struct tcache_s { -# ifdef JEMALLOC_STATS - ql_elm(tcache_t) link; /* Used for aggregating stats. */ -# endif -# ifdef JEMALLOC_PROF - uint64_t prof_accumbytes;/* Cleared after arena_prof_accum() */ -# endif - arena_t *arena; /* This thread's arena. */ - unsigned ev_cnt; /* Event count since incremental GC. */ - unsigned next_gc_bin; /* Next bin to GC. */ - tcache_bin_t tbins[1]; /* Dynamically sized. */ -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_tcache; -extern ssize_t opt_lg_tcache_maxclass; -extern ssize_t opt_lg_tcache_gc_sweep; - -/* Map of thread-specific caches. */ -extern __thread tcache_t *tcache_tls - JEMALLOC_ATTR(tls_model("initial-exec")); - -/* - * Number of tcache bins. There are nbins small-object bins, plus 0 or more - * large-object bins. - */ -extern size_t nhbins; - -/* Maximum cached size class. */ -extern size_t tcache_maxclass; - -/* Number of tcache allocation/deallocation events between incremental GCs. */ -extern unsigned tcache_gc_incr; - -void tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ); -void tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ); -tcache_t *tcache_create(arena_t *arena); -void *tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, - size_t binind); -void tcache_destroy(tcache_t *tcache); -#ifdef JEMALLOC_STATS -void tcache_stats_merge(tcache_t *tcache, arena_t *arena); -#endif -void tcache_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void tcache_event(tcache_t *tcache); -tcache_t *tcache_get(void); -void *tcache_alloc_easy(tcache_bin_t *tbin); -void *tcache_alloc_small(tcache_t *tcache, size_t size, bool zero); -void *tcache_alloc_large(tcache_t *tcache, size_t size, bool zero); -void tcache_dalloc_small(tcache_t *tcache, void *ptr); -void tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_TCACHE_C_)) -JEMALLOC_INLINE tcache_t * -tcache_get(void) -{ - tcache_t *tcache; - - if ((isthreaded & opt_tcache) == false) - return (NULL); - - tcache = tcache_tls; - if ((uintptr_t)tcache <= (uintptr_t)1) { - if (tcache == NULL) { - tcache = tcache_create(choose_arena()); - if (tcache == NULL) - return (NULL); - } else - return (NULL); - } - - return (tcache); -} - -JEMALLOC_INLINE void -tcache_event(tcache_t *tcache) -{ - - if (tcache_gc_incr == 0) - return; - - tcache->ev_cnt++; - assert(tcache->ev_cnt <= tcache_gc_incr); - if (tcache->ev_cnt == tcache_gc_incr) { - size_t binind = tcache->next_gc_bin; - tcache_bin_t *tbin = &tcache->tbins[binind]; - - if (tbin->low_water > 0) { - /* - * Flush (ceiling) 3/4 of the objects below the low - * water mark. - */ - if (binind < nbins) { - tcache_bin_flush_small(tbin, binind, - tbin->ncached - tbin->low_water + - (tbin->low_water >> 2) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } else { - tcache_bin_flush_large(tbin, binind, - tbin->ncached - tbin->low_water + - (tbin->low_water >> 2) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - } - tbin->low_water = tbin->ncached; - tbin->high_water = tbin->ncached; - - tcache->next_gc_bin++; - if (tcache->next_gc_bin == nhbins) - tcache->next_gc_bin = 0; - tcache->ev_cnt = 0; - } -} - -JEMALLOC_INLINE void * -tcache_alloc_easy(tcache_bin_t *tbin) -{ - void *ret; - - if (tbin->ncached == 0) - return (NULL); - tbin->ncached--; - if (tbin->ncached < tbin->low_water) - tbin->low_water = tbin->ncached; - ret = tbin->avail; - tbin->avail = *(void **)ret; - return (ret); -} - -JEMALLOC_INLINE void * -tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) -{ - void *ret; - size_t binind; - tcache_bin_t *tbin; - - binind = small_size2bin[size]; - assert(binind < nbins); - tbin = &tcache->tbins[binind]; - ret = tcache_alloc_easy(tbin); - if (ret == NULL) { - ret = tcache_alloc_small_hard(tcache, tbin, binind); - if (ret == NULL) - return (NULL); - } - assert(arena_salloc(ret) == tcache->arena->bins[binind].reg_size); - - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } else - memset(ret, 0, size); - -#ifdef JEMALLOC_STATS - tbin->tstats.nrequests++; -#endif -#ifdef JEMALLOC_PROF - tcache->prof_accumbytes += tcache->arena->bins[binind].reg_size; -#endif - tcache_event(tcache); - return (ret); -} - -JEMALLOC_INLINE void * -tcache_alloc_large(tcache_t *tcache, size_t size, bool zero) -{ - void *ret; - size_t binind; - tcache_bin_t *tbin; - - size = PAGE_CEILING(size); - assert(size <= tcache_maxclass); - binind = nbins + (size >> PAGE_SHIFT) - 1; - assert(binind < nhbins); - tbin = &tcache->tbins[binind]; - ret = tcache_alloc_easy(tbin); - if (ret == NULL) { - /* - * Only allocate one large object at a time, because it's quite - * expensive to create one and not use it. - */ - ret = arena_malloc_large(tcache->arena, size, zero); - if (ret == NULL) - return (NULL); - } else { -#ifdef JEMALLOC_PROF - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ret); - size_t pageind = (unsigned)(((uintptr_t)ret - (uintptr_t)chunk) - >> PAGE_SHIFT); - chunk->map[pageind].bits |= CHUNK_MAP_CLASS_MASK; -#endif - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } else - memset(ret, 0, size); - -#ifdef JEMALLOC_STATS - tbin->tstats.nrequests++; -#endif -#ifdef JEMALLOC_PROF - tcache->prof_accumbytes += size; -#endif - } - - tcache_event(tcache); - return (ret); -} - -JEMALLOC_INLINE void -tcache_dalloc_small(tcache_t *tcache, void *ptr) -{ - arena_t *arena; - arena_chunk_t *chunk; - arena_run_t *run; - arena_bin_t *bin; - tcache_bin_t *tbin; - size_t pageind, binind; - arena_chunk_map_t *mapelm; - - assert(arena_salloc(ptr) <= small_maxclass); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - bin = run->bin; - binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) / - sizeof(arena_bin_t); - assert(binind < nbins); - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ptr, 0x5a, bin->reg_size); -#endif - - tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_small(tbin, binind, (tbin->ncached_max >> 1) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; - tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; - - tcache_event(tcache); -} - -JEMALLOC_INLINE void -tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) -{ - arena_t *arena; - arena_chunk_t *chunk; - size_t pageind, binind; - tcache_bin_t *tbin; - arena_chunk_map_t *mapelm; - - assert((size & PAGE_MASK) == 0); - assert(arena_salloc(ptr) > small_maxclass); - assert(arena_salloc(ptr) <= tcache_maxclass); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - binind = nbins + (size >> PAGE_SHIFT) - 1; - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ptr, 0x5a, bin->reg_size); -#endif - - tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_large(tbin, binind, (tbin->ncached_max >> 1) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; - tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; - - tcache_event(tcache); -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_TCACHE */ diff --git a/dep/include/jemalloc/internal/totally_not_p_r_n.h b/dep/include/jemalloc/internal/totally_not_p_r_n.h deleted file mode 100644 index 0709d708012..00000000000 --- a/dep/include/jemalloc/internal/totally_not_p_r_n.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Simple linear congruential pseudo-random number generator: - * - * prn(y) = (a*x + c) % m - * - * where the following constants ensure maximal period: - * - * a == Odd number (relatively prime to 2^n), and (a-1) is a multiple of 4. - * c == Odd number (relatively prime to 2^n). - * m == 2^32 - * - * See Knuth's TAOCP 3rd Ed., Vol. 2, pg. 17 for details on these constraints. - * - * This choice of m has the disadvantage that the quality of the bits is - * proportional to bit position. For example. the lowest bit has a cycle of 2, - * the next has a cycle of 4, etc. For this reason, we prefer to use the upper - * bits. - * - * Macro parameters: - * uint32_t r : Result. - * unsigned lg_range : (0..32], number of least significant bits to return. - * uint32_t state : Seed value. - * const uint32_t a, c : See above discussion. - */ -#define prn32(r, lg_range, state, a, c) do { \ - assert(lg_range > 0); \ - assert(lg_range <= 32); \ - \ - r = (state * (a)) + (c); \ - state = r; \ - r >>= (32 - lg_range); \ -} while (false) - -/* Same as prn32(), but 64 bits of pseudo-randomness, using uint64_t. */ -#define prn64(r, lg_range, state, a, c) do { \ - assert(lg_range > 0); \ - assert(lg_range <= 64); \ - \ - r = (state * (a)) + (c); \ - state = r; \ - r >>= (64 - lg_range); \ -} while (false) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/include/jemalloc/jemalloc.h b/dep/include/jemalloc/jemalloc.h deleted file mode 100644 index d9bafbfff55..00000000000 --- a/dep/include/jemalloc/jemalloc.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef JEMALLOC_H_ -#define JEMALLOC_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#define JEMALLOC_VERSION "1.0.0-0-g5523399" -#define JEMALLOC_VERSION_MAJOR 1 -#define JEMALLOC_VERSION_MINOR 0 -#define JEMALLOC_VERSION_BUGFIX 0 -#define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "5523399" - -#include "jemalloc_defs.h" -#ifndef JEMALLOC_P -# define JEMALLOC_P(s) s -#endif - -extern const char *JEMALLOC_P(malloc_options); -extern void (*JEMALLOC_P(malloc_message))(void *, const char *); - -void *JEMALLOC_P(malloc)(size_t size) JEMALLOC_ATTR(malloc); -void *JEMALLOC_P(calloc)(size_t num, size_t size) JEMALLOC_ATTR(malloc); -int JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) - JEMALLOC_ATTR(nonnull(1)); -void *JEMALLOC_P(realloc)(void *ptr, size_t size); -void JEMALLOC_P(free)(void *ptr); - -size_t JEMALLOC_P(malloc_usable_size)(const void *ptr); -void JEMALLOC_P(malloc_stats_print)(void (*write_cb)(void *, const char *), - void *cbopaque, const char *opts); -int JEMALLOC_P(mallctl)(const char *name, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -int JEMALLOC_P(mallctlnametomib)(const char *name, size_t *mibp, - size_t *miblenp); -int JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen); - -#ifdef __cplusplus -}; -#endif -#endif /* JEMALLOC_H_ */ diff --git a/dep/include/jemalloc/jemalloc.h.in b/dep/include/jemalloc/jemalloc.h.in deleted file mode 100644 index 8ef8183686e..00000000000 --- a/dep/include/jemalloc/jemalloc.h.in +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef JEMALLOC_H_ -#define JEMALLOC_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#define JEMALLOC_VERSION "@jemalloc_version@" -#define JEMALLOC_VERSION_MAJOR @jemalloc_version_major@ -#define JEMALLOC_VERSION_MINOR @jemalloc_version_minor@ -#define JEMALLOC_VERSION_BUGFIX @jemalloc_version_bugfix@ -#define JEMALLOC_VERSION_NREV @jemalloc_version_nrev@ -#define JEMALLOC_VERSION_GID "@jemalloc_version_gid@" - -#include "jemalloc_defs@install_suffix@.h" -#ifndef JEMALLOC_P -# define JEMALLOC_P(s) s -#endif - -extern const char *JEMALLOC_P(malloc_options); -extern void (*JEMALLOC_P(malloc_message))(void *, const char *); - -void *JEMALLOC_P(malloc)(size_t size) JEMALLOC_ATTR(malloc); -void *JEMALLOC_P(calloc)(size_t num, size_t size) JEMALLOC_ATTR(malloc); -int JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) - JEMALLOC_ATTR(nonnull(1)); -void *JEMALLOC_P(realloc)(void *ptr, size_t size); -void JEMALLOC_P(free)(void *ptr); - -size_t JEMALLOC_P(malloc_usable_size)(const void *ptr); -void JEMALLOC_P(malloc_stats_print)(void (*write_cb)(void *, const char *), - void *cbopaque, const char *opts); -int JEMALLOC_P(mallctl)(const char *name, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -int JEMALLOC_P(mallctlnametomib)(const char *name, size_t *mibp, - size_t *miblenp); -int JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen); - -#ifdef __cplusplus -}; -#endif -#endif /* JEMALLOC_H_ */ diff --git a/dep/include/jemalloc/jemalloc_defs.h b/dep/include/jemalloc/jemalloc_defs.h deleted file mode 100644 index e8acaed3abd..00000000000 --- a/dep/include/jemalloc/jemalloc_defs.h +++ /dev/null @@ -1,102 +0,0 @@ -/* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */ -#ifndef JEMALLOC_DEFS_H_ -#define JEMALLOC_DEFS_H_ - -/* - * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed. - * This makes it possible, with some care, to use multiple allocators - * simultaneously. - * - * In many cases it is more convenient to manually prefix allocator function - * calls than to let macros do it automatically, particularly when using - * multiple allocators simultaneously. Define JEMALLOC_MANGLE before - * #include'ing jemalloc.h in order to cause name mangling that corresponds to - * the API prefixing. - */ -/* #undef JEMALLOC_PREFIX */ -#if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE)) -/* #undef JEMALLOC_P */ -#endif - -/* - * Hyper-threaded CPUs may need a special instruction inside spin loops in - * order to yield to another virtual CPU. - */ -#define CPU_SPINWAIT __asm__ volatile("pause") - -/* Defined if __attribute__((...)) syntax is supported. */ -#define JEMALLOC_HAVE_ATTR -#ifdef JEMALLOC_HAVE_ATTR -# define JEMALLOC_ATTR(s) __attribute__((s)) -#else -# define JEMALLOC_ATTR(s) -#endif - -/* - * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables - * inline functions. - */ -/* #undef JEMALLOC_DEBUG */ - -/* JEMALLOC_STATS enables statistics calculation. */ -/* #undef JEMALLOC_STATS */ - -/* JEMALLOC_PROF enables allocation profiling. */ -/* #undef JEMALLOC_PROF */ - -/* Use libunwind for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_LIBUNWIND */ - -/* Use libgcc for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_LIBGCC */ - -/* - * JEMALLOC_TINY enables support for tiny objects, which are smaller than one - * quantum. - */ -#define JEMALLOC_TINY - -/* - * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. - * This makes it possible to allocate/deallocate objects without any locking - * when the cache is in the steady state. - */ -#define JEMALLOC_TCACHE - -/* - * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage - * segment (DSS). - */ -/* #undef JEMALLOC_DSS */ - -/* JEMALLOC_SWAP enables mmap()ed swap file support. */ -/* #undef JEMALLOC_SWAP */ - -/* Support memory filling (junk/zero). */ -/* #undef JEMALLOC_FILL */ - -/* Support optional abort() on OOM. */ -/* #undef JEMALLOC_XMALLOC */ - -/* Support SYSV semantics. */ -/* #undef JEMALLOC_SYSV */ - -/* Support lazy locking (avoid locking unless a second thread is launched). */ -#define JEMALLOC_LAZY_LOCK - -/* Determine page size at run time if defined. */ -/* #undef DYNAMIC_PAGE_SHIFT */ - -/* One page is 2^STATIC_PAGE_SHIFT bytes. */ -#define STATIC_PAGE_SHIFT 12 - -/* TLS is used to map arenas and magazine caches to threads. */ -/* #undef NO_TLS */ - -/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#define LG_SIZEOF_PTR 3 - -/* sizeof(int) == 2^LG_SIZEOF_INT. */ -#define LG_SIZEOF_INT 2 - -#endif /* JEMALLOC_DEFS_H_ */ diff --git a/dep/include/jemalloc/jemalloc_defs.h.in b/dep/include/jemalloc/jemalloc_defs.h.in deleted file mode 100644 index 8b98d670acc..00000000000 --- a/dep/include/jemalloc/jemalloc_defs.h.in +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef JEMALLOC_DEFS_H_ -#define JEMALLOC_DEFS_H_ - -/* - * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed. - * This makes it possible, with some care, to use multiple allocators - * simultaneously. - * - * In many cases it is more convenient to manually prefix allocator function - * calls than to let macros do it automatically, particularly when using - * multiple allocators simultaneously. Define JEMALLOC_MANGLE before - * #include'ing jemalloc.h in order to cause name mangling that corresponds to - * the API prefixing. - */ -#undef JEMALLOC_PREFIX -#if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE)) -#undef JEMALLOC_P -#endif - -/* - * Hyper-threaded CPUs may need a special instruction inside spin loops in - * order to yield to another virtual CPU. - */ -#undef CPU_SPINWAIT - -/* Defined if __attribute__((...)) syntax is supported. */ -#undef JEMALLOC_HAVE_ATTR -#ifdef JEMALLOC_HAVE_ATTR -# define JEMALLOC_ATTR(s) __attribute__((s)) -#else -# define JEMALLOC_ATTR(s) -#endif - -/* - * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables - * inline functions. - */ -#undef JEMALLOC_DEBUG - -/* JEMALLOC_STATS enables statistics calculation. */ -#undef JEMALLOC_STATS - -/* JEMALLOC_PROF enables allocation profiling. */ -#undef JEMALLOC_PROF - -/* Use libunwind for profile backtracing if defined. */ -#undef JEMALLOC_PROF_LIBUNWIND - -/* Use libgcc for profile backtracing if defined. */ -#undef JEMALLOC_PROF_LIBGCC - -/* - * JEMALLOC_TINY enables support for tiny objects, which are smaller than one - * quantum. - */ -#undef JEMALLOC_TINY - -/* - * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. - * This makes it possible to allocate/deallocate objects without any locking - * when the cache is in the steady state. - */ -#undef JEMALLOC_TCACHE - -/* - * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage - * segment (DSS). - */ -#undef JEMALLOC_DSS - -/* JEMALLOC_SWAP enables mmap()ed swap file support. */ -#undef JEMALLOC_SWAP - -/* Support memory filling (junk/zero). */ -#undef JEMALLOC_FILL - -/* Support optional abort() on OOM. */ -#undef JEMALLOC_XMALLOC - -/* Support SYSV semantics. */ -#undef JEMALLOC_SYSV - -/* Support lazy locking (avoid locking unless a second thread is launched). */ -#undef JEMALLOC_LAZY_LOCK - -/* Determine page size at run time if defined. */ -#undef DYNAMIC_PAGE_SHIFT - -/* One page is 2^STATIC_PAGE_SHIFT bytes. */ -#undef STATIC_PAGE_SHIFT - -/* TLS is used to map arenas and magazine caches to threads. */ -#undef NO_TLS - -/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#undef LG_SIZEOF_PTR - -/* sizeof(int) == 2^LG_SIZEOF_INT. */ -#undef LG_SIZEOF_INT - -#endif /* JEMALLOC_DEFS_H_ */ diff --git a/dep/include/libmpq/common.h b/dep/include/libmpq/common.h deleted file mode 100644 index 12d6008debb..00000000000 --- a/dep/include/libmpq/common.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * common.h -- header functions used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _COMMON_H -#define _COMMON_H - -/* function to return the hash to a given string. */ -uint32_t libmpq__hash_string( - const char *key, - uint32_t offset -); - -/* function to encrypt a block. */ -int32_t libmpq__encrypt_block( - uint32_t *in_buf, - uint32_t in_size, - uint32_t seed -); - -/* function to decrypt a block. */ -int32_t libmpq__decrypt_block( - uint32_t *in_buf, - uint32_t in_size, - uint32_t seed -); - -/* function to detect decryption key. */ -int32_t libmpq__decrypt_key( - uint8_t *in_buf, - uint32_t in_size, - uint32_t block_size -); - -/* function to decompress or explode block from archive. */ -int32_t libmpq__decompress_block( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size, - uint32_t compression_type -); - -#endif /* _COMMON_H */ diff --git a/dep/include/libmpq/crypt_buf.h b/dep/include/libmpq/crypt_buf.h deleted file mode 100644 index 34184b017fe..00000000000 --- a/dep/include/libmpq/crypt_buf.h +++ /dev/null @@ -1,217 +0,0 @@ -/* DO NOT CHANGE! this file is auto-generated by crypt_buf_gen.c */ -static const uint32_t crypt_buf[0x500] = { - 0x55c636e2, 0x02be0170, 0x584b71d4, 0x2984f00e, 0xb682c809, 0x91cf876b, - 0x775a9c24, 0x597d5ca5, 0x5a1afeb2, 0xd3e9ce0d, 0x32cdcdf8, 0xb18201cd, - 0x3cce05ce, 0xa55d13be, 0xbb0afe71, 0x9376ab33, 0x848f645e, 0x87e45a45, - 0x45b86017, 0x5e656ca8, 0x1b851a95, 0x2542dbd7, 0xab4df9e4, 0x5976ae9b, - 0x6c317e7d, 0xcddd2f94, 0x3c3c13e5, 0x335b1371, 0x31a592ca, 0x51e4fc4c, - 0xf7db5b2f, 0x8abdbe41, 0x8beaa674, 0x20d6b319, 0xde6c9a9d, 0xc5ac84e5, - 0x445a5feb, 0x94958cb0, 0x1e7d3847, 0xf35d29b0, 0xca5cceda, 0xb732c8b5, - 0xfdcc41dd, 0x0edcec16, 0x9d01feae, 0x1165d38e, 0x9ee193c8, 0xbf33b13c, - 0x61bc0dfc, 0xef3e7be9, 0xf8d4d4c5, 0xc79b7694, 0x5a255943, 0x0b3dd20a, - 0x9d1ab5a3, 0xcfa8ba57, 0x5e6d7069, 0xcb89b731, 0x3dc0d15b, 0x0d4d7e7e, - 0x97e37f2b, 0xfefc2bb1, 0xf95b16b5, 0x27a55b93, 0x45f22729, 0x4c986630, - 0x7c666862, 0x5fa40847, 0xa3f16205, 0x791b7764, 0x386b36d6, 0x6e6c3fef, - 0xc75855db, 0x4abc7dc7, 0x4a328f9b, 0xcef20c0f, 0x60b88f07, 0xf7bb4b8f, - 0x830b5192, 0x94f711ec, 0x20250752, 0x399d21a3, 0xe5c0840d, 0xe76cffa5, - 0x624fab29, 0x5df133e6, 0x83e0b9b8, 0xc5796bfb, 0x4a7ab2d0, 0xba59a821, - 0x03a81e4c, 0xcd3adfdb, 0x32b26b8c, 0x8e35c533, 0x9e6300e9, 0x8cf92ac5, - 0x880d18eb, 0x131a53b3, 0x2ed2dc64, 0xb23257c1, 0xa06450c1, 0x1b92cb8e, - 0x72ed730e, 0x19a685f0, 0x82836483, 0x42d94e8a, 0xee9bd6f6, 0x556d0b6a, - 0xba65589a, 0xde24cce4, 0x53329f6c, 0xc754fe8b, 0x503d2dc7, 0x10027ba4, - 0xd3b60a8b, 0x68e68d83, 0x0a9128a9, 0x595fa35f, 0x0b03b5be, 0x150a45c4, - 0xb1629cce, 0xe5f7497b, 0x8a7098a4, 0xb8233e69, 0x8ea0f978, 0x5b579970, - 0xeab14318, 0x4b28b263, 0xb6766cef, 0x06782877, 0x155c6dd0, 0xc711333c, - 0xf819cedf, 0x00eb1d68, 0xd6fffa6e, 0x439e5962, 0xd765d6db, 0xcb0bcee9, - 0x6d3c5647, 0x965466f3, 0x0ca983c9, 0x74ecc1ce, 0xfc0563b6, 0x42b08fee, - 0xc5b38853, 0xfe502ceb, 0x7b432faf, 0xc309e610, 0x2c3997d8, 0x43774654, - 0x15bd9d2c, 0xed6a420d, 0xc7ff520c, 0xb8a97fd1, 0x5e4d60cc, 0xb9738d11, - 0xda2181ff, 0x73ac2597, 0x3a8eec8d, 0xac85e779, 0xf3f975d6, 0xb9fe7b91, - 0x0f155d1e, 0x2860b6dd, 0x835977cb, 0xb0607436, 0x9cab7f6b, 0x8ab91186, - 0xc12b51e9, 0x20084e8b, 0x44ba8ead, 0xa542b130, 0x82bcd5c4, 0xcc747f4e, - 0x0f1909d8, 0xda242e1c, 0x6f7d1aa0, 0xd2626486, 0x88d0781e, 0xab695ccd, - 0xfa569145, 0xb4feb55c, 0xbe47e896, 0xe70a7a88, 0xd56185a2, 0xacf4c871, - 0x09282332, 0x1ddeeaa8, 0x590c7adb, 0xf4a97667, 0xbfd85705, 0x0ea77ccc, - 0xa9f85364, 0x83195869, 0x8bfb041a, 0xdb842f5c, 0xd6f0f315, 0xa7756ea7, - 0x0a51b439, 0xa9edf8a3, 0xd9084e2f, 0x827407f8, 0xd4ac8284, 0x09739d0d, - 0xb3bb6cfc, 0xd539c77d, 0x6bbc9ac0, 0x35c641aa, 0x934c96b0, 0xd17af317, - 0x29c6baef, 0xb275cdac, 0xd72662de, 0x9f5c2544, 0xc1a98f75, 0xd98e8f9a, - 0x47bd5c86, 0x70c610a6, 0xb5482ed4, 0x23b9c68c, 0x3c1bae66, 0x69556e7f, - 0xd902f5e0, 0x653d195b, 0xde6541fb, 0x07bcc6ac, 0xc6ee7788, 0x801534d4, - 0x2c1f35c0, 0xd9de614d, 0xbdccac85, 0xb4d4a0da, 0x242d549b, 0x9d964796, - 0xb9ceb982, 0x59fa99a9, 0xd8986cc1, 0x9e90c1a1, 0x01bbd82f, 0xd7f1c5fd, - 0xdd847eba, 0x883d305d, 0x25f13152, 0x4a92694d, 0x77f1e601, 0x8024e6e7, - 0x02a5f53d, 0x9c3ef4d9, 0xaf403ccc, 0xe2ad03c0, 0x46edf6ec, 0x6f9bd3e6, - 0xcc24ad7a, 0x47afab12, 0x82298df7, 0x708c9eec, 0x76f8c1b1, 0xb39459d2, - 0x3f1e26d9, 0xe1811be7, 0x56ed1c4d, 0xc9d18af8, 0xe828060e, 0x91cada2e, - 0x5ccbf9b7, 0xf1a552d4, 0x3c9d4343, 0xe1008785, 0x2adfeebf, 0xf90240a0, - 0x3d08cce7, 0x426e6fb0, 0x573c984f, 0x13a843ae, 0x406b7439, 0x636085d9, - 0x5000ba9a, 0xad4a47ab, 0xaf001d8d, 0x419907ae, 0x185c8f96, 0xe5e9ed4d, - 0x61764133, 0xd3703d97, 0xac98f0c6, 0xdbc3a37c, 0x85f010c4, 0x90491e32, - 0xf12e18bf, 0xc88c96e1, 0xd3fbd6d9, 0xe3c28b08, 0xd5bf08cc, 0xb1e78859, - 0x2546ddcf, 0xb030b200, 0xaafd2811, 0x55b22d21, 0xd38bf567, 0x469c7a2b, - 0x5ad05792, 0xa1a5981e, 0x7dfb8384, 0x34d1ca0a, 0x7eb0dbe0, 0xd61ce0f6, - 0x398068b7, 0xe6406d1f, 0x95ae6b47, 0xe4281230, 0xb0843061, 0xa70a3a68, - 0xe340f625, 0x72dcbffd, 0x8eb8afcd, 0x18b6661f, 0x17ef5a5c, 0x000c5b22, - 0x6ba13836, 0x6165e383, 0x74481c5b, 0xe56f0711, 0xa26f5024, 0x5ff22e60, - 0x31a5e829, 0xa1094bf0, 0xc680ec6c, 0x8cf327d7, 0xebf1348a, 0x6a227d2f, - 0x74065184, 0x8df65112, 0x2bbd05ee, 0xe4d00ed6, 0x2980ee1a, 0x6ae1da73, - 0xe84614da, 0x6c9906ab, 0xcf8e02db, 0xd3723e97, 0x92f66caf, 0xac8491c7, - 0xaec65696, 0xb98997cf, 0xfa16c762, 0x6d73c65f, 0x205d22a6, 0x4dd3aaa5, - 0x2deb6bc0, 0x9f37686c, 0x71a5282b, 0x376bb9e0, 0x7fff2a1b, 0xde67982f, - 0x9cbf33ce, 0x2e6dab37, 0x6e3424b9, 0x0ee143bc, 0x832a60d9, 0xbb6329e1, - 0x13f6befd, 0x5965fb84, 0xf60b233c, 0x3d695183, 0x433224a1, 0xb5d9cae5, - 0x82459bab, 0x9f21b311, 0xaf6c5247, 0xb447b13a, 0x7b2676c3, 0xc38979cd, - 0x8526ae25, 0xc550ad5b, 0x685099a7, 0x65e9c2bd, 0xe5c6dc36, 0xe10b37a9, - 0x88016878, 0xce81d4e4, 0x24d6fc80, 0x4106152d, 0x6d4f5f90, 0xc4dc74be, - 0xdb48676c, 0x6cb569b7, 0xf3bf598f, 0x042b08d9, 0x02ccb2de, 0xb1056f65, - 0x47994af4, 0xfa141ba4, 0x9376ab2e, 0x07a76737, 0x75e7e6fc, 0x449d80a1, - 0x03b7259d, 0xf6df358a, 0x5a75d5b9, 0x47286923, 0x3b1a30ef, 0xeebe3d6a, - 0x9db1aa00, 0x007a90d9, 0x24667071, 0x019c73cf, 0x69039bcd, 0x95900744, - 0x6518b1eb, 0x6905f202, 0xee3951b2, 0xe141fca9, 0x797fa832, 0x5a95e55b, - 0xd6263b15, 0x5b61f394, 0x897acb1c, 0x005f83a9, 0x22420f71, 0xf495176e, - 0x7e138f3d, 0x1392e384, 0x373bf7aa, 0x8e512816, 0xa960b3ca, 0x0474d74c, - 0xffacd6d7, 0x2ef5ed9e, 0x60992aaa, 0x7e690e99, 0x23c0749d, 0xd8e29105, - 0x555d5909, 0x15631bfe, 0xa69c5a1c, 0x501017ca, 0x99438048, 0x38733ac7, - 0xe682e2c8, 0xd4655fd6, 0x956e4c04, 0x347df643, 0x2f4b177b, 0x93ed3aa4, - 0xa77e1dd5, 0x7ae55702, 0xd2a52fd9, 0xef8ba18c, 0xb7d3c1ee, 0x8078ba8d, - 0xab5aaadb, 0x752be08f, 0x068b31c1, 0x078aae3c, 0xaa5a8343, 0x123d9268, - 0x2ceaee43, 0x8ebdb239, 0x650251f3, 0x04883648, 0x8c62e12e, 0x12b32167, - 0xe5112e9a, 0x10002548, 0x3e7a818d, 0x077e5327, 0xf140cc21, 0x6ce7d75d, - 0x9b99f9a5, 0x3215741c, 0xb6aadbae, 0x738768dc, 0x82a3742f, 0x76517020, - 0xdd872ad8, 0x9d0902b2, 0x7d1a6b04, 0x49381592, 0x63a652a5, 0x0c15e626, - 0xe22f70d6, 0x01e84385, 0xb29de134, 0x20c5000e, 0xe961f443, 0x2d31662e, - 0x3ce6bc28, 0x34f9dd94, 0xfa45de53, 0x497588bd, 0x9468215b, 0x0777fa5c, - 0x6f7114c0, 0xe0e82694, 0xe4371986, 0x57112de2, 0xe0cac289, 0xf2a3cee0, - 0x6a41e1b9, 0xbfcea77d, 0xf927fd52, 0x69747d98, 0xbea76cdb, 0x8dd39557, - 0x04db5ece, 0x2a0885c8, 0x3be4e8ee, 0x21d785dc, 0x09de7c0e, 0x3258ea33, - 0x51922982, 0xee8dd024, 0x3df6965d, 0x30c1237b, 0xf7f6686a, 0x9faca186, - 0x7c400076, 0x85acef8a, 0xf4b6d220, 0xddc3481c, 0x439eaec4, 0x717bbe63, - 0x8259faa7, 0xd682bd68, 0x932a8610, 0x38bf0a7f, 0x6212e2c7, 0x88ee3168, - 0xb3c27047, 0x6133cb1e, 0x15295506, 0x5ae66246, 0x1d208ddd, 0xa91d3dba, - 0xc315968d, 0x6aa2664b, 0x716d0cca, 0x891f4956, 0x80866bff, 0xbd56c847, - 0x9093425a, 0x28dd9e87, 0x84ef3e08, 0x690a49d6, 0x6a7eff82, 0xabcfe400, - 0x3d3be5ca, 0x381b650c, 0x4b7c8622, 0x3e0246f3, 0xa3561654, 0x9488865c, - 0x3aef1bf2, 0x5e5d68a2, 0xd32f1ddc, 0x51972bf0, 0x177a213b, 0x469375c2, - 0x37640bd0, 0xfc3324c8, 0x07091a09, 0x2d63d3fb, 0x2153f023, 0x48223875, - 0x61a55826, 0x8c136538, 0x49f71d98, 0x84c7d51e, 0x85551a73, 0x13d604c5, - 0xd701a626, 0x87b844ca, 0x741eb29d, 0x2a2c977c, 0xc797ca03, 0x6c4085d7, - 0x2dacf79b, 0x734fa2eb, 0xcc290557, 0xfa1e75e4, 0x06b29a27, 0xbece2a7a, - 0x70a4554b, 0xc935942e, 0xa764bbc1, 0x1fe391d6, 0x7807f0c2, 0x40606ed9, - 0xe5153086, 0xe91d7dd2, 0xed5d3ba9, 0xaa14b64a, 0x83b24dd9, 0xec1ff5cd, - 0xba33ead3, 0xe4ef735c, 0xbc062438, 0xd8bfd523, 0x473d1e04, 0x2007f8a7, - 0xb02903ed, 0x86ea8ada, 0x95ab69cf, 0xfd1f9809, 0x9cb3d8bb, 0x51f45958, - 0x9cdd4276, 0xc245865e, 0x8f0c836b, 0x4ee7dc07, 0xf6368d9d, 0xef2c1dc1, - 0xee56b54b, 0xbd62ce2f, 0xf4916aad, 0xc81cb594, 0x41729f49, 0x24bef0a4, - 0xdef487a9, 0x222e05b8, 0x8d3bf5c6, 0x11b55009, 0xad09d2b3, 0x19db9fd1, - 0xd7427085, 0x33dbfc8b, 0x526b9378, 0x790e1bc8, 0xb2998a00, 0xa5641703, - 0x0676d249, 0x6b9185cc, 0x30e4348f, 0x82c52f65, 0x57c7dc24, 0x489c1ecd, - 0x9fcab02a, 0x56d61117, 0xfe869cac, 0x55fc5140, 0x7fbbb382, 0x9e5afc79, - 0x10047c99, 0xfc9f5984, 0x56587e2d, 0xb98193f0, 0x98fe5e8e, 0x29b15b6b, - 0x9561f055, 0xbb0caa25, 0x1e4ecc15, 0x23f5393b, 0x0845b458, 0xceff67ca, - 0xb099900c, 0x00b1564f, 0x39eef3d1, 0xfcc1bf84, 0xac8893b5, 0x6484bf0e, - 0x91c02ab3, 0x8c0c0c70, 0x686fa8c6, 0xe171bed6, 0xdfae37df, 0xd5a1a4e7, - 0xe3eb49a1, 0x5e6014e0, 0x205b21ac, 0xfd58b3da, 0x2e7c07cd, 0xef2cc85a, - 0xd7587b46, 0xf417847d, 0x8a30cec1, 0x70984f6c, 0xf0b63388, 0xc220c98d, - 0xede62936, 0x92c0a7b3, 0x1ef371e8, 0x2005f7af, 0x91a47265, 0xb0cf5504, - 0xd500aba8, 0xcb5c4bd3, 0x9b3bcbc3, 0xcf6644b5, 0xce9488ef, 0x003fc96e, - 0xaa42222f, 0x4844f3d0, 0x4db89d77, 0x08681aae, 0x662f3a28, 0x761552db, - 0x1df7a17a, 0x93feed9a, 0xcc496a4f, 0xa217cfcd, 0x3ba3c930, 0x268f7e77, - 0x0797b4a1, 0x8bebfc51, 0x068930c4, 0x16c874e2, 0xc242da24, 0xfb229f76, - 0xa0795b02, 0x689fc036, 0x17a73732, 0xd21aec00, 0xac00a692, 0x5b217f18, - 0xae421624, 0x2bc05cc0, 0x48c1db7a, 0x4f4e63b4, 0x1667f04e, 0x34020f94, - 0x972b2555, 0x9a07355b, 0x01665970, 0x7db60c6f, 0x3ad7103b, 0x5c3d09c0, - 0xeea3dada, 0x88c21c10, 0x102436d7, 0x6a3b3400, 0xeb523c4c, 0xfb97d896, - 0x964cb86b, 0xdd878038, 0x0529da4d, 0x0b1468a5, 0x18739ac8, 0xf7f26668, - 0xf64f4471, 0x5c14f5c3, 0x44a081fb, 0x39ac7e37, 0x8a17c26b, 0x868f5e67, - 0x3931978d, 0x6edf7817, 0x4951cc67, 0x943407f3, 0xcc5e748f, 0x2b7ee729, - 0xcbb320f0, 0x11fec8e7, 0xfccfc658, 0x03454354, 0x373aa1ec, 0x1d58fe9a, - 0x064710ae, 0xa88aa0ba, 0xd183a23e, 0x40d150a3, 0xf531b8d1, 0xa7d99f85, - 0x11838cd5, 0xb19e64b3, 0x3d67a5e9, 0xb02c5ac6, 0x99b9b9e8, 0x4c202b7a, - 0x15f261d3, 0xa84c2d0d, 0x50f185a6, 0x33ba41d5, 0x39791013, 0x4baff44e, - 0xeeeeaa1c, 0xe0488314, 0x559ccd2b, 0xa104f445, 0x636f37c4, 0x264d5e3b, - 0x75c17f35, 0x75424131, 0xbb115739, 0x74fe755a, 0x7d3a7aa6, 0x2d8be784, - 0x83ed154a, 0xfc2673d8, 0x44dd4a7f, 0x79056cc8, 0x82cc8831, 0x9d3c1b7c, - 0xe9453bfa, 0x24315694, 0x661f3253, 0x75549f5c, 0xbb2b63ed, 0x67e00d96, - 0xf48966c7, 0x0d7bea56, 0xc25f92ef, 0xa947a79d, 0xde4adf6f, 0xac0f0342, - 0xd3eb246b, 0xa4aa118e, 0x3c3e6a46, 0x457f4441, 0xa50a406f, 0x6c508d9f, - 0xe9ac18e7, 0x1ecdb4ba, 0x39ac7e3a, 0x7fb304fa, 0x6f38f8e8, 0x4aecea6d, - 0x61035e73, 0x81708907, 0xebc07205, 0x90fd7614, 0xb52d217f, 0x6c4de195, - 0x1dd49084, 0x64ee482c, 0x94c7a521, 0x540c09d8, 0x75df8dd5, 0x414131f7, - 0x3698fd76, 0xf784db4f, 0xf8c97a03, 0x048f39b9, 0x3bf4f0bd, 0x8cb50992, - 0x9b58d9ee, 0xe5ab79cc, 0x9a5f6052, 0xbd9591b0, 0xfad2232b, 0x5a632254, - 0x0286e618, 0x8ad3c8f7, 0xe4060176, 0x754c4617, 0x5c10490b, 0x6f7d6fff, - 0x2187b42a, 0x5775095b, 0x02f4c663, 0x5a5dca06, 0xfe4ad4c7, 0x53e19f7d, - 0x59ff46b5, 0xbcc42ba5, 0xfd2f4a97, 0xbed6d905, 0x95629b6b, 0x21a1c0db, - 0xaa10b45d, 0xe6ef6d58, 0x2892cf4d, 0x9fed6c10, 0x1e386bf7, 0x9be0c6e8, - 0x2b2f15ef, 0x19f5ac7b, 0x7aff0e72, 0x31da576f, 0x30252cb4, 0x577960ac, - 0x166e9e5a, 0xa9374a61, 0x71369c96, 0x7ff826ae, 0xe8175326, 0xcabbfd33, - 0x0191190e, 0x699d3c3e, 0x36b40b22, 0xb3950513, 0x9b889bfa, 0xa52a5007, - 0xac290fed, 0x3b4e4a4f, 0xb753d8d6, 0x3c531f22, 0x582f6427, 0xa9cd93a9, - 0x546e39ae, 0x242faad2, 0xd2e0f747, 0x09f6325d, 0x59d48719, 0xad7eb66e, - 0xd5512878, 0x56debf9d, 0x5107e5a5, 0xf1c00aa4, 0x814ccca8, 0x600d90f0, - 0x9be97619, 0x915fa5f2, 0x2b5628dd, 0xa33d5f5a, 0x595df7c1, 0x6966215d, - 0x50ec8337, 0xf1d21372, 0x0ee2eefb, 0xad9e70b7, 0xab0d2fe4, 0xcf277b5d, - 0x62585a2c, 0x835a7844, 0x74b1fa6b, 0x49baffd5, 0x2ea9c864, 0x129311a8, - 0xbdfa1867, 0x83ca5997, 0x9d1db719, 0x84bb79e6, 0x9e3f99f2, 0x313f6101, - 0x1b99245b, 0xd15d8fb2, 0xcef90f81, 0x2945268d, 0xdbbcf573, 0xb1021886, - 0x9ee7ec1d, 0x1cf824f7, 0x7eaa2e32, 0x69c0a2b5, 0x7494419c, 0xe253d7d3, - 0x48da3d12, 0x45b8b571, 0xdb4d147a, 0xd82d8dde, 0x265d10a2, 0xb0a6eb9a, - 0x7e1c93a6, 0x36fe2f46, 0xdcad6b00, 0x05439191, 0xb0ce5484, 0x61d1c309, - 0x8da62a03, 0x06d0fe2f, 0xbac6dd3c, 0xca2006f3, 0x8321b1af, 0x0411a6f3, - 0xe8918eac, 0x21a2c152, 0x91c0d54f, 0x6aaa14fa, 0xdd22a440, 0x88cb2075, - 0x7a4eb813, 0x67afa071, 0xd8d98c9c, 0x31f10d47, 0x6ff1a8a8, 0x2faaf0a1, - 0x48a221bb, 0x3be6948b, 0xaa79e79b, 0x0ea7278c, 0x7a3857ef, 0x49b7fe55, - 0xd51cb931, 0x041c018d, 0x00b90501, 0x45ea7881, 0x8fc1dbcf, 0xb80b32a9, - 0xabacd2e9, 0x677bdc40, 0xecace542, 0x6d6514eb, 0x31c09ff7, 0x5e6c1abd, - 0x1c391d0f, 0x0e9d77f1, 0x7119392d, 0x6be9b0ba, 0x6194fa77, 0x45e62148, - 0x42234af2, 0xc3239d66, 0x939cbdbc, 0x56200d9c, 0x6b275208, 0x001a61f3, - 0xccc2a546, 0x4b722be0, 0xee25f2b7, 0x6d86cf9e, 0xaa6be0cd, 0x4dcda7b6, - 0x78d4aa13, 0x36ea7ad9, 0x3f29d700, 0xdeea2d84, 0x6a6af5bd, 0x18afb81c, - 0xd8e4e73c, 0x8aa708ba, 0x658b94d9, 0xa676478c, 0xcfa10c22, 0x25593c74, - 0x8d962235, 0x5f980270, 0x3df6ebc0, 0x8e7d92fa, 0xc3ee55e1, 0xd5f72447, - 0x02b0fa95, 0x52b0b520, 0x70d2c11f, 0x3a6fdd6c, 0x193aa698, 0x5496f7d5, - 0x4208931b, 0x7a4106ec, 0x83e86840, 0xf49b6f8c, 0xba3d9a51, 0x55f54ddd, - 0x2de51372, 0x9afb571b, 0x3ab35406, 0xad64ff1f, 0xc77764fe, 0x7f864466, - 0x416d9cd4, 0xa2489278, 0xe30b86e4, 0x0b5231b6, 0xba67aed6, 0xe5ab2467, - 0x60028b90, 0x1d9e20c6, 0x2a7c692a, 0x6b691cdb, 0x9e51f817, 0x9b763dec, - 0x3d29323f, 0xcfe12b68, 0x754b459b, 0xa2238047, 0xd9c55514, 0x6bdcffc1, - 0x693e6340, 0x82383fe7, 0x1916ea5f, 0xec7bcd59, 0x72de165a, 0xe79a1617, - 0x8ec86234, 0xa8f0d284, 0x20c90226, 0x7bf98884, 0x28a58331, 0x3ec3fa6e, - 0x4ce0895b, 0xc353b4d0, 0x33ef064f, 0x21e5e210, 0xc8bb589d, 0xe85dcab2, - 0xac65829f, 0xa7bf92d0, 0x05a6174d, 0x25a50c2e, 0xe5c78777, 0x3d75021f, - 0x4baa9c98, 0x23bdc884, 0x9653bbd7, 0xbadce7f5, 0xc283a484, 0xc040df2e, - 0x9370a841, 0x2f316022, 0x36eed231, 0xac2cbc0c, 0x13c0a49b, 0xcdd12997, - 0x07fe91b2, 0xcd7eabcd, 0x2c01271d, 0x18432df8, 0x599c6bc7, 0x75e93d5a, - 0xb67a6ee2, 0x8e738e16, 0xff9073fd, 0xaf77026a, 0xf86ea2fc, 0x91509ea3, - 0x33a78dc6, 0x4f79234a, 0x3a7535bc, 0x3539fcb1, 0x3103ee52, 0x4f6f1e69, - 0x6bb3ebbc, 0x4cb77555, 0x8dd1e999, 0x2ade439d, 0x11521fae, 0xb94d2545, - 0x8dde9abd, 0x1909393f, 0xb792a23d, 0x749c455b, 0xb5b60f2c, 0x380459ce, - 0x0dad5820, 0xb130845b, 0x291cbd52, 0xde9a5bb7, 0x51def961, 0x515b6408, - 0xca6e823e, 0x382e6e74, 0xeebe3d71, 0x4c8f0c6a, 0xe676dcea, 0x14e1dc7c, - 0x6f7fc634, 0xcf85a943, 0xd39ea96e, 0x136e7c93, 0x7164b304, 0xf32f1333, - 0x35c34034, 0xde39d721, 0x91a87439, 0xc410111f, 0x29f17aac, 0x1316a6ff, - 0x12f194ee, 0x420b9499, 0xf72db0dc, 0x690b9f93, 0x17d14bb2, 0x8f931ab8, - 0x217500bc, 0x875413f8, 0x98b2e43d, 0xc51f9571, 0x54cebdca, 0x0719cc79, - 0xf3c7080d, 0xe4286771, 0xa3eab3cd, 0x4a6b00e0, 0x11cf0759, 0x7e897379, - 0x5b32876c, 0x5e8cd4f6, 0x0cedfa64, 0x919ac2c7, 0xb214f3b3, 0x0e89c38c, - 0xf0c43a39, 0xeae10522, 0x835bce06, 0x9eec43c2, 0xea26a9d6, 0x69531821, - 0x6725b24a, 0xda81b0e2, 0xd5b4ae33, 0x080f99fb, 0x15a83daf, 0x29dfc720, - 0x91e1900f, 0x28163d58, 0x83d107a2, 0x4eac149a, 0x9f71da18, 0x61d5c4fa, - 0xe3ab2a5f, 0xc7b0d63f, 0xb3cc752a, 0x61ebcfb6, 0x26ffb52a, 0xed789e3f, - 0xaa3bc958, 0x455a8788, 0xc9c082a9, 0x0a1bef0e, 0xc29a5a7e, 0x150d4735, - 0x943809e0, 0x69215510, 0xef0b0da9, 0x3b4e9fb3, 0xd8b5d04c, 0xc7a023a8, - 0xb0d50288, 0x64821375, 0xc260e8cf, 0x8496bd2c, 0xff4f5435, 0x0fb5560c, - 0x7cd74a52, 0x93589c80, 0x88975c47, 0x83bda89d, 0x8bcc4296, 0x01b82c21, - 0xfd821dbf, 0x26520b47, 0x04983e19, 0xd3e1ca27, 0x782c580f, 0x326ff573, - 0xc157bcc7, 0x4f5e6b84, 0x44ebfbfb, 0xda26d9d8, 0x6cd9d08e, 0x1719f1d8, - 0x715c0487, 0x2c2d3c92, 0x53faaba9, 0xbc836146, 0x510c92d6, 0xe089f82a, - 0x4680171f, 0x369f00de, 0x70ec2331, 0x0e253d55, 0xdafb9717, 0xe5dd922d, - 0x95915d21, 0xa0202f96, 0xa161cc47, 0xeacfa6f1, 0xed5e9189, 0xdab87684, - 0xa4b76d4a, 0xfa704897, 0x631f10ba, 0xd39da8f9, 0x5db4c0e4, 0x16fde42a, - 0x2dff7580, 0xb56fec7e, 0xc3ffb370, 0x8e6f36bc, 0x6097d459, 0x514d5d36, - 0xa5a737e2, 0x3977b9b3, 0xfd31a0ca, 0x903368db, 0xe8370d61, 0x98109520, - 0xade23cac, 0x99f82e04, 0x41de7ea3, 0x84a1c295, 0x09191be0, 0x30930d02, - 0x1c9fa44a, 0xc406b6d7, 0xeedca152, 0x6149809c, 0xb0099ef4, 0xc5f653a5, - 0x4c10790d, 0x7303286c -}; diff --git a/dep/include/libmpq/explode.h b/dep/include/libmpq/explode.h deleted file mode 100644 index 84bbde77bee..00000000000 --- a/dep/include/libmpq/explode.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * explode.h -- header file for pkware data decompression library - * used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This source was adepted from the C++ version of pklib.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _EXPLODE_H -#define _EXPLODE_H - -/* define compression constants and return values. */ -#define LIBMPQ_PKZIP_CMP_BINARY 0 /* binary compression. */ -#define LIBMPQ_PKZIP_CMP_ASCII 1 /* ascii compression. */ -#define LIBMPQ_PKZIP_CMP_NO_ERROR 0 -#define LIBMPQ_PKZIP_CMP_INV_DICTSIZE 1 -#define LIBMPQ_PKZIP_CMP_INV_MODE 2 -#define LIBMPQ_PKZIP_CMP_BAD_DATA 3 -#define LIBMPQ_PKZIP_CMP_ABORT 4 - -#ifdef _MSC_VER -#pragma pack(push,1) -#endif - -/* compression structure. */ -typedef struct { - uint32_t offs0000; /* 0000 - start. */ - uint32_t cmp_type; /* 0004 - compression type (binary or ascii). */ - uint32_t out_pos; /* 0008 - position in output buffer. */ - uint32_t dsize_bits; /* 000C - dict size (4, 5, 6 for 0x400, 0x800, 0x1000). */ - uint32_t dsize_mask; /* 0010 - dict size bitmask (0x0F, 0x1F, 0x3F for 0x400, 0x800, 0x1000). */ - uint32_t bit_buf; /* 0014 - 16-bit buffer for processing input data. */ - uint32_t extra_bits; /* 0018 - number of extra (above 8) bits in bit buffer. */ - uint32_t in_pos; /* 001C - position in in_buf. */ - uint32_t in_bytes; /* 0020 - number of bytes in input buffer. */ - void *param; /* 0024 - custom parameter. */ - uint32_t (*read_buf)(char *buf, uint32_t *size, void *param); /* 0028 offset.*/ - void (*write_buf)(char *buf, uint32_t *size, void *param); /* 002C offset. */ - uint8_t out_buf[0x2000]; /* 0030 - output circle buffer, starting position is 0x1000. */ - uint8_t offs_2030[0x204]; /* 2030 - whats that? */ - uint8_t in_buf[0x800]; /* 2234 - buffer for data to be decompressed. */ - uint8_t pos1[0x100]; /* 2A34 - positions in buffers. */ - uint8_t pos2[0x100]; /* 2B34 - positions in buffers. */ - uint8_t offs_2c34[0x100]; /* 2C34 - buffer. */ - uint8_t offs_2d34[0x100]; /* 2D34 - buffer. */ - uint8_t offs_2e34[0x80]; /* 2EB4 - buffer. */ - uint8_t offs_2eb4[0x100]; /* 2EB4 - buffer. */ - uint8_t bits_asc[0x100]; /* 2FB4 - buffer. */ - uint8_t dist_bits[0x40]; /* 30B4 - numbers of bytes to skip copied block length. */ - uint8_t slen_bits[0x10]; /* 30F4 - numbers of bits for skip copied block length. */ - uint8_t clen_bits[0x10]; /* 3104 - number of valid bits for copied block. */ - uint16_t len_base[0x10]; /* 3114 - buffer. */ -#ifdef _MSC_VER -} pkzip_cmp_s; -#pragma pack(pop) -#else -} __attribute__ ((packed)) pkzip_cmp_s; -#endif - -/* data structure. */ -typedef struct { - uint8_t *in_buf; /* pointer to input data buffer. */ - uint32_t in_pos; /* current offset in input data buffer. */ - int32_t in_bytes; /* number of bytes in the input buffer. */ - uint8_t *out_buf; /* pointer to output data buffer. */ - uint32_t out_pos; /* position in the output buffer. */ - int32_t max_out; /* maximum number of bytes in the output buffer. */ -} pkzip_data_s; - -/* decompress the stream using pkzip compression. */ -uint32_t libmpq__do_decompress_pkzip( - uint8_t *work_buf, - void *param -); - -#endif /* _EXPLODE_H */ diff --git a/dep/include/libmpq/extract.h b/dep/include/libmpq/extract.h deleted file mode 100644 index d6ea794f162..00000000000 --- a/dep/include/libmpq/extract.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * extract.h -- header for the extraction functions used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _EXTRACT_H -#define _EXTRACT_H - -/* define compression types for multilpe compressions. */ -#define LIBMPQ_COMPRESSION_HUFFMAN 0x01 /* huffman compression. (used on wave files only and introduced in starcraft) */ -#define LIBMPQ_COMPRESSION_ZLIB 0x02 /* zlib compression. (introduced in warcraft 3) */ -#define LIBMPQ_COMPRESSION_PKZIP 0x08 /* pkware dcl compression. (first used compression algorithm) */ -#define LIBMPQ_COMPRESSION_BZIP2 0x10 /* bzip compression. (introduced in warcraft 3 - the frozen throne) */ -#define LIBMPQ_COMPRESSION_WAVE_MONO 0x40 /* adpcm 4:1 compression. (introduced in starcraft) */ -#define LIBMPQ_COMPRESSION_WAVE_STEREO 0x80 /* adpcm 4:1 compression. (introduced in starcraft) */ - -/* - * table for decompression functions, return value for all functions - * is the transferred data size or one of the following error constants: - * - * LIBMPQ_ERROR_MALLOC - * LIBMPQ_ERROR_DECOMPRESS - */ -typedef int32_t (*DECOMPRESS)(uint8_t *, uint32_t, uint8_t *, uint32_t); -typedef struct { - uint32_t mask; /* decompression bit. */ - DECOMPRESS decompress; /* decompression function. */ -} decompress_table_s; - -/* - * huffman decompression routine, the in_size parameter is not used, - * but needs to be specified due to compatibility reasons. - * - * 1500F5F0 - */ -extern int32_t libmpq__decompress_huffman( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using zlib. */ -extern int32_t libmpq__decompress_zlib( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using pkzip. */ -extern int32_t libmpq__decompress_pkzip( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using bzip2. */ -extern int32_t libmpq__decompress_bzip2( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using wave. (1 channel) */ -extern int32_t libmpq__decompress_wave_mono( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using wave. (2 channels) */ -extern int32_t libmpq__decompress_wave_stereo( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using multiple of the above algorithm. */ -extern int32_t libmpq__decompress_multi( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -#endif /* _EXTRACT_H */ diff --git a/dep/include/libmpq/huffman.h b/dep/include/libmpq/huffman.h deleted file mode 100644 index 6f691088fa0..00000000000 --- a/dep/include/libmpq/huffman.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * huffman.h -- structures used for huffman compression. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This source was adepted from the C++ version of huffman.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * ShadowFlare - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _HUFFMAN_H -#define _HUFFMAN_H - -/* define huffman compression and decompression values. */ -#define LIBMPQ_HUFF_DECOMPRESS 0 /* we want to decompress using huffman trees. */ - -/* define pointer conversions. */ -#define PTR_NOT(ptr) (struct huffman_tree_item_s *)(~(unsigned long)(ptr)) -#define PTR_PTR(ptr) ((struct huffman_tree_item_s *)(ptr)) -#define PTR_INT(ptr) (long)(ptr) - -/* define item handling. */ -#define INSERT_ITEM 1 /* insert item into huffman tree. */ -#define SWITCH_ITEMS 2 /* switch items isnide huffman tree. */ - -/* input stream for huffman decompression. */ -struct huffman_input_stream_s { - uint8_t *in_buf; /* 00 - input data. */ - uint32_t bit_buf; /* 04 - input bit buffer. */ - uint32_t bits; /* 08 - number of bits remaining in byte. */ -}; - -/* huffman tree item. */ -struct huffman_tree_item_s { - struct huffman_tree_item_s *next; /* 00 - pointer to next huffman tree item. */ - struct huffman_tree_item_s *prev; /* 04 - pointer to prev huffman tree item (< 0 if none). */ - uint32_t dcmp_byte; /* 08 - index of this item in item pointer array, decompressed byte value. */ - uint32_t byte_value; /* 0C - some byte value. */ - struct huffman_tree_item_s *parent; /* 10 - pointer to parent huffman tree item (NULL if none). */ - struct huffman_tree_item_s *child; /* 14 - pointer to child huffman tree item. */ -}; - -/* structure used for quick decompression. */ -struct huffman_decompress_s { - uint32_t offs00; /* 00 - 1 if resolved. */ - uint32_t bits; /* 04 - bit count. */ - union { - uint32_t dcmp_byte; /* 08 - byte value for decompress (if bitCount <= 7). */ - struct huffman_tree_item_s *p_item; /* 08 - huffman tree item (if number of bits is greater than 7). */ - }; -}; - -/* structure for huffman tree. */ -struct huffman_tree_s { - uint32_t cmp0; /* 0000 - 1 if compression type 0. */ - uint32_t offs0004; /* 0004 - some flag. */ - struct huffman_tree_item_s items0008[0x203]; /* 0008 - huffman tree items. */ - struct huffman_tree_item_s *item3050; /* 3050 - always NULL? */ - struct huffman_tree_item_s *item3054; /* 3054 - pointer to huffman tree item. */ - struct huffman_tree_item_s *item3058; /* 3058 - pointer to huffman tree item (< 0 if invalid). */ - struct huffman_tree_item_s *item305C; /* 305C - usually NULL. */ - struct huffman_tree_item_s *first; /* 3060 - pointer to top (first) huffman tree item. */ - struct huffman_tree_item_s *last; /* 3064 - pointer to bottom (last) huffman tree item (< 0 if invalid). */ - uint32_t items; /* 3068 - number of used huffman tree items. */ - struct huffman_tree_item_s *items306C[0x102]; /* 306C - huffman tree item pointer array. */ - struct huffman_decompress_s qd3474[0x80]; /* 3474 - array for quick decompression. */ - uint8_t table_1502A630[]; /* some table to make struct size flexible. */ -}; - -/* insert a new item into huffman tree. */ -void libmpq__huffman_insert_item( - struct huffman_tree_item_s **p_item, - struct huffman_tree_item_s *item, - uint32_t where, - struct huffman_tree_item_s *item2 -); - -/* remove item from huffman tree. */ -void libmpq__huffman_remove_item( - struct huffman_tree_item_s *hi -); - -/* get previous item from huffman tree. */ -struct huffman_tree_item_s *libmpq__huffman_previous_item( - struct huffman_tree_item_s *hi, - long value -); - -/* get one bit from stream. */ -uint32_t libmpq__huffman_get_1bit( - struct huffman_input_stream_s *is -); - -/* get seven bit from stream. */ -uint32_t libmpq__huffman_get_7bit( - struct huffman_input_stream_s *is -); - -/* get eight bit from stream. */ -uint32_t libmpq__huffman_get_8bit( - struct huffman_input_stream_s *is -); - -/* call 1500E740. */ -struct huffman_tree_item_s *libmpq__huffman_call_1500E740( - struct huffman_tree_s *ht -); - -/* call 1500E820- */ -void libmpq__huffman_call_1500E820( - struct huffman_tree_s *ht, - struct huffman_tree_item_s *p_item -); - -/* initialize the huffman tree. */ -void libmpq__huffman_tree_init( - struct huffman_tree_s *ht, - uint32_t cmp -); - -/* build the huffman tree. */ -void libmpq__huffman_tree_build( - struct huffman_tree_s *ht, - uint32_t cmp_type -); - -/* decompress the stream using huffman compression. */ -int32_t libmpq__do_decompress_huffman( - struct huffman_tree_s *ht, - struct huffman_input_stream_s *is, - uint8_t *out_buf, - uint32_t out_length -); - -#endif /* _HUFFMAN_H */ diff --git a/dep/include/libmpq/mpq-internal.h b/dep/include/libmpq/mpq-internal.h deleted file mode 100644 index eddcb7e89ae..00000000000 --- a/dep/include/libmpq/mpq-internal.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * mpq-internal.h -- some default types and defines, but only required for - * compilation of the library. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _MPQ_INTERNAL_H -#define _MPQ_INTERNAL_H - -/* generic includes. */ -#include -#include - -/* define return value if nothing failed. */ -#define LIBMPQ_SUCCESS 0 /* return value for all functions which success. */ - -/* define generic mpq archive information. */ -#define LIBMPQ_HEADER 0x1A51504D /* mpq archive header ('MPQ\x1A') */ - -/* define the known archive versions. */ -#define LIBMPQ_ARCHIVE_VERSION_ONE 0 /* version one used until world of warcraft. */ -#define LIBMPQ_ARCHIVE_VERSION_TWO 1 /* version two used from world of warcraft - the burning crusade. */ - -/* define values used by blizzard as flags. */ -#define LIBMPQ_FLAG_EXISTS 0x80000000 /* set if file exists, reset when the file was deleted. */ -#define LIBMPQ_FLAG_ENCRYPTED 0x00010000 /* indicates whether file is encrypted. */ -#define LIBMPQ_FLAG_COMPRESSED 0x0000FF00 /* file is compressed. */ -#define LIBMPQ_FLAG_COMPRESS_PKZIP 0x00000100 /* compression made by pkware data compression library. */ -#define LIBMPQ_FLAG_COMPRESS_MULTI 0x00000200 /* multiple compressions. */ -#define LIBMPQ_FLAG_COMPRESS_NONE 0x00000300 /* no compression (no blizzard flag used by myself). */ -#define LIBMPQ_FLAG_SINGLE 0x01000000 /* file is stored in one single sector, first seen in world of warcraft. */ -#define LIBMPQ_FLAG_EXTRA 0x04000000 /* compressed block offset table has one extra entry. */ - -/* define generic hash values. */ -#define LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */ - -/* define special files. */ -#define LIBMPQ_LISTFILE_NAME "(listfile)" /* internal listfile. */ -#define LIBMPQ_SIGNATURE_NAME "(signature)" /* internal signature file. */ -#define LIBMPQ_ATTRIBUTES_NAME "(attributes)" /* internal attributes file. */ - -/* define true and false, because not all systems have them. */ -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -#ifdef _MSC_VER - #pragma pack(push,1) - #define PACK_STRUCT -#else - #define PACK_STRUCT __attribute__((packed)) -#endif - -/* mpq archive header. */ -typedef struct { - uint32_t mpq_magic; /* the 0x1A51504D ('MPQ\x1A') signature. */ - uint32_t header_size; /* mpq archive header size. */ - uint32_t archive_size; /* size of mpq archive. */ - uint16_t version; /* 0000 for starcraft and broodwar. */ - uint16_t block_size; /* size of file block is (512 * 2 ^ block size). */ - uint32_t hash_table_offset; /* file position of mpq_hash. */ - uint32_t block_table_offset; /* file position of mpq_block, each entry has 16 bytes. */ - uint32_t hash_table_count; /* number of entries in hash table. */ - uint32_t block_table_count; /* number of entries in the block table. */ -} PACK_STRUCT mpq_header_s; - -/* mpq extended archive header, used since world of warcraft - the burning crusade. */ -typedef struct { - uint64_t extended_offset; /* offset to the beginning of the extended block table, relative to the beginning of the archive. */ - uint16_t hash_table_offset_high; /* upper 16 bits of the hash table offset for large archives. */ - uint16_t block_table_offset_high;/* upper 16 bits of the block table offset for large archives.*/ -} PACK_STRUCT mpq_header_ex_s; - -/* hash entry, all files in the archive are searched by their hashes. */ -typedef struct { - uint32_t hash_a; /* the first two uint32_ts are the encrypted file. */ - uint32_t hash_b; /* the first two uint32_ts are the encrypted file. */ - uint16_t locale; /* locale information. */ - uint16_t platform; /* platform information and zero is default. */ - uint32_t block_table_index; /* index to file description block. */ -} PACK_STRUCT mpq_hash_s; - -/* file description block contains informations about the file. */ -typedef struct { - uint32_t offset; /* block file starting position in the archive. */ - uint32_t packed_size; /* packed file size. */ - uint32_t unpacked_size; /* unpacked file size. */ - uint32_t flags; /* flags. */ -} PACK_STRUCT mpq_block_s; - -/* extended file description block contains information about the offset beyond 2^32 (4GB). */ -typedef struct { - uint16_t offset_high; /* upper 16 bit of the file offset in archive. */ -} PACK_STRUCT mpq_block_ex_s; - -/* file structure used since diablo 1.00 (0x38 bytes). */ -typedef struct { - uint32_t seed; /* seed used for file decrypt. */ - uint32_t *packed_offset; /* position of each file block (only for packed files). */ - uint32_t open_count; /* number of times it has been opened - used for freeing */ -} PACK_STRUCT mpq_file_s; - -/* map structure for valid blocks and hashes (first seen in warcraft 3 archives). */ -typedef struct { - uint32_t block_table_indices; /* real mapping for file number to block entry. */ - uint32_t block_table_diff; /* block table difference between valid blocks and invalid blocks before. */ -} PACK_STRUCT mpq_map_s; - -#ifdef _MSC_VER - #pragma pack(pop) -#endif -#undef PACK_STRUCT - -/* archive structure used since diablo 1.00 by blizzard. */ -struct mpq_archive { - - /* generic file information. */ - FILE *fp; /* file handle. */ - - /* generic size information. */ - uint32_t block_size; /* size of the mpq block. */ - off_t archive_offset; /* absolute start position of archive. */ - - /* archive related buffers and tables. */ - mpq_header_s mpq_header; /* mpq file header. */ - mpq_header_ex_s mpq_header_ex; /* mpq extended file header. */ - mpq_hash_s *mpq_hash; /* hash table. */ - mpq_block_s *mpq_block; /* block table. */ - mpq_block_ex_s *mpq_block_ex; /* extended block table. */ - mpq_file_s **mpq_file; /* pointer to the file pointers which are opened. */ - - /* non archive structure related members. */ - mpq_map_s *mpq_map; /* map table between valid blocks and hashes. */ - uint32_t files; /* number of files in archive, which could be extracted. */ -}; - -#endif /* _MPQ_INTERNAL_H */ diff --git a/dep/include/libmpq/mpq.h b/dep/include/libmpq/mpq.h deleted file mode 100644 index 3d53e06477c..00000000000 --- a/dep/include/libmpq/mpq.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * mpq.h -- some default types and defines. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * Some parts (the encryption and decryption stuff) were adapted from - * the C++ version of StormLib.h and StormPort.h included in stormlib. - * The C++ version belongs to the following authors: - * - * Ladislav Zezula - * Marko Friedemann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _MPQ_H -#define _MPQ_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* generic includes. */ -#include -#include - -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define LIBMPQ_API __attribute__((visibility("default"))) -#else -# define LIBMPQ_API -#endif - -/* define errors. */ -#define LIBMPQ_ERROR_OPEN -1 /* open error on file. */ -#define LIBMPQ_ERROR_CLOSE -2 /* close error on file. */ -#define LIBMPQ_ERROR_SEEK -3 /* lseek error on file. */ -#define LIBMPQ_ERROR_READ -4 /* read error on file. */ -#define LIBMPQ_ERROR_WRITE -5 /* write error on file. */ -#define LIBMPQ_ERROR_MALLOC -6 /* memory allocation error. */ -#define LIBMPQ_ERROR_FORMAT -7 /* format errror. */ -#define LIBMPQ_ERROR_NOT_INITIALIZED -8 /* libmpq__init() wasn't called. */ -#define LIBMPQ_ERROR_SIZE -9 /* buffer size is to small. */ -#define LIBMPQ_ERROR_EXIST -10 /* file or block does not exist in archive. */ -#define LIBMPQ_ERROR_DECRYPT -11 /* we don't know the decryption seed. */ -#define LIBMPQ_ERROR_UNPACK -12 /* error on unpacking file. */ - -/* internal data structure. */ -typedef struct mpq_archive mpq_archive_s; - -/* file offset data type for API*/ -typedef int64_t libmpq__off_t; - -/* generic information about library. */ -extern LIBMPQ_API const char *libmpq__version(void); - -/* generic mpq archive information. */ -extern LIBMPQ_API int32_t libmpq__archive_open(mpq_archive_s **mpq_archive, const char *mpq_filename, libmpq__off_t archive_offset); -extern LIBMPQ_API int32_t libmpq__archive_close(mpq_archive_s *mpq_archive); -extern LIBMPQ_API int32_t libmpq__archive_packed_size(mpq_archive_s *mpq_archive, libmpq__off_t *packed_size); -extern LIBMPQ_API int32_t libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__archive_offset(mpq_archive_s *mpq_archive, libmpq__off_t *offset); -extern LIBMPQ_API int32_t libmpq__archive_version(mpq_archive_s *mpq_archive, uint32_t *version); -extern LIBMPQ_API int32_t libmpq__archive_files(mpq_archive_s *mpq_archive, uint32_t *files); - -/* generic file processing functions. */ -extern LIBMPQ_API int32_t libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *packed_size); -extern LIBMPQ_API int32_t libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *offset); -extern LIBMPQ_API int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *blocks); -extern LIBMPQ_API int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *encrypted); -extern LIBMPQ_API int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *compressed); -extern LIBMPQ_API int32_t libmpq__file_imploded(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *imploded); -extern LIBMPQ_API int32_t libmpq__file_number(mpq_archive_s *mpq_archive, const char *filename, uint32_t *number); -extern LIBMPQ_API int32_t libmpq__file_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred); - -/* generic block processing functions. */ -extern LIBMPQ_API int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_number); -extern LIBMPQ_API int32_t libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint32_t file_number); -extern LIBMPQ_API int32_t libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__block_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred); - -#ifdef __cplusplus -} -#endif - -#endif /* _MPQ_H */ diff --git a/dep/include/libmpq/wave.h b/dep/include/libmpq/wave.h deleted file mode 100644 index 1b9491bd70a..00000000000 --- a/dep/include/libmpq/wave.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * wave.h -- header file for wav unplode functions used by mpq-tools. - * - * Copyright (c) 2003-2007 Maik Broemme - * - * This source was adepted from the C++ version of wave.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * Tom Amigo - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _WAVE_H -#define _WAVE_H - -/* buffer. */ -typedef union { - uint16_t *pw; - uint8_t *pb; -} byte_and_int16_t; - -/* decompress a wave file, mono or stereo, 1500F230 offset. */ -int32_t libmpq__do_decompress_wave( - uint8_t *out_buf, - int32_t out_length, - uint8_t *in_buf, - int32_t in_length, - int32_t channels -); - -#endif /* _WAVE_H */ diff --git a/dep/include/mersennetwister/MersenneTwister.h b/dep/include/mersennetwister/MersenneTwister.h deleted file mode 100644 index 1cff879643f..00000000000 --- a/dep/include/mersennetwister/MersenneTwister.h +++ /dev/null @@ -1,405 +0,0 @@ -// MersenneTwister.h -// Mersenne Twister random number generator -- a C++ class MTRand -// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// Richard J. Wagner v1.0 15 May 2003 rjwagner@writeme.com - -// The Mersenne Twister is an algorithm for generating random numbers. It -// was designed with consideration of the flaws in various other generators. -// The period, 2^19937-1, and the order of equidistribution, 623 dimensions, -// are far greater. The generator is also fast; it avoids multiplication and -// division, and it benefits from caches and pipelines. For more information -// see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html - -// Reference -// M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally -// Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on -// Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30. - -// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, -// Copyright (C) 2000 - 2003, Richard J. Wagner -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The names of its contributors may not be used to endorse or promote -// products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// The original code included the following notice: -// -// When you use this, send an email to: matumoto@math.keio.ac.jp -// with an appropriate reference to your work. -// -// It would be nice to CC: rjwagner@writeme.com and Cokus@math.washington.edu -// when you write. - -#ifndef MERSENNETWISTER_H -#define MERSENNETWISTER_H - -// Not thread safe (unless auto-initialization is avoided and each thread has -// its own MTRand object) - -#include"Define.h" - -#include -#include -#include - -class MTRand { -// Data -public: - typedef ::uint32 uint32; - enum { N = 624 }; // length of state vector - enum { SAVE = N + 1 }; // length of array for save() - -protected: - enum { M = 397 }; // period parameter - - uint32 state[N]; // internal state - uint32 *pNext; // next value to get from state - int left; // number of values left before reload needed - -//Methods -public: - MTRand( const uint32& oneSeed ); // initialize with a simple uint32 - MTRand( uint32 *const bigSeed, uint32 const seedLength = N ); // or an array - MTRand(); // auto-initialize with /dev/urandom or time() and clock() - MTRand(const MTRand&); // prevent copy constructor - MTRand& operator=(const MTRand&); // no-op operator= - - // Do NOT use for CRYPTOGRAPHY without securely hashing several returned - // values together, otherwise the generator state can be learned after - // reading 624 consecutive values. - - // Access to 32-bit random numbers - double rand(); // real number in [0,1] - double rand( const double& n ); // real number in [0,n] - double randExc(); // real number in [0,1) - double randExc( const double& n ); // real number in [0,n) - double randDblExc(); // real number in (0,1) - double randDblExc( const double& n ); // real number in (0,n) - uint32 randInt(); // integer in [0,2^32-1] - uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32 - double operator()() { return rand(); } // same as rand() - - // Access to 53-bit random numbers (capacity of IEEE double precision) - double rand53(); // real number in [0,1) - - // Access to nonuniform random number distributions - double randNorm( const double& mean = 0.0, const double& variance = 0.0 ); - - // Re-seeding functions with same behavior as initializers - void seed( const uint32 oneSeed ); - void seed( uint32 *const bigSeed, const uint32 seedLength = N ); - void seed(); - - // Saving and loading generator state - void save( uint32* saveArray ) const; // to array of size SAVE - void load( uint32 *const loadArray ); // from such array - /* Trinity not use streams for random values output - friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ); - friend std::istream& operator>>( std::istream& is, MTRand& mtrand ); - */ -protected: - void initialize( const uint32 oneSeed ); - void reload(); - uint32 hiBit( const uint32& u ) const { return u & 0x80000000UL; } - uint32 loBit( const uint32& u ) const { return u & 0x00000001UL; } - uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; } - uint32 mixBits( const uint32& u, const uint32& v ) const - { return hiBit(u) | loBits(v); } - uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const - { return m ^ (mixBits(s0,s1)>>1) ^ uint32(-(int32)(loBit(s1) & 0x9908b0dfUL)); } - static uint32 hash( time_t t, clock_t c ); -}; - -inline MTRand::MTRand(const MTRand&) - { seed(); } - -inline MTRand& MTRand::operator=(const MTRand&) - { return *this; } - -inline MTRand::MTRand( const uint32& oneSeed ) - { seed(oneSeed); } - -inline MTRand::MTRand( uint32 *const bigSeed, const uint32 seedLength ) - { seed(bigSeed,seedLength); } - -inline MTRand::MTRand() - { seed(); } - -inline double MTRand::rand() - { return double(randInt()) * (1.0/4294967295.0); } - -inline double MTRand::rand( const double& n ) - { return rand() * n; } - -inline double MTRand::randExc() - { return double(randInt()) * (1.0/4294967296.0); } - -inline double MTRand::randExc( const double& n ) - { return randExc() * n; } - -inline double MTRand::randDblExc() - { return ( double(randInt()) + 0.5 ) * (1.0/4294967296.0); } - -inline double MTRand::randDblExc( const double& n ) - { return randDblExc() * n; } - -inline double MTRand::rand53() -{ - uint32 a = randInt() >> 5, b = randInt() >> 6; - return ( a * 67108864.0 + b ) * (1.0/9007199254740992.0); // by Isaku Wada -} - -inline double MTRand::randNorm( const double& mean, const double& variance ) -{ - // Return a real number from a normal (Gaussian) distribution with given - // mean and variance by Box-Muller method - double r = sqrt( -2.0 * log( 1.0-randDblExc()) ) * variance; - double phi = 2.0 * 3.14159265358979323846264338328 * randExc(); - return mean + r * cos(phi); -} - -inline MTRand::uint32 MTRand::randInt() -{ - // Pull a 32-bit integer from the generator state - // Every other access function simply transforms the numbers extracted here - - if( left == 0 ) reload(); - --left; - - register uint32 s1; - s1 = *pNext++; - s1 ^= (s1 >> 11); - s1 ^= (s1 << 7) & 0x9d2c5680UL; - s1 ^= (s1 << 15) & 0xefc60000UL; - return ( s1 ^ (s1 >> 18) ); -} - -inline MTRand::uint32 MTRand::randInt( const uint32& n ) -{ - // Find which bits are used in n - // Optimized by Magnus Jonsson (magnus@smartelectronix.com) - uint32 used = n; - used |= used >> 1; - used |= used >> 2; - used |= used >> 4; - used |= used >> 8; - used |= used >> 16; - - // Draw numbers until one is found in [0,n] - uint32 i; - do - i = randInt() & used; // toss unused bits to shorten search - while( i > n ); - return i; -} - -inline void MTRand::seed( const uint32 oneSeed ) -{ - // Seed the generator with a simple uint32 - initialize(oneSeed); - reload(); -} - -inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) -{ - // Seed the generator with an array of uint32's - // There are 2^19937-1 possible initial states. This function allows - // all of those to be accessed by providing at least 19937 bits (with a - // default seed length of N = 624 uint32's). Any bits above the lower 32 - // in each element are discarded. - // Just call seed() if you want to get array from /dev/urandom - initialize(19650218UL); - register int i = 1; - register uint32 j = 0; - register int k = ( N > int(seedLength) ? N : int(seedLength) ); - for (; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL ); - state[i] += ( bigSeed[j] & 0xffffffffUL ) + j; - state[i] &= 0xffffffffUL; - ++i; ++j; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - if( j >= seedLength ) j = 0; - } - for (k = N - 1; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL ); - state[i] -= i; - state[i] &= 0xffffffffUL; - ++i; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - } - state[0] = 0x80000000UL; // MSB is 1, assuring non-zero initial array - reload(); -} - -inline void MTRand::seed() -{ - // Seed the generator with hash of time() and clock() values - seed( hash( time(NULL), clock() ) ); -} - -inline void MTRand::initialize( const uint32 seed ) -{ - // Initialize generator state with seed - // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier. - // In previous versions, most significant bits (MSBs) of the seed affect - // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. - register uint32 *s = state; - register uint32 *r = state; - register int i = 1; - *s++ = seed & 0xffffffffUL; - for (; i < N; ++i ) - { - *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL; - r++; - } -} - -inline void MTRand::reload() -{ - // Generate N new values in state - // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) - register uint32 *p = state; - register int i; - for (i = N - M; i--; ++p ) - *p = twist( p[M], p[0], p[1] ); - for (i = M; --i; ++p ) - *p = twist( p[M-N], p[0], p[1] ); - *p = twist( p[M-N], p[0], state[0] ); - - left = N, pNext = state; -} - -inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) -{ - // Get a uint32 from t and c - // Better than uint32(x) in case x is floating point in [0,1] - // Based on code by Lawrence Kirby (fred@genesis.demon.co.uk) - - static uint32 differ = 0; // guarantee time-based seeds will change - - uint32 h1 = 0; - unsigned char *p = (unsigned char *) &t; - for (size_t i = 0; i < sizeof(t); ++i ) - { - h1 *= UCHAR_MAX + 2U; - h1 += p[i]; - } - uint32 h2 = 0; - p = (unsigned char *) &c; - for (size_t j = 0; j < sizeof(c); ++j ) - { - h2 *= UCHAR_MAX + 2U; - h2 += p[j]; - } - return ( h1 + differ++ ) ^ h2; -} - -inline void MTRand::save( uint32* saveArray ) const -{ - register uint32 *sa = saveArray; - register const uint32 *s = state; - register int i = N; - for (; i--; *sa++ = *s++ ) {} - *sa = left; -} - -inline void MTRand::load( uint32 *const loadArray ) -{ - register uint32 *s = state; - register uint32 *la = loadArray; - register int i = N; - for (; i--; *s++ = *la++ ) {} - left = *la; - pNext = &state[N-left]; -} - -/* Trinity not use streams for random values output -inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) -{ - register const MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; os << *s++ << "\t" ) {} - return os << mtrand.left; -} - -inline std::istream& operator>>( std::istream& is, MTRand& mtrand ) -{ - register MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; is >> *s++ ) {} - is >> mtrand.left; - mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left]; - return is; -} -*/ - -#endif // MERSENNETWISTER_H - -// Change log: -// -// v0.1 - First release on 15 May 2000 -// - Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// - Translated from C to C++ -// - Made completely ANSI compliant -// - Designed convenient interface for initialization, seeding, and -// obtaining numbers in default or user-defined ranges -// - Added automatic seeding from /dev/urandom or time() and clock() -// - Provided functions for saving and loading generator state -// -// v0.2 - Fixed bug which reloaded generator one step too late -// -// v0.3 - Switched to clearer, faster reload() code from Matthew Bellew -// -// v0.4 - Removed trailing newline in saved generator format to be consistent -// with output format of built-in types -// -// v0.5 - Improved portability by replacing static const int's with enum's and -// clarifying return values in seed(); suggested by Eric Heimburg -// - Removed MAXINT constant; use 0xffffffffUL instead -// -// v0.6 - Eliminated seed overflow when uint32 is larger than 32 bits -// - Changed integer [0,n] generator to give better uniformity -// -// v0.7 - Fixed operator precedence ambiguity in reload() -// - Added access for real numbers in (0,1) and (0,n) -// -// v0.8 - Included time.h header to properly support time_t and clock_t -// -// v1.0 - Revised seeding to match 26 Jan 2002 update of Nishimura and Matsumoto -// - Allowed for seeding with arrays of any length -// - Added access for real numbers in [0,1) with 53-bit resolution -// - Added access for real numbers from normal (Gaussian) distributions -// - Increased overall speed by optimizing twist() -// - Doubled speed of integer [0,n] generation -// - Fixed out-of-range number generation on 64-bit machines -// - Improved portability by substituting literal constants for long enum's -// - Changed license from GNU LGPL to BSD - diff --git a/dep/include/mysql/Libmysql.def b/dep/include/mysql/Libmysql.def deleted file mode 100644 index 81f86dc8726..00000000000 --- a/dep/include/mysql/Libmysql.def +++ /dev/null @@ -1,153 +0,0 @@ -LIBRARY LIBMYSQL -VERSION 6.0 -EXPORTS - _dig_vec_lower - _dig_vec_upper - bmove_upp - delete_dynamic - free_defaults - getopt_compare_strings - getopt_ull_limit_value - handle_options - init_dynamic_array - insert_dynamic - int2str - is_prefix - list_add - list_delete - load_defaults - my_end - my_getopt_print_errors - my_init - my_malloc - my_memdup - my_no_flags_free - my_path - mysql_get_parameters - my_print_help - my_print_variables - my_realloc - my_strdup - mysql_thread_end - mysql_thread_init - myodbc_remove_escape - mysql_affected_rows - mysql_autocommit - mysql_stmt_bind_param - mysql_stmt_bind_result - mysql_change_user - mysql_character_set_name - mysql_close - mysql_commit - mysql_data_seek - mysql_debug - mysql_dump_debug_info - mysql_eof - mysql_errno - mysql_error - mysql_escape_string - mysql_hex_string - mysql_stmt_execute - mysql_stmt_fetch - mysql_stmt_fetch_column - mysql_fetch_field - mysql_fetch_field_direct - mysql_fetch_fields - mysql_fetch_lengths - mysql_fetch_row - mysql_field_count - mysql_field_seek - mysql_field_tell - mysql_free_result - mysql_get_client_info - mysql_get_host_info - mysql_get_proto_info - mysql_get_server_info - mysql_get_client_version - mysql_get_ssl_cipher - mysql_info - mysql_init - mysql_insert_id - mysql_kill - mysql_set_server_option - mysql_list_dbs - mysql_list_fields - mysql_list_processes - mysql_list_tables - mysql_more_results - mysql_next_result - mysql_num_fields - mysql_num_rows - mysql_options - mysql_stmt_param_count - mysql_stmt_param_metadata - mysql_ping - mysql_stmt_result_metadata - mysql_query - mysql_read_query_result - mysql_real_connect - mysql_real_escape_string - mysql_real_query - mysql_refresh - mysql_rollback - mysql_row_seek - mysql_row_tell - mysql_select_db - mysql_stmt_send_long_data - mysql_send_query - mysql_shutdown - mysql_ssl_set - mysql_stat - mysql_stmt_affected_rows - mysql_stmt_close - mysql_stmt_reset - mysql_stmt_data_seek - mysql_stmt_errno - mysql_stmt_error - mysql_stmt_free_result - mysql_stmt_num_rows - mysql_stmt_row_seek - mysql_stmt_row_tell - mysql_stmt_store_result - mysql_store_result - mysql_thread_id - mysql_thread_safe - mysql_use_result - mysql_warning_count - mysql_stmt_sqlstate - mysql_sqlstate - mysql_get_server_version - set_dynamic - strcend - strcont - strdup_root - strfill - strinstr - strmake - strmov - strxmov - mysql_stmt_prepare - mysql_stmt_init - mysql_stmt_insert_id - mysql_stmt_attr_get - mysql_stmt_attr_set - mysql_stmt_field_count - client_errors - mysql_set_local_infile_default - mysql_set_local_infile_handler - mysql_disable_reads_from_master - mysql_disable_rpl_parse - mysql_enable_reads_from_master - mysql_enable_rpl_parse - mysql_master_query - mysql_rpl_parse_enabled - mysql_rpl_probe - mysql_rpl_query_type - mysql_slave_query - mysql_embedded - mysql_server_init - mysql_server_end - mysql_set_character_set - mysql_get_character_set_info - get_defaults_options - modify_defaults_file diff --git a/dep/include/mysql/config-netware.h b/dep/include/mysql/config-netware.h deleted file mode 100644 index 0cc47802591..00000000000 --- a/dep/include/mysql/config-netware.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Header for NetWare compatible with MySQL */ - -#ifndef _config_netware_h -#define _config_netware_h - -/* required headers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* required adjustments */ -#undef HAVE_READDIR_R -#undef HAVE_RWLOCK_INIT -#undef HAVE_SCHED_H -#undef HAVE_SYS_MMAN_H -#undef HAVE_SYNCH_H -#undef HAVE_MMAP -#undef HAVE_RINT - -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#define HAVE_PTHREAD_SIGMASK 1 -#define HAVE_PTHREAD_YIELD_ZERO_ARG 1 -#define HAVE_BROKEN_REALPATH 1 - -/* changes made to make use of LibC-June-2004 for building purpose */ -#undef HAVE_POSIX_SIGNALS -#undef HAVE_PTHREAD_ATTR_SETSCOPE -#undef HAVE_ALLOC_A -#undef HAVE_FINITE -#undef HAVE_GETPWNAM -#undef HAVE_GETPWUID -#undef HAVE_PTHREAD_SETSCHEDPARAM -#undef HAVE_READLINK -#undef HAVE_STPCPY -/* changes end */ - -/* no libc crypt() function */ -#ifdef HAVE_OPENSSL - #define HAVE_CRYPT 1 -#else - #undef HAVE_CRYPT -#endif /* HAVE_OPENSSL */ - -/* Netware has an ancient zlib */ -#undef HAVE_COMPRESS -#define HAVE_COMPRESS -#undef HAVE_ARCHIVE_DB - -/* include the old function apis */ -#define USE_OLD_FUNCTIONS 1 - -/* no case sensitivity */ -#define FN_NO_CASE_SENCE 1 - -/* the thread alarm is not used */ -#define DONT_USE_THR_ALARM 1 - -/* signals do not interrupt sockets */ -#define SIGNALS_DONT_BREAK_READ 1 - -/* signal by closing the sockets */ -#define SIGNAL_WITH_VIO_CLOSE 1 - -/* On NetWare, stack grows towards lower address*/ -#define STACK_DIRECTION -1 - -/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */ -#define NW_THD_STACKSIZE 65536 - -/* On NetWare, to fix the problem with the deletion of open files */ -#define CANT_DELETE_OPEN_FILES 1 - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define FN_DEVCHAR ':' - -/* default directory information */ -#define DEFAULT_MYSQL_HOME "sys:/mysql" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "sys:/" -#define SHAREDIR "share/" -#define DEFAULT_CHARSET_HOME "sys:/mysql/" -#define DATADIR "data/" - -/* 64-bit file system calls */ -#define SIZEOF_OFF_T 8 -#define off_t off64_t -#define chsize chsize64 -#define ftruncate ftruncate64 -#define lseek lseek64 -#define pread pread64 -#define pwrite pwrite64 -#define tell tell64 - -/* do not use the extended time in LibC sys\stat.h */ -#define _POSIX_SOURCE - -/* Some macros for portability */ - -#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; } - -/* extra protection against CPU Hogs on NetWare */ -#define NETWARE_YIELD pthread_yield() -/* Screen mode for help texts */ -#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A) - -#ifdef __cplusplus -} -#endif - -#endif /* _config_netware_h */ - diff --git a/dep/include/mysql/config-os2.h b/dep/include/mysql/config-os2.h deleted file mode 100644 index 440d75af65a..00000000000 --- a/dep/include/mysql/config-os2.h +++ /dev/null @@ -1,836 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & Yuri Dario - All the above parties has a full, independent copyright to - the following code, including the right to use the code in - any manner without any demands from the other parties. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Defines for OS2 to make it compatible for MySQL */ - -#ifndef __CONFIG_OS2_H__ -#define __CONFIG_OS2_H__ - -#include -#include -#include -#include - -/* Define to name of system eg solaris*/ -#define SYSTEM_TYPE "IBM OS/2 Warp" -/* Define to machine type name eg sun10 */ -#define MACHINE_TYPE "i686" -/* Name of package */ -#define PACKAGE "mysql" -/* Version number of package */ -#define VERSION MYSQL_SERVER_VERSION -/* Default socket */ -#define MYSQL_UNIX_ADDR "\\socket\\MySQL" - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define MY_NFILE 1024 /* This is only used to save filenames */ - -#define HAVE_ACCESS - -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#define _POSIX_PATH_MAX 255 -#define DWORD ULONG - -#define O_SHARE 0x1000 /* Open file in sharing mode */ -#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ -#define S_IROTH S_IREAD /* for my_lib */ - -#define CANT_DELETE_OPEN_FILES /* saves open files in a list, for delayed delete */ - -#define O_NONBLOCK 0x10 - -#define NO_OPEN_3 /* For my_create() */ -#define SIGQUIT SIGTERM /* No SIGQUIT */ -#define SIGALRM 14 /* Alarm */ - -#define NO_FCNTL_NONBLOCK - -#define EFBIG E2BIG -/*#define ENFILE EMFILE */ -/*#define ENAMETOOLONG (EOS2ERR+2) */ -/*#define ETIMEDOUT 145 */ -/*#define EPIPE 146 */ -#define EROFS 147 - -#define sleep(A) DosSleep((A)*1000) -#define closesocket(A) soclose(A) - -#define F_OK 0 -#define W_OK 2 - -#define bzero(x,y) memset((x),'\0',(y)) -#define bcopy(x,y,z) memcpy((y),(x),(z)) -#define bcmp(x,y,z) memcmp((y),(x),(z)) - -#define F_RDLCK 4 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 0 /* Remove lock. */ - -#define S_IFMT 0x17000 /* Mask for file type */ -#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */ - -#define HUGE_PTR - -#ifdef __cplusplus -extern "C" -#endif -double _cdecl rint( double nr); - -DWORD TlsAlloc( void); -BOOL TlsFree( DWORD); -PVOID TlsGetValue( DWORD); -BOOL TlsSetValue( DWORD, PVOID); - -/* support for > 2GB file size */ -#define SIZEOF_OFF_T 8 -#define lseek(A,B,C) _lseek64( A, B, C) -#define tell(A) _lseek64( A, 0, SEEK_CUR) - -void* dlopen( char* path, int flag); -char* dlerror( void); -void* dlsym( void* hmod, char* fn); -void dlclose( void* hmod); - -/* Some typedefs */ -typedef unsigned long long os_off_t; - -/* config.h. Generated automatically by configure. */ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -/* #undef C_ALLOCA */ - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -/* #undef CRAY_STACKSEG_END */ - -/* Define if you have alloca, as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define if you have and it should be used (not on Ultrix). */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you don't have vprintf but do have _doprnt. */ -/* #undef HAVE_DOPRNT */ - -/* Define if you have a working `mmap' system call. */ -/* #undef HAVE_MMAP */ - -/* Define if system calls automatically restart after interruption - by a signal. */ -/* #undef HAVE_RESTARTABLE_SYSCALLS */ - -/* Define if your struct stat has st_rdev. */ -#define HAVE_ST_RDEV 1 - -/* Define if you have that is POSIX.1 compatible. */ -/* #define HAVE_SYS_WAIT_H 1 */ - -/* Define if you don't have tm_zone but do have the external array - tzname. */ -#define HAVE_TZNAME 1 - -/* Define if utime(file, NULL) sets file's timestamp to the present. */ -#define HAVE_UTIME_NULL 1 - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define as __inline if that's what the C compiler calls it. */ -/* #undef inline */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#define STACK_DIRECTION -1 - -/* Define if the `S_IS*' macros in do not work properly. */ -/* #undef STAT_MACROS_BROKEN */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define if your declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - -/* Version of .frm files */ -#define DOT_FRM_VERSION 6 - -/* READLINE: */ -#define FIONREAD_IN_SYS_IOCTL 1 - -/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */ -/* #undef GWINSZ_IN_SYS_IOCTL */ - -/* Do we have FIONREAD */ -#define FIONREAD_IN_SYS_IOCTL 1 - -/* atomic_add() from (Linux only) */ -/* #undef HAVE_ATOMIC_ADD */ - -/* atomic_sub() from (Linux only) */ -/* #undef HAVE_ATOMIC_SUB */ - -/* bool is not defined by all C++ compilators */ -#define HAVE_BOOL 1 - -/* Have berkeley db installed */ -/* #define HAVE_BERKELEY_DB 1 */ - -/* DSB style signals ? */ -/* #undef HAVE_BSD_SIGNALS */ - -/* Can netinet be included */ -/* #undef HAVE_BROKEN_NETINET_INCLUDES */ - -/* READLINE: */ -/* #undef HAVE_BSD_SIGNALS */ - -/* ZLIB and compress: */ -#define HAVE_COMPRESS 1 - -/* Define if we are using OSF1 DEC threads */ -/* #undef HAVE_DEC_THREADS */ - -/* Define if we are using OSF1 DEC threads on 3.2 */ -/* #undef HAVE_DEC_3_2_THREADS */ - -/* fp_except from ieeefp.h */ -/* #undef HAVE_FP_EXCEPT */ - -/* READLINE: */ -/* #undef HAVE_GETPW_DECLS */ - -/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines - this with 6 arguments */ -/* #undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE */ - -/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */ -/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */ - -/* Define if int8, int16 and int32 types exist */ -/* #undef HAVE_INT_8_16_32 */ - -/* Define if have -lwrap */ -/* #undef HAVE_LIBWRAP */ - -/* Define if we are using Xavier Leroy's LinuxThreads */ -/* #undef HAVE_LINUXTHREADS */ - -/* Do we use user level threads */ -/* #undef HAVE_mit_thread */ - -/* For some non posix threads */ -/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */ - -/* For some non posix threads */ -/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ - -/* READLINE: */ -#define HAVE_POSIX_SIGNALS 0 - -/* sigwait with one argument */ -/* #undef HAVE_NONPOSIX_SIGWAIT */ - -/* pthread_attr_setscope */ -#define HAVE_PTHREAD_ATTR_SETSCOPE 1 - -/* POSIX readdir_r */ -/* #undef HAVE_READDIR_R */ - -/* POSIX sigwait */ -/* #undef HAVE_SIGWAIT */ - -/* crypt */ -#define HAVE_CRYPT 1 - -/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines - this with 8 arguments */ -/* #undef HAVE_SOLARIS_STYLE_GETHOST */ - -/* Timespec has a ts_sec instead of tv_sev */ -#define HAVE_TIMESPEC_TS_SEC 1 - -/* Have the tzname variable */ -#define HAVE_TZNAME 1 - -/* Define if the system files define uchar */ -/* #undef HAVE_UCHAR */ - -/* Define if the system files define uint */ -/* #undef HAVE_UINT */ - -/* Define if the system files define ulong */ -/* #undef HAVE_ULONG */ - -/* UNIXWARE7 threads are not posix */ -/* #undef HAVE_UNIXWARE7_THREADS */ - -/* new UNIXWARE7 threads that are not yet posix */ -/* #undef HAVE_UNIXWARE7_POSIX */ - -/* READLINE: */ -/* #undef HAVE_USG_SIGHOLD */ - -/* Define if want -lwrap */ -/* #undef LIBWRAP */ - -/* mysql client protocoll version */ -#define PROTOCOL_VERSION 10 - -/* Define if qsort returns void */ -#define QSORT_TYPE_IS_VOID 1 - -/* Define as the return type of qsort (int or void). */ -#define RETQSORTTYPE void - -/* Define as the base type of the last arg to accept */ -#define SOCKET_SIZE_TYPE int - -/* Last argument to get/setsockopt */ -/* #undef SOCKOPT_OPTLEN_TYPE */ - -/* #undef SPEED_T_IN_SYS_TYPES */ -/* #undef SPRINTF_RETURNS_PTR */ -#define SPRINTF_RETURNS_INT 1 -/* #undef SPRINTF_RETURNS_GARBAGE */ - -/* #undef STRUCT_DIRENT_HAS_D_FILENO */ -#define STRUCT_DIRENT_HAS_D_INO 1 - -/* Define if you want to have threaded code. This may be undef on client code */ -#define THREAD 1 - -/* Should be client be thread safe */ -/* #undef THREAD_SAFE_CLIENT */ - -/* READLINE: */ -/* #undef TIOCSTAT_IN_SYS_IOCTL */ - -/* Use multi-byte character routines */ -/* #undef USE_MB */ -/* #undef USE_MB_IDENT */ - -/* Use MySQL RAID */ -/* #undef USE_RAID */ - -/* Use strcoll() functions when comparing and sorting. */ -/* #undef USE_STRCOLL */ - -/* READLINE: */ -#define VOID_SIGHANDLER 1 - -/* The number of bytes in a char. */ -#define SIZEOF_CHAR 1 - -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* The number of bytes in a long. */ -#define SIZEOF_LONG 4 - -/* The number of bytes in a long long. */ -#define SIZEOF_LONG_LONG 8 - -/* Define if you have the alarm function. */ -#define HAVE_ALARM 1 - -/* Define if you have the atod function. */ -/* #undef HAVE_ATOD */ - -/* Define if you have the bcmp function. */ -#define HAVE_BCMP 1 - -/* Define if you have the bfill function. */ -/* #undef HAVE_BFILL */ - -/* Define if you have the bmove function. */ -/* #undef HAVE_BMOVE */ - -/* Define if you have the bzero function. */ -#define HAVE_BZERO 1 - -/* Define if you have the chsize function. */ -#define HAVE_CHSIZE 1 - -/* Define if you have the cuserid function. */ -/* #define HAVE_CUSERID 1 */ - -/* Define if you have the dlerror function. */ -#define HAVE_DLERROR 1 - -/* Define if you have the dlopen function. */ -#define HAVE_DLOPEN 1 - -/* Define if you have the fchmod function. */ -/* #undef HAVE_FCHMOD */ - -/* Define if you have the fcntl function. */ -/* #define HAVE_FCNTL 1 */ - -/* Define if you have the fconvert function. */ -/* #undef HAVE_FCONVERT */ - -/* Define if you have the finite function. */ -/* #undef HAVE_FINITE */ - -/* Define if you have the fpresetsticky function. */ -/* #undef HAVE_FPRESETSTICKY */ - -/* Define if you have the fpsetmask function. */ -/* #undef HAVE_FPSETMASK */ - -/* Define if you have the fseeko function. */ -/* #undef HAVE_FSEEKO */ - -/* Define if you have the ftruncate function. */ -/* #define HAVE_FTRUNCATE 1 */ - -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD 1 - -/* Define if you have the gethostbyaddr_r function. */ -/* #undef HAVE_GETHOSTBYADDR_R */ - -/* Define if you have the gethostbyname_r function. */ -/* #undef HAVE_GETHOSTBYNAME_R */ - -/* Define if you have the getpagesize function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define if you have the getpass function. */ -/*#define HAVE_GETPASS 1 */ - -/* Define if you have the getpassphrase function. */ -/* #undef HAVE_GETPASSPHRASE */ - -/* Define if you have the getpwnam function. */ -/* #define HAVE_GETPWNAM 1 */ - -/* Define if you have the getpwuid function. */ -/* #define HAVE_GETPWUID 1 */ - -/* Define if you have the getrlimit function. */ -/* #undef HAVE_GETRLIMIT */ - -/* Define if you have the getrusage function. */ -/* #undef HAVE_GETRUSAGE */ - -/* Define if you have the getwd function. */ -#define HAVE_GETWD 1 - -/* Define to 1 if you have the `gmtime_r' function. */ -#define HAVE_GMTIME_R 1 - -/* Define if you have the index function. */ -#define HAVE_INDEX 1 - -/* Define if you have the initgroups function. */ -/* #undef HAVE_INITGROUPS */ - -/* Define if you have the localtime_r function. */ -#define HAVE_LOCALTIME_R 1 - -/* Define if you have the locking function. */ -/* #undef HAVE_LOCKING */ - -/* Define if you have the longjmp function. */ -#define HAVE_LONGJMP 1 - -/* Define if you have the lrand48 function. */ -/* #undef HAVE_LRAND48 */ - -/* Define if you have the lstat function. */ -/* #undef HAVE_LSTAT */ - -/* Define if you have the madvise function. */ -/* #undef HAVE_MADVISE */ - -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the mkstemp function. */ -/* #define HAVE_MKSTEMP 1 */ - -/* Define if you have the mlockall function. */ -/* #undef HAVE_MLOCKALL */ - -/* Define if you have the perror function. */ -#define HAVE_PERROR 1 - -/* Define if you have the poll function. */ -/* #undef HAVE_POLL */ - -/* Define if you have the pread function. */ -/* #undef HAVE_PREAD */ - -/* Define if you have the pthread_attr_create function. */ -/* #undef HAVE_PTHREAD_ATTR_CREATE */ - -/* Define if you have the pthread_attr_setprio function. */ -#define HAVE_PTHREAD_ATTR_SETPRIO 1 - -/* Define if you have the pthread_attr_setschedparam function. */ -/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ - -/* Define if you have the pthread_attr_setstacksize function. */ -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 - -/* Define if you have the pthread_condattr_create function. */ -/* #undef HAVE_PTHREAD_CONDATTR_CREATE */ - -/* Define if you have the pthread_getsequence_np function. */ -/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */ - -/* Define if you have the pthread_init function. */ -/* #undef HAVE_PTHREAD_INIT */ - -/* Define if you have the pthread_rwlock_rdlock function. */ -/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */ - -/* Define if you have the pthread_setprio function. */ -#define HAVE_PTHREAD_SETPRIO 1 - -/* Define if you have the pthread_setprio_np function. */ -/* #undef HAVE_PTHREAD_SETPRIO_NP */ - -/* Define if you have the pthread_setschedparam function. */ -/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ - -/* Define if you have the pthread_sigmask function. */ -#define HAVE_PTHREAD_SIGMASK 1 - -/* Define if you have the putenv function. */ -#define HAVE_PUTENV 1 - -/* Define if you have the readlink function. */ -/* #undef HAVE_READLINK */ - -/* Define if you have the realpath function. */ -/* #undef HAVE_REALPATH */ - -/* Define if you have the rename function. */ -#define HAVE_RENAME 1 - -/* Define if you have the rint function. */ -#define HAVE_RINT 1 - -/* Define if you have the rwlock_init function. */ -/* #undef HAVE_RWLOCK_INIT */ - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the setenv function. */ -/* #undef HAVE_SETENV */ - -/* Define if you have the setlocale function. */ -#define HAVE_SETLOCALE 1 - -/* Define if you have the setupterm function. */ -/* #undef HAVE_SETUPTERM */ - -/* Define if you have the sighold function. */ -/* #undef HAVE_SIGHOLD */ - -/* Define if you have the sigset function. */ -/* #undef HAVE_SIGSET */ - -/* Define if you have the sigthreadmask function. */ -/* #undef HAVE_SIGTHREADMASK */ - -/* Define if you have the snprintf function. */ -/* #define HAVE_SNPRINTF 1 */ - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the stpcpy function. */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the strcasecmp function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the strcoll function. */ -#define HAVE_STRCOLL 1 - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strnlen function. */ -/* #undef HAVE_STRNLEN */ - -/* Define if you have the strpbrk function. */ -#define HAVE_STRPBRK 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the strtok_r function. */ -/* #undef HAVE_STRTOK_R */ - -/* Define if you have the strtol function. */ -#define HAVE_STRTOL 1 - -/* Define if you have the strtoul function. */ -#define HAVE_STRTOUL 1 - -/* Define if you have the strtoull function. */ -/* #undef HAVE_STRTOULL */ - -/* Define if you have the tcgetattr function. */ -#define HAVE_TCGETATTR 1 - -/* Define if you have the tell function. */ -#define HAVE_TELL 1 - -/* Define if you have the tempnam function. */ -#define HAVE_TEMPNAM 1 - -/* Define if you have the thr_setconcurrency function. */ -/* #undef HAVE_THR_SETCONCURRENCY */ - -/* Define if you have the vidattr function. */ -/* #undef HAVE_VIDATTR */ - -/* Define if you have the header file. */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_ASM_TERMBITS_H */ - -/* Define if you have the header file. */ -#define HAVE_CRYPT_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_CURSES_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_DIRENT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -#define HAVE_FLOAT_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_FLOATINGPOINT_H */ - -/* Define if you have the header file. */ -/* #define HAVE_GRP_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_IEEEFP_H */ - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_NDIR_H */ - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_PATHS_H */ - -/* Define if you have the header file. */ -/* #define HAVE_PWD_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_SCHED_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SELECT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_STRINGS_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYNCH_H */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_DIR_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_FILE_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_MMAN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PTE_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PTEM_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STREAM_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_UN_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_UTIME_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_VADVISE_H */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_WAIT_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_TERM_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_TERMBITS_H */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMCAP_H 1 */ - -/* Define if you have the header file. */ -/* /#define HAVE_TERMIO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMIOS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the header file. */ -#define HAVE_UTIME_H 1 - -/* Define if you have the header file. */ -#define HAVE_VARARGS_H 1 - -/* Define if you have the bind library (-lbind). */ -/* #undef HAVE_LIBBIND */ - -/* Define if you have the c_r library (-lc_r). */ -/* #undef HAVE_LIBC_R */ - -/* Define if you have the compat library (-lcompat). */ -/* #undef HAVE_LIBCOMPAT */ - -/* Define if you have the crypt library (-lcrypt). */ -#define HAVE_LIBCRYPT 1 - -/* Define if you have the dl library (-ldl). */ -#define HAVE_LIBDL 1 - -/* Define if you have the gen library (-lgen). */ -/* #undef HAVE_LIBGEN */ - -/* Define if you have the m library (-lm). */ -#define HAVE_LIBM 1 - -/* Define if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define if you have the nsl_r library (-lnsl_r). */ -/* #undef HAVE_LIBNSL_R */ - -/* Define if you have the pthread library (-lpthread). */ -/* #undef HAVE_LIBPTHREAD */ - -/* Define if you have the socket library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define to make fseeko etc. visible, on some hosts. */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -#endif /* __CONFIG_OS2_H__ */ - diff --git a/dep/include/mysql/config-win.h b/dep/include/mysql/config-win.h deleted file mode 100644 index 5a4cf162a11..00000000000 --- a/dep/include/mysql/config-win.h +++ /dev/null @@ -1,461 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Defines for Win32 to make it compatible for MySQL */ - -#ifdef __WIN2000__ -/* We have to do this define before including windows.h to get the AWE API -functions */ -#define _WIN32_WINNT 0x0500 -#else -/* Get NT 4.0 functions */ -#define _WIN32_WINNT 0x0400 -#endif - -#if defined(_MSC_VER) && _MSC_VER >= 1400 -/* Avoid endless warnings about sprintf() etc. being unsafe. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -#include -#include -#include /* Because of rint() */ -#include -#include -#include - -#define BIG_TABLES 1 -#define HAVE_SMEM 1 - -#if defined(_WIN64) || defined(WIN64) -#define SYSTEM_TYPE "Win64" -#elif defined(_WIN32) || defined(WIN32) -#define SYSTEM_TYPE "Win32" -#else -#define SYSTEM_TYPE "Windows" -#endif - -#if defined(_M_IA64) -#define MACHINE_TYPE "ia64" -#elif defined(_M_IX86) -#define MACHINE_TYPE "ia32" -#elif defined(_M_ALPHA) -#define MACHINE_TYPE "axp" -#else -#define MACHINE_TYPE "unknown" /* Define to machine type name */ -#endif - -#if !(defined(_WIN64) || defined(WIN64)) -#ifndef _WIN32 -#define _WIN32 /* Compatible with old source */ -#endif -#ifndef __WIN32__ -#define __WIN32__ -#endif -#endif /* _WIN64 */ -#ifndef __WIN__ -#define __WIN__ /* To make it easier in VC++ */ -#endif - -#ifndef MAX_INDEXES -#define MAX_INDEXES 64 -#endif - -/* File and lock constants */ -#define O_SHARE 0x1000 /* Open file in sharing mode */ -#ifdef __BORLANDC__ -#define F_RDLCK LK_NBLCK /* read lock */ -#define F_WRLCK LK_NBRLCK /* write lock */ -#define F_UNLCK LK_UNLCK /* remove lock(s) */ -#else -#define F_RDLCK _LK_NBLCK /* read lock */ -#define F_WRLCK _LK_NBRLCK /* write lock */ -#define F_UNLCK _LK_UNLCK /* remove lock(s) */ -#endif - -#define F_EXCLUSIVE 1 /* We have only exclusive locking */ -#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */ -#define F_OK 0 /* parameter to access() */ -#define W_OK 2 - -#define S_IROTH S_IREAD /* for my_lib */ - -#ifdef __BORLANDC__ -#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY 0 -#define O_SHORT_LIVED 0 -#define SH_DENYNO _SH_DENYNO -#else -#define O_BINARY _O_BINARY /* compability with MSDOS */ -#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY _O_TEMPORARY -#define O_SHORT_LIVED _O_SHORT_LIVED -#define SH_DENYNO _SH_DENYNO -#endif -#define NO_OPEN_3 /* For my_create() */ - -#define SIGQUIT SIGTERM /* No SIGQUIT */ - -#undef _REENTRANT /* Crashes something for win32 */ -#undef SAFE_MUTEX /* Can't be used on windows */ - -#if defined(_MSC_VER) && _MSC_VER >= 1310 -#define LL(A) A##ll -#define ULL(A) A##ull -#else -#define LL(A) ((__int64) A) -#define ULL(A) ((unsigned __int64) A) -#endif - -#define LONGLONG_MIN LL(0x8000000000000000) -#define LONGLONG_MAX LL(0x7FFFFFFFFFFFFFFF) -#define ULONGLONG_MAX ULL(0xFFFFFFFFFFFFFFFF) - -/* Type information */ - -#if defined(__EMX__) || !defined(HAVE_UINT) -#undef HAVE_UINT -#define HAVE_UINT -typedef unsigned short ushort; -typedef unsigned int uint; -#endif /* defined(__EMX__) || !defined(HAVE_UINT) */ - -typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ -typedef __int64 longlong; -#ifndef HAVE_SIGSET_T -typedef int sigset_t; -#endif -#define longlong_defined -/* - off_t should not be __int64 because of conflicts in header files; - Use my_off_t or os_off_t instead -*/ -#ifndef HAVE_OFF_T -typedef long off_t; -#endif -typedef __int64 os_off_t; -#ifdef _WIN64 -typedef UINT_PTR rf_SetTimer; -#else -#ifndef HAVE_SIZE_T -typedef unsigned int size_t; -#endif -typedef uint rf_SetTimer; -#endif - -#define Socket_defined -#define my_socket SOCKET -#define bool BOOL -#define SIGPIPE SIGINT -#define RETQSORTTYPE void -#define QSORT_TYPE_IS_VOID -#define RETSIGTYPE void -#define SOCKET_SIZE_TYPE int -#define my_socket_defined -#define bool_defined -#define byte_defined -#define HUGE_PTR -#define STDCALL __stdcall /* Used by libmysql.dll */ -#define isnan(X) _isnan(X) -#define finite(X) _finite(X) - -#ifndef UNDEF_THREAD_HACK -#define THREAD -#endif -#define VOID_SIGHANDLER -#define SIZEOF_CHAR 1 -#define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 8 -#define SIZEOF_OFF_T 8 -#ifdef _WIN64 -#define SIZEOF_CHARP 8 -#else -#define SIZEOF_CHARP 4 -#endif -#define HAVE_BROKEN_NETINET_INCLUDES -#ifdef __NT__ -#define HAVE_NAMED_PIPE /* We can only create pipes on NT */ -#endif - -/* ERROR is defined in wingdi.h */ -#undef ERROR - -/* We need to close files to break connections on shutdown */ -#ifndef SIGNAL_WITH_VIO_CLOSE -#define SIGNAL_WITH_VIO_CLOSE -#endif - -/* Use all character sets in MySQL */ -#define USE_MB 1 -#define USE_MB_IDENT 1 -#define USE_STRCOLL 1 - -/* All windows servers should support .sym files */ -#undef USE_SYMDIR -#define USE_SYMDIR - -/* If LOAD DATA LOCAL INFILE should be enabled by default */ -#define ENABLED_LOCAL_INFILE 1 - -/* Convert some simple functions to Posix */ - -#define my_sigset(A,B) signal((A),(B)) -#define finite(A) _finite(A) -#define sleep(A) Sleep((A)*1000) -#define popen(A,B) _popen((A),(B)) -#define pclose(A) _pclose(A) - -#ifndef __BORLANDC__ -#define access(A,B) _access(A,B) -#endif - -#if !defined(__cplusplus) -#define inline __inline -#endif /* __cplusplus */ - -inline double rint(double nr) -{ - double f = floor(nr); - double c = ceil(nr); - return (((c-nr) >= (nr-f)) ? f :c); -} - -#ifdef _WIN64 -#define ulonglong2double(A) ((double) (ulonglong) (A)) -#define my_off_t2double(A) ((double) (my_off_t) (A)) - -#else -inline double ulonglong2double(ulonglong value) -{ - longlong nr=(longlong) value; - if (nr >= 0) - return (double) nr; - return (18446744073709551616.0 + (double) nr); -} -#define my_off_t2double(A) ulonglong2double(A) -#endif /* _WIN64 */ - -#if SIZEOF_OFF_T > 4 -#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C)) -#define tell(A) _telli64(A) -#endif - - -#define STACK_DIRECTION -1 - -/* Optimized store functions for Intel x86 */ - -#ifndef _WIN64 -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -/* - ATTENTION ! - - Please, note, uint3korr reads 4 bytes (not 3) ! - It means, that you have to provide enough allocated space ! -*/ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#define uint4korr(A) (*((unsigned long *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) -#define int3store(T,A) { *(T)= (uchar) ((A));\ - *(T+1)=(uchar) (((uint) (A) >> 8));\ - *(T+2)=(uchar) (((A) >> 16)); } -#define int4store(T,A) *((long *) (T))= (long) (A) -#define int5store(T,A) { *(T)= (uchar)((A));\ - *((T)+1)=(uchar) (((A) >> 8));\ - *((T)+2)=(uchar) (((A) >> 16));\ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); } -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) - -#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \ - *(((long *) &V)+1) = *(((long*) M)+1); } while(0) -#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \ - *(((long *) T)+1) = *(((long*) &V)+1); } while(0) -#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } -#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) -#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float)) -#define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* _WIN64 */ - -#define HAVE_PERROR -#define HAVE_VFPRINT -#define HAVE_RENAME /* Have rename() as function */ -#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */ -#define HAVE_LONG_JMP /* Have long jump function */ -#define HAVE_LOCKING /* have locking() call */ -#define HAVE_ERRNO_AS_DEFINE /* errno is a define */ -#define HAVE_STDLIB /* everything is include in this file */ -#define HAVE_MEMCPY -#define HAVE_MEMMOVE -#define HAVE_GETCWD -#define HAVE_TELL -#define HAVE_TZNAME -#define HAVE_PUTENV -#define HAVE_SELECT -#define HAVE_SETLOCALE -#define HAVE_SOCKET /* Giangi */ -#define HAVE_FLOAT_H -#define HAVE_LIMITS_H -#define HAVE_STDDEF_H -#define HAVE_RINT /* defined in this file */ -#define NO_FCNTL_NONBLOCK /* No FCNTL */ -#define HAVE_ALLOCA -#define HAVE_STRPBRK -#define HAVE_STRSTR -#define HAVE_COMPRESS -#define HAVE_CREATESEMAPHORE -#define HAVE_ISNAN -#define HAVE_FINITE -#define HAVE_QUERY_CACHE -#define SPRINTF_RETURNS_INT -#define HAVE_SETFILEPOINTER -#define HAVE_VIO_READ_BUFF -#define HAVE_STRNLEN - -#ifndef __NT__ -#undef FILE_SHARE_DELETE -#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */ -#endif - -#ifdef NOT_USED -#define HAVE_SNPRINTF /* Gave link error */ -#define _snprintf snprintf -#endif - -#ifdef _MSC_VER -#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ -#define HAVE_ANSI_INCLUDE -#define HAVE_SYS_UTIME_H -#define HAVE_STRTOUL -#endif -#define my_reinterpret_cast(A) reinterpret_cast -#define my_const_cast(A) const_cast - - -/* MYSQL OPTIONS */ - -#ifdef _CUSTOMCONFIG_ -#include -#else -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define DATADIR "c:\\mysql\\data" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#endif -#ifndef DEFAULT_HOME_ENV -#define DEFAULT_HOME_ENV MYSQL_HOME -#endif -#ifndef DEFAULT_GROUP_SUFFIX_ENV -#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX -#endif - -/* File name handling */ - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define FN_DEVCHAR ':' -#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ -#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ -#define OS_FILE_LIMIT 2048 - -#define DO_NOT_REMOVE_THREAD_WRAPPERS -#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) -#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) -/* The following is only used for statistics, so it should be good enough */ -#ifdef __NT__ /* This should also work on Win98 but .. */ -#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) -#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) -#else -#define thread_safe_add(V,C,L) \ - pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); -#define thread_safe_sub(V,C,L) \ - pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); -#define statistic_add(V,C,L) (V)+=(C) -#endif -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) - -#define shared_memory_buffer_length 16000 -#define default_shared_memory_base_name "MYSQL" - -#define MYSQL_DEFAULT_CHARSET_NAME "latin1" -#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" - -#define HAVE_SPATIAL 1 -#define HAVE_RTREE_KEYS 1 - -#define HAVE_OPENSSL 1 -#define HAVE_YASSL 1 - -/* Define charsets you want */ -/* #undef HAVE_CHARSET_armscii8 */ -/* #undef HAVE_CHARSET_ascii */ -#define HAVE_CHARSET_big5 1 -#define HAVE_CHARSET_cp1250 1 -/* #undef HAVE_CHARSET_cp1251 */ -/* #undef HAVE_CHARSET_cp1256 */ -/* #undef HAVE_CHARSET_cp1257 */ -/* #undef HAVE_CHARSET_cp850 */ -/* #undef HAVE_CHARSET_cp852 */ -/* #undef HAVE_CHARSET_cp866 */ -#define HAVE_CHARSET_cp932 1 -/* #undef HAVE_CHARSET_dec8 */ -#define HAVE_CHARSET_eucjpms 1 -#define HAVE_CHARSET_euckr 1 -#define HAVE_CHARSET_gb2312 1 -#define HAVE_CHARSET_gbk 1 -/* #undef HAVE_CHARSET_greek */ -/* #undef HAVE_CHARSET_hebrew */ -/* #undef HAVE_CHARSET_hp8 */ -/* #undef HAVE_CHARSET_keybcs2 */ -/* #undef HAVE_CHARSET_koi8r */ -/* #undef HAVE_CHARSET_koi8u */ -#define HAVE_CHARSET_latin1 1 -#define HAVE_CHARSET_latin2 1 -/* #undef HAVE_CHARSET_latin5 */ -/* #undef HAVE_CHARSET_latin7 */ -/* #undef HAVE_CHARSET_macce */ -/* #undef HAVE_CHARSET_macroman */ -#define HAVE_CHARSET_sjis 1 -/* #undef HAVE_CHARSET_swe7 */ -#define HAVE_CHARSET_tis620 1 -#define HAVE_CHARSET_ucs2 1 -#define HAVE_CHARSET_ujis 1 -#define HAVE_CHARSET_utf8 1 -#define HAVE_UCA_COLLATIONS 1 - - diff --git a/dep/include/mysql/errmsg.h b/dep/include/mysql/errmsg.h deleted file mode 100644 index 720ff7a25ae..00000000000 --- a/dep/include/mysql/errmsg.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Error messages for MySQL clients */ -/* (Error messages for the daemon are in share/language/errmsg.sys) */ - -#ifdef __cplusplus -extern "C" { -#endif -void init_client_errs(void); -void finish_client_errs(void); -extern const char *client_errors[]; /* Error messages */ -#ifdef __cplusplus -} -#endif - -#define CR_MIN_ERROR 2000 /* For easier client code */ -#define CR_MAX_ERROR 2999 -#if defined(OS2) && defined(MYSQL_SERVER) -#define CER(X) client_errors[(X)-CR_MIN_ERROR] -#elif !defined(ER) -#define ER(X) client_errors[(X)-CR_MIN_ERROR] -#endif -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ - -/* Do not add error numbers before CR_ERROR_FIRST. */ -/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ -#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ -#define CR_UNKNOWN_ERROR 2000 -#define CR_SOCKET_CREATE_ERROR 2001 -#define CR_CONNECTION_ERROR 2002 -#define CR_CONN_HOST_ERROR 2003 -#define CR_IPSOCK_ERROR 2004 -#define CR_UNKNOWN_HOST 2005 -#define CR_SERVER_GONE_ERROR 2006 -#define CR_VERSION_ERROR 2007 -#define CR_OUT_OF_MEMORY 2008 -#define CR_WRONG_HOST_INFO 2009 -#define CR_LOCALHOST_CONNECTION 2010 -#define CR_TCP_CONNECTION 2011 -#define CR_SERVER_HANDSHAKE_ERR 2012 -#define CR_SERVER_LOST 2013 -#define CR_COMMANDS_OUT_OF_SYNC 2014 -#define CR_NAMEDPIPE_CONNECTION 2015 -#define CR_NAMEDPIPEWAIT_ERROR 2016 -#define CR_NAMEDPIPEOPEN_ERROR 2017 -#define CR_NAMEDPIPESETSTATE_ERROR 2018 -#define CR_CANT_READ_CHARSET 2019 -#define CR_NET_PACKET_TOO_LARGE 2020 -#define CR_EMBEDDED_CONNECTION 2021 -#define CR_PROBE_SLAVE_STATUS 2022 -#define CR_PROBE_SLAVE_HOSTS 2023 -#define CR_PROBE_SLAVE_CONNECT 2024 -#define CR_PROBE_MASTER_CONNECT 2025 -#define CR_SSL_CONNECTION_ERROR 2026 -#define CR_MALFORMED_PACKET 2027 -#define CR_WRONG_LICENSE 2028 - -/* new 4.1 error codes */ -#define CR_NULL_POINTER 2029 -#define CR_NO_PREPARE_STMT 2030 -#define CR_PARAMS_NOT_BOUND 2031 -#define CR_DATA_TRUNCATED 2032 -#define CR_NO_PARAMETERS_EXISTS 2033 -#define CR_INVALID_PARAMETER_NO 2034 -#define CR_INVALID_BUFFER_USE 2035 -#define CR_UNSUPPORTED_PARAM_TYPE 2036 - -#define CR_SHARED_MEMORY_CONNECTION 2037 -#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 -#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 -#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 -#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 -#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 -#define CR_SHARED_MEMORY_MAP_ERROR 2043 -#define CR_SHARED_MEMORY_EVENT_ERROR 2044 -#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 -#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 -#define CR_CONN_UNKNOW_PROTOCOL 2047 -#define CR_INVALID_CONN_HANDLE 2048 -#define CR_SECURE_AUTH 2049 -#define CR_FETCH_CANCELED 2050 -#define CR_NO_DATA 2051 -#define CR_NO_STMT_METADATA 2052 -#define CR_NO_RESULT_SET 2053 -#define CR_NOT_IMPLEMENTED 2054 -#define CR_SERVER_LOST_EXTENDED 2055 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2055 -/* Add error numbers before CR_ERROR_LAST and change it accordingly. */ - - diff --git a/dep/include/mysql/m_ctype.h b/dep/include/mysql/m_ctype.h deleted file mode 100644 index ac067636b0a..00000000000 --- a/dep/include/mysql/m_ctype.h +++ /dev/null @@ -1,522 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - A better inplementation of the UNIX ctype(3) library. - Notes: my_global.h should be included before ctype.h -*/ - -#ifndef _m_ctype_h -#define _m_ctype_h - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define MY_CS_NAME_SIZE 32 -#define MY_CS_CTYPE_TABLE_SIZE 257 -#define MY_CS_TO_LOWER_TABLE_SIZE 256 -#define MY_CS_TO_UPPER_TABLE_SIZE 256 -#define MY_CS_SORT_ORDER_TABLE_SIZE 256 -#define MY_CS_TO_UNI_TABLE_SIZE 256 - -#define CHARSET_DIR "charsets/" - -#define my_wc_t ulong - -typedef struct unicase_info_st -{ - uint16 toupper; - uint16 tolower; - uint16 sort; -} MY_UNICASE_INFO; - - -extern MY_UNICASE_INFO *my_unicase_default[256]; -extern MY_UNICASE_INFO *my_unicase_turkish[256]; - - -/* wm_wc and wc_mb return codes */ -#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ -#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ -#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ -/* These following three are currently not really used */ -#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ -/* A helper macros for "need at least n bytes" */ -#define MY_CS_TOOSMALLN(n) (-100-(n)) - -#define MY_SEQ_INTTAIL 1 -#define MY_SEQ_SPACES 2 - - /* My charsets_list flags */ -#define MY_CS_COMPILED 1 /* compiled-in sets */ -#define MY_CS_CONFIG 2 /* sets that have a *.conf file */ -#define MY_CS_INDEX 4 /* sets listed in the Index file */ -#define MY_CS_LOADED 8 /* sets that are currently loaded */ -#define MY_CS_BINSORT 16 /* if binary sort order */ -#define MY_CS_PRIMARY 32 /* if primary collation */ -#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ -#define MY_CS_UNICODE 128 /* is a charset is full unicode */ -#define MY_CS_READY 256 /* if a charset is initialized */ -#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ -#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ -#define MY_CS_PUREASCII 2048 /* if a charset is pure ascii */ -#define MY_CHARSET_UNDEFINED 0 - -/* Character repertoire flags */ -#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */ -#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */ -#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */ - - -typedef struct my_uni_idx_st -{ - uint16 from; - uint16 to; - uchar *tab; -} MY_UNI_IDX; - -typedef struct -{ - uint beg; - uint end; - uint mb_len; -} my_match_t; - -enum my_lex_states -{ - MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, - MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, - MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER, - MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, - MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, - MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, - MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, - MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, - MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, - MY_LEX_IDENT_OR_KEYWORD, - MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, - MY_LEX_STRING_OR_DELIMITER -}; - -struct charset_info_st; - - -/* See strings/CHARSET_INFO.txt for information about this structure */ -typedef struct my_collation_handler_st -{ - my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); - /* Collation routines */ - int (*strnncoll)(struct charset_info_st *, - const uchar *, uint, const uchar *, uint, my_bool); - int (*strnncollsp)(struct charset_info_st *, - const uchar *, uint, const uchar *, uint, - my_bool diff_if_only_endspace_difference); - int (*strnxfrm)(struct charset_info_st *, - uchar *, uint, const uchar *, uint); - uint (*strnxfrmlen)(struct charset_info_st *, uint); - my_bool (*like_range)(struct charset_info_st *, - const char *s, uint s_length, - pchar w_prefix, pchar w_one, pchar w_many, - uint res_length, - char *min_str, char *max_str, - uint *min_len, uint *max_len); - int (*wildcmp)(struct charset_info_st *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape,int w_one, int w_many); - - int (*strcasecmp)(struct charset_info_st *, const char *, const char *); - - uint (*instr)(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, - my_match_t *match, uint nmatch); - - /* Hash calculation */ - void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, - ulong *nr1, ulong *nr2); - my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len); -} MY_COLLATION_HANDLER; - -extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; -extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; -extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; -extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; - - -/* See strings/CHARSET_INFO.txt about information on this structure */ -typedef struct my_charset_handler_st -{ - my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); - /* Multibyte routines */ - int (*ismbchar)(struct charset_info_st *, const char *, const char *); - int (*mbcharlen)(struct charset_info_st *, uint); - uint (*numchars)(struct charset_info_st *, const char *b, const char *e); - uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos); - uint (*well_formed_len)(struct charset_info_st *, - const char *b,const char *e, - uint nchars, int *error); - uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); - uint (*numcells)(struct charset_info_st *, const char *b, const char *e); - - /* Unicode convertion */ - int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc, - const unsigned char *s,const unsigned char *e); - int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc, - unsigned char *s,unsigned char *e); - - /* Functions for case and sort convertion */ - uint (*caseup_str)(struct charset_info_st *, char *); - uint (*casedn_str)(struct charset_info_st *, char *); - uint (*caseup)(struct charset_info_st *, char *src, uint srclen, - char *dst, uint dstlen); - uint (*casedn)(struct charset_info_st *, char *src, uint srclen, - char *dst, uint dstlen); - - /* Charset dependant snprintf() */ - int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, - ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); - int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix, - long int val); - int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, - int radix, longlong val); - - void (*fill)(struct charset_info_st *, char *to, uint len, int fill); - - /* String-to-number convertion routines */ - long (*strntol)(struct charset_info_st *, const char *s, uint l, - int base, char **e, int *err); - ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, - int base, char **e, int *err); - longlong (*strntoll)(struct charset_info_st *, const char *s, uint l, - int base, char **e, int *err); - ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, - int base, char **e, int *err); - double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, - int *err); - longlong (*strtoll10)(struct charset_info_st *cs, - const char *nptr, char **endptr, int *error); - ulonglong (*strntoull10rnd)(struct charset_info_st *cs, - const char *str, uint length, int unsigned_fl, - char **endptr, int *error); - ulong (*scan)(struct charset_info_st *, const char *b, const char *e, - int sq); -} MY_CHARSET_HANDLER; - -extern MY_CHARSET_HANDLER my_charset_8bit_handler; -extern MY_CHARSET_HANDLER my_charset_ucs2_handler; - - -/* See strings/CHARSET_INFO.txt about information on this structure */ -typedef struct charset_info_st -{ - uint number; - uint primary_number; - uint binary_number; - uint state; - const char *csname; - const char *name; - const char *comment; - const char *tailoring; - uchar *ctype; - uchar *to_lower; - uchar *to_upper; - uchar *sort_order; - uint16 *contractions; - uint16 **sort_order_big; - uint16 *tab_to_uni; - MY_UNI_IDX *tab_from_uni; - MY_UNICASE_INFO **caseinfo; - uchar *state_map; - uchar *ident_map; - uint strxfrm_multiply; - uchar caseup_multiply; - uchar casedn_multiply; - uint mbminlen; - uint mbmaxlen; - uint16 min_sort_char; - uint16 max_sort_char; /* For LIKE optimization */ - uchar pad_char; - my_bool escape_with_backslash_is_dangerous; - - MY_CHARSET_HANDLER *cset; - MY_COLLATION_HANDLER *coll; - -} CHARSET_INFO; - - -extern CHARSET_INFO my_charset_bin; -extern CHARSET_INFO my_charset_big5_chinese_ci; -extern CHARSET_INFO my_charset_big5_bin; -extern CHARSET_INFO my_charset_cp932_japanese_ci; -extern CHARSET_INFO my_charset_cp932_bin; -extern CHARSET_INFO my_charset_eucjpms_japanese_ci; -extern CHARSET_INFO my_charset_eucjpms_bin; -extern CHARSET_INFO my_charset_euckr_korean_ci; -extern CHARSET_INFO my_charset_euckr_bin; -extern CHARSET_INFO my_charset_gb2312_chinese_ci; -extern CHARSET_INFO my_charset_gb2312_bin; -extern CHARSET_INFO my_charset_gbk_chinese_ci; -extern CHARSET_INFO my_charset_gbk_bin; -extern CHARSET_INFO my_charset_latin1; -extern CHARSET_INFO my_charset_latin1_german2_ci; -extern CHARSET_INFO my_charset_latin1_bin; -extern CHARSET_INFO my_charset_latin2_czech_ci; -extern CHARSET_INFO my_charset_sjis_japanese_ci; -extern CHARSET_INFO my_charset_sjis_bin; -extern CHARSET_INFO my_charset_tis620_thai_ci; -extern CHARSET_INFO my_charset_tis620_bin; -extern CHARSET_INFO my_charset_ucs2_general_ci; -extern CHARSET_INFO my_charset_ucs2_bin; -extern CHARSET_INFO my_charset_ucs2_unicode_ci; -extern CHARSET_INFO my_charset_ujis_japanese_ci; -extern CHARSET_INFO my_charset_ujis_bin; -extern CHARSET_INFO my_charset_utf8_general_ci; -extern CHARSET_INFO my_charset_utf8_unicode_ci; -extern CHARSET_INFO my_charset_utf8_bin; -extern CHARSET_INFO my_charset_cp1250_czech_ci; - -/* declarations for simple charsets */ -extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, - uint); -uint my_strnxfrmlen_simple(CHARSET_INFO *, uint); -extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, - const uchar *, uint, my_bool); - -extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint, - const uchar *, uint, - my_bool diff_if_only_endspace_difference); - -extern void my_hash_sort_simple(CHARSET_INFO *cs, - const uchar *key, uint len, - ulong *nr1, ulong *nr2); - -extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length); - -extern uint my_instr_simple(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, - my_match_t *match, uint nmatch); - - -/* Functions for 8bit */ -extern uint my_caseup_str_8bit(CHARSET_INFO *, char *); -extern uint my_casedn_str_8bit(CHARSET_INFO *, char *); -extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); -extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); - -extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); - -int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); -int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); - -ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); - -int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, - const char *fmt, ...) - ATTRIBUTE_FORMAT(printf, 4, 5); - -long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base, - char **e, int *err); -ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base, - char **e, int *err); -longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base, - char **e, int *err); -ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base, - char **e, int *err); -double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e, - int *err); -int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, - long int val); -int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, - longlong val); - -longlong my_strtoll10_8bit(CHARSET_INFO *cs, - const char *nptr, char **endptr, int *error); -longlong my_strtoll10_ucs2(CHARSET_INFO *cs, - const char *nptr, char **endptr, int *error); - -ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, - const char *str, uint length, int unsigned_fl, - char **endptr, int *error); -ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, - const char *str, uint length, int unsigned_fl, - char **endptr, int *error); - -void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill); - -my_bool my_like_range_simple(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, - pbool escape, pbool w_one, pbool w_many, - uint res_length, - char *min_str, char *max_str, - uint *min_length, uint *max_length); - -my_bool my_like_range_mb(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, - pbool escape, pbool w_one, pbool w_many, - uint res_length, - char *min_str, char *max_str, - uint *min_length, uint *max_length); - -my_bool my_like_range_ucs2(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, - pbool escape, pbool w_one, pbool w_many, - uint res_length, - char *min_str, char *max_str, - uint *min_length, uint *max_length); - - -int my_wildcmp_8bit(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); - -int my_wildcmp_bin(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); - -uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); -uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); -uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, - uint pos, int *error); -int my_mbcharlen_8bit(CHARSET_INFO *, uint c); - - -/* Functions for multibyte charsets */ -extern uint my_caseup_str_mb(CHARSET_INFO *, char *); -extern uint my_casedn_str_mb(CHARSET_INFO *, char *); -extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); -extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); -extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); - -int my_wildcmp_mb(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); -uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); -uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); -uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, - uint pos, int *error); -uint my_instr_mb(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, - my_match_t *match, uint nmatch); - -int my_wildcmp_unicode(CHARSET_INFO *cs, - const char *str, const char *str_end, - const char *wildstr, const char *wildend, - int escape, int w_one, int w_many, - MY_UNICASE_INFO **weights); - -extern my_bool my_parse_charset_xml(const char *bug, uint len, - int (*add)(CHARSET_INFO *cs)); - -my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len); -my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len); - - -uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); -my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); -my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); - - -#define _MY_U 01 /* Upper case */ -#define _MY_L 02 /* Lower case */ -#define _MY_NMR 04 /* Numeral (digit) */ -#define _MY_SPC 010 /* Spacing character */ -#define _MY_PNT 020 /* Punctuation */ -#define _MY_CTR 040 /* Control character */ -#define _MY_B 0100 /* Blank */ -#define _MY_X 0200 /* heXadecimal digit */ - - -#define my_isascii(c) (!((c) & ~0177)) -#define my_toascii(c) ((c) & 0177) -#define my_tocntrl(c) ((c) & 31) -#define my_toprint(c) ((c) | 64) -#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)]) -#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)]) -#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L)) -#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U) -#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L) -#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR) -#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X) -#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR)) -#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC) -#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT) -#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B)) -#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR)) -#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR) - -/* Some macros that should be cleaned up a little */ -#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') -#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') - -#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) -#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) -#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d))) -#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) -#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ - ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j))) -#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m))) -#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b))) -#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num)) - - -#define use_mb(s) ((s)->cset->ismbchar != NULL) -#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) -#ifdef USE_MB -#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a))) -#else -#define my_mbcharlen(s, a) 1 -#endif - -#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a))) -#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a))) -#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e))) -#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e))) -#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e))) -#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e))) -#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d))) - - -/* XXX: still need to take care of this one */ -#ifdef MY_CHARSET_TIS620 -#error The TIS620 charset is broken at the moment. Tell tim to fix it. -#define USE_TIS620 -#include "t_ctype.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _m_ctype_h */ - diff --git a/dep/include/mysql/m_string.h b/dep/include/mysql/m_string.h deleted file mode 100644 index 445ba18bf41..00000000000 --- a/dep/include/mysql/m_string.h +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* There may be prolems include all of theese. Try to test in - configure with ones are needed? */ - -/* This is needed for the definitions of strchr... on solaris */ - -#ifndef _m_string_h -#define _m_string_h -#ifndef __USE_GNU -#define __USE_GNU /* We want to use stpcpy */ -#endif -#if defined(HAVE_STRINGS_H) -#include -#endif -#if defined(HAVE_STRING_H) -#include -#endif - -/* need by my_vsnprintf */ -#include - -/* Correct some things for UNIXWARE7 */ -#ifdef HAVE_UNIXWARE7_THREADS -#undef HAVE_STRINGS_H -#undef HAVE_MEMORY_H -#define HAVE_MEMCPY -#ifndef HAVE_MEMMOVE -#define HAVE_MEMMOVE -#endif -#undef HAVE_BCMP -#undef bcopy -#undef bcmp -#undef bzero -#endif /* HAVE_UNIXWARE7_THREADS */ -#ifdef _AIX -#undef HAVE_BCMP -#endif - -/* This is needed for the definitions of bzero... on solaris */ -#if defined(HAVE_STRINGS_H) && !defined(HAVE_mit_thread) -#include -#endif - -/* This is needed for the definitions of memcpy... on solaris */ -#if defined(HAVE_MEMORY_H) && !defined(__cplusplus) -#include -#endif - -#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# define memset(A,C,B) bfill((A),(B),(C)) -# define memmove(d, s, n) bmove ((d), (s), (n)) -#elif defined(HAVE_MEMMOVE) -# define bmove(d, s, n) memmove((d), (s), (n)) -#else -# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */ -#endif - -/* Unixware 7 */ -#if !defined(HAVE_BFILL) -# define bfill(A,B,C) memset((A),(C),(B)) -# define bmove_align(A,B,C) memcpy((A),(B),(C)) -#endif - -#if !defined(HAVE_BCMP) -# define bcopy(s, d, n) memcpy((d), (s), (n)) -# define bcmp(A,B,C) memcmp((A),(B),(C)) -# define bzero(A,B) memset((A),0,(B)) -# define bmove_align(A,B,C) memcpy((A),(B),(C)) -#endif - -#if defined(__cplusplus) && !defined(OS2) -extern "C" { -#endif - -/* - my_str_malloc() and my_str_free() are assigned to implementations in - strings/alloc.c, but can be overridden in the calling program. - */ -extern void *(*my_str_malloc)(size_t); -extern void (*my_str_free)(void *); - -#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread) -#define strmov(A,B) stpcpy((A),(B)) -#ifndef stpcpy -extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ -#endif -#endif - -/* Declared in int2str() */ -extern char NEAR _dig_vec_upper[]; -extern char NEAR _dig_vec_lower[]; - -/* Defined in strtod.c */ -extern const double log_10[309]; - -#ifdef BAD_STRING_COMPILER -#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) -#else -#define strmov_overlapp(A,B) strmov(A,B) -#define strmake_overlapp(A,B,C) strmake(A,B,C) -#endif - -#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */ -#define memcpy_fixed(A,B,C) bmove((A),(B),(C)) -#else -#define memcpy_fixed(A,B,C) memcpy((A),(B),(C)) -#endif - -#ifdef MSDOS -#undef bmove_align -#define bmove512(A,B,C) bmove_align(A,B,C) -extern void bmove_align(gptr dst,const gptr src,uint len); -#endif - -#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512) -#define bmove512(A,B,C) memcpy(A,B,C) -#endif - - /* Prototypes for string functions */ - -#if !defined(bfill) && !defined(HAVE_BFILL) -extern void bfill(gptr dst,uint len,pchar fill); -#endif - -#if !defined(bzero) && !defined(HAVE_BZERO) -extern void bzero(gptr dst,uint len); -#endif - -#if !defined(bcmp) && !defined(HAVE_BCMP) -extern int bcmp(const char *s1,const char *s2,uint len); -#endif -#ifdef HAVE_purify -extern int my_bcmp(const char *s1,const char *s2,uint len); -#undef bcmp -#define bcmp(A,B,C) my_bcmp((A),(B),(C)) -#endif - -#ifndef bmove512 -extern void bmove512(gptr dst,const gptr src,uint len); -#endif - -#if !defined(HAVE_BMOVE) && !defined(bmove) -extern void bmove(char *dst, const char *src,uint len); -#endif - -extern void bmove_upp(char *dst,const char *src,uint len); -extern void bchange(char *dst,uint old_len,const char *src, - uint new_len,uint tot_len); -extern void strappend(char *s,uint len,pchar fill); -extern char *strend(const char *s); -extern char *strcend(const char *, pchar); -extern char *strfield(char *src,int fields,int chars,int blanks, - int tabch); -extern char *strfill(my_string s,uint len,pchar fill); -extern uint strinstr(const char *str,const char *search); -extern uint r_strinstr(reg1 my_string str,int from, reg4 my_string search); -extern char *strkey(char *dst,char *head,char *tail,char *flags); -extern char *strmake(char *dst,const char *src,uint length); -#ifndef strmake_overlapp -extern char *strmake_overlapp(char *dst,const char *src, uint length); -#endif - -#ifndef strmov -extern char *strmov(char *dst,const char *src); -#endif -extern char *strnmov(char *dst,const char *src,uint n); -extern char *strsuff(const char *src,const char *suffix); -extern char *strcont(const char *src,const char *set); -extern char *strxcat _VARARGS((char *dst,const char *src, ...)); -extern char *strxmov _VARARGS((char *dst,const char *src, ...)); -extern char *strxcpy _VARARGS((char *dst,const char *src, ...)); -extern char *strxncat _VARARGS((char *dst,uint len, const char *src, ...)); -extern char *strxnmov _VARARGS((char *dst,uint len, const char *src, ...)); -extern char *strxncpy _VARARGS((char *dst,uint len, const char *src, ...)); - -/* Prototypes of normal stringfunctions (with may ours) */ - -#ifdef WANT_STRING_PROTOTYPES -extern char *strcat(char *, const char *); -extern char *strchr(const char *, pchar); -extern char *strrchr(const char *, pchar); -extern char *strcpy(char *, const char *); -extern int strcmp(const char *, const char *); -#ifndef __GNUC__ -extern size_t strlen(const char *); -#endif -#endif -#ifndef HAVE_STRNLEN -extern uint strnlen(const char *s, uint n); -#endif - -#if !defined(__cplusplus) -#ifndef HAVE_STRPBRK -extern char *strpbrk(const char *, const char *); -#endif -#ifndef HAVE_STRSTR -extern char *strstr(const char *, const char *); -#endif -#endif -extern int is_prefix(const char *, const char *); - -/* Conversion routines */ -double my_strtod(const char *str, char **end, int *error); -double my_atof(const char *nptr); - -extern char *llstr(longlong value,char *buff); -extern char *ullstr(longlong value,char *buff); -#ifndef HAVE_STRTOUL -extern long strtol(const char *str, char **ptr, int base); -extern ulong strtoul(const char *str, char **ptr, int base); -#endif - -extern char *int2str(long val, char *dst, int radix, int upcase); -extern char *int10_to_str(long val,char *dst,int radix); -extern char *str2int(const char *src,int radix,long lower,long upper, - long *val); -longlong my_strtoll10(const char *nptr, char **endptr, int *error); -#if SIZEOF_LONG == SIZEOF_LONG_LONG -#define longlong2str(A,B,C) int2str((A),(B),(C),1) -#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) -#undef strtoll -#define strtoll(A,B,C) strtol((A),(B),(C)) -#define strtoull(A,B,C) strtoul((A),(B),(C)) -#ifndef HAVE_STRTOULL -#define HAVE_STRTOULL -#endif -#ifndef HAVE_STRTOLL -#define HAVE_STRTOLL -#endif -#else -#ifdef HAVE_LONG_LONG -extern char *longlong2str(longlong val,char *dst,int radix); -extern char *longlong10_to_str(longlong val,char *dst,int radix); -#if (!defined(HAVE_STRTOULL) || defined(HAVE_mit_thread)) || defined(NO_STRTOLL_PROTO) -extern longlong strtoll(const char *str, char **ptr, int base); -extern ulonglong strtoull(const char *str, char **ptr, int base); -#endif -#endif -#endif - -/* my_vsnprintf.c */ - -extern int my_vsnprintf( char *str, size_t n, - const char *format, va_list ap ); -extern int my_snprintf(char *to, size_t n, const char *fmt, ...) - ATTRIBUTE_FORMAT(printf, 3, 4); - -#if defined(__cplusplus) && !defined(OS2) -} -#endif -#endif - diff --git a/dep/include/mysql/my_alloc.h b/dep/include/mysql/my_alloc.h deleted file mode 100644 index ac56c97456c..00000000000 --- a/dep/include/mysql/my_alloc.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - Data structures for mysys/my_alloc.c (root memory allocator) -*/ - -#ifndef _my_alloc_h -#define _my_alloc_h - -#define ALLOC_MAX_BLOCK_TO_DROP 4096 -#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 - -typedef struct st_used_mem -{ /* struct for once_alloc (block) */ - struct st_used_mem *next; /* Next block in use */ - unsigned int left; /* memory left in block */ - unsigned int size; /* size of block */ -} USED_MEM; - - -typedef struct st_mem_root -{ - USED_MEM *free; /* blocks with free memory in it */ - USED_MEM *used; /* blocks almost without free memory */ - USED_MEM *pre_alloc; /* preallocated block */ - /* if block have less memory it will be put in 'used' list */ - unsigned int min_malloc; - unsigned int block_size; /* initial block size */ - unsigned int block_num; /* allocated blocks counter */ - /* - first free block in queue test counter (if it exceed - MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) - */ - unsigned int first_block_usage; - - void (*error_handler)(void); -} MEM_ROOT; -#endif - diff --git a/dep/include/mysql/my_dbug.h b/dep/include/mysql/my_dbug.h deleted file mode 100644 index 68088e1cc8d..00000000000 --- a/dep/include/mysql/my_dbug.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _dbug_h -#define _dbug_h - -#ifdef __cplusplus -extern "C" { -#endif -#if !defined(DBUG_OFF) && !defined(_lint) -extern int _db_on_,_no_db_; -extern FILE *_db_fp_; -extern char *_db_process_; -extern int _db_keyword_(const char *keyword); -extern int _db_strict_keyword_(const char *keyword); -extern void _db_setjmp_(void); -extern void _db_longjmp_(void); -extern void _db_push_(const char *control); -extern void _db_pop_(void); -extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, - const char **_sfunc_,const char **_sfile_, - uint *_slevel_, char ***); -extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_, - uint *_slevel_); -extern void _db_pargs_(uint _line_,const char *keyword); -extern void _db_doprnt_ _VARARGS((const char *format,...)) - ATTRIBUTE_FORMAT(printf, 1, 2); -extern void _db_dump_(uint _line_,const char *keyword,const char *memory, - uint length); -extern void _db_output_(uint flag); -extern void _db_end_(void); -extern void _db_lock_file(void); -extern void _db_unlock_file(void); - -#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \ - char **_db_framep_; \ - _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ - &_db_framep_) -#define DBUG_LEAVE \ - (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)) -#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} -#define DBUG_VOID_RETURN {DBUG_LEAVE; return;} -#define DBUG_EXECUTE(keyword,a1) \ - {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} -#define DBUG_PRINT(keyword,arglist) \ - {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} -#define DBUG_PUSH(a1) _db_push_ (a1) -#define DBUG_POP() _db_pop_ () -#define DBUG_PROCESS(a1) (_db_process_ = a1) -#define DBUG_FILE (_db_fp_) -#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) -#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) -#define DBUG_DUMP(keyword,a1,a2)\ - {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} -#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr) -#define DEBUGGER_OFF _no_db_=1;_db_on_=0; -#define DEBUGGER_ON _no_db_=0 -#define DBUG_END() _db_end_ () -#define DBUG_LOCK_FILE { _db_lock_file(); } -#define DBUG_UNLOCK_FILE { _db_unlock_file(); } -#define DBUG_OUTPUT(A) { _db_output_(A); } -#define DBUG_ASSERT(A) assert(A) -#define DBUG_EXECUTE_IF(keyword,a1) \ - {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}} -#define IF_DBUG(A) A -#else /* No debugger */ - -#define DBUG_ENTER(a1) -#define DBUG_RETURN(a1) return(a1) -#define DBUG_VOID_RETURN return -#define DBUG_EXECUTE(keyword,a1) {} -#define DBUG_EXECUTE_IF(keyword,a1) {} -#define DBUG_PRINT(keyword,arglist) {} -#define DBUG_PUSH(a1) {} -#define DBUG_POP() {} -#define DBUG_PROCESS(a1) {} -#define DBUG_FILE (stderr) -#define DBUG_SETJMP setjmp -#define DBUG_LONGJMP longjmp -#define DBUG_DUMP(keyword,a1,a2) {} -#define DBUG_IN_USE 0 -#define DEBUGGER_OFF -#define DEBUGGER_ON -#define DBUG_END() -#define DBUG_LOCK_FILE -#define DBUG_UNLOCK_FILE -#define DBUG_OUTPUT(A) -#define DBUG_ASSERT(A) {} -#define DBUG_LEAVE -#define IF_DBUG(A) -#endif -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/mysql/my_getopt.h b/dep/include/mysql/my_getopt.h deleted file mode 100644 index d5b6ae9e3fe..00000000000 --- a/dep/include/mysql/my_getopt.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 2002-2004 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _my_getopt_h -#define _my_getopt_h - -C_MODE_START - -#define GET_NO_ARG 1 -#define GET_BOOL 2 -#define GET_INT 3 -#define GET_UINT 4 -#define GET_LONG 5 -#define GET_ULONG 6 -#define GET_LL 7 -#define GET_ULL 8 -#define GET_STR 9 -#define GET_STR_ALLOC 10 -#define GET_DISABLED 11 - -#define GET_ASK_ADDR 128 -#define GET_TYPE_MASK 127 - -enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG }; - -struct my_option -{ - const char *name; /* Name of the option */ - int id; /* unique id or short option */ - const char *comment; /* option comment, for autom. --help */ - gptr *value; /* The variable value */ - gptr *u_max_value; /* The user def. max variable value */ - const char **str_values; /* Pointer to possible values */ - ulong var_type; - enum get_opt_arg_type arg_type; - longlong def_value; /* Default value */ - longlong min_value; /* Min allowed value */ - longlong max_value; /* Max allowed value */ - longlong sub_size; /* Subtract this from given value */ - long block_size; /* Value should be a mult. of this */ - int app_type; /* To be used by an application */ -}; - -typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * ); -typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... ); - -extern char *disabled_my_option; -extern my_bool my_getopt_print_errors; -extern my_error_reporter my_getopt_error_reporter; - -extern int handle_options (int *argc, char ***argv, - const struct my_option *longopts, my_get_one_option); -extern void my_print_help(const struct my_option *options); -extern void my_print_variables(const struct my_option *options); -extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint, - const struct my_option *)); - -ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - bool *fixed); -my_bool getopt_compare_strings(const char *s, const char *t, uint length); - -C_MODE_END - -#endif /* _my_getopt_h */ - - diff --git a/dep/include/mysql/my_global.h b/dep/include/mysql/my_global.h deleted file mode 100644 index 02bbd30e34a..00000000000 --- a/dep/include/mysql/my_global.h +++ /dev/null @@ -1,1355 +0,0 @@ -/* Copyright (C) 2000-2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* This is the include file that should be included 'first' in every C file. */ - -#ifndef _global_h -#define _global_h - -#ifndef EMBEDDED_LIBRARY -#define HAVE_REPLICATION -#define HAVE_EXTERNAL_CLIENT -#endif - -#if defined( __EMX__) && !defined( MYSQL_SERVER) -/* moved here to use below VOID macro redefinition */ -#define INCL_BASE -#define INCL_NOPMAPI -#include -#endif /* __EMX__ */ - -#ifdef __CYGWIN__ -/* We use a Unix API, so pretend it's not Windows */ -#undef WIN -#undef WIN32 -#undef _WIN -#undef _WIN32 -#undef _WIN64 -#undef __WIN__ -#undef __WIN32__ -#define HAVE_ERRNO_AS_DEFINE -#endif /* __CYGWIN__ */ - -#if defined(__QNXNTO__) && !defined(FD_SETSIZE) -#define FD_SETSIZE 1024 /* Max number of file descriptor bits in - fd_set, used when calling 'select' - Must be defined before including - "sys/select.h" and "sys/time.h" - */ -#endif - - -/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#define USE_PRAGMA_INTERFACE -#endif - -#if defined(i386) && !defined(__i386__) -#define __i386__ -#endif - -/* Macros to make switching between C and C++ mode easier */ -#ifdef __cplusplus -#define C_MODE_START extern "C" { -#define C_MODE_END } -#else -#define C_MODE_START -#define C_MODE_END -#endif - -#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) -#include -#elif defined(OS2) -#include -#elif defined(__NETWARE__) -#include -#include -#if defined(__cplusplus) && defined(inline) -#undef inline /* fix configure problem */ -#endif -#else -#include -#if defined(__cplusplus) && defined(inline) -#undef inline /* fix configure problem */ -#endif -#endif /* _WIN32... */ - -/* Make it easier to add conditionl code for windows */ -#ifdef __WIN__ -#define IF_WIN(A,B) (A) -#else -#define IF_WIN(A,B) (B) -#endif - - -/* Some defines to avoid ifdefs in the code */ -#ifndef NETWARE_YIELD -#define NETWARE_YIELD -#define NETWARE_SET_SCREEN_MODE(A) -#endif - -/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */ -#if defined(_AIX) && defined(_LARGE_FILE_API) -#undef _LARGE_FILE_API -#endif - -/* - The macros below are used to allow build of Universal/fat binaries of - MySQL and MySQL applications under darwin. -*/ -#if defined(__APPLE__) && defined(__MACH__) -# undef SIZEOF_CHARP -# undef SIZEOF_SHORT -# undef SIZEOF_INT -# undef SIZEOF_LONG -# undef SIZEOF_LONG_LONG -# undef SIZEOF_OFF_T -# undef WORDS_BIGENDIAN -# define SIZEOF_SHORT 2 -# define SIZEOF_INT 4 -# define SIZEOF_LONG_LONG 8 -# define SIZEOF_OFF_T 8 -# if defined(__i386__) || defined(__ppc__) -# define SIZEOF_CHARP 4 -# define SIZEOF_LONG 4 -# elif defined(__x86_64__) || defined(__ppc64__) -# define SIZEOF_CHARP 8 -# define SIZEOF_LONG 8 -# else -# error Building FAT binary for an unknown architecture. -# endif -# if defined(__ppc__) || defined(__ppc64__) -# define WORDS_BIGENDIAN -# endif -#endif /* defined(__APPLE__) && defined(__MACH__) */ - - -/* - The macros below are borrowed from include/linux/compiler.h in the - Linux kernel. Use them to indicate the likelyhood of the truthfulness - of a condition. This serves two purposes - newer versions of gcc will be - able to optimize for branch predication, which could yield siginficant - performance gains in frequently executed sections of the code, and the - other reason to use them is for documentation -*/ - -#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) -#define __builtin_expect(x, expected_value) (x) -#endif - -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) - - -/* Fix problem with S_ISLNK() on Linux */ -#if defined(TARGET_OS_LINUX) || defined(__GLIBC__) -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - -/* - Temporary solution to solve bug#7156. Include "sys/types.h" before - the thread headers, else the function madvise() will not be defined -*/ -#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) ) -#include -#endif - -/* The client defines this to avoid all thread code */ -#if defined(UNDEF_THREADS_HACK) -#undef THREAD -#undef HAVE_mit_thread -#undef HAVE_LINUXTHREADS -#undef HAVE_NPTL -#undef HAVE_UNIXWARE7_THREADS -#endif - -#ifdef HAVE_THREADS_WITHOUT_SOCKETS -/* MIT pthreads does not work with unix sockets */ -#undef HAVE_SYS_UN_H -#endif - -#define __EXTENSIONS__ 1 /* We want some extension */ -#ifndef __STDC_EXT__ -#define __STDC_EXT__ 1 /* To get large file support on hpux */ -#endif - -/* - Solaris 9 include file refers to X/Open document - - System Interfaces and Headers, Issue 5 - - saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes, - but apparently other systems (namely FreeBSD) don't agree. - - On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600. - Furthermore, it tests that if a program requires older standard - (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be - run on a new compiler (that defines _STDC_C99) and issues an #error. - It's also an #error if a program requires new standard (_XOPEN_SOURCE=600 - or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99. - - To add more to this mess, Sun Studio C compiler defines _STDC_C99 while - C++ compiler does not! - - So, in a desperate attempt to get correct prototypes for both - C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500 - depending on the compiler's announced C standard support. - - Cleaner solutions are welcome. -*/ -#ifdef __sun -#if __STDC_VERSION__ - 0 >= 199901L -#define _XOPEN_SOURCE 600 -#else -#define _XOPEN_SOURCE 500 -#endif -#endif - -#if defined(THREAD) && !defined(__WIN__) && !defined(OS2) -#ifndef _POSIX_PTHREAD_SEMANTICS -#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ -#endif - -#if !defined(SCO) -#define _REENTRANT 1 /* Some thread libraries require this */ -#endif -#if !defined(_THREAD_SAFE) && !defined(_AIX) -#define _THREAD_SAFE /* Required for OSF1 */ -#endif -#ifndef HAVE_mit_thread -#ifdef HAVE_UNIXWARE7_THREADS -#include -#else -#if defined(HPUX10) || defined(HPUX11) -C_MODE_START /* HPUX needs this, signal.h bug */ -#include -C_MODE_END -#else -#include /* AIX must have this included first */ -#endif -#endif /* HAVE_UNIXWARE7_THREADS */ -#endif /* HAVE_mit_thread */ -#if !defined(SCO) && !defined(_REENTRANT) -#define _REENTRANT 1 /* Threads requires reentrant code */ -#endif -#endif /* THREAD */ - -/* Go around some bugs in different OS and compilers */ -#ifdef _AIX /* By soren@t.dk */ -#define _H_STRINGS -#define _SYS_STREAM_H -/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ -#define ulonglong2double(A) my_ulonglong2double(A) -#define my_off_t2double(A) my_ulonglong2double(A) -C_MODE_START -double my_ulonglong2double(unsigned long long A); -C_MODE_END -#endif /* _AIX */ - -#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ -#undef HAVE_SNPRINTF -#endif -#ifdef HAVE_BROKEN_PREAD -/* - pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without - installing the kernel patch PHKL_20349 or greater -*/ -#undef HAVE_PREAD -#undef HAVE_PWRITE -#endif -#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus) -#undef inline -#define inline -#endif - -#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ -#undef HAVE_GETHOSTBYNAME_R -#endif -#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ -#undef HAVE_INITGROUPS -#endif - -/* gcc/egcs issues */ - -#if defined(__GNUC) && defined(__EXCEPTIONS) -#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" -#endif - - -/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ -#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8) -#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */ -#define __LONG_MAX__ 2147483647 -#endif - -/* egcs 1.1.2 has a problem with memcpy on Alpha */ -#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -#define BAD_MEMCPY -#endif - -#if defined(_lint) && !defined(lint) -#define lint -#endif -#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) -#define _LONG_LONG 1 /* For AIX string library */ -#endif - -#ifndef stdin -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDDEF_H -#include -#endif - -#include -#ifdef HAVE_LIMITS_H -#include -#endif -#ifdef HAVE_FLOAT_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SYS_TIMEB_H -#include /* Avoid warnings on SCO */ -#endif -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif /* TIME_WITH_SYS_TIME */ -#ifdef HAVE_UNISTD_H -#include -#endif -#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA) -#undef HAVE_ALLOCA -#undef HAVE_ALLOCA_H -#endif -#ifdef HAVE_ALLOCA_H -#include -#endif -#ifdef HAVE_ATOMIC_ADD -#define new my_arg_new -#define need_to_restore_new 1 -C_MODE_START -#include -C_MODE_END -#ifdef need_to_restore_new /* probably safer than #ifdef new */ -#undef new -#undef need_to_restore_new -#endif -#endif -#include /* Recommended by debian */ -/* We need the following to go around a problem with openssl on solaris */ -#if defined(HAVE_CRYPT_H) -#include -#endif - -/* - A lot of our programs uses asserts, so better to always include it - This also fixes a problem when people uses DBUG_ASSERT without including - assert.h -*/ -#include - -/* Go around some bugs in different OS and compilers */ -#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) -#include /* HPUX 10.20 defines ulong here. UGLY !!! */ -#define HAVE_ULONG -#endif -#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */ -#undef HAVE_FINITE -#endif -#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) -/* Fix bug in setrlimit */ -#undef setrlimit -#define setrlimit cma_setrlimit64 -#endif -/* Declare madvise where it is not declared for C++, like Solaris */ -#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus) -extern "C" int madvise(void *addr, size_t len, int behav); -#endif - -#ifdef __QNXNTO__ -/* This has to be after include limits.h */ -#define HAVE_ERRNO_AS_DEFINE -#define HAVE_FCNTL_LOCK -#undef HAVE_FINITE -#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ -#undef LONGLONG_MAX /* standard system library 'limits.h' */ -#ifdef __cplusplus -#ifndef HAVE_RINT -#define HAVE_RINT -#endif /* rint() and isnan() functions are not */ -#define rint(a) std::rint(a) /* visible in C++ scope due to an error */ -#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */ -#endif -#endif - -/* We can not live without the following defines */ - -#define USE_MYFUNC 1 /* Must use syscall indirection */ -#define MASTER 1 /* Compile without unireg */ -#define ENGLISH 1 /* Messages in English */ -#define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */ -#define USE_REGEX 1 /* We want the use the regex library */ -/* Do not define for ultra sparcs */ -#ifndef OS2 -#define USE_BMOVE512 1 /* Use this unless system bmove is faster */ -#endif - -#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ -#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ - -/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ -#ifdef I_AM_PARANOID -#define DONT_ALLOW_USER_CHANGE 1 -#define DONT_USE_MYSQL_PWD 1 -#endif - -/* Does the system remember a signal handler after a signal ? */ -#ifndef HAVE_BSD_SIGNALS -#define DONT_REMEMBER_SIGNAL -#endif - -/* Define void to stop lint from generating "null effekt" comments */ -#ifndef DONT_DEFINE_VOID -#ifdef _lint -int __void__; -#define VOID(X) (__void__ = (int) (X)) -#else -#undef VOID -#define VOID(X) (X) -#endif -#endif /* DONT_DEFINE_VOID */ - -#if defined(_lint) || defined(FORCE_INIT_OF_VARS) -#define LINT_INIT(var) var=0 /* No uninitialize-warning */ -#else -#define LINT_INIT(var) -#endif - -#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify) -#define PURIFY_OR_LINT_INIT(var) var=0 -#else -#define PURIFY_OR_LINT_INIT(var) -#endif - -/* Define some useful general macros */ -#if !defined(max) -#define max(a, b) ((a) > (b) ? (a) : (b)) -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#if defined(__EMX__) || !defined(HAVE_UINT) -#undef HAVE_UINT -#define HAVE_UINT -typedef unsigned int uint; -typedef unsigned short ushort; -#endif - -#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) -#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; } -#define test(a) ((a) ? 1 : 0) -#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) -#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) -#define test_all_bits(a,b) (((a) & (b)) == (b)) -#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) -#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) -#ifndef HAVE_RINT -#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5)) -#endif - -/* Define some general constants */ -#ifndef TRUE -#define TRUE (1) /* Logical true */ -#define FALSE (0) /* Logical false */ -#endif - -#if defined(__GNUC__) -#define function_volatile volatile -#define my_reinterpret_cast(A) reinterpret_cast -#define my_const_cast(A) const_cast -# ifndef GCC_VERSION -# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -# endif -#elif !defined(my_reinterpret_cast) -#define my_reinterpret_cast(A) (A) -#define my_const_cast(A) (A) -#endif - -#include - -/* - Wen using the embedded library, users might run into link problems, - duplicate declaration of __cxa_pure_virtual, solved by declaring it a - weak symbol. -*/ -#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL) -C_MODE_START -int __cxa_pure_virtual () __attribute__ ((weak)); -C_MODE_END -#endif - -/* From old s-system.h */ - -/* - Support macros for non ansi & other old compilers. Since such - things are no longer supported we do nothing. We keep then since - some of our code may still be needed to upgrade old customers. -*/ -#define _VARARGS(X) X -#define _STATIC_VARARGS(X) X -#define _PC(X) X - -#if defined(DBUG_ON) && defined(DBUG_OFF) -#undef DBUG_OFF -#endif - -#if defined(_lint) && !defined(DBUG_OFF) -#define DBUG_OFF -#endif - -#include - -#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ -#define ASCII_BITS_USED 8 /* Bit char used */ -#define NEAR_F /* No near function handling */ - -/* Some types that is different between systems */ - -typedef int File; /* File descriptor */ -#ifndef Socket_defined -typedef int my_socket; /* File descriptor for sockets */ -#define INVALID_SOCKET -1 -#endif -/* Type for fuctions that handles signals */ -#define sig_handler RETSIGTYPE -C_MODE_START -typedef void (*sig_return)();/* Returns type from signal */ -C_MODE_END -#if defined(__GNUC__) && !defined(_lint) -typedef char pchar; /* Mixed prototypes can take char */ -typedef char puchar; /* Mixed prototypes can take char */ -typedef char pbool; /* Mixed prototypes can take char */ -typedef short pshort; /* Mixed prototypes can take short int */ -typedef float pfloat; /* Mixed prototypes can take float */ -#else -typedef int pchar; /* Mixed prototypes can't take char */ -typedef uint puchar; /* Mixed prototypes can't take char */ -typedef int pbool; /* Mixed prototypes can't take char */ -typedef int pshort; /* Mixed prototypes can't take short int */ -typedef double pfloat; /* Mixed prototypes can't take float */ -#endif -C_MODE_START -typedef int (*qsort_cmp)(const void *,const void *); -typedef int (*qsort_cmp2)(void*, const void *,const void *); -C_MODE_END -#ifdef HAVE_mit_thread -#define qsort_t void -#undef QSORT_TYPE_IS_VOID -#define QSORT_TYPE_IS_VOID -#else -#define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ -#endif -#ifdef HAVE_mit_thread -#define size_socket socklen_t /* Type of last arg to accept */ -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -typedef SOCKET_SIZE_TYPE size_socket; -#endif - -#ifndef SOCKOPT_OPTLEN_TYPE -#define SOCKOPT_OPTLEN_TYPE size_socket -#endif - -/* file create flags */ - -#ifndef O_SHARE /* Probably not windows */ -#define O_SHARE 0 /* Flag to my_open for shared files */ -#ifndef O_BINARY -#define O_BINARY 0 /* Flag to my_open for binary files */ -#endif -#ifndef FILE_BINARY -#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */ -#endif -#ifdef HAVE_FCNTL -#define HAVE_FCNTL_LOCK -#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */ -#endif -#endif /* O_SHARE */ - -#ifndef O_TEMPORARY -#define O_TEMPORARY 0 -#endif -#ifndef O_SHORT_LIVED -#define O_SHORT_LIVED 0 -#endif -#ifndef O_NOFOLLOW -#define O_NOFOLLOW 0 -#endif - -/* additional file share flags for win32 */ -#ifdef __WIN__ -#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */ -#define _SH_DENYWRD 0x120 /* deny write mode & delete */ -#define _SH_DENYRDD 0x130 /* deny read mode & delete */ -#define _SH_DENYDEL 0x140 /* deny delete only */ -#endif /* __WIN__ */ - - -/* #define USE_RECORD_LOCK */ - - /* Unsigned types supported by the compiler */ -#define UNSINT8 /* unsigned int8 (char) */ -#define UNSINT16 /* unsigned int16 */ -#define UNSINT32 /* unsigned int32 */ - - /* General constants */ -#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */ -#define FN_LEN 256 /* Max file name len */ -#define FN_HEADLEN 253 /* Max length of filepart of file name */ -#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ -#define FN_REFLEN 512 /* Max length of full path-name */ -#define FN_EXTCHAR '.' -#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ -#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ -#define FN_PARENTDIR ".." /* Parent directory; Must be a string */ - -#ifndef FN_LIBCHAR -#ifdef __EMX__ -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#else -#define FN_LIBCHAR '/' -#define FN_ROOTDIR "/" -#endif -#endif -#define MY_NFILE 64 /* This is only used to save filenames */ -#ifndef OS_FILE_LIMIT -#define OS_FILE_LIMIT 65535 -#endif - -/* #define EXT_IN_LIBNAME */ -/* #define FN_NO_CASE_SENCE */ -/* #define FN_UPPER_CASE TRUE */ - -/* - Io buffer size; Must be a power of 2 and a multiple of 512. May be - smaller what the disk page size. This influences the speed of the - isam btree library. eg to big to slow. -*/ -#define IO_SIZE 4096 -/* - How much overhead does malloc have. The code often allocates - something like 1024-MALLOC_OVERHEAD bytes -*/ -#ifdef SAFEMALLOC -#define MALLOC_OVERHEAD (8+24+4) -#else -#define MALLOC_OVERHEAD 8 -#endif - /* get memory in huncs */ -#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) - /* Typical record cash */ -#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) - /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD) - /* Default size of a key cache block */ -#define KEY_CACHE_BLOCK_SIZE (uint) 1024 - - - /* Some things that this system doesn't have */ - -#define NO_HASH /* Not needed anymore */ -#ifdef __WIN__ -#define NO_DIR_LIBRARY /* Not standar dir-library */ -#define USE_MY_STAT_STRUCT /* For my_lib */ -#endif - -/* Some defines of functions for portability */ - -#undef remove /* Crashes MySQL on SCO 5.0.0 */ -#ifndef __WIN__ -#ifdef OS2 -#define closesocket(A) soclose(A) -#else -#define closesocket(A) close(A) -#endif -#ifndef ulonglong2double -#define ulonglong2double(A) ((double) (ulonglong) (A)) -#define my_off_t2double(A) ((double) (my_off_t) (A)) -#endif -#endif - -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif -#define ulong_to_double(X) ((double) (ulong) (X)) -#define SET_STACK_SIZE(X) /* Not needed on real machines */ - -#if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R) -#define strtok_r(A,B,C) strtok((A),(B)) -#endif - -/* Remove some things that mit_thread break or doesn't support */ -#if defined(HAVE_mit_thread) && defined(THREAD) -#undef HAVE_PREAD -#undef HAVE_REALPATH -#undef HAVE_MLOCK -#undef HAVE_TEMPNAM /* Use ours */ -#undef HAVE_PTHREAD_SETPRIO -#undef HAVE_FTRUNCATE -#undef HAVE_READLINK -#endif - -/* This is from the old m-machine.h file */ - -#if SIZEOF_LONG_LONG > 4 -#define HAVE_LONG_LONG 1 -#endif - -/* - Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define - ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined. - Also on Windows we define these constants by hand in config-win.h. -*/ - -#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) -#define LONGLONG_MIN ((long long) 0x8000000000000000LL) -#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) -#endif - -#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX) -/* First check for ANSI C99 definition: */ -#ifdef ULLONG_MAX -#define ULONGLONG_MAX ULLONG_MAX -#else -#define ULONGLONG_MAX ((unsigned long long)(~0ULL)) -#endif -#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/ - -#define INT_MIN32 (~0x7FFFFFFFL) -#define INT_MAX32 0x7FFFFFFFL -#define UINT_MAX32 0xFFFFFFFFL -#define INT_MIN24 (~0x007FFFFF) -#define INT_MAX24 0x007FFFFF -#define UINT_MAX24 0x00FFFFFF -#define INT_MIN16 (~0x7FFF) -#define INT_MAX16 0x7FFF -#define UINT_MAX16 0xFFFF -#define INT_MIN8 (~0x7F) -#define INT_MAX8 0x7F -#define UINT_MAX8 0xFF - -/* From limits.h instead */ -#ifndef DBL_MIN -#define DBL_MIN 4.94065645841246544e-324 -#define FLT_MIN ((float)1.40129846432481707e-45) -#endif -#ifndef DBL_MAX -#define DBL_MAX 1.79769313486231470e+308 -#define FLT_MAX ((float)3.40282346638528860e+38) -#endif - -#ifndef HAVE_FINITE -#define finite(x) (1.0 / fabs(x) > 0.0) -#endif - -#ifndef HAVE_ISNAN -#define isnan(x) ((x) != (x)) -#endif - -#ifdef HAVE_ISINF -/* isinf() can be used in both C and C++ code */ -#define my_isinf(X) isinf(X) -#else -#define my_isinf(X) (!finite(X) && !isnan(X)) -#endif - -/* Define missing math constants. */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -#ifndef M_E -#define M_E 2.7182818284590452354 -#endif -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#endif - -/* - Max size that must be added to a so that we know Size to make - adressable obj. -*/ -#if SIZEOF_CHARP == 4 -typedef long my_ptrdiff_t; -#else -typedef long long my_ptrdiff_t; -#endif - -#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) -#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) -/* Size to make adressable obj. */ -#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t))) - /* Offset of field f in structure t */ -#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) -#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) -#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) - -/* - Custom version of standard offsetof() macro which can be used to get - offsets of members in class for non-POD types (according to the current - version of C++ standard offsetof() macro can't be used in such cases and - attempt to do so causes warnings to be emitted, OTOH in many cases it is - still OK to assume that all instances of the class has the same offsets - for the same members). - - This is temporary solution which should be removed once File_parser class - and related routines are refactored. -*/ - -#define my_offsetof(TYPE, MEMBER) \ - ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) - -#define NullS (char *) 0 -/* Nowdays we do not support MessyDos */ -#ifndef NEAR -#define NEAR /* Who needs segments ? */ -#define FAR /* On a good machine */ -#ifndef HUGE_PTR -#define HUGE_PTR -#endif -#endif -#if defined(__IBMC__) || defined(__IBMCPP__) -/* This was _System _Export but caused a lot of warnings on _AIX43 */ -#define STDCALL -#elif !defined( STDCALL) -#define STDCALL -#endif - -/* Typdefs for easyier portability */ - -#if defined(VOIDTYPE) -typedef void *gptr; /* Generic pointer */ -#else -typedef char *gptr; /* Generic pointer */ -#endif -#ifndef HAVE_INT_8_16_32 -typedef signed char int8; /* Signed integer >= 8 bits */ -typedef short int16; /* Signed integer >= 16 bits */ -#endif -#ifndef HAVE_UCHAR -typedef unsigned char uchar; /* Short for unsigned char */ -#endif -typedef unsigned char uint8; /* Short for unsigned integer >= 8 bits */ -typedef unsigned short uint16; /* Short for unsigned integer >= 16 bits */ - -#if SIZEOF_INT == 4 -#ifndef HAVE_INT_8_16_32 -typedef int int32; -#endif -typedef unsigned int uint32; /* Short for unsigned integer >= 32 bits */ -#elif SIZEOF_LONG == 4 -#ifndef HAVE_INT_8_16_32 -typedef long int32; -#endif -typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */ -#else -#error "Neither int or long is of 4 bytes width" -#endif - -#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC) -typedef unsigned long ulong; /* Short for unsigned long */ -#endif -#ifndef longlong_defined -/* - Using [unsigned] long long is preferable as [u]longlong because we use - [unsigned] long long unconditionally in many places, - for example in constants with [U]LL suffix. -*/ -#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8 -typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ -typedef long long int longlong; -#else -typedef unsigned long ulonglong; /* ulong or unsigned long long */ -typedef long longlong; -#endif -#endif - -#if defined(NO_CLIENT_LONG_LONG) -typedef unsigned long my_ulonglong; -#elif defined (__WIN__) -typedef unsigned __int64 my_ulonglong; -#else -typedef unsigned long long my_ulonglong; -#endif - -#ifdef USE_RAID -/* - The following is done with a if to not get problems with pre-processors - with late define evaluation -*/ -#if SIZEOF_OFF_T == 4 -#define SYSTEM_SIZEOF_OFF_T 4 -#else -#define SYSTEM_SIZEOF_OFF_T 8 -#endif -#undef SIZEOF_OFF_T -#define SIZEOF_OFF_T 8 -#else -#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T -#endif /* USE_RAID */ - -#if SIZEOF_OFF_T > 4 -typedef ulonglong my_off_t; -#else -typedef unsigned long my_off_t; -#endif -#define MY_FILEPOS_ERROR (~(my_off_t) 0) -#if !defined(__WIN__) && !defined(OS2) -typedef off_t os_off_t; -#endif - -#if defined(__WIN__) -#define socket_errno WSAGetLastError() -#define SOCKET_EINTR WSAEINTR -#define SOCKET_EAGAIN WSAEINPROGRESS -#define SOCKET_ETIMEDOUT WSAETIMEDOUT -#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK -#define SOCKET_EADDRINUSE WSAEADDRINUSE -#define SOCKET_ENFILE ENFILE -#define SOCKET_EMFILE EMFILE -#elif defined(OS2) -#define socket_errno sock_errno() -#define SOCKET_EINTR SOCEINTR -#define SOCKET_EAGAIN SOCEINPROGRESS -#define SOCKET_ETIMEDOUT SOCKET_EINTR -#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK -#define SOCKET_EADDRINUSE SOCEADDRINUSE -#define SOCKET_ENFILE SOCENFILE -#define SOCKET_EMFILE SOCEMFILE -#define closesocket(A) soclose(A) -#else /* Unix */ -#define socket_errno errno -#define closesocket(A) close(A) -#define SOCKET_EINTR EINTR -#define SOCKET_EAGAIN EAGAIN -#define SOCKET_ETIMEDOUT SOCKET_EINTR -#define SOCKET_EWOULDBLOCK EWOULDBLOCK -#define SOCKET_EADDRINUSE EADDRINUSE -#define SOCKET_ENFILE ENFILE -#define SOCKET_EMFILE EMFILE -#endif - -typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ -typedef short int15; /* Most effective integer 0 <= x <= 32767 */ -typedef char *my_string; /* String of characters */ -typedef unsigned long size_s; /* Size of strings (In string-funcs) */ -typedef int myf; /* Type of MyFlags in my_funcs */ -#ifndef byte_defined -typedef char byte; /* Smallest addressable unit */ -#endif -typedef char my_bool; /* Small bool */ -#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus)) -typedef char bool; /* Ordinary boolean values 0 1 */ -#endif - /* Macros for converting *constants* to the right type */ -#define INT8(v) (int8) (v) -#define INT16(v) (int16) (v) -#define INT32(v) (int32) (v) -#define MYF(v) (myf) (v) - -#ifndef LL -#ifdef HAVE_LONG_LONG -#define LL(A) A ## LL -#else -#define LL(A) A ## L -#endif -#endif - -#ifndef ULL -#ifdef HAVE_LONG_LONG -#define ULL(A) A ## ULL -#else -#define ULL(A) A ## UL -#endif -#endif - -/* - Defines to make it possible to prioritize register assignments. No - longer that important with modern compilers. -*/ -#ifndef USING_X -#define reg1 register -#define reg2 register -#define reg3 register -#define reg4 register -#define reg5 register -#define reg6 register -#define reg7 register -#define reg8 register -#define reg9 register -#define reg10 register -#define reg11 register -#define reg12 register -#define reg13 register -#define reg14 register -#define reg15 register -#define reg16 register -#endif - -/* - Sometimes we want to make sure that the variable is not put into - a register in debugging mode so we can see its value in the core -*/ - -#ifndef DBUG_OFF -#define dbug_volatile volatile -#else -#define dbug_volatile -#endif - -/* Defines for time function */ -#define SCALE_SEC 100 -#define SCALE_USEC 10000 -#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ -#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ - - - -/* - Define-funktions for reading and storing in machine independent format - (low byte first) -*/ - -/* Optimized store functions for Intel x86 */ -#if defined(__i386__) && !defined(_WIN64) -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -#ifdef HAVE_purify -#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16)) -#else -/* - ATTENTION ! - - Please, note, uint3korr reads 4 bytes (not 3) ! - It means, that you have to provide enough allocated space ! -*/ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#endif -#define uint4korr(A) (*((uint32 *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) -#define int3store(T,A) do { *(T)= (uchar) ((A));\ - *(T+1)=(uchar) (((uint) (A) >> 8));\ - *(T+2)=(uchar) (((A) >> 16)); } while (0) -#define int4store(T,A) *((long *) (T))= (long) (A) -#define int5store(T,A) do { *(T)= (uchar)((A));\ - *((T)+1)=(uchar) (((A) >> 8));\ - *((T)+2)=(uchar) (((A) >> 16));\ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); } while(0) -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) - -typedef union { - double v; - long m[2]; -} doubleget_union; -#define doubleget(V,M) \ -do { doubleget_union _tmp; \ - _tmp.m[0] = *((long*)(M)); \ - _tmp.m[1] = *(((long*) (M))+1); \ - (V) = _tmp.v; } while(0) -#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ - *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \ - } while (0) -#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0) -#define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) -#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) -#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* __i386__ */ - -#ifndef sint2korr -/* - We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines - were done before) -*/ -#define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\ - ((int16) ((int16) (A)[1]) << 8)) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) +\ - (((int32) ((uchar) (A)[1]) << 8)) +\ - (((int32) ((uchar) (A)[2]) << 16)) +\ - (((int32) ((int16) (A)[3]) << 24))) -#define sint8korr(A) (longlong) uint8korr(A) -#define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) +\ - ((uint16) ((uchar) (A)[1]) << 8)) -#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16)) -#define uint4korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) (((uint32) ((uchar) (A)[4])) +\ - (((uint32) ((uchar) (A)[5])) << 8) +\ - (((uint32) ((uchar) (A)[6])) << 16) +\ - (((uint32) ((uchar) (A)[7])) << 24))) <<\ - 32)) -#define int2store(T,A) do { uint def_temp= (uint) (A) ;\ - *((uchar*) (T))= (uchar)(def_temp); \ - *((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \ - } while(0) -#define int3store(T,A) do { /*lint -save -e734 */\ - *((uchar*)(T))=(uchar) ((A));\ - *((uchar*) (T)+1)=(uchar) (((A) >> 8));\ - *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \ - /*lint -restore */} while(0) -#define int4store(T,A) do { *((char *)(T))=(char) ((A));\ - *(((char *)(T))+1)=(char) (((A) >> 8));\ - *(((char *)(T))+2)=(char) (((A) >> 16));\ - *(((char *)(T))+3)=(char) (((A) >> 24)); } while(0) -#define int5store(T,A) do { *((char *)(T))=((A));\ - *(((char *)(T))+1)=(((A) >> 8));\ - *(((char *)(T))+2)=(((A) >> 16));\ - *(((char *)(T))+3)=(((A) >> 24)); \ - *(((char *)(T))+4)=(((A) >> 32)); } while(0) -#define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \ - int4store((T),def_temp); \ - int4store((T+4),def_temp2); } while(0) -#ifdef WORDS_BIGENDIAN -#define float4store(T,A) do { *(T)= ((byte *) &A)[3];\ - *((T)+1)=(char) ((byte *) &A)[2];\ - *((T)+2)=(char) ((byte *) &A)[1];\ - *((T)+3)=(char) ((byte *) &A)[0]; } while(0) - -#define float4get(V,M) do { float def_temp;\ - ((byte*) &def_temp)[0]=(M)[3];\ - ((byte*) &def_temp)[1]=(M)[2];\ - ((byte*) &def_temp)[2]=(M)[1];\ - ((byte*) &def_temp)[3]=(M)[0];\ - (V)=def_temp; } while(0) -#define float8store(T,V) do { *(T)= ((byte *) &V)[7];\ - *((T)+1)=(char) ((byte *) &V)[6];\ - *((T)+2)=(char) ((byte *) &V)[5];\ - *((T)+3)=(char) ((byte *) &V)[4];\ - *((T)+4)=(char) ((byte *) &V)[3];\ - *((T)+5)=(char) ((byte *) &V)[2];\ - *((T)+6)=(char) ((byte *) &V)[1];\ - *((T)+7)=(char) ((byte *) &V)[0]; } while(0) - -#define float8get(V,M) do { double def_temp;\ - ((byte*) &def_temp)[0]=(M)[7];\ - ((byte*) &def_temp)[1]=(M)[6];\ - ((byte*) &def_temp)[2]=(M)[5];\ - ((byte*) &def_temp)[3]=(M)[4];\ - ((byte*) &def_temp)[4]=(M)[3];\ - ((byte*) &def_temp)[5]=(M)[2];\ - ((byte*) &def_temp)[6]=(M)[1];\ - ((byte*) &def_temp)[7]=(M)[0];\ - (V) = def_temp; } while(0) -#else -#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) -#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float)) - -#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\ - *(((char*)T)+1)=(char) ((byte *) &V)[5];\ - *(((char*)T)+2)=(char) ((byte *) &V)[6];\ - *(((char*)T)+3)=(char) ((byte *) &V)[7];\ - *(((char*)T)+4)=(char) ((byte *) &V)[0];\ - *(((char*)T)+5)=(char) ((byte *) &V)[1];\ - *(((char*)T)+6)=(char) ((byte *) &V)[2];\ - *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\ - while(0) -#define doubleget(V,M) do { double def_temp;\ - ((byte*) &def_temp)[0]=(M)[4];\ - ((byte*) &def_temp)[1]=(M)[5];\ - ((byte*) &def_temp)[2]=(M)[6];\ - ((byte*) &def_temp)[3]=(M)[7];\ - ((byte*) &def_temp)[4]=(M)[0];\ - ((byte*) &def_temp)[5]=(M)[1];\ - ((byte*) &def_temp)[6]=(M)[2];\ - ((byte*) &def_temp)[7]=(M)[3];\ - (V) = def_temp; } while(0) -#endif /* __FLOAT_WORD_ORDER */ - -#define float8get(V,M) doubleget((V),(M)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* WORDS_BIGENDIAN */ - -#endif /* sint2korr */ - -/* - Macro for reading 32-bit integer from network byte order (big-endian) - from unaligned memory location. -*/ -#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ - (((uint32) ((uchar) (A)[2])) << 8) |\ - (((uint32) ((uchar) (A)[1])) << 16) |\ - (((uint32) ((uchar) (A)[0])) << 24)) -/* - Define-funktions for reading and storing in machine format from/to - short/long to/from some place in memory V should be a (not - register) variable, M is a pointer to byte -*/ - -#ifdef WORDS_BIGENDIAN - -#define ushortget(V,M) do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\ - ((uint16) ((uint16) (M)[0]) << 8)); } while(0) -#define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\ - ((short) ((short) (M)[0]) << 8)); } while(0) -#define longget(V,M) do { int32 def_temp;\ - ((byte*) &def_temp)[0]=(M)[0];\ - ((byte*) &def_temp)[1]=(M)[1];\ - ((byte*) &def_temp)[2]=(M)[2];\ - ((byte*) &def_temp)[3]=(M)[3];\ - (V)=def_temp; } while(0) -#define ulongget(V,M) do { uint32 def_temp;\ - ((byte*) &def_temp)[0]=(M)[0];\ - ((byte*) &def_temp)[1]=(M)[1];\ - ((byte*) &def_temp)[2]=(M)[2];\ - ((byte*) &def_temp)[3]=(M)[3];\ - (V)=def_temp; } while(0) -#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ - *(((char*)T)+1)=(char)(def_temp); \ - *(((char*)T)+0)=(char)(def_temp >> 8); } while(0) -#define longstore(T,A) do { *(((char*)T)+3)=((A));\ - *(((char*)T)+2)=(((A) >> 8));\ - *(((char*)T)+1)=(((A) >> 16));\ - *(((char*)T)+0)=(((A) >> 24)); } while(0) - -#define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) -#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float)) -#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) -#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) -#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong)) - -#else - -#define ushortget(V,M) do { V = uint2korr(M); } while(0) -#define shortget(V,M) do { V = sint2korr(M); } while(0) -#define longget(V,M) do { V = sint4korr(M); } while(0) -#define ulongget(V,M) do { V = uint4korr(M); } while(0) -#define shortstore(T,V) int2store(T,V) -#define longstore(T,V) int4store(T,V) -#ifndef floatstore -#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float)) -#define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float)) -#endif -#ifndef doubleget -#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) -#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) -#endif /* doubleget */ -#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong)) - -#endif /* WORDS_BIGENDIAN */ - -/* sprintf does not always return the number of bytes :- */ -#ifdef SPRINTF_RETURNS_INT -#define my_sprintf(buff,args) sprintf args -#else -#ifdef SPRINTF_RETURNS_PTR -#define my_sprintf(buff,args) ((int)(sprintf args - buff)) -#else -#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff)) -#endif -#endif - -#ifndef THREAD -#define thread_safe_increment(V,L) (V)++ -#define thread_safe_add(V,C,L) (V)+=(C) -#define thread_safe_sub(V,C,L) (V)-=(C) -#define statistic_increment(V,L) (V)++ -#define statistic_add(V,C,L) (V)+=(C) -#endif - -#ifdef HAVE_CHARSET_utf8 -#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" -#else -#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME -#endif - -#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) -#define NO_EMBEDDED_ACCESS_CHECKS -#endif - - -/* Length of decimal number represented by INT32. */ - -#define MY_INT32_NUM_DECIMAL_DIGITS 11 - -/* Length of decimal number represented by INT64. */ - -#define MY_INT64_NUM_DECIMAL_DIGITS 21 - -#endif /* my_global_h */ - diff --git a/dep/include/mysql/my_list.h b/dep/include/mysql/my_list.h deleted file mode 100644 index bdb0a89c4f5..00000000000 --- a/dep/include/mysql/my_list.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _list_h_ -#define _list_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct st_list { - struct st_list *prev,*next; - void *data; -} LIST; - -typedef int (*list_walk_action)(void *,void *); - -extern LIST *list_add(LIST *root,LIST *element); -extern LIST *list_delete(LIST *root,LIST *element); -extern LIST *list_cons(void *data,LIST *root); -extern LIST *list_reverse(LIST *root); -extern void list_free(LIST *root,unsigned int free_data); -extern unsigned int list_length(LIST *); -extern int list_walk(LIST *,list_walk_action action,gptr argument); - -#define list_rest(a) ((a)->next) -#define list_push(a,b) (a)=list_cons((b),(a)) -#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); } - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/mysql/my_pthread.h b/dep/include/mysql/my_pthread.h deleted file mode 100644 index 2c734952ccd..00000000000 --- a/dep/include/mysql/my_pthread.h +++ /dev/null @@ -1,800 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Defines to make different thread packages compatible */ - -#ifndef _my_pthread_h -#define _my_pthread_h - -#include -#ifndef ETIME -#define ETIME ETIMEDOUT /* For FreeBSD */ -#endif - -#ifdef __cplusplus -#define EXTERNC extern "C" -extern "C" { -#else -#define EXTERNC -#endif /* __cplusplus */ - -#if defined(__WIN__) || defined(OS2) - -#ifdef OS2 -typedef ULONG HANDLE; -typedef ULONG DWORD; -typedef int sigset_t; -#endif - -#ifdef OS2 -typedef HMTX pthread_mutex_t; -#else -typedef CRITICAL_SECTION pthread_mutex_t; -#endif -typedef HANDLE pthread_t; -typedef struct thread_attr { - DWORD dwStackSize ; - DWORD dwCreatingFlag ; - int priority ; -} pthread_attr_t ; - -typedef struct { int dummy; } pthread_condattr_t; - -/* Implementation of posix conditions */ - -typedef struct st_pthread_link { - DWORD thread_id; - struct st_pthread_link *next; -} pthread_link; - -typedef struct { - uint32 waiting; - CRITICAL_SECTION lock_waiting; - - enum { - SIGNAL= 0, - BROADCAST= 1, - MAX_EVENTS= 2 - } EVENTS; - - HANDLE events[MAX_EVENTS]; - HANDLE broadcast_block_event; - -} pthread_cond_t; - -typedef int pthread_mutexattr_t; -#define win_pthread_self my_thread_var->pthread_self -#ifdef OS2 -#define pthread_handler_t EXTERNC void * _Optlink -typedef void * (_Optlink *pthread_handler)(void *); -#else -#define pthread_handler_t EXTERNC void * __cdecl -typedef void * (__cdecl *pthread_handler)(void *); -#endif - -/* - Struct and macros to be used in combination with the - windows implementation of pthread_cond_timedwait -*/ - -/* - Declare a union to make sure FILETIME is properly aligned - so it can be used directly as a 64 bit value. The value - stored is in 100ns units. - */ - union ft64 { - FILETIME ft; - __int64 i64; - }; -struct timespec { - union ft64 tv; - /* The max timeout value in millisecond for pthread_cond_timedwait */ - long max_timeout_msec; -}; -#define set_timespec(ABSTIME,SEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \ - (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \ -} -#define set_timespec_nsec(ABSTIME,NSEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \ - (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ -} - -void win_pthread_init(void); -int win_pthread_setspecific(void *A,void *B,uint length); -int win_pthread_mutex_trylock(pthread_mutex_t *mutex); -int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *); -int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); -int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); -int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime); -int pthread_cond_signal(pthread_cond_t *cond); -int pthread_cond_broadcast(pthread_cond_t *cond); -int pthread_cond_destroy(pthread_cond_t *cond); -int pthread_attr_init(pthread_attr_t *connect_att); -int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); -int pthread_attr_setprio(pthread_attr_t *connect_att,int priority); -int pthread_attr_destroy(pthread_attr_t *connect_att); -struct tm *localtime_r(const time_t *timep,struct tm *tmp); -struct tm *gmtime_r(const time_t *timep,struct tm *tmp); - - -void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ - -#ifndef OS2 -#define ETIMEDOUT 145 /* Win32 doesn't have this */ -#define getpid() GetCurrentThreadId() -#endif -#define pthread_self() win_pthread_self -#define HAVE_LOCALTIME_R 1 -#define _REENTRANT 1 -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 - -#ifdef USE_TLS /* For LIBMYSQL.DLL */ -#undef SAFE_MUTEX /* This will cause conflicts */ -#define pthread_key(T,V) DWORD V -#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF) -#define pthread_key_delete(A) TlsFree(A) -#define pthread_getspecific(A) (TlsGetValue(A)) -#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A)) -#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V)) -#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V))) -#define pthread_setspecific(A,B) (!TlsSetValue((A),(B))) -#else -#define pthread_key(T,V) __declspec(thread) T V -#define pthread_key_create(A,B) pthread_dummy(0) -#define pthread_key_delete(A) pthread_dummy(0) -#define pthread_getspecific(A) (&(A)) -#define my_pthread_getspecific(T,A) (&(A)) -#define my_pthread_getspecific_ptr(T,V) (V) -#define my_pthread_setspecific_ptr(T,V) ((T)=(V),0) -#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) -#endif /* USE_TLS */ - -#define pthread_equal(A,B) ((A) == (B)) -#ifdef OS2 -extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *); -extern int pthread_mutex_lock (pthread_mutex_t *); -extern int pthread_mutex_unlock (pthread_mutex_t *); -extern int pthread_mutex_destroy (pthread_mutex_t *); -#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A) -#define pthread_kill(A,B) raise(B) -#define pthread_exit(A) pthread_dummy() -#else -#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) -#define pthread_mutex_lock(A) (EnterCriticalSection(A),0) -#define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A)) -#define pthread_mutex_unlock(A) LeaveCriticalSection(A) -#define pthread_mutex_destroy(A) DeleteCriticalSection(A) -#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#endif /* OS2 */ - -/* Dummy defines for easier code */ -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B) -#define pthread_attr_setscope(A,B) -#define pthread_detach_this_thread() -#define pthread_condattr_init(A) -#define pthread_condattr_destroy(A) - -#define my_pthread_getprio(thread_id) pthread_dummy(0) - -#elif defined(HAVE_UNIXWARE7_THREADS) - -#include -#include - -#ifndef _REENTRANT -#define _REENTRANT -#endif - -#define HAVE_NONPOSIX_SIGWAIT -#define pthread_t thread_t -#define pthread_cond_t cond_t -#define pthread_mutex_t mutex_t -#define pthread_key_t thread_key_t -typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */ - -#define pthread_key_create(A,B) thr_keycreate((A),(B)) -#define pthread_key_delete(A) thr_keydelete(A) - -#define pthread_handler_t EXTERNC void * -#define pthread_key(T,V) pthread_key_t V - -void * my_pthread_getspecific_imp(pthread_key_t key); -#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) -#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V) - -#define pthread_setspecific(A,B) thr_setspecific(A,B) -#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V) - -#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED,(A)) -#define pthread_cond_init(a,b) cond_init((a),USYNC_THREAD,NULL) -#define pthread_cond_destroy(a) cond_destroy(a) -#define pthread_cond_signal(a) cond_signal(a) -#define pthread_cond_wait(a,b) cond_wait((a),(b)) -#define pthread_cond_timedwait(a,b,c) cond_timedwait((a),(b),(c)) -#define pthread_cond_broadcast(a) cond_broadcast(a) - -#define pthread_mutex_init(a,b) mutex_init((a),USYNC_THREAD,NULL) -#define pthread_mutex_lock(a) mutex_lock(a) -#define pthread_mutex_unlock(a) mutex_unlock(a) -#define pthread_mutex_destroy(a) mutex_destroy(a) - -#define pthread_self() thr_self() -#define pthread_exit(A) thr_exit(A) -#define pthread_equal(A,B) (((A) == (B)) ? 1 : 0) -#define pthread_kill(A,B) thr_kill((A),(B)) -#define HAVE_PTHREAD_KILL - -#define pthread_sigmask(A,B,C) thr_sigsetmask((A),(B),(C)) - -extern int my_sigwait(const sigset_t *set,int *sig); - -#define pthread_detach_this_thread() pthread_dummy(0) - -#define pthread_attr_init(A) pthread_dummy(0) -#define pthread_attr_destroy(A) pthread_dummy(0) -#define pthread_attr_setscope(A,B) pthread_dummy(0) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define my_pthread_setprio(A,B) pthread_dummy (0) -#define my_pthread_getprio(A) pthread_dummy (0) -#define my_pthread_attr_setprio(A,B) pthread_dummy(0) - -#else /* Normal threads */ - -#ifdef HAVE_rts_threads -#define sigwait org_sigwait -#include -#undef sigwait -#endif -#include -#ifndef _REENTRANT -#define _REENTRANT -#endif -#ifdef HAVE_THR_SETCONCURRENCY -#include /* Probably solaris */ -#endif -#ifdef HAVE_SCHED_H -#include -#endif -#ifdef HAVE_SYNCH_H -#include -#endif -#if defined(__EMX__) && (!defined(EMX_PTHREAD_REV) || (EMX_PTHREAD_REV < 2)) -#error Requires at least rev 2 of EMX pthreads library. -#endif - -#ifdef __NETWARE__ -void my_pthread_exit(void *status); -#define pthread_exit(A) my_pthread_exit(A) -#endif - -extern int my_pthread_getprio(pthread_t thread_id); - -#define pthread_key(T,V) pthread_key_t V -#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) -#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) -#define pthread_detach_this_thread() -#define pthread_handler_t EXTERNC void * -typedef void *(* pthread_handler)(void *); - -/* Test first for RTS or FSU threads */ - -#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) -#define HAVE_rts_threads -extern int my_pthread_create_detached; -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached -#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL -#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL -#define USE_ALARM_THREAD -#elif defined(HAVE_mit_thread) -#define USE_ALARM_THREAD -#undef HAVE_LOCALTIME_R -#define HAVE_LOCALTIME_R -#undef HAVE_GMTIME_R -#define HAVE_GMTIME_R -#undef HAVE_PTHREAD_ATTR_SETSCOPE -#define HAVE_PTHREAD_ATTR_SETSCOPE -#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE /* If we are running linux */ -#undef HAVE_RWLOCK_T -#undef HAVE_RWLOCK_INIT -#undef HAVE_PTHREAD_RWLOCK_RDLOCK -#undef HAVE_SNPRINTF - -#define my_pthread_attr_setprio(A,B) -#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - -#if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910 -int sigwait(sigset_t *set, int *sig); -#endif - -#ifndef HAVE_NONPOSIX_SIGWAIT -#define my_sigwait(A,B) sigwait((A),(B)) -#else -int my_sigwait(const sigset_t *set,int *sig); -#endif - -#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT -#ifndef SAFE_MUTEX -#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b)) -extern int my_pthread_mutex_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); -#endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b)) -extern int my_pthread_cond_init(pthread_cond_t *mp, - const pthread_condattr_t *attr); -#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ - -#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) -#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C)) -#endif - -#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) -int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ -#endif - - -/* - We define my_sigset() and use that instead of the system sigset() so that - we can favor an implementation based on sigaction(). On some systems, such - as Mac OS X, sigset() results in flags such as SA_RESTART being set, and - we want to make sure that no such flags are set. -*/ -#if defined(HAVE_SIGACTION) && !defined(my_sigset) -#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \ - DBUG_ASSERT((A) != 0); \ - sigemptyset(&l_set); \ - l_s.sa_handler = (B); \ - l_s.sa_mask = l_set; \ - l_s.sa_flags = 0; \ - l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\ - DBUG_ASSERT(l_rc == 0); \ - } while (0) -#elif defined(HAVE_SIGSET) && !defined(my_sigset) -#define my_sigset(A,B) sigset((A),(B)) -#elif !defined(my_sigset) -#define my_sigset(A,B) signal((A),(B)) -#endif - -#ifndef my_pthread_setprio -#if defined(HAVE_PTHREAD_SETPRIO_NP) /* FSU threads */ -#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B)) -#elif defined(HAVE_PTHREAD_SETPRIO) -#define my_pthread_setprio(A,B) pthread_setprio((A),(B)) -#else -extern void my_pthread_setprio(pthread_t thread_id,int prior); -#endif -#endif - -#ifndef my_pthread_attr_setprio -#ifdef HAVE_PTHREAD_ATTR_SETPRIO -#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B)) -#else -extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority); -#endif -#endif - -#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) -#define pthread_attr_setscope(A,B) -#undef HAVE_GETHOSTBYADDR_R /* No definition */ -#endif - -#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX) -extern int my_pthread_cond_timedwait(pthread_cond_t *cond, - pthread_mutex_t *mutex, - struct timespec *abstime); -#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) -#endif - -#if defined(OS2) -#define my_pthread_getspecific(T,A) ((T) &(A)) -#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) -#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) -#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B)) -#else -#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) -void *my_pthread_getspecific_imp(pthread_key_t key); -#endif /* OS2 */ - -#ifndef HAVE_LOCALTIME_R -struct tm *localtime_r(const time_t *clock, struct tm *res); -#endif - -#ifndef HAVE_GMTIME_R -struct tm *gmtime_r(const time_t *clock, struct tm *res); -#endif - -#ifdef HAVE_PTHREAD_CONDATTR_CREATE -/* DCE threads on HPUX 10.20 */ -#define pthread_condattr_init pthread_condattr_create -#define pthread_condattr_destroy pthread_condattr_delete -#endif - -/* FSU THREADS */ -#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete) -#define pthread_key_delete(A) pthread_dummy(0) -#endif - -#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */ -#define pthread_cond_destroy(A) pthread_dummy(0) -#define pthread_mutex_destroy(A) pthread_dummy(0) -#define pthread_attr_delete(A) pthread_dummy(0) -#define pthread_condattr_delete(A) pthread_dummy(0) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#define pthread_equal(A,B) ((A) == (B)) -#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b)) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } -#endif - -#ifdef HAVE_DARWIN5_THREADS -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#define pthread_condattr_init(A) pthread_dummy(0) -#define pthread_condattr_destroy(A) pthread_dummy(0) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } -#endif - -#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) -/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */ -#define pthread_key_create(A,B) \ - pthread_keycreate(A,(B) ?\ - (pthread_destructor_t) (B) :\ - (pthread_destructor_t) pthread_dummy) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#ifndef pthread_sigmask -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#endif -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } -#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ -#define HAVE_PTHREAD_KILL -#endif - -#endif /* defined(__WIN__) */ - -#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) -#undef pthread_cond_timedwait -#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c)) -int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime); -#endif - -#if defined(HPUX10) -#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B) -void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); -#endif - -#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) -#undef pthread_mutex_trylock -#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a)) -int my_pthread_mutex_trylock(pthread_mutex_t *mutex); -#endif - -/* - The defines set_timespec and set_timespec_nsec should be used - for calculating an absolute time at which - pthread_cond_timedwait should timeout -*/ -#ifdef HAVE_TIMESPEC_TS_SEC -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{ \ - (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \ - (ABSTIME).ts_nsec=0; \ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{ \ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).ts_sec= (now / ULL(10000000)); \ - (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ -#else -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{\ - struct timeval tv;\ - gettimeofday(&tv,0);\ - (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\ - (ABSTIME).tv_nsec=tv.tv_usec*1000;\ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{\ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \ - (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ -#endif /* HAVE_TIMESPEC_TS_SEC */ - - /* safe_mutex adds checking to mutex for easier debugging */ - -#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) -#define SAFE_MUTEX_DETECT_DESTROY -#endif - -typedef struct st_safe_mutex_t -{ - pthread_mutex_t global,mutex; - const char *file; - uint line,count; - pthread_t thread; -#ifdef SAFE_MUTEX_DETECT_DESTROY - struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ -#endif -} safe_mutex_t; - -#ifdef SAFE_MUTEX_DETECT_DESTROY -/* - Used to track the destroying of mutexes. This needs to be a seperate - structure because the safe_mutex_t structure could be freed before - the mutexes are destroyed. -*/ - -typedef struct st_safe_mutex_info_t -{ - struct st_safe_mutex_info_t *next; - struct st_safe_mutex_info_t *prev; - const char *init_file; - uint32 init_line; -} safe_mutex_info_t; -#endif /* SAFE_MUTEX_DETECT_DESTROY */ - -int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, - const char *file, uint line); -int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line); -int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); -int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); -int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, - uint line); -int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, - struct timespec *abstime, const char *file, uint line); -void safe_mutex_global_init(void); -void safe_mutex_end(FILE *file); - - /* Wrappers if safe mutex is actually used */ -#ifdef SAFE_MUTEX -#undef pthread_mutex_init -#undef pthread_mutex_lock -#undef pthread_mutex_unlock -#undef pthread_mutex_destroy -#undef pthread_mutex_wait -#undef pthread_mutex_timedwait -#undef pthread_mutex_t -#undef pthread_cond_wait -#undef pthread_cond_timedwait -#undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) -#define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE__) -#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) -#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) -#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__) -#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__) -#define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LINE__) -#define pthread_mutex_t safe_mutex_t -#define safe_mutex_assert_owner(mp) \ - DBUG_ASSERT((mp)->count > 0 && \ - pthread_equal(pthread_self(), (mp)->thread)) -#define safe_mutex_assert_not_owner(mp) \ - DBUG_ASSERT(! (mp)->count || \ - ! pthread_equal(pthread_self(), (mp)->thread)) -#else -#define safe_mutex_assert_owner(mp) -#define safe_mutex_assert_not_owner(mp) -#endif /* SAFE_MUTEX */ - - /* READ-WRITE thread locking */ - -#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */ -#undef HAVE_PTHREAD_RWLOCK_RDLOCK -#undef HAVE_RWLOCK_INIT -#undef HAVE_RWLOCK_T -#endif - -#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS) -/* use these defs for simple mutex locking */ -#define rw_lock_t pthread_mutex_t -#define my_rwlock_init(A,B) pthread_mutex_init((A),(B)) -#define rw_rdlock(A) pthread_mutex_lock((A)) -#define rw_wrlock(A) pthread_mutex_lock((A)) -#define rw_tryrdlock(A) pthread_mutex_trylock((A)) -#define rw_trywrlock(A) pthread_mutex_trylock((A)) -#define rw_unlock(A) pthread_mutex_unlock((A)) -#define rwlock_destroy(A) pthread_mutex_destroy((A)) -#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK) -#define rw_lock_t pthread_rwlock_t -#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B)) -#define rw_rdlock(A) pthread_rwlock_rdlock(A) -#define rw_wrlock(A) pthread_rwlock_wrlock(A) -#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A)) -#define rw_trywrlock(A) pthread_rwlock_trywrlock((A)) -#define rw_unlock(A) pthread_rwlock_unlock(A) -#define rwlock_destroy(A) pthread_rwlock_destroy(A) -#elif defined(HAVE_RWLOCK_INIT) -#ifdef HAVE_RWLOCK_T /* For example Solaris 2.6-> */ -#define rw_lock_t rwlock_t -#endif -#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0) -#else -/* Use our own version of read/write locks */ -typedef struct _my_rw_lock_t { - pthread_mutex_t lock; /* lock for structure */ - pthread_cond_t readers; /* waiting readers */ - pthread_cond_t writers; /* waiting writers */ - int state; /* -1:writer,0:free,>0:readers */ - int waiters; /* number of waiting writers */ -} my_rw_lock_t; - -#define rw_lock_t my_rw_lock_t -#define rw_rdlock(A) my_rw_rdlock((A)) -#define rw_wrlock(A) my_rw_wrlock((A)) -#define rw_tryrdlock(A) my_rw_tryrdlock((A)) -#define rw_trywrlock(A) my_rw_trywrlock((A)) -#define rw_unlock(A) my_rw_unlock((A)) -#define rwlock_destroy(A) my_rwlock_destroy((A)) - -extern int my_rwlock_init(my_rw_lock_t *, void *); -extern int my_rwlock_destroy(my_rw_lock_t *); -extern int my_rw_rdlock(my_rw_lock_t *); -extern int my_rw_wrlock(my_rw_lock_t *); -extern int my_rw_unlock(my_rw_lock_t *); -extern int my_rw_tryrdlock(my_rw_lock_t *); -extern int my_rw_trywrlock(my_rw_lock_t *); -#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */ - -#define GETHOSTBYADDR_BUFF_SIZE 2048 - -#ifndef HAVE_THR_SETCONCURRENCY -#define thr_setconcurrency(A) pthread_dummy(0) -#endif -#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#endif - -/* Define mutex types, see my_thr_init.c */ -#define MY_MUTEX_INIT_SLOW NULL -#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP -extern pthread_mutexattr_t my_fast_mutexattr; -#define MY_MUTEX_INIT_FAST &my_fast_mutexattr -#else -#define MY_MUTEX_INIT_FAST NULL -#endif -#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP -extern pthread_mutexattr_t my_errorcheck_mutexattr; -#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr -#else -#define MY_MUTEX_INIT_ERRCHK NULL -#endif - -#ifndef ESRCH -/* Define it to something */ -#define ESRCH 1 -#endif - -extern my_bool my_thread_global_init(void); -extern void my_thread_global_end(void); -extern my_bool my_thread_init(void); -extern void my_thread_end(void); -extern const char *my_thread_name(void); -extern long my_thread_id(void); -extern int pthread_no_free(void *); -extern int pthread_dummy(int); - -/* All thread specific variables are in the following struct */ - -#define THREAD_NAME_SIZE 10 -#ifndef DEFAULT_THREAD_STACK -#if SIZEOF_CHARP > 4 -/* - MySQL can survive with 32K, but some glibc libraries require > 128K stack - To resolve hostnames. Also recursive stored procedures needs stack. -*/ -#define DEFAULT_THREAD_STACK (256*1024L) -#else -#define DEFAULT_THREAD_STACK (192*1024) -#endif -#endif - -struct st_my_thread_var -{ - int thr_errno; - pthread_cond_t suspend; - pthread_mutex_t mutex; - pthread_mutex_t * volatile current_mutex; - pthread_cond_t * volatile current_cond; - pthread_t pthread_self; - long id; - int cmp_length; - int volatile abort; - my_bool init; - struct st_my_thread_var *next,**prev; - void *opt_info; -#ifndef DBUG_OFF - gptr dbug; - char name[THREAD_NAME_SIZE+1]; -#endif -}; - -extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); -extern uint my_thread_end_wait_time; -#define my_thread_var (_my_thread_var()) -#define my_errno my_thread_var->thr_errno -/* - Keep track of shutdown,signal, and main threads so that my_end() will not - report errors with them -*/ - -/* Which kind of thread library is in use */ - -#define THD_LIB_OTHER 1 -#define THD_LIB_NPTL 2 -#define THD_LIB_LT 4 - -extern uint thd_lib_detected; - - /* statistics_xxx functions are for not essential statistic */ - -#ifndef thread_safe_increment -#ifdef HAVE_ATOMIC_ADD -#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V) -#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V) -#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V) -#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V) -#else -#define thread_safe_increment(V,L) \ - (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L))) -#define thread_safe_decrement(V,L) \ - (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L))) -#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) -#define thread_safe_sub(V,C,L) \ - (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) -#endif /* HAVE_ATOMIC_ADD */ -#ifdef SAFE_STATISTICS -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) -#else -#define statistic_decrement(V,L) (V)-- -#define statistic_increment(V,L) (V)++ -#define statistic_add(V,C,L) (V)+=(C) -#endif /* SAFE_STATISTICS */ -#endif /* thread_safe_increment */ - -#ifdef __cplusplus -} -#endif -#endif /* _my_ptread_h */ - diff --git a/dep/include/mysql/my_sys.h b/dep/include/mysql/my_sys.h deleted file mode 100644 index cafdf571968..00000000000 --- a/dep/include/mysql/my_sys.h +++ /dev/null @@ -1,937 +0,0 @@ -/* Copyright (C) 2000-2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _my_sys_h -#define _my_sys_h -C_MODE_START - -#ifdef HAVE_AIOWAIT -#include /* Used by record-cache */ -typedef struct my_aio_result { - aio_result_t result; - int pending; -} my_aio_result; -#endif - -#ifndef THREAD -extern int NEAR my_errno; /* Last error in mysys */ -#else -#include -#endif - -#include /* for CHARSET_INFO */ -#include -#include - -#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; } -#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} -#define MY_INIT(name); { my_progname= name; my_init(); } - -#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */ -#define NRERRBUFFS (2) /* Buffers for parameters */ -#define MY_FILE_ERROR ((uint) ~0) - - /* General bitmaps for my_func's */ -#define MY_FFNF 1 /* Fatal if file not found */ -#define MY_FNABP 2 /* Fatal if not all bytes read/writen */ -#define MY_NABP 4 /* Error if not all bytes read/writen */ -#define MY_FAE 8 /* Fatal if any error */ -#define MY_WME 16 /* Write message on error */ -#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ -#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ -#define MY_RAID 64 /* Support for RAID */ -#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */ -#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ -#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ -#define MY_COPYTIME 64 /* my_redel() copys time */ -#define MY_DELETE_OLD 256 /* my_create_with_symlink() */ -#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */ -#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ -#define MY_REDEL_MAKE_BACKUP 256 -#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */ -#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */ -#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */ -#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ -#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ -#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ -#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ -#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ - -#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ -#define MY_GIVE_INFO 2 /* Give time info about process*/ -#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */ - -#define ME_HIGHBYTE 8 /* Shift for colours */ -#define ME_NOCUR 1 /* Don't use curses message */ -#define ME_OLDWIN 2 /* Use old window */ -#define ME_BELL 4 /* Ring bell then printing message */ -#define ME_HOLDTANG 8 /* Don't delete last keys */ -#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */ -#define ME_WAITTANG 32 /* Wait for a user action */ -#define ME_NOREFRESH 64 /* Dont refresh screen */ -#define ME_NOINPUT 128 /* Dont use the input libary */ -#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */ -#define ME_COLOUR2 ((2 << ME_HIGHBYTE)) -#define ME_COLOUR3 ((3 << ME_HIGHBYTE)) - - /* Bits in last argument to fn_format */ -#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ -#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */ -#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */ -#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */ -#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */ -#define MY_RETURN_REAL_PATH 32 /* return full path for file */ -#define MY_SAFE_PATH 64 /* Return NULL if too long path */ -#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */ - - /* My seek flags */ -#define MY_SEEK_SET 0 -#define MY_SEEK_CUR 1 -#define MY_SEEK_END 2 - - /* Some constants */ -#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */ -#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */ -#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */ -#define DFLT_INIT_HITS 3 - - /* root_alloc flags */ -#define MY_KEEP_PREALLOC 1 -#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */ - - /* Internal error numbers (for assembler functions) */ -#define MY_ERRNO_EDOM 33 -#define MY_ERRNO_ERANGE 34 - - /* Bits for get_date timeflag */ -#define GETDATE_DATE_TIME 1 -#define GETDATE_SHORT_DATE 2 -#define GETDATE_HHMMSSTIME 4 -#define GETDATE_GMT 8 -#define GETDATE_FIXEDLENGTH 16 - - /* defines when allocating data */ -#ifdef SAFEMALLOC -#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG ) -#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG ) -#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG ) -#define my_checkmalloc() _sanity( __FILE__, __LINE__ ) -#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG) -#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) -#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) -#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE__,__LINE__,C) -#define TRASH(A,B) bfill(A, B, 0x8F) -#define QUICK_SAFEMALLOC sf_malloc_quick=1 -#define NORMAL_SAFEMALLOC sf_malloc_quick=0 -extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; -extern ulonglong sf_malloc_mem_limit; - -#define CALLER_INFO_PROTO , const char *sFile, uint uLine -#define CALLER_INFO , __FILE__, __LINE__ -#define ORIG_CALLER_INFO , sFile, uLine -#else -#define my_checkmalloc() -#undef TERMINATE -#define TERMINATE(A) {} -#define QUICK_SAFEMALLOC -#define NORMAL_SAFEMALLOC -extern gptr my_malloc(size_t Size, myf MyFlags); -#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) -extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); -extern void my_no_flags_free(gptr ptr); -extern gptr my_memdup(const byte *from, size_t length, myf MyFlags); -extern char *my_strdup(const char *from,myf MyFlags); -extern char *my_strdup_with_length(const char *from, size_t length, - myf MyFlags); -/* we do use FG (as a no-op) in below so that a typo on FG is caught */ -#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) -#define CALLER_INFO_PROTO /* nothing */ -#define CALLER_INFO /* nothing */ -#define ORIG_CALLER_INFO /* nothing */ -#define TRASH(A,B) /* nothing */ -#endif - -#ifdef HAVE_LARGE_PAGES -extern uint my_get_large_page_size(void); -extern gptr my_large_malloc(size_t size, myf my_flags); -extern void my_large_free(gptr ptr, myf my_flags); -#else -#define my_get_large_page_size() (0) -#define my_large_malloc(A,B) my_malloc_lock((A),(B)) -#define my_large_free(A,B) my_free_lock((A),(B)) -#endif /* HAVE_LARGE_PAGES */ - -#ifdef HAVE_ALLOCA -#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) -#pragma alloca -#endif /* _AIX */ -#if defined(__MWERKS__) -#undef alloca -#define alloca _alloca -#endif /* __MWERKS__ */ -#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) -#define alloca __builtin_alloca -#endif /* GNUC */ -#define my_alloca(SZ) alloca((size_t) (SZ)) -#define my_afree(PTR) {} -#else -#define my_alloca(SZ) my_malloc(SZ,MYF(0)) -#define my_afree(PTR) my_free(PTR,MYF(MY_WME)) -#endif /* HAVE_ALLOCA */ - -#ifdef MSDOS -#ifdef __ZTC__ -void * __CDECL halloc(long count,size_t length); -void __CDECL hfree(void *ptr); -#endif -#if defined(USE_HALLOC) -#if defined(_VCM_) || defined(M_IC80386) -#undef USE_HALLOC -#endif -#endif -#ifdef USE_HALLOC -#define malloc(a) halloc((long) (a),1) -#define free(a) hfree(a) -#endif -#endif /* MSDOS */ - -#ifndef errno /* did we already get it? */ -#ifdef HAVE_ERRNO_AS_DEFINE -#include /* errno is a define */ -#else -extern int errno; /* declare errno */ -#endif -#endif /* #ifndef errno */ -extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; -extern char *home_dir; /* Home directory for user */ -extern const char *my_progname; /* program-name (printed in errors) */ -extern char NEAR curr_dir[]; /* Current directory for user */ -extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); -extern int (*fatal_error_handler_hook)(uint my_err, const char *str, - myf MyFlags); -extern uint my_file_limit; - -#ifdef HAVE_LARGE_PAGES -extern my_bool my_use_large_pages; -extern uint my_large_page_size; -#endif - -/* charsets */ -extern CHARSET_INFO *default_charset_info; -extern CHARSET_INFO *all_charsets[256]; -extern CHARSET_INFO compiled_charsets[]; - -/* statistics */ -extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; -extern uint mysys_usage_id; -extern my_bool my_init_done; - - /* Point to current my_message() */ -extern void (*my_sigtstp_cleanup)(void), - /* Executed before jump to shell */ - (*my_sigtstp_restart)(void), - (*my_abort_hook)(int); - /* Executed when comming from shell */ -extern int NEAR my_umask, /* Default creation mask */ - NEAR my_umask_dir, - NEAR my_recived_signals, /* Signals we have got */ - NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ - NEAR my_dont_interrupt; /* call remember_intr when set */ -extern my_bool NEAR mysys_uses_curses, my_use_symdir; -extern ulong sf_malloc_cur_memory, sf_malloc_max_memory; - -extern ulong my_default_record_cache_size; -extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, - NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks; -extern char wild_many,wild_one,wild_prefix; -extern const char *charsets_dir; -/* from default.c */ -extern char *my_defaults_extra_file; -extern const char *my_defaults_group_suffix; -extern const char *my_defaults_file; - -extern my_bool timed_mutexes; - -typedef struct wild_file_pack /* Struct to hold info when selecting files */ -{ - uint wilds; /* How many wildcards */ - uint not_pos; /* Start of not-theese-files */ - my_string *wild; /* Pointer to wildcards */ -} WF_PACK; - -enum loglevel { - ERROR_LEVEL, - WARNING_LEVEL, - INFORMATION_LEVEL -}; - -enum cache_type -{ - TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, - SEQ_READ_APPEND /* sequential read or append */, - READ_FIFO, READ_NET,WRITE_NET}; - -enum flush_type -{ - FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE -}; - -typedef struct st_record_cache /* Used when cacheing records */ -{ - File file; - int rc_seek,error,inited; - uint rc_length,read_length,reclength; - my_off_t rc_record_pos,end_of_file; - byte *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos; -#ifdef HAVE_AIOWAIT - int use_async_io; - my_aio_result aio_result; -#endif - enum cache_type type; -} RECORD_CACHE; - -enum file_type -{ - UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN, - FILE_BY_MKSTEMP, FILE_BY_DUP -}; - -struct st_my_file_info -{ - my_string name; - enum file_type type; -#if defined(THREAD) && !defined(HAVE_PREAD) - pthread_mutex_t mutex; -#endif -}; - -extern struct st_my_file_info *my_file_info; - -typedef struct st_dynamic_array -{ - char *buffer; - uint elements,max_element; - uint alloc_increment; - uint size_of_element; -} DYNAMIC_ARRAY; - -typedef struct st_my_tmpdir -{ - DYNAMIC_ARRAY full_list; - char **list; - uint cur, max; -#ifdef THREAD - pthread_mutex_t mutex; -#endif -} MY_TMPDIR; - -typedef struct st_dynamic_string -{ - char *str; - uint length,max_length,alloc_increment; -} DYNAMIC_STRING; - -struct st_io_cache; -typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); - -#ifdef THREAD -typedef struct st_io_cache_share -{ - pthread_mutex_t mutex; /* To sync on reads into buffer. */ - pthread_cond_t cond; /* To wait for signals. */ - pthread_cond_t cond_writer; /* For a synchronized writer. */ - /* Offset in file corresponding to the first byte of buffer. */ - my_off_t pos_in_file; - /* If a synchronized write cache is the source of the data. */ - struct st_io_cache *source_cache; - byte *buffer; /* The read buffer. */ - byte *read_end; /* Behind last valid byte of buffer. */ - int running_threads; /* threads not in lock. */ - int total_threads; /* threads sharing the cache. */ - int error; /* Last error. */ -#ifdef NOT_YET_IMPLEMENTED - /* whether the structure should be free'd */ - my_bool alloced; -#endif -} IO_CACHE_SHARE; -#endif - -typedef struct st_io_cache /* Used when cacheing files */ -{ - /* Offset in file corresponding to the first byte of byte* buffer. */ - my_off_t pos_in_file; - /* - The offset of end of file for READ_CACHE and WRITE_CACHE. - For SEQ_READ_APPEND it the maximum of the actual end of file and - the position represented by read_end. - */ - my_off_t end_of_file; - /* Points to current read position in the buffer */ - byte *read_pos; - /* the non-inclusive boundary in the buffer for the currently valid read */ - byte *read_end; - byte *buffer; /* The read buffer */ - /* Used in ASYNC_IO */ - byte *request_pos; - - /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */ - byte *write_buffer; - /* - Only used in SEQ_READ_APPEND, and points to the current read position - in the write buffer. Note that reads in SEQ_READ_APPEND caches can - happen from both read buffer (byte* buffer) and write buffer - (byte* write_buffer). - */ - byte *append_read_pos; - /* Points to current write position in the write buffer */ - byte *write_pos; - /* The non-inclusive boundary of the valid write area */ - byte *write_end; - - /* - Current_pos and current_end are convenience variables used by - my_b_tell() and other routines that need to know the current offset - current_pos points to &write_pos, and current_end to &write_end in a - WRITE_CACHE, and &read_pos and &read_end respectively otherwise - */ - byte **current_pos, **current_end; -#ifdef THREAD - /* - The lock is for append buffer used in SEQ_READ_APPEND cache - need mutex copying from append buffer to read buffer. - */ - pthread_mutex_t append_buffer_lock; - /* - The following is used when several threads are reading the - same file in parallel. They are synchronized on disk - accesses reading the cached part of the file asynchronously. - It should be set to NULL to disable the feature. Only - READ_CACHE mode is supported. - */ - IO_CACHE_SHARE *share; -#endif - /* - A caller will use my_b_read() macro to read from the cache - if the data is already in cache, it will be simply copied with - memcpy() and internal variables will be accordinging updated with - no functions invoked. However, if the data is not fully in the cache, - my_b_read() will call read_function to fetch the data. read_function - must never be invoked directly. - */ - int (*read_function)(struct st_io_cache *,byte *,uint); - /* - Same idea as in the case of read_function, except my_b_write() needs to - be replaced with my_b_append() for a SEQ_READ_APPEND cache - */ - int (*write_function)(struct st_io_cache *,const byte *,uint); - /* - Specifies the type of the cache. Depending on the type of the cache - certain operations might not be available and yield unpredicatable - results. Details to be documented later - */ - enum cache_type type; - /* - Callbacks when the actual read I/O happens. These were added and - are currently used for binary logging of LOAD DATA INFILE - when a - block is read from the file, we create a block create/append event, and - when IO_CACHE is closed, we create an end event. These functions could, - of course be used for other things - */ - IO_CACHE_CALLBACK pre_read; - IO_CACHE_CALLBACK post_read; - IO_CACHE_CALLBACK pre_close; - /* - Counts the number of times, when we were forced to use disk. We use it to - increase the binlog_cache_disk_use status variable. - */ - ulong disk_writes; - void* arg; /* for use by pre/post_read */ - char *file_name; /* if used with 'open_cached_file' */ - char *dir,*prefix; - File file; /* file descriptor */ - /* - seek_not_done is set by my_b_seek() to inform the upcoming read/write - operation that a seek needs to be preformed prior to the actual I/O - error is 0 if the cache operation was successful, -1 if there was a - "hard" error, and the actual number of I/O-ed bytes if the read/write was - partial. - */ - int seek_not_done,error; - /* buffer_length is memory size allocated for buffer or write_buffer */ - uint buffer_length; - /* read_length is the same as buffer_length except when we use async io */ - uint read_length; - myf myflags; /* Flags used to my_read/my_write */ - /* - alloced_buffer is 1 if the buffer was allocated by init_io_cache() and - 0 if it was supplied by the user. - Currently READ_NET is the only one that will use a buffer allocated - somewhere else - */ - my_bool alloced_buffer; -#ifdef HAVE_AIOWAIT - /* - As inidicated by ifdef, this is for async I/O, which is not currently - used (because it's not reliable on all systems) - */ - uint inited; - my_off_t aio_read_pos; - my_aio_result aio_result; -#endif -} IO_CACHE; - -typedef int (*qsort2_cmp)(const void *, const void *, const void *); - - /* defines for mf_iocache */ - - /* Test if buffer is inited */ -#define my_b_clear(info) (info)->buffer=0 -#define my_b_inited(info) (info)->buffer -#define my_b_EOF INT_MIN - -#define my_b_read(info,Buffer,Count) \ - ((info)->read_pos + (Count) <= (info)->read_end ?\ - (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ - ((info)->read_pos+=(Count)),0) :\ - (*(info)->read_function)((info),Buffer,Count)) - -#define my_b_write(info,Buffer,Count) \ - ((info)->write_pos + (Count) <=(info)->write_end ?\ - (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ - ((info)->write_pos+=(Count)),0) : \ - (*(info)->write_function)((info),(Buffer),(Count))) - -#define my_b_get(info) \ - ((info)->read_pos != (info)->read_end ?\ - ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\ - _my_b_get(info)) - - /* my_b_write_byte dosn't have any err-check */ -#define my_b_write_byte(info,chr) \ - (((info)->write_pos < (info)->write_end) ?\ - ((*(info)->write_pos++)=(chr)) :\ - (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr)))) - -#define my_b_fill_cache(info) \ - (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0)) - -#define my_b_tell(info) ((info)->pos_in_file + \ - (uint) (*(info)->current_pos - (info)->request_pos)) - -#define my_b_get_buffer_start(info) (info)->request_pos -#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \ - (char*) my_b_get_buffer_start(info) -#define my_b_get_pos_in_file(info) (info)->pos_in_file - - -/* tell write offset in the SEQ_APPEND cache */ -my_off_t my_b_append_tell(IO_CACHE* info); -my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ - -#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \ - *(info)->current_pos) - -typedef uint32 ha_checksum; - -/* Define the type of function to be passed to process_default_option_files */ -typedef int (*Process_option_func)(void *ctx, const char *group_name, - const char *option); - -#include - - - /* Prototypes for mysys and my_func functions */ - -extern int my_copy(const char *from,const char *to,myf MyFlags); -extern int my_append(const char *from,const char *to,myf MyFlags); -extern int my_delete(const char *name,myf MyFlags); -extern int my_getwd(my_string buf,uint size,myf MyFlags); -extern int my_setwd(const char *dir,myf MyFlags); -extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags); -extern gptr my_once_alloc(uint Size,myf MyFlags); -extern void my_once_free(void); -extern char *my_once_strdup(const char *src,myf myflags); -extern char *my_once_memdup(const char *src, uint len, myf myflags); -extern File my_open(const char *FileName,int Flags,myf MyFlags); -extern File my_register_filename(File fd, const char *FileName, - enum file_type type_of_file, - uint error_message_number, myf MyFlags); -extern File my_create(const char *FileName,int CreateFlags, - int AccsesFlags, myf MyFlags); -extern int my_close(File Filedes,myf MyFlags); -extern File my_dup(File file, myf MyFlags); -extern int my_mkdir(const char *dir, int Flags, myf MyFlags); -extern int my_readlink(char *to, const char *filename, myf MyFlags); -extern int my_realpath(char *to, const char *filename, myf MyFlags); -extern File my_create_with_symlink(const char *linkname, const char *filename, - int createflags, int access_flags, - myf MyFlags); -extern int my_delete_with_symlink(const char *name, myf MyFlags); -extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags); -extern int my_symlink(const char *content, const char *linkname, myf MyFlags); -extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags); -extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset, - myf MyFlags); -extern int my_rename(const char *from,const char *to,myf MyFlags); -extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags); -extern my_off_t my_tell(File fd,myf MyFlags); -extern uint my_write(File Filedes,const byte *Buffer,uint Count, - myf MyFlags); -extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count, - my_off_t offset,myf MyFlags); -extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags); -extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count, - myf MyFlags); -extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); -extern my_off_t my_ftell(FILE *stream,myf MyFlags); -extern gptr _mymalloc(size_t uSize, const char *sFile, - uint uLine, myf MyFlag); -extern gptr _myrealloc(gptr pPtr, size_t uSize, const char *sFile, - uint uLine, myf MyFlag); -extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...)); -extern void _myfree(gptr pPtr, const char *sFile, uint uLine, myf MyFlag); -extern int _sanity(const char *sFile,unsigned int uLine); -extern gptr _my_memdup(const byte *from, size_t length, - const char *sFile, uint uLine, myf MyFlag); -extern my_string _my_strdup(const char *from, const char *sFile, uint uLine, - myf MyFlag); -extern char *_my_strdup_with_length(const char *from, size_t length, - const char *sFile, uint uLine, - myf MyFlag); - -/* implemented in my_memmem.c */ -extern void *my_memmem(const void *haystack, size_t haystacklen, - const void *needle, size_t needlelen); - - -#ifdef __WIN__ -extern int my_access(const char *path, int amode); -extern File my_sopen(const char *path, int oflag, int shflag, int pmode); -#else -#define my_access access -#endif -extern int check_if_legal_filename(const char *path); - -#if defined(__WIN__) && defined(__NT__) -extern int nt_share_delete(const char *name,myf MyFlags); -#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags)) -#else -#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags)) -#endif - -#ifndef TERMINATE -extern void TERMINATE(FILE *file); -#endif -extern void init_glob_errs(void); -extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); -extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); -extern int my_fclose(FILE *fd,myf MyFlags); -extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); -extern int my_sync(File fd, myf my_flags); -extern int my_error _VARARGS((int nr,myf MyFlags, ...)); -extern int my_printf_error _VARARGS((uint my_err, const char *format, - myf MyFlags, ...)) - ATTRIBUTE_FORMAT(printf, 2, 4); -extern int my_error_register(const char **errmsgs, int first, int last); -extern const char **my_error_unregister(int first, int last); -extern int my_message(uint my_err, const char *str,myf MyFlags); -extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags); -extern int my_message_curses(uint my_err, const char *str,myf MyFlags); -extern my_bool my_init(void); -extern void my_end(int infoflag); -extern int my_redel(const char *from, const char *to, int MyFlags); -extern int my_copystat(const char *from, const char *to, int MyFlags); -extern my_string my_filename(File fd); - -#ifndef THREAD -extern void dont_break(void); -extern void allow_break(void); -#else -#define dont_break() -#define allow_break() -#endif - -extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); -extern char *my_tmpdir(MY_TMPDIR *tmpdir); -extern void free_tmpdir(MY_TMPDIR *tmpdir); - -extern void my_remember_signal(int signal_number,sig_handler (*func)(int)); -extern uint dirname_part(my_string to,const char *name); -extern uint dirname_length(const char *name); -#define base_name(A) (A+dirname_length(A)) -extern int test_if_hard_path(const char *dir_name); -extern my_bool has_path(const char *name); -extern char *convert_dirname(char *to, const char *from, const char *from_end); -extern void to_unix_path(my_string name); -extern my_string fn_ext(const char *name); -extern my_string fn_same(my_string toname,const char *name,int flag); -extern my_string fn_format(my_string to,const char *name,const char *dir, - const char *form, uint flag); -extern size_s strlength(const char *str); -extern void pack_dirname(my_string to,const char *from); -extern uint unpack_dirname(my_string to,const char *from); -extern uint cleanup_dirname(my_string to,const char *from); -extern uint system_filename(my_string to,const char *from); -extern uint unpack_filename(my_string to,const char *from); -extern my_string intern_filename(my_string to,const char *from); -extern my_string directory_file_name(my_string dst, const char *src); -extern int pack_filename(my_string to, const char *name, size_s max_length); -extern my_string my_path(my_string to,const char *progname, - const char *own_pathname_part); -extern my_string my_load_path(my_string to, const char *path, - const char *own_path_prefix); -extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern); -extern WF_PACK *wf_comp(my_string str); -extern int wf_test(struct wild_file_pack *wf_pack,const char *name); -extern void wf_end(struct wild_file_pack *buffer); -extern size_s strip_sp(my_string str); -extern my_bool array_append_string_unique(const char *str, - const char **array, size_t size); -extern void get_date(my_string to,int timeflag,time_t use_time); -extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage); -extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file, - uint reclength,enum cache_type type, - pbool use_async_io); -extern int read_cache_record(RECORD_CACHE *info,byte *to); -extern int end_record_cache(RECORD_CACHE *info); -extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, - const byte *record,uint length); -extern int flush_write_cache(RECORD_CACHE *info); -extern long my_clock(void); -extern sig_handler sigtstp_handler(int signal_number); -extern void handle_recived_signals(void); - -extern sig_handler my_set_alarm_variable(int signo); -extern void my_string_ptr_sort(void *base,uint items,size_s size); -extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, - size_s size_of_element,uchar *buffer[]); -extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, - qsort_cmp cmp); -extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, - qsort2_cmp cmp, void *cmp_argument); -extern qsort2_cmp get_ptr_compare(uint); -void my_store_ptr(byte *buff, uint pack_length, my_off_t pos); -my_off_t my_get_ptr(byte *ptr, uint pack_length); -extern int init_io_cache(IO_CACHE *info,File file,uint cachesize, - enum cache_type type,my_off_t seek_offset, - pbool use_async_io, myf cache_myflags); -extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, - my_off_t seek_offset,pbool use_async_io, - pbool clear_cache); -extern void setup_io_cache(IO_CACHE* info); -extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); -#ifdef THREAD -extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); -extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, - IO_CACHE *write_cache, uint num_threads); -extern void remove_io_thread(IO_CACHE *info); -#endif -extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count); -extern int _my_b_net_read(IO_CACHE *info,byte *Buffer,uint Count); -extern int _my_b_get(IO_CACHE *info); -extern int _my_b_async_read(IO_CACHE *info,byte *Buffer,uint Count); -extern int _my_b_write(IO_CACHE *info,const byte *Buffer,uint Count); -extern int my_b_append(IO_CACHE *info,const byte *Buffer,uint Count); -extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count); - -extern int my_block_write(IO_CACHE *info, const byte *Buffer, - uint Count, my_off_t pos); -extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock); - -#define flush_io_cache(info) my_b_flush_io_cache((info),1) - -extern int end_io_cache(IO_CACHE *info); -extern uint my_b_fill(IO_CACHE *info); -extern void my_b_seek(IO_CACHE *info,my_off_t pos); -extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length); -extern my_off_t my_b_filelength(IO_CACHE *info); -extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...); -extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); -extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, - const char *prefix, uint cache_size, - myf cache_myflags); -extern my_bool real_open_cached_file(IO_CACHE *cache); -extern void close_cached_file(IO_CACHE *cache); -File create_temp_file(char *to, const char *dir, const char *pfx, - int mode, myf MyFlags); -#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO) -#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) -extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, - uint init_alloc,uint alloc_increment - CALLER_INFO_PROTO); -extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); -extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); -extern byte *pop_dynamic(DYNAMIC_ARRAY*); -extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); -extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); -extern void delete_dynamic(DYNAMIC_ARRAY *array); -extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); -extern void freeze_size(DYNAMIC_ARRAY *array); -#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element) -#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index)) -#define push_dynamic(A,B) insert_dynamic(A,B) -#define reset_dynamic(array) ((array)->elements= 0) - -extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, - uint init_alloc,uint alloc_increment); -extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); -my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, - uint length); -extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, - ...); -extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); -extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size); -extern void dynstr_free(DYNAMIC_STRING *str); -#ifdef HAVE_MLOCK -extern byte *my_malloc_lock(uint length,myf flags); -extern void my_free_lock(byte *ptr,myf flags); -#else -#define my_malloc_lock(A,B) my_malloc((A),(B)) -#define my_free_lock(A,B) my_free((A),(B)) -#endif -#define alloc_root_inited(A) ((A)->min_malloc != 0) -#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) -#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0) -extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, - uint pre_alloc_size); -extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); -extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...); -extern void free_root(MEM_ROOT *root, myf MyFLAGS); -extern void set_prealloc_root(MEM_ROOT *root, char *ptr); -extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, - uint prealloc_size); -extern char *strdup_root(MEM_ROOT *root,const char *str); -extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); -extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); -extern int get_defaults_options(int argc, char **argv, - char **defaults, char **extra_defaults, - char **group_suffix); -extern int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); -extern int modify_defaults_file(const char *file_location, const char *option, - const char *option_value, - const char *section_name, int remove_option); -extern int my_search_option_files(const char *conf_file, int *argc, - char ***argv, uint *args_used, - Process_option_func func, void *func_ctx); -extern void free_defaults(char **argv); -extern void my_print_default_files(const char *conf_file); -extern void print_defaults(const char *conf_file, const char **groups); -extern my_bool my_compress(byte *, ulong *, ulong *); -extern my_bool my_uncompress(byte *, ulong *, ulong *); -extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); -extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); -extern uint my_bit_log2(ulong value); -extern uint my_count_bits(ulonglong v); -extern uint my_count_bits_ushort(ushort v); -extern void my_sleep(ulong m_seconds); -extern ulong crc32(ulong crc, const uchar *buf, uint len); -extern uint my_set_max_open_files(uint files); -void my_free_open_file_info(void); - -ulonglong my_getsystime(void); -my_bool my_gethwaddr(uchar *to); - -#ifdef HAVE_SYS_MMAN_H -#include - -#ifndef MAP_NOSYNC -#define MAP_NOSYNC 0 -#endif - -#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f) -#define my_munmap(a,b) munmap((a),(b)) - -#else -/* not a complete set of mmap() flags, but only those that nesessary */ -#define PROT_READ 1 -#define PROT_WRITE 2 -#define MAP_SHARED 0x0001 -#define MAP_NOSYNC 0x0800 -#define MAP_FAILED ((void *)-1) -#define MS_SYNC 0x0000 - -#ifndef __NETWARE__ -#define HAVE_MMAP -#endif - -void *my_mmap(void *, size_t, int, int, int, my_off_t); -int my_munmap(void *, size_t); -#endif - -/* my_getpagesize */ -#ifdef HAVE_GETPAGESIZE -#define my_getpagesize() getpagesize() -#else -int my_getpagesize(void); -#endif - -int my_msync(int, void *, size_t, int); - -/* character sets */ -extern uint get_charset_number(const char *cs_name, uint cs_flags); -extern uint get_collation_number(const char *name); -extern const char *get_charset_name(uint cs_number); - -extern CHARSET_INFO *get_charset(uint cs_number, myf flags); -extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); -extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, - uint cs_flags, myf my_flags); -extern CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO - *original_cs); -extern void free_charsets(void); -extern char *get_charsets_dir(char *buf); -extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); -extern my_bool init_compiled_charsets(myf flags); -extern void add_compiled_collation(CHARSET_INFO *cs); -extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, - char *to, ulong to_length, - const char *from, ulong length); -#ifdef __WIN__ -#define BACKSLASH_MBTAIL -/* File system character set */ -extern CHARSET_INFO *fs_character_set(void); -#endif -extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info, - char *to, ulong to_length, - const char *from, ulong length); - -extern void thd_increment_bytes_sent(ulong length); -extern void thd_increment_bytes_received(ulong length); -extern void thd_increment_net_big_packet_count(ulong length); - -#ifdef __WIN__ -extern my_bool have_tcpip; /* Is set if tcpip is used */ - -/* implemented in my_windac.c */ - -int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, - DWORD owner_rights, DWORD everybody_rights); - -void my_security_attr_free(SECURITY_ATTRIBUTES *sa); - -/* implemented in my_conio.c */ -char* my_cgets(char *string, unsigned long clen, unsigned long* plen); - -#endif -#ifdef __NETWARE__ -void netware_reg_user(const char *ip, const char *user, - const char *application); -#endif - -C_MODE_END -#include "raid.h" -#endif /* _my_sys_h */ - diff --git a/dep/include/mysql/mysql.h b/dep/include/mysql/mysql.h deleted file mode 100644 index 4d4a3eb67c9..00000000000 --- a/dep/include/mysql/mysql.h +++ /dev/null @@ -1,872 +0,0 @@ -/* Copyright (C) 2000-2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - This file defines the client API to MySQL and also the ABI of the - dynamically linked libmysqlclient. - - The ABI should never be changed in a released product of MySQL - thus you need to take great care when changing the file. In case - the file is changed so the ABI is broken, you must also - update the SHAREDLIB_MAJOR_VERSION in configure.in . - -*/ - -#ifndef _mysql_h -#define _mysql_h - -#ifdef _AIX /* large-file support will break without this */ -#include -#endif - -#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ -#undef WIN -#undef _WIN -#undef _WIN32 -#undef _WIN64 -#undef __WIN__ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _global_h /* If not standard header */ -#include -#ifdef __LCC__ -#include /* For windows */ -#endif -typedef char my_bool; -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) -#define __WIN__ -#endif -#if !defined(__WIN__) -#define STDCALL -#else -#define STDCALL __stdcall -#endif -typedef char * gptr; - -#ifndef my_socket_defined -#ifdef __WIN__ -#define my_socket SOCKET -#else -typedef int my_socket; -#endif /* __WIN__ */ -#endif /* my_socket_defined */ -#endif /* _global_h */ - -#include "mysql_version.h" -#include "mysql_com.h" -#include "mysql_time.h" -#include "typelib.h" - -#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ - -extern unsigned int mysql_port; -extern char *mysql_unix_port; - -#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ -#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ - -#ifdef __NETWARE__ -// GCC have alternative #pragma pack(8) syntax and old gcc version not support pack(push,8), also any gcc version not support it at some paltform -#if defined( __GNUC__ ) -#pragma pack(8) -#else -#pragma pack(push,8) -#endif - -#endif - -#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) -#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) -#define IS_BLOB(n) ((n) & BLOB_FLAG) -#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL) -#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) -#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR) -#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) - - -typedef struct st_mysql_field { - char *name; /* Name of column */ - char *org_name; /* Original column name, if an alias */ - char *table; /* Table of column if column was a field */ - char *org_table; /* Org table name, if table was an alias */ - char *db; /* Database for table */ - char *catalog; /* Catalog for table */ - char *def; /* Default value (set by mysql_list_fields) */ - unsigned long length; /* Width of column (create length) */ - unsigned long max_length; /* Max width for selected set */ - unsigned int name_length; - unsigned int org_name_length; - unsigned int table_length; - unsigned int org_table_length; - unsigned int db_length; - unsigned int catalog_length; - unsigned int def_length; - unsigned int flags; /* Div flags */ - unsigned int decimals; /* Number of decimals in field */ - unsigned int charsetnr; /* Character set */ - enum enum_field_types type; /* Type of field. See mysql_com.h for types */ -} MYSQL_FIELD; - -typedef char **MYSQL_ROW; /* return data as array of strings */ -typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ - -#ifndef _global_h -#if defined(NO_CLIENT_LONG_LONG) -typedef unsigned long my_ulonglong; -#elif defined (__WIN__) -typedef unsigned __int64 my_ulonglong; -#else -typedef unsigned long long my_ulonglong; -#endif -#endif - -#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) - -/* backward compatibility define - to be removed eventually */ -#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED - -typedef struct st_mysql_rows { - struct st_mysql_rows *next; /* list of rows */ - MYSQL_ROW data; - unsigned long length; -} MYSQL_ROWS; - -typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ - -#include "my_alloc.h" - -typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; -typedef struct st_mysql_data { - my_ulonglong rows; - unsigned int fields; - MYSQL_ROWS *data; - MEM_ROOT alloc; - /* extra info for embedded library */ - struct embedded_query_result *embedded_info; -} MYSQL_DATA; - -enum mysql_option -{ - MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, - MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, - MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, - MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, - MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, - MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, - MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, - MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, - MYSQL_OPT_SSL_VERIFY_SERVER_CERT -}; - -struct st_mysql_options { - unsigned int connect_timeout, read_timeout, write_timeout; - unsigned int port, protocol; - unsigned long client_flag; - char *host,*user,*password,*unix_socket,*db; - struct st_dynamic_array *init_commands; - char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; - char *ssl_key; /* PEM key file */ - char *ssl_cert; /* PEM cert file */ - char *ssl_ca; /* PEM CA file */ - char *ssl_capath; /* PEM directory of CA-s? */ - char *ssl_cipher; /* cipher to use */ - char *shared_memory_base_name; - unsigned long max_allowed_packet; - my_bool use_ssl; /* if to use SSL or not */ - my_bool compress,named_pipe; - /* - On connect, find out the replication role of the server, and - establish connections to all the peers - */ - my_bool rpl_probe; - /* - Each call to mysql_real_query() will parse it to tell if it is a read - or a write, and direct it to the slave or the master - */ - my_bool rpl_parse; - /* - If set, never read from a master, only from slave, when doing - a read that is replication-aware - */ - my_bool no_master_reads; -#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY) - my_bool separate_thread; -#endif - enum mysql_option methods_to_use; - char *client_ip; - /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ - my_bool secure_auth; - /* 0 - never report, 1 - always report (default) */ - my_bool report_data_truncation; - - /* function pointers for local infile support */ - int (*local_infile_init)(void **, const char *, void *); - int (*local_infile_read)(void *, char *, unsigned int); - void (*local_infile_end)(void *); - int (*local_infile_error)(void *, char *, unsigned int); - void *local_infile_userdata; -}; - -enum mysql_status -{ - MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT -}; - -enum mysql_protocol_type -{ - MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, - MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY -}; -/* - There are three types of queries - the ones that have to go to - the master, the ones that go to a slave, and the adminstrative - type which must happen on the pivot connectioin -*/ -enum mysql_rpl_type -{ - MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN -}; - -typedef struct character_set -{ - unsigned int number; /* character set number */ - unsigned int state; /* character set state */ - const char *csname; /* collation name */ - const char *name; /* character set name */ - const char *comment; /* comment */ - const char *dir; /* character set directory */ - unsigned int mbminlen; /* min. length for multibyte strings */ - unsigned int mbmaxlen; /* max. length for multibyte strings */ -} MY_CHARSET_INFO; - -struct st_mysql_methods; -struct st_mysql_stmt; - -typedef struct st_mysql -{ - NET net; /* Communication parameters */ - gptr connector_fd; /* ConnectorFd for SSL */ - char *host,*user,*passwd,*unix_socket,*server_version,*host_info,*info; - char *db; - struct charset_info_st *charset; - MYSQL_FIELD *fields; - MEM_ROOT field_alloc; - my_ulonglong affected_rows; - my_ulonglong insert_id; /* id if insert on table with NEXTNR */ - my_ulonglong extra_info; /* Not used */ - unsigned long thread_id; /* Id for connection in server */ - unsigned long packet_length; - unsigned int port; - unsigned long client_flag,server_capabilities; - unsigned int protocol_version; - unsigned int field_count; - unsigned int server_status; - unsigned int server_language; - unsigned int warning_count; - struct st_mysql_options options; - enum mysql_status status; - my_bool free_me; /* If free in mysql_close */ - my_bool reconnect; /* set to 1 if automatic reconnect */ - - /* session-wide random string */ - char scramble[SCRAMBLE_LENGTH+1]; - - /* - Set if this is the original connection, not a master or a slave we have - added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave() - */ - my_bool rpl_pivot; - /* - Pointers to the master, and the next slave connections, points to - itself if lone connection. - */ - struct st_mysql* master, *next_slave; - - struct st_mysql* last_used_slave; /* needed for round-robin slave pick */ - /* needed for send/read/store/use result to work correctly with replication */ - struct st_mysql* last_used_con; - - LIST *stmts; /* list of all statements */ - const struct st_mysql_methods *methods; - void *thd; - /* - Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag - from mysql_stmt_close if close had to cancel result set of this object. - */ - my_bool *unbuffered_fetch_owner; -#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100 - /* needed for embedded server - no net buffer to store the 'info' */ - char *info_buffer; -#endif -} MYSQL; - -typedef struct st_mysql_res { - my_ulonglong row_count; - MYSQL_FIELD *fields; - MYSQL_DATA *data; - MYSQL_ROWS *data_cursor; - unsigned long *lengths; /* column lengths of current row */ - MYSQL *handle; /* for unbuffered reads */ - MEM_ROOT field_alloc; - unsigned int field_count, current_field; - MYSQL_ROW row; /* If unbuffered read */ - MYSQL_ROW current_row; /* buffer to current row */ - my_bool eof; /* Used by mysql_fetch_row */ - /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; - const struct st_mysql_methods *methods; -} MYSQL_RES; - -#define MAX_MYSQL_MANAGER_ERR 256 -#define MAX_MYSQL_MANAGER_MSG 256 - -#define MANAGER_OK 200 -#define MANAGER_INFO 250 -#define MANAGER_ACCESS 401 -#define MANAGER_CLIENT_ERR 450 -#define MANAGER_INTERNAL_ERR 500 - -#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) -#define MYSQL_CLIENT -#endif - - -typedef struct st_mysql_manager -{ - NET net; - char *host,*user,*passwd; - unsigned int port; - my_bool free_me; - my_bool eof; - int cmd_status; - int last_errno; - char* net_buf,*net_buf_pos,*net_data_end; - int net_buf_size; - char last_error[MAX_MYSQL_MANAGER_ERR]; -} MYSQL_MANAGER; - -typedef struct st_mysql_parameters -{ - unsigned long *p_max_allowed_packet; - unsigned long *p_net_buffer_length; -} MYSQL_PARAMETERS; - -#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) -#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) -#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) -#endif - -/* - Set up and bring down the server; to ensure that applications will - work when linked against either the standard client library or the - embedded server library, these functions should be called. -*/ -int STDCALL mysql_server_init(int argc, char **argv, char **groups); -void STDCALL mysql_server_end(void); -/* - mysql_server_init/end need to be called when using libmysqld or - libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so - you don't need to call it explicitely; but you need to call - mysql_server_end() to free memory). The names are a bit misleading - (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general - names which suit well whether you're using libmysqld or libmysqlclient. We - intend to promote these aliases over the mysql_server* ones. -*/ -#define mysql_library_init mysql_server_init -#define mysql_library_end mysql_server_end - -MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); - -/* - Set up and bring down a thread; these function should be called - for each thread in an application which opens at least one MySQL - connection. All uses of the connection(s) should be between these - function calls. -*/ -my_bool STDCALL mysql_thread_init(void); -void STDCALL mysql_thread_end(void); - -/* - Functions to get information from the MYSQL and MYSQL_RES structures - Should definitely be used if one uses shared libraries. -*/ - -my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); -unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); -my_bool STDCALL mysql_eof(MYSQL_RES *res); -MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, - unsigned int fieldnr); -MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); -MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); -MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); - -unsigned int STDCALL mysql_field_count(MYSQL *mysql); -my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); -my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); -unsigned int STDCALL mysql_errno(MYSQL *mysql); -const char * STDCALL mysql_error(MYSQL *mysql); -const char *STDCALL mysql_sqlstate(MYSQL *mysql); -unsigned int STDCALL mysql_warning_count(MYSQL *mysql); -const char * STDCALL mysql_info(MYSQL *mysql); -unsigned long STDCALL mysql_thread_id(MYSQL *mysql); -const char * STDCALL mysql_character_set_name(MYSQL *mysql); -int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); - -MYSQL * STDCALL mysql_init(MYSQL *mysql); -my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, - const char *cert, const char *ca, - const char *capath, const char *cipher); -const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, - const char *passwd, const char *db); -MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, - const char *user, - const char *passwd, - const char *db, - unsigned int port, - const char *unix_socket, - unsigned long clientflag); -int STDCALL mysql_select_db(MYSQL *mysql, const char *db); -int STDCALL mysql_query(MYSQL *mysql, const char *q); -int STDCALL mysql_send_query(MYSQL *mysql, const char *q, - unsigned long length); -int STDCALL mysql_real_query(MYSQL *mysql, const char *q, - unsigned long length); -MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); - -/* perform query on master */ -my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length); -/* perform query on slave */ -my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length); -void STDCALL mysql_get_character_set_info(MYSQL *mysql, - MY_CHARSET_INFO *charset); - -/* local infile support */ - -#define LOCAL_INFILE_ERROR_LEN 512 - -void -mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *, - void *), - int (*local_infile_read)(void *, char *, - unsigned int), - void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char*, - unsigned int), - void *); - -void -mysql_set_local_infile_default(MYSQL *mysql); - - -/* - enable/disable parsing of all queries to decide if they go on master or - slave -*/ -void STDCALL mysql_enable_rpl_parse(MYSQL* mysql); -void STDCALL mysql_disable_rpl_parse(MYSQL* mysql); -/* get the value of the parse flag */ -int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql); - -/* enable/disable reads from master */ -void STDCALL mysql_enable_reads_from_master(MYSQL* mysql); -void STDCALL mysql_disable_reads_from_master(MYSQL* mysql); -/* get the value of the master read flag */ -my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql); - -enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len); - -/* discover the master and its slaves */ -my_bool STDCALL mysql_rpl_probe(MYSQL* mysql); - -/* set the master, close/free the old one, if it is not a pivot */ -int STDCALL mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); - -int STDCALL mysql_shutdown(MYSQL *mysql, - enum mysql_enum_shutdown_level - shutdown_level); -int STDCALL mysql_dump_debug_info(MYSQL *mysql); -int STDCALL mysql_refresh(MYSQL *mysql, - unsigned int refresh_options); -int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); -int STDCALL mysql_set_server_option(MYSQL *mysql, - enum enum_mysql_set_option - option); -int STDCALL mysql_ping(MYSQL *mysql); -const char * STDCALL mysql_stat(MYSQL *mysql); -const char * STDCALL mysql_get_server_info(MYSQL *mysql); -const char * STDCALL mysql_get_client_info(void); -unsigned long STDCALL mysql_get_client_version(void); -const char * STDCALL mysql_get_host_info(MYSQL *mysql); -unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); -unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); -int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, - const char *arg); -void STDCALL mysql_free_result(MYSQL_RES *result); -void STDCALL mysql_data_seek(MYSQL_RES *result, - my_ulonglong offset); -MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, - MYSQL_ROW_OFFSET offset); -MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, - MYSQL_FIELD_OFFSET offset); -MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); -unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); -MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); -MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, - const char *wild); -unsigned long STDCALL mysql_escape_string(char *to,const char *from, - unsigned long from_length); -unsigned long STDCALL mysql_hex_string(char *to,const char *from, - unsigned long from_length); -unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, - char *to,const char *from, - unsigned long length); -void STDCALL mysql_debug(const char *debug); -void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); -unsigned int STDCALL mysql_thread_safe(void); -my_bool STDCALL mysql_embedded(void); -MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con); -MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port); -void STDCALL mysql_manager_close(MYSQL_MANAGER* con); -int STDCALL mysql_manager_command(MYSQL_MANAGER* con, - const char* cmd, int cmd_len); -int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, - char* res_buf, - int res_buf_size); -my_bool STDCALL mysql_read_query_result(MYSQL *mysql); - - -/* - The following definitions are added for the enhanced - client-server protocol -*/ - -/* statement state */ -enum enum_mysql_stmt_state -{ - MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, - MYSQL_STMT_FETCH_DONE -}; - - -/* - This structure is used to define bind information, and - internally by the client library. - Public members with their descriptions are listed below - (conventionally `On input' refers to the binds given to - mysql_stmt_bind_param, `On output' refers to the binds given - to mysql_stmt_bind_result): - - buffer_type - One of the MYSQL_* types, used to describe - the host language type of buffer. - On output: if column type is different from - buffer_type, column value is automatically converted - to buffer_type before it is stored in the buffer. - buffer - On input: points to the buffer with input data. - On output: points to the buffer capable to store - output data. - The type of memory pointed by buffer must correspond - to buffer_type. See the correspondence table in - the comment to mysql_stmt_bind_param. - - The two above members are mandatory for any kind of bind. - - buffer_length - the length of the buffer. You don't have to set - it for any fixed length buffer: float, double, - int, etc. It must be set however for variable-length - types, such as BLOBs or STRINGs. - - length - On input: in case when lengths of input values - are different for each execute, you can set this to - point at a variable containining value length. This - way the value length can be different in each execute. - If length is not NULL, buffer_length is not used. - Note, length can even point at buffer_length if - you keep bind structures around while fetching: - this way you can change buffer_length before - each execution, everything will work ok. - On output: if length is set, mysql_stmt_fetch will - write column length into it. - - is_null - On input: points to a boolean variable that should - be set to TRUE for NULL values. - This member is useful only if your data may be - NULL in some but not all cases. - If your data is never NULL, is_null should be set to 0. - If your data is always NULL, set buffer_type - to MYSQL_TYPE_NULL, and is_null will not be used. - - is_unsigned - On input: used to signify that values provided for one - of numeric types are unsigned. - On output describes signedness of the output buffer. - If, taking into account is_unsigned flag, column data - is out of range of the output buffer, data for this column - is regarded truncated. Note that this has no correspondence - to the sign of result set column, if you need to find it out - use mysql_stmt_result_metadata. - error - where to write a truncation error if it is present. - possible error value is: - 0 no truncation - 1 value is out of range or buffer is too small - - Please note that MYSQL_BIND also has internals members. -*/ - -typedef struct st_mysql_bind -{ - unsigned long *length; /* output length pointer */ - my_bool *is_null; /* Pointer to null indicator */ - void *buffer; /* buffer to get/put data */ - /* set this if you want to track data truncations happened during fetch */ - my_bool *error; - enum enum_field_types buffer_type; /* buffer type */ - /* output buffer length, must be set when fetching str/binary */ - unsigned long buffer_length; - unsigned char *row_ptr; /* for the current data position */ - unsigned long offset; /* offset position for char/binary fetch */ - unsigned long length_value; /* Used if length is 0 */ - unsigned int param_number; /* For null count and error messages */ - unsigned int pack_length; /* Internal length for packed data */ - my_bool error_value; /* used if error is 0 */ - my_bool is_unsigned; /* set if integer type is unsigned */ - my_bool long_data_used; /* If used with mysql_send_long_data */ - my_bool is_null_value; /* Used if is_null is 0 */ - void (*store_param_func)(NET *net, struct st_mysql_bind *param); - void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, - unsigned char **row); - void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, - unsigned char **row); -} MYSQL_BIND; - - -/* statement handler */ -typedef struct st_mysql_stmt -{ - MEM_ROOT mem_root; /* root allocations */ - LIST list; /* list to keep track of all stmts */ - MYSQL *mysql; /* connection handle */ - MYSQL_BIND *params; /* input parameters */ - MYSQL_BIND *bind; /* output parameters */ - MYSQL_FIELD *fields; /* result set metadata */ - MYSQL_DATA result; /* cached result set */ - MYSQL_ROWS *data_cursor; /* current row in cached result */ - /* copy of mysql->affected_rows after statement execution */ - my_ulonglong affected_rows; - my_ulonglong insert_id; /* copy of mysql->insert_id */ - /* - mysql_stmt_fetch() calls this function to fetch one row (it's different - for buffered, unbuffered and cursor fetch). - */ - int (*read_row_func)(struct st_mysql_stmt *stmt, - unsigned char **row); - unsigned long stmt_id; /* Id for prepared statement */ - unsigned long flags; /* i.e. type of cursor to open */ - unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ - /* - Copied from mysql->server_status after execute/fetch to know - server-side cursor status for this statement. - */ - unsigned int server_status; - unsigned int last_errno; /* error code */ - unsigned int param_count; /* input parameter count */ - unsigned int field_count; /* number of columns in result set */ - enum enum_mysql_stmt_state state; /* statement state */ - char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ - char sqlstate[SQLSTATE_LENGTH+1]; - /* Types of input parameters should be sent to server */ - my_bool send_types_to_server; - my_bool bind_param_done; /* input buffers were supplied */ - unsigned char bind_result_done; /* output buffers were supplied */ - /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; - /* - Is set to true if we need to calculate field->max_length for - metadata fields when doing mysql_stmt_store_result. - */ - my_bool update_max_length; -} MYSQL_STMT; - -enum enum_stmt_attr_type -{ - /* - When doing mysql_stmt_store_result calculate max_length attribute - of statement metadata. This is to be consistent with the old API, - where this was done automatically. - In the new API we do that only by request because it slows down - mysql_stmt_store_result sufficiently. - */ - STMT_ATTR_UPDATE_MAX_LENGTH, - /* - unsigned long with combination of cursor flags (read only, for update, - etc) - */ - STMT_ATTR_CURSOR_TYPE, - /* - Amount of rows to retrieve from server per one fetch if using cursors. - Accepts unsigned long attribute in the range 1 - ulong_max - */ - STMT_ATTR_PREFETCH_ROWS -}; - - -typedef struct st_mysql_methods -{ - my_bool (*read_query_result)(MYSQL *mysql); - my_bool (*advanced_command)(MYSQL *mysql, - enum enum_server_command command, - const char *header, - unsigned long header_length, - const char *arg, - unsigned long arg_length, - my_bool skip_check, - MYSQL_STMT *stmt); - MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, - unsigned int fields); - MYSQL_RES * (*use_result)(MYSQL *mysql); - void (*fetch_lengths)(unsigned long *to, - MYSQL_ROW column, unsigned int field_count); - void (*flush_use_result)(MYSQL *mysql); -#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) - MYSQL_FIELD * (*list_fields)(MYSQL *mysql); - my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); - int (*stmt_execute)(MYSQL_STMT *stmt); - int (*read_binary_rows)(MYSQL_STMT *stmt); - int (*unbuffered_fetch)(MYSQL *mysql, char **row); - void (*free_embedded_thd)(MYSQL *mysql); - const char *(*read_statistics)(MYSQL *mysql); - my_bool (*next_result)(MYSQL *mysql); - int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd); - int (*read_rows_from_cursor)(MYSQL_STMT *stmt); -#endif -} MYSQL_METHODS; - - -MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); -int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, - unsigned long length); -int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, - unsigned int column, - unsigned long offset); -int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); -unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *attr); -my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *attr); -my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, - unsigned int param_number, - const char *data, - unsigned long length); -MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); -MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); -unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); -const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt); -const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt); -MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, - MYSQL_ROW_OFFSET offset); -MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt); -void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); -my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); -my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); -my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); -unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); - -my_bool STDCALL mysql_commit(MYSQL * mysql); -my_bool STDCALL mysql_rollback(MYSQL * mysql); -my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); -my_bool STDCALL mysql_more_results(MYSQL *mysql); -int STDCALL mysql_next_result(MYSQL *mysql); -void STDCALL mysql_close(MYSQL *sock); - - -/* status return codes */ -#define MYSQL_NO_DATA 100 -#define MYSQL_DATA_TRUNCATED 101 - -#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) - -#ifdef USE_OLD_FUNCTIONS -MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, - const char *user, const char *passwd); -int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); -int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) -#endif -#define HAVE_MYSQL_REAL_CONNECT - -/* - The following functions are mainly exported because of mysqlbinlog; - They are not for general usage -*/ - -#define simple_command(mysql, command, arg, length, skip_check) \ - (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ - 0, arg, length, skip_check, NULL) -#define stmt_command(mysql, command, arg, length, stmt) \ - (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ - 0, arg, length, 1, stmt) - -#ifdef __NETWARE__ - -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some paltform -#if defined( __GNUC__ ) -#pragma pack() -#else -#pragma pack(pop) -#endif - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _mysql_h */ - diff --git a/dep/include/mysql/mysql_com.h b/dep/include/mysql/mysql_com.h deleted file mode 100644 index 0669a7e0d02..00000000000 --- a/dep/include/mysql/mysql_com.h +++ /dev/null @@ -1,468 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* -** Common definition between mysql server & client -*/ - -#ifndef _mysql_com_h -#define _mysql_com_h - -#define NAME_LEN 64 /* Field/table name length */ -#define HOSTNAME_LENGTH 60 -#define USERNAME_LENGTH 16 -#define SERVER_VERSION_LENGTH 60 -#define SQLSTATE_LENGTH 5 - -/* - USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain - username and hostname parts of the user identifier with trailing zero in - MySQL standard format: - user_name_part@host_name_part\0 -*/ -#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 - -#define LOCAL_HOST "localhost" -#define LOCAL_HOST_NAMEDPIPE "." - - -#if defined(__WIN__) && !defined( _CUSTOMCONFIG_) -#define MYSQL_NAMEDPIPE "MySQL" -#define MYSQL_SERVICENAME "MySQL" -#endif /* __WIN__ */ - -/* - You should add new commands to the end of this list, otherwise old - servers won't be able to handle them as 'unsupported'. -*/ - -enum enum_server_command -{ - COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, - COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, - COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, - COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, - COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, - COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, - COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, - /* don't forget to update const char *command_name[] in sql_parse.cc */ - - /* Must be last */ - COM_END -}; - - -/* - Length of random string sent by server on handshake; this is also length of - obfuscated password, recieved from client -*/ -#define SCRAMBLE_LENGTH 20 -#define SCRAMBLE_LENGTH_323 8 -/* length of password stored in the db: new passwords are preceeded with '*' */ -#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1) -#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2) - - -#define NOT_NULL_FLAG 1 /* Field can't be NULL */ -#define PRI_KEY_FLAG 2 /* Field is part of a primary key */ -#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */ -#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */ -#define BLOB_FLAG 16 /* Field is a blob */ -#define UNSIGNED_FLAG 32 /* Field is unsigned */ -#define ZEROFILL_FLAG 64 /* Field is zerofill */ -#define BINARY_FLAG 128 /* Field is binary */ - -/* The following are only sent to new clients */ -#define ENUM_FLAG 256 /* field is an enum */ -#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ -#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ -#define SET_FLAG 2048 /* field is a set */ -#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */ -#define NUM_FLAG 32768 /* Field is num (for clients) */ -#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ -#define GROUP_FLAG 32768 /* Intern: Group field */ -#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ -#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ - -#define REFRESH_GRANT 1 /* Refresh grant tables */ -#define REFRESH_LOG 2 /* Start on new log file */ -#define REFRESH_TABLES 4 /* close all tables */ -#define REFRESH_HOSTS 8 /* Flush host cache */ -#define REFRESH_STATUS 16 /* Flush status variables */ -#define REFRESH_THREADS 32 /* Flush thread cache */ -#define REFRESH_SLAVE 64 /* Reset master info and restart slave - thread */ -#define REFRESH_MASTER 128 /* Remove all bin logs in the index - and truncate the index */ - -/* The following can't be set with mysql_refresh() */ -#define REFRESH_READ_LOCK 16384 /* Lock tables for read */ -#define REFRESH_FAST 32768 /* Intern flag */ - -/* RESET (remove all queries) from query cache */ -#define REFRESH_QUERY_CACHE 65536 -#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ -#define REFRESH_DES_KEY_FILE 0x40000L -#define REFRESH_USER_RESOURCES 0x80000L - -#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ -#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ -#define CLIENT_LONG_FLAG 4 /* Get all column flags */ -#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ -#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */ -#define CLIENT_COMPRESS 32 /* Can use compression protocol */ -#define CLIENT_ODBC 64 /* Odbc client */ -#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ -#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ -#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */ -#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ -#define CLIENT_SSL 2048 /* Switch to SSL after handshake */ -#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ -#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ -#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ -#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ -#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ -#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ - -#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) -#define CLIENT_REMEMBER_OPTIONS (1UL << 31) - -#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ -#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ -#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ -#define SERVER_QUERY_NO_GOOD_INDEX_USED 16 -#define SERVER_QUERY_NO_INDEX_USED 32 -/* - The server was able to fulfill the clients request and opened a - read-only non-scrollable cursor for a query. This flag comes - in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. -*/ -#define SERVER_STATUS_CURSOR_EXISTS 64 -/* - This flag is sent when a read-only cursor is exhausted, in reply to - COM_STMT_FETCH command. -*/ -#define SERVER_STATUS_LAST_ROW_SENT 128 -#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ -#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512 - -#define MYSQL_ERRMSG_SIZE 512 -#define NET_READ_TIMEOUT 30 /* Timeout on read */ -#define NET_WRITE_TIMEOUT 60 /* Timeout on write */ -#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ - -#define ONLY_KILL_QUERY 1 - -struct st_vio; /* Only C */ -typedef struct st_vio Vio; - -#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ -#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ -#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ -#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ -#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ -#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ -#define MAX_BLOB_WIDTH 8192 /* Default width for blob */ - -typedef struct st_net { -#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) - Vio* vio; - unsigned char *buff,*buff_end,*write_pos,*read_pos; - my_socket fd; /* For Perl DBI/dbd */ - unsigned long max_packet,max_packet_size; - unsigned int pkt_nr,compress_pkt_nr; - unsigned int write_timeout, read_timeout, retry_count; - int fcntl; - my_bool compress; - /* - The following variable is set if we are doing several queries in one - command ( as in LOAD TABLE ... FROM MASTER ), - and do not want to confuse the client with OK at the wrong time - */ - unsigned long remain_in_buf,length, buf_length, where_b; - unsigned int *return_status; - unsigned char reading_or_writing; - char save_char; - my_bool no_send_ok; /* For SPs and other things that do multiple stmts */ - my_bool no_send_eof; /* For SPs' first version read-only cursors */ - /* - Set if OK packet is already sent, and we do not need to send error - messages - */ - my_bool no_send_error; - /* - Pointer to query object in query cache, do not equal NULL (0) for - queries in cache that have not stored its results yet - */ -#endif - char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1]; - unsigned int last_errno; - unsigned char error; - - /* - 'query_cache_query' should be accessed only via query cache - functions and methods to maintain proper locking. - */ - gptr query_cache_query; - - my_bool report_error; /* We should report error (we have unreported error) */ - my_bool return_errno; -} NET; - -#define packet_error (~(unsigned long) 0) - -enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, - MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, - MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, - MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, - MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, - MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, - MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, - MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, - MYSQL_TYPE_BIT, - MYSQL_TYPE_NEWDECIMAL=246, - MYSQL_TYPE_ENUM=247, - MYSQL_TYPE_SET=248, - MYSQL_TYPE_TINY_BLOB=249, - MYSQL_TYPE_MEDIUM_BLOB=250, - MYSQL_TYPE_LONG_BLOB=251, - MYSQL_TYPE_BLOB=252, - MYSQL_TYPE_VAR_STRING=253, - MYSQL_TYPE_STRING=254, - MYSQL_TYPE_GEOMETRY=255 - -}; - -/* For backward compatibility */ -#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS -#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL -#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL -#define FIELD_TYPE_TINY MYSQL_TYPE_TINY -#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT -#define FIELD_TYPE_LONG MYSQL_TYPE_LONG -#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT -#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE -#define FIELD_TYPE_NULL MYSQL_TYPE_NULL -#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP -#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG -#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 -#define FIELD_TYPE_DATE MYSQL_TYPE_DATE -#define FIELD_TYPE_TIME MYSQL_TYPE_TIME -#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME -#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR -#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE -#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM -#define FIELD_TYPE_SET MYSQL_TYPE_SET -#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB -#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB -#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB -#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB -#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING -#define FIELD_TYPE_STRING MYSQL_TYPE_STRING -#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY -#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM -#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY -#define FIELD_TYPE_BIT MYSQL_TYPE_BIT - - -/* Shutdown/kill enums and constants */ - -/* Bits for THD::killable. */ -#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) -#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) -#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) -#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) - -enum mysql_enum_shutdown_level { - /* - We want levels to be in growing order of hardness (because we use number - comparisons). Note that DEFAULT does not respect the growing property, but - it's ok. - */ - SHUTDOWN_DEFAULT = 0, - /* wait for existing connections to finish */ - SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT, - /* wait for existing trans to finish */ - SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS, - /* wait for existing updates to finish (=> no partial MyISAM update) */ - SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE, - /* flush InnoDB buffers and other storage engines' buffers*/ - SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), - /* don't flush InnoDB buffers, flush other storage engines' buffers*/ - SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, - /* Now the 2 levels of the KILL command */ -#if MYSQL_VERSION_ID >= 50000 - KILL_QUERY= 254, -#endif - KILL_CONNECTION= 255 -}; - - -enum enum_cursor_type -{ - CURSOR_TYPE_NO_CURSOR= 0, - CURSOR_TYPE_READ_ONLY= 1, - CURSOR_TYPE_FOR_UPDATE= 2, - CURSOR_TYPE_SCROLLABLE= 4 -}; - - -/* options for mysql_set_option */ -enum enum_mysql_set_option -{ - MYSQL_OPTION_MULTI_STATEMENTS_ON, - MYSQL_OPTION_MULTI_STATEMENTS_OFF -}; - -#define net_new_transaction(net) ((net)->pkt_nr=0) - -#ifdef __cplusplus -extern "C" { -#endif - -my_bool my_net_init(NET *net, Vio* vio); -void my_net_local_init(NET *net); -void net_end(NET *net); -void net_clear(NET *net); -my_bool net_realloc(NET *net, unsigned long length); -my_bool net_flush(NET *net); -my_bool my_net_write(NET *net,const char *packet,unsigned long len); -my_bool net_write_command(NET *net,unsigned char command, - const char *header, unsigned long head_len, - const char *packet, unsigned long len); -int net_real_write(NET *net,const char *packet,unsigned long len); -unsigned long my_net_read(NET *net); - -#ifdef _global_h -void my_net_set_write_timeout(NET *net, uint timeout); -void my_net_set_read_timeout(NET *net, uint timeout); -#endif - -/* - The following function is not meant for normal usage - Currently it's used internally by manager.c -*/ -struct sockaddr; -int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, - unsigned int timeout); - -struct rand_struct { - unsigned long seed1,seed2,max_value; - double max_value_dbl; -}; - -#ifdef __cplusplus -} -#endif - - /* The following is for user defined functions */ - -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; - -typedef struct st_udf_args -{ - unsigned int arg_count; /* Number of arguments */ - enum Item_result *arg_type; /* Pointer to item_results */ - char **args; /* Pointer to argument */ - unsigned long *lengths; /* Length of string arguments */ - char *maybe_null; /* Set to 1 for all maybe_null args */ - char **attributes; /* Pointer to attribute name */ - unsigned long *attribute_lengths; /* Length of attribute arguments */ -} UDF_ARGS; - - /* This holds information about the result */ - -typedef struct st_udf_init -{ - my_bool maybe_null; /* 1 if function can return NULL */ - unsigned int decimals; /* for real functions */ - unsigned long max_length; /* For string functions */ - char *ptr; /* free pointer for function data */ - my_bool const_item; /* 1 if function always returns the same value */ -} UDF_INIT; -/* - TODO: add a notion for determinism of the UDF. - See Item_udf_func::update_used_tables () -*/ - - /* Constants when using compression */ -#define NET_HEADER_SIZE 4 /* standard header size */ -#define COMP_HEADER_SIZE 3 /* compression header extra size */ - - /* Prototypes to password functions */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - These functions are used for authentication by client and server and - implemented in sql/password.c -*/ - -void randominit(struct rand_struct *, unsigned long seed1, - unsigned long seed2); -double my_rnd(struct rand_struct *); -void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); - -void hash_password(unsigned long *to, const char *password, unsigned int password_len); -void make_scrambled_password_323(char *to, const char *password); -void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const char *, const char *message, - unsigned long *salt); -void get_salt_from_password_323(unsigned long *res, const char *password); -void make_password_from_salt_323(char *to, const unsigned long *salt); - -void make_scrambled_password(char *to, const char *password); -void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const char *reply, const char *message, - const unsigned char *hash_stage2); -void get_salt_from_password(unsigned char *res, const char *password); -void make_password_from_salt(char *to, const unsigned char *hash_stage2); -char *octet2hex(char *to, const char *str, unsigned int len); - -/* end of password.c */ - -char *get_tty_password(char *opt_message); -const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); - -/* Some other useful functions */ - -my_bool my_init(void); -extern int modify_defaults_file(const char *file_location, const char *option, - const char *option_value, - const char *section_name, int remove_option); -int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); -my_bool my_thread_init(void); -void my_thread_end(void); - -#ifdef _global_h -ulong STDCALL net_field_length(uchar **packet); -my_ulonglong net_field_length_ll(uchar **packet); -char *net_store_length(char *pkg, ulonglong length); -#endif - -#ifdef __cplusplus -} -#endif - -#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ -#define MYSQL_STMT_HEADER 4 -#define MYSQL_LONG_DATA_HEADER 6 - -#endif - diff --git a/dep/include/mysql/mysql_embed.h b/dep/include/mysql/mysql_embed.h deleted file mode 100644 index 2e44c99a192..00000000000 --- a/dep/include/mysql/mysql_embed.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Defines that are unique to the embedded version of MySQL */ - -#ifdef EMBEDDED_LIBRARY - -/* Things we don't need in the embedded version of MySQL */ -/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ - -#undef HAVE_PSTACK /* No stacktrace */ -#undef HAVE_DLOPEN /* No udf functions */ -#undef HAVE_OPENSSL -#undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ - -#define DONT_USE_RAID - -#endif /* EMBEDDED_LIBRARY */ - diff --git a/dep/include/mysql/mysql_time.h b/dep/include/mysql/mysql_time.h deleted file mode 100644 index 6dce2fd02c7..00000000000 --- a/dep/include/mysql/mysql_time.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 2004 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _mysql_time_h_ -#define _mysql_time_h_ - -/* - Time declarations shared between the server and client API: - you should not add anything to this header unless it's used - (and hence should be visible) in mysql.h. - If you're looking for a place to add new time-related declaration, - it's most likely my_time.h. See also "C API Handling of Date - and Time Values" chapter in documentation. -*/ - -enum enum_mysql_timestamp_type -{ - MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, - MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 -}; - - -/* - Structure which is used to represent datetime values inside MySQL. - - We assume that values in this structure are normalized, i.e. year <= 9999, - month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions - in server such as my_system_gmt_sec() or make_time() family of functions - rely on this (actually now usage of make_*() family relies on a bit weaker - restriction). Also functions that produce MYSQL_TIME as result ensure this. - There is one exception to this rule though if this structure holds time - value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold - bigger values. -*/ -typedef struct st_mysql_time -{ - unsigned int year, month, day, hour, minute, second; - unsigned long second_part; - my_bool neg; - enum enum_mysql_timestamp_type time_type; -} MYSQL_TIME; - -#endif /* _mysql_time_h_ */ - diff --git a/dep/include/mysql/mysql_version.h b/dep/include/mysql/mysql_version.h deleted file mode 100644 index 0628c9fb331..00000000000 --- a/dep/include/mysql/mysql_version.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright Abandoned 1996, 1999, 2001 MySQL AB - This file is public domain and comes with NO WARRANTY of any kind */ - -/* Version numbers for protocol & mysqld */ - -#ifndef _mysql_version_h -#define _mysql_version_h -#ifdef _CUSTOMCONFIG_ -#include -#else -#define PROTOCOL_VERSION 10 -#define MYSQL_SERVER_VERSION "5.0.56" -#define MYSQL_BASE_VERSION "mysqld-5.0" -#define MYSQL_SERVER_SUFFIX_DEF "-nt" -#define FRM_VER 6 -#define MYSQL_VERSION_ID 50056 -#define MYSQL_PORT 3306 -#define MYSQL_PORT_DEFAULT 0 -#define MYSQL_UNIX_ADDR "/tmp/mysql.sock" -#define MYSQL_CONFIG_NAME "my" -#define MYSQL_COMPILATION_COMMENT "From Sources" - -/* mysqld compile time options */ -#endif /* _CUSTOMCONFIG_ */ - -#ifndef LICENSE -#define LICENSE GPL -#endif /* LICENSE */ - -#endif /* _mysql_version_h */ - diff --git a/dep/include/mysql/mysqld_error.h b/dep/include/mysql/mysqld_error.h deleted file mode 100644 index b200fdc84d6..00000000000 --- a/dep/include/mysql/mysqld_error.h +++ /dev/null @@ -1,481 +0,0 @@ -/* Autogenerated file, please don't edit */ - -#define ER_ERROR_FIRST 1000 -#define ER_HASHCHK 1000 -#define ER_NISAMCHK 1001 -#define ER_NO 1002 -#define ER_YES 1003 -#define ER_CANT_CREATE_FILE 1004 -#define ER_CANT_CREATE_TABLE 1005 -#define ER_CANT_CREATE_DB 1006 -#define ER_DB_CREATE_EXISTS 1007 -#define ER_DB_DROP_EXISTS 1008 -#define ER_DB_DROP_DELETE 1009 -#define ER_DB_DROP_RMDIR 1010 -#define ER_CANT_DELETE_FILE 1011 -#define ER_CANT_FIND_SYSTEM_REC 1012 -#define ER_CANT_GET_STAT 1013 -#define ER_CANT_GET_WD 1014 -#define ER_CANT_LOCK 1015 -#define ER_CANT_OPEN_FILE 1016 -#define ER_FILE_NOT_FOUND 1017 -#define ER_CANT_READ_DIR 1018 -#define ER_CANT_SET_WD 1019 -#define ER_CHECKREAD 1020 -#define ER_DISK_FULL 1021 -#define ER_DUP_KEY 1022 -#define ER_ERROR_ON_CLOSE 1023 -#define ER_ERROR_ON_READ 1024 -#define ER_ERROR_ON_RENAME 1025 -#define ER_ERROR_ON_WRITE 1026 -#define ER_FILE_USED 1027 -#define ER_FILSORT_ABORT 1028 -#define ER_FORM_NOT_FOUND 1029 -#define ER_GET_ERRNO 1030 -#define ER_ILLEGAL_HA 1031 -#define ER_KEY_NOT_FOUND 1032 -#define ER_NOT_FORM_FILE 1033 -#define ER_NOT_KEYFILE 1034 -#define ER_OLD_KEYFILE 1035 -#define ER_OPEN_AS_READONLY 1036 -#define ER_OUTOFMEMORY 1037 -#define ER_OUT_OF_SORTMEMORY 1038 -#define ER_UNEXPECTED_EOF 1039 -#define ER_CON_COUNT_ERROR 1040 -#define ER_OUT_OF_RESOURCES 1041 -#define ER_BAD_HOST_ERROR 1042 -#define ER_HANDSHAKE_ERROR 1043 -#define ER_DBACCESS_DENIED_ERROR 1044 -#define ER_ACCESS_DENIED_ERROR 1045 -#define ER_NO_DB_ERROR 1046 -#define ER_UNKNOWN_COM_ERROR 1047 -#define ER_BAD_NULL_ERROR 1048 -#define ER_BAD_DB_ERROR 1049 -#define ER_TABLE_EXISTS_ERROR 1050 -#define ER_BAD_TABLE_ERROR 1051 -#define ER_NON_UNIQ_ERROR 1052 -#define ER_SERVER_SHUTDOWN 1053 -#define ER_BAD_FIELD_ERROR 1054 -#define ER_WRONG_FIELD_WITH_GROUP 1055 -#define ER_WRONG_GROUP_FIELD 1056 -#define ER_WRONG_SUM_SELECT 1057 -#define ER_WRONG_VALUE_COUNT 1058 -#define ER_TOO_LONG_IDENT 1059 -#define ER_DUP_FIELDNAME 1060 -#define ER_DUP_KEYNAME 1061 -#define ER_DUP_ENTRY 1062 -#define ER_WRONG_FIELD_SPEC 1063 -#define ER_PARSE_ERROR 1064 -#define ER_EMPTY_QUERY 1065 -#define ER_NONUNIQ_TABLE 1066 -#define ER_INVALID_DEFAULT 1067 -#define ER_MULTIPLE_PRI_KEY 1068 -#define ER_TOO_MANY_KEYS 1069 -#define ER_TOO_MANY_KEY_PARTS 1070 -#define ER_TOO_LONG_KEY 1071 -#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072 -#define ER_BLOB_USED_AS_KEY 1073 -#define ER_TOO_BIG_FIELDLENGTH 1074 -#define ER_WRONG_AUTO_KEY 1075 -#define ER_READY 1076 -#define ER_NORMAL_SHUTDOWN 1077 -#define ER_GOT_SIGNAL 1078 -#define ER_SHUTDOWN_COMPLETE 1079 -#define ER_FORCING_CLOSE 1080 -#define ER_IPSOCK_ERROR 1081 -#define ER_NO_SUCH_INDEX 1082 -#define ER_WRONG_FIELD_TERMINATORS 1083 -#define ER_BLOBS_AND_NO_TERMINATED 1084 -#define ER_TEXTFILE_NOT_READABLE 1085 -#define ER_FILE_EXISTS_ERROR 1086 -#define ER_LOAD_INFO 1087 -#define ER_ALTER_INFO 1088 -#define ER_WRONG_SUB_KEY 1089 -#define ER_CANT_REMOVE_ALL_FIELDS 1090 -#define ER_CANT_DROP_FIELD_OR_KEY 1091 -#define ER_INSERT_INFO 1092 -#define ER_UPDATE_TABLE_USED 1093 -#define ER_NO_SUCH_THREAD 1094 -#define ER_KILL_DENIED_ERROR 1095 -#define ER_NO_TABLES_USED 1096 -#define ER_TOO_BIG_SET 1097 -#define ER_NO_UNIQUE_LOGFILE 1098 -#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099 -#define ER_TABLE_NOT_LOCKED 1100 -#define ER_BLOB_CANT_HAVE_DEFAULT 1101 -#define ER_WRONG_DB_NAME 1102 -#define ER_WRONG_TABLE_NAME 1103 -#define ER_TOO_BIG_SELECT 1104 -#define ER_UNKNOWN_ERROR 1105 -#define ER_UNKNOWN_PROCEDURE 1106 -#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107 -#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108 -#define ER_UNKNOWN_TABLE 1109 -#define ER_FIELD_SPECIFIED_TWICE 1110 -#define ER_INVALID_GROUP_FUNC_USE 1111 -#define ER_UNSUPPORTED_EXTENSION 1112 -#define ER_TABLE_MUST_HAVE_COLUMNS 1113 -#define ER_RECORD_FILE_FULL 1114 -#define ER_UNKNOWN_CHARACTER_SET 1115 -#define ER_TOO_MANY_TABLES 1116 -#define ER_TOO_MANY_FIELDS 1117 -#define ER_TOO_BIG_ROWSIZE 1118 -#define ER_STACK_OVERRUN 1119 -#define ER_WRONG_OUTER_JOIN 1120 -#define ER_NULL_COLUMN_IN_INDEX 1121 -#define ER_CANT_FIND_UDF 1122 -#define ER_CANT_INITIALIZE_UDF 1123 -#define ER_UDF_NO_PATHS 1124 -#define ER_UDF_EXISTS 1125 -#define ER_CANT_OPEN_LIBRARY 1126 -#define ER_CANT_FIND_DL_ENTRY 1127 -#define ER_FUNCTION_NOT_DEFINED 1128 -#define ER_HOST_IS_BLOCKED 1129 -#define ER_HOST_NOT_PRIVILEGED 1130 -#define ER_PASSWORD_ANONYMOUS_USER 1131 -#define ER_PASSWORD_NOT_ALLOWED 1132 -#define ER_PASSWORD_NO_MATCH 1133 -#define ER_UPDATE_INFO 1134 -#define ER_CANT_CREATE_THREAD 1135 -#define ER_WRONG_VALUE_COUNT_ON_ROW 1136 -#define ER_CANT_REOPEN_TABLE 1137 -#define ER_INVALID_USE_OF_NULL 1138 -#define ER_REGEXP_ERROR 1139 -#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140 -#define ER_NONEXISTING_GRANT 1141 -#define ER_TABLEACCESS_DENIED_ERROR 1142 -#define ER_COLUMNACCESS_DENIED_ERROR 1143 -#define ER_ILLEGAL_GRANT_FOR_TABLE 1144 -#define ER_GRANT_WRONG_HOST_OR_USER 1145 -#define ER_NO_SUCH_TABLE 1146 -#define ER_NONEXISTING_TABLE_GRANT 1147 -#define ER_NOT_ALLOWED_COMMAND 1148 -#define ER_SYNTAX_ERROR 1149 -#define ER_DELAYED_CANT_CHANGE_LOCK 1150 -#define ER_TOO_MANY_DELAYED_THREADS 1151 -#define ER_ABORTING_CONNECTION 1152 -#define ER_NET_PACKET_TOO_LARGE 1153 -#define ER_NET_READ_ERROR_FROM_PIPE 1154 -#define ER_NET_FCNTL_ERROR 1155 -#define ER_NET_PACKETS_OUT_OF_ORDER 1156 -#define ER_NET_UNCOMPRESS_ERROR 1157 -#define ER_NET_READ_ERROR 1158 -#define ER_NET_READ_INTERRUPTED 1159 -#define ER_NET_ERROR_ON_WRITE 1160 -#define ER_NET_WRITE_INTERRUPTED 1161 -#define ER_TOO_LONG_STRING 1162 -#define ER_TABLE_CANT_HANDLE_BLOB 1163 -#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164 -#define ER_DELAYED_INSERT_TABLE_LOCKED 1165 -#define ER_WRONG_COLUMN_NAME 1166 -#define ER_WRONG_KEY_COLUMN 1167 -#define ER_WRONG_MRG_TABLE 1168 -#define ER_DUP_UNIQUE 1169 -#define ER_BLOB_KEY_WITHOUT_LENGTH 1170 -#define ER_PRIMARY_CANT_HAVE_NULL 1171 -#define ER_TOO_MANY_ROWS 1172 -#define ER_REQUIRES_PRIMARY_KEY 1173 -#define ER_NO_RAID_COMPILED 1174 -#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175 -#define ER_KEY_DOES_NOT_EXITS 1176 -#define ER_CHECK_NO_SUCH_TABLE 1177 -#define ER_CHECK_NOT_IMPLEMENTED 1178 -#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179 -#define ER_ERROR_DURING_COMMIT 1180 -#define ER_ERROR_DURING_ROLLBACK 1181 -#define ER_ERROR_DURING_FLUSH_LOGS 1182 -#define ER_ERROR_DURING_CHECKPOINT 1183 -#define ER_NEW_ABORTING_CONNECTION 1184 -#define ER_DUMP_NOT_IMPLEMENTED 1185 -#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186 -#define ER_INDEX_REBUILD 1187 -#define ER_MASTER 1188 -#define ER_MASTER_NET_READ 1189 -#define ER_MASTER_NET_WRITE 1190 -#define ER_FT_MATCHING_KEY_NOT_FOUND 1191 -#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192 -#define ER_UNKNOWN_SYSTEM_VARIABLE 1193 -#define ER_CRASHED_ON_USAGE 1194 -#define ER_CRASHED_ON_REPAIR 1195 -#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196 -#define ER_TRANS_CACHE_FULL 1197 -#define ER_SLAVE_MUST_STOP 1198 -#define ER_SLAVE_NOT_RUNNING 1199 -#define ER_BAD_SLAVE 1200 -#define ER_MASTER_INFO 1201 -#define ER_SLAVE_THREAD 1202 -#define ER_TOO_MANY_USER_CONNECTIONS 1203 -#define ER_SET_CONSTANTS_ONLY 1204 -#define ER_LOCK_WAIT_TIMEOUT 1205 -#define ER_LOCK_TABLE_FULL 1206 -#define ER_READ_ONLY_TRANSACTION 1207 -#define ER_DROP_DB_WITH_READ_LOCK 1208 -#define ER_CREATE_DB_WITH_READ_LOCK 1209 -#define ER_WRONG_ARGUMENTS 1210 -#define ER_NO_PERMISSION_TO_CREATE_USER 1211 -#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212 -#define ER_LOCK_DEADLOCK 1213 -#define ER_TABLE_CANT_HANDLE_FT 1214 -#define ER_CANNOT_ADD_FOREIGN 1215 -#define ER_NO_REFERENCED_ROW 1216 -#define ER_ROW_IS_REFERENCED 1217 -#define ER_CONNECT_TO_MASTER 1218 -#define ER_QUERY_ON_MASTER 1219 -#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220 -#define ER_WRONG_USAGE 1221 -#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222 -#define ER_CANT_UPDATE_WITH_READLOCK 1223 -#define ER_MIXING_NOT_ALLOWED 1224 -#define ER_DUP_ARGUMENT 1225 -#define ER_USER_LIMIT_REACHED 1226 -#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227 -#define ER_LOCAL_VARIABLE 1228 -#define ER_GLOBAL_VARIABLE 1229 -#define ER_NO_DEFAULT 1230 -#define ER_WRONG_VALUE_FOR_VAR 1231 -#define ER_WRONG_TYPE_FOR_VAR 1232 -#define ER_VAR_CANT_BE_READ 1233 -#define ER_CANT_USE_OPTION_HERE 1234 -#define ER_NOT_SUPPORTED_YET 1235 -#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 -#define ER_SLAVE_IGNORED_TABLE 1237 -#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238 -#define ER_WRONG_FK_DEF 1239 -#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240 -#define ER_OPERAND_COLUMNS 1241 -#define ER_SUBQUERY_NO_1_ROW 1242 -#define ER_UNKNOWN_STMT_HANDLER 1243 -#define ER_CORRUPT_HELP_DB 1244 -#define ER_CYCLIC_REFERENCE 1245 -#define ER_AUTO_CONVERT 1246 -#define ER_ILLEGAL_REFERENCE 1247 -#define ER_DERIVED_MUST_HAVE_ALIAS 1248 -#define ER_SELECT_REDUCED 1249 -#define ER_TABLENAME_NOT_ALLOWED_HERE 1250 -#define ER_NOT_SUPPORTED_AUTH_MODE 1251 -#define ER_SPATIAL_CANT_HAVE_NULL 1252 -#define ER_COLLATION_CHARSET_MISMATCH 1253 -#define ER_SLAVE_WAS_RUNNING 1254 -#define ER_SLAVE_WAS_NOT_RUNNING 1255 -#define ER_TOO_BIG_FOR_UNCOMPRESS 1256 -#define ER_ZLIB_Z_MEM_ERROR 1257 -#define ER_ZLIB_Z_BUF_ERROR 1258 -#define ER_ZLIB_Z_DATA_ERROR 1259 -#define ER_CUT_VALUE_GROUP_CONCAT 1260 -#define ER_WARN_TOO_FEW_RECORDS 1261 -#define ER_WARN_TOO_MANY_RECORDS 1262 -#define ER_WARN_NULL_TO_NOTNULL 1263 -#define ER_WARN_DATA_OUT_OF_RANGE 1264 -#define WARN_DATA_TRUNCATED 1265 -#define ER_WARN_USING_OTHER_HANDLER 1266 -#define ER_CANT_AGGREGATE_2COLLATIONS 1267 -#define ER_DROP_USER 1268 -#define ER_REVOKE_GRANTS 1269 -#define ER_CANT_AGGREGATE_3COLLATIONS 1270 -#define ER_CANT_AGGREGATE_NCOLLATIONS 1271 -#define ER_VARIABLE_IS_NOT_STRUCT 1272 -#define ER_UNKNOWN_COLLATION 1273 -#define ER_SLAVE_IGNORED_SSL_PARAMS 1274 -#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275 -#define ER_WARN_FIELD_RESOLVED 1276 -#define ER_BAD_SLAVE_UNTIL_COND 1277 -#define ER_MISSING_SKIP_SLAVE 1278 -#define ER_UNTIL_COND_IGNORED 1279 -#define ER_WRONG_NAME_FOR_INDEX 1280 -#define ER_WRONG_NAME_FOR_CATALOG 1281 -#define ER_WARN_QC_RESIZE 1282 -#define ER_BAD_FT_COLUMN 1283 -#define ER_UNKNOWN_KEY_CACHE 1284 -#define ER_WARN_HOSTNAME_WONT_WORK 1285 -#define ER_UNKNOWN_STORAGE_ENGINE 1286 -#define ER_WARN_DEPRECATED_SYNTAX 1287 -#define ER_NON_UPDATABLE_TABLE 1288 -#define ER_FEATURE_DISABLED 1289 -#define ER_OPTION_PREVENTS_STATEMENT 1290 -#define ER_DUPLICATED_VALUE_IN_TYPE 1291 -#define ER_TRUNCATED_WRONG_VALUE 1292 -#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 -#define ER_INVALID_ON_UPDATE 1294 -#define ER_UNSUPPORTED_PS 1295 -#define ER_GET_ERRMSG 1296 -#define ER_GET_TEMPORARY_ERRMSG 1297 -#define ER_UNKNOWN_TIME_ZONE 1298 -#define ER_WARN_INVALID_TIMESTAMP 1299 -#define ER_INVALID_CHARACTER_STRING 1300 -#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 -#define ER_CONFLICTING_DECLARATIONS 1302 -#define ER_SP_NO_RECURSIVE_CREATE 1303 -#define ER_SP_ALREADY_EXISTS 1304 -#define ER_SP_DOES_NOT_EXIST 1305 -#define ER_SP_DROP_FAILED 1306 -#define ER_SP_STORE_FAILED 1307 -#define ER_SP_LILABEL_MISMATCH 1308 -#define ER_SP_LABEL_REDEFINE 1309 -#define ER_SP_LABEL_MISMATCH 1310 -#define ER_SP_UNINIT_VAR 1311 -#define ER_SP_BADSELECT 1312 -#define ER_SP_BADRETURN 1313 -#define ER_SP_BADSTATEMENT 1314 -#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315 -#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316 -#define ER_QUERY_INTERRUPTED 1317 -#define ER_SP_WRONG_NO_OF_ARGS 1318 -#define ER_SP_COND_MISMATCH 1319 -#define ER_SP_NORETURN 1320 -#define ER_SP_NORETURNEND 1321 -#define ER_SP_BAD_CURSOR_QUERY 1322 -#define ER_SP_BAD_CURSOR_SELECT 1323 -#define ER_SP_CURSOR_MISMATCH 1324 -#define ER_SP_CURSOR_ALREADY_OPEN 1325 -#define ER_SP_CURSOR_NOT_OPEN 1326 -#define ER_SP_UNDECLARED_VAR 1327 -#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328 -#define ER_SP_FETCH_NO_DATA 1329 -#define ER_SP_DUP_PARAM 1330 -#define ER_SP_DUP_VAR 1331 -#define ER_SP_DUP_COND 1332 -#define ER_SP_DUP_CURS 1333 -#define ER_SP_CANT_ALTER 1334 -#define ER_SP_SUBSELECT_NYI 1335 -#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336 -#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337 -#define ER_SP_CURSOR_AFTER_HANDLER 1338 -#define ER_SP_CASE_NOT_FOUND 1339 -#define ER_FPARSER_TOO_BIG_FILE 1340 -#define ER_FPARSER_BAD_HEADER 1341 -#define ER_FPARSER_EOF_IN_COMMENT 1342 -#define ER_FPARSER_ERROR_IN_PARAMETER 1343 -#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344 -#define ER_VIEW_NO_EXPLAIN 1345 -#define ER_FRM_UNKNOWN_TYPE 1346 -#define ER_WRONG_OBJECT 1347 -#define ER_NONUPDATEABLE_COLUMN 1348 -#define ER_VIEW_SELECT_DERIVED 1349 -#define ER_VIEW_SELECT_CLAUSE 1350 -#define ER_VIEW_SELECT_VARIABLE 1351 -#define ER_VIEW_SELECT_TMPTABLE 1352 -#define ER_VIEW_WRONG_LIST 1353 -#define ER_WARN_VIEW_MERGE 1354 -#define ER_WARN_VIEW_WITHOUT_KEY 1355 -#define ER_VIEW_INVALID 1356 -#define ER_SP_NO_DROP_SP 1357 -#define ER_SP_GOTO_IN_HNDLR 1358 -#define ER_TRG_ALREADY_EXISTS 1359 -#define ER_TRG_DOES_NOT_EXIST 1360 -#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361 -#define ER_TRG_CANT_CHANGE_ROW 1362 -#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363 -#define ER_NO_DEFAULT_FOR_FIELD 1364 -#define ER_DIVISION_BY_ZERO 1365 -#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366 -#define ER_ILLEGAL_VALUE_FOR_TYPE 1367 -#define ER_VIEW_NONUPD_CHECK 1368 -#define ER_VIEW_CHECK_FAILED 1369 -#define ER_PROCACCESS_DENIED_ERROR 1370 -#define ER_RELAY_LOG_FAIL 1371 -#define ER_PASSWD_LENGTH 1372 -#define ER_UNKNOWN_TARGET_BINLOG 1373 -#define ER_IO_ERR_LOG_INDEX_READ 1374 -#define ER_BINLOG_PURGE_PROHIBITED 1375 -#define ER_FSEEK_FAIL 1376 -#define ER_BINLOG_PURGE_FATAL_ERR 1377 -#define ER_LOG_IN_USE 1378 -#define ER_LOG_PURGE_UNKNOWN_ERR 1379 -#define ER_RELAY_LOG_INIT 1380 -#define ER_NO_BINARY_LOGGING 1381 -#define ER_RESERVED_SYNTAX 1382 -#define ER_WSAS_FAILED 1383 -#define ER_DIFF_GROUPS_PROC 1384 -#define ER_NO_GROUP_FOR_PROC 1385 -#define ER_ORDER_WITH_PROC 1386 -#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387 -#define ER_NO_FILE_MAPPING 1388 -#define ER_WRONG_MAGIC 1389 -#define ER_PS_MANY_PARAM 1390 -#define ER_KEY_PART_0 1391 -#define ER_VIEW_CHECKSUM 1392 -#define ER_VIEW_MULTIUPDATE 1393 -#define ER_VIEW_NO_INSERT_FIELD_LIST 1394 -#define ER_VIEW_DELETE_MERGE_VIEW 1395 -#define ER_CANNOT_USER 1396 -#define ER_XAER_NOTA 1397 -#define ER_XAER_INVAL 1398 -#define ER_XAER_RMFAIL 1399 -#define ER_XAER_OUTSIDE 1400 -#define ER_XAER_RMERR 1401 -#define ER_XA_RBROLLBACK 1402 -#define ER_NONEXISTING_PROC_GRANT 1403 -#define ER_PROC_AUTO_GRANT_FAIL 1404 -#define ER_PROC_AUTO_REVOKE_FAIL 1405 -#define ER_DATA_TOO_LONG 1406 -#define ER_SP_BAD_SQLSTATE 1407 -#define ER_STARTUP 1408 -#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409 -#define ER_CANT_CREATE_USER_WITH_GRANT 1410 -#define ER_WRONG_VALUE_FOR_TYPE 1411 -#define ER_TABLE_DEF_CHANGED 1412 -#define ER_SP_DUP_HANDLER 1413 -#define ER_SP_NOT_VAR_ARG 1414 -#define ER_SP_NO_RETSET 1415 -#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416 -#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417 -#define ER_BINLOG_UNSAFE_ROUTINE 1418 -#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419 -#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420 -#define ER_STMT_HAS_NO_OPEN_CURSOR 1421 -#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422 -#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423 -#define ER_SP_NO_RECURSION 1424 -#define ER_TOO_BIG_SCALE 1425 -#define ER_TOO_BIG_PRECISION 1426 -#define ER_M_BIGGER_THAN_D 1427 -#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428 -#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429 -#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430 -#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431 -#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432 -#define ER_FOREIGN_DATA_STRING_INVALID 1433 -#define ER_CANT_CREATE_FEDERATED_TABLE 1434 -#define ER_TRG_IN_WRONG_SCHEMA 1435 -#define ER_STACK_OVERRUN_NEED_MORE 1436 -#define ER_TOO_LONG_BODY 1437 -#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438 -#define ER_TOO_BIG_DISPLAYWIDTH 1439 -#define ER_XAER_DUPID 1440 -#define ER_DATETIME_FUNCTION_OVERFLOW 1441 -#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442 -#define ER_VIEW_PREVENT_UPDATE 1443 -#define ER_PS_NO_RECURSION 1444 -#define ER_SP_CANT_SET_AUTOCOMMIT 1445 -#define ER_MALFORMED_DEFINER 1446 -#define ER_VIEW_FRM_NO_USER 1447 -#define ER_VIEW_OTHER_USER 1448 -#define ER_NO_SUCH_USER 1449 -#define ER_FORBID_SCHEMA_CHANGE 1450 -#define ER_ROW_IS_REFERENCED_2 1451 -#define ER_NO_REFERENCED_ROW_2 1452 -#define ER_SP_BAD_VAR_SHADOW 1453 -#define ER_TRG_NO_DEFINER 1454 -#define ER_OLD_FILE_FORMAT 1455 -#define ER_SP_RECURSION_LIMIT 1456 -#define ER_SP_PROC_TABLE_CORRUPT 1457 -#define ER_SP_WRONG_NAME 1458 -#define ER_TABLE_NEEDS_UPGRADE 1459 -#define ER_SP_NO_AGGREGATE 1460 -#define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461 -#define ER_VIEW_RECURSIVE 1462 -#define ER_NON_GROUPING_FIELD_USED 1463 -#define ER_TABLE_CANT_HANDLE_SPKEYS 1464 -#define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465 -#define ER_REMOVED_SPACES 1466 -#define ER_AUTOINC_READ_FAILED 1467 -#define ER_USERNAME 1468 -#define ER_HOSTNAME 1469 -#define ER_WRONG_STRING_LENGTH 1470 -#define ER_NON_INSERTABLE_TABLE 1471 -#define ER_ADMIN_WRONG_MRG_TABLE 1472 -#define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473 -#define ER_NAME_BECOMES_EMPTY 1474 -#define ER_AMBIGUOUS_FIELD_TERM 1475 -#define ER_ERROR_LAST 1475 - diff --git a/dep/include/mysql/raid.h b/dep/include/mysql/raid.h deleted file mode 100644 index 77e668c35b2..00000000000 --- a/dep/include/mysql/raid.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Parser needs these defines always, even if USE_RAID is not defined */ -#define RAID_TYPE_0 1 /* Striping */ -#define RAID_TYPE_x 2 /* Some new modes */ -#define RAID_TYPE_y 3 - -#define RAID_DEFAULT_CHUNKS 4 -#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */ - -C_MODE_START -#define my_raid_type(raid_type) raid_type_string[(int)(raid_type)] -extern const char *raid_type_string[]; -C_MODE_END - -#ifdef DONT_USE_RAID -#undef USE_RAID -#endif -#if defined(USE_RAID) - -#include "my_dir.h" - -/* Trap all occurences of my_...() in source and use our wrapper around this function */ - -#ifdef MAP_TO_USE_RAID -#define my_read(A,B,C,D) my_raid_read(A,B,C,D) -#define my_write(A,B,C,D) my_raid_write(A,B,C,D) -#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E) -#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E) -#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D) -#define my_close(A,B) my_raid_close(A,B) -#define my_tell(A,B) my_raid_tell(A,B) -#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D) -#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E) -#define my_fstat(A,B,C) my_raid_fstat(A,B,C) -#endif /* MAP_TO_USE_RAID */ - -#ifdef __cplusplus -extern "C" { -#endif - - void init_raid(void); - void end_raid(void); - - bool is_raid(File fd); - File my_raid_create(const char *FileName, int CreateFlags, int access_flags, - uint raid_type, uint raid_chunks, ulong raid_chunksize, - myf MyFlags); - File my_raid_open(const char *FileName, int Flags, - uint raid_type, uint raid_chunks, ulong raid_chunksize, - myf MyFlags); - int my_raid_rename(const char *from, const char *to, uint raid_chunks, - myf MyFlags); - int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags); - int my_raid_redel(const char *old_name, const char *new_name, - uint raid_chunks, myf MyFlags); - - my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags); - my_off_t my_raid_tell(File fd, myf MyFlags); - - uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags); - uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags); - - uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, - myf MyFlags); - uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count, - my_off_t offset, myf MyFlags); - - int my_raid_lock(File,int locktype, my_off_t start, my_off_t length, - myf MyFlags); - int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags); - int my_raid_close(File, myf MyFlags); - int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags); - -#ifdef __cplusplus -} - -#ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ -#endif - -class RaidName { - public: - RaidName(const char *FileName); - ~RaidName(); - bool IsRaid(); - int Rename(const char * from, const char * to, myf MyFlags); - private: - uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */ - uint _raid_chunks; /* 1..n */ - ulong _raid_chunksize; /* 1..n in bytes */ -}; - -class RaidFd { - public: - RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize); - ~RaidFd(); - File Create(const char *FileName, int CreateFlags, int access_flags, - myf MyFlags); - File Open(const char *FileName, int Flags, myf MyFlags); - my_off_t Seek(my_off_t pos,int whence,myf MyFlags); - my_off_t Tell(myf MyFlags); - int Write(const byte *Buffer, uint Count, myf MyFlags); - int Read(const byte *Buffer, uint Count, myf MyFlags); - int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags); - int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags); - int Fstat(int fd, MY_STAT *stat_area, myf MyFlags ); - int Close(myf MyFlags); - static bool IsRaid(File fd); - static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */ - private: - - uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */ - uint _raid_chunks; /* 1..n */ - ulong _raid_chunksize; /* 1..n in bytes */ - - ulong _total_block; /* We are operating with block no x (can be 0..many). */ - uint _this_block; /* can be 0.._raid_chunks */ - uint _remaining_bytes; /* Maximum bytes that can be written in this block */ - - my_off_t _position; - my_off_t _size; /* Cached file size for faster seek(SEEK_END) */ - File _fd; - File *_fd_vector; /* Array of File */ - off_t *_seek_vector; /* Array of cached seek positions */ - - inline void Calculate() - { - DBUG_ENTER("RaidFd::_Calculate"); - DBUG_PRINT("info",("_position: %lu _raid_chunksize: %lu _size: %lu", - (ulong) _position, _raid_chunksize, (ulong) _size)); - - _total_block = (ulong) (_position / _raid_chunksize); - _this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */ - _remaining_bytes = (uint) (_raid_chunksize - - (_position - _total_block * _raid_chunksize)); - DBUG_PRINT("info", - ("_total_block: %lu this_block: %d _remaining_bytes: %d", - _total_block, _this_block, _remaining_bytes)); - DBUG_VOID_RETURN; - } -}; - -#endif /* __cplusplus */ -#endif /* USE_RAID */ - diff --git a/dep/include/mysql/typelib.h b/dep/include/mysql/typelib.h deleted file mode 100644 index 40d69b89e34..00000000000 --- a/dep/include/mysql/typelib.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -#ifndef _typelib_h -#define _typelib_h - -#include "my_alloc.h" - -typedef struct st_typelib { /* Different types saved here */ - unsigned int count; /* How many types */ - const char *name; /* Name of typelib */ - const char **type_names; - unsigned int *type_lengths; -} TYPELIB; - -extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); -extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); -extern const char *get_type(TYPELIB *typelib,unsigned int nr); -extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); - -extern TYPELIB sql_protocol_typelib; - -#endif /* _typelib_h */ - diff --git a/dep/include/openssl/aes.h b/dep/include/openssl/aes.h deleted file mode 100644 index 450f2b4051b..00000000000 --- a/dep/include/openssl/aes.h +++ /dev/null @@ -1,148 +0,0 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - */ - -#ifndef HEADER_AES_H -#define HEADER_AES_H - -#include - -#ifdef OPENSSL_NO_AES -#error AES is disabled. -#endif - -#define AES_ENCRYPT 1 -#define AES_DECRYPT 0 - -/* Because array size can't be a const in C, the following two are macros. - Both sizes are in bytes. */ -#define AES_MAXNR 14 -#define AES_BLOCK_SIZE 16 - -#ifdef OPENSSL_FIPS -#define FIPS_AES_SIZE_T int -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* This should be a hidden type, but EVP requires that the size be known */ -struct aes_key_st { -#ifdef AES_LONG - unsigned long rd_key[4 *(AES_MAXNR + 1)]; -#else - unsigned int rd_key[4 *(AES_MAXNR + 1)]; -#endif - int rounds; -}; -typedef struct aes_key_st AES_KEY; - -const char *AES_options(void); - -int AES_set_encrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); -int AES_set_decrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); - -void AES_encrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key); -void AES_decrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key); - -void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key, const int enc); -void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, const int enc); -void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out, - const int nbits,const AES_KEY *key, - unsigned char *ivec,const int enc); -void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, int *num); -void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char ivec[AES_BLOCK_SIZE], - unsigned char ecount_buf[AES_BLOCK_SIZE], - unsigned int *num); - -/* For IGE, see also http://www.links.org/files/openssl-ige.pdf */ -/* NB: the IV is _two_ blocks long */ -void AES_ige_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - unsigned char *ivec, const int enc); -/* NB: the IV is _four_ blocks long */ -void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, - const unsigned long length, const AES_KEY *key, - const AES_KEY *key2, const unsigned char *ivec, - const int enc); - -int AES_wrap_key(AES_KEY *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, unsigned int inlen); -int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, unsigned int inlen); - -#ifdef __cplusplus -} -#endif - -#endif /* !HEADER_AES_H */ diff --git a/dep/include/openssl/asn1.h b/dep/include/openssl/asn1.h deleted file mode 100644 index e3385226d4a..00000000000 --- a/dep/include/openssl/asn1.h +++ /dev/null @@ -1,1329 +0,0 @@ -/* crypto/asn1/asn1.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ASN1_H -#define HEADER_ASN1_H - -#include -#include -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#include - -#include - -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define V_ASN1_UNIVERSAL 0x00 -#define V_ASN1_APPLICATION 0x40 -#define V_ASN1_CONTEXT_SPECIFIC 0x80 -#define V_ASN1_PRIVATE 0xc0 - -#define V_ASN1_CONSTRUCTED 0x20 -#define V_ASN1_PRIMITIVE_TAG 0x1f -#define V_ASN1_PRIMATIVE_TAG 0x1f - -#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ -#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ -#define V_ASN1_ANY -4 /* used in ASN1 template code */ - -#define V_ASN1_NEG 0x100 /* negative flag */ - -#define V_ASN1_UNDEF -1 -#define V_ASN1_EOC 0 -#define V_ASN1_BOOLEAN 1 /**/ -#define V_ASN1_INTEGER 2 -#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) -#define V_ASN1_BIT_STRING 3 -#define V_ASN1_OCTET_STRING 4 -#define V_ASN1_NULL 5 -#define V_ASN1_OBJECT 6 -#define V_ASN1_OBJECT_DESCRIPTOR 7 -#define V_ASN1_EXTERNAL 8 -#define V_ASN1_REAL 9 -#define V_ASN1_ENUMERATED 10 -#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) -#define V_ASN1_UTF8STRING 12 -#define V_ASN1_SEQUENCE 16 -#define V_ASN1_SET 17 -#define V_ASN1_NUMERICSTRING 18 /**/ -#define V_ASN1_PRINTABLESTRING 19 -#define V_ASN1_T61STRING 20 -#define V_ASN1_TELETEXSTRING 20 /* alias */ -#define V_ASN1_VIDEOTEXSTRING 21 /**/ -#define V_ASN1_IA5STRING 22 -#define V_ASN1_UTCTIME 23 -#define V_ASN1_GENERALIZEDTIME 24 /**/ -#define V_ASN1_GRAPHICSTRING 25 /**/ -#define V_ASN1_ISO64STRING 26 /**/ -#define V_ASN1_VISIBLESTRING 26 /* alias */ -#define V_ASN1_GENERALSTRING 27 /**/ -#define V_ASN1_UNIVERSALSTRING 28 /**/ -#define V_ASN1_BMPSTRING 30 - -/* For use with d2i_ASN1_type_bytes() */ -#define B_ASN1_NUMERICSTRING 0x0001 -#define B_ASN1_PRINTABLESTRING 0x0002 -#define B_ASN1_T61STRING 0x0004 -#define B_ASN1_TELETEXSTRING 0x0004 -#define B_ASN1_VIDEOTEXSTRING 0x0008 -#define B_ASN1_IA5STRING 0x0010 -#define B_ASN1_GRAPHICSTRING 0x0020 -#define B_ASN1_ISO64STRING 0x0040 -#define B_ASN1_VISIBLESTRING 0x0040 -#define B_ASN1_GENERALSTRING 0x0080 -#define B_ASN1_UNIVERSALSTRING 0x0100 -#define B_ASN1_OCTET_STRING 0x0200 -#define B_ASN1_BIT_STRING 0x0400 -#define B_ASN1_BMPSTRING 0x0800 -#define B_ASN1_UNKNOWN 0x1000 -#define B_ASN1_UTF8STRING 0x2000 -#define B_ASN1_UTCTIME 0x4000 -#define B_ASN1_GENERALIZEDTIME 0x8000 -#define B_ASN1_SEQUENCE 0x10000 - -/* For use with ASN1_mbstring_copy() */ -#define MBSTRING_FLAG 0x1000 -#define MBSTRING_UTF8 (MBSTRING_FLAG) -#define MBSTRING_ASC (MBSTRING_FLAG|1) -#define MBSTRING_BMP (MBSTRING_FLAG|2) -#define MBSTRING_UNIV (MBSTRING_FLAG|4) - -#define SMIME_OLDMIME 0x400 -#define SMIME_CRLFEOL 0x800 -#define SMIME_STREAM 0x1000 - -struct X509_algor_st; -DECLARE_STACK_OF(X509_ALGOR) - -#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ -#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ - -/* We MUST make sure that, except for constness, asn1_ctx_st and - asn1_const_ctx are exactly the same. Fortunately, as soon as - the old ASN1 parsing macros are gone, we can throw this away - as well... */ -typedef struct asn1_ctx_st - { - unsigned char *p;/* work char pointer */ - int eos; /* end of sequence read for indefinite encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - unsigned char *max; /* largest value of p allowed */ - unsigned char *q;/* temporary variable */ - unsigned char **pp;/* variable */ - int line; /* used in error processing */ - } ASN1_CTX; - -typedef struct asn1_const_ctx_st - { - const unsigned char *p;/* work char pointer */ - int eos; /* end of sequence read for indefinite encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - const unsigned char *max; /* largest value of p allowed */ - const unsigned char *q;/* temporary variable */ - const unsigned char **pp;/* variable */ - int line; /* used in error processing */ - } ASN1_const_CTX; - -/* These are used internally in the ASN1_OBJECT to keep track of - * whether the names and data need to be free()ed */ -#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */ -#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ -#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ -#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ -typedef struct asn1_object_st - { - const char *sn,*ln; - int nid; - int length; - unsigned char *data; - int flags; /* Should we free this one */ - } ASN1_OBJECT; - -#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ -/* This indicates that the ASN1_STRING is not a real value but just a place - * holder for the location where indefinite length constructed data should - * be inserted in the memory buffer - */ -#define ASN1_STRING_FLAG_NDEF 0x010 - -/* This flag is used by the CMS code to indicate that a string is not - * complete and is a place holder for content when it had all been - * accessed. The flag will be reset when content has been written to it. - */ -#define ASN1_STRING_FLAG_CONT 0x020 - -/* This is the base type that holds just about everything :-) */ -typedef struct asn1_string_st - { - int length; - int type; - unsigned char *data; - /* The value of the following field depends on the type being - * held. It is mostly being used for BIT_STRING so if the - * input data has a non-zero 'unused bits' value, it will be - * handled correctly */ - long flags; - } ASN1_STRING; - -/* ASN1_ENCODING structure: this is used to save the received - * encoding of an ASN1 type. This is useful to get round - * problems with invalid encodings which can break signatures. - */ - -typedef struct ASN1_ENCODING_st - { - unsigned char *enc; /* DER encoding */ - long len; /* Length of encoding */ - int modified; /* set to 1 if 'enc' is invalid */ - } ASN1_ENCODING; - -/* Used with ASN1 LONG type: if a long is set to this it is omitted */ -#define ASN1_LONG_UNDEF 0x7fffffffL - -#define STABLE_FLAGS_MALLOC 0x01 -#define STABLE_NO_MASK 0x02 -#define DIRSTRING_TYPE \ - (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) -#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) - -typedef struct asn1_string_table_st { - int nid; - long minsize; - long maxsize; - unsigned long mask; - unsigned long flags; -} ASN1_STRING_TABLE; - -DECLARE_STACK_OF(ASN1_STRING_TABLE) - -/* size limits: this stuff is taken straight from RFC2459 */ - -#define ub_name 32768 -#define ub_common_name 64 -#define ub_locality_name 128 -#define ub_state_name 128 -#define ub_organization_name 64 -#define ub_organization_unit_name 64 -#define ub_title 64 -#define ub_email_address 128 - -/* Declarations for template structures: for full definitions - * see asn1t.h - */ -typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; -typedef struct ASN1_ITEM_st ASN1_ITEM; -typedef struct ASN1_TLC_st ASN1_TLC; -/* This is just an opaque pointer */ -typedef struct ASN1_VALUE_st ASN1_VALUE; - -/* Declare ASN1 functions: the implement macro in in asn1t.h */ - -#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) - -#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) - -#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) - -#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) - -#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ - type *d2i_##name(type **a, const unsigned char **in, long len); \ - int i2d_##name(type *a, unsigned char **out); \ - DECLARE_ASN1_ITEM(itname) - -#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ - type *d2i_##name(type **a, const unsigned char **in, long len); \ - int i2d_##name(const type *a, unsigned char **out); \ - DECLARE_ASN1_ITEM(name) - -#define DECLARE_ASN1_NDEF_FUNCTION(name) \ - int i2d_##name##_NDEF(name *a, unsigned char **out); - -#define DECLARE_ASN1_FUNCTIONS_const(name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) - -#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - type *name##_new(void); \ - void name##_free(type *a); - -#define D2I_OF(type) type *(*)(type **,const unsigned char **,long) -#define I2D_OF(type) int (*)(type *,unsigned char **) -#define I2D_OF_const(type) int (*)(const type *,unsigned char **) - -#define CHECKED_D2I_OF(type, d2i) \ - ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) -#define CHECKED_I2D_OF(type, i2d) \ - ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) -#define CHECKED_NEW_OF(type, xnew) \ - ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) -#define CHECKED_PTR_OF(type, p) \ - ((void*) (1 ? p : (type*)0)) -#define CHECKED_PPTR_OF(type, p) \ - ((void**) (1 ? p : (type**)0)) - -#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) -#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) -#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) - -TYPEDEF_D2I2D_OF(void); - -/* The following macros and typedefs allow an ASN1_ITEM - * to be embedded in a structure and referenced. Since - * the ASN1_ITEM pointers need to be globally accessible - * (possibly from shared libraries) they may exist in - * different forms. On platforms that support it the - * ASN1_ITEM structure itself will be globally exported. - * Other platforms will export a function that returns - * an ASN1_ITEM pointer. - * - * To handle both cases transparently the macros below - * should be used instead of hard coding an ASN1_ITEM - * pointer in a structure. - * - * The structure will look like this: - * - * typedef struct SOMETHING_st { - * ... - * ASN1_ITEM_EXP *iptr; - * ... - * } SOMETHING; - * - * It would be initialised as e.g.: - * - * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; - * - * and the actual pointer extracted with: - * - * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); - * - * Finally an ASN1_ITEM pointer can be extracted from an - * appropriate reference with: ASN1_ITEM_rptr(X509). This - * would be used when a function takes an ASN1_ITEM * argument. - * - */ - -#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* ASN1_ITEM pointer exported type */ -typedef const ASN1_ITEM ASN1_ITEM_EXP; - -/* Macro to obtain ASN1_ITEM pointer from exported type */ -#define ASN1_ITEM_ptr(iptr) (iptr) - -/* Macro to include ASN1_ITEM pointer from base type */ -#define ASN1_ITEM_ref(iptr) (&(iptr##_it)) - -#define ASN1_ITEM_rptr(ref) (&(ref##_it)) - -#define DECLARE_ASN1_ITEM(name) \ - OPENSSL_EXTERN const ASN1_ITEM name##_it; - -#else - -/* Platforms that can't easily handle shared global variables are declared - * as functions returning ASN1_ITEM pointers. - */ - -/* ASN1_ITEM pointer exported type */ -typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); - -/* Macro to obtain ASN1_ITEM pointer from exported type */ -#define ASN1_ITEM_ptr(iptr) (iptr()) - -/* Macro to include ASN1_ITEM pointer from base type */ -#define ASN1_ITEM_ref(iptr) (iptr##_it) - -#define ASN1_ITEM_rptr(ref) (ref##_it()) - -#define DECLARE_ASN1_ITEM(name) \ - const ASN1_ITEM * name##_it(void); - -#endif - -/* Parameters used by ASN1_STRING_print_ex() */ - -/* These determine which characters to escape: - * RFC2253 special characters, control characters and - * MSB set characters - */ - -#define ASN1_STRFLGS_ESC_2253 1 -#define ASN1_STRFLGS_ESC_CTRL 2 -#define ASN1_STRFLGS_ESC_MSB 4 - - -/* This flag determines how we do escaping: normally - * RC2253 backslash only, set this to use backslash and - * quote. - */ - -#define ASN1_STRFLGS_ESC_QUOTE 8 - - -/* These three flags are internal use only. */ - -/* Character is a valid PrintableString character */ -#define CHARTYPE_PRINTABLESTRING 0x10 -/* Character needs escaping if it is the first character */ -#define CHARTYPE_FIRST_ESC_2253 0x20 -/* Character needs escaping if it is the last character */ -#define CHARTYPE_LAST_ESC_2253 0x40 - -/* NB the internal flags are safely reused below by flags - * handled at the top level. - */ - -/* If this is set we convert all character strings - * to UTF8 first - */ - -#define ASN1_STRFLGS_UTF8_CONVERT 0x10 - -/* If this is set we don't attempt to interpret content: - * just assume all strings are 1 byte per character. This - * will produce some pretty odd looking output! - */ - -#define ASN1_STRFLGS_IGNORE_TYPE 0x20 - -/* If this is set we include the string type in the output */ -#define ASN1_STRFLGS_SHOW_TYPE 0x40 - -/* This determines which strings to display and which to - * 'dump' (hex dump of content octets or DER encoding). We can - * only dump non character strings or everything. If we - * don't dump 'unknown' they are interpreted as character - * strings with 1 octet per character and are subject to - * the usual escaping options. - */ - -#define ASN1_STRFLGS_DUMP_ALL 0x80 -#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 - -/* These determine what 'dumping' does, we can dump the - * content octets or the DER encoding: both use the - * RFC2253 #XXXXX notation. - */ - -#define ASN1_STRFLGS_DUMP_DER 0x200 - -/* All the string flags consistent with RFC2253, - * escaping control characters isn't essential in - * RFC2253 but it is advisable anyway. - */ - -#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ - ASN1_STRFLGS_ESC_CTRL | \ - ASN1_STRFLGS_ESC_MSB | \ - ASN1_STRFLGS_UTF8_CONVERT | \ - ASN1_STRFLGS_DUMP_UNKNOWN | \ - ASN1_STRFLGS_DUMP_DER) - -DECLARE_STACK_OF(ASN1_INTEGER) -DECLARE_ASN1_SET_OF(ASN1_INTEGER) - -DECLARE_STACK_OF(ASN1_GENERALSTRING) - -typedef struct asn1_type_st - { - int type; - union { - char *ptr; - ASN1_BOOLEAN boolean; - ASN1_STRING * asn1_string; - ASN1_OBJECT * object; - ASN1_INTEGER * integer; - ASN1_ENUMERATED * enumerated; - ASN1_BIT_STRING * bit_string; - ASN1_OCTET_STRING * octet_string; - ASN1_PRINTABLESTRING * printablestring; - ASN1_T61STRING * t61string; - ASN1_IA5STRING * ia5string; - ASN1_GENERALSTRING * generalstring; - ASN1_BMPSTRING * bmpstring; - ASN1_UNIVERSALSTRING * universalstring; - ASN1_UTCTIME * utctime; - ASN1_GENERALIZEDTIME * generalizedtime; - ASN1_VISIBLESTRING * visiblestring; - ASN1_UTF8STRING * utf8string; - /* set and sequence are left complete and still - * contain the set or sequence bytes */ - ASN1_STRING * set; - ASN1_STRING * sequence; - ASN1_VALUE * asn1_value; - } value; - } ASN1_TYPE; - -DECLARE_STACK_OF(ASN1_TYPE) -DECLARE_ASN1_SET_OF(ASN1_TYPE) - -typedef struct asn1_method_st - { - i2d_of_void *i2d; - d2i_of_void *d2i; - void *(*create)(void); - void (*destroy)(void *); - } ASN1_METHOD; - -/* This is used when parsing some Netscape objects */ -typedef struct asn1_header_st - { - ASN1_OCTET_STRING *header; - void *data; - ASN1_METHOD *meth; - } ASN1_HEADER; - -/* This is used to contain a list of bit names */ -typedef struct BIT_STRING_BITNAME_st { - int bitnum; - const char *lname; - const char *sname; -} BIT_STRING_BITNAME; - - -#define M_ASN1_STRING_length(x) ((x)->length) -#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n)) -#define M_ASN1_STRING_type(x) ((x)->type) -#define M_ASN1_STRING_data(x) ((x)->data) - -/* Macros for string operations */ -#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\ - ASN1_STRING_type_new(V_ASN1_BIT_STRING) -#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\ - ASN1_STRING_dup((ASN1_STRING *)a) -#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (ASN1_STRING *)a,(ASN1_STRING *)b) -#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) - -#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\ - ASN1_STRING_type_new(V_ASN1_INTEGER) -#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a) -#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\ - (ASN1_STRING *)a,(ASN1_STRING *)b) - -#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\ - ASN1_STRING_type_new(V_ASN1_ENUMERATED) -#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a) -#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\ - (ASN1_STRING *)a,(ASN1_STRING *)b) - -#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\ - ASN1_STRING_type_new(V_ASN1_OCTET_STRING) -#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\ - ASN1_STRING_dup((ASN1_STRING *)a) -#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (ASN1_STRING *)a,(ASN1_STRING *)b) -#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) -#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b) -#define M_i2d_ASN1_OCTET_STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ - V_ASN1_UNIVERSAL) - -#define B_ASN1_TIME \ - B_ASN1_UTCTIME | \ - B_ASN1_GENERALIZEDTIME - -#define B_ASN1_PRINTABLE \ - B_ASN1_NUMERICSTRING| \ - B_ASN1_PRINTABLESTRING| \ - B_ASN1_T61STRING| \ - B_ASN1_IA5STRING| \ - B_ASN1_BIT_STRING| \ - B_ASN1_UNIVERSALSTRING|\ - B_ASN1_BMPSTRING|\ - B_ASN1_UTF8STRING|\ - B_ASN1_SEQUENCE|\ - B_ASN1_UNKNOWN - -#define B_ASN1_DIRECTORYSTRING \ - B_ASN1_PRINTABLESTRING| \ - B_ASN1_TELETEXSTRING|\ - B_ASN1_BMPSTRING|\ - B_ASN1_UNIVERSALSTRING|\ - B_ASN1_UTF8STRING - -#define B_ASN1_DISPLAYTEXT \ - B_ASN1_IA5STRING| \ - B_ASN1_VISIBLESTRING| \ - B_ASN1_BMPSTRING|\ - B_ASN1_UTF8STRING - -#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) -#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_PRINTABLE(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_PRINTABLE) - -#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_DIRECTORYSTRING(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DIRECTORYSTRING) - -#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_DISPLAYTEXT(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DISPLAYTEXT) - -#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_PRINTABLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \ - (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING) - -#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\ - ASN1_STRING_type_new(V_ASN1_T61STRING) -#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_T61STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_T61STRING(a,pp,l) \ - (ASN1_T61STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING) - -#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\ - ASN1_STRING_type_new(V_ASN1_IA5STRING) -#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_IA5STRING_dup(a) \ - (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a) -#define M_i2d_ASN1_IA5STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_IA5STRING(a,pp,l) \ - (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\ - B_ASN1_IA5STRING) - -#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a) - -#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\ - ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME) -#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\ - (ASN1_STRING *)a) - -#define M_ASN1_TIME_new() (ASN1_TIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a) - -#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_GENERALSTRING) -#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_GENERALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_GENERALSTRING(a,pp,l) \ - (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING) - -#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING) -#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \ - (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING) - -#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\ - ASN1_STRING_type_new(V_ASN1_BMPSTRING) -#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_BMPSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_BMPSTRING(a,pp,l) \ - (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING) - -#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_VISIBLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \ - (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING) - -#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\ - ASN1_STRING_type_new(V_ASN1_UTF8STRING) -#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_UTF8STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_UTF8STRING(a,pp,l) \ - (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) - - /* for the is_set parameter to i2d_ASN1_SET */ -#define IS_SEQUENCE 0 -#define IS_SET 1 - -DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) - -int ASN1_TYPE_get(ASN1_TYPE *a); -void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); -int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); - -ASN1_OBJECT * ASN1_OBJECT_new(void ); -void ASN1_OBJECT_free(ASN1_OBJECT *a); -int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); -ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, - long length); -ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, - long length); - -DECLARE_ASN1_ITEM(ASN1_OBJECT) - -DECLARE_STACK_OF(ASN1_OBJECT) -DECLARE_ASN1_SET_OF(ASN1_OBJECT) - -ASN1_STRING * ASN1_STRING_new(void); -void ASN1_STRING_free(ASN1_STRING *a); -ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a); -ASN1_STRING * ASN1_STRING_type_new(int type ); -int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b); - /* Since this is used to store all sorts of things, via macros, for now, make - its data void * */ -int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); -void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); -int ASN1_STRING_length(ASN1_STRING *x); -void ASN1_STRING_length_set(ASN1_STRING *x, int n); -int ASN1_STRING_type(ASN1_STRING *x); -unsigned char * ASN1_STRING_data(ASN1_STRING *x); - -DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) -int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); -ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, - long length); -int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, - int length ); -int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); - -#ifndef OPENSSL_NO_BIO -int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, - BIT_STRING_BITNAME *tbl, int indent); -#endif -int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); -int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, - BIT_STRING_BITNAME *tbl); - -int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); -int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); - -DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) -int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); -ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, - long length); -ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, - long length); -ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); -int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); - -DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) - -int ASN1_UTCTIME_check(ASN1_UTCTIME *a); -ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); -int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); -int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); -#if 0 -time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); -#endif - -int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); -ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); -int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); - -DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) -ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); -int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); -int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); - -DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_NULL) -DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) - -int UTF8_getc(const unsigned char *str, int len, unsigned long *val); -int UTF8_putc(unsigned char *str, int len, unsigned long value); - -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) - -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) -DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) -DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) -DECLARE_ASN1_FUNCTIONS(ASN1_TIME) - -DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) - -ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); -int ASN1_TIME_check(ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); - -int i2d_ASN1_SET(STACK *a, unsigned char **pp, - i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); -STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length, - d2i_of_void *d2i, void (*free_func)(void *), - int ex_tag, int ex_class); - -#ifndef OPENSSL_NO_BIO -int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); -int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); -int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); -int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size); -int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a); -int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size); -int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); -#endif -int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); - -int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); -ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, - const char *sn, const char *ln); - -int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); -long ASN1_INTEGER_get(ASN1_INTEGER *a); -ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai); -BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai,BIGNUM *bn); - -int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); -long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); -ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); -BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); - -/* General */ -/* given a string, return the correct type, max is the maximum length */ -int ASN1_PRINTABLE_type(const unsigned char *s, int max); - -int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); -ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int Ptag, int Pclass); -unsigned long ASN1_tag2bit(int tag); -/* type is one or more of the B_ASN1_ values. */ -ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp, - long length,int type); - -/* PARSING */ -int asn1_Finish(ASN1_CTX *c); -int asn1_const_Finish(ASN1_const_CTX *c); - -/* SPECIALS */ -int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, - int *pclass, long omax); -int ASN1_check_infinite_end(unsigned char **p,long len); -int ASN1_const_check_infinite_end(const unsigned char **p,long len); -void ASN1_put_object(unsigned char **pp, int constructed, int length, - int tag, int xclass); -int ASN1_put_eoc(unsigned char **pp); -int ASN1_object_size(int constructed, int length, int tag); - -/* Used to implement other functions */ -void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x); - -#define ASN1_dup_of(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_dup_of_const(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(const type, x))) - -void *ASN1_item_dup(const ASN1_ITEM *it, void *x); - -/* ASN1 alloc/free macros for when a type is only used internally */ - -#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) -#define M_ASN1_free_of(x, type) \ - ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) - -#ifndef OPENSSL_NO_FP_API -void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); - -#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - -void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); -int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); - -#define ASN1_i2d_fp_of(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_fp_of_const(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - -int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); -int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); -#endif - -int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); - -#ifndef OPENSSL_NO_BIO -void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); - -#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - -void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); -int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); - -#define ASN1_i2d_bio_of(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - -int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); -int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); -int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); -int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); -int ASN1_STRING_print(BIO *bp,ASN1_STRING *v); -int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); -int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent); -int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump); -#endif -const char *ASN1_tag2str(int tag); - -/* Used to load and write netscape format cert/key */ -int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp); -ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length); -ASN1_HEADER *ASN1_HEADER_new(void ); -void ASN1_HEADER_free(ASN1_HEADER *a); - -int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); - -/* Not used that much at this point, except for the first two */ -ASN1_METHOD *X509_asn1_meth(void); -ASN1_METHOD *RSAPrivateKey_asn1_meth(void); -ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void); -ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void); - -int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, - unsigned char *data, int len); -int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, - unsigned char *data, int max_len); -int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, - unsigned char *data, int len); -int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, - unsigned char *data, int max_len); - -STACK *ASN1_seq_unpack(const unsigned char *buf, int len, - d2i_of_void *d2i, void (*free_func)(void *)); -unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d, - unsigned char **buf, int *len ); -void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); -void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); -ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, - ASN1_OCTET_STRING **oct); - -#define ASN1_pack_string_of(type,obj,i2d,oct) \ - (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ - CHECKED_I2D_OF(type, i2d), \ - oct)) - -ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); - -void ASN1_STRING_set_default_mask(unsigned long mask); -int ASN1_STRING_set_default_mask_asc(char *p); -unsigned long ASN1_STRING_get_default_mask(void); -int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask); -int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask, - long minsize, long maxsize); - -ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, - const unsigned char *in, int inlen, int inform, int nid); -ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); -int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); -void ASN1_STRING_TABLE_cleanup(void); - -/* ASN1 template functions */ - -/* Old API compatible functions */ -ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); -void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); -ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); -int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); -int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); - -void ASN1_add_oid_module(void); - -ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); -ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); - -typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags, - const ASN1_ITEM *it); - -int int_smime_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, - int ctype_nid, int econt_nid, - STACK_OF(X509_ALGOR) *mdalgs, - asn1_output_data_fn *data_fn, - const ASN1_ITEM *it); -ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ASN1_strings(void); - -/* Error codes for the ASN1 functions. */ - -/* Function codes. */ -#define ASN1_F_A2D_ASN1_OBJECT 100 -#define ASN1_F_A2I_ASN1_ENUMERATED 101 -#define ASN1_F_A2I_ASN1_INTEGER 102 -#define ASN1_F_A2I_ASN1_STRING 103 -#define ASN1_F_APPEND_EXP 176 -#define ASN1_F_ASN1_BIT_STRING_SET_BIT 183 -#define ASN1_F_ASN1_CB 177 -#define ASN1_F_ASN1_CHECK_TLEN 104 -#define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 -#define ASN1_F_ASN1_COLLECT 106 -#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 -#define ASN1_F_ASN1_D2I_FP 109 -#define ASN1_F_ASN1_D2I_READ_BIO 107 -#define ASN1_F_ASN1_DIGEST 184 -#define ASN1_F_ASN1_DO_ADB 110 -#define ASN1_F_ASN1_DUP 111 -#define ASN1_F_ASN1_ENUMERATED_SET 112 -#define ASN1_F_ASN1_ENUMERATED_TO_BN 113 -#define ASN1_F_ASN1_EX_C2I 204 -#define ASN1_F_ASN1_FIND_END 190 -#define ASN1_F_ASN1_GENERALIZEDTIME_SET 185 -#define ASN1_F_ASN1_GENERATE_V3 178 -#define ASN1_F_ASN1_GET_OBJECT 114 -#define ASN1_F_ASN1_HEADER_NEW 115 -#define ASN1_F_ASN1_I2D_BIO 116 -#define ASN1_F_ASN1_I2D_FP 117 -#define ASN1_F_ASN1_INTEGER_SET 118 -#define ASN1_F_ASN1_INTEGER_TO_BN 119 -#define ASN1_F_ASN1_ITEM_D2I_FP 206 -#define ASN1_F_ASN1_ITEM_DUP 191 -#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 -#define ASN1_F_ASN1_ITEM_EX_D2I 120 -#define ASN1_F_ASN1_ITEM_I2D_BIO 192 -#define ASN1_F_ASN1_ITEM_I2D_FP 193 -#define ASN1_F_ASN1_ITEM_PACK 198 -#define ASN1_F_ASN1_ITEM_SIGN 195 -#define ASN1_F_ASN1_ITEM_UNPACK 199 -#define ASN1_F_ASN1_ITEM_VERIFY 197 -#define ASN1_F_ASN1_MBSTRING_NCOPY 122 -#define ASN1_F_ASN1_OBJECT_NEW 123 -#define ASN1_F_ASN1_OUTPUT_DATA 207 -#define ASN1_F_ASN1_PACK_STRING 124 -#define ASN1_F_ASN1_PCTX_NEW 205 -#define ASN1_F_ASN1_PKCS5_PBE_SET 125 -#define ASN1_F_ASN1_SEQ_PACK 126 -#define ASN1_F_ASN1_SEQ_UNPACK 127 -#define ASN1_F_ASN1_SIGN 128 -#define ASN1_F_ASN1_STR2TYPE 179 -#define ASN1_F_ASN1_STRING_SET 186 -#define ASN1_F_ASN1_STRING_TABLE_ADD 129 -#define ASN1_F_ASN1_STRING_TYPE_NEW 130 -#define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 -#define ASN1_F_ASN1_TEMPLATE_NEW 133 -#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131 -#define ASN1_F_ASN1_TIME_SET 175 -#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 -#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 -#define ASN1_F_ASN1_UNPACK_STRING 136 -#define ASN1_F_ASN1_UTCTIME_SET 187 -#define ASN1_F_ASN1_VERIFY 137 -#define ASN1_F_B64_READ_ASN1 208 -#define ASN1_F_B64_WRITE_ASN1 209 -#define ASN1_F_BITSTR_CB 180 -#define ASN1_F_BN_TO_ASN1_ENUMERATED 138 -#define ASN1_F_BN_TO_ASN1_INTEGER 139 -#define ASN1_F_C2I_ASN1_BIT_STRING 189 -#define ASN1_F_C2I_ASN1_INTEGER 194 -#define ASN1_F_C2I_ASN1_OBJECT 196 -#define ASN1_F_COLLECT_DATA 140 -#define ASN1_F_D2I_ASN1_BIT_STRING 141 -#define ASN1_F_D2I_ASN1_BOOLEAN 142 -#define ASN1_F_D2I_ASN1_BYTES 143 -#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144 -#define ASN1_F_D2I_ASN1_HEADER 145 -#define ASN1_F_D2I_ASN1_INTEGER 146 -#define ASN1_F_D2I_ASN1_OBJECT 147 -#define ASN1_F_D2I_ASN1_SET 148 -#define ASN1_F_D2I_ASN1_TYPE_BYTES 149 -#define ASN1_F_D2I_ASN1_UINTEGER 150 -#define ASN1_F_D2I_ASN1_UTCTIME 151 -#define ASN1_F_D2I_NETSCAPE_RSA 152 -#define ASN1_F_D2I_NETSCAPE_RSA_2 153 -#define ASN1_F_D2I_PRIVATEKEY 154 -#define ASN1_F_D2I_PUBLICKEY 155 -#define ASN1_F_D2I_RSA_NET 200 -#define ASN1_F_D2I_RSA_NET_2 201 -#define ASN1_F_D2I_X509 156 -#define ASN1_F_D2I_X509_CINF 157 -#define ASN1_F_D2I_X509_PKEY 159 -#define ASN1_F_I2D_ASN1_SET 188 -#define ASN1_F_I2D_ASN1_TIME 160 -#define ASN1_F_I2D_DSA_PUBKEY 161 -#define ASN1_F_I2D_EC_PUBKEY 181 -#define ASN1_F_I2D_PRIVATEKEY 163 -#define ASN1_F_I2D_PUBLICKEY 164 -#define ASN1_F_I2D_RSA_NET 162 -#define ASN1_F_I2D_RSA_PUBKEY 165 -#define ASN1_F_LONG_C2I 166 -#define ASN1_F_OID_MODULE_INIT 174 -#define ASN1_F_PARSE_TAGGING 182 -#define ASN1_F_PKCS5_PBE2_SET 167 -#define ASN1_F_PKCS5_PBE_SET 202 -#define ASN1_F_SMIME_READ_ASN1 210 -#define ASN1_F_SMIME_TEXT 211 -#define ASN1_F_X509_CINF_NEW 168 -#define ASN1_F_X509_CRL_ADD0_REVOKED 169 -#define ASN1_F_X509_INFO_NEW 170 -#define ASN1_F_X509_NAME_ENCODE 203 -#define ASN1_F_X509_NAME_EX_D2I 158 -#define ASN1_F_X509_NAME_EX_NEW 171 -#define ASN1_F_X509_NEW 172 -#define ASN1_F_X509_PKEY_NEW 173 - -/* Reason codes. */ -#define ASN1_R_ADDING_OBJECT 171 -#define ASN1_R_ASN1_PARSE_ERROR 198 -#define ASN1_R_ASN1_SIG_PARSE_ERROR 199 -#define ASN1_R_AUX_ERROR 100 -#define ASN1_R_BAD_CLASS 101 -#define ASN1_R_BAD_OBJECT_HEADER 102 -#define ASN1_R_BAD_PASSWORD_READ 103 -#define ASN1_R_BAD_TAG 104 -#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 210 -#define ASN1_R_BN_LIB 105 -#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 -#define ASN1_R_BUFFER_TOO_SMALL 107 -#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 -#define ASN1_R_DATA_IS_WRONG 109 -#define ASN1_R_DECODE_ERROR 110 -#define ASN1_R_DECODING_ERROR 111 -#define ASN1_R_DEPTH_EXCEEDED 174 -#define ASN1_R_ENCODE_ERROR 112 -#define ASN1_R_ERROR_GETTING_TIME 173 -#define ASN1_R_ERROR_LOADING_SECTION 172 -#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113 -#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 -#define ASN1_R_EXPECTING_AN_INTEGER 115 -#define ASN1_R_EXPECTING_AN_OBJECT 116 -#define ASN1_R_EXPECTING_A_BOOLEAN 117 -#define ASN1_R_EXPECTING_A_TIME 118 -#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 -#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 -#define ASN1_R_FIELD_MISSING 121 -#define ASN1_R_FIRST_NUM_TOO_LARGE 122 -#define ASN1_R_HEADER_TOO_LONG 123 -#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 -#define ASN1_R_ILLEGAL_BOOLEAN 176 -#define ASN1_R_ILLEGAL_CHARACTERS 124 -#define ASN1_R_ILLEGAL_FORMAT 177 -#define ASN1_R_ILLEGAL_HEX 178 -#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 -#define ASN1_R_ILLEGAL_INTEGER 180 -#define ASN1_R_ILLEGAL_NESTED_TAGGING 181 -#define ASN1_R_ILLEGAL_NULL 125 -#define ASN1_R_ILLEGAL_NULL_VALUE 182 -#define ASN1_R_ILLEGAL_OBJECT 183 -#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 -#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 -#define ASN1_R_ILLEGAL_TAGGED_ANY 127 -#define ASN1_R_ILLEGAL_TIME_VALUE 184 -#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 -#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 -#define ASN1_R_INVALID_BMPSTRING_LENGTH 129 -#define ASN1_R_INVALID_DIGIT 130 -#define ASN1_R_INVALID_MIME_TYPE 200 -#define ASN1_R_INVALID_MODIFIER 186 -#define ASN1_R_INVALID_NUMBER 187 -#define ASN1_R_INVALID_SEPARATOR 131 -#define ASN1_R_INVALID_TIME_FORMAT 132 -#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 -#define ASN1_R_INVALID_UTF8STRING 134 -#define ASN1_R_IV_TOO_LARGE 135 -#define ASN1_R_LENGTH_ERROR 136 -#define ASN1_R_LIST_ERROR 188 -#define ASN1_R_MIME_NO_CONTENT_TYPE 201 -#define ASN1_R_MIME_PARSE_ERROR 202 -#define ASN1_R_MIME_SIG_PARSE_ERROR 203 -#define ASN1_R_MISSING_EOC 137 -#define ASN1_R_MISSING_SECOND_NUMBER 138 -#define ASN1_R_MISSING_VALUE 189 -#define ASN1_R_MSTRING_NOT_UNIVERSAL 139 -#define ASN1_R_MSTRING_WRONG_TAG 140 -#define ASN1_R_NESTED_ASN1_STRING 197 -#define ASN1_R_NON_HEX_CHARACTERS 141 -#define ASN1_R_NOT_ASCII_FORMAT 190 -#define ASN1_R_NOT_ENOUGH_DATA 142 -#define ASN1_R_NO_CONTENT_TYPE 204 -#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 -#define ASN1_R_NO_MULTIPART_BODY_FAILURE 205 -#define ASN1_R_NO_MULTIPART_BOUNDARY 206 -#define ASN1_R_NO_SIG_CONTENT_TYPE 207 -#define ASN1_R_NULL_IS_WRONG_LENGTH 144 -#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 -#define ASN1_R_ODD_NUMBER_OF_CHARS 145 -#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 -#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 -#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 -#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 -#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 -#define ASN1_R_SHORT_LINE 150 -#define ASN1_R_SIG_INVALID_MIME_TYPE 208 -#define ASN1_R_STREAMING_NOT_SUPPORTED 209 -#define ASN1_R_STRING_TOO_LONG 151 -#define ASN1_R_STRING_TOO_SHORT 152 -#define ASN1_R_TAG_VALUE_TOO_HIGH 153 -#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 -#define ASN1_R_TIME_NOT_ASCII_FORMAT 193 -#define ASN1_R_TOO_LONG 155 -#define ASN1_R_TYPE_NOT_CONSTRUCTED 156 -#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 -#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 -#define ASN1_R_UNEXPECTED_EOC 159 -#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 211 -#define ASN1_R_UNKNOWN_FORMAT 160 -#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 -#define ASN1_R_UNKNOWN_OBJECT_TYPE 162 -#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 -#define ASN1_R_UNKNOWN_TAG 194 -#define ASN1_R_UNKOWN_FORMAT 195 -#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 -#define ASN1_R_UNSUPPORTED_CIPHER 165 -#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 -#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 -#define ASN1_R_UNSUPPORTED_TYPE 196 -#define ASN1_R_WRONG_TAG 168 -#define ASN1_R_WRONG_TYPE 169 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/asn1_mac.h b/dep/include/openssl/asn1_mac.h deleted file mode 100644 index c7b79ec56d8..00000000000 --- a/dep/include/openssl/asn1_mac.h +++ /dev/null @@ -1,572 +0,0 @@ -/* crypto/asn1/asn1_mac.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ASN1_MAC_H -#define HEADER_ASN1_MAC_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef ASN1_MAC_ERR_LIB -#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 -#endif - -#define ASN1_MAC_H_err(f,r,line) \ - ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) - -#define M_ASN1_D2I_vars(a,type,func) \ - ASN1_const_CTX c; \ - type ret=NULL; \ - \ - c.pp=(const unsigned char **)pp; \ - c.q= *(const unsigned char **)pp; \ - c.error=ERR_R_NESTED_ASN1_ERROR; \ - if ((a == NULL) || ((*a) == NULL)) \ - { if ((ret=(type)func()) == NULL) \ - { c.line=__LINE__; goto err; } } \ - else ret=(*a); - -#define M_ASN1_D2I_Init() \ - c.p= *(const unsigned char **)pp; \ - c.max=(length == 0)?0:(c.p+length); - -#define M_ASN1_D2I_Finish_2(a) \ - if (!asn1_const_Finish(&c)) \ - { c.line=__LINE__; goto err; } \ - *(const unsigned char **)pp=c.p; \ - if (a != NULL) (*a)=ret; \ - return(ret); - -#define M_ASN1_D2I_Finish(a,func,e) \ - M_ASN1_D2I_Finish_2(a); \ -err:\ - ASN1_MAC_H_err((e),c.error,c.line); \ - asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \ - if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ - return(NULL) - -#define M_ASN1_D2I_start_sequence() \ - if (!asn1_GetSequence(&c,&length)) \ - { c.line=__LINE__; goto err; } -/* Begin reading ASN1 without a surrounding sequence */ -#define M_ASN1_D2I_begin() \ - c.slen = length; - -/* End reading ASN1 with no check on length */ -#define M_ASN1_D2I_Finish_nolen(a, func, e) \ - *pp=c.p; \ - if (a != NULL) (*a)=ret; \ - return(ret); \ -err:\ - ASN1_MAC_H_err((e),c.error,c.line); \ - asn1_add_error(*pp,(int)(c.q- *pp)); \ - if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ - return(NULL) - -#define M_ASN1_D2I_end_sequence() \ - (((c.inf&1) == 0)?(c.slen <= 0): \ - (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen))) - -/* Don't use this with d2i_ASN1_BOOLEAN() */ -#define M_ASN1_D2I_get(b, func) \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -/* Don't use this with d2i_ASN1_BOOLEAN() */ -#define M_ASN1_D2I_get_x(type,b,func) \ - c.q=c.p; \ - if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -/* use this instead () */ -#define M_ASN1_D2I_get_int(b,func) \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) < 0) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -#define M_ASN1_D2I_get_opt(b,func,type) \ - if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \ - == (V_ASN1_UNIVERSAL|(type)))) \ - { \ - M_ASN1_D2I_get(b,func); \ - } - -#define M_ASN1_D2I_get_imp(b,func, type) \ - M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \ - c.slen-=(c.p-c.q);\ - M_ASN1_next_prev=_tmp; - -#define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \ - if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \ - (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \ - { \ - unsigned char _tmp = M_ASN1_next; \ - M_ASN1_D2I_get_imp(b,func, type);\ - } - -#define M_ASN1_D2I_get_set(r,func,free_func) \ - M_ASN1_D2I_get_imp_set(r,func,free_func, \ - V_ASN1_SET,V_ASN1_UNIVERSAL); - -#define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ - V_ASN1_SET,V_ASN1_UNIVERSAL); - -#define M_ASN1_D2I_get_set_opt(r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ - { M_ASN1_D2I_get_set(r,func,free_func); } - -#define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ - { M_ASN1_D2I_get_set_type(type,r,func,free_func); } - -#define M_ASN1_I2D_len_SET_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_len_SET(a,f); - -#define M_ASN1_I2D_put_SET_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SET(a,f); - -#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE(a,f); - -#define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE_type(type,a,f); - -#define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ - if ((c.slen != 0) && \ - (M_ASN1_next == \ - (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ - { \ - M_ASN1_D2I_get_imp_set(b,func,free_func,\ - tag,V_ASN1_CONTEXT_SPECIFIC); \ - } - -#define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ - if ((c.slen != 0) && \ - (M_ASN1_next == \ - (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ - { \ - M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\ - tag,V_ASN1_CONTEXT_SPECIFIC); \ - } - -#define M_ASN1_D2I_get_seq(r,func,free_func) \ - M_ASN1_D2I_get_imp_set(r,func,free_func,\ - V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - -#define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ - V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) - -#define M_ASN1_D2I_get_seq_opt(r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ - { M_ASN1_D2I_get_seq(r,func,free_func); } - -#define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ - { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } - -#define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \ - M_ASN1_D2I_get_imp_set(r,func,free_func,\ - x,V_ASN1_CONTEXT_SPECIFIC); - -#define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ - x,V_ASN1_CONTEXT_SPECIFIC); - -#define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\ - (void (*)())free_func,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -#define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ - free_func,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -#define M_ASN1_D2I_get_set_strings(r,func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -#define M_ASN1_D2I_get_EXP_opt(r,func,tag) \ - if ((c.slen != 0L) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (func(&(r),&c.p,Tlen) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -#define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \ - if ((c.slen != 0) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \ - (void (*)())free_func, \ - b,V_ASN1_UNIVERSAL) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -#define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ - if ((c.slen != 0) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \ - free_func,b,V_ASN1_UNIVERSAL) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -/* New macros */ -#define M_ASN1_New_Malloc(ret,type) \ - if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \ - { c.line=__LINE__; goto err2; } - -#define M_ASN1_New(arg,func) \ - if (((arg)=func()) == NULL) return(NULL) - -#define M_ASN1_New_Error(a) \ -/* err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \ - return(NULL);*/ \ - err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \ - return(NULL) - - -/* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, - some macros that use ASN1_const_CTX still insist on writing in the input - stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. - Please? -- Richard Levitte */ -#define M_ASN1_next (*((unsigned char *)(c.p))) -#define M_ASN1_next_prev (*((unsigned char *)(c.q))) - -/*************************************************/ - -#define M_ASN1_I2D_vars(a) int r=0,ret=0; \ - unsigned char *p; \ - if (a == NULL) return(0) - -/* Length Macros */ -#define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) -#define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) - -#define M_ASN1_I2D_len_SET(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); - -#define M_ASN1_I2D_len_SET_type(type,a,f) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ - V_ASN1_UNIVERSAL,IS_SET); - -#define M_ASN1_I2D_len_SEQUENCE(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); - -#define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ - V_ASN1_UNIVERSAL,IS_SEQUENCE) - -#define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_len_SEQUENCE(a,f); - -#define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - M_ASN1_I2D_len_SEQUENCE_type(type,a,f); - -#define M_ASN1_I2D_len_IMP_SET(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -#define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -#define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); - -#define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -#define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -#define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -#define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -#define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \ - if (a != NULL)\ - { \ - v=f(a,NULL); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -#define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0))\ - { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -#define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0))\ - { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -#define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_##type##_num(a) != 0))\ - { \ - v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \ - V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -/* Put Macros */ -#define M_ASN1_I2D_put(a,f) f(a,&p) - -#define M_ASN1_I2D_put_IMP_opt(a,f,t) \ - if (a != NULL) \ - { \ - unsigned char *q=p; \ - f(a,&p); \ - *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ - } - -#define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ - V_ASN1_UNIVERSAL,IS_SET) -#define M_ASN1_I2D_put_SET_type(type,a,f) \ - i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) -#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ - V_ASN1_CONTEXT_SPECIFIC,IS_SET) -#define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ - i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) -#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ - V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) - -#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ - V_ASN1_UNIVERSAL,IS_SEQUENCE) - -#define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ - i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE) - -#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE(a,f); - -#define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); } - -#define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); } - -#define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); } - -#define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); } - -#define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \ - if (a != NULL) \ - { \ - ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \ - f(a,&p); \ - } - -#define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ - } - -#define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ - } - -#define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - } - -#define M_ASN1_I2D_seq_total() \ - r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ - if (pp == NULL) return(r); \ - p= *pp; \ - ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) - -#define M_ASN1_I2D_INF_seq_start(tag,ctx) \ - *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \ - *(p++)=0x80 - -#define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00 - -#define M_ASN1_I2D_finish() *pp=p; \ - return(r); - -int asn1_GetSequence(ASN1_const_CTX *c, long *length); -void asn1_add_error(const unsigned char *address,int offset); -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/include/openssl/asn1t.h b/dep/include/openssl/asn1t.h deleted file mode 100644 index ac14f9415b8..00000000000 --- a/dep/include/openssl/asn1t.h +++ /dev/null @@ -1,893 +0,0 @@ -/* asn1t.h */ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 2000. - */ -/* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ASN1T_H -#define HEADER_ASN1T_H - -#include -#include -#include - -#ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -#endif - -/* ASN1 template defines, structures and functions */ - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ -#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) - - -/* Macros for start and end of ASN1_ITEM definition */ - -#define ASN1_ITEM_start(itname) \ - OPENSSL_GLOBAL const ASN1_ITEM itname##_it = { - -#define ASN1_ITEM_end(itname) \ - }; - -#else - -/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ -#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr())) - - -/* Macros for start and end of ASN1_ITEM definition */ - -#define ASN1_ITEM_start(itname) \ - const ASN1_ITEM * itname##_it(void) \ - { \ - static const ASN1_ITEM local_it = { - -#define ASN1_ITEM_end(itname) \ - }; \ - return &local_it; \ - } - -#endif - - -/* Macros to aid ASN1 template writing */ - -#define ASN1_ITEM_TEMPLATE(tname) \ - static const ASN1_TEMPLATE tname##_item_tt - -#define ASN1_ITEM_TEMPLATE_END(tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_PRIMITIVE,\ - -1,\ - &tname##_item_tt,\ - 0,\ - NULL,\ - 0,\ - #tname \ - ASN1_ITEM_end(tname) - - -/* This is a ASN1 type which just embeds a template */ - -/* This pair helps declare a SEQUENCE. We can do: - * - * ASN1_SEQUENCE(stname) = { - * ... SEQUENCE components ... - * } ASN1_SEQUENCE_END(stname) - * - * This will produce an ASN1_ITEM called stname_it - * for a structure called stname. - * - * If you want the same structure but a different - * name then use: - * - * ASN1_SEQUENCE(itname) = { - * ... SEQUENCE components ... - * } ASN1_SEQUENCE_END_name(stname, itname) - * - * This will create an item called itname_it using - * a structure called stname. - */ - -#define ASN1_SEQUENCE(tname) \ - static const ASN1_TEMPLATE tname##_seq_tt[] - -#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) - -#define ASN1_SEQUENCE_END_name(stname, tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -#define ASN1_NDEF_SEQUENCE(tname) \ - ASN1_SEQUENCE(tname) - -#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ - ASN1_SEQUENCE_cb(tname, cb) - -#define ASN1_SEQUENCE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ - ASN1_SEQUENCE(tname) - -#define ASN1_BROKEN_SEQUENCE(tname) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ - ASN1_SEQUENCE(tname) - -#define ASN1_SEQUENCE_ref(tname, cb, lck) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ - ASN1_SEQUENCE(tname) - -#define ASN1_SEQUENCE_enc(tname, enc, cb) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ - ASN1_SEQUENCE(tname) - -#define ASN1_NDEF_SEQUENCE_END(tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_NDEF_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(tname),\ - #tname \ - ASN1_ITEM_end(tname) - -#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) - -#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) - -#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) - -#define ASN1_SEQUENCE_END_ref(stname, tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - &tname##_aux,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - - -/* This pair helps declare a CHOICE type. We can do: - * - * ASN1_CHOICE(chname) = { - * ... CHOICE options ... - * ASN1_CHOICE_END(chname) - * - * This will produce an ASN1_ITEM called chname_it - * for a structure called chname. The structure - * definition must look like this: - * typedef struct { - * int type; - * union { - * ASN1_SOMETHING *opt1; - * ASN1_SOMEOTHER *opt2; - * } value; - * } chname; - * - * the name of the selector must be 'type'. - * to use an alternative selector name use the - * ASN1_CHOICE_END_selector() version. - */ - -#define ASN1_CHOICE(tname) \ - static const ASN1_TEMPLATE tname##_ch_tt[] - -#define ASN1_CHOICE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ - ASN1_CHOICE(tname) - -#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) - -#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) - -#define ASN1_CHOICE_END_selector(stname, tname, selname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_CHOICE,\ - offsetof(stname,selname) ,\ - tname##_ch_tt,\ - sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -#define ASN1_CHOICE_END_cb(stname, tname, selname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_CHOICE,\ - offsetof(stname,selname) ,\ - tname##_ch_tt,\ - sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ - &tname##_aux,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -/* This helps with the template wrapper form of ASN1_ITEM */ - -#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ - (flags), (tag), 0,\ - #name, ASN1_ITEM_ref(type) } - -/* These help with SEQUENCE or CHOICE components */ - -/* used to declare other types */ - -#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ - (flags), (tag), offsetof(stname, field),\ - #field, ASN1_ITEM_ref(type) } - -/* used when the structure is combined with the parent */ - -#define ASN1_EX_COMBINE(flags, tag, type) { \ - (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } - -/* implicit and explicit helper macros */ - -#define ASN1_IMP_EX(stname, field, type, tag, ex) \ - ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) - -#define ASN1_EXP_EX(stname, field, type, tag, ex) \ - ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) - -/* Any defined by macros: the field used is in the table itself */ - -#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION -#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } -#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } -#else -#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } -#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } -#endif -/* Plain simple type */ -#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) - -/* OPTIONAL simple type */ -#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* IMPLICIT tagged simple type */ -#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) - -/* IMPLICIT tagged OPTIONAL simple type */ -#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) - -/* Same as above but EXPLICIT */ - -#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) -#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) - -/* SEQUENCE OF type */ -#define ASN1_SEQUENCE_OF(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) - -/* OPTIONAL SEQUENCE OF */ -#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* Same as above but for SET OF */ - -#define ASN1_SET_OF(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) - -#define ASN1_SET_OF_OPT(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ - -#define ASN1_IMP_SET_OF(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) - -#define ASN1_EXP_SET_OF(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) - -#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) - -#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) - -#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) - -#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) - -#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) - -#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) - -/* EXPLICIT using indefinite length constructed form */ -#define ASN1_NDEF_EXP(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) - -/* EXPLICIT OPTIONAL using indefinite length constructed form */ -#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) - -/* Macros for the ASN1_ADB structure */ - -#define ASN1_ADB(name) \ - static const ASN1_ADB_TABLE name##_adbtbl[] - -#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ - ;\ - static const ASN1_ADB name##_adb = {\ - flags,\ - offsetof(name, field),\ - app_table,\ - name##_adbtbl,\ - sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ - def,\ - none\ - } - -#else - -#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ - ;\ - static const ASN1_ITEM *name##_adb(void) \ - { \ - static const ASN1_ADB internal_adb = \ - {\ - flags,\ - offsetof(name, field),\ - app_table,\ - name##_adbtbl,\ - sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ - def,\ - none\ - }; \ - return (const ASN1_ITEM *) &internal_adb; \ - } \ - void dummy_function(void) - -#endif - -#define ADB_ENTRY(val, template) {val, template} - -#define ASN1_ADB_TEMPLATE(name) \ - static const ASN1_TEMPLATE name##_tt - -/* This is the ASN1 template structure that defines - * a wrapper round the actual type. It determines the - * actual position of the field in the value structure, - * various flags such as OPTIONAL and the field name. - */ - -struct ASN1_TEMPLATE_st { -unsigned long flags; /* Various flags */ -long tag; /* tag, not used if no tagging */ -unsigned long offset; /* Offset of this field in structure */ -#ifndef NO_ASN1_FIELD_NAMES -const char *field_name; /* Field name */ -#endif -ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ -}; - -/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ - -#define ASN1_TEMPLATE_item(t) (t->item_ptr) -#define ASN1_TEMPLATE_adb(t) (t->item_ptr) - -typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; -typedef struct ASN1_ADB_st ASN1_ADB; - -struct ASN1_ADB_st { - unsigned long flags; /* Various flags */ - unsigned long offset; /* Offset of selector field */ - STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */ - const ASN1_ADB_TABLE *tbl; /* Table of possible types */ - long tblcount; /* Number of entries in tbl */ - const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ - const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ -}; - -struct ASN1_ADB_TABLE_st { - long value; /* NID for an object or value for an int */ - const ASN1_TEMPLATE tt; /* item for this value */ -}; - -/* template flags */ - -/* Field is optional */ -#define ASN1_TFLG_OPTIONAL (0x1) - -/* Field is a SET OF */ -#define ASN1_TFLG_SET_OF (0x1 << 1) - -/* Field is a SEQUENCE OF */ -#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) - -/* Special case: this refers to a SET OF that - * will be sorted into DER order when encoded *and* - * the corresponding STACK will be modified to match - * the new order. - */ -#define ASN1_TFLG_SET_ORDER (0x3 << 1) - -/* Mask for SET OF or SEQUENCE OF */ -#define ASN1_TFLG_SK_MASK (0x3 << 1) - -/* These flags mean the tag should be taken from the - * tag field. If EXPLICIT then the underlying type - * is used for the inner tag. - */ - -/* IMPLICIT tagging */ -#define ASN1_TFLG_IMPTAG (0x1 << 3) - - -/* EXPLICIT tagging, inner tag from underlying type */ -#define ASN1_TFLG_EXPTAG (0x2 << 3) - -#define ASN1_TFLG_TAG_MASK (0x3 << 3) - -/* context specific IMPLICIT */ -#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT - -/* context specific EXPLICIT */ -#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT - -/* If tagging is in force these determine the - * type of tag to use. Otherwise the tag is - * determined by the underlying type. These - * values reflect the actual octet format. - */ - -/* Universal tag */ -#define ASN1_TFLG_UNIVERSAL (0x0<<6) -/* Application tag */ -#define ASN1_TFLG_APPLICATION (0x1<<6) -/* Context specific tag */ -#define ASN1_TFLG_CONTEXT (0x2<<6) -/* Private tag */ -#define ASN1_TFLG_PRIVATE (0x3<<6) - -#define ASN1_TFLG_TAG_CLASS (0x3<<6) - -/* These are for ANY DEFINED BY type. In this case - * the 'item' field points to an ASN1_ADB structure - * which contains a table of values to decode the - * relevant type - */ - -#define ASN1_TFLG_ADB_MASK (0x3<<8) - -#define ASN1_TFLG_ADB_OID (0x1<<8) - -#define ASN1_TFLG_ADB_INT (0x1<<9) - -/* This flag means a parent structure is passed - * instead of the field: this is useful is a - * SEQUENCE is being combined with a CHOICE for - * example. Since this means the structure and - * item name will differ we need to use the - * ASN1_CHOICE_END_name() macro for example. - */ - -#define ASN1_TFLG_COMBINE (0x1<<10) - -/* This flag when present in a SEQUENCE OF, SET OF - * or EXPLICIT causes indefinite length constructed - * encoding to be used if required. - */ - -#define ASN1_TFLG_NDEF (0x1<<11) - -/* This is the actual ASN1 item itself */ - -struct ASN1_ITEM_st { -char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ -long utype; /* underlying type */ -const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */ -long tcount; /* Number of templates if SEQUENCE or CHOICE */ -const void *funcs; /* functions that handle this type */ -long size; /* Structure size (usually)*/ -#ifndef NO_ASN1_FIELD_NAMES -const char *sname; /* Structure name */ -#endif -}; - -/* These are values for the itype field and - * determine how the type is interpreted. - * - * For PRIMITIVE types the underlying type - * determines the behaviour if items is NULL. - * - * Otherwise templates must contain a single - * template and the type is treated in the - * same way as the type specified in the template. - * - * For SEQUENCE types the templates field points - * to the members, the size field is the - * structure size. - * - * For CHOICE types the templates field points - * to each possible member (typically a union) - * and the 'size' field is the offset of the - * selector. - * - * The 'funcs' field is used for application - * specific functions. - * - * For COMPAT types the funcs field gives a - * set of functions that handle this type, this - * supports the old d2i, i2d convention. - * - * The EXTERN type uses a new style d2i/i2d. - * The new style should be used where possible - * because it avoids things like the d2i IMPLICIT - * hack. - * - * MSTRING is a multiple string type, it is used - * for a CHOICE of character strings where the - * actual strings all occupy an ASN1_STRING - * structure. In this case the 'utype' field - * has a special meaning, it is used as a mask - * of acceptable types using the B_ASN1 constants. - * - * NDEF_SEQUENCE is the same as SEQUENCE except - * that it will use indefinite length constructed - * encoding if requested. - * - */ - -#define ASN1_ITYPE_PRIMITIVE 0x0 - -#define ASN1_ITYPE_SEQUENCE 0x1 - -#define ASN1_ITYPE_CHOICE 0x2 - -#define ASN1_ITYPE_COMPAT 0x3 - -#define ASN1_ITYPE_EXTERN 0x4 - -#define ASN1_ITYPE_MSTRING 0x5 - -#define ASN1_ITYPE_NDEF_SEQUENCE 0x6 - -/* Cache for ASN1 tag and length, so we - * don't keep re-reading it for things - * like CHOICE - */ - -struct ASN1_TLC_st{ - char valid; /* Values below are valid */ - int ret; /* return value */ - long plen; /* length */ - int ptag; /* class value */ - int pclass; /* class value */ - int hdrlen; /* header length */ -}; - -/* Typedefs for ASN1 function pointers */ - -typedef ASN1_VALUE * ASN1_new_func(void); -typedef void ASN1_free_func(ASN1_VALUE *a); -typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); -typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); - -typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, - int tag, int aclass, char opt, ASN1_TLC *ctx); - -typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); -typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); -typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); - -typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); -typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); - -typedef struct ASN1_COMPAT_FUNCS_st { - ASN1_new_func *asn1_new; - ASN1_free_func *asn1_free; - ASN1_d2i_func *asn1_d2i; - ASN1_i2d_func *asn1_i2d; -} ASN1_COMPAT_FUNCS; - -typedef struct ASN1_EXTERN_FUNCS_st { - void *app_data; - ASN1_ex_new_func *asn1_ex_new; - ASN1_ex_free_func *asn1_ex_free; - ASN1_ex_free_func *asn1_ex_clear; - ASN1_ex_d2i *asn1_ex_d2i; - ASN1_ex_i2d *asn1_ex_i2d; -} ASN1_EXTERN_FUNCS; - -typedef struct ASN1_PRIMITIVE_FUNCS_st { - void *app_data; - unsigned long flags; - ASN1_ex_new_func *prim_new; - ASN1_ex_free_func *prim_free; - ASN1_ex_free_func *prim_clear; - ASN1_primitive_c2i *prim_c2i; - ASN1_primitive_i2c *prim_i2c; -} ASN1_PRIMITIVE_FUNCS; - -/* This is the ASN1_AUX structure: it handles various - * miscellaneous requirements. For example the use of - * reference counts and an informational callback. - * - * The "informational callback" is called at various - * points during the ASN1 encoding and decoding. It can - * be used to provide minor customisation of the structures - * used. This is most useful where the supplied routines - * *almost* do the right thing but need some extra help - * at a few points. If the callback returns zero then - * it is assumed a fatal error has occurred and the - * main operation should be abandoned. - * - * If major changes in the default behaviour are required - * then an external type is more appropriate. - */ - -typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it); - -typedef struct ASN1_AUX_st { - void *app_data; - int flags; - int ref_offset; /* Offset of reference value */ - int ref_lock; /* Lock type to use */ - ASN1_aux_cb *asn1_cb; - int enc_offset; /* Offset of ASN1_ENCODING structure */ -} ASN1_AUX; - -/* Flags in ASN1_AUX */ - -/* Use a reference count */ -#define ASN1_AFLG_REFCOUNT 1 -/* Save the encoding of structure (useful for signatures) */ -#define ASN1_AFLG_ENCODING 2 -/* The Sequence length is invalid */ -#define ASN1_AFLG_BROKEN 4 - -/* operation values for asn1_cb */ - -#define ASN1_OP_NEW_PRE 0 -#define ASN1_OP_NEW_POST 1 -#define ASN1_OP_FREE_PRE 2 -#define ASN1_OP_FREE_POST 3 -#define ASN1_OP_D2I_PRE 4 -#define ASN1_OP_D2I_POST 5 -#define ASN1_OP_I2D_PRE 6 -#define ASN1_OP_I2D_POST 7 - -/* Macro to implement a primitive type */ -#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) -#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ - ASN1_ITEM_start(itname) \ - ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ - ASN1_ITEM_end(itname) - -/* Macro to implement a multi string type */ -#define IMPLEMENT_ASN1_MSTRING(itname, mask) \ - ASN1_ITEM_start(itname) \ - ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ - ASN1_ITEM_end(itname) - -/* Macro to implement an ASN1_ITEM in terms of old style funcs */ - -#define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE) - -#define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \ - static const ASN1_COMPAT_FUNCS sname##_ff = { \ - (ASN1_new_func *)sname##_new, \ - (ASN1_free_func *)sname##_free, \ - (ASN1_d2i_func *)d2i_##sname, \ - (ASN1_i2d_func *)i2d_##sname, \ - }; \ - ASN1_ITEM_start(sname) \ - ASN1_ITYPE_COMPAT, \ - tag, \ - NULL, \ - 0, \ - &sname##_ff, \ - 0, \ - #sname \ - ASN1_ITEM_end(sname) - -#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ - ASN1_ITEM_start(sname) \ - ASN1_ITYPE_EXTERN, \ - tag, \ - NULL, \ - 0, \ - &fptrs, \ - 0, \ - #sname \ - ASN1_ITEM_end(sname) - -/* Macro to implement standard functions in terms of ASN1_ITEM structures */ - -#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) - -#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) - -#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ - IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) - -#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) - -#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ - stname *fname##_new(void) \ - { \ - return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ - } \ - void fname##_free(stname *a) \ - { \ - ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ - } - -#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) - -#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ - stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ - { \ - return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ - } \ - int i2d_##fname(stname *a, unsigned char **out) \ - { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ - } - -#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ - int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ - { \ - return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ - } - -/* This includes evil casts to remove const: they will go away when full - * ASN1 constification is done. - */ -#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ - stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ - { \ - return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ - } \ - int i2d_##fname(const stname *a, unsigned char **out) \ - { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ - } - -#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ - stname * stname##_dup(stname *x) \ - { \ - return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ - } - -#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ - IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) - -#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) - -/* external definitions for primitive types */ - -DECLARE_ASN1_ITEM(ASN1_BOOLEAN) -DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) -DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) -DECLARE_ASN1_ITEM(ASN1_SEQUENCE) -DECLARE_ASN1_ITEM(CBIGNUM) -DECLARE_ASN1_ITEM(BIGNUM) -DECLARE_ASN1_ITEM(LONG) -DECLARE_ASN1_ITEM(ZLONG) - -DECLARE_STACK_OF(ASN1_VALUE) - -/* Functions used internally by the ASN1 code */ - -int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); -void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); -int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); - -void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); -int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt); -int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, - int tag, int aclass, char opt, ASN1_TLC *ctx); - -int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); -int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt); -void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); - -int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); -int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); - -int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); - -ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); - -const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr); - -int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); - -void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); -void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/bio.h b/dep/include/openssl/bio.h deleted file mode 100644 index cecb6a72077..00000000000 --- a/dep/include/openssl/bio.h +++ /dev/null @@ -1,776 +0,0 @@ -/* crypto/bio/bio.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BIO_H -#define HEADER_BIO_H - -#include - -#ifndef OPENSSL_NO_FP_API -# include -#endif -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* These are the 'types' of BIOs */ -#define BIO_TYPE_NONE 0 -#define BIO_TYPE_MEM (1|0x0400) -#define BIO_TYPE_FILE (2|0x0400) - -#define BIO_TYPE_FD (4|0x0400|0x0100) -#define BIO_TYPE_SOCKET (5|0x0400|0x0100) -#define BIO_TYPE_NULL (6|0x0400) -#define BIO_TYPE_SSL (7|0x0200) -#define BIO_TYPE_MD (8|0x0200) /* passive filter */ -#define BIO_TYPE_BUFFER (9|0x0200) /* filter */ -#define BIO_TYPE_CIPHER (10|0x0200) /* filter */ -#define BIO_TYPE_BASE64 (11|0x0200) /* filter */ -#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */ -#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */ -#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */ -#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */ -#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */ -#define BIO_TYPE_NULL_FILTER (17|0x0200) -#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */ -#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ -#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ -#define BIO_TYPE_DGRAM (21|0x0400|0x0100) -#define BIO_TYPE_COMP (23|0x0200) /* filter */ - -#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ -#define BIO_TYPE_FILTER 0x0200 -#define BIO_TYPE_SOURCE_SINK 0x0400 - -/* BIO_FILENAME_READ|BIO_CLOSE to open or close on free. - * BIO_set_fp(in,stdin,BIO_NOCLOSE); */ -#define BIO_NOCLOSE 0x00 -#define BIO_CLOSE 0x01 - -/* These are used in the following macros and are passed to - * BIO_ctrl() */ -#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */ -#define BIO_CTRL_EOF 2 /* opt - are we at the eof */ -#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */ -#define BIO_CTRL_SET 4 /* man - set the 'IO' type */ -#define BIO_CTRL_GET 5 /* man - get the 'IO' type */ -#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */ -#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */ -#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */ -#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */ -#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */ -#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */ -#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */ -#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */ -/* callback is int cb(BIO *bio,state,ret); */ -#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */ -#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */ - -#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */ - -/* dgram BIO stuff */ -#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */ -#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally - * connected socket to be - * passed in */ -#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */ -#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */ -#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */ -#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */ - -#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ -#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */ - -/* #ifdef IP_MTU_DISCOVER */ -#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ -/* #endif */ - -#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ -#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ -#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for - * MTU. want to use this - * if asking the kernel - * fails */ - -#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU - * was exceed in the - * previous write - * operation */ - -#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ - - -/* modifiers */ -#define BIO_FP_READ 0x02 -#define BIO_FP_WRITE 0x04 -#define BIO_FP_APPEND 0x08 -#define BIO_FP_TEXT 0x10 - -#define BIO_FLAGS_READ 0x01 -#define BIO_FLAGS_WRITE 0x02 -#define BIO_FLAGS_IO_SPECIAL 0x04 -#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL) -#define BIO_FLAGS_SHOULD_RETRY 0x08 -#ifndef BIO_FLAGS_UPLINK -/* "UPLINK" flag denotes file descriptors provided by application. - It defaults to 0, as most platforms don't require UPLINK interface. */ -#define BIO_FLAGS_UPLINK 0 -#endif - -/* Used in BIO_gethostbyname() */ -#define BIO_GHBN_CTRL_HITS 1 -#define BIO_GHBN_CTRL_MISSES 2 -#define BIO_GHBN_CTRL_CACHE_SIZE 3 -#define BIO_GHBN_CTRL_GET_ENTRY 4 -#define BIO_GHBN_CTRL_FLUSH 5 - -/* Mostly used in the SSL BIO */ -/* Not used anymore - * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10 - * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20 - * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40 - */ - -#define BIO_FLAGS_BASE64_NO_NL 0x100 - -/* This is used with memory BIOs: it means we shouldn't free up or change the - * data in any way. - */ -#define BIO_FLAGS_MEM_RDONLY 0x200 - -typedef struct bio_st BIO; - -void BIO_set_flags(BIO *b, int flags); -int BIO_test_flags(const BIO *b, int flags); -void BIO_clear_flags(BIO *b, int flags); - -#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) -#define BIO_set_retry_special(b) \ - BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) -#define BIO_set_retry_read(b) \ - BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) -#define BIO_set_retry_write(b) \ - BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) - -/* These are normally used internally in BIOs */ -#define BIO_clear_retry_flags(b) \ - BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) -#define BIO_get_retry_flags(b) \ - BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) - -/* These should be used by the application to tell why we should retry */ -#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) -#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) -#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) -#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) -#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) - -/* The next three are used in conjunction with the - * BIO_should_io_special() condition. After this returns true, - * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO - * stack and return the 'reason' for the special and the offending BIO. - * Given a BIO, BIO_get_retry_reason(bio) will return the code. */ -/* Returned from the SSL bio when the certificate retrieval code had an error */ -#define BIO_RR_SSL_X509_LOOKUP 0x01 -/* Returned from the connect BIO when a connect would have blocked */ -#define BIO_RR_CONNECT 0x02 -/* Returned from the accept BIO when an accept would have blocked */ -#define BIO_RR_ACCEPT 0x03 - -/* These are passed by the BIO callback */ -#define BIO_CB_FREE 0x01 -#define BIO_CB_READ 0x02 -#define BIO_CB_WRITE 0x03 -#define BIO_CB_PUTS 0x04 -#define BIO_CB_GETS 0x05 -#define BIO_CB_CTRL 0x06 - -/* The callback is called before and after the underling operation, - * The BIO_CB_RETURN flag indicates if it is after the call */ -#define BIO_CB_RETURN 0x80 -#define BIO_CB_return(a) ((a)|BIO_CB_RETURN)) -#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) -#define BIO_cb_post(a) ((a)&BIO_CB_RETURN) - -long (*BIO_get_callback(const BIO *b)) (struct bio_st *,int,const char *,int, long,long); -void BIO_set_callback(BIO *b, - long (*callback)(struct bio_st *,int,const char *,int, long,long)); -char *BIO_get_callback_arg(const BIO *b); -void BIO_set_callback_arg(BIO *b, char *arg); - -const char * BIO_method_name(const BIO *b); -int BIO_method_type(const BIO *b); - -typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); - -#ifndef OPENSSL_SYS_WIN16 -typedef struct bio_method_st - { - int type; - const char *name; - int (*bwrite)(BIO *, const char *, int); - int (*bread)(BIO *, char *, int); - int (*bputs)(BIO *, const char *); - int (*bgets)(BIO *, char *, int); - long (*ctrl)(BIO *, int, long, void *); - int (*create)(BIO *); - int (*destroy)(BIO *); - long (*callback_ctrl)(BIO *, int, bio_info_cb *); - } BIO_METHOD; -#else -typedef struct bio_method_st - { - int type; - const char *name; - int (_far *bwrite)(); - int (_far *bread)(); - int (_far *bputs)(); - int (_far *bgets)(); - long (_far *ctrl)(); - int (_far *create)(); - int (_far *destroy)(); - long (_far *callback_ctrl)(); - } BIO_METHOD; -#endif - -struct bio_st - { - BIO_METHOD *method; - /* bio, mode, argp, argi, argl, ret */ - long (*callback)(struct bio_st *,int,const char *,int, long,long); - char *cb_arg; /* first argument for the callback */ - - int init; - int shutdown; - int flags; /* extra storage */ - int retry_reason; - int num; - void *ptr; - struct bio_st *next_bio; /* used by filter BIOs */ - struct bio_st *prev_bio; /* used by filter BIOs */ - int references; - unsigned long num_read; - unsigned long num_write; - - CRYPTO_EX_DATA ex_data; - }; - -DECLARE_STACK_OF(BIO) - -typedef struct bio_f_buffer_ctx_struct - { - /* BIO *bio; */ /* this is now in the BIO struct */ - int ibuf_size; /* how big is the input buffer */ - int obuf_size; /* how big is the output buffer */ - - char *ibuf; /* the char array */ - int ibuf_len; /* how many bytes are in it */ - int ibuf_off; /* write/read offset */ - - char *obuf; /* the char array */ - int obuf_len; /* how many bytes are in it */ - int obuf_off; /* write/read offset */ - } BIO_F_BUFFER_CTX; - -/* connect BIO stuff */ -#define BIO_CONN_S_BEFORE 1 -#define BIO_CONN_S_GET_IP 2 -#define BIO_CONN_S_GET_PORT 3 -#define BIO_CONN_S_CREATE_SOCKET 4 -#define BIO_CONN_S_CONNECT 5 -#define BIO_CONN_S_OK 6 -#define BIO_CONN_S_BLOCKED_CONNECT 7 -#define BIO_CONN_S_NBIO 8 -/*#define BIO_CONN_get_param_hostname BIO_ctrl */ - -#define BIO_C_SET_CONNECT 100 -#define BIO_C_DO_STATE_MACHINE 101 -#define BIO_C_SET_NBIO 102 -#define BIO_C_SET_PROXY_PARAM 103 -#define BIO_C_SET_FD 104 -#define BIO_C_GET_FD 105 -#define BIO_C_SET_FILE_PTR 106 -#define BIO_C_GET_FILE_PTR 107 -#define BIO_C_SET_FILENAME 108 -#define BIO_C_SET_SSL 109 -#define BIO_C_GET_SSL 110 -#define BIO_C_SET_MD 111 -#define BIO_C_GET_MD 112 -#define BIO_C_GET_CIPHER_STATUS 113 -#define BIO_C_SET_BUF_MEM 114 -#define BIO_C_GET_BUF_MEM_PTR 115 -#define BIO_C_GET_BUFF_NUM_LINES 116 -#define BIO_C_SET_BUFF_SIZE 117 -#define BIO_C_SET_ACCEPT 118 -#define BIO_C_SSL_MODE 119 -#define BIO_C_GET_MD_CTX 120 -#define BIO_C_GET_PROXY_PARAM 121 -#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */ -#define BIO_C_GET_CONNECT 123 -#define BIO_C_GET_ACCEPT 124 -#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 -#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 -#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 -#define BIO_C_FILE_SEEK 128 -#define BIO_C_GET_CIPHER_CTX 129 -#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/ -#define BIO_C_SET_BIND_MODE 131 -#define BIO_C_GET_BIND_MODE 132 -#define BIO_C_FILE_TELL 133 -#define BIO_C_GET_SOCKS 134 -#define BIO_C_SET_SOCKS 135 - -#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */ -#define BIO_C_GET_WRITE_BUF_SIZE 137 -#define BIO_C_MAKE_BIO_PAIR 138 -#define BIO_C_DESTROY_BIO_PAIR 139 -#define BIO_C_GET_WRITE_GUARANTEE 140 -#define BIO_C_GET_READ_REQUEST 141 -#define BIO_C_SHUTDOWN_WR 142 -#define BIO_C_NREAD0 143 -#define BIO_C_NREAD 144 -#define BIO_C_NWRITE0 145 -#define BIO_C_NWRITE 146 -#define BIO_C_RESET_READ_REQUEST 147 -#define BIO_C_SET_MD_CTX 148 - - -#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) -#define BIO_get_app_data(s) BIO_get_ex_data(s,0) - -/* BIO_s_connect() and BIO_s_socks4a_connect() */ -#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) -#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) -#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) -#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) -#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) -#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) -#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3) - - -#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) - -/* BIO_s_accept_socket() */ -#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) -#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) -/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ -#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL) -#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) - -#define BIO_BIND_NORMAL 0 -#define BIO_BIND_REUSEADDR_IF_UNUSED 1 -#define BIO_BIND_REUSEADDR 2 -#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) -#define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) - -#define BIO_do_connect(b) BIO_do_handshake(b) -#define BIO_do_accept(b) BIO_do_handshake(b) -#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) - -/* BIO_s_proxy_client() */ -#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url)) -#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p)) -/* BIO_set_nbio(b,n) */ -#define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) -/* BIO *BIO_get_filter_bio(BIO *bio); */ -#define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) -#define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) -#define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) - -#define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp) -#define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p)) -#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) -#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) - -#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) -#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) - -#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) -#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) - -#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) -#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) - -/* name is cast to lose const, but might be better to route through a function - so we can do it safely */ -#ifdef CONST_STRICT -/* If you are wondering why this isn't defined, its because CONST_STRICT is - * purely a compile-time kludge to allow const to be checked. - */ -int BIO_read_filename(BIO *b,const char *name); -#else -#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_READ,(char *)name) -#endif -#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_WRITE,name) -#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_APPEND,name) -#define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name) - -/* WARNING WARNING, this ups the reference count on the read bio of the - * SSL structure. This is because the ssl read BIO is now pointed to by - * the next_bio field in the bio. So when you free the BIO, make sure - * you are doing a BIO_free_all() to catch the underlying BIO. */ -#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl) -#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) -#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) -#define BIO_set_ssl_renegotiate_bytes(b,num) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); -#define BIO_get_num_renegotiates(b) \ - BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL); -#define BIO_set_ssl_renegotiate_timeout(b,seconds) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); - -/* defined in evp.h */ -/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ - -#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp) -#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) -#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) -#define BIO_set_mem_eof_return(b,v) \ - BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL) - -/* For the BIO_f_buffer() type */ -#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) -#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) -#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) -#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) -#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf) - -/* Don't use the next one unless you know what you are doing :-) */ -#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret)) - -#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) -#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL) -#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL) -#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) -#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) -#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) -/* ...pending macros have inappropriate return type */ -size_t BIO_ctrl_pending(BIO *b); -size_t BIO_ctrl_wpending(BIO *b); -#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) -#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \ - cbp) -#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb) - -/* For the BIO_f_buffer() type */ -#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) - -/* For BIO_s_bio() */ -#define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL) -#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) -#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) -#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) -#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) -/* macros with inappropriate type -- but ...pending macros use int too: */ -#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) -#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) -size_t BIO_ctrl_get_write_guarantee(BIO *b); -size_t BIO_ctrl_get_read_request(BIO *b); -int BIO_ctrl_reset_read_request(BIO *b); - -/* ctrl macros for dgram */ -#define BIO_ctrl_dgram_connect(b,peer) \ - (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer) -#define BIO_ctrl_set_connected(b, state, peer) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer) -#define BIO_dgram_recv_timedout(b) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) -#define BIO_dgram_send_timedout(b) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) -#define BIO_dgram_set_peer(b,peer) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) - -/* These two aren't currently implemented */ -/* int BIO_get_ex_num(BIO *bio); */ -/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ -int BIO_set_ex_data(BIO *bio,int idx,void *data); -void *BIO_get_ex_data(BIO *bio,int idx); -int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -unsigned long BIO_number_read(BIO *bio); -unsigned long BIO_number_written(BIO *bio); - -# ifndef OPENSSL_NO_FP_API -# if defined(OPENSSL_SYS_WIN16) && defined(_WINDLL) -BIO_METHOD *BIO_s_file_internal(void); -BIO *BIO_new_file_internal(char *filename, char *mode); -BIO *BIO_new_fp_internal(FILE *stream, int close_flag); -# define BIO_s_file BIO_s_file_internal -# define BIO_new_file BIO_new_file_internal -# define BIO_new_fp BIO_new_fp_internal -# else /* FP_API */ -BIO_METHOD *BIO_s_file(void ); -BIO *BIO_new_file(const char *filename, const char *mode); -BIO *BIO_new_fp(FILE *stream, int close_flag); -# define BIO_s_file_internal BIO_s_file -# define BIO_new_file_internal BIO_new_file -# define BIO_new_fp_internal BIO_s_file -# endif /* FP_API */ -# endif -BIO * BIO_new(BIO_METHOD *type); -int BIO_set(BIO *a,BIO_METHOD *type); -int BIO_free(BIO *a); -void BIO_vfree(BIO *a); -int BIO_read(BIO *b, void *data, int len); -int BIO_gets(BIO *bp,char *buf, int size); -int BIO_write(BIO *b, const void *data, int len); -int BIO_puts(BIO *bp,const char *buf); -int BIO_indent(BIO *b,int indent,int max); -long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)); -char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); -long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); -BIO * BIO_push(BIO *b,BIO *append); -BIO * BIO_pop(BIO *b); -void BIO_free_all(BIO *a); -BIO * BIO_find_type(BIO *b,int bio_type); -BIO * BIO_next(BIO *b); -BIO * BIO_get_retry_BIO(BIO *bio, int *reason); -int BIO_get_retry_reason(BIO *bio); -BIO * BIO_dup_chain(BIO *in); - -int BIO_nread0(BIO *bio, char **buf); -int BIO_nread(BIO *bio, char **buf, int num); -int BIO_nwrite0(BIO *bio, char **buf); -int BIO_nwrite(BIO *bio, char **buf, int num); - -#ifndef OPENSSL_SYS_WIN16 -long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, - long argl,long ret); -#else -long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, - long argl,long ret); -#endif - -BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(void *buf, int len); -BIO_METHOD *BIO_s_socket(void); -BIO_METHOD *BIO_s_connect(void); -BIO_METHOD *BIO_s_accept(void); -BIO_METHOD *BIO_s_fd(void); -#ifndef OPENSSL_SYS_OS2 -BIO_METHOD *BIO_s_log(void); -#endif -BIO_METHOD *BIO_s_bio(void); -BIO_METHOD *BIO_s_null(void); -BIO_METHOD *BIO_f_null(void); -BIO_METHOD *BIO_f_buffer(void); -#ifdef OPENSSL_SYS_VMS -BIO_METHOD *BIO_f_linebuffer(void); -#endif -BIO_METHOD *BIO_f_nbio_test(void); -#ifndef OPENSSL_NO_DGRAM -BIO_METHOD *BIO_s_datagram(void); -#endif - -/* BIO_METHOD *BIO_f_ber(void); */ - -int BIO_sock_should_retry(int i); -int BIO_sock_non_fatal_error(int error); -int BIO_dgram_non_fatal_error(int error); - -int BIO_fd_should_retry(int i); -int BIO_fd_non_fatal_error(int error); -int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), - void *u, const char *s, int len); -int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), - void *u, const char *s, int len, int indent); -int BIO_dump(BIO *b,const char *bytes,int len); -int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent); -#ifndef OPENSSL_NO_FP_API -int BIO_dump_fp(FILE *fp, const char *s, int len); -int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); -#endif -struct hostent *BIO_gethostbyname(const char *name); -/* We might want a thread-safe interface too: - * struct hostent *BIO_gethostbyname_r(const char *name, - * struct hostent *result, void *buffer, size_t buflen); - * or something similar (caller allocates a struct hostent, - * pointed to by "result", and additional buffer space for the various - * substructures; if the buffer does not suffice, NULL is returned - * and an appropriate error code is set). - */ -int BIO_sock_error(int sock); -int BIO_socket_ioctl(int fd, long type, void *arg); -int BIO_socket_nbio(int fd,int mode); -int BIO_get_port(const char *str, unsigned short *port_ptr); -int BIO_get_host_ip(const char *str, unsigned char *ip); -int BIO_get_accept_socket(char *host_port,int mode); -int BIO_accept(int sock,char **ip_port); -int BIO_sock_init(void ); -void BIO_sock_cleanup(void); -int BIO_set_tcp_ndelay(int sock,int turn_on); - -BIO *BIO_new_socket(int sock, int close_flag); -BIO *BIO_new_dgram(int fd, int close_flag); -BIO *BIO_new_fd(int fd, int close_flag); -BIO *BIO_new_connect(char *host_port); -BIO *BIO_new_accept(char *host_port); - -int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, - BIO **bio2, size_t writebuf2); -/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. - * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. - * Size 0 uses default value. - */ - -void BIO_copy_next_retry(BIO *b); - -/*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/ - -#ifdef __GNUC__ -# define __bio_h__attr__ __attribute__ -#else -# define __bio_h__attr__(x) -#endif -int BIO_printf(BIO *bio, const char *format, ...) - __bio_h__attr__((__format__(__printf__,2,3))); -int BIO_vprintf(BIO *bio, const char *format, va_list args) - __bio_h__attr__((__format__(__printf__,2,0))); -int BIO_snprintf(char *buf, size_t n, const char *format, ...) - __bio_h__attr__((__format__(__printf__,3,4))); -int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) - __bio_h__attr__((__format__(__printf__,3,0))); -#undef __bio_h__attr__ - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BIO_strings(void); - -/* Error codes for the BIO functions. */ - -/* Function codes. */ -#define BIO_F_ACPT_STATE 100 -#define BIO_F_BIO_ACCEPT 101 -#define BIO_F_BIO_BER_GET_HEADER 102 -#define BIO_F_BIO_CALLBACK_CTRL 131 -#define BIO_F_BIO_CTRL 103 -#define BIO_F_BIO_GETHOSTBYNAME 120 -#define BIO_F_BIO_GETS 104 -#define BIO_F_BIO_GET_ACCEPT_SOCKET 105 -#define BIO_F_BIO_GET_HOST_IP 106 -#define BIO_F_BIO_GET_PORT 107 -#define BIO_F_BIO_MAKE_PAIR 121 -#define BIO_F_BIO_NEW 108 -#define BIO_F_BIO_NEW_FILE 109 -#define BIO_F_BIO_NEW_MEM_BUF 126 -#define BIO_F_BIO_NREAD 123 -#define BIO_F_BIO_NREAD0 124 -#define BIO_F_BIO_NWRITE 125 -#define BIO_F_BIO_NWRITE0 122 -#define BIO_F_BIO_PUTS 110 -#define BIO_F_BIO_READ 111 -#define BIO_F_BIO_SOCK_INIT 112 -#define BIO_F_BIO_WRITE 113 -#define BIO_F_BUFFER_CTRL 114 -#define BIO_F_CONN_CTRL 127 -#define BIO_F_CONN_STATE 115 -#define BIO_F_FILE_CTRL 116 -#define BIO_F_FILE_READ 130 -#define BIO_F_LINEBUFFER_CTRL 129 -#define BIO_F_MEM_READ 128 -#define BIO_F_MEM_WRITE 117 -#define BIO_F_SSL_NEW 118 -#define BIO_F_WSASTARTUP 119 - -/* Reason codes. */ -#define BIO_R_ACCEPT_ERROR 100 -#define BIO_R_BAD_FOPEN_MODE 101 -#define BIO_R_BAD_HOSTNAME_LOOKUP 102 -#define BIO_R_BROKEN_PIPE 124 -#define BIO_R_CONNECT_ERROR 103 -#define BIO_R_EOF_ON_MEMORY_BIO 127 -#define BIO_R_ERROR_SETTING_NBIO 104 -#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 -#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 -#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 -#define BIO_R_INVALID_ARGUMENT 125 -#define BIO_R_INVALID_IP_ADDRESS 108 -#define BIO_R_IN_USE 123 -#define BIO_R_KEEPALIVE 109 -#define BIO_R_NBIO_CONNECT_ERROR 110 -#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 -#define BIO_R_NO_HOSTNAME_SPECIFIED 112 -#define BIO_R_NO_PORT_DEFINED 113 -#define BIO_R_NO_PORT_SPECIFIED 114 -#define BIO_R_NO_SUCH_FILE 128 -#define BIO_R_NULL_PARAMETER 115 -#define BIO_R_TAG_MISMATCH 116 -#define BIO_R_UNABLE_TO_BIND_SOCKET 117 -#define BIO_R_UNABLE_TO_CREATE_SOCKET 118 -#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 -#define BIO_R_UNINITIALIZED 120 -#define BIO_R_UNSUPPORTED_METHOD 121 -#define BIO_R_WRITE_TO_READ_ONLY_BIO 126 -#define BIO_R_WSASTARTUP 122 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/blowfish.h b/dep/include/openssl/blowfish.h deleted file mode 100644 index d24ffccb65f..00000000000 --- a/dep/include/openssl/blowfish.h +++ /dev/null @@ -1,129 +0,0 @@ -/* crypto/bf/blowfish.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BLOWFISH_H -#define HEADER_BLOWFISH_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_BF -#error BF is disabled. -#endif - -#define BF_ENCRYPT 1 -#define BF_DECRYPT 0 - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! BF_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) -#define BF_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define BF_LONG unsigned long -#define BF_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -#else -#define BF_LONG unsigned int -#endif - -#define BF_ROUNDS 16 -#define BF_BLOCK 8 - -typedef struct bf_key_st - { - BF_LONG P[BF_ROUNDS+2]; - BF_LONG S[4*256]; - } BF_KEY; - -#ifdef OPENSSL_FIPS -void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); -#endif -void BF_set_key(BF_KEY *key, int len, const unsigned char *data); - -void BF_encrypt(BF_LONG *data,const BF_KEY *key); -void BF_decrypt(BF_LONG *data,const BF_KEY *key); - -void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, - const BF_KEY *key, int enc); -void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - const BF_KEY *schedule, unsigned char *ivec, int enc); -void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, - const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); -void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, - const BF_KEY *schedule, unsigned char *ivec, int *num); -const char *BF_options(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/bn.h b/dep/include/openssl/bn.h deleted file mode 100644 index f1719a5877f..00000000000 --- a/dep/include/openssl/bn.h +++ /dev/null @@ -1,855 +0,0 @@ -/* crypto/bn/bn.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the Eric Young open source - * license provided above. - * - * The binary polynomial arithmetic software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. - * - */ - -#ifndef HEADER_BN_H -#define HEADER_BN_H - -#include -#ifndef OPENSSL_NO_FP_API -#include /* FILE */ -#endif -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* These preprocessor symbols control various aspects of the bignum headers and - * library code. They're not defined by any "normal" configuration, as they are - * intended for development and testing purposes. NB: defining all three can be - * useful for debugging application code as well as openssl itself. - * - * BN_DEBUG - turn on various debugging alterations to the bignum code - * BN_DEBUG_RAND - uses random poisoning of unused words to trip up - * mismanagement of bignum internals. You must also define BN_DEBUG. - */ -/* #define BN_DEBUG */ -/* #define BN_DEBUG_RAND */ - -#define BN_MUL_COMBA -#define BN_SQR_COMBA -#define BN_RECURSION - -/* This next option uses the C libraries (2 word)/(1 word) function. - * If it is not defined, I use my C version (which is slower). - * The reason for this flag is that when the particular C compiler - * library routine is used, and the library is linked with a different - * compiler, the library is missing. This mostly happens when the - * library is built with gcc and then linked using normal cc. This would - * be a common occurrence because gcc normally produces code that is - * 2 times faster than system compilers for the big number stuff. - * For machines with only one compiler (or shared libraries), this should - * be on. Again this in only really a problem on machines - * using "long long's", are 32bit, and are not using my assembler code. */ -#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \ - defined(OPENSSL_SYS_WIN32) || defined(linux) -# ifndef BN_DIV2W -# define BN_DIV2W -# endif -#endif - -/* assuming long is 64bit - this is the DEC Alpha - * unsigned long long is only 64 bits :-(, don't define - * BN_LLONG for the DEC Alpha */ -#ifdef SIXTY_FOUR_BIT_LONG -#define BN_ULLONG unsigned long long -#define BN_ULONG unsigned long -#define BN_LONG long -#define BN_BITS 128 -#define BN_BYTES 8 -#define BN_BITS2 64 -#define BN_BITS4 32 -#define BN_MASK (0xffffffffffffffffffffffffffffffffLL) -#define BN_MASK2 (0xffffffffffffffffL) -#define BN_MASK2l (0xffffffffL) -#define BN_MASK2h (0xffffffff00000000L) -#define BN_MASK2h1 (0xffffffff80000000L) -#define BN_TBIT (0x8000000000000000L) -#define BN_DEC_CONV (10000000000000000000UL) -#define BN_DEC_FMT1 "%lu" -#define BN_DEC_FMT2 "%019lu" -#define BN_DEC_NUM 19 -#endif - -/* This is where the long long data type is 64 bits, but long is 32. - * For machines where there are 64bit registers, this is the mode to use. - * IRIX, on R4000 and above should use this mode, along with the relevant - * assembler code :-). Do NOT define BN_LLONG. - */ -#ifdef SIXTY_FOUR_BIT -#undef BN_LLONG -#undef BN_ULLONG -#define BN_ULONG unsigned long long -#define BN_LONG long long -#define BN_BITS 128 -#define BN_BYTES 8 -#define BN_BITS2 64 -#define BN_BITS4 32 -#define BN_MASK2 (0xffffffffffffffffLL) -#define BN_MASK2l (0xffffffffL) -#define BN_MASK2h (0xffffffff00000000LL) -#define BN_MASK2h1 (0xffffffff80000000LL) -#define BN_TBIT (0x8000000000000000LL) -#define BN_DEC_CONV (10000000000000000000ULL) -#define BN_DEC_FMT1 "%llu" -#define BN_DEC_FMT2 "%019llu" -#define BN_DEC_NUM 19 -#endif - -#ifdef THIRTY_TWO_BIT -#ifdef BN_LLONG -# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__) -# define BN_ULLONG unsigned __int64 -# else -# define BN_ULLONG unsigned long long -# endif -#endif -#define BN_ULONG unsigned long -#define BN_LONG long -#define BN_BITS 64 -#define BN_BYTES 4 -#define BN_BITS2 32 -#define BN_BITS4 16 -#ifdef OPENSSL_SYS_WIN32 -/* VC++ doesn't like the LL suffix */ -#define BN_MASK (0xffffffffffffffffL) -#else -#define BN_MASK (0xffffffffffffffffLL) -#endif -#define BN_MASK2 (0xffffffffL) -#define BN_MASK2l (0xffff) -#define BN_MASK2h1 (0xffff8000L) -#define BN_MASK2h (0xffff0000L) -#define BN_TBIT (0x80000000L) -#define BN_DEC_CONV (1000000000L) -#define BN_DEC_FMT1 "%lu" -#define BN_DEC_FMT2 "%09lu" -#define BN_DEC_NUM 9 -#endif - -#ifdef SIXTEEN_BIT -#ifndef BN_DIV2W -#define BN_DIV2W -#endif -#define BN_ULLONG unsigned long -#define BN_ULONG unsigned short -#define BN_LONG short -#define BN_BITS 32 -#define BN_BYTES 2 -#define BN_BITS2 16 -#define BN_BITS4 8 -#define BN_MASK (0xffffffff) -#define BN_MASK2 (0xffff) -#define BN_MASK2l (0xff) -#define BN_MASK2h1 (0xff80) -#define BN_MASK2h (0xff00) -#define BN_TBIT (0x8000) -#define BN_DEC_CONV (100000) -#define BN_DEC_FMT1 "%u" -#define BN_DEC_FMT2 "%05u" -#define BN_DEC_NUM 5 -#endif - -#ifdef EIGHT_BIT -#ifndef BN_DIV2W -#define BN_DIV2W -#endif -#define BN_ULLONG unsigned short -#define BN_ULONG unsigned char -#define BN_LONG char -#define BN_BITS 16 -#define BN_BYTES 1 -#define BN_BITS2 8 -#define BN_BITS4 4 -#define BN_MASK (0xffff) -#define BN_MASK2 (0xff) -#define BN_MASK2l (0xf) -#define BN_MASK2h1 (0xf8) -#define BN_MASK2h (0xf0) -#define BN_TBIT (0x80) -#define BN_DEC_CONV (100) -#define BN_DEC_FMT1 "%u" -#define BN_DEC_FMT2 "%02u" -#define BN_DEC_NUM 2 -#endif - -#define BN_DEFAULT_BITS 1280 - -#define BN_FLG_MALLOCED 0x01 -#define BN_FLG_STATIC_DATA 0x02 -#define BN_FLG_CONSTTIME 0x04 /* avoid leaking exponent information through timing, - * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, - * BN_div() will call BN_div_no_branch, - * BN_mod_inverse() will call BN_mod_inverse_no_branch. - */ - -#ifndef OPENSSL_NO_DEPRECATED -#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */ - /* avoid leaking exponent information through timings - * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ -#endif - -#ifndef OPENSSL_NO_DEPRECATED -#define BN_FLG_FREE 0x8000 /* used for debuging */ -#endif -#define BN_set_flags(b,n) ((b)->flags|=(n)) -#define BN_get_flags(b,n) ((b)->flags&(n)) - -/* get a clone of a BIGNUM with changed flags, for *temporary* use only - * (the two BIGNUMs cannot not be used in parallel!) */ -#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ - (dest)->top=(b)->top, \ - (dest)->dmax=(b)->dmax, \ - (dest)->neg=(b)->neg, \ - (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \ - | ((b)->flags & ~BN_FLG_MALLOCED) \ - | BN_FLG_STATIC_DATA \ - | (n))) - -/* Already declared in ossl_typ.h */ -#if 0 -typedef struct bignum_st BIGNUM; -/* Used for temp variables (declaration hidden in bn_lcl.h) */ -typedef struct bignum_ctx BN_CTX; -typedef struct bn_blinding_st BN_BLINDING; -typedef struct bn_mont_ctx_st BN_MONT_CTX; -typedef struct bn_recp_ctx_st BN_RECP_CTX; -typedef struct bn_gencb_st BN_GENCB; -#endif - -struct bignum_st - { - BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ - int top; /* Index of last used d +1. */ - /* The next are internal book keeping for bn_expand. */ - int dmax; /* Size of the d array. */ - int neg; /* one if the number is negative */ - int flags; - }; - -/* Used for montgomery multiplication */ -struct bn_mont_ctx_st - { - int ri; /* number of bits in R */ - BIGNUM RR; /* used to convert to montgomery form */ - BIGNUM N; /* The modulus */ - BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 - * (Ni is only stored for bignum algorithm) */ -#if 0 - /* OpenSSL 0.9.9 preview: */ - BN_ULONG n0[2];/* least significant word(s) of Ni */ -#else - BN_ULONG n0; /* least significant word of Ni */ -#endif - int flags; - }; - -/* Used for reciprocal division/mod functions - * It cannot be shared between threads - */ -struct bn_recp_ctx_st - { - BIGNUM N; /* the divisor */ - BIGNUM Nr; /* the reciprocal */ - int num_bits; - int shift; - int flags; - }; - -/* Used for slow "generation" functions. */ -struct bn_gencb_st - { - unsigned int ver; /* To handle binary (in)compatibility */ - void *arg; /* callback-specific data */ - union - { - /* if(ver==1) - handles old style callbacks */ - void (*cb_1)(int, int, void *); - /* if(ver==2) - new callback style */ - int (*cb_2)(int, int, BN_GENCB *); - } cb; - }; -/* Wrapper function to make using BN_GENCB easier, */ -int BN_GENCB_call(BN_GENCB *cb, int a, int b); -/* Macro to populate a BN_GENCB structure with an "old"-style callback */ -#define BN_GENCB_set_old(gencb, callback, cb_arg) { \ - BN_GENCB *tmp_gencb = (gencb); \ - tmp_gencb->ver = 1; \ - tmp_gencb->arg = (cb_arg); \ - tmp_gencb->cb.cb_1 = (callback); } -/* Macro to populate a BN_GENCB structure with a "new"-style callback */ -#define BN_GENCB_set(gencb, callback, cb_arg) { \ - BN_GENCB *tmp_gencb = (gencb); \ - tmp_gencb->ver = 2; \ - tmp_gencb->arg = (cb_arg); \ - tmp_gencb->cb.cb_2 = (callback); } - -#define BN_prime_checks 0 /* default: select number of iterations - based on the size of the number */ - -/* number of Miller-Rabin iterations for an error rate of less than 2^-80 - * for random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook - * of Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error estimates - * for the strong probable prime test. -- Math. Comp. 61 (1993) 177-194) */ -#define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) - -#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) - -/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */ -#define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \ - (((w) == 0) && ((a)->top == 0))) -#define BN_is_zero(a) ((a)->top == 0) -#define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg) -#define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg)) -#define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1)) - -#define BN_one(a) (BN_set_word((a),1)) -#define BN_zero_ex(a) \ - do { \ - BIGNUM *_tmp_bn = (a); \ - _tmp_bn->top = 0; \ - _tmp_bn->neg = 0; \ - } while(0) -#ifdef OPENSSL_NO_DEPRECATED -#define BN_zero(a) BN_zero_ex(a) -#else -#define BN_zero(a) (BN_set_word((a),0)) -#endif - -const BIGNUM *BN_value_one(void); -char * BN_options(void); -BN_CTX *BN_CTX_new(void); -#ifndef OPENSSL_NO_DEPRECATED -void BN_CTX_init(BN_CTX *c); -#endif -void BN_CTX_free(BN_CTX *c); -void BN_CTX_start(BN_CTX *ctx); -BIGNUM *BN_CTX_get(BN_CTX *ctx); -void BN_CTX_end(BN_CTX *ctx); -int BN_rand(BIGNUM *rnd, int bits, int top,int bottom); -int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom); -int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); -int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); -int BN_num_bits(const BIGNUM *a); -int BN_num_bits_word(BN_ULONG); -BIGNUM *BN_new(void); -void BN_init(BIGNUM *); -void BN_clear_free(BIGNUM *a); -BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); -void BN_swap(BIGNUM *a, BIGNUM *b); -BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret); -int BN_bn2bin(const BIGNUM *a, unsigned char *to); -BIGNUM *BN_mpi2bn(const unsigned char *s,int len,BIGNUM *ret); -int BN_bn2mpi(const BIGNUM *a, unsigned char *to); -int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); -int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx); -/** BN_set_negative sets sign of a BIGNUM - * \param b pointer to the BIGNUM object - * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise - */ -void BN_set_negative(BIGNUM *b, int n); -/** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object - * \return 1 if a < 0 and 0 otherwise - */ -#define BN_is_negative(a) ((a)->neg != 0) - -int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, - BN_CTX *ctx); -#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) -int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); -int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); -int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); -int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m, BN_CTX *ctx); -int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); -int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m); - -BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); -BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); -int BN_mul_word(BIGNUM *a, BN_ULONG w); -int BN_add_word(BIGNUM *a, BN_ULONG w); -int BN_sub_word(BIGNUM *a, BN_ULONG w); -int BN_set_word(BIGNUM *a, BN_ULONG w); -BN_ULONG BN_get_word(const BIGNUM *a); - -int BN_cmp(const BIGNUM *a, const BIGNUM *b); -void BN_free(BIGNUM *a); -int BN_is_bit_set(const BIGNUM *a, int n); -int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); -int BN_lshift1(BIGNUM *r, const BIGNUM *a); -int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx); - -int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m,BN_CTX *ctx); -int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); -int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, - const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m, - BN_CTX *ctx,BN_MONT_CTX *m_ctx); -int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m,BN_CTX *ctx); - -int BN_mask_bits(BIGNUM *a,int n); -#ifndef OPENSSL_NO_FP_API -int BN_print_fp(FILE *fp, const BIGNUM *a); -#endif -#ifdef HEADER_BIO_H -int BN_print(BIO *fp, const BIGNUM *a); -#else -int BN_print(void *fp, const BIGNUM *a); -#endif -int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); -int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); -int BN_rshift1(BIGNUM *r, const BIGNUM *a); -void BN_clear(BIGNUM *a); -BIGNUM *BN_dup(const BIGNUM *a); -int BN_ucmp(const BIGNUM *a, const BIGNUM *b); -int BN_set_bit(BIGNUM *a, int n); -int BN_clear_bit(BIGNUM *a, int n); -char * BN_bn2hex(const BIGNUM *a); -char * BN_bn2dec(const BIGNUM *a); -int BN_hex2bn(BIGNUM **a, const char *str); -int BN_dec2bn(BIGNUM **a, const char *str); -int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); -int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ -BIGNUM *BN_mod_inverse(BIGNUM *ret, - const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); -BIGNUM *BN_mod_sqrt(BIGNUM *ret, - const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); - -/* Deprecated versions */ -#ifndef OPENSSL_NO_DEPRECATED -BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, - const BIGNUM *add, const BIGNUM *rem, - void (*callback)(int,int,void *),void *cb_arg); -int BN_is_prime(const BIGNUM *p,int nchecks, - void (*callback)(int,int,void *), - BN_CTX *ctx,void *cb_arg); -int BN_is_prime_fasttest(const BIGNUM *p,int nchecks, - void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, - int do_trial_division); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* Newer versions */ -int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add, - const BIGNUM *rem, BN_GENCB *cb); -int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb); -int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, - int do_trial_division, BN_GENCB *cb); - -int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); - -int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, - const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, - const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); -int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, - BIGNUM *Xp1, BIGNUM *Xp2, - const BIGNUM *Xp, - const BIGNUM *e, BN_CTX *ctx, - BN_GENCB *cb); - -BN_MONT_CTX *BN_MONT_CTX_new(void ); -void BN_MONT_CTX_init(BN_MONT_CTX *ctx); -int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, - BN_MONT_CTX *mont, BN_CTX *ctx); -#define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ - (r),(a),&((mont)->RR),(mont),(ctx)) -int BN_from_montgomery(BIGNUM *r,const BIGNUM *a, - BN_MONT_CTX *mont, BN_CTX *ctx); -void BN_MONT_CTX_free(BN_MONT_CTX *mont); -int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); -BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); -BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, - const BIGNUM *mod, BN_CTX *ctx); - -/* BN_BLINDING flags */ -#define BN_BLINDING_NO_UPDATE 0x00000001 -#define BN_BLINDING_NO_RECREATE 0x00000002 - -BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod); -void BN_BLINDING_free(BN_BLINDING *b); -int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx); -int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); -int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); -int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); -int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); -unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); -void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); -unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); -void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); -BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, - const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx, - int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), - BN_MONT_CTX *m_ctx); - -#ifndef OPENSSL_NO_DEPRECATED -void BN_set_params(int mul,int high,int low,int mont); -int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ -#endif - -void BN_RECP_CTX_init(BN_RECP_CTX *recp); -BN_RECP_CTX *BN_RECP_CTX_new(void); -void BN_RECP_CTX_free(BN_RECP_CTX *recp); -int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx); -int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, - BN_RECP_CTX *recp,BN_CTX *ctx); -int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, - BN_RECP_CTX *recp, BN_CTX *ctx); - -/* Functions for arithmetic over binary polynomials represented by BIGNUMs. - * - * The BIGNUM::neg property of BIGNUMs representing binary polynomials is - * ignored. - * - * Note that input arguments are not const so that their bit arrays can - * be expanded to the appropriate size if needed. - */ - -int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/ -#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) -int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/ -int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */ -int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx); /* r = (a * a) mod p */ -int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, - BN_CTX *ctx); /* r = (1 / b) mod p */ -int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */ -int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */ -int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx); /* r = sqrt(a) mod p */ -int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx); /* r^2 + r = a mod p */ -#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) -/* Some functions allow for representation of the irreducible polynomials - * as an unsigned int[], say p. The irreducible f(t) is then of the form: - * t^p[0] + t^p[1] + ... + t^p[k] - * where m = p[0] > p[1] > ... > p[k] = 0. - */ -int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[]); - /* r = a mod p */ -int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const unsigned int p[], BN_CTX *ctx); /* r = (a * b) mod p */ -int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], - BN_CTX *ctx); /* r = (a * a) mod p */ -int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const unsigned int p[], - BN_CTX *ctx); /* r = (1 / b) mod p */ -int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const unsigned int p[], BN_CTX *ctx); /* r = (a / b) mod p */ -int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const unsigned int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */ -int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, - const unsigned int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */ -int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, - const unsigned int p[], BN_CTX *ctx); /* r^2 + r = a mod p */ -int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max); -int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a); - -/* faster mod functions for the 'NIST primes' - * 0 <= a < p^2 */ -int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); - -const BIGNUM *BN_get0_nist_prime_192(void); -const BIGNUM *BN_get0_nist_prime_224(void); -const BIGNUM *BN_get0_nist_prime_256(void); -const BIGNUM *BN_get0_nist_prime_384(void); -const BIGNUM *BN_get0_nist_prime_521(void); - -/* library internal functions */ - -#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ - (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) -#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) -BIGNUM *bn_expand2(BIGNUM *a, int words); -#ifndef OPENSSL_NO_DEPRECATED -BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */ -#endif - -/* Bignum consistency macros - * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from - * bignum data after direct manipulations on the data. There is also an - * "internal" macro, bn_check_top(), for verifying that there are no leading - * zeroes. Unfortunately, some auditing is required due to the fact that - * bn_fix_top() has become an overabused duct-tape because bignum data is - * occasionally passed around in an inconsistent state. So the following - * changes have been made to sort this out; - * - bn_fix_top()s implementation has been moved to bn_correct_top() - * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and - * bn_check_top() is as before. - * - if BN_DEBUG *is* defined; - * - bn_check_top() tries to pollute unused words even if the bignum 'top' is - * consistent. (ed: only if BN_DEBUG_RAND is defined) - * - bn_fix_top() maps to bn_check_top() rather than "fixing" anything. - * The idea is to have debug builds flag up inconsistent bignums when they - * occur. If that occurs in a bn_fix_top(), we examine the code in question; if - * the use of bn_fix_top() was appropriate (ie. it follows directly after code - * that manipulates the bignum) it is converted to bn_correct_top(), and if it - * was not appropriate, we convert it permanently to bn_check_top() and track - * down the cause of the bug. Eventually, no internal code should be using the - * bn_fix_top() macro. External applications and libraries should try this with - * their own code too, both in terms of building against the openssl headers - * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it - * defined. This not only improves external code, it provides more test - * coverage for openssl's own code. - */ - -#ifdef BN_DEBUG - -/* We only need assert() when debugging */ -#include - -#ifdef BN_DEBUG_RAND -/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ -#ifndef RAND_pseudo_bytes -int RAND_pseudo_bytes(unsigned char *buf,int num); -#define BN_DEBUG_TRIX -#endif -#define bn_pollute(a) \ - do { \ - const BIGNUM *_bnum1 = (a); \ - if(_bnum1->top < _bnum1->dmax) { \ - unsigned char _tmp_char; \ - /* We cast away const without the compiler knowing, any \ - * *genuinely* constant variables that aren't mutable \ - * wouldn't be constructed with top!=dmax. */ \ - BN_ULONG *_not_const; \ - memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \ - RAND_pseudo_bytes(&_tmp_char, 1); \ - memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \ - (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \ - } \ - } while(0) -#ifdef BN_DEBUG_TRIX -#undef RAND_pseudo_bytes -#endif -#else -#define bn_pollute(a) -#endif -#define bn_check_top(a) \ - do { \ - const BIGNUM *_bnum2 = (a); \ - if (_bnum2 != NULL) { \ - assert((_bnum2->top == 0) || \ - (_bnum2->d[_bnum2->top - 1] != 0)); \ - bn_pollute(_bnum2); \ - } \ - } while(0) - -#define bn_fix_top(a) bn_check_top(a) - -#else /* !BN_DEBUG */ - -#define bn_pollute(a) -#define bn_check_top(a) -#define bn_fix_top(a) bn_correct_top(a) - -#endif - -#define bn_correct_top(a) \ - { \ - BN_ULONG *ftl; \ - if ((a)->top > 0) \ - { \ - for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \ - if (*(ftl--)) break; \ - } \ - bn_pollute(a); \ - } - -BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); -BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); -void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); -BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d); -BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); -BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); - -/* Primes from RFC 2409 */ -BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); -BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); - -/* Primes from RFC 3526 */ -BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); - -int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BN_strings(void); - -/* Error codes for the BN functions. */ - -/* Function codes. */ -#define BN_F_BNRAND 127 -#define BN_F_BN_BLINDING_CONVERT_EX 100 -#define BN_F_BN_BLINDING_CREATE_PARAM 128 -#define BN_F_BN_BLINDING_INVERT_EX 101 -#define BN_F_BN_BLINDING_NEW 102 -#define BN_F_BN_BLINDING_UPDATE 103 -#define BN_F_BN_BN2DEC 104 -#define BN_F_BN_BN2HEX 105 -#define BN_F_BN_CTX_GET 116 -#define BN_F_BN_CTX_NEW 106 -#define BN_F_BN_CTX_START 129 -#define BN_F_BN_DIV 107 -#define BN_F_BN_DIV_NO_BRANCH 138 -#define BN_F_BN_DIV_RECP 130 -#define BN_F_BN_EXP 123 -#define BN_F_BN_EXPAND2 108 -#define BN_F_BN_EXPAND_INTERNAL 120 -#define BN_F_BN_GF2M_MOD 131 -#define BN_F_BN_GF2M_MOD_EXP 132 -#define BN_F_BN_GF2M_MOD_MUL 133 -#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134 -#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 -#define BN_F_BN_GF2M_MOD_SQR 136 -#define BN_F_BN_GF2M_MOD_SQRT 137 -#define BN_F_BN_MOD_EXP2_MONT 118 -#define BN_F_BN_MOD_EXP_MONT 109 -#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 -#define BN_F_BN_MOD_EXP_MONT_WORD 117 -#define BN_F_BN_MOD_EXP_RECP 125 -#define BN_F_BN_MOD_EXP_SIMPLE 126 -#define BN_F_BN_MOD_INVERSE 110 -#define BN_F_BN_MOD_INVERSE_NO_BRANCH 139 -#define BN_F_BN_MOD_LSHIFT_QUICK 119 -#define BN_F_BN_MOD_MUL_RECIPROCAL 111 -#define BN_F_BN_MOD_SQRT 121 -#define BN_F_BN_MPI2BN 112 -#define BN_F_BN_NEW 113 -#define BN_F_BN_RAND 114 -#define BN_F_BN_RAND_RANGE 122 -#define BN_F_BN_USUB 115 - -/* Reason codes. */ -#define BN_R_ARG2_LT_ARG3 100 -#define BN_R_BAD_RECIPROCAL 101 -#define BN_R_BIGNUM_TOO_LONG 114 -#define BN_R_CALLED_WITH_EVEN_MODULUS 102 -#define BN_R_DIV_BY_ZERO 103 -#define BN_R_ENCODING_ERROR 104 -#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 -#define BN_R_INPUT_NOT_REDUCED 110 -#define BN_R_INVALID_LENGTH 106 -#define BN_R_INVALID_RANGE 115 -#define BN_R_NOT_A_SQUARE 111 -#define BN_R_NOT_INITIALIZED 107 -#define BN_R_NO_INVERSE 108 -#define BN_R_NO_SOLUTION 116 -#define BN_R_P_IS_NOT_PRIME 112 -#define BN_R_TOO_MANY_ITERATIONS 113 -#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/buffer.h b/dep/include/openssl/buffer.h deleted file mode 100644 index 669bc5eb364..00000000000 --- a/dep/include/openssl/buffer.h +++ /dev/null @@ -1,119 +0,0 @@ -/* crypto/buffer/buffer.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BUFFER_H -#define HEADER_BUFFER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if !defined(NO_SYS_TYPES_H) -#include -#endif - -/* Already declared in ossl_typ.h */ -/* typedef struct buf_mem_st BUF_MEM; */ - -struct buf_mem_st - { - int length; /* current number of bytes */ - char *data; - int max; /* size of buffer */ - }; - -BUF_MEM *BUF_MEM_new(void); -void BUF_MEM_free(BUF_MEM *a); -int BUF_MEM_grow(BUF_MEM *str, int len); -int BUF_MEM_grow_clean(BUF_MEM *str, int len); -char * BUF_strdup(const char *str); -char * BUF_strndup(const char *str, size_t siz); -void * BUF_memdup(const void *data, size_t siz); - -/* safe string functions */ -size_t BUF_strlcpy(char *dst,const char *src,size_t siz); -size_t BUF_strlcat(char *dst,const char *src,size_t siz); - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BUF_strings(void); - -/* Error codes for the BUF functions. */ - -/* Function codes. */ -#define BUF_F_BUF_MEMDUP 103 -#define BUF_F_BUF_MEM_GROW 100 -#define BUF_F_BUF_MEM_GROW_CLEAN 105 -#define BUF_F_BUF_MEM_NEW 101 -#define BUF_F_BUF_STRDUP 102 -#define BUF_F_BUF_STRNDUP 104 - -/* Reason codes. */ - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/cast.h b/dep/include/openssl/cast.h deleted file mode 100644 index 1faf5806aac..00000000000 --- a/dep/include/openssl/cast.h +++ /dev/null @@ -1,107 +0,0 @@ -/* crypto/cast/cast.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CAST_H -#define HEADER_CAST_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef OPENSSL_NO_CAST -#error CAST is disabled. -#endif - -#define CAST_ENCRYPT 1 -#define CAST_DECRYPT 0 - -#define CAST_LONG unsigned long - -#define CAST_BLOCK 8 -#define CAST_KEY_LENGTH 16 - -typedef struct cast_key_st - { - CAST_LONG data[32]; - int short_key; /* Use reduced rounds for short key */ - } CAST_KEY; - -#ifdef OPENSSL_FIPS -void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); -#endif -void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); -void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, - int enc); -void CAST_encrypt(CAST_LONG *data,CAST_KEY *key); -void CAST_decrypt(CAST_LONG *data,CAST_KEY *key); -void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - CAST_KEY *ks, unsigned char *iv, int enc); -void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, CAST_KEY *schedule, unsigned char *ivec, - int *num, int enc); -void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, CAST_KEY *schedule, unsigned char *ivec, - int *num); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/comp.h b/dep/include/openssl/comp.h deleted file mode 100644 index 4b405c7d49e..00000000000 --- a/dep/include/openssl/comp.h +++ /dev/null @@ -1,80 +0,0 @@ - -#ifndef HEADER_COMP_H -#define HEADER_COMP_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct comp_ctx_st COMP_CTX; - -typedef struct comp_method_st - { - int type; /* NID for compression library */ - const char *name; /* A text string to identify the library */ - int (*init)(COMP_CTX *ctx); - void (*finish)(COMP_CTX *ctx); - int (*compress)(COMP_CTX *ctx, - unsigned char *out, unsigned int olen, - unsigned char *in, unsigned int ilen); - int (*expand)(COMP_CTX *ctx, - unsigned char *out, unsigned int olen, - unsigned char *in, unsigned int ilen); - /* The following two do NOTHING, but are kept for backward compatibility */ - long (*ctrl)(void); - long (*callback_ctrl)(void); - } COMP_METHOD; - -struct comp_ctx_st - { - COMP_METHOD *meth; - unsigned long compress_in; - unsigned long compress_out; - unsigned long expand_in; - unsigned long expand_out; - - CRYPTO_EX_DATA ex_data; - }; - - -COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); -void COMP_CTX_free(COMP_CTX *ctx); -int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, - unsigned char *in, int ilen); -int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, - unsigned char *in, int ilen); -COMP_METHOD *COMP_rle(void ); -COMP_METHOD *COMP_zlib(void ); -void COMP_zlib_cleanup(void); - -#ifdef HEADER_BIO_H -#ifdef ZLIB -BIO_METHOD *BIO_f_zlib(void); -#endif -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_COMP_strings(void); - -/* Error codes for the COMP functions. */ - -/* Function codes. */ -#define COMP_F_BIO_ZLIB_FLUSH 99 -#define COMP_F_BIO_ZLIB_NEW 100 -#define COMP_F_BIO_ZLIB_READ 101 -#define COMP_F_BIO_ZLIB_WRITE 102 - -/* Reason codes. */ -#define COMP_R_ZLIB_DEFLATE_ERROR 99 -#define COMP_R_ZLIB_INFLATE_ERROR 100 -#define COMP_R_ZLIB_NOT_SUPPORTED 101 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/conf.h b/dep/include/openssl/conf.h deleted file mode 100644 index 8aa06bc5ecb..00000000000 --- a/dep/include/openssl/conf.h +++ /dev/null @@ -1,254 +0,0 @@ -/* crypto/conf/conf.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CONF_H -#define HEADER_CONF_H - -#include -#include -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct - { - char *section; - char *name; - char *value; - } CONF_VALUE; - -DECLARE_STACK_OF(CONF_VALUE) -DECLARE_STACK_OF(CONF_MODULE) -DECLARE_STACK_OF(CONF_IMODULE) - -struct conf_st; -struct conf_method_st; -typedef struct conf_method_st CONF_METHOD; - -struct conf_method_st - { - const char *name; - CONF *(*create)(CONF_METHOD *meth); - int (*init)(CONF *conf); - int (*destroy)(CONF *conf); - int (*destroy_data)(CONF *conf); - int (*load_bio)(CONF *conf, BIO *bp, long *eline); - int (*dump)(const CONF *conf, BIO *bp); - int (*is_number)(const CONF *conf, char c); - int (*to_int)(const CONF *conf, char c); - int (*load)(CONF *conf, const char *name, long *eline); - }; - -/* Module definitions */ - -typedef struct conf_imodule_st CONF_IMODULE; -typedef struct conf_module_st CONF_MODULE; - -/* DSO module function typedefs */ -typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); -typedef void conf_finish_func(CONF_IMODULE *md); - -#define CONF_MFLAGS_IGNORE_ERRORS 0x1 -#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 -#define CONF_MFLAGS_SILENT 0x4 -#define CONF_MFLAGS_NO_DSO 0x8 -#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 -#define CONF_MFLAGS_DEFAULT_SECTION 0x20 - -int CONF_set_default_method(CONF_METHOD *meth); -void CONF_set_nconf(CONF *conf,LHASH *hash); -LHASH *CONF_load(LHASH *conf,const char *file,long *eline); -#ifndef OPENSSL_NO_FP_API -LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); -#endif -LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); -STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section); -char *CONF_get_string(LHASH *conf,const char *group,const char *name); -long CONF_get_number(LHASH *conf,const char *group,const char *name); -void CONF_free(LHASH *conf); -int CONF_dump_fp(LHASH *conf, FILE *out); -int CONF_dump_bio(LHASH *conf, BIO *out); - -void OPENSSL_config(const char *config_name); -void OPENSSL_no_config(void); - -/* New conf code. The semantics are different from the functions above. - If that wasn't the case, the above functions would have been replaced */ - -struct conf_st - { - CONF_METHOD *meth; - void *meth_data; - LHASH *data; - }; - -CONF *NCONF_new(CONF_METHOD *meth); -CONF_METHOD *NCONF_default(void); -CONF_METHOD *NCONF_WIN32(void); -#if 0 /* Just to give you an idea of what I have in mind */ -CONF_METHOD *NCONF_XML(void); -#endif -void NCONF_free(CONF *conf); -void NCONF_free_data(CONF *conf); - -int NCONF_load(CONF *conf,const char *file,long *eline); -#ifndef OPENSSL_NO_FP_API -int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); -#endif -int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); -STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); -char *NCONF_get_string(const CONF *conf,const char *group,const char *name); -int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, - long *result); -int NCONF_dump_fp(const CONF *conf, FILE *out); -int NCONF_dump_bio(const CONF *conf, BIO *out); - -#if 0 /* The following function has no error checking, - and should therefore be avoided */ -long NCONF_get_number(CONF *conf,char *group,char *name); -#else -#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) -#endif - -/* Module functions */ - -int CONF_modules_load(const CONF *cnf, const char *appname, - unsigned long flags); -int CONF_modules_load_file(const char *filename, const char *appname, - unsigned long flags); -void CONF_modules_unload(int all); -void CONF_modules_finish(void); -void CONF_modules_free(void); -int CONF_module_add(const char *name, conf_init_func *ifunc, - conf_finish_func *ffunc); - -const char *CONF_imodule_get_name(const CONF_IMODULE *md); -const char *CONF_imodule_get_value(const CONF_IMODULE *md); -void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); -void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); -CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); -unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); -void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); -void *CONF_module_get_usr_data(CONF_MODULE *pmod); -void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); - -char *CONF_get1_default_config_file(void); - -int CONF_parse_list(const char *list, int sep, int nospc, - int (*list_cb)(const char *elem, int len, void *usr), void *arg); - -void OPENSSL_load_builtin_modules(void); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_CONF_strings(void); - -/* Error codes for the CONF functions. */ - -/* Function codes. */ -#define CONF_F_CONF_DUMP_FP 104 -#define CONF_F_CONF_LOAD 100 -#define CONF_F_CONF_LOAD_BIO 102 -#define CONF_F_CONF_LOAD_FP 103 -#define CONF_F_CONF_MODULES_LOAD 116 -#define CONF_F_DEF_LOAD 120 -#define CONF_F_DEF_LOAD_BIO 121 -#define CONF_F_MODULE_INIT 115 -#define CONF_F_MODULE_LOAD_DSO 117 -#define CONF_F_MODULE_RUN 118 -#define CONF_F_NCONF_DUMP_BIO 105 -#define CONF_F_NCONF_DUMP_FP 106 -#define CONF_F_NCONF_GET_NUMBER 107 -#define CONF_F_NCONF_GET_NUMBER_E 112 -#define CONF_F_NCONF_GET_SECTION 108 -#define CONF_F_NCONF_GET_STRING 109 -#define CONF_F_NCONF_LOAD 113 -#define CONF_F_NCONF_LOAD_BIO 110 -#define CONF_F_NCONF_LOAD_FP 114 -#define CONF_F_NCONF_NEW 111 -#define CONF_F_STR_COPY 101 - -/* Reason codes. */ -#define CONF_R_ERROR_LOADING_DSO 110 -#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 -#define CONF_R_MISSING_EQUAL_SIGN 101 -#define CONF_R_MISSING_FINISH_FUNCTION 111 -#define CONF_R_MISSING_INIT_FUNCTION 112 -#define CONF_R_MODULE_INITIALIZATION_ERROR 109 -#define CONF_R_NO_CLOSE_BRACE 102 -#define CONF_R_NO_CONF 105 -#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 -#define CONF_R_NO_SECTION 107 -#define CONF_R_NO_SUCH_FILE 114 -#define CONF_R_NO_VALUE 108 -#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 -#define CONF_R_UNKNOWN_MODULE_NAME 113 -#define CONF_R_VARIABLE_HAS_NO_VALUE 104 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/conf_api.h b/dep/include/openssl/conf_api.h deleted file mode 100644 index ffe5ccd80aa..00000000000 --- a/dep/include/openssl/conf_api.h +++ /dev/null @@ -1,90 +0,0 @@ -/* conf_api.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CONF_API_H -#define HEADER_CONF_API_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Up until OpenSSL 0.9.5a, this was new_section */ -CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); -/* Up until OpenSSL 0.9.5a, this was get_section */ -CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); -/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ -STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, - const char *section); - -int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); -char *_CONF_get_string(const CONF *conf, const char *section, - const char *name); -long _CONF_get_number(const CONF *conf, const char *section, const char *name); - -int _CONF_new_data(CONF *conf); -void _CONF_free_data(CONF *conf); - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/dep/include/openssl/crypto.h b/dep/include/openssl/crypto.h deleted file mode 100644 index 0e4fb0723ce..00000000000 --- a/dep/include/openssl/crypto.h +++ /dev/null @@ -1,619 +0,0 @@ -/* crypto/crypto.h */ -/* ==================================================================== - * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_CRYPTO_H -#define HEADER_CRYPTO_H - -#include - -#include - -#ifndef OPENSSL_NO_FP_API -#include -#endif - -#include -#include -#include -#include - -#ifdef CHARSET_EBCDIC -#include -#endif - -/* Resolve problems on some operating systems with symbol names that clash - one way or another */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Backward compatibility to SSLeay */ -/* This is more to be used to check the correct DLL is being used - * in the MS world. */ -#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER -#define SSLEAY_VERSION 0 -/* #define SSLEAY_OPTIONS 1 no longer supported */ -#define SSLEAY_CFLAGS 2 -#define SSLEAY_BUILT_ON 3 -#define SSLEAY_PLATFORM 4 -#define SSLEAY_DIR 5 - -/* Already declared in ossl_typ.h */ -#if 0 -typedef struct crypto_ex_data_st CRYPTO_EX_DATA; -/* Called when a new object is created */ -typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -/* Called when an object is free()ed */ -typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -/* Called when we need to dup an object */ -typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, - int idx, long argl, void *argp); -#endif - -/* A generic structure to pass assorted data in a expandable way */ -typedef struct openssl_item_st - { - int code; - void *value; /* Not used for flag attributes */ - size_t value_size; /* Max size of value for output, length for input */ - size_t *value_length; /* Returned length of value for output */ - } OPENSSL_ITEM; - - -/* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock - * names in cryptlib.c - */ - -#define CRYPTO_LOCK_ERR 1 -#define CRYPTO_LOCK_EX_DATA 2 -#define CRYPTO_LOCK_X509 3 -#define CRYPTO_LOCK_X509_INFO 4 -#define CRYPTO_LOCK_X509_PKEY 5 -#define CRYPTO_LOCK_X509_CRL 6 -#define CRYPTO_LOCK_X509_REQ 7 -#define CRYPTO_LOCK_DSA 8 -#define CRYPTO_LOCK_RSA 9 -#define CRYPTO_LOCK_EVP_PKEY 10 -#define CRYPTO_LOCK_X509_STORE 11 -#define CRYPTO_LOCK_SSL_CTX 12 -#define CRYPTO_LOCK_SSL_CERT 13 -#define CRYPTO_LOCK_SSL_SESSION 14 -#define CRYPTO_LOCK_SSL_SESS_CERT 15 -#define CRYPTO_LOCK_SSL 16 -#define CRYPTO_LOCK_SSL_METHOD 17 -#define CRYPTO_LOCK_RAND 18 -#define CRYPTO_LOCK_RAND2 19 -#define CRYPTO_LOCK_MALLOC 20 -#define CRYPTO_LOCK_BIO 21 -#define CRYPTO_LOCK_GETHOSTBYNAME 22 -#define CRYPTO_LOCK_GETSERVBYNAME 23 -#define CRYPTO_LOCK_READDIR 24 -#define CRYPTO_LOCK_RSA_BLINDING 25 -#define CRYPTO_LOCK_DH 26 -#define CRYPTO_LOCK_MALLOC2 27 -#define CRYPTO_LOCK_DSO 28 -#define CRYPTO_LOCK_DYNLOCK 29 -#define CRYPTO_LOCK_ENGINE 30 -#define CRYPTO_LOCK_UI 31 -#define CRYPTO_LOCK_ECDSA 32 -#define CRYPTO_LOCK_EC 33 -#define CRYPTO_LOCK_ECDH 34 -#define CRYPTO_LOCK_BN 35 -#define CRYPTO_LOCK_EC_PRE_COMP 36 -#define CRYPTO_LOCK_STORE 37 -#define CRYPTO_LOCK_COMP 38 -#ifndef OPENSSL_FIPS -#define CRYPTO_NUM_LOCKS 39 -#else -#define CRYPTO_LOCK_FIPS 39 -#define CRYPTO_LOCK_FIPS2 40 -#define CRYPTO_NUM_LOCKS 41 -#endif - -#define CRYPTO_LOCK 1 -#define CRYPTO_UNLOCK 2 -#define CRYPTO_READ 4 -#define CRYPTO_WRITE 8 - -#ifndef OPENSSL_NO_LOCKING -#ifndef CRYPTO_w_lock -#define CRYPTO_w_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) -#define CRYPTO_w_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) -#define CRYPTO_r_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) -#define CRYPTO_r_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) -#define CRYPTO_add(addr,amount,type) \ - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) -#endif -#else -#define CRYPTO_w_lock(a) -#define CRYPTO_w_unlock(a) -#define CRYPTO_r_lock(a) -#define CRYPTO_r_unlock(a) -#define CRYPTO_add(a,b,c) ((*(a))+=(b)) -#endif - -/* Some applications as well as some parts of OpenSSL need to allocate - and deallocate locks in a dynamic fashion. The following typedef - makes this possible in a type-safe manner. */ -/* struct CRYPTO_dynlock_value has to be defined by the application. */ -typedef struct - { - int references; - struct CRYPTO_dynlock_value *data; - } CRYPTO_dynlock; - - -/* The following can be used to detect memory leaks in the SSLeay library. - * It used, it turns on malloc checking */ - -#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */ -#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */ -#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */ -#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */ - -/* The following are bit values to turn on or off options connected to the - * malloc checking functionality */ - -/* Adds time to the memory checking information */ -#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */ -/* Adds thread number to the memory checking information */ -#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */ - -#define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD) - - -/* predec of the BIO type */ -typedef struct bio_st BIO_dummy; - -struct crypto_ex_data_st - { - STACK *sk; - int dummy; /* gcc is screwing up this data structure :-( */ - }; - -/* This stuff is basically class callback functions - * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */ - -typedef struct crypto_ex_data_func_st - { - long argl; /* Arbitary long */ - void *argp; /* Arbitary void * */ - CRYPTO_EX_new *new_func; - CRYPTO_EX_free *free_func; - CRYPTO_EX_dup *dup_func; - } CRYPTO_EX_DATA_FUNCS; - -DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) - -/* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA - * entry. - */ - -#define CRYPTO_EX_INDEX_BIO 0 -#define CRYPTO_EX_INDEX_SSL 1 -#define CRYPTO_EX_INDEX_SSL_CTX 2 -#define CRYPTO_EX_INDEX_SSL_SESSION 3 -#define CRYPTO_EX_INDEX_X509_STORE 4 -#define CRYPTO_EX_INDEX_X509_STORE_CTX 5 -#define CRYPTO_EX_INDEX_RSA 6 -#define CRYPTO_EX_INDEX_DSA 7 -#define CRYPTO_EX_INDEX_DH 8 -#define CRYPTO_EX_INDEX_ENGINE 9 -#define CRYPTO_EX_INDEX_X509 10 -#define CRYPTO_EX_INDEX_UI 11 -#define CRYPTO_EX_INDEX_ECDSA 12 -#define CRYPTO_EX_INDEX_ECDH 13 -#define CRYPTO_EX_INDEX_COMP 14 -#define CRYPTO_EX_INDEX_STORE 15 - -/* Dynamically assigned indexes start from this value (don't use directly, use - * via CRYPTO_ex_data_new_class). */ -#define CRYPTO_EX_INDEX_USER 100 - - -/* This is the default callbacks, but we can have others as well: - * this is needed in Win32 where the application malloc and the - * library malloc may not be the same. - */ -#define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\ - malloc, realloc, free) - -#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD -# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ -# define CRYPTO_MDEBUG -# endif -#endif - -/* Set standard debugging functions (not done by default - * unless CRYPTO_MDEBUG is defined) */ -void CRYPTO_malloc_debug_init(void); - -int CRYPTO_mem_ctrl(int mode); -int CRYPTO_is_mem_check_on(void); - -/* for applications */ -#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) -#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) - -/* for library-internal use */ -#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) -#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) -#define is_MemCheck_on() CRYPTO_is_mem_check_on() - -#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) -#define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__) -#define OPENSSL_realloc(addr,num) \ - CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) -#define OPENSSL_realloc_clean(addr,old_num,num) \ - CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__) -#define OPENSSL_remalloc(addr,num) \ - CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__) -#define OPENSSL_freeFunc CRYPTO_free -#define OPENSSL_free(addr) CRYPTO_free(addr) - -#define OPENSSL_malloc_locked(num) \ - CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) -#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) - - -const char *SSLeay_version(int type); -unsigned long SSLeay(void); - -int OPENSSL_issetugid(void); - -/* An opaque type representing an implementation of "ex_data" support */ -typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL; -/* Return an opaque pointer to the current "ex_data" implementation */ -const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void); -/* Sets the "ex_data" implementation to be used (if it's not too late) */ -int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i); -/* Get a new "ex_data" class, and return the corresponding "class_index" */ -int CRYPTO_ex_data_new_class(void); -/* Within a given class, get/register a new index */ -int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, - CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -/* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given - * class (invokes whatever per-class callbacks are applicable) */ -int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); -int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, - CRYPTO_EX_DATA *from); -void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); -/* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index - * (relative to the class type involved) */ -int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); -void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad,int idx); -/* This function cleans up all "ex_data" state. It mustn't be called under - * potential race-conditions. */ -void CRYPTO_cleanup_all_ex_data(void); - -int CRYPTO_get_new_lockid(char *name); - -int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */ -void CRYPTO_lock(int mode, int type,const char *file,int line); -void CRYPTO_set_locking_callback(void (*func)(int mode,int type, - const char *file,int line)); -void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file, - int line); -void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type, - const char *file, int line)); -int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type, - const char *file,int line); -void CRYPTO_set_id_callback(unsigned long (*func)(void)); -unsigned long (*CRYPTO_get_id_callback(void))(void); -unsigned long CRYPTO_thread_id(void); -const char *CRYPTO_get_lock_name(int type); -int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file, - int line); - -void int_CRYPTO_set_do_dynlock_callback( - void (*do_dynlock_cb)(int mode, int type, const char *file, int line)); - -int CRYPTO_get_new_dynlockid(void); -void CRYPTO_destroy_dynlockid(int i); -struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i); -void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line)); -void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)); -void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line)); -struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file,int line); -void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file,int line); -void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file,int line); - -/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- - * call the latter last if you need different functions */ -int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *)); -int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); -int CRYPTO_set_mem_ex_functions(void *(*m)(size_t,const char *,int), - void *(*r)(void *,size_t,const char *,int), - void (*f)(void *)); -int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t,const char *,int), - void (*free_func)(void *)); -int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int), - void (*r)(void *,void *,int,const char *,int,int), - void (*f)(void *,int), - void (*so)(long), - long (*go)(void)); -void CRYPTO_set_mem_info_functions( - int (*push_info_fn)(const char *info, const char *file, int line), - int (*pop_info_fn)(void), - int (*remove_all_info_fn)(void)); -void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *)); -void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); -void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int), - void *(**r)(void *, size_t,const char *,int), - void (**f)(void *)); -void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t,const char *,int), - void (**f)(void *)); -void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int), - void (**r)(void *,void *,int,const char *,int,int), - void (**f)(void *,int), - void (**so)(long), - long (**go)(void)); - -void *CRYPTO_malloc_locked(int num, const char *file, int line); -void CRYPTO_free_locked(void *); -void *CRYPTO_malloc(int num, const char *file, int line); -char *CRYPTO_strdup(const char *str, const char *file, int line); -void CRYPTO_free(void *); -void *CRYPTO_realloc(void *addr,int num, const char *file, int line); -void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file, - int line); -void *CRYPTO_remalloc(void *addr,int num, const char *file, int line); - -void OPENSSL_cleanse(void *ptr, size_t len); - -void CRYPTO_set_mem_debug_options(long bits); -long CRYPTO_get_mem_debug_options(void); - -#define CRYPTO_push_info(info) \ - CRYPTO_push_info_(info, __FILE__, __LINE__); -int CRYPTO_push_info_(const char *info, const char *file, int line); -int CRYPTO_pop_info(void); -int CRYPTO_remove_all_info(void); - - -/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; - * used as default in CRYPTO_MDEBUG compilations): */ -/* The last argument has the following significance: - * - * 0: called before the actual memory allocation has taken place - * 1: called after the actual memory allocation has taken place - */ -void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p); -void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p); -void CRYPTO_dbg_free(void *addr,int before_p); -/* Tell the debugging code about options. By default, the following values - * apply: - * - * 0: Clear all options. - * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. - * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. - * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 - */ -void CRYPTO_dbg_set_options(long bits); -long CRYPTO_dbg_get_options(void); - -int CRYPTO_dbg_push_info(const char *info, const char *file, int line); -int CRYPTO_dbg_pop_info(void); -int CRYPTO_dbg_remove_all_info(void); - -#ifndef OPENSSL_NO_FP_API -void CRYPTO_mem_leaks_fp(FILE *); -#endif -void CRYPTO_mem_leaks(struct bio_st *bio); -/* unsigned long order, char *file, int line, int num_bytes, char *addr */ -typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); -void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); - -/* die if we have to */ -void OpenSSLDie(const char *file,int line,const char *assertion); -#define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) - -unsigned long *OPENSSL_ia32cap_loc(void); -#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) -int OPENSSL_isservice(void); - -#ifdef OPENSSL_FIPS -#define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \ - alg " previous FIPS forbidden algorithm error ignored"); - -#define FIPS_BAD_ABORT(alg) OpenSSLDie(__FILE__, __LINE__, \ - #alg " Algorithm forbidden in FIPS mode"); - -#ifdef OPENSSL_FIPS_STRICT -#define FIPS_BAD_ALGORITHM(alg) FIPS_BAD_ABORT(alg) -#else -#define FIPS_BAD_ALGORITHM(alg) \ - { \ - FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD); \ - ERR_add_error_data(2, "Algorithm=", #alg); \ - return 0; \ - } -#endif - -/* Low level digest API blocking macro */ - -#define FIPS_NON_FIPS_MD_Init(alg) \ - int alg##_Init(alg##_CTX *c) \ - { \ - if (FIPS_mode()) \ - FIPS_BAD_ALGORITHM(alg) \ - return private_##alg##_Init(c); \ - } \ - int private_##alg##_Init(alg##_CTX *c) - -/* For ciphers the API often varies from cipher to cipher and each needs to - * be treated as a special case. Variable key length ciphers (Blowfish, RC4, - * CAST) however are very similar and can use a blocking macro. - */ - -#define FIPS_NON_FIPS_VCIPHER_Init(alg) \ - void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) \ - { \ - if (FIPS_mode()) \ - FIPS_BAD_ABORT(alg) \ - private_##alg##_set_key(key, len, data); \ - } \ - void private_##alg##_set_key(alg##_KEY *key, int len, \ - const unsigned char *data) - -#else - -#define FIPS_NON_FIPS_VCIPHER_Init(alg) \ - void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) - -#define FIPS_NON_FIPS_MD_Init(alg) \ - int alg##_Init(alg##_CTX *c) - -#endif /* def OPENSSL_FIPS */ - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_CRYPTO_strings(void); - -#define OPENSSL_HAVE_INIT 1 -void OPENSSL_init(void); - -/* Error codes for the CRYPTO functions. */ - -/* Function codes. */ -#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 -#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103 -#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 -#define CRYPTO_F_CRYPTO_SET_EX_DATA 102 -#define CRYPTO_F_DEF_ADD_INDEX 104 -#define CRYPTO_F_DEF_GET_CLASS 105 -#define CRYPTO_F_INT_DUP_EX_DATA 106 -#define CRYPTO_F_INT_FREE_EX_DATA 107 -#define CRYPTO_F_INT_NEW_EX_DATA 108 - -/* Reason codes. */ -#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/des.h b/dep/include/openssl/des.h deleted file mode 100644 index 92b66635998..00000000000 --- a/dep/include/openssl/des.h +++ /dev/null @@ -1,245 +0,0 @@ -/* crypto/des/des.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_NEW_DES_H -#define HEADER_NEW_DES_H - -#include /* OPENSSL_EXTERN, OPENSSL_NO_DES, - DES_LONG (via openssl/opensslconf.h */ - -#ifdef OPENSSL_NO_DES -#error DES is disabled. -#endif - -#ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned char DES_cblock[8]; -typedef /* const */ unsigned char const_DES_cblock[8]; -/* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * - * and const_DES_cblock * are incompatible pointer types. */ - -typedef struct DES_ks - { - union - { - DES_cblock cblock; - /* make sure things are correct size on machines with - * 8 byte longs */ - DES_LONG deslong[2]; - } ks[16]; - } DES_key_schedule; - -#ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT -# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT -# define OPENSSL_ENABLE_OLD_DES_SUPPORT -# endif -#endif - -#ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT -# include -#endif - -#define DES_KEY_SZ (sizeof(DES_cblock)) -#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) - -#define DES_ENCRYPT 1 -#define DES_DECRYPT 0 - -#define DES_CBC_MODE 0 -#define DES_PCBC_MODE 1 - -#define DES_ecb2_encrypt(i,o,k1,k2,e) \ - DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */ -#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) -OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */ -#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) - -const char *DES_options(void); -void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks1,DES_key_schedule *ks2, - DES_key_schedule *ks3, int enc); -DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output, - long length,DES_key_schedule *schedule, - const_DES_cblock *ivec); -/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ -void DES_cbc_encrypt(const unsigned char *input,unsigned char *output, - long length,DES_key_schedule *schedule,DES_cblock *ivec, - int enc); -void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output, - long length,DES_key_schedule *schedule,DES_cblock *ivec, - int enc); -void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output, - long length,DES_key_schedule *schedule,DES_cblock *ivec, - const_DES_cblock *inw,const_DES_cblock *outw,int enc); -void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits, - long length,DES_key_schedule *schedule,DES_cblock *ivec, - int enc); -void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output, - DES_key_schedule *ks,int enc); - -/* This is the DES encryption function that gets called by just about - every other DES routine in the library. You should not use this - function except to implement 'modes' of DES. I say this because the - functions that call this routine do the conversion from 'char *' to - long, and this needs to be done to make sure 'non-aligned' memory - access do not occur. The characters are loaded 'little endian'. - Data is a pointer to 2 unsigned long's and ks is the - DES_key_schedule to use. enc, is non zero specifies encryption, - zero if decryption. */ -void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc); - -/* This functions is the same as DES_encrypt1() except that the DES - initial permutation (IP) and final permutation (FP) have been left - out. As for DES_encrypt1(), you should not use this function. - It is used by the routines in the library that implement triple DES. - IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same - as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */ -void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc); - -void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3); -void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3); -void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output, - long length, - DES_key_schedule *ks1,DES_key_schedule *ks2, - DES_key_schedule *ks3,DES_cblock *ivec,int enc); -void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out, - long length, - DES_key_schedule *ks1,DES_key_schedule *ks2, - DES_key_schedule *ks3, - DES_cblock *ivec1,DES_cblock *ivec2, - int enc); -void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out, - long length,DES_key_schedule *ks1, - DES_key_schedule *ks2,DES_key_schedule *ks3, - DES_cblock *ivec,int *num,int enc); -void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out, - int numbits,long length,DES_key_schedule *ks1, - DES_key_schedule *ks2,DES_key_schedule *ks3, - DES_cblock *ivec,int enc); -void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out, - long length,DES_key_schedule *ks1, - DES_key_schedule *ks2,DES_key_schedule *ks3, - DES_cblock *ivec,int *num); -#if 0 -void DES_xwhite_in2out(const_DES_cblock *DES_key,const_DES_cblock *in_white, - DES_cblock *out_white); -#endif - -int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched, - DES_cblock *iv); -int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched, - DES_cblock *iv); -char *DES_fcrypt(const char *buf,const char *salt, char *ret); -char *DES_crypt(const char *buf,const char *salt); -void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits, - long length,DES_key_schedule *schedule,DES_cblock *ivec); -void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output, - long length,DES_key_schedule *schedule,DES_cblock *ivec, - int enc); -DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[], - long length,int out_count,DES_cblock *seed); -int DES_random_key(DES_cblock *ret); -void DES_set_odd_parity(DES_cblock *key); -int DES_check_key_parity(const_DES_cblock *key); -int DES_is_weak_key(const_DES_cblock *key); -/* DES_set_key (= set_key = DES_key_sched = key_sched) calls - * DES_set_key_checked if global variable DES_check_key is set, - * DES_set_key_unchecked otherwise. */ -int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule); -int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); -int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule); -void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); -void DES_string_to_key(const char *str,DES_cblock *key); -void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); -void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, - DES_key_schedule *schedule,DES_cblock *ivec,int *num, - int enc); -void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length, - DES_key_schedule *schedule,DES_cblock *ivec,int *num); - -int DES_read_password(DES_cblock *key, const char *prompt, int verify); -int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt, - int verify); - -#define DES_fixup_key_parity DES_set_odd_parity - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/des_old.h b/dep/include/openssl/des_old.h deleted file mode 100644 index 2b2c3723549..00000000000 --- a/dep/include/openssl/des_old.h +++ /dev/null @@ -1,446 +0,0 @@ -/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ - -/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING - * - * The function names in here are deprecated and are only present to - * provide an interface compatible with openssl 0.9.6 and older as - * well as libdes. OpenSSL now provides functions where "des_" has - * been replaced with "DES_" in the names, to make it possible to - * make incompatible changes that are needed for C type security and - * other stuff. - * - * This include files has two compatibility modes: - * - * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API - * that is compatible with libdes and SSLeay. - * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an - * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. - * - * Note that these modes break earlier snapshots of OpenSSL, where - * libdes compatibility was the only available mode or (later on) the - * prefered compatibility mode. However, after much consideration - * (and more or less violent discussions with external parties), it - * was concluded that OpenSSL should be compatible with earlier versions - * of itself before anything else. Also, in all honesty, libdes is - * an old beast that shouldn't really be used any more. - * - * Please consider starting to use the DES_ functions rather than the - * des_ ones. The des_ functions will disappear completely before - * OpenSSL 1.0! - * - * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING - */ - -/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL - * project 2001. - */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DES_H -#define HEADER_DES_H - -#include /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ - -#ifdef OPENSSL_NO_DES -#error DES is disabled. -#endif - -#ifndef HEADER_NEW_DES_H -#error You must include des.h, not des_old.h directly. -#endif - -#ifdef _KERBEROS_DES_H -#error replaces . -#endif - -#include - -#ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _ -#undef _ -#endif - -typedef unsigned char _ossl_old_des_cblock[8]; -typedef struct _ossl_old_des_ks_struct - { - union { - _ossl_old_des_cblock _; - /* make sure things are correct size on machines with - * 8 byte longs */ - DES_LONG pad[2]; - } ks; - } _ossl_old_des_key_schedule[16]; - -#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY -#define des_cblock DES_cblock -#define const_des_cblock const_DES_cblock -#define des_key_schedule DES_key_schedule -#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ - DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) -#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ - DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) -#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ - DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) -#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ - DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) -#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ - DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) -#define des_options()\ - DES_options() -#define des_cbc_cksum(i,o,l,k,iv)\ - DES_cbc_cksum((i),(o),(l),&(k),(iv)) -#define des_cbc_encrypt(i,o,l,k,iv,e)\ - DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) -#define des_ncbc_encrypt(i,o,l,k,iv,e)\ - DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) -#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ - DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) -#define des_cfb_encrypt(i,o,n,l,k,iv,e)\ - DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) -#define des_ecb_encrypt(i,o,k,e)\ - DES_ecb_encrypt((i),(o),&(k),(e)) -#define des_encrypt1(d,k,e)\ - DES_encrypt1((d),&(k),(e)) -#define des_encrypt2(d,k,e)\ - DES_encrypt2((d),&(k),(e)) -#define des_encrypt3(d,k1,k2,k3)\ - DES_encrypt3((d),&(k1),&(k2),&(k3)) -#define des_decrypt3(d,k1,k2,k3)\ - DES_decrypt3((d),&(k1),&(k2),&(k3)) -#define des_xwhite_in2out(k,i,o)\ - DES_xwhite_in2out((k),(i),(o)) -#define des_enc_read(f,b,l,k,iv)\ - DES_enc_read((f),(b),(l),&(k),(iv)) -#define des_enc_write(f,b,l,k,iv)\ - DES_enc_write((f),(b),(l),&(k),(iv)) -#define des_fcrypt(b,s,r)\ - DES_fcrypt((b),(s),(r)) -#if 0 -#define des_crypt(b,s)\ - DES_crypt((b),(s)) -#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) -#define crypt(b,s)\ - DES_crypt((b),(s)) -#endif -#endif -#define des_ofb_encrypt(i,o,n,l,k,iv)\ - DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) -#define des_pcbc_encrypt(i,o,l,k,iv,e)\ - DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) -#define des_quad_cksum(i,o,l,c,s)\ - DES_quad_cksum((i),(o),(l),(c),(s)) -#define des_random_seed(k)\ - _ossl_096_des_random_seed((k)) -#define des_random_key(r)\ - DES_random_key((r)) -#define des_read_password(k,p,v) \ - DES_read_password((k),(p),(v)) -#define des_read_2passwords(k1,k2,p,v) \ - DES_read_2passwords((k1),(k2),(p),(v)) -#define des_set_odd_parity(k)\ - DES_set_odd_parity((k)) -#define des_check_key_parity(k)\ - DES_check_key_parity((k)) -#define des_is_weak_key(k)\ - DES_is_weak_key((k)) -#define des_set_key(k,ks)\ - DES_set_key((k),&(ks)) -#define des_key_sched(k,ks)\ - DES_key_sched((k),&(ks)) -#define des_set_key_checked(k,ks)\ - DES_set_key_checked((k),&(ks)) -#define des_set_key_unchecked(k,ks)\ - DES_set_key_unchecked((k),&(ks)) -#define des_string_to_key(s,k)\ - DES_string_to_key((s),(k)) -#define des_string_to_2keys(s,k1,k2)\ - DES_string_to_2keys((s),(k1),(k2)) -#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ - DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) -#define des_ofb64_encrypt(i,o,l,ks,iv,n)\ - DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) - - -#define des_ecb2_encrypt(i,o,k1,k2,e) \ - des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -#define des_check_key DES_check_key -#define des_rw_mode DES_rw_mode -#else /* libdes compatibility */ -/* Map all symbol names to _ossl_old_des_* form, so we avoid all - clashes with libdes */ -#define des_cblock _ossl_old_des_cblock -#define des_key_schedule _ossl_old_des_key_schedule -#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ - _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) -#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ - _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) -#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ - _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) -#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ - _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) -#define des_options()\ - _ossl_old_des_options() -#define des_cbc_cksum(i,o,l,k,iv)\ - _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) -#define des_cbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) -#define des_ncbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) -#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ - _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) -#define des_cfb_encrypt(i,o,n,l,k,iv,e)\ - _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) -#define des_ecb_encrypt(i,o,k,e)\ - _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) -#define des_encrypt(d,k,e)\ - _ossl_old_des_encrypt((d),(k),(e)) -#define des_encrypt2(d,k,e)\ - _ossl_old_des_encrypt2((d),(k),(e)) -#define des_encrypt3(d,k1,k2,k3)\ - _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) -#define des_decrypt3(d,k1,k2,k3)\ - _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) -#define des_xwhite_in2out(k,i,o)\ - _ossl_old_des_xwhite_in2out((k),(i),(o)) -#define des_enc_read(f,b,l,k,iv)\ - _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) -#define des_enc_write(f,b,l,k,iv)\ - _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) -#define des_fcrypt(b,s,r)\ - _ossl_old_des_fcrypt((b),(s),(r)) -#define des_crypt(b,s)\ - _ossl_old_des_crypt((b),(s)) -#if 0 -#define crypt(b,s)\ - _ossl_old_crypt((b),(s)) -#endif -#define des_ofb_encrypt(i,o,n,l,k,iv)\ - _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) -#define des_pcbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) -#define des_quad_cksum(i,o,l,c,s)\ - _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) -#define des_random_seed(k)\ - _ossl_old_des_random_seed((k)) -#define des_random_key(r)\ - _ossl_old_des_random_key((r)) -#define des_read_password(k,p,v) \ - _ossl_old_des_read_password((k),(p),(v)) -#define des_read_2passwords(k1,k2,p,v) \ - _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) -#define des_set_odd_parity(k)\ - _ossl_old_des_set_odd_parity((k)) -#define des_is_weak_key(k)\ - _ossl_old_des_is_weak_key((k)) -#define des_set_key(k,ks)\ - _ossl_old_des_set_key((k),(ks)) -#define des_key_sched(k,ks)\ - _ossl_old_des_key_sched((k),(ks)) -#define des_string_to_key(s,k)\ - _ossl_old_des_string_to_key((s),(k)) -#define des_string_to_2keys(s,k1,k2)\ - _ossl_old_des_string_to_2keys((s),(k1),(k2)) -#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ - _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) -#define des_ofb64_encrypt(i,o,l,ks,iv,n)\ - _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) - - -#define des_ecb2_encrypt(i,o,k1,k2,e) \ - des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -#define des_check_key DES_check_key -#define des_rw_mode DES_rw_mode -#endif - -const char *_ossl_old_des_options(void); -void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, - _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, int enc); -DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, - long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); -void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, - _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); -void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, - _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); -void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, - _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec, - _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc); -void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, - long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); -void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, - _ossl_old_des_key_schedule ks,int enc); -void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); -void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); -void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); -void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); -void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, - long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc); -void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, - long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc); -void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, - long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num); -#if 0 -void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), - _ossl_old_des_cblock (*out_white)); -#endif - -int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, - _ossl_old_des_cblock *iv); -int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, - _ossl_old_des_cblock *iv); -char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret); -char *_ossl_old_des_crypt(const char *buf,const char *salt); -#if !defined(PERL5) && !defined(NeXT) -char *_ossl_old_crypt(const char *buf,const char *salt); -#endif -void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, - int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); -void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, - _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); -DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, - long length,int out_count,_ossl_old_des_cblock *seed); -void _ossl_old_des_random_seed(_ossl_old_des_cblock key); -void _ossl_old_des_random_key(_ossl_old_des_cblock ret); -int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify); -int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2, - const char *prompt,int verify); -void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); -int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); -int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); -int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); -void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key); -void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2); -void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, - _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc); -void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, - _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num); - -void _ossl_096_des_random_seed(des_cblock *key); - -/* The following definitions provide compatibility with the MIT Kerberos - * library. The _ossl_old_des_key_schedule structure is not binary compatible. */ - -#define _KERBEROS_DES_H - -#define KRBDES_ENCRYPT DES_ENCRYPT -#define KRBDES_DECRYPT DES_DECRYPT - -#ifdef KERBEROS -# define ENCRYPT DES_ENCRYPT -# define DECRYPT DES_DECRYPT -#endif - -#ifndef NCOMPAT -# define C_Block des_cblock -# define Key_schedule des_key_schedule -# define KEY_SZ DES_KEY_SZ -# define string_to_key des_string_to_key -# define read_pw_string des_read_pw_string -# define random_key des_random_key -# define pcbc_encrypt des_pcbc_encrypt -# define set_key des_set_key -# define key_sched des_key_sched -# define ecb_encrypt des_ecb_encrypt -# define cbc_encrypt des_cbc_encrypt -# define ncbc_encrypt des_ncbc_encrypt -# define xcbc_encrypt des_xcbc_encrypt -# define cbc_cksum des_cbc_cksum -# define quad_cksum des_quad_cksum -# define check_parity des_check_key_parity -#endif - -#define des_fixup_key_parity DES_fixup_key_parity - -#ifdef __cplusplus -} -#endif - -/* for DES_read_pw_string et al */ -#include - -#endif diff --git a/dep/include/openssl/dh.h b/dep/include/openssl/dh.h deleted file mode 100644 index 10475ac4b3c..00000000000 --- a/dep/include/openssl/dh.h +++ /dev/null @@ -1,245 +0,0 @@ -/* crypto/dh/dh.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_DH_H -#define HEADER_DH_H - -#include - -#ifdef OPENSSL_NO_DH -#error DH is disabled. -#endif - -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifndef OPENSSL_DH_MAX_MODULUS_BITS -# define OPENSSL_DH_MAX_MODULUS_BITS 10000 -#endif - -#define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024 - -#define DH_FLAG_CACHE_MONT_P 0x01 -#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH - * implementation now uses constant time - * modular exponentiation for secret exponents - * by default. This flag causes the - * faster variable sliding window method to - * be used for all exponents. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct dh_st DH; */ -/* typedef struct dh_method DH_METHOD; */ - -struct dh_method - { - const char *name; - /* Methods here */ - int (*generate_key)(DH *dh); - int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh); - int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a, - const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *m_ctx); /* Can be null */ - - int (*init)(DH *dh); - int (*finish)(DH *dh); - int flags; - char *app_data; - /* If this is non-NULL, it will be used to generate parameters */ - int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb); - }; - -struct dh_st - { - /* This first argument is used to pick up errors when - * a DH is passed instead of a EVP_PKEY */ - int pad; - int version; - BIGNUM *p; - BIGNUM *g; - long length; /* optional */ - BIGNUM *pub_key; /* g^x */ - BIGNUM *priv_key; /* x */ - - int flags; - BN_MONT_CTX *method_mont_p; - /* Place holders if we want to do X9.42 DH */ - BIGNUM *q; - BIGNUM *j; - unsigned char *seed; - int seedlen; - BIGNUM *counter; - - int references; - CRYPTO_EX_DATA ex_data; - const DH_METHOD *meth; - ENGINE *engine; - }; - -#define DH_GENERATOR_2 2 -/* #define DH_GENERATOR_3 3 */ -#define DH_GENERATOR_5 5 - -/* DH_check error codes */ -#define DH_CHECK_P_NOT_PRIME 0x01 -#define DH_CHECK_P_NOT_SAFE_PRIME 0x02 -#define DH_UNABLE_TO_CHECK_GENERATOR 0x04 -#define DH_NOT_SUITABLE_GENERATOR 0x08 - -/* DH_check_pub_key error codes */ -#define DH_CHECK_PUBKEY_TOO_SMALL 0x01 -#define DH_CHECK_PUBKEY_TOO_LARGE 0x02 - -/* primes p where (p-1)/2 is prime too are called "safe"; we define - this for backward compatibility: */ -#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME - -#define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x) -#define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -#define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) - -const DH_METHOD *DH_OpenSSL(void); - -#ifdef OPENSSL_FIPS -DH * FIPS_dh_new(void); -void FIPS_dh_free(DH *dh); -#endif - -void DH_set_default_method(const DH_METHOD *meth); -const DH_METHOD *DH_get_default_method(void); -int DH_set_method(DH *dh, const DH_METHOD *meth); -DH *DH_new_method(ENGINE *engine); - -DH * DH_new(void); -void DH_free(DH *dh); -int DH_up_ref(DH *dh); -int DH_size(const DH *dh); -int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int DH_set_ex_data(DH *d, int idx, void *arg); -void *DH_get_ex_data(DH *d, int idx); - -/* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -DH * DH_generate_parameters(int prime_len,int generator, - void (*callback)(int,int,void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb); - -int DH_check(const DH *dh,int *codes); -int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes); -int DH_generate_key(DH *dh); -int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh); -DH * d2i_DHparams(DH **a,const unsigned char **pp, long length); -int i2d_DHparams(const DH *a,unsigned char **pp); -#ifndef OPENSSL_NO_FP_API -int DHparams_print_fp(FILE *fp, const DH *x); -#endif -#ifndef OPENSSL_NO_BIO -int DHparams_print(BIO *bp, const DH *x); -#else -int DHparams_print(char *bp, const DH *x); -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DH_strings(void); - -/* Error codes for the DH functions. */ - -/* Function codes. */ -#define DH_F_COMPUTE_KEY 102 -#define DH_F_DHPARAMS_PRINT 100 -#define DH_F_DHPARAMS_PRINT_FP 101 -#define DH_F_DH_BUILTIN_GENPARAMS 106 -#define DH_F_DH_COMPUTE_KEY 107 -#define DH_F_DH_GENERATE_KEY 108 -#define DH_F_DH_GENERATE_PARAMETERS 109 -#define DH_F_DH_NEW_METHOD 105 -#define DH_F_GENERATE_KEY 103 -#define DH_F_GENERATE_PARAMETERS 104 - -/* Reason codes. */ -#define DH_R_BAD_GENERATOR 101 -#define DH_R_INVALID_PUBKEY 102 -#define DH_R_KEY_SIZE_TOO_SMALL 104 -#define DH_R_MODULUS_TOO_LARGE 103 -#define DH_R_NO_PRIVATE_VALUE 100 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/dsa.h b/dep/include/openssl/dsa.h deleted file mode 100644 index 702c50d6dc8..00000000000 --- a/dep/include/openssl/dsa.h +++ /dev/null @@ -1,324 +0,0 @@ -/* crypto/dsa/dsa.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -/* - * The DSS routines are based on patches supplied by - * Steven Schoch . He basically did the - * work and I have just tweaked them a little to fit into my - * stylistic vision for SSLeay :-) */ - -#ifndef HEADER_DSA_H -#define HEADER_DSA_H - -#include - -#ifdef OPENSSL_NO_DSA -#error DSA is disabled. -#endif - -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#include - -#ifndef OPENSSL_NO_DEPRECATED -#include -#ifndef OPENSSL_NO_DH -# include -#endif -#endif - -#ifndef OPENSSL_DSA_MAX_MODULUS_BITS -# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 -#endif - -#define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024 - -#define DSA_FLAG_CACHE_MONT_P 0x01 -#define DSA_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DSA - * implementation now uses constant time - * modular exponentiation for secret exponents - * by default. This flag causes the - * faster variable sliding window method to - * be used for all exponents. - */ - -/* If this flag is set the DSA method is FIPS compliant and can be used - * in FIPS mode. This is set in the validated module method. If an - * application sets this flag in its own methods it is its reposibility - * to ensure the result is compliant. - */ - -#define DSA_FLAG_FIPS_METHOD 0x0400 - -/* If this flag is set the operations normally disabled in FIPS mode are - * permitted it is then the applications responsibility to ensure that the - * usage is compliant. - */ - -#define DSA_FLAG_NON_FIPS_ALLOW 0x0400 - -#ifdef OPENSSL_FIPS -#define FIPS_DSA_SIZE_T int -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct dsa_st DSA; */ -/* typedef struct dsa_method DSA_METHOD; */ - -typedef struct DSA_SIG_st - { - BIGNUM *r; - BIGNUM *s; - } DSA_SIG; - -struct dsa_method - { - const char *name; - DSA_SIG * (*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa); - int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, - BIGNUM **rp); - int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, - DSA_SIG *sig, DSA *dsa); - int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, - BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *in_mont); - int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *m_ctx); /* Can be null */ - int (*init)(DSA *dsa); - int (*finish)(DSA *dsa); - int flags; - char *app_data; - /* If this is non-NULL, it is used to generate DSA parameters */ - int (*dsa_paramgen)(DSA *dsa, int bits, - unsigned char *seed, int seed_len, - int *counter_ret, unsigned long *h_ret, - BN_GENCB *cb); - /* If this is non-NULL, it is used to generate DSA keys */ - int (*dsa_keygen)(DSA *dsa); - }; - -struct dsa_st - { - /* This first variable is used to pick up errors where - * a DSA is passed instead of of a EVP_PKEY */ - int pad; - long version; - int write_params; - BIGNUM *p; - BIGNUM *q; /* == 20 */ - BIGNUM *g; - - BIGNUM *pub_key; /* y public key */ - BIGNUM *priv_key; /* x private key */ - - BIGNUM *kinv; /* Signing pre-calc */ - BIGNUM *r; /* Signing pre-calc */ - - int flags; - /* Normally used to cache montgomery values */ - BN_MONT_CTX *method_mont_p; - int references; - CRYPTO_EX_DATA ex_data; - const DSA_METHOD *meth; - /* functional reference if 'meth' is ENGINE-provided */ - ENGINE *engine; - }; - -#define DSAparams_dup(x) ASN1_dup_of_const(DSA,i2d_DSAparams,d2i_DSAparams,x) -#define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ - (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) -#define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ - (unsigned char *)(x)) -#define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) -#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x) - - -DSA_SIG * DSA_SIG_new(void); -void DSA_SIG_free(DSA_SIG *a); -int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); -DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); - -DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); -int DSA_do_verify(const unsigned char *dgst,int dgst_len, - DSA_SIG *sig,DSA *dsa); - -const DSA_METHOD *DSA_OpenSSL(void); - -void DSA_set_default_method(const DSA_METHOD *); -const DSA_METHOD *DSA_get_default_method(void); -int DSA_set_method(DSA *dsa, const DSA_METHOD *); - -#ifdef OPENSSL_FIPS -DSA * FIPS_dsa_new(void); -void FIPS_dsa_free (DSA *r); -#endif - -DSA * DSA_new(void); -DSA * DSA_new_method(ENGINE *engine); -void DSA_free (DSA *r); -/* "up" the DSA object's reference count */ -int DSA_up_ref(DSA *r); -int DSA_size(const DSA *); - /* next 4 return -1 on error */ -int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); -int DSA_sign(int type,const unsigned char *dgst,int dlen, - unsigned char *sig, unsigned int *siglen, DSA *dsa); -int DSA_verify(int type,const unsigned char *dgst,int dgst_len, - const unsigned char *sigbuf, int siglen, DSA *dsa); -int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int DSA_set_ex_data(DSA *d, int idx, void *arg); -void *DSA_get_ex_data(DSA *d, int idx); - -DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); -DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); -DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length); - -/* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -DSA * DSA_generate_parameters(int bits, - unsigned char *seed,int seed_len, - int *counter_ret, unsigned long *h_ret,void - (*callback)(int, int, void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int DSA_generate_parameters_ex(DSA *dsa, int bits, - unsigned char *seed,int seed_len, - int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); - -int DSA_generate_key(DSA *a); -int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); -int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); -int i2d_DSAparams(const DSA *a,unsigned char **pp); - -#ifndef OPENSSL_NO_BIO -int DSAparams_print(BIO *bp, const DSA *x); -int DSA_print(BIO *bp, const DSA *x, int off); -#endif -#ifndef OPENSSL_NO_FP_API -int DSAparams_print_fp(FILE *fp, const DSA *x); -int DSA_print_fp(FILE *bp, const DSA *x, int off); -#endif - -#define DSS_prime_checks 50 -/* Primality test according to FIPS PUB 186[-1], Appendix 2.1: - * 50 rounds of Rabin-Miller */ -#define DSA_is_prime(n, callback, cb_arg) \ - BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) - -#ifndef OPENSSL_NO_DH -/* Convert DSA structure (key or just parameters) into DH structure - * (be careful to avoid small subgroup attacks when using this!) */ -DH *DSA_dup_DH(const DSA *r); -#endif - -#ifdef OPENSSL_FIPS -int FIPS_dsa_sig_encode(unsigned char *out, DSA_SIG *sig); -int FIPS_dsa_sig_decode(DSA_SIG *sig, const unsigned char *in, int inlen); -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DSA_strings(void); - -/* Error codes for the DSA functions. */ - -/* Function codes. */ -#define DSA_F_D2I_DSA_SIG 110 -#define DSA_F_DSAPARAMS_PRINT 100 -#define DSA_F_DSAPARAMS_PRINT_FP 101 -#define DSA_F_DSA_BUILTIN_KEYGEN 119 -#define DSA_F_DSA_BUILTIN_PARAMGEN 118 -#define DSA_F_DSA_DO_SIGN 112 -#define DSA_F_DSA_DO_VERIFY 113 -#define DSA_F_DSA_GENERATE_PARAMETERS 117 -#define DSA_F_DSA_NEW_METHOD 103 -#define DSA_F_DSA_PRINT 104 -#define DSA_F_DSA_PRINT_FP 105 -#define DSA_F_DSA_SET_DEFAULT_METHOD 115 -#define DSA_F_DSA_SET_METHOD 116 -#define DSA_F_DSA_SIGN 106 -#define DSA_F_DSA_SIGN_SETUP 107 -#define DSA_F_DSA_SIG_NEW 109 -#define DSA_F_DSA_VERIFY 108 -#define DSA_F_I2D_DSA_SIG 111 -#define DSA_F_SIG_CB 114 - -/* Reason codes. */ -#define DSA_R_BAD_Q_VALUE 102 -#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 -#define DSA_R_KEY_SIZE_TOO_SMALL 106 -#define DSA_R_MISSING_PARAMETERS 101 -#define DSA_R_MODULUS_TOO_LARGE 103 -#define DSA_R_NON_FIPS_METHOD 104 -#define DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 105 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/dso.h b/dep/include/openssl/dso.h deleted file mode 100644 index 08730cef2f1..00000000000 --- a/dep/include/openssl/dso.h +++ /dev/null @@ -1,369 +0,0 @@ -/* dso.h -*- mode:C; c-file-style: "eay" -*- */ -/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL - * project 2000. - */ -/* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DSO_H -#define HEADER_DSO_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* These values are used as commands to DSO_ctrl() */ -#define DSO_CTRL_GET_FLAGS 1 -#define DSO_CTRL_SET_FLAGS 2 -#define DSO_CTRL_OR_FLAGS 3 - -/* By default, DSO_load() will translate the provided filename into a form - * typical for the platform (more specifically the DSO_METHOD) using the - * dso_name_converter function of the method. Eg. win32 will transform "blah" - * into "blah.dll", and dlfcn will transform it into "libblah.so". The - * behaviour can be overriden by setting the name_converter callback in the DSO - * object (using DSO_set_name_converter()). This callback could even utilise - * the DSO_METHOD's converter too if it only wants to override behaviour for - * one or two possible DSO methods. However, the following flag can be set in a - * DSO to prevent *any* native name-translation at all - eg. if the caller has - * prompted the user for a path to a driver library so the filename should be - * interpreted as-is. */ -#define DSO_FLAG_NO_NAME_TRANSLATION 0x01 -/* An extra flag to give if only the extension should be added as - * translation. This is obviously only of importance on Unix and - * other operating systems where the translation also may prefix - * the name with something, like 'lib', and ignored everywhere else. - * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used - * at the same time. */ -#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02 - -/* The following flag controls the translation of symbol names to upper - * case. This is currently only being implemented for OpenVMS. - */ -#define DSO_FLAG_UPCASE_SYMBOL 0x10 - -/* This flag loads the library with public symbols. - * Meaning: The exported symbols of this library are public - * to all libraries loaded after this library. - * At the moment only implemented in unix. - */ -#define DSO_FLAG_GLOBAL_SYMBOLS 0x20 - - -typedef void (*DSO_FUNC_TYPE)(void); - -typedef struct dso_st DSO; - -/* The function prototype used for method functions (or caller-provided - * callbacks) that transform filenames. They are passed a DSO structure pointer - * (or NULL if they are to be used independantly of a DSO object) and a - * filename to transform. They should either return NULL (if there is an error - * condition) or a newly allocated string containing the transformed form that - * the caller will need to free with OPENSSL_free() when done. */ -typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); -/* The function prototype used for method functions (or caller-provided - * callbacks) that merge two file specifications. They are passed a - * DSO structure pointer (or NULL if they are to be used independantly of - * a DSO object) and two file specifications to merge. They should - * either return NULL (if there is an error condition) or a newly allocated - * string containing the result of merging that the caller will need - * to free with OPENSSL_free() when done. - * Here, merging means that bits and pieces are taken from each of the - * file specifications and added together in whatever fashion that is - * sensible for the DSO method in question. The only rule that really - * applies is that if the two specification contain pieces of the same - * type, the copy from the first string takes priority. One could see - * it as the first specification is the one given by the user and the - * second being a bunch of defaults to add on if they're missing in the - * first. */ -typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *); - -typedef struct dso_meth_st - { - const char *name; - /* Loads a shared library, NB: new DSO_METHODs must ensure that a - * successful load populates the loaded_filename field, and likewise a - * successful unload OPENSSL_frees and NULLs it out. */ - int (*dso_load)(DSO *dso); - /* Unloads a shared library */ - int (*dso_unload)(DSO *dso); - /* Binds a variable */ - void *(*dso_bind_var)(DSO *dso, const char *symname); - /* Binds a function - assumes a return type of DSO_FUNC_TYPE. - * This should be cast to the real function prototype by the - * caller. Platforms that don't have compatible representations - * for different prototypes (this is possible within ANSI C) - * are highly unlikely to have shared libraries at all, let - * alone a DSO_METHOD implemented for them. */ - DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname); - -/* I don't think this would actually be used in any circumstances. */ -#if 0 - /* Unbinds a variable */ - int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr); - /* Unbinds a function */ - int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr); -#endif - /* The generic (yuck) "ctrl()" function. NB: Negative return - * values (rather than zero) indicate errors. */ - long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg); - /* The default DSO_METHOD-specific function for converting filenames to - * a canonical native form. */ - DSO_NAME_CONVERTER_FUNC dso_name_converter; - /* The default DSO_METHOD-specific function for converting filenames to - * a canonical native form. */ - DSO_MERGER_FUNC dso_merger; - - /* [De]Initialisation handlers. */ - int (*init)(DSO *dso); - int (*finish)(DSO *dso); - } DSO_METHOD; - -/**********************************************************************/ -/* The low-level handle type used to refer to a loaded shared library */ - -struct dso_st - { - DSO_METHOD *meth; - /* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS - * doesn't use anything but will need to cache the filename - * for use in the dso_bind handler. All in all, let each - * method control its own destiny. "Handles" and such go in - * a STACK. */ - STACK *meth_data; - int references; - int flags; - /* For use by applications etc ... use this for your bits'n'pieces, - * don't touch meth_data! */ - CRYPTO_EX_DATA ex_data; - /* If this callback function pointer is set to non-NULL, then it will - * be used in DSO_load() in place of meth->dso_name_converter. NB: This - * should normally set using DSO_set_name_converter(). */ - DSO_NAME_CONVERTER_FUNC name_converter; - /* If this callback function pointer is set to non-NULL, then it will - * be used in DSO_load() in place of meth->dso_merger. NB: This - * should normally set using DSO_set_merger(). */ - DSO_MERGER_FUNC merger; - /* This is populated with (a copy of) the platform-independant - * filename used for this DSO. */ - char *filename; - /* This is populated with (a copy of) the translated filename by which - * the DSO was actually loaded. It is NULL iff the DSO is not currently - * loaded. NB: This is here because the filename translation process - * may involve a callback being invoked more than once not only to - * convert to a platform-specific form, but also to try different - * filenames in the process of trying to perform a load. As such, this - * variable can be used to indicate (a) whether this DSO structure - * corresponds to a loaded library or not, and (b) the filename with - * which it was actually loaded. */ - char *loaded_filename; - }; - - -DSO * DSO_new(void); -DSO * DSO_new_method(DSO_METHOD *method); -int DSO_free(DSO *dso); -int DSO_flags(DSO *dso); -int DSO_up_ref(DSO *dso); -long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg); - -/* This function sets the DSO's name_converter callback. If it is non-NULL, - * then it will be used instead of the associated DSO_METHOD's function. If - * oldcb is non-NULL then it is set to the function pointer value being - * replaced. Return value is non-zero for success. */ -int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb, - DSO_NAME_CONVERTER_FUNC *oldcb); -/* These functions can be used to get/set the platform-independant filename - * used for a DSO. NB: set will fail if the DSO is already loaded. */ -const char *DSO_get_filename(DSO *dso); -int DSO_set_filename(DSO *dso, const char *filename); -/* This function will invoke the DSO's name_converter callback to translate a - * filename, or if the callback isn't set it will instead use the DSO_METHOD's - * converter. If "filename" is NULL, the "filename" in the DSO itself will be - * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is - * simply duplicated. NB: This function is usually called from within a - * DSO_METHOD during the processing of a DSO_load() call, and is exposed so that - * caller-created DSO_METHODs can do the same thing. A non-NULL return value - * will need to be OPENSSL_free()'d. */ -char *DSO_convert_filename(DSO *dso, const char *filename); -/* This function will invoke the DSO's merger callback to merge two file - * specifications, or if the callback isn't set it will instead use the - * DSO_METHOD's merger. A non-NULL return value will need to be - * OPENSSL_free()'d. */ -char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2); -/* If the DSO is currently loaded, this returns the filename that it was loaded - * under, otherwise it returns NULL. So it is also useful as a test as to - * whether the DSO is currently loaded. NB: This will not necessarily return - * the same value as DSO_convert_filename(dso, dso->filename), because the - * DSO_METHOD's load function may have tried a variety of filenames (with - * and/or without the aid of the converters) before settling on the one it - * actually loaded. */ -const char *DSO_get_loaded_filename(DSO *dso); - -void DSO_set_default_method(DSO_METHOD *meth); -DSO_METHOD *DSO_get_default_method(void); -DSO_METHOD *DSO_get_method(DSO *dso); -DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth); - -/* The all-singing all-dancing load function, you normally pass NULL - * for the first and third parameters. Use DSO_up and DSO_free for - * subsequent reference count handling. Any flags passed in will be set - * in the constructed DSO after its init() function but before the - * load operation. If 'dso' is non-NULL, 'flags' is ignored. */ -DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags); - -/* This function binds to a variable inside a shared library. */ -void *DSO_bind_var(DSO *dso, const char *symname); - -/* This function binds to a function inside a shared library. */ -DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname); - -/* This method is the default, but will beg, borrow, or steal whatever - * method should be the default on any particular platform (including - * DSO_METH_null() if necessary). */ -DSO_METHOD *DSO_METHOD_openssl(void); - -/* This method is defined for all platforms - if a platform has no - * DSO support then this will be the only method! */ -DSO_METHOD *DSO_METHOD_null(void); - -/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions - * (dlopen, dlclose, dlsym, etc) will be used and incorporated into - * this method. If not, this method will return NULL. */ -DSO_METHOD *DSO_METHOD_dlfcn(void); - -/* If DSO_DL is defined, the standard dl.h-style functions (shl_load, - * shl_unload, shl_findsym, etc) will be used and incorporated into - * this method. If not, this method will return NULL. */ -DSO_METHOD *DSO_METHOD_dl(void); - -/* If WIN32 is defined, use DLLs. If not, return NULL. */ -DSO_METHOD *DSO_METHOD_win32(void); - -/* If VMS is defined, use shared images. If not, return NULL. */ -DSO_METHOD *DSO_METHOD_vms(void); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DSO_strings(void); - -/* Error codes for the DSO functions. */ - -/* Function codes. */ -#define DSO_F_DLFCN_BIND_FUNC 100 -#define DSO_F_DLFCN_BIND_VAR 101 -#define DSO_F_DLFCN_LOAD 102 -#define DSO_F_DLFCN_MERGER 130 -#define DSO_F_DLFCN_NAME_CONVERTER 123 -#define DSO_F_DLFCN_UNLOAD 103 -#define DSO_F_DL_BIND_FUNC 104 -#define DSO_F_DL_BIND_VAR 105 -#define DSO_F_DL_LOAD 106 -#define DSO_F_DL_MERGER 131 -#define DSO_F_DL_NAME_CONVERTER 124 -#define DSO_F_DL_UNLOAD 107 -#define DSO_F_DSO_BIND_FUNC 108 -#define DSO_F_DSO_BIND_VAR 109 -#define DSO_F_DSO_CONVERT_FILENAME 126 -#define DSO_F_DSO_CTRL 110 -#define DSO_F_DSO_FREE 111 -#define DSO_F_DSO_GET_FILENAME 127 -#define DSO_F_DSO_GET_LOADED_FILENAME 128 -#define DSO_F_DSO_LOAD 112 -#define DSO_F_DSO_MERGE 132 -#define DSO_F_DSO_NEW_METHOD 113 -#define DSO_F_DSO_SET_FILENAME 129 -#define DSO_F_DSO_SET_NAME_CONVERTER 122 -#define DSO_F_DSO_UP_REF 114 -#define DSO_F_VMS_BIND_SYM 115 -#define DSO_F_VMS_LOAD 116 -#define DSO_F_VMS_MERGER 133 -#define DSO_F_VMS_UNLOAD 117 -#define DSO_F_WIN32_BIND_FUNC 118 -#define DSO_F_WIN32_BIND_VAR 119 -#define DSO_F_WIN32_JOINER 135 -#define DSO_F_WIN32_LOAD 120 -#define DSO_F_WIN32_MERGER 134 -#define DSO_F_WIN32_NAME_CONVERTER 125 -#define DSO_F_WIN32_SPLITTER 136 -#define DSO_F_WIN32_UNLOAD 121 - -/* Reason codes. */ -#define DSO_R_CTRL_FAILED 100 -#define DSO_R_DSO_ALREADY_LOADED 110 -#define DSO_R_EMPTY_FILE_STRUCTURE 113 -#define DSO_R_FAILURE 114 -#define DSO_R_FILENAME_TOO_BIG 101 -#define DSO_R_FINISH_FAILED 102 -#define DSO_R_INCORRECT_FILE_SYNTAX 115 -#define DSO_R_LOAD_FAILED 103 -#define DSO_R_NAME_TRANSLATION_FAILED 109 -#define DSO_R_NO_FILENAME 111 -#define DSO_R_NO_FILE_SPECIFICATION 116 -#define DSO_R_NULL_HANDLE 104 -#define DSO_R_SET_FILENAME_FAILED 112 -#define DSO_R_STACK_ERROR 105 -#define DSO_R_SYM_FAILURE 106 -#define DSO_R_UNLOAD_FAILED 107 -#define DSO_R_UNSUPPORTED 108 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/dtls1.h b/dep/include/openssl/dtls1.h deleted file mode 100644 index f159d371102..00000000000 --- a/dep/include/openssl/dtls1.h +++ /dev/null @@ -1,218 +0,0 @@ -/* ssl/dtls1.h */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ -/* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DTLS1_H -#define HEADER_DTLS1_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define DTLS1_VERSION 0xFEFF -#define DTLS1_BAD_VER 0x0100 - -#if 0 -/* this alert description is not specified anywhere... */ -#define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110 -#endif - -/* lengths of messages */ -#define DTLS1_COOKIE_LENGTH 32 - -#define DTLS1_RT_HEADER_LENGTH 13 - -#define DTLS1_HM_HEADER_LENGTH 12 - -#define DTLS1_HM_BAD_FRAGMENT -2 -#define DTLS1_HM_FRAGMENT_RETRY -3 - -#define DTLS1_CCS_HEADER_LENGTH 1 - -#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE -#define DTLS1_AL_HEADER_LENGTH 7 -#else -#define DTLS1_AL_HEADER_LENGTH 2 -#endif - - -typedef struct dtls1_bitmap_st - { - PQ_64BIT map; - unsigned long length; /* sizeof the bitmap in bits */ - PQ_64BIT max_seq_num; /* max record number seen so far */ - } DTLS1_BITMAP; - -struct hm_header_st - { - unsigned char type; - unsigned long msg_len; - unsigned short seq; - unsigned long frag_off; - unsigned long frag_len; - unsigned int is_ccs; - }; - -struct ccs_header_st - { - unsigned char type; - unsigned short seq; - }; - -struct dtls1_timeout_st - { - /* Number of read timeouts so far */ - unsigned int read_timeouts; - - /* Number of write timeouts so far */ - unsigned int write_timeouts; - - /* Number of alerts received so far */ - unsigned int num_alerts; - }; - -typedef struct record_pqueue_st - { - unsigned short epoch; - pqueue q; - } record_pqueue; - -typedef struct hm_fragment_st - { - struct hm_header_st msg_header; - unsigned char *fragment; - } hm_fragment; - -typedef struct dtls1_state_st - { - unsigned int send_cookie; - unsigned char cookie[DTLS1_COOKIE_LENGTH]; - unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; - unsigned int cookie_len; - - /* - * The current data and handshake epoch. This is initially - * undefined, and starts at zero once the initial handshake is - * completed - */ - unsigned short r_epoch; - unsigned short w_epoch; - - /* records being received in the current epoch */ - DTLS1_BITMAP bitmap; - - /* renegotiation starts a new set of sequence numbers */ - DTLS1_BITMAP next_bitmap; - - /* handshake message numbers */ - unsigned short handshake_write_seq; - unsigned short next_handshake_write_seq; - - unsigned short handshake_read_seq; - - /* Received handshake records (processed and unprocessed) */ - record_pqueue unprocessed_rcds; - record_pqueue processed_rcds; - - /* Buffered handshake messages */ - pqueue buffered_messages; - - /* Buffered (sent) handshake records */ - pqueue sent_messages; - - unsigned int mtu; /* max wire packet size */ - - struct hm_header_st w_msg_hdr; - struct hm_header_st r_msg_hdr; - - struct dtls1_timeout_st timeout; - - /* storage for Alert/Handshake protocol data received but not - * yet processed by ssl3_read_bytes: */ - unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; - unsigned int handshake_fragment_len; - - unsigned int retransmitting; - - } DTLS1_STATE; - -typedef struct dtls1_record_data_st - { - unsigned char *packet; - unsigned int packet_length; - SSL3_BUFFER rbuf; - SSL3_RECORD rrec; - } DTLS1_RECORD_DATA; - - -/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ -#define DTLS1_TMO_READ_COUNT 2 -#define DTLS1_TMO_WRITE_COUNT 2 - -#define DTLS1_TMO_ALERT_COUNT 12 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/e_os2.h b/dep/include/openssl/e_os2.h deleted file mode 100644 index 100265e2379..00000000000 --- a/dep/include/openssl/e_os2.h +++ /dev/null @@ -1,280 +0,0 @@ -/* e_os2.h */ -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include - -#ifndef HEADER_E_OS2_H -#define HEADER_E_OS2_H - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * Detect operating systems. This probably needs completing. - * The result is that at least one OPENSSL_SYS_os macro should be defined. - * However, if none is defined, Unix is assumed. - **/ - -#define OPENSSL_SYS_UNIX - -/* ----------------------- Macintosh, before MacOS X ----------------------- */ -#if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_MACINTOSH_CLASSIC -#endif - -/* ----------------------- NetWare ----------------------------------------- */ -#if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_NETWARE -#endif - -/* ---------------------- Microsoft operating systems ---------------------- */ - -/* Note that MSDOS actually denotes 32-bit environments running on top of - MS-DOS, such as DJGPP one. */ -#if defined(OPENSSL_SYSNAME_MSDOS) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_MSDOS -#endif - -/* For 32 bit environment, there seems to be the CygWin environment and then - all the others that try to do the same thing Microsoft does... */ -#if defined(OPENSSL_SYSNAME_UWIN) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32_UWIN -#else -# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32_CYGWIN -# else -# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32 -# endif -# if defined(OPENSSL_SYSNAME_WINNT) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINNT -# endif -# if defined(OPENSSL_SYSNAME_WINCE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINCE -# endif -# endif -#endif - -/* Anything that tries to look like Microsoft is "Windows" */ -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINDOWS -# ifndef OPENSSL_SYS_MSDOS -# define OPENSSL_SYS_MSDOS -# endif -#endif - -/* DLL settings. This part is a bit tough, because it's up to the application - implementor how he or she will link the application, so it requires some - macro to be used. */ -#ifdef OPENSSL_SYS_WINDOWS -# ifndef OPENSSL_OPT_WINDLL -# if defined(_WINDLL) /* This is used when building OpenSSL to indicate that - DLL linkage should be used */ -# define OPENSSL_OPT_WINDLL -# endif -# endif -#endif - -/* -------------------------------- OpenVMS -------------------------------- */ -#if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_VMS -# if defined(__DECC) -# define OPENSSL_SYS_VMS_DECC -# elif defined(__DECCXX) -# define OPENSSL_SYS_VMS_DECC -# define OPENSSL_SYS_VMS_DECCXX -# else -# define OPENSSL_SYS_VMS_NODECC -# endif -#endif - -/* --------------------------------- OS/2 ---------------------------------- */ -#if defined(__EMX__) || defined(__OS2__) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_OS2 -#endif - -/* --------------------------------- Unix ---------------------------------- */ -#ifdef OPENSSL_SYS_UNIX -# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX) -# define OPENSSL_SYS_LINUX -# endif -# ifdef OPENSSL_SYSNAME_MPE -# define OPENSSL_SYS_MPE -# endif -# ifdef OPENSSL_SYSNAME_SNI -# define OPENSSL_SYS_SNI -# endif -# ifdef OPENSSL_SYSNAME_ULTRASPARC -# define OPENSSL_SYS_ULTRASPARC -# endif -# ifdef OPENSSL_SYSNAME_NEWS4 -# define OPENSSL_SYS_NEWS4 -# endif -# ifdef OPENSSL_SYSNAME_MACOSX -# define OPENSSL_SYS_MACOSX -# endif -# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY -# define OPENSSL_SYS_MACOSX_RHAPSODY -# define OPENSSL_SYS_MACOSX -# endif -# ifdef OPENSSL_SYSNAME_SUNOS -# define OPENSSL_SYS_SUNOS -#endif -# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY) -# define OPENSSL_SYS_CRAY -# endif -# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX) -# define OPENSSL_SYS_AIX -# endif -#endif - -/* --------------------------------- VOS ----------------------------------- */ -#ifdef OPENSSL_SYSNAME_VOS -# define OPENSSL_SYS_VOS -#endif - -/* ------------------------------- VxWorks --------------------------------- */ -#ifdef OPENSSL_SYSNAME_VXWORKS -# define OPENSSL_SYS_VXWORKS -#endif - -/** - * That's it for OS-specific stuff - *****************************************************************************/ - - -/* Specials for I/O an exit */ -#ifdef OPENSSL_SYS_MSDOS -# define OPENSSL_UNISTD_IO -# define OPENSSL_DECLARE_EXIT extern void exit(int); -#else -# define OPENSSL_UNISTD_IO OPENSSL_UNISTD -# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */ -#endif - -/* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare - certain global symbols that, with some compilers under VMS, have to be - defined and declared explicitely with globaldef and globalref. - Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare - DLL exports and imports for compilers under Win32. These are a little - more complicated to use. Basically, for any library that exports some - global variables, the following code must be present in the header file - that declares them, before OPENSSL_EXTERN is used: - - #ifdef SOME_BUILD_FLAG_MACRO - # undef OPENSSL_EXTERN - # define OPENSSL_EXTERN OPENSSL_EXPORT - #endif - - The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL - have some generally sensible values, and for OPENSSL_EXTERN to have the - value OPENSSL_IMPORT. -*/ - -#if defined(OPENSSL_SYS_VMS_NODECC) -# define OPENSSL_EXPORT globalref -# define OPENSSL_IMPORT globalref -# define OPENSSL_GLOBAL globaldef -#elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) -# define OPENSSL_EXPORT extern __declspec(dllexport) -# define OPENSSL_IMPORT extern __declspec(dllimport) -# define OPENSSL_GLOBAL -#else -# define OPENSSL_EXPORT extern -# define OPENSSL_IMPORT extern -# define OPENSSL_GLOBAL -#endif -#define OPENSSL_EXTERN OPENSSL_IMPORT - -/* Macros to allow global variables to be reached through function calls when - required (if a shared library version requvres it, for example. - The way it's done allows definitions like this: - - // in foobar.c - OPENSSL_IMPLEMENT_GLOBAL(int,foobar) = 0; - // in foobar.h - OPENSSL_DECLARE_GLOBAL(int,foobar); - #define foobar OPENSSL_GLOBAL_REF(foobar) -*/ -#ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION -# define OPENSSL_IMPLEMENT_GLOBAL(type,name) \ - extern type _hide_##name; \ - type *_shadow_##name(void) { return &_hide_##name; } \ - static type _hide_##name -# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) -# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) -#else -# define OPENSSL_IMPLEMENT_GLOBAL(type,name) OPENSSL_GLOBAL type _shadow_##name -# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name -# define OPENSSL_GLOBAL_REF(name) _shadow_##name -#endif - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/ebcdic.h b/dep/include/openssl/ebcdic.h deleted file mode 100644 index e970f129364..00000000000 --- a/dep/include/openssl/ebcdic.h +++ /dev/null @@ -1,20 +0,0 @@ -/* crypto/ebcdic.h */ - -#ifndef HEADER_EBCDIC_H -#define HEADER_EBCDIC_H - -#include - -/* Avoid name clashes with other applications */ -#define os_toascii _openssl_os_toascii -#define os_toebcdic _openssl_os_toebcdic -#define ebcdic2ascii _openssl_ebcdic2ascii -#define ascii2ebcdic _openssl_ascii2ebcdic - -extern const unsigned char os_toascii[256]; -extern const unsigned char os_toebcdic[256]; -void *ebcdic2ascii(void *dest, const void *srce, size_t count); -void *ascii2ebcdic(void *dest, const void *srce, size_t count); - -#endif - diff --git a/dep/include/openssl/ec.h b/dep/include/openssl/ec.h deleted file mode 100644 index 8bc2a235b1a..00000000000 --- a/dep/include/openssl/ec.h +++ /dev/null @@ -1,526 +0,0 @@ -/* crypto/ec/ec.h */ -/* - * Originally written by Bodo Moeller for the OpenSSL project. - */ -/* ==================================================================== - * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. - * - */ - -#ifndef HEADER_EC_H -#define HEADER_EC_H - -#include - -#ifdef OPENSSL_NO_EC -#error EC is disabled. -#endif - -#include -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifdef __cplusplus -extern "C" { -#elif defined(__SUNPRO_C) -# if __SUNPRO_C >= 0x520 -# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) -# endif -#endif - - -#ifndef OPENSSL_ECC_MAX_FIELD_BITS -# define OPENSSL_ECC_MAX_FIELD_BITS 661 -#endif - -typedef enum { - /* values as defined in X9.62 (ECDSA) and elsewhere */ - POINT_CONVERSION_COMPRESSED = 2, - POINT_CONVERSION_UNCOMPRESSED = 4, - POINT_CONVERSION_HYBRID = 6 -} point_conversion_form_t; - - -typedef struct ec_method_st EC_METHOD; - -typedef struct ec_group_st - /* - EC_METHOD *meth; - -- field definition - -- curve coefficients - -- optional generator with associated information (order, cofactor) - -- optional extra data (precomputed table for fast computation of multiples of generator) - -- ASN1 stuff - */ - EC_GROUP; - -typedef struct ec_point_st EC_POINT; - - -/* EC_METHODs for curves over GF(p). - * EC_GFp_simple_method provides the basis for the optimized methods. - */ -const EC_METHOD *EC_GFp_simple_method(void); -const EC_METHOD *EC_GFp_mont_method(void); -const EC_METHOD *EC_GFp_nist_method(void); - -/* EC_METHOD for curves over GF(2^m). - */ -const EC_METHOD *EC_GF2m_simple_method(void); - - -EC_GROUP *EC_GROUP_new(const EC_METHOD *); -void EC_GROUP_free(EC_GROUP *); -void EC_GROUP_clear_free(EC_GROUP *); -int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *); -EC_GROUP *EC_GROUP_dup(const EC_GROUP *); - -const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *); -int EC_METHOD_get_field_type(const EC_METHOD *); - -int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); -const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *); -int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *); -int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *); - -void EC_GROUP_set_curve_name(EC_GROUP *, int nid); -int EC_GROUP_get_curve_name(const EC_GROUP *); - -void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); -int EC_GROUP_get_asn1_flag(const EC_GROUP *); - -void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t); -point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); - -unsigned char *EC_GROUP_get0_seed(const EC_GROUP *); -size_t EC_GROUP_get_seed_len(const EC_GROUP *); -size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); - -int EC_GROUP_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); -int EC_GROUP_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); -int EC_GROUP_set_curve_GF2m(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); -int EC_GROUP_get_curve_GF2m(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); - -/* returns the number of bits needed to represent a field element */ -int EC_GROUP_get_degree(const EC_GROUP *); - -/* EC_GROUP_check() returns 1 if 'group' defines a valid group, 0 otherwise */ -int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx); -/* EC_GROUP_check_discriminant() returns 1 if the discriminant of the - * elliptic curve is not zero, 0 otherwise */ -int EC_GROUP_check_discriminant(const EC_GROUP *, BN_CTX *); - -/* EC_GROUP_cmp() returns 0 if both groups are equal and 1 otherwise */ -int EC_GROUP_cmp(const EC_GROUP *, const EC_GROUP *, BN_CTX *); - -/* EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() - * after choosing an appropriate EC_METHOD */ -EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); -EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); - -/* EC_GROUP_new_by_curve_name() creates a EC_GROUP structure - * specified by a curve name (in form of a NID) */ -EC_GROUP *EC_GROUP_new_by_curve_name(int nid); -/* handling of internal curves */ -typedef struct { - int nid; - const char *comment; - } EC_builtin_curve; -/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number - * of all available curves or zero if a error occurred. - * In case r ist not zero nitems EC_builtin_curve structures - * are filled with the data of the first nitems internal groups */ -size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems); - - -/* EC_POINT functions */ - -EC_POINT *EC_POINT_new(const EC_GROUP *); -void EC_POINT_free(EC_POINT *); -void EC_POINT_clear_free(EC_POINT *); -int EC_POINT_copy(EC_POINT *, const EC_POINT *); -EC_POINT *EC_POINT_dup(const EC_POINT *, const EC_GROUP *); - -const EC_METHOD *EC_POINT_method_of(const EC_POINT *); - -int EC_POINT_set_to_infinity(const EC_GROUP *, EC_POINT *); -int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *); -int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *, - BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *); -int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, const BIGNUM *y, BN_CTX *); -int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *, - BIGNUM *x, BIGNUM *y, BN_CTX *); -int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, int y_bit, BN_CTX *); - -int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, const BIGNUM *y, BN_CTX *); -int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *, - BIGNUM *x, BIGNUM *y, BN_CTX *); -int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, int y_bit, BN_CTX *); - -size_t EC_POINT_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, - unsigned char *buf, size_t len, BN_CTX *); -int EC_POINT_oct2point(const EC_GROUP *, EC_POINT *, - const unsigned char *buf, size_t len, BN_CTX *); - -/* other interfaces to point2oct/oct2point: */ -BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *, - point_conversion_form_t form, BIGNUM *, BN_CTX *); -EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *, - EC_POINT *, BN_CTX *); -char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *, - point_conversion_form_t form, BN_CTX *); -EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, - EC_POINT *, BN_CTX *); - -int EC_POINT_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *); -int EC_POINT_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *); -int EC_POINT_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); - -int EC_POINT_is_at_infinity(const EC_GROUP *, const EC_POINT *); -int EC_POINT_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); -int EC_POINT_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); - -int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); -int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); - - -int EC_POINTs_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, size_t num, const EC_POINT *[], const BIGNUM *[], BN_CTX *); -int EC_POINT_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, const EC_POINT *, const BIGNUM *, BN_CTX *); - -/* EC_GROUP_precompute_mult() stores multiples of generator for faster point multiplication */ -int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *); -/* EC_GROUP_have_precompute_mult() reports whether such precomputation has been done */ -int EC_GROUP_have_precompute_mult(const EC_GROUP *); - - - -/* ASN1 stuff */ - -/* EC_GROUP_get_basis_type() returns the NID of the basis type - * used to represent the field elements */ -int EC_GROUP_get_basis_type(const EC_GROUP *); -int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); -int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, - unsigned int *k2, unsigned int *k3); - -#define OPENSSL_EC_NAMED_CURVE 0x001 - -typedef struct ecpk_parameters_st ECPKPARAMETERS; - -EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); -int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); - -#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) -#define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) -#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \ - (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) -#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ - (unsigned char *)(x)) - -#ifndef OPENSSL_NO_BIO -int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); -#endif -#ifndef OPENSSL_NO_FP_API -int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); -#endif - -/* the EC_KEY stuff */ -typedef struct ec_key_st EC_KEY; - -/* some values for the encoding_flag */ -#define EC_PKEY_NO_PARAMETERS 0x001 -#define EC_PKEY_NO_PUBKEY 0x002 - -EC_KEY *EC_KEY_new(void); -EC_KEY *EC_KEY_new_by_curve_name(int nid); -void EC_KEY_free(EC_KEY *); -EC_KEY *EC_KEY_copy(EC_KEY *, const EC_KEY *); -EC_KEY *EC_KEY_dup(const EC_KEY *); - -int EC_KEY_up_ref(EC_KEY *); - -const EC_GROUP *EC_KEY_get0_group(const EC_KEY *); -int EC_KEY_set_group(EC_KEY *, const EC_GROUP *); -const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *); -int EC_KEY_set_private_key(EC_KEY *, const BIGNUM *); -const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *); -int EC_KEY_set_public_key(EC_KEY *, const EC_POINT *); -unsigned EC_KEY_get_enc_flags(const EC_KEY *); -void EC_KEY_set_enc_flags(EC_KEY *, unsigned int); -point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *); -void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t); -/* functions to set/get method specific data */ -void *EC_KEY_get_key_method_data(EC_KEY *, - void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); -void EC_KEY_insert_key_method_data(EC_KEY *, void *data, - void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); -/* wrapper functions for the underlying EC_GROUP object */ -void EC_KEY_set_asn1_flag(EC_KEY *, int); -int EC_KEY_precompute_mult(EC_KEY *, BN_CTX *ctx); - -/* EC_KEY_generate_key() creates a ec private (public) key */ -int EC_KEY_generate_key(EC_KEY *); -/* EC_KEY_check_key() */ -int EC_KEY_check_key(const EC_KEY *); - -/* de- and encoding functions for SEC1 ECPrivateKey */ -EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len); -int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out); -/* de- and encoding functions for EC parameters */ -EC_KEY *d2i_ECParameters(EC_KEY **a, const unsigned char **in, long len); -int i2d_ECParameters(EC_KEY *a, unsigned char **out); -/* de- and encoding functions for EC public key - * (octet string, not DER -- hence 'o2i' and 'i2o') */ -EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len); -int i2o_ECPublicKey(EC_KEY *a, unsigned char **out); - -#ifndef OPENSSL_NO_BIO -int ECParameters_print(BIO *bp, const EC_KEY *x); -int EC_KEY_print(BIO *bp, const EC_KEY *x, int off); -#endif -#ifndef OPENSSL_NO_FP_API -int ECParameters_print_fp(FILE *fp, const EC_KEY *x); -int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off); -#endif - -#define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x) - -#ifndef __cplusplus -#if defined(__SUNPRO_C) -# if __SUNPRO_C >= 0x520 -# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) -# endif -# endif -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_EC_strings(void); - -/* Error codes for the EC functions. */ - -/* Function codes. */ -#define EC_F_COMPUTE_WNAF 143 -#define EC_F_D2I_ECPARAMETERS 144 -#define EC_F_D2I_ECPKPARAMETERS 145 -#define EC_F_D2I_ECPRIVATEKEY 146 -#define EC_F_ECPARAMETERS_PRINT 147 -#define EC_F_ECPARAMETERS_PRINT_FP 148 -#define EC_F_ECPKPARAMETERS_PRINT 149 -#define EC_F_ECPKPARAMETERS_PRINT_FP 150 -#define EC_F_ECP_NIST_MOD_192 203 -#define EC_F_ECP_NIST_MOD_224 204 -#define EC_F_ECP_NIST_MOD_256 205 -#define EC_F_ECP_NIST_MOD_521 206 -#define EC_F_EC_ASN1_GROUP2CURVE 153 -#define EC_F_EC_ASN1_GROUP2FIELDID 154 -#define EC_F_EC_ASN1_GROUP2PARAMETERS 155 -#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156 -#define EC_F_EC_ASN1_PARAMETERS2GROUP 157 -#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158 -#define EC_F_EC_EX_DATA_SET_DATA 211 -#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 -#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 -#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 -#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 -#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161 -#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162 -#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163 -#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 -#define EC_F_EC_GFP_MONT_FIELD_DECODE 133 -#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 -#define EC_F_EC_GFP_MONT_FIELD_MUL 131 -#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 -#define EC_F_EC_GFP_MONT_FIELD_SQR 132 -#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 -#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 -#define EC_F_EC_GFP_NIST_FIELD_MUL 200 -#define EC_F_EC_GFP_NIST_FIELD_SQR 201 -#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 -#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 -#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 -#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100 -#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101 -#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 -#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103 -#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104 -#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137 -#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167 -#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105 -#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168 -#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128 -#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169 -#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129 -#define EC_F_EC_GROUP_CHECK 170 -#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171 -#define EC_F_EC_GROUP_COPY 106 -#define EC_F_EC_GROUP_GET0_GENERATOR 139 -#define EC_F_EC_GROUP_GET_COFACTOR 140 -#define EC_F_EC_GROUP_GET_CURVE_GF2M 172 -#define EC_F_EC_GROUP_GET_CURVE_GFP 130 -#define EC_F_EC_GROUP_GET_DEGREE 173 -#define EC_F_EC_GROUP_GET_ORDER 141 -#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193 -#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194 -#define EC_F_EC_GROUP_NEW 108 -#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174 -#define EC_F_EC_GROUP_NEW_FROM_DATA 175 -#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142 -#define EC_F_EC_GROUP_SET_CURVE_GF2M 176 -#define EC_F_EC_GROUP_SET_CURVE_GFP 109 -#define EC_F_EC_GROUP_SET_EXTRA_DATA 110 -#define EC_F_EC_GROUP_SET_GENERATOR 111 -#define EC_F_EC_KEY_CHECK_KEY 177 -#define EC_F_EC_KEY_COPY 178 -#define EC_F_EC_KEY_GENERATE_KEY 179 -#define EC_F_EC_KEY_NEW 182 -#define EC_F_EC_KEY_PRINT 180 -#define EC_F_EC_KEY_PRINT_FP 181 -#define EC_F_EC_POINTS_MAKE_AFFINE 136 -#define EC_F_EC_POINTS_MUL 138 -#define EC_F_EC_POINT_ADD 112 -#define EC_F_EC_POINT_CMP 113 -#define EC_F_EC_POINT_COPY 114 -#define EC_F_EC_POINT_DBL 115 -#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183 -#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116 -#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117 -#define EC_F_EC_POINT_INVERT 210 -#define EC_F_EC_POINT_IS_AT_INFINITY 118 -#define EC_F_EC_POINT_IS_ON_CURVE 119 -#define EC_F_EC_POINT_MAKE_AFFINE 120 -#define EC_F_EC_POINT_MUL 184 -#define EC_F_EC_POINT_NEW 121 -#define EC_F_EC_POINT_OCT2POINT 122 -#define EC_F_EC_POINT_POINT2OCT 123 -#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185 -#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124 -#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186 -#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125 -#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 -#define EC_F_EC_POINT_SET_TO_INFINITY 127 -#define EC_F_EC_PRE_COMP_DUP 207 -#define EC_F_EC_PRE_COMP_NEW 196 -#define EC_F_EC_WNAF_MUL 187 -#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188 -#define EC_F_I2D_ECPARAMETERS 190 -#define EC_F_I2D_ECPKPARAMETERS 191 -#define EC_F_I2D_ECPRIVATEKEY 192 -#define EC_F_I2O_ECPUBLICKEY 151 -#define EC_F_O2I_ECPUBLICKEY 152 - -/* Reason codes. */ -#define EC_R_ASN1_ERROR 115 -#define EC_R_ASN1_UNKNOWN_FIELD 116 -#define EC_R_BUFFER_TOO_SMALL 100 -#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 -#define EC_R_DISCRIMINANT_IS_ZERO 118 -#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 -#define EC_R_FIELD_TOO_LARGE 138 -#define EC_R_GROUP2PKPARAMETERS_FAILURE 120 -#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 -#define EC_R_INCOMPATIBLE_OBJECTS 101 -#define EC_R_INVALID_ARGUMENT 112 -#define EC_R_INVALID_COMPRESSED_POINT 110 -#define EC_R_INVALID_COMPRESSION_BIT 109 -#define EC_R_INVALID_ENCODING 102 -#define EC_R_INVALID_FIELD 103 -#define EC_R_INVALID_FORM 104 -#define EC_R_INVALID_GROUP_ORDER 122 -#define EC_R_INVALID_PENTANOMIAL_BASIS 132 -#define EC_R_INVALID_PRIVATE_KEY 123 -#define EC_R_INVALID_TRINOMIAL_BASIS 137 -#define EC_R_MISSING_PARAMETERS 124 -#define EC_R_MISSING_PRIVATE_KEY 125 -#define EC_R_NOT_A_NIST_PRIME 135 -#define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136 -#define EC_R_NOT_IMPLEMENTED 126 -#define EC_R_NOT_INITIALIZED 111 -#define EC_R_NO_FIELD_MOD 133 -#define EC_R_PASSED_NULL_PARAMETER 134 -#define EC_R_PKPARAMETERS2GROUP_FAILURE 127 -#define EC_R_POINT_AT_INFINITY 106 -#define EC_R_POINT_IS_NOT_ON_CURVE 107 -#define EC_R_SLOT_FULL 108 -#define EC_R_UNDEFINED_GENERATOR 113 -#define EC_R_UNDEFINED_ORDER 128 -#define EC_R_UNKNOWN_GROUP 129 -#define EC_R_UNKNOWN_ORDER 114 -#define EC_R_UNSUPPORTED_FIELD 131 -#define EC_R_WRONG_ORDER 130 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/ecdh.h b/dep/include/openssl/ecdh.h deleted file mode 100644 index ee07aa05036..00000000000 --- a/dep/include/openssl/ecdh.h +++ /dev/null @@ -1,124 +0,0 @@ -/* crypto/ecdh/ecdh.h */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * The Elliptic Curve Public-Key Crypto Library (ECC Code) included - * herein is developed by SUN MICROSYSTEMS, INC., and is contributed - * to the OpenSSL project. - * - * The ECC Code is licensed pursuant to the OpenSSL open source - * license provided below. - * - * The ECDH software is originally written by Douglas Stebila of - * Sun Microsystems Laboratories. - * - */ -/* ==================================================================== - * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ECDH_H -#define HEADER_ECDH_H - -#include - -#ifdef OPENSSL_NO_ECDH -#error ECDH is disabled. -#endif - -#include -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -const ECDH_METHOD *ECDH_OpenSSL(void); - -void ECDH_set_default_method(const ECDH_METHOD *); -const ECDH_METHOD *ECDH_get_default_method(void); -int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); - -int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, - void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); - -int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new - *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); -void *ECDH_get_ex_data(EC_KEY *d, int idx); - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ECDH_strings(void); - -/* Error codes for the ECDH functions. */ - -/* Function codes. */ -#define ECDH_F_ECDH_COMPUTE_KEY 100 -#define ECDH_F_ECDH_DATA_NEW_METHOD 101 - -/* Reason codes. */ -#define ECDH_R_KDF_FAILED 102 -#define ECDH_R_NO_PRIVATE_VALUE 100 -#define ECDH_R_POINT_ARITHMETIC_FAILURE 101 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/ecdsa.h b/dep/include/openssl/ecdsa.h deleted file mode 100644 index 1f85df7fa2a..00000000000 --- a/dep/include/openssl/ecdsa.h +++ /dev/null @@ -1,272 +0,0 @@ -/* crypto/ecdsa/ecdsa.h */ -/** - * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions - * \author Written by Nils Larsch for the OpenSSL project - */ -/* ==================================================================== - * Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ECDSA_H -#define HEADER_ECDSA_H - -#include - -#ifdef OPENSSL_NO_ECDSA -#error ECDSA is disabled. -#endif - -#include -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ECDSA_SIG_st - { - BIGNUM *r; - BIGNUM *s; - } ECDSA_SIG; - -/** ECDSA_SIG *ECDSA_SIG_new(void) - * allocates and initialize a ECDSA_SIG structure - * \return pointer to a ECDSA_SIG structure or NULL if an error occurred - */ -ECDSA_SIG *ECDSA_SIG_new(void); - -/** ECDSA_SIG_free - * frees a ECDSA_SIG structure - * \param a pointer to the ECDSA_SIG structure - */ -void ECDSA_SIG_free(ECDSA_SIG *a); - -/** i2d_ECDSA_SIG - * DER encode content of ECDSA_SIG object (note: this function modifies *pp - * (*pp += length of the DER encoded signature)). - * \param a pointer to the ECDSA_SIG object - * \param pp pointer to a unsigned char pointer for the output or NULL - * \return the length of the DER encoded ECDSA_SIG object or 0 - */ -int i2d_ECDSA_SIG(const ECDSA_SIG *a, unsigned char **pp); - -/** d2i_ECDSA_SIG - * decodes a DER encoded ECDSA signature (note: this function changes *pp - * (*pp += len)). - * \param v pointer to ECDSA_SIG pointer (may be NULL) - * \param pp buffer with the DER encoded signature - * \param len bufferlength - * \return pointer to the decoded ECDSA_SIG structure (or NULL) - */ -ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **v, const unsigned char **pp, long len); - -/** ECDSA_do_sign - * computes the ECDSA signature of the given hash value using - * the supplied private key and returns the created signature. - * \param dgst pointer to the hash value - * \param dgst_len length of the hash value - * \param eckey pointer to the EC_KEY object containing a private EC key - * \return pointer to a ECDSA_SIG structure or NULL - */ -ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,int dgst_len,EC_KEY *eckey); - -/** ECDSA_do_sign_ex - * computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param kinv optional pointer to a pre-computed inverse k - * \param rp optional pointer to the pre-computed rp value (see - * ECDSA_sign_setup - * \param eckey pointer to the EC_KEY object containing a private EC key - * \return pointer to a ECDSA_SIG structure or NULL - */ -ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, - const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); - -/** ECDSA_do_verify - * verifies that the supplied signature is a valid ECDSA - * signature of the supplied hash value using the supplied public key. - * \param dgst pointer to the hash value - * \param dgst_len length of the hash value - * \param sig pointer to the ECDSA_SIG structure - * \param eckey pointer to the EC_KEY object containing a public EC key - * \return 1 if the signature is valid, 0 if the signature is invalid and -1 on error - */ -int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, - const ECDSA_SIG *sig, EC_KEY* eckey); - -const ECDSA_METHOD *ECDSA_OpenSSL(void); - -/** ECDSA_set_default_method - * sets the default ECDSA method - * \param meth the new default ECDSA_METHOD - */ -void ECDSA_set_default_method(const ECDSA_METHOD *meth); - -/** ECDSA_get_default_method - * returns the default ECDSA method - * \return pointer to ECDSA_METHOD structure containing the default method - */ -const ECDSA_METHOD *ECDSA_get_default_method(void); - -/** ECDSA_set_method - * sets method to be used for the ECDSA operations - * \param eckey pointer to the EC_KEY object - * \param meth pointer to the new method - * \return 1 on success and 0 otherwise - */ -int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth); - -/** ECDSA_size - * returns the maximum length of the DER encoded signature - * \param eckey pointer to a EC_KEY object - * \return numbers of bytes required for the DER encoded signature - */ -int ECDSA_size(const EC_KEY *eckey); - -/** ECDSA_sign_setup - * precompute parts of the signing operation. - * \param eckey pointer to the EC_KEY object containing a private EC key - * \param ctx pointer to a BN_CTX object (may be NULL) - * \param kinv pointer to a BIGNUM pointer for the inverse of k - * \param rp pointer to a BIGNUM pointer for x coordinate of k * generator - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, - BIGNUM **rp); - -/** ECDSA_sign - * computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param type this parameter is ignored - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param sig buffer to hold the DER encoded signature - * \param siglen pointer to the length of the returned signature - * \param eckey pointer to the EC_KEY object containing a private EC key - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, - unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); - - -/** ECDSA_sign_ex - * computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param type this parameter is ignored - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param sig buffer to hold the DER encoded signature - * \param siglen pointer to the length of the returned signature - * \param kinv optional pointer to a pre-computed inverse k - * \param rp optional pointer to the pre-computed rp value (see - * ECDSA_sign_setup - * \param eckey pointer to the EC_KEY object containing a private EC key - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen, - unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, - const BIGNUM *rp, EC_KEY *eckey); - -/** ECDSA_verify - * verifies that the given signature is valid ECDSA signature - * of the supplied hash value using the specified public key. - * \param type this parameter is ignored - * \param dgst pointer to the hash value - * \param dgstlen length of the hash value - * \param sig pointer to the DER encoded signature - * \param siglen length of the DER encoded signature - * \param eckey pointer to the EC_KEY object containing a public EC key - * \return 1 if the signature is valid, 0 if the signature is invalid and -1 on error - */ -int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, - const unsigned char *sig, int siglen, EC_KEY *eckey); - -/* the standard ex_data functions */ -int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new - *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); -void *ECDSA_get_ex_data(EC_KEY *d, int idx); - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ECDSA_strings(void); - -/* Error codes for the ECDSA functions. */ - -/* Function codes. */ -#define ECDSA_F_ECDSA_DATA_NEW_METHOD 100 -#define ECDSA_F_ECDSA_DO_SIGN 101 -#define ECDSA_F_ECDSA_DO_VERIFY 102 -#define ECDSA_F_ECDSA_SIGN_SETUP 103 - -/* Reason codes. */ -#define ECDSA_R_BAD_SIGNATURE 100 -#define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101 -#define ECDSA_R_ERR_EC_LIB 102 -#define ECDSA_R_MISSING_PARAMETERS 103 -#define ECDSA_R_NEED_NEW_SETUP_VALUES 106 -#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104 -#define ECDSA_R_SIGNATURE_MALLOC_FAILED 105 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/engine.h b/dep/include/openssl/engine.h deleted file mode 100644 index f503595eceb..00000000000 --- a/dep/include/openssl/engine.h +++ /dev/null @@ -1,801 +0,0 @@ -/* openssl/engine.h */ -/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL - * project 2000. - */ -/* ==================================================================== - * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_ENGINE_H -#define HEADER_ENGINE_H - -#include - -#ifdef OPENSSL_NO_ENGINE -#error ENGINE is disabled. -#endif - -#ifndef OPENSSL_NO_DEPRECATED -#include -#ifndef OPENSSL_NO_RSA -#include -#endif -#ifndef OPENSSL_NO_DSA -#include -#endif -#ifndef OPENSSL_NO_DH -#include -#endif -#ifndef OPENSSL_NO_ECDH -#include -#endif -#ifndef OPENSSL_NO_ECDSA -#include -#endif -#include -#include -#include -#include -#endif - -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* These flags are used to control combinations of algorithm (methods) - * by bitwise "OR"ing. */ -#define ENGINE_METHOD_RSA (unsigned int)0x0001 -#define ENGINE_METHOD_DSA (unsigned int)0x0002 -#define ENGINE_METHOD_DH (unsigned int)0x0004 -#define ENGINE_METHOD_RAND (unsigned int)0x0008 -#define ENGINE_METHOD_ECDH (unsigned int)0x0010 -#define ENGINE_METHOD_ECDSA (unsigned int)0x0020 -#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 -#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 -#define ENGINE_METHOD_STORE (unsigned int)0x0100 -/* Obvious all-or-nothing cases. */ -#define ENGINE_METHOD_ALL (unsigned int)0xFFFF -#define ENGINE_METHOD_NONE (unsigned int)0x0000 - -/* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used - * internally to control registration of ENGINE implementations, and can be set - * by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to - * initialise registered ENGINEs if they are not already initialised. */ -#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 - -/* ENGINE flags that can be set by ENGINE_set_flags(). */ -/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ /* Not used */ - -/* This flag is for ENGINEs that wish to handle the various 'CMD'-related - * control commands on their own. Without this flag, ENGINE_ctrl() handles these - * control commands on behalf of the ENGINE using their "cmd_defns" data. */ -#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002 - -/* This flag is for ENGINEs who return new duplicate structures when found via - * "ENGINE_by_id()". When an ENGINE must store state (eg. if ENGINE_ctrl() - * commands are called in sequence as part of some stateful process like - * key-generation setup and execution), it can set this flag - then each attempt - * to obtain the ENGINE will result in it being copied into a new structure. - * Normally, ENGINEs don't declare this flag so ENGINE_by_id() just increments - * the existing ENGINE's structural reference count. */ -#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 - -/* ENGINEs can support their own command types, and these flags are used in - * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each - * command expects. Currently only numeric and string input is supported. If a - * control command supports none of the _NUMERIC, _STRING, or _NO_INPUT options, - * then it is regarded as an "internal" control command - and not for use in - * config setting situations. As such, they're not available to the - * ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() access. Changes to - * this list of 'command types' should be reflected carefully in - * ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). */ - -/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ -#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 -/* accepts string input (cast from 'void*' to 'const char *', 4th parameter to - * ENGINE_ctrl) */ -#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 -/* Indicates that the control command takes *no* input. Ie. the control command - * is unparameterised. */ -#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 -/* Indicates that the control command is internal. This control command won't - * be shown in any output, and is only usable through the ENGINE_ctrl_cmd() - * function. */ -#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 - -/* NB: These 3 control commands are deprecated and should not be used. ENGINEs - * relying on these commands should compile conditional support for - * compatibility (eg. if these symbols are defined) but should also migrate the - * same functionality to their own ENGINE-specific control functions that can be - * "discovered" by calling applications. The fact these control commands - * wouldn't be "executable" (ie. usable by text-based config) doesn't change the - * fact that application code can find and use them without requiring per-ENGINE - * hacking. */ - -/* These flags are used to tell the ctrl function what should be done. - * All command numbers are shared between all engines, even if some don't - * make sense to some engines. In such a case, they do nothing but return - * the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */ -#define ENGINE_CTRL_SET_LOGSTREAM 1 -#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2 -#define ENGINE_CTRL_HUP 3 /* Close and reinitialise any - handles/connections etc. */ -#define ENGINE_CTRL_SET_USER_INTERFACE 4 /* Alternative to callback */ -#define ENGINE_CTRL_SET_CALLBACK_DATA 5 /* User-specific data, used - when calling the password - callback and the user - interface */ -#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, given - a string that represents a - file name or so */ -#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given - section in the already loaded - configuration */ - -/* These control commands allow an application to deal with an arbitrary engine - * in a dynamic way. Warn: Negative return values indicate errors FOR THESE - * COMMANDS because zero is used to indicate 'end-of-list'. Other commands, - * including ENGINE-specific command types, return zero for an error. - * - * An ENGINE can choose to implement these ctrl functions, and can internally - * manage things however it chooses - it does so by setting the - * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise the - * ENGINE_ctrl() code handles this on the ENGINE's behalf using the cmd_defns - * data (set using ENGINE_set_cmd_defns()). This means an ENGINE's ctrl() - * handler need only implement its own commands - the above "meta" commands will - * be taken care of. */ - -/* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then - * all the remaining control commands will return failure, so it is worth - * checking this first if the caller is trying to "discover" the engine's - * capabilities and doesn't want errors generated unnecessarily. */ -#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10 -/* Returns a positive command number for the first command supported by the - * engine. Returns zero if no ctrl commands are supported. */ -#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 -/* The 'long' argument specifies a command implemented by the engine, and the - * return value is the next command supported, or zero if there are no more. */ -#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 -/* The 'void*' argument is a command name (cast from 'const char *'), and the - * return value is the command that corresponds to it. */ -#define ENGINE_CTRL_GET_CMD_FROM_NAME 13 -/* The next two allow a command to be converted into its corresponding string - * form. In each case, the 'long' argument supplies the command. In the NAME_LEN - * case, the return value is the length of the command name (not counting a - * trailing EOL). In the NAME case, the 'void*' argument must be a string buffer - * large enough, and it will be populated with the name of the command (WITH a - * trailing EOL). */ -#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 -#define ENGINE_CTRL_GET_NAME_FROM_CMD 15 -/* The next two are similar but give a "short description" of a command. */ -#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 -#define ENGINE_CTRL_GET_DESC_FROM_CMD 17 -/* With this command, the return value is the OR'd combination of - * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given - * engine-specific ctrl command expects. */ -#define ENGINE_CTRL_GET_CMD_FLAGS 18 - -/* ENGINE implementations should start the numbering of their own control - * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ -#define ENGINE_CMD_BASE 200 - -/* NB: These 2 nCipher "chil" control commands are deprecated, and their - * functionality is now available through ENGINE-specific control commands - * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 - * commands should be migrated to the more general command handling before these - * are removed. */ - -/* Flags specific to the nCipher "chil" engine */ -#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100 - /* Depending on the value of the (long)i argument, this sets or - * unsets the SimpleForkCheck flag in the CHIL API to enable or - * disable checking and workarounds for applications that fork(). - */ -#define ENGINE_CTRL_CHIL_NO_LOCKING 101 - /* This prevents the initialisation function from providing mutex - * callbacks to the nCipher library. */ - -/* If an ENGINE supports its own specific control commands and wishes the - * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its - * behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN entries - * to ENGINE_set_cmd_defns(). It should also implement a ctrl() handler that - * supports the stated commands (ie. the "cmd_num" entries as described by the - * array). NB: The array must be ordered in increasing order of cmd_num. - * "null-terminated" means that the last ENGINE_CMD_DEFN element has cmd_num set - * to zero and/or cmd_name set to NULL. */ -typedef struct ENGINE_CMD_DEFN_st - { - unsigned int cmd_num; /* The command number */ - const char *cmd_name; /* The command name itself */ - const char *cmd_desc; /* A short description of the command */ - unsigned int cmd_flags; /* The input the command expects */ - } ENGINE_CMD_DEFN; - -/* Generic function pointer */ -typedef int (*ENGINE_GEN_FUNC_PTR)(void); -/* Generic function pointer taking no arguments */ -typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); -/* Specific control function pointer */ -typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void)); -/* Generic load_key function pointer */ -typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, - UI_METHOD *ui_method, void *callback_data); -typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, - STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey, - STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data); -/* These callback types are for an ENGINE's handler for cipher and digest logic. - * These handlers have these prototypes; - * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); - * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); - * Looking at how to implement these handlers in the case of cipher support, if - * the framework wants the EVP_CIPHER for 'nid', it will call; - * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) - * If the framework wants a list of supported 'nid's, it will call; - * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) - */ -/* Returns to a pointer to the array of supported cipher 'nid's. If the second - * parameter is non-NULL it is set to the size of the returned array. */ -typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, int); -typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); - -/* STRUCTURE functions ... all of these functions deal with pointers to ENGINE - * structures where the pointers have a "structural reference". This means that - * their reference is to allowed access to the structure but it does not imply - * that the structure is functional. To simply increment or decrement the - * structural reference count, use ENGINE_by_id and ENGINE_free. NB: This is not - * required when iterating using ENGINE_get_next as it will automatically - * decrement the structural reference count of the "current" ENGINE and - * increment the structural reference count of the ENGINE it returns (unless it - * is NULL). */ - -/* Get the first/last "ENGINE" type available. */ -ENGINE *ENGINE_get_first(void); -ENGINE *ENGINE_get_last(void); -/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */ -ENGINE *ENGINE_get_next(ENGINE *e); -ENGINE *ENGINE_get_prev(ENGINE *e); -/* Add another "ENGINE" type into the array. */ -int ENGINE_add(ENGINE *e); -/* Remove an existing "ENGINE" type from the array. */ -int ENGINE_remove(ENGINE *e); -/* Retrieve an engine from the list by its unique "id" value. */ -ENGINE *ENGINE_by_id(const char *id); -/* Add all the built-in engines. */ -void ENGINE_load_openssl(void); -void ENGINE_load_dynamic(void); -#ifndef OPENSSL_NO_STATIC_ENGINE -void ENGINE_load_4758cca(void); -void ENGINE_load_aep(void); -void ENGINE_load_atalla(void); -void ENGINE_load_chil(void); -void ENGINE_load_cswift(void); -#ifndef OPENSSL_NO_GMP -void ENGINE_load_gmp(void); -#endif -void ENGINE_load_nuron(void); -void ENGINE_load_sureware(void); -void ENGINE_load_ubsec(void); -#endif -void ENGINE_load_cryptodev(void); -void ENGINE_load_padlock(void); -void ENGINE_load_builtin_engines(void); -#ifndef OPENSSL_NO_CAPIENG -void ENGINE_load_capi(void); -#endif - -/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation - * "registry" handling. */ -unsigned int ENGINE_get_table_flags(void); -void ENGINE_set_table_flags(unsigned int flags); - -/* Manage registration of ENGINEs per "table". For each type, there are 3 - * functions; - * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) - * ENGINE_unregister_***(e) - unregister the implementation from 'e' - * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list - * Cleanup is automatically registered from each table when required, so - * ENGINE_cleanup() will reverse any "register" operations. */ - -int ENGINE_register_RSA(ENGINE *e); -void ENGINE_unregister_RSA(ENGINE *e); -void ENGINE_register_all_RSA(void); - -int ENGINE_register_DSA(ENGINE *e); -void ENGINE_unregister_DSA(ENGINE *e); -void ENGINE_register_all_DSA(void); - -int ENGINE_register_ECDH(ENGINE *e); -void ENGINE_unregister_ECDH(ENGINE *e); -void ENGINE_register_all_ECDH(void); - -int ENGINE_register_ECDSA(ENGINE *e); -void ENGINE_unregister_ECDSA(ENGINE *e); -void ENGINE_register_all_ECDSA(void); - -int ENGINE_register_DH(ENGINE *e); -void ENGINE_unregister_DH(ENGINE *e); -void ENGINE_register_all_DH(void); - -int ENGINE_register_RAND(ENGINE *e); -void ENGINE_unregister_RAND(ENGINE *e); -void ENGINE_register_all_RAND(void); - -int ENGINE_register_STORE(ENGINE *e); -void ENGINE_unregister_STORE(ENGINE *e); -void ENGINE_register_all_STORE(void); - -int ENGINE_register_ciphers(ENGINE *e); -void ENGINE_unregister_ciphers(ENGINE *e); -void ENGINE_register_all_ciphers(void); - -int ENGINE_register_digests(ENGINE *e); -void ENGINE_unregister_digests(ENGINE *e); -void ENGINE_register_all_digests(void); - -/* These functions register all support from the above categories. Note, use of - * these functions can result in static linkage of code your application may not - * need. If you only need a subset of functionality, consider using more - * selective initialisation. */ -int ENGINE_register_complete(ENGINE *e); -int ENGINE_register_all_complete(void); - -/* Send parametrised control commands to the engine. The possibilities to send - * down an integer, a pointer to data or a function pointer are provided. Any of - * the parameters may or may not be NULL, depending on the command number. In - * actuality, this function only requires a structural (rather than functional) - * reference to an engine, but many control commands may require the engine be - * functional. The caller should be aware of trying commands that require an - * operational ENGINE, and only use functional references in such situations. */ -int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)); - -/* This function tests if an ENGINE-specific command is usable as a "setting". - * Eg. in an application's config file that gets processed through - * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to - * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). */ -int ENGINE_cmd_is_executable(ENGINE *e, int cmd); - -/* This function works like ENGINE_ctrl() with the exception of taking a - * command name instead of a command number, and can handle optional commands. - * See the comment on ENGINE_ctrl_cmd_string() for an explanation on how to - * use the cmd_name and cmd_optional. */ -int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, - long i, void *p, void (*f)(void), int cmd_optional); - -/* This function passes a command-name and argument to an ENGINE. The cmd_name - * is converted to a command number and the control command is called using - * 'arg' as an argument (unless the ENGINE doesn't support such a command, in - * which case no control command is called). The command is checked for input - * flags, and if necessary the argument will be converted to a numeric value. If - * cmd_optional is non-zero, then if the ENGINE doesn't support the given - * cmd_name the return value will be success anyway. This function is intended - * for applications to use so that users (or config files) can supply - * engine-specific config data to the ENGINE at run-time to control behaviour of - * specific engines. As such, it shouldn't be used for calling ENGINE_ctrl() - * functions that return data, deal with binary data, or that are otherwise - * supposed to be used directly through ENGINE_ctrl() in application code. Any - * "return" data from an ENGINE_ctrl() operation in this function will be lost - - * the return value is interpreted as failure if the return value is zero, - * success otherwise, and this function returns a boolean value as a result. In - * other words, vendors of 'ENGINE'-enabled devices should write ENGINE - * implementations with parameterisations that work in this scheme, so that - * compliant ENGINE-based applications can work consistently with the same - * configuration for the same ENGINE-enabled devices, across applications. */ -int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, - int cmd_optional); - -/* These functions are useful for manufacturing new ENGINE structures. They - * don't address reference counting at all - one uses them to populate an ENGINE - * structure with personalised implementations of things prior to using it - * directly or adding it to the builtin ENGINE list in OpenSSL. These are also - * here so that the ENGINE structure doesn't have to be exposed and break binary - * compatibility! */ -ENGINE *ENGINE_new(void); -int ENGINE_free(ENGINE *e); -int ENGINE_up_ref(ENGINE *e); -int ENGINE_set_id(ENGINE *e, const char *id); -int ENGINE_set_name(ENGINE *e, const char *name); -int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); -int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); -int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth); -int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth); -int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); -int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); -int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth); -int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); -int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); -int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); -int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); -int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); -int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); -int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, - ENGINE_SSL_CLIENT_CERT_PTR loadssl_f); -int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); -int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); -int ENGINE_set_flags(ENGINE *e, int flags); -int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); -/* These functions allow control over any per-structure ENGINE data. */ -int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); -void *ENGINE_get_ex_data(const ENGINE *e, int idx); - -/* This function cleans up anything that needs it. Eg. the ENGINE_add() function - * automatically ensures the list cleanup function is registered to be called - * from ENGINE_cleanup(). Similarly, all ENGINE_register_*** functions ensure - * ENGINE_cleanup() will clean up after them. */ -void ENGINE_cleanup(void); - -/* These return values from within the ENGINE structure. These can be useful - * with functional references as well as structural references - it depends - * which you obtained. Using the result for functional purposes if you only - * obtained a structural reference may be problematic! */ -const char *ENGINE_get_id(const ENGINE *e); -const char *ENGINE_get_name(const ENGINE *e); -const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); -const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); -const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e); -const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e); -const DH_METHOD *ENGINE_get_DH(const ENGINE *e); -const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); -const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); -ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); -ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); -ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); -ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e); -ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); -ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); -const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); -const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); -const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); -int ENGINE_get_flags(const ENGINE *e); - -/* FUNCTIONAL functions. These functions deal with ENGINE structures - * that have (or will) be initialised for use. Broadly speaking, the - * structural functions are useful for iterating the list of available - * engine types, creating new engine types, and other "list" operations. - * These functions actually deal with ENGINEs that are to be used. As - * such these functions can fail (if applicable) when particular - * engines are unavailable - eg. if a hardware accelerator is not - * attached or not functioning correctly. Each ENGINE has 2 reference - * counts; structural and functional. Every time a functional reference - * is obtained or released, a corresponding structural reference is - * automatically obtained or released too. */ - -/* Initialise a engine type for use (or up its reference count if it's - * already in use). This will fail if the engine is not currently - * operational and cannot initialise. */ -int ENGINE_init(ENGINE *e); -/* Free a functional reference to a engine type. This does not require - * a corresponding call to ENGINE_free as it also releases a structural - * reference. */ -int ENGINE_finish(ENGINE *e); - -/* The following functions handle keys that are stored in some secondary - * location, handled by the engine. The storage may be on a card or - * whatever. */ -EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); -EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); -int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, - STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey, - STACK_OF(X509) **pother, - UI_METHOD *ui_method, void *callback_data); - -/* This returns a pointer for the current ENGINE structure that - * is (by default) performing any RSA operations. The value returned - * is an incremented reference, so it should be free'd (ENGINE_finish) - * before it is discarded. */ -ENGINE *ENGINE_get_default_RSA(void); -/* Same for the other "methods" */ -ENGINE *ENGINE_get_default_DSA(void); -ENGINE *ENGINE_get_default_ECDH(void); -ENGINE *ENGINE_get_default_ECDSA(void); -ENGINE *ENGINE_get_default_DH(void); -ENGINE *ENGINE_get_default_RAND(void); -/* These functions can be used to get a functional reference to perform - * ciphering or digesting corresponding to "nid". */ -ENGINE *ENGINE_get_cipher_engine(int nid); -ENGINE *ENGINE_get_digest_engine(int nid); - -/* This sets a new default ENGINE structure for performing RSA - * operations. If the result is non-zero (success) then the ENGINE - * structure will have had its reference count up'd so the caller - * should still free their own reference 'e'. */ -int ENGINE_set_default_RSA(ENGINE *e); -int ENGINE_set_default_string(ENGINE *e, const char *def_list); -/* Same for the other "methods" */ -int ENGINE_set_default_DSA(ENGINE *e); -int ENGINE_set_default_ECDH(ENGINE *e); -int ENGINE_set_default_ECDSA(ENGINE *e); -int ENGINE_set_default_DH(ENGINE *e); -int ENGINE_set_default_RAND(ENGINE *e); -int ENGINE_set_default_ciphers(ENGINE *e); -int ENGINE_set_default_digests(ENGINE *e); - -/* The combination "set" - the flags are bitwise "OR"d from the - * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" - * function, this function can result in unnecessary static linkage. If your - * application requires only specific functionality, consider using more - * selective functions. */ -int ENGINE_set_default(ENGINE *e, unsigned int flags); - -void ENGINE_add_conf_module(void); - -/* Deprecated functions ... */ -/* int ENGINE_clear_defaults(void); */ - -/**************************/ -/* DYNAMIC ENGINE SUPPORT */ -/**************************/ - -/* Binary/behaviour compatibility levels */ -#define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000 -/* Binary versions older than this are too old for us (whether we're a loader or - * a loadee) */ -#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000 - -/* When compiling an ENGINE entirely as an external shared library, loadable by - * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure - * type provides the calling application's (or library's) error functionality - * and memory management function pointers to the loaded library. These should - * be used/set in the loaded library code so that the loading application's - * 'state' will be used/changed in all operations. The 'static_state' pointer - * allows the loaded library to know if it shares the same static data as the - * calling application (or library), and thus whether these callbacks need to be - * set or not. */ -typedef void *(*dyn_MEM_malloc_cb)(size_t); -typedef void *(*dyn_MEM_realloc_cb)(void *, size_t); -typedef void (*dyn_MEM_free_cb)(void *); -typedef struct st_dynamic_MEM_fns { - dyn_MEM_malloc_cb malloc_cb; - dyn_MEM_realloc_cb realloc_cb; - dyn_MEM_free_cb free_cb; - } dynamic_MEM_fns; -/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use - * these types so we (and any other dependant code) can simplify a bit?? */ -typedef void (*dyn_lock_locking_cb)(int,int,const char *,int); -typedef int (*dyn_lock_add_lock_cb)(int*,int,int,const char *,int); -typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( - const char *,int); -typedef void (*dyn_dynlock_lock_cb)(int,struct CRYPTO_dynlock_value *, - const char *,int); -typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *, - const char *,int); -typedef struct st_dynamic_LOCK_fns { - dyn_lock_locking_cb lock_locking_cb; - dyn_lock_add_lock_cb lock_add_lock_cb; - dyn_dynlock_create_cb dynlock_create_cb; - dyn_dynlock_lock_cb dynlock_lock_cb; - dyn_dynlock_destroy_cb dynlock_destroy_cb; - } dynamic_LOCK_fns; -/* The top-level structure */ -typedef struct st_dynamic_fns { - void *static_state; - const ERR_FNS *err_fns; - const CRYPTO_EX_DATA_IMPL *ex_data_fns; - dynamic_MEM_fns mem_fns; - dynamic_LOCK_fns lock_fns; - } dynamic_fns; - -/* The version checking function should be of this prototype. NB: The - * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code. - * If this function returns zero, it indicates a (potential) version - * incompatibility and the loaded library doesn't believe it can proceed. - * Otherwise, the returned value is the (latest) version supported by the - * loading library. The loader may still decide that the loaded code's version - * is unsatisfactory and could veto the load. The function is expected to - * be implemented with the symbol name "v_check", and a default implementation - * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ -typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); -#define IMPLEMENT_DYNAMIC_CHECK_FN() \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ - if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ - return 0; } - -/* This function is passed the ENGINE structure to initialise with its own - * function and command settings. It should not adjust the structural or - * functional reference counts. If this function returns zero, (a) the load will - * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the - * structure, and (c) the shared library will be unloaded. So implementations - * should do their own internal cleanup in failure circumstances otherwise they - * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that - * the loader is looking for. If this is NULL, the shared library can choose to - * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared - * library must initialise only an ENGINE matching the passed 'id'. The function - * is expected to be implemented with the symbol name "bind_engine". A standard - * implementation can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where - * the parameter 'fn' is a callback function that populates the ENGINE structure - * and returns an int value (zero for failure). 'fn' should have prototype; - * [static] int fn(ENGINE *e, const char *id); */ -typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, - const dynamic_fns *fns); -#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ - OPENSSL_EXPORT \ - int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ - if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ - if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ - fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ - return 0; \ - CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ - CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ - CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ - CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ - CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ - if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ - return 0; \ - if(!ERR_set_implementation(fns->err_fns)) return 0; \ - skip_cbs: \ - if(!fn(e,id)) return 0; \ - return 1; } - -/* If the loading application (or library) and the loaded ENGINE library share - * the same static data (eg. they're both dynamically linked to the same - * libcrypto.so) we need a way to avoid trying to set system callbacks - this - * would fail, and for the same reason that it's unnecessary to try. If the - * loaded ENGINE has (or gets from through the loader) its own copy of the - * libcrypto static data, we will need to set the callbacks. The easiest way to - * detect this is to have a function that returns a pointer to some static data - * and let the loading application and loaded ENGINE compare their respective - * values. */ -void *ENGINE_get_static_state(void); - -#if defined(__OpenBSD__) || defined(__FreeBSD__) -void ENGINE_setup_bsd_cryptodev(void); -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ENGINE_strings(void); - -/* Error codes for the ENGINE functions. */ - -/* Function codes. */ -#define ENGINE_F_DYNAMIC_CTRL 180 -#define ENGINE_F_DYNAMIC_GET_DATA_CTX 181 -#define ENGINE_F_DYNAMIC_LOAD 182 -#define ENGINE_F_DYNAMIC_SET_DATA_CTX 183 -#define ENGINE_F_ENGINE_ADD 105 -#define ENGINE_F_ENGINE_BY_ID 106 -#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170 -#define ENGINE_F_ENGINE_CTRL 142 -#define ENGINE_F_ENGINE_CTRL_CMD 178 -#define ENGINE_F_ENGINE_CTRL_CMD_STRING 171 -#define ENGINE_F_ENGINE_FINISH 107 -#define ENGINE_F_ENGINE_FREE_UTIL 108 -#define ENGINE_F_ENGINE_GET_CIPHER 185 -#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177 -#define ENGINE_F_ENGINE_GET_DIGEST 186 -#define ENGINE_F_ENGINE_GET_NEXT 115 -#define ENGINE_F_ENGINE_GET_PREV 116 -#define ENGINE_F_ENGINE_INIT 119 -#define ENGINE_F_ENGINE_LIST_ADD 120 -#define ENGINE_F_ENGINE_LIST_REMOVE 121 -#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 -#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 -#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 192 -#define ENGINE_F_ENGINE_NEW 122 -#define ENGINE_F_ENGINE_REMOVE 123 -#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 -#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126 -#define ENGINE_F_ENGINE_SET_ID 129 -#define ENGINE_F_ENGINE_SET_NAME 130 -#define ENGINE_F_ENGINE_TABLE_REGISTER 184 -#define ENGINE_F_ENGINE_UNLOAD_KEY 152 -#define ENGINE_F_ENGINE_UNLOCKED_FINISH 191 -#define ENGINE_F_ENGINE_UP_REF 190 -#define ENGINE_F_INT_CTRL_HELPER 172 -#define ENGINE_F_INT_ENGINE_CONFIGURE 188 -#define ENGINE_F_INT_ENGINE_MODULE_INIT 187 -#define ENGINE_F_LOG_MESSAGE 141 - -/* Reason codes. */ -#define ENGINE_R_ALREADY_LOADED 100 -#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 -#define ENGINE_R_CMD_NOT_EXECUTABLE 134 -#define ENGINE_R_COMMAND_TAKES_INPUT 135 -#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 -#define ENGINE_R_CONFLICTING_ENGINE_ID 103 -#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 -#define ENGINE_R_DH_NOT_IMPLEMENTED 139 -#define ENGINE_R_DSA_NOT_IMPLEMENTED 140 -#define ENGINE_R_DSO_FAILURE 104 -#define ENGINE_R_DSO_NOT_FOUND 132 -#define ENGINE_R_ENGINES_SECTION_ERROR 148 -#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 -#define ENGINE_R_ENGINE_SECTION_ERROR 149 -#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 -#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 -#define ENGINE_R_FINISH_FAILED 106 -#define ENGINE_R_GET_HANDLE_FAILED 107 -#define ENGINE_R_ID_OR_NAME_MISSING 108 -#define ENGINE_R_INIT_FAILED 109 -#define ENGINE_R_INTERNAL_LIST_ERROR 110 -#define ENGINE_R_INVALID_ARGUMENT 143 -#define ENGINE_R_INVALID_CMD_NAME 137 -#define ENGINE_R_INVALID_CMD_NUMBER 138 -#define ENGINE_R_INVALID_INIT_VALUE 151 -#define ENGINE_R_INVALID_STRING 150 -#define ENGINE_R_NOT_INITIALISED 117 -#define ENGINE_R_NOT_LOADED 112 -#define ENGINE_R_NO_CONTROL_FUNCTION 120 -#define ENGINE_R_NO_INDEX 144 -#define ENGINE_R_NO_LOAD_FUNCTION 125 -#define ENGINE_R_NO_REFERENCE 130 -#define ENGINE_R_NO_SUCH_ENGINE 116 -#define ENGINE_R_NO_UNLOAD_FUNCTION 126 -#define ENGINE_R_PROVIDE_PARAMETERS 113 -#define ENGINE_R_RSA_NOT_IMPLEMENTED 141 -#define ENGINE_R_UNIMPLEMENTED_CIPHER 146 -#define ENGINE_R_UNIMPLEMENTED_DIGEST 147 -#define ENGINE_R_VERSION_INCOMPATIBILITY 145 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/err.h b/dep/include/openssl/err.h deleted file mode 100644 index dcac4152310..00000000000 --- a/dep/include/openssl/err.h +++ /dev/null @@ -1,330 +0,0 @@ -/* crypto/err/err.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ERR_H -#define HEADER_ERR_H - -#include - -#ifndef OPENSSL_NO_FP_API -#include -#include -#endif - -#include -#ifndef OPENSSL_NO_BIO -#include -#endif -#ifndef OPENSSL_NO_LHASH -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef OPENSSL_NO_ERR -#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) -#else -#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) -#endif - -#include - -#define ERR_TXT_MALLOCED 0x01 -#define ERR_TXT_STRING 0x02 - -#define ERR_FLAG_MARK 0x01 - -#define ERR_NUM_ERRORS 16 -typedef struct err_state_st - { - unsigned long pid; - int err_flags[ERR_NUM_ERRORS]; - unsigned long err_buffer[ERR_NUM_ERRORS]; - char *err_data[ERR_NUM_ERRORS]; - int err_data_flags[ERR_NUM_ERRORS]; - const char *err_file[ERR_NUM_ERRORS]; - int err_line[ERR_NUM_ERRORS]; - int top,bottom; - } ERR_STATE; - -/* library */ -#define ERR_LIB_NONE 1 -#define ERR_LIB_SYS 2 -#define ERR_LIB_BN 3 -#define ERR_LIB_RSA 4 -#define ERR_LIB_DH 5 -#define ERR_LIB_EVP 6 -#define ERR_LIB_BUF 7 -#define ERR_LIB_OBJ 8 -#define ERR_LIB_PEM 9 -#define ERR_LIB_DSA 10 -#define ERR_LIB_X509 11 -/* #define ERR_LIB_METH 12 */ -#define ERR_LIB_ASN1 13 -#define ERR_LIB_CONF 14 -#define ERR_LIB_CRYPTO 15 -#define ERR_LIB_EC 16 -#define ERR_LIB_SSL 20 -/* #define ERR_LIB_SSL23 21 */ -/* #define ERR_LIB_SSL2 22 */ -/* #define ERR_LIB_SSL3 23 */ -/* #define ERR_LIB_RSAREF 30 */ -/* #define ERR_LIB_PROXY 31 */ -#define ERR_LIB_BIO 32 -#define ERR_LIB_PKCS7 33 -#define ERR_LIB_X509V3 34 -#define ERR_LIB_PKCS12 35 -#define ERR_LIB_RAND 36 -#define ERR_LIB_DSO 37 -#define ERR_LIB_ENGINE 38 -#define ERR_LIB_OCSP 39 -#define ERR_LIB_UI 40 -#define ERR_LIB_COMP 41 -#define ERR_LIB_ECDSA 42 -#define ERR_LIB_ECDH 43 -#define ERR_LIB_STORE 44 -#define ERR_LIB_FIPS 45 -#define ERR_LIB_CMS 46 -#define ERR_LIB_JPAKE 47 - -#define ERR_LIB_USER 128 - -#define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) -#define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) -#define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) -#define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) -#define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) -#define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) -#define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) -#define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) -#define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) -#define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) -#define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) -#define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) -#define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) -#define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) -#define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) -#define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) -#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) -#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) -#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) -#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) -#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) -#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) -#define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) -#define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) -#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) -#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) -#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) -#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) -#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) -#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) -#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) - -/* Borland C seems too stupid to be able to shift and do longs in - * the pre-processor :-( */ -#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ - ((((unsigned long)f)&0xfffL)*0x1000)| \ - ((((unsigned long)r)&0xfffL))) -#define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) -#define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) -#define ERR_GET_REASON(l) (int)((l)&0xfffL) -#define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) - - -/* OS functions */ -#define SYS_F_FOPEN 1 -#define SYS_F_CONNECT 2 -#define SYS_F_GETSERVBYNAME 3 -#define SYS_F_SOCKET 4 -#define SYS_F_IOCTLSOCKET 5 -#define SYS_F_BIND 6 -#define SYS_F_LISTEN 7 -#define SYS_F_ACCEPT 8 -#define SYS_F_WSASTARTUP 9 /* Winsock stuff */ -#define SYS_F_OPENDIR 10 -#define SYS_F_FREAD 11 - - -/* reasons */ -#define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */ -#define ERR_R_BN_LIB ERR_LIB_BN /* 3 */ -#define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */ -#define ERR_R_DH_LIB ERR_LIB_DH /* 5 */ -#define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */ -#define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */ -#define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */ -#define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */ -#define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */ -#define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */ -#define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */ -#define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */ -#define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */ -#define ERR_R_EC_LIB ERR_LIB_EC /* 16 */ -#define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */ -#define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */ -#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */ -#define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */ -#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */ -#define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */ -#define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */ -#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */ -#define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ -#define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ -#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ -#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ -#define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ -#define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ - -#define ERR_R_NESTED_ASN1_ERROR 58 -#define ERR_R_BAD_ASN1_OBJECT_HEADER 59 -#define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 -#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 -#define ERR_R_ASN1_LENGTH_MISMATCH 62 -#define ERR_R_MISSING_ASN1_EOS 63 - -/* fatal error */ -#define ERR_R_FATAL 64 -#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) -#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) -#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) -#define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) -#define ERR_R_DISABLED (5|ERR_R_FATAL) - -/* 99 is the maximum possible ERR_R_... code, higher values - * are reserved for the individual libraries */ - - -typedef struct ERR_string_data_st - { - unsigned long error; - const char *string; - } ERR_STRING_DATA; - -void ERR_put_error(int lib, int func,int reason,const char *file,int line); -void ERR_set_error_data(char *data,int flags); - -unsigned long ERR_get_error(void); -unsigned long ERR_get_error_line(const char **file,int *line); -unsigned long ERR_get_error_line_data(const char **file,int *line, - const char **data, int *flags); -unsigned long ERR_peek_error(void); -unsigned long ERR_peek_error_line(const char **file,int *line); -unsigned long ERR_peek_error_line_data(const char **file,int *line, - const char **data,int *flags); -unsigned long ERR_peek_last_error(void); -unsigned long ERR_peek_last_error_line(const char **file,int *line); -unsigned long ERR_peek_last_error_line_data(const char **file,int *line, - const char **data,int *flags); -void ERR_clear_error(void ); -char *ERR_error_string(unsigned long e,char *buf); -void ERR_error_string_n(unsigned long e, char *buf, size_t len); -const char *ERR_lib_error_string(unsigned long e); -const char *ERR_func_error_string(unsigned long e); -const char *ERR_reason_error_string(unsigned long e); -void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), - void *u); -#ifndef OPENSSL_NO_FP_API -void ERR_print_errors_fp(FILE *fp); -#endif -#ifndef OPENSSL_NO_BIO -void ERR_print_errors(BIO *bp); -void ERR_add_error_data(int num, ...); -#endif -void ERR_load_strings(int lib,ERR_STRING_DATA str[]); -void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); -void ERR_load_ERR_strings(void); -void ERR_load_crypto_strings(void); -void ERR_free_strings(void); - -void ERR_remove_state(unsigned long pid); /* if zero we look it up */ -ERR_STATE *ERR_get_state(void); - -#ifndef OPENSSL_NO_LHASH -LHASH *ERR_get_string_table(void); -LHASH *ERR_get_err_state_table(void); -void ERR_release_err_state_table(LHASH **hash); -#endif - -int ERR_get_next_error_library(void); - -int ERR_set_mark(void); -int ERR_pop_to_mark(void); - -#ifdef OPENSSL_FIPS -void int_ERR_set_state_func(ERR_STATE *(*get_func)(void), - void (*remove_func)(unsigned long pid)); -void int_ERR_lib_init(void); -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct st_ERR_FNS ERR_FNS; */ -/* An application can use this function and provide the return value to loaded - * modules that should use the application's ERR state/functionality */ -const ERR_FNS *ERR_get_implementation(void); -/* A loaded module should call this function prior to any ERR operations using - * the application's "ERR_FNS". */ -int ERR_set_implementation(const ERR_FNS *fns); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/evp.h b/dep/include/openssl/evp.h deleted file mode 100644 index 79c097181f4..00000000000 --- a/dep/include/openssl/evp.h +++ /dev/null @@ -1,1059 +0,0 @@ -/* crypto/evp/evp.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ENVELOPE_H -#define HEADER_ENVELOPE_H - -#ifdef OPENSSL_ALGORITHM_DEFINES -# include -#else -# define OPENSSL_ALGORITHM_DEFINES -# include -# undef OPENSSL_ALGORITHM_DEFINES -#endif - -#include - -#include - -#ifndef OPENSSL_NO_BIO -#include -#endif - -#ifdef OPENSSL_FIPS -#include -#endif - -/* -#define EVP_RC2_KEY_SIZE 16 -#define EVP_RC4_KEY_SIZE 16 -#define EVP_BLOWFISH_KEY_SIZE 16 -#define EVP_CAST5_KEY_SIZE 16 -#define EVP_RC5_32_12_16_KEY_SIZE 16 -*/ -#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ -#define EVP_MAX_KEY_LENGTH 32 -#define EVP_MAX_IV_LENGTH 16 -#define EVP_MAX_BLOCK_LENGTH 32 - -#define PKCS5_SALT_LEN 8 -/* Default PKCS#5 iteration count */ -#define PKCS5_DEFAULT_ITER 2048 - -#include - -#define EVP_PK_RSA 0x0001 -#define EVP_PK_DSA 0x0002 -#define EVP_PK_DH 0x0004 -#define EVP_PK_EC 0x0008 -#define EVP_PKT_SIGN 0x0010 -#define EVP_PKT_ENC 0x0020 -#define EVP_PKT_EXCH 0x0040 -#define EVP_PKS_RSA 0x0100 -#define EVP_PKS_DSA 0x0200 -#define EVP_PKS_EC 0x0400 -#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */ - -#define EVP_PKEY_NONE NID_undef -#define EVP_PKEY_RSA NID_rsaEncryption -#define EVP_PKEY_RSA2 NID_rsa -#define EVP_PKEY_DSA NID_dsa -#define EVP_PKEY_DSA1 NID_dsa_2 -#define EVP_PKEY_DSA2 NID_dsaWithSHA -#define EVP_PKEY_DSA3 NID_dsaWithSHA1 -#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 -#define EVP_PKEY_DH NID_dhKeyAgreement -#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey - -#ifdef __cplusplus -extern "C" { -#endif - -/* Type needs to be a bit field - * Sub-type needs to be for variations on the method, as in, can it do - * arbitrary encryption.... */ -struct evp_pkey_st - { - int type; - int save_type; - int references; - union { - char *ptr; -#ifndef OPENSSL_NO_RSA - struct rsa_st *rsa; /* RSA */ -#endif -#ifndef OPENSSL_NO_DSA - struct dsa_st *dsa; /* DSA */ -#endif -#ifndef OPENSSL_NO_DH - struct dh_st *dh; /* DH */ -#endif -#ifndef OPENSSL_NO_EC - struct ec_key_st *ec; /* ECC */ -#endif - } pkey; - int save_parameters; - STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ - } /* EVP_PKEY */; - -#define EVP_PKEY_MO_SIGN 0x0001 -#define EVP_PKEY_MO_VERIFY 0x0002 -#define EVP_PKEY_MO_ENCRYPT 0x0004 -#define EVP_PKEY_MO_DECRYPT 0x0008 - -#if 0 -/* This structure is required to tie the message digest and signing together. - * The lookup can be done by md/pkey_method, oid, oid/pkey_method, or - * oid, md and pkey. - * This is required because for various smart-card perform the digest and - * signing/verification on-board. To handle this case, the specific - * EVP_MD and EVP_PKEY_METHODs need to be closely associated. - * When a PKEY is created, it will have a EVP_PKEY_METHOD associated with it. - * This can either be software or a token to provide the required low level - * routines. - */ -typedef struct evp_pkey_md_st - { - int oid; - EVP_MD *md; - EVP_PKEY_METHOD *pkey; - } EVP_PKEY_MD; - -#define EVP_rsa_md2() \ - EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\ - EVP_rsa_pkcs1(),EVP_md2()) -#define EVP_rsa_md5() \ - EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\ - EVP_rsa_pkcs1(),EVP_md5()) -#define EVP_rsa_sha0() \ - EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\ - EVP_rsa_pkcs1(),EVP_sha()) -#define EVP_rsa_sha1() \ - EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\ - EVP_rsa_pkcs1(),EVP_sha1()) -#define EVP_rsa_ripemd160() \ - EVP_PKEY_MD_add(NID_ripemd160WithRSA,\ - EVP_rsa_pkcs1(),EVP_ripemd160()) -#define EVP_rsa_mdc2() \ - EVP_PKEY_MD_add(NID_mdc2WithRSA,\ - EVP_rsa_octet_string(),EVP_mdc2()) -#define EVP_dsa_sha() \ - EVP_PKEY_MD_add(NID_dsaWithSHA,\ - EVP_dsa(),EVP_sha()) -#define EVP_dsa_sha1() \ - EVP_PKEY_MD_add(NID_dsaWithSHA1,\ - EVP_dsa(),EVP_sha1()) - -typedef struct evp_pkey_method_st - { - char *name; - int flags; - int type; /* RSA, DSA, an SSLeay specific constant */ - int oid; /* For the pub-key type */ - int encrypt_oid; /* pub/priv key encryption */ - - int (*sign)(); - int (*verify)(); - struct { - int (*set)(); /* get and/or set the underlying type */ - int (*get)(); - int (*encrypt)(); - int (*decrypt)(); - int (*i2d)(); - int (*d2i)(); - int (*dup)(); - } pub,priv; - int (*set_asn1_parameters)(); - int (*get_asn1_parameters)(); - } EVP_PKEY_METHOD; -#endif - -#ifndef EVP_MD -struct env_md_st - { - int type; - int pkey_type; - int md_size; - unsigned long flags; - int (*init)(EVP_MD_CTX *ctx); - int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count); - int (*final)(EVP_MD_CTX *ctx,unsigned char *md); - int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from); - int (*cleanup)(EVP_MD_CTX *ctx); - - /* FIXME: prototype these some day */ - int (*sign)(int type, const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, void *key); - int (*verify)(int type, const unsigned char *m, unsigned int m_length, - const unsigned char *sigbuf, unsigned int siglen, - void *key); - int required_pkey_type[5]; /*EVP_PKEY_xxx */ - int block_size; - int ctx_size; /* how big does the ctx->md_data need to be */ - } /* EVP_MD */; - -typedef int evp_sign_method(int type,const unsigned char *m, - unsigned int m_length,unsigned char *sigret, - unsigned int *siglen, void *key); -typedef int evp_verify_method(int type,const unsigned char *m, - unsigned int m_length,const unsigned char *sigbuf, - unsigned int siglen, void *key); - -typedef struct - { - EVP_MD_CTX *mctx; - void *key; - } EVP_MD_SVCTX; - -#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single - * block */ - -#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */ - -#define EVP_MD_FLAG_SVCTX 0x0800 /* pass EVP_MD_SVCTX to sign/verify */ - -#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} - -#ifndef OPENSSL_NO_DSA -#define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \ - (evp_verify_method *)DSA_verify, \ - {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ - EVP_PKEY_DSA4,0} -#else -#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method -#endif - -#ifndef OPENSSL_NO_ECDSA -#define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \ - (evp_verify_method *)ECDSA_verify, \ - {EVP_PKEY_EC,0,0,0} -#else -#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method -#endif - -#ifndef OPENSSL_NO_RSA -#define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \ - (evp_verify_method *)RSA_verify, \ - {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} -#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ - (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \ - (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \ - {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} -#else -#define EVP_PKEY_RSA_method EVP_PKEY_NULL_method -#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method -#endif - -#endif /* !EVP_MD */ - -struct env_md_ctx_st - { - const EVP_MD *digest; - ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */ - unsigned long flags; - void *md_data; - } /* EVP_MD_CTX */; - -/* values for EVP_MD_CTX flags */ - -#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called - * once only */ -#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been - * cleaned */ -#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data - * in EVP_MD_CTX_cleanup */ -#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest - * in FIPS mode */ - -#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */ -#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ -#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ -#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ -#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ - ((ctx->flags>>16) &0xFFFF) /* seed length */ -#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */ -#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */ - -struct evp_cipher_st - { - int nid; - int block_size; - int key_len; /* Default value for variable length ciphers */ - int iv_len; - unsigned long flags; /* Various flags */ - int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key, - const unsigned char *iv, int enc); /* init key */ - int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, - const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ - int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ - int ctx_size; /* how big ctx->cipher_data needs to be */ - int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ - int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ - int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ - void *app_data; /* Application data */ - } /* EVP_CIPHER */; - -/* Values for cipher flags */ - -/* Modes for ciphers */ - -#define EVP_CIPH_STREAM_CIPHER 0x0 -#define EVP_CIPH_ECB_MODE 0x1 -#define EVP_CIPH_CBC_MODE 0x2 -#define EVP_CIPH_CFB_MODE 0x3 -#define EVP_CIPH_OFB_MODE 0x4 -#define EVP_CIPH_MODE 0x7 -/* Set if variable length cipher */ -#define EVP_CIPH_VARIABLE_LENGTH 0x8 -/* Set if the iv handling should be done by the cipher itself */ -#define EVP_CIPH_CUSTOM_IV 0x10 -/* Set if the cipher's init() function should be called if key is NULL */ -#define EVP_CIPH_ALWAYS_CALL_INIT 0x20 -/* Call ctrl() to init cipher parameters */ -#define EVP_CIPH_CTRL_INIT 0x40 -/* Don't use standard key length function */ -#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 -/* Don't use standard block padding */ -#define EVP_CIPH_NO_PADDING 0x100 -/* cipher handles random key generation */ -#define EVP_CIPH_RAND_KEY 0x200 -/* Note if suitable for use in FIPS mode */ -#define EVP_CIPH_FLAG_FIPS 0x400 -/* Allow non FIPS cipher in FIPS mode */ -#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800 -/* Allow use default ASN1 get/set iv */ -#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 -/* Buffer length in bits not bytes: CFB1 mode only */ -#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 - -/* ctrl() values */ - -#define EVP_CTRL_INIT 0x0 -#define EVP_CTRL_SET_KEY_LENGTH 0x1 -#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 -#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 -#define EVP_CTRL_GET_RC5_ROUNDS 0x4 -#define EVP_CTRL_SET_RC5_ROUNDS 0x5 -#define EVP_CTRL_RAND_KEY 0x6 - -typedef struct evp_cipher_info_st - { - const EVP_CIPHER *cipher; - unsigned char iv[EVP_MAX_IV_LENGTH]; - } EVP_CIPHER_INFO; - -struct evp_cipher_ctx_st - { - const EVP_CIPHER *cipher; - ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */ - int encrypt; /* encrypt or decrypt */ - int buf_len; /* number we have left */ - - unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ - unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ - unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ - int num; /* used by cfb/ofb mode */ - - void *app_data; /* application stuff */ - int key_len; /* May change for variable length cipher */ - unsigned long flags; /* Various flags */ - void *cipher_data; /* per EVP data */ - int final_used; - int block_mask; - unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ - } /* EVP_CIPHER_CTX */; - -typedef struct evp_Encode_Ctx_st - { - int num; /* number saved in a partial encode/decode */ - int length; /* The length is either the output line length - * (in input bytes) or the shortest input line - * length that is ok. Once decoding begins, - * the length is adjusted up each time a longer - * line is decoded */ - unsigned char enc_data[80]; /* data to encode */ - int line_num; /* number read on current line */ - int expect_nl; - } EVP_ENCODE_CTX; - -/* Password based encryption function */ -typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, - const EVP_MD *md, int en_de); - -#ifndef OPENSSL_NO_RSA -#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ - (char *)(rsa)) -#endif - -#ifndef OPENSSL_NO_DSA -#define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ - (char *)(dsa)) -#endif - -#ifndef OPENSSL_NO_DH -#define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ - (char *)(dh)) -#endif - -#ifndef OPENSSL_NO_EC -#define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ - (char *)(eckey)) -#endif - -/* Add some extra combinations */ -#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) -#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) -#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) -#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) - -/* Macros to reduce FIPS dependencies: do NOT use in applications */ -#define M_EVP_MD_size(e) ((e)->md_size) -#define M_EVP_MD_block_size(e) ((e)->block_size) -#define M_EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) -#define M_EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs)) -#define M_EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs)) -#define M_EVP_MD_type(e) ((e)->type) -#define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e)) -#define M_EVP_MD_CTX_md(e) ((e)->digest) - -#define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) - -int EVP_MD_type(const EVP_MD *md); -#define EVP_MD_nid(e) EVP_MD_type(e) -#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) -int EVP_MD_pkey_type(const EVP_MD *md); -int EVP_MD_size(const EVP_MD *md); -int EVP_MD_block_size(const EVP_MD *md); - -const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx); -#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) -#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) -#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) - -int EVP_CIPHER_nid(const EVP_CIPHER *cipher); -#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) -int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); -int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); -int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); -unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); -#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) - -const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); -void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); -void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); -#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) -unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx); -#define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE) - -#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) -#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) - -#define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) -#define EVP_SignInit(a,b) EVP_DigestInit(a,b) -#define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) -#define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) -#define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) -#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) -#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) -#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) - -#ifdef CONST_STRICT -void BIO_set_md(BIO *,const EVP_MD *md); -#else -# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) -#endif -#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) -#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) -#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp) -#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) -#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) - -int EVP_Cipher(EVP_CIPHER_CTX *c, - unsigned char *out, - const unsigned char *in, - unsigned int inl); - -#define EVP_add_cipher_alias(n,alias) \ - OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) -#define EVP_add_digest_alias(n,alias) \ - OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) -#define EVP_delete_cipher_alias(alias) \ - OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); -#define EVP_delete_digest_alias(alias) \ - OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); - -void EVP_MD_CTX_init(EVP_MD_CTX *ctx); -int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); -EVP_MD_CTX *EVP_MD_CTX_create(void); -void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); -int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in); -void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); -void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); -int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx,int flags); -int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); -int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, - size_t cnt); -int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); -int EVP_Digest(const void *data, size_t count, - unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl); - -int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in); -int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); -int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); - -int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); -void EVP_set_pw_prompt(const char *prompt); -char * EVP_get_pw_prompt(void); - -int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, - const unsigned char *salt, const unsigned char *data, - int datal, int count, unsigned char *key,unsigned char *iv); - -void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); -void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); -int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags); - -int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv); -int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, - const unsigned char *key, const unsigned char *iv); -int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, int inl); -int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); -int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); - -int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv); -int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, - const unsigned char *key, const unsigned char *iv); -int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, int inl); -int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); - -int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, - const unsigned char *key,const unsigned char *iv, - int enc); -int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, - const unsigned char *key,const unsigned char *iv, - int enc); -int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, int inl); -int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); - -int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, - EVP_PKEY *pkey); - -int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf, - unsigned int siglen,EVP_PKEY *pkey); - -int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, - const unsigned char *ek, int ekl, const unsigned char *iv, - EVP_PKEY *priv); -int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); - -int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char **ek, int *ekl, unsigned char *iv, - EVP_PKEY **pubk, int npubk); -int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); - -void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); -void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, - const unsigned char *in,int inl); -void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl); -int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); - -void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); -int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, - const unsigned char *in, int inl); -int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned - char *out, int *outl); -int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); - -void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); -int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); -EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); -void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); -int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); -int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); -int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); -int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); - -#ifndef OPENSSL_NO_BIO -BIO_METHOD *BIO_f_md(void); -BIO_METHOD *BIO_f_base64(void); -BIO_METHOD *BIO_f_cipher(void); -BIO_METHOD *BIO_f_reliable(void); -void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,const unsigned char *k, - const unsigned char *i, int enc); -#endif - -const EVP_MD *EVP_md_null(void); -#ifndef OPENSSL_NO_MD2 -const EVP_MD *EVP_md2(void); -#endif -#ifndef OPENSSL_NO_MD4 -const EVP_MD *EVP_md4(void); -#endif -#ifndef OPENSSL_NO_MD5 -const EVP_MD *EVP_md5(void); -#endif -#ifndef OPENSSL_NO_SHA -const EVP_MD *EVP_sha(void); -const EVP_MD *EVP_sha1(void); -const EVP_MD *EVP_dss(void); -const EVP_MD *EVP_dss1(void); -const EVP_MD *EVP_ecdsa(void); -#endif -#ifndef OPENSSL_NO_SHA256 -const EVP_MD *EVP_sha224(void); -const EVP_MD *EVP_sha256(void); -#endif -#ifndef OPENSSL_NO_SHA512 -const EVP_MD *EVP_sha384(void); -const EVP_MD *EVP_sha512(void); -#endif -#ifndef OPENSSL_NO_MDC2 -const EVP_MD *EVP_mdc2(void); -#endif -#ifndef OPENSSL_NO_RIPEMD -const EVP_MD *EVP_ripemd160(void); -#endif -const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ -#ifndef OPENSSL_NO_DES -const EVP_CIPHER *EVP_des_ecb(void); -const EVP_CIPHER *EVP_des_ede(void); -const EVP_CIPHER *EVP_des_ede3(void); -const EVP_CIPHER *EVP_des_ede_ecb(void); -const EVP_CIPHER *EVP_des_ede3_ecb(void); -const EVP_CIPHER *EVP_des_cfb64(void); -# define EVP_des_cfb EVP_des_cfb64 -const EVP_CIPHER *EVP_des_cfb1(void); -const EVP_CIPHER *EVP_des_cfb8(void); -const EVP_CIPHER *EVP_des_ede_cfb64(void); -# define EVP_des_ede_cfb EVP_des_ede_cfb64 -#if 0 -const EVP_CIPHER *EVP_des_ede_cfb1(void); -const EVP_CIPHER *EVP_des_ede_cfb8(void); -#endif -const EVP_CIPHER *EVP_des_ede3_cfb64(void); -# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 -const EVP_CIPHER *EVP_des_ede3_cfb1(void); -const EVP_CIPHER *EVP_des_ede3_cfb8(void); -const EVP_CIPHER *EVP_des_ofb(void); -const EVP_CIPHER *EVP_des_ede_ofb(void); -const EVP_CIPHER *EVP_des_ede3_ofb(void); -const EVP_CIPHER *EVP_des_cbc(void); -const EVP_CIPHER *EVP_des_ede_cbc(void); -const EVP_CIPHER *EVP_des_ede3_cbc(void); -const EVP_CIPHER *EVP_desx_cbc(void); -/* This should now be supported through the dev_crypto ENGINE. But also, why are - * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ -#if 0 -# ifdef OPENSSL_OPENBSD_DEV_CRYPTO -const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void); -const EVP_CIPHER *EVP_dev_crypto_rc4(void); -const EVP_MD *EVP_dev_crypto_md5(void); -# endif -#endif -#endif -#ifndef OPENSSL_NO_RC4 -const EVP_CIPHER *EVP_rc4(void); -const EVP_CIPHER *EVP_rc4_40(void); -#endif -#ifndef OPENSSL_NO_IDEA -const EVP_CIPHER *EVP_idea_ecb(void); -const EVP_CIPHER *EVP_idea_cfb64(void); -# define EVP_idea_cfb EVP_idea_cfb64 -const EVP_CIPHER *EVP_idea_ofb(void); -const EVP_CIPHER *EVP_idea_cbc(void); -#endif -#ifndef OPENSSL_NO_RC2 -const EVP_CIPHER *EVP_rc2_ecb(void); -const EVP_CIPHER *EVP_rc2_cbc(void); -const EVP_CIPHER *EVP_rc2_40_cbc(void); -const EVP_CIPHER *EVP_rc2_64_cbc(void); -const EVP_CIPHER *EVP_rc2_cfb64(void); -# define EVP_rc2_cfb EVP_rc2_cfb64 -const EVP_CIPHER *EVP_rc2_ofb(void); -#endif -#ifndef OPENSSL_NO_BF -const EVP_CIPHER *EVP_bf_ecb(void); -const EVP_CIPHER *EVP_bf_cbc(void); -const EVP_CIPHER *EVP_bf_cfb64(void); -# define EVP_bf_cfb EVP_bf_cfb64 -const EVP_CIPHER *EVP_bf_ofb(void); -#endif -#ifndef OPENSSL_NO_CAST -const EVP_CIPHER *EVP_cast5_ecb(void); -const EVP_CIPHER *EVP_cast5_cbc(void); -const EVP_CIPHER *EVP_cast5_cfb64(void); -# define EVP_cast5_cfb EVP_cast5_cfb64 -const EVP_CIPHER *EVP_cast5_ofb(void); -#endif -#ifndef OPENSSL_NO_RC5 -const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); -const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); -const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); -# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 -const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); -#endif -#ifndef OPENSSL_NO_AES -const EVP_CIPHER *EVP_aes_128_ecb(void); -const EVP_CIPHER *EVP_aes_128_cbc(void); -const EVP_CIPHER *EVP_aes_128_cfb1(void); -const EVP_CIPHER *EVP_aes_128_cfb8(void); -const EVP_CIPHER *EVP_aes_128_cfb128(void); -# define EVP_aes_128_cfb EVP_aes_128_cfb128 -const EVP_CIPHER *EVP_aes_128_ofb(void); -#if 0 -const EVP_CIPHER *EVP_aes_128_ctr(void); -#endif -const EVP_CIPHER *EVP_aes_192_ecb(void); -const EVP_CIPHER *EVP_aes_192_cbc(void); -const EVP_CIPHER *EVP_aes_192_cfb1(void); -const EVP_CIPHER *EVP_aes_192_cfb8(void); -const EVP_CIPHER *EVP_aes_192_cfb128(void); -# define EVP_aes_192_cfb EVP_aes_192_cfb128 -const EVP_CIPHER *EVP_aes_192_ofb(void); -#if 0 -const EVP_CIPHER *EVP_aes_192_ctr(void); -#endif -const EVP_CIPHER *EVP_aes_256_ecb(void); -const EVP_CIPHER *EVP_aes_256_cbc(void); -const EVP_CIPHER *EVP_aes_256_cfb1(void); -const EVP_CIPHER *EVP_aes_256_cfb8(void); -const EVP_CIPHER *EVP_aes_256_cfb128(void); -# define EVP_aes_256_cfb EVP_aes_256_cfb128 -const EVP_CIPHER *EVP_aes_256_ofb(void); -#if 0 -const EVP_CIPHER *EVP_aes_256_ctr(void); -#endif -#endif -#ifndef OPENSSL_NO_CAMELLIA -const EVP_CIPHER *EVP_camellia_128_ecb(void); -const EVP_CIPHER *EVP_camellia_128_cbc(void); -const EVP_CIPHER *EVP_camellia_128_cfb1(void); -const EVP_CIPHER *EVP_camellia_128_cfb8(void); -const EVP_CIPHER *EVP_camellia_128_cfb128(void); -# define EVP_camellia_128_cfb EVP_camellia_128_cfb128 -const EVP_CIPHER *EVP_camellia_128_ofb(void); -const EVP_CIPHER *EVP_camellia_192_ecb(void); -const EVP_CIPHER *EVP_camellia_192_cbc(void); -const EVP_CIPHER *EVP_camellia_192_cfb1(void); -const EVP_CIPHER *EVP_camellia_192_cfb8(void); -const EVP_CIPHER *EVP_camellia_192_cfb128(void); -# define EVP_camellia_192_cfb EVP_camellia_192_cfb128 -const EVP_CIPHER *EVP_camellia_192_ofb(void); -const EVP_CIPHER *EVP_camellia_256_ecb(void); -const EVP_CIPHER *EVP_camellia_256_cbc(void); -const EVP_CIPHER *EVP_camellia_256_cfb1(void); -const EVP_CIPHER *EVP_camellia_256_cfb8(void); -const EVP_CIPHER *EVP_camellia_256_cfb128(void); -# define EVP_camellia_256_cfb EVP_camellia_256_cfb128 -const EVP_CIPHER *EVP_camellia_256_ofb(void); -#endif - -#ifndef OPENSSL_NO_SEED -const EVP_CIPHER *EVP_seed_ecb(void); -const EVP_CIPHER *EVP_seed_cbc(void); -const EVP_CIPHER *EVP_seed_cfb128(void); -# define EVP_seed_cfb EVP_seed_cfb128 -const EVP_CIPHER *EVP_seed_ofb(void); -#endif - -void OPENSSL_add_all_algorithms_noconf(void); -void OPENSSL_add_all_algorithms_conf(void); - -#ifdef OPENSSL_LOAD_CONF -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_conf() -#else -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_noconf() -#endif - -void OpenSSL_add_all_ciphers(void); -void OpenSSL_add_all_digests(void); -#define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() -#define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() -#define SSLeay_add_all_digests() OpenSSL_add_all_digests() - -int EVP_add_cipher(const EVP_CIPHER *cipher); -int EVP_add_digest(const EVP_MD *digest); - -const EVP_CIPHER *EVP_get_cipherbyname(const char *name); -const EVP_MD *EVP_get_digestbyname(const char *name); -void EVP_cleanup(void); - -int EVP_PKEY_decrypt(unsigned char *dec_key, - const unsigned char *enc_key,int enc_key_len, - EVP_PKEY *private_key); -int EVP_PKEY_encrypt(unsigned char *enc_key, - const unsigned char *key,int key_len, - EVP_PKEY *pub_key); -int EVP_PKEY_type(int type); -int EVP_PKEY_bits(EVP_PKEY *pkey); -int EVP_PKEY_size(EVP_PKEY *pkey); -int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); - -#ifndef OPENSSL_NO_RSA -struct rsa_st; -int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,struct rsa_st *key); -struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); -#endif -#ifndef OPENSSL_NO_DSA -struct dsa_st; -int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,struct dsa_st *key); -struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); -#endif -#ifndef OPENSSL_NO_DH -struct dh_st; -int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key); -struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); -#endif -#ifndef OPENSSL_NO_EC -struct ec_key_st; -int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,struct ec_key_st *key); -struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); -#endif - -EVP_PKEY * EVP_PKEY_new(void); -void EVP_PKEY_free(EVP_PKEY *pkey); - -EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp, - long length); -int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); - -EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp, - long length); -EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, - long length); -int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); - -int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); -int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); -int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode); -int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); - -int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); - -int EVP_CIPHER_type(const EVP_CIPHER *ctx); - -/* calls methods */ -int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); -int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); - -/* These are used by EVP_CIPHER methods */ -int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); -int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); - -/* PKCS5 password based encryption */ -int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, - int en_de); -int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - int keylen, unsigned char *out); -int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, - int en_de); - -void PKCS5_PBE_add(void); - -int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, - ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); -int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, - EVP_PBE_KEYGEN *keygen); -void EVP_PBE_cleanup(void); - -#ifdef OPENSSL_FIPS -#ifndef OPENSSL_NO_ENGINE -void int_EVP_MD_set_engine_callbacks( - int (*eng_md_init)(ENGINE *impl), - int (*eng_md_fin)(ENGINE *impl), - int (*eng_md_evp) - (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)); -void int_EVP_MD_init_engine_callbacks(void); -void int_EVP_CIPHER_set_engine_callbacks( - int (*eng_ciph_fin)(ENGINE *impl), - int (*eng_ciph_evp) - (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl)); -void int_EVP_CIPHER_init_engine_callbacks(void); -#endif -#endif - -void EVP_add_alg_module(void); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_EVP_strings(void); - -/* Error codes for the EVP functions. */ - -/* Function codes. */ -#define EVP_F_AES_INIT_KEY 133 -#define EVP_F_ALG_MODULE_INIT 138 -#define EVP_F_CAMELLIA_INIT_KEY 159 -#define EVP_F_D2I_PKEY 100 -#define EVP_F_DO_EVP_ENC_ENGINE 140 -#define EVP_F_DO_EVP_ENC_ENGINE_FULL 141 -#define EVP_F_DO_EVP_MD_ENGINE 139 -#define EVP_F_DO_EVP_MD_ENGINE_FULL 142 -#define EVP_F_DSAPKEY2PKCS8 134 -#define EVP_F_DSA_PKEY2PKCS8 135 -#define EVP_F_ECDSA_PKEY2PKCS8 129 -#define EVP_F_ECKEY_PKEY2PKCS8 132 -#define EVP_F_EVP_CIPHERINIT 137 -#define EVP_F_EVP_CIPHERINIT_EX 123 -#define EVP_F_EVP_CIPHER_CTX_CTRL 124 -#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 -#define EVP_F_EVP_DECRYPTFINAL_EX 101 -#define EVP_F_EVP_DIGESTINIT 136 -#define EVP_F_EVP_DIGESTINIT_EX 128 -#define EVP_F_EVP_ENCRYPTFINAL_EX 127 -#define EVP_F_EVP_MD_CTX_COPY_EX 110 -#define EVP_F_EVP_OPENINIT 102 -#define EVP_F_EVP_PBE_ALG_ADD 115 -#define EVP_F_EVP_PBE_CIPHERINIT 116 -#define EVP_F_EVP_PKCS82PKEY 111 -#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113 -#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 -#define EVP_F_EVP_PKEY_DECRYPT 104 -#define EVP_F_EVP_PKEY_ENCRYPT 105 -#define EVP_F_EVP_PKEY_GET1_DH 119 -#define EVP_F_EVP_PKEY_GET1_DSA 120 -#define EVP_F_EVP_PKEY_GET1_ECDSA 130 -#define EVP_F_EVP_PKEY_GET1_EC_KEY 131 -#define EVP_F_EVP_PKEY_GET1_RSA 121 -#define EVP_F_EVP_PKEY_NEW 106 -#define EVP_F_EVP_RIJNDAEL 126 -#define EVP_F_EVP_SIGNFINAL 107 -#define EVP_F_EVP_VERIFYFINAL 108 -#define EVP_F_PKCS5_PBE_KEYIVGEN 117 -#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 -#define EVP_F_PKCS8_SET_BROKEN 112 -#define EVP_F_RC2_MAGIC_TO_METH 109 -#define EVP_F_RC5_CTRL 125 - -/* Reason codes. */ -#define EVP_R_AES_KEY_SETUP_FAILED 143 -#define EVP_R_ASN1_LIB 140 -#define EVP_R_BAD_BLOCK_LENGTH 136 -#define EVP_R_BAD_DECRYPT 100 -#define EVP_R_BAD_KEY_LENGTH 137 -#define EVP_R_BN_DECODE_ERROR 112 -#define EVP_R_BN_PUBKEY_ERROR 113 -#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 -#define EVP_R_CIPHER_PARAMETER_ERROR 122 -#define EVP_R_CTRL_NOT_IMPLEMENTED 132 -#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 -#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 -#define EVP_R_DECODE_ERROR 114 -#define EVP_R_DIFFERENT_KEY_TYPES 101 -#define EVP_R_DISABLED_FOR_FIPS 144 -#define EVP_R_ENCODE_ERROR 115 -#define EVP_R_ERROR_LOADING_SECTION 145 -#define EVP_R_ERROR_SETTING_FIPS_MODE 146 -#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 -#define EVP_R_EXPECTING_AN_RSA_KEY 127 -#define EVP_R_EXPECTING_A_DH_KEY 128 -#define EVP_R_EXPECTING_A_DSA_KEY 129 -#define EVP_R_EXPECTING_A_ECDSA_KEY 141 -#define EVP_R_EXPECTING_A_EC_KEY 142 -#define EVP_R_FIPS_MODE_NOT_SUPPORTED 147 -#define EVP_R_INITIALIZATION_ERROR 134 -#define EVP_R_INPUT_NOT_INITIALIZED 111 -#define EVP_R_INVALID_FIPS_MODE 148 -#define EVP_R_INVALID_KEY_LENGTH 130 -#define EVP_R_IV_TOO_LARGE 102 -#define EVP_R_KEYGEN_FAILURE 120 -#define EVP_R_MISSING_PARAMETERS 103 -#define EVP_R_NO_CIPHER_SET 131 -#define EVP_R_NO_DIGEST_SET 139 -#define EVP_R_NO_DSA_PARAMETERS 116 -#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 -#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 -#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 -#define EVP_R_PUBLIC_KEY_NOT_RSA 106 -#define EVP_R_UNKNOWN_OPTION 149 -#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135 -#define EVP_R_UNSUPPORTED_CIPHER 107 -#define EVP_R_UNSUPPORTED_KEYLENGTH 123 -#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 -#define EVP_R_UNSUPPORTED_KEY_SIZE 108 -#define EVP_R_UNSUPPORTED_PRF 125 -#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 -#define EVP_R_UNSUPPORTED_SALT_TYPE 126 -#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 -#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 -#define EVP_R_SEED_KEY_SETUP_FAILED 162 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/hmac.h b/dep/include/openssl/hmac.h deleted file mode 100644 index fc38ffb52b3..00000000000 --- a/dep/include/openssl/hmac.h +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/hmac/hmac.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -#ifndef HEADER_HMAC_H -#define HEADER_HMAC_H - -#include - -#ifdef OPENSSL_NO_HMAC -#error HMAC is disabled. -#endif - -#include - -#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct hmac_ctx_st - { - const EVP_MD *md; - EVP_MD_CTX md_ctx; - EVP_MD_CTX i_ctx; - EVP_MD_CTX o_ctx; - unsigned int key_length; - unsigned char key[HMAC_MAX_MD_CBLOCK]; - } HMAC_CTX; - -#define HMAC_size(e) (EVP_MD_size((e)->md)) - - -void HMAC_CTX_init(HMAC_CTX *ctx); -void HMAC_CTX_cleanup(HMAC_CTX *ctx); - -#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ - -void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, - const EVP_MD *md); /* deprecated */ -void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, - const EVP_MD *md, ENGINE *impl); -void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); -void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); -unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, - const unsigned char *d, size_t n, unsigned char *md, - unsigned int *md_len); - -void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/idea.h b/dep/include/openssl/idea.h deleted file mode 100644 index a137d4cbce2..00000000000 --- a/dep/include/openssl/idea.h +++ /dev/null @@ -1,103 +0,0 @@ -/* crypto/idea/idea.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_IDEA_H -#define HEADER_IDEA_H - -#include /* IDEA_INT, OPENSSL_NO_IDEA */ - -#ifdef OPENSSL_NO_IDEA -#error IDEA is disabled. -#endif - -#define IDEA_ENCRYPT 1 -#define IDEA_DECRYPT 0 - -#define IDEA_BLOCK 8 -#define IDEA_KEY_LENGTH 16 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct idea_key_st - { - IDEA_INT data[9][6]; - } IDEA_KEY_SCHEDULE; - -const char *idea_options(void); -void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, - IDEA_KEY_SCHEDULE *ks); -#ifdef OPENSSL_FIPS -void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); -#endif -void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); -void idea_set_decrypt_key(const IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); -void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); -void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, - int *num,int enc); -void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); -void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/krb5_asn.h b/dep/include/openssl/krb5_asn.h deleted file mode 100644 index 66c0629bcdb..00000000000 --- a/dep/include/openssl/krb5_asn.h +++ /dev/null @@ -1,257 +0,0 @@ -/* krb5_asn.h */ -/* Written by Vern Staats for the OpenSSL project, -** using ocsp/{*.h,*asn*.c} as a starting point -*/ - -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_KRB5_ASN_H -#define HEADER_KRB5_ASN_H - -/* -#include -*/ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ASN.1 from Kerberos RFC 1510 -*/ - -/* EncryptedData ::= SEQUENCE { -** etype[0] INTEGER, -- EncryptionType -** kvno[1] INTEGER OPTIONAL, -** cipher[2] OCTET STRING -- ciphertext -** } -*/ -typedef struct krb5_encdata_st - { - ASN1_INTEGER *etype; - ASN1_INTEGER *kvno; - ASN1_OCTET_STRING *cipher; - } KRB5_ENCDATA; - -DECLARE_STACK_OF(KRB5_ENCDATA) - -/* PrincipalName ::= SEQUENCE { -** name-type[0] INTEGER, -** name-string[1] SEQUENCE OF GeneralString -** } -*/ -typedef struct krb5_princname_st - { - ASN1_INTEGER *nametype; - STACK_OF(ASN1_GENERALSTRING) *namestring; - } KRB5_PRINCNAME; - -DECLARE_STACK_OF(KRB5_PRINCNAME) - - -/* Ticket ::= [APPLICATION 1] SEQUENCE { -** tkt-vno[0] INTEGER, -** realm[1] Realm, -** sname[2] PrincipalName, -** enc-part[3] EncryptedData -** } -*/ -typedef struct krb5_tktbody_st - { - ASN1_INTEGER *tktvno; - ASN1_GENERALSTRING *realm; - KRB5_PRINCNAME *sname; - KRB5_ENCDATA *encdata; - } KRB5_TKTBODY; - -typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET; -DECLARE_STACK_OF(KRB5_TKTBODY) - - -/* AP-REQ ::= [APPLICATION 14] SEQUENCE { -** pvno[0] INTEGER, -** msg-type[1] INTEGER, -** ap-options[2] APOptions, -** ticket[3] Ticket, -** authenticator[4] EncryptedData -** } -** -** APOptions ::= BIT STRING { -** reserved(0), use-session-key(1), mutual-required(2) } -*/ -typedef struct krb5_ap_req_st - { - ASN1_INTEGER *pvno; - ASN1_INTEGER *msgtype; - ASN1_BIT_STRING *apoptions; - KRB5_TICKET *ticket; - KRB5_ENCDATA *authenticator; - } KRB5_APREQBODY; - -typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ; -DECLARE_STACK_OF(KRB5_APREQBODY) - - -/* Authenticator Stuff */ - - -/* Checksum ::= SEQUENCE { -** cksumtype[0] INTEGER, -** checksum[1] OCTET STRING -** } -*/ -typedef struct krb5_checksum_st - { - ASN1_INTEGER *ctype; - ASN1_OCTET_STRING *checksum; - } KRB5_CHECKSUM; - -DECLARE_STACK_OF(KRB5_CHECKSUM) - - -/* EncryptionKey ::= SEQUENCE { -** keytype[0] INTEGER, -** keyvalue[1] OCTET STRING -** } -*/ -typedef struct krb5_encryptionkey_st - { - ASN1_INTEGER *ktype; - ASN1_OCTET_STRING *keyvalue; - } KRB5_ENCKEY; - -DECLARE_STACK_OF(KRB5_ENCKEY) - - -/* AuthorizationData ::= SEQUENCE OF SEQUENCE { -** ad-type[0] INTEGER, -** ad-data[1] OCTET STRING -** } -*/ -typedef struct krb5_authorization_st - { - ASN1_INTEGER *adtype; - ASN1_OCTET_STRING *addata; - } KRB5_AUTHDATA; - -DECLARE_STACK_OF(KRB5_AUTHDATA) - - -/* -- Unencrypted authenticator -** Authenticator ::= [APPLICATION 2] SEQUENCE { -** authenticator-vno[0] INTEGER, -** crealm[1] Realm, -** cname[2] PrincipalName, -** cksum[3] Checksum OPTIONAL, -** cusec[4] INTEGER, -** ctime[5] KerberosTime, -** subkey[6] EncryptionKey OPTIONAL, -** seq-number[7] INTEGER OPTIONAL, -** authorization-data[8] AuthorizationData OPTIONAL -** } -*/ -typedef struct krb5_authenticator_st - { - ASN1_INTEGER *avno; - ASN1_GENERALSTRING *crealm; - KRB5_PRINCNAME *cname; - KRB5_CHECKSUM *cksum; - ASN1_INTEGER *cusec; - ASN1_GENERALIZEDTIME *ctime; - KRB5_ENCKEY *subkey; - ASN1_INTEGER *seqnum; - KRB5_AUTHDATA *authorization; - } KRB5_AUTHENTBODY; - -typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT; -DECLARE_STACK_OF(KRB5_AUTHENTBODY) - - -/* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) = -** type *name##_new(void); -** void name##_free(type *a); -** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) = -** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = -** type *d2i_##name(type **a, const unsigned char **in, long len); -** int i2d_##name(type *a, unsigned char **out); -** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it -*/ - -DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA) -DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME) -DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_TICKET) -DECLARE_ASN1_FUNCTIONS(KRB5_APREQ) - -DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM) -DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT) - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/dep/include/openssl/kssl.h b/dep/include/openssl/kssl.h deleted file mode 100644 index e920e1ceea7..00000000000 --- a/dep/include/openssl/kssl.h +++ /dev/null @@ -1,180 +0,0 @@ -/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ -/* Written by Vern Staats for the OpenSSL project 2000. - * project 2000. - */ -/* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -/* -** 19990701 VRS Started. -*/ - -#ifndef KSSL_H -#define KSSL_H - -#include - -#ifndef OPENSSL_NO_KRB5 - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Depending on which KRB5 implementation used, some types from -** the other may be missing. Resolve that here and now -*/ -#ifdef KRB5_HEIMDAL -typedef unsigned char krb5_octet; -#define FAR -#else - -#ifndef FAR -#define FAR -#endif - -#endif - -/* Uncomment this to debug kssl problems or -** to trace usage of the Kerberos session key -** -** #define KSSL_DEBUG -*/ - -#ifndef KRB5SVC -#define KRB5SVC "host" -#endif - -#ifndef KRB5KEYTAB -#define KRB5KEYTAB "/etc/krb5.keytab" -#endif - -#ifndef KRB5SENDAUTH -#define KRB5SENDAUTH 1 -#endif - -#ifndef KRB5CHECKAUTH -#define KRB5CHECKAUTH 1 -#endif - -#ifndef KSSL_CLOCKSKEW -#define KSSL_CLOCKSKEW 300; -#endif - -#define KSSL_ERR_MAX 255 -typedef struct kssl_err_st { - int reason; - char text[KSSL_ERR_MAX+1]; - } KSSL_ERR; - - -/* Context for passing -** (1) Kerberos session key to SSL, and -** (2) Config data between application and SSL lib -*/ -typedef struct kssl_ctx_st - { - /* used by: disposition: */ - char *service_name; /* C,S default ok (kssl) */ - char *service_host; /* C input, REQUIRED */ - char *client_princ; /* S output from krb5 ticket */ - char *keytab_file; /* S NULL (/etc/krb5.keytab) */ - char *cred_cache; /* C NULL (default) */ - krb5_enctype enctype; - int length; - krb5_octet FAR *key; - } KSSL_CTX; - -#define KSSL_CLIENT 1 -#define KSSL_SERVER 2 -#define KSSL_SERVICE 3 -#define KSSL_KEYTAB 4 - -#define KSSL_CTX_OK 0 -#define KSSL_CTX_ERR 1 -#define KSSL_NOMEM 2 - -/* Public (for use by applications that use OpenSSL with Kerberos 5 support */ -krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); -KSSL_CTX *kssl_ctx_new(void); -KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); -void kssl_ctx_show(KSSL_CTX *kssl_ctx); -krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, - krb5_data *realm, krb5_data *entity, int nentities); -krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, - krb5_data *authenp, KSSL_ERR *kssl_err); -krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, - krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); -krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); -void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); -void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); -krb5_error_code kssl_build_principal_2(krb5_context context, - krb5_principal *princ, int rlen, const char *realm, - int slen, const char *svc, int hlen, const char *host); -krb5_error_code kssl_validate_times(krb5_timestamp atime, - krb5_ticket_times *ttimes); -krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, - krb5_timestamp *atimep, KSSL_ERR *kssl_err); -unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); - -#ifdef __cplusplus -} -#endif -#endif /* OPENSSL_NO_KRB5 */ -#endif /* KSSL_H */ - diff --git a/dep/include/openssl/lhash.h b/dep/include/openssl/lhash.h deleted file mode 100644 index 9ae674e6c3e..00000000000 --- a/dep/include/openssl/lhash.h +++ /dev/null @@ -1,201 +0,0 @@ -/* crypto/lhash/lhash.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -/* Header for dynamic hash table routines - * Author - Eric Young - */ - -#ifndef HEADER_LHASH_H -#define HEADER_LHASH_H - -#include -#ifndef OPENSSL_NO_FP_API -#include -#endif - -#ifndef OPENSSL_NO_BIO -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct lhash_node_st - { - void *data; - struct lhash_node_st *next; -#ifndef OPENSSL_NO_HASH_COMP - unsigned long hash; -#endif - } LHASH_NODE; - -typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); -typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); -typedef void (*LHASH_DOALL_FN_TYPE)(void *); -typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *); - -/* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. - * This way, callbacks can be provided to LHASH structures without function - * pointer casting and the macro-defined callbacks provide per-variable casting - * before deferring to the underlying type-specific callbacks. NB: It is - * possible to place a "static" in front of both the DECLARE and IMPLEMENT - * macros if the functions are strictly internal. */ - -/* First: "hash" functions */ -#define DECLARE_LHASH_HASH_FN(f_name,o_type) \ - unsigned long f_name##_LHASH_HASH(const void *); -#define IMPLEMENT_LHASH_HASH_FN(f_name,o_type) \ - unsigned long f_name##_LHASH_HASH(const void *arg) { \ - o_type a = (o_type)arg; \ - return f_name(a); } -#define LHASH_HASH_FN(f_name) f_name##_LHASH_HASH - -/* Second: "compare" functions */ -#define DECLARE_LHASH_COMP_FN(f_name,o_type) \ - int f_name##_LHASH_COMP(const void *, const void *); -#define IMPLEMENT_LHASH_COMP_FN(f_name,o_type) \ - int f_name##_LHASH_COMP(const void *arg1, const void *arg2) { \ - o_type a = (o_type)arg1; \ - o_type b = (o_type)arg2; \ - return f_name(a,b); } -#define LHASH_COMP_FN(f_name) f_name##_LHASH_COMP - -/* Third: "doall" functions */ -#define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ - void f_name##_LHASH_DOALL(void *); -#define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ - void f_name##_LHASH_DOALL(void *arg) { \ - o_type a = (o_type)arg; \ - f_name(a); } -#define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL - -/* Fourth: "doall_arg" functions */ -#define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ - void f_name##_LHASH_DOALL_ARG(void *, void *); -#define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ - void f_name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ - o_type a = (o_type)arg1; \ - a_type b = (a_type)arg2; \ - f_name(a,b); } -#define LHASH_DOALL_ARG_FN(f_name) f_name##_LHASH_DOALL_ARG - -typedef struct lhash_st - { - LHASH_NODE **b; - LHASH_COMP_FN_TYPE comp; - LHASH_HASH_FN_TYPE hash; - unsigned int num_nodes; - unsigned int num_alloc_nodes; - unsigned int p; - unsigned int pmax; - unsigned long up_load; /* load times 256 */ - unsigned long down_load; /* load times 256 */ - unsigned long num_items; - - unsigned long num_expands; - unsigned long num_expand_reallocs; - unsigned long num_contracts; - unsigned long num_contract_reallocs; - unsigned long num_hash_calls; - unsigned long num_comp_calls; - unsigned long num_insert; - unsigned long num_replace; - unsigned long num_delete; - unsigned long num_no_delete; - unsigned long num_retrieve; - unsigned long num_retrieve_miss; - unsigned long num_hash_comps; - - int error; - } LHASH; - -#define LH_LOAD_MULT 256 - -/* Indicates a malloc() error in the last call, this is only bad - * in lh_insert(). */ -#define lh_error(lh) ((lh)->error) - -LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); -void lh_free(LHASH *lh); -void *lh_insert(LHASH *lh, void *data); -void *lh_delete(LHASH *lh, const void *data); -void *lh_retrieve(LHASH *lh, const void *data); -void lh_doall(LHASH *lh, LHASH_DOALL_FN_TYPE func); -void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); -unsigned long lh_strhash(const char *c); -unsigned long lh_num_items(const LHASH *lh); - -#ifndef OPENSSL_NO_FP_API -void lh_stats(const LHASH *lh, FILE *out); -void lh_node_stats(const LHASH *lh, FILE *out); -void lh_node_usage_stats(const LHASH *lh, FILE *out); -#endif - -#ifndef OPENSSL_NO_BIO -void lh_stats_bio(const LHASH *lh, BIO *out); -void lh_node_stats_bio(const LHASH *lh, BIO *out); -void lh_node_usage_stats_bio(const LHASH *lh, BIO *out); -#endif -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/dep/include/openssl/md2.h b/dep/include/openssl/md2.h deleted file mode 100644 index d59c9f25931..00000000000 --- a/dep/include/openssl/md2.h +++ /dev/null @@ -1,95 +0,0 @@ -/* crypto/md/md2.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD2_H -#define HEADER_MD2_H - -#include /* OPENSSL_NO_MD2, MD2_INT */ -#ifdef OPENSSL_NO_MD2 -#error MD2 is disabled. -#endif -#include - -#define MD2_DIGEST_LENGTH 16 -#define MD2_BLOCK 16 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct MD2state_st - { - unsigned int num; - unsigned char data[MD2_BLOCK]; - MD2_INT cksm[MD2_BLOCK]; - MD2_INT state[MD2_BLOCK]; - } MD2_CTX; - -const char *MD2_options(void); -#ifdef OPENSSL_FIPS -int private_MD2_Init(MD2_CTX *c); -#endif -int MD2_Init(MD2_CTX *c); -int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); -int MD2_Final(unsigned char *md, MD2_CTX *c); -unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/md4.h b/dep/include/openssl/md4.h deleted file mode 100644 index ba1fe4a6ee8..00000000000 --- a/dep/include/openssl/md4.h +++ /dev/null @@ -1,120 +0,0 @@ -/* crypto/md4/md4.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD4_H -#define HEADER_MD4_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_MD4 -#error MD4 is disabled. -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD4_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) -#define MD4_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define MD4_LONG unsigned long -#define MD4_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -#else -#define MD4_LONG unsigned int -#endif - -#define MD4_CBLOCK 64 -#define MD4_LBLOCK (MD4_CBLOCK/4) -#define MD4_DIGEST_LENGTH 16 - -typedef struct MD4state_st - { - MD4_LONG A,B,C,D; - MD4_LONG Nl,Nh; - MD4_LONG data[MD4_LBLOCK]; - unsigned int num; - } MD4_CTX; - -#ifdef OPENSSL_FIPS -int private_MD4_Init(MD4_CTX *c); -#endif -int MD4_Init(MD4_CTX *c); -int MD4_Update(MD4_CTX *c, const void *data, size_t len); -int MD4_Final(unsigned char *md, MD4_CTX *c); -unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); -void MD4_Transform(MD4_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/md5.h b/dep/include/openssl/md5.h deleted file mode 100644 index 0761f84a27b..00000000000 --- a/dep/include/openssl/md5.h +++ /dev/null @@ -1,120 +0,0 @@ -/* crypto/md5/md5.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD5_H -#define HEADER_MD5_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_MD5 -#error MD5 is disabled. -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD5_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) -#define MD5_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define MD5_LONG unsigned long -#define MD5_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -#else -#define MD5_LONG unsigned int -#endif - -#define MD5_CBLOCK 64 -#define MD5_LBLOCK (MD5_CBLOCK/4) -#define MD5_DIGEST_LENGTH 16 - -typedef struct MD5state_st - { - MD5_LONG A,B,C,D; - MD5_LONG Nl,Nh; - MD5_LONG data[MD5_LBLOCK]; - unsigned int num; - } MD5_CTX; - -#ifdef OPENSSL_FIPS -int private_MD5_Init(MD5_CTX *c); -#endif -int MD5_Init(MD5_CTX *c); -int MD5_Update(MD5_CTX *c, const void *data, size_t len); -int MD5_Final(unsigned char *md, MD5_CTX *c); -unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); -void MD5_Transform(MD5_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/obj_mac.h b/dep/include/openssl/obj_mac.h deleted file mode 100644 index ad5f7cfc104..00000000000 --- a/dep/include/openssl/obj_mac.h +++ /dev/null @@ -1,3775 +0,0 @@ -/* crypto/objects/obj_mac.h */ - -/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the - * following command: - * perl objects.pl objects.txt obj_mac.num obj_mac.h - */ - -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#define SN_undef "UNDEF" -#define LN_undef "undefined" -#define NID_undef 0 -#define OBJ_undef 0L - -#define SN_itu_t "ITU-T" -#define LN_itu_t "itu-t" -#define NID_itu_t 645 -#define OBJ_itu_t 0L - -#define NID_ccitt 404 -#define OBJ_ccitt OBJ_itu_t - -#define SN_iso "ISO" -#define LN_iso "iso" -#define NID_iso 181 -#define OBJ_iso 1L - -#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" -#define LN_joint_iso_itu_t "joint-iso-itu-t" -#define NID_joint_iso_itu_t 646 -#define OBJ_joint_iso_itu_t 2L - -#define NID_joint_iso_ccitt 393 -#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t - -#define SN_member_body "member-body" -#define LN_member_body "ISO Member Body" -#define NID_member_body 182 -#define OBJ_member_body OBJ_iso,2L - -#define SN_identified_organization "identified-organization" -#define NID_identified_organization 676 -#define OBJ_identified_organization OBJ_iso,3L - -#define SN_hmac_md5 "HMAC-MD5" -#define LN_hmac_md5 "hmac-md5" -#define NID_hmac_md5 780 -#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L - -#define SN_hmac_sha1 "HMAC-SHA1" -#define LN_hmac_sha1 "hmac-sha1" -#define NID_hmac_sha1 781 -#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L - -#define SN_certicom_arc "certicom-arc" -#define NID_certicom_arc 677 -#define OBJ_certicom_arc OBJ_identified_organization,132L - -#define SN_international_organizations "international-organizations" -#define LN_international_organizations "International Organizations" -#define NID_international_organizations 647 -#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L - -#define SN_wap "wap" -#define NID_wap 678 -#define OBJ_wap OBJ_international_organizations,43L - -#define SN_wap_wsg "wap-wsg" -#define NID_wap_wsg 679 -#define OBJ_wap_wsg OBJ_wap,13L - -#define SN_selected_attribute_types "selected-attribute-types" -#define LN_selected_attribute_types "Selected Attribute Types" -#define NID_selected_attribute_types 394 -#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L - -#define SN_clearance "clearance" -#define NID_clearance 395 -#define OBJ_clearance OBJ_selected_attribute_types,55L - -#define SN_ISO_US "ISO-US" -#define LN_ISO_US "ISO US Member Body" -#define NID_ISO_US 183 -#define OBJ_ISO_US OBJ_member_body,840L - -#define SN_X9_57 "X9-57" -#define LN_X9_57 "X9.57" -#define NID_X9_57 184 -#define OBJ_X9_57 OBJ_ISO_US,10040L - -#define SN_X9cm "X9cm" -#define LN_X9cm "X9.57 CM ?" -#define NID_X9cm 185 -#define OBJ_X9cm OBJ_X9_57,4L - -#define SN_dsa "DSA" -#define LN_dsa "dsaEncryption" -#define NID_dsa 116 -#define OBJ_dsa OBJ_X9cm,1L - -#define SN_dsaWithSHA1 "DSA-SHA1" -#define LN_dsaWithSHA1 "dsaWithSHA1" -#define NID_dsaWithSHA1 113 -#define OBJ_dsaWithSHA1 OBJ_X9cm,3L - -#define SN_ansi_X9_62 "ansi-X9-62" -#define LN_ansi_X9_62 "ANSI X9.62" -#define NID_ansi_X9_62 405 -#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L - -#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L - -#define SN_X9_62_prime_field "prime-field" -#define NID_X9_62_prime_field 406 -#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L - -#define SN_X9_62_characteristic_two_field "characteristic-two-field" -#define NID_X9_62_characteristic_two_field 407 -#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L - -#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" -#define NID_X9_62_id_characteristic_two_basis 680 -#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L - -#define SN_X9_62_onBasis "onBasis" -#define NID_X9_62_onBasis 681 -#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L - -#define SN_X9_62_tpBasis "tpBasis" -#define NID_X9_62_tpBasis 682 -#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L - -#define SN_X9_62_ppBasis "ppBasis" -#define NID_X9_62_ppBasis 683 -#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L - -#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L - -#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" -#define NID_X9_62_id_ecPublicKey 408 -#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L - -#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L - -#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L - -#define SN_X9_62_c2pnb163v1 "c2pnb163v1" -#define NID_X9_62_c2pnb163v1 684 -#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L - -#define SN_X9_62_c2pnb163v2 "c2pnb163v2" -#define NID_X9_62_c2pnb163v2 685 -#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L - -#define SN_X9_62_c2pnb163v3 "c2pnb163v3" -#define NID_X9_62_c2pnb163v3 686 -#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L - -#define SN_X9_62_c2pnb176v1 "c2pnb176v1" -#define NID_X9_62_c2pnb176v1 687 -#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L - -#define SN_X9_62_c2tnb191v1 "c2tnb191v1" -#define NID_X9_62_c2tnb191v1 688 -#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L - -#define SN_X9_62_c2tnb191v2 "c2tnb191v2" -#define NID_X9_62_c2tnb191v2 689 -#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L - -#define SN_X9_62_c2tnb191v3 "c2tnb191v3" -#define NID_X9_62_c2tnb191v3 690 -#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L - -#define SN_X9_62_c2onb191v4 "c2onb191v4" -#define NID_X9_62_c2onb191v4 691 -#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L - -#define SN_X9_62_c2onb191v5 "c2onb191v5" -#define NID_X9_62_c2onb191v5 692 -#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L - -#define SN_X9_62_c2pnb208w1 "c2pnb208w1" -#define NID_X9_62_c2pnb208w1 693 -#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L - -#define SN_X9_62_c2tnb239v1 "c2tnb239v1" -#define NID_X9_62_c2tnb239v1 694 -#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L - -#define SN_X9_62_c2tnb239v2 "c2tnb239v2" -#define NID_X9_62_c2tnb239v2 695 -#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L - -#define SN_X9_62_c2tnb239v3 "c2tnb239v3" -#define NID_X9_62_c2tnb239v3 696 -#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L - -#define SN_X9_62_c2onb239v4 "c2onb239v4" -#define NID_X9_62_c2onb239v4 697 -#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L - -#define SN_X9_62_c2onb239v5 "c2onb239v5" -#define NID_X9_62_c2onb239v5 698 -#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L - -#define SN_X9_62_c2pnb272w1 "c2pnb272w1" -#define NID_X9_62_c2pnb272w1 699 -#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L - -#define SN_X9_62_c2pnb304w1 "c2pnb304w1" -#define NID_X9_62_c2pnb304w1 700 -#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L - -#define SN_X9_62_c2tnb359v1 "c2tnb359v1" -#define NID_X9_62_c2tnb359v1 701 -#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L - -#define SN_X9_62_c2pnb368w1 "c2pnb368w1" -#define NID_X9_62_c2pnb368w1 702 -#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L - -#define SN_X9_62_c2tnb431r1 "c2tnb431r1" -#define NID_X9_62_c2tnb431r1 703 -#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L - -#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L - -#define SN_X9_62_prime192v1 "prime192v1" -#define NID_X9_62_prime192v1 409 -#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L - -#define SN_X9_62_prime192v2 "prime192v2" -#define NID_X9_62_prime192v2 410 -#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L - -#define SN_X9_62_prime192v3 "prime192v3" -#define NID_X9_62_prime192v3 411 -#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L - -#define SN_X9_62_prime239v1 "prime239v1" -#define NID_X9_62_prime239v1 412 -#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L - -#define SN_X9_62_prime239v2 "prime239v2" -#define NID_X9_62_prime239v2 413 -#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L - -#define SN_X9_62_prime239v3 "prime239v3" -#define NID_X9_62_prime239v3 414 -#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L - -#define SN_X9_62_prime256v1 "prime256v1" -#define NID_X9_62_prime256v1 415 -#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L - -#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L - -#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" -#define NID_ecdsa_with_SHA1 416 -#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L - -#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" -#define NID_ecdsa_with_Recommended 791 -#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L - -#define SN_ecdsa_with_Specified "ecdsa-with-Specified" -#define NID_ecdsa_with_Specified 792 -#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L - -#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" -#define NID_ecdsa_with_SHA224 793 -#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L - -#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" -#define NID_ecdsa_with_SHA256 794 -#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L - -#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" -#define NID_ecdsa_with_SHA384 795 -#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L - -#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" -#define NID_ecdsa_with_SHA512 796 -#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L - -#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L - -#define SN_secp112r1 "secp112r1" -#define NID_secp112r1 704 -#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L - -#define SN_secp112r2 "secp112r2" -#define NID_secp112r2 705 -#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L - -#define SN_secp128r1 "secp128r1" -#define NID_secp128r1 706 -#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L - -#define SN_secp128r2 "secp128r2" -#define NID_secp128r2 707 -#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L - -#define SN_secp160k1 "secp160k1" -#define NID_secp160k1 708 -#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L - -#define SN_secp160r1 "secp160r1" -#define NID_secp160r1 709 -#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L - -#define SN_secp160r2 "secp160r2" -#define NID_secp160r2 710 -#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L - -#define SN_secp192k1 "secp192k1" -#define NID_secp192k1 711 -#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L - -#define SN_secp224k1 "secp224k1" -#define NID_secp224k1 712 -#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L - -#define SN_secp224r1 "secp224r1" -#define NID_secp224r1 713 -#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L - -#define SN_secp256k1 "secp256k1" -#define NID_secp256k1 714 -#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L - -#define SN_secp384r1 "secp384r1" -#define NID_secp384r1 715 -#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L - -#define SN_secp521r1 "secp521r1" -#define NID_secp521r1 716 -#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L - -#define SN_sect113r1 "sect113r1" -#define NID_sect113r1 717 -#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L - -#define SN_sect113r2 "sect113r2" -#define NID_sect113r2 718 -#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L - -#define SN_sect131r1 "sect131r1" -#define NID_sect131r1 719 -#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L - -#define SN_sect131r2 "sect131r2" -#define NID_sect131r2 720 -#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L - -#define SN_sect163k1 "sect163k1" -#define NID_sect163k1 721 -#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L - -#define SN_sect163r1 "sect163r1" -#define NID_sect163r1 722 -#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L - -#define SN_sect163r2 "sect163r2" -#define NID_sect163r2 723 -#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L - -#define SN_sect193r1 "sect193r1" -#define NID_sect193r1 724 -#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L - -#define SN_sect193r2 "sect193r2" -#define NID_sect193r2 725 -#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L - -#define SN_sect233k1 "sect233k1" -#define NID_sect233k1 726 -#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L - -#define SN_sect233r1 "sect233r1" -#define NID_sect233r1 727 -#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L - -#define SN_sect239k1 "sect239k1" -#define NID_sect239k1 728 -#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L - -#define SN_sect283k1 "sect283k1" -#define NID_sect283k1 729 -#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L - -#define SN_sect283r1 "sect283r1" -#define NID_sect283r1 730 -#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L - -#define SN_sect409k1 "sect409k1" -#define NID_sect409k1 731 -#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L - -#define SN_sect409r1 "sect409r1" -#define NID_sect409r1 732 -#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L - -#define SN_sect571k1 "sect571k1" -#define NID_sect571k1 733 -#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L - -#define SN_sect571r1 "sect571r1" -#define NID_sect571r1 734 -#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L - -#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L - -#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" -#define NID_wap_wsg_idm_ecid_wtls1 735 -#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L - -#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" -#define NID_wap_wsg_idm_ecid_wtls3 736 -#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L - -#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" -#define NID_wap_wsg_idm_ecid_wtls4 737 -#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L - -#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" -#define NID_wap_wsg_idm_ecid_wtls5 738 -#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L - -#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" -#define NID_wap_wsg_idm_ecid_wtls6 739 -#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L - -#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" -#define NID_wap_wsg_idm_ecid_wtls7 740 -#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L - -#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" -#define NID_wap_wsg_idm_ecid_wtls8 741 -#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L - -#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" -#define NID_wap_wsg_idm_ecid_wtls9 742 -#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L - -#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" -#define NID_wap_wsg_idm_ecid_wtls10 743 -#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L - -#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" -#define NID_wap_wsg_idm_ecid_wtls11 744 -#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L - -#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" -#define NID_wap_wsg_idm_ecid_wtls12 745 -#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L - -#define SN_cast5_cbc "CAST5-CBC" -#define LN_cast5_cbc "cast5-cbc" -#define NID_cast5_cbc 108 -#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L - -#define SN_cast5_ecb "CAST5-ECB" -#define LN_cast5_ecb "cast5-ecb" -#define NID_cast5_ecb 109 - -#define SN_cast5_cfb64 "CAST5-CFB" -#define LN_cast5_cfb64 "cast5-cfb" -#define NID_cast5_cfb64 110 - -#define SN_cast5_ofb64 "CAST5-OFB" -#define LN_cast5_ofb64 "cast5-ofb" -#define NID_cast5_ofb64 111 - -#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" -#define NID_pbeWithMD5AndCast5_CBC 112 -#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L - -#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" -#define LN_id_PasswordBasedMAC "password based MAC" -#define NID_id_PasswordBasedMAC 782 -#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L - -#define SN_id_DHBasedMac "id-DHBasedMac" -#define LN_id_DHBasedMac "Diffie-Hellman based MAC" -#define NID_id_DHBasedMac 783 -#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L - -#define SN_rsadsi "rsadsi" -#define LN_rsadsi "RSA Data Security, Inc." -#define NID_rsadsi 1 -#define OBJ_rsadsi OBJ_ISO_US,113549L - -#define SN_pkcs "pkcs" -#define LN_pkcs "RSA Data Security, Inc. PKCS" -#define NID_pkcs 2 -#define OBJ_pkcs OBJ_rsadsi,1L - -#define SN_pkcs1 "pkcs1" -#define NID_pkcs1 186 -#define OBJ_pkcs1 OBJ_pkcs,1L - -#define LN_rsaEncryption "rsaEncryption" -#define NID_rsaEncryption 6 -#define OBJ_rsaEncryption OBJ_pkcs1,1L - -#define SN_md2WithRSAEncryption "RSA-MD2" -#define LN_md2WithRSAEncryption "md2WithRSAEncryption" -#define NID_md2WithRSAEncryption 7 -#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L - -#define SN_md4WithRSAEncryption "RSA-MD4" -#define LN_md4WithRSAEncryption "md4WithRSAEncryption" -#define NID_md4WithRSAEncryption 396 -#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L - -#define SN_md5WithRSAEncryption "RSA-MD5" -#define LN_md5WithRSAEncryption "md5WithRSAEncryption" -#define NID_md5WithRSAEncryption 8 -#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L - -#define SN_sha1WithRSAEncryption "RSA-SHA1" -#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" -#define NID_sha1WithRSAEncryption 65 -#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L - -#define SN_sha256WithRSAEncryption "RSA-SHA256" -#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" -#define NID_sha256WithRSAEncryption 668 -#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L - -#define SN_sha384WithRSAEncryption "RSA-SHA384" -#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" -#define NID_sha384WithRSAEncryption 669 -#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L - -#define SN_sha512WithRSAEncryption "RSA-SHA512" -#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" -#define NID_sha512WithRSAEncryption 670 -#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L - -#define SN_sha224WithRSAEncryption "RSA-SHA224" -#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" -#define NID_sha224WithRSAEncryption 671 -#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L - -#define SN_pkcs3 "pkcs3" -#define NID_pkcs3 27 -#define OBJ_pkcs3 OBJ_pkcs,3L - -#define LN_dhKeyAgreement "dhKeyAgreement" -#define NID_dhKeyAgreement 28 -#define OBJ_dhKeyAgreement OBJ_pkcs3,1L - -#define SN_pkcs5 "pkcs5" -#define NID_pkcs5 187 -#define OBJ_pkcs5 OBJ_pkcs,5L - -#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" -#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" -#define NID_pbeWithMD2AndDES_CBC 9 -#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L - -#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" -#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" -#define NID_pbeWithMD5AndDES_CBC 10 -#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L - -#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" -#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" -#define NID_pbeWithMD2AndRC2_CBC 168 -#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L - -#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" -#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" -#define NID_pbeWithMD5AndRC2_CBC 169 -#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L - -#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" -#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" -#define NID_pbeWithSHA1AndDES_CBC 170 -#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L - -#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" -#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" -#define NID_pbeWithSHA1AndRC2_CBC 68 -#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L - -#define LN_id_pbkdf2 "PBKDF2" -#define NID_id_pbkdf2 69 -#define OBJ_id_pbkdf2 OBJ_pkcs5,12L - -#define LN_pbes2 "PBES2" -#define NID_pbes2 161 -#define OBJ_pbes2 OBJ_pkcs5,13L - -#define LN_pbmac1 "PBMAC1" -#define NID_pbmac1 162 -#define OBJ_pbmac1 OBJ_pkcs5,14L - -#define SN_pkcs7 "pkcs7" -#define NID_pkcs7 20 -#define OBJ_pkcs7 OBJ_pkcs,7L - -#define LN_pkcs7_data "pkcs7-data" -#define NID_pkcs7_data 21 -#define OBJ_pkcs7_data OBJ_pkcs7,1L - -#define LN_pkcs7_signed "pkcs7-signedData" -#define NID_pkcs7_signed 22 -#define OBJ_pkcs7_signed OBJ_pkcs7,2L - -#define LN_pkcs7_enveloped "pkcs7-envelopedData" -#define NID_pkcs7_enveloped 23 -#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L - -#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" -#define NID_pkcs7_signedAndEnveloped 24 -#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L - -#define LN_pkcs7_digest "pkcs7-digestData" -#define NID_pkcs7_digest 25 -#define OBJ_pkcs7_digest OBJ_pkcs7,5L - -#define LN_pkcs7_encrypted "pkcs7-encryptedData" -#define NID_pkcs7_encrypted 26 -#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L - -#define SN_pkcs9 "pkcs9" -#define NID_pkcs9 47 -#define OBJ_pkcs9 OBJ_pkcs,9L - -#define LN_pkcs9_emailAddress "emailAddress" -#define NID_pkcs9_emailAddress 48 -#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L - -#define LN_pkcs9_unstructuredName "unstructuredName" -#define NID_pkcs9_unstructuredName 49 -#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L - -#define LN_pkcs9_contentType "contentType" -#define NID_pkcs9_contentType 50 -#define OBJ_pkcs9_contentType OBJ_pkcs9,3L - -#define LN_pkcs9_messageDigest "messageDigest" -#define NID_pkcs9_messageDigest 51 -#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L - -#define LN_pkcs9_signingTime "signingTime" -#define NID_pkcs9_signingTime 52 -#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L - -#define LN_pkcs9_countersignature "countersignature" -#define NID_pkcs9_countersignature 53 -#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L - -#define LN_pkcs9_challengePassword "challengePassword" -#define NID_pkcs9_challengePassword 54 -#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L - -#define LN_pkcs9_unstructuredAddress "unstructuredAddress" -#define NID_pkcs9_unstructuredAddress 55 -#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L - -#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" -#define NID_pkcs9_extCertAttributes 56 -#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L - -#define SN_ext_req "extReq" -#define LN_ext_req "Extension Request" -#define NID_ext_req 172 -#define OBJ_ext_req OBJ_pkcs9,14L - -#define SN_SMIMECapabilities "SMIME-CAPS" -#define LN_SMIMECapabilities "S/MIME Capabilities" -#define NID_SMIMECapabilities 167 -#define OBJ_SMIMECapabilities OBJ_pkcs9,15L - -#define SN_SMIME "SMIME" -#define LN_SMIME "S/MIME" -#define NID_SMIME 188 -#define OBJ_SMIME OBJ_pkcs9,16L - -#define SN_id_smime_mod "id-smime-mod" -#define NID_id_smime_mod 189 -#define OBJ_id_smime_mod OBJ_SMIME,0L - -#define SN_id_smime_ct "id-smime-ct" -#define NID_id_smime_ct 190 -#define OBJ_id_smime_ct OBJ_SMIME,1L - -#define SN_id_smime_aa "id-smime-aa" -#define NID_id_smime_aa 191 -#define OBJ_id_smime_aa OBJ_SMIME,2L - -#define SN_id_smime_alg "id-smime-alg" -#define NID_id_smime_alg 192 -#define OBJ_id_smime_alg OBJ_SMIME,3L - -#define SN_id_smime_cd "id-smime-cd" -#define NID_id_smime_cd 193 -#define OBJ_id_smime_cd OBJ_SMIME,4L - -#define SN_id_smime_spq "id-smime-spq" -#define NID_id_smime_spq 194 -#define OBJ_id_smime_spq OBJ_SMIME,5L - -#define SN_id_smime_cti "id-smime-cti" -#define NID_id_smime_cti 195 -#define OBJ_id_smime_cti OBJ_SMIME,6L - -#define SN_id_smime_mod_cms "id-smime-mod-cms" -#define NID_id_smime_mod_cms 196 -#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L - -#define SN_id_smime_mod_ess "id-smime-mod-ess" -#define NID_id_smime_mod_ess 197 -#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L - -#define SN_id_smime_mod_oid "id-smime-mod-oid" -#define NID_id_smime_mod_oid 198 -#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L - -#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" -#define NID_id_smime_mod_msg_v3 199 -#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L - -#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" -#define NID_id_smime_mod_ets_eSignature_88 200 -#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L - -#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" -#define NID_id_smime_mod_ets_eSignature_97 201 -#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L - -#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" -#define NID_id_smime_mod_ets_eSigPolicy_88 202 -#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L - -#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" -#define NID_id_smime_mod_ets_eSigPolicy_97 203 -#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L - -#define SN_id_smime_ct_receipt "id-smime-ct-receipt" -#define NID_id_smime_ct_receipt 204 -#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L - -#define SN_id_smime_ct_authData "id-smime-ct-authData" -#define NID_id_smime_ct_authData 205 -#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L - -#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" -#define NID_id_smime_ct_publishCert 206 -#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L - -#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" -#define NID_id_smime_ct_TSTInfo 207 -#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L - -#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" -#define NID_id_smime_ct_TDTInfo 208 -#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L - -#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" -#define NID_id_smime_ct_contentInfo 209 -#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L - -#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" -#define NID_id_smime_ct_DVCSRequestData 210 -#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L - -#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" -#define NID_id_smime_ct_DVCSResponseData 211 -#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L - -#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" -#define NID_id_smime_ct_compressedData 786 -#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L - -#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" -#define NID_id_ct_asciiTextWithCRLF 787 -#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L - -#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" -#define NID_id_smime_aa_receiptRequest 212 -#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L - -#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" -#define NID_id_smime_aa_securityLabel 213 -#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L - -#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" -#define NID_id_smime_aa_mlExpandHistory 214 -#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L - -#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" -#define NID_id_smime_aa_contentHint 215 -#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L - -#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" -#define NID_id_smime_aa_msgSigDigest 216 -#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L - -#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" -#define NID_id_smime_aa_encapContentType 217 -#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L - -#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" -#define NID_id_smime_aa_contentIdentifier 218 -#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L - -#define SN_id_smime_aa_macValue "id-smime-aa-macValue" -#define NID_id_smime_aa_macValue 219 -#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L - -#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" -#define NID_id_smime_aa_equivalentLabels 220 -#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L - -#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" -#define NID_id_smime_aa_contentReference 221 -#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L - -#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" -#define NID_id_smime_aa_encrypKeyPref 222 -#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L - -#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" -#define NID_id_smime_aa_signingCertificate 223 -#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L - -#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" -#define NID_id_smime_aa_smimeEncryptCerts 224 -#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L - -#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" -#define NID_id_smime_aa_timeStampToken 225 -#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L - -#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" -#define NID_id_smime_aa_ets_sigPolicyId 226 -#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L - -#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" -#define NID_id_smime_aa_ets_commitmentType 227 -#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L - -#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" -#define NID_id_smime_aa_ets_signerLocation 228 -#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L - -#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" -#define NID_id_smime_aa_ets_signerAttr 229 -#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L - -#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" -#define NID_id_smime_aa_ets_otherSigCert 230 -#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L - -#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" -#define NID_id_smime_aa_ets_contentTimestamp 231 -#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L - -#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" -#define NID_id_smime_aa_ets_CertificateRefs 232 -#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L - -#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" -#define NID_id_smime_aa_ets_RevocationRefs 233 -#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L - -#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" -#define NID_id_smime_aa_ets_certValues 234 -#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L - -#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" -#define NID_id_smime_aa_ets_revocationValues 235 -#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L - -#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" -#define NID_id_smime_aa_ets_escTimeStamp 236 -#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L - -#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" -#define NID_id_smime_aa_ets_certCRLTimestamp 237 -#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L - -#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" -#define NID_id_smime_aa_ets_archiveTimeStamp 238 -#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L - -#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" -#define NID_id_smime_aa_signatureType 239 -#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L - -#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" -#define NID_id_smime_aa_dvcs_dvc 240 -#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L - -#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" -#define NID_id_smime_alg_ESDHwith3DES 241 -#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L - -#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" -#define NID_id_smime_alg_ESDHwithRC2 242 -#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L - -#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" -#define NID_id_smime_alg_3DESwrap 243 -#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L - -#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" -#define NID_id_smime_alg_RC2wrap 244 -#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L - -#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" -#define NID_id_smime_alg_ESDH 245 -#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L - -#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" -#define NID_id_smime_alg_CMS3DESwrap 246 -#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L - -#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" -#define NID_id_smime_alg_CMSRC2wrap 247 -#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L - -#define SN_id_smime_cd_ldap "id-smime-cd-ldap" -#define NID_id_smime_cd_ldap 248 -#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L - -#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" -#define NID_id_smime_spq_ets_sqt_uri 249 -#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L - -#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" -#define NID_id_smime_spq_ets_sqt_unotice 250 -#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L - -#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" -#define NID_id_smime_cti_ets_proofOfOrigin 251 -#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L - -#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" -#define NID_id_smime_cti_ets_proofOfReceipt 252 -#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L - -#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" -#define NID_id_smime_cti_ets_proofOfDelivery 253 -#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L - -#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" -#define NID_id_smime_cti_ets_proofOfSender 254 -#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L - -#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" -#define NID_id_smime_cti_ets_proofOfApproval 255 -#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L - -#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" -#define NID_id_smime_cti_ets_proofOfCreation 256 -#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L - -#define LN_friendlyName "friendlyName" -#define NID_friendlyName 156 -#define OBJ_friendlyName OBJ_pkcs9,20L - -#define LN_localKeyID "localKeyID" -#define NID_localKeyID 157 -#define OBJ_localKeyID OBJ_pkcs9,21L - -#define SN_ms_csp_name "CSPName" -#define LN_ms_csp_name "Microsoft CSP Name" -#define NID_ms_csp_name 417 -#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L - -#define SN_LocalKeySet "LocalKeySet" -#define LN_LocalKeySet "Microsoft Local Key set" -#define NID_LocalKeySet 856 -#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L - -#define OBJ_certTypes OBJ_pkcs9,22L - -#define LN_x509Certificate "x509Certificate" -#define NID_x509Certificate 158 -#define OBJ_x509Certificate OBJ_certTypes,1L - -#define LN_sdsiCertificate "sdsiCertificate" -#define NID_sdsiCertificate 159 -#define OBJ_sdsiCertificate OBJ_certTypes,2L - -#define OBJ_crlTypes OBJ_pkcs9,23L - -#define LN_x509Crl "x509Crl" -#define NID_x509Crl 160 -#define OBJ_x509Crl OBJ_crlTypes,1L - -#define OBJ_pkcs12 OBJ_pkcs,12L - -#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L - -#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" -#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" -#define NID_pbe_WithSHA1And128BitRC4 144 -#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L - -#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" -#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" -#define NID_pbe_WithSHA1And40BitRC4 145 -#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L - -#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" -#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 -#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L - -#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" -#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 -#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L - -#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" -#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" -#define NID_pbe_WithSHA1And128BitRC2_CBC 148 -#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L - -#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" -#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" -#define NID_pbe_WithSHA1And40BitRC2_CBC 149 -#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L - -#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L - -#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L - -#define LN_keyBag "keyBag" -#define NID_keyBag 150 -#define OBJ_keyBag OBJ_pkcs12_BagIds,1L - -#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" -#define NID_pkcs8ShroudedKeyBag 151 -#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L - -#define LN_certBag "certBag" -#define NID_certBag 152 -#define OBJ_certBag OBJ_pkcs12_BagIds,3L - -#define LN_crlBag "crlBag" -#define NID_crlBag 153 -#define OBJ_crlBag OBJ_pkcs12_BagIds,4L - -#define LN_secretBag "secretBag" -#define NID_secretBag 154 -#define OBJ_secretBag OBJ_pkcs12_BagIds,5L - -#define LN_safeContentsBag "safeContentsBag" -#define NID_safeContentsBag 155 -#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L - -#define SN_md2 "MD2" -#define LN_md2 "md2" -#define NID_md2 3 -#define OBJ_md2 OBJ_rsadsi,2L,2L - -#define SN_md4 "MD4" -#define LN_md4 "md4" -#define NID_md4 257 -#define OBJ_md4 OBJ_rsadsi,2L,4L - -#define SN_md5 "MD5" -#define LN_md5 "md5" -#define NID_md5 4 -#define OBJ_md5 OBJ_rsadsi,2L,5L - -#define SN_md5_sha1 "MD5-SHA1" -#define LN_md5_sha1 "md5-sha1" -#define NID_md5_sha1 114 - -#define LN_hmacWithMD5 "hmacWithMD5" -#define NID_hmacWithMD5 797 -#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L - -#define LN_hmacWithSHA1 "hmacWithSHA1" -#define NID_hmacWithSHA1 163 -#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L - -#define LN_hmacWithSHA224 "hmacWithSHA224" -#define NID_hmacWithSHA224 798 -#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L - -#define LN_hmacWithSHA256 "hmacWithSHA256" -#define NID_hmacWithSHA256 799 -#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L - -#define LN_hmacWithSHA384 "hmacWithSHA384" -#define NID_hmacWithSHA384 800 -#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L - -#define LN_hmacWithSHA512 "hmacWithSHA512" -#define NID_hmacWithSHA512 801 -#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L - -#define SN_rc2_cbc "RC2-CBC" -#define LN_rc2_cbc "rc2-cbc" -#define NID_rc2_cbc 37 -#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L - -#define SN_rc2_ecb "RC2-ECB" -#define LN_rc2_ecb "rc2-ecb" -#define NID_rc2_ecb 38 - -#define SN_rc2_cfb64 "RC2-CFB" -#define LN_rc2_cfb64 "rc2-cfb" -#define NID_rc2_cfb64 39 - -#define SN_rc2_ofb64 "RC2-OFB" -#define LN_rc2_ofb64 "rc2-ofb" -#define NID_rc2_ofb64 40 - -#define SN_rc2_40_cbc "RC2-40-CBC" -#define LN_rc2_40_cbc "rc2-40-cbc" -#define NID_rc2_40_cbc 98 - -#define SN_rc2_64_cbc "RC2-64-CBC" -#define LN_rc2_64_cbc "rc2-64-cbc" -#define NID_rc2_64_cbc 166 - -#define SN_rc4 "RC4" -#define LN_rc4 "rc4" -#define NID_rc4 5 -#define OBJ_rc4 OBJ_rsadsi,3L,4L - -#define SN_rc4_40 "RC4-40" -#define LN_rc4_40 "rc4-40" -#define NID_rc4_40 97 - -#define SN_des_ede3_cbc "DES-EDE3-CBC" -#define LN_des_ede3_cbc "des-ede3-cbc" -#define NID_des_ede3_cbc 44 -#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L - -#define SN_rc5_cbc "RC5-CBC" -#define LN_rc5_cbc "rc5-cbc" -#define NID_rc5_cbc 120 -#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L - -#define SN_rc5_ecb "RC5-ECB" -#define LN_rc5_ecb "rc5-ecb" -#define NID_rc5_ecb 121 - -#define SN_rc5_cfb64 "RC5-CFB" -#define LN_rc5_cfb64 "rc5-cfb" -#define NID_rc5_cfb64 122 - -#define SN_rc5_ofb64 "RC5-OFB" -#define LN_rc5_ofb64 "rc5-ofb" -#define NID_rc5_ofb64 123 - -#define SN_ms_ext_req "msExtReq" -#define LN_ms_ext_req "Microsoft Extension Request" -#define NID_ms_ext_req 171 -#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L - -#define SN_ms_code_ind "msCodeInd" -#define LN_ms_code_ind "Microsoft Individual Code Signing" -#define NID_ms_code_ind 134 -#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L - -#define SN_ms_code_com "msCodeCom" -#define LN_ms_code_com "Microsoft Commercial Code Signing" -#define NID_ms_code_com 135 -#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L - -#define SN_ms_ctl_sign "msCTLSign" -#define LN_ms_ctl_sign "Microsoft Trust List Signing" -#define NID_ms_ctl_sign 136 -#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L - -#define SN_ms_sgc "msSGC" -#define LN_ms_sgc "Microsoft Server Gated Crypto" -#define NID_ms_sgc 137 -#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L - -#define SN_ms_efs "msEFS" -#define LN_ms_efs "Microsoft Encrypted File System" -#define NID_ms_efs 138 -#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L - -#define SN_ms_smartcard_login "msSmartcardLogin" -#define LN_ms_smartcard_login "Microsoft Smartcardlogin" -#define NID_ms_smartcard_login 648 -#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L - -#define SN_ms_upn "msUPN" -#define LN_ms_upn "Microsoft Universal Principal Name" -#define NID_ms_upn 649 -#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L - -#define SN_idea_cbc "IDEA-CBC" -#define LN_idea_cbc "idea-cbc" -#define NID_idea_cbc 34 -#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L - -#define SN_idea_ecb "IDEA-ECB" -#define LN_idea_ecb "idea-ecb" -#define NID_idea_ecb 36 - -#define SN_idea_cfb64 "IDEA-CFB" -#define LN_idea_cfb64 "idea-cfb" -#define NID_idea_cfb64 35 - -#define SN_idea_ofb64 "IDEA-OFB" -#define LN_idea_ofb64 "idea-ofb" -#define NID_idea_ofb64 46 - -#define SN_bf_cbc "BF-CBC" -#define LN_bf_cbc "bf-cbc" -#define NID_bf_cbc 91 -#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L - -#define SN_bf_ecb "BF-ECB" -#define LN_bf_ecb "bf-ecb" -#define NID_bf_ecb 92 - -#define SN_bf_cfb64 "BF-CFB" -#define LN_bf_cfb64 "bf-cfb" -#define NID_bf_cfb64 93 - -#define SN_bf_ofb64 "BF-OFB" -#define LN_bf_ofb64 "bf-ofb" -#define NID_bf_ofb64 94 - -#define SN_id_pkix "PKIX" -#define NID_id_pkix 127 -#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L - -#define SN_id_pkix_mod "id-pkix-mod" -#define NID_id_pkix_mod 258 -#define OBJ_id_pkix_mod OBJ_id_pkix,0L - -#define SN_id_pe "id-pe" -#define NID_id_pe 175 -#define OBJ_id_pe OBJ_id_pkix,1L - -#define SN_id_qt "id-qt" -#define NID_id_qt 259 -#define OBJ_id_qt OBJ_id_pkix,2L - -#define SN_id_kp "id-kp" -#define NID_id_kp 128 -#define OBJ_id_kp OBJ_id_pkix,3L - -#define SN_id_it "id-it" -#define NID_id_it 260 -#define OBJ_id_it OBJ_id_pkix,4L - -#define SN_id_pkip "id-pkip" -#define NID_id_pkip 261 -#define OBJ_id_pkip OBJ_id_pkix,5L - -#define SN_id_alg "id-alg" -#define NID_id_alg 262 -#define OBJ_id_alg OBJ_id_pkix,6L - -#define SN_id_cmc "id-cmc" -#define NID_id_cmc 263 -#define OBJ_id_cmc OBJ_id_pkix,7L - -#define SN_id_on "id-on" -#define NID_id_on 264 -#define OBJ_id_on OBJ_id_pkix,8L - -#define SN_id_pda "id-pda" -#define NID_id_pda 265 -#define OBJ_id_pda OBJ_id_pkix,9L - -#define SN_id_aca "id-aca" -#define NID_id_aca 266 -#define OBJ_id_aca OBJ_id_pkix,10L - -#define SN_id_qcs "id-qcs" -#define NID_id_qcs 267 -#define OBJ_id_qcs OBJ_id_pkix,11L - -#define SN_id_cct "id-cct" -#define NID_id_cct 268 -#define OBJ_id_cct OBJ_id_pkix,12L - -#define SN_id_ppl "id-ppl" -#define NID_id_ppl 662 -#define OBJ_id_ppl OBJ_id_pkix,21L - -#define SN_id_ad "id-ad" -#define NID_id_ad 176 -#define OBJ_id_ad OBJ_id_pkix,48L - -#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" -#define NID_id_pkix1_explicit_88 269 -#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L - -#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" -#define NID_id_pkix1_implicit_88 270 -#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L - -#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" -#define NID_id_pkix1_explicit_93 271 -#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L - -#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" -#define NID_id_pkix1_implicit_93 272 -#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L - -#define SN_id_mod_crmf "id-mod-crmf" -#define NID_id_mod_crmf 273 -#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L - -#define SN_id_mod_cmc "id-mod-cmc" -#define NID_id_mod_cmc 274 -#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L - -#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" -#define NID_id_mod_kea_profile_88 275 -#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L - -#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" -#define NID_id_mod_kea_profile_93 276 -#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L - -#define SN_id_mod_cmp "id-mod-cmp" -#define NID_id_mod_cmp 277 -#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L - -#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" -#define NID_id_mod_qualified_cert_88 278 -#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L - -#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" -#define NID_id_mod_qualified_cert_93 279 -#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L - -#define SN_id_mod_attribute_cert "id-mod-attribute-cert" -#define NID_id_mod_attribute_cert 280 -#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L - -#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" -#define NID_id_mod_timestamp_protocol 281 -#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L - -#define SN_id_mod_ocsp "id-mod-ocsp" -#define NID_id_mod_ocsp 282 -#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L - -#define SN_id_mod_dvcs "id-mod-dvcs" -#define NID_id_mod_dvcs 283 -#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L - -#define SN_id_mod_cmp2000 "id-mod-cmp2000" -#define NID_id_mod_cmp2000 284 -#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L - -#define SN_info_access "authorityInfoAccess" -#define LN_info_access "Authority Information Access" -#define NID_info_access 177 -#define OBJ_info_access OBJ_id_pe,1L - -#define SN_biometricInfo "biometricInfo" -#define LN_biometricInfo "Biometric Info" -#define NID_biometricInfo 285 -#define OBJ_biometricInfo OBJ_id_pe,2L - -#define SN_qcStatements "qcStatements" -#define NID_qcStatements 286 -#define OBJ_qcStatements OBJ_id_pe,3L - -#define SN_ac_auditEntity "ac-auditEntity" -#define NID_ac_auditEntity 287 -#define OBJ_ac_auditEntity OBJ_id_pe,4L - -#define SN_ac_targeting "ac-targeting" -#define NID_ac_targeting 288 -#define OBJ_ac_targeting OBJ_id_pe,5L - -#define SN_aaControls "aaControls" -#define NID_aaControls 289 -#define OBJ_aaControls OBJ_id_pe,6L - -#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" -#define NID_sbgp_ipAddrBlock 290 -#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L - -#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" -#define NID_sbgp_autonomousSysNum 291 -#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L - -#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" -#define NID_sbgp_routerIdentifier 292 -#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L - -#define SN_ac_proxying "ac-proxying" -#define NID_ac_proxying 397 -#define OBJ_ac_proxying OBJ_id_pe,10L - -#define SN_sinfo_access "subjectInfoAccess" -#define LN_sinfo_access "Subject Information Access" -#define NID_sinfo_access 398 -#define OBJ_sinfo_access OBJ_id_pe,11L - -#define SN_proxyCertInfo "proxyCertInfo" -#define LN_proxyCertInfo "Proxy Certificate Information" -#define NID_proxyCertInfo 663 -#define OBJ_proxyCertInfo OBJ_id_pe,14L - -#define SN_id_qt_cps "id-qt-cps" -#define LN_id_qt_cps "Policy Qualifier CPS" -#define NID_id_qt_cps 164 -#define OBJ_id_qt_cps OBJ_id_qt,1L - -#define SN_id_qt_unotice "id-qt-unotice" -#define LN_id_qt_unotice "Policy Qualifier User Notice" -#define NID_id_qt_unotice 165 -#define OBJ_id_qt_unotice OBJ_id_qt,2L - -#define SN_textNotice "textNotice" -#define NID_textNotice 293 -#define OBJ_textNotice OBJ_id_qt,3L - -#define SN_server_auth "serverAuth" -#define LN_server_auth "TLS Web Server Authentication" -#define NID_server_auth 129 -#define OBJ_server_auth OBJ_id_kp,1L - -#define SN_client_auth "clientAuth" -#define LN_client_auth "TLS Web Client Authentication" -#define NID_client_auth 130 -#define OBJ_client_auth OBJ_id_kp,2L - -#define SN_code_sign "codeSigning" -#define LN_code_sign "Code Signing" -#define NID_code_sign 131 -#define OBJ_code_sign OBJ_id_kp,3L - -#define SN_email_protect "emailProtection" -#define LN_email_protect "E-mail Protection" -#define NID_email_protect 132 -#define OBJ_email_protect OBJ_id_kp,4L - -#define SN_ipsecEndSystem "ipsecEndSystem" -#define LN_ipsecEndSystem "IPSec End System" -#define NID_ipsecEndSystem 294 -#define OBJ_ipsecEndSystem OBJ_id_kp,5L - -#define SN_ipsecTunnel "ipsecTunnel" -#define LN_ipsecTunnel "IPSec Tunnel" -#define NID_ipsecTunnel 295 -#define OBJ_ipsecTunnel OBJ_id_kp,6L - -#define SN_ipsecUser "ipsecUser" -#define LN_ipsecUser "IPSec User" -#define NID_ipsecUser 296 -#define OBJ_ipsecUser OBJ_id_kp,7L - -#define SN_time_stamp "timeStamping" -#define LN_time_stamp "Time Stamping" -#define NID_time_stamp 133 -#define OBJ_time_stamp OBJ_id_kp,8L - -#define SN_OCSP_sign "OCSPSigning" -#define LN_OCSP_sign "OCSP Signing" -#define NID_OCSP_sign 180 -#define OBJ_OCSP_sign OBJ_id_kp,9L - -#define SN_dvcs "DVCS" -#define LN_dvcs "dvcs" -#define NID_dvcs 297 -#define OBJ_dvcs OBJ_id_kp,10L - -#define SN_id_it_caProtEncCert "id-it-caProtEncCert" -#define NID_id_it_caProtEncCert 298 -#define OBJ_id_it_caProtEncCert OBJ_id_it,1L - -#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" -#define NID_id_it_signKeyPairTypes 299 -#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L - -#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" -#define NID_id_it_encKeyPairTypes 300 -#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L - -#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" -#define NID_id_it_preferredSymmAlg 301 -#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L - -#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" -#define NID_id_it_caKeyUpdateInfo 302 -#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L - -#define SN_id_it_currentCRL "id-it-currentCRL" -#define NID_id_it_currentCRL 303 -#define OBJ_id_it_currentCRL OBJ_id_it,6L - -#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" -#define NID_id_it_unsupportedOIDs 304 -#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L - -#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" -#define NID_id_it_subscriptionRequest 305 -#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L - -#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" -#define NID_id_it_subscriptionResponse 306 -#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L - -#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" -#define NID_id_it_keyPairParamReq 307 -#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L - -#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" -#define NID_id_it_keyPairParamRep 308 -#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L - -#define SN_id_it_revPassphrase "id-it-revPassphrase" -#define NID_id_it_revPassphrase 309 -#define OBJ_id_it_revPassphrase OBJ_id_it,12L - -#define SN_id_it_implicitConfirm "id-it-implicitConfirm" -#define NID_id_it_implicitConfirm 310 -#define OBJ_id_it_implicitConfirm OBJ_id_it,13L - -#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" -#define NID_id_it_confirmWaitTime 311 -#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L - -#define SN_id_it_origPKIMessage "id-it-origPKIMessage" -#define NID_id_it_origPKIMessage 312 -#define OBJ_id_it_origPKIMessage OBJ_id_it,15L - -#define SN_id_it_suppLangTags "id-it-suppLangTags" -#define NID_id_it_suppLangTags 784 -#define OBJ_id_it_suppLangTags OBJ_id_it,16L - -#define SN_id_regCtrl "id-regCtrl" -#define NID_id_regCtrl 313 -#define OBJ_id_regCtrl OBJ_id_pkip,1L - -#define SN_id_regInfo "id-regInfo" -#define NID_id_regInfo 314 -#define OBJ_id_regInfo OBJ_id_pkip,2L - -#define SN_id_regCtrl_regToken "id-regCtrl-regToken" -#define NID_id_regCtrl_regToken 315 -#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L - -#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" -#define NID_id_regCtrl_authenticator 316 -#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L - -#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" -#define NID_id_regCtrl_pkiPublicationInfo 317 -#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L - -#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" -#define NID_id_regCtrl_pkiArchiveOptions 318 -#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L - -#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" -#define NID_id_regCtrl_oldCertID 319 -#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L - -#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" -#define NID_id_regCtrl_protocolEncrKey 320 -#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L - -#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" -#define NID_id_regInfo_utf8Pairs 321 -#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L - -#define SN_id_regInfo_certReq "id-regInfo-certReq" -#define NID_id_regInfo_certReq 322 -#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L - -#define SN_id_alg_des40 "id-alg-des40" -#define NID_id_alg_des40 323 -#define OBJ_id_alg_des40 OBJ_id_alg,1L - -#define SN_id_alg_noSignature "id-alg-noSignature" -#define NID_id_alg_noSignature 324 -#define OBJ_id_alg_noSignature OBJ_id_alg,2L - -#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" -#define NID_id_alg_dh_sig_hmac_sha1 325 -#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L - -#define SN_id_alg_dh_pop "id-alg-dh-pop" -#define NID_id_alg_dh_pop 326 -#define OBJ_id_alg_dh_pop OBJ_id_alg,4L - -#define SN_id_cmc_statusInfo "id-cmc-statusInfo" -#define NID_id_cmc_statusInfo 327 -#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L - -#define SN_id_cmc_identification "id-cmc-identification" -#define NID_id_cmc_identification 328 -#define OBJ_id_cmc_identification OBJ_id_cmc,2L - -#define SN_id_cmc_identityProof "id-cmc-identityProof" -#define NID_id_cmc_identityProof 329 -#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L - -#define SN_id_cmc_dataReturn "id-cmc-dataReturn" -#define NID_id_cmc_dataReturn 330 -#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L - -#define SN_id_cmc_transactionId "id-cmc-transactionId" -#define NID_id_cmc_transactionId 331 -#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L - -#define SN_id_cmc_senderNonce "id-cmc-senderNonce" -#define NID_id_cmc_senderNonce 332 -#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L - -#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" -#define NID_id_cmc_recipientNonce 333 -#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L - -#define SN_id_cmc_addExtensions "id-cmc-addExtensions" -#define NID_id_cmc_addExtensions 334 -#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L - -#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" -#define NID_id_cmc_encryptedPOP 335 -#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L - -#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" -#define NID_id_cmc_decryptedPOP 336 -#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L - -#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" -#define NID_id_cmc_lraPOPWitness 337 -#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L - -#define SN_id_cmc_getCert "id-cmc-getCert" -#define NID_id_cmc_getCert 338 -#define OBJ_id_cmc_getCert OBJ_id_cmc,15L - -#define SN_id_cmc_getCRL "id-cmc-getCRL" -#define NID_id_cmc_getCRL 339 -#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L - -#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" -#define NID_id_cmc_revokeRequest 340 -#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L - -#define SN_id_cmc_regInfo "id-cmc-regInfo" -#define NID_id_cmc_regInfo 341 -#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L - -#define SN_id_cmc_responseInfo "id-cmc-responseInfo" -#define NID_id_cmc_responseInfo 342 -#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L - -#define SN_id_cmc_queryPending "id-cmc-queryPending" -#define NID_id_cmc_queryPending 343 -#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L - -#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" -#define NID_id_cmc_popLinkRandom 344 -#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L - -#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" -#define NID_id_cmc_popLinkWitness 345 -#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L - -#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" -#define NID_id_cmc_confirmCertAcceptance 346 -#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L - -#define SN_id_on_personalData "id-on-personalData" -#define NID_id_on_personalData 347 -#define OBJ_id_on_personalData OBJ_id_on,1L - -#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" -#define LN_id_on_permanentIdentifier "Permanent Identifier" -#define NID_id_on_permanentIdentifier 858 -#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L - -#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" -#define NID_id_pda_dateOfBirth 348 -#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L - -#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" -#define NID_id_pda_placeOfBirth 349 -#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L - -#define SN_id_pda_gender "id-pda-gender" -#define NID_id_pda_gender 351 -#define OBJ_id_pda_gender OBJ_id_pda,3L - -#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" -#define NID_id_pda_countryOfCitizenship 352 -#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L - -#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" -#define NID_id_pda_countryOfResidence 353 -#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L - -#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" -#define NID_id_aca_authenticationInfo 354 -#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L - -#define SN_id_aca_accessIdentity "id-aca-accessIdentity" -#define NID_id_aca_accessIdentity 355 -#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L - -#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" -#define NID_id_aca_chargingIdentity 356 -#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L - -#define SN_id_aca_group "id-aca-group" -#define NID_id_aca_group 357 -#define OBJ_id_aca_group OBJ_id_aca,4L - -#define SN_id_aca_role "id-aca-role" -#define NID_id_aca_role 358 -#define OBJ_id_aca_role OBJ_id_aca,5L - -#define SN_id_aca_encAttrs "id-aca-encAttrs" -#define NID_id_aca_encAttrs 399 -#define OBJ_id_aca_encAttrs OBJ_id_aca,6L - -#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" -#define NID_id_qcs_pkixQCSyntax_v1 359 -#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L - -#define SN_id_cct_crs "id-cct-crs" -#define NID_id_cct_crs 360 -#define OBJ_id_cct_crs OBJ_id_cct,1L - -#define SN_id_cct_PKIData "id-cct-PKIData" -#define NID_id_cct_PKIData 361 -#define OBJ_id_cct_PKIData OBJ_id_cct,2L - -#define SN_id_cct_PKIResponse "id-cct-PKIResponse" -#define NID_id_cct_PKIResponse 362 -#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L - -#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" -#define LN_id_ppl_anyLanguage "Any language" -#define NID_id_ppl_anyLanguage 664 -#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L - -#define SN_id_ppl_inheritAll "id-ppl-inheritAll" -#define LN_id_ppl_inheritAll "Inherit all" -#define NID_id_ppl_inheritAll 665 -#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L - -#define SN_Independent "id-ppl-independent" -#define LN_Independent "Independent" -#define NID_Independent 667 -#define OBJ_Independent OBJ_id_ppl,2L - -#define SN_ad_OCSP "OCSP" -#define LN_ad_OCSP "OCSP" -#define NID_ad_OCSP 178 -#define OBJ_ad_OCSP OBJ_id_ad,1L - -#define SN_ad_ca_issuers "caIssuers" -#define LN_ad_ca_issuers "CA Issuers" -#define NID_ad_ca_issuers 179 -#define OBJ_ad_ca_issuers OBJ_id_ad,2L - -#define SN_ad_timeStamping "ad_timestamping" -#define LN_ad_timeStamping "AD Time Stamping" -#define NID_ad_timeStamping 363 -#define OBJ_ad_timeStamping OBJ_id_ad,3L - -#define SN_ad_dvcs "AD_DVCS" -#define LN_ad_dvcs "ad dvcs" -#define NID_ad_dvcs 364 -#define OBJ_ad_dvcs OBJ_id_ad,4L - -#define SN_caRepository "caRepository" -#define LN_caRepository "CA Repository" -#define NID_caRepository 785 -#define OBJ_caRepository OBJ_id_ad,5L - -#define OBJ_id_pkix_OCSP OBJ_ad_OCSP - -#define SN_id_pkix_OCSP_basic "basicOCSPResponse" -#define LN_id_pkix_OCSP_basic "Basic OCSP Response" -#define NID_id_pkix_OCSP_basic 365 -#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L - -#define SN_id_pkix_OCSP_Nonce "Nonce" -#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" -#define NID_id_pkix_OCSP_Nonce 366 -#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L - -#define SN_id_pkix_OCSP_CrlID "CrlID" -#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" -#define NID_id_pkix_OCSP_CrlID 367 -#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L - -#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" -#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" -#define NID_id_pkix_OCSP_acceptableResponses 368 -#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L - -#define SN_id_pkix_OCSP_noCheck "noCheck" -#define LN_id_pkix_OCSP_noCheck "OCSP No Check" -#define NID_id_pkix_OCSP_noCheck 369 -#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L - -#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" -#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" -#define NID_id_pkix_OCSP_archiveCutoff 370 -#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L - -#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" -#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" -#define NID_id_pkix_OCSP_serviceLocator 371 -#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L - -#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" -#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" -#define NID_id_pkix_OCSP_extendedStatus 372 -#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L - -#define SN_id_pkix_OCSP_valid "valid" -#define NID_id_pkix_OCSP_valid 373 -#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L - -#define SN_id_pkix_OCSP_path "path" -#define NID_id_pkix_OCSP_path 374 -#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L - -#define SN_id_pkix_OCSP_trustRoot "trustRoot" -#define LN_id_pkix_OCSP_trustRoot "Trust Root" -#define NID_id_pkix_OCSP_trustRoot 375 -#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L - -#define SN_algorithm "algorithm" -#define LN_algorithm "algorithm" -#define NID_algorithm 376 -#define OBJ_algorithm 1L,3L,14L,3L,2L - -#define SN_md5WithRSA "RSA-NP-MD5" -#define LN_md5WithRSA "md5WithRSA" -#define NID_md5WithRSA 104 -#define OBJ_md5WithRSA OBJ_algorithm,3L - -#define SN_des_ecb "DES-ECB" -#define LN_des_ecb "des-ecb" -#define NID_des_ecb 29 -#define OBJ_des_ecb OBJ_algorithm,6L - -#define SN_des_cbc "DES-CBC" -#define LN_des_cbc "des-cbc" -#define NID_des_cbc 31 -#define OBJ_des_cbc OBJ_algorithm,7L - -#define SN_des_ofb64 "DES-OFB" -#define LN_des_ofb64 "des-ofb" -#define NID_des_ofb64 45 -#define OBJ_des_ofb64 OBJ_algorithm,8L - -#define SN_des_cfb64 "DES-CFB" -#define LN_des_cfb64 "des-cfb" -#define NID_des_cfb64 30 -#define OBJ_des_cfb64 OBJ_algorithm,9L - -#define SN_rsaSignature "rsaSignature" -#define NID_rsaSignature 377 -#define OBJ_rsaSignature OBJ_algorithm,11L - -#define SN_dsa_2 "DSA-old" -#define LN_dsa_2 "dsaEncryption-old" -#define NID_dsa_2 67 -#define OBJ_dsa_2 OBJ_algorithm,12L - -#define SN_dsaWithSHA "DSA-SHA" -#define LN_dsaWithSHA "dsaWithSHA" -#define NID_dsaWithSHA 66 -#define OBJ_dsaWithSHA OBJ_algorithm,13L - -#define SN_shaWithRSAEncryption "RSA-SHA" -#define LN_shaWithRSAEncryption "shaWithRSAEncryption" -#define NID_shaWithRSAEncryption 42 -#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L - -#define SN_des_ede_ecb "DES-EDE" -#define LN_des_ede_ecb "des-ede" -#define NID_des_ede_ecb 32 -#define OBJ_des_ede_ecb OBJ_algorithm,17L - -#define SN_des_ede3_ecb "DES-EDE3" -#define LN_des_ede3_ecb "des-ede3" -#define NID_des_ede3_ecb 33 - -#define SN_des_ede_cbc "DES-EDE-CBC" -#define LN_des_ede_cbc "des-ede-cbc" -#define NID_des_ede_cbc 43 - -#define SN_des_ede_cfb64 "DES-EDE-CFB" -#define LN_des_ede_cfb64 "des-ede-cfb" -#define NID_des_ede_cfb64 60 - -#define SN_des_ede3_cfb64 "DES-EDE3-CFB" -#define LN_des_ede3_cfb64 "des-ede3-cfb" -#define NID_des_ede3_cfb64 61 - -#define SN_des_ede_ofb64 "DES-EDE-OFB" -#define LN_des_ede_ofb64 "des-ede-ofb" -#define NID_des_ede_ofb64 62 - -#define SN_des_ede3_ofb64 "DES-EDE3-OFB" -#define LN_des_ede3_ofb64 "des-ede3-ofb" -#define NID_des_ede3_ofb64 63 - -#define SN_desx_cbc "DESX-CBC" -#define LN_desx_cbc "desx-cbc" -#define NID_desx_cbc 80 - -#define SN_sha "SHA" -#define LN_sha "sha" -#define NID_sha 41 -#define OBJ_sha OBJ_algorithm,18L - -#define SN_sha1 "SHA1" -#define LN_sha1 "sha1" -#define NID_sha1 64 -#define OBJ_sha1 OBJ_algorithm,26L - -#define SN_dsaWithSHA1_2 "DSA-SHA1-old" -#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" -#define NID_dsaWithSHA1_2 70 -#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L - -#define SN_sha1WithRSA "RSA-SHA1-2" -#define LN_sha1WithRSA "sha1WithRSA" -#define NID_sha1WithRSA 115 -#define OBJ_sha1WithRSA OBJ_algorithm,29L - -#define SN_ripemd160 "RIPEMD160" -#define LN_ripemd160 "ripemd160" -#define NID_ripemd160 117 -#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L - -#define SN_ripemd160WithRSA "RSA-RIPEMD160" -#define LN_ripemd160WithRSA "ripemd160WithRSA" -#define NID_ripemd160WithRSA 119 -#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L - -#define SN_sxnet "SXNetID" -#define LN_sxnet "Strong Extranet ID" -#define NID_sxnet 143 -#define OBJ_sxnet 1L,3L,101L,1L,4L,1L - -#define SN_X500 "X500" -#define LN_X500 "directory services (X.500)" -#define NID_X500 11 -#define OBJ_X500 2L,5L - -#define SN_X509 "X509" -#define NID_X509 12 -#define OBJ_X509 OBJ_X500,4L - -#define SN_commonName "CN" -#define LN_commonName "commonName" -#define NID_commonName 13 -#define OBJ_commonName OBJ_X509,3L - -#define SN_surname "SN" -#define LN_surname "surname" -#define NID_surname 100 -#define OBJ_surname OBJ_X509,4L - -#define LN_serialNumber "serialNumber" -#define NID_serialNumber 105 -#define OBJ_serialNumber OBJ_X509,5L - -#define SN_countryName "C" -#define LN_countryName "countryName" -#define NID_countryName 14 -#define OBJ_countryName OBJ_X509,6L - -#define SN_localityName "L" -#define LN_localityName "localityName" -#define NID_localityName 15 -#define OBJ_localityName OBJ_X509,7L - -#define SN_stateOrProvinceName "ST" -#define LN_stateOrProvinceName "stateOrProvinceName" -#define NID_stateOrProvinceName 16 -#define OBJ_stateOrProvinceName OBJ_X509,8L - -#define LN_streetAddress "streetAddress" -#define NID_streetAddress 660 -#define OBJ_streetAddress OBJ_X509,9L - -#define SN_organizationName "O" -#define LN_organizationName "organizationName" -#define NID_organizationName 17 -#define OBJ_organizationName OBJ_X509,10L - -#define SN_organizationalUnitName "OU" -#define LN_organizationalUnitName "organizationalUnitName" -#define NID_organizationalUnitName 18 -#define OBJ_organizationalUnitName OBJ_X509,11L - -#define LN_title "title" -#define NID_title 106 -#define OBJ_title OBJ_X509,12L - -#define LN_description "description" -#define NID_description 107 -#define OBJ_description OBJ_X509,13L - -#define LN_postalCode "postalCode" -#define NID_postalCode 661 -#define OBJ_postalCode OBJ_X509,17L - -#define SN_name "name" -#define LN_name "name" -#define NID_name 173 -#define OBJ_name OBJ_X509,41L - -#define SN_givenName "GN" -#define LN_givenName "givenName" -#define NID_givenName 99 -#define OBJ_givenName OBJ_X509,42L - -#define LN_initials "initials" -#define NID_initials 101 -#define OBJ_initials OBJ_X509,43L - -#define LN_generationQualifier "generationQualifier" -#define NID_generationQualifier 509 -#define OBJ_generationQualifier OBJ_X509,44L - -#define LN_x500UniqueIdentifier "x500UniqueIdentifier" -#define NID_x500UniqueIdentifier 503 -#define OBJ_x500UniqueIdentifier OBJ_X509,45L - -#define SN_dnQualifier "dnQualifier" -#define LN_dnQualifier "dnQualifier" -#define NID_dnQualifier 174 -#define OBJ_dnQualifier OBJ_X509,46L - -#define LN_pseudonym "pseudonym" -#define NID_pseudonym 510 -#define OBJ_pseudonym OBJ_X509,65L - -#define SN_role "role" -#define LN_role "role" -#define NID_role 400 -#define OBJ_role OBJ_X509,72L - -#define SN_X500algorithms "X500algorithms" -#define LN_X500algorithms "directory services - algorithms" -#define NID_X500algorithms 378 -#define OBJ_X500algorithms OBJ_X500,8L - -#define SN_rsa "RSA" -#define LN_rsa "rsa" -#define NID_rsa 19 -#define OBJ_rsa OBJ_X500algorithms,1L,1L - -#define SN_mdc2WithRSA "RSA-MDC2" -#define LN_mdc2WithRSA "mdc2WithRSA" -#define NID_mdc2WithRSA 96 -#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L - -#define SN_mdc2 "MDC2" -#define LN_mdc2 "mdc2" -#define NID_mdc2 95 -#define OBJ_mdc2 OBJ_X500algorithms,3L,101L - -#define SN_id_ce "id-ce" -#define NID_id_ce 81 -#define OBJ_id_ce OBJ_X500,29L - -#define SN_subject_directory_attributes "subjectDirectoryAttributes" -#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" -#define NID_subject_directory_attributes 769 -#define OBJ_subject_directory_attributes OBJ_id_ce,9L - -#define SN_subject_key_identifier "subjectKeyIdentifier" -#define LN_subject_key_identifier "X509v3 Subject Key Identifier" -#define NID_subject_key_identifier 82 -#define OBJ_subject_key_identifier OBJ_id_ce,14L - -#define SN_key_usage "keyUsage" -#define LN_key_usage "X509v3 Key Usage" -#define NID_key_usage 83 -#define OBJ_key_usage OBJ_id_ce,15L - -#define SN_private_key_usage_period "privateKeyUsagePeriod" -#define LN_private_key_usage_period "X509v3 Private Key Usage Period" -#define NID_private_key_usage_period 84 -#define OBJ_private_key_usage_period OBJ_id_ce,16L - -#define SN_subject_alt_name "subjectAltName" -#define LN_subject_alt_name "X509v3 Subject Alternative Name" -#define NID_subject_alt_name 85 -#define OBJ_subject_alt_name OBJ_id_ce,17L - -#define SN_issuer_alt_name "issuerAltName" -#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" -#define NID_issuer_alt_name 86 -#define OBJ_issuer_alt_name OBJ_id_ce,18L - -#define SN_basic_constraints "basicConstraints" -#define LN_basic_constraints "X509v3 Basic Constraints" -#define NID_basic_constraints 87 -#define OBJ_basic_constraints OBJ_id_ce,19L - -#define SN_crl_number "crlNumber" -#define LN_crl_number "X509v3 CRL Number" -#define NID_crl_number 88 -#define OBJ_crl_number OBJ_id_ce,20L - -#define SN_crl_reason "CRLReason" -#define LN_crl_reason "X509v3 CRL Reason Code" -#define NID_crl_reason 141 -#define OBJ_crl_reason OBJ_id_ce,21L - -#define SN_invalidity_date "invalidityDate" -#define LN_invalidity_date "Invalidity Date" -#define NID_invalidity_date 142 -#define OBJ_invalidity_date OBJ_id_ce,24L - -#define SN_delta_crl "deltaCRL" -#define LN_delta_crl "X509v3 Delta CRL Indicator" -#define NID_delta_crl 140 -#define OBJ_delta_crl OBJ_id_ce,27L - -#define SN_issuing_distribution_point "issuingDistributionPoint" -#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point" -#define NID_issuing_distribution_point 770 -#define OBJ_issuing_distribution_point OBJ_id_ce,28L - -#define SN_certificate_issuer "certificateIssuer" -#define LN_certificate_issuer "X509v3 Certificate Issuer" -#define NID_certificate_issuer 771 -#define OBJ_certificate_issuer OBJ_id_ce,29L - -#define SN_name_constraints "nameConstraints" -#define LN_name_constraints "X509v3 Name Constraints" -#define NID_name_constraints 666 -#define OBJ_name_constraints OBJ_id_ce,30L - -#define SN_crl_distribution_points "crlDistributionPoints" -#define LN_crl_distribution_points "X509v3 CRL Distribution Points" -#define NID_crl_distribution_points 103 -#define OBJ_crl_distribution_points OBJ_id_ce,31L - -#define SN_certificate_policies "certificatePolicies" -#define LN_certificate_policies "X509v3 Certificate Policies" -#define NID_certificate_policies 89 -#define OBJ_certificate_policies OBJ_id_ce,32L - -#define SN_any_policy "anyPolicy" -#define LN_any_policy "X509v3 Any Policy" -#define NID_any_policy 746 -#define OBJ_any_policy OBJ_certificate_policies,0L - -#define SN_policy_mappings "policyMappings" -#define LN_policy_mappings "X509v3 Policy Mappings" -#define NID_policy_mappings 747 -#define OBJ_policy_mappings OBJ_id_ce,33L - -#define SN_authority_key_identifier "authorityKeyIdentifier" -#define LN_authority_key_identifier "X509v3 Authority Key Identifier" -#define NID_authority_key_identifier 90 -#define OBJ_authority_key_identifier OBJ_id_ce,35L - -#define SN_policy_constraints "policyConstraints" -#define LN_policy_constraints "X509v3 Policy Constraints" -#define NID_policy_constraints 401 -#define OBJ_policy_constraints OBJ_id_ce,36L - -#define SN_ext_key_usage "extendedKeyUsage" -#define LN_ext_key_usage "X509v3 Extended Key Usage" -#define NID_ext_key_usage 126 -#define OBJ_ext_key_usage OBJ_id_ce,37L - -#define SN_freshest_crl "freshestCRL" -#define LN_freshest_crl "X509v3 Freshest CRL" -#define NID_freshest_crl 857 -#define OBJ_freshest_crl OBJ_id_ce,46L - -#define SN_inhibit_any_policy "inhibitAnyPolicy" -#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" -#define NID_inhibit_any_policy 748 -#define OBJ_inhibit_any_policy OBJ_id_ce,54L - -#define SN_target_information "targetInformation" -#define LN_target_information "X509v3 AC Targeting" -#define NID_target_information 402 -#define OBJ_target_information OBJ_id_ce,55L - -#define SN_no_rev_avail "noRevAvail" -#define LN_no_rev_avail "X509v3 No Revocation Available" -#define NID_no_rev_avail 403 -#define OBJ_no_rev_avail OBJ_id_ce,56L - -#define SN_netscape "Netscape" -#define LN_netscape "Netscape Communications Corp." -#define NID_netscape 57 -#define OBJ_netscape 2L,16L,840L,1L,113730L - -#define SN_netscape_cert_extension "nsCertExt" -#define LN_netscape_cert_extension "Netscape Certificate Extension" -#define NID_netscape_cert_extension 58 -#define OBJ_netscape_cert_extension OBJ_netscape,1L - -#define SN_netscape_data_type "nsDataType" -#define LN_netscape_data_type "Netscape Data Type" -#define NID_netscape_data_type 59 -#define OBJ_netscape_data_type OBJ_netscape,2L - -#define SN_netscape_cert_type "nsCertType" -#define LN_netscape_cert_type "Netscape Cert Type" -#define NID_netscape_cert_type 71 -#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L - -#define SN_netscape_base_url "nsBaseUrl" -#define LN_netscape_base_url "Netscape Base Url" -#define NID_netscape_base_url 72 -#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L - -#define SN_netscape_revocation_url "nsRevocationUrl" -#define LN_netscape_revocation_url "Netscape Revocation Url" -#define NID_netscape_revocation_url 73 -#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L - -#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" -#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" -#define NID_netscape_ca_revocation_url 74 -#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L - -#define SN_netscape_renewal_url "nsRenewalUrl" -#define LN_netscape_renewal_url "Netscape Renewal Url" -#define NID_netscape_renewal_url 75 -#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L - -#define SN_netscape_ca_policy_url "nsCaPolicyUrl" -#define LN_netscape_ca_policy_url "Netscape CA Policy Url" -#define NID_netscape_ca_policy_url 76 -#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L - -#define SN_netscape_ssl_server_name "nsSslServerName" -#define LN_netscape_ssl_server_name "Netscape SSL Server Name" -#define NID_netscape_ssl_server_name 77 -#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L - -#define SN_netscape_comment "nsComment" -#define LN_netscape_comment "Netscape Comment" -#define NID_netscape_comment 78 -#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L - -#define SN_netscape_cert_sequence "nsCertSequence" -#define LN_netscape_cert_sequence "Netscape Certificate Sequence" -#define NID_netscape_cert_sequence 79 -#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L - -#define SN_ns_sgc "nsSGC" -#define LN_ns_sgc "Netscape Server Gated Crypto" -#define NID_ns_sgc 139 -#define OBJ_ns_sgc OBJ_netscape,4L,1L - -#define SN_org "ORG" -#define LN_org "org" -#define NID_org 379 -#define OBJ_org OBJ_iso,3L - -#define SN_dod "DOD" -#define LN_dod "dod" -#define NID_dod 380 -#define OBJ_dod OBJ_org,6L - -#define SN_iana "IANA" -#define LN_iana "iana" -#define NID_iana 381 -#define OBJ_iana OBJ_dod,1L - -#define OBJ_internet OBJ_iana - -#define SN_Directory "directory" -#define LN_Directory "Directory" -#define NID_Directory 382 -#define OBJ_Directory OBJ_internet,1L - -#define SN_Management "mgmt" -#define LN_Management "Management" -#define NID_Management 383 -#define OBJ_Management OBJ_internet,2L - -#define SN_Experimental "experimental" -#define LN_Experimental "Experimental" -#define NID_Experimental 384 -#define OBJ_Experimental OBJ_internet,3L - -#define SN_Private "private" -#define LN_Private "Private" -#define NID_Private 385 -#define OBJ_Private OBJ_internet,4L - -#define SN_Security "security" -#define LN_Security "Security" -#define NID_Security 386 -#define OBJ_Security OBJ_internet,5L - -#define SN_SNMPv2 "snmpv2" -#define LN_SNMPv2 "SNMPv2" -#define NID_SNMPv2 387 -#define OBJ_SNMPv2 OBJ_internet,6L - -#define LN_Mail "Mail" -#define NID_Mail 388 -#define OBJ_Mail OBJ_internet,7L - -#define SN_Enterprises "enterprises" -#define LN_Enterprises "Enterprises" -#define NID_Enterprises 389 -#define OBJ_Enterprises OBJ_Private,1L - -#define SN_dcObject "dcobject" -#define LN_dcObject "dcObject" -#define NID_dcObject 390 -#define OBJ_dcObject OBJ_Enterprises,1466L,344L - -#define SN_mime_mhs "mime-mhs" -#define LN_mime_mhs "MIME MHS" -#define NID_mime_mhs 504 -#define OBJ_mime_mhs OBJ_Mail,1L - -#define SN_mime_mhs_headings "mime-mhs-headings" -#define LN_mime_mhs_headings "mime-mhs-headings" -#define NID_mime_mhs_headings 505 -#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L - -#define SN_mime_mhs_bodies "mime-mhs-bodies" -#define LN_mime_mhs_bodies "mime-mhs-bodies" -#define NID_mime_mhs_bodies 506 -#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L - -#define SN_id_hex_partial_message "id-hex-partial-message" -#define LN_id_hex_partial_message "id-hex-partial-message" -#define NID_id_hex_partial_message 507 -#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L - -#define SN_id_hex_multipart_message "id-hex-multipart-message" -#define LN_id_hex_multipart_message "id-hex-multipart-message" -#define NID_id_hex_multipart_message 508 -#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L - -#define SN_rle_compression "RLE" -#define LN_rle_compression "run length compression" -#define NID_rle_compression 124 -#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L - -#define SN_zlib_compression "ZLIB" -#define LN_zlib_compression "zlib compression" -#define NID_zlib_compression 125 -#define OBJ_zlib_compression OBJ_id_smime_alg,8L - -#define OBJ_csor 2L,16L,840L,1L,101L,3L - -#define OBJ_nistAlgorithms OBJ_csor,4L - -#define OBJ_aes OBJ_nistAlgorithms,1L - -#define SN_aes_128_ecb "AES-128-ECB" -#define LN_aes_128_ecb "aes-128-ecb" -#define NID_aes_128_ecb 418 -#define OBJ_aes_128_ecb OBJ_aes,1L - -#define SN_aes_128_cbc "AES-128-CBC" -#define LN_aes_128_cbc "aes-128-cbc" -#define NID_aes_128_cbc 419 -#define OBJ_aes_128_cbc OBJ_aes,2L - -#define SN_aes_128_ofb128 "AES-128-OFB" -#define LN_aes_128_ofb128 "aes-128-ofb" -#define NID_aes_128_ofb128 420 -#define OBJ_aes_128_ofb128 OBJ_aes,3L - -#define SN_aes_128_cfb128 "AES-128-CFB" -#define LN_aes_128_cfb128 "aes-128-cfb" -#define NID_aes_128_cfb128 421 -#define OBJ_aes_128_cfb128 OBJ_aes,4L - -#define SN_aes_192_ecb "AES-192-ECB" -#define LN_aes_192_ecb "aes-192-ecb" -#define NID_aes_192_ecb 422 -#define OBJ_aes_192_ecb OBJ_aes,21L - -#define SN_aes_192_cbc "AES-192-CBC" -#define LN_aes_192_cbc "aes-192-cbc" -#define NID_aes_192_cbc 423 -#define OBJ_aes_192_cbc OBJ_aes,22L - -#define SN_aes_192_ofb128 "AES-192-OFB" -#define LN_aes_192_ofb128 "aes-192-ofb" -#define NID_aes_192_ofb128 424 -#define OBJ_aes_192_ofb128 OBJ_aes,23L - -#define SN_aes_192_cfb128 "AES-192-CFB" -#define LN_aes_192_cfb128 "aes-192-cfb" -#define NID_aes_192_cfb128 425 -#define OBJ_aes_192_cfb128 OBJ_aes,24L - -#define SN_aes_256_ecb "AES-256-ECB" -#define LN_aes_256_ecb "aes-256-ecb" -#define NID_aes_256_ecb 426 -#define OBJ_aes_256_ecb OBJ_aes,41L - -#define SN_aes_256_cbc "AES-256-CBC" -#define LN_aes_256_cbc "aes-256-cbc" -#define NID_aes_256_cbc 427 -#define OBJ_aes_256_cbc OBJ_aes,42L - -#define SN_aes_256_ofb128 "AES-256-OFB" -#define LN_aes_256_ofb128 "aes-256-ofb" -#define NID_aes_256_ofb128 428 -#define OBJ_aes_256_ofb128 OBJ_aes,43L - -#define SN_aes_256_cfb128 "AES-256-CFB" -#define LN_aes_256_cfb128 "aes-256-cfb" -#define NID_aes_256_cfb128 429 -#define OBJ_aes_256_cfb128 OBJ_aes,44L - -#define SN_aes_128_cfb1 "AES-128-CFB1" -#define LN_aes_128_cfb1 "aes-128-cfb1" -#define NID_aes_128_cfb1 650 - -#define SN_aes_192_cfb1 "AES-192-CFB1" -#define LN_aes_192_cfb1 "aes-192-cfb1" -#define NID_aes_192_cfb1 651 - -#define SN_aes_256_cfb1 "AES-256-CFB1" -#define LN_aes_256_cfb1 "aes-256-cfb1" -#define NID_aes_256_cfb1 652 - -#define SN_aes_128_cfb8 "AES-128-CFB8" -#define LN_aes_128_cfb8 "aes-128-cfb8" -#define NID_aes_128_cfb8 653 - -#define SN_aes_192_cfb8 "AES-192-CFB8" -#define LN_aes_192_cfb8 "aes-192-cfb8" -#define NID_aes_192_cfb8 654 - -#define SN_aes_256_cfb8 "AES-256-CFB8" -#define LN_aes_256_cfb8 "aes-256-cfb8" -#define NID_aes_256_cfb8 655 - -#define SN_des_cfb1 "DES-CFB1" -#define LN_des_cfb1 "des-cfb1" -#define NID_des_cfb1 656 - -#define SN_des_cfb8 "DES-CFB8" -#define LN_des_cfb8 "des-cfb8" -#define NID_des_cfb8 657 - -#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" -#define LN_des_ede3_cfb1 "des-ede3-cfb1" -#define NID_des_ede3_cfb1 658 - -#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" -#define LN_des_ede3_cfb8 "des-ede3-cfb8" -#define NID_des_ede3_cfb8 659 - -#define SN_id_aes128_wrap "id-aes128-wrap" -#define NID_id_aes128_wrap 788 -#define OBJ_id_aes128_wrap OBJ_aes,5L - -#define SN_id_aes192_wrap "id-aes192-wrap" -#define NID_id_aes192_wrap 789 -#define OBJ_id_aes192_wrap OBJ_aes,25L - -#define SN_id_aes256_wrap "id-aes256-wrap" -#define NID_id_aes256_wrap 790 -#define OBJ_id_aes256_wrap OBJ_aes,45L - -#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L - -#define SN_sha256 "SHA256" -#define LN_sha256 "sha256" -#define NID_sha256 672 -#define OBJ_sha256 OBJ_nist_hashalgs,1L - -#define SN_sha384 "SHA384" -#define LN_sha384 "sha384" -#define NID_sha384 673 -#define OBJ_sha384 OBJ_nist_hashalgs,2L - -#define SN_sha512 "SHA512" -#define LN_sha512 "sha512" -#define NID_sha512 674 -#define OBJ_sha512 OBJ_nist_hashalgs,3L - -#define SN_sha224 "SHA224" -#define LN_sha224 "sha224" -#define NID_sha224 675 -#define OBJ_sha224 OBJ_nist_hashalgs,4L - -#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L - -#define SN_dsa_with_SHA224 "dsa_with_SHA224" -#define NID_dsa_with_SHA224 802 -#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L - -#define SN_dsa_with_SHA256 "dsa_with_SHA256" -#define NID_dsa_with_SHA256 803 -#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L - -#define SN_hold_instruction_code "holdInstructionCode" -#define LN_hold_instruction_code "Hold Instruction Code" -#define NID_hold_instruction_code 430 -#define OBJ_hold_instruction_code OBJ_id_ce,23L - -#define OBJ_holdInstruction OBJ_X9_57,2L - -#define SN_hold_instruction_none "holdInstructionNone" -#define LN_hold_instruction_none "Hold Instruction None" -#define NID_hold_instruction_none 431 -#define OBJ_hold_instruction_none OBJ_holdInstruction,1L - -#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" -#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" -#define NID_hold_instruction_call_issuer 432 -#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L - -#define SN_hold_instruction_reject "holdInstructionReject" -#define LN_hold_instruction_reject "Hold Instruction Reject" -#define NID_hold_instruction_reject 433 -#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L - -#define SN_data "data" -#define NID_data 434 -#define OBJ_data OBJ_itu_t,9L - -#define SN_pss "pss" -#define NID_pss 435 -#define OBJ_pss OBJ_data,2342L - -#define SN_ucl "ucl" -#define NID_ucl 436 -#define OBJ_ucl OBJ_pss,19200300L - -#define SN_pilot "pilot" -#define NID_pilot 437 -#define OBJ_pilot OBJ_ucl,100L - -#define LN_pilotAttributeType "pilotAttributeType" -#define NID_pilotAttributeType 438 -#define OBJ_pilotAttributeType OBJ_pilot,1L - -#define LN_pilotAttributeSyntax "pilotAttributeSyntax" -#define NID_pilotAttributeSyntax 439 -#define OBJ_pilotAttributeSyntax OBJ_pilot,3L - -#define LN_pilotObjectClass "pilotObjectClass" -#define NID_pilotObjectClass 440 -#define OBJ_pilotObjectClass OBJ_pilot,4L - -#define LN_pilotGroups "pilotGroups" -#define NID_pilotGroups 441 -#define OBJ_pilotGroups OBJ_pilot,10L - -#define LN_iA5StringSyntax "iA5StringSyntax" -#define NID_iA5StringSyntax 442 -#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L - -#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" -#define NID_caseIgnoreIA5StringSyntax 443 -#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L - -#define LN_pilotObject "pilotObject" -#define NID_pilotObject 444 -#define OBJ_pilotObject OBJ_pilotObjectClass,3L - -#define LN_pilotPerson "pilotPerson" -#define NID_pilotPerson 445 -#define OBJ_pilotPerson OBJ_pilotObjectClass,4L - -#define SN_account "account" -#define NID_account 446 -#define OBJ_account OBJ_pilotObjectClass,5L - -#define SN_document "document" -#define NID_document 447 -#define OBJ_document OBJ_pilotObjectClass,6L - -#define SN_room "room" -#define NID_room 448 -#define OBJ_room OBJ_pilotObjectClass,7L - -#define LN_documentSeries "documentSeries" -#define NID_documentSeries 449 -#define OBJ_documentSeries OBJ_pilotObjectClass,9L - -#define SN_Domain "domain" -#define LN_Domain "Domain" -#define NID_Domain 392 -#define OBJ_Domain OBJ_pilotObjectClass,13L - -#define LN_rFC822localPart "rFC822localPart" -#define NID_rFC822localPart 450 -#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L - -#define LN_dNSDomain "dNSDomain" -#define NID_dNSDomain 451 -#define OBJ_dNSDomain OBJ_pilotObjectClass,15L - -#define LN_domainRelatedObject "domainRelatedObject" -#define NID_domainRelatedObject 452 -#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L - -#define LN_friendlyCountry "friendlyCountry" -#define NID_friendlyCountry 453 -#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L - -#define LN_simpleSecurityObject "simpleSecurityObject" -#define NID_simpleSecurityObject 454 -#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L - -#define LN_pilotOrganization "pilotOrganization" -#define NID_pilotOrganization 455 -#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L - -#define LN_pilotDSA "pilotDSA" -#define NID_pilotDSA 456 -#define OBJ_pilotDSA OBJ_pilotObjectClass,21L - -#define LN_qualityLabelledData "qualityLabelledData" -#define NID_qualityLabelledData 457 -#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L - -#define SN_userId "UID" -#define LN_userId "userId" -#define NID_userId 458 -#define OBJ_userId OBJ_pilotAttributeType,1L - -#define LN_textEncodedORAddress "textEncodedORAddress" -#define NID_textEncodedORAddress 459 -#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L - -#define SN_rfc822Mailbox "mail" -#define LN_rfc822Mailbox "rfc822Mailbox" -#define NID_rfc822Mailbox 460 -#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L - -#define SN_info "info" -#define NID_info 461 -#define OBJ_info OBJ_pilotAttributeType,4L - -#define LN_favouriteDrink "favouriteDrink" -#define NID_favouriteDrink 462 -#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L - -#define LN_roomNumber "roomNumber" -#define NID_roomNumber 463 -#define OBJ_roomNumber OBJ_pilotAttributeType,6L - -#define SN_photo "photo" -#define NID_photo 464 -#define OBJ_photo OBJ_pilotAttributeType,7L - -#define LN_userClass "userClass" -#define NID_userClass 465 -#define OBJ_userClass OBJ_pilotAttributeType,8L - -#define SN_host "host" -#define NID_host 466 -#define OBJ_host OBJ_pilotAttributeType,9L - -#define SN_manager "manager" -#define NID_manager 467 -#define OBJ_manager OBJ_pilotAttributeType,10L - -#define LN_documentIdentifier "documentIdentifier" -#define NID_documentIdentifier 468 -#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L - -#define LN_documentTitle "documentTitle" -#define NID_documentTitle 469 -#define OBJ_documentTitle OBJ_pilotAttributeType,12L - -#define LN_documentVersion "documentVersion" -#define NID_documentVersion 470 -#define OBJ_documentVersion OBJ_pilotAttributeType,13L - -#define LN_documentAuthor "documentAuthor" -#define NID_documentAuthor 471 -#define OBJ_documentAuthor OBJ_pilotAttributeType,14L - -#define LN_documentLocation "documentLocation" -#define NID_documentLocation 472 -#define OBJ_documentLocation OBJ_pilotAttributeType,15L - -#define LN_homeTelephoneNumber "homeTelephoneNumber" -#define NID_homeTelephoneNumber 473 -#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L - -#define SN_secretary "secretary" -#define NID_secretary 474 -#define OBJ_secretary OBJ_pilotAttributeType,21L - -#define LN_otherMailbox "otherMailbox" -#define NID_otherMailbox 475 -#define OBJ_otherMailbox OBJ_pilotAttributeType,22L - -#define LN_lastModifiedTime "lastModifiedTime" -#define NID_lastModifiedTime 476 -#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L - -#define LN_lastModifiedBy "lastModifiedBy" -#define NID_lastModifiedBy 477 -#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L - -#define SN_domainComponent "DC" -#define LN_domainComponent "domainComponent" -#define NID_domainComponent 391 -#define OBJ_domainComponent OBJ_pilotAttributeType,25L - -#define LN_aRecord "aRecord" -#define NID_aRecord 478 -#define OBJ_aRecord OBJ_pilotAttributeType,26L - -#define LN_pilotAttributeType27 "pilotAttributeType27" -#define NID_pilotAttributeType27 479 -#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L - -#define LN_mXRecord "mXRecord" -#define NID_mXRecord 480 -#define OBJ_mXRecord OBJ_pilotAttributeType,28L - -#define LN_nSRecord "nSRecord" -#define NID_nSRecord 481 -#define OBJ_nSRecord OBJ_pilotAttributeType,29L - -#define LN_sOARecord "sOARecord" -#define NID_sOARecord 482 -#define OBJ_sOARecord OBJ_pilotAttributeType,30L - -#define LN_cNAMERecord "cNAMERecord" -#define NID_cNAMERecord 483 -#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L - -#define LN_associatedDomain "associatedDomain" -#define NID_associatedDomain 484 -#define OBJ_associatedDomain OBJ_pilotAttributeType,37L - -#define LN_associatedName "associatedName" -#define NID_associatedName 485 -#define OBJ_associatedName OBJ_pilotAttributeType,38L - -#define LN_homePostalAddress "homePostalAddress" -#define NID_homePostalAddress 486 -#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L - -#define LN_personalTitle "personalTitle" -#define NID_personalTitle 487 -#define OBJ_personalTitle OBJ_pilotAttributeType,40L - -#define LN_mobileTelephoneNumber "mobileTelephoneNumber" -#define NID_mobileTelephoneNumber 488 -#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L - -#define LN_pagerTelephoneNumber "pagerTelephoneNumber" -#define NID_pagerTelephoneNumber 489 -#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L - -#define LN_friendlyCountryName "friendlyCountryName" -#define NID_friendlyCountryName 490 -#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L - -#define LN_organizationalStatus "organizationalStatus" -#define NID_organizationalStatus 491 -#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L - -#define LN_janetMailbox "janetMailbox" -#define NID_janetMailbox 492 -#define OBJ_janetMailbox OBJ_pilotAttributeType,46L - -#define LN_mailPreferenceOption "mailPreferenceOption" -#define NID_mailPreferenceOption 493 -#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L - -#define LN_buildingName "buildingName" -#define NID_buildingName 494 -#define OBJ_buildingName OBJ_pilotAttributeType,48L - -#define LN_dSAQuality "dSAQuality" -#define NID_dSAQuality 495 -#define OBJ_dSAQuality OBJ_pilotAttributeType,49L - -#define LN_singleLevelQuality "singleLevelQuality" -#define NID_singleLevelQuality 496 -#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L - -#define LN_subtreeMinimumQuality "subtreeMinimumQuality" -#define NID_subtreeMinimumQuality 497 -#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L - -#define LN_subtreeMaximumQuality "subtreeMaximumQuality" -#define NID_subtreeMaximumQuality 498 -#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L - -#define LN_personalSignature "personalSignature" -#define NID_personalSignature 499 -#define OBJ_personalSignature OBJ_pilotAttributeType,53L - -#define LN_dITRedirect "dITRedirect" -#define NID_dITRedirect 500 -#define OBJ_dITRedirect OBJ_pilotAttributeType,54L - -#define SN_audio "audio" -#define NID_audio 501 -#define OBJ_audio OBJ_pilotAttributeType,55L - -#define LN_documentPublisher "documentPublisher" -#define NID_documentPublisher 502 -#define OBJ_documentPublisher OBJ_pilotAttributeType,56L - -#define SN_id_set "id-set" -#define LN_id_set "Secure Electronic Transactions" -#define NID_id_set 512 -#define OBJ_id_set OBJ_international_organizations,42L - -#define SN_set_ctype "set-ctype" -#define LN_set_ctype "content types" -#define NID_set_ctype 513 -#define OBJ_set_ctype OBJ_id_set,0L - -#define SN_set_msgExt "set-msgExt" -#define LN_set_msgExt "message extensions" -#define NID_set_msgExt 514 -#define OBJ_set_msgExt OBJ_id_set,1L - -#define SN_set_attr "set-attr" -#define NID_set_attr 515 -#define OBJ_set_attr OBJ_id_set,3L - -#define SN_set_policy "set-policy" -#define NID_set_policy 516 -#define OBJ_set_policy OBJ_id_set,5L - -#define SN_set_certExt "set-certExt" -#define LN_set_certExt "certificate extensions" -#define NID_set_certExt 517 -#define OBJ_set_certExt OBJ_id_set,7L - -#define SN_set_brand "set-brand" -#define NID_set_brand 518 -#define OBJ_set_brand OBJ_id_set,8L - -#define SN_setct_PANData "setct-PANData" -#define NID_setct_PANData 519 -#define OBJ_setct_PANData OBJ_set_ctype,0L - -#define SN_setct_PANToken "setct-PANToken" -#define NID_setct_PANToken 520 -#define OBJ_setct_PANToken OBJ_set_ctype,1L - -#define SN_setct_PANOnly "setct-PANOnly" -#define NID_setct_PANOnly 521 -#define OBJ_setct_PANOnly OBJ_set_ctype,2L - -#define SN_setct_OIData "setct-OIData" -#define NID_setct_OIData 522 -#define OBJ_setct_OIData OBJ_set_ctype,3L - -#define SN_setct_PI "setct-PI" -#define NID_setct_PI 523 -#define OBJ_setct_PI OBJ_set_ctype,4L - -#define SN_setct_PIData "setct-PIData" -#define NID_setct_PIData 524 -#define OBJ_setct_PIData OBJ_set_ctype,5L - -#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" -#define NID_setct_PIDataUnsigned 525 -#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L - -#define SN_setct_HODInput "setct-HODInput" -#define NID_setct_HODInput 526 -#define OBJ_setct_HODInput OBJ_set_ctype,7L - -#define SN_setct_AuthResBaggage "setct-AuthResBaggage" -#define NID_setct_AuthResBaggage 527 -#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L - -#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" -#define NID_setct_AuthRevReqBaggage 528 -#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L - -#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" -#define NID_setct_AuthRevResBaggage 529 -#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L - -#define SN_setct_CapTokenSeq "setct-CapTokenSeq" -#define NID_setct_CapTokenSeq 530 -#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L - -#define SN_setct_PInitResData "setct-PInitResData" -#define NID_setct_PInitResData 531 -#define OBJ_setct_PInitResData OBJ_set_ctype,12L - -#define SN_setct_PI_TBS "setct-PI-TBS" -#define NID_setct_PI_TBS 532 -#define OBJ_setct_PI_TBS OBJ_set_ctype,13L - -#define SN_setct_PResData "setct-PResData" -#define NID_setct_PResData 533 -#define OBJ_setct_PResData OBJ_set_ctype,14L - -#define SN_setct_AuthReqTBS "setct-AuthReqTBS" -#define NID_setct_AuthReqTBS 534 -#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L - -#define SN_setct_AuthResTBS "setct-AuthResTBS" -#define NID_setct_AuthResTBS 535 -#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L - -#define SN_setct_AuthResTBSX "setct-AuthResTBSX" -#define NID_setct_AuthResTBSX 536 -#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L - -#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" -#define NID_setct_AuthTokenTBS 537 -#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L - -#define SN_setct_CapTokenData "setct-CapTokenData" -#define NID_setct_CapTokenData 538 -#define OBJ_setct_CapTokenData OBJ_set_ctype,20L - -#define SN_setct_CapTokenTBS "setct-CapTokenTBS" -#define NID_setct_CapTokenTBS 539 -#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L - -#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" -#define NID_setct_AcqCardCodeMsg 540 -#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L - -#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" -#define NID_setct_AuthRevReqTBS 541 -#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L - -#define SN_setct_AuthRevResData "setct-AuthRevResData" -#define NID_setct_AuthRevResData 542 -#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L - -#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" -#define NID_setct_AuthRevResTBS 543 -#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L - -#define SN_setct_CapReqTBS "setct-CapReqTBS" -#define NID_setct_CapReqTBS 544 -#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L - -#define SN_setct_CapReqTBSX "setct-CapReqTBSX" -#define NID_setct_CapReqTBSX 545 -#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L - -#define SN_setct_CapResData "setct-CapResData" -#define NID_setct_CapResData 546 -#define OBJ_setct_CapResData OBJ_set_ctype,28L - -#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" -#define NID_setct_CapRevReqTBS 547 -#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L - -#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" -#define NID_setct_CapRevReqTBSX 548 -#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L - -#define SN_setct_CapRevResData "setct-CapRevResData" -#define NID_setct_CapRevResData 549 -#define OBJ_setct_CapRevResData OBJ_set_ctype,31L - -#define SN_setct_CredReqTBS "setct-CredReqTBS" -#define NID_setct_CredReqTBS 550 -#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L - -#define SN_setct_CredReqTBSX "setct-CredReqTBSX" -#define NID_setct_CredReqTBSX 551 -#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L - -#define SN_setct_CredResData "setct-CredResData" -#define NID_setct_CredResData 552 -#define OBJ_setct_CredResData OBJ_set_ctype,34L - -#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" -#define NID_setct_CredRevReqTBS 553 -#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L - -#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" -#define NID_setct_CredRevReqTBSX 554 -#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L - -#define SN_setct_CredRevResData "setct-CredRevResData" -#define NID_setct_CredRevResData 555 -#define OBJ_setct_CredRevResData OBJ_set_ctype,37L - -#define SN_setct_PCertReqData "setct-PCertReqData" -#define NID_setct_PCertReqData 556 -#define OBJ_setct_PCertReqData OBJ_set_ctype,38L - -#define SN_setct_PCertResTBS "setct-PCertResTBS" -#define NID_setct_PCertResTBS 557 -#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L - -#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" -#define NID_setct_BatchAdminReqData 558 -#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L - -#define SN_setct_BatchAdminResData "setct-BatchAdminResData" -#define NID_setct_BatchAdminResData 559 -#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L - -#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" -#define NID_setct_CardCInitResTBS 560 -#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L - -#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" -#define NID_setct_MeAqCInitResTBS 561 -#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L - -#define SN_setct_RegFormResTBS "setct-RegFormResTBS" -#define NID_setct_RegFormResTBS 562 -#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L - -#define SN_setct_CertReqData "setct-CertReqData" -#define NID_setct_CertReqData 563 -#define OBJ_setct_CertReqData OBJ_set_ctype,45L - -#define SN_setct_CertReqTBS "setct-CertReqTBS" -#define NID_setct_CertReqTBS 564 -#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L - -#define SN_setct_CertResData "setct-CertResData" -#define NID_setct_CertResData 565 -#define OBJ_setct_CertResData OBJ_set_ctype,47L - -#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" -#define NID_setct_CertInqReqTBS 566 -#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L - -#define SN_setct_ErrorTBS "setct-ErrorTBS" -#define NID_setct_ErrorTBS 567 -#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L - -#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" -#define NID_setct_PIDualSignedTBE 568 -#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L - -#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" -#define NID_setct_PIUnsignedTBE 569 -#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L - -#define SN_setct_AuthReqTBE "setct-AuthReqTBE" -#define NID_setct_AuthReqTBE 570 -#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L - -#define SN_setct_AuthResTBE "setct-AuthResTBE" -#define NID_setct_AuthResTBE 571 -#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L - -#define SN_setct_AuthResTBEX "setct-AuthResTBEX" -#define NID_setct_AuthResTBEX 572 -#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L - -#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" -#define NID_setct_AuthTokenTBE 573 -#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L - -#define SN_setct_CapTokenTBE "setct-CapTokenTBE" -#define NID_setct_CapTokenTBE 574 -#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L - -#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" -#define NID_setct_CapTokenTBEX 575 -#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L - -#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" -#define NID_setct_AcqCardCodeMsgTBE 576 -#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L - -#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" -#define NID_setct_AuthRevReqTBE 577 -#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L - -#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" -#define NID_setct_AuthRevResTBE 578 -#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L - -#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" -#define NID_setct_AuthRevResTBEB 579 -#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L - -#define SN_setct_CapReqTBE "setct-CapReqTBE" -#define NID_setct_CapReqTBE 580 -#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L - -#define SN_setct_CapReqTBEX "setct-CapReqTBEX" -#define NID_setct_CapReqTBEX 581 -#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L - -#define SN_setct_CapResTBE "setct-CapResTBE" -#define NID_setct_CapResTBE 582 -#define OBJ_setct_CapResTBE OBJ_set_ctype,64L - -#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" -#define NID_setct_CapRevReqTBE 583 -#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L - -#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" -#define NID_setct_CapRevReqTBEX 584 -#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L - -#define SN_setct_CapRevResTBE "setct-CapRevResTBE" -#define NID_setct_CapRevResTBE 585 -#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L - -#define SN_setct_CredReqTBE "setct-CredReqTBE" -#define NID_setct_CredReqTBE 586 -#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L - -#define SN_setct_CredReqTBEX "setct-CredReqTBEX" -#define NID_setct_CredReqTBEX 587 -#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L - -#define SN_setct_CredResTBE "setct-CredResTBE" -#define NID_setct_CredResTBE 588 -#define OBJ_setct_CredResTBE OBJ_set_ctype,70L - -#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" -#define NID_setct_CredRevReqTBE 589 -#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L - -#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" -#define NID_setct_CredRevReqTBEX 590 -#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L - -#define SN_setct_CredRevResTBE "setct-CredRevResTBE" -#define NID_setct_CredRevResTBE 591 -#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L - -#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" -#define NID_setct_BatchAdminReqTBE 592 -#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L - -#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" -#define NID_setct_BatchAdminResTBE 593 -#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L - -#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" -#define NID_setct_RegFormReqTBE 594 -#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L - -#define SN_setct_CertReqTBE "setct-CertReqTBE" -#define NID_setct_CertReqTBE 595 -#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L - -#define SN_setct_CertReqTBEX "setct-CertReqTBEX" -#define NID_setct_CertReqTBEX 596 -#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L - -#define SN_setct_CertResTBE "setct-CertResTBE" -#define NID_setct_CertResTBE 597 -#define OBJ_setct_CertResTBE OBJ_set_ctype,79L - -#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" -#define NID_setct_CRLNotificationTBS 598 -#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L - -#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" -#define NID_setct_CRLNotificationResTBS 599 -#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L - -#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" -#define NID_setct_BCIDistributionTBS 600 -#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L - -#define SN_setext_genCrypt "setext-genCrypt" -#define LN_setext_genCrypt "generic cryptogram" -#define NID_setext_genCrypt 601 -#define OBJ_setext_genCrypt OBJ_set_msgExt,1L - -#define SN_setext_miAuth "setext-miAuth" -#define LN_setext_miAuth "merchant initiated auth" -#define NID_setext_miAuth 602 -#define OBJ_setext_miAuth OBJ_set_msgExt,3L - -#define SN_setext_pinSecure "setext-pinSecure" -#define NID_setext_pinSecure 603 -#define OBJ_setext_pinSecure OBJ_set_msgExt,4L - -#define SN_setext_pinAny "setext-pinAny" -#define NID_setext_pinAny 604 -#define OBJ_setext_pinAny OBJ_set_msgExt,5L - -#define SN_setext_track2 "setext-track2" -#define NID_setext_track2 605 -#define OBJ_setext_track2 OBJ_set_msgExt,7L - -#define SN_setext_cv "setext-cv" -#define LN_setext_cv "additional verification" -#define NID_setext_cv 606 -#define OBJ_setext_cv OBJ_set_msgExt,8L - -#define SN_set_policy_root "set-policy-root" -#define NID_set_policy_root 607 -#define OBJ_set_policy_root OBJ_set_policy,0L - -#define SN_setCext_hashedRoot "setCext-hashedRoot" -#define NID_setCext_hashedRoot 608 -#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L - -#define SN_setCext_certType "setCext-certType" -#define NID_setCext_certType 609 -#define OBJ_setCext_certType OBJ_set_certExt,1L - -#define SN_setCext_merchData "setCext-merchData" -#define NID_setCext_merchData 610 -#define OBJ_setCext_merchData OBJ_set_certExt,2L - -#define SN_setCext_cCertRequired "setCext-cCertRequired" -#define NID_setCext_cCertRequired 611 -#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L - -#define SN_setCext_tunneling "setCext-tunneling" -#define NID_setCext_tunneling 612 -#define OBJ_setCext_tunneling OBJ_set_certExt,4L - -#define SN_setCext_setExt "setCext-setExt" -#define NID_setCext_setExt 613 -#define OBJ_setCext_setExt OBJ_set_certExt,5L - -#define SN_setCext_setQualf "setCext-setQualf" -#define NID_setCext_setQualf 614 -#define OBJ_setCext_setQualf OBJ_set_certExt,6L - -#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" -#define NID_setCext_PGWYcapabilities 615 -#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L - -#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" -#define NID_setCext_TokenIdentifier 616 -#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L - -#define SN_setCext_Track2Data "setCext-Track2Data" -#define NID_setCext_Track2Data 617 -#define OBJ_setCext_Track2Data OBJ_set_certExt,9L - -#define SN_setCext_TokenType "setCext-TokenType" -#define NID_setCext_TokenType 618 -#define OBJ_setCext_TokenType OBJ_set_certExt,10L - -#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" -#define NID_setCext_IssuerCapabilities 619 -#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L - -#define SN_setAttr_Cert "setAttr-Cert" -#define NID_setAttr_Cert 620 -#define OBJ_setAttr_Cert OBJ_set_attr,0L - -#define SN_setAttr_PGWYcap "setAttr-PGWYcap" -#define LN_setAttr_PGWYcap "payment gateway capabilities" -#define NID_setAttr_PGWYcap 621 -#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L - -#define SN_setAttr_TokenType "setAttr-TokenType" -#define NID_setAttr_TokenType 622 -#define OBJ_setAttr_TokenType OBJ_set_attr,2L - -#define SN_setAttr_IssCap "setAttr-IssCap" -#define LN_setAttr_IssCap "issuer capabilities" -#define NID_setAttr_IssCap 623 -#define OBJ_setAttr_IssCap OBJ_set_attr,3L - -#define SN_set_rootKeyThumb "set-rootKeyThumb" -#define NID_set_rootKeyThumb 624 -#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L - -#define SN_set_addPolicy "set-addPolicy" -#define NID_set_addPolicy 625 -#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L - -#define SN_setAttr_Token_EMV "setAttr-Token-EMV" -#define NID_setAttr_Token_EMV 626 -#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L - -#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" -#define NID_setAttr_Token_B0Prime 627 -#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L - -#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" -#define NID_setAttr_IssCap_CVM 628 -#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L - -#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" -#define NID_setAttr_IssCap_T2 629 -#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L - -#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" -#define NID_setAttr_IssCap_Sig 630 -#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L - -#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" -#define LN_setAttr_GenCryptgrm "generate cryptogram" -#define NID_setAttr_GenCryptgrm 631 -#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L - -#define SN_setAttr_T2Enc "setAttr-T2Enc" -#define LN_setAttr_T2Enc "encrypted track 2" -#define NID_setAttr_T2Enc 632 -#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L - -#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" -#define LN_setAttr_T2cleartxt "cleartext track 2" -#define NID_setAttr_T2cleartxt 633 -#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L - -#define SN_setAttr_TokICCsig "setAttr-TokICCsig" -#define LN_setAttr_TokICCsig "ICC or token signature" -#define NID_setAttr_TokICCsig 634 -#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L - -#define SN_setAttr_SecDevSig "setAttr-SecDevSig" -#define LN_setAttr_SecDevSig "secure device signature" -#define NID_setAttr_SecDevSig 635 -#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L - -#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" -#define NID_set_brand_IATA_ATA 636 -#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L - -#define SN_set_brand_Diners "set-brand-Diners" -#define NID_set_brand_Diners 637 -#define OBJ_set_brand_Diners OBJ_set_brand,30L - -#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" -#define NID_set_brand_AmericanExpress 638 -#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L - -#define SN_set_brand_JCB "set-brand-JCB" -#define NID_set_brand_JCB 639 -#define OBJ_set_brand_JCB OBJ_set_brand,35L - -#define SN_set_brand_Visa "set-brand-Visa" -#define NID_set_brand_Visa 640 -#define OBJ_set_brand_Visa OBJ_set_brand,4L - -#define SN_set_brand_MasterCard "set-brand-MasterCard" -#define NID_set_brand_MasterCard 641 -#define OBJ_set_brand_MasterCard OBJ_set_brand,5L - -#define SN_set_brand_Novus "set-brand-Novus" -#define NID_set_brand_Novus 642 -#define OBJ_set_brand_Novus OBJ_set_brand,6011L - -#define SN_des_cdmf "DES-CDMF" -#define LN_des_cdmf "des-cdmf" -#define NID_des_cdmf 643 -#define OBJ_des_cdmf OBJ_rsadsi,3L,10L - -#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" -#define NID_rsaOAEPEncryptionSET 644 -#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L - -#define SN_ipsec3 "Oakley-EC2N-3" -#define LN_ipsec3 "ipsec3" -#define NID_ipsec3 749 - -#define SN_ipsec4 "Oakley-EC2N-4" -#define LN_ipsec4 "ipsec4" -#define NID_ipsec4 750 - -#define SN_whirlpool "whirlpool" -#define NID_whirlpool 804 -#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L - -#define SN_cryptopro "cryptopro" -#define NID_cryptopro 805 -#define OBJ_cryptopro OBJ_member_body,643L,2L,2L - -#define SN_cryptocom "cryptocom" -#define NID_cryptocom 806 -#define OBJ_cryptocom OBJ_member_body,643L,2L,9L - -#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001" -#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001" -#define NID_id_GostR3411_94_with_GostR3410_2001 807 -#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L - -#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" -#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94" -#define NID_id_GostR3411_94_with_GostR3410_94 808 -#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L - -#define SN_id_GostR3411_94 "md_gost94" -#define LN_id_GostR3411_94 "GOST R 34.11-94" -#define NID_id_GostR3411_94 809 -#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L - -#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" -#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" -#define NID_id_HMACGostR3411_94 810 -#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L - -#define SN_id_GostR3410_2001 "gost2001" -#define LN_id_GostR3410_2001 "GOST R 34.10-2001" -#define NID_id_GostR3410_2001 811 -#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L - -#define SN_id_GostR3410_94 "gost94" -#define LN_id_GostR3410_94 "GOST R 34.10-94" -#define NID_id_GostR3410_94 812 -#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L - -#define SN_id_Gost28147_89 "gost89" -#define LN_id_Gost28147_89 "GOST 28147-89" -#define NID_id_Gost28147_89 813 -#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L - -#define SN_gost89_cnt "gost89-cnt" -#define NID_gost89_cnt 814 - -#define SN_id_Gost28147_89_MAC "gost-mac" -#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" -#define NID_id_Gost28147_89_MAC 815 -#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L - -#define SN_id_GostR3411_94_prf "prf-gostr3411-94" -#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" -#define NID_id_GostR3411_94_prf 816 -#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L - -#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" -#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" -#define NID_id_GostR3410_2001DH 817 -#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L - -#define SN_id_GostR3410_94DH "id-GostR3410-94DH" -#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" -#define NID_id_GostR3410_94DH 818 -#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L - -#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing" -#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 -#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L - -#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" -#define NID_id_Gost28147_89_None_KeyMeshing 820 -#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L - -#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" -#define NID_id_GostR3411_94_TestParamSet 821 -#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L - -#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" -#define NID_id_GostR3411_94_CryptoProParamSet 822 -#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L - -#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" -#define NID_id_Gost28147_89_TestParamSet 823 -#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L - -#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 -#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L - -#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 -#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L - -#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 -#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L - -#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 -#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L - -#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 -#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L - -#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 -#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L - -#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 -#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L - -#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" -#define NID_id_GostR3410_94_TestParamSet 831 -#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L - -#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 -#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L - -#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 -#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L - -#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 -#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L - -#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 -#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L - -#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 -#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L - -#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 -#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L - -#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 -#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L - -#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" -#define NID_id_GostR3410_2001_TestParamSet 839 -#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L - -#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 -#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L - -#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 -#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L - -#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 -#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L - -#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 -#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L - -#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 -#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L - -#define SN_id_GostR3410_94_a "id-GostR3410-94-a" -#define NID_id_GostR3410_94_a 845 -#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L - -#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" -#define NID_id_GostR3410_94_aBis 846 -#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L - -#define SN_id_GostR3410_94_b "id-GostR3410-94-b" -#define NID_id_GostR3410_94_b 847 -#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L - -#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" -#define NID_id_GostR3410_94_bBis 848 -#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L - -#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" -#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" -#define NID_id_Gost28147_89_cc 849 -#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L - -#define SN_id_GostR3410_94_cc "gost94cc" -#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" -#define NID_id_GostR3410_94_cc 850 -#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L - -#define SN_id_GostR3410_2001_cc "gost2001cc" -#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" -#define NID_id_GostR3410_2001_cc 851 -#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L - -#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc" -#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" -#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 -#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L - -#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc" -#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" -#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 -#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L - -#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" -#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom" -#define NID_id_GostR3410_2001_ParamSet_cc 854 -#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L - -#define SN_camellia_128_cbc "CAMELLIA-128-CBC" -#define LN_camellia_128_cbc "camellia-128-cbc" -#define NID_camellia_128_cbc 751 -#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L - -#define SN_camellia_192_cbc "CAMELLIA-192-CBC" -#define LN_camellia_192_cbc "camellia-192-cbc" -#define NID_camellia_192_cbc 752 -#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L - -#define SN_camellia_256_cbc "CAMELLIA-256-CBC" -#define LN_camellia_256_cbc "camellia-256-cbc" -#define NID_camellia_256_cbc 753 -#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L - -#define OBJ_ntt_ds 0L,3L,4401L,5L - -#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L - -#define SN_camellia_128_ecb "CAMELLIA-128-ECB" -#define LN_camellia_128_ecb "camellia-128-ecb" -#define NID_camellia_128_ecb 754 -#define OBJ_camellia_128_ecb OBJ_camellia,1L - -#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" -#define LN_camellia_128_ofb128 "camellia-128-ofb" -#define NID_camellia_128_ofb128 766 -#define OBJ_camellia_128_ofb128 OBJ_camellia,3L - -#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" -#define LN_camellia_128_cfb128 "camellia-128-cfb" -#define NID_camellia_128_cfb128 757 -#define OBJ_camellia_128_cfb128 OBJ_camellia,4L - -#define SN_camellia_192_ecb "CAMELLIA-192-ECB" -#define LN_camellia_192_ecb "camellia-192-ecb" -#define NID_camellia_192_ecb 755 -#define OBJ_camellia_192_ecb OBJ_camellia,21L - -#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" -#define LN_camellia_192_ofb128 "camellia-192-ofb" -#define NID_camellia_192_ofb128 767 -#define OBJ_camellia_192_ofb128 OBJ_camellia,23L - -#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" -#define LN_camellia_192_cfb128 "camellia-192-cfb" -#define NID_camellia_192_cfb128 758 -#define OBJ_camellia_192_cfb128 OBJ_camellia,24L - -#define SN_camellia_256_ecb "CAMELLIA-256-ECB" -#define LN_camellia_256_ecb "camellia-256-ecb" -#define NID_camellia_256_ecb 756 -#define OBJ_camellia_256_ecb OBJ_camellia,41L - -#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" -#define LN_camellia_256_ofb128 "camellia-256-ofb" -#define NID_camellia_256_ofb128 768 -#define OBJ_camellia_256_ofb128 OBJ_camellia,43L - -#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" -#define LN_camellia_256_cfb128 "camellia-256-cfb" -#define NID_camellia_256_cfb128 759 -#define OBJ_camellia_256_cfb128 OBJ_camellia,44L - -#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" -#define LN_camellia_128_cfb1 "camellia-128-cfb1" -#define NID_camellia_128_cfb1 760 - -#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" -#define LN_camellia_192_cfb1 "camellia-192-cfb1" -#define NID_camellia_192_cfb1 761 - -#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" -#define LN_camellia_256_cfb1 "camellia-256-cfb1" -#define NID_camellia_256_cfb1 762 - -#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" -#define LN_camellia_128_cfb8 "camellia-128-cfb8" -#define NID_camellia_128_cfb8 763 - -#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" -#define LN_camellia_192_cfb8 "camellia-192-cfb8" -#define NID_camellia_192_cfb8 764 - -#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" -#define LN_camellia_256_cfb8 "camellia-256-cfb8" -#define NID_camellia_256_cfb8 765 - -#define SN_kisa "KISA" -#define LN_kisa "kisa" -#define NID_kisa 773 -#define OBJ_kisa OBJ_member_body,410L,200004L - -#define SN_seed_ecb "SEED-ECB" -#define LN_seed_ecb "seed-ecb" -#define NID_seed_ecb 776 -#define OBJ_seed_ecb OBJ_kisa,1L,3L - -#define SN_seed_cbc "SEED-CBC" -#define LN_seed_cbc "seed-cbc" -#define NID_seed_cbc 777 -#define OBJ_seed_cbc OBJ_kisa,1L,4L - -#define SN_seed_cfb128 "SEED-CFB" -#define LN_seed_cfb128 "seed-cfb" -#define NID_seed_cfb128 779 -#define OBJ_seed_cfb128 OBJ_kisa,1L,5L - -#define SN_seed_ofb128 "SEED-OFB" -#define LN_seed_ofb128 "seed-ofb" -#define NID_seed_ofb128 778 -#define OBJ_seed_ofb128 OBJ_kisa,1L,6L - -#define SN_hmac "HMAC" -#define LN_hmac "hmac" -#define NID_hmac 855 - diff --git a/dep/include/openssl/objects.h b/dep/include/openssl/objects.h deleted file mode 100644 index b44abc3e683..00000000000 --- a/dep/include/openssl/objects.h +++ /dev/null @@ -1,1050 +0,0 @@ -/* crypto/objects/objects.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_OBJECTS_H -#define HEADER_OBJECTS_H - -#define USE_OBJ_MAC - -#ifdef USE_OBJ_MAC -#include -#else -#define SN_undef "UNDEF" -#define LN_undef "undefined" -#define NID_undef 0 -#define OBJ_undef 0L - -#define SN_Algorithm "Algorithm" -#define LN_algorithm "algorithm" -#define NID_algorithm 38 -#define OBJ_algorithm 1L,3L,14L,3L,2L - -#define LN_rsadsi "rsadsi" -#define NID_rsadsi 1 -#define OBJ_rsadsi 1L,2L,840L,113549L - -#define LN_pkcs "pkcs" -#define NID_pkcs 2 -#define OBJ_pkcs OBJ_rsadsi,1L - -#define SN_md2 "MD2" -#define LN_md2 "md2" -#define NID_md2 3 -#define OBJ_md2 OBJ_rsadsi,2L,2L - -#define SN_md5 "MD5" -#define LN_md5 "md5" -#define NID_md5 4 -#define OBJ_md5 OBJ_rsadsi,2L,5L - -#define SN_rc4 "RC4" -#define LN_rc4 "rc4" -#define NID_rc4 5 -#define OBJ_rc4 OBJ_rsadsi,3L,4L - -#define LN_rsaEncryption "rsaEncryption" -#define NID_rsaEncryption 6 -#define OBJ_rsaEncryption OBJ_pkcs,1L,1L - -#define SN_md2WithRSAEncryption "RSA-MD2" -#define LN_md2WithRSAEncryption "md2WithRSAEncryption" -#define NID_md2WithRSAEncryption 7 -#define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L - -#define SN_md5WithRSAEncryption "RSA-MD5" -#define LN_md5WithRSAEncryption "md5WithRSAEncryption" -#define NID_md5WithRSAEncryption 8 -#define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L - -#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" -#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" -#define NID_pbeWithMD2AndDES_CBC 9 -#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L - -#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" -#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" -#define NID_pbeWithMD5AndDES_CBC 10 -#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L - -#define LN_X500 "X500" -#define NID_X500 11 -#define OBJ_X500 2L,5L - -#define LN_X509 "X509" -#define NID_X509 12 -#define OBJ_X509 OBJ_X500,4L - -#define SN_commonName "CN" -#define LN_commonName "commonName" -#define NID_commonName 13 -#define OBJ_commonName OBJ_X509,3L - -#define SN_countryName "C" -#define LN_countryName "countryName" -#define NID_countryName 14 -#define OBJ_countryName OBJ_X509,6L - -#define SN_localityName "L" -#define LN_localityName "localityName" -#define NID_localityName 15 -#define OBJ_localityName OBJ_X509,7L - -/* Postal Address? PA */ - -/* should be "ST" (rfc1327) but MS uses 'S' */ -#define SN_stateOrProvinceName "ST" -#define LN_stateOrProvinceName "stateOrProvinceName" -#define NID_stateOrProvinceName 16 -#define OBJ_stateOrProvinceName OBJ_X509,8L - -#define SN_organizationName "O" -#define LN_organizationName "organizationName" -#define NID_organizationName 17 -#define OBJ_organizationName OBJ_X509,10L - -#define SN_organizationalUnitName "OU" -#define LN_organizationalUnitName "organizationalUnitName" -#define NID_organizationalUnitName 18 -#define OBJ_organizationalUnitName OBJ_X509,11L - -#define SN_rsa "RSA" -#define LN_rsa "rsa" -#define NID_rsa 19 -#define OBJ_rsa OBJ_X500,8L,1L,1L - -#define LN_pkcs7 "pkcs7" -#define NID_pkcs7 20 -#define OBJ_pkcs7 OBJ_pkcs,7L - -#define LN_pkcs7_data "pkcs7-data" -#define NID_pkcs7_data 21 -#define OBJ_pkcs7_data OBJ_pkcs7,1L - -#define LN_pkcs7_signed "pkcs7-signedData" -#define NID_pkcs7_signed 22 -#define OBJ_pkcs7_signed OBJ_pkcs7,2L - -#define LN_pkcs7_enveloped "pkcs7-envelopedData" -#define NID_pkcs7_enveloped 23 -#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L - -#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" -#define NID_pkcs7_signedAndEnveloped 24 -#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L - -#define LN_pkcs7_digest "pkcs7-digestData" -#define NID_pkcs7_digest 25 -#define OBJ_pkcs7_digest OBJ_pkcs7,5L - -#define LN_pkcs7_encrypted "pkcs7-encryptedData" -#define NID_pkcs7_encrypted 26 -#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L - -#define LN_pkcs3 "pkcs3" -#define NID_pkcs3 27 -#define OBJ_pkcs3 OBJ_pkcs,3L - -#define LN_dhKeyAgreement "dhKeyAgreement" -#define NID_dhKeyAgreement 28 -#define OBJ_dhKeyAgreement OBJ_pkcs3,1L - -#define SN_des_ecb "DES-ECB" -#define LN_des_ecb "des-ecb" -#define NID_des_ecb 29 -#define OBJ_des_ecb OBJ_algorithm,6L - -#define SN_des_cfb64 "DES-CFB" -#define LN_des_cfb64 "des-cfb" -#define NID_des_cfb64 30 -/* IV + num */ -#define OBJ_des_cfb64 OBJ_algorithm,9L - -#define SN_des_cbc "DES-CBC" -#define LN_des_cbc "des-cbc" -#define NID_des_cbc 31 -/* IV */ -#define OBJ_des_cbc OBJ_algorithm,7L - -#define SN_des_ede "DES-EDE" -#define LN_des_ede "des-ede" -#define NID_des_ede 32 -/* ?? */ -#define OBJ_des_ede OBJ_algorithm,17L - -#define SN_des_ede3 "DES-EDE3" -#define LN_des_ede3 "des-ede3" -#define NID_des_ede3 33 - -#define SN_idea_cbc "IDEA-CBC" -#define LN_idea_cbc "idea-cbc" -#define NID_idea_cbc 34 -#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L - -#define SN_idea_cfb64 "IDEA-CFB" -#define LN_idea_cfb64 "idea-cfb" -#define NID_idea_cfb64 35 - -#define SN_idea_ecb "IDEA-ECB" -#define LN_idea_ecb "idea-ecb" -#define NID_idea_ecb 36 - -#define SN_rc2_cbc "RC2-CBC" -#define LN_rc2_cbc "rc2-cbc" -#define NID_rc2_cbc 37 -#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L - -#define SN_rc2_ecb "RC2-ECB" -#define LN_rc2_ecb "rc2-ecb" -#define NID_rc2_ecb 38 - -#define SN_rc2_cfb64 "RC2-CFB" -#define LN_rc2_cfb64 "rc2-cfb" -#define NID_rc2_cfb64 39 - -#define SN_rc2_ofb64 "RC2-OFB" -#define LN_rc2_ofb64 "rc2-ofb" -#define NID_rc2_ofb64 40 - -#define SN_sha "SHA" -#define LN_sha "sha" -#define NID_sha 41 -#define OBJ_sha OBJ_algorithm,18L - -#define SN_shaWithRSAEncryption "RSA-SHA" -#define LN_shaWithRSAEncryption "shaWithRSAEncryption" -#define NID_shaWithRSAEncryption 42 -#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L - -#define SN_des_ede_cbc "DES-EDE-CBC" -#define LN_des_ede_cbc "des-ede-cbc" -#define NID_des_ede_cbc 43 - -#define SN_des_ede3_cbc "DES-EDE3-CBC" -#define LN_des_ede3_cbc "des-ede3-cbc" -#define NID_des_ede3_cbc 44 -#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L - -#define SN_des_ofb64 "DES-OFB" -#define LN_des_ofb64 "des-ofb" -#define NID_des_ofb64 45 -#define OBJ_des_ofb64 OBJ_algorithm,8L - -#define SN_idea_ofb64 "IDEA-OFB" -#define LN_idea_ofb64 "idea-ofb" -#define NID_idea_ofb64 46 - -#define LN_pkcs9 "pkcs9" -#define NID_pkcs9 47 -#define OBJ_pkcs9 OBJ_pkcs,9L - -#define SN_pkcs9_emailAddress "Email" -#define LN_pkcs9_emailAddress "emailAddress" -#define NID_pkcs9_emailAddress 48 -#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L - -#define LN_pkcs9_unstructuredName "unstructuredName" -#define NID_pkcs9_unstructuredName 49 -#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L - -#define LN_pkcs9_contentType "contentType" -#define NID_pkcs9_contentType 50 -#define OBJ_pkcs9_contentType OBJ_pkcs9,3L - -#define LN_pkcs9_messageDigest "messageDigest" -#define NID_pkcs9_messageDigest 51 -#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L - -#define LN_pkcs9_signingTime "signingTime" -#define NID_pkcs9_signingTime 52 -#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L - -#define LN_pkcs9_countersignature "countersignature" -#define NID_pkcs9_countersignature 53 -#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L - -#define LN_pkcs9_challengePassword "challengePassword" -#define NID_pkcs9_challengePassword 54 -#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L - -#define LN_pkcs9_unstructuredAddress "unstructuredAddress" -#define NID_pkcs9_unstructuredAddress 55 -#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L - -#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" -#define NID_pkcs9_extCertAttributes 56 -#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L - -#define SN_netscape "Netscape" -#define LN_netscape "Netscape Communications Corp." -#define NID_netscape 57 -#define OBJ_netscape 2L,16L,840L,1L,113730L - -#define SN_netscape_cert_extension "nsCertExt" -#define LN_netscape_cert_extension "Netscape Certificate Extension" -#define NID_netscape_cert_extension 58 -#define OBJ_netscape_cert_extension OBJ_netscape,1L - -#define SN_netscape_data_type "nsDataType" -#define LN_netscape_data_type "Netscape Data Type" -#define NID_netscape_data_type 59 -#define OBJ_netscape_data_type OBJ_netscape,2L - -#define SN_des_ede_cfb64 "DES-EDE-CFB" -#define LN_des_ede_cfb64 "des-ede-cfb" -#define NID_des_ede_cfb64 60 - -#define SN_des_ede3_cfb64 "DES-EDE3-CFB" -#define LN_des_ede3_cfb64 "des-ede3-cfb" -#define NID_des_ede3_cfb64 61 - -#define SN_des_ede_ofb64 "DES-EDE-OFB" -#define LN_des_ede_ofb64 "des-ede-ofb" -#define NID_des_ede_ofb64 62 - -#define SN_des_ede3_ofb64 "DES-EDE3-OFB" -#define LN_des_ede3_ofb64 "des-ede3-ofb" -#define NID_des_ede3_ofb64 63 - -/* I'm not sure about the object ID */ -#define SN_sha1 "SHA1" -#define LN_sha1 "sha1" -#define NID_sha1 64 -#define OBJ_sha1 OBJ_algorithm,26L -/* 28 Jun 1996 - eay */ -/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */ - -#define SN_sha1WithRSAEncryption "RSA-SHA1" -#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" -#define NID_sha1WithRSAEncryption 65 -#define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L - -#define SN_dsaWithSHA "DSA-SHA" -#define LN_dsaWithSHA "dsaWithSHA" -#define NID_dsaWithSHA 66 -#define OBJ_dsaWithSHA OBJ_algorithm,13L - -#define SN_dsa_2 "DSA-old" -#define LN_dsa_2 "dsaEncryption-old" -#define NID_dsa_2 67 -#define OBJ_dsa_2 OBJ_algorithm,12L - -/* proposed by microsoft to RSA */ -#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" -#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" -#define NID_pbeWithSHA1AndRC2_CBC 68 -#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L - -/* proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now - * defined explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something - * completely different. - */ -#define LN_id_pbkdf2 "PBKDF2" -#define NID_id_pbkdf2 69 -#define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L - -#define SN_dsaWithSHA1_2 "DSA-SHA1-old" -#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" -#define NID_dsaWithSHA1_2 70 -/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */ -#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L - -#define SN_netscape_cert_type "nsCertType" -#define LN_netscape_cert_type "Netscape Cert Type" -#define NID_netscape_cert_type 71 -#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L - -#define SN_netscape_base_url "nsBaseUrl" -#define LN_netscape_base_url "Netscape Base Url" -#define NID_netscape_base_url 72 -#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L - -#define SN_netscape_revocation_url "nsRevocationUrl" -#define LN_netscape_revocation_url "Netscape Revocation Url" -#define NID_netscape_revocation_url 73 -#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L - -#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" -#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" -#define NID_netscape_ca_revocation_url 74 -#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L - -#define SN_netscape_renewal_url "nsRenewalUrl" -#define LN_netscape_renewal_url "Netscape Renewal Url" -#define NID_netscape_renewal_url 75 -#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L - -#define SN_netscape_ca_policy_url "nsCaPolicyUrl" -#define LN_netscape_ca_policy_url "Netscape CA Policy Url" -#define NID_netscape_ca_policy_url 76 -#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L - -#define SN_netscape_ssl_server_name "nsSslServerName" -#define LN_netscape_ssl_server_name "Netscape SSL Server Name" -#define NID_netscape_ssl_server_name 77 -#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L - -#define SN_netscape_comment "nsComment" -#define LN_netscape_comment "Netscape Comment" -#define NID_netscape_comment 78 -#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L - -#define SN_netscape_cert_sequence "nsCertSequence" -#define LN_netscape_cert_sequence "Netscape Certificate Sequence" -#define NID_netscape_cert_sequence 79 -#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L - -#define SN_desx_cbc "DESX-CBC" -#define LN_desx_cbc "desx-cbc" -#define NID_desx_cbc 80 - -#define SN_id_ce "id-ce" -#define NID_id_ce 81 -#define OBJ_id_ce 2L,5L,29L - -#define SN_subject_key_identifier "subjectKeyIdentifier" -#define LN_subject_key_identifier "X509v3 Subject Key Identifier" -#define NID_subject_key_identifier 82 -#define OBJ_subject_key_identifier OBJ_id_ce,14L - -#define SN_key_usage "keyUsage" -#define LN_key_usage "X509v3 Key Usage" -#define NID_key_usage 83 -#define OBJ_key_usage OBJ_id_ce,15L - -#define SN_private_key_usage_period "privateKeyUsagePeriod" -#define LN_private_key_usage_period "X509v3 Private Key Usage Period" -#define NID_private_key_usage_period 84 -#define OBJ_private_key_usage_period OBJ_id_ce,16L - -#define SN_subject_alt_name "subjectAltName" -#define LN_subject_alt_name "X509v3 Subject Alternative Name" -#define NID_subject_alt_name 85 -#define OBJ_subject_alt_name OBJ_id_ce,17L - -#define SN_issuer_alt_name "issuerAltName" -#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" -#define NID_issuer_alt_name 86 -#define OBJ_issuer_alt_name OBJ_id_ce,18L - -#define SN_basic_constraints "basicConstraints" -#define LN_basic_constraints "X509v3 Basic Constraints" -#define NID_basic_constraints 87 -#define OBJ_basic_constraints OBJ_id_ce,19L - -#define SN_crl_number "crlNumber" -#define LN_crl_number "X509v3 CRL Number" -#define NID_crl_number 88 -#define OBJ_crl_number OBJ_id_ce,20L - -#define SN_certificate_policies "certificatePolicies" -#define LN_certificate_policies "X509v3 Certificate Policies" -#define NID_certificate_policies 89 -#define OBJ_certificate_policies OBJ_id_ce,32L - -#define SN_authority_key_identifier "authorityKeyIdentifier" -#define LN_authority_key_identifier "X509v3 Authority Key Identifier" -#define NID_authority_key_identifier 90 -#define OBJ_authority_key_identifier OBJ_id_ce,35L - -#define SN_bf_cbc "BF-CBC" -#define LN_bf_cbc "bf-cbc" -#define NID_bf_cbc 91 -#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L - -#define SN_bf_ecb "BF-ECB" -#define LN_bf_ecb "bf-ecb" -#define NID_bf_ecb 92 - -#define SN_bf_cfb64 "BF-CFB" -#define LN_bf_cfb64 "bf-cfb" -#define NID_bf_cfb64 93 - -#define SN_bf_ofb64 "BF-OFB" -#define LN_bf_ofb64 "bf-ofb" -#define NID_bf_ofb64 94 - -#define SN_mdc2 "MDC2" -#define LN_mdc2 "mdc2" -#define NID_mdc2 95 -#define OBJ_mdc2 2L,5L,8L,3L,101L -/* An alternative? 1L,3L,14L,3L,2L,19L */ - -#define SN_mdc2WithRSA "RSA-MDC2" -#define LN_mdc2WithRSA "mdc2withRSA" -#define NID_mdc2WithRSA 96 -#define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L - -#define SN_rc4_40 "RC4-40" -#define LN_rc4_40 "rc4-40" -#define NID_rc4_40 97 - -#define SN_rc2_40_cbc "RC2-40-CBC" -#define LN_rc2_40_cbc "rc2-40-cbc" -#define NID_rc2_40_cbc 98 - -#define SN_givenName "G" -#define LN_givenName "givenName" -#define NID_givenName 99 -#define OBJ_givenName OBJ_X509,42L - -#define SN_surname "S" -#define LN_surname "surname" -#define NID_surname 100 -#define OBJ_surname OBJ_X509,4L - -#define SN_initials "I" -#define LN_initials "initials" -#define NID_initials 101 -#define OBJ_initials OBJ_X509,43L - -#define SN_uniqueIdentifier "UID" -#define LN_uniqueIdentifier "uniqueIdentifier" -#define NID_uniqueIdentifier 102 -#define OBJ_uniqueIdentifier OBJ_X509,45L - -#define SN_crl_distribution_points "crlDistributionPoints" -#define LN_crl_distribution_points "X509v3 CRL Distribution Points" -#define NID_crl_distribution_points 103 -#define OBJ_crl_distribution_points OBJ_id_ce,31L - -#define SN_md5WithRSA "RSA-NP-MD5" -#define LN_md5WithRSA "md5WithRSA" -#define NID_md5WithRSA 104 -#define OBJ_md5WithRSA OBJ_algorithm,3L - -#define SN_serialNumber "SN" -#define LN_serialNumber "serialNumber" -#define NID_serialNumber 105 -#define OBJ_serialNumber OBJ_X509,5L - -#define SN_title "T" -#define LN_title "title" -#define NID_title 106 -#define OBJ_title OBJ_X509,12L - -#define SN_description "D" -#define LN_description "description" -#define NID_description 107 -#define OBJ_description OBJ_X509,13L - -/* CAST5 is CAST-128, I'm just sticking with the documentation */ -#define SN_cast5_cbc "CAST5-CBC" -#define LN_cast5_cbc "cast5-cbc" -#define NID_cast5_cbc 108 -#define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L - -#define SN_cast5_ecb "CAST5-ECB" -#define LN_cast5_ecb "cast5-ecb" -#define NID_cast5_ecb 109 - -#define SN_cast5_cfb64 "CAST5-CFB" -#define LN_cast5_cfb64 "cast5-cfb" -#define NID_cast5_cfb64 110 - -#define SN_cast5_ofb64 "CAST5-OFB" -#define LN_cast5_ofb64 "cast5-ofb" -#define NID_cast5_ofb64 111 - -#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" -#define NID_pbeWithMD5AndCast5_CBC 112 -#define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L - -/* This is one sun will soon be using :-( - * id-dsa-with-sha1 ID ::= { - * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 } - */ -#define SN_dsaWithSHA1 "DSA-SHA1" -#define LN_dsaWithSHA1 "dsaWithSHA1" -#define NID_dsaWithSHA1 113 -#define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L - -#define NID_md5_sha1 114 -#define SN_md5_sha1 "MD5-SHA1" -#define LN_md5_sha1 "md5-sha1" - -#define SN_sha1WithRSA "RSA-SHA1-2" -#define LN_sha1WithRSA "sha1WithRSA" -#define NID_sha1WithRSA 115 -#define OBJ_sha1WithRSA OBJ_algorithm,29L - -#define SN_dsa "DSA" -#define LN_dsa "dsaEncryption" -#define NID_dsa 116 -#define OBJ_dsa 1L,2L,840L,10040L,4L,1L - -#define SN_ripemd160 "RIPEMD160" -#define LN_ripemd160 "ripemd160" -#define NID_ripemd160 117 -#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L - -/* The name should actually be rsaSignatureWithripemd160, but I'm going - * to continue using the convention I'm using with the other ciphers */ -#define SN_ripemd160WithRSA "RSA-RIPEMD160" -#define LN_ripemd160WithRSA "ripemd160WithRSA" -#define NID_ripemd160WithRSA 119 -#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L - -/* Taken from rfc2040 - * RC5_CBC_Parameters ::= SEQUENCE { - * version INTEGER (v1_0(16)), - * rounds INTEGER (8..127), - * blockSizeInBits INTEGER (64, 128), - * iv OCTET STRING OPTIONAL - * } - */ -#define SN_rc5_cbc "RC5-CBC" -#define LN_rc5_cbc "rc5-cbc" -#define NID_rc5_cbc 120 -#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L - -#define SN_rc5_ecb "RC5-ECB" -#define LN_rc5_ecb "rc5-ecb" -#define NID_rc5_ecb 121 - -#define SN_rc5_cfb64 "RC5-CFB" -#define LN_rc5_cfb64 "rc5-cfb" -#define NID_rc5_cfb64 122 - -#define SN_rc5_ofb64 "RC5-OFB" -#define LN_rc5_ofb64 "rc5-ofb" -#define NID_rc5_ofb64 123 - -#define SN_rle_compression "RLE" -#define LN_rle_compression "run length compression" -#define NID_rle_compression 124 -#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L - -#define SN_zlib_compression "ZLIB" -#define LN_zlib_compression "zlib compression" -#define NID_zlib_compression 125 -#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L - -#define SN_ext_key_usage "extendedKeyUsage" -#define LN_ext_key_usage "X509v3 Extended Key Usage" -#define NID_ext_key_usage 126 -#define OBJ_ext_key_usage OBJ_id_ce,37 - -#define SN_id_pkix "PKIX" -#define NID_id_pkix 127 -#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L - -#define SN_id_kp "id-kp" -#define NID_id_kp 128 -#define OBJ_id_kp OBJ_id_pkix,3L - -/* PKIX extended key usage OIDs */ - -#define SN_server_auth "serverAuth" -#define LN_server_auth "TLS Web Server Authentication" -#define NID_server_auth 129 -#define OBJ_server_auth OBJ_id_kp,1L - -#define SN_client_auth "clientAuth" -#define LN_client_auth "TLS Web Client Authentication" -#define NID_client_auth 130 -#define OBJ_client_auth OBJ_id_kp,2L - -#define SN_code_sign "codeSigning" -#define LN_code_sign "Code Signing" -#define NID_code_sign 131 -#define OBJ_code_sign OBJ_id_kp,3L - -#define SN_email_protect "emailProtection" -#define LN_email_protect "E-mail Protection" -#define NID_email_protect 132 -#define OBJ_email_protect OBJ_id_kp,4L - -#define SN_time_stamp "timeStamping" -#define LN_time_stamp "Time Stamping" -#define NID_time_stamp 133 -#define OBJ_time_stamp OBJ_id_kp,8L - -/* Additional extended key usage OIDs: Microsoft */ - -#define SN_ms_code_ind "msCodeInd" -#define LN_ms_code_ind "Microsoft Individual Code Signing" -#define NID_ms_code_ind 134 -#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L - -#define SN_ms_code_com "msCodeCom" -#define LN_ms_code_com "Microsoft Commercial Code Signing" -#define NID_ms_code_com 135 -#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L - -#define SN_ms_ctl_sign "msCTLSign" -#define LN_ms_ctl_sign "Microsoft Trust List Signing" -#define NID_ms_ctl_sign 136 -#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L - -#define SN_ms_sgc "msSGC" -#define LN_ms_sgc "Microsoft Server Gated Crypto" -#define NID_ms_sgc 137 -#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L - -#define SN_ms_efs "msEFS" -#define LN_ms_efs "Microsoft Encrypted File System" -#define NID_ms_efs 138 -#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L - -/* Additional usage: Netscape */ - -#define SN_ns_sgc "nsSGC" -#define LN_ns_sgc "Netscape Server Gated Crypto" -#define NID_ns_sgc 139 -#define OBJ_ns_sgc OBJ_netscape,4L,1L - -#define SN_delta_crl "deltaCRL" -#define LN_delta_crl "X509v3 Delta CRL Indicator" -#define NID_delta_crl 140 -#define OBJ_delta_crl OBJ_id_ce,27L - -#define SN_crl_reason "CRLReason" -#define LN_crl_reason "CRL Reason Code" -#define NID_crl_reason 141 -#define OBJ_crl_reason OBJ_id_ce,21L - -#define SN_invalidity_date "invalidityDate" -#define LN_invalidity_date "Invalidity Date" -#define NID_invalidity_date 142 -#define OBJ_invalidity_date OBJ_id_ce,24L - -#define SN_sxnet "SXNetID" -#define LN_sxnet "Strong Extranet ID" -#define NID_sxnet 143 -#define OBJ_sxnet 1L,3L,101L,1L,4L,1L - -/* PKCS12 and related OBJECT IDENTIFIERS */ - -#define OBJ_pkcs12 OBJ_pkcs,12L -#define OBJ_pkcs12_pbeids OBJ_pkcs12, 1 - -#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" -#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" -#define NID_pbe_WithSHA1And128BitRC4 144 -#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L - -#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" -#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" -#define NID_pbe_WithSHA1And40BitRC4 145 -#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L - -#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" -#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 -#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L - -#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" -#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 -#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L - -#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" -#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" -#define NID_pbe_WithSHA1And128BitRC2_CBC 148 -#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L - -#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" -#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" -#define NID_pbe_WithSHA1And40BitRC2_CBC 149 -#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L - -#define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L - -#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L - -#define LN_keyBag "keyBag" -#define NID_keyBag 150 -#define OBJ_keyBag OBJ_pkcs12_BagIds, 1L - -#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" -#define NID_pkcs8ShroudedKeyBag 151 -#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L - -#define LN_certBag "certBag" -#define NID_certBag 152 -#define OBJ_certBag OBJ_pkcs12_BagIds, 3L - -#define LN_crlBag "crlBag" -#define NID_crlBag 153 -#define OBJ_crlBag OBJ_pkcs12_BagIds, 4L - -#define LN_secretBag "secretBag" -#define NID_secretBag 154 -#define OBJ_secretBag OBJ_pkcs12_BagIds, 5L - -#define LN_safeContentsBag "safeContentsBag" -#define NID_safeContentsBag 155 -#define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L - -#define LN_friendlyName "friendlyName" -#define NID_friendlyName 156 -#define OBJ_friendlyName OBJ_pkcs9, 20L - -#define LN_localKeyID "localKeyID" -#define NID_localKeyID 157 -#define OBJ_localKeyID OBJ_pkcs9, 21L - -#define OBJ_certTypes OBJ_pkcs9, 22L - -#define LN_x509Certificate "x509Certificate" -#define NID_x509Certificate 158 -#define OBJ_x509Certificate OBJ_certTypes, 1L - -#define LN_sdsiCertificate "sdsiCertificate" -#define NID_sdsiCertificate 159 -#define OBJ_sdsiCertificate OBJ_certTypes, 2L - -#define OBJ_crlTypes OBJ_pkcs9, 23L - -#define LN_x509Crl "x509Crl" -#define NID_x509Crl 160 -#define OBJ_x509Crl OBJ_crlTypes, 1L - -/* PKCS#5 v2 OIDs */ - -#define LN_pbes2 "PBES2" -#define NID_pbes2 161 -#define OBJ_pbes2 OBJ_pkcs,5L,13L - -#define LN_pbmac1 "PBMAC1" -#define NID_pbmac1 162 -#define OBJ_pbmac1 OBJ_pkcs,5L,14L - -#define LN_hmacWithSHA1 "hmacWithSHA1" -#define NID_hmacWithSHA1 163 -#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L - -/* Policy Qualifier Ids */ - -#define LN_id_qt_cps "Policy Qualifier CPS" -#define SN_id_qt_cps "id-qt-cps" -#define NID_id_qt_cps 164 -#define OBJ_id_qt_cps OBJ_id_pkix,2L,1L - -#define LN_id_qt_unotice "Policy Qualifier User Notice" -#define SN_id_qt_unotice "id-qt-unotice" -#define NID_id_qt_unotice 165 -#define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L - -#define SN_rc2_64_cbc "RC2-64-CBC" -#define LN_rc2_64_cbc "rc2-64-cbc" -#define NID_rc2_64_cbc 166 - -#define SN_SMIMECapabilities "SMIME-CAPS" -#define LN_SMIMECapabilities "S/MIME Capabilities" -#define NID_SMIMECapabilities 167 -#define OBJ_SMIMECapabilities OBJ_pkcs9,15L - -#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" -#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" -#define NID_pbeWithMD2AndRC2_CBC 168 -#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L - -#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" -#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" -#define NID_pbeWithMD5AndRC2_CBC 169 -#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L - -#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" -#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" -#define NID_pbeWithSHA1AndDES_CBC 170 -#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L - -/* Extension request OIDs */ - -#define LN_ms_ext_req "Microsoft Extension Request" -#define SN_ms_ext_req "msExtReq" -#define NID_ms_ext_req 171 -#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L - -#define LN_ext_req "Extension Request" -#define SN_ext_req "extReq" -#define NID_ext_req 172 -#define OBJ_ext_req OBJ_pkcs9,14L - -#define SN_name "name" -#define LN_name "name" -#define NID_name 173 -#define OBJ_name OBJ_X509,41L - -#define SN_dnQualifier "dnQualifier" -#define LN_dnQualifier "dnQualifier" -#define NID_dnQualifier 174 -#define OBJ_dnQualifier OBJ_X509,46L - -#define SN_id_pe "id-pe" -#define NID_id_pe 175 -#define OBJ_id_pe OBJ_id_pkix,1L - -#define SN_id_ad "id-ad" -#define NID_id_ad 176 -#define OBJ_id_ad OBJ_id_pkix,48L - -#define SN_info_access "authorityInfoAccess" -#define LN_info_access "Authority Information Access" -#define NID_info_access 177 -#define OBJ_info_access OBJ_id_pe,1L - -#define SN_ad_OCSP "OCSP" -#define LN_ad_OCSP "OCSP" -#define NID_ad_OCSP 178 -#define OBJ_ad_OCSP OBJ_id_ad,1L - -#define SN_ad_ca_issuers "caIssuers" -#define LN_ad_ca_issuers "CA Issuers" -#define NID_ad_ca_issuers 179 -#define OBJ_ad_ca_issuers OBJ_id_ad,2L - -#define SN_OCSP_sign "OCSPSigning" -#define LN_OCSP_sign "OCSP Signing" -#define NID_OCSP_sign 180 -#define OBJ_OCSP_sign OBJ_id_kp,9L -#endif /* USE_OBJ_MAC */ - -#include -#include - -#define OBJ_NAME_TYPE_UNDEF 0x00 -#define OBJ_NAME_TYPE_MD_METH 0x01 -#define OBJ_NAME_TYPE_CIPHER_METH 0x02 -#define OBJ_NAME_TYPE_PKEY_METH 0x03 -#define OBJ_NAME_TYPE_COMP_METH 0x04 -#define OBJ_NAME_TYPE_NUM 0x05 - -#define OBJ_NAME_ALIAS 0x8000 - -#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01 -#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02 - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct obj_name_st - { - int type; - int alias; - const char *name; - const char *data; - } OBJ_NAME; - -#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) - - -int OBJ_NAME_init(void); -int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), - int (*cmp_func)(const char *, const char *), - void (*free_func)(const char *, int, const char *)); -const char *OBJ_NAME_get(const char *name,int type); -int OBJ_NAME_add(const char *name,int type,const char *data); -int OBJ_NAME_remove(const char *name,int type); -void OBJ_NAME_cleanup(int type); /* -1 for everything */ -void OBJ_NAME_do_all(int type,void (*fn)(const OBJ_NAME *,void *arg), - void *arg); -void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg), - void *arg); - -ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o); -ASN1_OBJECT * OBJ_nid2obj(int n); -const char * OBJ_nid2ln(int n); -const char * OBJ_nid2sn(int n); -int OBJ_obj2nid(const ASN1_OBJECT *o); -ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name); -int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); -int OBJ_txt2nid(const char *s); -int OBJ_ln2nid(const char *s); -int OBJ_sn2nid(const char *s); -int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); -const char * OBJ_bsearch(const char *key,const char *base,int num,int size, - int (*cmp)(const void *, const void *)); -const char * OBJ_bsearch_ex(const char *key,const char *base,int num, - int size, int (*cmp)(const void *, const void *), int flags); - -int OBJ_new_nid(int num); -int OBJ_add_object(const ASN1_OBJECT *obj); -int OBJ_create(const char *oid,const char *sn,const char *ln); -void OBJ_cleanup(void ); -int OBJ_create_objects(BIO *in); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_OBJ_strings(void); - -/* Error codes for the OBJ functions. */ - -/* Function codes. */ -#define OBJ_F_OBJ_ADD_OBJECT 105 -#define OBJ_F_OBJ_CREATE 100 -#define OBJ_F_OBJ_DUP 101 -#define OBJ_F_OBJ_NAME_NEW_INDEX 106 -#define OBJ_F_OBJ_NID2LN 102 -#define OBJ_F_OBJ_NID2OBJ 103 -#define OBJ_F_OBJ_NID2SN 104 - -/* Reason codes. */ -#define OBJ_R_MALLOC_FAILURE 100 -#define OBJ_R_UNKNOWN_NID 101 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/ocsp.h b/dep/include/openssl/ocsp.h deleted file mode 100644 index a0577a717ef..00000000000 --- a/dep/include/openssl/ocsp.h +++ /dev/null @@ -1,623 +0,0 @@ -/* ocsp.h */ -/* Written by Tom Titchener for the OpenSSL - * project. */ - -/* History: - This file was transfered to Richard Levitte from CertCo by Kathy - Weinhold in mid-spring 2000 to be included in OpenSSL or released - as a patch kit. */ - -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_OCSP_H -#define HEADER_OCSP_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Various flags and values */ - -#define OCSP_DEFAULT_NONCE_LENGTH 16 - -#define OCSP_NOCERTS 0x1 -#define OCSP_NOINTERN 0x2 -#define OCSP_NOSIGS 0x4 -#define OCSP_NOCHAIN 0x8 -#define OCSP_NOVERIFY 0x10 -#define OCSP_NOEXPLICIT 0x20 -#define OCSP_NOCASIGN 0x40 -#define OCSP_NODELEGATED 0x80 -#define OCSP_NOCHECKS 0x100 -#define OCSP_TRUSTOTHER 0x200 -#define OCSP_RESPID_KEY 0x400 -#define OCSP_NOTIME 0x800 - -/* CertID ::= SEQUENCE { - * hashAlgorithm AlgorithmIdentifier, - * issuerNameHash OCTET STRING, -- Hash of Issuer's DN - * issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields) - * serialNumber CertificateSerialNumber } - */ -typedef struct ocsp_cert_id_st - { - X509_ALGOR *hashAlgorithm; - ASN1_OCTET_STRING *issuerNameHash; - ASN1_OCTET_STRING *issuerKeyHash; - ASN1_INTEGER *serialNumber; - } OCSP_CERTID; - -DECLARE_STACK_OF(OCSP_CERTID) - -/* Request ::= SEQUENCE { - * reqCert CertID, - * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_one_request_st - { - OCSP_CERTID *reqCert; - STACK_OF(X509_EXTENSION) *singleRequestExtensions; - } OCSP_ONEREQ; - -DECLARE_STACK_OF(OCSP_ONEREQ) -DECLARE_ASN1_SET_OF(OCSP_ONEREQ) - - -/* TBSRequest ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * requestorName [1] EXPLICIT GeneralName OPTIONAL, - * requestList SEQUENCE OF Request, - * requestExtensions [2] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_req_info_st - { - ASN1_INTEGER *version; - GENERAL_NAME *requestorName; - STACK_OF(OCSP_ONEREQ) *requestList; - STACK_OF(X509_EXTENSION) *requestExtensions; - } OCSP_REQINFO; - -/* Signature ::= SEQUENCE { - * signatureAlgorithm AlgorithmIdentifier, - * signature BIT STRING, - * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } - */ -typedef struct ocsp_signature_st - { - X509_ALGOR *signatureAlgorithm; - ASN1_BIT_STRING *signature; - STACK_OF(X509) *certs; - } OCSP_SIGNATURE; - -/* OCSPRequest ::= SEQUENCE { - * tbsRequest TBSRequest, - * optionalSignature [0] EXPLICIT Signature OPTIONAL } - */ -typedef struct ocsp_request_st - { - OCSP_REQINFO *tbsRequest; - OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */ - } OCSP_REQUEST; - -/* OCSPResponseStatus ::= ENUMERATED { - * successful (0), --Response has valid confirmations - * malformedRequest (1), --Illegal confirmation request - * internalError (2), --Internal error in issuer - * tryLater (3), --Try again later - * --(4) is not used - * sigRequired (5), --Must sign the request - * unauthorized (6) --Request unauthorized - * } - */ -#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 -#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 -#define OCSP_RESPONSE_STATUS_INTERNALERROR 2 -#define OCSP_RESPONSE_STATUS_TRYLATER 3 -#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 -#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6 - -/* ResponseBytes ::= SEQUENCE { - * responseType OBJECT IDENTIFIER, - * response OCTET STRING } - */ -typedef struct ocsp_resp_bytes_st - { - ASN1_OBJECT *responseType; - ASN1_OCTET_STRING *response; - } OCSP_RESPBYTES; - -/* OCSPResponse ::= SEQUENCE { - * responseStatus OCSPResponseStatus, - * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } - */ -struct ocsp_response_st - { - ASN1_ENUMERATED *responseStatus; - OCSP_RESPBYTES *responseBytes; - }; - -/* ResponderID ::= CHOICE { - * byName [1] Name, - * byKey [2] KeyHash } - */ -#define V_OCSP_RESPID_NAME 0 -#define V_OCSP_RESPID_KEY 1 -struct ocsp_responder_id_st - { - int type; - union { - X509_NAME* byName; - ASN1_OCTET_STRING *byKey; - } value; - }; - -DECLARE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) - -/* KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key - * --(excluding the tag and length fields) - */ - -/* RevokedInfo ::= SEQUENCE { - * revocationTime GeneralizedTime, - * revocationReason [0] EXPLICIT CRLReason OPTIONAL } - */ -typedef struct ocsp_revoked_info_st - { - ASN1_GENERALIZEDTIME *revocationTime; - ASN1_ENUMERATED *revocationReason; - } OCSP_REVOKEDINFO; - -/* CertStatus ::= CHOICE { - * good [0] IMPLICIT NULL, - * revoked [1] IMPLICIT RevokedInfo, - * unknown [2] IMPLICIT UnknownInfo } - */ -#define V_OCSP_CERTSTATUS_GOOD 0 -#define V_OCSP_CERTSTATUS_REVOKED 1 -#define V_OCSP_CERTSTATUS_UNKNOWN 2 -typedef struct ocsp_cert_status_st - { - int type; - union { - ASN1_NULL *good; - OCSP_REVOKEDINFO *revoked; - ASN1_NULL *unknown; - } value; - } OCSP_CERTSTATUS; - -/* SingleResponse ::= SEQUENCE { - * certID CertID, - * certStatus CertStatus, - * thisUpdate GeneralizedTime, - * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, - * singleExtensions [1] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_single_response_st - { - OCSP_CERTID *certId; - OCSP_CERTSTATUS *certStatus; - ASN1_GENERALIZEDTIME *thisUpdate; - ASN1_GENERALIZEDTIME *nextUpdate; - STACK_OF(X509_EXTENSION) *singleExtensions; - } OCSP_SINGLERESP; - -DECLARE_STACK_OF(OCSP_SINGLERESP) -DECLARE_ASN1_SET_OF(OCSP_SINGLERESP) - -/* ResponseData ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * responderID ResponderID, - * producedAt GeneralizedTime, - * responses SEQUENCE OF SingleResponse, - * responseExtensions [1] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_response_data_st - { - ASN1_INTEGER *version; - OCSP_RESPID *responderId; - ASN1_GENERALIZEDTIME *producedAt; - STACK_OF(OCSP_SINGLERESP) *responses; - STACK_OF(X509_EXTENSION) *responseExtensions; - } OCSP_RESPDATA; - -/* BasicOCSPResponse ::= SEQUENCE { - * tbsResponseData ResponseData, - * signatureAlgorithm AlgorithmIdentifier, - * signature BIT STRING, - * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } - */ - /* Note 1: - The value for "signature" is specified in the OCSP rfc2560 as follows: - "The value for the signature SHALL be computed on the hash of the DER - encoding ResponseData." This means that you must hash the DER-encoded - tbsResponseData, and then run it through a crypto-signing function, which - will (at least w/RSA) do a hash-'n'-private-encrypt operation. This seems - a bit odd, but that's the spec. Also note that the data structures do not - leave anywhere to independently specify the algorithm used for the initial - hash. So, we look at the signature-specification algorithm, and try to do - something intelligent. -- Kathy Weinhold, CertCo */ - /* Note 2: - It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open - for interpretation. I've done tests against another responder, and found - that it doesn't do the double hashing that the RFC seems to say one - should. Therefore, all relevant functions take a flag saying which - variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */ -typedef struct ocsp_basic_response_st - { - OCSP_RESPDATA *tbsResponseData; - X509_ALGOR *signatureAlgorithm; - ASN1_BIT_STRING *signature; - STACK_OF(X509) *certs; - } OCSP_BASICRESP; - -/* - * CRLReason ::= ENUMERATED { - * unspecified (0), - * keyCompromise (1), - * cACompromise (2), - * affiliationChanged (3), - * superseded (4), - * cessationOfOperation (5), - * certificateHold (6), - * removeFromCRL (8) } - */ -#define OCSP_REVOKED_STATUS_NOSTATUS -1 -#define OCSP_REVOKED_STATUS_UNSPECIFIED 0 -#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 -#define OCSP_REVOKED_STATUS_CACOMPROMISE 2 -#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 -#define OCSP_REVOKED_STATUS_SUPERSEDED 4 -#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 -#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 -#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8 - -/* CrlID ::= SEQUENCE { - * crlUrl [0] EXPLICIT IA5String OPTIONAL, - * crlNum [1] EXPLICIT INTEGER OPTIONAL, - * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } - */ -typedef struct ocsp_crl_id_st - { - ASN1_IA5STRING *crlUrl; - ASN1_INTEGER *crlNum; - ASN1_GENERALIZEDTIME *crlTime; - } OCSP_CRLID; - -/* ServiceLocator ::= SEQUENCE { - * issuer Name, - * locator AuthorityInfoAccessSyntax OPTIONAL } - */ -typedef struct ocsp_service_locator_st - { - X509_NAME* issuer; - STACK_OF(ACCESS_DESCRIPTION) *locator; - } OCSP_SERVICELOC; - -#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" -#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" - -#define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p) - -#define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p) - -#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL) - -#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\ - (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL) - -#define PEM_write_bio_OCSP_REQUEST(bp,o) \ - PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\ - bp,(char *)o, NULL,NULL,0,NULL,NULL) - -#define PEM_write_bio_OCSP_RESPONSE(bp,o) \ - PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\ - bp,(char *)o, NULL,NULL,0,NULL,NULL) - -#define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o) - -#define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) - -#define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,o->tbsRequest,pkey,md) - -#define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\ - o->signature,o->tbsResponseData,pkey,md) - -#define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,a->tbsRequest,r) - -#define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - a->signatureAlgorithm,a->signature,a->tbsResponseData,r) - -#define ASN1_BIT_STRING_digest(data,type,md,len) \ - ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) - -#define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid) - -#define OCSP_CERTSTATUS_dup(cs)\ - (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\ - (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs)) - -OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req); -OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, - int maxline); -int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); -void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); - -OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); - -OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, - X509_NAME *issuerName, - ASN1_BIT_STRING* issuerKey, - ASN1_INTEGER *serialNumber); - -OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); - -int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); -int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); -int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); -int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); - -int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm); -int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); - -int OCSP_request_sign(OCSP_REQUEST *req, - X509 *signer, - EVP_PKEY *key, - const EVP_MD *dgst, - STACK_OF(X509) *certs, - unsigned long flags); - -int OCSP_response_status(OCSP_RESPONSE *resp); -OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); - -int OCSP_resp_count(OCSP_BASICRESP *bs); -OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); -int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); -int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, - ASN1_GENERALIZEDTIME **revtime, - ASN1_GENERALIZEDTIME **thisupd, - ASN1_GENERALIZEDTIME **nextupd); -int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, - int *reason, - ASN1_GENERALIZEDTIME **revtime, - ASN1_GENERALIZEDTIME **thisupd, - ASN1_GENERALIZEDTIME **nextupd); -int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, - ASN1_GENERALIZEDTIME *nextupd, - long sec, long maxsec); - -int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags); - -int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl); - -int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); -int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); - -int OCSP_request_onereq_count(OCSP_REQUEST *req); -OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); -OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); -int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, - ASN1_OCTET_STRING **pikeyHash, - ASN1_INTEGER **pserial, OCSP_CERTID *cid); -int OCSP_request_is_signed(OCSP_REQUEST *req); -OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); -OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, - OCSP_CERTID *cid, - int status, int reason, - ASN1_TIME *revtime, - ASN1_TIME *thisupd, ASN1_TIME *nextupd); -int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); -int OCSP_basic_sign(OCSP_BASICRESP *brsp, - X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, - STACK_OF(X509) *certs, unsigned long flags); - -ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, - void *data, STACK_OF(ASN1_OBJECT) *sk); -#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \ - ASN1_STRING_encode(s, CHECKED_I2D_OF(type, i2d), data, sk) - -X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim); - -X509_EXTENSION *OCSP_accept_responses_new(char **oids); - -X509_EXTENSION *OCSP_archive_cutoff_new(char* tim); - -X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls); - -int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); -int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); -int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos); -int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); -X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); -X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); -void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx); -int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); - -int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); -int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); -int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos); -int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); -X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); -X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); -void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); -int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); - -int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); -int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); -int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos); -int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos); -X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); -X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); -void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx); -int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); - -int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); -int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); -int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos); -int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos); -X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); -X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); -void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx); -int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); - -DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) -DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) -DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO) -DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES) -DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ) -DECLARE_ASN1_FUNCTIONS(OCSP_CERTID) -DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST) -DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE) -DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) -DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) -DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) - -char *OCSP_response_status_str(long s); -char *OCSP_cert_status_str(long s); -char *OCSP_crl_reason_str(long s); - -int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); -int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags); - -int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, - X509_STORE *st, unsigned long flags); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_OCSP_strings(void); - -/* Error codes for the OCSP functions. */ - -/* Function codes. */ -#define OCSP_F_ASN1_STRING_ENCODE 100 -#define OCSP_F_D2I_OCSP_NONCE 102 -#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 -#define OCSP_F_OCSP_BASIC_SIGN 104 -#define OCSP_F_OCSP_BASIC_VERIFY 105 -#define OCSP_F_OCSP_CERT_ID_NEW 101 -#define OCSP_F_OCSP_CHECK_DELEGATED 106 -#define OCSP_F_OCSP_CHECK_IDS 107 -#define OCSP_F_OCSP_CHECK_ISSUER 108 -#define OCSP_F_OCSP_CHECK_VALIDITY 115 -#define OCSP_F_OCSP_MATCH_ISSUERID 109 -#define OCSP_F_OCSP_PARSE_URL 114 -#define OCSP_F_OCSP_REQUEST_SIGN 110 -#define OCSP_F_OCSP_REQUEST_VERIFY 116 -#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 -#define OCSP_F_OCSP_SENDREQ_BIO 112 -#define OCSP_F_PARSE_HTTP_LINE1 117 -#define OCSP_F_REQUEST_VERIFY 113 - -/* Reason codes. */ -#define OCSP_R_BAD_DATA 100 -#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 -#define OCSP_R_DIGEST_ERR 102 -#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 -#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 -#define OCSP_R_ERROR_PARSING_URL 121 -#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 -#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 -#define OCSP_R_NOT_BASIC_RESPONSE 104 -#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 -#define OCSP_R_NO_CONTENT 106 -#define OCSP_R_NO_PUBLIC_KEY 107 -#define OCSP_R_NO_RESPONSE_DATA 108 -#define OCSP_R_NO_REVOKED_TIME 109 -#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 -#define OCSP_R_REQUEST_NOT_SIGNED 128 -#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 -#define OCSP_R_ROOT_CA_NOT_TRUSTED 112 -#define OCSP_R_SERVER_READ_ERROR 113 -#define OCSP_R_SERVER_RESPONSE_ERROR 114 -#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 -#define OCSP_R_SERVER_WRITE_ERROR 116 -#define OCSP_R_SIGNATURE_FAILURE 117 -#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 -#define OCSP_R_STATUS_EXPIRED 125 -#define OCSP_R_STATUS_NOT_YET_VALID 126 -#define OCSP_R_STATUS_TOO_OLD 127 -#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 -#define OCSP_R_UNKNOWN_NID 120 -#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/opensslconf.h b/dep/include/openssl/opensslconf.h deleted file mode 100644 index 2d571c894c7..00000000000 --- a/dep/include/openssl/opensslconf.h +++ /dev/null @@ -1,259 +0,0 @@ -/* opensslconf.h */ -/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ - -/* OpenSSL was configured with the following options: */ -#ifndef OPENSSL_SYSNAME_WIN32 -# define OPENSSL_SYSNAME_WIN32 -#endif -#ifndef OPENSSL_DOING_MAKEDEPEND - - -#ifndef OPENSSL_NO_CAMELLIA -# define OPENSSL_NO_CAMELLIA -#endif -#ifndef OPENSSL_NO_CAPIENG -# define OPENSSL_NO_CAPIENG -#endif -#ifndef OPENSSL_NO_CMS -# define OPENSSL_NO_CMS -#endif -#ifndef OPENSSL_NO_GMP -# define OPENSSL_NO_GMP -#endif -#ifndef OPENSSL_NO_JPAKE -# define OPENSSL_NO_JPAKE -#endif -#ifndef OPENSSL_NO_KRB5 -# define OPENSSL_NO_KRB5 -#endif -#ifndef OPENSSL_NO_MDC2 -# define OPENSSL_NO_MDC2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_NO_RFC3779 -# define OPENSSL_NO_RFC3779 -#endif -#ifndef OPENSSL_NO_SEED -# define OPENSSL_NO_SEED -#endif - -#endif /* OPENSSL_DOING_MAKEDEPEND */ - -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif - -/* The OPENSSL_NO_* macros are also defined as NO_* if the application - asks for it. This is a transient feature that is provided for those - who haven't had the time to do the appropriate changes in their - applications. */ -#ifdef OPENSSL_ALGORITHM_DEFINES -# if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA) -# define NO_CAMELLIA -# endif -# if defined(OPENSSL_NO_CAPIENG) && !defined(NO_CAPIENG) -# define NO_CAPIENG -# endif -# if defined(OPENSSL_NO_CMS) && !defined(NO_CMS) -# define NO_CMS -# endif -# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) -# define NO_GMP -# endif -# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) -# define NO_JPAKE -# endif -# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) -# define NO_KRB5 -# endif -# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2) -# define NO_MDC2 -# endif -# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) -# define NO_RC5 -# endif -# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) -# define NO_RFC3779 -# endif -# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED) -# define NO_SEED -# endif -#endif - -/* crypto/opensslconf.h.in */ - -#ifdef OPENSSL_DOING_MAKEDEPEND - -/* Include any symbols here that have to be explicitly set to enable a feature - * that should be visible to makedepend. - * - * [Our "make depend" doesn't actually look at this, we use actual build settings - * instead; we want to make it easy to remove subdirectories with disabled algorithms.] - */ - -#ifndef OPENSSL_FIPS -#define OPENSSL_FIPS -#endif - -#endif - -/* Generate 80386 code? */ -#undef I386_ONLY - -#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ -#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) -#define ENGINESDIR "g:/openssl/lib/engines" -#define OPENSSLDIR "g:/openssl/ssl" -#endif -#endif - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION -#define OPENSSL_EXPORT_VAR_AS_FUNCTION - -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_INT unsigned int -#endif - -#if defined(HEADER_MD2_H) && !defined(MD2_INT) -#define MD2_INT unsigned int -#endif - -#if defined(HEADER_RC2_H) && !defined(RC2_INT) -/* I need to put in a mod for the alpha - eay */ -#define RC2_INT unsigned int -#endif - -#if defined(HEADER_RC4_H) -#if !defined(RC4_INT) -/* using int types make the structure larger but make the code faster - * on most boxes I have tested - up to %20 faster. */ -/* - * I don't know what does "most" mean, but declaring "int" is a must on: - * - Intel P6 because partial register stalls are very expensive; - * - elder Alpha because it lacks byte load/store instructions; - */ -#define RC4_INT unsigned int -#endif -#if !defined(RC4_CHUNK) -/* - * This enables code handling data aligned at natural CPU word - * boundary. See crypto/rc4/rc4_enc.c for further details. - */ -#undef RC4_CHUNK -#endif -#endif - -#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) -/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a - * %20 speed up (longs are 8 bytes, int's are 4). */ -#ifndef DES_LONG -#define DES_LONG unsigned long -#endif -#endif - -#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) -#define CONFIG_HEADER_BN_H -#define BN_LLONG - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -/* The prime number generation stuff may not work when - * EIGHT_BIT but I don't care since I've only used this mode - * for debuging the bignum libraries */ -#undef SIXTY_FOUR_BIT_LONG -#undef SIXTY_FOUR_BIT -#define THIRTY_TWO_BIT -#undef SIXTEEN_BIT -#undef EIGHT_BIT -#endif - -#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) -#define CONFIG_HEADER_RC4_LOCL_H -/* if this is defined data[i] is used instead of *data, this is a %20 - * speedup on x86 */ -#define RC4_INDEX -#endif - -#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) -#define CONFIG_HEADER_BF_LOCL_H -#undef BF_PTR -#endif /* HEADER_BF_LOCL_H */ - -#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) -#define CONFIG_HEADER_DES_LOCL_H -#ifndef DES_DEFAULT_OPTIONS -/* the following is tweaked from a config script, that is why it is a - * protected undef/define */ -#ifndef DES_PTR -#undef DES_PTR -#endif - -/* This helps C compiler generate the correct code for multiple functional - * units. It reduces register dependancies at the expense of 2 more - * registers */ -#ifndef DES_RISC1 -#undef DES_RISC1 -#endif - -#ifndef DES_RISC2 -#undef DES_RISC2 -#endif - -#if defined(DES_RISC1) && defined(DES_RISC2) -YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! -#endif - -/* Unroll the inner loop, this sometimes helps, sometimes hinders. - * Very mucy CPU dependant */ -#ifndef DES_UNROLL -#undef DES_UNROLL -#endif - -/* These default values were supplied by - * Peter Gutman - * They are only used if nothing else has been defined */ -#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) -/* Special defines which change the way the code is built depending on the - CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find - even newer MIPS CPU's, but at the moment one size fits all for - optimization options. Older Sparc's work better with only UNROLL, but - there's no way to tell at compile time what it is you're running on */ - -#if defined( sun ) /* Newer Sparc's */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#elif defined( __ultrix ) /* Older MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined( __osf1__ ) /* Alpha */ -# define DES_PTR -# define DES_RISC2 -#elif defined ( _AIX ) /* RS6000 */ - /* Unknown */ -#elif defined( __hpux ) /* HP-PA */ - /* Unknown */ -#elif defined( __aux ) /* 68K */ - /* Unknown */ -#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ -# define DES_UNROLL -#elif defined( __sgi ) /* Newer MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#endif /* Systems-specific speed defines */ -#endif - -#endif /* DES_DEFAULT_OPTIONS */ -#endif /* HEADER_DES_LOCL_H */ diff --git a/dep/include/openssl/opensslv.h b/dep/include/openssl/opensslv.h deleted file mode 100644 index c6207f76b2c..00000000000 --- a/dep/include/openssl/opensslv.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef HEADER_OPENSSLV_H -#define HEADER_OPENSSLV_H - -/* Numeric release version identifier: - * MNNFFPPS: major minor fix patch status - * The status nibble has one of the values 0 for development, 1 to e for betas - * 1 to 14, and f for release. The patch level is exactly that. - * For example: - * 0.9.3-dev 0x00903000 - * 0.9.3-beta1 0x00903001 - * 0.9.3-beta2-dev 0x00903002 - * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) - * 0.9.3 0x0090300f - * 0.9.3a 0x0090301f - * 0.9.4 0x0090400f - * 1.2.3z 0x102031af - * - * For continuity reasons (because 0.9.5 is already out, and is coded - * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level - * part is slightly different, by setting the highest bit. This means - * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start - * with 0x0090600S... - * - * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) - * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for - * major minor fix final patch/beta) - */ -#define OPENSSL_VERSION_NUMBER 0x009080bfL -#ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k-fips 25 Mar 2009" -#else -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k 25 Mar 2009" -#endif -#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT - - -/* The macros below are to be used for shared library (.so, .dll, ...) - * versioning. That kind of versioning works a bit differently between - * operating systems. The most usual scheme is to set a major and a minor - * number, and have the runtime loader check that the major number is equal - * to what it was at application link time, while the minor number has to - * be greater or equal to what it was at application link time. With this - * scheme, the version number is usually part of the file name, like this: - * - * libcrypto.so.0.9 - * - * Some unixen also make a softlink with the major verson number only: - * - * libcrypto.so.0 - * - * On Tru64 and IRIX 6.x it works a little bit differently. There, the - * shared library version is stored in the file, and is actually a series - * of versions, separated by colons. The rightmost version present in the - * library when linking an application is stored in the application to be - * matched at run time. When the application is run, a check is done to - * see if the library version stored in the application matches any of the - * versions in the version string of the library itself. - * This version string can be constructed in any way, depending on what - * kind of matching is desired. However, to implement the same scheme as - * the one used in the other unixen, all compatible versions, from lowest - * to highest, should be part of the string. Consecutive builds would - * give the following versions strings: - * - * 3.0 - * 3.0:3.1 - * 3.0:3.1:3.2 - * 4.0 - * 4.0:4.1 - * - * Notice how version 4 is completely incompatible with version, and - * therefore give the breach you can see. - * - * There may be other schemes as well that I haven't yet discovered. - * - * So, here's the way it works here: first of all, the library version - * number doesn't need at all to match the overall OpenSSL version. - * However, it's nice and more understandable if it actually does. - * The current library version is stored in the macro SHLIB_VERSION_NUMBER, - * which is just a piece of text in the format "M.m.e" (Major, minor, edit). - * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, - * we need to keep a history of version numbers, which is done in the - * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and - * should only keep the versions that are binary compatible with the current. - */ -#define SHLIB_VERSION_HISTORY "" -#define SHLIB_VERSION_NUMBER "0.9.8" - - -#endif /* HEADER_OPENSSLV_H */ diff --git a/dep/include/openssl/ossl_typ.h b/dep/include/openssl/ossl_typ.h deleted file mode 100644 index 0e7a3808803..00000000000 --- a/dep/include/openssl/ossl_typ.h +++ /dev/null @@ -1,183 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_OPENSSL_TYPES_H -#define HEADER_OPENSSL_TYPES_H - -#include - -#ifdef NO_ASN1_TYPEDEFS -#define ASN1_INTEGER ASN1_STRING -#define ASN1_ENUMERATED ASN1_STRING -#define ASN1_BIT_STRING ASN1_STRING -#define ASN1_OCTET_STRING ASN1_STRING -#define ASN1_PRINTABLESTRING ASN1_STRING -#define ASN1_T61STRING ASN1_STRING -#define ASN1_IA5STRING ASN1_STRING -#define ASN1_UTCTIME ASN1_STRING -#define ASN1_GENERALIZEDTIME ASN1_STRING -#define ASN1_TIME ASN1_STRING -#define ASN1_GENERALSTRING ASN1_STRING -#define ASN1_UNIVERSALSTRING ASN1_STRING -#define ASN1_BMPSTRING ASN1_STRING -#define ASN1_VISIBLESTRING ASN1_STRING -#define ASN1_UTF8STRING ASN1_STRING -#define ASN1_BOOLEAN int -#define ASN1_NULL int -#else -typedef struct asn1_string_st ASN1_INTEGER; -typedef struct asn1_string_st ASN1_ENUMERATED; -typedef struct asn1_string_st ASN1_BIT_STRING; -typedef struct asn1_string_st ASN1_OCTET_STRING; -typedef struct asn1_string_st ASN1_PRINTABLESTRING; -typedef struct asn1_string_st ASN1_T61STRING; -typedef struct asn1_string_st ASN1_IA5STRING; -typedef struct asn1_string_st ASN1_GENERALSTRING; -typedef struct asn1_string_st ASN1_UNIVERSALSTRING; -typedef struct asn1_string_st ASN1_BMPSTRING; -typedef struct asn1_string_st ASN1_UTCTIME; -typedef struct asn1_string_st ASN1_TIME; -typedef struct asn1_string_st ASN1_GENERALIZEDTIME; -typedef struct asn1_string_st ASN1_VISIBLESTRING; -typedef struct asn1_string_st ASN1_UTF8STRING; -typedef int ASN1_BOOLEAN; -typedef int ASN1_NULL; -#endif - -#ifdef OPENSSL_SYS_WIN32 -#undef X509_NAME -#undef X509_EXTENSIONS -#undef X509_CERT_PAIR -#undef PKCS7_ISSUER_AND_SERIAL -#undef OCSP_REQUEST -#undef OCSP_RESPONSE -#endif - -#ifdef BIGNUM -#undef BIGNUM -#endif -typedef struct bignum_st BIGNUM; -typedef struct bignum_ctx BN_CTX; -typedef struct bn_blinding_st BN_BLINDING; -typedef struct bn_mont_ctx_st BN_MONT_CTX; -typedef struct bn_recp_ctx_st BN_RECP_CTX; -typedef struct bn_gencb_st BN_GENCB; - -typedef struct buf_mem_st BUF_MEM; - -typedef struct evp_cipher_st EVP_CIPHER; -typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; -typedef struct env_md_st EVP_MD; -typedef struct env_md_ctx_st EVP_MD_CTX; -typedef struct evp_pkey_st EVP_PKEY; - -typedef struct dh_st DH; -typedef struct dh_method DH_METHOD; - -typedef struct dsa_st DSA; -typedef struct dsa_method DSA_METHOD; - -typedef struct rsa_st RSA; -typedef struct rsa_meth_st RSA_METHOD; - -typedef struct rand_meth_st RAND_METHOD; - -typedef struct ecdh_method ECDH_METHOD; -typedef struct ecdsa_method ECDSA_METHOD; - -typedef struct x509_st X509; -typedef struct X509_algor_st X509_ALGOR; -typedef struct X509_crl_st X509_CRL; -typedef struct X509_name_st X509_NAME; -typedef struct x509_store_st X509_STORE; -typedef struct x509_store_ctx_st X509_STORE_CTX; -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; - -typedef struct v3_ext_ctx X509V3_CTX; -typedef struct conf_st CONF; - -typedef struct store_st STORE; -typedef struct store_method_st STORE_METHOD; - -typedef struct ui_st UI; -typedef struct ui_method_st UI_METHOD; - -typedef struct st_ERR_FNS ERR_FNS; - -typedef struct engine_st ENGINE; - -typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; -typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; -typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; -typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; - - /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ -#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ -#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ - -typedef struct crypto_ex_data_st CRYPTO_EX_DATA; -/* Callback types for crypto.h */ -typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, - int idx, long argl, void *argp); - -typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; -typedef struct ocsp_response_st OCSP_RESPONSE; -typedef struct ocsp_responder_id_st OCSP_RESPID; - -#endif /* def HEADER_OPENSSL_TYPES_H */ diff --git a/dep/include/openssl/pem.h b/dep/include/openssl/pem.h deleted file mode 100644 index 6c193f1cbfa..00000000000 --- a/dep/include/openssl/pem.h +++ /dev/null @@ -1,782 +0,0 @@ -/* crypto/pem/pem.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_PEM_H -#define HEADER_PEM_H - -#include -#ifndef OPENSSL_NO_BIO -#include -#endif -#ifndef OPENSSL_NO_STACK -#include -#endif -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define PEM_BUFSIZE 1024 - -#define PEM_OBJ_UNDEF 0 -#define PEM_OBJ_X509 1 -#define PEM_OBJ_X509_REQ 2 -#define PEM_OBJ_CRL 3 -#define PEM_OBJ_SSL_SESSION 4 -#define PEM_OBJ_PRIV_KEY 10 -#define PEM_OBJ_PRIV_RSA 11 -#define PEM_OBJ_PRIV_DSA 12 -#define PEM_OBJ_PRIV_DH 13 -#define PEM_OBJ_PUB_RSA 14 -#define PEM_OBJ_PUB_DSA 15 -#define PEM_OBJ_PUB_DH 16 -#define PEM_OBJ_DHPARAMS 17 -#define PEM_OBJ_DSAPARAMS 18 -#define PEM_OBJ_PRIV_RSA_PUBLIC 19 -#define PEM_OBJ_PRIV_ECDSA 20 -#define PEM_OBJ_PUB_ECDSA 21 -#define PEM_OBJ_ECPARAMETERS 22 - -#define PEM_ERROR 30 -#define PEM_DEK_DES_CBC 40 -#define PEM_DEK_IDEA_CBC 45 -#define PEM_DEK_DES_EDE 50 -#define PEM_DEK_DES_ECB 60 -#define PEM_DEK_RSA 70 -#define PEM_DEK_RSA_MD2 80 -#define PEM_DEK_RSA_MD5 90 - -#define PEM_MD_MD2 NID_md2 -#define PEM_MD_MD5 NID_md5 -#define PEM_MD_SHA NID_sha -#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption -#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption -#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption - -#define PEM_STRING_X509_OLD "X509 CERTIFICATE" -#define PEM_STRING_X509 "CERTIFICATE" -#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" -#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" -#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" -#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" -#define PEM_STRING_X509_CRL "X509 CRL" -#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" -#define PEM_STRING_PUBLIC "PUBLIC KEY" -#define PEM_STRING_RSA "RSA PRIVATE KEY" -#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" -#define PEM_STRING_DSA "DSA PRIVATE KEY" -#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" -#define PEM_STRING_PKCS7 "PKCS7" -#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" -#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" -#define PEM_STRING_PKCS8INF "PRIVATE KEY" -#define PEM_STRING_DHPARAMS "DH PARAMETERS" -#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" -#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" -#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" -#define PEM_STRING_ECPARAMETERS "EC PARAMETERS" -#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" -#define PEM_STRING_CMS "CMS" - - /* Note that this structure is initialised by PEM_SealInit and cleaned up - by PEM_SealFinal (at least for now) */ -typedef struct PEM_Encode_Seal_st - { - EVP_ENCODE_CTX encode; - EVP_MD_CTX md; - EVP_CIPHER_CTX cipher; - } PEM_ENCODE_SEAL_CTX; - -/* enc_type is one off */ -#define PEM_TYPE_ENCRYPTED 10 -#define PEM_TYPE_MIC_ONLY 20 -#define PEM_TYPE_MIC_CLEAR 30 -#define PEM_TYPE_CLEAR 40 - -typedef struct pem_recip_st - { - char *name; - X509_NAME *dn; - - int cipher; - int key_enc; - /* char iv[8]; unused and wrong size */ - } PEM_USER; - -typedef struct pem_ctx_st - { - int type; /* what type of object */ - - struct { - int version; - int mode; - } proc_type; - - char *domain; - - struct { - int cipher; - /* unused, and wrong size - unsigned char iv[8]; */ - } DEK_info; - - PEM_USER *originator; - - int num_recipient; - PEM_USER **recipient; - -#ifndef OPENSSL_NO_STACK - STACK *x509_chain; /* certificate chain */ -#else - char *x509_chain; /* certificate chain */ -#endif - EVP_MD *md; /* signature type */ - - int md_enc; /* is the md encrypted or not? */ - int md_len; /* length of md_data */ - char *md_data; /* message digest, could be pkey encrypted */ - - EVP_CIPHER *dec; /* date encryption cipher */ - int key_len; /* key length */ - unsigned char *key; /* key */ - /* unused, and wrong size - unsigned char iv[8]; */ - - - int data_enc; /* is the data encrypted */ - int data_len; - unsigned char *data; - } PEM_CTX; - -/* These macros make the PEM_read/PEM_write functions easier to maintain and - * write. Now they are all implemented with either: - * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) - */ - -#ifdef OPENSSL_NO_FP_API - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ - -#else - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ -type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ -{ \ - return (type*)PEM_ASN1_read(CHECKED_D2I_OF(type, d2i_##asn1), \ - str, fp, \ - CHECKED_PPTR_OF(type, x), \ - cb, u); \ -} - -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x) \ -{ \ - return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ - str, fp, \ - CHECKED_PTR_OF(type, x), \ - NULL, NULL, 0, NULL, NULL); \ -} - -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, const type *x) \ -{ \ - return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ - str, fp, \ - CHECKED_PTR_OF(const type, x), \ - NULL, NULL, 0, NULL, NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ - str, fp, \ - CHECKED_PTR_OF(type, x), \ - enc, kstr, klen, cb, u); \ - } - -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ - str, fp, \ - CHECKED_PTR_OF(const type, x), \ - enc, kstr, klen, cb, u); \ - } - -#endif - -#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ -type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ -{ \ - return (type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i_##asn1), \ - str, bp, \ - CHECKED_PPTR_OF(type, x), \ - cb, u); \ -} - -#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x) \ -{ \ - return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ - str, bp, \ - CHECKED_PTR_OF(type, x), \ - NULL, NULL, 0, NULL, NULL); \ -} - -#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, const type *x) \ -{ \ - return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ - str, bp, \ - CHECKED_PTR_OF(const type, x), \ - NULL, NULL, 0, NULL, NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ - str, bp, \ - CHECKED_PTR_OF(type, x), \ - enc, kstr, klen, cb, u); \ - } - -#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ - str, bp, \ - CHECKED_PTR_OF(const type, x), \ - enc, kstr, klen, cb, u); \ - } - -#define IMPLEMENT_PEM_write(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_read_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb(name, type, str, asn1) - -/* These are the same except they are for the declarations */ - -#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_NO_FP_API) - -#define DECLARE_PEM_read_fp(name, type) /**/ -#define DECLARE_PEM_write_fp(name, type) /**/ -#define DECLARE_PEM_write_fp_const(name, type) /**/ -#define DECLARE_PEM_write_cb_fp(name, type) /**/ - -#else - -#define DECLARE_PEM_read_fp(name, type) \ - type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_fp(name, type) \ - int PEM_write_##name(FILE *fp, type *x); - -#define DECLARE_PEM_write_fp_const(name, type) \ - int PEM_write_##name(FILE *fp, const type *x); - -#define DECLARE_PEM_write_cb_fp(name, type) \ - int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -#endif - -#ifndef OPENSSL_NO_BIO -#define DECLARE_PEM_read_bio(name, type) \ - type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_bio(name, type) \ - int PEM_write_bio_##name(BIO *bp, type *x); - -#define DECLARE_PEM_write_bio_const(name, type) \ - int PEM_write_bio_##name(BIO *bp, const type *x); - -#define DECLARE_PEM_write_cb_bio(name, type) \ - int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -#else - -#define DECLARE_PEM_read_bio(name, type) /**/ -#define DECLARE_PEM_write_bio(name, type) /**/ -#define DECLARE_PEM_write_bio_const(name, type) /**/ -#define DECLARE_PEM_write_cb_bio(name, type) /**/ - -#endif - -#define DECLARE_PEM_write(name, type) \ - DECLARE_PEM_write_bio(name, type) \ - DECLARE_PEM_write_fp(name, type) - -#define DECLARE_PEM_write_const(name, type) \ - DECLARE_PEM_write_bio_const(name, type) \ - DECLARE_PEM_write_fp_const(name, type) - -#define DECLARE_PEM_write_cb(name, type) \ - DECLARE_PEM_write_cb_bio(name, type) \ - DECLARE_PEM_write_cb_fp(name, type) - -#define DECLARE_PEM_read(name, type) \ - DECLARE_PEM_read_bio(name, type) \ - DECLARE_PEM_read_fp(name, type) - -#define DECLARE_PEM_rw(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write(name, type) - -#define DECLARE_PEM_rw_const(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_const(name, type) - -#define DECLARE_PEM_rw_cb(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_cb(name, type) - -#ifdef SSLEAY_MACROS - -#define PEM_write_SSL_SESSION(fp,x) \ - PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ - PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_X509(fp,x) \ - PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \ - (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_X509_REQ(fp,x) PEM_ASN1_write( \ - (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \ - NULL,NULL,0,NULL,NULL) -#define PEM_write_X509_CRL(fp,x) \ - PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \ - fp,(char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\ - (char *)x,enc,kstr,klen,cb,u) -#define PEM_write_RSAPublicKey(fp,x) \ - PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\ - PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL) -#define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\ - (char *)x,enc,kstr,klen,cb,u) -#define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write((int (*)())i2d_PrivateKey,\ - (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ - bp,(char *)x,enc,kstr,klen,cb,u) -#define PEM_write_PKCS7(fp,x) \ - PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \ - (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_DHparams(fp,x) \ - PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\ - (char *)x,NULL,NULL,0,NULL,NULL) - -#define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \ - PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ - PEM_STRING_X509,fp, \ - (char *)x, NULL,NULL,0,NULL,NULL) - -#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ - (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) -#define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \ - (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u) -#define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \ - (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u) -#define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \ - (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u) -#define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ - (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u) -#define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ - (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u) -#define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \ - (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u) -#define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \ - (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u) -#define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \ - (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u) -#define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \ - (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u) - -#define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb,u) \ - (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \ - (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\ - (char **)x,cb,u) - -#define PEM_write_bio_X509(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \ - (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_X509_REQ(bp,x) PEM_ASN1_write_bio( \ - (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \ - NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_X509_CRL(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\ - bp,(char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\ - bp,(char *)x,enc,kstr,klen,cb,u) -#define PEM_write_bio_RSAPublicKey(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \ - PEM_STRING_RSA_PUBLIC,\ - bp,(char *)x,NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\ - bp,(char *)x,enc,kstr,klen,cb,u) -#define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ - PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\ - (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ - bp,(char *)x,enc,kstr,klen,cb,u) -#define PEM_write_bio_PKCS7(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \ - (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_DHparams(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\ - bp,(char *)x,NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_DSAparams(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \ - PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL) - -#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \ - PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ - PEM_STRING_X509,bp, \ - (char *)x, NULL,NULL,0,NULL,NULL) - -#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u) -#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u) -#define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u) -#define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u) -#define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u) -#define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u) -#define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u) - -#define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u) -#define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u) -#define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u) - -#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb,u) \ - (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\ - (char **)x,cb,u) - -#endif - -#if 1 -/* "userdata": new with OpenSSL 0.9.4 */ -typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); -#else -/* OpenSSL 0.9.3, 0.9.3a */ -typedef int pem_password_cb(char *buf, int size, int rwflag); -#endif - -int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); -int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, - pem_password_cb *callback,void *u); - -#ifndef OPENSSL_NO_BIO -int PEM_read_bio(BIO *bp, char **name, char **header, - unsigned char **data,long *len); -int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, - long len); -int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, - pem_password_cb *cb, void *u); -void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, - void **x, pem_password_cb *cb, void *u); - -#define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \ - ((type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i), \ - name, bp, \ - CHECKED_PPTR_OF(type, x), \ - cb, u)) - -int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x, - const EVP_CIPHER *enc,unsigned char *kstr,int klen, - pem_password_cb *cb, void *u); - -#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \ - (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \ - name, bp, \ - CHECKED_PTR_OF(type, x), \ - enc, kstr, klen, cb, u)) - -STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); -int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, - unsigned char *kstr, int klen, pem_password_cb *cd, void *u); -#endif - -#ifndef OPENSSL_SYS_WIN16 -int PEM_read(FILE *fp, char **name, char **header, - unsigned char **data,long *len); -int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); -void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, - pem_password_cb *cb, void *u); -int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, - char *x,const EVP_CIPHER *enc,unsigned char *kstr, - int klen,pem_password_cb *callback, void *u); -STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u); -#endif - -int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, - EVP_MD *md_type, unsigned char **ek, int *ekl, - unsigned char *iv, EVP_PKEY **pubk, int npubk); -void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, - unsigned char *in, int inl); -int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, - unsigned char *out, int *outl, EVP_PKEY *priv); - -void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); -void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); -int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, - unsigned int *siglen, EVP_PKEY *pkey); - -int PEM_def_callback(char *buf, int num, int w, void *key); -void PEM_proc_type(char *buf, int type); -void PEM_dek_info(char *buf, const char *type, int len, char *str); - -#ifndef SSLEAY_MACROS - -#include - -DECLARE_PEM_rw(X509, X509) - -DECLARE_PEM_rw(X509_AUX, X509) - -DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) - -DECLARE_PEM_rw(X509_REQ, X509_REQ) -DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) - -DECLARE_PEM_rw(X509_CRL, X509_CRL) - -DECLARE_PEM_rw(PKCS7, PKCS7) - -DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) - -DECLARE_PEM_rw(PKCS8, X509_SIG) - -DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) - -#ifndef OPENSSL_NO_RSA - -DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) - -DECLARE_PEM_rw_const(RSAPublicKey, RSA) -DECLARE_PEM_rw(RSA_PUBKEY, RSA) - -#endif - -#ifndef OPENSSL_NO_DSA - -DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) - -DECLARE_PEM_rw(DSA_PUBKEY, DSA) - -DECLARE_PEM_rw_const(DSAparams, DSA) - -#endif - -#ifndef OPENSSL_NO_EC -DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP) -DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) -DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) -#endif - -#ifndef OPENSSL_NO_DH - -DECLARE_PEM_rw_const(DHparams, DH) - -#endif - -DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) - -DECLARE_PEM_rw(PUBKEY, EVP_PKEY) - -int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, - char *, int, pem_password_cb *, void *); -int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); - -EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, - char *kstr,int klen, pem_password_cb *cd, void *u); - -#endif /* SSLEAY_MACROS */ - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_PEM_strings(void); - -/* Error codes for the PEM functions. */ - -/* Function codes. */ -#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 -#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 -#define PEM_F_DO_PK8PKEY 126 -#define PEM_F_DO_PK8PKEY_FP 125 -#define PEM_F_LOAD_IV 101 -#define PEM_F_PEM_ASN1_READ 102 -#define PEM_F_PEM_ASN1_READ_BIO 103 -#define PEM_F_PEM_ASN1_WRITE 104 -#define PEM_F_PEM_ASN1_WRITE_BIO 105 -#define PEM_F_PEM_DEF_CALLBACK 100 -#define PEM_F_PEM_DO_HEADER 106 -#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 -#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 -#define PEM_F_PEM_PK8PKEY 119 -#define PEM_F_PEM_READ 108 -#define PEM_F_PEM_READ_BIO 109 -#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 -#define PEM_F_PEM_READ_PRIVATEKEY 124 -#define PEM_F_PEM_SEALFINAL 110 -#define PEM_F_PEM_SEALINIT 111 -#define PEM_F_PEM_SIGNFINAL 112 -#define PEM_F_PEM_WRITE 113 -#define PEM_F_PEM_WRITE_BIO 114 -#define PEM_F_PEM_X509_INFO_READ 115 -#define PEM_F_PEM_X509_INFO_READ_BIO 116 -#define PEM_F_PEM_X509_INFO_WRITE_BIO 117 - -/* Reason codes. */ -#define PEM_R_BAD_BASE64_DECODE 100 -#define PEM_R_BAD_DECRYPT 101 -#define PEM_R_BAD_END_LINE 102 -#define PEM_R_BAD_IV_CHARS 103 -#define PEM_R_BAD_PASSWORD_READ 104 -#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 -#define PEM_R_NOT_DEK_INFO 105 -#define PEM_R_NOT_ENCRYPTED 106 -#define PEM_R_NOT_PROC_TYPE 107 -#define PEM_R_NO_START_LINE 108 -#define PEM_R_PROBLEMS_GETTING_PASSWORD 109 -#define PEM_R_PUBLIC_KEY_NO_RSA 110 -#define PEM_R_READ_KEY 111 -#define PEM_R_SHORT_HEADER 112 -#define PEM_R_UNSUPPORTED_CIPHER 113 -#define PEM_R_UNSUPPORTED_ENCRYPTION 114 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/pem2.h b/dep/include/openssl/pem2.h deleted file mode 100644 index 893030edcdc..00000000000 --- a/dep/include/openssl/pem2.h +++ /dev/null @@ -1,71 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -/* - * This header only exists to break a circular dependency between pem and err - * Ben 30 Jan 1999. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HEADER_PEM_H -void ERR_load_PEM_strings(void); -#endif - -#ifdef __cplusplus -} -#endif - diff --git a/dep/include/openssl/pkcs12.h b/dep/include/openssl/pkcs12.h deleted file mode 100644 index 4bee605dc0d..00000000000 --- a/dep/include/openssl/pkcs12.h +++ /dev/null @@ -1,333 +0,0 @@ -/* pkcs12.h */ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_PKCS12_H -#define HEADER_PKCS12_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define PKCS12_KEY_ID 1 -#define PKCS12_IV_ID 2 -#define PKCS12_MAC_ID 3 - -/* Default iteration count */ -#ifndef PKCS12_DEFAULT_ITER -#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER -#endif - -#define PKCS12_MAC_KEY_LENGTH 20 - -#define PKCS12_SALT_LEN 8 - -/* Uncomment out next line for unicode password and names, otherwise ASCII */ - -/*#define PBE_UNICODE*/ - -#ifdef PBE_UNICODE -#define PKCS12_key_gen PKCS12_key_gen_uni -#define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni -#else -#define PKCS12_key_gen PKCS12_key_gen_asc -#define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc -#endif - -/* MS key usage constants */ - -#define KEY_EX 0x10 -#define KEY_SIG 0x80 - -typedef struct { -X509_SIG *dinfo; -ASN1_OCTET_STRING *salt; -ASN1_INTEGER *iter; /* defaults to 1 */ -} PKCS12_MAC_DATA; - -typedef struct { -ASN1_INTEGER *version; -PKCS12_MAC_DATA *mac; -PKCS7 *authsafes; -} PKCS12; - -PREDECLARE_STACK_OF(PKCS12_SAFEBAG) - -typedef struct { -ASN1_OBJECT *type; -union { - struct pkcs12_bag_st *bag; /* secret, crl and certbag */ - struct pkcs8_priv_key_info_st *keybag; /* keybag */ - X509_SIG *shkeybag; /* shrouded key bag */ - STACK_OF(PKCS12_SAFEBAG) *safes; - ASN1_TYPE *other; -}value; -STACK_OF(X509_ATTRIBUTE) *attrib; -} PKCS12_SAFEBAG; - -DECLARE_STACK_OF(PKCS12_SAFEBAG) -DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG) -DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) - -typedef struct pkcs12_bag_st { -ASN1_OBJECT *type; -union { - ASN1_OCTET_STRING *x509cert; - ASN1_OCTET_STRING *x509crl; - ASN1_OCTET_STRING *octet; - ASN1_IA5STRING *sdsicert; - ASN1_TYPE *other; /* Secret or other bag */ -}value; -} PKCS12_BAGS; - -#define PKCS12_ERROR 0 -#define PKCS12_OK 1 - -/* Compatibility macros */ - -#define M_PKCS12_x5092certbag PKCS12_x5092certbag -#define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag - -#define M_PKCS12_certbag2x509 PKCS12_certbag2x509 -#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl - -#define M_PKCS12_unpack_p7data PKCS12_unpack_p7data -#define M_PKCS12_pack_authsafes PKCS12_pack_authsafes -#define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes -#define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata - -#define M_PKCS12_decrypt_skey PKCS12_decrypt_skey -#define M_PKCS8_decrypt PKCS8_decrypt - -#define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) -#define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) -#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type - -#define PKCS12_get_attr(bag, attr_nid) \ - PKCS12_get_attr_gen(bag->attrib, attr_nid) - -#define PKCS8_get_attr(p8, attr_nid) \ - PKCS12_get_attr_gen(p8->attributes, attr_nid) - -#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) - - -PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); -PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); -X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); -X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); - -PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, - int nid2); -PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); -PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen); -PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, - int passlen); -X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, - const char *pass, int passlen, - unsigned char *salt, int saltlen, int iter, - PKCS8_PRIV_KEY_INFO *p8); -PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, - int passlen, unsigned char *salt, - int saltlen, int iter, - PKCS8_PRIV_KEY_INFO *p8); -PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); -STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); -PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, - unsigned char *salt, int saltlen, int iter, - STACK_OF(PKCS12_SAFEBAG) *bags); -STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen); - -int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); -STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); - -int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); -int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, - int namelen); -int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, - int namelen); -int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, - int namelen); -int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); -ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); -char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); -unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, - int passlen, unsigned char *in, int inlen, - unsigned char **data, int *datalen, int en_de); -void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, - const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); -ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, - const char *pass, int passlen, - void *obj, int zbuf); -PKCS12 *PKCS12_init(int mode); -int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, - int saltlen, int id, int iter, int n, - unsigned char *out, const EVP_MD *md_type); -int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); -int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type, - int en_de); -int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, - unsigned char *mac, unsigned int *maclen); -int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); -int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, - unsigned char *salt, int saltlen, int iter, - const EVP_MD *md_type); -int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, - int saltlen, const EVP_MD *md_type); -unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); -char *uni2asc(unsigned char *uni, int unilen); - -DECLARE_ASN1_FUNCTIONS(PKCS12) -DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) -DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) -DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) - -DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) -DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) - -void PKCS12_PBE_add(void); -int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, - STACK_OF(X509) **ca); -PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, - STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, - int mac_iter, int keytype); - -PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); -PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, - int key_usage, int iter, - int key_nid, char *pass); -int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int safe_nid, int iter, char *pass); -PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); - -int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); -int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); -PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); -PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); -int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_PKCS12_strings(void); - -/* Error codes for the PKCS12 functions. */ - -/* Function codes. */ -#define PKCS12_F_PARSE_BAG 129 -#define PKCS12_F_PARSE_BAGS 103 -#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100 -#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127 -#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102 -#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104 -#define PKCS12_F_PKCS12_CREATE 105 -#define PKCS12_F_PKCS12_GEN_MAC 107 -#define PKCS12_F_PKCS12_INIT 109 -#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 -#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 -#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 -#define PKCS12_F_PKCS12_KEY_GEN_ASC 110 -#define PKCS12_F_PKCS12_KEY_GEN_UNI 111 -#define PKCS12_F_PKCS12_MAKE_KEYBAG 112 -#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113 -#define PKCS12_F_PKCS12_NEWPASS 128 -#define PKCS12_F_PKCS12_PACK_P7DATA 114 -#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 -#define PKCS12_F_PKCS12_PARSE 118 -#define PKCS12_F_PKCS12_PBE_CRYPT 119 -#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 -#define PKCS12_F_PKCS12_SETUP_MAC 122 -#define PKCS12_F_PKCS12_SET_MAC 123 -#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 -#define PKCS12_F_PKCS12_UNPACK_P7DATA 131 -#define PKCS12_F_PKCS12_VERIFY_MAC 126 -#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124 -#define PKCS12_F_PKCS8_ENCRYPT 125 - -/* Reason codes. */ -#define PKCS12_R_CANT_PACK_STRUCTURE 100 -#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 -#define PKCS12_R_DECODE_ERROR 101 -#define PKCS12_R_ENCODE_ERROR 102 -#define PKCS12_R_ENCRYPT_ERROR 103 -#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 -#define PKCS12_R_INVALID_NULL_ARGUMENT 104 -#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 -#define PKCS12_R_IV_GEN_ERROR 106 -#define PKCS12_R_KEY_GEN_ERROR 107 -#define PKCS12_R_MAC_ABSENT 108 -#define PKCS12_R_MAC_GENERATION_ERROR 109 -#define PKCS12_R_MAC_SETUP_ERROR 110 -#define PKCS12_R_MAC_STRING_SET_ERROR 111 -#define PKCS12_R_MAC_VERIFY_ERROR 112 -#define PKCS12_R_MAC_VERIFY_FAILURE 113 -#define PKCS12_R_PARSE_ERROR 114 -#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 -#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 -#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 -#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 -#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/pkcs7.h b/dep/include/openssl/pkcs7.h deleted file mode 100644 index 457cfdd70ac..00000000000 --- a/dep/include/openssl/pkcs7.h +++ /dev/null @@ -1,465 +0,0 @@ -/* crypto/pkcs7/pkcs7.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_PKCS7_H -#define HEADER_PKCS7_H - -#include -#include -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_SYS_WIN32 -/* Under Win32 thes are defined in wincrypt.h */ -#undef PKCS7_ISSUER_AND_SERIAL -#undef PKCS7_SIGNER_INFO -#endif - -/* -Encryption_ID DES-CBC -Digest_ID MD5 -Digest_Encryption_ID rsaEncryption -Key_Encryption_ID rsaEncryption -*/ - -typedef struct pkcs7_issuer_and_serial_st - { - X509_NAME *issuer; - ASN1_INTEGER *serial; - } PKCS7_ISSUER_AND_SERIAL; - -typedef struct pkcs7_signer_info_st - { - ASN1_INTEGER *version; /* version 1 */ - PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; - X509_ALGOR *digest_alg; - STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ - X509_ALGOR *digest_enc_alg; - ASN1_OCTET_STRING *enc_digest; - STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ - - /* The private key to sign with */ - EVP_PKEY *pkey; - } PKCS7_SIGNER_INFO; - -DECLARE_STACK_OF(PKCS7_SIGNER_INFO) -DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) - -typedef struct pkcs7_recip_info_st - { - ASN1_INTEGER *version; /* version 0 */ - PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; - X509_ALGOR *key_enc_algor; - ASN1_OCTET_STRING *enc_key; - X509 *cert; /* get the pub-key from this */ - } PKCS7_RECIP_INFO; - -DECLARE_STACK_OF(PKCS7_RECIP_INFO) -DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) - -typedef struct pkcs7_signed_st - { - ASN1_INTEGER *version; /* version 1 */ - STACK_OF(X509_ALGOR) *md_algs; /* md used */ - STACK_OF(X509) *cert; /* [ 0 ] */ - STACK_OF(X509_CRL) *crl; /* [ 1 ] */ - STACK_OF(PKCS7_SIGNER_INFO) *signer_info; - - struct pkcs7_st *contents; - } PKCS7_SIGNED; -/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. - * How about merging the two */ - -typedef struct pkcs7_enc_content_st - { - ASN1_OBJECT *content_type; - X509_ALGOR *algorithm; - ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ - const EVP_CIPHER *cipher; - } PKCS7_ENC_CONTENT; - -typedef struct pkcs7_enveloped_st - { - ASN1_INTEGER *version; /* version 0 */ - STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; - PKCS7_ENC_CONTENT *enc_data; - } PKCS7_ENVELOPE; - -typedef struct pkcs7_signedandenveloped_st - { - ASN1_INTEGER *version; /* version 1 */ - STACK_OF(X509_ALGOR) *md_algs; /* md used */ - STACK_OF(X509) *cert; /* [ 0 ] */ - STACK_OF(X509_CRL) *crl; /* [ 1 ] */ - STACK_OF(PKCS7_SIGNER_INFO) *signer_info; - - PKCS7_ENC_CONTENT *enc_data; - STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; - } PKCS7_SIGN_ENVELOPE; - -typedef struct pkcs7_digest_st - { - ASN1_INTEGER *version; /* version 0 */ - X509_ALGOR *md; /* md used */ - struct pkcs7_st *contents; - ASN1_OCTET_STRING *digest; - } PKCS7_DIGEST; - -typedef struct pkcs7_encrypted_st - { - ASN1_INTEGER *version; /* version 0 */ - PKCS7_ENC_CONTENT *enc_data; - } PKCS7_ENCRYPT; - -typedef struct pkcs7_st - { - /* The following is non NULL if it contains ASN1 encoding of - * this structure */ - unsigned char *asn1; - long length; - -#define PKCS7_S_HEADER 0 -#define PKCS7_S_BODY 1 -#define PKCS7_S_TAIL 2 - int state; /* used during processing */ - - int detached; - - ASN1_OBJECT *type; - /* content as defined by the type */ - /* all encryption/message digests are applied to the 'contents', - * leaving out the 'type' field. */ - union { - char *ptr; - - /* NID_pkcs7_data */ - ASN1_OCTET_STRING *data; - - /* NID_pkcs7_signed */ - PKCS7_SIGNED *sign; - - /* NID_pkcs7_enveloped */ - PKCS7_ENVELOPE *enveloped; - - /* NID_pkcs7_signedAndEnveloped */ - PKCS7_SIGN_ENVELOPE *signed_and_enveloped; - - /* NID_pkcs7_digest */ - PKCS7_DIGEST *digest; - - /* NID_pkcs7_encrypted */ - PKCS7_ENCRYPT *encrypted; - - /* Anything else */ - ASN1_TYPE *other; - } d; - } PKCS7; - -DECLARE_STACK_OF(PKCS7) -DECLARE_ASN1_SET_OF(PKCS7) -DECLARE_PKCS12_STACK_OF(PKCS7) - -#define PKCS7_OP_SET_DETACHED_SIGNATURE 1 -#define PKCS7_OP_GET_DETACHED_SIGNATURE 2 - -#define PKCS7_get_signed_attributes(si) ((si)->auth_attr) -#define PKCS7_get_attributes(si) ((si)->unauth_attr) - -#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) -#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) -#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) -#define PKCS7_type_is_signedAndEnveloped(a) \ - (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) -#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) - -#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) - -#define PKCS7_set_detached(p,v) \ - PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) -#define PKCS7_get_detached(p) \ - PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) - -#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) - -#ifdef SSLEAY_MACROS -#ifndef PKCS7_ISSUER_AND_SERIAL_digest -#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ - ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ - (char *)data,md,len) -#endif -#endif - -/* S/MIME related flags */ - -#define PKCS7_TEXT 0x1 -#define PKCS7_NOCERTS 0x2 -#define PKCS7_NOSIGS 0x4 -#define PKCS7_NOCHAIN 0x8 -#define PKCS7_NOINTERN 0x10 -#define PKCS7_NOVERIFY 0x20 -#define PKCS7_DETACHED 0x40 -#define PKCS7_BINARY 0x80 -#define PKCS7_NOATTR 0x100 -#define PKCS7_NOSMIMECAP 0x200 -#define PKCS7_NOOLDMIMETYPE 0x400 -#define PKCS7_CRLFEOL 0x800 -#define PKCS7_STREAM 0x1000 -#define PKCS7_NOCRL 0x2000 - -/* Flags: for compatibility with older code */ - -#define SMIME_TEXT PKCS7_TEXT -#define SMIME_NOCERTS PKCS7_NOCERTS -#define SMIME_NOSIGS PKCS7_NOSIGS -#define SMIME_NOCHAIN PKCS7_NOCHAIN -#define SMIME_NOINTERN PKCS7_NOINTERN -#define SMIME_NOVERIFY PKCS7_NOVERIFY -#define SMIME_DETACHED PKCS7_DETACHED -#define SMIME_BINARY PKCS7_BINARY -#define SMIME_NOATTR PKCS7_NOATTR - -DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) - -#ifndef SSLEAY_MACROS -int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, - unsigned char *md,unsigned int *len); -#ifndef OPENSSL_NO_FP_API -PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); -int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); -#endif -PKCS7 *PKCS7_dup(PKCS7 *p7); -PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); -int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); -#endif - -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) -DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) -DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) -DECLARE_ASN1_FUNCTIONS(PKCS7) - -DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) -DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) - -DECLARE_ASN1_NDEF_FUNCTION(PKCS7) - -long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); - -int PKCS7_set_type(PKCS7 *p7, int type); -int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); -int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); -int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, - const EVP_MD *dgst); -int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); -int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); -int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); -int PKCS7_content_new(PKCS7 *p7, int nid); -int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, - BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); -int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, - X509 *x509); - -BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); -int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); -BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); - - -PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, - EVP_PKEY *pkey, const EVP_MD *dgst); -X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); -int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); -STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); - -PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); -int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); -int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); -int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); - -PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); -ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); -int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, - void *data); -int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, - void *value); -ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); -ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); -int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, - STACK_OF(X509_ATTRIBUTE) *sk); -int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); - - -PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, - BIO *data, int flags); -int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, - BIO *indata, BIO *out, int flags); -STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); -PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, - int flags); -int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); - -int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, - STACK_OF(X509_ALGOR) *cap); -STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); -int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); - -int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); -PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); -int SMIME_crlf_copy(BIO *in, BIO *out, int flags); -int SMIME_text(BIO *in, BIO *out); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_PKCS7_strings(void); - -/* Error codes for the PKCS7 functions. */ - -/* Function codes. */ -#define PKCS7_F_B64_READ_PKCS7 120 -#define PKCS7_F_B64_WRITE_PKCS7 121 -#define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 -#define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 -#define PKCS7_F_PKCS7_ADD_CRL 101 -#define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 -#define PKCS7_F_PKCS7_ADD_SIGNER 103 -#define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 -#define PKCS7_F_PKCS7_CTRL 104 -#define PKCS7_F_PKCS7_DATADECODE 112 -#define PKCS7_F_PKCS7_DATAFINAL 128 -#define PKCS7_F_PKCS7_DATAINIT 105 -#define PKCS7_F_PKCS7_DATASIGN 106 -#define PKCS7_F_PKCS7_DATAVERIFY 107 -#define PKCS7_F_PKCS7_DECRYPT 114 -#define PKCS7_F_PKCS7_ENCRYPT 115 -#define PKCS7_F_PKCS7_FIND_DIGEST 127 -#define PKCS7_F_PKCS7_GET0_SIGNERS 124 -#define PKCS7_F_PKCS7_SET_CIPHER 108 -#define PKCS7_F_PKCS7_SET_CONTENT 109 -#define PKCS7_F_PKCS7_SET_DIGEST 126 -#define PKCS7_F_PKCS7_SET_TYPE 110 -#define PKCS7_F_PKCS7_SIGN 116 -#define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 -#define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 -#define PKCS7_F_PKCS7_VERIFY 117 -#define PKCS7_F_SMIME_READ_PKCS7 122 -#define PKCS7_F_SMIME_TEXT 123 - -/* Reason codes. */ -#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 -#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 -#define PKCS7_R_CIPHER_NOT_INITIALIZED 116 -#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 -#define PKCS7_R_DECODE_ERROR 130 -#define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100 -#define PKCS7_R_DECRYPT_ERROR 119 -#define PKCS7_R_DIGEST_FAILURE 101 -#define PKCS7_R_ERROR_ADDING_RECIPIENT 120 -#define PKCS7_R_ERROR_SETTING_CIPHER 121 -#define PKCS7_R_INVALID_MIME_TYPE 131 -#define PKCS7_R_INVALID_NULL_POINTER 143 -#define PKCS7_R_MIME_NO_CONTENT_TYPE 132 -#define PKCS7_R_MIME_PARSE_ERROR 133 -#define PKCS7_R_MIME_SIG_PARSE_ERROR 134 -#define PKCS7_R_MISSING_CERIPEND_INFO 103 -#define PKCS7_R_NO_CONTENT 122 -#define PKCS7_R_NO_CONTENT_TYPE 135 -#define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136 -#define PKCS7_R_NO_MULTIPART_BOUNDARY 137 -#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 -#define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146 -#define PKCS7_R_NO_SIGNATURES_ON_DATA 123 -#define PKCS7_R_NO_SIGNERS 142 -#define PKCS7_R_NO_SIG_CONTENT_TYPE 138 -#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 -#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 -#define PKCS7_R_PKCS7_DATAFINAL 126 -#define PKCS7_R_PKCS7_DATAFINAL_ERROR 125 -#define PKCS7_R_PKCS7_DATASIGN 145 -#define PKCS7_R_PKCS7_PARSE_ERROR 139 -#define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140 -#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 -#define PKCS7_R_SIGNATURE_FAILURE 105 -#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 -#define PKCS7_R_SIG_INVALID_MIME_TYPE 141 -#define PKCS7_R_SMIME_TEXT_ERROR 129 -#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 -#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 -#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 -#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 -#define PKCS7_R_UNKNOWN_OPERATION 110 -#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 -#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 -#define PKCS7_R_WRONG_CONTENT_TYPE 113 -#define PKCS7_R_WRONG_PKCS7_TYPE 114 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/pq_compat.h b/dep/include/openssl/pq_compat.h deleted file mode 100644 index 7b2c32725cd..00000000000 --- a/dep/include/openssl/pq_compat.h +++ /dev/null @@ -1,152 +0,0 @@ -/* crypto/pqueue/pqueue_compat.h */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ -/* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_PQ_COMPAT_H -#define HEADER_PQ_COMPAT_H - -#include -#include - -/* - * The purpose of this header file is for supporting 64-bit integer - * manipulation on 32-bit (and lower) machines. Currently the only - * such environment is VMS, Utrix and those with smaller default integer - * sizes than 32 bits. For all such environment, we fall back to using - * BIGNUM. We may need to fine tune the conditions for systems that - * are incorrectly configured. - * - * The only clients of this code are (1) pqueue for priority, and - * (2) DTLS, for sequence number manipulation. - */ - -#if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT) - -#define PQ_64BIT_IS_INTEGER 0 -#define PQ_64BIT_IS_BIGNUM 1 - -#define PQ_64BIT BIGNUM -#define PQ_64BIT_CTX BN_CTX - -#define pq_64bit_init(x) BN_init(x) -#define pq_64bit_free(x) BN_free(x) - -#define pq_64bit_ctx_new(ctx) BN_CTX_new() -#define pq_64bit_ctx_free(x) BN_CTX_free(x) - -#define pq_64bit_assign(x, y) BN_copy(x, y) -#define pq_64bit_assign_word(x, y) BN_set_word(x, y) -#define pq_64bit_gt(x, y) BN_ucmp(x, y) >= 1 ? 1 : 0 -#define pq_64bit_eq(x, y) BN_ucmp(x, y) == 0 ? 1 : 0 -#define pq_64bit_add_word(x, w) BN_add_word(x, w) -#define pq_64bit_sub(r, x, y) BN_sub(r, x, y) -#define pq_64bit_sub_word(x, w) BN_sub_word(x, w) -#define pq_64bit_mod(r, x, n, ctx) BN_mod(r, x, n, ctx) - -#define pq_64bit_bin2num(bn, bytes, len) BN_bin2bn(bytes, len, bn) -#define pq_64bit_num2bin(bn, bytes) BN_bn2bin(bn, bytes) -#define pq_64bit_get_word(x) BN_get_word(x) -#define pq_64bit_is_bit_set(x, offset) BN_is_bit_set(x, offset) -#define pq_64bit_lshift(r, x, shift) BN_lshift(r, x, shift) -#define pq_64bit_set_bit(x, num) BN_set_bit(x, num) -#define pq_64bit_get_length(x) BN_num_bits((x)) - -#else - -#define PQ_64BIT_IS_INTEGER 1 -#define PQ_64BIT_IS_BIGNUM 0 - -#if defined(SIXTY_FOUR_BIT) -#define PQ_64BIT BN_ULONG -#define PQ_64BIT_PRINT "%lld" -#elif defined(SIXTY_FOUR_BIT_LONG) -#define PQ_64BIT BN_ULONG -#define PQ_64BIT_PRINT "%ld" -#elif defined(THIRTY_TWO_BIT) -#define PQ_64BIT BN_ULLONG -#define PQ_64BIT_PRINT "%lld" -#endif - -#define PQ_64BIT_CTX void - -#define pq_64bit_init(x) -#define pq_64bit_free(x) -#define pq_64bit_ctx_new(ctx) (ctx) -#define pq_64bit_ctx_free(x) - -#define pq_64bit_assign(x, y) (*(x) = *(y)) -#define pq_64bit_assign_word(x, y) (*(x) = y) -#define pq_64bit_gt(x, y) (*(x) > *(y)) -#define pq_64bit_eq(x, y) (*(x) == *(y)) -#define pq_64bit_add_word(x, w) (*(x) = (*(x) + (w))) -#define pq_64bit_sub(r, x, y) (*(r) = (*(x) - *(y))) -#define pq_64bit_sub_word(x, w) (*(x) = (*(x) - (w))) -#define pq_64bit_mod(r, x, n, ctx) - -#define pq_64bit_bin2num(num, bytes, len) bytes_to_long_long(bytes, num) -#define pq_64bit_num2bin(num, bytes) long_long_to_bytes(num, bytes) -#define pq_64bit_get_word(x) *(x) -#define pq_64bit_lshift(r, x, shift) (*(r) = (*(x) << (shift))) -#define pq_64bit_set_bit(x, num) do { \ - PQ_64BIT mask = 1; \ - mask = mask << (num); \ - *(x) |= mask; \ - } while(0) -#endif /* OPENSSL_SYS_VMS */ - -#endif diff --git a/dep/include/openssl/pqueue.h b/dep/include/openssl/pqueue.h deleted file mode 100644 index cc6b0018201..00000000000 --- a/dep/include/openssl/pqueue.h +++ /dev/null @@ -1,96 +0,0 @@ -/* crypto/pqueue/pqueue.h */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ -/* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_PQUEUE_H -#define HEADER_PQUEUE_H - -#include -#include -#include - -#include - -typedef struct _pqueue *pqueue; - -typedef struct _pitem - { - PQ_64BIT priority; - void *data; - struct _pitem *next; - } pitem; - -typedef struct _pitem *piterator; - -pitem *pitem_new(PQ_64BIT priority, void *data); -void pitem_free(pitem *item); - -pqueue pqueue_new(void); -void pqueue_free(pqueue pq); - -pitem *pqueue_insert(pqueue pq, pitem *item); -pitem *pqueue_peek(pqueue pq); -pitem *pqueue_pop(pqueue pq); -pitem *pqueue_find(pqueue pq, PQ_64BIT priority); -pitem *pqueue_iterator(pqueue pq); -pitem *pqueue_next(piterator *iter); - -void pqueue_print(pqueue pq); - -#endif /* ! HEADER_PQUEUE_H */ - diff --git a/dep/include/openssl/rand.h b/dep/include/openssl/rand.h deleted file mode 100644 index ea89153cba3..00000000000 --- a/dep/include/openssl/rand.h +++ /dev/null @@ -1,167 +0,0 @@ -/* crypto/rand/rand.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RAND_H -#define HEADER_RAND_H - -#include -#include -#include - -#if defined(OPENSSL_SYS_WINDOWS) -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(OPENSSL_FIPS) -#define FIPS_RAND_SIZE_T int -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct rand_meth_st RAND_METHOD; */ - -struct rand_meth_st - { - void (*seed)(const void *buf, int num); - int (*bytes)(unsigned char *buf, int num); - void (*cleanup)(void); - void (*add)(const void *buf, int num, double entropy); - int (*pseudorand)(unsigned char *buf, int num); - int (*status)(void); - }; - -#ifdef BN_DEBUG -extern int rand_predictable; -#endif - -int RAND_set_rand_method(const RAND_METHOD *meth); -const RAND_METHOD *RAND_get_rand_method(void); -#ifndef OPENSSL_NO_ENGINE -int RAND_set_rand_engine(ENGINE *engine); -#endif -RAND_METHOD *RAND_SSLeay(void); -void RAND_cleanup(void ); -int RAND_bytes(unsigned char *buf,int num); -int RAND_pseudo_bytes(unsigned char *buf,int num); -void RAND_seed(const void *buf,int num); -void RAND_add(const void *buf,int num,double entropy); -int RAND_load_file(const char *file,long max_bytes); -int RAND_write_file(const char *file); -const char *RAND_file_name(char *file,size_t num); -int RAND_status(void); -int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); -int RAND_egd(const char *path); -int RAND_egd_bytes(const char *path,int bytes); -int RAND_poll(void); -#ifndef OPENSSL_NO_ENGINE -#ifdef OPENSSL_FIPS -void int_RAND_init_engine_callbacks(void); -void int_RAND_set_callbacks( - int (*set_rand_func)(const RAND_METHOD *meth, - const RAND_METHOD **pmeth), - const RAND_METHOD *(*get_rand_func)(const RAND_METHOD **pmeth)); -#endif -#endif - -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) - -void RAND_screen(void); -int RAND_event(UINT, WPARAM, LPARAM); - -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_RAND_strings(void); - -/* Error codes for the RAND functions. */ - -/* Function codes. */ -#define RAND_F_ENG_RAND_GET_RAND_METHOD 108 -#define RAND_F_FIPS_RAND 103 -#define RAND_F_FIPS_RAND_BYTES 102 -#define RAND_F_FIPS_RAND_GET_RAND_METHOD 109 -#define RAND_F_FIPS_RAND_SET_DT 106 -#define RAND_F_FIPS_SET_DT 104 -#define RAND_F_FIPS_SET_PRNG_SEED 107 -#define RAND_F_FIPS_SET_TEST_MODE 105 -#define RAND_F_RAND_GET_RAND_METHOD 101 -#define RAND_F_SSLEAY_RAND_BYTES 100 - -/* Reason codes. */ -#define RAND_R_NON_FIPS_METHOD 105 -#define RAND_R_NOT_IN_TEST_MODE 106 -#define RAND_R_NO_KEY_SET 107 -#define RAND_R_PRNG_ASKING_FOR_TOO_MUCH 101 -#define RAND_R_PRNG_ERROR 108 -#define RAND_R_PRNG_KEYED 109 -#define RAND_R_PRNG_NOT_REKEYED 102 -#define RAND_R_PRNG_NOT_RESEEDED 103 -#define RAND_R_PRNG_NOT_SEEDED 100 -#define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 110 -#define RAND_R_PRNG_STUCK 104 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/rc2.h b/dep/include/openssl/rc2.h deleted file mode 100644 index e542ec94ffb..00000000000 --- a/dep/include/openssl/rc2.h +++ /dev/null @@ -1,103 +0,0 @@ -/* crypto/rc2/rc2.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RC2_H -#define HEADER_RC2_H - -#include /* OPENSSL_NO_RC2, RC2_INT */ -#ifdef OPENSSL_NO_RC2 -#error RC2 is disabled. -#endif - -#define RC2_ENCRYPT 1 -#define RC2_DECRYPT 0 - -#define RC2_BLOCK 8 -#define RC2_KEY_LENGTH 16 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct rc2_key_st - { - RC2_INT data[64]; - } RC2_KEY; - -#ifdef OPENSSL_FIPS -void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); -#endif -void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); -void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, - int enc); -void RC2_encrypt(unsigned long *data,RC2_KEY *key); -void RC2_decrypt(unsigned long *data,RC2_KEY *key); -void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - RC2_KEY *ks, unsigned char *iv, int enc); -void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, RC2_KEY *schedule, unsigned char *ivec, - int *num, int enc); -void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, RC2_KEY *schedule, unsigned char *ivec, - int *num); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/rc4.h b/dep/include/openssl/rc4.h deleted file mode 100644 index 2d8620d33b9..00000000000 --- a/dep/include/openssl/rc4.h +++ /dev/null @@ -1,90 +0,0 @@ -/* crypto/rc4/rc4.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RC4_H -#define HEADER_RC4_H - -#include /* OPENSSL_NO_RC4, RC4_INT */ -#ifdef OPENSSL_NO_RC4 -#error RC4 is disabled. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct rc4_key_st - { - RC4_INT x,y; - RC4_INT data[256]; - } RC4_KEY; - - -const char *RC4_options(void); -#ifdef OPENSSL_FIPS -void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); -#endif -void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); -void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, - unsigned char *outdata); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/ripemd.h b/dep/include/openssl/ripemd.h deleted file mode 100644 index 3b6d04386d4..00000000000 --- a/dep/include/openssl/ripemd.h +++ /dev/null @@ -1,106 +0,0 @@ -/* crypto/ripemd/ripemd.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RIPEMD_H -#define HEADER_RIPEMD_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_RIPEMD -#error RIPEMD is disabled. -#endif - -#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) -#define RIPEMD160_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define RIPEMD160_LONG unsigned long -#define RIPEMD160_LONG_LOG2 3 -#else -#define RIPEMD160_LONG unsigned int -#endif - -#define RIPEMD160_CBLOCK 64 -#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) -#define RIPEMD160_DIGEST_LENGTH 20 - -typedef struct RIPEMD160state_st - { - RIPEMD160_LONG A,B,C,D,E; - RIPEMD160_LONG Nl,Nh; - RIPEMD160_LONG data[RIPEMD160_LBLOCK]; - unsigned int num; - } RIPEMD160_CTX; -#ifdef OPENSSL_FIPS -int private_RIPEMD160_Init(RIPEMD160_CTX *c); -#endif -int RIPEMD160_Init(RIPEMD160_CTX *c); -int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); -int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); -unsigned char *RIPEMD160(const unsigned char *d, size_t n, - unsigned char *md); -void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/rsa.h b/dep/include/openssl/rsa.h deleted file mode 100644 index 5bb932ae15f..00000000000 --- a/dep/include/openssl/rsa.h +++ /dev/null @@ -1,496 +0,0 @@ -/* crypto/rsa/rsa.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RSA_H -#define HEADER_RSA_H - -#include - -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif - -#ifdef OPENSSL_NO_RSA -#error RSA is disabled. -#endif - -/* If this flag is set the RSA method is FIPS compliant and can be used - * in FIPS mode. This is set in the validated module method. If an - * application sets this flag in its own methods it is its reposibility - * to ensure the result is compliant. - */ - -#define RSA_FLAG_FIPS_METHOD 0x0400 - -/* If this flag is set the operations normally disabled in FIPS mode are - * permitted it is then the applications responsibility to ensure that the - * usage is compliant. - */ - -#define RSA_FLAG_NON_FIPS_ALLOW 0x0400 - -#ifdef OPENSSL_FIPS -#define FIPS_RSA_SIZE_T int -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Declared already in ossl_typ.h */ -/* typedef struct rsa_st RSA; */ -/* typedef struct rsa_meth_st RSA_METHOD; */ - -struct rsa_meth_st - { - const char *name; - int (*rsa_pub_enc)(int flen,const unsigned char *from, - unsigned char *to, - RSA *rsa,int padding); - int (*rsa_pub_dec)(int flen,const unsigned char *from, - unsigned char *to, - RSA *rsa,int padding); - int (*rsa_priv_enc)(int flen,const unsigned char *from, - unsigned char *to, - RSA *rsa,int padding); - int (*rsa_priv_dec)(int flen,const unsigned char *from, - unsigned char *to, - RSA *rsa,int padding); - int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */ - int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *m_ctx); /* Can be null */ - int (*init)(RSA *rsa); /* called at new */ - int (*finish)(RSA *rsa); /* called at free */ - int flags; /* RSA_METHOD_FLAG_* things */ - char *app_data; /* may be needed! */ -/* New sign and verify functions: some libraries don't allow arbitrary data - * to be signed/verified: this allows them to be used. Note: for this to work - * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used - * RSA_sign(), RSA_verify() should be used instead. Note: for backwards - * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER - * option is set in 'flags'. - */ - int (*rsa_sign)(int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, const RSA *rsa); - int (*rsa_verify)(int dtype, - const unsigned char *m, unsigned int m_length, - unsigned char *sigbuf, unsigned int siglen, const RSA *rsa); -/* If this callback is NULL, the builtin software RSA key-gen will be used. This - * is for behavioural compatibility whilst the code gets rewired, but one day - * it would be nice to assume there are no such things as "builtin software" - * implementations. */ - int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); - }; - -struct rsa_st - { - /* The first parameter is used to pickup errors where - * this is passed instead of aEVP_PKEY, it is set to 0 */ - int pad; - long version; - const RSA_METHOD *meth; - /* functional reference if 'meth' is ENGINE-provided */ - ENGINE *engine; - BIGNUM *n; - BIGNUM *e; - BIGNUM *d; - BIGNUM *p; - BIGNUM *q; - BIGNUM *dmp1; - BIGNUM *dmq1; - BIGNUM *iqmp; - /* be careful using this if the RSA structure is shared */ - CRYPTO_EX_DATA ex_data; - int references; - int flags; - - /* Used to cache montgomery values */ - BN_MONT_CTX *_method_mod_n; - BN_MONT_CTX *_method_mod_p; - BN_MONT_CTX *_method_mod_q; - - /* all BIGNUM values are actually in the following data, if it is not - * NULL */ - char *bignum_data; - BN_BLINDING *blinding; - BN_BLINDING *mt_blinding; - }; - -#ifndef OPENSSL_RSA_MAX_MODULUS_BITS -# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 -#endif - -#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 1024 - -#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS -# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 -#endif -#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS -# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */ -#endif - -#define RSA_3 0x3L -#define RSA_F4 0x10001L - -#define RSA_METHOD_FLAG_NO_CHECK 0x0001 /* don't check pub/private match */ - -#define RSA_FLAG_CACHE_PUBLIC 0x0002 -#define RSA_FLAG_CACHE_PRIVATE 0x0004 -#define RSA_FLAG_BLINDING 0x0008 -#define RSA_FLAG_THREAD_SAFE 0x0010 -/* This flag means the private key operations will be handled by rsa_mod_exp - * and that they do not depend on the private key components being present: - * for example a key stored in external hardware. Without this flag bn_mod_exp - * gets called when private key components are absent. - */ -#define RSA_FLAG_EXT_PKEY 0x0020 - -/* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. - */ -#define RSA_FLAG_SIGN_VER 0x0040 - -#define RSA_FLAG_NO_BLINDING 0x0080 /* new with 0.9.6j and 0.9.7b; the built-in - * RSA implementation now uses blinding by - * default (ignoring RSA_FLAG_BLINDING), - * but other engines might not need it - */ -#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA - * implementation now uses constant time - * operations by default in private key operations, - * e.g., constant time modular exponentiation, - * modular inverse without leaking branches, - * division without leaking branches. This - * flag disables these constant time - * operations and results in faster RSA - * private key operations. - */ -#ifndef OPENSSL_NO_DEPRECATED -#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/ - /* new with 0.9.7h; the built-in RSA - * implementation now uses constant time - * modular exponentiation for secret exponents - * by default. This flag causes the - * faster variable sliding window method to - * be used for all exponents. - */ -#endif - - -#define RSA_PKCS1_PADDING 1 -#define RSA_SSLV23_PADDING 2 -#define RSA_NO_PADDING 3 -#define RSA_PKCS1_OAEP_PADDING 4 -#define RSA_X931_PADDING 5 - -#define RSA_PKCS1_PADDING_SIZE 11 - -#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) -#define RSA_get_app_data(s) RSA_get_ex_data(s,0) - -RSA * RSA_new(void); -RSA * RSA_new_method(ENGINE *engine); -int RSA_size(const RSA *); - -/* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -RSA * RSA_generate_key(int bits, unsigned long e,void - (*callback)(int,int,void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); -int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, BIGNUM *q2, - const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *Xp, - const BIGNUM *Xq1, const BIGNUM *Xq2, const BIGNUM *Xq, - const BIGNUM *e, BN_GENCB *cb); -int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb); - -int RSA_check_key(const RSA *); - /* next 4 return -1 on error */ -int RSA_public_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa,int padding); -int RSA_private_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa,int padding); -int RSA_public_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa,int padding); -int RSA_private_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa,int padding); -void RSA_free (RSA *r); -/* "up" the RSA object's reference count */ -int RSA_up_ref(RSA *r); - -int RSA_flags(const RSA *r); - -#ifdef OPENSSL_FIPS -RSA *FIPS_rsa_new(void); -void FIPS_rsa_free(RSA *r); -#endif - -void RSA_set_default_method(const RSA_METHOD *meth); -const RSA_METHOD *RSA_get_default_method(void); -const RSA_METHOD *RSA_get_method(const RSA *rsa); -int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); - -/* This function needs the memory locking malloc callbacks to be installed */ -int RSA_memory_lock(RSA *r); - -/* these are the actual SSLeay RSA functions */ -const RSA_METHOD *RSA_PKCS1_SSLeay(void); - -const RSA_METHOD *RSA_null_method(void); - -DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) -DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) - -#ifndef OPENSSL_NO_FP_API -int RSA_print_fp(FILE *fp, const RSA *r,int offset); -#endif - -#ifndef OPENSSL_NO_BIO -int RSA_print(BIO *bp, const RSA *r,int offset); -#endif - -#ifndef OPENSSL_NO_RC4 -int i2d_RSA_NET(const RSA *a, unsigned char **pp, - int (*cb)(char *buf, int len, const char *prompt, int verify), - int sgckey); -RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, - int (*cb)(char *buf, int len, const char *prompt, int verify), - int sgckey); - -int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, - int (*cb)(char *buf, int len, const char *prompt, - int verify)); -RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, - int (*cb)(char *buf, int len, const char *prompt, - int verify)); -#endif - -/* The following 2 functions sign and verify a X509_SIG ASN1 object - * inside PKCS#1 padded RSA encryption */ -int RSA_sign(int type, const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, RSA *rsa); -int RSA_verify(int type, const unsigned char *m, unsigned int m_length, - unsigned char *sigbuf, unsigned int siglen, RSA *rsa); - -/* The following 2 function sign and verify a ASN1_OCTET_STRING - * object inside PKCS#1 padded RSA encryption */ -int RSA_sign_ASN1_OCTET_STRING(int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, RSA *rsa); -int RSA_verify_ASN1_OCTET_STRING(int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigbuf, unsigned int siglen, RSA *rsa); - -int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); -void RSA_blinding_off(RSA *rsa); -BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); - -int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, - const unsigned char *f,int fl); -int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len); -int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, - const unsigned char *f,int fl); -int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len); -int PKCS1_MGF1(unsigned char *mask, long len, - const unsigned char *seed, long seedlen, const EVP_MD *dgst); -int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, - const unsigned char *f,int fl, - const unsigned char *p,int pl); -int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len, - const unsigned char *p,int pl); -int RSA_padding_add_SSLv23(unsigned char *to,int tlen, - const unsigned char *f,int fl); -int RSA_padding_check_SSLv23(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len); -int RSA_padding_add_none(unsigned char *to,int tlen, - const unsigned char *f,int fl); -int RSA_padding_check_none(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len); -int RSA_padding_add_X931(unsigned char *to,int tlen, - const unsigned char *f,int fl); -int RSA_padding_check_X931(unsigned char *to,int tlen, - const unsigned char *f,int fl,int rsa_len); -int RSA_X931_hash_id(int nid); - -int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, - const EVP_MD *Hash, const unsigned char *EM, int sLen); -int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, - const unsigned char *mHash, - const EVP_MD *Hash, int sLen); - -int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int RSA_set_ex_data(RSA *r,int idx,void *arg); -void *RSA_get_ex_data(const RSA *r, int idx); - -RSA *RSAPublicKey_dup(RSA *rsa); -RSA *RSAPrivateKey_dup(RSA *rsa); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_RSA_strings(void); - -/* Error codes for the RSA functions. */ - -/* Function codes. */ -#define RSA_F_FIPS_RSA_SIGN 140 -#define RSA_F_FIPS_RSA_VERIFY 141 -#define RSA_F_MEMORY_LOCK 100 -#define RSA_F_RSA_BUILTIN_KEYGEN 129 -#define RSA_F_RSA_CHECK_KEY 123 -#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 -#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 -#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 -#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 -#define RSA_F_RSA_GENERATE_KEY 105 -#define RSA_F_RSA_MEMORY_LOCK 130 -#define RSA_F_RSA_NEW_METHOD 106 -#define RSA_F_RSA_NULL 124 -#define RSA_F_RSA_NULL_MOD_EXP 131 -#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132 -#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133 -#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134 -#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135 -#define RSA_F_RSA_PADDING_ADD_NONE 107 -#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 -#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 -#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 -#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 -#define RSA_F_RSA_PADDING_ADD_SSLV23 110 -#define RSA_F_RSA_PADDING_ADD_X931 127 -#define RSA_F_RSA_PADDING_CHECK_NONE 111 -#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 -#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 -#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 -#define RSA_F_RSA_PADDING_CHECK_SSLV23 114 -#define RSA_F_RSA_PADDING_CHECK_X931 128 -#define RSA_F_RSA_PRINT 115 -#define RSA_F_RSA_PRINT_FP 116 -#define RSA_F_RSA_PRIVATE_ENCRYPT 137 -#define RSA_F_RSA_PUBLIC_DECRYPT 138 -#define RSA_F_RSA_SETUP_BLINDING 136 -#define RSA_F_RSA_SET_DEFAULT_METHOD 139 -#define RSA_F_RSA_SET_METHOD 142 -#define RSA_F_RSA_SIGN 117 -#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 -#define RSA_F_RSA_VERIFY 119 -#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 -#define RSA_F_RSA_VERIFY_PKCS1_PSS 126 - -/* Reason codes. */ -#define RSA_R_ALGORITHM_MISMATCH 100 -#define RSA_R_BAD_E_VALUE 101 -#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 -#define RSA_R_BAD_PAD_BYTE_COUNT 103 -#define RSA_R_BAD_SIGNATURE 104 -#define RSA_R_BLOCK_TYPE_IS_NOT_01 106 -#define RSA_R_BLOCK_TYPE_IS_NOT_02 107 -#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 -#define RSA_R_DATA_TOO_LARGE 109 -#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 -#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 -#define RSA_R_DATA_TOO_SMALL 111 -#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 -#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 -#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 -#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 -#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 -#define RSA_R_FIRST_OCTET_INVALID 133 -#define RSA_R_INVALID_HEADER 137 -#define RSA_R_INVALID_MESSAGE_LENGTH 131 -#define RSA_R_INVALID_PADDING 138 -#define RSA_R_INVALID_TRAILER 139 -#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 -#define RSA_R_KEY_SIZE_TOO_SMALL 120 -#define RSA_R_LAST_OCTET_INVALID 134 -#define RSA_R_MODULUS_TOO_LARGE 105 -#define RSA_R_NON_FIPS_METHOD 141 -#define RSA_R_NO_PUBLIC_EXPONENT 140 -#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 -#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 -#define RSA_R_OAEP_DECODING_ERROR 121 -#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 142 -#define RSA_R_PADDING_CHECK_FAILED 114 -#define RSA_R_P_NOT_PRIME 128 -#define RSA_R_Q_NOT_PRIME 129 -#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 -#define RSA_R_SLEN_CHECK_FAILED 136 -#define RSA_R_SLEN_RECOVERY_FAILED 135 -#define RSA_R_SSLV3_ROLLBACK_ATTACK 115 -#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 -#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 -#define RSA_R_UNKNOWN_PADDING_TYPE 118 -#define RSA_R_WRONG_SIGNATURE_LENGTH 119 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/safestack.h b/dep/include/openssl/safestack.h deleted file mode 100644 index 40b17902e07..00000000000 --- a/dep/include/openssl/safestack.h +++ /dev/null @@ -1,2030 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_SAFESTACK_H -#define HEADER_SAFESTACK_H - -#include - -#ifdef DEBUG_SAFESTACK - -#ifndef CHECKED_PTR_OF -#define CHECKED_PTR_OF(type, p) \ - ((void*) (1 ? p : (type*)0)) -#endif - -#define CHECKED_SK_FREE_FUNC(type, p) \ - ((void (*)(void *)) ((1 ? p : (void (*)(type *))0))) - -#define CHECKED_SK_CMP_FUNC(type, p) \ - ((int (*)(const char * const *, const char * const *)) \ - ((1 ? p : (int (*)(const type * const *, const type * const *))0))) - -#define STACK_OF(type) struct stack_st_##type -#define PREDECLARE_STACK_OF(type) STACK_OF(type); - -#define DECLARE_STACK_OF(type) \ -STACK_OF(type) \ - { \ - STACK stack; \ - }; - -#define IMPLEMENT_STACK_OF(type) /* nada (obsolete in new safestack approach)*/ - -/* SKM_sk_... stack macros are internal to safestack.h: - * never use them directly, use sk__... instead */ -#define SKM_sk_new(type, cmp) \ - ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp))) -#define SKM_sk_new_null(type) \ - ((STACK_OF(type) *)sk_new_null()) -#define SKM_sk_free(type, st) \ - sk_free(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_num(type, st) \ - sk_num(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_value(type, st,i) \ - ((type *)sk_value(CHECKED_PTR_OF(STACK_OF(type), st), i)) -#define SKM_sk_set(type, st,i,val) \ - sk_set(CHECKED_PTR_OF(STACK_OF(type), st), i, CHECKED_PTR_OF(type, val)) -#define SKM_sk_zero(type, st) \ - sk_zero(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_push(type, st,val) \ - sk_push(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) -#define SKM_sk_unshift(type, st,val) \ - sk_unshift(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) -#define SKM_sk_find(type, st,val) \ - sk_find(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) -#define SKM_sk_delete(type, st,i) \ - (type *)sk_delete(CHECKED_PTR_OF(STACK_OF(type), st), i) -#define SKM_sk_delete_ptr(type, st,ptr) \ - (type *)sk_delete_ptr(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, ptr)) -#define SKM_sk_insert(type, st,val,i) \ - sk_insert(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val), i) -#define SKM_sk_set_cmp_func(type, st,cmp) \ - ((int (*)(const type * const *,const type * const *)) \ - sk_set_cmp_func(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_CMP_FUNC(type, cmp))) -#define SKM_sk_dup(type, st) \ - (STACK_OF(type) *)sk_dup(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_pop_free(type, st,free_func) \ - sk_pop_free(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_FREE_FUNC(type, free_func)) -#define SKM_sk_shift(type, st) \ - (type *)sk_shift(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_pop(type, st) \ - (type *)sk_pop(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_sort(type, st) \ - sk_sort(CHECKED_PTR_OF(STACK_OF(type), st)) -#define SKM_sk_is_sorted(type, st) \ - sk_is_sorted(CHECKED_PTR_OF(STACK_OF(type), st)) - -#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - (STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), \ - pp, length, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - ex_tag, ex_class) - -#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ - i2d_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), pp, \ - CHECKED_I2D_OF(type, i2d_func), \ - ex_tag, ex_class, is_set) - -#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ - ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ - CHECKED_I2D_OF(type, i2d_func), buf, len) - -#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ - (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) - -#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ - (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - pass, passlen, oct, seq) - -#else - -#define STACK_OF(type) STACK -#define PREDECLARE_STACK_OF(type) /* nada */ -#define DECLARE_STACK_OF(type) /* nada */ -#define IMPLEMENT_STACK_OF(type) /* nada */ - -#define SKM_sk_new(type, cmp) \ - sk_new((int (*)(const char * const *, const char * const *))(cmp)) -#define SKM_sk_new_null(type) \ - sk_new_null() -#define SKM_sk_free(type, st) \ - sk_free(st) -#define SKM_sk_num(type, st) \ - sk_num(st) -#define SKM_sk_value(type, st,i) \ - ((type *)sk_value(st, i)) -#define SKM_sk_set(type, st,i,val) \ - ((type *)sk_set(st, i,(char *)val)) -#define SKM_sk_zero(type, st) \ - sk_zero(st) -#define SKM_sk_push(type, st,val) \ - sk_push(st, (char *)val) -#define SKM_sk_unshift(type, st,val) \ - sk_unshift(st, (char *)val) -#define SKM_sk_find(type, st,val) \ - sk_find(st, (char *)val) -#define SKM_sk_delete(type, st,i) \ - ((type *)sk_delete(st, i)) -#define SKM_sk_delete_ptr(type, st,ptr) \ - ((type *)sk_delete_ptr(st,(char *)ptr)) -#define SKM_sk_insert(type, st,val,i) \ - sk_insert(st, (char *)val, i) -#define SKM_sk_set_cmp_func(type, st,cmp) \ - ((int (*)(const type * const *,const type * const *)) \ - sk_set_cmp_func(st, (int (*)(const char * const *, const char * const *))(cmp))) -#define SKM_sk_dup(type, st) \ - sk_dup(st) -#define SKM_sk_pop_free(type, st,free_func) \ - sk_pop_free(st, (void (*)(void *))free_func) -#define SKM_sk_shift(type, st) \ - ((type *)sk_shift(st)) -#define SKM_sk_pop(type, st) \ - ((type *)sk_pop(st)) -#define SKM_sk_sort(type, st) \ - sk_sort(st) -#define SKM_sk_is_sorted(type, st) \ - sk_is_sorted(st) - -#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - d2i_ASN1_SET(st,pp,length, (void *(*)(void ** ,const unsigned char ** ,long))d2i_func, (void (*)(void *))free_func, ex_tag,ex_class) -#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ - i2d_ASN1_SET(st,pp,(int (*)(void *, unsigned char **))i2d_func,ex_tag,ex_class,is_set) - -#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ - ASN1_seq_pack(st, (int (*)(void *, unsigned char **))i2d_func, buf, len) -#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ - ASN1_seq_unpack(buf,len,(void *(*)(void **,const unsigned char **,long))d2i_func, (void(*)(void *))free_func) - -#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ - ((STACK *)PKCS12_decrypt_d2i(algor,(char *(*)())d2i_func, (void(*)(void *))free_func,pass,passlen,oct,seq)) - -#endif - -/* This block of defines is updated by util/mkstack.pl, please do not touch! */ -#define sk_ACCESS_DESCRIPTION_new(st) SKM_sk_new(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION) -#define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i)) -#define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val)) -#define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val)) -#define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val)) -#define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val)) -#define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val)) -#define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i)) -#define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr)) -#define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i)) -#define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp)) -#define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st) -#define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func)) -#define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st)) -#define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st)) - -#define sk_ASIdOrRange_new(st) SKM_sk_new(ASIdOrRange, (st)) -#define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange) -#define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st)) -#define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st)) -#define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i)) -#define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val)) -#define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st)) -#define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val)) -#define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val)) -#define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val)) -#define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val)) -#define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i)) -#define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr)) -#define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i)) -#define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp)) -#define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st) -#define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func)) -#define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st)) -#define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st)) -#define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st)) -#define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st)) - -#define sk_ASN1_GENERALSTRING_new(st) SKM_sk_new(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING) -#define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i)) -#define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val)) -#define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val)) -#define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val)) -#define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val)) -#define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val)) -#define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i)) -#define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr)) -#define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i)) -#define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp)) -#define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st) -#define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func)) -#define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st)) -#define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st)) - -#define sk_ASN1_INTEGER_new(st) SKM_sk_new(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER) -#define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i)) -#define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val)) -#define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val)) -#define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val)) -#define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val)) -#define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val)) -#define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i)) -#define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr)) -#define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i)) -#define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp)) -#define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st) -#define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func)) -#define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st)) -#define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st)) - -#define sk_ASN1_OBJECT_new(st) SKM_sk_new(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT) -#define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i)) -#define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val)) -#define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val)) -#define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val)) -#define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val)) -#define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val)) -#define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i)) -#define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr)) -#define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i)) -#define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp)) -#define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st) -#define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func)) -#define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st)) -#define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st)) - -#define sk_ASN1_STRING_TABLE_new(st) SKM_sk_new(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE) -#define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i)) -#define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val)) -#define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val)) -#define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val)) -#define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val)) -#define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val)) -#define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i)) -#define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr)) -#define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i)) -#define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp)) -#define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st) -#define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func)) -#define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st)) -#define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st)) - -#define sk_ASN1_TYPE_new(st) SKM_sk_new(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE) -#define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i)) -#define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val)) -#define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val)) -#define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val)) -#define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val)) -#define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val)) -#define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i)) -#define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr)) -#define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i)) -#define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp)) -#define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st) -#define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func)) -#define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st)) -#define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st)) - -#define sk_ASN1_VALUE_new(st) SKM_sk_new(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE) -#define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i)) -#define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val)) -#define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val)) -#define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val)) -#define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val)) -#define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val)) -#define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i)) -#define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr)) -#define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i)) -#define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp)) -#define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st) -#define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func)) -#define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st)) -#define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st)) - -#define sk_BIO_new(st) SKM_sk_new(BIO, (st)) -#define sk_BIO_new_null() SKM_sk_new_null(BIO) -#define sk_BIO_free(st) SKM_sk_free(BIO, (st)) -#define sk_BIO_num(st) SKM_sk_num(BIO, (st)) -#define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i)) -#define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val)) -#define sk_BIO_zero(st) SKM_sk_zero(BIO, (st)) -#define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val)) -#define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val)) -#define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val)) -#define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val)) -#define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i)) -#define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr)) -#define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i)) -#define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp)) -#define sk_BIO_dup(st) SKM_sk_dup(BIO, st) -#define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func)) -#define sk_BIO_shift(st) SKM_sk_shift(BIO, (st)) -#define sk_BIO_pop(st) SKM_sk_pop(BIO, (st)) -#define sk_BIO_sort(st) SKM_sk_sort(BIO, (st)) -#define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st)) - -#define sk_CMS_CertificateChoices_new(st) SKM_sk_new(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices) -#define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i)) -#define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val)) -#define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i)) -#define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr)) -#define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i)) -#define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp)) -#define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st) -#define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func)) -#define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st)) - -#define sk_CMS_RecipientInfo_new(st) SKM_sk_new(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo) -#define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i)) -#define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val)) -#define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i)) -#define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr)) -#define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i)) -#define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp)) -#define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st) -#define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func)) -#define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st)) - -#define sk_CMS_RevocationInfoChoice_new(st) SKM_sk_new(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice) -#define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i)) -#define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val)) -#define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i)) -#define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr)) -#define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i)) -#define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp)) -#define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st) -#define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func)) -#define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st)) - -#define sk_CMS_SignerInfo_new(st) SKM_sk_new(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo) -#define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i)) -#define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val)) -#define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i)) -#define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr)) -#define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i)) -#define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp)) -#define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st) -#define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func)) -#define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st)) - -#define sk_CONF_IMODULE_new(st) SKM_sk_new(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE) -#define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i)) -#define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val)) -#define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val)) -#define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val)) -#define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val)) -#define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val)) -#define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i)) -#define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr)) -#define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i)) -#define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp)) -#define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st) -#define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func)) -#define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st)) -#define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st)) - -#define sk_CONF_MODULE_new(st) SKM_sk_new(CONF_MODULE, (st)) -#define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE) -#define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st)) -#define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st)) -#define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i)) -#define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val)) -#define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st)) -#define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val)) -#define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val)) -#define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val)) -#define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val)) -#define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i)) -#define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr)) -#define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i)) -#define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp)) -#define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st) -#define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func)) -#define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st)) -#define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st)) -#define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st)) -#define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st)) - -#define sk_CONF_VALUE_new(st) SKM_sk_new(CONF_VALUE, (st)) -#define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE) -#define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st)) -#define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st)) -#define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i)) -#define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val)) -#define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st)) -#define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val)) -#define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val)) -#define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val)) -#define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val)) -#define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i)) -#define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr)) -#define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i)) -#define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp)) -#define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st) -#define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func)) -#define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st)) -#define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st)) -#define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st)) -#define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st)) - -#define sk_CRYPTO_EX_DATA_FUNCS_new(st) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS) -#define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i)) -#define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val)) -#define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val)) -#define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val)) -#define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val)) -#define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val)) -#define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i)) -#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr)) -#define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i)) -#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp)) -#define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st) -#define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func)) -#define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st)) -#define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st)) - -#define sk_CRYPTO_dynlock_new(st) SKM_sk_new(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock) -#define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i)) -#define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val)) -#define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val)) -#define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val)) -#define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val)) -#define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val)) -#define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i)) -#define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr)) -#define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i)) -#define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp)) -#define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st) -#define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func)) -#define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st)) -#define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st)) - -#define sk_DIST_POINT_new(st) SKM_sk_new(DIST_POINT, (st)) -#define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT) -#define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st)) -#define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st)) -#define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i)) -#define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val)) -#define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st)) -#define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val)) -#define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val)) -#define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val)) -#define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val)) -#define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i)) -#define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr)) -#define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i)) -#define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp)) -#define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st) -#define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func)) -#define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st)) -#define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st)) -#define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st)) -#define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st)) - -#define sk_ENGINE_new(st) SKM_sk_new(ENGINE, (st)) -#define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE) -#define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st)) -#define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st)) -#define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i)) -#define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val)) -#define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st)) -#define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val)) -#define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val)) -#define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val)) -#define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val)) -#define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i)) -#define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr)) -#define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i)) -#define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp)) -#define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st) -#define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func)) -#define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st)) -#define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st)) -#define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st)) -#define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st)) - -#define sk_ENGINE_CLEANUP_ITEM_new(st) SKM_sk_new(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM) -#define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i)) -#define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val)) -#define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val)) -#define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val)) -#define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val)) -#define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val)) -#define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i)) -#define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr)) -#define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i)) -#define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp)) -#define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st) -#define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func)) -#define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st)) -#define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st)) - -#define sk_GENERAL_NAME_new(st) SKM_sk_new(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME) -#define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i)) -#define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val)) -#define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val)) -#define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val)) -#define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val)) -#define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val)) -#define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i)) -#define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr)) -#define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i)) -#define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp)) -#define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st) -#define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func)) -#define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st)) -#define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st)) - -#define sk_GENERAL_NAMES_new(st) SKM_sk_new(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES) -#define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i)) -#define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val)) -#define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val)) -#define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val)) -#define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val)) -#define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val)) -#define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i)) -#define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr)) -#define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i)) -#define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp)) -#define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st) -#define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func)) -#define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st)) -#define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st)) - -#define sk_GENERAL_SUBTREE_new(st) SKM_sk_new(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE) -#define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i)) -#define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val)) -#define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val)) -#define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val)) -#define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val)) -#define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val)) -#define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i)) -#define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr)) -#define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i)) -#define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp)) -#define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st) -#define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func)) -#define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st)) -#define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st)) - -#define sk_IPAddressFamily_new(st) SKM_sk_new(IPAddressFamily, (st)) -#define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily) -#define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st)) -#define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st)) -#define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i)) -#define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val)) -#define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st)) -#define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val)) -#define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val)) -#define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val)) -#define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val)) -#define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i)) -#define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr)) -#define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i)) -#define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp)) -#define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st) -#define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func)) -#define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st)) -#define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st)) -#define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st)) -#define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st)) - -#define sk_IPAddressOrRange_new(st) SKM_sk_new(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange) -#define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i)) -#define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val)) -#define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val)) -#define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val)) -#define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val)) -#define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val)) -#define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i)) -#define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr)) -#define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i)) -#define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp)) -#define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st) -#define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func)) -#define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st)) -#define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st)) - -#define sk_KRB5_APREQBODY_new(st) SKM_sk_new(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY) -#define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i)) -#define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val)) -#define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i)) -#define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr)) -#define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i)) -#define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp)) -#define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st) -#define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func)) -#define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st)) - -#define sk_KRB5_AUTHDATA_new(st) SKM_sk_new(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA) -#define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i)) -#define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val)) -#define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i)) -#define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr)) -#define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i)) -#define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp)) -#define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st) -#define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func)) -#define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st)) - -#define sk_KRB5_AUTHENTBODY_new(st) SKM_sk_new(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY) -#define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i)) -#define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val)) -#define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i)) -#define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr)) -#define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i)) -#define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp)) -#define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st) -#define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func)) -#define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st)) - -#define sk_KRB5_CHECKSUM_new(st) SKM_sk_new(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM) -#define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i)) -#define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val)) -#define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i)) -#define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr)) -#define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i)) -#define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp)) -#define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st) -#define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func)) -#define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st)) - -#define sk_KRB5_ENCDATA_new(st) SKM_sk_new(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA) -#define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i)) -#define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val)) -#define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i)) -#define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr)) -#define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i)) -#define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp)) -#define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st) -#define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func)) -#define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st)) - -#define sk_KRB5_ENCKEY_new(st) SKM_sk_new(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY) -#define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i)) -#define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val)) -#define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i)) -#define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr)) -#define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i)) -#define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp)) -#define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st) -#define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func)) -#define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st)) - -#define sk_KRB5_PRINCNAME_new(st) SKM_sk_new(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME) -#define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i)) -#define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val)) -#define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i)) -#define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr)) -#define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i)) -#define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp)) -#define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st) -#define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func)) -#define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st)) - -#define sk_KRB5_TKTBODY_new(st) SKM_sk_new(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY) -#define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i)) -#define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val)) -#define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i)) -#define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr)) -#define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i)) -#define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp)) -#define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st) -#define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func)) -#define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st)) - -#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st)) -#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) -#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) -#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) -#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) -#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) -#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) -#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) -#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) -#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) -#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) -#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) -#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) -#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) -#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) -#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) -#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) - -#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st)) -#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) -#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) -#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) -#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) -#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) -#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) -#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) -#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) -#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) -#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) -#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) -#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) -#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) -#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) -#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) -#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) -#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) - -#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st)) -#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) -#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) -#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) -#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) -#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) -#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) -#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) -#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) -#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) -#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) -#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) -#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) -#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) -#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) -#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) -#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) - -#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st)) -#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) -#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) -#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) -#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) -#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) -#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) -#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) -#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) -#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) -#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) -#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) -#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) -#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) -#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) -#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) -#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) -#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) - -#define sk_NAME_FUNCS_new(st) SKM_sk_new(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS) -#define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i)) -#define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val)) -#define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val)) -#define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val)) -#define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val)) -#define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val)) -#define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i)) -#define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr)) -#define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i)) -#define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp)) -#define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st) -#define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func)) -#define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st)) -#define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st)) - -#define sk_OCSP_CERTID_new(st) SKM_sk_new(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID) -#define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i)) -#define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val)) -#define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val)) -#define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val)) -#define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val)) -#define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val)) -#define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i)) -#define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr)) -#define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i)) -#define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp)) -#define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st) -#define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func)) -#define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st)) -#define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st)) - -#define sk_OCSP_ONEREQ_new(st) SKM_sk_new(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ) -#define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i)) -#define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val)) -#define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val)) -#define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val)) -#define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val)) -#define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val)) -#define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i)) -#define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr)) -#define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i)) -#define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp)) -#define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st) -#define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func)) -#define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st)) -#define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st)) - -#define sk_OCSP_RESPID_new(st) SKM_sk_new(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID) -#define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i)) -#define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val)) -#define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val)) -#define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val)) -#define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val)) -#define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val)) -#define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i)) -#define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr)) -#define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i)) -#define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp)) -#define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st) -#define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func)) -#define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st)) -#define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st)) - -#define sk_OCSP_SINGLERESP_new(st) SKM_sk_new(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP) -#define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i)) -#define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val)) -#define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val)) -#define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val)) -#define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val)) -#define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val)) -#define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i)) -#define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr)) -#define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i)) -#define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp)) -#define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st) -#define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func)) -#define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st)) -#define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st)) - -#define sk_PKCS12_SAFEBAG_new(st) SKM_sk_new(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG) -#define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i)) -#define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val)) -#define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val)) -#define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val)) -#define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val)) -#define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val)) -#define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i)) -#define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr)) -#define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i)) -#define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp)) -#define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st) -#define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func)) -#define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st)) -#define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st)) - -#define sk_PKCS7_new(st) SKM_sk_new(PKCS7, (st)) -#define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7) -#define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st)) -#define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st)) -#define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i)) -#define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val)) -#define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st)) -#define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val)) -#define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val)) -#define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val)) -#define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val)) -#define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i)) -#define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr)) -#define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i)) -#define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp)) -#define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st) -#define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func)) -#define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st)) -#define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st)) -#define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st)) -#define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st)) - -#define sk_PKCS7_RECIP_INFO_new(st) SKM_sk_new(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO) -#define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i)) -#define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val)) -#define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val)) -#define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val)) -#define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val)) -#define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val)) -#define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i)) -#define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr)) -#define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i)) -#define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp)) -#define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st) -#define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func)) -#define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st)) -#define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st)) - -#define sk_PKCS7_SIGNER_INFO_new(st) SKM_sk_new(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO) -#define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i)) -#define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val)) -#define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val)) -#define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val)) -#define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val)) -#define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val)) -#define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i)) -#define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr)) -#define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i)) -#define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp)) -#define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st) -#define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func)) -#define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st)) -#define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st)) - -#define sk_POLICYINFO_new(st) SKM_sk_new(POLICYINFO, (st)) -#define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO) -#define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st)) -#define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st)) -#define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i)) -#define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val)) -#define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st)) -#define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val)) -#define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val)) -#define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val)) -#define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val)) -#define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i)) -#define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr)) -#define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i)) -#define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp)) -#define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st) -#define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func)) -#define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st)) -#define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st)) -#define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st)) -#define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st)) - -#define sk_POLICYQUALINFO_new(st) SKM_sk_new(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO) -#define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i)) -#define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val)) -#define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val)) -#define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val)) -#define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val)) -#define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val)) -#define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i)) -#define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr)) -#define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i)) -#define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp)) -#define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st) -#define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func)) -#define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st)) -#define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st)) - -#define sk_POLICY_MAPPING_new(st) SKM_sk_new(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING) -#define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i)) -#define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val)) -#define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val)) -#define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val)) -#define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val)) -#define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val)) -#define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i)) -#define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr)) -#define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i)) -#define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp)) -#define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st) -#define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func)) -#define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) -#define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) - -#define sk_SSL_CIPHER_new(st) SKM_sk_new(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) -#define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i)) -#define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val)) -#define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val)) -#define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val)) -#define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val)) -#define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val)) -#define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i)) -#define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr)) -#define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i)) -#define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp)) -#define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st) -#define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func)) -#define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st)) -#define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st)) - -#define sk_SSL_COMP_new(st) SKM_sk_new(SSL_COMP, (st)) -#define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP) -#define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st)) -#define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st)) -#define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i)) -#define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val)) -#define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st)) -#define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val)) -#define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val)) -#define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val)) -#define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val)) -#define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i)) -#define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr)) -#define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i)) -#define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp)) -#define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st) -#define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func)) -#define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st)) -#define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st)) -#define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st)) -#define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st)) - -#define sk_STORE_OBJECT_new(st) SKM_sk_new(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT) -#define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i)) -#define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val)) -#define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val)) -#define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val)) -#define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val)) -#define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val)) -#define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i)) -#define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr)) -#define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i)) -#define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp)) -#define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st) -#define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func)) -#define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st)) -#define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st)) - -#define sk_SXNETID_new(st) SKM_sk_new(SXNETID, (st)) -#define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID) -#define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st)) -#define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st)) -#define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i)) -#define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val)) -#define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st)) -#define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val)) -#define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val)) -#define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val)) -#define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val)) -#define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i)) -#define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr)) -#define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i)) -#define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp)) -#define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st) -#define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func)) -#define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st)) -#define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st)) -#define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st)) -#define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st)) - -#define sk_UI_STRING_new(st) SKM_sk_new(UI_STRING, (st)) -#define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING) -#define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st)) -#define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st)) -#define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i)) -#define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val)) -#define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st)) -#define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val)) -#define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val)) -#define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val)) -#define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val)) -#define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i)) -#define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr)) -#define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i)) -#define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp)) -#define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st) -#define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func)) -#define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st)) -#define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st)) -#define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st)) -#define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st)) - -#define sk_X509_new(st) SKM_sk_new(X509, (st)) -#define sk_X509_new_null() SKM_sk_new_null(X509) -#define sk_X509_free(st) SKM_sk_free(X509, (st)) -#define sk_X509_num(st) SKM_sk_num(X509, (st)) -#define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i)) -#define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val)) -#define sk_X509_zero(st) SKM_sk_zero(X509, (st)) -#define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val)) -#define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val)) -#define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val)) -#define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val)) -#define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i)) -#define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr)) -#define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i)) -#define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp)) -#define sk_X509_dup(st) SKM_sk_dup(X509, st) -#define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func)) -#define sk_X509_shift(st) SKM_sk_shift(X509, (st)) -#define sk_X509_pop(st) SKM_sk_pop(X509, (st)) -#define sk_X509_sort(st) SKM_sk_sort(X509, (st)) -#define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st)) - -#define sk_X509V3_EXT_METHOD_new(st) SKM_sk_new(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD) -#define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i)) -#define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val)) -#define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val)) -#define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val)) -#define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val)) -#define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val)) -#define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i)) -#define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr)) -#define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i)) -#define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp)) -#define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st) -#define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func)) -#define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st)) -#define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st)) - -#define sk_X509_ALGOR_new(st) SKM_sk_new(X509_ALGOR, (st)) -#define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR) -#define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st)) -#define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st)) -#define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i)) -#define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val)) -#define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st)) -#define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val)) -#define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val)) -#define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val)) -#define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val)) -#define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i)) -#define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr)) -#define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i)) -#define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp)) -#define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st) -#define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func)) -#define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st)) -#define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st)) -#define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st)) -#define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st)) - -#define sk_X509_ATTRIBUTE_new(st) SKM_sk_new(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE) -#define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i)) -#define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val)) -#define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val)) -#define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val)) -#define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val)) -#define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val)) -#define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i)) -#define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr)) -#define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i)) -#define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp)) -#define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st) -#define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func)) -#define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st)) -#define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st)) - -#define sk_X509_CRL_new(st) SKM_sk_new(X509_CRL, (st)) -#define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL) -#define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st)) -#define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st)) -#define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i)) -#define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val)) -#define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st)) -#define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val)) -#define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val)) -#define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val)) -#define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val)) -#define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i)) -#define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr)) -#define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i)) -#define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp)) -#define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st) -#define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func)) -#define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st)) -#define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st)) -#define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st)) -#define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st)) - -#define sk_X509_EXTENSION_new(st) SKM_sk_new(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION) -#define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i)) -#define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val)) -#define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val)) -#define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val)) -#define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val)) -#define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val)) -#define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i)) -#define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr)) -#define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i)) -#define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp)) -#define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st) -#define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func)) -#define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st)) -#define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st)) - -#define sk_X509_INFO_new(st) SKM_sk_new(X509_INFO, (st)) -#define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO) -#define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st)) -#define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st)) -#define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i)) -#define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val)) -#define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st)) -#define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val)) -#define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val)) -#define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val)) -#define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val)) -#define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i)) -#define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr)) -#define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i)) -#define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp)) -#define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st) -#define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func)) -#define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st)) -#define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st)) -#define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st)) -#define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st)) - -#define sk_X509_LOOKUP_new(st) SKM_sk_new(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP) -#define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i)) -#define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val)) -#define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val)) -#define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val)) -#define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val)) -#define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val)) -#define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i)) -#define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr)) -#define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i)) -#define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp)) -#define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st) -#define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func)) -#define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st)) -#define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st)) - -#define sk_X509_NAME_new(st) SKM_sk_new(X509_NAME, (st)) -#define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME) -#define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st)) -#define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st)) -#define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i)) -#define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val)) -#define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st)) -#define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val)) -#define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val)) -#define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val)) -#define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val)) -#define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i)) -#define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr)) -#define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i)) -#define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp)) -#define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st) -#define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func)) -#define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st)) -#define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st)) -#define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st)) -#define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st)) - -#define sk_X509_NAME_ENTRY_new(st) SKM_sk_new(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY) -#define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i)) -#define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val)) -#define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val)) -#define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val)) -#define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val)) -#define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val)) -#define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i)) -#define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr)) -#define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i)) -#define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp)) -#define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st) -#define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func)) -#define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st)) -#define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st)) - -#define sk_X509_OBJECT_new(st) SKM_sk_new(X509_OBJECT, (st)) -#define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT) -#define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st)) -#define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st)) -#define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i)) -#define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val)) -#define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st)) -#define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val)) -#define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val)) -#define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val)) -#define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val)) -#define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i)) -#define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr)) -#define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i)) -#define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp)) -#define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st) -#define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func)) -#define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st)) -#define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st)) -#define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st)) -#define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st)) - -#define sk_X509_POLICY_DATA_new(st) SKM_sk_new(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA) -#define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i)) -#define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val)) -#define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val)) -#define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val)) -#define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val)) -#define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val)) -#define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i)) -#define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr)) -#define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i)) -#define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp)) -#define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st) -#define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func)) -#define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st)) -#define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st)) - -#define sk_X509_POLICY_NODE_new(st) SKM_sk_new(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE) -#define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i)) -#define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val)) -#define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val)) -#define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val)) -#define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val)) -#define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val)) -#define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i)) -#define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr)) -#define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i)) -#define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp)) -#define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st) -#define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func)) -#define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st)) -#define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st)) - -#define sk_X509_POLICY_REF_new(st) SKM_sk_new(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_new_null() SKM_sk_new_null(X509_POLICY_REF) -#define sk_X509_POLICY_REF_free(st) SKM_sk_free(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_num(st) SKM_sk_num(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_value(st, i) SKM_sk_value(X509_POLICY_REF, (st), (i)) -#define sk_X509_POLICY_REF_set(st, i, val) SKM_sk_set(X509_POLICY_REF, (st), (i), (val)) -#define sk_X509_POLICY_REF_zero(st) SKM_sk_zero(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_push(st, val) SKM_sk_push(X509_POLICY_REF, (st), (val)) -#define sk_X509_POLICY_REF_unshift(st, val) SKM_sk_unshift(X509_POLICY_REF, (st), (val)) -#define sk_X509_POLICY_REF_find(st, val) SKM_sk_find(X509_POLICY_REF, (st), (val)) -#define sk_X509_POLICY_REF_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_REF, (st), (val)) -#define sk_X509_POLICY_REF_delete(st, i) SKM_sk_delete(X509_POLICY_REF, (st), (i)) -#define sk_X509_POLICY_REF_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_REF, (st), (ptr)) -#define sk_X509_POLICY_REF_insert(st, val, i) SKM_sk_insert(X509_POLICY_REF, (st), (val), (i)) -#define sk_X509_POLICY_REF_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_REF, (st), (cmp)) -#define sk_X509_POLICY_REF_dup(st) SKM_sk_dup(X509_POLICY_REF, st) -#define sk_X509_POLICY_REF_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_REF, (st), (free_func)) -#define sk_X509_POLICY_REF_shift(st) SKM_sk_shift(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_pop(st) SKM_sk_pop(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_sort(st) SKM_sk_sort(X509_POLICY_REF, (st)) -#define sk_X509_POLICY_REF_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_REF, (st)) - -#define sk_X509_PURPOSE_new(st) SKM_sk_new(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE) -#define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i)) -#define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val)) -#define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val)) -#define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val)) -#define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val)) -#define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val)) -#define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i)) -#define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr)) -#define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i)) -#define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp)) -#define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st) -#define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func)) -#define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st)) -#define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st)) - -#define sk_X509_REVOKED_new(st) SKM_sk_new(X509_REVOKED, (st)) -#define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED) -#define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st)) -#define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st)) -#define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i)) -#define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val)) -#define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st)) -#define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val)) -#define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val)) -#define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val)) -#define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val)) -#define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i)) -#define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr)) -#define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i)) -#define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp)) -#define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st) -#define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func)) -#define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st)) -#define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st)) -#define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st)) -#define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st)) - -#define sk_X509_TRUST_new(st) SKM_sk_new(X509_TRUST, (st)) -#define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST) -#define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st)) -#define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st)) -#define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i)) -#define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val)) -#define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st)) -#define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val)) -#define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val)) -#define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val)) -#define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val)) -#define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i)) -#define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr)) -#define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i)) -#define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp)) -#define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st) -#define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func)) -#define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st)) -#define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st)) -#define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st)) -#define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st)) - -#define sk_X509_VERIFY_PARAM_new(st) SKM_sk_new(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM) -#define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i)) -#define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val)) -#define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val)) -#define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val)) -#define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val)) -#define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val)) -#define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i)) -#define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr)) -#define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i)) -#define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp)) -#define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st) -#define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func)) -#define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st)) -#define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st)) - -#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) - -#define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) - -#define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) -/* End of util/mkstack.pl block, you may now edit :-) */ - -#endif /* !defined HEADER_SAFESTACK_H */ diff --git a/dep/include/openssl/sha.h b/dep/include/openssl/sha.h deleted file mode 100644 index 47a2c29f662..00000000000 --- a/dep/include/openssl/sha.h +++ /dev/null @@ -1,203 +0,0 @@ -/* crypto/sha/sha.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SHA_H -#define HEADER_SHA_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) -#error SHA is disabled. -#endif - -#if defined(OPENSSL_FIPS) -#define FIPS_SHA_SIZE_T size_t -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! SHA_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) -#define SHA_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define SHA_LONG unsigned long -#define SHA_LONG_LOG2 3 -#else -#define SHA_LONG unsigned int -#endif - -#define SHA_LBLOCK 16 -#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA_LAST_BLOCK (SHA_CBLOCK-8) -#define SHA_DIGEST_LENGTH 20 - -typedef struct SHAstate_st - { - SHA_LONG h0,h1,h2,h3,h4; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num; - } SHA_CTX; - -#ifndef OPENSSL_NO_SHA0 -#ifdef OPENSSL_FIPS -int private_SHA_Init(SHA_CTX *c); -#endif -int SHA_Init(SHA_CTX *c); -int SHA_Update(SHA_CTX *c, const void *data, size_t len); -int SHA_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); -void SHA_Transform(SHA_CTX *c, const unsigned char *data); -#endif -#ifndef OPENSSL_NO_SHA1 -int SHA1_Init(SHA_CTX *c); -int SHA1_Update(SHA_CTX *c, const void *data, size_t len); -int SHA1_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); -void SHA1_Transform(SHA_CTX *c, const unsigned char *data); -#endif - -#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA224_DIGEST_LENGTH 28 -#define SHA256_DIGEST_LENGTH 32 - -typedef struct SHA256state_st - { - SHA_LONG h[8]; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num,md_len; - } SHA256_CTX; - -#ifndef OPENSSL_NO_SHA256 -int SHA224_Init(SHA256_CTX *c); -int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA224_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); -int SHA256_Init(SHA256_CTX *c); -int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA256_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); -void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); -#endif - -#define SHA384_DIGEST_LENGTH 48 -#define SHA512_DIGEST_LENGTH 64 - -#ifndef OPENSSL_NO_SHA512 -/* - * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 - * being exactly 64-bit wide. See Implementation Notes in sha512.c - * for further details. - */ -#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a - * contiguous array of 64 bit - * wide big-endian values. */ -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) -#define SHA_LONG64 unsigned __int64 -#define U64(C) C##UI64 -#elif defined(__arch64__) -#define SHA_LONG64 unsigned long -#define U64(C) C##UL -#else -#define SHA_LONG64 unsigned long long -#define U64(C) C##ULL -#endif - -typedef struct SHA512state_st - { - SHA_LONG64 h[8]; - SHA_LONG64 Nl,Nh; - union { - SHA_LONG64 d[SHA_LBLOCK]; - unsigned char p[SHA512_CBLOCK]; - } u; - unsigned int num,md_len; - } SHA512_CTX; -#endif - -#ifndef OPENSSL_NO_SHA512 -int SHA384_Init(SHA512_CTX *c); -int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA384_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); -int SHA512_Init(SHA512_CTX *c); -int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA512_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); -void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/include/openssl/ssl.h b/dep/include/openssl/ssl.h deleted file mode 100644 index ff8a128d3c2..00000000000 --- a/dep/include/openssl/ssl.h +++ /dev/null @@ -1,2075 +0,0 @@ -/* ssl/ssl.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_SSL_H -#define HEADER_SSL_H - -#include - -#ifndef OPENSSL_NO_COMP -#include -#endif -#ifndef OPENSSL_NO_BIO -#include -#endif -#ifndef OPENSSL_NO_DEPRECATED -#ifndef OPENSSL_NO_X509 -#include -#endif -#include -#include -#include -#endif -#include -#include - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* SSLeay version number for ASN.1 encoding of the session information */ -/* Version 0 - initial version - * Version 1 - added the optional peer certificate - */ -#define SSL_SESSION_ASN1_VERSION 0x0001 - -/* text strings for the ciphers */ -#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5 -#define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5 -#define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 -#define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5 -#define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 -#define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5 -#define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5 -#define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA -#define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 -#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA - -/* VRS Additional Kerberos5 entries - */ -#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA -#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA -#define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA -#define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA -#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 -#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 -#define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5 -#define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5 - -#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA -#define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA -#define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA -#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 -#define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5 -#define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5 - -#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA -#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 -#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA -#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 -#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA -#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 -#define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256 - -#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 -#define SSL_MAX_SID_CTX_LENGTH 32 - -#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) -#define SSL_MAX_KEY_ARG_LENGTH 8 -#define SSL_MAX_MASTER_KEY_LENGTH 48 - -/* These are used to specify which ciphers to use and not to use */ -#define SSL_TXT_LOW "LOW" -#define SSL_TXT_MEDIUM "MEDIUM" -#define SSL_TXT_HIGH "HIGH" -#define SSL_TXT_FIPS "FIPS" -#define SSL_TXT_kFZA "kFZA" -#define SSL_TXT_aFZA "aFZA" -#define SSL_TXT_eFZA "eFZA" -#define SSL_TXT_FZA "FZA" - -#define SSL_TXT_aNULL "aNULL" -#define SSL_TXT_eNULL "eNULL" -#define SSL_TXT_NULL "NULL" - -#define SSL_TXT_kKRB5 "kKRB5" -#define SSL_TXT_aKRB5 "aKRB5" -#define SSL_TXT_KRB5 "KRB5" - -#define SSL_TXT_kRSA "kRSA" -#define SSL_TXT_kDHr "kDHr" -#define SSL_TXT_kDHd "kDHd" -#define SSL_TXT_kEDH "kEDH" -#define SSL_TXT_aRSA "aRSA" -#define SSL_TXT_aDSS "aDSS" -#define SSL_TXT_aDH "aDH" -#define SSL_TXT_DSS "DSS" -#define SSL_TXT_DH "DH" -#define SSL_TXT_EDH "EDH" -#define SSL_TXT_ADH "ADH" -#define SSL_TXT_RSA "RSA" -#define SSL_TXT_DES "DES" -#define SSL_TXT_3DES "3DES" -#define SSL_TXT_RC4 "RC4" -#define SSL_TXT_RC2 "RC2" -#define SSL_TXT_IDEA "IDEA" -#define SSL_TXT_SEED "SEED" -#define SSL_TXT_AES "AES" -#define SSL_TXT_CAMELLIA "CAMELLIA" -#define SSL_TXT_MD5 "MD5" -#define SSL_TXT_SHA1 "SHA1" -#define SSL_TXT_SHA "SHA" -#define SSL_TXT_EXP "EXP" -#define SSL_TXT_EXPORT "EXPORT" -#define SSL_TXT_EXP40 "EXPORT40" -#define SSL_TXT_EXP56 "EXPORT56" -#define SSL_TXT_SSLV2 "SSLv2" -#define SSL_TXT_SSLV3 "SSLv3" -#define SSL_TXT_TLSV1 "TLSv1" -#define SSL_TXT_ALL "ALL" -#define SSL_TXT_ECC "ECCdraft" /* ECC ciphersuites are not yet official */ - -/* - * COMPLEMENTOF* definitions. These identifiers are used to (de-select) - * ciphers normally not being used. - * Example: "RC4" will activate all ciphers using RC4 including ciphers - * without authentication, which would normally disabled by DEFAULT (due - * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" - * will make sure that it is also disabled in the specific selection. - * COMPLEMENTOF* identifiers are portable between version, as adjustments - * to the default cipher setup will also be included here. - * - * COMPLEMENTOFDEFAULT does not experience the same special treatment that - * DEFAULT gets, as only selection is being done and no sorting as needed - * for DEFAULT. - */ -#define SSL_TXT_CMPALL "COMPLEMENTOFALL" -#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" - -/* The following cipher list is used by default. - * It also is substituted when an application-defined cipher list string - * starts with 'DEFAULT'. */ -#define SSL_DEFAULT_CIPHER_LIST "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH" /* low priority for RC4 */ - -/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ -#define SSL_SENT_SHUTDOWN 1 -#define SSL_RECEIVED_SHUTDOWN 2 - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) -#define OPENSSL_NO_SSL2 -#endif - -#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 -#define SSL_FILETYPE_PEM X509_FILETYPE_PEM - -/* This is needed to stop compilers complaining about the - * 'struct ssl_st *' function parameters used to prototype callbacks - * in SSL_CTX. */ -typedef struct ssl_st *ssl_crock_st; - -/* used to hold info on the particular ciphers used */ -typedef struct ssl_cipher_st - { - int valid; - const char *name; /* text name */ - unsigned long id; /* id, 4 bytes, first is version */ - unsigned long algorithms; /* what ciphers are used */ - unsigned long algo_strength; /* strength and export flags */ - unsigned long algorithm2; /* Extra flags */ - int strength_bits; /* Number of bits really used */ - int alg_bits; /* Number of bits for algorithm */ - unsigned long mask; /* used for matching */ - unsigned long mask_strength; /* also used for matching */ - } SSL_CIPHER; - -DECLARE_STACK_OF(SSL_CIPHER) - -/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ -typedef struct ssl_method_st - { - int version; - int (*ssl_new)(SSL *s); - void (*ssl_clear)(SSL *s); - void (*ssl_free)(SSL *s); - int (*ssl_accept)(SSL *s); - int (*ssl_connect)(SSL *s); - int (*ssl_read)(SSL *s,void *buf,int len); - int (*ssl_peek)(SSL *s,void *buf,int len); - int (*ssl_write)(SSL *s,const void *buf,int len); - int (*ssl_shutdown)(SSL *s); - int (*ssl_renegotiate)(SSL *s); - int (*ssl_renegotiate_check)(SSL *s); - long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long - max, int *ok); - int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len, - int peek); - int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len); - int (*ssl_dispatch_alert)(SSL *s); - long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg); - long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg); - SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr); - int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr); - int (*ssl_pending)(const SSL *s); - int (*num_ciphers)(void); - SSL_CIPHER *(*get_cipher)(unsigned ncipher); - struct ssl_method_st *(*get_ssl_method)(int version); - long (*get_timeout)(void); - struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */ - int (*ssl_version)(void); - long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void)); - long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void)); - } SSL_METHOD; - -/* Lets make this into an ASN.1 type structure as follows - * SSL_SESSION_ID ::= SEQUENCE { - * version INTEGER, -- structure version number - * SSLversion INTEGER, -- SSL version number - * Cipher OCTET_STRING, -- the 3 byte cipher ID - * Session_ID OCTET_STRING, -- the Session ID - * Master_key OCTET_STRING, -- the master key - * KRB5_principal OCTET_STRING -- optional Kerberos principal - * Key_Arg [ 0 ] IMPLICIT OCTET_STRING, -- the optional Key argument - * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time - * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds - * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate - * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context - * Verify_result [ 5 ] EXPLICIT INTEGER -- X509_V_... code for `Peer' - * Compression [6] IMPLICIT ASN1_OBJECT -- compression OID XXXXX - * } - * Look in ssl/ssl_asn1.c for more details - * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). - */ -typedef struct ssl_session_st - { - int ssl_version; /* what ssl version session info is - * being kept in here? */ - - /* only really used in SSLv2 */ - unsigned int key_arg_length; - unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH]; - int master_key_length; - unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH]; - /* session_id - valid? */ - unsigned int session_id_length; - unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; - /* this is used to determine whether the session is being reused in - * the appropriate context. It is up to the application to set this, - * via SSL_new */ - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - -#ifndef OPENSSL_NO_KRB5 - unsigned int krb5_client_princ_len; - unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH]; -#endif /* OPENSSL_NO_KRB5 */ - - int not_resumable; - - /* The cert is the certificate used to establish this connection */ - struct sess_cert_st /* SESS_CERT */ *sess_cert; - - /* This is the cert for the other end. - * On clients, it will be the same as sess_cert->peer_key->x509 - * (the latter is not enough as sess_cert is not retained - * in the external representation of sessions, see ssl_asn1.c). */ - X509 *peer; - /* when app_verify_callback accepts a session where the peer's certificate - * is not ok, we must remember the error for session reuse: */ - long verify_result; /* only for servers */ - - int references; - long timeout; - long time; - - int compress_meth; /* Need to lookup the method */ - - SSL_CIPHER *cipher; - unsigned long cipher_id; /* when ASN.1 loaded, this - * needs to be used to load - * the 'cipher' structure */ - - STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */ - - CRYPTO_EX_DATA ex_data; /* application specific data */ - - /* These are used to make removal of session-ids more - * efficient and to implement a maximum cache size. */ - struct ssl_session_st *prev,*next; -#ifndef OPENSSL_NO_TLSEXT - char *tlsext_hostname; - /* RFC4507 info */ - unsigned char *tlsext_tick; /* Session ticket */ - size_t tlsext_ticklen; /* Session ticket length */ - long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */ -#endif - } SSL_SESSION; - - -#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L -#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L -#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L -#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x00000010L -#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L -#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */ -#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L -#define SSL_OP_TLS_D5_BUG 0x00000100L -#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L - -/* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added - * in OpenSSL 0.9.6d. Usually (depending on the application protocol) - * the workaround is not needed. Unfortunately some broken SSL/TLS - * implementations cannot handle it at all, which is why we include - * it in SSL_OP_ALL. */ -#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L /* added in 0.9.6e */ - -/* SSL_OP_ALL: various bug workarounds that should be rather harmless. - * This used to be 0x000FFFFFL before 0.9.7. */ -#define SSL_OP_ALL 0x00000FFFL - -/* DTLS options */ -#define SSL_OP_NO_QUERY_MTU 0x00001000L -/* Turn on Cookie Exchange (on relevant for servers) */ -#define SSL_OP_COOKIE_EXCHANGE 0x00002000L -/* Don't use RFC4507 ticket extension */ -#define SSL_OP_NO_TICKET 0x00004000L - -/* As server, disallow session resumption on renegotiation */ -#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L -/* If set, always create a new key when using tmp_ecdh parameters */ -#define SSL_OP_SINGLE_ECDH_USE 0x00080000L -/* If set, always create a new key when using tmp_dh parameters */ -#define SSL_OP_SINGLE_DH_USE 0x00100000L -/* Set to always use the tmp_rsa key when doing RSA operations, - * even when this violates protocol specs */ -#define SSL_OP_EPHEMERAL_RSA 0x00200000L -/* Set on servers to choose the cipher according to the server's - * preferences */ -#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L -/* If set, a server will allow a client to issue a SSLv3.0 version number - * as latest version supported in the premaster secret, even when TLSv1.0 - * (version 3.1) was announced in the client hello. Normally this is - * forbidden to prevent version rollback attacks. */ -#define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L - -#define SSL_OP_NO_SSLv2 0x01000000L -#define SSL_OP_NO_SSLv3 0x02000000L -#define SSL_OP_NO_TLSv1 0x04000000L - -/* The next flag deliberately changes the ciphertest, this is a check - * for the PKCS#1 attack */ -#define SSL_OP_PKCS1_CHECK_1 0x08000000L -#define SSL_OP_PKCS1_CHECK_2 0x10000000L -#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L -#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L - - -/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success - * when just a single record has been written): */ -#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L -/* Make it possible to retry SSL_write() with changed buffer location - * (buffer contents must stay the same!); this is not the default to avoid - * the misconception that non-blocking SSL_write() behaves like - * non-blocking write(): */ -#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L -/* Never bother the application with retries if the transport - * is blocking: */ -#define SSL_MODE_AUTO_RETRY 0x00000004L -/* Don't attempt to automatically build certificate chain */ -#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L - - -/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, - * they cannot be used to clear bits. */ - -#define SSL_CTX_set_options(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) -#define SSL_CTX_get_options(ctx) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL) -#define SSL_set_options(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL) -#define SSL_get_options(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL) - -#define SSL_CTX_set_mode(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) -#define SSL_CTX_get_mode(ctx) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) -#define SSL_set_mode(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) -#define SSL_get_mode(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) -#define SSL_set_mtu(ssl, mtu) \ - SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) - - -void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); -void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); -#define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) -#define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) - - - -#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) -#define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */ -#else -#define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */ -#endif - -#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) - -/* This callback type is used inside SSL_CTX, SSL, and in the functions that set - * them. It is used to override the generation of SSL/TLS session IDs in a - * server. Return value should be zero on an error, non-zero to proceed. Also, - * callbacks should themselves check if the id they generate is unique otherwise - * the SSL handshake will fail with an error - callbacks can do this using the - * 'ssl' value they're passed by; - * SSL_has_matching_session_id(ssl, id, *id_len) - * The length value passed in is set at the maximum size the session ID can be. - * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback - * can alter this length to be less if desired, but under SSLv2 session IDs are - * supposed to be fixed at 16 bytes so the id will be padded after the callback - * returns in this case. It is also an error for the callback to set the size to - * zero. */ -typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, - unsigned int *id_len); - -typedef struct ssl_comp_st - { - int id; - const char *name; -#ifndef OPENSSL_NO_COMP - COMP_METHOD *method; -#else - char *method; -#endif - } SSL_COMP; - -DECLARE_STACK_OF(SSL_COMP) - -struct ssl_ctx_st - { - SSL_METHOD *method; - - STACK_OF(SSL_CIPHER) *cipher_list; - /* same as above but sorted for lookup */ - STACK_OF(SSL_CIPHER) *cipher_list_by_id; - - struct x509_store_st /* X509_STORE */ *cert_store; - struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSIONs */ - /* Most session-ids that will be cached, default is - * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */ - unsigned long session_cache_size; - struct ssl_session_st *session_cache_head; - struct ssl_session_st *session_cache_tail; - - /* This can have one of 2 values, ored together, - * SSL_SESS_CACHE_CLIENT, - * SSL_SESS_CACHE_SERVER, - * Default is SSL_SESSION_CACHE_SERVER, which means only - * SSL_accept which cache SSL_SESSIONS. */ - int session_cache_mode; - - /* If timeout is not 0, it is the default timeout value set - * when SSL_new() is called. This has been put in to make - * life easier to set things up */ - long session_timeout; - - /* If this callback is not null, it will be called each - * time a session id is added to the cache. If this function - * returns 1, it means that the callback will do a - * SSL_SESSION_free() when it has finished using it. Otherwise, - * on 0, it means the callback has finished with it. - * If remove_session_cb is not null, it will be called when - * a session-id is removed from the cache. After the call, - * OpenSSL will SSL_SESSION_free() it. */ - int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess); - void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess); - SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, - unsigned char *data,int len,int *copy); - - struct - { - int sess_connect; /* SSL new conn - started */ - int sess_connect_renegotiate;/* SSL reneg - requested */ - int sess_connect_good; /* SSL new conne/reneg - finished */ - int sess_accept; /* SSL new accept - started */ - int sess_accept_renegotiate;/* SSL reneg - requested */ - int sess_accept_good; /* SSL accept/reneg - finished */ - int sess_miss; /* session lookup misses */ - int sess_timeout; /* reuse attempt on timeouted session */ - int sess_cache_full; /* session removed due to full cache */ - int sess_hit; /* session reuse actually done */ - int sess_cb_hit; /* session-id that was not - * in the cache was - * passed back via the callback. This - * indicates that the application is - * supplying session-id's from other - * processes - spooky :-) */ - } stats; - - int references; - - /* if defined, these override the X509_verify_cert() calls */ - int (*app_verify_callback)(X509_STORE_CTX *, void *); - void *app_verify_arg; - /* before OpenSSL 0.9.7, 'app_verify_arg' was ignored - * ('app_verify_callback' was called with just one argument) */ - - /* Default password callback. */ - pem_password_cb *default_passwd_callback; - - /* Default password callback user data. */ - void *default_passwd_callback_userdata; - - /* get client cert callback */ - int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey); - - /* cookie generate callback */ - int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, - unsigned int *cookie_len); - - /* verify cookie callback */ - int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, - unsigned int cookie_len); - - CRYPTO_EX_DATA ex_data; - - const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */ - const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */ - const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */ - - STACK_OF(X509) *extra_certs; - STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */ - - - /* Default values used when no per-SSL value is defined follow */ - - void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */ - - /* what we put in client cert requests */ - STACK_OF(X509_NAME) *client_CA; - - - /* Default values to use in SSL structures follow (these are copied by SSL_new) */ - - unsigned long options; - unsigned long mode; - long max_cert_list; - - struct cert_st /* CERT */ *cert; - int read_ahead; - - /* callback that allows applications to peek at protocol messages */ - void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - int verify_mode; - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */ - - /* Default generate session ID callback. */ - GEN_SESSION_CB generate_session_id; - - X509_VERIFY_PARAM *param; - -#if 0 - int purpose; /* Purpose setting */ - int trust; /* Trust setting */ -#endif - - int quiet_shutdown; - -#ifndef OPENSSL_ENGINE - /* Engine to pass requests for client certs to - */ - ENGINE *client_cert_engine; -#endif - -#ifndef OPENSSL_NO_TLSEXT - /* TLS extensions servername callback */ - int (*tlsext_servername_callback)(SSL*, int *, void *); - void *tlsext_servername_arg; - /* RFC 4507 session ticket keys */ - unsigned char tlsext_tick_key_name[16]; - unsigned char tlsext_tick_hmac_key[16]; - unsigned char tlsext_tick_aes_key[16]; - /* Callback to support customisation of ticket key setting */ - int (*tlsext_ticket_key_cb)(SSL *ssl, - unsigned char *name, unsigned char *iv, - EVP_CIPHER_CTX *ectx, - HMAC_CTX *hctx, int enc); - - /* certificate status request info */ - /* Callback for status request */ - int (*tlsext_status_cb)(SSL *ssl, void *arg); - void *tlsext_status_arg; -#endif - - }; - -#define SSL_SESS_CACHE_OFF 0x0000 -#define SSL_SESS_CACHE_CLIENT 0x0001 -#define SSL_SESS_CACHE_SERVER 0x0002 -#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER) -#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 -/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ -#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 -#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 -#define SSL_SESS_CACHE_NO_INTERNAL \ - (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE) - - struct lhash_st *SSL_CTX_sessions(SSL_CTX *ctx); -#define SSL_CTX_sess_number(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) -#define SSL_CTX_sess_connect(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) -#define SSL_CTX_sess_connect_good(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) -#define SSL_CTX_sess_connect_renegotiate(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) -#define SSL_CTX_sess_accept(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) -#define SSL_CTX_sess_accept_renegotiate(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) -#define SSL_CTX_sess_accept_good(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) -#define SSL_CTX_sess_hits(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) -#define SSL_CTX_sess_cb_hits(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) -#define SSL_CTX_sess_misses(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) -#define SSL_CTX_sess_timeouts(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) -#define SSL_CTX_sess_cache_full(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) - -void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess)); -int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, SSL_SESSION *sess); -void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess)); -void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, SSL_SESSION *sess); -void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, unsigned char *data,int len,int *copy)); -SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, unsigned char *Data, int len, int *copy); -void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(const SSL *ssl,int type,int val)); -void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl,int type,int val); -void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); -int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey); -#ifndef OPENSSL_NO_ENGINE -int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); -#endif -void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)); -void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)); - -#define SSL_NOTHING 1 -#define SSL_WRITING 2 -#define SSL_READING 3 -#define SSL_X509_LOOKUP 4 - -/* These will only be used when doing non-blocking IO */ -#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) -#define SSL_want_read(s) (SSL_want(s) == SSL_READING) -#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) -#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) - -struct ssl_st - { - /* protocol version - * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) - */ - int version; - int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ - - SSL_METHOD *method; /* SSLv3 */ - - /* There are 2 BIO's even though they are normally both the - * same. This is so data can be read and written to different - * handlers */ - -#ifndef OPENSSL_NO_BIO - BIO *rbio; /* used by SSL_read */ - BIO *wbio; /* used by SSL_write */ - BIO *bbio; /* used during session-id reuse to concatenate - * messages */ -#else - char *rbio; /* used by SSL_read */ - char *wbio; /* used by SSL_write */ - char *bbio; -#endif - /* This holds a variable that indicates what we were doing - * when a 0 or -1 is returned. This is needed for - * non-blocking IO so we know what request needs re-doing when - * in SSL_accept or SSL_connect */ - int rwstate; - - /* true when we are actually in SSL_accept() or SSL_connect() */ - int in_handshake; - int (*handshake_func)(SSL *); - - /* Imagine that here's a boolean member "init" that is - * switched as soon as SSL_set_{accept/connect}_state - * is called for the first time, so that "state" and - * "handshake_func" are properly initialized. But as - * handshake_func is == 0 until then, we use this - * test instead of an "init" member. - */ - - int server; /* are we the server side? - mostly used by SSL_clear*/ - - int new_session;/* 1 if we are to use a new session. - * 2 if we are a server and are inside a handshake - * (i.e. not just sending a HelloRequest) - * NB: For servers, the 'new' session may actually be a previously - * cached session or even the previous session unless - * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ - int quiet_shutdown;/* don't send shutdown packets */ - int shutdown; /* we have shut things down, 0x01 sent, 0x02 - * for received */ - int state; /* where we are */ - int rstate; /* where we are when reading */ - - BUF_MEM *init_buf; /* buffer used during init */ - void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ - int init_num; /* amount read/written */ - int init_off; /* amount read/written */ - - /* used internally to point at a raw packet */ - unsigned char *packet; - unsigned int packet_length; - - struct ssl2_state_st *s2; /* SSLv2 variables */ - struct ssl3_state_st *s3; /* SSLv3 variables */ - struct dtls1_state_st *d1; /* DTLSv1 variables */ - - int read_ahead; /* Read as many input bytes as possible - * (for non-blocking reads) */ - - /* callback that allows applications to peek at protocol messages */ - void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - int hit; /* reusing a previous session */ - - X509_VERIFY_PARAM *param; - -#if 0 - int purpose; /* Purpose setting */ - int trust; /* Trust setting */ -#endif - - /* crypto */ - STACK_OF(SSL_CIPHER) *cipher_list; - STACK_OF(SSL_CIPHER) *cipher_list_by_id; - - /* These are the ones being used, the ones in SSL_SESSION are - * the ones to be 'copied' into these ones */ - - EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ - const EVP_MD *read_hash; /* used for mac generation */ -#ifndef OPENSSL_NO_COMP - COMP_CTX *expand; /* uncompress */ -#else - char *expand; -#endif - - EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ - const EVP_MD *write_hash; /* used for mac generation */ -#ifndef OPENSSL_NO_COMP - COMP_CTX *compress; /* compression */ -#else - char *compress; -#endif - - /* session info */ - - /* client cert? */ - /* This is used to hold the server certificate used */ - struct cert_st /* CERT */ *cert; - - /* the session_id_context is used to ensure sessions are only reused - * in the appropriate context */ - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - /* This can also be in the session once a session is established */ - SSL_SESSION *session; - - /* Default generate session ID callback. */ - GEN_SESSION_CB generate_session_id; - - /* Used in SSL2 and SSL3 */ - int verify_mode; /* 0 don't care about verify failure. - * 1 fail if verify fails */ - int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */ - - void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */ - - int error; /* error bytes to be written */ - int error_code; /* actual code */ - -#ifndef OPENSSL_NO_KRB5 - KSSL_CTX *kssl_ctx; /* Kerberos 5 context */ -#endif /* OPENSSL_NO_KRB5 */ - - SSL_CTX *ctx; - /* set this flag to 1 and a sleep(1) is put into all SSL_read() - * and SSL_write() calls, good for nbio debuging :-) */ - int debug; - - /* extra application data */ - long verify_result; - CRYPTO_EX_DATA ex_data; - - /* for server side, keep the list of CA_dn we can use */ - STACK_OF(X509_NAME) *client_CA; - - int references; - unsigned long options; /* protocol behaviour */ - unsigned long mode; /* API behaviour */ - long max_cert_list; - int first_packet; - int client_version; /* what was passed, used for - * SSLv3/TLS rollback check */ -#ifndef OPENSSL_NO_TLSEXT - /* TLS extension debug callback */ - void (*tlsext_debug_cb)(SSL *s, int client_server, int type, - unsigned char *data, int len, - void *arg); - void *tlsext_debug_arg; - char *tlsext_hostname; - int servername_done; /* no further mod of servername - 0 : call the servername extension callback. - 1 : prepare 2, allow last ack just after in server callback. - 2 : don't call servername callback, no ack in server hello - */ - /* certificate status request info */ - /* Status type or -1 if no status type */ - int tlsext_status_type; - /* Expect OCSP CertificateStatus message */ - int tlsext_status_expected; - /* OCSP status request only */ - STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; - X509_EXTENSIONS *tlsext_ocsp_exts; - /* OCSP response received or to be sent */ - unsigned char *tlsext_ocsp_resp; - int tlsext_ocsp_resplen; - - /* RFC4507 session ticket expected to be received or sent */ - int tlsext_ticket_expected; - SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */ -#define session_ctx initial_ctx -#else -#define session_ctx ctx -#endif - }; - -#ifdef __cplusplus -} -#endif - -#include -#include -#include /* This is mostly sslv3 with a few tweaks */ -#include /* Datagram TLS */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* compatibility */ -#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) -#define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) -#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a)) -#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) -#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) -#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg)) - -/* The following are the possible values for ssl->state are are - * used to indicate where we are up to in the SSL connection establishment. - * The macros that follow are about the only things you should need to use - * and even then, only when using non-blocking IO. - * It can also be useful to work out where you were when the connection - * failed */ - -#define SSL_ST_CONNECT 0x1000 -#define SSL_ST_ACCEPT 0x2000 -#define SSL_ST_MASK 0x0FFF -#define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT) -#define SSL_ST_BEFORE 0x4000 -#define SSL_ST_OK 0x03 -#define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT) - -#define SSL_CB_LOOP 0x01 -#define SSL_CB_EXIT 0x02 -#define SSL_CB_READ 0x04 -#define SSL_CB_WRITE 0x08 -#define SSL_CB_ALERT 0x4000 /* used in callback */ -#define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ) -#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE) -#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP) -#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT) -#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP) -#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT) -#define SSL_CB_HANDSHAKE_START 0x10 -#define SSL_CB_HANDSHAKE_DONE 0x20 - -/* Is the SSL_connection established? */ -#define SSL_get_state(a) SSL_state(a) -#define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK) -#define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT) -#define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE) -#define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT) -#define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT) - -/* The following 2 states are kept in ssl->rstate when reads fail, - * you should not need these */ -#define SSL_ST_READ_HEADER 0xF0 -#define SSL_ST_READ_BODY 0xF1 -#define SSL_ST_READ_DONE 0xF2 - -/* Obtain latest Finished message - * -- that we sent (SSL_get_finished) - * -- that we expected from peer (SSL_get_peer_finished). - * Returns length (0 == no Finished so far), copies up to 'count' bytes. */ -size_t SSL_get_finished(const SSL *s, void *buf, size_t count); -size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); - -/* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options - * are 'ored' with SSL_VERIFY_PEER if they are desired */ -#define SSL_VERIFY_NONE 0x00 -#define SSL_VERIFY_PEER 0x01 -#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 -#define SSL_VERIFY_CLIENT_ONCE 0x04 - -#define OpenSSL_add_ssl_algorithms() SSL_library_init() -#define SSLeay_add_ssl_algorithms() SSL_library_init() - -/* this is for backward compatibility */ -#if 0 /* NEW_SSLEAY */ -#define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c) -#define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n) -#define SSL_add_session(a,b) SSL_CTX_add_session((a),(b)) -#define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b)) -#define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b)) -#endif -/* More backward compatibility */ -#define SSL_get_cipher(s) \ - SSL_CIPHER_get_name(SSL_get_current_cipher(s)) -#define SSL_get_cipher_bits(s,np) \ - SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) -#define SSL_get_cipher_version(s) \ - SSL_CIPHER_get_version(SSL_get_current_cipher(s)) -#define SSL_get_cipher_name(s) \ - SSL_CIPHER_get_name(SSL_get_current_cipher(s)) -#define SSL_get_time(a) SSL_SESSION_get_time(a) -#define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) -#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) -#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) - -#if 1 /*SSLEAY_MACROS*/ -#define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) -#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) -#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ - (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) -#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) PEM_ASN1_read_bio_of(SSL_SESSION,d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,cb,u) -#define PEM_write_SSL_SESSION(fp,x) \ - PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ - PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL) -#define PEM_write_bio_SSL_SESSION(bp,x) \ - PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL) -#endif - -#define SSL_AD_REASON_OFFSET 1000 -/* These alert types are for SSLv3 and TLSv1 */ -#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY -#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */ -#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC /* fatal */ -#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED -#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW -#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE/* fatal */ -#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE/* fatal */ -#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE /* Not for TLS */ -#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE -#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE -#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED -#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED -#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN -#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER /* fatal */ -#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA /* fatal */ -#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED /* fatal */ -#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR /* fatal */ -#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR -#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION/* fatal */ -#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION /* fatal */ -#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY/* fatal */ -#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR /* fatal */ -#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED -#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION -#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION -#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE -#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME -#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE - -#define SSL_ERROR_NONE 0 -#define SSL_ERROR_SSL 1 -#define SSL_ERROR_WANT_READ 2 -#define SSL_ERROR_WANT_WRITE 3 -#define SSL_ERROR_WANT_X509_LOOKUP 4 -#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ -#define SSL_ERROR_ZERO_RETURN 6 -#define SSL_ERROR_WANT_CONNECT 7 -#define SSL_ERROR_WANT_ACCEPT 8 - -#define SSL_CTRL_NEED_TMP_RSA 1 -#define SSL_CTRL_SET_TMP_RSA 2 -#define SSL_CTRL_SET_TMP_DH 3 -#define SSL_CTRL_SET_TMP_ECDH 4 -#define SSL_CTRL_SET_TMP_RSA_CB 5 -#define SSL_CTRL_SET_TMP_DH_CB 6 -#define SSL_CTRL_SET_TMP_ECDH_CB 7 - -#define SSL_CTRL_GET_SESSION_REUSED 8 -#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 -#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 -#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 -#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 -#define SSL_CTRL_GET_FLAGS 13 -#define SSL_CTRL_EXTRA_CHAIN_CERT 14 - -#define SSL_CTRL_SET_MSG_CALLBACK 15 -#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 - -/* only applies to datagram connections */ -#define SSL_CTRL_SET_MTU 17 -/* Stats */ -#define SSL_CTRL_SESS_NUMBER 20 -#define SSL_CTRL_SESS_CONNECT 21 -#define SSL_CTRL_SESS_CONNECT_GOOD 22 -#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 -#define SSL_CTRL_SESS_ACCEPT 24 -#define SSL_CTRL_SESS_ACCEPT_GOOD 25 -#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 -#define SSL_CTRL_SESS_HIT 27 -#define SSL_CTRL_SESS_CB_HIT 28 -#define SSL_CTRL_SESS_MISSES 29 -#define SSL_CTRL_SESS_TIMEOUTS 30 -#define SSL_CTRL_SESS_CACHE_FULL 31 -#define SSL_CTRL_OPTIONS 32 -#define SSL_CTRL_MODE 33 - -#define SSL_CTRL_GET_READ_AHEAD 40 -#define SSL_CTRL_SET_READ_AHEAD 41 -#define SSL_CTRL_SET_SESS_CACHE_SIZE 42 -#define SSL_CTRL_GET_SESS_CACHE_SIZE 43 -#define SSL_CTRL_SET_SESS_CACHE_MODE 44 -#define SSL_CTRL_GET_SESS_CACHE_MODE 45 - -#define SSL_CTRL_GET_MAX_CERT_LIST 50 -#define SSL_CTRL_SET_MAX_CERT_LIST 51 - -/* see tls1.h for macros based on these */ -#ifndef OPENSSL_NO_TLSEXT -#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53 -#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54 -#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55 -#define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56 -#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 -#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 -#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 - -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 -#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67 -#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68 -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69 -#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70 -#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 - -#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 -#endif - -#define SSL_session_reused(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) -#define SSL_num_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) -#define SSL_clear_num_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) -#define SSL_total_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) - -#define SSL_CTX_need_tmp_RSA(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL) -#define SSL_CTX_set_tmp_rsa(ctx,rsa) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) -#define SSL_CTX_set_tmp_dh(ctx,dh) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) -#define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) - -#define SSL_need_tmp_RSA(ssl) \ - SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL) -#define SSL_set_tmp_rsa(ssl,rsa) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) -#define SSL_set_tmp_dh(ssl,dh) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh) -#define SSL_set_tmp_ecdh(ssl,ecdh) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) - -#define SSL_CTX_add_extra_chain_cert(ctx,x509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) - -#ifndef OPENSSL_NO_BIO -BIO_METHOD *BIO_f_ssl(void); -BIO *BIO_new_ssl(SSL_CTX *ctx,int client); -BIO *BIO_new_ssl_connect(SSL_CTX *ctx); -BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); -int BIO_ssl_copy_session_id(BIO *to,BIO *from); -void BIO_ssl_shutdown(BIO *ssl_bio); - -#endif - -int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str); -SSL_CTX *SSL_CTX_new(SSL_METHOD *meth); -void SSL_CTX_free(SSL_CTX *); -long SSL_CTX_set_timeout(SSL_CTX *ctx,long t); -long SSL_CTX_get_timeout(const SSL_CTX *ctx); -X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); -void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *); -int SSL_want(const SSL *s); -int SSL_clear(SSL *s); - -void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm); - -SSL_CIPHER *SSL_get_current_cipher(const SSL *s); -int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits); -char * SSL_CIPHER_get_version(const SSL_CIPHER *c); -const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); - -int SSL_get_fd(const SSL *s); -int SSL_get_rfd(const SSL *s); -int SSL_get_wfd(const SSL *s); -const char * SSL_get_cipher_list(const SSL *s,int n); -char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len); -int SSL_get_read_ahead(const SSL * s); -int SSL_pending(const SSL *s); -#ifndef OPENSSL_NO_SOCK -int SSL_set_fd(SSL *s, int fd); -int SSL_set_rfd(SSL *s, int fd); -int SSL_set_wfd(SSL *s, int fd); -#endif -#ifndef OPENSSL_NO_BIO -void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio); -BIO * SSL_get_rbio(const SSL *s); -BIO * SSL_get_wbio(const SSL *s); -#endif -int SSL_set_cipher_list(SSL *s, const char *str); -void SSL_set_read_ahead(SSL *s, int yes); -int SSL_get_verify_mode(const SSL *s); -int SSL_get_verify_depth(const SSL *s); -int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback)(int ok,X509_STORE_CTX *ctx)); -void SSL_set_verify_depth(SSL *s, int depth); -#ifndef OPENSSL_NO_RSA -int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); -#endif -int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); -int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); -int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len); -int SSL_use_certificate(SSL *ssl, X509 *x); -int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); - -#ifndef OPENSSL_NO_STDIO -int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); -int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); -int SSL_use_certificate_file(SSL *ssl, const char *file, int type); -int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); -int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); -int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); -int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */ -STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); -int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, - const char *file); -#ifndef OPENSSL_SYS_VMS -#ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */ -int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, - const char *dir); -#endif -#endif - -#endif - -void SSL_load_error_strings(void ); -const char *SSL_state_string(const SSL *s); -const char *SSL_rstate_string(const SSL *s); -const char *SSL_state_string_long(const SSL *s); -const char *SSL_rstate_string_long(const SSL *s); -long SSL_SESSION_get_time(const SSL_SESSION *s); -long SSL_SESSION_set_time(SSL_SESSION *s, long t); -long SSL_SESSION_get_timeout(const SSL_SESSION *s); -long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); -void SSL_copy_session_id(SSL *to,const SSL *from); - -SSL_SESSION *SSL_SESSION_new(void); -unsigned long SSL_SESSION_hash(const SSL_SESSION *a); -int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b); -const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len); -#ifndef OPENSSL_NO_FP_API -int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses); -#endif -#ifndef OPENSSL_NO_BIO -int SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses); -#endif -void SSL_SESSION_free(SSL_SESSION *ses); -int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp); -int SSL_set_session(SSL *to, SSL_SESSION *session); -int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); -int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c); -int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); -int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); -int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, - unsigned int id_len); -SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp, - long length); - -#ifdef HEADER_X509_H -X509 * SSL_get_peer_certificate(const SSL *s); -#endif - -STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); - -int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); -int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int,X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx,int mode, - int (*callback)(int, X509_STORE_CTX *)); -void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth); -void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *,void *), void *arg); -#ifndef OPENSSL_NO_RSA -int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); -#endif -int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); -int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); -int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx, - const unsigned char *d, long len); -int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); -int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); - -void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); -void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); - -int SSL_CTX_check_private_key(const SSL_CTX *ctx); -int SSL_check_private_key(const SSL *ctx); - -int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx, - unsigned int sid_ctx_len); - -SSL * SSL_new(SSL_CTX *ctx); -int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx, - unsigned int sid_ctx_len); - -int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); -int SSL_set_purpose(SSL *s, int purpose); -int SSL_CTX_set_trust(SSL_CTX *s, int trust); -int SSL_set_trust(SSL *s, int trust); - -void SSL_free(SSL *ssl); -int SSL_accept(SSL *ssl); -int SSL_connect(SSL *ssl); -int SSL_read(SSL *ssl,void *buf,int num); -int SSL_peek(SSL *ssl,void *buf,int num); -int SSL_write(SSL *ssl,const void *buf,int num); -long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg); -long SSL_callback_ctrl(SSL *, int, void (*)(void)); -long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); -long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); - -int SSL_get_error(const SSL *s,int ret_code); -const char *SSL_get_version(const SSL *s); - -/* This sets the 'default' SSL version that SSL_new() will create */ -int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth); - -SSL_METHOD *SSLv2_method(void); /* SSLv2 */ -SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ -SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ - -SSL_METHOD *SSLv3_method(void); /* SSLv3 */ -SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */ -SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */ - -SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */ -SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */ -SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */ - -SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ -SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ -SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ - -SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ -SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ -SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ - -STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); - -int SSL_do_handshake(SSL *s); -int SSL_renegotiate(SSL *s); -int SSL_renegotiate_pending(SSL *s); -int SSL_shutdown(SSL *s); - -SSL_METHOD *SSL_get_ssl_method(SSL *s); -int SSL_set_ssl_method(SSL *s,SSL_METHOD *method); -const char *SSL_alert_type_string_long(int value); -const char *SSL_alert_type_string(int value); -const char *SSL_alert_desc_string_long(int value); -const char *SSL_alert_desc_string(int value); - -void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); -void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); -STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); -STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); -int SSL_add_client_CA(SSL *ssl,X509 *x); -int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x); - -void SSL_set_connect_state(SSL *s); -void SSL_set_accept_state(SSL *s); - -long SSL_get_default_timeout(const SSL *s); - -int SSL_library_init(void ); - -char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); -STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); - -SSL *SSL_dup(SSL *ssl); - -X509 *SSL_get_certificate(const SSL *ssl); -/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl); - -void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode); -int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); -void SSL_set_quiet_shutdown(SSL *ssl,int mode); -int SSL_get_quiet_shutdown(const SSL *ssl); -void SSL_set_shutdown(SSL *ssl,int mode); -int SSL_get_shutdown(const SSL *ssl); -int SSL_version(const SSL *ssl); -int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); -int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, - const char *CApath); -#define SSL_get0_session SSL_get_session /* just peek at pointer */ -SSL_SESSION *SSL_get_session(const SSL *ssl); -SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ -SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); -SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx); -void SSL_set_info_callback(SSL *ssl, - void (*cb)(const SSL *ssl,int type,int val)); -void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val); -int SSL_state(const SSL *ssl); - -void SSL_set_verify_result(SSL *ssl,long v); -long SSL_get_verify_result(const SSL *ssl); - -int SSL_set_ex_data(SSL *ssl,int idx,void *data); -void *SSL_get_ex_data(const SSL *ssl,int idx); -int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); - -int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data); -void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss,int idx); -int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); - -int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data); -void *SSL_CTX_get_ex_data(const SSL_CTX *ssl,int idx); -int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); - -int SSL_get_ex_data_X509_STORE_CTX_idx(void ); - -#define SSL_CTX_sess_set_cache_size(ctx,t) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) -#define SSL_CTX_sess_get_cache_size(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) -#define SSL_CTX_set_session_cache_mode(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) -#define SSL_CTX_get_session_cache_mode(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) - -#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) -#define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) -#define SSL_CTX_get_read_ahead(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) -#define SSL_CTX_set_read_ahead(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) -#define SSL_CTX_get_max_cert_list(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) -#define SSL_CTX_set_max_cert_list(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) -#define SSL_get_max_cert_list(ssl) \ - SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) -#define SSL_set_max_cert_list(ssl,m) \ - SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) - - /* NB: the keylength is only applicable when is_export is true */ -#ifndef OPENSSL_NO_RSA -void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, - RSA *(*cb)(SSL *ssl,int is_export, - int keylength)); - -void SSL_set_tmp_rsa_callback(SSL *ssl, - RSA *(*cb)(SSL *ssl,int is_export, - int keylength)); -#endif -#ifndef OPENSSL_NO_DH -void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, - DH *(*dh)(SSL *ssl,int is_export, - int keylength)); -void SSL_set_tmp_dh_callback(SSL *ssl, - DH *(*dh)(SSL *ssl,int is_export, - int keylength)); -#endif -#ifndef OPENSSL_NO_ECDH -void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, - EC_KEY *(*ecdh)(SSL *ssl,int is_export, - int keylength)); -void SSL_set_tmp_ecdh_callback(SSL *ssl, - EC_KEY *(*ecdh)(SSL *ssl,int is_export, - int keylength)); -#endif - -#ifndef OPENSSL_NO_COMP -const COMP_METHOD *SSL_get_current_compression(SSL *s); -const COMP_METHOD *SSL_get_current_expansion(SSL *s); -const char *SSL_COMP_get_name(const COMP_METHOD *comp); -STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); -int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm); -#else -const void *SSL_get_current_compression(SSL *s); -const void *SSL_get_current_expansion(SSL *s); -const char *SSL_COMP_get_name(const void *comp); -void *SSL_COMP_get_compression_methods(void); -int SSL_COMP_add_compression_method(int id,void *cm); -#endif - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_SSL_strings(void); - -/* Error codes for the SSL functions. */ - -/* Function codes. */ -#define SSL_F_CLIENT_CERTIFICATE 100 -#define SSL_F_CLIENT_FINISHED 167 -#define SSL_F_CLIENT_HELLO 101 -#define SSL_F_CLIENT_MASTER_KEY 102 -#define SSL_F_D2I_SSL_SESSION 103 -#define SSL_F_DO_DTLS1_WRITE 245 -#define SSL_F_DO_SSL3_WRITE 104 -#define SSL_F_DTLS1_ACCEPT 246 -#define SSL_F_DTLS1_BUFFER_RECORD 247 -#define SSL_F_DTLS1_CLIENT_HELLO 248 -#define SSL_F_DTLS1_CONNECT 249 -#define SSL_F_DTLS1_ENC 250 -#define SSL_F_DTLS1_GET_HELLO_VERIFY 251 -#define SSL_F_DTLS1_GET_MESSAGE 252 -#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 -#define SSL_F_DTLS1_GET_RECORD 254 -#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 -#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 277 -#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 -#define SSL_F_DTLS1_PROCESS_RECORD 257 -#define SSL_F_DTLS1_READ_BYTES 258 -#define SSL_F_DTLS1_READ_FAILED 259 -#define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260 -#define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261 -#define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262 -#define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263 -#define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264 -#define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265 -#define SSL_F_DTLS1_SEND_SERVER_HELLO 266 -#define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267 -#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268 -#define SSL_F_GET_CLIENT_FINISHED 105 -#define SSL_F_GET_CLIENT_HELLO 106 -#define SSL_F_GET_CLIENT_MASTER_KEY 107 -#define SSL_F_GET_SERVER_FINISHED 108 -#define SSL_F_GET_SERVER_HELLO 109 -#define SSL_F_GET_SERVER_VERIFY 110 -#define SSL_F_I2D_SSL_SESSION 111 -#define SSL_F_READ_N 112 -#define SSL_F_REQUEST_CERTIFICATE 113 -#define SSL_F_SERVER_FINISH 239 -#define SSL_F_SERVER_HELLO 114 -#define SSL_F_SERVER_VERIFY 240 -#define SSL_F_SSL23_ACCEPT 115 -#define SSL_F_SSL23_CLIENT_HELLO 116 -#define SSL_F_SSL23_CONNECT 117 -#define SSL_F_SSL23_GET_CLIENT_HELLO 118 -#define SSL_F_SSL23_GET_SERVER_HELLO 119 -#define SSL_F_SSL23_PEEK 237 -#define SSL_F_SSL23_READ 120 -#define SSL_F_SSL23_WRITE 121 -#define SSL_F_SSL2_ACCEPT 122 -#define SSL_F_SSL2_CONNECT 123 -#define SSL_F_SSL2_ENC_INIT 124 -#define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241 -#define SSL_F_SSL2_PEEK 234 -#define SSL_F_SSL2_READ 125 -#define SSL_F_SSL2_READ_INTERNAL 236 -#define SSL_F_SSL2_SET_CERTIFICATE 126 -#define SSL_F_SSL2_WRITE 127 -#define SSL_F_SSL3_ACCEPT 128 -#define SSL_F_SSL3_CALLBACK_CTRL 233 -#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129 -#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 -#define SSL_F_SSL3_CLIENT_HELLO 131 -#define SSL_F_SSL3_CONNECT 132 -#define SSL_F_SSL3_CTRL 213 -#define SSL_F_SSL3_CTX_CTRL 133 -#define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 279 -#define SSL_F_SSL3_ENC 134 -#define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 -#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 -#define SSL_F_SSL3_GET_CERT_STATUS 288 -#define SSL_F_SSL3_GET_CERT_VERIFY 136 -#define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 -#define SSL_F_SSL3_GET_CLIENT_HELLO 138 -#define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 -#define SSL_F_SSL3_GET_FINISHED 140 -#define SSL_F_SSL3_GET_KEY_EXCHANGE 141 -#define SSL_F_SSL3_GET_MESSAGE 142 -#define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 -#define SSL_F_SSL3_GET_RECORD 143 -#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 -#define SSL_F_SSL3_GET_SERVER_DONE 145 -#define SSL_F_SSL3_GET_SERVER_HELLO 146 -#define SSL_F_SSL3_NEW_SESSION_TICKET 284 -#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147 -#define SSL_F_SSL3_PEEK 235 -#define SSL_F_SSL3_READ_BYTES 148 -#define SSL_F_SSL3_READ_N 149 -#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150 -#define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151 -#define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152 -#define SSL_F_SSL3_SEND_CLIENT_VERIFY 153 -#define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154 -#define SSL_F_SSL3_SEND_SERVER_HELLO 242 -#define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155 -#define SSL_F_SSL3_SETUP_BUFFERS 156 -#define SSL_F_SSL3_SETUP_KEY_BLOCK 157 -#define SSL_F_SSL3_WRITE_BYTES 158 -#define SSL_F_SSL3_WRITE_PENDING 159 -#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 272 -#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 -#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 -#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 273 -#define SSL_F_SSL_BAD_METHOD 160 -#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 -#define SSL_F_SSL_CERT_DUP 221 -#define SSL_F_SSL_CERT_INST 222 -#define SSL_F_SSL_CERT_INSTANTIATE 214 -#define SSL_F_SSL_CERT_NEW 162 -#define SSL_F_SSL_CHECK_PRIVATE_KEY 163 -#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 274 -#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230 -#define SSL_F_SSL_CIPHER_STRENGTH_SORT 231 -#define SSL_F_SSL_CLEAR 164 -#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165 -#define SSL_F_SSL_CREATE_CIPHER_LIST 166 -#define SSL_F_SSL_CTRL 232 -#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 -#define SSL_F_SSL_CTX_NEW 169 -#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 -#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 278 -#define SSL_F_SSL_CTX_SET_PURPOSE 226 -#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219 -#define SSL_F_SSL_CTX_SET_SSL_VERSION 170 -#define SSL_F_SSL_CTX_SET_TRUST 229 -#define SSL_F_SSL_CTX_USE_CERTIFICATE 171 -#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 -#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220 -#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 -#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 -#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 -#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176 -#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177 -#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178 -#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179 -#define SSL_F_SSL_DO_HANDSHAKE 180 -#define SSL_F_SSL_GET_NEW_SESSION 181 -#define SSL_F_SSL_GET_PREV_SESSION 217 -#define SSL_F_SSL_GET_SERVER_SEND_CERT 182 -#define SSL_F_SSL_GET_SIGN_PKEY 183 -#define SSL_F_SSL_INIT_WBIO_BUFFER 184 -#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 -#define SSL_F_SSL_NEW 186 -#define SSL_F_SSL_PEEK 270 -#define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 275 -#define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 276 -#define SSL_F_SSL_READ 223 -#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187 -#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 -#define SSL_F_SSL_SESSION_NEW 189 -#define SSL_F_SSL_SESSION_PRINT_FP 190 -#define SSL_F_SSL_SESS_CERT_NEW 225 -#define SSL_F_SSL_SET_CERT 191 -#define SSL_F_SSL_SET_CIPHER_LIST 271 -#define SSL_F_SSL_SET_FD 192 -#define SSL_F_SSL_SET_PKEY 193 -#define SSL_F_SSL_SET_PURPOSE 227 -#define SSL_F_SSL_SET_RFD 194 -#define SSL_F_SSL_SET_SESSION 195 -#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218 -#define SSL_F_SSL_SET_TRUST 228 -#define SSL_F_SSL_SET_WFD 196 -#define SSL_F_SSL_SHUTDOWN 224 -#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 -#define SSL_F_SSL_UNDEFINED_FUNCTION 197 -#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 -#define SSL_F_SSL_USE_CERTIFICATE 198 -#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199 -#define SSL_F_SSL_USE_CERTIFICATE_FILE 200 -#define SSL_F_SSL_USE_PRIVATEKEY 201 -#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202 -#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203 -#define SSL_F_SSL_USE_RSAPRIVATEKEY 204 -#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205 -#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206 -#define SSL_F_SSL_VERIFY_CERT_CHAIN 207 -#define SSL_F_SSL_WRITE 208 -#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 -#define SSL_F_TLS1_ENC 210 -#define SSL_F_TLS1_SETUP_KEY_BLOCK 211 -#define SSL_F_WRITE_PENDING 212 - -/* Reason codes. */ -#define SSL_R_APP_DATA_IN_HANDSHAKE 100 -#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 -#define SSL_R_BAD_ALERT_RECORD 101 -#define SSL_R_BAD_AUTHENTICATION_TYPE 102 -#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 -#define SSL_R_BAD_CHECKSUM 104 -#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 -#define SSL_R_BAD_DECOMPRESSION 107 -#define SSL_R_BAD_DH_G_LENGTH 108 -#define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 -#define SSL_R_BAD_DH_P_LENGTH 110 -#define SSL_R_BAD_DIGEST_LENGTH 111 -#define SSL_R_BAD_DSA_SIGNATURE 112 -#define SSL_R_BAD_ECC_CERT 304 -#define SSL_R_BAD_ECDSA_SIGNATURE 305 -#define SSL_R_BAD_ECPOINT 306 -#define SSL_R_BAD_HELLO_REQUEST 105 -#define SSL_R_BAD_LENGTH 271 -#define SSL_R_BAD_MAC_DECODE 113 -#define SSL_R_BAD_MESSAGE_TYPE 114 -#define SSL_R_BAD_PACKET_LENGTH 115 -#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 -#define SSL_R_BAD_RESPONSE_ARGUMENT 117 -#define SSL_R_BAD_RSA_DECRYPT 118 -#define SSL_R_BAD_RSA_ENCRYPT 119 -#define SSL_R_BAD_RSA_E_LENGTH 120 -#define SSL_R_BAD_RSA_MODULUS_LENGTH 121 -#define SSL_R_BAD_RSA_SIGNATURE 122 -#define SSL_R_BAD_SIGNATURE 123 -#define SSL_R_BAD_SSL_FILETYPE 124 -#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 -#define SSL_R_BAD_STATE 126 -#define SSL_R_BAD_WRITE_RETRY 127 -#define SSL_R_BIO_NOT_SET 128 -#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 -#define SSL_R_BN_LIB 130 -#define SSL_R_CA_DN_LENGTH_MISMATCH 131 -#define SSL_R_CA_DN_TOO_LONG 132 -#define SSL_R_CCS_RECEIVED_EARLY 133 -#define SSL_R_CERTIFICATE_VERIFY_FAILED 134 -#define SSL_R_CERT_LENGTH_MISMATCH 135 -#define SSL_R_CHALLENGE_IS_DIFFERENT 136 -#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 -#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 -#define SSL_R_CIPHER_TABLE_SRC_ERROR 139 -#define SSL_R_CLIENTHELLO_TLSEXT 157 -#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 -#define SSL_R_COMPRESSION_FAILURE 141 -#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307 -#define SSL_R_COMPRESSION_LIBRARY_ERROR 142 -#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143 -#define SSL_R_CONNECTION_TYPE_NOT_SET 144 -#define SSL_R_COOKIE_MISMATCH 308 -#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 -#define SSL_R_DATA_LENGTH_TOO_LONG 146 -#define SSL_R_DECRYPTION_FAILED 147 -#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281 -#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 -#define SSL_R_DIGEST_CHECK_FAILED 149 -#define SSL_R_DUPLICATE_COMPRESSION_ID 309 -#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 -#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 -#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 -#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 -#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 -#define SSL_R_EXTRA_DATA_IN_MESSAGE 153 -#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 -#define SSL_R_HTTPS_PROXY_REQUEST 155 -#define SSL_R_HTTP_REQUEST 156 -#define SSL_R_ILLEGAL_PADDING 283 -#define SSL_R_INVALID_CHALLENGE_LENGTH 158 -#define SSL_R_INVALID_COMMAND 280 -#define SSL_R_INVALID_PURPOSE 278 -#define SSL_R_INVALID_STATUS_RESPONSE 316 -#define SSL_R_INVALID_TICKET_KEYS_LENGTH 275 -#define SSL_R_INVALID_TRUST 279 -#define SSL_R_KEY_ARG_TOO_LONG 284 -#define SSL_R_KRB5 285 -#define SSL_R_KRB5_C_CC_PRINC 286 -#define SSL_R_KRB5_C_GET_CRED 287 -#define SSL_R_KRB5_C_INIT 288 -#define SSL_R_KRB5_C_MK_REQ 289 -#define SSL_R_KRB5_S_BAD_TICKET 290 -#define SSL_R_KRB5_S_INIT 291 -#define SSL_R_KRB5_S_RD_REQ 292 -#define SSL_R_KRB5_S_TKT_EXPIRED 293 -#define SSL_R_KRB5_S_TKT_NYV 294 -#define SSL_R_KRB5_S_TKT_SKEW 295 -#define SSL_R_LENGTH_MISMATCH 159 -#define SSL_R_LENGTH_TOO_SHORT 160 -#define SSL_R_LIBRARY_BUG 274 -#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 -#define SSL_R_MESSAGE_TOO_LONG 296 -#define SSL_R_MISSING_DH_DSA_CERT 162 -#define SSL_R_MISSING_DH_KEY 163 -#define SSL_R_MISSING_DH_RSA_CERT 164 -#define SSL_R_MISSING_DSA_SIGNING_CERT 165 -#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166 -#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167 -#define SSL_R_MISSING_RSA_CERTIFICATE 168 -#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 -#define SSL_R_MISSING_RSA_SIGNING_CERT 170 -#define SSL_R_MISSING_TMP_DH_KEY 171 -#define SSL_R_MISSING_TMP_ECDH_KEY 311 -#define SSL_R_MISSING_TMP_RSA_KEY 172 -#define SSL_R_MISSING_TMP_RSA_PKEY 173 -#define SSL_R_MISSING_VERIFY_MESSAGE 174 -#define SSL_R_NON_SSLV2_INITIAL_PACKET 175 -#define SSL_R_NO_CERTIFICATES_RETURNED 176 -#define SSL_R_NO_CERTIFICATE_ASSIGNED 177 -#define SSL_R_NO_CERTIFICATE_RETURNED 178 -#define SSL_R_NO_CERTIFICATE_SET 179 -#define SSL_R_NO_CERTIFICATE_SPECIFIED 180 -#define SSL_R_NO_CIPHERS_AVAILABLE 181 -#define SSL_R_NO_CIPHERS_PASSED 182 -#define SSL_R_NO_CIPHERS_SPECIFIED 183 -#define SSL_R_NO_CIPHER_LIST 184 -#define SSL_R_NO_CIPHER_MATCH 185 -#define SSL_R_NO_CLIENT_CERT_METHOD 317 -#define SSL_R_NO_CLIENT_CERT_RECEIVED 186 -#define SSL_R_NO_COMPRESSION_SPECIFIED 187 -#define SSL_R_NO_METHOD_SPECIFIED 188 -#define SSL_R_NO_PRIVATEKEY 189 -#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 -#define SSL_R_NO_PROTOCOLS_AVAILABLE 191 -#define SSL_R_NO_PUBLICKEY 192 -#define SSL_R_NO_SHARED_CIPHER 193 -#define SSL_R_NO_VERIFY_CALLBACK 194 -#define SSL_R_NULL_SSL_CTX 195 -#define SSL_R_NULL_SSL_METHOD_PASSED 196 -#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 -#define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297 -#define SSL_R_PACKET_LENGTH_TOO_LONG 198 -#define SSL_R_PARSE_TLSEXT 223 -#define SSL_R_PATH_TOO_LONG 270 -#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 -#define SSL_R_PEER_ERROR 200 -#define SSL_R_PEER_ERROR_CERTIFICATE 201 -#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202 -#define SSL_R_PEER_ERROR_NO_CIPHER 203 -#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204 -#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205 -#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206 -#define SSL_R_PROTOCOL_IS_SHUTDOWN 207 -#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208 -#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209 -#define SSL_R_PUBLIC_KEY_NOT_RSA 210 -#define SSL_R_READ_BIO_NOT_SET 211 -#define SSL_R_READ_TIMEOUT_EXPIRED 312 -#define SSL_R_READ_WRONG_PACKET_TYPE 212 -#define SSL_R_RECORD_LENGTH_MISMATCH 213 -#define SSL_R_RECORD_TOO_LARGE 214 -#define SSL_R_RECORD_TOO_SMALL 298 -#define SSL_R_REQUIRED_CIPHER_MISSING 215 -#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216 -#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217 -#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218 -#define SSL_R_SERVERHELLO_TLSEXT 224 -#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 -#define SSL_R_SHORT_READ 219 -#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 -#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 -#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 -#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 225 -#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 226 -#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300 -#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222 -#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 -#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 -#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 -#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 -#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 -#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 -#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 -#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 -#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 -#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 -#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 -#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 -#define SSL_R_SSL_HANDSHAKE_FAILURE 229 -#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 -#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301 -#define SSL_R_SSL_SESSION_ID_CONFLICT 302 -#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 -#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 -#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 -#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 -#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 -#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 -#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 -#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 -#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 -#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 -#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 -#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 -#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 -#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 -#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 -#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 -#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 227 -#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 -#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 -#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 -#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 -#define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 -#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237 -#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238 -#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314 -#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 -#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240 -#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241 -#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 -#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 -#define SSL_R_UNEXPECTED_MESSAGE 244 -#define SSL_R_UNEXPECTED_RECORD 245 -#define SSL_R_UNINITIALIZED 276 -#define SSL_R_UNKNOWN_ALERT_TYPE 246 -#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 -#define SSL_R_UNKNOWN_CIPHER_RETURNED 248 -#define SSL_R_UNKNOWN_CIPHER_TYPE 249 -#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 -#define SSL_R_UNKNOWN_PKEY_TYPE 251 -#define SSL_R_UNKNOWN_PROTOCOL 252 -#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 -#define SSL_R_UNKNOWN_SSL_VERSION 254 -#define SSL_R_UNKNOWN_STATE 255 -#define SSL_R_UNSUPPORTED_CIPHER 256 -#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 -#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315 -#define SSL_R_UNSUPPORTED_PROTOCOL 258 -#define SSL_R_UNSUPPORTED_SSL_VERSION 259 -#define SSL_R_UNSUPPORTED_STATUS_TYPE 329 -#define SSL_R_WRITE_BIO_NOT_SET 260 -#define SSL_R_WRONG_CIPHER_RETURNED 261 -#define SSL_R_WRONG_MESSAGE_TYPE 262 -#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 -#define SSL_R_WRONG_SIGNATURE_LENGTH 264 -#define SSL_R_WRONG_SIGNATURE_SIZE 265 -#define SSL_R_WRONG_SSL_VERSION 266 -#define SSL_R_WRONG_VERSION_NUMBER 267 -#define SSL_R_X509_LIB 268 -#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/ssl2.h b/dep/include/openssl/ssl2.h deleted file mode 100644 index 52c166e8c5b..00000000000 --- a/dep/include/openssl/ssl2.h +++ /dev/null @@ -1,269 +0,0 @@ -/* ssl/ssl2.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SSL2_H -#define HEADER_SSL2_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Protocol Version Codes */ -#define SSL2_VERSION 0x0002 -#define SSL2_VERSION_MAJOR 0x00 -#define SSL2_VERSION_MINOR 0x02 -/* #define SSL2_CLIENT_VERSION 0x0002 */ -/* #define SSL2_SERVER_VERSION 0x0002 */ - -/* Protocol Message Codes */ -#define SSL2_MT_ERROR 0 -#define SSL2_MT_CLIENT_HELLO 1 -#define SSL2_MT_CLIENT_MASTER_KEY 2 -#define SSL2_MT_CLIENT_FINISHED 3 -#define SSL2_MT_SERVER_HELLO 4 -#define SSL2_MT_SERVER_VERIFY 5 -#define SSL2_MT_SERVER_FINISHED 6 -#define SSL2_MT_REQUEST_CERTIFICATE 7 -#define SSL2_MT_CLIENT_CERTIFICATE 8 - -/* Error Message Codes */ -#define SSL2_PE_UNDEFINED_ERROR 0x0000 -#define SSL2_PE_NO_CIPHER 0x0001 -#define SSL2_PE_NO_CERTIFICATE 0x0002 -#define SSL2_PE_BAD_CERTIFICATE 0x0004 -#define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 - -/* Cipher Kind Values */ -#define SSL2_CK_NULL_WITH_MD5 0x02000000 /* v3 */ -#define SSL2_CK_RC4_128_WITH_MD5 0x02010080 -#define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080 -#define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080 -#define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080 -#define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080 -#define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040 -#define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140 /* v3 */ -#define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0 -#define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0 /* v3 */ -#define SSL2_CK_RC4_64_WITH_MD5 0x02080080 /* MS hack */ - -#define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800 /* SSLeay */ -#define SSL2_CK_NULL 0x02ff0810 /* SSLeay */ - -#define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1" -#define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5" -#define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5" -#define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5" -#define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5" -#define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5" -#define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5" -#define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5" -#define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA" -#define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5" -#define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA" -#define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5" - -#define SSL2_TXT_NULL "NULL" - -/* Flags for the SSL_CIPHER.algorithm2 field */ -#define SSL2_CF_5_BYTE_ENC 0x01 -#define SSL2_CF_8_BYTE_ENC 0x02 - -/* Certificate Type Codes */ -#define SSL2_CT_X509_CERTIFICATE 0x01 - -/* Authentication Type Code */ -#define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01 - -#define SSL2_MAX_SSL_SESSION_ID_LENGTH 32 - -/* Upper/Lower Bounds */ -#define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256 -#ifdef OPENSSL_SYS_MPE -#define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u -#else -#define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u /* 2^15-1 */ -#endif -#define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383 /* 2^14-1 */ - -#define SSL2_CHALLENGE_LENGTH 16 -/*#define SSL2_CHALLENGE_LENGTH 32 */ -#define SSL2_MIN_CHALLENGE_LENGTH 16 -#define SSL2_MAX_CHALLENGE_LENGTH 32 -#define SSL2_CONNECTION_ID_LENGTH 16 -#define SSL2_MAX_CONNECTION_ID_LENGTH 16 -#define SSL2_SSL_SESSION_ID_LENGTH 16 -#define SSL2_MAX_CERT_CHALLENGE_LENGTH 32 -#define SSL2_MIN_CERT_CHALLENGE_LENGTH 16 -#define SSL2_MAX_KEY_MATERIAL_LENGTH 24 - -#ifndef HEADER_SSL_LOCL_H -#define CERT char -#endif - -typedef struct ssl2_state_st - { - int three_byte_header; - int clear_text; /* clear text */ - int escape; /* not used in SSLv2 */ - int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */ - - /* non-blocking io info, used to make sure the same - * args were passwd */ - unsigned int wnum; /* number of bytes sent so far */ - int wpend_tot; - const unsigned char *wpend_buf; - - int wpend_off; /* offset to data to write */ - int wpend_len; /* number of bytes passwd to write */ - int wpend_ret; /* number of bytes to return to caller */ - - /* buffer raw data */ - int rbuf_left; - int rbuf_offs; - unsigned char *rbuf; - unsigned char *wbuf; - - unsigned char *write_ptr;/* used to point to the start due to - * 2/3 byte header. */ - - unsigned int padding; - unsigned int rlength; /* passed to ssl2_enc */ - int ract_data_length; /* Set when things are encrypted. */ - unsigned int wlength; /* passed to ssl2_enc */ - int wact_data_length; /* Set when things are decrypted. */ - unsigned char *ract_data; - unsigned char *wact_data; - unsigned char *mac_data; - - unsigned char *read_key; - unsigned char *write_key; - - /* Stuff specifically to do with this SSL session */ - unsigned int challenge_length; - unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH]; - unsigned int conn_id_length; - unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH]; - unsigned int key_material_length; - unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH*2]; - - unsigned long read_sequence; - unsigned long write_sequence; - - struct { - unsigned int conn_id_length; - unsigned int cert_type; - unsigned int cert_length; - unsigned int csl; - unsigned int clear; - unsigned int enc; - unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH]; - unsigned int cipher_spec_length; - unsigned int session_id_length; - unsigned int clen; - unsigned int rlen; - } tmp; - } SSL2_STATE; - -/* SSLv2 */ -/* client */ -#define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT) -#define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT) -#define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT) -#define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT) -#define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT) -/* server */ -#define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT) -#define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT) -#define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT) -#define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT) -#define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT) - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/dep/include/openssl/ssl23.h b/dep/include/openssl/ssl23.h deleted file mode 100644 index 67bd8e9e952..00000000000 --- a/dep/include/openssl/ssl23.h +++ /dev/null @@ -1,84 +0,0 @@ -/* ssl/ssl23.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SSL23_H -#define HEADER_SSL23_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*client */ -/* write to server */ -#define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) -#define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) -/* read from server */ -#define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) -#define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) - -/* server */ -/* read from client */ -#define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) -#define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/dep/include/openssl/ssl3.h b/dep/include/openssl/ssl3.h deleted file mode 100644 index 4b1e2e98347..00000000000 --- a/dep/include/openssl/ssl3.h +++ /dev/null @@ -1,565 +0,0 @@ -/* ssl/ssl3.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_SSL3_H -#define HEADER_SSL3_H - -#ifndef OPENSSL_NO_COMP -#include -#endif -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define SSL3_CK_RSA_NULL_MD5 0x03000001 -#define SSL3_CK_RSA_NULL_SHA 0x03000002 -#define SSL3_CK_RSA_RC4_40_MD5 0x03000003 -#define SSL3_CK_RSA_RC4_128_MD5 0x03000004 -#define SSL3_CK_RSA_RC4_128_SHA 0x03000005 -#define SSL3_CK_RSA_RC2_40_MD5 0x03000006 -#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 -#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 -#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 -#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A - -#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B -#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C -#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D -#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E -#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F -#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 - -#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011 -#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012 -#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013 -#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014 -#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015 -#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016 - -#define SSL3_CK_ADH_RC4_40_MD5 0x03000017 -#define SSL3_CK_ADH_RC4_128_MD5 0x03000018 -#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 -#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A -#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B - -#define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C -#define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D -#if 0 /* Because it clashes with KRB5, is never used any more, and is safe - to remove according to David Hopwood - of the ietf-tls list */ -#define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E -#endif - -/* VRS Additional Kerberos5 entries - */ -#define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E -#define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F -#define SSL3_CK_KRB5_RC4_128_SHA 0x03000020 -#define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021 -#define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022 -#define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023 -#define SSL3_CK_KRB5_RC4_128_MD5 0x03000024 -#define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025 - -#define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026 -#define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027 -#define SSL3_CK_KRB5_RC4_40_SHA 0x03000028 -#define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029 -#define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A -#define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B - -#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" -#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" -#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" -#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" -#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" -#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" -#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" -#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" -#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" -#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" - -#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" -#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" -#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" -#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" -#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" -#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" - -#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" -#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" -#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" -#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" -#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" -#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" - -#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" -#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" -#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" -#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" -#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" - -#define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA" -#define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA" -#define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA" - -#define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA" -#define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA" -#define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA" -#define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA" -#define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5" -#define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5" -#define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5" -#define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5" - -#define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA" -#define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA" -#define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA" -#define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5" -#define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5" -#define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5" - -#define SSL3_SSL_SESSION_ID_LENGTH 32 -#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 - -#define SSL3_MASTER_SECRET_SIZE 48 -#define SSL3_RANDOM_SIZE 32 -#define SSL3_SESSION_ID_SIZE 32 -#define SSL3_RT_HEADER_LENGTH 5 - -/* Due to MS stuffing up, this can change.... */ -#if defined(OPENSSL_SYS_WIN16) || \ - (defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)) -#define SSL3_RT_MAX_EXTRA (14000) -#else -#define SSL3_RT_MAX_EXTRA (16384) -#endif - -#define SSL3_RT_MAX_PLAIN_LENGTH 16384 -#ifdef OPENSSL_NO_COMP -#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH -#else -#define SSL3_RT_MAX_COMPRESSED_LENGTH (1024+SSL3_RT_MAX_PLAIN_LENGTH) -#endif -#define SSL3_RT_MAX_ENCRYPTED_LENGTH (1024+SSL3_RT_MAX_COMPRESSED_LENGTH) -#define SSL3_RT_MAX_PACKET_SIZE (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH) -#define SSL3_RT_MAX_DATA_SIZE (1024*1024) - -#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" -#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" - -#define SSL3_VERSION 0x0300 -#define SSL3_VERSION_MAJOR 0x03 -#define SSL3_VERSION_MINOR 0x00 - -#define SSL3_RT_CHANGE_CIPHER_SPEC 20 -#define SSL3_RT_ALERT 21 -#define SSL3_RT_HANDSHAKE 22 -#define SSL3_RT_APPLICATION_DATA 23 - -#define SSL3_AL_WARNING 1 -#define SSL3_AL_FATAL 2 - -#define SSL3_AD_CLOSE_NOTIFY 0 -#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */ -#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */ -#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */ -#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */ -#define SSL3_AD_NO_CERTIFICATE 41 -#define SSL3_AD_BAD_CERTIFICATE 42 -#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 -#define SSL3_AD_CERTIFICATE_REVOKED 44 -#define SSL3_AD_CERTIFICATE_EXPIRED 45 -#define SSL3_AD_CERTIFICATE_UNKNOWN 46 -#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ - -typedef struct ssl3_record_st - { -/*r */ int type; /* type of record */ -/*rw*/ unsigned int length; /* How many bytes available */ -/*r */ unsigned int off; /* read/write offset into 'buf' */ -/*rw*/ unsigned char *data; /* pointer to the record data */ -/*rw*/ unsigned char *input; /* where the decode bytes are */ -/*r */ unsigned char *comp; /* only used with decompression - malloc()ed */ -/*r */ unsigned long epoch; /* epoch number, needed by DTLS1 */ -/*r */ PQ_64BIT seq_num; /* sequence number, needed by DTLS1 */ - } SSL3_RECORD; - -typedef struct ssl3_buffer_st - { - unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes, - * see ssl3_setup_buffers() */ - size_t len; /* buffer size */ - int offset; /* where to 'copy from' */ - int left; /* how many bytes left */ - } SSL3_BUFFER; - -#define SSL3_CT_RSA_SIGN 1 -#define SSL3_CT_DSS_SIGN 2 -#define SSL3_CT_RSA_FIXED_DH 3 -#define SSL3_CT_DSS_FIXED_DH 4 -#define SSL3_CT_RSA_EPHEMERAL_DH 5 -#define SSL3_CT_DSS_EPHEMERAL_DH 6 -#define SSL3_CT_FORTEZZA_DMS 20 -/* SSL3_CT_NUMBER is used to size arrays and it must be large - * enough to contain all of the cert types defined either for - * SSLv3 and TLSv1. - */ -#define SSL3_CT_NUMBER 7 - - -#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 -#define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002 -#define SSL3_FLAGS_POP_BUFFER 0x0004 -#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 - -typedef struct ssl3_state_st - { - long flags; - int delay_buf_pop_ret; - - unsigned char read_sequence[8]; - unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; - unsigned char write_sequence[8]; - unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; - - unsigned char server_random[SSL3_RANDOM_SIZE]; - unsigned char client_random[SSL3_RANDOM_SIZE]; - - /* flags for countermeasure against known-IV weakness */ - int need_empty_fragments; - int empty_fragment_done; - - SSL3_BUFFER rbuf; /* read IO goes into here */ - SSL3_BUFFER wbuf; /* write IO goes into here */ - - SSL3_RECORD rrec; /* each decoded record goes in here */ - SSL3_RECORD wrec; /* goes out from here */ - - /* storage for Alert/Handshake protocol data received but not - * yet processed by ssl3_read_bytes: */ - unsigned char alert_fragment[2]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[4]; - unsigned int handshake_fragment_len; - - /* partial write - check the numbers match */ - unsigned int wnum; /* number of bytes sent so far */ - int wpend_tot; /* number bytes written */ - int wpend_type; - int wpend_ret; /* number of bytes submitted */ - const unsigned char *wpend_buf; - - /* used during startup, digest all incoming/outgoing packets */ - EVP_MD_CTX finish_dgst1; - EVP_MD_CTX finish_dgst2; - - /* this is set whenerver we see a change_cipher_spec message - * come in when we are not looking for one */ - int change_cipher_spec; - - int warn_alert; - int fatal_alert; - /* we allow one fatal and one warning alert to be outstanding, - * send close alert via the warning alert */ - int alert_dispatch; - unsigned char send_alert[2]; - - /* This flag is set when we should renegotiate ASAP, basically when - * there is no more data in the read or write buffers */ - int renegotiate; - int total_renegotiations; - int num_renegotiations; - - int in_read_app_data; - - struct { - /* actually only needs to be 16+20 */ - unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; - - /* actually only need to be 16+20 for SSLv3 and 12 for TLS */ - unsigned char finish_md[EVP_MAX_MD_SIZE*2]; - int finish_md_len; - unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; - int peer_finish_md_len; - - unsigned long message_size; - int message_type; - - /* used to hold the new cipher we are going to use */ - SSL_CIPHER *new_cipher; -#ifndef OPENSSL_NO_DH - DH *dh; -#endif - -#ifndef OPENSSL_NO_ECDH - EC_KEY *ecdh; /* holds short lived ECDH key */ -#endif - - /* used when SSL_ST_FLUSH_DATA is entered */ - int next_state; - - int reuse_message; - - /* used for certificate requests */ - int cert_req; - int ctype_num; - char ctype[SSL3_CT_NUMBER]; - STACK_OF(X509_NAME) *ca_names; - - int use_rsa_tmp; - - int key_block_length; - unsigned char *key_block; - - const EVP_CIPHER *new_sym_enc; - const EVP_MD *new_hash; -#ifndef OPENSSL_NO_COMP - const SSL_COMP *new_compression; -#else - char *new_compression; -#endif - int cert_request; - } tmp; - - } SSL3_STATE; - - -/* SSLv3 */ -/*client */ -/* extra state */ -#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) -/* write to server */ -#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) -#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) -/* read from server */ -#define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT) -#define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT) -#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT) -#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT) -#define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT) -#define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT) -#define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT) -#define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT) -/* write to server */ -#define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT) -#define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT) -#define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT) -#define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT) -#define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT) -#define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT) -#define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT) -#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) -#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) -#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) -#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) -#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) -/* read from server */ -#define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT) -#define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT) -#define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT) -#define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT) -#define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT) -#define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT) -#define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT) - -/* server */ -/* extra state */ -#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) -/* read from client */ -/* Do not change the number values, they do matter */ -#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT) -/* write to client */ -#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT) -#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT) -#define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT) -#define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT) -#define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT) -#define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT) -#define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT) -/* read from client */ -#define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT) -#define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT) -#define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) -#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) -#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) -#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) -/* write to client */ -#define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT) -#define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT) -#define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT) -#define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT) -#define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT) - -#define SSL3_MT_HELLO_REQUEST 0 -#define SSL3_MT_CLIENT_HELLO 1 -#define SSL3_MT_SERVER_HELLO 2 -#define SSL3_MT_NEWSESSION_TICKET 4 -#define SSL3_MT_CERTIFICATE 11 -#define SSL3_MT_SERVER_KEY_EXCHANGE 12 -#define SSL3_MT_CERTIFICATE_REQUEST 13 -#define SSL3_MT_SERVER_DONE 14 -#define SSL3_MT_CERTIFICATE_VERIFY 15 -#define SSL3_MT_CLIENT_KEY_EXCHANGE 16 -#define SSL3_MT_FINISHED 20 -#define SSL3_MT_CERTIFICATE_STATUS 22 -#define DTLS1_MT_HELLO_VERIFY_REQUEST 3 - - -#define SSL3_MT_CCS 1 - -/* These are used when changing over to a new cipher */ -#define SSL3_CC_READ 0x01 -#define SSL3_CC_WRITE 0x02 -#define SSL3_CC_CLIENT 0x10 -#define SSL3_CC_SERVER 0x20 -#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE) -#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ) -#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ) -#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE) - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/stack.h b/dep/include/openssl/stack.h deleted file mode 100644 index 51d14d5bf77..00000000000 --- a/dep/include/openssl/stack.h +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/stack/stack.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_STACK_H -#define HEADER_STACK_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct stack_st - { - int num; - char **data; - int sorted; - - int num_alloc; - int (*comp)(const char * const *, const char * const *); - } STACK; - -#define M_sk_num(sk) ((sk) ? (sk)->num:-1) -#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) - -int sk_num(const STACK *); -char *sk_value(const STACK *, int); - -char *sk_set(STACK *, int, char *); - -STACK *sk_new(int (*cmp)(const char * const *, const char * const *)); -STACK *sk_new_null(void); -void sk_free(STACK *); -void sk_pop_free(STACK *st, void (*func)(void *)); -int sk_insert(STACK *sk,char *data,int where); -char *sk_delete(STACK *st,int loc); -char *sk_delete_ptr(STACK *st, char *p); -int sk_find(STACK *st,char *data); -int sk_find_ex(STACK *st,char *data); -int sk_push(STACK *st,char *data); -int sk_unshift(STACK *st,char *data); -char *sk_shift(STACK *st); -char *sk_pop(STACK *st); -void sk_zero(STACK *st); -int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *, - const char * const *))) - (const char * const *, const char * const *); -STACK *sk_dup(STACK *st); -void sk_sort(STACK *st); -int sk_is_sorted(const STACK *st); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/include/openssl/store.h b/dep/include/openssl/store.h deleted file mode 100644 index 25f360892a3..00000000000 --- a/dep/include/openssl/store.h +++ /dev/null @@ -1,555 +0,0 @@ -/* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */ -/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL - * project 2003. - */ -/* ==================================================================== - * Copyright (c) 2003 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_STORE_H -#define HEADER_STORE_H - -#include -#ifndef OPENSSL_NO_DEPRECATED -#include -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct store_st STORE; */ -/* typedef struct store_method_st STORE_METHOD; */ - - -/* All the following functions return 0, a negative number or NULL on error. - When everything is fine, they return a positive value or a non-NULL - pointer, all depending on their purpose. */ - -/* Creators and destructor. */ -STORE *STORE_new_method(const STORE_METHOD *method); -STORE *STORE_new_engine(ENGINE *engine); -void STORE_free(STORE *ui); - - -/* Give a user interface parametrised control commands. This can be used to - send down an integer, a data pointer or a function pointer, as well as - be used to get information from a STORE. */ -int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)); - -/* A control to set the directory with keys and certificates. Used by the - built-in directory level method. */ -#define STORE_CTRL_SET_DIRECTORY 0x0001 -/* A control to set a file to load. Used by the built-in file level method. */ -#define STORE_CTRL_SET_FILE 0x0002 -/* A control to set a configuration file to load. Can be used by any method - that wishes to load a configuration file. */ -#define STORE_CTRL_SET_CONF_FILE 0x0003 -/* A control to set a the section of the loaded configuration file. Can be - used by any method that wishes to load a configuration file. */ -#define STORE_CTRL_SET_CONF_SECTION 0x0004 - - -/* Some methods may use extra data */ -#define STORE_set_app_data(s,arg) STORE_set_ex_data(s,0,arg) -#define STORE_get_app_data(s) STORE_get_ex_data(s,0) -int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int STORE_set_ex_data(STORE *r,int idx,void *arg); -void *STORE_get_ex_data(STORE *r, int idx); - -/* Use specific methods instead of the built-in one */ -const STORE_METHOD *STORE_get_method(STORE *store); -const STORE_METHOD *STORE_set_method(STORE *store, const STORE_METHOD *meth); - -/* The standard OpenSSL methods. */ -/* This is the in-memory method. It does everything except revoking and updating, - and is of course volatile. It's used by other methods that have an in-memory - cache. */ -const STORE_METHOD *STORE_Memory(void); -#if 0 /* Not yet implemented */ -/* This is the directory store. It does everything except revoking and updating, - and uses STORE_Memory() to cache things in memory. */ -const STORE_METHOD *STORE_Directory(void); -/* This is the file store. It does everything except revoking and updating, - and uses STORE_Memory() to cache things in memory. Certificates are added - to it with the store operation, and it will only get cached certificates. */ -const STORE_METHOD *STORE_File(void); -#endif - -/* Store functions take a type code for the type of data they should store - or fetch */ -typedef enum STORE_object_types - { - STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */ - STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */ - STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */ - STORE_OBJECT_TYPE_PUBLIC_KEY= 0x04, /* EVP_PKEY * */ - STORE_OBJECT_TYPE_NUMBER= 0x05, /* BIGNUM * */ - STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */ - STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known - object types */ - } STORE_OBJECT_TYPES; -/* List of text strings corresponding to the object types. */ -extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1]; - -/* Some store functions take a parameter list. Those parameters come with - one of the following codes. The comments following the codes below indicate - what type the value should be a pointer to. */ -typedef enum STORE_params - { - STORE_PARAM_EVP_TYPE= 0x01, /* int */ - STORE_PARAM_BITS= 0x02, /* size_t */ - STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */ - STORE_PARAM_KEY_NO_PARAMETERS= 0x04, /* N/A */ - STORE_PARAM_AUTH_PASSPHRASE= 0x05, /* char * */ - STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */ - STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known - parameter types */ - } STORE_PARAM_TYPES; -/* Parameter value sizes. -1 means unknown, anything else is the required size. */ -extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1]; - -/* Store functions take attribute lists. Those attributes come with codes. - The comments following the codes below indicate what type the value should - be a pointer to. */ -typedef enum STORE_attribs - { - STORE_ATTR_END= 0x00, - STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */ - STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */ - STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */ - STORE_ATTR_SUBJECTKEYID= 0x04, /* 160 bit string (SHA1) */ - STORE_ATTR_ISSUERSERIALHASH= 0x05, /* 160 bit string (SHA1) */ - STORE_ATTR_ISSUER= 0x06, /* X509_NAME * */ - STORE_ATTR_SERIAL= 0x07, /* BIGNUM * */ - STORE_ATTR_SUBJECT= 0x08, /* X509_NAME * */ - STORE_ATTR_CERTHASH= 0x09, /* 160 bit string (SHA1) */ - STORE_ATTR_EMAIL= 0x0a, /* C string */ - STORE_ATTR_FILENAME= 0x0b, /* C string */ - STORE_ATTR_TYPE_NUM= 0x0b, /* The amount of known - attribute types */ - STORE_ATTR_OR= 0xff /* This is a special - separator, which - expresses the OR - operation. */ - } STORE_ATTR_TYPES; -/* Attribute value sizes. -1 means unknown, anything else is the required size. */ -extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1]; - -typedef enum STORE_certificate_status - { - STORE_X509_VALID= 0x00, - STORE_X509_EXPIRED= 0x01, - STORE_X509_SUSPENDED= 0x02, - STORE_X509_REVOKED= 0x03 - } STORE_CERTIFICATE_STATUS; - -/* Engine store functions will return a structure that contains all the necessary - * information, including revokation status for certificates. This is really not - * needed for application authors, as the ENGINE framework functions will extract - * the OpenSSL-specific information when at all possible. However, for engine - * authors, it's crucial to know this structure. */ -typedef struct STORE_OBJECT_st - { - STORE_OBJECT_TYPES type; - union - { - struct - { - STORE_CERTIFICATE_STATUS status; - X509 *certificate; - } x509; - X509_CRL *crl; - EVP_PKEY *key; - BIGNUM *number; - BUF_MEM *arbitrary; - } data; - } STORE_OBJECT; -DECLARE_STACK_OF(STORE_OBJECT) -STORE_OBJECT *STORE_OBJECT_new(void); -void STORE_OBJECT_free(STORE_OBJECT *data); - - - -/* The following functions handle the storage. They return 0, a negative number - or NULL on error, anything else on success. */ -X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -X509 *STORE_list_certificate_next(STORE *e, void *handle); -int STORE_list_certificate_end(STORE *e, void *handle); -int STORE_list_certificate_endp(STORE *e, void *handle); -EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_store_private_key(STORE *e, EVP_PKEY *data, - OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); -int STORE_list_private_key_end(STORE *e, void *handle); -int STORE_list_private_key_endp(STORE *e, void *handle); -EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); -int STORE_list_public_key_end(STORE *e, void *handle); -int STORE_list_public_key_endp(STORE *e, void *handle); -X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -X509_CRL *STORE_list_crl_next(STORE *e, void *handle); -int STORE_list_crl_end(STORE *e, void *handle); -int STORE_list_crl_endp(STORE *e, void *handle); -int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], - OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], - OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); -int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], - OPENSSL_ITEM parameters[]); - - -/* Create and manipulate methods */ -STORE_METHOD *STORE_create_method(char *name); -void STORE_destroy_method(STORE_METHOD *store_method); - -/* These callback types are use for store handlers */ -typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); -typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); -typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); -typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); -typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); -typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); -typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void)); - -int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f); -int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f); -int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f); -int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f); -int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f); -int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f); -int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f); -int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f); -int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f); -int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f); -int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f); -int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); -int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); -int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); -int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f); - -STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm); -STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); -STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm); -STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); -STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); -STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); -STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); -STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); -STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm); -STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm); -STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); -STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); -STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); -STORE_GENERIC_FUNC_PTR STORE_method_get_unlock_store_function(STORE_METHOD *sm); -STORE_CTRL_FUNC_PTR STORE_method_get_ctrl_function(STORE_METHOD *sm); - -/* Method helper structures and functions. */ - -/* This structure is the result of parsing through the information in a list - of OPENSSL_ITEMs. It stores all the necessary information in a structured - way.*/ -typedef struct STORE_attr_info_st STORE_ATTR_INFO; - -/* Parse a list of OPENSSL_ITEMs and return a pointer to a STORE_ATTR_INFO. - Note that we do this in the list form, since the list of OPENSSL_ITEMs can - come in blocks separated with STORE_ATTR_OR. Note that the value returned - by STORE_parse_attrs_next() must be freed with STORE_ATTR_INFO_free(). */ -void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes); -STORE_ATTR_INFO *STORE_parse_attrs_next(void *handle); -int STORE_parse_attrs_end(void *handle); -int STORE_parse_attrs_endp(void *handle); - -/* Creator and destructor */ -STORE_ATTR_INFO *STORE_ATTR_INFO_new(void); -int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs); - -/* Manipulators */ -char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); -unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, - STORE_ATTR_TYPES code); -X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); -BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); -int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - char *cstr, size_t cstr_size); -int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - unsigned char *sha1str, size_t sha1str_size); -int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - X509_NAME *dn); -int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - BIGNUM *number); -int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - char *cstr, size_t cstr_size); -int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - unsigned char *sha1str, size_t sha1str_size); -int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - X509_NAME *dn); -int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, - BIGNUM *number); - -/* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values - in each contained attribute. */ -int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); -/* Check if the set of attributes in a is within the range of attributes - set in b. */ -int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); -/* Check if the set of attributes in a are also set in b. */ -int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); -/* Same as STORE_ATTR_INFO_in(), but also checks the attribute values. */ -int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_STORE_strings(void); - -/* Error codes for the STORE functions. */ - -/* Function codes. */ -#define STORE_F_MEM_DELETE 134 -#define STORE_F_MEM_GENERATE 135 -#define STORE_F_MEM_LIST_END 168 -#define STORE_F_MEM_LIST_NEXT 136 -#define STORE_F_MEM_LIST_START 137 -#define STORE_F_MEM_MODIFY 169 -#define STORE_F_MEM_STORE 138 -#define STORE_F_STORE_ATTR_INFO_GET0_CSTR 139 -#define STORE_F_STORE_ATTR_INFO_GET0_DN 140 -#define STORE_F_STORE_ATTR_INFO_GET0_NUMBER 141 -#define STORE_F_STORE_ATTR_INFO_GET0_SHA1STR 142 -#define STORE_F_STORE_ATTR_INFO_MODIFY_CSTR 143 -#define STORE_F_STORE_ATTR_INFO_MODIFY_DN 144 -#define STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER 145 -#define STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR 146 -#define STORE_F_STORE_ATTR_INFO_SET_CSTR 147 -#define STORE_F_STORE_ATTR_INFO_SET_DN 148 -#define STORE_F_STORE_ATTR_INFO_SET_NUMBER 149 -#define STORE_F_STORE_ATTR_INFO_SET_SHA1STR 150 -#define STORE_F_STORE_CERTIFICATE 170 -#define STORE_F_STORE_CTRL 161 -#define STORE_F_STORE_DELETE_ARBITRARY 158 -#define STORE_F_STORE_DELETE_CERTIFICATE 102 -#define STORE_F_STORE_DELETE_CRL 103 -#define STORE_F_STORE_DELETE_NUMBER 104 -#define STORE_F_STORE_DELETE_PRIVATE_KEY 105 -#define STORE_F_STORE_DELETE_PUBLIC_KEY 106 -#define STORE_F_STORE_GENERATE_CRL 107 -#define STORE_F_STORE_GENERATE_KEY 108 -#define STORE_F_STORE_GET_ARBITRARY 159 -#define STORE_F_STORE_GET_CERTIFICATE 109 -#define STORE_F_STORE_GET_CRL 110 -#define STORE_F_STORE_GET_NUMBER 111 -#define STORE_F_STORE_GET_PRIVATE_KEY 112 -#define STORE_F_STORE_GET_PUBLIC_KEY 113 -#define STORE_F_STORE_LIST_CERTIFICATE_END 114 -#define STORE_F_STORE_LIST_CERTIFICATE_ENDP 153 -#define STORE_F_STORE_LIST_CERTIFICATE_NEXT 115 -#define STORE_F_STORE_LIST_CERTIFICATE_START 116 -#define STORE_F_STORE_LIST_CRL_END 117 -#define STORE_F_STORE_LIST_CRL_ENDP 154 -#define STORE_F_STORE_LIST_CRL_NEXT 118 -#define STORE_F_STORE_LIST_CRL_START 119 -#define STORE_F_STORE_LIST_PRIVATE_KEY_END 120 -#define STORE_F_STORE_LIST_PRIVATE_KEY_ENDP 155 -#define STORE_F_STORE_LIST_PRIVATE_KEY_NEXT 121 -#define STORE_F_STORE_LIST_PRIVATE_KEY_START 122 -#define STORE_F_STORE_LIST_PUBLIC_KEY_END 123 -#define STORE_F_STORE_LIST_PUBLIC_KEY_ENDP 156 -#define STORE_F_STORE_LIST_PUBLIC_KEY_NEXT 124 -#define STORE_F_STORE_LIST_PUBLIC_KEY_START 125 -#define STORE_F_STORE_MODIFY_ARBITRARY 162 -#define STORE_F_STORE_MODIFY_CERTIFICATE 163 -#define STORE_F_STORE_MODIFY_CRL 164 -#define STORE_F_STORE_MODIFY_NUMBER 165 -#define STORE_F_STORE_MODIFY_PRIVATE_KEY 166 -#define STORE_F_STORE_MODIFY_PUBLIC_KEY 167 -#define STORE_F_STORE_NEW_ENGINE 133 -#define STORE_F_STORE_NEW_METHOD 132 -#define STORE_F_STORE_PARSE_ATTRS_END 151 -#define STORE_F_STORE_PARSE_ATTRS_ENDP 172 -#define STORE_F_STORE_PARSE_ATTRS_NEXT 152 -#define STORE_F_STORE_PARSE_ATTRS_START 171 -#define STORE_F_STORE_REVOKE_CERTIFICATE 129 -#define STORE_F_STORE_REVOKE_PRIVATE_KEY 130 -#define STORE_F_STORE_REVOKE_PUBLIC_KEY 131 -#define STORE_F_STORE_STORE_ARBITRARY 157 -#define STORE_F_STORE_STORE_CERTIFICATE 100 -#define STORE_F_STORE_STORE_CRL 101 -#define STORE_F_STORE_STORE_NUMBER 126 -#define STORE_F_STORE_STORE_PRIVATE_KEY 127 -#define STORE_F_STORE_STORE_PUBLIC_KEY 128 - -/* Reason codes. */ -#define STORE_R_ALREADY_HAS_A_VALUE 127 -#define STORE_R_FAILED_DELETING_ARBITRARY 132 -#define STORE_R_FAILED_DELETING_CERTIFICATE 100 -#define STORE_R_FAILED_DELETING_KEY 101 -#define STORE_R_FAILED_DELETING_NUMBER 102 -#define STORE_R_FAILED_GENERATING_CRL 103 -#define STORE_R_FAILED_GENERATING_KEY 104 -#define STORE_R_FAILED_GETTING_ARBITRARY 133 -#define STORE_R_FAILED_GETTING_CERTIFICATE 105 -#define STORE_R_FAILED_GETTING_KEY 106 -#define STORE_R_FAILED_GETTING_NUMBER 107 -#define STORE_R_FAILED_LISTING_CERTIFICATES 108 -#define STORE_R_FAILED_LISTING_KEYS 109 -#define STORE_R_FAILED_MODIFYING_ARBITRARY 138 -#define STORE_R_FAILED_MODIFYING_CERTIFICATE 139 -#define STORE_R_FAILED_MODIFYING_CRL 140 -#define STORE_R_FAILED_MODIFYING_NUMBER 141 -#define STORE_R_FAILED_MODIFYING_PRIVATE_KEY 142 -#define STORE_R_FAILED_MODIFYING_PUBLIC_KEY 143 -#define STORE_R_FAILED_REVOKING_CERTIFICATE 110 -#define STORE_R_FAILED_REVOKING_KEY 111 -#define STORE_R_FAILED_STORING_ARBITRARY 134 -#define STORE_R_FAILED_STORING_CERTIFICATE 112 -#define STORE_R_FAILED_STORING_KEY 113 -#define STORE_R_FAILED_STORING_NUMBER 114 -#define STORE_R_NOT_IMPLEMENTED 128 -#define STORE_R_NO_CONTROL_FUNCTION 144 -#define STORE_R_NO_DELETE_ARBITRARY_FUNCTION 135 -#define STORE_R_NO_DELETE_NUMBER_FUNCTION 115 -#define STORE_R_NO_DELETE_OBJECT_FUNCTION 116 -#define STORE_R_NO_GENERATE_CRL_FUNCTION 117 -#define STORE_R_NO_GENERATE_OBJECT_FUNCTION 118 -#define STORE_R_NO_GET_OBJECT_ARBITRARY_FUNCTION 136 -#define STORE_R_NO_GET_OBJECT_FUNCTION 119 -#define STORE_R_NO_GET_OBJECT_NUMBER_FUNCTION 120 -#define STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION 131 -#define STORE_R_NO_LIST_OBJECT_END_FUNCTION 121 -#define STORE_R_NO_LIST_OBJECT_NEXT_FUNCTION 122 -#define STORE_R_NO_LIST_OBJECT_START_FUNCTION 123 -#define STORE_R_NO_MODIFY_OBJECT_FUNCTION 145 -#define STORE_R_NO_REVOKE_OBJECT_FUNCTION 124 -#define STORE_R_NO_STORE 129 -#define STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION 137 -#define STORE_R_NO_STORE_OBJECT_FUNCTION 125 -#define STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION 126 -#define STORE_R_NO_VALUE 130 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/symhacks.h b/dep/include/openssl/symhacks.h deleted file mode 100644 index 8728e6124da..00000000000 --- a/dep/include/openssl/symhacks.h +++ /dev/null @@ -1,409 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_SYMHACKS_H -#define HEADER_SYMHACKS_H - -#include - -/* Hacks to solve the problem with linkers incapable of handling very long - symbol names. In the case of VMS, the limit is 31 characters on VMS for - VAX. */ -#ifdef OPENSSL_SYS_VMS - -/* Hack a long name in crypto/cryptlib.c */ -#undef int_CRYPTO_set_do_dynlock_callback -#define int_CRYPTO_set_do_dynlock_callback int_CRYPTO_set_do_dynlock_cb - -/* Hack a long name in crypto/ex_data.c */ -#undef CRYPTO_get_ex_data_implementation -#define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl -#undef CRYPTO_set_ex_data_implementation -#define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl - -/* Hack a long name in crypto/asn1/a_mbstr.c */ -#undef ASN1_STRING_set_default_mask_asc -#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc - -#if 0 /* No longer needed, since safestack macro magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */ -#undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO -#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF -#undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO -#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF -#endif - -#if 0 /* No longer needed, since safestack macro magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */ -#undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO -#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF -#undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO -#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF -#endif - -#if 0 /* No longer needed, since safestack macro magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */ -#undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION -#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC -#undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION -#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC -#endif - -/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */ -#undef PEM_read_NETSCAPE_CERT_SEQUENCE -#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ -#undef PEM_write_NETSCAPE_CERT_SEQUENCE -#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ -#undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE -#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ -#undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE -#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ -#undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE -#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ - -/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */ -#undef PEM_read_PKCS8_PRIV_KEY_INFO -#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO -#undef PEM_write_PKCS8_PRIV_KEY_INFO -#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO -#undef PEM_read_bio_PKCS8_PRIV_KEY_INFO -#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO -#undef PEM_write_bio_PKCS8_PRIV_KEY_INFO -#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO -#undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO -#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO - -/* Hack other PEM names */ -#undef PEM_write_bio_PKCS8PrivateKey_nid -#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid - -/* Hack some long X509 names */ -#undef X509_REVOKED_get_ext_by_critical -#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic -#undef X509_policy_tree_get0_user_policies -#define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies -#undef X509_policy_node_get0_qualifiers -#define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers -#undef X509_STORE_CTX_get_explicit_policy -#define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy - -/* Hack some long CRYPTO names */ -#undef CRYPTO_set_dynlock_destroy_callback -#define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb -#undef CRYPTO_set_dynlock_create_callback -#define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb -#undef CRYPTO_set_dynlock_lock_callback -#define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb -#undef CRYPTO_get_dynlock_lock_callback -#define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb -#undef CRYPTO_get_dynlock_destroy_callback -#define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb -#undef CRYPTO_get_dynlock_create_callback -#define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb -#undef CRYPTO_set_locked_mem_ex_functions -#define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs -#undef CRYPTO_get_locked_mem_ex_functions -#define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs - -/* Hack some long SSL names */ -#undef SSL_CTX_set_default_verify_paths -#define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths -#undef SSL_get_ex_data_X509_STORE_CTX_idx -#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx -#undef SSL_add_file_cert_subjects_to_stack -#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk -#undef SSL_add_dir_cert_subjects_to_stack -#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk -#undef SSL_CTX_use_certificate_chain_file -#define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file -#undef SSL_CTX_set_cert_verify_callback -#define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb -#undef SSL_CTX_set_default_passwd_cb_userdata -#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud -#undef SSL_COMP_get_compression_methods -#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods - -/* Hack some long ENGINE names */ -#undef ENGINE_get_default_BN_mod_exp_crt -#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt -#undef ENGINE_set_default_BN_mod_exp_crt -#define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt -#undef ENGINE_set_load_privkey_function -#define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn -#undef ENGINE_get_load_privkey_function -#define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn -#undef ENGINE_set_load_ssl_client_cert_function -#define ENGINE_set_load_ssl_client_cert_function \ - ENGINE_set_ld_ssl_clnt_cert_fn -#undef ENGINE_get_ssl_client_cert_function -#define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn - -/* Hack some long OCSP names */ -#undef OCSP_REQUEST_get_ext_by_critical -#define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit -#undef OCSP_BASICRESP_get_ext_by_critical -#define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit -#undef OCSP_SINGLERESP_get_ext_by_critical -#define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit - -/* Hack some long DES names */ -#undef _ossl_old_des_ede3_cfb64_encrypt -#define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt -#undef _ossl_old_des_ede3_ofb64_encrypt -#define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt - -/* Hack some long EVP names */ -#undef OPENSSL_add_all_algorithms_noconf -#define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf -#undef OPENSSL_add_all_algorithms_conf -#define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf - -/* Hack some long EC names */ -#undef EC_GROUP_set_point_conversion_form -#define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form -#undef EC_GROUP_get_point_conversion_form -#define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form -#undef EC_GROUP_clear_free_all_extra_data -#define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data -#undef EC_POINT_set_Jprojective_coordinates_GFp -#define EC_POINT_set_Jprojective_coordinates_GFp \ - EC_POINT_set_Jproj_coords_GFp -#undef EC_POINT_get_Jprojective_coordinates_GFp -#define EC_POINT_get_Jprojective_coordinates_GFp \ - EC_POINT_get_Jproj_coords_GFp -#undef EC_POINT_set_affine_coordinates_GFp -#define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp -#undef EC_POINT_get_affine_coordinates_GFp -#define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp -#undef EC_POINT_set_compressed_coordinates_GFp -#define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp -#undef EC_POINT_set_affine_coordinates_GF2m -#define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m -#undef EC_POINT_get_affine_coordinates_GF2m -#define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m -#undef EC_POINT_set_compressed_coordinates_GF2m -#define EC_POINT_set_compressed_coordinates_GF2m \ - EC_POINT_set_compr_coords_GF2m -#undef ec_GF2m_simple_group_clear_finish -#define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish -#undef ec_GF2m_simple_group_check_discriminant -#define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim -#undef ec_GF2m_simple_point_clear_finish -#define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish -#undef ec_GF2m_simple_point_set_to_infinity -#define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf -#undef ec_GF2m_simple_points_make_affine -#define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine -#undef ec_GF2m_simple_point_set_affine_coordinates -#define ec_GF2m_simple_point_set_affine_coordinates \ - ec_GF2m_smp_pt_set_af_coords -#undef ec_GF2m_simple_point_get_affine_coordinates -#define ec_GF2m_simple_point_get_affine_coordinates \ - ec_GF2m_smp_pt_get_af_coords -#undef ec_GF2m_simple_set_compressed_coordinates -#define ec_GF2m_simple_set_compressed_coordinates \ - ec_GF2m_smp_set_compr_coords -#undef ec_GFp_simple_group_set_curve_GFp -#define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp -#undef ec_GFp_simple_group_get_curve_GFp -#define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp -#undef ec_GFp_simple_group_clear_finish -#define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish -#undef ec_GFp_simple_group_set_generator -#define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator -#undef ec_GFp_simple_group_get0_generator -#define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator -#undef ec_GFp_simple_group_get_cofactor -#define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor -#undef ec_GFp_simple_point_clear_finish -#define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish -#undef ec_GFp_simple_point_set_to_infinity -#define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf -#undef ec_GFp_simple_points_make_affine -#define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine -#undef ec_GFp_simple_group_get_curve_GFp -#define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp -#undef ec_GFp_simple_set_Jprojective_coordinates_GFp -#define ec_GFp_simple_set_Jprojective_coordinates_GFp \ - ec_GFp_smp_set_Jproj_coords_GFp -#undef ec_GFp_simple_get_Jprojective_coordinates_GFp -#define ec_GFp_simple_get_Jprojective_coordinates_GFp \ - ec_GFp_smp_get_Jproj_coords_GFp -#undef ec_GFp_simple_point_set_affine_coordinates_GFp -#define ec_GFp_simple_point_set_affine_coordinates_GFp \ - ec_GFp_smp_pt_set_af_coords_GFp -#undef ec_GFp_simple_point_get_affine_coordinates_GFp -#define ec_GFp_simple_point_get_affine_coordinates_GFp \ - ec_GFp_smp_pt_get_af_coords_GFp -#undef ec_GFp_simple_set_compressed_coordinates_GFp -#define ec_GFp_simple_set_compressed_coordinates_GFp \ - ec_GFp_smp_set_compr_coords_GFp -#undef ec_GFp_simple_point_set_affine_coordinates -#define ec_GFp_simple_point_set_affine_coordinates \ - ec_GFp_smp_pt_set_af_coords -#undef ec_GFp_simple_point_get_affine_coordinates -#define ec_GFp_simple_point_get_affine_coordinates \ - ec_GFp_smp_pt_get_af_coords -#undef ec_GFp_simple_set_compressed_coordinates -#define ec_GFp_simple_set_compressed_coordinates \ - ec_GFp_smp_set_compr_coords -#undef ec_GFp_simple_group_check_discriminant -#define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim - -/* Hack som long STORE names */ -#undef STORE_method_set_initialise_function -#define STORE_method_set_initialise_function STORE_meth_set_initialise_fn -#undef STORE_method_set_cleanup_function -#define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn -#undef STORE_method_set_generate_function -#define STORE_method_set_generate_function STORE_meth_set_generate_fn -#undef STORE_method_set_modify_function -#define STORE_method_set_modify_function STORE_meth_set_modify_fn -#undef STORE_method_set_revoke_function -#define STORE_method_set_revoke_function STORE_meth_set_revoke_fn -#undef STORE_method_set_delete_function -#define STORE_method_set_delete_function STORE_meth_set_delete_fn -#undef STORE_method_set_list_start_function -#define STORE_method_set_list_start_function STORE_meth_set_list_start_fn -#undef STORE_method_set_list_next_function -#define STORE_method_set_list_next_function STORE_meth_set_list_next_fn -#undef STORE_method_set_list_end_function -#define STORE_method_set_list_end_function STORE_meth_set_list_end_fn -#undef STORE_method_set_update_store_function -#define STORE_method_set_update_store_function STORE_meth_set_update_store_fn -#undef STORE_method_set_lock_store_function -#define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn -#undef STORE_method_set_unlock_store_function -#define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn -#undef STORE_method_get_initialise_function -#define STORE_method_get_initialise_function STORE_meth_get_initialise_fn -#undef STORE_method_get_cleanup_function -#define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn -#undef STORE_method_get_generate_function -#define STORE_method_get_generate_function STORE_meth_get_generate_fn -#undef STORE_method_get_modify_function -#define STORE_method_get_modify_function STORE_meth_get_modify_fn -#undef STORE_method_get_revoke_function -#define STORE_method_get_revoke_function STORE_meth_get_revoke_fn -#undef STORE_method_get_delete_function -#define STORE_method_get_delete_function STORE_meth_get_delete_fn -#undef STORE_method_get_list_start_function -#define STORE_method_get_list_start_function STORE_meth_get_list_start_fn -#undef STORE_method_get_list_next_function -#define STORE_method_get_list_next_function STORE_meth_get_list_next_fn -#undef STORE_method_get_list_end_function -#define STORE_method_get_list_end_function STORE_meth_get_list_end_fn -#undef STORE_method_get_update_store_function -#define STORE_method_get_update_store_function STORE_meth_get_update_store_fn -#undef STORE_method_get_lock_store_function -#define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn -#undef STORE_method_get_unlock_store_function -#define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn - -/* Hack some long CMS names */ -#undef CMS_RecipientInfo_ktri_get0_algs -#define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs -#undef CMS_RecipientInfo_ktri_get0_signer_id -#define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id -#undef CMS_OtherRevocationInfoFormat_it -#define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it -#undef CMS_KeyAgreeRecipientIdentifier_it -#define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it -#undef CMS_OriginatorIdentifierOrKey_it -#define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it -#undef cms_SignerIdentifier_get0_signer_id -#define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id - -#endif /* defined OPENSSL_SYS_VMS */ - - -/* Case insensiteve linking causes problems.... */ -#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) -#undef ERR_load_CRYPTO_strings -#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings -#undef OCSP_crlID_new -#define OCSP_crlID_new OCSP_crlID2_new - -#undef d2i_ECPARAMETERS -#define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS -#undef i2d_ECPARAMETERS -#define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS -#undef d2i_ECPKPARAMETERS -#define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS -#undef i2d_ECPKPARAMETERS -#define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS - -/* These functions do not seem to exist! However, I'm paranoid... - Original command in x509v3.h: - These functions are being redefined in another directory, - and clash when the linker is case-insensitive, so let's - hide them a little, by giving them an extra 'o' at the - beginning of the name... */ -#undef X509v3_cleanup_extensions -#define X509v3_cleanup_extensions oX509v3_cleanup_extensions -#undef X509v3_add_extension -#define X509v3_add_extension oX509v3_add_extension -#undef X509v3_add_netscape_extensions -#define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -#undef X509v3_add_standard_extensions -#define X509v3_add_standard_extensions oX509v3_add_standard_extensions - - -#endif - - -#endif /* ! defined HEADER_VMS_IDHACKS_H */ -/* This one clashes with CMS_data_create */ -#undef cms_Data_create -#define cms_Data_create priv_cms_Data_create diff --git a/dep/include/openssl/tls1.h b/dep/include/openssl/tls1.h deleted file mode 100644 index 2d1d293e1a4..00000000000 --- a/dep/include/openssl/tls1.h +++ /dev/null @@ -1,407 +0,0 @@ -/* ssl/tls1.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * ECC cipher suite support in OpenSSL originally written by - * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories. - * - */ - -#ifndef HEADER_TLS1_H -#define HEADER_TLS1_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 - -#define TLS1_VERSION 0x0301 -#define TLS1_VERSION_MAJOR 0x03 -#define TLS1_VERSION_MINOR 0x01 - -#define TLS1_AD_DECRYPTION_FAILED 21 -#define TLS1_AD_RECORD_OVERFLOW 22 -#define TLS1_AD_UNKNOWN_CA 48 /* fatal */ -#define TLS1_AD_ACCESS_DENIED 49 /* fatal */ -#define TLS1_AD_DECODE_ERROR 50 /* fatal */ -#define TLS1_AD_DECRYPT_ERROR 51 -#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */ -#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */ -#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */ -#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */ -#define TLS1_AD_USER_CANCELLED 90 -#define TLS1_AD_NO_RENEGOTIATION 100 -/* codes 110-114 are from RFC3546 */ -#define TLS1_AD_UNSUPPORTED_EXTENSION 110 -#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 -#define TLS1_AD_UNRECOGNIZED_NAME 112 -#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 -#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 -#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ - -/* ExtensionType values from RFC 3546 */ -#define TLSEXT_TYPE_server_name 0 -#define TLSEXT_TYPE_max_fragment_length 1 -#define TLSEXT_TYPE_client_certificate_url 2 -#define TLSEXT_TYPE_trusted_ca_keys 3 -#define TLSEXT_TYPE_truncated_hmac 4 -#define TLSEXT_TYPE_status_request 5 -#define TLSEXT_TYPE_elliptic_curves 10 -#define TLSEXT_TYPE_ec_point_formats 11 -#define TLSEXT_TYPE_session_ticket 35 - -/* NameType value from RFC 3546 */ -#define TLSEXT_NAMETYPE_host_name 0 -/* status request value from RFC 3546 */ -#define TLSEXT_STATUSTYPE_ocsp 1 - -#ifndef OPENSSL_NO_TLSEXT - -#define TLSEXT_MAXLEN_host_name 255 - -const char *SSL_get_servername(const SSL *s, const int type) ; -int SSL_get_servername_type(const SSL *s) ; - -#define SSL_set_tlsext_host_name(s,name) \ -SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) - -#define SSL_set_tlsext_debug_callback(ssl, cb) \ -SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb) - -#define SSL_set_tlsext_debug_arg(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg) - -#define SSL_set_tlsext_status_type(ssl, type) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL) - -#define SSL_get_tlsext_status_exts(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) - -#define SSL_set_tlsext_status_exts(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) - -#define SSL_get_tlsext_status_ids(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) - -#define SSL_set_tlsext_status_ids(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) - -#define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg) - -#define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg) - -#define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ -SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb) - -#define SSL_TLSEXT_ERR_OK 0 -#define SSL_TLSEXT_ERR_ALERT_WARNING 1 -#define SSL_TLSEXT_ERR_ALERT_FATAL 2 -#define SSL_TLSEXT_ERR_NOACK 3 - -#define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ -SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) - -#define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLXEXT_TICKET_KEYS,(keylen),(keys)) -#define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLXEXT_TICKET_KEYS,(keylen),(keys)) - -#define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ -SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) - -#define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) - -#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ -SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) - -#endif - -/* Additional TLS ciphersuites from draft-ietf-tls-56-bit-ciphersuites-00.txt - * (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see - * s3_lib.c). We actually treat them like SSL 3.0 ciphers, which we probably - * shouldn't. */ -#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060 -#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061 -#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062 -#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063 -#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064 -#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065 -#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 - -/* AES ciphersuites from RFC3268 */ - -#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F -#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 -#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 -#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 -#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 -#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 - -#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 -#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 -#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 -#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 -#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 -#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A - -/* Camellia ciphersuites from RFC4132 */ -#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 -#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 -#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 -#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 -#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 -#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 - -#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 -#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 -#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 -#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 -#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 -#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 - -/* SEED ciphersuites from RFC4162 */ -#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 -#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 -#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 -#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 -#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A -#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B - -/* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ -#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 -#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 -#define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 -#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 -#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 - -#define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 -#define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 -#define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 -#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 -#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A - -#define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B -#define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C -#define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D -#define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E -#define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F - -#define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 -#define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 -#define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 -#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 -#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 - -#define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 -#define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 -#define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 -#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 -#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 - -/* XXX - * Inconsistency alert: - * The OpenSSL names of ciphers with ephemeral DH here include the string - * "DHE", while elsewhere it has always been "EDH". - * (The alias for the list of all such ciphers also is "EDH".) - * The specifications speak of "EDH"; maybe we should allow both forms - * for everything. */ -#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" -#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" -#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA" -#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA" -#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA" -#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA" -#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" - -/* AES ciphersuites from RFC3268 */ -#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" -#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" -#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" -#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" -#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" -#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" - -#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" -#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" -#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" -#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" -#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" -#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" - -/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ -#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" -#define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" -#define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" -#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" -#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" - -#define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" -#define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" -#define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" -#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" -#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" - -#define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" -#define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" -#define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" -#define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" -#define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" - -#define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" -#define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" -#define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" -#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" -#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" - -#define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" -#define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" -#define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" -#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" -#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" - -/* Camellia ciphersuites from RFC4132 */ -#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" -#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" -#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" -#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" -#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" -#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" - -#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" -#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" -#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" -#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" -#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" -#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" - -/* SEED ciphersuites from RFC4162 */ -#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" -#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" -#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" -#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" -#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" -#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" - -#define TLS_CT_RSA_SIGN 1 -#define TLS_CT_DSS_SIGN 2 -#define TLS_CT_RSA_FIXED_DH 3 -#define TLS_CT_DSS_FIXED_DH 4 -#define TLS_CT_ECDSA_SIGN 64 -#define TLS_CT_RSA_FIXED_ECDH 65 -#define TLS_CT_ECDSA_FIXED_ECDH 66 -#define TLS_CT_NUMBER 7 - -#define TLS1_FINISH_MAC_LENGTH 12 - -#define TLS_MD_MAX_CONST_SIZE 20 -#define TLS_MD_CLIENT_FINISH_CONST "client finished" -#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15 -#define TLS_MD_SERVER_FINISH_CONST "server finished" -#define TLS_MD_SERVER_FINISH_CONST_SIZE 15 -#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" -#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 -#define TLS_MD_KEY_EXPANSION_CONST "key expansion" -#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13 -#define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key" -#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16 -#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" -#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 -#define TLS_MD_IV_BLOCK_CONST "IV block" -#define TLS_MD_IV_BLOCK_CONST_SIZE 8 -#define TLS_MD_MASTER_SECRET_CONST "master secret" -#define TLS_MD_MASTER_SECRET_CONST_SIZE 13 - -#ifdef CHARSET_EBCDIC -#undef TLS_MD_CLIENT_FINISH_CONST -#define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*client finished*/ -#undef TLS_MD_SERVER_FINISH_CONST -#define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*server finished*/ -#undef TLS_MD_SERVER_WRITE_KEY_CONST -#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/ -#undef TLS_MD_KEY_EXPANSION_CONST -#define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" /*key expansion*/ -#undef TLS_MD_CLIENT_WRITE_KEY_CONST -#define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*client write key*/ -#undef TLS_MD_SERVER_WRITE_KEY_CONST -#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/ -#undef TLS_MD_IV_BLOCK_CONST -#define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b" /*IV block*/ -#undef TLS_MD_MASTER_SECRET_CONST -#define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" /*master secret*/ -#endif - -#ifdef __cplusplus -} -#endif -#endif - - - diff --git a/dep/include/openssl/tmdiff.h b/dep/include/openssl/tmdiff.h deleted file mode 100644 index 0409edbaacd..00000000000 --- a/dep/include/openssl/tmdiff.h +++ /dev/null @@ -1,94 +0,0 @@ -/* crypto/tmdiff.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -/* Header for dynamic hash table routines - * Author - Eric Young - */ -/* ... erm yeah, "dynamic hash tables" you say? - * - * And what would dynamic hash tables have to do with any of this code *now*? - * AFAICS, this code is only referenced by crypto/bn/exp.c which is an unused - * file that I doubt compiles any more. speed.c is the only thing that could - * use this (and it has nothing to do with hash tables), yet it instead has its - * own duplication of all this stuff and looks, if anything, more complete. See - * the corresponding note in apps/speed.c. - * The Bemused - Geoff - */ - -#ifndef HEADER_TMDIFF_H -#define HEADER_TMDIFF_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ms_tm MS_TM; - -MS_TM *ms_time_new(void ); -void ms_time_free(MS_TM *a); -void ms_time_get(MS_TM *a); -double ms_time_diff(MS_TM *start, MS_TM *end); -int ms_time_cmp(const MS_TM *ap, const MS_TM *bp); - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/dep/include/openssl/txt_db.h b/dep/include/openssl/txt_db.h deleted file mode 100644 index e78ba87fa9f..00000000000 --- a/dep/include/openssl/txt_db.h +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/txt_db/txt_db.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_TXT_DB_H -#define HEADER_TXT_DB_H - -#include -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#include - -#define DB_ERROR_OK 0 -#define DB_ERROR_MALLOC 1 -#define DB_ERROR_INDEX_CLASH 2 -#define DB_ERROR_INDEX_OUT_OF_RANGE 3 -#define DB_ERROR_NO_INDEX 4 -#define DB_ERROR_INSERT_INDEX_CLASH 5 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct txt_db_st - { - int num_fields; - STACK /* char ** */ *data; - LHASH **index; - int (**qual)(char **); - long error; - long arg1; - long arg2; - char **arg_row; - } TXT_DB; - -#ifndef OPENSSL_NO_BIO -TXT_DB *TXT_DB_read(BIO *in, int num); -long TXT_DB_write(BIO *out, TXT_DB *db); -#else -TXT_DB *TXT_DB_read(char *in, int num); -long TXT_DB_write(char *out, TXT_DB *db); -#endif -int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(char **), - LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); -void TXT_DB_free(TXT_DB *db); -char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); -int TXT_DB_insert(TXT_DB *db,char **value); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/include/openssl/ui.h b/dep/include/openssl/ui.h deleted file mode 100644 index 3a2f29e67ee..00000000000 --- a/dep/include/openssl/ui.h +++ /dev/null @@ -1,382 +0,0 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ -/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL - * project 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_UI_H -#define HEADER_UI_H - -#ifndef OPENSSL_NO_DEPRECATED -#include -#endif -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Declared already in ossl_typ.h */ -/* typedef struct ui_st UI; */ -/* typedef struct ui_method_st UI_METHOD; */ - - -/* All the following functions return -1 or NULL on error and in some cases - (UI_process()) -2 if interrupted or in some other way cancelled. - When everything is fine, they return 0, a positive value or a non-NULL - pointer, all depending on their purpose. */ - -/* Creators and destructor. */ -UI *UI_new(void); -UI *UI_new_method(const UI_METHOD *method); -void UI_free(UI *ui); - -/* The following functions are used to add strings to be printed and prompt - strings to prompt for data. The names are UI_{add,dup}__string - and UI_{add,dup}_input_boolean. - - UI_{add,dup}__string have the following meanings: - add add a text or prompt string. The pointers given to these - functions are used verbatim, no copying is done. - dup make a copy of the text or prompt string, then add the copy - to the collection of strings in the user interface. - - The function is a name for the functionality that the given - string shall be used for. It can be one of: - input use the string as data prompt. - verify use the string as verification prompt. This - is used to verify a previous input. - info use the string for informational output. - error use the string for error output. - Honestly, there's currently no difference between info and error for the - moment. - - UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", - and are typically used when one wants to prompt for a yes/no response. - - - All of the functions in this group take a UI and a prompt string. - The string input and verify addition functions also take a flag argument, - a buffer for the result to end up with, a minimum input size and a maximum - input size (the result buffer MUST be large enough to be able to contain - the maximum number of characters). Additionally, the verify addition - functions takes another buffer to compare the result against. - The boolean input functions take an action description string (which should - be safe to ignore if the expected user action is obvious, for example with - a dialog box with an OK button and a Cancel button), a string of acceptable - characters to mean OK and to mean Cancel. The two last strings are checked - to make sure they don't have common characters. Additionally, the same - flag argument as for the string input is taken, as well as a result buffer. - The result buffer is required to be at least one byte long. Depending on - the answer, the first character from the OK or the Cancel character strings - will be stored in the first byte of the result buffer. No NUL will be - added, so the result is *not* a string. - - On success, the all return an index of the added information. That index - is usefull when retrieving results with UI_get0_result(). */ -int UI_add_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); -int UI_dup_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); -int UI_add_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); -int UI_dup_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); -int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); -int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); -int UI_add_info_string(UI *ui, const char *text); -int UI_dup_info_string(UI *ui, const char *text); -int UI_add_error_string(UI *ui, const char *text); -int UI_dup_error_string(UI *ui, const char *text); - -/* These are the possible flags. They can be or'ed together. */ -/* Use to have echoing of input */ -#define UI_INPUT_FLAG_ECHO 0x01 -/* Use a default password. Where that password is found is completely - up to the application, it might for example be in the user data set - with UI_add_user_data(). It is not recommended to have more than - one input in each UI being marked with this flag, or the application - might get confused. */ -#define UI_INPUT_FLAG_DEFAULT_PWD 0x02 - -/* The user of these routines may want to define flags of their own. The core - UI won't look at those, but will pass them on to the method routines. They - must use higher bits so they don't get confused with the UI bits above. - UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good - example of use is this: - - #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) - -*/ -#define UI_INPUT_FLAG_USER_BASE 16 - - -/* The following function helps construct a prompt. object_desc is a - textual short description of the object, for example "pass phrase", - and object_name is the name of the object (might be a card name or - a file name. - The returned string shall always be allocated on the heap with - OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). - - If the ui_method doesn't contain a pointer to a user-defined prompt - constructor, a default string is built, looking like this: - - "Enter {object_desc} for {object_name}:" - - So, if object_desc has the value "pass phrase" and object_name has - the value "foo.key", the resulting string is: - - "Enter pass phrase for foo.key:" -*/ -char *UI_construct_prompt(UI *ui_method, - const char *object_desc, const char *object_name); - - -/* The following function is used to store a pointer to user-specific data. - Any previous such pointer will be returned and replaced. - - For callback purposes, this function makes a lot more sense than using - ex_data, since the latter requires that different parts of OpenSSL or - applications share the same ex_data index. - - Note that the UI_OpenSSL() method completely ignores the user data. - Other methods may not, however. */ -void *UI_add_user_data(UI *ui, void *user_data); -/* We need a user data retrieving function as well. */ -void *UI_get0_user_data(UI *ui); - -/* Return the result associated with a prompt given with the index i. */ -const char *UI_get0_result(UI *ui, int i); - -/* When all strings have been added, process the whole thing. */ -int UI_process(UI *ui); - -/* Give a user interface parametrised control commands. This can be used to - send down an integer, a data pointer or a function pointer, as well as - be used to get information from a UI. */ -int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)); - -/* The commands */ -/* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the - OpenSSL error stack before printing any info or added error messages and - before any prompting. */ -#define UI_CTRL_PRINT_ERRORS 1 -/* Check if a UI_process() is possible to do again with the same instance of - a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 - if not. */ -#define UI_CTRL_IS_REDOABLE 2 - - -/* Some methods may use extra data */ -#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) -#define UI_get_app_data(s) UI_get_ex_data(s,0) -int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int UI_set_ex_data(UI *r,int idx,void *arg); -void *UI_get_ex_data(UI *r, int idx); - -/* Use specific methods instead of the built-in one */ -void UI_set_default_method(const UI_METHOD *meth); -const UI_METHOD *UI_get_default_method(void); -const UI_METHOD *UI_get_method(UI *ui); -const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); - -/* The method with all the built-in thingies */ -UI_METHOD *UI_OpenSSL(void); - - -/* ---------- For method writers ---------- */ -/* A method contains a number of functions that implement the low level - of the User Interface. The functions are: - - an opener This function starts a session, maybe by opening - a channel to a tty, or by opening a window. - a writer This function is called to write a given string, - maybe to the tty, maybe as a field label in a - window. - a flusher This function is called to flush everything that - has been output so far. It can be used to actually - display a dialog box after it has been built. - a reader This function is called to read a given prompt, - maybe from the tty, maybe from a field in a - window. Note that it's called wth all string - structures, not only the prompt ones, so it must - check such things itself. - a closer This function closes the session, maybe by closing - the channel to the tty, or closing the window. - - All these functions are expected to return: - - 0 on error. - 1 on success. - -1 on out-of-band events, for example if some prompting has - been canceled (by pressing Ctrl-C, for example). This is - only checked when returned by the flusher or the reader. - - The way this is used, the opener is first called, then the writer for all - strings, then the flusher, then the reader for all strings and finally the - closer. Note that if you want to prompt from a terminal or other command - line interface, the best is to have the reader also write the prompts - instead of having the writer do it. If you want to prompt from a dialog - box, the writer can be used to build up the contents of the box, and the - flusher to actually display the box and run the event loop until all data - has been given, after which the reader only grabs the given data and puts - them back into the UI strings. - - All method functions take a UI as argument. Additionally, the writer and - the reader take a UI_STRING. -*/ - -/* The UI_STRING type is the data structure that contains all the needed info - about a string or a prompt, including test data for a verification prompt. -*/ -DECLARE_STACK_OF(UI_STRING) -typedef struct ui_string_st UI_STRING; - -/* The different types of strings that are currently supported. - This is only needed by method authors. */ -enum UI_string_types - { - UIT_NONE=0, - UIT_PROMPT, /* Prompt for a string */ - UIT_VERIFY, /* Prompt for a string and verify */ - UIT_BOOLEAN, /* Prompt for a yes/no response */ - UIT_INFO, /* Send info to the user */ - UIT_ERROR /* Send an error message to the user */ - }; - -/* Create and manipulate methods */ -UI_METHOD *UI_create_method(char *name); -void UI_destroy_method(UI_METHOD *ui_method); -int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)); -int UI_method_set_writer(UI_METHOD *method, int (*writer)(UI *ui, UI_STRING *uis)); -int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)); -int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis)); -int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); -int (*UI_method_get_opener(UI_METHOD *method))(UI*); -int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); -int (*UI_method_get_flusher(UI_METHOD *method))(UI*); -int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); -int (*UI_method_get_closer(UI_METHOD *method))(UI*); - -/* The following functions are helpers for method writers to access relevant - data from a UI_STRING. */ - -/* Return type of the UI_STRING */ -enum UI_string_types UI_get_string_type(UI_STRING *uis); -/* Return input flags of the UI_STRING */ -int UI_get_input_flags(UI_STRING *uis); -/* Return the actual string to output (the prompt, info or error) */ -const char *UI_get0_output_string(UI_STRING *uis); -/* Return the optional action string to output (the boolean promtp instruction) */ -const char *UI_get0_action_string(UI_STRING *uis); -/* Return the result of a prompt */ -const char *UI_get0_result_string(UI_STRING *uis); -/* Return the string to test the result against. Only useful with verifies. */ -const char *UI_get0_test_string(UI_STRING *uis); -/* Return the required minimum size of the result */ -int UI_get_result_minsize(UI_STRING *uis); -/* Return the required maximum size of the result */ -int UI_get_result_maxsize(UI_STRING *uis); -/* Set the result of a UI_STRING. */ -int UI_set_result(UI *ui, UI_STRING *uis, const char *result); - - -/* A couple of popular utility functions */ -int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify); -int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); - - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_UI_strings(void); - -/* Error codes for the UI functions. */ - -/* Function codes. */ -#define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 -#define UI_F_GENERAL_ALLOCATE_PROMPT 109 -#define UI_F_GENERAL_ALLOCATE_STRING 100 -#define UI_F_UI_CTRL 111 -#define UI_F_UI_DUP_ERROR_STRING 101 -#define UI_F_UI_DUP_INFO_STRING 102 -#define UI_F_UI_DUP_INPUT_BOOLEAN 110 -#define UI_F_UI_DUP_INPUT_STRING 103 -#define UI_F_UI_DUP_VERIFY_STRING 106 -#define UI_F_UI_GET0_RESULT 107 -#define UI_F_UI_NEW_METHOD 104 -#define UI_F_UI_SET_RESULT 105 - -/* Reason codes. */ -#define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 -#define UI_R_INDEX_TOO_LARGE 102 -#define UI_R_INDEX_TOO_SMALL 103 -#define UI_R_NO_RESULT_BUFFER 105 -#define UI_R_RESULT_TOO_LARGE 100 -#define UI_R_RESULT_TOO_SMALL 101 -#define UI_R_UNKNOWN_CONTROL_COMMAND 106 - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/ui_compat.h b/dep/include/openssl/ui_compat.h deleted file mode 100644 index 4687853772a..00000000000 --- a/dep/include/openssl/ui_compat.h +++ /dev/null @@ -1,84 +0,0 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ -/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL - * project 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_UI_COMPAT_H -#define HEADER_UI_COMPAT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* The following functions were previously part of the DES section, - and are provided here for backward compatibility reasons. */ - -#define des_read_pw_string(b,l,p,v) \ - _ossl_old_des_read_pw_string((b),(l),(p),(v)) -#define des_read_pw(b,bf,s,p,v) \ - _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) - -int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); -int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/openssl/x509.h b/dep/include/openssl/x509.h deleted file mode 100644 index e71b5257e57..00000000000 --- a/dep/include/openssl/x509.h +++ /dev/null @@ -1,1355 +0,0 @@ -/* crypto/x509/x509.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_X509_H -#define HEADER_X509_H - -#include -#include -#ifndef OPENSSL_NO_BUFFER -#include -#endif -#ifndef OPENSSL_NO_EVP -#include -#endif -#ifndef OPENSSL_NO_BIO -#include -#endif -#include -#include -#include - -#ifndef OPENSSL_NO_EC -#include -#endif - -#ifndef OPENSSL_NO_ECDSA -#include -#endif - -#ifndef OPENSSL_NO_ECDH -#include -#endif - -#ifndef OPENSSL_NO_DEPRECATED -#ifndef OPENSSL_NO_RSA -#include -#endif -#ifndef OPENSSL_NO_DSA -#include -#endif -#ifndef OPENSSL_NO_DH -#include -#endif -#endif - -#ifndef OPENSSL_NO_SHA -#include -#endif -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_SYS_WIN32 -/* Under Win32 these are defined in wincrypt.h */ -#undef X509_NAME -#undef X509_CERT_PAIR -#endif - -#define X509_FILETYPE_PEM 1 -#define X509_FILETYPE_ASN1 2 -#define X509_FILETYPE_DEFAULT 3 - -#define X509v3_KU_DIGITAL_SIGNATURE 0x0080 -#define X509v3_KU_NON_REPUDIATION 0x0040 -#define X509v3_KU_KEY_ENCIPHERMENT 0x0020 -#define X509v3_KU_DATA_ENCIPHERMENT 0x0010 -#define X509v3_KU_KEY_AGREEMENT 0x0008 -#define X509v3_KU_KEY_CERT_SIGN 0x0004 -#define X509v3_KU_CRL_SIGN 0x0002 -#define X509v3_KU_ENCIPHER_ONLY 0x0001 -#define X509v3_KU_DECIPHER_ONLY 0x8000 -#define X509v3_KU_UNDEF 0xffff - -typedef struct X509_objects_st - { - int nid; - int (*a2i)(void); - int (*i2a)(void); - } X509_OBJECTS; - -struct X509_algor_st - { - ASN1_OBJECT *algorithm; - ASN1_TYPE *parameter; - } /* X509_ALGOR */; - -DECLARE_ASN1_SET_OF(X509_ALGOR) - -typedef STACK_OF(X509_ALGOR) X509_ALGORS; - -typedef struct X509_val_st - { - ASN1_TIME *notBefore; - ASN1_TIME *notAfter; - } X509_VAL; - -typedef struct X509_pubkey_st - { - X509_ALGOR *algor; - ASN1_BIT_STRING *public_key; - EVP_PKEY *pkey; - } X509_PUBKEY; - -typedef struct X509_sig_st - { - X509_ALGOR *algor; - ASN1_OCTET_STRING *digest; - } X509_SIG; - -typedef struct X509_name_entry_st - { - ASN1_OBJECT *object; - ASN1_STRING *value; - int set; - int size; /* temp variable */ - } X509_NAME_ENTRY; - -DECLARE_STACK_OF(X509_NAME_ENTRY) -DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) - -/* we always keep X509_NAMEs in 2 forms. */ -struct X509_name_st - { - STACK_OF(X509_NAME_ENTRY) *entries; - int modified; /* true if 'bytes' needs to be built */ -#ifndef OPENSSL_NO_BUFFER - BUF_MEM *bytes; -#else - char *bytes; -#endif - unsigned long hash; /* Keep the hash around for lookups */ - } /* X509_NAME */; - -DECLARE_STACK_OF(X509_NAME) - -#define X509_EX_V_NETSCAPE_HACK 0x8000 -#define X509_EX_V_INIT 0x0001 -typedef struct X509_extension_st - { - ASN1_OBJECT *object; - ASN1_BOOLEAN critical; - ASN1_OCTET_STRING *value; - } X509_EXTENSION; - -typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; - -DECLARE_STACK_OF(X509_EXTENSION) -DECLARE_ASN1_SET_OF(X509_EXTENSION) - -/* a sequence of these are used */ -typedef struct x509_attributes_st - { - ASN1_OBJECT *object; - int single; /* 0 for a set, 1 for a single item (which is wrong) */ - union { - char *ptr; -/* 0 */ STACK_OF(ASN1_TYPE) *set; -/* 1 */ ASN1_TYPE *single; - } value; - } X509_ATTRIBUTE; - -DECLARE_STACK_OF(X509_ATTRIBUTE) -DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) - - -typedef struct X509_req_info_st - { - ASN1_ENCODING enc; - ASN1_INTEGER *version; - X509_NAME *subject; - X509_PUBKEY *pubkey; - /* d=2 hl=2 l= 0 cons: cont: 00 */ - STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ - } X509_REQ_INFO; - -typedef struct X509_req_st - { - X509_REQ_INFO *req_info; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int references; - } X509_REQ; - -typedef struct x509_cinf_st - { - ASN1_INTEGER *version; /* [ 0 ] default of v1 */ - ASN1_INTEGER *serialNumber; - X509_ALGOR *signature; - X509_NAME *issuer; - X509_VAL *validity; - X509_NAME *subject; - X509_PUBKEY *key; - ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ - ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ - STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ - } X509_CINF; - -/* This stuff is certificate "auxiliary info" - * it contains details which are useful in certificate - * stores and databases. When used this is tagged onto - * the end of the certificate itself - */ - -typedef struct x509_cert_aux_st - { - STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ - STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ - ASN1_UTF8STRING *alias; /* "friendly name" */ - ASN1_OCTET_STRING *keyid; /* key id of private key */ - STACK_OF(X509_ALGOR) *other; /* other unspecified info */ - } X509_CERT_AUX; - -struct x509_st - { - X509_CINF *cert_info; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int valid; - int references; - char *name; - CRYPTO_EX_DATA ex_data; - /* These contain copies of various extension values */ - long ex_pathlen; - long ex_pcpathlen; - unsigned long ex_flags; - unsigned long ex_kusage; - unsigned long ex_xkusage; - unsigned long ex_nscert; - ASN1_OCTET_STRING *skid; - struct AUTHORITY_KEYID_st *akid; - X509_POLICY_CACHE *policy_cache; -#ifndef OPENSSL_NO_RFC3779 - STACK_OF(IPAddressFamily) *rfc3779_addr; - struct ASIdentifiers_st *rfc3779_asid; -#endif -#ifndef OPENSSL_NO_SHA - unsigned char sha1_hash[SHA_DIGEST_LENGTH]; -#endif - X509_CERT_AUX *aux; - } /* X509 */; - -DECLARE_STACK_OF(X509) -DECLARE_ASN1_SET_OF(X509) - -/* This is used for a table of trust checking functions */ - -typedef struct x509_trust_st { - int trust; - int flags; - int (*check_trust)(struct x509_trust_st *, X509 *, int); - char *name; - int arg1; - void *arg2; -} X509_TRUST; - -DECLARE_STACK_OF(X509_TRUST) - -typedef struct x509_cert_pair_st { - X509 *forward; - X509 *reverse; -} X509_CERT_PAIR; - -/* standard trust ids */ - -#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ - -#define X509_TRUST_COMPAT 1 -#define X509_TRUST_SSL_CLIENT 2 -#define X509_TRUST_SSL_SERVER 3 -#define X509_TRUST_EMAIL 4 -#define X509_TRUST_OBJECT_SIGN 5 -#define X509_TRUST_OCSP_SIGN 6 -#define X509_TRUST_OCSP_REQUEST 7 - -/* Keep these up to date! */ -#define X509_TRUST_MIN 1 -#define X509_TRUST_MAX 7 - - -/* trust_flags values */ -#define X509_TRUST_DYNAMIC 1 -#define X509_TRUST_DYNAMIC_NAME 2 - -/* check_trust return codes */ - -#define X509_TRUST_TRUSTED 1 -#define X509_TRUST_REJECTED 2 -#define X509_TRUST_UNTRUSTED 3 - -/* Flags for X509_print_ex() */ - -#define X509_FLAG_COMPAT 0 -#define X509_FLAG_NO_HEADER 1L -#define X509_FLAG_NO_VERSION (1L << 1) -#define X509_FLAG_NO_SERIAL (1L << 2) -#define X509_FLAG_NO_SIGNAME (1L << 3) -#define X509_FLAG_NO_ISSUER (1L << 4) -#define X509_FLAG_NO_VALIDITY (1L << 5) -#define X509_FLAG_NO_SUBJECT (1L << 6) -#define X509_FLAG_NO_PUBKEY (1L << 7) -#define X509_FLAG_NO_EXTENSIONS (1L << 8) -#define X509_FLAG_NO_SIGDUMP (1L << 9) -#define X509_FLAG_NO_AUX (1L << 10) -#define X509_FLAG_NO_ATTRIBUTES (1L << 11) - -/* Flags specific to X509_NAME_print_ex() */ - -/* The field separator information */ - -#define XN_FLAG_SEP_MASK (0xf << 16) - -#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */ -#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ -#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ -#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ -#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ - -#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ - -/* How the field name is shown */ - -#define XN_FLAG_FN_MASK (0x3 << 21) - -#define XN_FLAG_FN_SN 0 /* Object short name */ -#define XN_FLAG_FN_LN (1 << 21) /* Object long name */ -#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ -#define XN_FLAG_FN_NONE (3 << 21) /* No field names */ - -#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ - -/* This determines if we dump fields we don't recognise: - * RFC2253 requires this. - */ - -#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) - -#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ - -/* Complete set of RFC2253 flags */ - -#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ - XN_FLAG_SEP_COMMA_PLUS | \ - XN_FLAG_DN_REV | \ - XN_FLAG_FN_SN | \ - XN_FLAG_DUMP_UNKNOWN_FIELDS) - -/* readable oneline form */ - -#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ - ASN1_STRFLGS_ESC_QUOTE | \ - XN_FLAG_SEP_CPLUS_SPC | \ - XN_FLAG_SPC_EQ | \ - XN_FLAG_FN_SN) - -/* readable multiline form */ - -#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ - ASN1_STRFLGS_ESC_MSB | \ - XN_FLAG_SEP_MULTILINE | \ - XN_FLAG_SPC_EQ | \ - XN_FLAG_FN_LN | \ - XN_FLAG_FN_ALIGN) - -typedef struct X509_revoked_st - { - ASN1_INTEGER *serialNumber; - ASN1_TIME *revocationDate; - STACK_OF(X509_EXTENSION) /* optional */ *extensions; - int sequence; /* load sequence */ - } X509_REVOKED; - -DECLARE_STACK_OF(X509_REVOKED) -DECLARE_ASN1_SET_OF(X509_REVOKED) - -typedef struct X509_crl_info_st - { - ASN1_INTEGER *version; - X509_ALGOR *sig_alg; - X509_NAME *issuer; - ASN1_TIME *lastUpdate; - ASN1_TIME *nextUpdate; - STACK_OF(X509_REVOKED) *revoked; - STACK_OF(X509_EXTENSION) /* [0] */ *extensions; - ASN1_ENCODING enc; - } X509_CRL_INFO; - -struct X509_crl_st - { - /* actual signature */ - X509_CRL_INFO *crl; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int references; - } /* X509_CRL */; - -DECLARE_STACK_OF(X509_CRL) -DECLARE_ASN1_SET_OF(X509_CRL) - -typedef struct private_key_st - { - int version; - /* The PKCS#8 data types */ - X509_ALGOR *enc_algor; - ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ - - /* When decrypted, the following will not be NULL */ - EVP_PKEY *dec_pkey; - - /* used to encrypt and decrypt */ - int key_length; - char *key_data; - int key_free; /* true if we should auto free key_data */ - - /* expanded version of 'enc_algor' */ - EVP_CIPHER_INFO cipher; - - int references; - } X509_PKEY; - -#ifndef OPENSSL_NO_EVP -typedef struct X509_info_st - { - X509 *x509; - X509_CRL *crl; - X509_PKEY *x_pkey; - - EVP_CIPHER_INFO enc_cipher; - int enc_len; - char *enc_data; - - int references; - } X509_INFO; - -DECLARE_STACK_OF(X509_INFO) -#endif - -/* The next 2 structures and their 8 routines were sent to me by - * Pat Richard and are used to manipulate - * Netscapes spki structures - useful if you are writing a CA web page - */ -typedef struct Netscape_spkac_st - { - X509_PUBKEY *pubkey; - ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ - } NETSCAPE_SPKAC; - -typedef struct Netscape_spki_st - { - NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ - X509_ALGOR *sig_algor; - ASN1_BIT_STRING *signature; - } NETSCAPE_SPKI; - -/* Netscape certificate sequence structure */ -typedef struct Netscape_certificate_sequence - { - ASN1_OBJECT *type; - STACK_OF(X509) *certs; - } NETSCAPE_CERT_SEQUENCE; - -/* Unused (and iv length is wrong) -typedef struct CBCParameter_st - { - unsigned char iv[8]; - } CBC_PARAM; -*/ - -/* Password based encryption structure */ - -typedef struct PBEPARAM_st { -ASN1_OCTET_STRING *salt; -ASN1_INTEGER *iter; -} PBEPARAM; - -/* Password based encryption V2 structures */ - -typedef struct PBE2PARAM_st { -X509_ALGOR *keyfunc; -X509_ALGOR *encryption; -} PBE2PARAM; - -typedef struct PBKDF2PARAM_st { -ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */ -ASN1_INTEGER *iter; -ASN1_INTEGER *keylength; -X509_ALGOR *prf; -} PBKDF2PARAM; - - -/* PKCS#8 private key info structure */ - -typedef struct pkcs8_priv_key_info_st - { - int broken; /* Flag for various broken formats */ -#define PKCS8_OK 0 -#define PKCS8_NO_OCTET 1 -#define PKCS8_EMBEDDED_PARAM 2 -#define PKCS8_NS_DB 3 - ASN1_INTEGER *version; - X509_ALGOR *pkeyalg; - ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ - STACK_OF(X509_ATTRIBUTE) *attributes; - } PKCS8_PRIV_KEY_INFO; - -#ifdef __cplusplus -} -#endif - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef SSLEAY_MACROS -#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ - a->signature,(char *)a->cert_info,r) -#define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \ - a->sig_alg,a->signature,(char *)a->req_info,r) -#define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \ - a->sig_alg, a->signature,(char *)a->crl,r) - -#define X509_sign(x,pkey,md) \ - ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \ - x->sig_alg, x->signature, (char *)x->cert_info,pkey,md) -#define X509_REQ_sign(x,pkey,md) \ - ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \ - x->signature, (char *)x->req_info,pkey,md) -#define X509_CRL_sign(x,pkey,md) \ - ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \ - x->signature, (char *)x->crl,pkey,md) -#define NETSCAPE_SPKI_sign(x,pkey,md) \ - ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \ - x->signature, (char *)x->spkac,pkey,md) - -#define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ - (char *(*)())d2i_X509,(char *)x509) -#define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\ - (int (*)())i2d_X509_ATTRIBUTE, \ - (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa) -#define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ - (int (*)())i2d_X509_EXTENSION, \ - (char *(*)())d2i_X509_EXTENSION,(char *)ex) -#define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \ - (char *(*)())d2i_X509, (fp),(unsigned char **)(x509)) -#define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509) -#define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \ - (char *(*)())d2i_X509, (bp),(unsigned char **)(x509)) -#define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509) - -#define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \ - (char *(*)())d2i_X509_CRL,(char *)crl) -#define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \ - X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\ - (unsigned char **)(crl)) -#define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\ - (unsigned char *)crl) -#define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \ - X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\ - (unsigned char **)(crl)) -#define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\ - (unsigned char *)crl) - -#define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \ - (char *(*)())d2i_PKCS7,(char *)p7) -#define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \ - PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\ - (unsigned char **)(p7)) -#define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\ - (unsigned char *)p7) -#define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \ - PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\ - (unsigned char **)(p7)) -#define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\ - (unsigned char *)p7) - -#define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \ - (char *(*)())d2i_X509_REQ,(char *)req) -#define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\ - X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\ - (unsigned char **)(req)) -#define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\ - (unsigned char *)req) -#define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\ - X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\ - (unsigned char **)(req)) -#define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\ - (unsigned char *)req) - -#define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \ - (char *(*)())d2i_RSAPublicKey,(char *)rsa) -#define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \ - (char *(*)())d2i_RSAPrivateKey,(char *)rsa) - -#define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ - RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \ - (unsigned char **)(rsa)) -#define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \ - (unsigned char *)rsa) -#define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ - RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \ - (unsigned char **)(rsa)) -#define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \ - (unsigned char *)rsa) - -#define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ - RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \ - (unsigned char **)(rsa)) -#define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \ - (unsigned char *)rsa) -#define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ - RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \ - (unsigned char **)(rsa)) -#define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \ - (unsigned char *)rsa) - -#define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\ - DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \ - (unsigned char **)(dsa)) -#define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \ - (unsigned char *)dsa) -#define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\ - DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \ - (unsigned char **)(dsa)) -#define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ - (unsigned char *)dsa) - -#define d2i_ECPrivateKey_fp(fp,ecdsa) (EC_KEY *)ASN1_d2i_fp((char *(*)())\ - EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), \ - (unsigned char **)(ecdsa)) -#define i2d_ECPrivateKey_fp(fp,ecdsa) ASN1_i2d_fp(i2d_ECPrivateKey,fp, \ - (unsigned char *)ecdsa) -#define d2i_ECPrivateKey_bio(bp,ecdsa) (EC_KEY *)ASN1_d2i_bio((char *(*)())\ - EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), \ - (unsigned char **)(ecdsa)) -#define i2d_ECPrivateKey_bio(bp,ecdsa) ASN1_i2d_bio(i2d_ECPrivateKey,bp, \ - (unsigned char *)ecdsa) - -#define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\ - (char *(*)())d2i_X509_ALGOR,(char *)xn) - -#define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ - (char *(*)())d2i_X509_NAME,(char *)xn) -#define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ - (int (*)())i2d_X509_NAME_ENTRY, \ - (char *(*)())d2i_X509_NAME_ENTRY,\ - (char *)ne) - -#define X509_digest(data,type,md,len) \ - ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) -#define X509_NAME_digest(data,type,md,len) \ - ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) -#ifndef PKCS7_ISSUER_AND_SERIAL_digest -#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ - ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ - (char *)data,md,len) -#endif -#endif - -#define X509_EXT_PACK_UNKNOWN 1 -#define X509_EXT_PACK_STRING 2 - -#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) -/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ -#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) -#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) -#define X509_extract_key(x) X509_get_pubkey(x) /*****/ -#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) -#define X509_REQ_get_subject_name(x) ((x)->req_info->subject) -#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) -#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) -#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) - -#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) -#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) -#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) -#define X509_CRL_get_issuer(x) ((x)->crl->issuer) -#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) - -/* This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ -#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) - - -const char *X509_verify_cert_error_string(long n); - -#ifndef SSLEAY_MACROS -#ifndef OPENSSL_NO_EVP -int X509_verify(X509 *a, EVP_PKEY *r); - -int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); -int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); -int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); - -NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); -char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); -EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); -int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); - -int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); - -int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); - -int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); -int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); -int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); -int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); - -int X509_pubkey_digest(const X509 *data,const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_digest(const X509 *data,const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, - unsigned char *md, unsigned int *len); -#endif - -#ifndef OPENSSL_NO_FP_API -X509 *d2i_X509_fp(FILE *fp, X509 **x509); -int i2d_X509_fp(FILE *fp,X509 *x509); -X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); -int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); -X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); -int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); -#ifndef OPENSSL_NO_RSA -RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); -int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); -RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); -int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); -RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); -int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); -#endif -#ifndef OPENSSL_NO_DSA -DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); -int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); -DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); -int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); -#endif -#ifndef OPENSSL_NO_EC -EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); -int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); -EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); -int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); -#endif -X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); -int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, - PKCS8_PRIV_KEY_INFO **p8inf); -int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); -int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); -int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); -int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); -#endif - -#ifndef OPENSSL_NO_BIO -X509 *d2i_X509_bio(BIO *bp,X509 **x509); -int i2d_X509_bio(BIO *bp,X509 *x509); -X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); -int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); -X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); -int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); -#ifndef OPENSSL_NO_RSA -RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); -int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); -RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); -int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); -RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); -int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); -#endif -#ifndef OPENSSL_NO_DSA -DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); -int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); -DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); -int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); -#endif -#ifndef OPENSSL_NO_EC -EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); -int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey); -EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); -int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey); -#endif -X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); -int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, - PKCS8_PRIV_KEY_INFO **p8inf); -int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); -int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); -int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); -int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); -#endif - -X509 *X509_dup(X509 *x509); -X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); -X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); -X509_CRL *X509_CRL_dup(X509_CRL *crl); -X509_REQ *X509_REQ_dup(X509_REQ *req); -X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); -int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); -void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, - X509_ALGOR *algor); - -X509_NAME *X509_NAME_dup(X509_NAME *xn); -X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); - -#endif /* !SSLEAY_MACROS */ - -int X509_cmp_time(ASN1_TIME *s, time_t *t); -int X509_cmp_current_time(ASN1_TIME *s); -ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t); -ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj); - -const char * X509_get_default_cert_area(void ); -const char * X509_get_default_cert_dir(void ); -const char * X509_get_default_cert_file(void ); -const char * X509_get_default_cert_dir_env(void ); -const char * X509_get_default_cert_file_env(void ); -const char * X509_get_default_private_dir(void ); - -X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); -X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); - -DECLARE_ASN1_FUNCTIONS(X509_ALGOR) -DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) -DECLARE_ASN1_FUNCTIONS(X509_VAL) - -DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) - -int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); -EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); -int X509_get_pubkey_parameters(EVP_PKEY *pkey, - STACK_OF(X509) *chain); -int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); -EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp, - long length); -#ifndef OPENSSL_NO_RSA -int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); -RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp, - long length); -#endif -#ifndef OPENSSL_NO_DSA -int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); -DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp, - long length); -#endif -#ifndef OPENSSL_NO_EC -int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp); -EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, - long length); -#endif - -DECLARE_ASN1_FUNCTIONS(X509_SIG) -DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) -DECLARE_ASN1_FUNCTIONS(X509_REQ) - -DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) -X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); - -DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) -DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) - -DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) - -DECLARE_ASN1_FUNCTIONS(X509_NAME) - -int X509_NAME_set(X509_NAME **xn, X509_NAME *name); - -DECLARE_ASN1_FUNCTIONS(X509_CINF) - -DECLARE_ASN1_FUNCTIONS(X509) -DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) - -DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR) - -int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int X509_set_ex_data(X509 *r, int idx, void *arg); -void *X509_get_ex_data(X509 *r, int idx); -int i2d_X509_AUX(X509 *a,unsigned char **pp); -X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); - -int X509_alias_set1(X509 *x, unsigned char *name, int len); -int X509_keyid_set1(X509 *x, unsigned char *id, int len); -unsigned char * X509_alias_get0(X509 *x, int *len); -unsigned char * X509_keyid_get0(X509 *x, int *len); -int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); -int X509_TRUST_set(int *t, int trust); -int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); -int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); -void X509_trust_clear(X509 *x); -void X509_reject_clear(X509 *x); - -DECLARE_ASN1_FUNCTIONS(X509_REVOKED) -DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) -DECLARE_ASN1_FUNCTIONS(X509_CRL) - -int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); - -X509_PKEY * X509_PKEY_new(void ); -void X509_PKEY_free(X509_PKEY *a); -int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); -X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length); - -DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) -DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) -DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) - -#ifndef OPENSSL_NO_EVP -X509_INFO * X509_INFO_new(void); -void X509_INFO_free(X509_INFO *a); -char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); - -int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, - ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); - -int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data, - unsigned char *md,unsigned int *len); - -int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, - X509_ALGOR *algor2, ASN1_BIT_STRING *signature, - char *data,EVP_PKEY *pkey, const EVP_MD *type); - -int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, - unsigned char *md,unsigned int *len); - -int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, - ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey); - -int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, - ASN1_BIT_STRING *signature, - void *data, EVP_PKEY *pkey, const EVP_MD *type); -#endif - -int X509_set_version(X509 *x,long version); -int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); -ASN1_INTEGER * X509_get_serialNumber(X509 *x); -int X509_set_issuer_name(X509 *x, X509_NAME *name); -X509_NAME * X509_get_issuer_name(X509 *a); -int X509_set_subject_name(X509 *x, X509_NAME *name); -X509_NAME * X509_get_subject_name(X509 *a); -int X509_set_notBefore(X509 *x, ASN1_TIME *tm); -int X509_set_notAfter(X509 *x, ASN1_TIME *tm); -int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); -EVP_PKEY * X509_get_pubkey(X509 *x); -ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); -int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); - -int X509_REQ_set_version(X509_REQ *x,long version); -int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); -int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); -EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); -int X509_REQ_extension_nid(int nid); -int * X509_REQ_get_extension_nids(void); -void X509_REQ_set_extension_nids(int *nids); -STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); -int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, - int nid); -int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); -int X509_REQ_get_attr_count(const X509_REQ *req); -int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, - int lastpos); -int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); -X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); -int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); -int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, - const ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len); -int X509_REQ_add1_attr_by_NID(X509_REQ *req, - int nid, int type, - const unsigned char *bytes, int len); -int X509_REQ_add1_attr_by_txt(X509_REQ *req, - const char *attrname, int type, - const unsigned char *bytes, int len); - -int X509_CRL_set_version(X509_CRL *x, long version); -int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); -int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm); -int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm); -int X509_CRL_sort(X509_CRL *crl); - -int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); -int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); - -int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); - -int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); - -int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); -unsigned long X509_issuer_and_serial_hash(X509 *a); - -int X509_issuer_name_cmp(const X509 *a, const X509 *b); -unsigned long X509_issuer_name_hash(X509 *a); - -int X509_subject_name_cmp(const X509 *a, const X509 *b); -unsigned long X509_subject_name_hash(X509 *x); - -int X509_cmp(const X509 *a, const X509 *b); -int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); -unsigned long X509_NAME_hash(X509_NAME *x); - -int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); -#ifndef OPENSSL_NO_FP_API -int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag); -int X509_print_fp(FILE *bp,X509 *x); -int X509_CRL_print_fp(FILE *bp,X509_CRL *x); -int X509_REQ_print_fp(FILE *bp,X509_REQ *req); -int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); -#endif - -#ifndef OPENSSL_NO_BIO -int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); -int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); -int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); -int X509_print(BIO *bp,X509 *x); -int X509_ocspid_print(BIO *bp,X509 *x); -int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); -int X509_CRL_print(BIO *bp,X509_CRL *x); -int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag); -int X509_REQ_print(BIO *bp,X509_REQ *req); -#endif - -int X509_NAME_entry_count(X509_NAME *name); -int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, - char *buf,int len); -int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, - char *buf,int len); - -/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use - * lastpos, search after that position on. */ -int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); -int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, - int lastpos); -X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); -X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); -int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, - int loc, int set); -int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, - unsigned char *bytes, int len, int loc, int set); -int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, - unsigned char *bytes, int len, int loc, int set); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, - const char *field, int type, const unsigned char *bytes, int len); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, - int type,unsigned char *bytes, int len); -int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, - const unsigned char *bytes, int len, int loc, int set); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, - ASN1_OBJECT *obj, int type,const unsigned char *bytes, - int len); -int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, - ASN1_OBJECT *obj); -int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, - const unsigned char *bytes, int len); -ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); -ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); - -int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); -int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, - int nid, int lastpos); -int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, - ASN1_OBJECT *obj,int lastpos); -int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, - int crit, int lastpos); -X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); -X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); -STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, - X509_EXTENSION *ex, int loc); - -int X509_get_ext_count(X509 *x); -int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); -int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); -int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); -X509_EXTENSION *X509_get_ext(X509 *x, int loc); -X509_EXTENSION *X509_delete_ext(X509 *x, int loc); -int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); -void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); -int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, - unsigned long flags); - -int X509_CRL_get_ext_count(X509_CRL *x); -int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); -int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); -int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); -X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); -X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); -int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); -void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); -int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, - unsigned long flags); - -int X509_REVOKED_get_ext_count(X509_REVOKED *x); -int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); -int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos); -int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); -X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); -X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); -int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); -void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); -int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, - unsigned long flags); - -X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, - int nid, int crit, ASN1_OCTET_STRING *data); -X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, - ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data); -int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj); -int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); -int X509_EXTENSION_set_data(X509_EXTENSION *ex, - ASN1_OCTET_STRING *data); -ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); -ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); -int X509_EXTENSION_get_critical(X509_EXTENSION *ex); - -int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); -int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, - int lastpos); -int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); -X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, - X509_ATTRIBUTE *attr); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, - const ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, - int nid, int type, - const unsigned char *bytes, int len); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, - const char *attrname, int type, - const unsigned char *bytes, int len); -void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, - ASN1_OBJECT *obj, int lastpos, int type); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, - int atrtype, const void *data, int len); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, - const ASN1_OBJECT *obj, int atrtype, const void *data, int len); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, - const char *atrname, int type, const unsigned char *bytes, int len); -int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); -int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); -void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, - int atrtype, void *data); -int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); -ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); -ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); - -int EVP_PKEY_get_attr_count(const EVP_PKEY *key); -int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, - int lastpos); -int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); -X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); -int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); -int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, - const ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len); -int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, - int nid, int type, - const unsigned char *bytes, int len); -int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, - const char *attrname, int type, - const unsigned char *bytes, int len); - -int X509_verify_cert(X509_STORE_CTX *ctx); - -/* lookup a cert from a X509 STACK */ -X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, - ASN1_INTEGER *serial); -X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); - -DECLARE_ASN1_FUNCTIONS(PBEPARAM) -DECLARE_ASN1_FUNCTIONS(PBE2PARAM) -DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) - -X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); -X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, - unsigned char *salt, int saltlen); - -/* PKCS#8 utilities */ - -DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) - -EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); -PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); - -int X509_check_trust(X509 *x, int id, int flags); -int X509_TRUST_get_count(void); -X509_TRUST * X509_TRUST_get0(int idx); -int X509_TRUST_get_by_id(int id); -int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), - char *name, int arg1, void *arg2); -void X509_TRUST_cleanup(void); -int X509_TRUST_get_flags(X509_TRUST *xp); -char *X509_TRUST_get0_name(X509_TRUST *xp); -int X509_TRUST_get_trust(X509_TRUST *xp); - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_X509_strings(void); - -/* Error codes for the X509 functions. */ - -/* Function codes. */ -#define X509_F_ADD_CERT_DIR 100 -#define X509_F_BY_FILE_CTRL 101 -#define X509_F_CHECK_POLICY 145 -#define X509_F_DIR_CTRL 102 -#define X509_F_GET_CERT_BY_SUBJECT 103 -#define X509_F_NETSCAPE_SPKI_B64_DECODE 129 -#define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 -#define X509_F_X509AT_ADD1_ATTR 135 -#define X509_F_X509V3_ADD_EXT 104 -#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 -#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 -#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 -#define X509_F_X509_ATTRIBUTE_GET0_DATA 139 -#define X509_F_X509_ATTRIBUTE_SET1_DATA 138 -#define X509_F_X509_CHECK_PRIVATE_KEY 128 -#define X509_F_X509_CRL_PRINT_FP 147 -#define X509_F_X509_EXTENSION_CREATE_BY_NID 108 -#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 -#define X509_F_X509_GET_PUBKEY_PARAMETERS 110 -#define X509_F_X509_LOAD_CERT_CRL_FILE 132 -#define X509_F_X509_LOAD_CERT_FILE 111 -#define X509_F_X509_LOAD_CRL_FILE 112 -#define X509_F_X509_NAME_ADD_ENTRY 113 -#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 -#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 -#define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 -#define X509_F_X509_NAME_ONELINE 116 -#define X509_F_X509_NAME_PRINT 117 -#define X509_F_X509_PRINT_EX_FP 118 -#define X509_F_X509_PUBKEY_GET 119 -#define X509_F_X509_PUBKEY_SET 120 -#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144 -#define X509_F_X509_REQ_PRINT_EX 121 -#define X509_F_X509_REQ_PRINT_FP 122 -#define X509_F_X509_REQ_TO_X509 123 -#define X509_F_X509_STORE_ADD_CERT 124 -#define X509_F_X509_STORE_ADD_CRL 125 -#define X509_F_X509_STORE_CTX_GET1_ISSUER 146 -#define X509_F_X509_STORE_CTX_INIT 143 -#define X509_F_X509_STORE_CTX_NEW 142 -#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 -#define X509_F_X509_TO_X509_REQ 126 -#define X509_F_X509_TRUST_ADD 133 -#define X509_F_X509_TRUST_SET 141 -#define X509_F_X509_VERIFY_CERT 127 - -/* Reason codes. */ -#define X509_R_BAD_X509_FILETYPE 100 -#define X509_R_BASE64_DECODE_ERROR 118 -#define X509_R_CANT_CHECK_DH_KEY 114 -#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 -#define X509_R_ERR_ASN1_LIB 102 -#define X509_R_INVALID_DIRECTORY 113 -#define X509_R_INVALID_FIELD_NAME 119 -#define X509_R_INVALID_TRUST 123 -#define X509_R_KEY_TYPE_MISMATCH 115 -#define X509_R_KEY_VALUES_MISMATCH 116 -#define X509_R_LOADING_CERT_DIR 103 -#define X509_R_LOADING_DEFAULTS 104 -#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 -#define X509_R_SHOULD_RETRY 106 -#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 -#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 -#define X509_R_UNKNOWN_KEY_TYPE 117 -#define X509_R_UNKNOWN_NID 109 -#define X509_R_UNKNOWN_PURPOSE_ID 121 -#define X509_R_UNKNOWN_TRUST_ID 120 -#define X509_R_UNSUPPORTED_ALGORITHM 111 -#define X509_R_WRONG_LOOKUP_TYPE 112 -#define X509_R_WRONG_TYPE 122 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/openssl/x509_vfy.h b/dep/include/openssl/x509_vfy.h deleted file mode 100644 index 053920a458c..00000000000 --- a/dep/include/openssl/x509_vfy.h +++ /dev/null @@ -1,532 +0,0 @@ -/* crypto/x509/x509_vfy.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_X509_H -#include -/* openssl/x509.h ends up #include-ing this file at about the only - * appropriate moment. */ -#endif - -#ifndef HEADER_X509_VFY_H -#define HEADER_X509_VFY_H - -#include -#ifndef OPENSSL_NO_LHASH -#include -#endif -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Outer object */ -typedef struct x509_hash_dir_st - { - int num_dirs; - char **dirs; - int *dirs_type; - int num_dirs_alloced; - } X509_HASH_DIR_CTX; - -typedef struct x509_file_st - { - int num_paths; /* number of paths to files or directories */ - int num_alloced; - char **paths; /* the list of paths or directories */ - int *path_type; - } X509_CERT_FILE_CTX; - -/*******************************/ -/* -SSL_CTX -> X509_STORE - -> X509_LOOKUP - ->X509_LOOKUP_METHOD - -> X509_LOOKUP - ->X509_LOOKUP_METHOD - -SSL -> X509_STORE_CTX - ->X509_STORE - -The X509_STORE holds the tables etc for verification stuff. -A X509_STORE_CTX is used while validating a single certificate. -The X509_STORE has X509_LOOKUPs for looking up certs. -The X509_STORE then calls a function to actually verify the -certificate chain. -*/ - -#define X509_LU_RETRY -1 -#define X509_LU_FAIL 0 -#define X509_LU_X509 1 -#define X509_LU_CRL 2 -#define X509_LU_PKEY 3 - -typedef struct x509_object_st - { - /* one of the above types */ - int type; - union { - char *ptr; - X509 *x509; - X509_CRL *crl; - EVP_PKEY *pkey; - } data; - } X509_OBJECT; - -typedef struct x509_lookup_st X509_LOOKUP; - -DECLARE_STACK_OF(X509_LOOKUP) -DECLARE_STACK_OF(X509_OBJECT) - -/* This is a static that defines the function interface */ -typedef struct x509_lookup_method_st - { - const char *name; - int (*new_item)(X509_LOOKUP *ctx); - void (*free)(X509_LOOKUP *ctx); - int (*init)(X509_LOOKUP *ctx); - int (*shutdown)(X509_LOOKUP *ctx); - int (*ctrl)(X509_LOOKUP *ctx,int cmd,const char *argc,long argl, - char **ret); - int (*get_by_subject)(X509_LOOKUP *ctx,int type,X509_NAME *name, - X509_OBJECT *ret); - int (*get_by_issuer_serial)(X509_LOOKUP *ctx,int type,X509_NAME *name, - ASN1_INTEGER *serial,X509_OBJECT *ret); - int (*get_by_fingerprint)(X509_LOOKUP *ctx,int type, - unsigned char *bytes,int len, - X509_OBJECT *ret); - int (*get_by_alias)(X509_LOOKUP *ctx,int type,char *str,int len, - X509_OBJECT *ret); - } X509_LOOKUP_METHOD; - -/* This structure hold all parameters associated with a verify operation - * by including an X509_VERIFY_PARAM structure in related structures the - * parameters used can be customized - */ - -typedef struct X509_VERIFY_PARAM_st - { - char *name; - time_t check_time; /* Time to use */ - unsigned long inh_flags; /* Inheritance flags */ - unsigned long flags; /* Various verify flags */ - int purpose; /* purpose to check untrusted certificates */ - int trust; /* trust setting to check */ - int depth; /* Verify depth */ - STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */ - } X509_VERIFY_PARAM; - -DECLARE_STACK_OF(X509_VERIFY_PARAM) - -/* This is used to hold everything. It is used for all certificate - * validation. Once we have a certificate chain, the 'verify' - * function is then called to actually check the cert chain. */ -struct x509_store_st - { - /* The following is a cache of trusted certs */ - int cache; /* if true, stash any hits */ - STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */ - - /* These are external lookup methods */ - STACK_OF(X509_LOOKUP) *get_cert_methods; - - X509_VERIFY_PARAM *param; - - /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - int (*cleanup)(X509_STORE_CTX *ctx); - - CRYPTO_EX_DATA ex_data; - int references; - } /* X509_STORE */; - -int X509_STORE_set_depth(X509_STORE *store, int depth); - -#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func)) -#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) - -/* This is the functions plus an instance of the local variables. */ -struct x509_lookup_st - { - int init; /* have we been started */ - int skip; /* don't use us. */ - X509_LOOKUP_METHOD *method; /* the functions */ - char *method_data; /* method data */ - - X509_STORE *store_ctx; /* who owns us */ - } /* X509_LOOKUP */; - -/* This is a used when verifying cert chains. Since the - * gathering of the cert chain can take some time (and have to be - * 'retried', this needs to be kept and passed around. */ -struct x509_store_ctx_st /* X509_STORE_CTX */ - { - X509_STORE *ctx; - int current_method; /* used when looking up certs */ - - /* The following are set by the caller */ - X509 *cert; /* The cert to check */ - STACK_OF(X509) *untrusted; /* chain of X509s - untrusted - passed in */ - STACK_OF(X509_CRL) *crls; /* set of CRLs passed in */ - - X509_VERIFY_PARAM *param; - void *other_ctx; /* Other info for use with get_issuer() */ - - /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - int (*check_policy)(X509_STORE_CTX *ctx); - int (*cleanup)(X509_STORE_CTX *ctx); - - /* The following is built up */ - int valid; /* if 0, rebuild chain */ - int last_untrusted; /* index of last untrusted cert */ - STACK_OF(X509) *chain; /* chain of X509s - built up and trusted */ - X509_POLICY_TREE *tree; /* Valid policy tree */ - - int explicit_policy; /* Require explicit policy value */ - - /* When something goes wrong, this is why */ - int error_depth; - int error; - X509 *current_cert; - X509 *current_issuer; /* cert currently being tested as valid issuer */ - X509_CRL *current_crl; /* current CRL */ - - CRYPTO_EX_DATA ex_data; - } /* X509_STORE_CTX */; - -void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); - -#define X509_STORE_CTX_set_app_data(ctx,data) \ - X509_STORE_CTX_set_ex_data(ctx,0,data) -#define X509_STORE_CTX_get_app_data(ctx) \ - X509_STORE_CTX_get_ex_data(ctx,0) - -#define X509_L_FILE_LOAD 1 -#define X509_L_ADD_DIR 2 - -#define X509_LOOKUP_load_file(x,name,type) \ - X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) - -#define X509_LOOKUP_add_dir(x,name,type) \ - X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) - -#define X509_V_OK 0 -/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ - -#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 -#define X509_V_ERR_UNABLE_TO_GET_CRL 3 -#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 -#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 -#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 -#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 -#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 -#define X509_V_ERR_CERT_NOT_YET_VALID 9 -#define X509_V_ERR_CERT_HAS_EXPIRED 10 -#define X509_V_ERR_CRL_NOT_YET_VALID 11 -#define X509_V_ERR_CRL_HAS_EXPIRED 12 -#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 -#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 -#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 -#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 -#define X509_V_ERR_OUT_OF_MEM 17 -#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 -#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 -#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 -#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 -#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 -#define X509_V_ERR_CERT_REVOKED 23 -#define X509_V_ERR_INVALID_CA 24 -#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 -#define X509_V_ERR_INVALID_PURPOSE 26 -#define X509_V_ERR_CERT_UNTRUSTED 27 -#define X509_V_ERR_CERT_REJECTED 28 -/* These are 'informational' when looking for issuer cert */ -#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 -#define X509_V_ERR_AKID_SKID_MISMATCH 30 -#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 -#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 - -#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 -#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 -#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 -#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 -#define X509_V_ERR_INVALID_NON_CA 37 -#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 -#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 -#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 - -#define X509_V_ERR_INVALID_EXTENSION 41 -#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 -#define X509_V_ERR_NO_EXPLICIT_POLICY 43 - -#define X509_V_ERR_UNNESTED_RESOURCE 44 - -/* The application is not happy */ -#define X509_V_ERR_APPLICATION_VERIFICATION 50 - -/* Certificate verify flags */ - -/* Send issuer+subject checks to verify_cb */ -#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 -/* Use check time instead of current time */ -#define X509_V_FLAG_USE_CHECK_TIME 0x2 -/* Lookup CRLs */ -#define X509_V_FLAG_CRL_CHECK 0x4 -/* Lookup CRLs for whole chain */ -#define X509_V_FLAG_CRL_CHECK_ALL 0x8 -/* Ignore unhandled critical extensions */ -#define X509_V_FLAG_IGNORE_CRITICAL 0x10 -/* Disable workarounds for broken certificates */ -#define X509_V_FLAG_X509_STRICT 0x20 -/* Enable proxy certificate validation */ -#define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 -/* Enable policy checking */ -#define X509_V_FLAG_POLICY_CHECK 0x80 -/* Policy variable require-explicit-policy */ -#define X509_V_FLAG_EXPLICIT_POLICY 0x100 -/* Policy variable inhibit-any-policy */ -#define X509_V_FLAG_INHIBIT_ANY 0x200 -/* Policy variable inhibit-policy-mapping */ -#define X509_V_FLAG_INHIBIT_MAP 0x400 -/* Notify callback that policy is OK */ -#define X509_V_FLAG_NOTIFY_POLICY 0x800 - -#define X509_VP_FLAG_DEFAULT 0x1 -#define X509_VP_FLAG_OVERWRITE 0x2 -#define X509_VP_FLAG_RESET_FLAGS 0x4 -#define X509_VP_FLAG_LOCKED 0x8 -#define X509_VP_FLAG_ONCE 0x10 - -/* Internal use: mask of policy related options */ -#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ - | X509_V_FLAG_EXPLICIT_POLICY \ - | X509_V_FLAG_INHIBIT_ANY \ - | X509_V_FLAG_INHIBIT_MAP) - -int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, - X509_NAME *name); -X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name); -X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); -void X509_OBJECT_up_ref_count(X509_OBJECT *a); -void X509_OBJECT_free_contents(X509_OBJECT *a); -X509_STORE *X509_STORE_new(void ); -void X509_STORE_free(X509_STORE *v); - -int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); -int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); -int X509_STORE_set_trust(X509_STORE *ctx, int trust); -int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); - -X509_STORE_CTX *X509_STORE_CTX_new(void); - -int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); - -void X509_STORE_CTX_free(X509_STORE_CTX *ctx); -int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, - X509 *x509, STACK_OF(X509) *chain); -void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); -void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); - -X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); - -X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); -X509_LOOKUP_METHOD *X509_LOOKUP_file(void); - -int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); -int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); - -int X509_STORE_get_by_subject(X509_STORE_CTX *vs,int type,X509_NAME *name, - X509_OBJECT *ret); - -int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, - long argl, char **ret); - -#ifndef OPENSSL_NO_STDIO -int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); -int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); -int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); -#endif - - -X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); -void X509_LOOKUP_free(X509_LOOKUP *ctx); -int X509_LOOKUP_init(X509_LOOKUP *ctx); -int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, - X509_OBJECT *ret); -int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, - ASN1_INTEGER *serial, X509_OBJECT *ret); -int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, - unsigned char *bytes, int len, X509_OBJECT *ret); -int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, - int len, X509_OBJECT *ret); -int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); - -#ifndef OPENSSL_NO_STDIO -int X509_STORE_load_locations (X509_STORE *ctx, - const char *file, const char *dir); -int X509_STORE_set_default_paths(X509_STORE *ctx); -#endif - -int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data); -void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); -int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); -int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); -X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); -STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); -STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x); -void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); -void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); -int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); -int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); -int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, - int purpose, int trust); -void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); -void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, - time_t t); -void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, - int (*verify_cb)(int, X509_STORE_CTX *)); - -X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); -int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); - -X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); -int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); - -/* X509_VERIFY_PARAM functions */ - -X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); -void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); -int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, - const X509_VERIFY_PARAM *from); -int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, - const X509_VERIFY_PARAM *from); -int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); -int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags); -int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, - unsigned long flags); -unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); -int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); -int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); -void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); -void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); -int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, - ASN1_OBJECT *policy); -int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, - STACK_OF(ASN1_OBJECT) *policies); -int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); - -int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); -const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); -void X509_VERIFY_PARAM_table_cleanup(void); - -int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, - STACK_OF(X509) *certs, - STACK_OF(ASN1_OBJECT) *policy_oids, - unsigned int flags); - -void X509_policy_tree_free(X509_POLICY_TREE *tree); - -int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); -X509_POLICY_LEVEL * - X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, int i); - -STACK_OF(X509_POLICY_NODE) * - X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); - -STACK_OF(X509_POLICY_NODE) * - X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); - -int X509_policy_level_node_count(X509_POLICY_LEVEL *level); - -X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i); - -const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); - -STACK_OF(POLICYQUALINFO) * - X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); -const X509_POLICY_NODE * - X509_policy_node_get0_parent(const X509_POLICY_NODE *node); - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/dep/include/openssl/x509v3.h b/dep/include/openssl/x509v3.h deleted file mode 100644 index 9ef83da755e..00000000000 --- a/dep/include/openssl/x509v3.h +++ /dev/null @@ -1,922 +0,0 @@ -/* x509v3.h */ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_X509V3_H -#define HEADER_X509V3_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Forward reference */ -struct v3_ext_method; -struct v3_ext_ctx; - -/* Useful typedefs */ - -typedef void * (*X509V3_EXT_NEW)(void); -typedef void (*X509V3_EXT_FREE)(void *); -typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); -typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); -typedef STACK_OF(CONF_VALUE) * (*X509V3_EXT_I2V)(struct v3_ext_method *method, void *ext, STACK_OF(CONF_VALUE) *extlist); -typedef void * (*X509V3_EXT_V2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, STACK_OF(CONF_VALUE) *values); -typedef char * (*X509V3_EXT_I2S)(struct v3_ext_method *method, void *ext); -typedef void * (*X509V3_EXT_S2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); -typedef int (*X509V3_EXT_I2R)(struct v3_ext_method *method, void *ext, BIO *out, int indent); -typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); - -/* V3 extension structure */ - -struct v3_ext_method { -int ext_nid; -int ext_flags; -/* If this is set the following four fields are ignored */ -ASN1_ITEM_EXP *it; -/* Old style ASN1 calls */ -X509V3_EXT_NEW ext_new; -X509V3_EXT_FREE ext_free; -X509V3_EXT_D2I d2i; -X509V3_EXT_I2D i2d; - -/* The following pair is used for string extensions */ -X509V3_EXT_I2S i2s; -X509V3_EXT_S2I s2i; - -/* The following pair is used for multi-valued extensions */ -X509V3_EXT_I2V i2v; -X509V3_EXT_V2I v2i; - -/* The following are used for raw extensions */ -X509V3_EXT_I2R i2r; -X509V3_EXT_R2I r2i; - -void *usr_data; /* Any extension specific data */ -}; - -typedef struct X509V3_CONF_METHOD_st { -char * (*get_string)(void *db, char *section, char *value); -STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section); -void (*free_string)(void *db, char * string); -void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); -} X509V3_CONF_METHOD; - -/* Context specific info */ -struct v3_ext_ctx { -#define CTX_TEST 0x1 -int flags; -X509 *issuer_cert; -X509 *subject_cert; -X509_REQ *subject_req; -X509_CRL *crl; -X509V3_CONF_METHOD *db_meth; -void *db; -/* Maybe more here */ -}; - -typedef struct v3_ext_method X509V3_EXT_METHOD; - -DECLARE_STACK_OF(X509V3_EXT_METHOD) - -/* ext_flags values */ -#define X509V3_EXT_DYNAMIC 0x1 -#define X509V3_EXT_CTX_DEP 0x2 -#define X509V3_EXT_MULTILINE 0x4 - -typedef BIT_STRING_BITNAME ENUMERATED_NAMES; - -typedef struct BASIC_CONSTRAINTS_st { -int ca; -ASN1_INTEGER *pathlen; -} BASIC_CONSTRAINTS; - - -typedef struct PKEY_USAGE_PERIOD_st { -ASN1_GENERALIZEDTIME *notBefore; -ASN1_GENERALIZEDTIME *notAfter; -} PKEY_USAGE_PERIOD; - -typedef struct otherName_st { -ASN1_OBJECT *type_id; -ASN1_TYPE *value; -} OTHERNAME; - -typedef struct EDIPartyName_st { - ASN1_STRING *nameAssigner; - ASN1_STRING *partyName; -} EDIPARTYNAME; - -typedef struct GENERAL_NAME_st { - -#define GEN_OTHERNAME 0 -#define GEN_EMAIL 1 -#define GEN_DNS 2 -#define GEN_X400 3 -#define GEN_DIRNAME 4 -#define GEN_EDIPARTY 5 -#define GEN_URI 6 -#define GEN_IPADD 7 -#define GEN_RID 8 - -int type; -union { - char *ptr; - OTHERNAME *otherName; /* otherName */ - ASN1_IA5STRING *rfc822Name; - ASN1_IA5STRING *dNSName; - ASN1_TYPE *x400Address; - X509_NAME *directoryName; - EDIPARTYNAME *ediPartyName; - ASN1_IA5STRING *uniformResourceIdentifier; - ASN1_OCTET_STRING *iPAddress; - ASN1_OBJECT *registeredID; - - /* Old names */ - ASN1_OCTET_STRING *ip; /* iPAddress */ - X509_NAME *dirn; /* dirn */ - ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */ - ASN1_OBJECT *rid; /* registeredID */ - ASN1_TYPE *other; /* x400Address */ -} d; -} GENERAL_NAME; - -typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; - -typedef struct ACCESS_DESCRIPTION_st { - ASN1_OBJECT *method; - GENERAL_NAME *location; -} ACCESS_DESCRIPTION; - -typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; - -typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; - -DECLARE_STACK_OF(GENERAL_NAME) -DECLARE_ASN1_SET_OF(GENERAL_NAME) - -DECLARE_STACK_OF(ACCESS_DESCRIPTION) -DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) - -typedef struct DIST_POINT_NAME_st { -int type; -union { - GENERAL_NAMES *fullname; - STACK_OF(X509_NAME_ENTRY) *relativename; -} name; -} DIST_POINT_NAME; - -typedef struct DIST_POINT_st { -DIST_POINT_NAME *distpoint; -ASN1_BIT_STRING *reasons; -GENERAL_NAMES *CRLissuer; -} DIST_POINT; - -typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; - -DECLARE_STACK_OF(DIST_POINT) -DECLARE_ASN1_SET_OF(DIST_POINT) - -typedef struct AUTHORITY_KEYID_st { -ASN1_OCTET_STRING *keyid; -GENERAL_NAMES *issuer; -ASN1_INTEGER *serial; -} AUTHORITY_KEYID; - -/* Strong extranet structures */ - -typedef struct SXNET_ID_st { - ASN1_INTEGER *zone; - ASN1_OCTET_STRING *user; -} SXNETID; - -DECLARE_STACK_OF(SXNETID) -DECLARE_ASN1_SET_OF(SXNETID) - -typedef struct SXNET_st { - ASN1_INTEGER *version; - STACK_OF(SXNETID) *ids; -} SXNET; - -typedef struct NOTICEREF_st { - ASN1_STRING *organization; - STACK_OF(ASN1_INTEGER) *noticenos; -} NOTICEREF; - -typedef struct USERNOTICE_st { - NOTICEREF *noticeref; - ASN1_STRING *exptext; -} USERNOTICE; - -typedef struct POLICYQUALINFO_st { - ASN1_OBJECT *pqualid; - union { - ASN1_IA5STRING *cpsuri; - USERNOTICE *usernotice; - ASN1_TYPE *other; - } d; -} POLICYQUALINFO; - -DECLARE_STACK_OF(POLICYQUALINFO) -DECLARE_ASN1_SET_OF(POLICYQUALINFO) - -typedef struct POLICYINFO_st { - ASN1_OBJECT *policyid; - STACK_OF(POLICYQUALINFO) *qualifiers; -} POLICYINFO; - -typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; - -DECLARE_STACK_OF(POLICYINFO) -DECLARE_ASN1_SET_OF(POLICYINFO) - -typedef struct POLICY_MAPPING_st { - ASN1_OBJECT *issuerDomainPolicy; - ASN1_OBJECT *subjectDomainPolicy; -} POLICY_MAPPING; - -DECLARE_STACK_OF(POLICY_MAPPING) - -typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; - -typedef struct GENERAL_SUBTREE_st { - GENERAL_NAME *base; - ASN1_INTEGER *minimum; - ASN1_INTEGER *maximum; -} GENERAL_SUBTREE; - -DECLARE_STACK_OF(GENERAL_SUBTREE) - -typedef struct NAME_CONSTRAINTS_st { - STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; - STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; -} NAME_CONSTRAINTS; - -typedef struct POLICY_CONSTRAINTS_st { - ASN1_INTEGER *requireExplicitPolicy; - ASN1_INTEGER *inhibitPolicyMapping; -} POLICY_CONSTRAINTS; - -/* Proxy certificate structures, see RFC 3820 */ -typedef struct PROXY_POLICY_st - { - ASN1_OBJECT *policyLanguage; - ASN1_OCTET_STRING *policy; - } PROXY_POLICY; - -typedef struct PROXY_CERT_INFO_EXTENSION_st - { - ASN1_INTEGER *pcPathLengthConstraint; - PROXY_POLICY *proxyPolicy; - } PROXY_CERT_INFO_EXTENSION; - -DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) -DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) - - -#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \ -",name:", val->name, ",value:", val->value); - -#define X509V3_set_ctx_test(ctx) \ - X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) -#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; - -#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ - 0,0,0,0, \ - 0,0, \ - (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ - (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ - NULL, NULL, \ - table} - -#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ - 0,0,0,0, \ - (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ - (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ - 0,0,0,0, \ - NULL} - -#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - - -/* X509_PURPOSE stuff */ - -#define EXFLAG_BCONS 0x1 -#define EXFLAG_KUSAGE 0x2 -#define EXFLAG_XKUSAGE 0x4 -#define EXFLAG_NSCERT 0x8 - -#define EXFLAG_CA 0x10 -/* Really self issued not necessarily self signed */ -#define EXFLAG_SI 0x20 -#define EXFLAG_SS 0x20 -#define EXFLAG_V1 0x40 -#define EXFLAG_INVALID 0x80 -#define EXFLAG_SET 0x100 -#define EXFLAG_CRITICAL 0x200 -#define EXFLAG_PROXY 0x400 - -#define EXFLAG_INVALID_POLICY 0x800 - -#define KU_DIGITAL_SIGNATURE 0x0080 -#define KU_NON_REPUDIATION 0x0040 -#define KU_KEY_ENCIPHERMENT 0x0020 -#define KU_DATA_ENCIPHERMENT 0x0010 -#define KU_KEY_AGREEMENT 0x0008 -#define KU_KEY_CERT_SIGN 0x0004 -#define KU_CRL_SIGN 0x0002 -#define KU_ENCIPHER_ONLY 0x0001 -#define KU_DECIPHER_ONLY 0x8000 - -#define NS_SSL_CLIENT 0x80 -#define NS_SSL_SERVER 0x40 -#define NS_SMIME 0x20 -#define NS_OBJSIGN 0x10 -#define NS_SSL_CA 0x04 -#define NS_SMIME_CA 0x02 -#define NS_OBJSIGN_CA 0x01 -#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) - -#define XKU_SSL_SERVER 0x1 -#define XKU_SSL_CLIENT 0x2 -#define XKU_SMIME 0x4 -#define XKU_CODE_SIGN 0x8 -#define XKU_SGC 0x10 -#define XKU_OCSP_SIGN 0x20 -#define XKU_TIMESTAMP 0x40 -#define XKU_DVCS 0x80 - -#define X509_PURPOSE_DYNAMIC 0x1 -#define X509_PURPOSE_DYNAMIC_NAME 0x2 - -typedef struct x509_purpose_st { - int purpose; - int trust; /* Default trust ID */ - int flags; - int (*check_purpose)(const struct x509_purpose_st *, - const X509 *, int); - char *name; - char *sname; - void *usr_data; -} X509_PURPOSE; - -#define X509_PURPOSE_SSL_CLIENT 1 -#define X509_PURPOSE_SSL_SERVER 2 -#define X509_PURPOSE_NS_SSL_SERVER 3 -#define X509_PURPOSE_SMIME_SIGN 4 -#define X509_PURPOSE_SMIME_ENCRYPT 5 -#define X509_PURPOSE_CRL_SIGN 6 -#define X509_PURPOSE_ANY 7 -#define X509_PURPOSE_OCSP_HELPER 8 - -#define X509_PURPOSE_MIN 1 -#define X509_PURPOSE_MAX 8 - -/* Flags for X509V3_EXT_print() */ - -#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) -/* Return error for unknown extensions */ -#define X509V3_EXT_DEFAULT 0 -/* Print error for unknown extensions */ -#define X509V3_EXT_ERROR_UNKNOWN (1L << 16) -/* ASN1 parse unknown extensions */ -#define X509V3_EXT_PARSE_UNKNOWN (2L << 16) -/* BIO_dump unknown extensions */ -#define X509V3_EXT_DUMP_UNKNOWN (3L << 16) - -/* Flags for X509V3_add1_i2d */ - -#define X509V3_ADD_OP_MASK 0xfL -#define X509V3_ADD_DEFAULT 0L -#define X509V3_ADD_APPEND 1L -#define X509V3_ADD_REPLACE 2L -#define X509V3_ADD_REPLACE_EXISTING 3L -#define X509V3_ADD_KEEP_EXISTING 4L -#define X509V3_ADD_DELETE 5L -#define X509V3_ADD_SILENT 0x10 - -DECLARE_STACK_OF(X509_PURPOSE) - -DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) - -DECLARE_ASN1_FUNCTIONS(SXNET) -DECLARE_ASN1_FUNCTIONS(SXNETID) - -int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); -int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); -int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); - -ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); -ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); -ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); - -DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) - -DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) - -DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) - - -ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); -STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, - ASN1_BIT_STRING *bits, - STACK_OF(CONF_VALUE) *extlist); - -STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret); -int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); - -DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) - -STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, - GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); -GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); - -DECLARE_ASN1_FUNCTIONS(OTHERNAME) -DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) - -char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); -ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); - -DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) -int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a); - -DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) -DECLARE_ASN1_FUNCTIONS(POLICYINFO) -DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) -DECLARE_ASN1_FUNCTIONS(USERNOTICE) -DECLARE_ASN1_FUNCTIONS(NOTICEREF) - -DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) -DECLARE_ASN1_FUNCTIONS(DIST_POINT) -DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) - -DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) -DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) - -DECLARE_ASN1_ITEM(POLICY_MAPPING) -DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) -DECLARE_ASN1_ITEM(POLICY_MAPPINGS) - -DECLARE_ASN1_ITEM(GENERAL_SUBTREE) -DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) - -DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) -DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) - -DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) -DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) - -#ifdef HEADER_CONF_H -GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, - CONF_VALUE *cnf); -GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); -void X509V3_conf_free(CONF_VALUE *val); - -X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); -X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); -int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); -int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert); -int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); -int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); - -X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value); -X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value); -int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert); -int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); -int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); - -int X509V3_add_value_bool_nf(char *name, int asn1_bool, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); -int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); -void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); -void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash); -#endif - -char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); -STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section); -void X509V3_string_free(X509V3_CTX *ctx, char *str); -void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); -void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, - X509_REQ *req, X509_CRL *crl, int flags); - -int X509V3_add_value(const char *name, const char *value, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_uchar(const char *name, const unsigned char *value, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_bool(const char *name, int asn1_bool, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, - STACK_OF(CONF_VALUE) **extlist); -char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); -ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); -char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); -char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); -int X509V3_EXT_add(X509V3_EXT_METHOD *ext); -int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); -int X509V3_EXT_add_alias(int nid_to, int nid_from); -void X509V3_EXT_cleanup(void); - -X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); -X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); -int X509V3_add_standard_extensions(void); -STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); -void *X509V3_EXT_d2i(X509_EXTENSION *ext); -void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); - - -X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); -int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); - -char *hex_to_string(unsigned char *buffer, long len); -unsigned char *string_to_hex(char *str, long *len); -int name_cmp(const char *name, const char *cmp); - -void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, - int ml); -int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); -int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); - -int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); - -int X509_check_ca(X509 *x); -int X509_check_purpose(X509 *x, int id, int ca); -int X509_supported_extension(X509_EXTENSION *ex); -int X509_PURPOSE_set(int *p, int purpose); -int X509_check_issued(X509 *issuer, X509 *subject); -int X509_PURPOSE_get_count(void); -X509_PURPOSE * X509_PURPOSE_get0(int idx); -int X509_PURPOSE_get_by_sname(char *sname); -int X509_PURPOSE_get_by_id(int id); -int X509_PURPOSE_add(int id, int trust, int flags, - int (*ck)(const X509_PURPOSE *, const X509 *, int), - char *name, char *sname, void *arg); -char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); -char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); -int X509_PURPOSE_get_trust(X509_PURPOSE *xp); -void X509_PURPOSE_cleanup(void); -int X509_PURPOSE_get_id(X509_PURPOSE *); - -STACK *X509_get1_email(X509 *x); -STACK *X509_REQ_get1_email(X509_REQ *x); -void X509_email_free(STACK *sk); -STACK *X509_get1_ocsp(X509 *x); - -ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); -ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); -int a2i_ipadd(unsigned char *ipout, const char *ipasc); -int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, - unsigned long chtype); - -void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); - -#ifndef OPENSSL_NO_RFC3779 - -typedef struct ASRange_st { - ASN1_INTEGER *min, *max; -} ASRange; - -#define ASIdOrRange_id 0 -#define ASIdOrRange_range 1 - -typedef struct ASIdOrRange_st { - int type; - union { - ASN1_INTEGER *id; - ASRange *range; - } u; -} ASIdOrRange; - -typedef STACK_OF(ASIdOrRange) ASIdOrRanges; -DECLARE_STACK_OF(ASIdOrRange) - -#define ASIdentifierChoice_inherit 0 -#define ASIdentifierChoice_asIdsOrRanges 1 - -typedef struct ASIdentifierChoice_st { - int type; - union { - ASN1_NULL *inherit; - ASIdOrRanges *asIdsOrRanges; - } u; -} ASIdentifierChoice; - -typedef struct ASIdentifiers_st { - ASIdentifierChoice *asnum, *rdi; -} ASIdentifiers; - -DECLARE_ASN1_FUNCTIONS(ASRange) -DECLARE_ASN1_FUNCTIONS(ASIdOrRange) -DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice) -DECLARE_ASN1_FUNCTIONS(ASIdentifiers) - - -typedef struct IPAddressRange_st { - ASN1_BIT_STRING *min, *max; -} IPAddressRange; - -#define IPAddressOrRange_addressPrefix 0 -#define IPAddressOrRange_addressRange 1 - -typedef struct IPAddressOrRange_st { - int type; - union { - ASN1_BIT_STRING *addressPrefix; - IPAddressRange *addressRange; - } u; -} IPAddressOrRange; - -typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; -DECLARE_STACK_OF(IPAddressOrRange) - -#define IPAddressChoice_inherit 0 -#define IPAddressChoice_addressesOrRanges 1 - -typedef struct IPAddressChoice_st { - int type; - union { - ASN1_NULL *inherit; - IPAddressOrRanges *addressesOrRanges; - } u; -} IPAddressChoice; - -typedef struct IPAddressFamily_st { - ASN1_OCTET_STRING *addressFamily; - IPAddressChoice *ipAddressChoice; -} IPAddressFamily; - -typedef STACK_OF(IPAddressFamily) IPAddrBlocks; -DECLARE_STACK_OF(IPAddressFamily) - -DECLARE_ASN1_FUNCTIONS(IPAddressRange) -DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) -DECLARE_ASN1_FUNCTIONS(IPAddressChoice) -DECLARE_ASN1_FUNCTIONS(IPAddressFamily) - -/* - * API tag for elements of the ASIdentifer SEQUENCE. - */ -#define V3_ASID_ASNUM 0 -#define V3_ASID_RDI 1 - -/* - * AFI values, assigned by IANA. It'd be nice to make the AFI - * handling code totally generic, but there are too many little things - * that would need to be defined for other address families for it to - * be worth the trouble. - */ -#define IANA_AFI_IPV4 1 -#define IANA_AFI_IPV6 2 - -/* - * Utilities to construct and extract values from RFC3779 extensions, - * since some of the encodings (particularly for IP address prefixes - * and ranges) are a bit tedious to work with directly. - */ -int v3_asid_add_inherit(ASIdentifiers *asid, int which); -int v3_asid_add_id_or_range(ASIdentifiers *asid, int which, - ASN1_INTEGER *min, ASN1_INTEGER *max); -int v3_addr_add_inherit(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi); -int v3_addr_add_prefix(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi, - unsigned char *a, const int prefixlen); -int v3_addr_add_range(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi, - unsigned char *min, unsigned char *max); -unsigned v3_addr_get_afi(const IPAddressFamily *f); -int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, - unsigned char *min, unsigned char *max, - const int length); - -/* - * Canonical forms. - */ -int v3_asid_is_canonical(ASIdentifiers *asid); -int v3_addr_is_canonical(IPAddrBlocks *addr); -int v3_asid_canonize(ASIdentifiers *asid); -int v3_addr_canonize(IPAddrBlocks *addr); - -/* - * Tests for inheritance and containment. - */ -int v3_asid_inherits(ASIdentifiers *asid); -int v3_addr_inherits(IPAddrBlocks *addr); -int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b); -int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b); - -/* - * Check whether RFC 3779 extensions nest properly in chains. - */ -int v3_asid_validate_path(X509_STORE_CTX *); -int v3_addr_validate_path(X509_STORE_CTX *); -int v3_asid_validate_resource_set(STACK_OF(X509) *chain, - ASIdentifiers *ext, - int allow_inheritance); -int v3_addr_validate_resource_set(STACK_OF(X509) *chain, - IPAddrBlocks *ext, - int allow_inheritance); - -#endif /* OPENSSL_NO_RFC3779 */ - -/* BEGIN ERROR CODES */ -/* The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_X509V3_strings(void); - -/* Error codes for the X509V3 functions. */ - -/* Function codes. */ -#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156 -#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157 -#define X509V3_F_COPY_EMAIL 122 -#define X509V3_F_COPY_ISSUER 123 -#define X509V3_F_DO_DIRNAME 144 -#define X509V3_F_DO_EXT_CONF 124 -#define X509V3_F_DO_EXT_I2D 135 -#define X509V3_F_DO_EXT_NCONF 151 -#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 -#define X509V3_F_HEX_TO_STRING 111 -#define X509V3_F_I2S_ASN1_ENUMERATED 121 -#define X509V3_F_I2S_ASN1_IA5STRING 149 -#define X509V3_F_I2S_ASN1_INTEGER 120 -#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138 -#define X509V3_F_NOTICE_SECTION 132 -#define X509V3_F_NREF_NOS 133 -#define X509V3_F_POLICY_SECTION 131 -#define X509V3_F_PROCESS_PCI_VALUE 150 -#define X509V3_F_R2I_CERTPOL 130 -#define X509V3_F_R2I_PCI 155 -#define X509V3_F_S2I_ASN1_IA5STRING 100 -#define X509V3_F_S2I_ASN1_INTEGER 108 -#define X509V3_F_S2I_ASN1_OCTET_STRING 112 -#define X509V3_F_S2I_ASN1_SKEY_ID 114 -#define X509V3_F_S2I_SKEY_ID 115 -#define X509V3_F_STRING_TO_HEX 113 -#define X509V3_F_SXNET_ADD_ID_ASC 125 -#define X509V3_F_SXNET_ADD_ID_INTEGER 126 -#define X509V3_F_SXNET_ADD_ID_ULONG 127 -#define X509V3_F_SXNET_GET_ID_ASC 128 -#define X509V3_F_SXNET_GET_ID_ULONG 129 -#define X509V3_F_V2I_ASIDENTIFIERS 158 -#define X509V3_F_V2I_ASN1_BIT_STRING 101 -#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 -#define X509V3_F_V2I_AUTHORITY_KEYID 119 -#define X509V3_F_V2I_BASIC_CONSTRAINTS 102 -#define X509V3_F_V2I_CRLD 134 -#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 -#define X509V3_F_V2I_GENERAL_NAMES 118 -#define X509V3_F_V2I_GENERAL_NAME_EX 117 -#define X509V3_F_V2I_IPADDRBLOCKS 159 -#define X509V3_F_V2I_ISSUER_ALT 153 -#define X509V3_F_V2I_NAME_CONSTRAINTS 147 -#define X509V3_F_V2I_POLICY_CONSTRAINTS 146 -#define X509V3_F_V2I_POLICY_MAPPINGS 145 -#define X509V3_F_V2I_SUBJECT_ALT 154 -#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160 -#define X509V3_F_V3_GENERIC_EXTENSION 116 -#define X509V3_F_X509V3_ADD1_I2D 140 -#define X509V3_F_X509V3_ADD_VALUE 105 -#define X509V3_F_X509V3_EXT_ADD 104 -#define X509V3_F_X509V3_EXT_ADD_ALIAS 106 -#define X509V3_F_X509V3_EXT_CONF 107 -#define X509V3_F_X509V3_EXT_I2D 136 -#define X509V3_F_X509V3_EXT_NCONF 152 -#define X509V3_F_X509V3_GET_SECTION 142 -#define X509V3_F_X509V3_GET_STRING 143 -#define X509V3_F_X509V3_GET_VALUE_BOOL 110 -#define X509V3_F_X509V3_PARSE_LIST 109 -#define X509V3_F_X509_PURPOSE_ADD 137 -#define X509V3_F_X509_PURPOSE_SET 141 - -/* Reason codes. */ -#define X509V3_R_BAD_IP_ADDRESS 118 -#define X509V3_R_BAD_OBJECT 119 -#define X509V3_R_BN_DEC2BN_ERROR 100 -#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 -#define X509V3_R_DIRNAME_ERROR 149 -#define X509V3_R_DUPLICATE_ZONE_ID 133 -#define X509V3_R_ERROR_CONVERTING_ZONE 131 -#define X509V3_R_ERROR_CREATING_EXTENSION 144 -#define X509V3_R_ERROR_IN_EXTENSION 128 -#define X509V3_R_EXPECTED_A_SECTION_NAME 137 -#define X509V3_R_EXTENSION_EXISTS 145 -#define X509V3_R_EXTENSION_NAME_ERROR 115 -#define X509V3_R_EXTENSION_NOT_FOUND 102 -#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 -#define X509V3_R_EXTENSION_VALUE_ERROR 116 -#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 -#define X509V3_R_ILLEGAL_HEX_DIGIT 113 -#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 -#define X509V3_R_INVALID_ASNUMBER 160 -#define X509V3_R_INVALID_ASRANGE 161 -#define X509V3_R_INVALID_BOOLEAN_STRING 104 -#define X509V3_R_INVALID_EXTENSION_STRING 105 -#define X509V3_R_INVALID_INHERITANCE 162 -#define X509V3_R_INVALID_IPADDRESS 163 -#define X509V3_R_INVALID_NAME 106 -#define X509V3_R_INVALID_NULL_ARGUMENT 107 -#define X509V3_R_INVALID_NULL_NAME 108 -#define X509V3_R_INVALID_NULL_VALUE 109 -#define X509V3_R_INVALID_NUMBER 140 -#define X509V3_R_INVALID_NUMBERS 141 -#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 -#define X509V3_R_INVALID_OPTION 138 -#define X509V3_R_INVALID_POLICY_IDENTIFIER 134 -#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153 -#define X509V3_R_INVALID_PURPOSE 146 -#define X509V3_R_INVALID_SAFI 164 -#define X509V3_R_INVALID_SECTION 135 -#define X509V3_R_INVALID_SYNTAX 143 -#define X509V3_R_ISSUER_DECODE_ERROR 126 -#define X509V3_R_MISSING_VALUE 124 -#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142 -#define X509V3_R_NO_CONFIG_DATABASE 136 -#define X509V3_R_NO_ISSUER_CERTIFICATE 121 -#define X509V3_R_NO_ISSUER_DETAILS 127 -#define X509V3_R_NO_POLICY_IDENTIFIER 139 -#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154 -#define X509V3_R_NO_PUBLIC_KEY 114 -#define X509V3_R_NO_SUBJECT_DETAILS 125 -#define X509V3_R_ODD_NUMBER_OF_DIGITS 112 -#define X509V3_R_OPERATION_NOT_DEFINED 148 -#define X509V3_R_OTHERNAME_ERROR 147 -#define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155 -#define X509V3_R_POLICY_PATH_LENGTH 156 -#define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157 -#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 -#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 -#define X509V3_R_SECTION_NOT_FOUND 150 -#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122 -#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123 -#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111 -#define X509V3_R_UNKNOWN_EXTENSION 129 -#define X509V3_R_UNKNOWN_EXTENSION_NAME 130 -#define X509V3_R_UNKNOWN_OPTION 120 -#define X509V3_R_UNSUPPORTED_OPTION 117 -#define X509V3_R_USER_TOO_LONG 132 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/include/sockets/Base64.h b/dep/include/sockets/Base64.h deleted file mode 100644 index d4323aaa019..00000000000 --- a/dep/include/sockets/Base64.h +++ /dev/null @@ -1,77 +0,0 @@ -/** \file Base64.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Base64_H -#define _SOCKETS_Base64_H - -#include "sockets-config.h" -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -#include -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup util Utilities */ - -/** Base64 encode/decode. - \ingroup util */ -class Base64 -{ -public: - Base64(); - - void encode(FILE *, std::string& , bool add_crlf = true); - void encode(const std::string&, std::string& , bool add_crlf = true); - void encode(const char *, size_t, std::string& , bool add_crlf = true); - void encode(const unsigned char *, size_t, std::string& , bool add_crlf = true); - - void decode(const std::string&, std::string& ); - void decode(const std::string&, unsigned char *, size_t&); - - size_t decode_length(const std::string& ); - -private: - Base64(const Base64& ) {} - Base64& operator=(const Base64& ) { return *this; } -static const char *bstr; -static const char rstr[128]; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Base64_H - - diff --git a/dep/include/sockets/Exception.h b/dep/include/sockets/Exception.h deleted file mode 100644 index bb881b2d74f..00000000000 --- a/dep/include/sockets/Exception.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - ** \file Exception.h - ** \date 2007-09-28 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _Sockets_Exception_H -#define _Sockets_Exception_H - -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Exception -{ -public: - Exception(const std::string& description); - virtual ~Exception() {} - - virtual const std::string ToString() const; - - Exception(const Exception& ) {} // copy constructor - - Exception& operator=(const Exception& ) { return *this; } // assignment operator - -private: - std::string m_description; - -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - -#endif // _Sockets_Exception_H - - diff --git a/dep/include/sockets/File.h b/dep/include/sockets/File.h deleted file mode 100644 index ed322efa2d8..00000000000 --- a/dep/include/sockets/File.h +++ /dev/null @@ -1,82 +0,0 @@ -/** \file File.h - ** \date 2005-04-25 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_File_H -#define _SOCKETS_File_H - -#include "sockets-config.h" -#include "IFile.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** IFile implementation of a disk file. - \ingroup file */ -class File : public IFile -{ -public: - File(); - ~File(); - - bool fopen(const std::string&, const std::string&); - void fclose(); - - size_t fread(char *, size_t, size_t) const; - size_t fwrite(const char *, size_t, size_t); - - char *fgets(char *, int) const; - void fprintf(const char *format, ...); - - off_t size() const; - bool eof() const; - - void reset_read() const; - void reset_write(); - -private: - File(const File& ) {} // copy constructor - File& operator=(const File& ) { return *this; } // assignment operator - - std::string m_path; - std::string m_mode; - FILE *m_fil; - mutable long m_rptr; - long m_wptr; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_File_H - - diff --git a/dep/include/sockets/IFile.h b/dep/include/sockets/IFile.h deleted file mode 100644 index 657c8a4b1d9..00000000000 --- a/dep/include/sockets/IFile.h +++ /dev/null @@ -1,71 +0,0 @@ -/** \file IFile.h - ** \date 2005-04-25 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_IFile_H -#define _SOCKETS_IFile_H - -#include "sockets-config.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup file File handling */ -/** Pure virtual file I/O interface. - \ingroup file */ -class IFile -{ -public: - virtual ~IFile() {} - - virtual bool fopen(const std::string&, const std::string&) = 0; - virtual void fclose() = 0; - - virtual size_t fread(char *, size_t, size_t) const = 0; - virtual size_t fwrite(const char *, size_t, size_t) = 0; - - virtual char *fgets(char *, int) const = 0; - virtual void fprintf(const char *format, ...) = 0; - - virtual off_t size() const = 0; - virtual bool eof() const = 0; - - virtual void reset_read() const = 0; - virtual void reset_write() = 0; - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_IFile_H - - diff --git a/dep/include/sockets/ISocketHandler.h b/dep/include/sockets/ISocketHandler.h deleted file mode 100644 index 940783c104b..00000000000 --- a/dep/include/sockets/ISocketHandler.h +++ /dev/null @@ -1,231 +0,0 @@ -/** \file ISocketHandler.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ISocketHandler_H -#define _SOCKETS_ISocketHandler_H -#include "sockets-config.h" - -#include - -#include "socket_include.h" -#include "Socket.h" -#include "StdLog.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -typedef enum { - LIST_CALLONCONNECT = 0, -#ifdef ENABLE_DETACH - LIST_DETACH, -#endif - LIST_TIMEOUT, - LIST_RETRY, - LIST_CLOSE -} list_t; - -class SocketAddress; -class Mutex; - -/** Socket container class, event generator. - \ingroup basic */ -class ISocketHandler -{ - friend class Socket; - -public: - /** Connection pool class for internal use by the ISocketHandler. - \ingroup internal */ -#ifdef ENABLE_POOL - class PoolSocket : public Socket - { - public: - PoolSocket(ISocketHandler& h,Socket *src) : Socket(h) { - CopyConnection( src ); - SetIsClient(); - } - - void OnRead() { - Handler().LogError(this, "OnRead", 0, "data on hibernating socket", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - } - void OnOptions(int,int,int,SOCKET) {} - - }; -#endif - -public: - virtual ~ISocketHandler() {} - - /** Get mutex reference for threadsafe operations. */ - virtual Mutex& GetMutex() const = 0; - - /** Register StdLog object for error callback. - \param log Pointer to log class */ - virtual void RegStdLog(StdLog *log) = 0; - - /** Log error to log class for print out / storage. */ - virtual void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING) = 0; - - // ------------------------------------------------------------------------- - // Socket stuff - // ------------------------------------------------------------------------- - /** Add socket instance to socket map. Removal is always automatic. */ - virtual void Add(Socket *) = 0; -private: - /** Remove socket from socket map, used by Socket class. */ - virtual void Remove(Socket *) = 0; -public: - /** Get status of read/write/exception file descriptor set for a socket. */ - virtual void Get(SOCKET s,bool& r,bool& w,bool& e) = 0; - /** Set read/write/exception file descriptor sets (fd_set). */ - virtual void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true) = 0; - - /** Wait for events, generate callbacks. */ - virtual int Select(long sec,long usec) = 0; - /** This method will not return until an event has been detected. */ - virtual int Select() = 0; - /** Wait for events, generate callbacks. */ - virtual int Select(struct timeval *tsel) = 0; - - /** Check that a socket really is handled by this socket handler. */ - virtual bool Valid(Socket *) = 0; - /** Return number of sockets handled by this handler. */ - virtual size_t GetCount() = 0; - - /** Override and return false to deny all incoming connections. - \param p ListenSocket class pointer (use GetPort to identify which one) */ - virtual bool OkToAccept(Socket *p) = 0; - - /** Called by Socket when a socket changes state. */ - virtual void AddList(SOCKET s,list_t which_one,bool add) = 0; - - // ------------------------------------------------------------------------- - // Connection pool - // ------------------------------------------------------------------------- -#ifdef ENABLE_POOL - /** Find available open connection (used by connection pool). */ - virtual ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) = 0; - /** Enable connection pool (by default disabled). */ - virtual void EnablePool(bool = true) = 0; - /** Check pool status. - \return true if connection pool is enabled */ - virtual bool PoolEnabled() = 0; -#endif // ENABLE_POOL - - // ------------------------------------------------------------------------- - // Socks4 - // ------------------------------------------------------------------------- -#ifdef ENABLE_SOCKS4 - /** Set socks4 server ip that all new tcp sockets should use. */ - virtual void SetSocks4Host(ipaddr_t) = 0; - /** Set socks4 server hostname that all new tcp sockets should use. */ - virtual void SetSocks4Host(const std::string& ) = 0; - /** Set socks4 server port number that all new tcp sockets should use. */ - virtual void SetSocks4Port(port_t) = 0; - /** Set optional socks4 userid. */ - virtual void SetSocks4Userid(const std::string& ) = 0; - /** If connection to socks4 server fails, immediately try direct connection to final host. */ - virtual void SetSocks4TryDirect(bool = true) = 0; - /** Get socks4 server ip. - \return socks4 server ip */ - virtual ipaddr_t GetSocks4Host() = 0; - /** Get socks4 port number. - \return socks4 port number */ - virtual port_t GetSocks4Port() = 0; - /** Get socks4 userid (optional). - \return socks4 userid */ - virtual const std::string& GetSocks4Userid() = 0; - /** Check status of socks4 try direct flag. - \return true if direct connection should be tried if connection to socks4 server fails */ - virtual bool Socks4TryDirect() = 0; -#endif // ENABLE_SOCKS4 - - // ------------------------------------------------------------------------- - // DNS resolve server - // ------------------------------------------------------------------------- -#ifdef ENABLE_RESOLVER - /** Enable asynchronous DNS. - \param port Listen port of asynchronous dns server */ - virtual void EnableResolver(port_t = 16667) = 0; - /** Check resolver status. - \return true if resolver is enabled */ - virtual bool ResolverEnabled() = 0; - /** Queue a dns request. - \param host Hostname to be resolved - \param port Port number will be echoed in Socket::OnResolved callback */ - virtual int Resolve(Socket *,const std::string& host,port_t port) = 0; -#ifdef ENABLE_IPV6 - virtual int Resolve6(Socket *,const std::string& host,port_t port) = 0; -#endif - /** Do a reverse dns lookup. */ - virtual int Resolve(Socket *,ipaddr_t a) = 0; -#ifdef ENABLE_IPV6 - virtual int Resolve(Socket *,in6_addr& a) = 0; -#endif - /** Get listen port of asynchronous dns server. */ - virtual port_t GetResolverPort() = 0; - /** Resolver thread ready for queries. */ - virtual bool ResolverReady() = 0; - /** Returns true if socket waiting for a resolve event. */ - virtual bool Resolving(Socket *) = 0; -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_TRIGGERS - /** Fetch unique trigger id. */ - virtual int TriggerID(Socket *src) = 0; - /** Subscribe socket to trigger id. */ - virtual bool Subscribe(int id, Socket *dst) = 0; - /** Unsubscribe socket from trigger id. */ - virtual bool Unsubscribe(int id, Socket *dst) = 0; - /** Execute OnTrigger for subscribed sockets. - \param id Trigger ID - \param data Data passed from source to destination - \param erase Empty trigger id source and destination maps if 'true', - Leave them in place if 'false' - if a trigger should be called many times */ - virtual void Trigger(int id, Socket::TriggerData& data, bool erase = true) = 0; -#endif // ENABLE_TRIGGERS - -#ifdef ENABLE_DETACH - /** Indicates that the handler runs under SocketThread. */ - virtual void SetSlave(bool x = true) = 0; - /** Indicates that the handler runs under SocketThread. */ - virtual bool IsSlave() = 0; -#endif // ENABLE_DETACH - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_ISocketHandler_H - - diff --git a/dep/include/sockets/Ipv4Address.h b/dep/include/sockets/Ipv4Address.h deleted file mode 100644 index 71d925254e9..00000000000 --- a/dep/include/sockets/Ipv4Address.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - ** \file Ipv4Address.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Ipv4Address_H -#define _SOCKETS_Ipv4Address_H - -#include "sockets-config.h" -#include "SocketAddress.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/* Ipv4 address implementation. - \ingroup basic */ -class Ipv4Address : public SocketAddress -{ -public: - /** Create empty Ipv4 address structure. - \param port Port number */ - Ipv4Address(port_t port = 0); - /** Create Ipv4 address structure. - \param a Socket address in network byte order (as returned by Utility::u2ip) - \param port Port number in host byte order */ - Ipv4Address(ipaddr_t a,port_t port); - /** Create Ipv4 address structure. - \param a Socket address in network byte order - \param port Port number in host byte order */ - Ipv4Address(struct in_addr& a,port_t port); - /** Create Ipv4 address structure. - \param host Hostname to be resolved - \param port Port number in host byte order */ - Ipv4Address(const std::string& host,port_t port); - Ipv4Address(struct sockaddr_in&); - ~Ipv4Address(); - - // SocketAddress implementation - - operator struct sockaddr *(); - operator socklen_t(); - bool operator==(SocketAddress&); - - void SetPort(port_t port); - port_t GetPort(); - - void SetAddress(struct sockaddr *sa); - int GetFamily(); - - bool IsValid(); - std::auto_ptr GetCopy(); - - /** Convert address struct to text. */ - std::string Convert(bool include_port = false); - std::string Reverse(); - - /** Resolve hostname. */ -static bool Resolve(const std::string& hostname,struct in_addr& a); - /** Reverse resolve (IP to hostname). */ -static bool Reverse(struct in_addr& a,std::string& name); - /** Convert address struct to text. */ -static std::string Convert(struct in_addr& a); - -private: - Ipv4Address(const Ipv4Address& ) {} // copy constructor - Ipv4Address& operator=(const Ipv4Address& ) { return *this; } // assignment operator - struct sockaddr_in m_addr; - bool m_valid; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // _SOCKETS_Ipv4Address_H - - diff --git a/dep/include/sockets/Ipv6Address.h b/dep/include/sockets/Ipv6Address.h deleted file mode 100644 index 20c68d8c92d..00000000000 --- a/dep/include/sockets/Ipv6Address.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - ** \file Ipv6Address.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Ipv6Address_H -#define _SOCKETS_Ipv6Address_H -#include "sockets-config.h" -#ifdef ENABLE_IPV6 - -#include "SocketAddress.h" -#ifdef IPPROTO_IPV6 -#if defined( _WIN32) && !defined(__CYGWIN__) -typedef unsigned __int32 uint32_t; -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Ipv6 address implementation. - \ingroup basic */ -class Ipv6Address : public SocketAddress -{ -public: - /** Create empty Ipv6 address structure. - \param port Port number */ - Ipv6Address(port_t port = 0); - /** Create Ipv6 address structure. - \param a Socket address in network byte order - \param port Port number in host byte order */ - Ipv6Address(struct in6_addr& a,port_t port); - /** Create Ipv6 address structure. - \param host Hostname to be resolved - \param port Port number in host byte order */ - Ipv6Address(const std::string& host,port_t port); - Ipv6Address(struct sockaddr_in6&); - ~Ipv6Address(); - - // SocketAddress implementation - - operator struct sockaddr *(); - operator socklen_t(); - bool operator==(SocketAddress&); - - void SetPort(port_t port); - port_t GetPort(); - - void SetAddress(struct sockaddr *sa); - int GetFamily(); - - bool IsValid(); - std::auto_ptr GetCopy(); - - /** Convert address struct to text. */ - std::string Convert(bool include_port = false); - std::string Reverse(); - - /** Resolve hostname. */ -static bool Resolve(const std::string& hostname,struct in6_addr& a); - /** Reverse resolve (IP to hostname). */ -static bool Reverse(struct in6_addr& a,std::string& name); - /** Convert address struct to text. */ -static std::string Convert(struct in6_addr& a,bool mixed = false); - - void SetFlowinfo(uint32_t); - uint32_t GetFlowinfo(); -#ifndef _WIN32 - void SetScopeId(uint32_t); - uint32_t GetScopeId(); -#endif - -private: - Ipv6Address(const Ipv6Address& ) {} // copy constructor - Ipv6Address& operator=(const Ipv6Address& ) { return *this; } // assignment operator - struct sockaddr_in6 m_addr; - bool m_valid; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // IPPROTO_IPV6 -#endif // ENABLE_IPV6 -#endif // _SOCKETS_Ipv6Address_H - - diff --git a/dep/include/sockets/ListenSocket.h b/dep/include/sockets/ListenSocket.h deleted file mode 100644 index 8934a809d0e..00000000000 --- a/dep/include/sockets/ListenSocket.h +++ /dev/null @@ -1,418 +0,0 @@ -/** \file ListenSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ListenSocket_H -#define _SOCKETS_ListenSocket_H -#include "sockets-config.h" - -#ifdef _WIN32 -#include -#else -#include -#endif - -#include "ISocketHandler.h" -#include "Socket.h" -#include "Utility.h" -#include "SctpSocket.h" -#include "Ipv4Address.h" -#include "Ipv6Address.h" -#ifdef ENABLE_EXCEPTIONS -#include "Exception.h" -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Binds incoming port number to new Socket class X. - \ingroup basic */ -template -class ListenSocket : public Socket -{ -public: - /** Constructor. - \param h ISocketHandler reference - \param use_creator Optional use of creator (default true) */ - ListenSocket(ISocketHandler& h,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL) - ,m_bHasCreate(false) - { - if (use_creator) - { - m_creator = new X(h); - Socket *tmp = m_creator -> Create(); - if (tmp && dynamic_cast(tmp)) - { - m_bHasCreate = true; - } - if (tmp) - { - delete tmp; - } - } - } - ~ListenSocket() { - if (m_creator) - { - delete m_creator; - } - } - - /** Close file descriptor. */ - int Close() { - if (GetSocket() != INVALID_SOCKET) - { - closesocket(GetSocket()); - } - return 0; - } - - /** Bind and listen to any interface. - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(port_t port,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(port); - return Bind(ad, depth); - } - else -#endif -#endif - { - Ipv4Address ad(port); - return Bind(ad, depth); - } - } - - int Bind(SocketAddress& ad,int depth) { -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - - /** Bind and listen to any interface, with optional protocol. - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(port_t port,const std::string& protocol,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(port); - return Bind(ad, protocol, depth); - } - else -#endif -#endif - { - Ipv4Address ad(port); - return Bind(ad, protocol, depth); - } - } - - /** Bind and listen to specific interface. - \param intf Interface hostname - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(const std::string& intf,port_t port,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - else -#endif -#endif - { - Ipv4Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - } - - /** Bind and listen to specific interface. - \param intf Interface hostname - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(const std::string& intf,port_t port,const std::string& protocol,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, protocol, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - else -#endif -#endif - { - Ipv4Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, protocol, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - } - - /** Bind and listen to ipv4 interface. - \param a Ipv4 interface address - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(ipaddr_t a,port_t port,int depth = 20) { - Ipv4Address ad(a, port); -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - /** Bind and listen to ipv4 interface. - \param a Ipv4 interface address - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(ipaddr_t a,port_t port,const std::string& protocol,int depth) { - Ipv4Address ad(a, port); - return Bind(ad, protocol, depth); - } - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Bind and listen to ipv6 interface. - \param a Ipv6 interface address - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(in6_addr a,port_t port,int depth = 20) { - Ipv6Address ad(a, port); -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - /** Bind and listen to ipv6 interface. - \param a Ipv6 interface address - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(in6_addr a,port_t port,const std::string& protocol,int depth) { - Ipv6Address ad(a, port); - return Bind(ad, protocol, depth); - } -#endif -#endif - - /** Bind and listen to network interface. - \param ad Interface address - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(SocketAddress& ad,const std::string& protocol,int depth) { - SOCKET s; - if ( (s = CreateSocket(ad.GetFamily(), SOCK_STREAM, protocol)) == INVALID_SOCKET) - { - return -1; - } - if (bind(s, ad, ad) == -1) - { - Handler().LogError(this, "bind", Errno, StrError(Errno), LOG_LEVEL_FATAL); - closesocket(s); -#ifdef ENABLE_EXCEPTIONS - throw Exception("bind() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno)); -#endif - return -1; - } - if (listen(s, depth) == -1) - { - Handler().LogError(this, "listen", Errno, StrError(Errno), LOG_LEVEL_FATAL); - closesocket(s); -#ifdef ENABLE_EXCEPTIONS - throw Exception("listen() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno)); -#endif - return -1; - } - m_depth = depth; - Attach(s); - return 0; - } - - /** Return assigned port number. */ - port_t GetPort() - { - return GetSockPort(); - } - - /** Return listen queue depth. */ - int GetDepth() - { - return m_depth; - } - - /** OnRead on a ListenSocket receives an incoming connection. */ - void OnRead() - { - struct sockaddr sa; - socklen_t sa_len = sizeof(struct sockaddr); - SOCKET a_s = accept(GetSocket(), &sa, &sa_len); - - if (a_s == INVALID_SOCKET) - { - Handler().LogError(this, "accept", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return; - } - if (!Handler().OkToAccept(this)) - { - Handler().LogError(this, "accept", -1, "Not OK to accept", LOG_LEVEL_WARNING); - closesocket(a_s); - return; - } - if (Handler().GetCount() >= FD_SETSIZE) - { - Handler().LogError(this, "accept", (int)Handler().GetCount(), "ISocketHandler fd_set limit reached", LOG_LEVEL_FATAL); - closesocket(a_s); - return; - } - Socket *tmp = m_bHasCreate ? m_creator -> Create() : new X(Handler()); -#ifdef ENABLE_IPV6 - tmp -> SetIpv6( IsIpv6() ); -#endif - tmp -> SetParent(this); - tmp -> Attach(a_s); - tmp -> SetNonblocking(true); - { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (sa_len == sizeof(struct sockaddr_in6)) - { - struct sockaddr_in6 *p = (struct sockaddr_in6 *)&sa; - if (p -> sin6_family == AF_INET6) - { - Ipv6Address ad(p -> sin6_addr,ntohs(p -> sin6_port)); - ad.SetFlowinfo(p -> sin6_flowinfo); -#ifndef _WIN32 - ad.SetScopeId(p -> sin6_scope_id); -#endif - tmp -> SetRemoteAddress(ad); - } - } -#endif -#endif - if (sa_len == sizeof(struct sockaddr_in)) - { - struct sockaddr_in *p = (struct sockaddr_in *)&sa; - if (p -> sin_family == AF_INET) - { - Ipv4Address ad(p -> sin_addr,ntohs(p -> sin_port)); - tmp -> SetRemoteAddress(ad); - } - } - } - tmp -> SetConnected(true); - tmp -> Init(); - tmp -> SetDeleteByHandler(true); - Handler().Add(tmp); -#ifdef HAVE_OPENSSL - if (tmp -> IsSSL()) // SSL Enabled socket - { - // %! OnSSLAccept calls SSLNegotiate that can finish in this one call. - // %! If that happens and negotiation fails, the 'tmp' instance is - // %! still added to the list of active sockets in the sockethandler. - // %! See bugfix for this in SocketHandler::Select - don't Set rwx - // %! flags if CloseAndDelete() flag is true. - // %! An even better fugbix (see TcpSocket::OnSSLAccept) now avoids - // %! the Add problem altogether, so ignore the above. - // %! (OnSSLAccept does no longer call SSLNegotiate().) - tmp -> OnSSLAccept(); - } - else -#endif - { - tmp -> OnAccept(); - } - } - - /** Please don't use this method. - "accept()" is handled automatically in the OnRead() method. */ - virtual SOCKET Accept(SOCKET socket, struct sockaddr *saptr, socklen_t *lenptr) - { - return accept(socket, saptr, lenptr); - } - - bool HasCreator() { return m_bHasCreate; } - - void OnOptions(int,int,int,SOCKET) { - SetSoReuseaddr(true); - } - -protected: - ListenSocket(const ListenSocket& s) : Socket(s) {} -private: - ListenSocket& operator=(const ListenSocket& ) { return *this; } - int m_depth; - X *m_creator; - bool m_bHasCreate; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_ListenSocket_H - - diff --git a/dep/include/sockets/Lock.h b/dep/include/sockets/Lock.h deleted file mode 100644 index f3bb9273920..00000000000 --- a/dep/include/sockets/Lock.h +++ /dev/null @@ -1,58 +0,0 @@ -/** \file Lock.h - ** \date 2005-08-22 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2005,2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Lock_H -#define _SOCKETS_Lock_H - -#include "sockets-config.h" -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Mutex; - -/** Mutex encapsulation class. - \ingroup threading */ -class Lock -{ -public: - Lock(Mutex&); - ~Lock(); - -private: - Mutex& m_mutex; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif -#endif // _SOCKETS_Lock_H - - diff --git a/dep/include/sockets/Mutex.h b/dep/include/sockets/Mutex.h deleted file mode 100644 index e42a57c3262..00000000000 --- a/dep/include/sockets/Mutex.h +++ /dev/null @@ -1,68 +0,0 @@ -/** \file Mutex.h - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Mutex_H -#define _SOCKETS_Mutex_H - -#include "sockets-config.h" -#ifndef _WIN32 -#include -#else -#include -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Mutex container class, used by Lock. - \ingroup threading */ -class Mutex -{ - friend class Lock; -public: - Mutex(); - ~Mutex(); - - void Lock(); - void Unlock(); -private: -#ifdef _WIN32 - HANDLE m_mutex; -#else - pthread_mutex_t m_mutex; -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif -#endif // _SOCKETS_Mutex_H - - diff --git a/dep/include/sockets/Parse.h b/dep/include/sockets/Parse.h deleted file mode 100644 index 52bd9327e28..00000000000 --- a/dep/include/sockets/Parse.h +++ /dev/null @@ -1,100 +0,0 @@ -/** \file Parse.h - parse a string - ** - ** Written: 1999-Feb-10 grymse@alhem.net - **/ - -/* -Copyright (C) 1999-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _SOCKETS_Parse_H -#define _SOCKETS_Parse_H - -#include "sockets-config.h" -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/***************************************************/ -/* interface of class Parse */ - -/** Splits a string whatever way you want. - \ingroup util */ -class Parse -{ -public: - Parse(); - Parse(const std::string&); - Parse(const std::string&,const std::string&); - Parse(const std::string&,const std::string&,short); - ~Parse(); - short issplit(const char); - void getsplit(); - void getsplit(std::string&); - std::string getword(); - void getword(std::string&); - void getword(std::string&,std::string&,int); - std::string getrest(); - void getrest(std::string&); - long getvalue(); - void setbreak(const char); - int getwordlen(); - int getrestlen(); - void enablebreak(const char c) { - pa_enable = c; - } - void disablebreak(const char c) { - pa_disable = c; - } - void getline(); - void getline(std::string&); - size_t getptr() { return pa_the_ptr; } - void EnableQuote(bool b) { pa_quote = b; } - -private: - std::string pa_the_str; - std::string pa_splits; - std::string pa_ord; - size_t pa_the_ptr; - char pa_breakchar; - char pa_enable; - char pa_disable; - short pa_nospace; - bool pa_quote; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Parse_H - - diff --git a/dep/include/sockets/ResolvServer.h b/dep/include/sockets/ResolvServer.h deleted file mode 100644 index 409c9b7a619..00000000000 --- a/dep/include/sockets/ResolvServer.h +++ /dev/null @@ -1,72 +0,0 @@ -/** \file ResolvServer.h - ** \date 2005-03-24 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ResolvServer_H -#define _SOCKETS_ResolvServer_H -#include "sockets-config.h" -#ifdef ENABLE_RESOLVER -#include "socket_include.h" -#include "Thread.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup async Asynchronous DNS */ -/** Async DNS resolver thread. - \ingroup async */ -class ResolvServer : public Thread -{ -public: - ResolvServer(port_t); - ~ResolvServer(); - - void Run(); - void Quit(); - - bool Ready(); - -private: - ResolvServer(const ResolvServer& ) {} // copy constructor - ResolvServer& operator=(const ResolvServer& ) { return *this; } // assignment operator - - bool m_quit; - port_t m_port; - bool m_ready; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER -#endif // _SOCKETS_ResolvServer_H - - diff --git a/dep/include/sockets/ResolvSocket.h b/dep/include/sockets/ResolvSocket.h deleted file mode 100644 index 60743736e08..00000000000 --- a/dep/include/sockets/ResolvSocket.h +++ /dev/null @@ -1,105 +0,0 @@ -/** \file ResolvSocket.h - ** \date 2005-03-24 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ResolvSocket_H -#define _SOCKETS_ResolvSocket_H -#include "sockets-config.h" -#ifdef ENABLE_RESOLVER -#include "TcpSocket.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Mutex; - -/** Async DNS resolver socket. - \ingroup async */ -class ResolvSocket : public TcpSocket -{ - typedef std::map > cache_t; /* host, result */ - typedef std::map > timeout_t; /* host, time */ - -public: - ResolvSocket(ISocketHandler&); - ResolvSocket(ISocketHandler&, Socket *parent, const std::string& host, port_t port, bool ipv6 = false); - ResolvSocket(ISocketHandler&, Socket *parent, ipaddr_t); -#ifdef ENABLE_IPV6 - ResolvSocket(ISocketHandler&, Socket *parent, in6_addr&); -#endif - ~ResolvSocket(); - - void OnAccept() { m_bServer = true; } - void OnLine(const std::string& line); - void OnDetached(); - void OnDelete(); - - void SetId(int x) { m_resolv_id = x; } - int GetId() { return m_resolv_id; } - - void OnConnect(); - -#ifdef ENABLE_IPV6 - void SetResolveIpv6(bool x = true) { m_resolve_ipv6 = x; } -#endif - -private: - ResolvSocket(const ResolvSocket& s) : TcpSocket(s) {} // copy constructor - ResolvSocket& operator=(const ResolvSocket& ) { return *this; } // assignment operator - - std::string m_query; - std::string m_data; - bool m_bServer; - Socket *m_parent; - int m_resolv_id; - std::string m_resolv_host; - port_t m_resolv_port; - ipaddr_t m_resolv_address; -#ifdef ENABLE_IPV6 - bool m_resolve_ipv6; - in6_addr m_resolv_address6; -#endif - static cache_t m_cache; - static timeout_t m_cache_to; - static Mutex m_cache_mutex; - bool m_cached; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER -#endif // _SOCKETS_ResolvSocket_H - - diff --git a/dep/include/sockets/SctpSocket.h b/dep/include/sockets/SctpSocket.h deleted file mode 100644 index ed507fb1880..00000000000 --- a/dep/include/sockets/SctpSocket.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - ** \file SctpSocket.h - ** \date 2006-09-04 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SctpSocket_H -#define _SOCKETS_SctpSocket_H -#include "sockets-config.h" - -#include "StreamSocket.h" -#ifdef USE_SCTP -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#define SCTP_BUFSIZE_READ 16400 - -class SocketAddress; - -class SctpSocket : public StreamSocket -{ -public: - /** SctpSocket constructor. - \param h Owner - \param type SCTP_STREAM or SCTP_SEQPACKET */ - SctpSocket(ISocketHandler& h,int type); - ~SctpSocket(); - - /** bind() */ - int Bind(const std::string&,port_t); - int Bind(SocketAddress&); - /** sctp_bindx() */ - int AddAddress(const std::string&,port_t); - int AddAddress(SocketAddress&); - /** sctp_bindx() */ - int RemoveAddress(const std::string&,port_t); - int RemoveAddress(SocketAddress&); - - /** connect() */ - int Open(const std::string&,port_t); - int Open(SocketAddress&); - - /** Connect timeout callback. */ - void OnConnectTimeout(); -#ifdef _WIN32 - /** Connection failed reported as exception on win32 */ - void OnException(); -#endif - -#ifndef SOLARIS - /** sctp_connectx() */ - int AddConnection(const std::string&,port_t); - int AddConnection(SocketAddress&); -#endif - - /** Get peer addresses of an association. */ - int getpaddrs(sctp_assoc_t id,std::list&); - /** Get all bound addresses of an association. */ - int getladdrs(sctp_assoc_t id,std::list&); - - /** sctp_peeloff */ - int PeelOff(sctp_assoc_t id); - - /** recvmsg callback */ - virtual void OnReceiveMessage(const char *buf,size_t sz,struct sockaddr *sa,socklen_t sa_len,struct sctp_sndrcvinfo *sinfo,int msg_flags) = 0; - - void OnOptions(int,int,int,SOCKET) {} - - virtual int Protocol(); - -protected: - SctpSocket(const SctpSocket& s) : StreamSocket(s) {} - void OnRead(); - void OnWrite(); - -private: - SctpSocket& operator=(const SctpSocket& s) { return *this; } - int m_type; ///< SCTP_STREAM or SCTP_SEQPACKET - char *m_buf; ///< Temporary receive buffer -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE -#endif - -#endif // USE_SCTP -#endif // _SOCKETS_SctpSocket_H - - diff --git a/dep/include/sockets/Socket.h b/dep/include/sockets/Socket.h deleted file mode 100644 index 23a806b5ea1..00000000000 --- a/dep/include/sockets/Socket.h +++ /dev/null @@ -1,735 +0,0 @@ -/** \file Socket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This software is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Socket_H -#define _SOCKETS_Socket_H -#include "sockets-config.h" - -#include -#include -#include -#ifdef HAVE_OPENSSL -#include -#endif - -#include "socket_include.h" -#include -#include "SocketAddress.h" -#include "Thread.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class ISocketHandler; -class SocketAddress; -class IFile; - -/** \defgroup basic Basic sockets */ -/** Socket base class. - \ingroup basic */ -class Socket -{ - friend class ISocketHandler; -#ifdef ENABLE_DETACH - /** Detached socket run thread. - \ingroup internal */ - class SocketThread : public Thread - { - public: - SocketThread(Socket *p); - ~SocketThread(); - - void Run(); - - private: - Socket *GetSocket() const { return m_socket; } - SocketThread(const SocketThread& s) : m_socket(s.GetSocket()) {} - SocketThread& operator=(const SocketThread& ) { return *this; } - Socket *m_socket; - }; -#endif // ENABLE_DETACH - -#ifdef ENABLE_TRIGGERS -public: - /** Data pass class from source to destination. */ - class TriggerData - { - public: - TriggerData() : m_src(NULL) {} - virtual ~TriggerData() {} - - Socket *GetSource() const { return m_src; } - void SetSource(Socket *x) { m_src = x; } - - private: - Socket *m_src; - }; -#endif // ENABLE_TRIGGERS - - /** Socket mode flags. */ -/* - enum { - // Socket - SOCK_DEL = 0x01, ///< Delete by handler flag - SOCK_CLOSE = 0x02, ///< Close and delete flag - SOCK_DISABLE_READ = 0x04, ///< Disable checking for read events - SOCK_CONNECTED = 0x08, ///< Socket is connected (tcp/udp) - - SOCK_ERASED_BY_HANDLER = 0x10, ///< Set by handler before delete - // HAVE_OPENSSL - SOCK_ENABLE_SSL = 0x20, ///< Enable SSL for this TcpSocket - SOCK_SSL = 0x40, ///< ssl negotiation mode (TcpSocket) - SOCK_SSL_SERVER = 0x80, ///< True if this is an incoming ssl TcpSocket connection - - // ENABLE_IPV6 - SOCK_IPV6 = 0x0100, ///< This is an ipv6 socket if this one is true - // ENABLE_POOL - SOCK_CLIENT = 0x0200, ///< only client connections are pooled - SOCK_RETAIN = 0x0400, ///< keep connection on close - SOCK_LOST = 0x0800, ///< connection lost - - // ENABLE_SOCKS4 - SOCK_SOCKS4 = 0x1000, ///< socks4 negotiation mode (TcpSocket) - // ENABLE_DETACH - SOCK_DETACH = 0x2000, ///< Socket ordered to detach flag - SOCK_DETACHED = 0x4000, ///< Socket has been detached - // StreamSocket - STREAMSOCK_CONNECTING = 0x8000, ///< Flag indicating connection in progress - - STREAMSOCK_FLUSH_BEFORE_CLOSE = 0x010000L, ///< Send all data before closing (default true) - STREAMSOCK_CALL_ON_CONNECT = 0x020000L, ///< OnConnect will be called next ISocketHandler cycle if true - STREAMSOCK_RETRY_CONNECT = 0x040000L, ///< Try another connection attempt next ISocketHandler cycle - STREAMSOCK_LINE_PROTOCOL = 0x080000L, ///< Line protocol mode flag - - }; -*/ - -public: - /** "Default" constructor */ - Socket(ISocketHandler&); - - virtual ~Socket(); - - /** Socket class instantiation method. Used when a "non-standard" constructor - * needs to be used for the socket class. Note: the socket class still needs - * the "default" constructor with one ISocketHandler& as input parameter. - */ - virtual Socket *Create() { return NULL; } - - /** Returns reference to sockethandler that owns the socket. - If the socket is detached, this is a reference to the slave sockethandler. - */ - ISocketHandler& Handler() const; - - /** Returns reference to sockethandler that owns the socket. - This one always returns the reference to the original sockethandler, - even if the socket is detached. - */ - ISocketHandler& MasterHandler() const; - - /** Called by ListenSocket after accept but before socket is added to handler. - * CTcpSocket uses this to create its ICrypt member variable. - * The ICrypt member variable is created by a virtual method, therefore - * it can't be called directly from the CTcpSocket constructor. - * Also used to determine if incoming HTTP connection is normal (port 80) - * or ssl (port 443). - */ - virtual void Init(); - - /** Create a socket file descriptor. - \param af Address family AF_INET / AF_INET6 / ... - \param type SOCK_STREAM / SOCK_DGRAM / ... - \param protocol "tcp" / "udp" / ... */ - SOCKET CreateSocket(int af,int type,const std::string& protocol = ""); - - /** Assign this socket a file descriptor created - by a call to socket() or otherwise. */ - void Attach(SOCKET s); - - /** Return file descriptor assigned to this socket. */ - SOCKET GetSocket(); - - /** Close connection immediately - internal use. - \sa SetCloseAndDelete */ - virtual int Close(); - - /** Add file descriptor to sockethandler fd_set's. */ - void Set(bool bRead,bool bWrite,bool bException = true); - - /** Returns true when socket file descriptor is valid - and socket is not about to be closed. */ - virtual bool Ready(); - - /** Returns pointer to ListenSocket that created this instance - * on an incoming connection. */ - Socket *GetParent(); - - /** Used by ListenSocket to set parent pointer of newly created - * socket instance. */ - void SetParent(Socket *); - - /** Get listening port from ListenSocket<>. */ - virtual port_t GetPort(); - - /** Set socket non-block operation. */ - bool SetNonblocking(bool); - - /** Set socket non-block operation. */ - bool SetNonblocking(bool, SOCKET); - - /** Total lifetime of instance. */ - time_t Uptime(); - - /** Set address/port of last connect() call. */ - void SetClientRemoteAddress(SocketAddress&); - - /** Get address/port of last connect() call. */ - std::auto_ptr GetClientRemoteAddress(); - - /** Common interface for SendBuf used by Tcp and Udp sockets. */ - virtual void SendBuf(const char *,size_t,int = 0); - - /** Common interface for Send used by Tcp and Udp sockets. */ - virtual void Send(const std::string&,int = 0); - - /** Outgoing traffic counter. */ - virtual uint64_t GetBytesSent(bool clear = false); - - /** Incoming traffic counter. */ - virtual uint64_t GetBytesReceived(bool clear = false); - - // LIST_TIMEOUT - - /** Enable timeout control. 0=disable timeout check. */ - void SetTimeout(time_t secs); - - /** Check timeout. \return true if time limit reached */ - bool Timeout(time_t tnow); - - /** Used by ListenSocket. ipv4 and ipv6 */ - void SetRemoteAddress(SocketAddress&); - - /** \name Event callbacks */ - //@{ - - /** Called when there is something to be read from the file descriptor. */ - virtual void OnRead(); - /** Called when there is room for another write on the file descriptor. */ - virtual void OnWrite(); - /** Called on socket exception. */ - virtual void OnException(); - /** Called before a socket class is deleted by the ISocketHandler. */ - virtual void OnDelete(); - /** Called when a connection has completed. */ - virtual void OnConnect(); - /** Called when an incoming connection has been completed. */ - virtual void OnAccept(); - /** Called when a complete line has been read and the socket is in - * line protocol mode. */ - virtual void OnLine(const std::string& ); - /** Called on connect timeout (5s). */ - virtual void OnConnectFailed(); - /** Called when a client socket is created, to set socket options. - \param family AF_INET, AF_INET6, etc - \param type SOCK_STREAM, SOCK_DGRAM, etc - \param protocol Protocol number (tcp, udp, sctp, etc) - \param s Socket file descriptor - */ - virtual void OnOptions(int family,int type,int protocol,SOCKET s) = 0; - /** Connection retry callback - return false to abort connection attempts */ - virtual bool OnConnectRetry(); -#ifdef ENABLE_RECONNECT - /** a reconnect has been made */ - virtual void OnReconnect(); -#endif - /** TcpSocket: When a disconnect has been detected (recv/SSL_read returns 0 bytes). */ - virtual void OnDisconnect(); - /** Timeout callback. */ - virtual void OnTimeout(); - /** Connection timeout. */ - virtual void OnConnectTimeout(); - //@} - - /** \name Socket mode flags, set/reset */ - //@{ - /** Set delete by handler true when you want the sockethandler to - delete the socket instance after use. */ - void SetDeleteByHandler(bool = true); - /** Check delete by handler flag. - \return true if this instance should be deleted by the sockethandler */ - bool DeleteByHandler(); - - // LIST_CLOSE - conditional event queue - - /** Set close and delete to terminate the connection. */ - void SetCloseAndDelete(bool = true); - /** Check close and delete flag. - \return true if this socket should be closed and the instance removed */ - bool CloseAndDelete(); - - /** Return number of seconds since socket was ordered to close. \sa SetCloseAndDelete */ - time_t TimeSinceClose(); - - /** Ignore read events for an output only socket. */ - void DisableRead(bool x = true); - /** Check ignore read events flag. - \return true if read events should be ignored */ - bool IsDisableRead(); - - /** Set connected status. */ - void SetConnected(bool = true); - /** Check connected status. - \return true if connected */ - bool IsConnected(); - - /** Connection lost - error while reading/writing from a socket - TcpSocket only. */ - void SetLost(); - /** Check connection lost status flag, used by TcpSocket only. - \return true if there was an error while r/w causing the socket to close */ - bool Lost(); - - /** Set flag indicating the socket is being actively deleted by the sockethandler. */ - void SetErasedByHandler(bool x = true); - /** Get value of flag indicating socket is deleted by sockethandler. */ - bool ErasedByHandler(); - - //@} - - /** \name Information about remote connection */ - //@{ - /** Returns address of remote end. */ - std::auto_ptr GetRemoteSocketAddress(); - /** Returns address of remote end: ipv4. */ - ipaddr_t GetRemoteIP4(); -#ifdef ENABLE_IPV6 - /** Returns address of remote end: ipv6. */ -#ifdef IPPROTO_IPV6 - struct in6_addr GetRemoteIP6(); -#endif -#endif - /** Returns remote port number: ipv4 and ipv6. */ - port_t GetRemotePort(); - /** Returns remote ip as string? ipv4 and ipv6. */ - std::string GetRemoteAddress(); - /** ipv4 and ipv6(not implemented) */ - std::string GetRemoteHostname(); - //@} - - /** Returns local port number for bound socket file descriptor. */ - port_t GetSockPort(); - /** Returns local ipv4 address for bound socket file descriptor. */ - ipaddr_t GetSockIP4(); - /** Returns local ipv4 address as text for bound socket file descriptor. */ - std::string GetSockAddress(); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Returns local ipv6 address for bound socket file descriptor. */ - struct in6_addr GetSockIP6(); - /** Returns local ipv6 address as text for bound socket file descriptor. */ - std::string GetSockAddress6(); -#endif -#endif - // -------------------------------------------------------------------------- - /** @name IP options - When an ip or socket option is available on all of the operating systems - I'm testing on (linux 2.4.x, _win32, macosx, solaris9 intel) they are not - checked with an #ifdef below. - This might cause a compile error on other operating systems. */ - // -------------------------------------------------------------------------- - - // IP options - //@{ - - bool SetIpOptions(const void *p, socklen_t len); - bool SetIpTOS(unsigned char tos); - unsigned char IpTOS(); - bool SetIpTTL(int ttl); - int IpTTL(); - bool SetIpHdrincl(bool x = true); - bool SetIpMulticastTTL(int); - int IpMulticastTTL(); - bool SetMulticastLoop(bool x = true); - bool IpAddMembership(struct ip_mreq&); - bool IpDropMembership(struct ip_mreq&); - -#ifdef IP_PKTINFO - bool SetIpPktinfo(bool x = true); -#endif -#ifdef IP_RECVTOS - bool SetIpRecvTOS(bool x = true); -#endif -#ifdef IP_RECVTTL - bool SetIpRecvTTL(bool x = true); -#endif -#ifdef IP_RECVOPTS - bool SetIpRecvopts(bool x = true); -#endif -#ifdef IP_RETOPTS - bool SetIpRetopts(bool x = true); -#endif -#ifdef IP_RECVERR - bool SetIpRecverr(bool x = true); -#endif -#ifdef IP_MTU_DISCOVER - bool SetIpMtudiscover(bool x = true); -#endif -#ifdef IP_MTU - int IpMtu(); -#endif -#ifdef IP_ROUTER_ALERT - bool SetIpRouterAlert(bool x = true); -#endif -#ifdef LINUX - bool IpAddMembership(struct ip_mreqn&); -#endif -#ifdef LINUX - bool IpDropMembership(struct ip_mreqn&); -#endif - //@} - - // SOCKET options - /** @name Socket Options */ - //@{ - - bool SoAcceptconn(); - bool SetSoBroadcast(bool x = true); - bool SetSoDebug(bool x = true); - int SoError(); - bool SetSoDontroute(bool x = true); - bool SetSoLinger(int onoff, int linger); - bool SetSoOobinline(bool x = true); - bool SetSoRcvlowat(int); - bool SetSoSndlowat(int); - bool SetSoRcvtimeo(struct timeval&); - bool SetSoSndtimeo(struct timeval&); - bool SetSoRcvbuf(int); - int SoRcvbuf(); - bool SetSoSndbuf(int); - int SoSndbuf(); - int SoType(); - bool SetSoReuseaddr(bool x = true); - bool SetSoKeepalive(bool x = true); - -#ifdef SO_BSDCOMPAT - bool SetSoBsdcompat(bool x = true); -#endif -#ifdef SO_BINDTODEVICE - bool SetSoBindtodevice(const std::string& intf); -#endif -#ifdef SO_PASSCRED - bool SetSoPasscred(bool x = true); -#endif -#ifdef SO_PEERCRED - bool SoPeercred(struct ucred& ); -#endif -#ifdef SO_PRIORITY - bool SetSoPriority(int); -#endif -#ifdef SO_RCVBUFFORCE - bool SetSoRcvbufforce(int); -#endif -#ifdef SO_SNDBUFFORCE - bool SetSoSndbufforce(int); -#endif -#ifdef SO_TIMESTAMP - bool SetSoTimestamp(bool x = true); -#endif -#ifdef SO_NOSIGPIPE - bool SetSoNosigpipe(bool x = true); -#endif - //@} - - // TCP options in TcpSocket.h/TcpSocket.cpp - -#ifdef HAVE_OPENSSL - /** @name SSL Support */ - //@{ - /** SSL client/server support - internal use. \sa TcpSocket */ - virtual void OnSSLConnect(); - /** SSL client/server support - internal use. \sa TcpSocket */ - virtual void OnSSLAccept(); - /** SSL negotiation failed for client connect. */ - virtual void OnSSLConnectFailed(); - /** SSL negotiation failed for server accept. */ - virtual void OnSSLAcceptFailed(); - /** new SSL support */ - virtual bool SSLNegotiate(); - /** Check if SSL is Enabled for this TcpSocket. - \return true if this is a TcpSocket with SSL enabled */ - bool IsSSL(); - /** Enable SSL operation for a TcpSocket. */ - void EnableSSL(bool x = true); - /** Still negotiating ssl connection. - \return true if ssl negotiating is still in progress */ - bool IsSSLNegotiate(); - /** Set flag indicating ssl handshaking still in progress. */ - void SetSSLNegotiate(bool x = true); - /** OnAccept called with SSL Enabled. - \return true if this is a TcpSocket with an incoming SSL connection */ - bool IsSSLServer(); - /** Set flag indicating that this is a TcpSocket with incoming SSL connection. */ - void SetSSLServer(bool x = true); - /** SSL; Get pointer to ssl context structure. */ - virtual SSL_CTX *GetSslContext() { return NULL; } - /** SSL; Get pointer to ssl structure. */ - virtual SSL *GetSsl() { return NULL; } - //@} -#endif // HAVE_OPENSSL - -#ifdef ENABLE_IPV6 - /** Enable ipv6 for this socket. */ - void SetIpv6(bool x = true); - /** Check ipv6 socket. - \return true if this is an ipv6 socket */ - bool IsIpv6(); -#endif - -#ifdef ENABLE_POOL - /** @name Connection Pool */ - //@{ - /** Client = connecting TcpSocket. */ - void SetIsClient(); - /** Socket type from socket() call. */ - void SetSocketType(int x); - /** Socket type from socket() call. */ - int GetSocketType(); - /** Protocol type from socket() call. */ - void SetSocketProtocol(const std::string& x); - /** Protocol type from socket() call. */ - const std::string& GetSocketProtocol(); - /** Instruct a client socket to stay open in the connection pool after use. - If you have connected to a server using tcp, you can call SetRetain - to leave the connection open after your socket instance has been deleted. - The next connection you make to the same server will reuse the already - opened connection, if it is still available. - */ - void SetRetain(); - /** Check retain flag. - \return true if the socket should be moved to connection pool after use */ - bool Retain(); - /** Copy connection parameters from sock. */ - void CopyConnection(Socket *sock); - //@} -#endif // ENABLE_POOL - -#ifdef ENABLE_SOCKS4 - /** \name Socks4 support */ - //@{ - /** Socks4 client support internal use. \sa TcpSocket */ - virtual void OnSocks4Connect(); - /** Socks4 client support internal use. \sa TcpSocket */ - virtual void OnSocks4ConnectFailed(); - /** Socks4 client support internal use. \sa TcpSocket */ - virtual bool OnSocks4Read(); - /** Called when the last write caused the tcp output buffer to - * become empty. */ - /** socket still in socks4 negotiation mode */ - bool Socks4(); - /** Set flag indicating Socks4 handshaking in progress */ - void SetSocks4(bool x = true); - - /** Set socks4 server host address to use */ - void SetSocks4Host(ipaddr_t a); - /** Set socks4 server hostname to use. */ - void SetSocks4Host(const std::string& ); - /** Socks4 server port to use. */ - void SetSocks4Port(port_t p); - /** Provide a socks4 userid if required by the socks4 server. */ - void SetSocks4Userid(const std::string& x); - /** Get the ip address of socks4 server to use. - \return socks4 server host address */ - ipaddr_t GetSocks4Host(); - /** Get the socks4 server port to use. - \return socks4 server port */ - port_t GetSocks4Port(); - /** Get socks4 userid. - \return Socks4 userid */ - const std::string& GetSocks4Userid(); - //@} -#endif // ENABLE_SOCKS4 - -#ifdef ENABLE_RESOLVER - /** \name Asynchronous Resolver */ - //@{ - /** Request an asynchronous dns resolution. - \param host hostname to be resolved - \param port port number passed along for the ride - \return Resolve ID */ - int Resolve(const std::string& host,port_t port = 0); -#ifdef ENABLE_IPV6 - int Resolve6(const std::string& host, port_t port = 0); -#endif - /** Callback returning a resolved address. - \param id Resolve ID from Resolve call - \param a resolved ip address - \param port port number passed to Resolve */ - virtual void OnResolved(int id,ipaddr_t a,port_t port); -#ifdef ENABLE_IPV6 - virtual void OnResolved(int id,in6_addr& a,port_t port); -#endif - /** Request asynchronous reverse dns lookup. - \param a in_addr to be translated */ - int Resolve(ipaddr_t a); -#ifdef ENABLE_IPV6 - int Resolve(in6_addr& a); -#endif - /** Callback returning reverse resolve results. - \param id Resolve ID - \param name Resolved hostname */ - virtual void OnReverseResolved(int id,const std::string& name); - /** Callback indicating failed dns lookup. - \param id Resolve ID */ - virtual void OnResolveFailed(int id); - //@} -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_DETACH - /** \name Thread Support */ - //@{ - /** Callback fires when a new socket thread has started and this - socket is ready for operation again. - \sa ResolvSocket */ - virtual void OnDetached(); - - // LIST_DETACH - - /** Internal use. */ - void SetDetach(bool x = true); - /** Check detach flag. - \return true if the socket should detach to its own thread */ - bool IsDetach(); - - /** Internal use. */ - void SetDetached(bool x = true); - /** Check detached flag. - \return true if the socket runs in its own thread. */ - const bool IsDetached() const; - /** Order this socket to start its own thread and call OnDetached - when ready for operation. */ - bool Detach(); - /** Store the slave sockethandler pointer. */ - void SetSlaveHandler(ISocketHandler *); - /** Create new thread for this socket to run detached in. */ - void DetachSocket(); - //@} -#endif // ENABLE_DETACH - - /** Write traffic to an IFile. Socket will not delete this object. */ - void SetTrafficMonitor(IFile *p) { m_traffic_monitor = p; } - -#ifdef ENABLE_TRIGGERS - /** \name Triggers */ - //@{ - /** Subscribe to trigger id. */ - void Subscribe(int id); - /** Unsubscribe from trigger id. */ - void Unsubscribe(int id); - /** Trigger callback, with data passed from source to destination. */ - virtual void OnTrigger(int id, const TriggerData& data); - /** Trigger cancelled because source has been deleted (as in delete). */ - virtual void OnCancelled(int id); - //@} -#endif - -protected: - /** default constructor not available */ - Socket() : m_handler(m_handler) {} - /** copy constructor not available */ - Socket(const Socket& s) : m_handler(s.m_handler) {} - - /** assignment operator not available. */ - Socket& operator=(const Socket& ) { return *this; } - - /** All traffic will be written to this IFile, if set. */ - IFile *GetTrafficMonitor() { return m_traffic_monitor; } - -// unsigned long m_flags; ///< boolean flags, replacing old 'bool' members - -private: - ISocketHandler& m_handler; ///< Reference of ISocketHandler in control of this socket - SOCKET m_socket; ///< File descriptor - bool m_bDel; ///< Delete by handler flag - bool m_bClose; ///< Close and delete flag - time_t m_tCreate; ///< Time in seconds when this socket was created - Socket *m_parent; ///< Pointer to ListenSocket class, valid for incoming sockets - bool m_b_disable_read; ///< Disable checking for read events - bool m_connected; ///< Socket is connected (tcp/udp) - bool m_b_erased_by_handler; ///< Set by handler before delete - time_t m_tClose; ///< Time in seconds when ordered to close - std::auto_ptr m_client_remote_address; ///< Address of last connect() - std::auto_ptr m_remote_address; ///< Remote end address - IFile *m_traffic_monitor; - time_t m_timeout_start; ///< Set by SetTimeout - time_t m_timeout_limit; ///< Defined by SetTimeout - bool m_bLost; ///< connection lost - -#ifdef _WIN32 -static WSAInitializer m_winsock_init; ///< Winsock initialization singleton class -#endif - -#ifdef HAVE_OPENSSL - bool m_b_enable_ssl; ///< Enable SSL for this TcpSocket - bool m_b_ssl; ///< ssl negotiation mode (TcpSocket) - bool m_b_ssl_server; ///< True if this is an incoming ssl TcpSocket connection -#endif - -#ifdef ENABLE_IPV6 - bool m_ipv6; ///< This is an ipv6 socket if this one is true -#endif - -#ifdef ENABLE_POOL - int m_socket_type; ///< Type of socket, from socket() call - std::string m_socket_protocol; ///< Protocol, from socket() call - bool m_bClient; ///< only client connections are pooled - bool m_bRetain; ///< keep connection on close -#endif - -#ifdef ENABLE_SOCKS4 - bool m_bSocks4; ///< socks4 negotiation mode (TcpSocket) - ipaddr_t m_socks4_host; ///< socks4 server address - port_t m_socks4_port; ///< socks4 server port number - std::string m_socks4_userid; ///< socks4 server usedid -#endif - -#ifdef ENABLE_DETACH - bool m_detach; ///< Socket ordered to detach flag - bool m_detached; ///< Socket has been detached - SocketThread *m_pThread; ///< Detach socket thread class pointer - ISocketHandler *m_slave_handler; ///< Actual sockethandler while detached -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Socket_H - - diff --git a/dep/include/sockets/SocketAddress.h b/dep/include/sockets/SocketAddress.h deleted file mode 100644 index abdbbfd2cf6..00000000000 --- a/dep/include/sockets/SocketAddress.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - ** \file SocketAddress.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SocketAddress_H -#define _SOCKETS_SocketAddress_H - -#include "sockets-config.h" -#include -#include -#include "socket_include.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** - This class and its subclasses is intended to be used as replacement - for the internal data type 'ipaddr_t' and various implementations of - IPv6 addressing found throughout the library. - 'ipaddr_t' is an IPv4 address in network byte order. - 'port_t' is the portnumber in host byte order. - 'struct in6_addr' is an IPv6 address. - 'struct in_addr' is an IPv4 address. - \ingroup basic -*/ -class SocketAddress -{ -public: - virtual ~SocketAddress() {} - - /** Get a pointer to the address struct. */ - virtual operator struct sockaddr *() = 0; - - /** Get length of address struct. */ - virtual operator socklen_t() = 0; - - /** Compare two addresses. */ - virtual bool operator==(SocketAddress&) = 0; - - /** Set port number. - \param port Port number in host byte order */ - virtual void SetPort(port_t port) = 0; - - /** Get port number. - \return Port number in host byte order. */ - virtual port_t GetPort() = 0; - - /** Set socket address. - \param sa Pointer to either 'struct sockaddr_in' or 'struct sockaddr_in6'. */ - virtual void SetAddress(struct sockaddr *sa) = 0; - - /** Convert address to text. */ - virtual std::string Convert(bool include_port) = 0; - - /** Reverse lookup of address. */ - virtual std::string Reverse() = 0; - - /** Get address family. */ - virtual int GetFamily() = 0; - - /** Address structure is valid. */ - virtual bool IsValid() = 0; - - /** Get a copy of this SocketAddress object. */ - virtual std::auto_ptr GetCopy() = 0; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // _SOCKETS_SocketAddress_H - - diff --git a/dep/include/sockets/SocketHandler.h b/dep/include/sockets/SocketHandler.h deleted file mode 100644 index 5598ec4249b..00000000000 --- a/dep/include/sockets/SocketHandler.h +++ /dev/null @@ -1,265 +0,0 @@ -/** \file SocketHandler.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SocketHandler_H -#define _SOCKETS_SocketHandler_H - -#include "sockets-config.h" -#include -#include - -#include "socket_include.h" -#include "ISocketHandler.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Socket; -#ifdef ENABLE_RESOLVER -class ResolvServer; -#endif -class Mutex; - -/** Socket container class, event generator. - \ingroup basic */ -class SocketHandler : public ISocketHandler -{ -protected: - /** Map type for holding file descriptors/socket object pointers. */ - typedef std::map socket_m; - -public: - /** SocketHandler constructor. - \param log Optional log class pointer */ - SocketHandler(StdLog *log = NULL); - - /** SocketHandler threadsafe constructor. - \param mutex Externally declared mutex variable - \param log Optional log class pointer */ - SocketHandler(Mutex& mutex,StdLog *log = NULL); - - ~SocketHandler(); - - /** Get mutex reference for threadsafe operations. */ - Mutex& GetMutex() const; - - /** Register StdLog object for error callback. - \param log Pointer to log class */ - void RegStdLog(StdLog *log); - - /** Log error to log class for print out / storage. */ - void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING); - - /** Add socket instance to socket map. Removal is always automatic. */ - void Add(Socket *); - - /** Get status of read/write/exception file descriptor set for a socket. */ - void Get(SOCKET s,bool& r,bool& w,bool& e); - - /** Set read/write/exception file descriptor sets (fd_set). */ - void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true); - - /** Wait for events, generate callbacks. */ - int Select(long sec,long usec); - - /** This method will not return until an event has been detected. */ - int Select(); - - /** Wait for events, generate callbacks. */ - int Select(struct timeval *tsel); - - /** Check that a socket really is handled by this socket handler. */ - bool Valid(Socket *); - - /** Return number of sockets handled by this handler. */ - size_t GetCount(); - - /** Override and return false to deny all incoming connections. - \param p ListenSocket class pointer (use GetPort to identify which one) */ - bool OkToAccept(Socket *p); - - /** Called by Socket when a socket changes state. */ - void AddList(SOCKET s,list_t which_one,bool add); - - // Connection pool -#ifdef ENABLE_POOL - /** Find available open connection (used by connection pool). */ - ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&); - /** Enable connection pool (by default disabled). */ - void EnablePool(bool x = true); - /** Check pool status. - \return true if connection pool is enabled */ - bool PoolEnabled(); -#endif // ENABLE_POOL - - // Socks4 -#ifdef ENABLE_SOCKS4 - /** Set socks4 server ip that all new tcp sockets should use. */ - void SetSocks4Host(ipaddr_t); - /** Set socks4 server hostname that all new tcp sockets should use. */ - void SetSocks4Host(const std::string& ); - /** Set socks4 server port number that all new tcp sockets should use. */ - void SetSocks4Port(port_t); - /** Set optional socks4 userid. */ - void SetSocks4Userid(const std::string& ); - /** If connection to socks4 server fails, immediately try direct connection to final host. */ - void SetSocks4TryDirect(bool x = true); - /** Get socks4 server ip. - \return socks4 server ip */ - ipaddr_t GetSocks4Host(); - /** Get socks4 port number. - \return socks4 port number */ - port_t GetSocks4Port(); - /** Get socks4 userid (optional). - \return socks4 userid */ - const std::string& GetSocks4Userid(); - /** Check status of socks4 try direct flag. - \return true if direct connection should be tried if connection to socks4 server fails */ - bool Socks4TryDirect(); -#endif // ENABLE_SOCKS4 - - // DNS resolve server -#ifdef ENABLE_RESOLVER - /** Enable asynchronous DNS. - \param port Listen port of asynchronous dns server */ - void EnableResolver(port_t port = 16667); - /** Check resolver status. - \return true if resolver is enabled */ - bool ResolverEnabled(); - /** Queue a dns request. - \param host Hostname to be resolved - \param port Port number will be echoed in Socket::OnResolved callback */ - int Resolve(Socket *,const std::string& host,port_t port); -#ifdef ENABLE_IPV6 - int Resolve6(Socket *,const std::string& host,port_t port); -#endif - /** Do a reverse dns lookup. */ - int Resolve(Socket *,ipaddr_t a); -#ifdef ENABLE_IPV6 - int Resolve(Socket *,in6_addr& a); -#endif - /** Get listen port of asynchronous dns server. */ - port_t GetResolverPort(); - /** Resolver thread ready for queries. */ - bool ResolverReady(); - /** Returns true if the socket is waiting for a resolve event. */ - bool Resolving(Socket *); -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_TRIGGERS - /** Fetch unique trigger id. */ - int TriggerID(Socket *src); - /** Subscribe socket to trigger id. */ - bool Subscribe(int id, Socket *dst); - /** Unsubscribe socket from trigger id. */ - bool Unsubscribe(int id, Socket *dst); - /** Execute OnTrigger for subscribed sockets. - \param id Trigger ID - \param data Data passed from source to destination - \param erase Empty trigger id source and destination maps if 'true', - Leave them in place if 'false' - if a trigger should be called many times */ - void Trigger(int id, Socket::TriggerData& data, bool erase = true); -#endif // ENABLE_TRIGGERS - -#ifdef ENABLE_DETACH - /** Indicates that the handler runs under SocketThread. */ - void SetSlave(bool x = true); - /** Indicates that the handler runs under SocketThread. */ - bool IsSlave(); -#endif - - /** Sanity check of those accursed lists. */ - void CheckSanity(); - -protected: - socket_m m_sockets; ///< Active sockets map - socket_m m_add; ///< Sockets to be added to sockets map - std::list m_delete; ///< Sockets to be deleted (failed when Add) - -protected: - StdLog *m_stdlog; ///< Registered log class, or NULL - Mutex& m_mutex; ///< Thread safety mutex - bool m_b_use_mutex; ///< Mutex correctly initialized - -private: - void CheckList(socket_v&,const std::string&); ///< Used by CheckSanity - /** Remove socket from socket map, used by Socket class. */ - void Remove(Socket *); - SOCKET m_maxsock; ///< Highest file descriptor + 1 in active sockets list - fd_set m_rfds; ///< file descriptor set monitored for read events - fd_set m_wfds; ///< file descriptor set monitored for write events - fd_set m_efds; ///< file descriptor set monitored for exceptions - int m_preverror; ///< debug select() error - int m_errcnt; ///< debug select() error - time_t m_tlast; ///< timeout control - - // state lists - socket_v m_fds; ///< Active file descriptor list - socket_v m_fds_erase; ///< File descriptors that are to be erased from m_sockets - socket_v m_fds_callonconnect; ///< checklist CallOnConnect -#ifdef ENABLE_DETACH - socket_v m_fds_detach; ///< checklist Detach -#endif - socket_v m_fds_timeout; ///< checklist timeout - socket_v m_fds_retry; ///< checklist retry client connect - socket_v m_fds_close; ///< checklist close and delete - -#ifdef ENABLE_SOCKS4 - ipaddr_t m_socks4_host; ///< Socks4 server host ip - port_t m_socks4_port; ///< Socks4 server port number - std::string m_socks4_userid; ///< Socks4 userid - bool m_bTryDirect; ///< Try direct connection if socks4 server fails -#endif -#ifdef ENABLE_RESOLVER - int m_resolv_id; ///< Resolver id counter - ResolvServer *m_resolver; ///< Resolver thread pointer - port_t m_resolver_port; ///< Resolver listen port - std::map m_resolve_q; ///< resolve queue -#endif -#ifdef ENABLE_POOL - bool m_b_enable_pool; ///< Connection pool enabled if true -#endif -#ifdef ENABLE_TRIGGERS - int m_next_trigger_id; ///< Unique trigger id counter - std::map m_trigger_src; ///< mapping trigger id to source socket - std::map > m_trigger_dst; ///< mapping trigger id to destination sockets -#endif -#ifdef ENABLE_DETACH - bool m_slave; ///< Indicates that this is a ISocketHandler run in SocketThread -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_SocketHandler_H - - diff --git a/dep/include/sockets/StdLog.h b/dep/include/sockets/StdLog.h deleted file mode 100644 index 3ff68d6e9ea..00000000000 --- a/dep/include/sockets/StdLog.h +++ /dev/null @@ -1,73 +0,0 @@ -/** \file StdLog.h - ** \date 2004-06-01 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_StdLog_H -#define _SOCKETS_StdLog_H - -#include "sockets-config.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** error level enum. */ -typedef enum -{ - LOG_LEVEL_WARNING = 0, - LOG_LEVEL_ERROR, - LOG_LEVEL_FATAL, - LOG_LEVEL_INFO -} loglevel_t; - -class ISocketHandler; -class Socket; - -/** \defgroup logging Log help classes */ -/** Log class interface. - \ingroup logging */ -class StdLog -{ -public: - virtual ~StdLog() {} - - virtual void error(ISocketHandler *,Socket *, - const std::string& user_text, - int err, - const std::string& sys_err, - loglevel_t = LOG_LEVEL_WARNING) = 0; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_StdLog_H - - diff --git a/dep/include/sockets/StdoutLog.h b/dep/include/sockets/StdoutLog.h deleted file mode 100644 index aeb25b3e6e6..00000000000 --- a/dep/include/sockets/StdoutLog.h +++ /dev/null @@ -1,55 +0,0 @@ -/** \file StdoutLog.h - ** \date 2004-06-01 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_StdoutLog_H -#define _SOCKETS_StdoutLog_H - -#include "sockets-config.h" -#include "StdLog.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** StdLog implementation, logs to stdout. - \ingroup logging */ -class StdoutLog : public StdLog -{ -public: - void error(ISocketHandler *,Socket *,const std::string& call,int err,const std::string& sys_err,loglevel_t); -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_StdoutLog_H - - diff --git a/dep/include/sockets/StreamSocket.h b/dep/include/sockets/StreamSocket.h deleted file mode 100644 index bcce10ffbc5..00000000000 --- a/dep/include/sockets/StreamSocket.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef _StreamSocket_H -#define _StreamSocket_H - -#include "Socket.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** SOCK_STREAM Socket base class. - \ingroup basic */ -class StreamSocket : public Socket -{ -public: - StreamSocket(ISocketHandler& ); - ~StreamSocket(); - - /** Socket should Check Connect on next write event from select(). */ - void SetConnecting(bool = true); - - /** Check connecting flag. - \return true if the socket is still trying to connect */ - bool Connecting(); - - /** Returns true when socket file descriptor is valid, - socket connection is established, and socket is not about to - be closed. */ - bool Ready(); - - /** Set timeout to use for connection attempt. - \param x Timeout in seconds */ - void SetConnectTimeout(int x); - - /** Return number of seconds to wait for a connection. - \return Connection timeout (seconds) */ - int GetConnectTimeout(); - - /** Set flush before close to make a tcp socket completely empty its - output buffer before closing the connection. */ - void SetFlushBeforeClose(bool = true); - - /** Check flush before status. - \return true if the socket should send all data before closing */ - bool GetFlushBeforeClose(); - - /** Define number of connection retries (tcp only). - n = 0 - no retry - n > 0 - number of retries - n = -1 - unlimited retries */ - void SetConnectionRetry(int n); - - /** Get number of maximum connection retries (tcp only). */ - int GetConnectionRetry(); - - /** Increase number of actual connection retries (tcp only). */ - void IncreaseConnectionRetries(); - - /** Get number of actual connection retries (tcp only). */ - int GetConnectionRetries(); - - /** Reset actual connection retries (tcp only). */ - void ResetConnectionRetries(); - - // LIST_CALLONCONNECT - - /** Instruct socket to call OnConnect callback next sockethandler cycle. */ - void SetCallOnConnect(bool x = true); - - /** Check call on connect flag. - \return true if OnConnect() should be called a.s.a.p */ - bool CallOnConnect(); - - // LIST_RETRY - - /** Set flag to initiate a connection attempt after a connection timeout. */ - void SetRetryClientConnect(bool x = true); - - /** Check if a connection attempt should be made. - \return true when another attempt should be made */ - bool RetryClientConnect(); - - /** Called after OnRead if socket is in line protocol mode. - \sa SetLineProtocol */ - /** Enable the OnLine callback. Do not create your own OnRead - * callback when using this. */ - virtual void SetLineProtocol(bool = true); - - /** Check line protocol mode. - \return true if socket is in line protocol mode */ - bool LineProtocol(); - - /** Set shutdown status. */ - void SetShutdown(int); - - /** Get shutdown status. */ - int GetShutdown(); - - /** Returns IPPROTO_TCP or IPPROTO_SCTP */ - virtual int Protocol() = 0; - -protected: - StreamSocket(const StreamSocket& ) {} // copy constructor - -private: - StreamSocket& operator=(const StreamSocket& ) { return *this; } // assignment operator - - bool m_bConnecting; ///< Flag indicating connection in progress - int m_connect_timeout; ///< Connection timeout (seconds) - bool m_flush_before_close; ///< Send all data before closing (default true) - int m_connection_retry; ///< Maximum connection retries (tcp) - int m_retries; ///< Actual number of connection retries (tcp) - bool m_call_on_connect; ///< OnConnect will be called next ISocketHandler cycle if true - bool m_b_retry_connect; ///< Try another connection attempt next ISocketHandler cycle - bool m_line_protocol; ///< Line protocol mode flag - int m_shutdown; ///< Shutdown status -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - -#endif // _StreamSocket_H - - diff --git a/dep/include/sockets/TcpSocket.h b/dep/include/sockets/TcpSocket.h deleted file mode 100644 index de1be8bd8b9..00000000000 --- a/dep/include/sockets/TcpSocket.h +++ /dev/null @@ -1,356 +0,0 @@ -/** \file TcpSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_TcpSocket_H -#define _SOCKETS_TcpSocket_H -#include "sockets-config.h" -#include "StreamSocket.h" -#ifdef HAVE_OPENSSL -#include -#include "SSLInitializer.h" -#endif - -#include - -#define TCP_BUFSIZE_READ 16400 -#define TCP_OUTPUT_CAPACITY 1024000 - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class SocketAddress; - -/** Socket implementation for TCP. - \ingroup basic */ -class TcpSocket : public StreamSocket -{ - /** \defgroup internal Internal utility */ -protected: - /** Buffer class containing one read/write circular buffer. - \ingroup internal */ - class CircularBuffer - { - public: - CircularBuffer(size_t size); - ~CircularBuffer(); - - /** append l bytes from p to buffer */ - bool Write(const char *p,size_t l); - /** copy l bytes from buffer to dest */ - bool Read(char *dest,size_t l); - /** copy l bytes from buffer to dest, dont touch buffer pointers */ - bool SoftRead(char *dest, size_t l); - /** skip l bytes from buffer */ - bool Remove(size_t l); - /** read l bytes from buffer, returns as string. */ - std::string ReadString(size_t l); - - /** total buffer length */ - size_t GetLength(); - /** pointer to circular buffer beginning */ - const char *GetStart(); - /** return number of bytes from circular buffer beginning to buffer physical end */ - size_t GetL(); - /** return free space in buffer, number of bytes until buffer overrun */ - size_t Space(); - - /** return total number of bytes written to this buffer, ever */ - unsigned long ByteCounter(bool clear = false); - - private: - CircularBuffer(const CircularBuffer& /*s*/) {} - CircularBuffer& operator=(const CircularBuffer& ) { return *this; } - char *buf; - size_t m_max; - size_t m_q; - size_t m_b; - size_t m_t; - unsigned long m_count; - }; - /** Output buffer struct. - \ingroup internal */ - struct OUTPUT { - OUTPUT() : _b(0), _t(0), _q(0) {} - OUTPUT(const char *buf, size_t len) : _b(0), _t(len), _q(len) { - memcpy(_buf, buf, len); - } - size_t Space() { - return TCP_OUTPUT_CAPACITY - _t; - } - void Add(const char *buf, size_t len) { - memcpy(_buf + _t, buf, len); - _t += len; - _q += len; - } - size_t Remove(size_t len) { - _b += len; - _q -= len; - return _q; - } - const char *Buf() { - return _buf + _b; - } - size_t Len() { - return _q; - } - size_t _b; - size_t _t; - size_t _q; - char _buf[TCP_OUTPUT_CAPACITY]; - }; - typedef std::list output_l; - -public: - /** Constructor with standard values on input/output buffers. */ - TcpSocket(ISocketHandler& ); - /** Constructor with custom values for i/o buffer. - \param h ISocketHandler reference - \param isize Input buffer size - \param osize Output buffer size */ - TcpSocket(ISocketHandler& h,size_t isize,size_t osize); - ~TcpSocket(); - - /** Open a connection to a remote server. - If you want your socket to connect to a server, - always call Open before Add'ing a socket to the sockethandler. - If not, the connection attempt will not be monitored by the - socket handler... - \param ip IP address - \param port Port number - \param skip_socks Do not use socks4 even if configured */ - bool Open(ipaddr_t ip,port_t port,bool skip_socks = false); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Open connection. - \param ip Ipv6 address - \param port Port number - \param skip_socks Do not use socks4 even if configured */ - bool Open(in6_addr ip,port_t port,bool skip_socks = false); -#endif -#endif - bool Open(SocketAddress&,bool skip_socks = false); - bool Open(SocketAddress&,SocketAddress& bind_address,bool skip_socks = false); - /** Open connection. - \param host Hostname - \param port Port number */ - bool Open(const std::string &host,port_t port); - - /** Connect timeout callback. */ - void OnConnectTimeout(); -#ifdef _WIN32 - /** Connection failed reported as exception on win32 */ - void OnException(); -#endif - - /** Close file descriptor - internal use only. - \sa SetCloseAndDelete */ - int Close(); - - /** Send a string. - \param s String to send - \param f Dummy flags -- not used */ - void Send(const std::string &s,int f = 0); - /** Send string using printf formatting. */ - void Sendf(const char *format, ...); - /** Send buffer of bytes. - \param buf Buffer pointer - \param len Length of data - \param f Dummy flags -- not used */ - void SendBuf(const char *buf,size_t len,int f = 0); - /** This callback is executed after a successful read from the socket. - \param buf Pointer to the data - \param len Length of the data */ - virtual void OnRawData(const char *buf,size_t len); - - /** Called when output buffer has been sent. - Note: Will only be called IF the output buffer has been used. - Send's that was successful without needing the output buffer - will not generate a call to this method. */ - virtual void OnWriteComplete(); - /** Number of bytes in input buffer. */ - size_t GetInputLength(); - /** Number of bytes in output buffer. */ - size_t GetOutputLength(); - - /** Callback fires when a socket in line protocol has read one full line. - \param line Line read */ - void OnLine(const std::string& line); - /** Get counter of number of bytes received. */ - uint64_t GetBytesReceived(bool clear = false); - /** Get counter of number of bytes sent. */ - uint64_t GetBytesSent(bool clear = false); - - /** Socks4 specific callback. */ - void OnSocks4Connect(); - /** Socks4 specific callback. */ - void OnSocks4ConnectFailed(); - /** Socks4 specific callback. - \return 'need_more' */ - bool OnSocks4Read(); - -#ifdef ENABLE_RESOLVER - /** Callback executed when resolver thread has finished a resolve request. */ - void OnResolved(int id,ipaddr_t a,port_t port); -#ifdef ENABLE_IPV6 - void OnResolved(int id,in6_addr& a,port_t port); -#endif -#endif -#ifdef HAVE_OPENSSL - /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */ - void OnSSLConnect(); - /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */ - void OnSSLAccept(); - /** This method must be implemented to initialize - the ssl context for an outgoing connection. */ - virtual void InitSSLClient(); - /** This method must be implemented to initialize - the ssl context for an incoming connection. */ - virtual void InitSSLServer(); -#endif - -#ifdef ENABLE_RECONNECT - /** Flag that says a broken connection will try to reconnect. */ - void SetReconnect(bool = true); - /** Check reconnect on lost connection flag status. */ - bool Reconnect(); - /** Flag to determine if a reconnect is in progress. */ - void SetIsReconnect(bool x = true); - /** Socket is reconnecting. */ - bool IsReconnect(); -#endif - - void DisableInputBuffer(bool = true); - - void OnOptions(int,int,int,SOCKET); - - void SetLineProtocol(bool = true); - - // TCP options - bool SetTcpNodelay(bool = true); - - virtual int Protocol(); - - /** Trigger limit for callback OnTransferLimit. */ - void SetTransferLimit(size_t sz); - /** This callback fires when the output buffer drops below the value - set by SetTransferLimit. Default: 0 (disabled). */ - virtual void OnTransferLimit(); - -protected: - TcpSocket(const TcpSocket& ); - void OnRead(); - void OnRead( char *buf, size_t n ); - void OnWrite(); -#ifdef HAVE_OPENSSL - /** SSL; Initialize ssl context for a client socket. - \param meth_in SSL method */ - void InitializeContext(const std::string& context, SSL_METHOD *meth_in = NULL); - /** SSL; Initialize ssl context for a server socket. - \param keyfile Combined private key/certificate file - \param password Password for private key - \param meth_in SSL method */ - void InitializeContext(const std::string& context, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL); - /** SSL; Initialize ssl context for a server socket. - \param certfile Separate certificate file - \param keyfile Combined private key/certificate file - \param password Password for private key - \param meth_in SSL method */ - void InitializeContext(const std::string& context, const std::string& certfile, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL); - /** SSL; Password callback method. */ -static int SSL_password_cb(char *buf,int num,int rwflag,void *userdata); - /** SSL; Get pointer to ssl context structure. */ - virtual SSL_CTX *GetSslContext(); - /** SSL; Get pointer to ssl structure. */ - virtual SSL *GetSsl(); - /** ssl; still negotiating connection. */ - bool SSLNegotiate(); - /** SSL; Get ssl password. */ - const std::string& GetPassword(); -#endif - - CircularBuffer ibuf; ///< Circular input buffer - -private: - TcpSocket& operator=(const TcpSocket& ) { return *this; } - - /** the actual send() */ - int TryWrite(const char *buf, size_t len); - /** add data to output buffer top */ - void Buffer(const char *buf, size_t len); - - // - bool m_b_input_buffer_disabled; - uint64_t m_bytes_sent; - uint64_t m_bytes_received; - bool m_skip_c; ///< Skip second char of CRLF or LFCR sequence in OnRead - char m_c; ///< First char in CRLF or LFCR sequence - std::string m_line; ///< Current line in line protocol mode -#ifdef SOCKETS_DYNAMIC_TEMP - char *m_buf; ///< temporary read buffer -#endif - output_l m_obuf; ///< output buffer - OUTPUT *m_obuf_top; ///< output buffer on top - size_t m_transfer_limit; - size_t m_output_length; - -#ifdef HAVE_OPENSSL -static SSLInitializer m_ssl_init; - SSL_CTX *m_ssl_ctx; ///< ssl context - SSL *m_ssl; ///< ssl 'socket' - BIO *m_sbio; ///< ssl bio - std::string m_password; ///< ssl password -#endif - -#ifdef ENABLE_SOCKS4 - int m_socks4_state; ///< socks4 support - char m_socks4_vn; ///< socks4 support, temporary variable - char m_socks4_cd; ///< socks4 support, temporary variable - unsigned short m_socks4_dstport; ///< socks4 support - unsigned long m_socks4_dstip; ///< socks4 support -#endif - -#ifdef ENABLE_RESOLVER - int m_resolver_id; ///< Resolver id (if any) for current Open call -#endif - -#ifdef ENABLE_RECONNECT - bool m_b_reconnect; ///< Reconnect on lost connection flag - bool m_b_is_reconnect; ///< Trying to reconnect -#endif - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_TcpSocket_H - - diff --git a/dep/include/sockets/Thread.h b/dep/include/sockets/Thread.h deleted file mode 100644 index efb766e9ee6..00000000000 --- a/dep/include/sockets/Thread.h +++ /dev/null @@ -1,100 +0,0 @@ -/** \file Thread.h - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Thread_H -#define _SOCKETS_Thread_H - -#include "sockets-config.h" -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#ifdef _WIN32 -// to be -//typedef DWORD threadfunc_t; -//typedef LPVOID threadparam_t; -//#define STDPREFIX WINAPI -typedef unsigned threadfunc_t; -typedef void * threadparam_t; -#define STDPREFIX __stdcall -#else -#include - -typedef void * threadfunc_t; -typedef void * threadparam_t; -#define STDPREFIX -#endif - -/** \defgroup threading Threading */ -/** Thread base class. -The Thread class is used by the resolver (ResolvServer) and running a detached socket (SocketThread). -When you know some processing will take a long time and will freeze up a socket, there is always the -possibility to call Detach() on that socket before starting the processing. -When the OnDetached() callback is later called the processing can continue, now in its own thread. - \ingroup threading */ -class Thread -{ -public: - Thread(bool release = true); - virtual ~Thread(); - - static threadfunc_t STDPREFIX StartThread(threadparam_t); - - virtual void Run() = 0; - - bool IsRunning(); - void SetRunning(bool x); - bool IsReleased(); - void SetRelease(bool x); - bool DeleteOnExit(); - void SetDeleteOnExit(bool x = true); - bool IsDestructor(); - -private: - Thread(const Thread& ) {} - Thread& operator=(const Thread& ) { return *this; } -#ifdef _WIN32 - HANDLE m_thread; - unsigned m_dwThreadId; -#else - pthread_t m_thread; -#endif - bool m_running; - bool m_release; - bool m_b_delete_on_exit; - bool m_b_destructor; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Thread_H - - diff --git a/dep/include/sockets/UdpSocket.h b/dep/include/sockets/UdpSocket.h deleted file mode 100644 index 3b06c6955bd..00000000000 --- a/dep/include/sockets/UdpSocket.h +++ /dev/null @@ -1,215 +0,0 @@ -/** \file UdpSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_UdpSocket_H -#define _SOCKETS_UdpSocket_H - -#include "sockets-config.h" -#include "Socket.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Socket implementation for UDP. - \ingroup basic */ -class UdpSocket : public Socket -{ -public: - /** Constructor. - \param h ISocketHandler reference - \param ibufsz Maximum size of receive message (extra bytes will be truncated) - \param ipv6 'true' if this is an ipv6 socket */ - UdpSocket(ISocketHandler& h,int ibufsz = 16384,bool ipv6 = false, int retries = 0); - ~UdpSocket(); - - /** Called when incoming data has been received. - \param buf Pointer to data - \param len Length of data - \param sa Pointer to sockaddr struct of sender - \param sa_len Length of sockaddr struct */ - virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len); - - /** Called when incoming data has been received and read timestamp is enabled. - \param buf Pointer to data - \param len Length of data - \param sa Pointer to sockaddr struct of sender - \param sa_len Length of sockaddr struct - \param ts Timestamp from message */ - virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len,struct timeval *ts); - - /** To receive incoming data, call Bind to setup an incoming port. - \param port Incoming port number - \param range Port range to try if ports already in use - \return 0 if bind succeeded */ - int Bind(port_t& port,int range = 1); - /** To receive data on a specific interface:port, use this. - \param intf Interface ip/hostname - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(const std::string& intf,port_t& port,int range = 1); - /** To receive data on a specific interface:port, use this. - \param a Ip address - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(ipaddr_t a,port_t& port,int range = 1); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** To receive data on a specific interface:port, use this. - \param a Ipv6 address - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(in6_addr a,port_t& port,int range = 1); -#endif -#endif - /** To receive data on a specific interface:port, use this. - \param ad Socket address - \param range Port range - \return 0 if bind succeeded */ - int Bind(SocketAddress& ad,int range = 1); - - /** Define remote host. - \param l Address of remote host - \param port Port of remote host - \return true if successful */ - bool Open(ipaddr_t l,port_t port); - /** Define remote host. - \param host Hostname - \param port Port number - \return true if successful */ - bool Open(const std::string& host,port_t port); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Define remote host. - \param a Address of remote host, ipv6 - \param port Port of remote host - \return true if successful */ - bool Open(struct in6_addr& a,port_t port); -#endif -#endif - /** Define remote host. - \param ad Socket address - \return true if successful */ - bool Open(SocketAddress& ad); - - /** Send to specified host */ - void SendToBuf(const std::string& ,port_t,const char *data,int len,int flags = 0); - /** Send to specified address */ - void SendToBuf(ipaddr_t,port_t,const char *data,int len,int flags = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Send to specified ipv6 address */ - void SendToBuf(in6_addr,port_t,const char *data,int len,int flags = 0); -#endif -#endif - /** Send to specified socket address */ - void SendToBuf(SocketAddress& ad,const char *data,int len,int flags = 0); - - /** Send string to specified host */ - void SendTo(const std::string&,port_t,const std::string&,int flags = 0); - /** Send string to specified address */ - void SendTo(ipaddr_t,port_t,const std::string&,int flags = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Send string to specified ipv6 address */ - void SendTo(in6_addr,port_t,const std::string&,int flags = 0); -#endif -#endif - /** Send string to specified socket address */ - void SendTo(SocketAddress& ad,const std::string&,int flags = 0); - - /** Send to connected address */ - void SendBuf(const char *data,size_t,int flags = 0); - /** Send string to connected address. */ - void Send(const std::string& ,int flags = 0); - - /** Set broadcast */ - void SetBroadcast(bool b = true); - /** Check broadcast flag. - \return true broadcast is enabled. */ - bool IsBroadcast(); - - /** multicast */ - void SetMulticastTTL(int ttl = 1); - int GetMulticastTTL(); - void SetMulticastLoop(bool = true); - bool IsMulticastLoop(); - void AddMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0); - void DropMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** multicast, ipv6 only */ - void SetMulticastHops(int = -1); - /** multicast, ipv6 only */ - int GetMulticastHops(); -#endif -#endif - /** Returns true if Bind succeeded. */ - bool IsBound(); - /** Return Bind port number */ - port_t GetPort(); - - void OnOptions(int,int,int,SOCKET) {} - - int GetLastSizeWritten(); - - /** Also read timestamp information from incoming message */ - void SetTimestamp(bool = true); - -protected: - UdpSocket(const UdpSocket& s) : Socket(s) {} - void OnRead(); -#if defined(LINUX) || defined(MACOSX) - /** This method emulates socket recvfrom, but uses messages so we can get the timestamp */ - int ReadTS(char *ioBuf, int inBufSize, struct sockaddr *from, socklen_t fromlen, struct timeval *ts); -#endif - -private: - UdpSocket& operator=(const UdpSocket& ) { return *this; } - /** create before using sendto methods */ - void CreateConnection(); - char *m_ibuf; ///< Input buffer - int m_ibufsz; ///< Size of input buffer - bool m_bind_ok; ///< Bind completed successfully - port_t m_port; ///< Bind port number - int m_last_size_written; - int m_retries; - bool m_b_read_ts; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_UdpSocket_H - - diff --git a/dep/include/sockets/Utility.h b/dep/include/sockets/Utility.h deleted file mode 100644 index 724a94e4b32..00000000000 --- a/dep/include/sockets/Utility.h +++ /dev/null @@ -1,186 +0,0 @@ -/** \file Utility.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Utility_H -#define _SOCKETS_Utility_H - -#include "sockets-config.h" -#include -#include -#include -#include "socket_include.h" -#include -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#define TWIST_LEN 624 - -class SocketAddress; - -/** Conversion utilities. - \ingroup util */ -class Utility -{ - /** - The Mersenne Twister - http://www.math.keio.ac.jp/~matumoto/emt.html - */ - class Rng { - public: - Rng(unsigned long seed); - - unsigned long Get(); - - private: - int m_value; - unsigned long m_tmp[TWIST_LEN]; - }; - class ncmap_compare { - public: - bool operator()(const std::string& x, const std::string& y) const { - return strcasecmp(x.c_str(), y.c_str()) < 0; - } - }; -public: - template class ncmap : public std::map { - public: - ncmap() {} - }; -public: - static std::string base64(const std::string& str_in); - static std::string base64d(const std::string& str_in); - static std::string l2string(long l); - static std::string bigint2string(uint64_t l); - static uint64_t atoi64(const std::string& str); - static unsigned int hex2unsigned(const std::string& str); - static std::string rfc1738_encode(const std::string& src); - static std::string rfc1738_decode(const std::string& src); - - /** Checks whether a string is a valid ipv4/ipv6 ip number. */ - static bool isipv4(const std::string&); - /** Checks whether a string is a valid ipv4/ipv6 ip number. */ - static bool isipv6(const std::string&); - - /** Hostname to ip resolution ipv4, not asynchronous. */ - static bool u2ip(const std::string&, ipaddr_t&); - static bool u2ip(const std::string&, struct sockaddr_in& sa, int ai_flags = 0); - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Hostname to ip resolution ipv6, not asynchronous. */ - static bool u2ip(const std::string&, struct in6_addr&); - static bool u2ip(const std::string&, struct sockaddr_in6& sa, int ai_flags = 0); -#endif -#endif - - /** Reverse lookup of address to hostname */ - static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string&, int flags = 0); - static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, std::string& service, int flags = 0); - - static bool u2service(const std::string& name, int& service, int ai_flags = 0); - - /** Convert binary ip address to string: ipv4. */ - static void l2ip(const ipaddr_t,std::string& ); - static void l2ip(const in_addr&,std::string& ); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Convert binary ip address to string: ipv6. */ - static void l2ip(const struct in6_addr&,std::string& ,bool mixed = false); - - /** ipv6 address compare. */ - static int in6_addr_compare(in6_addr,in6_addr); -#endif -#endif - /** ResolveLocal (hostname) - call once before calling any GetLocal method. */ - static void ResolveLocal(); - /** Returns local hostname, ResolveLocal must be called once before using. - \sa ResolveLocal */ - static const std::string& GetLocalHostname(); - /** Returns local ip, ResolveLocal must be called once before using. - \sa ResolveLocal */ - static ipaddr_t GetLocalIP(); - /** Returns local ip number as string. - \sa ResolveLocal */ - static const std::string& GetLocalAddress(); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Returns local ipv6 ip. - \sa ResolveLocal */ - static const struct in6_addr& GetLocalIP6(); - /** Returns local ipv6 address. - \sa ResolveLocal */ - static const std::string& GetLocalAddress6(); -#endif -#endif - /** Set environment variable. - \param var Name of variable to set - \param value Value */ - static void SetEnv(const std::string& var,const std::string& value); - /** Convert sockaddr struct to human readable string. - \param sa Ptr to sockaddr struct */ - static std::string Sa2String(struct sockaddr *sa); - - /** Get current time in sec/microseconds. */ - static void GetTime(struct timeval *); - - static std::auto_ptr CreateAddress(struct sockaddr *,socklen_t); - - static unsigned long ThreadID(); - - static std::string ToLower(const std::string& str); - static std::string ToUpper(const std::string& str); - - static std::string ToString(double d); - - /** Returns a random 32-bit integer */ - static unsigned long Rnd(); - -private: - static std::string m_host; ///< local hostname - static ipaddr_t m_ip; ///< local ip address - static std::string m_addr; ///< local ip address in string format -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - static struct in6_addr m_local_ip6; ///< local ipv6 address -#endif - static std::string m_local_addr6; ///< local ipv6 address in string format -#endif - static bool m_local_resolved; ///< ResolveLocal has been called if true -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Utility_H - - diff --git a/dep/include/sockets/socket_include.h b/dep/include/sockets/socket_include.h deleted file mode 100644 index 89855a54108..00000000000 --- a/dep/include/sockets/socket_include.h +++ /dev/null @@ -1,290 +0,0 @@ -/** \file socket_include.h - ** \date 2005-04-12 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_socket_include_H -#define _SOCKETS_socket_include_H -#include "sockets-config.h" - -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -// common defines affecting library and applications using library - -/* Define SOCKETS_DYNAMIC_TEMP to use dynamically allocated buffers - in read operations - helps on ECOS */ -#define SOCKETS_DYNAMIC_TEMP - -// platform specific stuff -#if (defined(__unix__) || defined(unix)) && !defined(USG) -#include -#endif -#include - -// int64 -#ifdef _WIN32 -typedef unsigned __int64 uint64_t; -#else -#include -#ifdef SOLARIS -# include -#else -# include -#endif -#endif - -#ifndef _WIN32 -// ---------------------------------------- -// common unix includes / defines -#include -#include -#include -#include -#include -#include -//#include - -// all typedefs in this file will be declared outside the sockets namespace, -// because some os's will already have one or more of the type defined. -typedef int SOCKET; -#define Errno errno -#define StrError strerror - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// WIN32 adapt -#define closesocket close -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 - -#ifndef INADDR_NONE -#define INADDR_NONE ((unsigned long) -1) -#endif // INADDR_NONE - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // !_WIN32 - -// ---------------------------------------- -// Generic -#ifndef SOL_IP -#define SOL_IP IPPROTO_IP -#endif - -// ---------------------------------------- -// OS specific adaptions - -#ifdef SOLARIS -// ---------------------------------------- -// Solaris -typedef unsigned short port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#define s6_addr16 _S6_un._S6_u8 -#define MSG_NOSIGNAL 0 - -#elif defined __FreeBSD__ -// ---------------------------------------- -// FreeBSD -# if __FreeBSD_version >= 400014 -# define s6_addr16 __u6_addr.__u6_addr16 -# if !defined(MSG_NOSIGNAL) -# define MSG_NOSIGNAL 0 -# endif -# include -typedef in_addr_t ipaddr_t; -typedef in_port_t port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP -# else -# error FreeBSD versions prior to 400014 does not support ipv6 -# endif - -#elif defined (__NetBSD__) || defined (__OpenBSD__) -# if !defined(MSG_NOSIGNAL) -# define MSG_NOSIGNAL 0 -# endif -# include -typedef in_addr_t ipaddr_t; -typedef in_port_t port_t; -#elif defined MACOSX -// ---------------------------------------- -// Mac OS X -#include -#ifdef __DARWIN_UNIX03 -typedef unsigned short port_t; -#else -#include -#endif // __DARWIN_UNIX03 -typedef unsigned long ipaddr_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#define s6_addr16 __u6_addr.__u6_addr16 -#define MSG_NOSIGNAL 0 // oops - thanks Derek -#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP - -#elif defined _WIN32 -// ---------------------------------------- -// Win32 -#ifdef _MSC_VER -#pragma comment(lib, "wsock32.lib") -#endif -#define strcasecmp _stricmp - -typedef unsigned long ipaddr_t; -typedef unsigned short port_t; -typedef int socklen_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -// 1.8.6: define FD_SETSIZE to something bigger than 64 if there are a lot of -// simultaneous connections (must be done before including winsock.h) -#define FD_SETSIZE 1024 - -// windows 2000 with ipv6 preview installed: -// http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp -// see the FAQ on how to install -#define WIN32_LEAN_AND_MEAN -#include -#include -#if _MSC_VER < 1200 -#ifndef __CYGWIN__ -#ifdef ENABLE_IPV6 -#include // For IPv6 Tech Preview. -#endif -#endif -#endif // _MSC_VER < 1200 - -#define MSG_NOSIGNAL 0 -//#define SHUT_RDWR 2 -#define SHUT_WR 1 - -#define Errno WSAGetLastError() -const char *StrError(int x); - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// class WSAInitializer is a part of the Socket class (on win32) -// as a static instance - so whenever an application uses a Socket, -// winsock is initialized -class WSAInitializer // Winsock Initializer -{ -public: - WSAInitializer() { - if (WSAStartup(0x101,&m_wsadata)) - { - exit(-1); - } - } - ~WSAInitializer() { - WSACleanup(); - } -private: - WSADATA m_wsadata; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#else -// ---------------------------------------- -// LINUX -typedef unsigned long ipaddr_t; -typedef unsigned short port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - /** List type containing file descriptors. */ - typedef std::list socket_v; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -// getaddrinfo / getnameinfo replacements -#ifdef NO_GETADDRINFO -#ifndef AI_NUMERICHOST -#define AI_NUMERICHOST 1 -#endif -#ifndef NI_NUMERICHOST -#define NI_NUMERICHOST 1 -#endif -#endif - -#endif // _SOCKETS_socket_include_H - - diff --git a/dep/include/sockets/sockets-config.h b/dep/include/sockets/sockets-config.h deleted file mode 100644 index 1c8dc439092..00000000000 --- a/dep/include/sockets/sockets-config.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - ** \file sockets-config.h - ** \date 2007-04-14 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_CONFIG_H -#define _SOCKETS_CONFIG_H - -#ifndef _RUN_DP -/* First undefine symbols if already defined. */ -#undef HAVE_OPENSSL -#undef ENABLE_IPV6 -#undef USE_SCTP -#undef NO_GETADDRINFO -#undef ENABLE_POOL -#undef ENABLE_SOCKS4 -#undef ENABLE_RESOLVER -#undef ENABLE_RECONNECT -#undef ENABLE_DETACH -#undef ENABLE_TRIGGERS -#undef ENABLE_EXCEPTIONS -#endif // _RUN_DP - -// define MACOSX for internal socket library checks -#if defined(__APPLE__) && defined(__MACH__) && !defined(MACOSX) -#define MACOSX -#endif - -/* OpenSSL support. */ -//#define HAVE_OPENSSL - -/* Ipv6 support. */ -//#define ENABLE_IPV6 - -/* SCTP support. */ -//#define USE_SCTP - -/* Define NO_GETADDRINFO if your operating system does not support - the "getaddrinfo" and "getnameinfo" function calls. */ -#define NO_GETADDRINFO - -/* Connection pool support. */ -#define ENABLE_POOL - -/* Socks4 client support. */ -//#define ENABLE_SOCKS4 - -/* Asynchronous resolver. */ -#define ENABLE_RESOLVER - -/* Enable TCP reconnect on lost connection. - Socket::OnReconnect - Socket::OnDisconnect -*/ -#define ENABLE_RECONNECT - -/* Enable socket thread detach functionality. */ -#define ENABLE_DETACH - -/* Enable socket to socket triggers. Not yet in use. */ -//#define ENABLE_TRIGGERS - -/* Enabled exceptions. */ -//#define ENABLE_EXCEPTIONS - -/* Resolver uses the detach function so either enable both or disable both. */ -#ifndef ENABLE_DETACH -#undef ENABLE_RESOLVER -#endif - -#endif // _SOCKETS_CONFIG_H - - diff --git a/dep/include/utf8cpp/doc/ReleaseNotes b/dep/include/utf8cpp/doc/ReleaseNotes deleted file mode 100644 index 8541c7a6031..00000000000 --- a/dep/include/utf8cpp/doc/ReleaseNotes +++ /dev/null @@ -1,9 +0,0 @@ -utf8 cpp library -Release 2.1 - -This is a minor feature release - added the function peek_next. - -Changes from version 2.o -- Implemented feature request [ 1770746 ] "Provide a const version of next() (some sort of a peek() ) - -Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes diff --git a/dep/include/utf8cpp/doc/utf8cpp.html b/dep/include/utf8cpp/doc/utf8cpp.html deleted file mode 100644 index 4ad7e1002a9..00000000000 --- a/dep/include/utf8cpp/doc/utf8cpp.html +++ /dev/null @@ -1,1574 +0,0 @@ - - - - - - - - - UTF8-CPP: UTF-8 with C++ in a Portable Way - - - - -

- UTF8-CPP: UTF-8 with C++ in a Portable Way -

-

- The Sourceforge project page -

- -

- Introduction -

-

- Many C++ developers miss an easy and portable way of handling Unicode encoded - strings. C++ Standard is currently Unicode agnostic, and while some work is being - done to introduce Unicode to the next incarnation called C++0x, for the moment - nothing of the sort is available. In the meantime, developers use 3rd party - libraries like ICU, OS specific capabilities, or simply roll out their own - solutions. -

-

- In order to easily handle UTF-8 encoded Unicode strings, I have come up with a small - generic library. For anybody used to work with STL algorithms and iterators, it should be - easy and natural to use. The code is freely available for any purpose - check out - the license at the beginning of the utf8.h file. If you run into - bugs or performance issues, please let me know and I'll do my best to address them. -

-

- The purpose of this article is not to offer an introduction to Unicode in general, - and UTF-8 in particular. If you are not familiar with Unicode, be sure to check out - Unicode Home Page or some other source of - information for Unicode. Also, it is not my aim to advocate the use of UTF-8 - encoded strings in C++ programs; if you want to handle UTF-8 encoded strings from - C++, I am sure you have good reasons for it. -

-

- Examples of use -

-

- To illustrate the use of this utf8 library, we shall open a file containing UTF-8 - encoded text, check whether it starts with a byte order mark, read each line into a - std::string, check it for validity, convert the text to UTF-16, and - back to UTF-8: -

-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-#include "utf8.h"
-using namespace std;
-int main()
-{
-    if (argc != 2) {
-        cout << "\nUsage: docsample filename\n";
-        return 0;
-    }
-    const char* test_file_path = argv[1];
-    // Open the test file (must be UTF-8 encoded)
-    ifstream fs8(test_file_path);
-    if (!fs8.is_open()) {
-    cout << "Could not open " << test_file_path << endl;
-    return 0;
-    }
-    // Read the first line of the file
-    unsigned line_count = 1;
-    string line;
-    if (!getline(fs8, line)) 
-        return 0;
-    // Look for utf-8 byte-order mark at the beginning
-    if (line.size() > 2) {
-        if (utf8::is_bom(line.c_str()))
-            cout << "There is a byte order mark at the beginning of the file\n";
-    }
-    // Play with all the lines in the file
-    do {
-       // check for invalid utf-8 (for a simple yes/no check, there is also utf8::is_valid function)
-        string::iterator end_it = utf8::find_invalid(line.begin(), line.end());
-        if (end_it != line.end()) {
-            cout << "Invalid UTF-8 encoding detected at line " << line_count << "\n";
-            cout << "This part is fine: " << string(line.begin(), end_it) << "\n";
-        }
-        // Get the line length (at least for the valid part)
-        int length = utf8::distance(line.begin(), end_it);
-        cout << "Length of line " << line_count << " is " << length <<  "\n";
-        // Convert it to utf-16
-        vector<unsigned short> utf16line;
-        utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-        // And back to utf-8
-        string utf8line; 
-        utf8::utf16to8(utf16line.begin(), utf16line.end(), back_inserter(utf8line));
-        // Confirm that the conversion went OK:
-        if (utf8line != string(line.begin(), end_it))
-            cout << "Error in UTF-16 conversion at line: " << line_count << "\n";        
-        getline(fs8, line);
-        line_count++;
-    } while (!fs8.eof());
-    return 0;
-}
-
-

- In the previous code sample, we have seen the use of the following functions from - utf8 namespace: first we used is_bom function to detect - UTF-8 byte order mark at the beginning of the file; then for each line we performed - a detection of invalid UTF-8 sequences with find_invalid; the number - of characters (more precisely - the number of Unicode code points) in each line was - determined with a use of utf8::distance; finally, we have converted - each line to UTF-16 encoding with utf8to16 and back to UTF-8 with - utf16to8. -

-

- Reference -

-

- Functions From utf8 Namespace -

-

- utf8::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- Note that append does not allocate any memory - it is the burden of - the caller to make sure there is enough memory allocated for the operation. To make - things more interesting, append can add anywhere between 1 and 4 - octets to the sequence. In practice, you would most often want to use - std::back_inserter to ensure that the necessary memory is allocated. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point and moves the iterator to the next position. -

-
-template <typename octet_iterator> 
-uint32_t next(octet_iterator& it, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This function is typically used to iterate through a UTF-8 encoded string. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point for the following sequence without changing the value of the iterator. -

-
-template <typename octet_iterator> 
-uint32_t peek_next(octet_iterator it, octet_iterator end);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = peek_next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t prior(octet_iterator& it, octet_iterator start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- start: an iterator to the beginning of the sequence where the search - for the beginning of a code point is performed. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = prior (w, twochars);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This function has two purposes: one is two iterate backwards through a UTF-8 - encoded string. Note that it is usually a better idea to iterate forward instead, - since utf8::next is faster. The second purpose is to find a beginning - of a UTF-8 sequence if we have a random position within a string. -

-

- it will typically point to the beginning of - a code point, and start will point to the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown. -

-

- utf8::previous -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t previous(octet_iterator& it, octet_iterator pass_start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- pass_start: an iterator to the point in the sequence where the search - for the beginning of a code point is aborted if no result was reached. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = previous (w, twochars - 1);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- utf8::previous is deprecated, and utf8::prior should - be used instead, although the existing code can continue using this function. - The problem is the parameter pass_start that points to the position - just before the beginning of the sequence. Standard containers don't have the - concept of "pass start" and the function can not be used with their iterators. -

-

- it will typically point to the beginning of - a code point, and pass_start will point to the octet just before the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown -

-

- utf8::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type> 
-void advance (octet_iterator& it, distance_type n, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars;
-advance (w, 2, twochars + 6);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator> 
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-   
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This function is used to find the length (in code points) of a UTF-8 encoded - string. The reason it is called distance, rather than, say, - length is mainly because developers are used that length is an - O(1) function. Computing the length of an UTF-8 string is a linear operation, and - it looked better to model it after std::distance algorithm. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If last does not point to the past-of-end of a UTF-8 seqence, - a utf8::not_enough_room exception is thrown. -

-

- utf8::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- In case of invalid UTF-16 sequence, a utf8::invalid_utf16 exception is - thrown. -

-

- utf8::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- In case of invalid UTF-32 string, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::find_invalid -

-

- Available in version 1.0 and later. -

-

- Detects an invalid sequence within a UTF-8 string. -

-
-template <typename octet_iterator> 
-octet_iterator find_invalid(octet_iterator start, octet_iterator end);
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: an iterator pointing to the first - invalid octet in the UTF-8 string. In case none were found, equals - end. -

-

- Example of use: -

-
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-char* invalid = find_invalid(utf_invalid, utf_invalid + 6);
-assert (invalid == utf_invalid + 5);
-
-

- This function is typically used to make sure a UTF-8 string is valid before - processing it with other functions. It is especially important to call it if before - doing any of the unchecked operations on it. -

-

- utf8::is_valid -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of octets is a valid UTF-8 string. -

-
-template <typename octet_iterator> 
-bool is_valid(octet_iterator start, octet_iterator end);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: true if the sequence - is a valid UTF-8 string; false if not. -

- Example of use: -
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid, utf_invalid + 6);
-assert (bvalid == false);
-
-

- is_valid is a shorthand for find_invalid(start, end) == - end;. You may want to use it to make sure that a byte seqence is a valid - UTF-8 string without the need to know where it fails if it is not valid. -

-

- utf8::replace_invalid -

-

- Available in version 2.0 and later. -

-

- Replaces all invalid UTF-8 sequences within a string with a replacement marker. -

-
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement);
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - look for invalid UTF-8 sequences.
- end: an iterator pointing to pass-the-end of the UTF-8 string to look - for invalid UTF-8 sequences.
- out: An output iterator to the range where the result of replacement - is stored.
- replacement: A Unicode code point for the replacement marker. The - version without this parameter assumes the value 0xfffd
- Return value: An iterator pointing to the place - after the UTF-8 string with replaced invalid sequences. -

-

- Example of use: -

-
-char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-vector<char> replace_invalid_result;
-replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), back_inserter(replace_invalid_result), '?');
-bvalid = is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
-assert (bvalid);
-char* fixed_invalid_sequence = "a????z";
-assert (std::equal(replace_invalid_result.begin(), replace_invalid_result.end(), fixed_invalid_sequence));
-
-

- replace_invalid does not perform in-place replacement of invalid - sequences. Rather, it produces a copy of the original string with the invalid - sequences replaced with a replacement marker. Therefore, out must not - be in the [start, end] range. -

-

- If end does not point to the past-of-end of a UTF-8 sequence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::is_bom -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of three octets is a UTF-8 byte order mark (BOM) -

-
-template <typename octet_iterator> 
-bool is_bom (octet_iterator it);
-
-

- it: beginning of the 3-octet sequence to check
- Return value: true if the sequence - is UTF-8 byte order mark; false if not. -

-

- Example of use: -

-
-unsigned char byte_order_mark[] = {0xef, 0xbb, 0xbf};
-bool bbom = is_bom(byte_order_mark);
-assert (bbom == true);
-
-

- The typical use of this function is to check the first three bytes of a file. If - they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 - encoded text. -

-

- Types From utf8 Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it, - const octet_iterator& range_start, - const octet_iterator& range_end);
a constructor - that initializes the underlying octet_iterator with octet_it - and sets the range in which the iterator is considered valid. -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::iterator<char*> it(threechars, threechars, threechars + 9);
-utf8::iterator<char*> it2 = it;
-assert (it2 == it);
-assert (*it == 0x10346);
-assert (*(++it) == 0x65e5);
-assert ((*it++) == 0x65e5);
-assert (*it == 0x0448);
-assert (it != it2);
-utf8::iterator<char*> endit (threechars + 9, threechars, threechars + 9);  
-assert (++it == endit);
-assert (*(--it) == 0x0448);
-assert ((*it--) == 0x0448);
-assert (*it == 0x65e5);
-assert (--it == utf8::iterator<char*>(threechars, threechars, threechars + 9));
-assert (*it == 0x10346);
-
-

- The purpose of utf8::iterator adapter is to enable easy iteration as well as the use of STL - algorithms with UTF-8 encoded strings. Increment and decrement operators are implemented in terms of - utf8::next() and utf8::prior() functions. -

-

- Note that utf8::iterator adapter is a checked iterator. It operates on the range specified in - the constructor; any attempt to go out of that range will result in an exception. Even the comparison operators - require both iterator object to be constructed against the same range - otherwise an exception is thrown. Typically, - the range will be determined by sequence container functions begin and end, i.e.: -

-
-std::string s = "example";
-utf8::iterator i (s.begin(), s.begin(), s.end());
-
-

- Functions From utf8::unchecked Namespace -

-

- utf8::unchecked::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = unchecked::append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- This is a faster but less safe version of utf8::append. It does not - check for validity of the supplied code point, and may produce an invalid UTF-8 - sequence. -

-

- utf8::unchecked::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point - and moves the iterator to the next position. -

-
-template <typename octet_iterator>
-uint32_t next(octet_iterator& it);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::next(w);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This is a faster but less safe version of utf8::next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point. -

-
-template <typename octet_iterator>
-uint32_t peek_next(octet_iterator it);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::peek_next(w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::peek_next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t prior(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::prior (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::prior. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::previous (deprecated, see utf8::unchecked::prior) -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t previous(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::previous (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- The reason this function is deprecated is just the consistency with the "checked" - versions, where prior should be used instead of previous. - In fact, unchecked::previous behaves exactly the same as - unchecked::prior -

-

- This is a faster but less safe version of utf8::previous. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type>
-void advance (octet_iterator& it, distance_type n);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-unchecked::advance (w, 2);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- This is a faster but less safe version of utf8::advance. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator>
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::unchecked::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This is a faster but less safe version of utf8::distance. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-unchecked::utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- This is a faster but less safe version of utf8::utf16to8. It does not - check for validity of the supplied UTF-16 sequence. -

-

- utf8::unchecked::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-unchecked::utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- This is a faster but less safe version of utf8::utf8to16. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65e5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- This is a faster but less safe version of utf8::utf32to8. It does not - check for validity of the supplied UTF-32 sequence. -

-

- utf8::unchecked::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-unchecked::utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- This is a faster but less safe version of utf8::utf8to32. It does not - check for validity of the supplied UTF-8 sequence. -

-

- Types From utf8::unchecked Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it); -
a constructor - that initializes the underlying octet_iterator with octet_it -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::unchecked::iterator<char*> un_it(threechars);
-utf8::unchecked::iterator<char*> un_it2 = un_it;
-assert (un_it2 == un_it);
-assert (*un_it == 0x10346);
-assert (*(++un_it) == 0x65e5);
-assert ((*un_it++) == 0x65e5);
-assert (*un_it == 0x0448);
-assert (un_it != un_it2);
-utf8::::unchecked::iterator<char*> un_endit (threechars + 9);  
-assert (++un_it == un_endit);
-assert (*(--un_it) == 0x0448);
-assert ((*un_it--) == 0x0448);
-assert (*un_it == 0x65e5);
-assert (--un_it == utf8::unchecked::iterator<char*>(threechars));
-assert (*un_it == 0x10346);
-
-

- This is an unchecked version of utf8::iterator. It is faster in many cases, but offers - no validity or range checks. -

-

- Points of interest -

-

- Design goals and decisions -

-

- The library was designed to be: -

-
    -
  1. - Generic: for better or worse, there are many C++ string classes out there, and - the library should work with as many of them as possible. -
  2. -
  3. - Portable: the library should be portable both accross different platforms and - compilers. The only non-portable code is a small section that declares unsigned - integers of different sizes: three typedefs. They can be changed by the users of - the library if they don't match their platform. The default setting should work - for Windows (both 32 and 64 bit), and most 32 bit and 64 bit Unix derivatives. -
  4. -
  5. - Lightweight: follow the "pay only for what you use" guidline. -
  6. -
  7. - Unintrusive: avoid forcing any particular design or even programming style on the - user. This is a library, not a framework. -
  8. -
-

- Alternatives -

-

- In case you want to look into other means of working with UTF-8 strings from C++, - here is the list of solutions I am aware of: -

-
    -
  1. - ICU Library. It is very powerful, - complete, feature-rich, mature, and widely used. Also big, intrusive, - non-generic, and doesn't play well with the Standard Library. I definitelly - recommend looking at ICU even if you don't plan to use it. -
  2. -
  3. - Glib::ustring. - A class specifically made to work with UTF-8 strings, and also feel like - std::string. If you prefer to have yet another string class in your - code, it may be worth a look. Be aware of the licensing issues, though. -
  4. -
  5. - Platform dependent solutions: Windows and POSIX have functions to convert strings - from one encoding to another. That is only a subset of what my library offers, - but if that is all you need it may be good enough, especially given the fact that - these functions are mature and tested in production. -
  6. -
-

- Conclusion -

-

- Until Unicode becomes officially recognized by the C++ Standard Library, we need to - use other means to work with UTF-8 strings. Template functions I describe in this - article may be a good step in this direction. -

- -
    -
  1. - The Unicode Consortium. -
  2. -
  3. - ICU Library. -
  4. -
  5. - UTF-8 at Wikipedia -
  6. -
  7. - UTF-8 and Unicode FAQ for - Unix/Linux -
  8. -
- - diff --git a/dep/include/utf8cpp/utf8.h b/dep/include/utf8cpp/utf8.h deleted file mode 100644 index cc463cb82d5..00000000000 --- a/dep/include/utf8cpp/utf8.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "utf8/checked.h" -#include "utf8/unchecked.h" - -#endif // header guard - diff --git a/dep/include/utf8cpp/utf8/checked.h b/dep/include/utf8cpp/utf8/checked.h deleted file mode 100644 index 86204eae3ea..00000000000 --- a/dep/include/utf8cpp/utf8/checked.h +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "core.h" -#include - -namespace utf8 -{ - // Exceptions that may be thrown from the library functions. - class invalid_code_point : public std::exception { - uint32_t cp; - public: - invalid_code_point(uint32_t cp) : cp(cp) {} - virtual const char* what() const throw() { return "Invalid code point"; } - uint32_t code_point() const {return cp;} - }; - - class invalid_utf8 : public std::exception { - uint8_t u8; - public: - invalid_utf8 (uint8_t u) : u8(u) {} - virtual const char* what() const throw() { return "Invalid UTF-8"; } - uint8_t utf8_octet() const {return u8;} - }; - - class invalid_utf16 : public std::exception { - uint16_t u16; - public: - invalid_utf16 (uint16_t u) : u16(u) {} - virtual const char* what() const throw() { return "Invalid UTF-16"; } - uint16_t utf16_word() const {return u16;} - }; - - class not_enough_room : public std::exception { - public: - virtual const char* what() const throw() { return "Not enough space"; } - }; - - /// The library API - functions intended to be called by the users - - template - output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement) - { - while (start != end) { - octet_iterator sequence_start = start; - internal::utf_error err_code = internal::validate_next(start, end); - switch (err_code) { - case internal::OK : - for (octet_iterator it = sequence_start; it != start; ++it) - *out++ = *it; - break; - case internal::NOT_ENOUGH_ROOM: - throw not_enough_room(); - case internal::INVALID_LEAD: - append (replacement, out); - ++start; - break; - case internal::INCOMPLETE_SEQUENCE: - case internal::OVERLONG_SEQUENCE: - case internal::INVALID_CODE_POINT: - append (replacement, out); - ++start; - // just one replacement mark for the sequence - while (internal::is_trail(*start) && start != end) - ++start; - break; - } - } - return out; - } - - template - inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out) - { - static const uint32_t replacement_marker = internal::mask16(0xfffd); - return replace_invalid(start, end, out, replacement_marker); - } - - template - octet_iterator append(uint32_t cp, octet_iterator result) - { - if (!internal::is_code_point_valid(cp)) - throw invalid_code_point(cp); - - if (cp < 0x80) // one octet - *(result++) = static_cast(cp); - else if (cp < 0x800) { // two octets - *(result++) = static_cast((cp >> 6) | 0xc0); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp < 0x10000) { // three octets - *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp <= internal::CODE_POINT_MAX) { // four octets - *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast(((cp >> 12)& 0x3f) | 0x80); - *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else - throw invalid_code_point(cp); - - return result; - } - - template - uint32_t next(octet_iterator& it, octet_iterator end) - { - uint32_t cp = 0; - internal::utf_error err_code = internal::validate_next(it, end, &cp); - switch (err_code) { - case internal::OK : - break; - case internal::NOT_ENOUGH_ROOM : - throw not_enough_room(); - case internal::INVALID_LEAD : - case internal::INCOMPLETE_SEQUENCE : - case internal::OVERLONG_SEQUENCE : - throw invalid_utf8(*it); - case internal::INVALID_CODE_POINT : - throw invalid_code_point(cp); - } - return cp; - } - - template - uint32_t peek_next(octet_iterator it, octet_iterator end) - { - return next(it, end); - } - - template - uint32_t prior(octet_iterator& it, octet_iterator start) - { - octet_iterator end = it; - while (internal::is_trail(*(--it))) - if (it < start) - throw invalid_utf8(*it); // error - no lead byte in the sequence - octet_iterator temp = it; - return next(temp, end); - } - - /// Deprecated in versions that include "prior" - template - uint32_t previous(octet_iterator& it, octet_iterator pass_start) - { - octet_iterator end = it; - while (internal::is_trail(*(--it))) - if (it == pass_start) - throw invalid_utf8(*it); // error - no lead byte in the sequence - octet_iterator temp = it; - return next(temp, end); - } - - template - void advance (octet_iterator& it, distance_type n, octet_iterator end) - { - for (distance_type i = 0; i < n; ++i) - next(it, end); - } - - template - typename std::iterator_traits::difference_type - distance (octet_iterator first, octet_iterator last) - { - typename std::iterator_traits::difference_type dist; - for (dist = 0; first < last; ++dist) - next(first, last); - return dist; - } - - template - octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) - { - while (start != end) { - uint32_t cp = internal::mask16(*start++); - // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { - if (start != end) { - uint32_t trail_surrogate = internal::mask16(*start++); - if (trail_surrogate >= internal::TRAIL_SURROGATE_MIN && trail_surrogate <= internal::TRAIL_SURROGATE_MAX) - cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; - else - throw invalid_utf16(static_cast(trail_surrogate)); - } - else - throw invalid_utf16(static_cast(*start)); - - } - result = append(cp, result); - } - return result; - } - - template - u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) - { - while (start != end) { - uint32_t cp = next(start, end); - if (cp > 0xffff) { //make a surrogate pair - *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); - *result++ = static_cast((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN); - } - else - *result++ = static_cast(cp); - } - return result; - } - - template - octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result) - { - while (start != end) - result = append(*(start++), result); - - return result; - } - - template - u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) - { - while (start < end) - (*result++) = next(start, end); - - return result; - } - - // The iterator class - template - class iterator : public std::iterator { - octet_iterator it; - octet_iterator range_start; - octet_iterator range_end; - public: - iterator () {}; - explicit iterator (const octet_iterator& octet_it, - const octet_iterator& range_start, - const octet_iterator& range_end) : - it(octet_it), range_start(range_start), range_end(range_end) - { - if (it < range_start || it > range_end) - throw std::out_of_range("Invalid utf-8 iterator position"); - } - // the default "big three" are OK - octet_iterator base () const { return it; } - uint32_t operator * () const - { - octet_iterator temp = it; - return next(temp, range_end); - } - bool operator == (const iterator& rhs) const - { - if (range_start != rhs.range_start || range_end != rhs.range_end) - throw std::logic_error("Comparing utf-8 iterators defined with different ranges"); - return (it == rhs.it); - } - bool operator != (const iterator& rhs) const - { - return !(operator == (rhs)); - } - iterator& operator ++ () - { - next(it, range_end); - return *this; - } - iterator operator ++ (int) - { - iterator temp = *this; - next(it, range_end); - return temp; - } - iterator& operator -- () - { - prior(it, range_start); - return *this; - } - iterator operator -- (int) - { - iterator temp = *this; - prior(it, range_start); - return temp; - } - }; // class iterator - -} // namespace utf8 - -#endif //header guard - - - diff --git a/dep/include/utf8cpp/utf8/core.h b/dep/include/utf8cpp/utf8/core.h deleted file mode 100644 index 3b6edf70b96..00000000000 --- a/dep/include/utf8cpp/utf8/core.h +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include - -// use Trinity core types -#include "Define.h" - -namespace utf8 -{ - // The typedefs for 8-bit, 16-bit and 32-bit unsigned integers - // You may need to change them to match your system. - // These typedefs have the same names as ones from cstdint, or boost/cstdint - - /* use Trinity alternatives - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - */ - typedef uint8 uint8_t; - typedef uint16 uint16_t; - typedef uint32 uint32_t; - -// Helper code - not intended to be directly called by the library users. May be changed at any time -namespace internal -{ - // Unicode constants - // Leading (high) surrogates: 0xd800 - 0xdbff - // Trailing (low) surrogates: 0xdc00 - 0xdfff - const uint16_t LEAD_SURROGATE_MIN = 0xd800u; - const uint16_t LEAD_SURROGATE_MAX = 0xdbffu; - const uint16_t TRAIL_SURROGATE_MIN = 0xdc00u; - const uint16_t TRAIL_SURROGATE_MAX = 0xdfffu; - const uint16_t LEAD_OFFSET = LEAD_SURROGATE_MIN - (0x10000 >> 10); - const uint32_t SURROGATE_OFFSET = 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN; - - // Maximum valid value for a Unicode code point - const uint32_t CODE_POINT_MAX = 0x0010ffffu; - - template - inline uint8_t mask8(octet_type oc) - { - return static_cast(0xff & oc); - } - template - inline uint16_t mask16(u16_type oc) - { - return static_cast(0xffff & oc); - } - template - inline bool is_trail(octet_type oc) - { - return ((mask8(oc) >> 6) == 0x2); - } - - template - inline bool is_surrogate(u16 cp) - { - return (cp >= LEAD_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX); - } - - template - inline bool is_code_point_valid(u32 cp) - { - return (cp <= CODE_POINT_MAX && !is_surrogate(cp) && cp != 0xfffe && cp != 0xffff); - } - - template - inline typename std::iterator_traits::difference_type - sequence_length(octet_iterator lead_it) - { - uint8_t lead = mask8(*lead_it); - if (lead < 0x80) - return 1; - else if ((lead >> 5) == 0x6) - return 2; - else if ((lead >> 4) == 0xe) - return 3; - else if ((lead >> 3) == 0x1e) - return 4; - else - return 0; - } - - enum utf_error {OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT}; - - template - utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t* code_point) - { - uint32_t cp = mask8(*it); - // Check the lead octet - typedef typename std::iterator_traits::difference_type octet_difference_type; - octet_difference_type length = sequence_length(it); - - // "Shortcut" for ASCII characters - if (length == 1) { - if (end - it > 0) { - if (code_point) - *code_point = cp; - ++it; - return OK; - } - else - return NOT_ENOUGH_ROOM; - } - - // Do we have enough memory? - if (std::distance(it, end) < length) - return NOT_ENOUGH_ROOM; - - // Check trail octets and calculate the code point - switch (length) { - case 0: - return INVALID_LEAD; - break; - case 2: - if (is_trail(*(++it))) { - cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - case 3: - if (is_trail(*(++it))) { - cp = ((cp << 12) & 0xffff) + ((mask8(*it) << 6) & 0xfff); - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - case 4: - if (is_trail(*(++it))) { - cp = ((cp << 18) & 0x1fffff) + ((mask8(*it) << 12) & 0x3ffff); - if (is_trail(*(++it))) { - cp += (mask8(*it) << 6) & 0xfff; - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -3); - return INCOMPLETE_SEQUENCE; - } - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - } - // Is the code point valid? - if (!is_code_point_valid(cp)) { - for (octet_difference_type i = 0; i < length - 1; ++i) - --it; - return INVALID_CODE_POINT; - } - - if (code_point) - *code_point = cp; - - if (cp < 0x80) { - if (length != 1) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x800) { - if (length != 2) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x10000) { - if (length != 3) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - - ++it; - return OK; - } - - template - inline utf_error validate_next(octet_iterator& it, octet_iterator end) { - return validate_next(it, end, 0); - } - -} // namespace internal - - /// The library API - functions intended to be called by the users - - // Byte order mark - const uint8_t bom[] = {0xef, 0xbb, 0xbf}; - - template - octet_iterator find_invalid(octet_iterator start, octet_iterator end) - { - octet_iterator result = start; - while (result != end) { - internal::utf_error err_code = internal::validate_next(result, end); - if (err_code != internal::OK) - return result; - } - return result; - } - - template - inline bool is_valid(octet_iterator start, octet_iterator end) - { - return (find_invalid(start, end) == end); - } - - template - inline bool is_bom (octet_iterator it) - { - return ( - (internal::mask8(*it++)) == bom[0] && - (internal::mask8(*it++)) == bom[1] && - (internal::mask8(*it)) == bom[2] - ); - } -} // namespace utf8 - -#endif // header guard - - - diff --git a/dep/include/utf8cpp/utf8/unchecked.h b/dep/include/utf8cpp/utf8/unchecked.h deleted file mode 100644 index fc7267d1b98..00000000000 --- a/dep/include/utf8cpp/utf8/unchecked.h +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "core.h" - -namespace utf8 -{ - namespace unchecked - { - template - octet_iterator append(uint32_t cp, octet_iterator result) - { - if (cp < 0x80) // one octet - *(result++) = static_cast(cp); - else if (cp < 0x800) { // two octets - *(result++) = static_cast((cp >> 6) | 0xc0); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp < 0x10000) { // three octets - *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else { // four octets - *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast((cp >> 12)& 0x3f | 0x80); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - return result; - } - - template - uint32_t next(octet_iterator& it) - { - uint32_t cp = internal::mask8(*it); - typename std::iterator_traits::difference_type length = utf8::internal::sequence_length(it); - switch (length) { - case 1: - break; - case 2: - it++; - cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); - break; - case 3: - ++it; - cp = ((cp << 12) & 0xffff) + ((internal::mask8(*it) << 6) & 0xfff); - ++it; - cp += (*it) & 0x3f; - break; - case 4: - ++it; - cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff); - ++it; - cp += (internal::mask8(*it) << 6) & 0xfff; - ++it; - cp += (*it) & 0x3f; - break; - } - ++it; - return cp; - } - - template - uint32_t peek_next(octet_iterator it) - { - return next(it); - } - - template - uint32_t prior(octet_iterator& it) - { - while (internal::is_trail(*(--it))) ; - octet_iterator temp = it; - return next(temp); - } - - // Deprecated in versions that include prior, but only for the sake of consistency (see utf8::previous) - template - inline uint32_t previous(octet_iterator& it) - { - return prior(it); - } - - template - void advance (octet_iterator& it, distance_type n) - { - for (distance_type i = 0; i < n; ++i) - next(it); - } - - template - typename std::iterator_traits::difference_type - distance (octet_iterator first, octet_iterator last) - { - typename std::iterator_traits::difference_type dist; - for (dist = 0; first < last; ++dist) - next(first); - return dist; - } - - template - octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) - { - while (start != end) { - uint32_t cp = internal::mask16(*start++); - // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { - uint32_t trail_surrogate = internal::mask16(*start++); - cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; - } - result = append(cp, result); - } - return result; - } - - template - u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) - { - while (start != end) { - uint32_t cp = next(start); - if (cp > 0xffff) { //make a surrogate pair - *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); - *result++ = static_cast((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN); - } - else - *result++ = static_cast(cp); - } - return result; - } - - template - octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result) - { - while (start != end) - result = append(*(start++), result); - - return result; - } - - template - u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) - { - while (start < end) - (*result++) = next(start); - - return result; - } - - // The iterator class - template - class iterator : public std::iterator { - octet_iterator it; - public: - iterator () {}; - explicit iterator (const octet_iterator& octet_it): it(octet_it) {} - // the default "big three" are OK - octet_iterator base () const { return it; } - uint32_t operator * () const - { - octet_iterator temp = it; - return next(temp); - } - bool operator == (const iterator& rhs) const - { - return (it == rhs.it); - } - bool operator != (const iterator& rhs) const - { - return !(operator == (rhs)); - } - iterator& operator ++ () - { - std::advance(it, internal::sequence_length(it)); - return *this; - } - iterator operator ++ (int) - { - iterator temp = *this; - std::advance(it, internal::sequence_length(it)); - return temp; - } - iterator& operator -- () - { - prior(it); - return *this; - } - iterator operator -- (int) - { - iterator temp = *this; - prior(it); - return temp; - } - }; // class iterator - - } // namespace utf8::unchecked -} // namespace utf8 - - -#endif // header guard - - diff --git a/dep/include/vld/vld.h b/dep/include/vld/vld.h deleted file mode 100644 index 72bebd8c4f6..00000000000 --- a/dep/include/vld/vld.h +++ /dev/null @@ -1,105 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// $Id: vld.h,v 1.27 2006/11/12 18:09:20 dmouldin Exp $ -// -// Visual Leak Detector (Version 1.9d) - Import Library Header -// Copyright (c) 2006 Dan Moulding -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// -// See COPYING.txt for the full terms of the GNU Lesser General Public License. -// -//////////////////////////////////////////////////////////////////////////////// - -//#pragma once -#ifndef _VLD_H_ -#define _VLD_H_ - -#ifdef _DEBUG - -#pragma comment(lib, "vld.lib") - -// Force a symbolic reference to the global VisualLeakDetector class object from -// the DLL. This enusres that the DLL is loaded and linked with the program, -// even if no code otherwise imports any of the DLL's exports. -#pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A") - -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Leak Detector APIs -// - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// VLDDisable - Disables Visual Leak Detector's memory leak detection at -// runtime. If memory leak detection is already disabled, then calling this -// function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only disabled for that thread. If memory leak -// detection is enabled for other threads, then it will remain enabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to disable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// - -__declspec(dllimport) void VLDDisable (); - -// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime. -// If memory leak detection is already enabled, which it is by default, then -// calling this function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only enabled for that thread. If memory leak -// detection is disabled for other threads, then it will remain disabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to enable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// - -__declspec(dllimport) void VLDEnable (); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#else // !_DEBUG - -#define VLDEnable() -#define VLDDisable() - -#endif // _DEBUG - -#endif // _VLD_H_ - diff --git a/dep/include/zlib/zconf.h b/dep/include/zlib/zconf.h deleted file mode 100644 index 719855a60d4..00000000000 --- a/dep/include/zlib/zconf.h +++ /dev/null @@ -1,333 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ - diff --git a/dep/include/zlib/zlib.h b/dep/include/zlib/zlib.h deleted file mode 100644 index 2ad74617098..00000000000 --- a/dep/include/zlib/zlib.h +++ /dev/null @@ -1,1358 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ - diff --git a/dep/src/CMakeLists.txt b/dep/src/CMakeLists.txt deleted file mode 100644 index a2b27016ce1..00000000000 --- a/dep/src/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(g3dlite) -if (NOT MACOSX) -add_subdirectory(jmalloc) -endif(NOT MACOSX) -add_subdirectory(sockets) -add_subdirectory(zlib) - - -########### install files ############### \ No newline at end of file diff --git a/dep/src/ace/ACE.cpp b/dep/src/ace/ACE.cpp deleted file mode 100644 index 9780df8e829..00000000000 --- a/dep/src/ace/ACE.cpp +++ /dev/null @@ -1,3439 +0,0 @@ -// $Id: ACE.cpp 82581 2008-08-11 08:58:24Z johnnyw $ - -#include "ace/ACE.h" - -#include "ace/Basic_Types.h" -#include "ace/Handle_Set.h" -#include "ace/Auto_Ptr.h" -#include "ace/SString.h" -#include "ace/Version.h" -#include "ace/Message_Block.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_sys_select.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_strings.h" -#include "ace/OS_NS_signal.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_sys_resource.h" -#include "ace/OS_NS_sys_wait.h" -#include "ace/OS_NS_sys_time.h" -#include "ace/OS_NS_time.h" -#include "ace/OS_NS_sys_uio.h" -#include "ace/OS_NS_sys_stat.h" -#include "ace/OS_NS_ctype.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/OS_TLI.h" -#include "ace/Truncate.h" - -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) -extern "C" int maxFiles; -#endif /* ACE_VXWORKS */ - -#if !defined (__ACE_INLINE__) -#include "ace/ACE.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) -# include "ace/OS_NS_poll.h" -#endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - -ACE_RCSID (ace, - ACE, - "$Id: ACE.cpp 82581 2008-08-11 08:58:24Z johnnyw $") - -// Open versioned namespace, if enabled by the user. - ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE -{ - // private: - // Used internally so not exported. - - // Size of allocation granularity. - size_t allocation_granularity_ = 0; - - // Size of a VM page. - size_t pagesize_ = 0; - - // Are we debugging ACE? - // Keeps track of whether we're in some global debug mode. - char debug_; -} - -int -ACE::out_of_handles (int error) -{ - // EMFILE is common to all platforms. - if (error == EMFILE || -#if defined (ACE_WIN32) - // On Win32, we need to check for ENOBUFS also. - error == ENOBUFS || -#elif defined (HPUX) - // On HPUX, we need to check for EADDRNOTAVAIL also. - error == EADDRNOTAVAIL || -#elif defined (linux) - // On linux, we need to check for ENOENT also. - error == ENOENT || - // For RedHat5.2, need to check for EINVAL too. - error == EINVAL || - // Without threads check for EOPNOTSUPP - error == EOPNOTSUPP || -#elif defined (sun) - // On sun, we need to check for ENOSR also. - error == ENOSR || - // Without threads check for ENOTSUP - error == ENOTSUP || -#elif defined (__FreeBSD__) - // On FreeBSD we need to check for EOPNOTSUPP (LinuxThreads) or - // ENOSYS (libc_r threads) also. - error == EOPNOTSUPP || - error == ENOSYS || -#elif defined (__OpenBSD__) - // OpenBSD appears to return EBADF. - error == EBADF || -#elif defined (__sgi) // irix - error == ENOTSUP || -#elif defined (DIGITAL_UNIX) // osf1 - error == ENOTSUP || -#endif /* ACE_WIN32 */ - error == ENFILE) - return 1; - else - return 0; -} - -u_int -ACE::major_version (void) -{ - return ACE_MAJOR_VERSION; -} - -u_int -ACE::minor_version (void) -{ - return ACE_MINOR_VERSION; -} - -u_int -ACE::beta_version (void) -{ - return ACE_BETA_VERSION; -} - -const ACE_TCHAR * -ACE::compiler_name (void) -{ -#ifdef ACE_CC_NAME - return ACE_CC_NAME; -#else - return ACE_TEXT (""); -#endif -} - -u_int -ACE::compiler_major_version (void) -{ -#ifdef ACE_CC_MAJOR_VERSION - return ACE_CC_MAJOR_VERSION; -#else - return 0; -#endif -} - -u_int -ACE::compiler_minor_version (void) -{ -#ifdef ACE_CC_MINOR_VERSION - return ACE_CC_MINOR_VERSION; -#else - return 0; -#endif -} - -u_int -ACE::compiler_beta_version (void) -{ -#ifdef ACE_CC_BETA_VERSION - return ACE_CC_BETA_VERSION; -#else - return 0; -#endif -} - -bool -ACE::debug (void) -{ - static const char* debug = ACE_OS::getenv ("ACE_DEBUG"); - return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0'): false); -} - -void -ACE::debug (bool onoff) -{ - ACE::debug_ = onoff; -} - -int -ACE::select (int width, - ACE_Handle_Set *readfds, - ACE_Handle_Set *writefds, - ACE_Handle_Set *exceptfds, - const ACE_Time_Value *timeout) -{ - int result = ACE_OS::select (width, - readfds ? readfds->fdset () : 0, - writefds ? writefds->fdset () : 0, - exceptfds ? exceptfds->fdset () : 0, - timeout); - if (result > 0) - { -# if !defined (ACE_WIN32) - // This isn't needed for Windows... it's a no-op anyway. - if (readfds) - readfds->sync ((ACE_HANDLE) width); - if (writefds) - writefds->sync ((ACE_HANDLE) width); - if (exceptfds) - exceptfds->sync ((ACE_HANDLE) width); -#endif /* ACE_WIN32 */ - } - return result; -} - -int -ACE::select (int width, - ACE_Handle_Set &readfds, - const ACE_Time_Value *timeout) -{ - int result = ACE_OS::select (width, - readfds.fdset (), - 0, - 0, - timeout); - -#if !defined (ACE_WIN32) - if (result > 0) - readfds.sync ((ACE_HANDLE) width); -#endif /* ACE_WIN32 */ - return result; -} - -int -ACE::terminate_process (pid_t pid) -{ -#if defined (ACE_HAS_PHARLAP) - ACE_UNUSED_ARG (pid); - ACE_NOTSUP_RETURN (-1); -#elif defined (ACE_WIN32) - // Create a handle for the given process id. - ACE_HANDLE process_handle = - ::OpenProcess (PROCESS_TERMINATE, - FALSE, // New handle is not inheritable. - pid); - - if (process_handle == ACE_INVALID_HANDLE - || process_handle == 0) - return -1; - else - { - // Kill the process associated with process_handle. - BOOL terminate_result = - ::TerminateProcess (process_handle, 0); - // Free up the kernel resources. - ACE_OS::close (process_handle); - return terminate_result ? 0 : -1; - } -#else - return ACE_OS::kill (pid, 9); -#endif /* ACE_HAS_PHARLAP */ -} - -int -ACE::process_active (pid_t pid) -{ -#if !defined(ACE_WIN32) - if (ACE_OS::kill (pid, 0) == 0) - return 1; - else if (errno == ESRCH) - return 0; - else - return -1; -#else - // Create a handle for the given process id. - ACE_HANDLE process_handle = - ::OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, pid); - if (process_handle == ACE_INVALID_HANDLE || process_handle == 0) - return 0; - else - { - DWORD status; - int result = 1; - if (::GetExitCodeProcess (process_handle, - &status) == 0 - || status != STILL_ACTIVE) - result = 0; - - ::CloseHandle (process_handle); - return result; - } -#endif /* !ACE_WIN32 */ -} - -const ACE_TCHAR * -ACE::execname (const ACE_TCHAR *old_name) -{ -#if defined (ACE_WIN32) - const ACE_TCHAR *suffix = ACE_OS::strrchr (old_name, ACE_TEXT ('.')); - if (suffix == 0 || ACE_OS::strcasecmp (suffix, ACE_TEXT (".exe")) != 0) - { - ACE_TCHAR *new_name = 0; - - size_t size = - ACE_OS::strlen (old_name) - + ACE_OS::strlen (ACE_TEXT (".exe")) - + 1; - - ACE_NEW_RETURN (new_name, - ACE_TCHAR[size], - 0); - ACE_TCHAR *end = new_name; - - end = ACE_OS::strecpy (new_name, old_name); - - // Concatenate the .exe suffix onto the end of the executable. - // end points _after_ the terminating nul. - ACE_OS::strcpy (end - 1, ACE_TEXT (".exe")); - - return new_name; - } -#endif /* ACE_WIN32 */ - return old_name; -} - -u_long -ACE::hash_pjw (const char *str, size_t len) -{ - u_long hash = 0; - - for (size_t i = 0; i < len; i++) - { - const char temp = str[i]; - hash = (hash << 4) + (temp * 13); - - u_long g = hash & 0xf0000000; - - if (g) - { - hash ^= (g >> 24); - hash ^= g; - } - } - - return hash; -} - -u_long -ACE::hash_pjw (const char *str) -{ - return ACE::hash_pjw (str, ACE_OS::strlen (str)); -} - -#if defined (ACE_HAS_WCHAR) -u_long -ACE::hash_pjw (const wchar_t *str, size_t len) -{ - u_long hash = 0; - - for (size_t i = 0; i < len; i++) - { - // @@ UNICODE: Does this function do the correct thing with wchar's? - - const wchar_t temp = str[i]; - hash = (hash << 4) + (temp * 13); - - u_long g = hash & 0xf0000000; - - if (g) - { - hash ^= (g >> 24); - hash ^= g; - } - } - - return hash; -} - -u_long -ACE::hash_pjw (const wchar_t *str) -{ - return ACE::hash_pjw (str, ACE_OS::strlen (str)); -} -#endif /* ACE_HAS_WCHAR */ - -#if !defined (ACE_HAS_WINCE) -ACE_TCHAR * -ACE::strenvdup (const ACE_TCHAR *str) -{ - ACE_TRACE ("ACE::strenvdup"); - - return ACE_OS::strenvdup (str); -} -#endif /* ACE_HAS_WINCE */ - -/* - -Examples: - -Source NT UNIX -================================================================== -netsvc netsvc.dll libnetsvc.so -(PATH will be (LD_LIBRARY_PATH -evaluated) evaluated) - -libnetsvc.dll libnetsvc.dll libnetsvc.dll + warning -netsvc.so netsvc.so + warning libnetsvc.so - -..\../libs/netsvc ..\..\libs\netsvc.dll ../../libs/netsvc.so -(absolute path used) (absolute path used) - -*/ - -const ACE_TCHAR * -ACE::basename (const ACE_TCHAR *pathname, ACE_TCHAR delim) -{ - ACE_TRACE ("ACE::basename"); - const ACE_TCHAR *temp = ACE_OS::strrchr (pathname, delim); - - if (temp == 0) - return pathname; - else - return temp + 1; -} - -const ACE_TCHAR * -ACE::dirname (const ACE_TCHAR *pathname, ACE_TCHAR delim) -{ - ACE_TRACE ("ACE::dirname"); - static ACE_TCHAR return_dirname[MAXPATHLEN + 1]; - - const ACE_TCHAR *temp = ACE_OS::strrchr (pathname, delim); - - if (temp == 0) - { - return_dirname[0] = '.'; - return_dirname[1] = '\0'; - - return return_dirname; - } - else - { - // When the len is truncated, there are problems! This should - // not happen in normal circomstances - size_t len = temp - pathname + 1; - if (len > (sizeof return_dirname / sizeof (ACE_TCHAR))) - len = sizeof return_dirname / sizeof (ACE_TCHAR); - - ACE_OS::strsncpy (return_dirname, - pathname, - len); - return return_dirname; - } -} - -ssize_t -ACE::recv (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::recv (handle, (char *) buf, len, flags); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) ==-1) - return -1; - else - { - ssize_t bytes_transferred = - ACE_OS::recv (handle, (char *) buf, len, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -#if defined (ACE_HAS_TLI) - -ssize_t -ACE::t_rcv (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::t_rcv (handle, (char *) buf, len, flags); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) ==-1) - return -1; - else - { - ssize_t bytes_transferred = - ACE_OS::t_rcv (handle, (char *) buf, len, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -#endif /* ACE_HAS_TLI */ - -ssize_t -ACE::recv (ACE_HANDLE handle, - void *buf, - size_t n, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE::recv_i (handle, buf, n); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE::recv_i (handle, buf, n); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::recvmsg (ACE_HANDLE handle, - struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::recvmsg (handle, msg, flags); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::recvmsg (handle, msg, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::recvfrom (ACE_HANDLE handle, - char *buf, - int len, - int flags, - struct sockaddr *addr, - int *addrlen, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::recvfrom (handle, buf, len, flags, addr, addrlen); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = - ACE_OS::recvfrom (handle, buf, len, flags, addr, addrlen); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE_OS::recv (handle, - static_cast (buf) + bytes_transferred, - len - bytes_transferred, - flags); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK) - { - // Wait for the blocking to subside. - int const result = ACE::handle_read_ready (handle, 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return static_cast (bytes_transferred); -} - -ssize_t -ACE::recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE_OS::recv (handle, - static_cast (buf) + bytes_transferred, - len - bytes_transferred, - flags); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - errno == EWOULDBLOCK) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_read_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - return result; - else - return static_cast (bytes_transferred); -} - -#if defined (ACE_HAS_TLI) - -ssize_t -ACE::t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE_OS::t_rcv (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK) - { - // Wait for the blocking to subside. - int result = ACE::handle_read_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return bytes_transferred; -} - -ssize_t -ACE::t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE_OS::t_rcv (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - errno == EWOULDBLOCK) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_read_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - return result; - else - return bytes_transferred; -} - -#endif /* ACE_HAS_TLI */ - -ssize_t -ACE::recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE::recv_i (handle, - static_cast (buf) + bytes_transferred, - len - bytes_transferred); - // Check EOF. - if (n == 0) - { - return 0; - } - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK) - { - // Wait for the blocking to subside. - int result = ACE::handle_read_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return static_cast (bytes_transferred); -} - -ssize_t -ACE::recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE::recv_i (handle, - static_cast (buf) + bytes_transferred, - len - bytes_transferred); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - errno == EWOULDBLOCK) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_read_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - return result; - else - return static_cast (bytes_transferred); -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE::recv (ACE_HANDLE handle, size_t n, ...) -{ - va_list argp; - int total_tuples = static_cast (n / 2); - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::recvv (handle, iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -ssize_t -ACE::recvv (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::recvv (handle, iov, iovcnt); - else - { - int val = 0; - if (ACE::enter_recv_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::recvv (handle, iov, iovcnt); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - for (int s = 0; - s < iovcnt; - ) - { - // Try to transfer as much of the remaining data as possible. - ssize_t n = ACE_OS::recvv (handle, - iov + s, - iovcnt - s); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK) - { - // Wait for the blocking to subside. - int result = ACE::handle_read_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = static_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (int s = 0; - s < iovcnt; - ) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - ssize_t n = ACE_OS::recvv (handle, - iov + s, - iovcnt - s); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - errno == EWOULDBLOCK) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_read_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = reinterpret_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - { - return result; - } - else - { - return ACE_Utils::truncate_cast (bytes_transferred); - } -} - -ssize_t -ACE::recv_n (ACE_HANDLE handle, - ACE_Message_Block *message_block, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - iovec iov[ACE_IOV_MAX]; - int iovcnt = 0; - - while (message_block != 0) - { - // Our current message block chain. - const ACE_Message_Block *current_message_block = message_block; - - while (current_message_block != 0) - { - size_t current_message_block_length = - current_message_block->length (); - char *this_rd_ptr = current_message_block->rd_ptr (); - - // Check if this block has any space for incoming data. - while (current_message_block_length > 0) - { - u_long const this_chunk_length = - ACE_Utils::truncate_cast ( - current_message_block_length); - - // Collect the data in the iovec. - iov[iovcnt].iov_base = this_rd_ptr; - iov[iovcnt].iov_len = this_chunk_length; - current_message_block_length -= this_chunk_length; - this_rd_ptr += this_chunk_length; - - // Increment iovec counter. - ++iovcnt; - - // The buffer is full make a OS call. @@ TODO find a way to - // find ACE_IOV_MAX for platforms that do not define it rather - // than simply setting ACE_IOV_MAX to some arbitrary value such - // as 16. - if (iovcnt == ACE_IOV_MAX) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::recvv_n (handle, - iov, - iovcnt, - timeout, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - return result; - - // Reset iovec counter. - iovcnt = 0; - } - } - - // Select the next message block in the chain. - current_message_block = current_message_block->cont (); - } - - // Selection of the next message block chain. - message_block = message_block->next (); - } - - // Check for remaining buffers to be sent. This will happen when - // ACE_IOV_MAX is not a multiple of the number of message blocks. - if (iovcnt != 0) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::recvv_n (handle, - iov, - iovcnt, - timeout, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - { - return result; - } - } - - // Return total bytes transferred. - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::send (ACE_HANDLE handle, - const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::send (handle, (const char *) buf, n, flags); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::send (handle, (const char *) buf, n, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -#if defined (ACE_HAS_TLI) - -ssize_t -ACE::t_snd (ACE_HANDLE handle, - const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::t_snd (handle, (const char *) buf, n, flags); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::t_snd (handle, (const char *) buf, n, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -#endif /* ACE_HAS_TLI */ - -ssize_t -ACE::send (ACE_HANDLE handle, - const void *buf, - size_t n, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE::send_i (handle, buf, n); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE::send_i (handle, buf, n); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::sendmsg (ACE_HANDLE handle, - const struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::sendmsg (handle, msg, flags); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::sendmsg (handle, msg, flags); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::sendto (ACE_HANDLE handle, - const char *buf, - int len, - int flags, - const struct sockaddr *addr, - int addrlen, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::sendto (handle, buf, len, flags, addr, addrlen); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = - ACE_OS::sendto (handle, buf, len, flags, addr, addrlen); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE_OS::send (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. -#if defined (ACE_WIN32) - if (errno == EWOULDBLOCK) // If enobufs no need to loop -#else - if (errno == EWOULDBLOCK || errno == ENOBUFS) -#endif /* ACE_WIN32 */ - { - // Wait for the blocking to subside. - int result = ACE::handle_write_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE_OS::send (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - (errno == EWOULDBLOCK || errno == ENOBUFS)) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_write_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - { - return result; - } - else - { - return ACE_Utils::truncate_cast (bytes_transferred); - } -} - -#if defined (ACE_HAS_TLI) - -ssize_t -ACE::t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE_OS::t_snd (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK || errno == ENOBUFS) - { - // Wait for the blocking to subside. - int result = ACE::handle_write_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return bytes_transferred; -} - -ssize_t -ACE::t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE_OS::t_snd (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred, - flags); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - errno == EWOULDBLOCK || errno == ENOBUFS) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_write_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - return result; - else - return bytes_transferred; -} - -#endif /* ACE_HAS_TLI */ - -ssize_t -ACE::send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - n = ACE::send_i (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred); - // Check EOF. - if (n == 0) - { - return 0; - } - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK || errno == ENOBUFS) - { - // Wait for the blocking to subside. - int result = ACE::handle_write_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - ssize_t n; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - n = ACE::send_i (handle, - (char *) buf + bytes_transferred, - len - bytes_transferred); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - (errno == EWOULDBLOCK || errno == ENOBUFS)) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_write_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - { - return result; - } - else - { - return ACE_Utils::truncate_cast (bytes_transferred); - } -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE::send (ACE_HANDLE handle, size_t n, ...) -{ - va_list argp; - int total_tuples = static_cast (n / 2); - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::sendv (handle, iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -ssize_t -ACE::sendv (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout) -{ - if (timeout == 0) - return ACE_OS::sendv (handle, iov, iovcnt); - else - { - int val = 0; - if (ACE::enter_send_timedwait (handle, timeout, val) == -1) - return -1; - else - { - ssize_t bytes_transferred = ACE_OS::sendv (handle, iov, iovcnt); - ACE::restore_non_blocking_mode (handle, val); - return bytes_transferred; - } - } -} - -ssize_t -ACE::sendv_n_i (ACE_HANDLE handle, - const iovec *i, - int iovcnt, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - iovec *iov = const_cast (i); - - for (int s = 0; - s < iovcnt; - ) - { - // Try to transfer as much of the remaining data as possible. - ssize_t n = ACE_OS::sendv (handle, - iov + s, - iovcnt - s); - // Check EOF. - if (n == 0) - return 0; - - // Check for other errors. - if (n == -1) - { - // Check for possible blocking. - if (errno == EWOULDBLOCK || errno == ENOBUFS) - { - // Wait for the blocking to subside. - int result = ACE::handle_write_ready (handle, - 0); - - // Did select() succeed? - if (result != -1) - { - // Blocking subsided. Continue data transfer. - n = 0; - continue; - } - } - - // Other data transfer or select() failures. - return -1; - } - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = reinterpret_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::sendv_n_i (ACE_HANDLE handle, - const iovec *i, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - ssize_t result = 0; - int error = 0; - - int val = 0; - ACE::record_and_set_non_blocking_mode (handle, val); - - iovec *iov = const_cast (i); - - for (int s = 0; - s < iovcnt; - ) - { - // Try to transfer as much of the remaining data as possible. - // Since the socket is in non-blocking mode, this call will not - // block. - ssize_t n = ACE_OS::sendv (handle, - iov + s, - iovcnt - s); - - // Check for errors. - if (n == 0 || - n == -1) - { - // Check for possible blocking. - if (n == -1 && - (errno == EWOULDBLOCK || errno == ENOBUFS)) - { - // Wait upto for the blocking to subside. - int rtn = ACE::handle_write_ready (handle, - timeout); - - // Did select() succeed? - if (rtn != -1) - { - // Blocking subsided in period. Continue - // data transfer. - n = 0; - continue; - } - } - - // Wait in select() timed out or other data transfer or - // select() failures. - error = 1; - result = n; - break; - } - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = reinterpret_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - ACE::restore_non_blocking_mode (handle, val); - - if (error) - { - return result; - } - else - { - return ACE_Utils::truncate_cast (bytes_transferred); - } -} - -ssize_t -ACE::write_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - iovec iov[ACE_IOV_MAX]; - int iovcnt = 0; - - while (message_block != 0) - { - // Our current message block chain. - const ACE_Message_Block *current_message_block = message_block; - - while (current_message_block != 0) - { - size_t current_message_block_length = - current_message_block->length (); - char *this_block_ptr = current_message_block->rd_ptr (); - - // Check if this block has any data to be sent. - while (current_message_block_length > 0) - { - u_long const this_chunk_length = - ACE_Utils::truncate_cast ( - current_message_block_length); - - // Collect the data in the iovec. - iov[iovcnt].iov_base = this_block_ptr; - iov[iovcnt].iov_len = this_chunk_length; - current_message_block_length -= this_chunk_length; - this_block_ptr += this_chunk_length; - - // Increment iovec counter. - ++iovcnt; - - // The buffer is full make a OS call. @@ TODO find a way to - // find ACE_IOV_MAX for platforms that do not define it rather - // than simply setting ACE_IOV_MAX to some arbitrary value such - // as 16. - if (iovcnt == ACE_IOV_MAX) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::writev_n (handle, - iov, - iovcnt, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - return result; - - // Reset iovec counter. - iovcnt = 0; - } - } - - // Select the next message block in the chain. - current_message_block = current_message_block->cont (); - } - - // Selection of the next message block chain. - message_block = message_block->next (); - } - - // Check for remaining buffers to be sent. This will happen when - // ACE_IOV_MAX is not a multiple of the number of message blocks. - if (iovcnt != 0) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::writev_n (handle, - iov, - iovcnt, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - return result; - } - - // Return total bytes transferred. - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::send_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - const ACE_Time_Value *timeout, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - iovec iov[ACE_IOV_MAX]; - int iovcnt = 0; - - while (message_block != 0) - { - // Our current message block chain. - const ACE_Message_Block *current_message_block = message_block; - - while (current_message_block != 0) - { - char *this_block_ptr = current_message_block->rd_ptr (); - size_t current_message_block_length = - current_message_block->length (); - - // Check if this block has any data to be sent. - while (current_message_block_length > 0) - { - u_long const this_chunk_length = - ACE_Utils::truncate_cast ( - current_message_block_length); - - // Collect the data in the iovec. - iov[iovcnt].iov_base = this_block_ptr; - iov[iovcnt].iov_len = this_chunk_length; - current_message_block_length -= this_chunk_length; - this_block_ptr += this_chunk_length; - - // Increment iovec counter. - ++iovcnt; - - // The buffer is full make a OS call. @@ TODO find a way to - // find ACE_IOV_MAX for platforms that do not define it rather - // than simply setting ACE_IOV_MAX to some arbitrary value such - // as 16. - if (iovcnt == ACE_IOV_MAX) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::sendv_n (handle, - iov, - iovcnt, - timeout, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - return result; - - // Reset iovec counter. - iovcnt = 0; - } - } - - // Select the next message block in the chain. - current_message_block = current_message_block->cont (); - } - - // Selection of the next message block chain. - message_block = message_block->next (); - } - - // Check for remaining buffers to be sent. This will happen when - // ACE_IOV_MAX is not a multiple of the number of message blocks. - if (iovcnt != 0) - { - size_t current_transfer = 0; - - ssize_t const result = ACE::sendv_n (handle, - iov, - iovcnt, - timeout, - ¤t_transfer); - - // Add to total bytes transferred. - bytes_transferred += current_transfer; - - // Errors. - if (result == -1 || result == 0) - { - return result; - } - } - - // Return total bytes transferred. - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::readv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - for (int s = 0; - s < iovcnt; - ) - { - ssize_t n = ACE_OS::readv (handle, - iov + s, - iovcnt - s); - - if (n == -1 || n == 0) - return n; - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = reinterpret_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -ssize_t -ACE::writev_n (ACE_HANDLE handle, - const iovec *i, - int iovcnt, - size_t *bt) -{ - size_t temp; - size_t &bytes_transferred = bt == 0 ? temp : *bt; - bytes_transferred = 0; - - iovec *iov = const_cast (i); - - for (int s = 0; - s < iovcnt; - ) - { - ssize_t n = ACE_OS::writev (handle, - iov + s, - iovcnt - s); - - if (n == -1 || n == 0) - { - return n; - } - - for (bytes_transferred += n; - s < iovcnt - && n >= static_cast (iov[s].iov_len); - s++) - n -= iov[s].iov_len; - - if (n != 0) - { - char *base = reinterpret_cast (iov[s].iov_base); - iov[s].iov_base = base + n; - iov[s].iov_len = iov[s].iov_len - n; - } - } - - return ACE_Utils::truncate_cast (bytes_transferred); -} - -int -ACE::handle_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int read_ready, - int write_ready, - int exception_ready) -{ -#if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - ACE_UNUSED_ARG (write_ready); - ACE_UNUSED_ARG (exception_ready); - - struct pollfd fds; - - fds.fd = handle; - fds.events = read_ready ? POLLIN : POLLOUT; - fds.revents = 0; - - int result = ACE_OS::poll (&fds, 1, timeout); -#else - ACE_Handle_Set handle_set; - handle_set.set_bit (handle); - - // Wait for data or for the timeout to elapse. - int select_width; -# if defined (ACE_WIN32) - // This arg is ignored on Windows and causes pointer truncation - // warnings on 64-bit compiles. - select_width = 0; -# else - select_width = int (handle) + 1; -# endif /* ACE_WIN64 */ - int result = ACE_OS::select (select_width, - read_ready ? handle_set.fdset () : 0, // read_fds. - write_ready ? handle_set.fdset () : 0, // write_fds. - exception_ready ? handle_set.fdset () : 0, // exception_fds. - timeout); - -#endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - - switch (result) - { - case 0: // Timer expired. - errno = ETIME; - /* FALLTHRU */ - case -1: // we got here directly - select() returned -1. - return -1; - case 1: // Handle has data. - /* FALLTHRU */ - default: // default is case result > 0; return a - // ACE_ASSERT (result == 1); - return result; - } -} - -int -ACE::enter_recv_timedwait (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int &val) -{ - int result = ACE::handle_read_ready (handle, - timeout); - - if (result == -1) - return -1; - - ACE::record_and_set_non_blocking_mode (handle, - val); - - return result; -} - -int -ACE::enter_send_timedwait (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int &val) -{ - int result = ACE::handle_write_ready (handle, - timeout); - - if (result == -1) - return -1; - - ACE::record_and_set_non_blocking_mode (handle, - val); - - return result; -} - -void -ACE::record_and_set_non_blocking_mode (ACE_HANDLE handle, - int &val) -{ - // We need to record whether we are already *in* nonblocking mode, - // so that we can correctly reset the state when we're done. - val = ACE::get_flags (handle); - - if (ACE_BIT_DISABLED (val, ACE_NONBLOCK)) - // Set the handle into non-blocking mode if it's not already in - // it. - ACE::set_flags (handle, ACE_NONBLOCK); -} - -void -ACE::restore_non_blocking_mode (ACE_HANDLE handle, - int val) -{ - if (ACE_BIT_DISABLED (val, - ACE_NONBLOCK)) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - // Only disable ACE_NONBLOCK if we weren't in non-blocking mode - // originally. - ACE::clr_flags (handle, ACE_NONBLOCK); - } -} - -// Format buffer into printable format. This is useful for debugging. -// Portions taken from mdump by J.P. Knight (J.P.Knight@lut.ac.uk) -// Modifications by Todd Montgomery. - -size_t -ACE::format_hexdump (const char *buffer, - size_t size, - ACE_TCHAR *obuf, - size_t obuf_sz) -{ - ACE_TRACE ("ACE::format_hexdump"); - - u_char c; - ACE_TCHAR textver[16 + 1]; - - // We can fit 16 bytes output in text mode per line, 4 chars per byte. - size_t maxlen = (obuf_sz / 68) * 16; - - if (size > maxlen) - size = maxlen; - - size_t i; - - size_t lines = size / 16; - for (i = 0; i < lines; i++) - { - size_t j; - - for (j = 0 ; j < 16; j++) - { - c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j] - ACE_OS::sprintf (obuf, - ACE_TEXT ("%02x "), - c); - obuf += 3; - if (j == 7) - { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; - } - textver[j] = ACE_OS::ace_isprint (c) ? c : '.'; - } - - textver[j] = 0; - - ACE_OS::sprintf (obuf, - ACE_TEXT (" %s\n"), - textver); - - while (*obuf != '\0') - ++obuf; - } - - if (size % 16) - { - for (i = 0 ; i < size % 16; i++) - { - c = (u_char) buffer[size - size % 16 + i]; - ACE_OS::sprintf (obuf, - ACE_TEXT ("%02x "), - c); - obuf += 3; - if (i == 7) - { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; - } - textver[i] = ACE_OS::ace_isprint (c) ? c : '.'; - } - - for (i = size % 16; i < 16; i++) - { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - obuf += 3; - if (i == 7) - { - ACE_OS::sprintf (obuf, - ACE_TEXT (" ")); - ++obuf; - } - textver[i] = ' '; - } - - textver[i] = 0; - ACE_OS::sprintf (obuf, - ACE_TEXT (" %s\n"), - textver); - } - return size; -} - -// Returns the current timestamp in the form -// "hour:minute:second:microsecond." The month, day, and year are -// also stored in the beginning of the date_and_time array. - -ACE_TCHAR * -ACE::timestamp (ACE_TCHAR date_and_time[], - size_t date_and_timelen, - bool return_pointer_to_first_digit) -{ - //ACE_TRACE ("ACE::timestamp"); - - if (date_and_timelen < 35) - { - errno = EINVAL; - return 0; - } - -#if defined (WIN32) - // Emulate Unix. Win32 does NOT support all the UNIX versions - // below, so DO we need this ifdef. - static const ACE_TCHAR *day_of_week_name[] = - { - ACE_TEXT ("Sun"), - ACE_TEXT ("Mon"), - ACE_TEXT ("Tue"), - ACE_TEXT ("Wed"), - ACE_TEXT ("Thu"), - ACE_TEXT ("Fri"), - ACE_TEXT ("Sat") - }; - - static const ACE_TCHAR *month_name[] = - { - ACE_TEXT ("Jan"), - ACE_TEXT ("Feb"), - ACE_TEXT ("Mar"), - ACE_TEXT ("Apr"), - ACE_TEXT ("May"), - ACE_TEXT ("Jun"), - ACE_TEXT ("Jul"), - ACE_TEXT ("Aug"), - ACE_TEXT ("Sep"), - ACE_TEXT ("Oct"), - ACE_TEXT ("Nov"), - ACE_TEXT ("Dec") - }; - - SYSTEMTIME local; - ::GetLocalTime (&local); - - ACE_OS::sprintf (date_and_time, - ACE_TEXT ("%3s %3s %2d %04d %02d:%02d:%02d.%06d"), - day_of_week_name[local.wDayOfWeek], - month_name[local.wMonth - 1], - (int) local.wDay, - (int) local.wYear, - (int) local.wHour, - (int) local.wMinute, - (int) local.wSecond, - (int) (local.wMilliseconds * 1000)); - return &date_and_time[15 + (return_pointer_to_first_digit != 0)]; -#else /* UNIX */ - ACE_TCHAR timebuf[26]; // This magic number is based on the ctime(3c) man page. - ACE_Time_Value cur_time = ACE_OS::gettimeofday (); - time_t secs = cur_time.sec (); - - ACE_OS::ctime_r (&secs, - timebuf, - sizeof timebuf / sizeof (ACE_TCHAR)); - // date_and_timelen > sizeof timebuf! - ACE_OS::strsncpy (date_and_time, - timebuf, - date_and_timelen); - ACE_TCHAR yeartmp[5]; - ACE_OS::strsncpy (yeartmp, - &date_and_time[20], - 5); - ACE_TCHAR timetmp[9]; - ACE_OS::strsncpy (timetmp, - &date_and_time[11], - 9); - ACE_OS::sprintf (&date_and_time[11], -# if defined (ACE_USES_WCHAR) - ACE_TEXT ("%ls %ls.%06ld"), -# else - ACE_TEXT ("%s %s.%06ld"), -# endif /* ACE_USES_WCHAR */ - yeartmp, - timetmp, - cur_time.usec ()); - date_and_time[33] = '\0'; - return &date_and_time[15 + (return_pointer_to_first_digit != 0)]; -#endif /* WIN32 */ -} - -// This function rounds the request to a multiple of the page size. - -size_t -ACE::round_to_pagesize (size_t len) -{ - ACE_TRACE ("ACE::round_to_pagesize"); - - if (ACE::pagesize_ == 0) - ACE::pagesize_ = ACE_OS::getpagesize (); - - return (len + (ACE::pagesize_ - 1)) & ~(ACE::pagesize_ - 1); -} - -size_t -ACE::round_to_allocation_granularity (size_t len) -{ - ACE_TRACE ("ACE::round_to_allocation_granularity"); - - if (ACE::allocation_granularity_ == 0) - ACE::allocation_granularity_ = ACE_OS::allocation_granularity (); - - return (len + (ACE::allocation_granularity_ - 1)) & ~(ACE::allocation_granularity_ - 1); -} - -ACE_HANDLE -ACE::handle_timed_complete (ACE_HANDLE h, - const ACE_Time_Value *timeout, - int is_tli) -{ - ACE_TRACE ("ACE::handle_timed_complete"); - -#if !defined (ACE_WIN32) && defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - - struct pollfd fds; - - fds.fd = h; - fds.events = POLLIN | POLLOUT; - fds.revents = 0; - -#else - ACE_Handle_Set rd_handles; - ACE_Handle_Set wr_handles; - - rd_handles.set_bit (h); - wr_handles.set_bit (h); -#endif /* !ACE_WIN32 && ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - -#if defined (ACE_WIN32) - // Winsock is different - it sets the exception bit for failed connect, - // unlike other platforms, where the read bit is set. - ACE_Handle_Set ex_handles; - ex_handles.set_bit (h); -#endif /* ACE_WIN32 */ - - bool need_to_check = false; - bool known_failure = false; - -#if defined (ACE_WIN32) - int n = ACE_OS::select (0, // Ignored on Windows: int (h) + 1, - 0, - wr_handles, - ex_handles, - timeout); -#else -# if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - - int n = ACE_OS::poll (&fds, 1, timeout); - -# else - int n = ACE_OS::select (int (h) + 1, - rd_handles, - wr_handles, - 0, - timeout); -# endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ -#endif /* ACE_WIN32 */ - - // If we failed to connect within the time period allocated by the - // caller, then we fail (e.g., the remote host might have been too - // busy to accept our call). - if (n <= 0) - { - if (n == 0 && timeout != 0) - errno = ETIME; - return ACE_INVALID_HANDLE; - } - - // Usually, a ready-for-write handle is successfully connected, and - // ready-for-read (exception on Win32) is a failure. On fails, we - // need to grab the error code via getsockopt. On possible success for - // any platform where we can't tell just from select() (e.g. AIX), - // we also need to check for success/fail. -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (is_tli); - - // On Win32, ex_handle set indicates a failure. We'll do the check - // to try and get an errno value, but the connect failed regardless of - // what getsockopt says about the error. - if (ex_handles.is_set (h)) - { - need_to_check = true; - known_failure = true; - } -#elif defined (ACE_VXWORKS) - ACE_UNUSED_ARG (is_tli); - - // Force the check on VxWorks. The read handle for "h" is not set, - // so "need_to_check" is false at this point. The write handle is - // set, for what it's worth. - need_to_check = true; -#else - if (is_tli) - -# if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - need_to_check = (fds.revents & POLLIN) && !(fds.revents & POLLOUT); -# else - need_to_check = rd_handles.is_set (h) && !wr_handles.is_set (h); -# endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - - else -#if defined(AIX) - // AIX is broken... both success and failed connect will set the - // write handle only, so always check. - need_to_check = true; -#else -# if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - need_to_check = (fds.revents & POLLIN); -# else - need_to_check = rd_handles.is_set (h); -# endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ -#endif /* AIX */ -#endif /* ACE_WIN32 */ - - if (need_to_check) - { -#if defined (SOL_SOCKET) && defined (SO_ERROR) - int sock_err = 0; - int sock_err_len = sizeof (sock_err); - int sockopt_ret = ACE_OS::getsockopt (h, SOL_SOCKET, SO_ERROR, - (char *)&sock_err, &sock_err_len); - if (sockopt_ret < 0) - { - h = ACE_INVALID_HANDLE; - } - - if (sock_err != 0 || known_failure) - { - h = ACE_INVALID_HANDLE; - errno = sock_err; - } -#else - char dummy; - - // The following recv() won't block provided that the - // ACE_NONBLOCK flag has not been turned off . - n = ACE::recv (h, &dummy, 1, MSG_PEEK); - - // If no data was read/peeked at, check to see if it's because - // of a non-connected socket (and therefore an error) or there's - // just no data yet. - if (n <= 0) - { - if (n == 0) - { - errno = ECONNREFUSED; - h = ACE_INVALID_HANDLE; - } - else if (errno != EWOULDBLOCK && errno != EAGAIN) - h = ACE_INVALID_HANDLE; - } -#endif - } - - // 1. The HANDLE is ready for writing and doesn't need to be checked or - // 2. recv() returned an indication of the state of the socket - if there is - // either data present, or a recv is legit but there's no data yet, - // the connection was successfully established. - return h; -} - -// Wait up to amount of time to accept a connection. - -int -ACE::handle_timed_accept (ACE_HANDLE listener, - ACE_Time_Value *timeout, - int restart) -{ - ACE_TRACE ("ACE::handle_timed_accept"); - // Make sure we don't bomb out on erroneous values. - if (listener == ACE_INVALID_HANDLE) - return -1; - -#if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - - struct pollfd fds; - - fds.fd = listener; - fds.events = POLLIN; - fds.revents = 0; - -#else - // Use the select() implementation rather than poll(). - ACE_Handle_Set rd_handle; - rd_handle.set_bit (listener); -#endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - - // We need a loop here if is enabled. - - for (;;) - { -#if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - - int n = ACE_OS::poll (&fds, 1, timeout); - -#else - int select_width; -# if defined (ACE_WIN32) - // This arg is ignored on Windows and causes pointer truncation - // warnings on 64-bit compiles. - select_width = 0; -# else - select_width = int (listener) + 1; -# endif /* ACE_WIN32 */ - int n = ACE_OS::select (select_width, - rd_handle, 0, 0, - timeout); -#endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ - - switch (n) - { - case -1: - if (errno == EINTR && restart) - continue; - else - return -1; - /* NOTREACHED */ - case 0: - if (timeout != 0 - && timeout->sec () == 0 - && timeout->usec () == 0) - errno = EWOULDBLOCK; - else - errno = ETIMEDOUT; - return -1; - /* NOTREACHED */ - case 1: - return 0; - /* NOTREACHED */ - default: - errno = EINVAL; - return -1; - /* NOTREACHED */ - } - } -} - -// Make the current process a UNIX daemon. This is based on Stevens -// code from APUE. - -int -ACE::daemonize (const ACE_TCHAR pathname[], - bool close_all_handles, - const ACE_TCHAR program_name[]) -{ - ACE_TRACE ("ACE::daemonize"); -#if !defined (ACE_LACKS_FORK) - pid_t pid = ACE_OS::fork (); - - if (pid == -1) - return -1; - else if (pid != 0) - ACE_OS::exit (0); // Parent exits. - - // 1st child continues. - ACE_OS::setsid (); // Become session leader. - - ACE_OS::signal (SIGHUP, SIG_IGN); - - pid = ACE_OS::fork (program_name); - - if (pid != 0) - ACE_OS::exit (0); // First child terminates. - - // Second child continues. - - if (pathname != 0) - // change working directory. - ACE_OS::chdir (pathname); - - ACE_OS::umask (0); // clear our file mode creation mask. - - // Close down the I/O handles. - if (close_all_handles) - { - for (int i = ACE::max_handles () - 1; i >= 0; i--) - ACE_OS::close (i); - - int fd = ACE_OS::open ("/dev/null", O_RDWR, 0); - if (fd != -1) - { - ACE_OS::dup2 (fd, ACE_STDIN); - ACE_OS::dup2 (fd, ACE_STDOUT); - ACE_OS::dup2 (fd, ACE_STDERR); - - if (fd > ACE_STDERR) - ACE_OS::close (fd); - } - } - - return 0; -#else - ACE_UNUSED_ARG (pathname); - ACE_UNUSED_ARG (close_all_handles); - ACE_UNUSED_ARG (program_name); - - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_LACKS_FORK */ -} - -pid_t -ACE::fork (const ACE_TCHAR *program_name, - int avoid_zombies) -{ - if (avoid_zombies == 0) - return ACE_OS::fork (program_name); - else - { - // This algorithm is adapted from an example in the Stevens book - // "Advanced Programming in the Unix Environment" and an item in - // Andrew Gierth's Unix Programming FAQ. It creates an orphan - // process that's inherited by the init process; init cleans up - // when the orphan process terminates. - // - // Another way to avoid zombies is to ignore or catch the - // SIGCHLD signal; we don't use that approach here. - - pid_t pid = ACE_OS::fork (); - if (pid == 0) - { - // The child process forks again to create a grandchild. - switch (ACE_OS::fork (program_name)) - { - case 0: // grandchild returns 0. - return 0; - case -1: // assumes all errnos are < 256 - ACE_OS::_exit (errno); - default: // child terminates, orphaning grandchild - ACE_OS::_exit (0); - } - } - - // Parent process waits for child to terminate. - ACE_exitcode status; - if (pid < 0 || ACE_OS::waitpid (pid, &status, 0) < 0) - return -1; - - // child terminated by calling exit()? - if (WIFEXITED ((status))) - { - // child terminated normally? - if (WEXITSTATUS ((status)) == 0) - return 1; - else - errno = WEXITSTATUS ((status)); - } - else - // child didn't call exit(); perhaps it received a signal? - errno = EINTR; - - return -1; - } -} - -int -ACE::max_handles (void) -{ - ACE_TRACE ("ACE::max_handles"); -#if defined (RLIMIT_NOFILE) && !defined (ACE_LACKS_RLIMIT) - rlimit rl; - int const r = ACE_OS::getrlimit (RLIMIT_NOFILE, &rl); -# if !defined (RLIM_INFINITY) - if (r == 0) - return rl.rlim_cur; -# else - if (r == 0 && rl.rlim_cur != RLIM_INFINITY) - return rl.rlim_cur; - // If == RLIM_INFINITY, fall through to the ACE_LACKS_RLIMIT sections -# endif /* RLIM_INFINITY */ -#endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */ - -#if defined (_SC_OPEN_MAX) - return ACE_OS::sysconf (_SC_OPEN_MAX); -#elif defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) - return maxFiles; -#elif defined (FD_SETSIZE) - return FD_SETSIZE; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* _SC_OPEN_MAX */ -} - -// Set the number of currently open handles in the process. -// -// If NEW_LIMIT == -1 set the limit to the maximum allowable. -// Otherwise, set it to be the value of NEW_LIMIT. - -int -ACE::set_handle_limit (int new_limit, - int increase_limit_only) -{ - ACE_TRACE ("ACE::set_handle_limit"); - int cur_limit = ACE::max_handles (); - int max_limit = cur_limit; - - if (cur_limit == -1) - return -1; - -#if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE) - struct rlimit rl; - - ACE_OS::memset ((void *) &rl, 0, sizeof rl); - int r = ACE_OS::getrlimit (RLIMIT_NOFILE, &rl); - if (r == 0) - max_limit = rl.rlim_max; -#endif /* ACE_LACKS_RLIMIT */ - - if (new_limit == -1) - new_limit = max_limit; - - if (new_limit < 0) - { - errno = EINVAL; - return -1; - } - else if (new_limit > cur_limit) - { - // Increase the limit. -#if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE) - rl.rlim_cur = new_limit; - return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); -#elif defined (ACE_LACKS_RLIMIT_NOFILE) - return 0; -#else - // Must return EINVAL errno. - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_LACKS_RLIMIT */ - } - else if (increase_limit_only == 0) - { - // Decrease the limit. -#if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE) - rl.rlim_cur = new_limit; - return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); -#else - // We give a chance to platforms without RLIMIT to work. - // Instead of ACE_NOTSUP_RETURN (0), just return 0 because - // new_limit is <= cur_limit, so it's a no-op. - return 0; -#endif /* ACE_LACKS_RLIMIT */ - } - - return 0; -} - -// Euclid's greatest common divisor algorithm. -u_long -ACE::gcd (u_long x, u_long y) -{ - while (y != 0) - { - u_long r = x % y; - x = y; - y = r; - } - - return x; -} - -// Calculates the minimum enclosing frame size for the given values. -u_long -ACE::minimum_frame_size (u_long period1, u_long period2) -{ - // if one of the periods is zero, treat it as though it as - // uninitialized and return the other period as the frame size - if (0 == period1) - { - return period2; - } - if (0 == period2) - { - return period1; - } - - // if neither is zero, find the greatest common divisor of the two periods - u_long greatest_common_divisor = ACE::gcd (period1, period2); - - // explicitly consider cases to reduce risk of possible overflow errors - if (greatest_common_divisor == 1) - { - // periods are relative primes: just multiply them together - return period1 * period2; - } - else if (greatest_common_divisor == period1) - { - // the first period divides the second: return the second - return period2; - } - else if (greatest_common_divisor == period2) - { - // the second period divides the first: return the first - return period1; - } - else - { - // the current frame size and the entry's effective period - // have a non-trivial greatest common divisor: return the - // product of factors divided by those in their gcd. - return (period1 * period2) / greatest_common_divisor; - } -} - -u_long -ACE::is_prime (const u_long n, - const u_long min_factor, - const u_long max_factor) -{ - if (n > 3) - for (u_long factor = min_factor; - factor <= max_factor; - ++factor) - if (n / factor * factor == n) - return factor; - - return 0; -} - -const ACE_TCHAR * -ACE::sock_error (int error) -{ -#if defined (ACE_WIN32) - static ACE_TCHAR unknown_msg[64]; - - switch (error) - { - case WSAVERNOTSUPPORTED: - return ACE_TEXT ("version of WinSock not supported"); - /* NOTREACHED */ - case WSASYSNOTREADY: - return ACE_TEXT ("WinSock not present or not responding"); - /* NOTREACHED */ - case WSAEINVAL: - return ACE_TEXT ("app version not supported by DLL"); - /* NOTREACHED */ - case WSAHOST_NOT_FOUND: - return ACE_TEXT ("Authoritive: Host not found"); - /* NOTREACHED */ - case WSATRY_AGAIN: - return ACE_TEXT ("Non-authoritive: host not found or server failure"); - /* NOTREACHED */ - case WSANO_RECOVERY: - return ACE_TEXT ("Non-recoverable: refused or not implemented"); - /* NOTREACHED */ - case WSANO_DATA: - return ACE_TEXT ("Valid name, no data record for type"); - /* NOTREACHED */ - /* - case WSANO_ADDRESS: - return "Valid name, no MX record"; - */ - case WSANOTINITIALISED: - return ACE_TEXT ("WSA Startup not initialized"); - /* NOTREACHED */ - case WSAENETDOWN: - return ACE_TEXT ("Network subsystem failed"); - /* NOTREACHED */ - case WSAEINPROGRESS: - return ACE_TEXT ("Blocking operation in progress"); - /* NOTREACHED */ - case WSAEINTR: - return ACE_TEXT ("Blocking call cancelled"); - /* NOTREACHED */ - case WSAEAFNOSUPPORT: - return ACE_TEXT ("address family not supported"); - /* NOTREACHED */ - case WSAEMFILE: - return ACE_TEXT ("no file handles available"); - /* NOTREACHED */ - case WSAENOBUFS: - return ACE_TEXT ("no buffer space available"); - /* NOTREACHED */ - case WSAEPROTONOSUPPORT: - return ACE_TEXT ("specified protocol not supported"); - /* NOTREACHED */ - case WSAEPROTOTYPE: - return ACE_TEXT ("protocol wrong type for this socket"); - /* NOTREACHED */ - case WSAESOCKTNOSUPPORT: - return ACE_TEXT ("socket type not supported for address family"); - /* NOTREACHED */ - case WSAENOTSOCK: - return ACE_TEXT ("handle is not a socket"); - /* NOTREACHED */ - case WSAEWOULDBLOCK: - return ACE_TEXT ("resource temporarily unavailable"); - /* NOTREACHED */ - case WSAEADDRINUSE: - return ACE_TEXT ("address already in use"); - /* NOTREACHED */ - case WSAECONNABORTED: - return ACE_TEXT ("connection aborted"); - /* NOTREACHED */ - case WSAECONNRESET: - return ACE_TEXT ("connection reset"); - /* NOTREACHED */ - case WSAENOTCONN: - return ACE_TEXT ("not connected"); - /* NOTREACHED */ - case WSAETIMEDOUT: - return ACE_TEXT ("connection timed out"); - /* NOTREACHED */ - case WSAECONNREFUSED: - return ACE_TEXT ("connection refused"); - /* NOTREACHED */ - case WSAEHOSTDOWN: - return ACE_TEXT ("host down"); - /* NOTREACHED */ - case WSAEHOSTUNREACH: - return ACE_TEXT ("host unreachable"); - /* NOTREACHED */ - case WSAEADDRNOTAVAIL: - return ACE_TEXT ("address not available"); - /* NOTREACHED */ - case WSAEISCONN: - return ACE_TEXT ("socket is already connected"); - /* NOTREACHED */ - case WSAENETRESET: - return ACE_TEXT ("network dropped connection on reset"); - /* NOTREACHED */ - case WSAEMSGSIZE: - return ACE_TEXT ("message too long"); - /* NOTREACHED */ - case WSAENETUNREACH: - return ACE_TEXT ("network is unreachable"); - /* NOTREACHED */ - case WSAEFAULT: - return ACE_TEXT ("bad address"); - /* NOTREACHED */ - case WSAEDISCON: - return ACE_TEXT ("graceful shutdown in progress"); - /* NOTREACHED */ - case WSAEACCES: - return ACE_TEXT ("permission denied"); - /* NOTREACHED */ - case WSAESHUTDOWN: - return ACE_TEXT ("cannot send after socket shutdown"); - /* NOTREACHED */ - case WSAEPROCLIM: - return ACE_TEXT ("too many processes"); - /* NOTREACHED */ - case WSAEALREADY: - return ACE_TEXT ("operation already in progress"); - /* NOTREACHED */ - case WSAEPFNOSUPPORT: - return ACE_TEXT ("protocol family not supported"); - /* NOTREACHED */ - case WSAENOPROTOOPT: - return ACE_TEXT ("bad protocol option"); - /* NOTREACHED */ - case WSATYPE_NOT_FOUND: - return ACE_TEXT ("class type not found"); - /* NOTREACHED */ - case WSAEOPNOTSUPP: - return ACE_TEXT ("operation not supported"); - /* NOTREACHED */ - case WSAEDESTADDRREQ: - return ACE_TEXT ("destination address required"); - /* NOTREACHED */ - default: - ACE_OS::sprintf (unknown_msg, ACE_TEXT ("unknown error: %d"), error); - return unknown_msg; - /* NOTREACHED */ - } -#else - ACE_UNUSED_ARG (error); - ACE_NOTSUP_RETURN (0); -#endif /* ACE_WIN32 */ -} - -bool -ACE::is_sock_error (int error) -{ -#if defined (ACE_WIN32) - switch (error) - { - case WSAVERNOTSUPPORTED: - case WSASYSNOTREADY: - case WSAEINVAL: - case WSAHOST_NOT_FOUND: - case WSATRY_AGAIN: - case WSANO_RECOVERY: - case WSANO_DATA: - /* - case WSANO_ADDRESS: - */ - case WSANOTINITIALISED: - case WSAENETDOWN: - case WSAEINPROGRESS: - case WSAEINTR: - case WSAEAFNOSUPPORT: - case WSAEMFILE: - case WSAENOBUFS: - case WSAEPROTONOSUPPORT: - case WSAEPROTOTYPE: - case WSAESOCKTNOSUPPORT: - case WSAENOTSOCK: - case WSAEWOULDBLOCK: - case WSAEADDRINUSE: - case WSAECONNABORTED: - case WSAECONNRESET: - case WSAENOTCONN: - case WSAETIMEDOUT: - case WSAECONNREFUSED: - case WSAEHOSTDOWN: - case WSAEHOSTUNREACH: - case WSAEADDRNOTAVAIL: - case WSAEISCONN: - case WSAENETRESET: - case WSAEMSGSIZE: - case WSAENETUNREACH: - case WSAEFAULT: - case WSAEDISCON: - case WSAEACCES: - case WSAESHUTDOWN: - case WSAEPROCLIM: - case WSAEALREADY: - case WSAEPFNOSUPPORT: - case WSAENOPROTOOPT: - case WSATYPE_NOT_FOUND: - case WSAEOPNOTSUPP: - return true; - } -#else - ACE_UNUSED_ARG (error); -#endif /* ACE_WIN32 */ - return false; -} - -char * -ACE::strndup (const char *str, size_t n) -{ - const char *t = str; - size_t len; - - // Figure out how long this string is (remember, it might not be - // NUL-terminated). - - for (len = 0; - len < n && *t++ != '\0'; - len++) - continue; - - char *s; - ACE_ALLOCATOR_RETURN (s, - (char *) ACE_OS::malloc (len + 1), - 0); - return ACE_OS::strsncpy (s, str, len + 1); -} - -#if defined (ACE_HAS_WCHAR) -wchar_t * -ACE::strndup (const wchar_t *str, size_t n) -{ - const wchar_t *t = str; - size_t len; - - // Figure out how long this string is (remember, it might not be - // NUL-terminated). - - for (len = 0; - len < n && *t++ != '\0'; - len++) - continue; - - wchar_t *s; - ACE_ALLOCATOR_RETURN (s, - static_cast ( - ACE_OS::malloc ((len + 1) * sizeof (wchar_t))), - 0); - return ACE_OS::strsncpy (s, str, len + 1); -} -#endif /* ACE_HAS_WCHAR */ - -char * -ACE::strnnew (const char *str, size_t n) -{ - const char *t = str; - size_t len; - - // Figure out how long this string is (remember, it might not be - // NUL-terminated). - - for (len = 0; - len < n && *t++ != L'\0'; - len++) - continue; - - char *s; - ACE_NEW_RETURN (s, - char[len + 1], - 0); - return ACE_OS::strsncpy (s, str, len + 1); -} - -#if defined (ACE_HAS_WCHAR) -wchar_t * -ACE::strnnew (const wchar_t *str, size_t n) -{ - const wchar_t *t = str; - size_t len; - - // Figure out how long this string is (remember, it might not be - // NUL-terminated). - - for (len = 0; - len < n && *t++ != ACE_TEXT_WIDE ('\0'); - len++) - continue; - - wchar_t *s; - ACE_NEW_RETURN (s, - wchar_t[len + 1], - 0); - return ACE_OS::strsncpy (s, str, len + 1); -} -#endif /* ACE_HAS_WCHAR */ - -const char * -ACE::strend (const char *s) -{ - while (*s++ != '\0') - continue; - - return s; -} - -#if defined ACE_HAS_WCHAR -const wchar_t * -ACE::strend (const wchar_t *s) -{ - while (*s++ != ACE_TEXT_WIDE ('\0')) - continue; - - return s; -} -#endif - -char * -ACE::strnew (const char *s) -{ - if (s == 0) - return 0; - char *t = 0; - ACE_NEW_RETURN (t, - char [ACE_OS::strlen (s) + 1], - 0); - if (t == 0) - return 0; - else - return ACE_OS::strcpy (t, s); -} - -#if defined (ACE_HAS_WCHAR) -wchar_t * -ACE::strnew (const wchar_t *s) -{ - if (s == 0) - return 0; - wchar_t *t = 0; - ACE_NEW_RETURN (t, - wchar_t[ACE_OS::strlen (s) + 1], - 0); - if (t == 0) - return 0; - else - return ACE_OS::strcpy (t, s); -} -#endif /* ACE_HAS_WCHAR */ - -inline static bool equal_char(char a, char b, bool case_sensitive) -{ - if (case_sensitive) - return a == b; - return ACE_OS::ace_tolower(a) == ACE_OS::ace_tolower(b); -} - -bool -ACE::wild_match(const char* str, const char* pat, bool case_sensitive) -{ - if (str == pat) - return true; - if (pat == 0 || str == 0) - return false; - - bool star = false; - const char* s = str; - const char* p = pat; - while (*s != '\0') - { - if (*p == '*') - { - star = true; - pat = p; - while (*++pat == '*') {} - - if (*pat == '\0') - return true; - p = pat; - } - else if (*p == '?') - { - ++s; - ++p; - } - else if (! equal_char(*s, *p, case_sensitive)) - { - if (!star) - return false; - s = ++str; - p = pat; - } - else - { - ++s; - ++p; - } - } - if (*p == '*') - while (*++p == '*') {} - - return *p == '\0'; -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/ACE_crc32.cpp b/dep/src/ace/ACE_crc32.cpp deleted file mode 100644 index 40608e8f7bc..00000000000 --- a/dep/src/ace/ACE_crc32.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// $Id: ACE_crc32.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" - -ACE_RCSID (ace, - ACE_crc32, - "$Id: ACE_crc32.cpp 80826 2008-03-04 14:51:23Z wotte $") - -namespace -{ - /*****************************************************************/ - /* */ - /* CRC LOOKUP TABLE */ - /* ================ */ - /* The following CRC lookup table was generated automagically */ - /* by the Rocksoft^tm Model CRC Algorithm Table Generation */ - /* Program V1.0 using the following model parameters: */ - /* */ - /* Width : 4 bytes. */ - /* Poly : 0x04C11DB7L */ - /* Reverse : TRUE. */ - /* */ - /* For more information on the Rocksoft^tm Model CRC Algorithm, */ - /* see the document titled "A Painless Guide to CRC Error */ - /* Detection Algorithms" by Ross Williams */ - /* (ross@guest.adelaide.edu.au.). This document is likely to be */ - /* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ - /* */ - /*****************************************************************/ - - const ACE_UINT32 crc_table[] = - { - 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, - 0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L, - 0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L, - 0x09B64C2BL, 0x7EB17CBDL, 0xE7B82D07L, 0x90BF1D91L, - 0x1DB71064L, 0x6AB020F2L, 0xF3B97148L, 0x84BE41DEL, - 0x1ADAD47DL, 0x6DDDE4EBL, 0xF4D4B551L, 0x83D385C7L, - 0x136C9856L, 0x646BA8C0L, 0xFD62F97AL, 0x8A65C9ECL, - 0x14015C4FL, 0x63066CD9L, 0xFA0F3D63L, 0x8D080DF5L, - 0x3B6E20C8L, 0x4C69105EL, 0xD56041E4L, 0xA2677172L, - 0x3C03E4D1L, 0x4B04D447L, 0xD20D85FDL, 0xA50AB56BL, - 0x35B5A8FAL, 0x42B2986CL, 0xDBBBC9D6L, 0xACBCF940L, - 0x32D86CE3L, 0x45DF5C75L, 0xDCD60DCFL, 0xABD13D59L, - 0x26D930ACL, 0x51DE003AL, 0xC8D75180L, 0xBFD06116L, - 0x21B4F4B5L, 0x56B3C423L, 0xCFBA9599L, 0xB8BDA50FL, - 0x2802B89EL, 0x5F058808L, 0xC60CD9B2L, 0xB10BE924L, - 0x2F6F7C87L, 0x58684C11L, 0xC1611DABL, 0xB6662D3DL, - 0x76DC4190L, 0x01DB7106L, 0x98D220BCL, 0xEFD5102AL, - 0x71B18589L, 0x06B6B51FL, 0x9FBFE4A5L, 0xE8B8D433L, - 0x7807C9A2L, 0x0F00F934L, 0x9609A88EL, 0xE10E9818L, - 0x7F6A0DBBL, 0x086D3D2DL, 0x91646C97L, 0xE6635C01L, - 0x6B6B51F4L, 0x1C6C6162L, 0x856530D8L, 0xF262004EL, - 0x6C0695EDL, 0x1B01A57BL, 0x8208F4C1L, 0xF50FC457L, - 0x65B0D9C6L, 0x12B7E950L, 0x8BBEB8EAL, 0xFCB9887CL, - 0x62DD1DDFL, 0x15DA2D49L, 0x8CD37CF3L, 0xFBD44C65L, - 0x4DB26158L, 0x3AB551CEL, 0xA3BC0074L, 0xD4BB30E2L, - 0x4ADFA541L, 0x3DD895D7L, 0xA4D1C46DL, 0xD3D6F4FBL, - 0x4369E96AL, 0x346ED9FCL, 0xAD678846L, 0xDA60B8D0L, - 0x44042D73L, 0x33031DE5L, 0xAA0A4C5FL, 0xDD0D7CC9L, - 0x5005713CL, 0x270241AAL, 0xBE0B1010L, 0xC90C2086L, - 0x5768B525L, 0x206F85B3L, 0xB966D409L, 0xCE61E49FL, - 0x5EDEF90EL, 0x29D9C998L, 0xB0D09822L, 0xC7D7A8B4L, - 0x59B33D17L, 0x2EB40D81L, 0xB7BD5C3BL, 0xC0BA6CADL, - 0xEDB88320L, 0x9ABFB3B6L, 0x03B6E20CL, 0x74B1D29AL, - 0xEAD54739L, 0x9DD277AFL, 0x04DB2615L, 0x73DC1683L, - 0xE3630B12L, 0x94643B84L, 0x0D6D6A3EL, 0x7A6A5AA8L, - 0xE40ECF0BL, 0x9309FF9DL, 0x0A00AE27L, 0x7D079EB1L, - 0xF00F9344L, 0x8708A3D2L, 0x1E01F268L, 0x6906C2FEL, - 0xF762575DL, 0x806567CBL, 0x196C3671L, 0x6E6B06E7L, - 0xFED41B76L, 0x89D32BE0L, 0x10DA7A5AL, 0x67DD4ACCL, - 0xF9B9DF6FL, 0x8EBEEFF9L, 0x17B7BE43L, 0x60B08ED5L, - 0xD6D6A3E8L, 0xA1D1937EL, 0x38D8C2C4L, 0x4FDFF252L, - 0xD1BB67F1L, 0xA6BC5767L, 0x3FB506DDL, 0x48B2364BL, - 0xD80D2BDAL, 0xAF0A1B4CL, 0x36034AF6L, 0x41047A60L, - 0xDF60EFC3L, 0xA867DF55L, 0x316E8EEFL, 0x4669BE79L, - 0xCB61B38CL, 0xBC66831AL, 0x256FD2A0L, 0x5268E236L, - 0xCC0C7795L, 0xBB0B4703L, 0x220216B9L, 0x5505262FL, - 0xC5BA3BBEL, 0xB2BD0B28L, 0x2BB45A92L, 0x5CB36A04L, - 0xC2D7FFA7L, 0xB5D0CF31L, 0x2CD99E8BL, 0x5BDEAE1DL, - 0x9B64C2B0L, 0xEC63F226L, 0x756AA39CL, 0x026D930AL, - 0x9C0906A9L, 0xEB0E363FL, 0x72076785L, 0x05005713L, - 0x95BF4A82L, 0xE2B87A14L, 0x7BB12BAEL, 0x0CB61B38L, - 0x92D28E9BL, 0xE5D5BE0DL, 0x7CDCEFB7L, 0x0BDBDF21L, - 0x86D3D2D4L, 0xF1D4E242L, 0x68DDB3F8L, 0x1FDA836EL, - 0x81BE16CDL, 0xF6B9265BL, 0x6FB077E1L, 0x18B74777L, - 0x88085AE6L, 0xFF0F6A70L, 0x66063BCAL, 0x11010B5CL, - 0x8F659EFFL, 0xF862AE69L, 0x616BFFD3L, 0x166CCF45L, - 0xA00AE278L, 0xD70DD2EEL, 0x4E048354L, 0x3903B3C2L, - 0xA7672661L, 0xD06016F7L, 0x4969474DL, 0x3E6E77DBL, - 0xAED16A4AL, 0xD9D65ADCL, 0x40DF0B66L, 0x37D83BF0L, - 0xA9BCAE53L, 0xDEBB9EC5L, 0x47B2CF7FL, 0x30B5FFE9L, - 0xBDBDF21CL, 0xCABAC28AL, 0x53B39330L, 0x24B4A3A6L, - 0xBAD03605L, 0xCDD70693L, 0x54DE5729L, 0x23D967BFL, - 0xB3667A2EL, 0xC4614AB8L, 0x5D681B02L, 0x2A6F2B94L, - 0xB40BBE37L, 0xC30C8EA1L, 0x5A05DF1BL, 0x2D02EF8DL - }; - - /*****************************************************************/ - /* End of CRC Lookup Table */ - /*****************************************************************/ -} - -#define COMPUTE(var, ch) (var) = (crc_table[(var ^ ch) & 0xFF] ^ (var >> 8)) - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_UINT32 -ACE::crc32 (const char *string) -{ - ACE_UINT32 crc = 0xFFFFFFFF; - - for (const char *p = string; - *p != 0; - ++p) - { - COMPUTE (crc, *p); - } - - return ~crc; -} - -ACE_UINT32 -ACE::crc32 (const void *buffer, size_t len, ACE_UINT32 crc) -{ - crc = ~crc; - - for (const char *p = (const char *) buffer, - *e = (const char *) buffer + len; - p != e; - ++p) - { - COMPUTE (crc, *p); - } - - return ~crc; -} - -ACE_UINT32 -ACE::crc32 (const iovec *iov, int len, ACE_UINT32 crc) -{ - crc = ~crc; - - for (int i = 0; i < len; ++i) - { - for (const char *p = (const char *) iov[i].iov_base, - *e = (const char *) iov[i].iov_base + iov[i].iov_len; - p != e; - ++p) - COMPUTE (crc, *p); - } - - return ~crc; -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#undef COMPUTE - diff --git a/dep/src/ace/ACE_crc_ccitt.cpp b/dep/src/ace/ACE_crc_ccitt.cpp deleted file mode 100644 index 4e9b4a2f98e..00000000000 --- a/dep/src/ace/ACE_crc_ccitt.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// $Id: ACE_crc_ccitt.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ACE.h" - -ACE_RCSID (ace, - ACE_crc_ccitt, - "$Id: ACE_crc_ccitt.cpp 80826 2008-03-04 14:51:23Z wotte $") - -namespace -{ - /*****************************************************************/ - /* */ - /* CRC LOOKUP TABLE */ - /* ================ */ - /* The following CRC lookup table was generated automagically */ - /* by the Rocksoft^tm Model CRC Algorithm Table Generation */ - /* Program V1.0 using the following model parameters: */ - /* */ - /* Width : 2 bytes. */ - /* Poly : 0x1021 */ - /* Reverse : TRUE. */ - /* */ - /* For more information on the Rocksoft^tm Model CRC Algorithm, */ - /* see the document titled "A Painless Guide to CRC Error */ - /* Detection Algorithms" by Ross Williams */ - /* (ross@guest.adelaide.edu.au.). This document is likely to be */ - /* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ - /* */ - /*****************************************************************/ - - const ACE_UINT16 crc_table[] = - { - 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, - 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7, - 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E, - 0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876, - 0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD, - 0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5, - 0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C, - 0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974, - 0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB, - 0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3, - 0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A, - 0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72, - 0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9, - 0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1, - 0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738, - 0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70, - 0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7, - 0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF, - 0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036, - 0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E, - 0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5, - 0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD, - 0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134, - 0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C, - 0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3, - 0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB, - 0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232, - 0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A, - 0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1, - 0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9, - 0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330, - 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78 - }; - - /*****************************************************************/ - /* End of CRC Lookup Table */ - /*****************************************************************/ -} - -#define COMPUTE(var, ch) (var) = (crc_table[(var ^ ch) & 0xFF] ^ (var >> 8)) - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_UINT16 -ACE::crc_ccitt (const char *string) -{ - ACE_UINT16 crc = 0xFFFF; - - for (const char *p = string; - *p != 0; - ++p) - { - COMPUTE (crc, *p); - } - - return ~crc; -} - -ACE_UINT16 -ACE::crc_ccitt (const void *buffer, size_t len, ACE_UINT16 crc) -{ - crc = ~crc; - - for (const char *p = (const char *) buffer, - *e = (const char *) buffer + len; - p != e; - ++p) - { - COMPUTE (crc, *p); - } - - return ~crc; -} - -ACE_UINT16 -ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc) -{ - crc = ~crc; - - for (int i = 0; i < len; ++i) - { - for (const char *p = (const char *) iov[i].iov_base, - *e = (const char *) iov[i].iov_base + iov[i].iov_len; - p != e; - ++p) - COMPUTE (crc, *p); - } - - return ~crc; -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#undef COMPUTE - diff --git a/dep/src/ace/ARGV.cpp b/dep/src/ace/ARGV.cpp deleted file mode 100644 index a30809b2ec1..00000000000 --- a/dep/src/ace/ARGV.cpp +++ /dev/null @@ -1,384 +0,0 @@ -// $Id: ARGV.cpp 81374 2008-04-16 13:07:47Z iliyan $ - -#ifndef ACE_ARGV_CPP -#define ACE_ARGV_CPP - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_Memory.h" - -#if !defined (__ACE_INLINE__) -#include "ace/ARGV.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, ARGV, "$Id: ARGV.cpp 81374 2008-04-16 13:07:47Z iliyan $") - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_ARGV_Queue_Entry) -ACE_ALLOC_HOOK_DEFINE (ACE_ARGV) - -template -void -ACE_ARGV_Queue_Entry_T::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ARGV_Queue_Entry_T::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("arg_ = %s"), this->arg_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("quote_arg_ = %d"), (int)this->quote_arg_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template -void -ACE_ARGV_T::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ARGV_T::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("argc_ = %d"), this->argc_)); - - ACE_ARGV *this_obj = const_cast (this); - - for (int i = 0; i < this->argc_; i++) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\nargv_[%i] = %s"), - i, - this_obj->argv ()[i])); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nbuf = %s\n"), this->buf_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Creates this->argv_ out of this->buf_. New memory is allocated for -// each element of the array. This is used by the array-to-string -// style constructor and for creating this->argv_ when in iterative -// mode. - -template -int -ACE_ARGV_T::string_to_argv (void) -{ - ACE_TRACE ("ACE_ARGV_T::string_to_argv"); - - return ACE_OS::string_to_argv (this->buf_, - this->argc_, - this->argv_, - this->substitute_env_args_); -} - -template -ACE_ARGV_T::ACE_ARGV_T (const CHAR_TYPE buf[], - bool substitute_env_args) - : substitute_env_args_ (substitute_env_args), - iterative_ (false), - argc_ (0), - argv_ (0), - buf_ (0), - length_ (0), - queue_ () -{ - ACE_TRACE ("ACE_ARGV_T::ACE_ARGV_T CHAR_TYPE[] to CHAR_TYPE *[]"); - - if (buf == 0 || buf[0] == 0) - return; - - // Make an internal copy of the string. - ACE_NEW (this->buf_, - CHAR_TYPE[ACE_OS::strlen (buf) + 1]); - ACE_OS::strcpy (this->buf_, buf); - - // Create this->argv_. - if (this->string_to_argv () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("string_to_argv"))); -} - -template -ACE_ARGV_T::ACE_ARGV_T (CHAR_TYPE *argv[], - bool substitute_env_args, - bool quote_arg) - : substitute_env_args_ (substitute_env_args), - iterative_ (false), - argc_ (0), - argv_ (0), - buf_ (0), - length_ (0), - queue_ () -{ - ACE_TRACE ("ACE_ARGV_T::ACE_ARGV_T CHAR_TYPE*[] to CHAR_TYPE[]"); - - if (argv == 0 || argv[0] == 0) - return; - - this->argc_ = ACE_OS::argv_to_string (argv, - this->buf_, - substitute_env_args, - quote_arg); -} - -template -ACE_ARGV_T::ACE_ARGV_T (int argc, - CHAR_TYPE *argv[], - bool substitute_env_args, - bool quote_arg) - : substitute_env_args_ (substitute_env_args), - iterative_ (false), - argc_ (0), - argv_ (0), - buf_ (0), - length_ (0), - queue_ () -{ - ACE_TRACE ("ACE_ARGV_T::ACE_ARGV_T int,CHAR_TYPE*[] to CHAR_TYPE[]"); - - this->argc_ = ACE_OS::argv_to_string (argc, - argv, - this->buf_, - substitute_env_args, - quote_arg); -} - - -template -ACE_ARGV_T::ACE_ARGV_T (CHAR_TYPE *first_argv[], - CHAR_TYPE *second_argv[], - bool substitute_env_args, - bool quote_args) - : substitute_env_args_ (substitute_env_args), - iterative_ (false), - argc_ (0), - argv_ (0), - buf_ (0), - length_ (0), - queue_ () -{ - ACE_TRACE ("ACE_ARGV_T::ACE_ARGV_T CHAR_TYPE*[] + CHAR_TYPE *[] to CHAR_TYPE[]"); - - int first_argc = 0; - int second_argc = 0; - - CHAR_TYPE *first_buf = 0; - CHAR_TYPE *second_buf = 0; - - // convert the first argv to a string - if (first_argv != 0 && first_argv[0] != 0) - { - first_argc = ACE_OS::argv_to_string (first_argv, - first_buf, - substitute_env_args, - quote_args); - } - - // convert the second argv to a string - if (second_argv != 0 && second_argv[0] != 0) - { - second_argc = ACE_OS::argv_to_string (second_argv, - second_buf, - substitute_env_args, - quote_args); - } - - // Add the number of arguments in both the argvs. - this->argc_ = first_argc + second_argc; - - size_t buf_len = - ACE_OS::strlen (first_buf) + ACE_OS::strlen (second_buf) + 1; - - // Allocate memory to the lenght of the combined argv string. - ACE_NEW (this->buf_, - CHAR_TYPE[buf_len + 1]); - - // copy the first argv string to the buffer - ACE_OS::strcpy (this->buf_, first_buf); - - // concatenate the second argv string to the buffer - ACE_OS::strcat (this->buf_, second_buf); - - // Delete the first and second buffers - delete [] first_buf; - delete [] second_buf; -} - -template -ACE_ARGV_T::ACE_ARGV_T (bool substitute_env_args) - : substitute_env_args_ (substitute_env_args), - iterative_ (true), - argc_ (0), - argv_ (0), - buf_ (0), - length_ (0), - queue_ () -{ - ACE_TRACE ("ACE_ARGV_T::ACE_ARGV_T Iterative"); - - // Nothing to do yet -- the user puts in arguments via add () -} - -template -int -ACE_ARGV_T::add (const CHAR_TYPE *next_arg, bool quote_arg) -{ - // Only allow this to work in the "iterative" verion -- the - // ACE_ARGVs created with the one argument constructor. - if (!this->iterative_) - { - errno = EINVAL; - return -1; - } - - this->length_ += ACE_OS::strlen (next_arg); - if (quote_arg && ACE_OS::strchr (next_arg, ' ') != 0) - { - this->length_ += 2; - if (ACE_OS::strchr (next_arg, '"') != 0) - for (const CHAR_TYPE * p = next_arg; *p != '\0'; ++p) - if (*p == '"') ++this->length_; - } - else - { - quote_arg = false; - } - - // Put the new argument at the end of the queue. - if (this->queue_.enqueue_tail (ACE_ARGV_Queue_Entry_T (next_arg, quote_arg)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Can't add more to ARGV queue")), - -1); - - ++this->argc_; - - // Wipe argv_ and buf_ away so that they will be recreated if the - // user calls argv () or buf (). - if (this->argv_ != 0) - { - for (int i = 0; this->argv_[i] != 0; i++) - ACE_OS::free ((void *) this->argv_[i]); - - delete [] this->argv_; - this->argv_ = 0; - } - - delete [] this->buf_; - this->buf_ = 0; - - return 0; -} - -template -int -ACE_ARGV_T::add (CHAR_TYPE *argv[], bool quote_args) -{ - for (int i = 0; argv[i] != 0; i++) - if (this->add (argv[i], quote_args) == -1) - return -1; - - return 0; -} - -// Free up argv_ and buf_ - -template -ACE_ARGV_T::~ACE_ARGV_T (void) -{ - ACE_TRACE ("ACE_ARGV_T::~ACE_ARGV_T"); - - if (this->argv_ != 0) - for (int i = 0; this->argv_[i] != 0; i++) - ACE_OS::free ((void *) this->argv_[i]); - - delete [] this->argv_; - delete [] this->buf_; -} - -// Create buf_ out of the queue_. This is only used in the -// "iterative" mode. - -template -int -ACE_ARGV_T::create_buf_from_queue (void) -{ - ACE_TRACE ("ACE_ARGV_T::create_buf_from_queue"); - - // If the are no arguments, don't do anything - if (this->argc_ <= 0) - return -1; - - delete [] this->buf_; - - ACE_NEW_RETURN (this->buf_, - CHAR_TYPE[this->length_ + this->argc_], - -1); - - // Get an iterator over the queue - ACE_Unbounded_Queue_Iterator > iter (this->queue_); - - ACE_ARGV_Queue_Entry_T *arg = 0; - CHAR_TYPE *ptr = this->buf_; - size_t len; - - while (!iter.done ()) - { - // Get next argument from the queue. - iter.next (arg); - iter.advance (); - - if (arg->quote_arg_) - { - *ptr++ = '"'; - if (ACE_OS::strchr (arg->arg_, '"') != 0) - { - CHAR_TYPE prev = 0; - for (const CHAR_TYPE * p = arg->arg_; *p != '\0'; ++p) - { - if (*p == '"' && prev != '\\') *ptr++ = '\\'; - prev = *ptr++ = *p; - } - } - else - { - len = ACE_OS::strlen (arg->arg_); - // Copy the argument into buf_ - ACE_OS::memcpy ((void *) ptr, - (const void *) (arg->arg_), - len * sizeof (CHAR_TYPE)); - // Move the pointer down. - ptr += len; - } - *ptr++ = '"'; - } - else - { - len = ACE_OS::strlen (arg->arg_); - // Copy the argument into buf_ - ACE_OS::memcpy ((void *) ptr, - (const void *) (arg->arg_), - len * sizeof (CHAR_TYPE)); - // Move the pointer down. - ptr += len; - } - - // Put in an argument separating space. - *ptr++ = ' '; - } - - // Put in the NUL terminator - ptr[-1] = '\0'; - - return 0; -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ARGV_CPP */ - diff --git a/dep/src/ace/ATM_Acceptor.cpp b/dep/src/ace/ATM_Acceptor.cpp deleted file mode 100644 index af2e0e1f695..00000000000 --- a/dep/src/ace/ATM_Acceptor.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// $Id: ATM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ATM_Acceptor.h" - -ACE_RCSID(ace, ATM_Acceptor, "$Id: ATM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_HAS_ATM) - -#if defined (ACE_HAS_LINUX_ATM) -#include /**/ "linux/atmdev.h" -#endif /* ACE_HAS_LINUX_ATM */ - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_Acceptor.inl" -#endif /* __ACE_INLINE__ */ - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Put the actual definitions of the ACE_ATM_Request and -// ACE_ATM_Request_Queue classes here to hide them from clients... - -ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Acceptor) - -ACE_ATM_Acceptor::ACE_ATM_Acceptor (void) -{ - ACE_TRACE ("ACE_ATM_Acceptor::ACE_ATM_Acceptor"); -} - -ACE_ATM_Acceptor::~ACE_ATM_Acceptor (void) -{ - ACE_TRACE ("ACE_ATM_Acceptor::~ACE_ATM_Acceptor"); -} - -int -ACE_ATM_Acceptor::get_local_addr (ACE_ATM_Addr &local_addr) -{ - ACE_TRACE ("ACE_ATM_Acceptor::get_local_addr"); - -#if defined (ACE_HAS_FORE_ATM_WS2) - unsigned long ret = 0; - DWORD deviceID = 0; - ATM_ADDRESS addr; - struct sockaddr_atm *laddr; - - if (::WSAIoctl ((int) ((ACE_SOCK_Acceptor *)this) -> get_handle (), - SIO_GET_ATM_ADDRESS, - (LPVOID) &deviceID, - sizeof (DWORD), - (LPVOID)&addr, - sizeof (ATM_ADDRESS), - &ret, - 0, - 0) == SOCKET_ERROR) { - ACE_OS::printf ("ATM_Acceptor (get_local_addr): WSIoctl: %d\n", - ::WSAGetLastError ()); - return -1; - } - - laddr = (struct sockaddr_atm *)local_addr.get_addr (); - ACE_OS::memcpy ((void *)& (laddr -> satm_number), - (void *)&addr, - ATM_ADDR_SIZE - 1); - - return 0; -#elif defined (ACE_HAS_FORE_ATM_XTI) - ACE_UNUSED_ARG (local_addr); - - return 0; -#elif defined (ACE_HAS_LINUX_ATM) - ATM_Addr *myaddr = (ATM_Addr *)local_addr.get_addr (); - int addrlen = sizeof (myaddr->sockaddratmsvc); - - if (ACE_OS::getsockname (acceptor_.get_handle (), - (struct sockaddr *) & (myaddr->sockaddratmsvc), - &addrlen) < 0) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ATM_Acceptor (get_local_addr): ioctl: %d\n"), - errno)); - return -1; - } - - return (0); -#else - ACE_UNUSED_ARG (local_addr); - - return 0; -#endif /* ACE_HAS_FORE_ATM_WS2 && ACE_HAS_FORE_ATM_XTI */ -} - -ACE_HANDLE -ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, - int backlog, - ACE_ATM_Params params) -{ - ACE_TRACE ("ACE_ATM_Acceptor::open"); -#if defined (ACE_HAS_FORE_ATM_XTI) - ACE_HANDLE handle = acceptor_.open (remote_sap, - params.get_reuse_addr (), - params.get_oflag (), - params.get_info (), - backlog, - params.get_device ()); - return (handle == ACE_INVALID_HANDLE ? -1 : 0); -#elif defined (ACE_HAS_FORE_ATM_WS2) - struct sockaddr_atm local_atm_addr; - ACE_HANDLE ret; - DWORD flags = 0; - - /* Create a local endpoint of communication */ - - // Only leaves can listen. - flags = ACE_FLAG_MULTIPOINT_C_LEAF | ACE_FLAG_MULTIPOINT_D_LEAF; - - if ((ret = ACE_OS::socket (AF_ATM, - SOCK_RAW, - ATMPROTO_AAL5, - 0, - 0, - flags)) - == ACE_INVALID_HANDLE) { - ACE_OS::printf ("Acceptor (open): socket %d\n", - ::WSAGetLastError ()); - return (ret); - } - - ((ACE_SOCK_Acceptor *)this) -> set_handle (ret); - - /* Set up the address information to become a server */ - ACE_OS::memset ((void *) &local_atm_addr, 0, sizeof local_atm_addr); - local_atm_addr.satm_family = AF_ATM; - local_atm_addr.satm_number.AddressType = SAP_FIELD_ANY_AESA_REST; - local_atm_addr.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] - = ((ACE_ATM_Addr *)&remote_sap) -> get_selector (); - local_atm_addr.satm_blli.Layer2Protocol = SAP_FIELD_ANY; - local_atm_addr.satm_blli.Layer3Protocol = SAP_FIELD_ABSENT; - local_atm_addr.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT; - - /* Associate address with endpoint */ - if (ACE_OS::bind (((ACE_SOCK_Acceptor *)this) -> get_handle (), - reinterpret_cast (&local_atm_addr), - sizeof local_atm_addr) == -1) { - ACE_OS::printf ("Acceptor (open): bind %d\n", ::WSAGetLastError ()); - return (ACE_INVALID_HANDLE); - } - - /* Make endpoint listen for service requests */ - if (ACE_OS::listen (( (ACE_SOCK_Acceptor *)this) -> get_handle (), - backlog) - == -1) { - ACE_OS::printf ("Acceptor (open): listen %d\n", ::WSAGetLastError ()); - return (ACE_INVALID_HANDLE); - } - - return 0; -#elif defined (ACE_HAS_LINUX_ATM) - //we need to set the qos before binding to the socket - //use remote_sap as local_sap - - ACE_ATM_Addr local_sap; - ATM_Addr *local_sap_addr = (ATM_Addr*)local_sap.get_addr (); - ACE_ATM_QoS def_qos; - ATM_QoS qos = def_qos.get_qos (); - - ACE_HANDLE handle; - if ((handle = ACE_OS::socket (params.get_protocol_family (), - params.get_type (), - params.get_protocol (), - params.get_protocol_info (), - params.get_sock_group (), - params.get_flags () - )) - == ACE_INVALID_HANDLE) { - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("Acceptor (socket): socket %d\n"), - errno); - return (ACE_INVALID_HANDLE); - } - - ((ACE_SOCK_Acceptor *)this) -> set_handle (handle); - if (ACE_OS::setsockopt (handle, - SOL_ATM, - SO_ATMQOS, - reinterpret_cast (&qos), - sizeof (qos)) < 0) { - ACE_OS::printf ("Acceptor (setsockopt): setsockopt:%d\n", - errno); - } - - struct atmif_sioc req; - struct sockaddr_atmsvc aux_addr[1024]; - - req.number = 0; - req.arg = aux_addr; - req.length = sizeof (aux_addr); - if (ACE_OS::ioctl (handle, - ATM_GETADDR, - &req) < 0) { - ACE_OS::perror ("Acceptor (setsockopt): ioctl:"); - } - else { - local_sap_addr->sockaddratmsvc = aux_addr[0]; - } - local_sap.set_selector (( (ACE_ATM_Addr*)&remote_sap)->get_selector ()); - - if (ACE_OS::bind (handle, - reinterpret_cast ( - &(local_sap_addr->sockaddratmsvc)), - sizeof (local_sap_addr->sockaddratmsvc) - ) == -1) { - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("Acceptor (open): bind %d\n"), - errno); - return -1; - } - // Make endpoint listen for service requests - if (ACE_OS::listen (handle, - backlog) - == -1) { - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("Acceptor (listen): listen %d\n"), - errno); - return -1; - } - - return 0; -#else - ACE_UNUSED_ARG (remote_sap); - ACE_UNUSED_ARG (backlog); - ACE_UNUSED_ARG (params); -#endif /* ACE_HAS_FORE_ATM_XTI/ACE_HAS_FORE_ATM_WS2/ACE_HAS_LINUX_ATM */ -} - -int -ACE_ATM_Acceptor::accept (ACE_ATM_Stream &new_sap, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle, - ACE_ATM_Params params, - ACE_ATM_QoS qos) -{ - ACE_TRACE ("ACE_ATM_Acceptor::accept"); -#if defined (ACE_HAS_FORE_ATM_XTI) - ATM_QoS optbuf = qos.get_qos (); - - return (acceptor_.accept (new_sap.get_stream (), - remote_addr, - timeout, - restart, - reset_new_handle, - params.get_rw_flag (), - params.get_user_data (), - &optbuf)); -#elif defined (ACE_HAS_FORE_ATM_WS2) - ACE_HANDLE n_handle; - ACE_HANDLE s_handle = ((ACE_SOCK_Acceptor *) this) -> get_handle (); - struct sockaddr_atm *cli_addr - = (struct sockaddr_atm *)remote_addr -> get_addr (); - int caddr_len = sizeof (struct sockaddr_atm); - - do { - n_handle = ACE_OS::accept (s_handle, - reinterpret_cast (cli_addr), - &caddr_len); - } while (n_handle == ACE_INVALID_HANDLE && errno == EINTR); - - ((ACE_ATM_Addr *)remote_addr) -> set (cli_addr, - ((ACE_ATM_Addr *)remote_addr) -> get_selector ()); - ((ACE_IPC_SAP *)&new_sap) -> set_handle (n_handle); - - return 0; -#elif defined (ACE_HAS_LINUX_ATM) - ACE_UNUSED_ARG (params); - - ACE_HANDLE s_handle = ((ACE_SOCK_Acceptor *) this) -> get_handle (); - struct atm_qos accept_qos = qos.get_qos (); - - if (ACE_OS::setsockopt (s_handle, - SOL_ATM, - SO_ATMQOS, - reinterpret_cast (&accept_qos), - sizeof (accept_qos)) < 0) { - ACE_OS::printf ("Acceptor (accept): error setting Qos"); - } - - return (acceptor_.accept (new_sap.get_stream (), - remote_addr, - timeout, - restart, - reset_new_handle)); -#else - ACE_UNUSED_ARG (new_sap); - ACE_UNUSED_ARG (remote_addr); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (restart); - ACE_UNUSED_ARG (reset_new_handle); - ACE_UNUSED_ARG (params); - ACE_UNUSED_ARG (qos); - return (0); -#endif /* ACE_HAS_FORE_ATM_XTI */ -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - diff --git a/dep/src/ace/ATM_Addr.cpp b/dep/src/ace/ATM_Addr.cpp deleted file mode 100644 index 033816743ea..00000000000 --- a/dep/src/ace/ATM_Addr.cpp +++ /dev/null @@ -1,522 +0,0 @@ -// $Id: ATM_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ - -// Defines the Internet domain address family address format. - -#include "ace/ATM_Addr.h" -#if defined (ACE_HAS_ATM) - -#include "ace/Log_Msg.h" - -#if defined (ACE_HAS_FORE_ATM_WS2) -#include /**/ "forews2.h" -#endif /* ACE_HAS_FORE_ATM_WS2 */ - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_Addr.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, ATM_Addr, "$Id: ATM_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Addr) - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) -#define BHLI_MAGIC "FORE_ATM" -// This is line rate in cells/s for an OC-3 MM interface. -const long ACE_ATM_Addr::LINE_RATE = 353207; -const int ACE_ATM_Addr::OPT_FLAGS_CPID = 0x1; -const int ACE_ATM_Addr::OPT_FLAGS_PMP = 0x2; -const int ACE_ATM_Addr::DEFAULT_SELECTOR = 0x99; -#elif defined (ACE_HAS_LINUX_ATM) -//pbrandao:for Linux: -//pbrandao:for now stick with current definitions -//pbrandao:see if later need to change -const long ACE_ATM_Addr::LINE_RATE = 353207; -const int ACE_ATM_Addr::OPT_FLAGS_CPID = 0; -const int ACE_ATM_Addr::OPT_FLAGS_PMP = 0; -const int ACE_ATM_Addr::DEFAULT_SELECTOR = 0x99; -#else -const long ACE_ATM_Addr::LINE_RATE = 0L; -const int ACE_ATM_Addr::OPT_FLAGS_CPID = 0; -const int ACE_ATM_Addr::OPT_FLAGS_PMP = 0; -const int ACE_ATM_Addr::DEFAULT_SELECTOR = 0x0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - -// Default constructor - -ACE_ATM_Addr::ACE_ATM_Addr (u_char selector) -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - : ACE_Addr (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - : ACE_Addr (PF_ATMSVC, -#else - : ACE_Addr (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - sizeof this->atm_addr_) -{ - // ACE_TRACE ("ACE_ATM_Addr::ACE_ATM_Addr"); - (void) ACE_OS::memset ((void *) &this->atm_addr_, - 0, - sizeof this->atm_addr_); - this->init (selector); -} - -// Copy constructor. - -ACE_ATM_Addr::ACE_ATM_Addr (const ACE_ATM_Addr &sap, - u_char selector) -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - : ACE_Addr (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - : ACE_Addr (PF_ATMSVC, -#else - : ACE_Addr (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - sizeof this->atm_addr_) -{ - ACE_TRACE ("ACE_ATM_Addr::ACE_ATM_Addr"); - this->set (sap, selector); -#if defined (ACE_HAS_LINUX_ATM) - this->atm_addr_.sockaddratmsvc.sas_family = PF_ATMSVC; - this->atm_addr_.atmsap.blli[0].l3_proto = ATM_L3_NONE; - this->atm_addr_.atmsap.blli[0].l2_proto = ATM_L2_NONE; - this->atm_addr_.atmsap.bhli.hl_type = ATM_HL_NONE; -#endif /* ACE_HAS_LINUX_ATM */ -} - -ACE_ATM_Addr::ACE_ATM_Addr (const ATM_Addr *sap, - u_char selector) -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - : ACE_Addr (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - : ACE_Addr (PF_ATMSVC, -#else - : ACE_Addr (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - sizeof this->atm_addr_) -{ - ACE_TRACE ("ACE_ATM_Addr::ACE_ATM_Addr"); - this->set (sap, selector); -} - -ACE_ATM_Addr::ACE_ATM_Addr (const ACE_TCHAR sap[], - u_char selector) -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - : ACE_Addr (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - : ACE_Addr (PF_ATMSVC, -#else - : ACE_Addr (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - sizeof this->atm_addr_) -{ - ACE_TRACE ("ACE_ATM_Addr::ACE_ATM_Addr"); - this->set (sap, selector); -} - -ACE_ATM_Addr::~ACE_ATM_Addr (void) -{ -} - -// Return the address. - -void * -ACE_ATM_Addr::get_addr (void) const -{ - ACE_TRACE ("ACE_ATM_Addr::get_addr"); - return (void *) &this->atm_addr_; -} - -void -ACE_ATM_Addr::init (u_char selector) -{ -#if defined (ACE_HAS_FORE_ATM_XTI) - // Note: this approach may be FORE implementation-specific. When we - // bind with tag_addr ABSENT and tag_selector PRESENT, only the - // selector (i.e. address[19]) is used by the TP. The rest of the - // local address is filled in by the TP and can be obtained via the - // 'ret' parameter or with t_getname ()/t_getprotaddr (). - - atm_addr_.addressType = (u_int16_t) AF_ATM; - - atm_addr_.sap.t_atm_sap_addr.SVE_tag_addr = (int8_t) T_ATM_ABSENT; - atm_addr_.sap.t_atm_sap_addr.SVE_tag_selector = (int8_t) T_ATM_PRESENT; - - atm_addr_.sap.t_atm_sap_addr.address_format = (u_int8_t) T_ATM_ENDSYS_ADDR; - atm_addr_.sap.t_atm_sap_addr.address_length = ATMNSAP_ADDR_LEN; - atm_addr_.sap.t_atm_sap_addr.address[ATMNSAP_ADDR_LEN - 1] = selector; - - atm_addr_.sap.t_atm_sap_layer2.SVE_tag = (int8_t) T_ATM_ABSENT; - atm_addr_.sap.t_atm_sap_layer3.SVE_tag = (int8_t) T_ATM_ABSENT; - - atm_addr_.sap.t_atm_sap_appl.SVE_tag = (int8_t) T_ATM_PRESENT; - atm_addr_.sap.t_atm_sap_appl.ID_type = (u_int8_t) T_ATM_USER_APP_ID; - - ACE_OS::memcpy (atm_addr_.sap.t_atm_sap_appl.ID.user_defined_ID, - BHLI_MAGIC, - sizeof atm_addr_.sap.t_atm_sap_appl.ID); -#elif defined (ACE_HAS_FORE_ATM_WS2) - ACE_OS::memset ((void *)&atm_addr_, 0, sizeof atm_addr_); - atm_addr_.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] = (char)selector; - atm_addr_.satm_family = AF_ATM; - atm_addr_.satm_number.AddressType = ATM_NSAP; - atm_addr_.satm_number.NumofDigits = ATM_ADDR_SIZE; - atm_addr_.satm_blli.Layer2Protocol = SAP_FIELD_ABSENT; - atm_addr_.satm_blli.Layer3Protocol = SAP_FIELD_ABSENT; - atm_addr_.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT; - - // Need to know the correspondence. - //atm_addr_.sap.t_atm_sap_appl.SVE_tag = (int8_t) T_ATM_PRESENT; - //atm_addr_.sap.t_atm_sap_appl.ID_type = (u_int8_t) T_ATM_USER_APP_ID; - //ACE_OS::memcpy (atm_addr_.sap.t_atm_sap_appl.ID.user_defined_ID, - // BHLI_MAGIC, - // sizeof atm_addr_.sap.t_atm_sap_appl.ID); -#elif defined (ACE_HAS_LINUX_ATM) - atm_addr_.sockaddratmsvc.sas_family = AF_ATMSVC; - atm_addr_.sockaddratmsvc.sas_addr.prv[ATM_ESA_LEN - 1] = (char)selector; - atm_addr_.atmsap.blli[0].l3_proto = ATM_L3_NONE; - atm_addr_.atmsap.blli[0].l2_proto = ATM_L2_NONE; - atm_addr_.atmsap.bhli.hl_type = ATM_HL_NONE; -#else - ACE_UNUSED_ARG (selector); -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -int -ACE_ATM_Addr::set (const ACE_ATM_Addr &sap, - u_char selector) -{ - ACE_TRACE ("ACE_ATM_Addr::set"); - - this->init (selector); - - this->ACE_Addr::base_set (sap.get_type (), - sap.get_size ()); - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - ACE_ASSERT (sap.get_type () == AF_ATM); -#elif defined (ACE_HAS_LINUX_ATM) - ACE_ASSERT (sap.get_type () == PF_ATMSVC); -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ - - (void) ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) &sap.atm_addr_, - sizeof this->atm_addr_); - return 0; -} - -int -ACE_ATM_Addr::set (const ATM_Addr *sap, - u_char selector) -{ - ACE_TRACE ("ACE_ATM_Addr::set"); - - this->init (selector); - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - this->ACE_Addr::base_set (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - this->ACE_Addr::base_set (PF_ATMSVC, -#else - this->ACE_Addr::base_set (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ - sizeof (*sap)); - - (void) ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) sap, - sizeof this->atm_addr_); - return 0; -} - -int -ACE_ATM_Addr::set (const ACE_TCHAR address[], - u_char selector) -{ - ACE_TRACE ("ACE_ATM_Addr::set"); - int ret; - - this->init (selector); - -#if defined (ACE_HAS_FORE_ATM_XTI) - atm_addr_.sap.t_atm_sap_addr.SVE_tag_addr = - (int8_t) T_ATM_PRESENT; -#endif /* ACE_HAS_FORE_ATM_XTI */ - - ret = this -> string_to_addr (address); - this -> set_selector (selector); - return ret; -} - -// Transform the string into the current addressing format. - -int -ACE_ATM_Addr::string_to_addr (const ACE_TCHAR sap[]) -{ - ACE_TRACE ("ACE_ATM_Addr::string_to_addr"); - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - this->ACE_Addr::base_set (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - this->ACE_Addr::base_set (PF_ATMSVC, -#else - this->ACE_Addr::base_set (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - sizeof this->atm_addr_); -#if defined (ACE_HAS_FORE_ATM_XTI) - struct hostent *entry; - struct atmnsap_addr *nsap; - - // Yow, someone gave us a NULL ATM address! - if (sap == 0) - { - errno = EINVAL; - return -1; - } - else if ((entry = gethostbyname_atmnsap ((ACE_TCHAR *)sap)) != 0) - { - ACE_OS::memcpy (atm_addr_.sap.t_atm_sap_addr.address, - entry->h_addr_list[0], - ATMNSAP_ADDR_LEN - 1); - } - else if ((nsap = atmnsap_addr (sap)) != 0) - { - ACE_OS::memcpy (atm_addr_.sap.t_atm_sap_addr.address, - nsap->atmnsap, - ATMNSAP_ADDR_LEN); - } - else { - errno = EINVAL; - return -1; - } -#elif defined (ACE_HAS_FORE_ATM_WS2) - DWORD dwValue; - HANDLE hLookup; - WSAQUERYSETW qsRestrictions; - CSADDR_INFO csaBuffer; - WCHAR tmpWStr[100]; - - MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, sap, -1, tmpWStr, 100); - - csaBuffer.LocalAddr.iSockaddrLength = sizeof (struct sockaddr_atm); - csaBuffer.LocalAddr.lpSockaddr = (struct sockaddr *)&atm_addr_; - csaBuffer.RemoteAddr.iSockaddrLength = sizeof (struct sockaddr_atm); - csaBuffer.RemoteAddr.lpSockaddr = (struct sockaddr *)&atm_addr_; - - qsRestrictions.dwSize = sizeof (WSAQUERYSETW); - qsRestrictions.lpszServiceInstanceName = 0; - qsRestrictions.lpServiceClassId = &FORE_NAME_CLASS; - qsRestrictions.lpVersion = 0; - qsRestrictions.lpszComment = 0; - qsRestrictions.dwNameSpace = FORE_NAME_SPACE; - qsRestrictions.lpNSProviderId = 0; - qsRestrictions.lpszContext = L""; - qsRestrictions.dwNumberOfProtocols = 0; - qsRestrictions.lpafpProtocols = 0; - qsRestrictions.lpszQueryString = tmpWStr; - qsRestrictions.dwNumberOfCsAddrs = 1; - qsRestrictions.lpcsaBuffer = &csaBuffer; - qsRestrictions.lpBlob = 0; //&blob; - - if (::WSALookupServiceBeginW (&qsRestrictions, LUP_RETURN_ALL, &hLookup) - == SOCKET_ERROR) { - ACE_OS::printf ("Error: WSALookupServiceBeginW failed! %d\n", - ::WSAGetLastError ()); - return -1; - } - - dwValue = sizeof (WSAQUERYSETW); - - if (::WSALookupServiceNextW (hLookup, 0, &dwValue, &qsRestrictions) - == SOCKET_ERROR) { - if (WSAGetLastError () != WSA_E_NO_MORE) { - ACE_OS::printf ("Error: WSALookupServiceNextW failed! %d\n", - ::WSAGetLastError ()); - return -1; - } - } - - if (WSALookupServiceEnd (hLookup) == SOCKET_ERROR) { - ACE_OS::printf ("Error : WSALookupServiceEnd failed! %d \n", - ::WSAGetLastError ()); - errno = EINVAL; - return -1; - } -#elif defined (ACE_HAS_LINUX_ATM) - if (sap == 0 || !ACE_OS::strcmp (sap,"")) { - errno = EINVAL; - return -1; - } - - if (text2atm ((ACE_TCHAR *)sap, - (struct sockaddr *)& (atm_addr_.sockaddratmsvc), - sizeof (atm_addr_.sockaddratmsvc), - T2A_SVC | T2A_NAME) < 0) { - ACE_DEBUG (LM_DEBUG, - "Error : text2atm failed!\n"); - errno = EINVAL; - return -1; - } -#else - ACE_UNUSED_ARG (sap); - - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ -} - -// Transform the current address into string format. - -int -ACE_ATM_Addr::addr_to_string (ACE_TCHAR addr[], - size_t addrlen) const -{ - ACE_TRACE ("ACE_ATM_Addr::addr_to_string"); - -#if defined (ACE_HAS_FORE_ATM_XTI) - ACE_TCHAR buffer[MAXNAMELEN + 1]; - struct atmnsap_addr nsap; - ACE_OS::memcpy (nsap.atmnsap, - atm_addr_.sap.t_atm_sap_addr.address, - ATMNSAP_ADDR_LEN); - ACE_OS::sprintf (buffer, - ACE_TEXT ("%s"), - atmnsap_ntoa (nsap)); - - size_t total_len = ACE_OS::strlen (buffer) + sizeof ('\0'); - - if (addrlen < total_len) - return -1; - else - ACE_OS::strcpy (addr, buffer); - - return 0; -#elif defined (ACE_HAS_FORE_ATM_WS2) - ACE_TCHAR buffer[MAXNAMELEN + 1]; - int i; - - if (addrlen < ATM_ADDR_SIZE + 1) - return -1; - - for (i = 0; i < ATM_ADDR_SIZE; i++) { - buffer[ i * 3 ] = '\0'; - ACE_OS::sprintf (buffer, ACE_TEXT ("%s%02x."), - buffer, - atm_addr_.satm_number.Addr[ i ]); - } - - buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; - ACE_OS::strcpy (addr, buffer); - - return 0; -#elif defined (ACE_HAS_LINUX_ATM) - ACE_TCHAR buffer[MAX_ATM_ADDR_LEN + 1]; - int total_len; - if ((total_len = atm2text (buffer, - sizeof buffer, - (struct sockaddr *)& (atm_addr_.sockaddratmsvc), - A2T_PRETTY)) < 0) { - ACE_DEBUG ((LM_DEBUG,"ACE_ATM_Addr (addr_to_string): atm2text failed\n")); - return -1; - } - if (addrlen < (size_t)total_len) - return -1; - else - ACE_OS::strcpy (addr, - buffer); - - return 0; -#else - ACE_UNUSED_ARG (addr); - ACE_UNUSED_ARG (addrlen); - return -1; -#endif /* ACE_HAS_FORE_ATM_XTI && ACE_HAS_FORE_ATM_WS2 */ -} - -const ACE_TCHAR * -ACE_ATM_Addr::addr_to_string (void) const -{ - ACE_TRACE ("ACE_ATM_Addr::addr_to_string"); - - static ACE_TCHAR addr[MAXHOSTNAMELEN + 1]; - if (this->addr_to_string (addr, - MAXHOSTNAMELEN + 1) < 0) - return 0; - - return addr; -} - -// Set a pointer to the address. -void -ACE_ATM_Addr::set_addr (void *addr, int len) -{ - ACE_TRACE ("ACE_ATM_Addr::set_addr"); - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) - this->ACE_Addr::base_set (AF_ATM, -#elif defined (ACE_HAS_LINUX_ATM) - this->ACE_Addr::base_set (PF_ATMSVC, -#else - this->ACE_Addr::base_set (AF_UNSPEC, -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_WS2 */ - len); - ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) addr, len); -} - -// Compare two addresses for inequality. - -bool -ACE_ATM_Addr::operator != (const ACE_ATM_Addr &sap) const -{ - ACE_TRACE ("ACE_ATM_Addr::operator !="); - return ! ((*this) == sap); -} - -// Compare two addresses for equality. - -bool -ACE_ATM_Addr::operator == (const ACE_ATM_Addr &sap) const -{ - ACE_TRACE ("ACE_ATM_Addr::operator =="); - -#if defined (ACE_HAS_LINUX_ATM) - return (atm_equal ((const struct sockaddr *)& (this->atm_addr_.sockaddratmsvc), - (const struct sockaddr *)& (sap.atm_addr_.sockaddratmsvc), - 0, - 0) - && - sap_equal (& (this->atm_addr_.atmsap), - & (sap.atm_addr_.atmsap), - 0)); -#else - return ACE_OS::memcmp (&atm_addr_, - &sap.atm_addr_, - sizeof (ATM_Addr)) == 0; -#endif /* ACE_HAS_LINUX_ATM */ -} - -void -ACE_ATM_Addr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_ATM_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_TCHAR s[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16]; - ACE_OS::sprintf (s, - ACE_TEXT ("%s"), - this->addr_to_string ()); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s"), s)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - diff --git a/dep/src/ace/ATM_Connector.cpp b/dep/src/ace/ATM_Connector.cpp deleted file mode 100644 index 7d68ed88bd2..00000000000 --- a/dep/src/ace/ATM_Connector.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// ATM_Connector.cpp -// $Id: ATM_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ATM_Connector.h" -#if defined (ACE_HAS_ATM) - -#include "ace/Handle_Set.h" - -ACE_RCSID(ace, ATM_Connector, "$Id: ATM_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_Connector.inl" -#endif /* __ACE_INLINE__ */ - -// Open versioned namespace, if enabled by the user. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Connector) - -ACE_ATM_Connector::ACE_ATM_Connector (void) -{ - ACE_TRACE ("ACE_ATM_Connector::ACE_ATM_Connector"); -} - -// Actively connect and produce a new ACE_ATM_Stream if things go well... -// Connect the to the , waiting up to -// amount of time if necessary. - -int -ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, - const ACE_ATM_Addr &remote_sap, - ACE_ATM_Params params, - ACE_ATM_QoS options, - ACE_Time_Value *timeout, - const ACE_ATM_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_ATM_Connector::connect"); -#if defined (ACE_HAS_FORE_ATM_XTI) - return connector_.connect(new_stream.get_stream(), - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - params.get_device(), - params.get_info(), - params.get_rw_flag(), - params.get_user_data(), - &options.get_qos()); -#elif defined (ACE_HAS_FORE_ATM_WS2) - ACE_DEBUG(LM_DEBUG, - ACE_TEXT ("ATM_Connector(connect): set QoS parameters\n" )); - - ACE_HANDLE s = new_stream.get_handle(); - struct sockaddr_atm *saddr = ( struct sockaddr_atm *)remote_sap.get_addr(); - ACE_QoS cqos = options.get_qos(); - - ACE_QoS_Params qos_params = ACE_QoS_Params(0, - 0, - &cqos, - 0, - 0); - - ACE_DEBUG(LM_DEBUG, - ACE_TEXT ("ATM_Connector(connect): connecting...\n")); - - int result = ACE_OS::connect( s, - ( struct sockaddr *)saddr, - sizeof( struct sockaddr_atm ), - qos_params ); - - if ( result != 0 ) - ACE_OS::printf( "ATM_Connector(connect): connection failed, %d\n", - ::WSAGetLastError()); - - return result; -#elif defined (ACE_HAS_LINUX_ATM) - ACE_UNUSED_ARG (params); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (reuse_addr); - ACE_UNUSED_ARG (perms); - ACE_UNUSED_ARG (flags); - - ACE_HANDLE handle = new_stream.get_handle(); - ATM_QoS qos =options.get_qos(); - ATM_Addr *local_addr=(ATM_Addr*)local_sap.get_addr(), - *remote_addr=(ATM_Addr*)remote_sap.get_addr(); - - if (ACE_OS::setsockopt(handle, - SOL_ATM, - SO_ATMSAP, - reinterpret_cast (&(local_addr->atmsap)), - sizeof(local_addr->atmsap)) < 0) { - ACE_OS::printf( "ATM_Connector(connect): unable to set atmsap %d\nContinuing...", - errno); - } - if (ACE_OS::setsockopt(handle, - SOL_ATM, - SO_ATMQOS, - reinterpret_cast (&qos), - sizeof(qos)) < 0) { - ACE_DEBUG((LM_DEBUG,ACE_TEXT ("ATM_Connector(connect): unable to set qos %d\n"), - errno)); - return -1; - } - - int result = ACE_OS::connect(handle, - (struct sockaddr *)&(remote_addr->sockaddratmsvc), - sizeof( remote_addr->sockaddratmsvc)); - - if ( result != 0 ) - ACE_DEBUG(LM_DEBUG, - ACE_TEXT ("ATM_Connector(connect): connection failed, %d\n"), - errno); - - return result; -#else - ACE_UNUSED_ARG (new_stream); - ACE_UNUSED_ARG (remote_sap); - ACE_UNUSED_ARG (params); - ACE_UNUSED_ARG (options); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (local_sap); - ACE_UNUSED_ARG (reuse_addr); - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (perms); - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -// Close versioned namespace, if enabled by the user. -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - diff --git a/dep/src/ace/ATM_Params.cpp b/dep/src/ace/ATM_Params.cpp deleted file mode 100644 index d3e5116b0f8..00000000000 --- a/dep/src/ace/ATM_Params.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// $Id: ATM_Params.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ATM_Params.h" - -#if defined (ACE_HAS_ATM) - -ACE_RCSID(ace, ATM_Params, "$Id: ATM_Params.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_Params.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Params) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - - diff --git a/dep/src/ace/ATM_QoS.cpp b/dep/src/ace/ATM_QoS.cpp deleted file mode 100644 index 60e4cafad3f..00000000000 --- a/dep/src/ace/ATM_QoS.cpp +++ /dev/null @@ -1,632 +0,0 @@ -// $Id: ATM_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ATM_QoS.h" - -ACE_RCSID(ace, ATM_QoS, "$Id: ATM_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_HAS_ATM) - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_QoS.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) -#define BHLI_MAGIC "FORE_ATM" -// This is line rate in cells/s for an OC-3 MM interface. -const long ACE_ATM_QoS::LINE_RATE = 353207; -const int ACE_ATM_QoS::OPT_FLAGS_CPID = 0x1; -const int ACE_ATM_QoS::OPT_FLAGS_PMP = 0x2; -const int ACE_ATM_QoS::DEFAULT_SELECTOR = 0x99; -const int ACE_ATM_QoS::DEFAULT_PKT_SIZE = 8192; -#elif defined (ACE_HAS_LINUX_ATM) -//pbrandao:for Linux: -//pbrandao:for now stick with current definitions -//pbrandao:see if later need to change -const long ACE_ATM_QoS::LINE_RATE = 353207; -const int ACE_ATM_QoS::OPT_FLAGS_CPID = 0x1; -const int ACE_ATM_QoS::OPT_FLAGS_PMP = 0x2; -const int ACE_ATM_QoS::DEFAULT_SELECTOR = 0x99; -const int ACE_ATM_QoS::DEFAULT_PKT_SIZE = 8192; -#else -const long ACE_ATM_QoS::LINE_RATE = 0L; -const int ACE_ATM_QoS::OPT_FLAGS_CPID = 0; -const int ACE_ATM_QoS::OPT_FLAGS_PMP = 0; -const int ACE_ATM_QoS::DEFAULT_SELECTOR = 0x0; -const int ACE_ATM_QoS::DEFAULT_PKT_SIZE = 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ - -ACE_ALLOC_HOOK_DEFINE(ACE_ATM_QoS) - -ACE_ATM_QoS::ACE_ATM_QoS (int pktSize) -{ - ACE_TRACE ("ACE_ATM_QoS::ACE_ATM_QoS"); -#if defined (ACE_HAS_LINUX_ATM) - ACE_OS::memset(&qos_, 0, sizeof(qos_)); - qos_.aal = ATM_PROTOCOL_DEFAULT; - qos_.rxtp.traffic_class = ATM_ANYCLASS; - qos_.rxtp.max_sdu = pktSize; - qos_.txtp.traffic_class = ATM_ANYCLASS; - qos_.txtp.max_sdu = pktSize; -#else - ACE_UNUSED_ARG (pktSize); -#endif /* ACE_HAS_LINUX_ATM */ -} - -ACE_ATM_QoS::ACE_ATM_QoS(int rate, - int pktSize) -{ - ACE_TRACE( "ACE_ATM_QoS::ACE_ATM_QoS" ); -#if defined (ACE_HAS_FORE_ATM_WS2) - AAL_PARAMETERS_IE ie_aalparams; - ATM_TRAFFIC_DESCRIPTOR_IE ie_td; - ATM_BROADBAND_BEARER_CAPABILITY_IE ie_bbc; - ATM_QOS_CLASS_IE ie_qos; - Q2931_IE *ie_ptr; - int size; - - // Setting up cbr parameters ... - ie_aalparams.AALType = AALTYPE_5; - ie_aalparams.AALSpecificParameters.AAL5Parameters.ForwardMaxCPCSSDUSize - = pktSize; // was 1516; - ie_aalparams.AALSpecificParameters.AAL5Parameters.BackwardMaxCPCSSDUSize - = pktSize; // was 1516; - ie_aalparams.AALSpecificParameters.AAL5Parameters.Mode = AAL5_MODE_MESSAGE; - ie_aalparams.AALSpecificParameters.AAL5Parameters.SSCSType = AAL5_SSCS_NULL; - - size = sizeof(Q2931_IE_TYPE) + sizeof(ULONG) + sizeof(AAL_PARAMETERS_IE); - - ie_td.Forward.PeakCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.PeakCellRate_CLP01 = rate; - ie_td.Forward.SustainableCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.SustainableCellRate_CLP01 = SAP_FIELD_ABSENT; - ie_td.Forward.MaxBurstSize_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.MaxBurstSize_CLP01 = SAP_FIELD_ABSENT; - ie_td.Forward.Tagging = SAP_FIELD_ABSENT; - - ie_td.Backward.PeakCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.PeakCellRate_CLP01 = rate; - ie_td.Backward.SustainableCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.SustainableCellRate_CLP01 = SAP_FIELD_ABSENT; - ie_td.Backward.MaxBurstSize_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.MaxBurstSize_CLP01 = SAP_FIELD_ABSENT; - ie_td.Backward.Tagging = SAP_FIELD_ABSENT; - - ie_td.BestEffort = 0; // Note: this must be set to zero for CBR. - - size += sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( ATM_TRAFFIC_DESCRIPTOR_IE ); - - ie_bbc.BearerClass = BCOB_X; - ie_bbc.TrafficType = TT_CBR; - ie_bbc.TimingRequirements = TR_END_TO_END; - ie_bbc.ClippingSusceptability = CLIP_NOT; - ie_bbc.UserPlaneConnectionConfig = UP_P2P; - - size += sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( ATM_BROADBAND_BEARER_CAPABILITY_IE ); - - ie_qos.QOSClassForward = QOS_CLASS1; - ie_qos.QOSClassBackward = QOS_CLASS1; // This may not be really used - // since we do only simplex data xfer. - - size += sizeof(Q2931_IE_TYPE) + sizeof(ULONG) + sizeof(ATM_QOS_CLASS_IE); - - qos_.ProviderSpecific.buf = (char *) ACE_OS::malloc(size); - if (qos_.ProviderSpecific.buf == 0) { - ACE_ERROR((LM_ERROR, - ACE_TEXT ("ACE_ATM_QoS::ACE_ATM_QoS: Unable to allocate %d bytes for qos_.ProviderSpecific.buf\n"), - size)); - return; - } - qos_.ProviderSpecific.len = size; - ACE_OS::memset(qos_.ProviderSpecific.buf, 0, size); - - ie_ptr = (Q2931_IE *) qos_.ProviderSpecific.buf; - ie_ptr->IEType = IE_AALParameters; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( AAL_PARAMETERS_IE ); - ACE_OS::memcpy(ie_ptr->IE, &ie_aalparams, sizeof(AAL_PARAMETERS_IE)); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_TrafficDescriptor; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( ATM_TRAFFIC_DESCRIPTOR_IE ); - ACE_OS::memcpy(ie_ptr->IE, &ie_td, sizeof(ATM_TRAFFIC_DESCRIPTOR_IE)); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_BroadbandBearerCapability; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( ATM_BROADBAND_BEARER_CAPABILITY_IE ); - ACE_OS::memcpy(ie_ptr->IE, - &ie_bbc, - sizeof(ATM_BROADBAND_BEARER_CAPABILITY_IE)); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_QOSClass; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) - + sizeof( ULONG ) - + sizeof( ATM_QOS_CLASS_IE ); - ACE_OS::memcpy(ie_ptr->IE, &ie_qos, sizeof(ATM_QOS_CLASS_IE)); - - // qos_.SendingFlowspec.TokenRate = 0xffffffff; - // qos_.SendingFlowspec.TokenBucketSize = 0xffffffff; - // qos_.SendingFlowspec.PeakBandwidth = 0xffffffff; - // qos_.SendingFlowspec.Latency = 0xffffffff; - // qos_.SendingFlowspec.DelayVariation = 0xffffffff; - // qos_.SendingFlowspec.ServiceType = SERVICETYPE_BESTEFFORT; - // This will most probably be ignored by the service provider. - // qos_.SendingFlowspec.MaxSduSize = 0xffffffff; - // qos_.SendingFlowspec.MinimumPolicedSize = 0xffffffff; - - // qos_.ReceivingFlowspec.TokenRate = 0xffffffff; - // qos_.ReceivingFlowspec.TokenBucketSize = 0xffffffff; - // qos_.ReceivingFlowspec.PeakBandwidth = 0xffffffff; - // qos_.ReceivingFlowspec.Latency = 0xffffffff; - // qos_.ReceivingFlowspec.DelayVariation = 0xffffffff; - // qos_.ReceivingFlowspec.ServiceType = SERVICETYPE_BESTEFFORT; - // This will most probably be ignored by the service provider. - // qos_.ReceivingFlowspec.MaxSduSize = 0xffffffff; - // qos_.ReceivingFlowspec.MinimumPolicedSize = 0; - - ACE_Flow_Spec send_fspec( 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - SERVICETYPE_BESTEFFORT, - // This will most probably ignored by SP. - 0xffffffff, - 0xffffffff, - 15, - ACE_DEFAULT_THREAD_PRIORITY ), - recv_fspec( 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - SERVICETYPE_BESTEFFORT, - // This will most probably ignored by SP. - 0xffffffff, - 0, - 15, - ACE_DEFAULT_THREAD_PRIORITY ); - - qos_.sending_flowspec (send_fspec); - qos_.receiving_flowspec (recv_fspec); -#elif defined (ACE_HAS_FORE_ATM_XTI) - ACE_UNUSED_ARG (rate); - ACE_UNUSED_ARG (pktSize); -#elif defined (ACE_HAS_LINUX_ATM) - ACE_OS::memset(&qos_, - 0, - sizeof(qos_)); - qos_.aal = ATM_PROTOCOL_DEFAULT; - qos_.rxtp.max_sdu = pktSize; - - if (rate > 0) { - qos_.rxtp.pcr = rate; - qos_.rxtp.traffic_class = ATM_CBR; - qos_.txtp.traffic_class = ATM_CBR; - qos_.txtp.pcr = rate; - } - else { - qos_.rxtp.traffic_class = ATM_UBR; - qos_.txtp.traffic_class = ATM_UBR; - } - - qos_.txtp.max_sdu = pktSize; -#else - ACE_UNUSED_ARG (rate); -#endif /* ACE_HAS_FORE_ATM_WS2 || ACE_HAS_FORE_ATM_XTI || ACE_HAS_LINUX_ATM */ -} - -void -ACE_ATM_QoS::set_cbr_rate (int rate, - int pktSize) -{ - ACE_TRACE ("ACE_ATM_QoS::set_cbr_rate"); -#if defined (ACE_HAS_FORE_ATM_WS2) - /* - AAL_PARAMETERS_IE ie_aalparams; - ATM_TRAFFIC_DESCRIPTOR_IE ie_td; - ATM_BROADBAND_BEARER_CAPABILITY_IE ie_bbc; - ATM_QOS_CLASS_IE ie_qos; - Q2931_IE *ie_ptr; - int size; - */ - - ACE_OS::printf( "ATM_QoS(set_cbr_rate): set rate to %d c/s\n", rate ); - - // Setting up cbr parameters ... - /* - FORE has changed this - we no longer specify QoS this way - ie_aalparams.AALType = AALTYPE_5; - ie_aalparams.AALSpecificParameters.AAL5Parameters.ForwardMaxCPCSSDUSize - = pktSize; // was 1516; - ie_aalparams.AALSpecificParameters.AAL5Parameters.BackwardMaxCPCSSDUSize - = pktSize; // was 1516; - ie_aalparams.AALSpecificParameters.AAL5Parameters.Mode = AAL5_MODE_MESSAGE; - ie_aalparams.AALSpecificParameters.AAL5Parameters.SSCSType = AAL5_SSCS_NULL; - - size = sizeof(Q2931_IE_TYPE) + sizeof(ULONG) + sizeof(AAL_PARAMETERS_IE); - - ie_td.Forward.PeakCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.PeakCellRate_CLP01 = rate; - ie_td.Forward.SustainableCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.SustainableCellRate_CLP01 = SAP_FIELD_ABSENT; - ie_td.Forward.MaxBurstSize_CLP0 = SAP_FIELD_ABSENT; - ie_td.Forward.MaxBurstSize_CLP01 = SAP_FIELD_ABSENT; - ie_td.Forward.Tagging = SAP_FIELD_ABSENT; - - ie_td.Backward.PeakCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.PeakCellRate_CLP01 = rate; - ie_td.Backward.SustainableCellRate_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.SustainableCellRate_CLP01 = SAP_FIELD_ABSENT; - ie_td.Backward.MaxBurstSize_CLP0 = SAP_FIELD_ABSENT; - ie_td.Backward.MaxBurstSize_CLP01 = SAP_FIELD_ABSENT; - ie_td.Backward.Tagging = SAP_FIELD_ABSENT; - - ie_td.BestEffort = 0; // Note: this must be set to zero for CBR. - - size += sizeof( Q2931_IE_TYPE ) + - sizeof( ULONG ) + - sizeof( ATM_TRAFFIC_DESCRIPTOR_IE ); - - ie_bbc.BearerClass = BCOB_X; - ie_bbc.TrafficType = TT_CBR; - ie_bbc.TimingRequirements = TR_END_TO_END; - ie_bbc.ClippingSusceptability = CLIP_NOT; - ie_bbc.UserPlaneConnectionConfig = UP_P2P; - - size += sizeof(Q2931_IE_TYPE) + - sizeof(ULONG) + - sizeof(ATM_BROADBAND_BEARER_CAPABILITY_IE); - - ie_qos.QOSClassForward = QOS_CLASS1; - ie_qos.QOSClassBackward = QOS_CLASS1; // This may not be really used - // since we only simplex data xfer. - - size += sizeof(Q2931_IE_TYPE) + sizeof(ULONG) + sizeof(ATM_QOS_CLASS_IE); - - qos_.ProviderSpecific.buf = (char *) ACE_OS::malloc(size); - if (qos_.ProviderSpecific.buf == 0) { - ACE_ERROR((LM_ERROR, - ACE_TEXT ("ACE_ATM_QoS::ACE_ATM_QoS: Unable to allocate %d bytes for qos_.ProviderSpecific.buf\n"), - size)); - return; - } - qos_.ProviderSpecific.len = size; - ACE_OS::memset(qos_.ProviderSpecific.buf, 0, size); - - ie_ptr = (Q2931_IE *) qos_.ProviderSpecific.buf; - ie_ptr->IEType = IE_AALParameters; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) + - sizeof( ULONG ) + - sizeof( AAL_PARAMETERS_IE ); - ACE_OS::memcpy(ie_ptr->IE, &ie_aalparams, sizeof(AAL_PARAMETERS_IE)); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_TrafficDescriptor; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) + - sizeof( ULONG ) + - sizeof( ATM_TRAFFIC_DESCRIPTOR_IE ); - ACE_OS::memcpy(ie_ptr->IE, &ie_td, sizeof(ATM_TRAFFIC_DESCRIPTOR_IE)); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_BroadbandBearerCapability; - ie_ptr->IELength = sizeof( Q2931_IE_TYPE ) + - sizeof( ULONG ) + - sizeof( ATM_BROADBAND_BEARER_CAPABILITY_IE ); - ACE_OS::memcpy( ie_ptr->IE, - &ie_bbc, - sizeof( ATM_BROADBAND_BEARER_CAPABILITY_IE )); - - ie_ptr = (Q2931_IE *) ((char *)ie_ptr + ie_ptr->IELength); - ie_ptr->IEType = IE_QOSClass; - ie_ptr->IELength = sizeof(Q2931_IE_TYPE) + sizeof(ULONG) + - sizeof(ATM_QOS_CLASS_IE); - ACE_OS::memcpy(ie_ptr->IE, &ie_qos, sizeof(ATM_QOS_CLASS_IE)); - */ - - const int BYTES_PER_ATM_CELL = 53; - ACE_OS::memset(&qos_, 0, sizeof(ATM_QoS)); - // Setting the token rate sets the minimum rate. 3 Mbits/sec seems too high. - // Certainly for Vaudeville audio, we only need about 1000 c/s which is - // 424000 bits/sec which is 53000 bytes/sec. - //qos_.SendingFlowspec.TokenRate = 3*(1024*128); // 3Mbits/sec - qos_.SendingFlowspec.TokenRate = 53000; // 1000 cells/sec - qos_.SendingFlowspec.TokenBucketSize = 32*1024; // our block size - //ourQos.SendingFlowspec.PeakBandwidth = ourQos.SendingFlowspec.TokenRate; - qos_.SendingFlowspec.ServiceType = SERVICETYPE_GUARANTEED; - // Peak bandwidth is in bytes/sec. The rate is specified in cells/sec so - // we need to convert from cells/sec to bytes/sec (i.e., multiply by 53). - qos_.SendingFlowspec.PeakBandwidth = rate * BYTES_PER_ATM_CELL; - qos_.SendingFlowspec.Latency = -1; // we don't care too much - qos_.SendingFlowspec.DelayVariation = -1; // we don't care too much - // no provider-specific data allowed on ATM - qos_.ProviderSpecific.buf=0; - qos_.ProviderSpecific.len=0; - // unidirectional P2MP; we don't need to setup the Receiving flowspec - - //qos_.SendingFlowspec.TokenRate = 0xffffffff; - //qos_.SendingFlowspec.TokenBucketSize = 0xffffffff; - //qos_.SendingFlowspec.PeakBandwidth = 0xffffffff; - //qos_.SendingFlowspec.Latency = 0xffffffff; - //qos_.SendingFlowspec.DelayVariation = 0xffffffff; - //qos_.SendingFlowspec.ServiceType = SERVICETYPE_BESTEFFORT; - // This will most probably be ignored by the service provider. - //qos_.SendingFlowspec.MaxSduSize = 0xffffffff; - //qos_.SendingFlowspec.MinimumPolicedSize = 0xffffffff; - - //qos_.ReceivingFlowspec.TokenRate = 0xffffffff; - //qos_.ReceivingFlowspec.TokenBucketSize = 0xffffffff; - //qos_.ReceivingFlowspec.PeakBandwidth = 0xffffffff; - //qos_.ReceivingFlowspec.Latency = 0xffffffff; - //qos_.ReceivingFlowspec.DelayVariation = 0xffffffff; - //qos_.ReceivingFlowspec.ServiceType = SERVICETYPE_BESTEFFORT; - // This will most probably be ignored by the service provider. - //qos_.ReceivingFlowspec.MaxSduSize = 0xffffffff; - //qos_.ReceivingFlowspec.MinimumPolicedSize = 0; - - /* - ACE_Flow_Spec send_fspec( 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - SERVICETYPE_BESTEFFORT, - // This will most probably ignored by SP. - 0xffffffff, - 0xffffffff, - 15, - ACE_DEFAULT_THREAD_PRIORITY ), - recv_fspec( 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - 0xffffffff, - SERVICETYPE_BESTEFFORT, - // This will most probably ignored by SP. - 0xffffffff, - 0, - 15, - ACE_DEFAULT_THREAD_PRIORITY ); - - qos_.sending_flowspec( send_fspec ); - qos_.receiving_flowspec( recv_fspec ); - */ -#elif defined (ACE_HAS_FORE_ATM_XTI) - ACE_UNUSED_ARG (rate); - ACE_UNUSED_ARG (pktSize); -#elif defined (ACE_HAS_LINUX_ATM) - ACE_UNUSED_ARG (pktSize); - - qos_.rxtp.traffic_class = ATM_CBR; - qos_.rxtp.pcr = rate; - qos_.txtp.traffic_class = ATM_CBR; - qos_.txtp.pcr = rate; -#else - ACE_UNUSED_ARG (rate); -#endif /* ACE_HAS_FORE_ATM_WS2 || ACE_HAS_FORE_ATM_XTI || ACE_HAS_LINUX_ATM */ -} - -void -ACE_ATM_QoS::set_rate (ACE_HANDLE fd, - int rate, - int flags) -{ - ACE_TRACE ("ACE_ATM_QoS::set_rate"); -#if defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) - set_cbr_rate( rate ); - - ACE_UNUSED_ARG( fd ); - ACE_UNUSED_ARG( flags ); -#elif defined (ACE_HAS_FORE_ATM_XTI) - long optlen = 0; - qos_.buf = construct_options(fd, - rate, - flags, - &optlen); - qos_.len = optlen; -#else - ACE_UNUSED_ARG (rate); -#endif /* ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM || ACE_HAS_FORE_ATM_XTI */ -} - -char* -ACE_ATM_QoS::construct_options (ACE_HANDLE fd, - int rate, - int flags, - long *len) -{ -#if defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) - ACE_UNUSED_ARG (fd); - ACE_UNUSED_ARG (rate); - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (len); - return (0); -#elif defined (ACE_HAS_FORE_ATM_XTI) - struct t_opthdr *popt; - char *buf; - int qos_cells; - struct t_info info; - - if (ACE_OS::t_getinfo (fd, &info) == -1) - { - ACE_OS::t_error ("t_getinfo"); - return 0; - } - - buf = (char *) ACE_OS::malloc (info.options); - - if (buf == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Unable to allocate %d bytes for options\n"), - info.options), - 0); - - popt = (struct t_opthdr *) buf; - - if (flags & OPT_FLAGS_CPID) - { - // This constructs the T_ATM_ORIG_ADDR option, which is used to - // signal the UNI 3.1 Calling Party ID Information Element. - t_atm_addr *source_addr; - - popt->len = sizeof (struct t_opthdr) + sizeof (t_atm_addr); - popt->level = T_ATM_SIGNALING; - popt->name = T_ATM_ORIG_ADDR; - popt->status = 0; - - source_addr = - (t_atm_addr *)((char *) popt + sizeof (struct t_opthdr)); - - source_addr->address_format = T_ATM_ENDSYS_ADDR; - source_addr->address_length = ATMNSAP_ADDR_LEN; - - ATMSAPAddress local_addr; - struct t_bind boundaddr; - - boundaddr.addr.maxlen = sizeof(local_addr); - boundaddr.addr.buf = (char *) &local_addr; - - //if (ACE_OS::t_getprotaddr(fd, &boundaddr, 0) < 0) { - if (ACE_OS::t_getname(fd, - &boundaddr.addr, - LOCALNAME) < 0) - { - ACE_OS::t_error("t_getname (local_address)"); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Can't get local address!\n"))); - ACE_OS::free (buf); - return 0; - } - - ACE_OS::memcpy(source_addr->address, - local_addr.sap.t_atm_sap_addr.address, - ATMNSAP_ADDR_LEN); - - popt = T_OPT_NEXTHDR (buf, info.options , popt); - } - - // This constructs all options necessary (bearer cap., QoS, and - // Traffic Descriptor) to signal for a CBR connection with the - // specified QoS in kbit/sec., and/or specify a PMP connection. - - // For FORE 200e cards, the adapter shapes traffic to CBR with rate - // equal to PCR CLP=0+1 (traffic.forward.PCR_all_traffic) - - qos_cells = (rate * 1000) / (48*8); - - if ((qos_cells > 0 && qos_cells < LINE_RATE) - || (ACE_BIT_ENABLED (flags, OPT_FLAGS_PMP))) - { - struct t_atm_bearer *bearer; - struct t_atm_traffic *traffic; - - // T_ATM_BEARER_CAP: Broadband bearer capability - popt->len = sizeof (struct t_opthdr) + sizeof (struct t_atm_bearer); - popt->level = T_ATM_SIGNALING; - popt->name = T_ATM_BEARER_CAP; - popt->status = 0; - - bearer = (struct t_atm_bearer *)((char *) popt + - sizeof (struct t_opthdr)); - bearer->bearer_class = T_ATM_CLASS_X; - - if (qos_cells) - { - bearer->traffic_type = T_ATM_CBR; - bearer->timing_requirements = T_ATM_END_TO_END; - } - else - { - bearer->traffic_type = 0; // UBR - bearer->timing_requirements = 0; - } - bearer->clipping_susceptibility = T_ATM_NULL; - - if (ACE_BIT_ENABLED (flags, OPT_FLAGS_PMP)) - bearer->connection_configuration = T_ATM_1_TO_MANY; - else - bearer->connection_configuration = T_ATM_1_TO_1; - - popt = T_OPT_NEXTHDR (buf, info.options, popt); - - // T_ATM_TRAFFIC: traffic descriptor - popt->len = sizeof (struct t_opthdr) + sizeof (struct t_atm_traffic); - popt->level = T_ATM_SIGNALING; - popt->name = T_ATM_TRAFFIC; - popt->status = 0; - - traffic = (struct t_atm_traffic *)((char *) popt + - sizeof (struct t_opthdr)); - - traffic->forward.PCR_high_priority = T_ATM_ABSENT; - traffic->forward.PCR_all_traffic = qos_cells ? qos_cells : LINE_RATE; - traffic->forward.SCR_high_priority = T_ATM_ABSENT; - traffic->forward.SCR_all_traffic = T_ATM_ABSENT; - traffic->forward.MBS_high_priority = T_ATM_ABSENT; - traffic->forward.MBS_all_traffic = T_ATM_ABSENT; - traffic->forward.tagging = T_NO; - - traffic->backward.PCR_high_priority = T_ATM_ABSENT; - traffic->backward.PCR_all_traffic = - (ACE_BIT_ENABLED (flags, OPT_FLAGS_PMP)) - ? 0 : qos_cells ? qos_cells : LINE_RATE; - traffic->backward.SCR_high_priority = T_ATM_ABSENT; - traffic->backward.SCR_all_traffic = T_ATM_ABSENT; - traffic->backward.MBS_high_priority = T_ATM_ABSENT; - traffic->backward.MBS_all_traffic = T_ATM_ABSENT; - traffic->backward.tagging = T_NO; - - traffic->best_effort = qos_cells ? T_NO : T_YES; - - popt = T_OPT_NEXTHDR (buf, - info.options, - popt); - } - - if (qos_cells > 0 && qos_cells < LINE_RATE) - { - struct t_atm_qos *qos; - - // T_ATM_QOS: Quality of Service - popt->len = sizeof (struct t_opthdr) + sizeof (struct t_atm_qos); - popt->level = T_ATM_SIGNALING; - popt->name = T_ATM_QOS; - popt->status = 0; - - qos = (struct t_atm_qos *)((char *) popt + sizeof (struct t_opthdr)); - qos->coding_standard = T_ATM_ITU_CODING; - qos->forward.qos_class = T_ATM_QOS_CLASS_1; - qos->backward.qos_class = T_ATM_QOS_CLASS_1; - - popt = T_OPT_NEXTHDR (buf, info.options, popt); - } - - // Return actual size of options and option buffer to user. - *len = (char *) popt - buf; - - return buf; -#else - ACE_UNUSED_ARG (fd); - ACE_UNUSED_ARG (rate); - ACE_UNUSED_ARG (flag); - ACE_UNUSED_ARG (len); - return (0); -#endif /* ACE_HAS_FORE_ATM_WS2 */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - - diff --git a/dep/src/ace/ATM_Stream.cpp b/dep/src/ace/ATM_Stream.cpp deleted file mode 100644 index 83b4625436d..00000000000 --- a/dep/src/ace/ATM_Stream.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// $Id: ATM_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ATM_Stream.h" - -ACE_RCSID (ace, ATM_Stream, "$Id: ATM_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_HAS_ATM) - -#if !defined (__ACE_INLINE__) -#include "ace/ATM_Stream.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_ATM_Stream) - -char* -ACE_ATM_Stream::get_peer_name (void) const -{ - ACE_TRACE ("ACE_ATM_Stream::get_peer_name"); -#if defined (ACE_HAS_FORE_ATM_XTI) - // // Use t_getprotaddr for XTI/ATM - // struct t_bind *localaddr - // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), - // T_BIND, - // T_ADDR); - // struct t_bind *peeraddr - // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), - // T_BIND, - // T_ADDR); - // ::t_getprotaddr (get_handle (), - // localaddr, - // peeraddr); - - // char* connected_name = (char*) ACE_OS::malloc (peeraddr->addr.len + 1); - // ACE_OS::strcpy (connected_name, - // peeraddr->addr.buf); - // ACE_OS::t_free ((char *) localaddr, - // T_BIND); - // ACE_OS::t_free ((char *) peeraddr, - // T_BIND); - // return (connected_name); - -#error "This doesn't seem to work. May need to jimmy-rig something with the" -#error "/etc/xti_hosts file - Ugh!" - - ACE_ATM_Addr sa; - struct netbuf name; - name.maxlen = sa.get_size (); - name.buf = (char *) sa.get_addr (); - ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME); - // ACE_OS::ioctl (this->get_handle (), - // TI_GETPEERNAME, - // &name); - return (name.buf); - -#elif defined (ACE_HAS_FORE_ATM_WS2) - // Use getpeername for WinSock2. - struct sockaddr_atm name; - ACE_OS::memset (&name, 0, sizeof (name)); - int nameSize = sizeof (name); - - if (ACE_OS::getpeername (this->get_handle (), - (struct sockaddr *) &name, - &nameSize) != 0) { - return 0; - } - - char buffer[256]; - for (unsigned int index = 0; index < ATM_ADDR_SIZE - 1; index++) { - buffer[ index * 3 ] = '\0'; - ACE_OS::sprintf (buffer, "%s%02x.", buffer, name.satm_number.Addr[ index ]); - } - buffer[ (ATM_ADDR_SIZE - 1) * 3 ] = '\0'; - ACE_OS::sprintf (buffer, "%s%02x.", buffer, 0); - buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; - for (index = 0; index < ACE_OS::strlen (buffer); ++index) - buffer[index] = ACE_OS::ace_tolower (buffer[index]); - - ifstream atm_hosts ("C:/WINNT/atmhosts"); - assert (atm_hosts.is_open ()); - - // Find the host address in the ATM hosts file and return the - // host name - char line[256]; - char *host_ptr, *host_name = 0; - ACE_NEW_RETURN (host_name, char[256], 0); - while (!atm_hosts.eof ()) { - atm_hosts.getline (line, 256); - // Convert the line to lower case to ease comparison - for (index = 0; index < ACE_OS::strlen (line); ++index) - line[index] = ACE_OS::ace_tolower (line[index]); - if (ACE_OS::strstr (line, buffer) != 0) - { - char *strtok_p; - // Grab the second token which is the host name - ACE_OS::strtok_r (line, " \t", &strtok_p); - host_ptr = ACE_OS::strtok (0, " \t", &strtok_p); - ACE_OS::strcpy (host_name, host_ptr); - break; - } - } - - return host_name; -#elif defined (ACE_HAS_LINUX_ATM) - ATM_Addr name; - int nameSize = sizeof (name.sockaddratmsvc); - - if (ACE_OS::getpeername (this->get_handle (), - (struct sockaddr *) & (name.sockaddratmsvc), - &nameSize) < 0) { - ACE_OS::perror ("ACE_ATM_Stream (get_peer_name) : "); - return 0; - } - - static ACE_TCHAR buffer[MAX_ATM_ADDR_LEN + 1]; - int total_len; - if ((total_len = atm2text (buffer,sizeof buffer, - (struct sockaddr *) & (name.sockaddratmsvc), - A2T_PRETTY|A2T_NAME)) < 0) { - ACE_DEBUG ((LM_DEBUG,ACE_TEXT ("ACE_ATM_Stream (get_peer_name) :%d"),errno)); - return 0; - } - - return (char*) buffer; -#else - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -ACE_HANDLE -ACE_ATM_Stream::get_handle (void) const -{ - ACE_TRACE ("ACE_ATM_Stream::get_handle"); -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) - return stream_.get_handle (); -#else - return 0; -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -int -ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, - ACE_UINT16 &vci) const -{ - ACE_TRACE ("ACE_ATM_Stream::get_vpi_vci"); -#if defined (ACE_HAS_FORE_ATM_XTI) - struct t_atm_conn_prop conn_prop; - char* connect_opts = (char *) &conn_prop; - int opt_size = sizeof (t_atm_conn_prop); - struct t_info info; - struct t_optmgmt opt_req, opt_ret; - - if (ACE_OS::t_getinfo (stream_.get_handle (), - &info) < 0) - { - ACE_OS::t_error ("t_getinfo"); - return -1; - } - - char *buf_req = (char *) ACE_OS::malloc (info.options); - if (buf_req == 0) - { - ACE_OS::fprintf (stderr, - "Unable to allocate %ld bytes for options\n", - info.options); - return -1; - } - - char *buf_ret = (char *) ACE_OS::malloc (info.options); - if (buf_ret == 0) - { - ACE_OS::fprintf (stderr, - "Unable to allocate %ld bytes for options\n", - info.options); - return -1; - } - - ACE_OS::memset (&opt_req, 0, sizeof (opt_req)); - ACE_OS::memset (&opt_ret, 0, sizeof (opt_ret)); - - struct t_opthdr *popt = (struct t_opthdr *) buf_req; - struct t_opthdr *popt_ret = (struct t_opthdr *) buf_ret; - - popt->len= sizeof (struct t_opthdr) + opt_size; - - // We are only concerned with SVCs so no other check or values are needed - // here. - popt->level = T_ATM_SIGNALING; - popt->name = T_ATM_CONN_PROP; - popt->status = 0; - - opt_req.opt.len = popt->len; - opt_req.opt.buf = (char *) popt; - opt_req.flags = T_CURRENT; - - popt = T_OPT_NEXTHDR (buf_req, - info.options, - popt); - opt_ret.opt.maxlen = info.options; - opt_ret.opt.buf = (char *) popt_ret; - - if (ACE_OS::t_optmgmt (stream_.get_handle (), - &opt_req, - &opt_ret) < 0) { - ACE_OS::t_error ("t_optmgmt"); - return -1; - } - - ACE_OS::memcpy (connect_opts, - (char *) popt_ret + sizeof (struct t_opthdr), - opt_size); - - ACE_OS::free (buf_ret); - ACE_OS::free (buf_req); - - vpi = conn_prop.vpi; - vci = conn_prop.vci; - return (0); -#elif defined (ACE_HAS_FORE_ATM_WS2) - ATM_CONNECTION_ID connID; - DWORD bytes = 0; - - if (::WSAIoctl ((int) this -> get_handle (), - SIO_GET_ATM_CONNECTION_ID, - 0, - 0, - (LPVOID) &connID, - sizeof (ATM_CONNECTION_ID), - &bytes, - 0, - 0) - == SOCKET_ERROR) { - ACE_OS::printf ("Error: WSAIoctl %d\n", WSAGetLastError ()); - } - - vpi = (ACE_UINT16) connID.VPI; - vci = (ACE_UINT16) connID.VCI; - - return 0; -#elif defined (ACE_HAS_LINUX_ATM) -#if defined (SO_ATMPVC) /* atm version>=0.62 */ - struct sockaddr_atmpvc mypvcaddr; - int addrpvclen = sizeof (mypvcaddr); - if (ACE_OS::getsockopt (stream_.get_handle (), - SOL_ATM, - SO_ATMPVC, - reinterpret_cast (&mypvcaddr), - &addrpvclen) < 0) { - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), - errno); - return -1; - } - vpi = (ACE_UINT16) mypvcaddr.sap_addr.vpi; - vci = (ACE_UINT16) mypvcaddr.sap_addr.vci; - - return 0; -#elif defined (SO_VCID) /* patch for atm version 0.59 */ - struct atm_vcid mypvcid; - int pvcidlen = sizeof (mypvcid); - if (ACE_OS::getsockopt (stream_.get_handle (), - SOL_ATM,SO_VCID, - reinterpret_cast (&mypvcid), - &pvcidlen) < 0) { - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), - errno); - return -1; - } - vpi = (ACE_UINT16) mypvcid.vpi; - vci = (ACE_UINT16) mypvcid.vci; - - return 0; -#else - ACE_DEBUG (LM_DEBUG, - ACE_TEXT ("ACE_ATM_Stream::get_vpi_vci: Not implemented in this ATM version. Update to >= 0.62\n Or patch 0.59")); - ACE_UNUSED_ARG (vci); - ACE_UNUSED_ARG (vpi); - - return (-1); -#endif /* SO_ATMPVC || SO_VCID */ -#else - return (-1); -#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ATM */ - diff --git a/dep/src/ace/Acceptor.cpp b/dep/src/ace/Acceptor.cpp deleted file mode 100644 index 01b7f8da632..00000000000 --- a/dep/src/ace/Acceptor.cpp +++ /dev/null @@ -1,1236 +0,0 @@ -#ifndef ACE_ACCEPTOR_CPP -#define ACE_ACCEPTOR_CPP - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Acceptor.h" -#include "ace/Handle_Set.h" -#include "ace/Svc_Handler.h" -#include "ace/WFMO_Reactor.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_sys_select.h" - -ACE_RCSID (ace, - Acceptor, - "$Id: Acceptor.cpp 81991 2008-06-16 19:05:40Z elliott_c $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Acceptor) - -template void -ACE_Acceptor::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Acceptor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->peer_acceptor_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Acceptor::operator ACE_PEER_ACCEPTOR & () const -{ - ACE_TRACE ("ACE_Acceptor::operator ACE_PEER_ACCEPTOR &"); - return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; -} - -template ACE_PEER_ACCEPTOR & -ACE_Acceptor::acceptor (void) const -{ - ACE_TRACE ("ACE_Acceptor::acceptor"); - return const_cast (this->peer_acceptor_); -} - -// Returns ACE_HANDLE of the underlying Acceptor_Strategy. - -template ACE_HANDLE -ACE_Acceptor::get_handle (void) const -{ - ACE_TRACE ("ACE_Acceptor::get_handle"); - return this->peer_acceptor_.get_handle (); -} - -// Initialize the appropriate strategies for creation, passive -// connection acceptance, and concurrency, and then register -// with the Reactor and listen for connection requests at the -// designated . - -template int -ACE_Acceptor::open - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - int flags, - int use_select, - int reuse_addr) -{ - ACE_TRACE ("ACE_Acceptor::open"); - this->flags_ = flags; - this->use_select_ = use_select; - this->reuse_addr_ = reuse_addr; - this->peer_acceptor_addr_ = local_addr; - - // Must supply a valid Reactor to Acceptor::open()... - - if (reactor == 0) - { - errno = EINVAL; - return -1; - } - - if (this->peer_acceptor_.open (local_addr, reuse_addr) == -1) - return -1; - - // Set the peer acceptor's handle into non-blocking mode. This is a - // safe-guard against the race condition that can otherwise occur - // between the time when indicates that a passive-mode - // socket handle is "ready" and when we call . During this - // interval, the client can shutdown the connection, in which case, - // the call can hang! - if (this->accept_strategy_->acceptor ().enable (ACE_NONBLOCK) != 0) - return -1; - - // Initialize the concurrency strategy. - - if (con_s == 0) - { - ACE_NEW_RETURN (con_s, - CONCURRENCY_STRATEGY, - -1); - this->delete_concurrency_strategy_ = true; - } - this->concurrency_strategy_ = con_s; - - // Initialize the scheduling strategy. - - if (sch_s == 0) - { - ACE_NEW_RETURN (sch_s, - SCHEDULING_STRATEGY, - -1); - this->delete_scheduling_strategy_ = true; - } - this->scheduling_strategy_ = sch_s; - - this->use_select_ = use_select; - - return this->reactor ()->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); -} - -// Simple constructor. - -template -ACE_Strategy_Acceptor::ACE_Strategy_Acceptor - (const ACE_TCHAR service_name[], - const ACE_TCHAR service_description[], - int use_select, - int reuse_addr) - : creation_strategy_ (0), - delete_creation_strategy_ (false), - accept_strategy_ (0), - delete_accept_strategy_ (false), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (false), - scheduling_strategy_ (0), - delete_scheduling_strategy_ (false), - service_name_ (0), - service_description_ (0) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"); - - if (service_name != 0) - ACE_ALLOCATOR (this->service_name_, - ACE_OS::strdup (service_name)); - if (service_description != 0) - ACE_ALLOCATOR (this->service_description_, - ACE_OS::strdup (service_description)); - this->use_select_ = use_select; - this->reuse_addr_ = reuse_addr; -} - -template -ACE_Strategy_Acceptor::ACE_Strategy_Acceptor - (const ACE_PEER_ACCEPTOR_ADDR &addr, - ACE_Reactor *reactor, - ACE_Creation_Strategy *cre_s, - ACE_Accept_Strategy *acc_s, - ACE_Concurrency_Strategy *con_s, - ACE_Scheduling_Strategy *sch_s, - const ACE_TCHAR service_name[], - const ACE_TCHAR service_description[], - int use_select, - int reuse_addr) - : creation_strategy_ (0), - delete_creation_strategy_ (false), - accept_strategy_ (0), - delete_accept_strategy_ (false), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (false), - scheduling_strategy_ (0), - delete_scheduling_strategy_ (false), - service_name_ (0), - service_description_ (0) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"); - - if (this->open (addr, - reactor, - cre_s, - acc_s, - con_s, - sch_s, - service_name, - service_description, - use_select, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"))); -} - -// Perform termination activities when is removed from the -// . - -template int -ACE_Strategy_Acceptor::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::handle_close"); - // Guard against multiple closes. - if (this->reactor () != 0) - { - ACE_HANDLE handle = this->get_handle (); - - if (this->delete_creation_strategy_) - delete this->creation_strategy_; - this->delete_creation_strategy_ = false; - this->creation_strategy_ = 0; - - if (this->delete_accept_strategy_) - delete this->accept_strategy_; - this->delete_accept_strategy_ = false; - this->accept_strategy_ = 0; - - if (this->delete_concurrency_strategy_) - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = false; - this->concurrency_strategy_ = 0; - - if (this->delete_scheduling_strategy_) - delete this->scheduling_strategy_; - this->delete_scheduling_strategy_ = false; - this->scheduling_strategy_ = 0; - - // We must use the obtained *before* we deleted the - // accept_strategy_... - - this->reactor ()->remove_handler - (handle, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - // Set the Reactor to 0 so that we don't try to close down - // again. - this->reactor (0); - } - return 0; -} - -// Bridge method for creating a . The strategy for -// creating a are configured into the Acceptor via it's -// . The default is to create a new -// . However, subclasses can override this strategy to -// perform creation in any way that they like (such as -// creating subclass instances of , using a singleton, -// dynamically linking the handler, etc.). - -template int -ACE_Strategy_Acceptor::make_svc_handler (SVC_HANDLER *&sh) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::make_svc_handler"); - return this->creation_strategy_->make_svc_handler (sh); -} - -// Bridge method for accepting the new connection into the -// . The default behavior delegates to the -// in the Acceptor_Strategy. - -template int -ACE_Strategy_Acceptor::accept_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::accept_svc_handler"); - return this->accept_strategy_->accept_svc_handler (svc_handler); -} - -// Bridge method for activating a with the appropriate -// concurrency strategy. The default behavior of this method is to -// activate the SVC_HANDLER by calling its open() method (which allows -// the SVC_HANDLER to define its own concurrency strategy). However, -// subclasses can override this strategy to do more sophisticated -// concurrency activations (such as creating the SVC_HANDLER as an -// "active object" via multi-threading or multi-processing). - -template int -ACE_Strategy_Acceptor::activate_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::activate_svc_handler"); - return this->concurrency_strategy_->activate_svc_handler - (svc_handler, - (void *) this); -} - -template -ACE_Strategy_Acceptor::~ACE_Strategy_Acceptor (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::~ACE_Strategy_Acceptor"); - ACE_OS::free ((void *) this->service_name_); - ACE_OS::free ((void *) this->service_description_); - this->handle_close (); -} - -// Signal the server to shutdown gracefully. - -template int -ACE_Strategy_Acceptor::handle_signal (int, siginfo_t *, ucontext_t *) -{ - ACE_Reactor::instance()->end_reactor_event_loop (); - return 0; -} - -template int -ACE_Strategy_Acceptor::info (ACE_TCHAR **strp, - size_t length) const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::info"); - - ACE_TCHAR buf[BUFSIZ]; - ACE_TCHAR service_addr_str[BUFSIZ]; - ACE_PEER_ACCEPTOR_ADDR addr; - - if (this->acceptor ().get_local_addr (addr) == -1) - return -1; - else if (addr.addr_to_string (service_addr_str, - sizeof service_addr_str) == -1) - return -1; - - // @@ Should add the protocol in... - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s #%s\n"), - this->service_name_ == 0 - ? ACE_TEXT ("") - : this->service_name_, - service_addr_str, - this->service_description_ == 0 - ? ACE_TEXT ("") - : this->service_description_); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strsncpy (*strp, buf, length); - return static_cast (ACE_OS::strlen (buf)); -} - -template int -ACE_Strategy_Acceptor::fini (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::fini"); - return this->ACE_Strategy_Acceptor::handle_close (); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Oneshot_Acceptor) - -template void -ACE_Oneshot_Acceptor::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Oneshot_Acceptor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nsvc_handler_ = %x"), this->svc_handler_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nrestart_ = %d"), this->restart_)); - this->peer_acceptor_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_concurrency_strategy_ = %d"), - delete_concurrency_strategy_)); - this->concurrency_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template int -ACE_Oneshot_Acceptor::open - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - ACE_Concurrency_Strategy *con_s) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::open"); - this->reactor (reactor); - - // Initialize the concurrency strategy. - - if (con_s == 0) - { - ACE_NEW_RETURN (con_s, - ACE_Concurrency_Strategy, - -1); - this->delete_concurrency_strategy_ = true; - } - this->concurrency_strategy_ = con_s; - - // Reuse the addr, even if it is already in use...! - return this->peer_acceptor_.open (local_addr, 1); -} - -template -ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor (void) - : delete_concurrency_strategy_ (false) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"); - this->reactor (0); -} - -template -ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - ACE_Concurrency_Strategy *cs) - : delete_concurrency_strategy_ (false) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"); - if (this->open (local_addr, reactor, cs) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"))); -} - -template -ACE_Oneshot_Acceptor::~ACE_Oneshot_Acceptor (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::~ACE_Oneshot_Acceptor"); - this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::close (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::close"); - return this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_close"); - - // Guard against multiple closes. - if (this->delete_concurrency_strategy_) - { - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = false; - this->concurrency_strategy_ = 0; - } - // Note that if we aren't actually registered with the - // ACE_Reactor then it's ok for this call to fail... - - if (this->reactor ()) - this->reactor ()->remove_handler - (this, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - if (this->peer_acceptor_.close () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("close\n"))); - return 0; -} - -template int -ACE_Oneshot_Acceptor::handle_timeout - (const ACE_Time_Value &tv, - const void *arg) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_timeout"); - errno = ETIME; - - if (this->svc_handler_->handle_timeout (tv, arg) == -1) - this->svc_handler_->handle_close (this->svc_handler_->get_handle (), - ACE_Event_Handler::TIMER_MASK); - - // Since we aren't necessarily registered with the Reactor, don't - // bother to check the return value here... - if (this->reactor ()) - this->reactor ()->remove_handler (this, - ACE_Event_Handler::ACCEPT_MASK); - return 0; -} - -template int -ACE_Oneshot_Acceptor::cancel (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::cancel"); - return this->reactor () && this->reactor ()->cancel_timer (this); -} - -template int -ACE_Oneshot_Acceptor::register_handler - (SVC_HANDLER *svc_handler, - const ACE_Synch_Options &synch_options, - int restart) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::register_handler"); - // Can't do this if we don't have a Reactor. - if (this->reactor () == 0) - { - errno = EINVAL; - return -1; - } - else - { - this->svc_handler_ = svc_handler; - this->restart_ = restart; - ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value (); - - if (tv != 0 - && this->reactor ()->schedule_timer (this, - synch_options.arg (), - *tv) == 0) - return -1; - else - return this->reactor ()->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); - } -} - -// Bridge method for activating a with the appropriate -// concurrency strategy. The default behavior of this method is to -// activate the SVC_HANDLER by calling its open() method (which allows -// the SVC_HANDLER to define its own concurrency strategy). However, -// subclasses can override this strategy to do more sophisticated -// concurrency activations (such as creating the SVC_HANDLER as an -// "active object" via multi-threading or multi-processing). - -template int -ACE_Oneshot_Acceptor::activate_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::activate_svc_handler"); - return this->concurrency_strategy_->activate_svc_handler - (svc_handler, - (void *) this); -} - -// Factors out the code shared between the and -// methods. - -template int -ACE_Oneshot_Acceptor::shared_accept - (SVC_HANDLER *svc_handler, - ACE_PEER_ACCEPTOR_ADDR *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::shared_accept"); - if (svc_handler == 0) - return -1; - - // Accept connection into the Svc_Handler. - else if (this->peer_acceptor_.accept (svc_handler->peer (), // stream - remote_addr, // remote address - timeout, // timeout - restart, // restart - reset_new_handle // reset new handle - ) == -1) - { - // Check whether we just timed out or whether we failed... - if (!(errno == EWOULDBLOCK || errno == ETIME)) - // Close down handler to avoid memory leaks. - svc_handler->close (CLOSE_DURING_NEW_CONNECTION); - return -1; - } - // Activate the using the designated concurrency - // strategy (note that this method becomes responsible for handling - // errors and freeing up the memory if things go awry...) - else - return this->activate_svc_handler (svc_handler); -} - -// Make a SVC_HANDLER, accept the connection into the SVC_HANDLER, and -// then activate the SVC_HANDLER. Note that SVC_HANDLER::open() -// decides what type of concurrency strategy to use. - -template int -ACE_Oneshot_Acceptor::accept - (SVC_HANDLER *svc_handler, - ACE_PEER_ACCEPTOR_ADDR *remote_addr, - const ACE_Synch_Options &synch_options, - int restart, - int reset_new_handle) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::accept"); - // Note that if timeout == ACE_Time_Value (x, y) where (x > 0 || y > - // 0) then this->connector_.connect() will block synchronously. If - // is set then we don't want this to happen (since we - // want the ACE_Reactor to do the timeout asynchronously). - // Therefore, we'll force this->connector_ to use ACE_Time_Value (0, - // 0) in this case... - - ACE_Time_Value *timeout; - int use_reactor = synch_options[ACE_Synch_Options::USE_REACTOR]; - - if (use_reactor) - timeout = (ACE_Time_Value *) &ACE_Time_Value::zero; - else - timeout = (ACE_Time_Value *) synch_options.time_value (); - - if (this->shared_accept (svc_handler, // stream - remote_addr, // remote address - timeout, // timeout - restart, // restart - reset_new_handle // reset new handler - ) == -1) - { - if (use_reactor && errno == EWOULDBLOCK) - // We couldn't accept right away, so let's wait in the - // . - this->register_handler (svc_handler, - synch_options, - restart); - return -1; - } - return 0; -} - -// Accepts one pending connection from a client (since we're the -// "oneshot" Acceptor). - -template int -ACE_Oneshot_Acceptor::handle_input (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_input"); - int result = 0; - - // Cancel any timer that might be pending. - this->cancel (); - - // Try to find out if the implementation of the reactor that we are - // using requires us to reset the event association for the newly - // created handle. This is because the newly created handle will - // inherit the properties of the listen handle, including its event - // associations. - int reset_new_handle = this->reactor ()->uses_event_associations (); - - // There is a use-case whereby this object will be gone upon return - // from shared_accept - if the Svc_Handler deletes this Oneshot_Acceptor - // during the shared_accept/activation steps. So, do whatever we need - // to do with this object before calling shared_accept. - if (this->reactor ()) - this->reactor ()->remove_handler - (this, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - if (this->shared_accept (this->svc_handler_, // stream - 0, // remote address - 0, // timeout - this->restart_, // restart - reset_new_handle // reset new handle - ) == -1) - result = -1; - - return result; -} - -// Hook called by the explicit dynamic linking facility. - -template int -ACE_Oneshot_Acceptor::init (int, ACE_TCHAR *[]) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::init"); - return -1; -} - -template int -ACE_Oneshot_Acceptor::fini (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::fini"); - return this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::info (ACE_TCHAR **strp, - size_t length) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::info"); - ACE_TCHAR buf[BUFSIZ]; - ACE_TCHAR addr_str[BUFSIZ]; - ACE_PEER_ACCEPTOR_ADDR addr; - - if (this->peer_acceptor_.get_local_addr (addr) == -1) - return -1; - else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) - return -1; - - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s %s"), - ACE_TEXT ("ACE_Oneshot_Acceptor"), - addr_str, - ACE_TEXT ("#oneshot acceptor factory\n")); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strsncpy (*strp, buf, length); - return static_cast (ACE_OS::strlen (buf)); -} - -template int -ACE_Oneshot_Acceptor::suspend (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::suspend"); - return this->reactor () && this->reactor ()->suspend_handler (this); -} - -template int -ACE_Oneshot_Acceptor::resume (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::resume"); - return this->reactor () && this->reactor ()->resume_handler (this); -} - -// Returns ACE_HANDLE of the underlying peer_acceptor. - -template ACE_HANDLE -ACE_Oneshot_Acceptor::get_handle (void) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::get_handle"); - return this->peer_acceptor_.get_handle (); -} - -template ACE_PEER_ACCEPTOR & -ACE_Oneshot_Acceptor::acceptor (void) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::acceptor"); - return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; -} - -template -ACE_Oneshot_Acceptor::operator ACE_PEER_ACCEPTOR & () const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::operator ACE_PEER_ACCEPTOR &"); - return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ACCEPTOR_CPP */ - diff --git a/dep/src/ace/Activation_Queue.cpp b/dep/src/ace/Activation_Queue.cpp deleted file mode 100644 index 9701af2e236..00000000000 --- a/dep/src/ace/Activation_Queue.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include "ace/Activation_Queue.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Activation_Queue.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" -#include "ace/Method_Request.h" -#include "ace/Malloc_Base.h" -#include "ace/Time_Value.h" - -ACE_RCSID (ace, - Activation_Queue, - "$Id: Activation_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Activation_Queue::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("delete_queue_ = %d\n"), - this->delete_queue_)); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("queue_: \n"))); - if (this->queue_) - this->queue_->dump(); - else - //FUZZ: disable check_for_NULL - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(NULL)\n"))); - //FUZZ: enable check_for_NULL - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Activation_Queue::ACE_Activation_Queue (ACE_Message_Queue *new_queue, - ACE_Allocator *alloc, - ACE_Allocator *db_alloc) - : delete_queue_ (false) - , allocator_(alloc) - , data_block_allocator_(db_alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (new_queue) - this->queue_ = new_queue; - else - { - ACE_NEW (this->queue_, - ACE_Message_Queue); - this->delete_queue_ = true; - } -} - -void -ACE_Activation_Queue::queue (ACE_Message_Queue *q) -{ - // Destroy the internal queue if one exist. - if (this->delete_queue_) - { - // Destroy the current queue. - delete this->queue_; - - // Set the flag to false. NOTE that the delete_queue_ flag is a - // flag used to only indicate whether or not if an internal - // ACE_Message_Queue has been created, therefore, it will not - // affect the user if the user decided to replace the queue with - // their own queue no matter how many time they call on this - // function. - this->delete_queue_ = false; - } - - queue_ = q; -} - -ACE_Activation_Queue::~ACE_Activation_Queue (void) -{ - if (this->delete_queue_) - delete this->queue_; -} - -ACE_Method_Request * -ACE_Activation_Queue::dequeue (ACE_Time_Value *tv) -{ - ACE_Message_Block *mb = 0; - - // Dequeue the message. - if (this->queue_->dequeue_head (mb, tv) != -1) - { - // Get the next . - ACE_Method_Request *mr = - reinterpret_cast (mb->base ()); - // Delete the message block. - mb->release (); - return mr; - } - else - return 0; -} - -int -ACE_Activation_Queue::enqueue (ACE_Method_Request *mr, - ACE_Time_Value *tv) -{ - ACE_Message_Block *mb = 0; - - // We pass sizeof (*mr) here so that flow control will work - // correctly. Since we also pass note that no unnecessary - // memory is actually allocated -- just the size field is set. - ACE_NEW_MALLOC_RETURN (mb, - static_cast (this->allocator_->malloc (sizeof (ACE_Message_Block))), - ACE_Message_Block (sizeof (*mr), // size - ACE_Message_Block::MB_DATA, // type - 0, // cont - (char *) mr, // data - 0, // allocator - 0, // locking strategy - mr->priority (), // priority - ACE_Time_Value::zero, // execution time - ACE_Time_Value::max_time, // absolute time of deadline - this->data_block_allocator_, // data_block allocator - this->allocator_), // message_block allocator - -1); - - // Enqueue in priority order. - int const result = this->queue_->enqueue_prio (mb, tv); - - // Free ACE_Message_Block if enqueue_prio failed. - if (result == -1) - ACE_DES_FREE (mb, this->allocator_->free, ACE_Message_Block); - - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Active_Map_Manager.cpp b/dep/src/ace/Active_Map_Manager.cpp deleted file mode 100644 index 0f3d5485cde..00000000000 --- a/dep/src/ace/Active_Map_Manager.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// $Id: Active_Map_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Active_Map_Manager.h" - -ACE_RCSID(ace, Active_Map_Manager, "$Id: Active_Map_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/Active_Map_Manager.inl" -#endif /* __ACE_INLINE__ */ - diff --git a/dep/src/ace/Active_Map_Manager_T.cpp b/dep/src/ace/Active_Map_Manager_T.cpp deleted file mode 100644 index 1d87e44bc54..00000000000 --- a/dep/src/ace/Active_Map_Manager_T.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id: Active_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ACTIVE_MAP_MANAGER_T_CPP -#define ACE_ACTIVE_MAP_MANAGER_T_CPP - -#include "ace/Active_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Active_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Active_Map_Manager) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ACTIVE_MAP_MANAGER_T_CPP */ - diff --git a/dep/src/ace/Addr.cpp b/dep/src/ace/Addr.cpp deleted file mode 100644 index 6944bfea740..00000000000 --- a/dep/src/ace/Addr.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// $Id: Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Addr.h" - -ACE_RCSID (ace, - Addr, - "$Id: Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" -#include "ace/os_include/sys/os_socket.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Note: this object requires static construction and destruction. -/* static */ -const ACE_Addr ACE_Addr::sap_any (AF_ANY, -1); - -ACE_ALLOC_HOOK_DEFINE(ACE_Addr) - -// Initializes instance variables. Note that 0 is an unspecified -// protocol family type... - -ACE_Addr::ACE_Addr (int type, int size) : - addr_type_ (type), - addr_size_ (size) -{ -} - -ACE_Addr::~ACE_Addr (void) -{ -} - -void * -ACE_Addr::get_addr (void) const -{ - return 0; -} - -void -ACE_Addr::set_addr (void *, int) -{ -} - -// Initializes instance variables. - -void -ACE_Addr::base_set (int type, int size) -{ - this->addr_type_ = type; - this->addr_size_ = size; -} - -void -ACE_Addr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("addr_type_ = %d"), this->addr_type_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\naddr_size_ = %d"), this->addr_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Arg_Shifter.cpp b/dep/src/ace/Arg_Shifter.cpp deleted file mode 100644 index da1337d9f4b..00000000000 --- a/dep/src/ace/Arg_Shifter.cpp +++ /dev/null @@ -1,231 +0,0 @@ -#ifndef ACE_ARG_SHIFTER_T_CPP -#define ACE_ARG_SHIFTER_T_CPP - -#include "ace/Arg_Shifter.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_strings.h" -#include "ace/OS_Errno.h" -#include "ace/OS_Memory.h" - -ACE_RCSID (ace, - Arg_Shifter, - "$Id: Arg_Shifter.cpp 80826 2008-03-04 14:51:23Z wotte $") - - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Arg_Shifter_T::ACE_Arg_Shifter_T (int& argc, - const CHAR_TYPE** argv, - const CHAR_TYPE** temp) - : argc_ (argc), - total_size_ (argc), - temp_ (temp), - argv_ (argv), - current_index_ (0), - back_ (argc - 1), - front_ (0) -{ - this->init (); -} - -template -ACE_Arg_Shifter_T::ACE_Arg_Shifter_T (int& argc, - CHAR_TYPE** argv, - CHAR_TYPE** temp) - : argc_ (argc), - total_size_ (argc), - temp_ ((const CHAR_TYPE **) temp), - argv_ ((const CHAR_TYPE **) argv), - current_index_ (0), - back_ (argc - 1), - front_ (0) -{ - this->init (); -} - -template -void -ACE_Arg_Shifter_T::init (void) -{ - // If not provided with one, allocate a temporary array. - if (this->temp_ == 0) - ACE_NEW (this->temp_, - const CHAR_TYPE *[this->total_size_]); - - if (this->temp_ != 0) - { - // Fill the temporary array. - this->argc_ = 0; - for (int i = 0; i < this->total_size_; i++) - { - this->temp_[i] = this->argv_[i]; - this->argv_[i] = 0; - } - } - else - { - // Allocation failed, prohibit iteration. - this->current_index_ = this->argc_; - this->front_ = this->argc_; - } -} - -template -ACE_Arg_Shifter_T::~ACE_Arg_Shifter_T (void) -{ - // Delete the temporary vector. - delete [] temp_; -} - -template -const CHAR_TYPE * -ACE_Arg_Shifter_T::get_current (void) const -{ - const CHAR_TYPE * retval = 0; - - if (this->is_anything_left ()) - retval = this->temp_[current_index_]; - - return retval; -} - -template -const CHAR_TYPE * -ACE_Arg_Shifter_T::get_the_parameter (const CHAR_TYPE *flag) -{ - // the return 0's abound because this method - // would otherwise be a deep if { } else { } - - // check to see if any arguments still exist - if (!this->is_anything_left()) - return 0; - - // check to see if the flag is the argument - int const offset = this->cur_arg_strncasecmp (flag); - if (offset == -1) - return 0; - - if (offset == 0) - { - this->consume_arg (); - - if (!this->is_parameter_next()) - { - return 0; - } - } - // the parameter is in the middle somewhere... - return this->temp_[current_index_] + offset; -} - -template -int -ACE_Arg_Shifter_T::cur_arg_strncasecmp (const CHAR_TYPE *flag) -{ - // Check for a current argument - if (this->is_anything_left()) - { - size_t const flag_length = ACE_OS::strlen (flag); - - // Check for presence of the flag - if (ACE_OS::strncasecmp(this->temp_[current_index_], - flag, - flag_length) == 0) - { - if (ACE_OS::strlen(temp_[current_index_]) == - flag_length) - { - // match and lengths are equal - return 0; - } - else - { - // matches, with more info to boot! - size_t const remaining = ACE_OS::strspn - (this->temp_[current_index_] + flag_length, - ACE_TEXT (" ")) + flag_length; - return static_cast (remaining); - } - } - } - // failure - return -1; -} - -template -int -ACE_Arg_Shifter_T::consume_arg (int number) -{ - int retval = 0; - - // Stick knowns at the end of the vector (consumed). - if (this->is_anything_left() >= number) - { - for (int i = 0, j = this->back_ - (number - 1); - i < number; - ++i, ++j, ++this->current_index_) - this->argv_[j] = this->temp_[this->current_index_]; - - this->back_ -= number; - retval = 1; - } - - return retval; -} - -template -int -ACE_Arg_Shifter_T::ignore_arg (int number) -{ - int retval = 0; - - // Keep unknowns at the head of the vector. - if (this->is_anything_left () >= number) - { - for (int i = 0; - i < number; - i++, this->current_index_++, this->front_++) - this->argv_[this->front_] = this->temp_[this->current_index_]; - - retval = 1; - this->argc_ += number; - } - - return retval; -} - -template -int -ACE_Arg_Shifter_T::is_anything_left (void) const -{ - return this->total_size_ - this->current_index_; -} - -template -int -ACE_Arg_Shifter_T::is_option_next (void) const -{ - return this->is_anything_left () && - this->temp_[this->current_index_][0] == '-'; -} - -template -int -ACE_Arg_Shifter_T::is_parameter_next (void) const -{ - return this->is_anything_left () - && this->temp_[this->current_index_][0] != '-'; -} - -template -int -ACE_Arg_Shifter_T::num_ignored_args (void) const -{ - return this->front_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ATOMIC_OP_T_CPP */ - diff --git a/dep/src/ace/Argv_Type_Converter.cpp b/dep/src/ace/Argv_Type_Converter.cpp deleted file mode 100644 index 3679fbc0737..00000000000 --- a/dep/src/ace/Argv_Type_Converter.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// $Id: Argv_Type_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Argv_Type_Converter.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Argv_Type_Converter.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - Argv_Type_Converter, - "$Id: Argv_Type_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#include "ace/OS_NS_string.h" -#include "ace/OS_Errno.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (ACE_USES_WCHAR) -ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, wchar_t** argv) - : saved_argc_ (argc), - char_argv_ (0), - wchar_argv_ (argv), - before_pass_argc_ (argc), - original_type_ (true), - wchar_passed_ (false), - char_passed_ (false) -{ - this->initialize (); - - for (int i = 0; i < argc; ++i) - this->char_argv_[i] = ACE_OS::strdup (ACE_TEXT_ALWAYS_CHAR (argv[i])); -} -#endif // ACE_USES_WCHAR - -ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, char **argv) - : saved_argc_(argc), - char_argv_(argv) -#if defined (ACE_USES_WCHAR) - , wchar_argv_(0), - before_pass_argc_(argc), - original_type_(false), - wchar_passed_(false), - char_passed_(false) -{ - this->initialize(); - - for (int i = 0; i < argc; ++i) - this->wchar_argv_[i] = ACE_OS::strdup (ACE_TEXT_ANTI_TO_TCHAR (argv[i])); -} -#else -{ -} -#endif // ACE_USES_WCHAR - -ACE_Argv_Type_Converter::~ACE_Argv_Type_Converter (void) -{ -#if defined (ACE_USES_WCHAR) - // selectively delete the 'copy' of argv - if (this->original_type_) - { - // if original type is wchar_t - if (this->char_passed_) - this->align_wchar_with_char (); - - for (int i = 0; i < this->before_pass_argc_; ++i) - ACE_OS::free (this->char_argv_[i]); - - delete [] this->char_argv_; - } - else - { - // if original type is char - if (this->wchar_passed_) - this->align_char_with_wchar (); - - for (int i = 0; i < this->before_pass_argc_; ++i) - ACE_OS::free (this->wchar_argv_[i]); - - delete [] this->wchar_argv_; - } -#endif // ACE_USES_WCHAR -} - -#if defined (ACE_USES_WCHAR) -void -ACE_Argv_Type_Converter::initialize (void) -{ - if (this->original_type_) - { - // Make a copy of argv in 'char'. type Create one more argv entry - // than original argc for the NULL. - ACE_NEW (char_argv_, - char *[this->saved_argc_ + 1]); - this->char_argv_[saved_argc_] = 0; // last entry of argv is - // always a NULL - } - else - { - // make a copy of argv in 'wchar_t' type - ACE_NEW (this->wchar_argv_, - wchar_t*[this->saved_argc_ + 1]); - this->wchar_argv_[saved_argc_] = 0; - } -} - -void -ACE_Argv_Type_Converter::align_char_with_wchar (void) -{ - int wchar_argv_index = 0; - wchar_t* match_argv = this->wchar_argv_[0]; // pick the initial entry - - while (wchar_argv_index < this->saved_argc_) - { - // if n'th entries of both argv lists are different - if (ACE_OS::strcmp (this->char_argv_[wchar_argv_index], - ACE_TEXT_ALWAYS_CHAR (match_argv)) != 0) - { - // loop through the wchar argv list entries that are after - // wchar_argv_index - for (int i = wchar_argv_index + 1; i < before_pass_argc_; ++i) - { - if (ACE_OS::strcmp (this->char_argv_[i], - ACE_TEXT_ALWAYS_CHAR (match_argv)) == 0) - { - // swap the pointers in the char argv list - char *temp = this->char_argv_[wchar_argv_index]; - this->char_argv_[wchar_argv_index] = this->char_argv_[i]; - this->char_argv_[i] = temp; - break; - } - } - } - - // move to the next wchar argv list entry - match_argv = this->wchar_argv_[++wchar_argv_index]; - } - - this->cleanup (); -} - -void -ACE_Argv_Type_Converter::align_wchar_with_char (void) -{ - int char_argv_index = 0; - char* match_argv = this->char_argv_[0]; // pick the initial entry - - while (char_argv_index < saved_argc_) - { - // if n'th entries of both argv lists are different - if (ACE_OS::strcmp ( - ACE_TEXT_ALWAYS_CHAR (this->wchar_argv_[char_argv_index]), - match_argv) != 0) - { - // loop through the wchar argv list entries that are after - // wchar_argv_index - for (int i = char_argv_index + 1; i < this->before_pass_argc_; ++i) - { - if (ACE_OS::strcmp ( - ACE_TEXT_ALWAYS_CHAR(this->wchar_argv_[i]), - match_argv) == 0) { - // swap the pointers in the char argv list - wchar_t* temp = this->wchar_argv_[char_argv_index]; - this->wchar_argv_[char_argv_index] = this->wchar_argv_[i]; - this->wchar_argv_[i] = temp; - break; - } - } - } - - // move to the next wchar argv list entry - match_argv = this->char_argv_[++char_argv_index]; - } - - this->cleanup(); -} - -void -ACE_Argv_Type_Converter::cleanup (void) -{ - for (int i = this->saved_argc_; i < this->before_pass_argc_; ++i) - { - // Check whether it's ours to delete. - if (original_type_) - { - ACE_OS::free (this->char_argv_[i]); - this->char_argv_[i] = 0; - } - else - { - ACE_OS::free (this->wchar_argv_[i]); - this->wchar_argv_[i] = 0; - } - } - - this->before_pass_argc_ = this->saved_argc_; - - this->wchar_passed_ = false; - this->char_passed_ = false; -} -#endif // ACE_USES_WCHAR - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Array_Base.cpp b/dep/src/ace/Array_Base.cpp deleted file mode 100644 index 8136d2e5309..00000000000 --- a/dep/src/ace/Array_Base.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// $Id: Array_Base.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ARRAY_BASE_CPP -#define ACE_ARRAY_BASE_CPP - -#include "ace/Array_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Array_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Malloc_Base.h" -#include "ace/os_include/os_errno.h" - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Dynamically initialize an array. -template -ACE_Array_Base::ACE_Array_Base (typename ACE_Array_Base::size_type size, - ACE_Allocator *alloc) - : max_size_ (size), - cur_size_ (size), - allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (size != 0) - { - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (size * sizeof (T))); - for (size_type i = 0; i < size; ++i) - new (&array_[i]) T; - } - else - this->array_ = 0; -} - -template -ACE_Array_Base::ACE_Array_Base (typename ACE_Array_Base::size_type size, - const T &default_value, - ACE_Allocator *alloc) - : max_size_ (size), - cur_size_ (size), - allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (size != 0) - { - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (size * sizeof (T))); - for (size_type i = 0; i < size; ++i) - new (&array_[i]) T (default_value); - } - else - this->array_ = 0; -} - -// The copy constructor (performs initialization). - -template -ACE_Array_Base::ACE_Array_Base (const ACE_Array_Base &s) - : max_size_ (s.size ()), - cur_size_ (s.size ()), - allocator_ (s.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (s.size () * sizeof (T))); - for (size_type i = 0; i < this->size (); ++i) - new (&this->array_[i]) T (s.array_[i]); -} - -// Assignment operator (performs assignment). - -template void -ACE_Array_Base::operator= (const ACE_Array_Base &s) -{ - // Check for "self-assignment". - - if (this != &s) - { - if (this->max_size_ < s.size ()) - { - // Need to reallocate memory. - - // Strongly exception-safe assignment. - // - // Note that we're swapping the allocators here, too. - // Should we? Probably. "*this" should be a duplicate of - // the "right hand side". - ACE_Array_Base tmp (s); - this->swap (tmp); - } - else - { - // Underlying array is large enough. No need to reallocate - // memory. - // - // "*this" still owns the memory for the underlying array. - // Do not swap out the allocator. - // - // @@ Why don't we just drop the explicit destructor and - // placement operator new() calls with a straight - // element-by-element assignment? Is the existing - // approach more efficient? - // -Ossama - - ACE_DES_ARRAY_NOFREE (this->array_, - s.size (), - T); - - this->cur_size_ = s.size (); - - for (size_type i = 0; i < this->size (); ++i) - new (&this->array_[i]) T (s.array_[i]); - } - } -} - -// Set an item in the array at location slot. - -template int -ACE_Array_Base::set (const T &new_item, - typename ACE_Array_Base::size_type slot) -{ - if (this->in_range (slot)) - { - this->array_[slot] = new_item; - return 0; - } - else - return -1; -} - -// Get an item in the array at location slot. - -template int -ACE_Array_Base::get (T &item, - typename ACE_Array_Base::size_type slot) const -{ - if (this->in_range (slot)) - { - // Copies the item. If you don't want to copy, use operator [] - // instead (but then you'll be responsible for range checking). - item = this->array_[slot]; - return 0; - } - else - return -1; -} - -template int -ACE_Array_Base::max_size (typename ACE_Array_Base::size_type new_size) -{ - if (new_size > this->max_size_) - { - T *tmp = 0; - - ACE_ALLOCATOR_RETURN (tmp, - (T *) this->allocator_->malloc (new_size * sizeof (T)), - -1); - for (size_type i = 0; i < this->cur_size_; ++i) - new (&tmp[i]) T (this->array_[i]); - - // Initialize the new portion of the array that exceeds the - // previously allocated section. - for (size_type j = this->cur_size_; j < new_size; ++j) - new (&tmp[j]) T; - - ACE_DES_ARRAY_FREE (this->array_, - this->max_size_, - this->allocator_->free, - T); - this->array_ = tmp; - this->max_size_ = new_size; - this->cur_size_ = new_size; - } - - return 0; -} - -template int -ACE_Array_Base::size (typename ACE_Array_Base::size_type new_size) -{ - int const r = this->max_size (new_size); - - if (r == 0) - this->cur_size_ = new_size; - - return r; -} - -template -void -ACE_Array_Base::swap (ACE_Array_Base & rhs) -{ - std::swap (this->max_size_ , rhs.max_size_); - std::swap (this->cur_size_ , rhs.cur_size_); - std::swap (this->array_ , rhs.array_); - std::swap (this->allocator_, rhs.allocator_); -} - -// **************************************************************** - -template int -ACE_Array_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Array_Iterator::next"); - - if (this->done ()) - { - item = 0; - return 0; - } - else - { - item = &array_[current_]; - return 1; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ARRAY_BASE_CPP */ - diff --git a/dep/src/ace/Array_Map.cpp b/dep/src/ace/Array_Map.cpp deleted file mode 100644 index c66a21ddc73..00000000000 --- a/dep/src/ace/Array_Map.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// $Id: Array_Map.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ARRAY_MAP_CPP -#define ACE_ARRAY_MAP_CPP - -#include "ace/Array_Map.h" - -#ifndef __ACE_INLINE__ -# include "ace/Array_Map.inl" -#endif /* !__ACE_INLINE__ */ - -#include "ace/checked_iterator.h" - -#include - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#ifndef ACE_LACKS_MEMBER_TEMPLATES -template -template -ACE_Array_Map::ACE_Array_Map (InputIterator f, - InputIterator l) - : size_ (l - f) - , capacity_ (size_) - , nodes_ (size_ == 0 ? 0 : new value_type[size_]) -{ - (void) std::copy (f, - l, - ACE_make_checked_array_iterator (this->begin (), - this->size_)); - -// iterator n = this->begin (); - -// for (InputIterator i = f; i != l; ++i, ++n) -// *n = *i; -} -#else -template -ACE_Array_Map::ACE_Array_Map ( - typename ACE_Array_Map::const_iterator f, - typename ACE_Array_Map::const_iterator l) - : size_ (l - f) - , capacity_ (size_) - , nodes_ (size_ == 0 ? 0 : new value_type[size_]) -{ - (void) std::copy (f, - l, - ACE_make_checked_array_iterator (this->begin (), - this->size_)); - -// iterator n = this->begin (); - -// for (const_iterator i = f; i != l; ++i, ++n) -// *n = *i; -} -#endif /* !ACE_LACKS_MEMBER_TEMPLATES */ - -template -ACE_Array_Map::ACE_Array_Map ( - ACE_Array_Map const & map) - : size_ (map.size_) - , capacity_ (map.size_) - , nodes_ (size_ == 0 ? 0 : new value_type[size_]) -{ - std::copy (map.begin (), - map.end (), - ACE_make_checked_array_iterator (this->begin (), - this->size_)); - -// iterator f = map.begin (); -// iterator l = map.end (); -// iterator n = this->begin (); - -// for (iterator i = f; i != l; ++i, ++n) -// *n = *i; -} - -template -ACE_Array_Map::~ACE_Array_Map (void) -{ - delete[] this->nodes_; -} - -template -void -ACE_Array_Map::swap ( - ACE_Array_Map & map) -{ - std::swap (this->size_, map.size_); - std::swap (this->capacity_, map.capacity_); - std::swap (this->nodes_, map.nodes_); -} - -template -std::pair::iterator, bool> -ACE_Array_Map::insert ( - typename ACE_Array_Map::value_type const & x) -{ - // Linear insertion due to linear duplicate key search. - - bool inserted = false; - iterator i = this->find (x.first); - - if (i == this->end ()) - { - // Add the element to the array. - - size_type const old_size = this->size (); - this->grow (1); // Increase size by at least one. - - i = this->begin () + old_size; - *i = x; - - ++this->size_; - - inserted = true; - } - - return std::make_pair (i, inserted); -} - -#ifndef ACE_LACKS_MEMBER_TEMPLATES -template -template -void -ACE_Array_Map::insert (InputIterator f, InputIterator l) -{ - this->grow (l - f); // Preallocate storage. - - for (InputIterator i = f; i != l; ++i) - { - (void) this->insert (*i); - } -} -#else -template -void -ACE_Array_Map::insert ( - typename ACE_Array_Map::const_iterator f, - typename ACE_Array_Map::const_iterator l) -{ - this->grow (l - f); // Preallocate storage. - - for (const_iterator i = f; i != l; ++i) - { - (void) this->insert (*i); - } -} -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -template -void -ACE_Array_Map::erase ( - typename ACE_Array_Map::iterator pos) -{ - iterator const first = this->begin (); - iterator const last = this->end (); - - if (pos >= first && pos < last) - { - if (pos != last - 1) - { - // Relocate the tail element to the location of the erased - // element to prevent introduction of "holes" in the - // underlying array. - *pos = *(last - 1); - } - - // Explicitly destroy the tail element by assigning a default - // constructed instance to it. Note that this also works for - // the case of a map of size 1. - *(last - 1) = value_type (); - - --this->size_; - } -} - -template -typename ACE_Array_Map::size_type -ACE_Array_Map::erase ( - typename ACE_Array_Map::key_type const & k) -{ - iterator pos = this->find (k); - - size_type const old_size = this->size_; - - this->erase (pos); - - return old_size - this->size_; -} - -template -void -ACE_Array_Map::erase ( - typename ACE_Array_Map::iterator first, - typename ACE_Array_Map::iterator last) -{ - if (this->begin () <= first && first < last && last < this->end ()) - for (iterator i = first; i != last; ++i) - this->erase (i); -} - -template -void -ACE_Array_Map::clear (void) -{ - this->size_ = 0; // No need to deallocate array nor destroy elements. -} - -template -typename ACE_Array_Map::iterator -ACE_Array_Map::find ( - typename ACE_Array_Map::key_type const & k) -{ - iterator const the_end = this->end (); - - EqualTo eq; - - for (iterator i = this->begin (); i != the_end; ++i) - if (eq (k, i->first)) - return i; - - return this->end (); -} - -template -typename ACE_Array_Map::const_iterator -ACE_Array_Map::find ( - typename ACE_Array_Map::key_type const & k) const -{ - const_iterator const the_end = this->end (); - - EqualTo eq; - - for (const_iterator i = this->begin (); i != the_end; ++i) - if (eq (k, i->first)) - return i; - - return this->end (); -} - -template -void -ACE_Array_Map::grow ( - typename ACE_Array_Map::size_type s) -{ - if (this->size () + s > this->capacity_) - { - // This implementation focuses more on static footprint than - // speed. - - // Strongly exception safe. - - ACE_Array_Map temp (this->size () + s); - - std::copy (this->begin (), - this->end (), - ACE_make_checked_array_iterator (temp.begin (), - temp.capacity_)); - - size_type const n = this->size (); // Do not swap out the size - // since we bypassed the - // temporary map's element - // counting code. - this->swap (temp); - - this->size_ = n; - } -} - -// --------------------------------------------------------------- - -template -bool -operator== (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs) -{ - // Do not include Array_Map capacity in comparison. It isn't useful - // in this case. - - return (lhs.size () == rhs.size () - && std::equal (lhs.begin (), - lhs.end (), - ACE_make_checked_array_iterator (rhs.begin (), - rhs.size ()))); -} - -template -bool -operator< (ACE_Array_Map const & lhs, - ACE_Array_Map const & rhs) -{ - return std::lexicographical_compare (lhs.begin (), lhs.end (), - rhs.begin (), rhs.end ()); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ARRAY_MAP_CPP */ - diff --git a/dep/src/ace/Assert.cpp b/dep/src/ace/Assert.cpp deleted file mode 100644 index 3faf3426d07..00000000000 --- a/dep/src/ace/Assert.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// $Id: Assert.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Assert.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, Assert, "$Id: Assert.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// The following ASSERT macro is courtesy of Alexandre Karev -// . -void -__ace_assert(const char *file, int line, const ACE_TCHAR *expression) -{ - int error = ACE_Log_Msg::last_error_adapter (); - ACE_Log_Msg *log = ACE_Log_Msg::instance (); - - log->set (file, line, -1, error, log->restart (), - log->msg_ostream (), log->msg_callback ()); - - log->log (LM_ERROR, ACE_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), expression, -1); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Asynch_Acceptor.cpp b/dep/src/ace/Asynch_Acceptor.cpp deleted file mode 100644 index 50122caa9a5..00000000000 --- a/dep/src/ace/Asynch_Acceptor.cpp +++ /dev/null @@ -1,515 +0,0 @@ -/* -*- C++ -*- */ -// $Id: Asynch_Acceptor.cpp 82444 2008-07-28 13:33:07Z johnnyw $ - -#ifndef ACE_ASYNCH_ACCEPTOR_C -#define ACE_ASYNCH_ACCEPTOR_C - -#include "ace/Asynch_Acceptor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Asynch_Acceptor, "$Id: Asynch_Acceptor.cpp 82444 2008-07-28 13:33:07Z johnnyw $") - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) -// This only works on platforms that support async i/o. - -#include "ace/OS_Errno.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_sys_socket.h" -#include "ace/Log_Msg.h" -#include "ace/Message_Block.h" -#include "ace/INET_Addr.h" -#include "ace/SOCK_Stream.h" -#include "ace/Sock_Connect.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Asynch_Acceptor::ACE_Asynch_Acceptor (void) - : listen_handle_ (ACE_INVALID_HANDLE), - pass_addresses_ (false), - validate_new_connection_ (false), - reissue_accept_ (1), - bytes_to_read_ (0) -{ -} - -template -ACE_Asynch_Acceptor::~ACE_Asynch_Acceptor (void) -{ - // Close down the listen socket - if (this->listen_handle_ != ACE_INVALID_HANDLE) - { - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - } -} - -template int -ACE_Asynch_Acceptor::open (const ACE_INET_Addr &address, - size_t bytes_to_read, - bool pass_addresses, - int backlog, - int reuse_addr, - ACE_Proactor *proactor, - bool validate_new_connection, - int reissue_accept, - int number_of_initial_accepts) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::open"); - - this->proactor (proactor); - this->pass_addresses_ = pass_addresses; - this->bytes_to_read_ = bytes_to_read; - this->validate_new_connection_ = validate_new_connection; - this->reissue_accept_ = reissue_accept; - this->addr_family_ = address.get_type (); - - // Create the listener socket - this->listen_handle_ = ACE_OS::socket (address.get_type (), SOCK_STREAM, 0); - if (this->listen_handle_ == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_OS::socket")), - -1); - // Initialize the ACE_Asynch_Accept - if (this->asynch_accept_.open (*this, - this->listen_handle_, - 0, - this->proactor ()) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Accept::open"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - - if (reuse_addr) - { - // Reuse the address - int one = 1; - if (ACE_OS::setsockopt (this->listen_handle_, - SOL_SOCKET, - SO_REUSEADDR, - (const char*) &one, - sizeof one) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_OS::setsockopt"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - } - - // If port is not specified, bind to any port. - static ACE_INET_Addr sa (ACE_sap_any_cast (const ACE_INET_Addr &)); - - if (address == sa && - ACE::bind_port (this->listen_handle_, - INADDR_ANY, - address.get_type()) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE::bind_port"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - - // Bind to the specified port. - if (ACE_OS::bind (this->listen_handle_, - reinterpret_cast (address.get_addr ()), - address.get_size ()) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_OS::bind"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - - // Start listening. - if (ACE_OS::listen (this->listen_handle_, backlog) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_OS::listen"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - - // For the number of . - if (number_of_initial_accepts == -1) - number_of_initial_accepts = backlog; - - for (int i = 0; i < number_of_initial_accepts; i++) - { - // Initiate accepts. - if (this->accept (bytes_to_read) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Acceptor::accept"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } - } - - return 0; -} - -template int -ACE_Asynch_Acceptor::set_handle (ACE_HANDLE listen_handle) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::set_handle"); - - // Take ownership of the - this->listen_handle_ = listen_handle; - - // Reinitialize the ACE_Asynch_Accept - if (this->asynch_accept_.open (*this, - this->listen_handle_, - 0, - this->proactor ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Accept::open")), - -1); - return 0; -} - -template ACE_HANDLE -ACE_Asynch_Acceptor::get_handle (void) const -{ - return this->listen_handle_; -} - -template int -ACE_Asynch_Acceptor::accept (size_t bytes_to_read, const void *act) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::accept"); - - ACE_Message_Block *message_block = 0; - // The space_needed calculation is drive by needs of Windows. POSIX doesn't - // need to extra 16 bytes, but it doesn't hurt. - size_t space_needed = sizeof (sockaddr_in) + 16; -#if defined (ACE_HAS_IPV6) - if (PF_INET6 == this->addr_family_) - space_needed = sizeof (sockaddr_in6) + 16; -#endif /* ACE_HAS_IPV6 */ - space_needed = (2 * space_needed) + bytes_to_read; - - // Create a new message block big enough for the addresses and data - ACE_NEW_RETURN (message_block, - ACE_Message_Block (space_needed), - -1); - - // Initiate asynchronous accepts - if (this->asynch_accept_.accept (*message_block, - bytes_to_read, - ACE_INVALID_HANDLE, - act, - 0, - ACE_SIGRTMIN, - this->addr_family_) == -1) - { - // Cleanup on error - message_block->release (); - return -1; - } - return 0; -} - -template void -ACE_Asynch_Acceptor::handle_accept (const ACE_Asynch_Accept::Result &result) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::handle_accept"); - - // Variable for error tracking - int error = 0; - - // If the asynchronous accept fails. - if (!result.success () || result.accept_handle () == ACE_INVALID_HANDLE) - { - error = 1; - } - -#if defined (ACE_WIN32) - // In order to use accept handle with other Window Sockets 1.1 - // functions, we call the setsockopt function with the - // SO_UPDATE_ACCEPT_CONTEXT option. This option initializes the - // socket so that other Windows Sockets routines to access the - // socket correctly. - if (!error && - ACE_OS::setsockopt (result.accept_handle (), - SOL_SOCKET, - SO_UPDATE_ACCEPT_CONTEXT, - (char *) &this->listen_handle_, - sizeof (this->listen_handle_)) == -1) - { - error = 1; - } -#endif /* ACE_WIN32 */ - - // Parse address. - ACE_INET_Addr local_address; - ACE_INET_Addr remote_address; - if (!error && - (this->validate_new_connection_ || this->pass_addresses_)) - // Parse the addresses. - this->parse_address (result, - remote_address, - local_address); - - // Validate remote address - if (!error && - this->validate_new_connection_ && - (this->validate_connection (result, remote_address, local_address) == -1)) - { - error = 1; - } - - HANDLER *new_handler = 0; - if (!error) - { - // The Template method - new_handler = this->make_handler (); - if (new_handler == 0) - { - error = 1; - } - } - - // If no errors - if (!error) - { - // Update the Proactor. - new_handler->proactor (this->proactor ()); - - // Pass the addresses - if (this->pass_addresses_) - new_handler->addresses (remote_address, - local_address); - - // Pass the ACT - if (result.act () != 0) - new_handler->act (result.act ()); - - // Set up the handler's new handle value - new_handler->handle (result.accept_handle ()); - - // Initiate the handler - new_handler->open (result.accept_handle (), - result.message_block ()); - } - - // On failure, no choice but to close the socket - if (error && - result.accept_handle() != ACE_INVALID_HANDLE ) - ACE_OS::closesocket (result.accept_handle ()); - - // Delete the dynamically allocated message_block - result.message_block ().release (); - - // Start off another asynchronous accept to keep the backlog going, - // unless we closed the listen socket already (from the destructor), - // or this callback is the result of a canceled/aborted accept. - if (this->should_reissue_accept () && - this->listen_handle_ != ACE_INVALID_HANDLE -#if defined (ACE_WIN32) - && result.error () != ERROR_OPERATION_ABORTED -#else - && result.error () != ECANCELED -#endif - ) - this->accept (this->bytes_to_read_); -} - -template int -ACE_Asynch_Acceptor::validate_connection - (const ACE_Asynch_Accept::Result& /* result */, - const ACE_INET_Addr& /* remote */, - const ACE_INET_Addr& /* local */) -{ - // Default implementation always validates the remote address. - return 0; -} - -template int -ACE_Asynch_Acceptor::cancel (void) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::cancel"); - - // All I/O operations that are canceled will complete with the error - // ERROR_OPERATION_ABORTED. All completion notifications for the I/O - // operations will occur normally. -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) - return (int) ::CancelIo (this->listen_handle_); -#else - // Supported now - return this->asynch_accept_.cancel(); -#endif /* defined (ACE_HAS_WIN32_OVERLAPPED_IO) */ -} - -template void -ACE_Asynch_Acceptor::parse_address (const - ACE_Asynch_Accept::Result &result, - ACE_INET_Addr &remote_address, - ACE_INET_Addr &local_address) -{ - ACE_TRACE ("ACE_Asynch_Acceptor<>::parse_address"); - -#if defined (ACE_HAS_AIO_CALLS) - - // Use an ACE_SOCK to get the addresses - it knows how to deal with - // ACE_INET_Addr objects and get IPv4/v6 addresses. - ACE_SOCK_Stream str (result.accept_handle ()); - str.get_local_addr (local_address); - str.get_remote_addr (remote_address); - -#elif defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - - ACE_Message_Block &message_block = result.message_block (); - - sockaddr *local_addr = 0; - sockaddr *remote_addr = 0; - int local_size = 0; - int remote_size = 0; - // This matches setup in accept(). - size_t addr_size = sizeof (sockaddr_in) + 16; -#if defined (ACE_HAS_IPV6) - if (this->addr_family_ == PF_INET6) - addr_size = sizeof (sockaddr_in6) + 16; -#endif /* ACE_HAS_IPV6 */ - - ::GetAcceptExSockaddrs (message_block.rd_ptr (), - static_cast (this->bytes_to_read_), - static_cast (addr_size), - static_cast (addr_size), - &local_addr, - &local_size, - &remote_addr, - &remote_size); - - local_address.set (reinterpret_cast (local_addr), - local_size); - remote_address.set (reinterpret_cast (remote_addr), - remote_size); -#else - // just in case - errno = ENOTSUP; -#endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */ - return; -} - -template ACE_HANDLE -ACE_Asynch_Acceptor::handle (void) const -{ - return this->listen_handle_; -} - -template void -ACE_Asynch_Acceptor::handle (ACE_HANDLE h) -{ - ACE_Handler::handle (h); -} - -template ACE_Asynch_Accept & -ACE_Asynch_Acceptor::asynch_accept (void) -{ - return this->asynch_accept_; -} - -template HANDLER * -ACE_Asynch_Acceptor::make_handler (void) -{ - // Default behavior - HANDLER *handler = 0; - ACE_NEW_RETURN (handler, - HANDLER, - 0); - return handler; -} - -/* static */ -template size_t -ACE_Asynch_Acceptor::address_size (void) -{ - return sizeof (sockaddr) + sizeof (sockaddr_in); -} - -template bool -ACE_Asynch_Acceptor::pass_addresses (void) const -{ - return this->pass_addresses_; -} - -template void -ACE_Asynch_Acceptor::pass_addresses (bool new_value) -{ - this->pass_addresses_ = new_value; -} - -template bool -ACE_Asynch_Acceptor::validate_new_connection (void) const -{ - return this->validate_new_connection_; -} - -template void -ACE_Asynch_Acceptor::validate_new_connection (bool new_value) -{ - this->validate_new_connection_ = new_value; -} - -template int -ACE_Asynch_Acceptor::reissue_accept (void) const -{ - return this->reissue_accept_; -} - -template void -ACE_Asynch_Acceptor::reissue_accept (int new_value) -{ - this->reissue_accept_ = new_value; -} - -template size_t -ACE_Asynch_Acceptor::bytes_to_read (void) const -{ - return this->bytes_to_read_; -} - -template void -ACE_Asynch_Acceptor::bytes_to_read (size_t new_value) -{ - this->bytes_to_read_ = new_value; -} - -template int -ACE_Asynch_Acceptor::should_reissue_accept (void) -{ - return this->reissue_accept_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ -#endif /* ACE_ASYNCH_ACCEPTOR_C */ - diff --git a/dep/src/ace/Asynch_Connector.cpp b/dep/src/ace/Asynch_Connector.cpp deleted file mode 100644 index 3a5fac78068..00000000000 --- a/dep/src/ace/Asynch_Connector.cpp +++ /dev/null @@ -1,297 +0,0 @@ -// $Id: Asynch_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ASYNCH_CONNECTOR_CPP -#define ACE_ASYNCH_CONNECTOR_CPP - -#include "ace/Asynch_Connector.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (defined (ACE_WIN32) || defined (ACE_HAS_AIO_CALLS)) && !defined(ACE_HAS_WINCE) -// This only works on platforms that support async I/O. - -#include "ace/OS_NS_sys_socket.h" -#include "ace/OS_Memory.h" -#include "ace/Flag_Manip.h" -#include "ace/Log_Msg.h" -#include "ace/Message_Block.h" -#include "ace/INET_Addr.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Asynch_Connector::ACE_Asynch_Connector (void) - : pass_addresses_ (false), - validate_new_connection_ (false) -{ -} - -template -ACE_Asynch_Connector::~ACE_Asynch_Connector (void) -{ - //this->asynch_connect_.close (); -} - -template int -ACE_Asynch_Connector::open (bool pass_addresses, - ACE_Proactor *proactor, - bool validate_new_connection) -{ - this->proactor (proactor); - this->pass_addresses_ = pass_addresses; - this->validate_new_connection_ = validate_new_connection; - - // Initialize the ACE_Asynch_Connect - if (this->asynch_connect_.open (*this, - ACE_INVALID_HANDLE, - 0, - this->proactor ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Connect::open")), - -1); - return 0; -} - -template int -ACE_Asynch_Connector::connect (const ACE_INET_Addr & remote_sap, - const ACE_INET_Addr & local_sap, - int reuse_addr, - const void *act) -{ - // Initiate asynchronous connect - if (this->asynch_connect_.connect (ACE_INVALID_HANDLE, - remote_sap, - local_sap, - reuse_addr, - act) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Connect::connect")), - -1); - return 0; -} - -template void -ACE_Asynch_Connector::handle_connect (const ACE_Asynch_Connect::Result &result) -{ - // Variable for error tracking - int error = 0; - - // If the asynchronous connect fails. - if (!result.success () || - result.connect_handle () == ACE_INVALID_HANDLE) - { - error = 1; - } - - if (result.error () != 0) - { - error = 1; - } - - // set blocking mode - if (!error && - ACE::clr_flags - (result.connect_handle (), ACE_NONBLOCK) != 0) - { - error = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Connector::handle_connect : Set blocking mode"))); - } - - // Parse the addresses. - ACE_INET_Addr local_address; - ACE_INET_Addr remote_address; - if (!error && - (this->validate_new_connection_ || this->pass_addresses_)) - this->parse_address (result, - remote_address, - local_address); - - // Call validate_connection even if there was an error - it's the only - // way the application can learn the connect disposition. - if (this->validate_new_connection_ && - this->validate_connection (result, remote_address, local_address) == -1) - { - error = 1; - } - - HANDLER *new_handler = 0; - if (!error) - { - // The Template method - new_handler = this->make_handler (); - if (new_handler == 0) - { - error = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Asynch_Connector::handle_connect : Making of new handler failed"))); - } - } - - // If no errors - if (!error) - { - // Update the Proactor. - new_handler->proactor (this->proactor ()); - - // Pass the addresses - if (this->pass_addresses_) - new_handler->addresses (remote_address, - local_address); - - // Pass the ACT - if (result.act () != 0) - new_handler->act (result.act ()); - - // Set up the handler's new handle value - new_handler->handle (result.connect_handle ()); - - ACE_Message_Block mb; - - // Initiate the handler with empty message block; - new_handler->open (result.connect_handle (), mb); - } - - // On failure, no choice but to close the socket - if (error && - result.connect_handle() != ACE_INVALID_HANDLE) - ACE_OS::closesocket (result.connect_handle ()); -} - -template int -ACE_Asynch_Connector::validate_connection - (const ACE_Asynch_Connect::Result &, - const ACE_INET_Addr & /* remote_address */, - const ACE_INET_Addr & /* local_address */) -{ - // Default implementation always validates the remote address. - return 0; -} - -template int -ACE_Asynch_Connector::cancel (void) -{ - return this->asynch_connect_.cancel (); -} - -template void -ACE_Asynch_Connector::parse_address (const ACE_Asynch_Connect::Result &result, - ACE_INET_Addr &remote_address, - ACE_INET_Addr &local_address) -{ -#if defined (ACE_HAS_IPV6) - // Getting the addresses. - sockaddr_in6 local_addr; - sockaddr_in6 remote_addr; -#else - // Getting the addresses. - sockaddr_in local_addr; - sockaddr_in remote_addr; -#endif /* ACE_HAS_IPV6 */ - - // Get the length. - int local_size = sizeof (local_addr); - int remote_size = sizeof (remote_addr); - - // Get the local address. - if (ACE_OS::getsockname (result.connect_handle (), - reinterpret_cast (&local_addr), - &local_size) < 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT("%p\n"), - ACE_TEXT("ACE_Asynch_Connector:: failed"))); - - // Get the remote address. - if (ACE_OS::getpeername (result.connect_handle (), - reinterpret_cast (&remote_addr), - &remote_size) < 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT("%p\n"), - ACE_TEXT("ACE_Asynch_Connector:: failed"))); - - // Set the addresses. - local_address.set (reinterpret_cast (&local_addr), - local_size); - remote_address.set (reinterpret_cast (&remote_addr), - remote_size); - -#if 0 - // @@ Just debugging. - char local_address_buf [BUFSIZ]; - char remote_address_buf [BUFSIZ]; - - if (local_address.addr_to_string (local_address_buf, - sizeof local_address_buf) == -1) - ACE_ERROR ((LM_ERROR, - "Error:%m:can't obtain local_address's address string")); - - ACE_DEBUG ((LM_DEBUG, - "ACE_Asynch_Connector::parse_address : " - "Local address %s\n", - local_address_buf)); - - if (remote_address.addr_to_string (remote_address_buf, - sizeof remote_address_buf) == -1) - ACE_ERROR ((LM_ERROR, - "Error:%m:can't obtain remote_address's address string")); - - ACE_DEBUG ((LM_DEBUG, - "ACE_Asynch_Connector::parse_address : " - "Remote address %s\n", - remote_address_buf)); -#endif /* 0 */ - - return; -} - - -template ACE_Asynch_Connect & -ACE_Asynch_Connector::asynch_connect (void) -{ - return this->asynch_connect_; -} - -template HANDLER * -ACE_Asynch_Connector::make_handler (void) -{ - // Default behavior - HANDLER *handler = 0; - ACE_NEW_RETURN (handler, HANDLER, 0); - return handler; -} - -template bool -ACE_Asynch_Connector::pass_addresses (void) const -{ - return this->pass_addresses_; -} - -template void -ACE_Asynch_Connector::pass_addresses (bool new_value) -{ - this->pass_addresses_ = new_value; -} - -template bool -ACE_Asynch_Connector::validate_new_connection (void) const -{ - return this->validate_new_connection_; -} - -template void -ACE_Asynch_Connector::validate_new_connection (bool new_value) -{ - this->validate_new_connection_ = new_value; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ -#endif /* ACE_ASYNCH_CONNECTOR_CPP */ - diff --git a/dep/src/ace/Asynch_IO.cpp b/dep/src/ace/Asynch_IO.cpp deleted file mode 100644 index ad7dedfc671..00000000000 --- a/dep/src/ace/Asynch_IO.cpp +++ /dev/null @@ -1,1410 +0,0 @@ -// $Id: Asynch_IO.cpp 82559 2008-08-07 20:23:07Z parsons $ - -#include "ace/Asynch_IO.h" - -ACE_RCSID(ace, Asynch_IO, "$Id: Asynch_IO.cpp 82559 2008-08-07 20:23:07Z parsons $") - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) -// This only works on platforms with Asynchronous IO - -#include "ace/Proactor.h" -#include "ace/Message_Block.h" -#include "ace/INET_Addr.h" -#include "ace/Asynch_IO_Impl.h" -#include "ace/os_include/os_errno.h" -#include "ace/Truncate.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -size_t -ACE_Asynch_Result::bytes_transferred (void) const -{ - return this->implementation ()->bytes_transferred (); -} - -const void * -ACE_Asynch_Result::act (void) const -{ - return this->implementation ()->act (); -} - -int -ACE_Asynch_Result::success (void) const -{ - return this->implementation ()->success (); -} - -const void * -ACE_Asynch_Result::completion_key (void) const -{ - return this->implementation ()->completion_key (); -} - -unsigned long -ACE_Asynch_Result::error (void) const -{ - return this->implementation ()->error (); -} - -ACE_HANDLE -ACE_Asynch_Result::event (void) const -{ - return this->implementation ()->event (); -} - -unsigned long -ACE_Asynch_Result::offset (void) const -{ - return this->implementation ()->offset (); -} - -unsigned long -ACE_Asynch_Result::offset_high (void) const -{ - return this->implementation ()->offset_high (); -} - -int -ACE_Asynch_Result::priority (void) const -{ - return this->implementation ()->priority (); -} - -int -ACE_Asynch_Result::signal_number (void) const -{ - return this->implementation ()->signal_number (); -} - -ACE_Asynch_Result::ACE_Asynch_Result (ACE_Asynch_Result_Impl *implementation) - : implementation_ (implementation) -{ -} - -ACE_Asynch_Result::~ACE_Asynch_Result (void) -{ - // Proactor deletes the implementation when the finishes. -} - -ACE_Asynch_Result_Impl * -ACE_Asynch_Result::implementation (void) const -{ - return this->implementation_; -} - -// ********************************************************************* - -int -ACE_Asynch_Operation::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - return this->implementation ()->open (handler.proxy (), - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Operation::cancel (void) -{ - if (0 == this->implementation ()) - { - errno = EFAULT; - return -1; - } - return this->implementation ()->cancel (); -} - -ACE_Proactor * -ACE_Asynch_Operation::proactor (void) const -{ - if (0 == this->implementation ()) - { - errno = EFAULT; - return 0; - } - return this->implementation ()->proactor (); -} - -ACE_Asynch_Operation::ACE_Asynch_Operation (void) -{ -} - -ACE_Asynch_Operation::~ACE_Asynch_Operation (void) -{ -} - -ACE_Proactor * -ACE_Asynch_Operation::get_proactor (ACE_Proactor *user_proactor, - ACE_Handler &handler) const -{ - if (user_proactor == 0) - { - // Grab the singleton proactor if proactor> is zero - user_proactor = handler.proactor (); - if (user_proactor == 0) - user_proactor = ACE_Proactor::instance (); - } - - return user_proactor; -} - -// ************************************************************ - -ACE_Asynch_Read_Stream::ACE_Asynch_Read_Stream (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Read_Stream::~ACE_Asynch_Read_Stream (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Read_Stream::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_read_stream ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Read_Stream::read (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->read (message_block, - bytes_to_read, - act, - priority, - signal_number); -} - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) -int -ACE_Asynch_Read_Stream::readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->readv (message_block, - bytes_to_read, - act, - priority, - signal_number); -} -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Read_Stream::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -size_t -ACE_Asynch_Read_Stream::Result::bytes_to_read (void) const -{ - return this->implementation ()->bytes_to_read (); -} - -ACE_Message_Block & -ACE_Asynch_Read_Stream::Result::message_block (void) const -{ - return this->implementation ()->message_block (); -} - -ACE_HANDLE -ACE_Asynch_Read_Stream::Result::handle (void) const -{ - return this->implementation ()->handle (); -} - -ACE_Asynch_Read_Stream::Result::Result (ACE_Asynch_Read_Stream_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Read_Stream::Result::~Result (void) -{ - // Proactor will delete the implementation after is - // finished. -} - -ACE_Asynch_Read_Stream_Result_Impl * -ACE_Asynch_Read_Stream::Result::implementation (void) const -{ - return this->implementation_; -} - -// *************************************************** - -ACE_Asynch_Write_Stream::ACE_Asynch_Write_Stream (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Write_Stream::~ACE_Asynch_Write_Stream (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Write_Stream::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_write_stream ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Write_Stream::write (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->write (message_block, - bytes_to_write, - act, - priority, - signal_number); -} - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) -int -ACE_Asynch_Write_Stream::writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->writev (message_block, - bytes_to_write, - act, - priority, - signal_number); -} -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Write_Stream::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -size_t -ACE_Asynch_Write_Stream::Result::bytes_to_write (void) const -{ - return this->implementation ()->bytes_to_write (); -} - -ACE_Message_Block & -ACE_Asynch_Write_Stream::Result::message_block (void) const -{ - return this->implementation ()->message_block (); -} - -ACE_HANDLE -ACE_Asynch_Write_Stream::Result::handle (void) const -{ - return this->implementation ()->handle (); -} - -ACE_Asynch_Write_Stream::Result::Result (ACE_Asynch_Write_Stream_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Write_Stream::Result::~Result (void) -{ - // Proactor will delte the implementation when the call - // finishes. -} - -ACE_Asynch_Write_Stream_Result_Impl * -ACE_Asynch_Write_Stream::Result::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Read_File::ACE_Asynch_Read_File (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Read_File::~ACE_Asynch_Read_File (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Read_File::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_read_file ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Read_File::read (ACE_Message_Block &message_block, - size_t bytes_to_read, - unsigned long offset, - unsigned long offset_high, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->read (message_block, - bytes_to_read, - offset, - offset_high, - act, - priority, - signal_number); -} - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) -int -ACE_Asynch_Read_File::readv (ACE_Message_Block &message_block, - size_t bytes_to_read, - unsigned long offset, - unsigned long offset_high, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->readv (message_block, - bytes_to_read, - offset, - offset_high, - act, - priority, - signal_number); -} -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Read_File::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Read_File::Result::Result (ACE_Asynch_Read_File_Result_Impl *implementation) - : ACE_Asynch_Read_Stream::Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Read_File::Result::~Result (void) -{ - // Proactor will delete the implementation when call - // completes. -} - -ACE_Asynch_Read_File_Result_Impl * -ACE_Asynch_Read_File::Result::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Write_File::ACE_Asynch_Write_File (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Write_File::~ACE_Asynch_Write_File (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Write_File::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_write_file ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Write_File::write (ACE_Message_Block &message_block, - size_t bytes_to_write, - unsigned long offset, - unsigned long offset_high, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->write (message_block, - bytes_to_write, - offset, - offset_high, - act, - priority, - signal_number); -} - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) -int -ACE_Asynch_Write_File::writev (ACE_Message_Block &message_block, - size_t bytes_to_write, - unsigned long offset, - unsigned long offset_high, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->writev (message_block, - bytes_to_write, - offset, - offset_high, - act, - priority, - signal_number); -} -#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Write_File::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Write_File::Result::Result (ACE_Asynch_Write_File_Result_Impl *implementation) - : ACE_Asynch_Write_Stream::Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Write_File::Result::~Result (void) -{ - // Proactor will delete the implementation when the call - // completes. -} - -ACE_Asynch_Write_File_Result_Impl * -ACE_Asynch_Write_File::Result::implementation (void) const -{ - return this->implementation_; -} - -// ********************************************************************* - -ACE_Asynch_Accept::ACE_Asynch_Accept (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Accept::~ACE_Asynch_Accept (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Accept::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_accept ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Accept::accept (ACE_Message_Block &message_block, - size_t bytes_to_read, - ACE_HANDLE accept_handle, - const void *act, - int priority, - int signal_number, - int addr_family) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->accept (message_block, - bytes_to_read, - accept_handle, - act, - priority, - signal_number, - addr_family); -} - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Accept::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -size_t -ACE_Asynch_Accept::Result::bytes_to_read (void) const -{ - return this->implementation ()->bytes_to_read (); -} - -ACE_Message_Block & -ACE_Asynch_Accept::Result::message_block (void) const -{ - return this->implementation ()->message_block (); -} - -ACE_HANDLE -ACE_Asynch_Accept::Result::listen_handle (void) const -{ - return this->implementation ()->listen_handle (); -} - -ACE_HANDLE -ACE_Asynch_Accept::Result::accept_handle (void) const -{ - return this->implementation ()->accept_handle (); -} - -ACE_Asynch_Accept::Result::Result (ACE_Asynch_Accept_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Accept::Result::~Result (void) -{ - // Proactor will delete the implementation when the call - // completes. -} - -ACE_Asynch_Accept_Result_Impl * -ACE_Asynch_Accept::Result::implementation (void) const -{ - return this->implementation_; -} - -// ********************************************************************* - -ACE_Asynch_Connect::ACE_Asynch_Connect (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Connect::~ACE_Asynch_Connect (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Connect::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_connect ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Connect::connect (ACE_HANDLE connect_handle, - const ACE_Addr & remote_sap, - const ACE_Addr & local_sap, - int reuse_addr, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->connect (connect_handle, - remote_sap, - local_sap, - reuse_addr, - act, - priority, - signal_number); -} - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Connect::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Connect::Result::Result (ACE_Asynch_Connect_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Connect::Result::~Result (void) -{ - // Proactor will delete the implementation when the call - // completes. -} - -ACE_HANDLE -ACE_Asynch_Connect::Result::connect_handle (void) const -{ - return this->implementation ()->connect_handle (); -} - -ACE_Asynch_Connect_Result_Impl * -ACE_Asynch_Connect::Result::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Transmit_File::ACE_Asynch_Transmit_File (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Transmit_File::~ACE_Asynch_Transmit_File (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Transmit_File::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_transmit_file ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -int -ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, - Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - unsigned long offset, - unsigned long offset_high, - size_t bytes_per_send, - unsigned long flags, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->transmit_file (file, - header_and_trailer, - bytes_to_write, - offset, - offset_high, - bytes_per_send, - flags, - act, - priority, - signal_number); -} - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Transmit_File::implementation (void) const -{ - return this->implementation_; -} - -// **************************************************************************** - -ACE_HANDLE -ACE_Asynch_Transmit_File::Result::socket (void) const -{ - return this->implementation ()->socket (); -} - -ACE_HANDLE -ACE_Asynch_Transmit_File::Result::file (void) const -{ - return this->implementation ()->file (); -} - -ACE_Asynch_Transmit_File::Header_And_Trailer * -ACE_Asynch_Transmit_File::Result::header_and_trailer (void) const -{ - return this->implementation ()->header_and_trailer (); -} - -size_t -ACE_Asynch_Transmit_File::Result::bytes_to_write (void) const -{ - return this->implementation ()->bytes_to_write (); -} - -size_t -ACE_Asynch_Transmit_File::Result::bytes_per_send (void) const -{ - return this->implementation ()->bytes_per_send (); -} - -unsigned long -ACE_Asynch_Transmit_File::Result::flags (void) const -{ - return this->implementation ()->flags (); -} - -ACE_Asynch_Transmit_File::Result::Result (ACE_Asynch_Transmit_File_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Transmit_File::Result::~Result (void) -{ -} - -ACE_Asynch_Transmit_File_Result_Impl * -ACE_Asynch_Transmit_File::Result::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Transmit_File::Header_And_Trailer::Header_And_Trailer (ACE_Message_Block *header, - size_t header_bytes, - ACE_Message_Block *trailer, - size_t trailer_bytes) - : header_ (header), - header_bytes_ (header_bytes), - trailer_ (trailer), - trailer_bytes_ (trailer_bytes) -{ -} - -ACE_Asynch_Transmit_File::Header_And_Trailer::~Header_And_Trailer (void) -{ -} - -void -ACE_Asynch_Transmit_File::Header_And_Trailer::header_and_trailer (ACE_Message_Block *header, - size_t header_bytes, - ACE_Message_Block *trailer, - size_t trailer_bytes) -{ - this->header (header); - this->header_bytes (header_bytes); - this->trailer (trailer); - this->trailer_bytes (trailer_bytes); -} - -ACE_Message_Block * -ACE_Asynch_Transmit_File::Header_And_Trailer::header (void) const -{ - return this->header_; -} - -void -ACE_Asynch_Transmit_File::Header_And_Trailer::header (ACE_Message_Block *message_block) -{ - this->header_ = message_block; -} - -size_t -ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes (void) const -{ - return this->header_bytes_; -} - -void -ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes (size_t bytes) -{ - this->header_bytes_ = bytes; -} - -ACE_Message_Block * -ACE_Asynch_Transmit_File::Header_And_Trailer::trailer (void) const -{ - return this->trailer_; -} - -void -ACE_Asynch_Transmit_File::Header_And_Trailer::trailer (ACE_Message_Block *message_block) -{ - this->trailer_ = message_block; -} - -size_t -ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes (void) const -{ - return this->trailer_bytes_; -} - -void -ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes (size_t bytes) -{ - this->trailer_bytes_ = bytes; -} - -ACE_LPTRANSMIT_FILE_BUFFERS -ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers (void) -{ - // If both are zero, return zero - if (this->header_ == 0 && this->trailer_ == 0) - { - return 0; - } - else - { - // Something is valid - - // If header is valid, set the fields - if (this->header_ != 0) - { - this->transmit_buffers_.Head = this->header_->rd_ptr (); -#if defined (ACE_WIN64) || defined (ACE_WIN32) - this->transmit_buffers_.HeadLength = - ACE_Utils::truncate_cast (this->header_bytes_); -#else - this->transmit_buffers_.HeadLength = this->header_bytes_; -#endif /* ACE_WIN64 || ACE_WIN32 */ - } - else - { - this->transmit_buffers_.Head = 0; - this->transmit_buffers_.HeadLength = 0; - } - - // If trailer is valid, set the fields - if (this->trailer_ != 0) - { - this->transmit_buffers_.Tail = this->trailer_->rd_ptr (); -#if defined(ACE_WIN64) || defined (ACE_WIN32) - this->transmit_buffers_.TailLength = - ACE_Utils::truncate_cast (this->trailer_bytes_); -#else - this->transmit_buffers_.TailLength = this->trailer_bytes_; -#endif /* ACE_WIN64 || ACE_WIN32 */ - } - else - { - this->transmit_buffers_.Tail = 0; - this->transmit_buffers_.TailLength = 0; - } - - // Return the transmit buffers - return &this->transmit_buffers_; - } -} - -// ********************************************************************* - -ACE_Handler::ACE_Handler (void) - : proactor_ (0), handle_ (ACE_INVALID_HANDLE) -{ - ACE_Handler::Proxy *p; - ACE_NEW (p, ACE_Handler::Proxy (this)); - this->proxy_.reset (p); -} - -ACE_Handler::ACE_Handler (ACE_Proactor *d) - : proactor_ (d), handle_ (ACE_INVALID_HANDLE) -{ - ACE_Handler::Proxy *p; - ACE_NEW (p, ACE_Handler::Proxy (this)); - this->proxy_.reset (p); -} - -ACE_Handler::~ACE_Handler (void) -{ - ACE_Handler::Proxy *p = this->proxy_.get (); - if (p) - p->reset (); -} - -void -ACE_Handler::handle_read_stream (const ACE_Asynch_Read_Stream::Result & /* result */) -{ -} - -void -ACE_Handler::handle_write_stream (const ACE_Asynch_Write_Stream::Result & /* result */) -{ -} - -void -ACE_Handler::handle_write_dgram (const ACE_Asynch_Write_Dgram::Result & /* result */) -{ -} - -void -ACE_Handler::handle_read_dgram (const ACE_Asynch_Read_Dgram::Result & /* result */) -{ -} - -void -ACE_Handler::handle_accept (const ACE_Asynch_Accept::Result & /* result */) -{ -} - -void -ACE_Handler::handle_connect (const ACE_Asynch_Connect::Result & /* result */) -{ -} - -void -ACE_Handler::handle_transmit_file (const ACE_Asynch_Transmit_File::Result & /* result */) -{ -} - -void -ACE_Handler::handle_read_file (const ACE_Asynch_Read_File::Result & /* result */) -{ -} - -void -ACE_Handler::handle_write_file (const ACE_Asynch_Write_File::Result & /* result */) -{ -} - -void -ACE_Handler::handle_time_out (const ACE_Time_Value & /* tv */, - const void * /* act */) -{ -} - -void -ACE_Handler::handle_wakeup (void) -{ -} - -ACE_Proactor * -ACE_Handler::proactor (void) -{ - return this->proactor_; -} - -void -ACE_Handler::proactor (ACE_Proactor *p) -{ - this->proactor_ = p; -} - -ACE_HANDLE -ACE_Handler::handle (void) const -{ - return this->handle_; -} - -void -ACE_Handler::handle (ACE_HANDLE h) -{ - this->handle_ = h; -} - -ACE_Refcounted_Auto_Ptr & -ACE_Handler::proxy (void) -{ - return this->proxy_; -} - -// ************************************************************ - -ACE_Service_Handler::ACE_Service_Handler (void) -{ -} - -ACE_Service_Handler::~ACE_Service_Handler (void) -{ -} - -void -ACE_Service_Handler::addresses (const ACE_INET_Addr & /* remote_address */, - const ACE_INET_Addr & /* local_address */ ) -{ -} - -void -ACE_Service_Handler::act (const void *) -{ -} - -void -ACE_Service_Handler::open (ACE_HANDLE, - ACE_Message_Block &) -{ -} - -// ************************************************************ - -ACE_Asynch_Read_Dgram::ACE_Asynch_Read_Dgram (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Read_Dgram::~ACE_Asynch_Read_Dgram (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Read_Dgram::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_read_dgram ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -ssize_t -ACE_Asynch_Read_Dgram::recv (ACE_Message_Block *message_block, - size_t &number_of_bytes_recvd, - int flags, - int protocol_family, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->recv (message_block, - number_of_bytes_recvd, - flags, - protocol_family, - act, - priority, - signal_number); -} - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Read_Dgram::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -int -ACE_Asynch_Read_Dgram::Result::remote_address (ACE_Addr& addr) const -{ - return this->implementation ()->remote_address (addr); -} - -ACE_Message_Block* -ACE_Asynch_Read_Dgram::Result::message_block (void) const -{ - return this->implementation ()->message_block (); -} - -int -ACE_Asynch_Read_Dgram::Result::flags (void) const -{ - return this->implementation ()->flags (); -} - -size_t -ACE_Asynch_Read_Dgram::Result::bytes_to_read (void) const -{ - return this->implementation ()->bytes_to_read (); -} - -ACE_HANDLE -ACE_Asynch_Read_Dgram::Result::handle (void) const -{ - return this->implementation ()->handle(); -} - -ACE_Asynch_Read_Dgram::Result::Result (ACE_Asynch_Read_Dgram_Result_Impl *implementation) -: ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Read_Dgram::Result::~Result (void) -{ -} - -ACE_Asynch_Read_Dgram_Result_Impl * -ACE_Asynch_Read_Dgram::Result::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -ACE_Asynch_Write_Dgram::ACE_Asynch_Write_Dgram (void) - : implementation_ (0) -{ -} - -ACE_Asynch_Write_Dgram::~ACE_Asynch_Write_Dgram (void) -{ - // Delete the implementation. - delete this->implementation_; - this->implementation_ = 0; -} - -int -ACE_Asynch_Write_Dgram::open (ACE_Handler &handler, - ACE_HANDLE handle, - const void *completion_key, - ACE_Proactor *proactor) -{ - // Get a proactor for/from the user. - proactor = this->get_proactor (proactor, handler); - - // Now let us get the implementation initialized. - if ((this->implementation_ = proactor->create_asynch_write_dgram ()) == 0) - return -1; - - // Call the method of the base class. - return ACE_Asynch_Operation::open (handler, - handle, - completion_key, - proactor); -} - -ssize_t -ACE_Asynch_Write_Dgram::send (ACE_Message_Block *message_block, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr& remote_addr, - const void *act, - int priority, - int signal_number) -{ - if (0 == this->implementation_) - { - errno = EFAULT; - return -1; - } - return this->implementation_->send (message_block, - number_of_bytes_sent, - flags, - remote_addr, - act, - priority, - signal_number); -} - -ACE_Asynch_Operation_Impl * -ACE_Asynch_Write_Dgram::implementation (void) const -{ - return this->implementation_; -} - -// ************************************************************ - -size_t -ACE_Asynch_Write_Dgram::Result::bytes_to_write (void) const -{ - return this->implementation ()->bytes_to_write (); -} - -ACE_Message_Block* -ACE_Asynch_Write_Dgram::Result::message_block () const -{ - return this->implementation ()->message_block (); -} - -int -ACE_Asynch_Write_Dgram::Result::flags (void) const -{ - return this->implementation ()->flags (); -} - -ACE_HANDLE -ACE_Asynch_Write_Dgram::Result::handle (void) const -{ - return this->implementation ()->handle (); -} - -ACE_Asynch_Write_Dgram_Result_Impl * -ACE_Asynch_Write_Dgram::Result::implementation (void) const -{ - return this->implementation_; -} - -ACE_Asynch_Write_Dgram::Result::Result (ACE_Asynch_Write_Dgram_Result_Impl *implementation) -: ACE_Asynch_Result (implementation), - implementation_ (implementation) -{ -} - -ACE_Asynch_Write_Dgram::Result::~Result (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ - diff --git a/dep/src/ace/Asynch_IO_Impl.cpp b/dep/src/ace/Asynch_IO_Impl.cpp deleted file mode 100644 index 5bfc8b4c749..00000000000 --- a/dep/src/ace/Asynch_IO_Impl.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// $Id: Asynch_IO_Impl.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Asynch_IO_Impl.h" - -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) -// This only works on Win32 platforms and on Unix platforms supporting -// aio calls. - -#if !defined (__ACE_INLINE__) -#include "ace/Asynch_IO_Impl.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Asynch_Result_Impl::~ACE_Asynch_Result_Impl (void) -{ -} - -ACE_Asynch_Operation_Impl::~ACE_Asynch_Operation_Impl (void) -{ -} - -ACE_Asynch_Read_Stream_Impl::~ACE_Asynch_Read_Stream_Impl (void) -{ -} - -ACE_Asynch_Read_Stream_Result_Impl::~ACE_Asynch_Read_Stream_Result_Impl (void) -{ -} - -ACE_Asynch_Write_Stream_Impl::~ACE_Asynch_Write_Stream_Impl (void) -{ -} - -ACE_Asynch_Write_Stream_Result_Impl::~ACE_Asynch_Write_Stream_Result_Impl (void) -{ -} - -ACE_Asynch_Read_File_Impl::~ACE_Asynch_Read_File_Impl (void) -{ -} - -ACE_Asynch_Write_File_Impl::~ACE_Asynch_Write_File_Impl (void) -{ -} - -ACE_Asynch_Read_File_Result_Impl::~ACE_Asynch_Read_File_Result_Impl (void) -{ -} - -ACE_Asynch_Write_File_Result_Impl::~ACE_Asynch_Write_File_Result_Impl (void) -{ -} - -ACE_Asynch_Accept_Result_Impl::~ACE_Asynch_Accept_Result_Impl (void) -{ -} - -ACE_Asynch_Connect_Result_Impl::~ACE_Asynch_Connect_Result_Impl (void) -{ -} - -ACE_Asynch_Accept_Impl::~ACE_Asynch_Accept_Impl (void) -{ -} - -ACE_Asynch_Connect_Impl::~ACE_Asynch_Connect_Impl (void) -{ -} - -ACE_Asynch_Transmit_File_Impl::~ACE_Asynch_Transmit_File_Impl (void) -{ -} - -ACE_Asynch_Transmit_File_Result_Impl::~ACE_Asynch_Transmit_File_Result_Impl (void) -{ -} - -ACE_Asynch_Read_Dgram_Impl::~ACE_Asynch_Read_Dgram_Impl (void) -{ -} - -ACE_Asynch_Read_Dgram_Impl::ACE_Asynch_Read_Dgram_Impl (void) -{ -} - -ACE_Asynch_Write_Dgram_Impl::~ACE_Asynch_Write_Dgram_Impl (void) -{ -} - -ACE_Asynch_Write_Dgram_Impl::ACE_Asynch_Write_Dgram_Impl (void) -{ -} - -//*********************************************** - -ACE_Asynch_Read_Dgram_Result_Impl::~ACE_Asynch_Read_Dgram_Result_Impl (void) -{ -} - -ACE_Asynch_Read_Dgram_Result_Impl::ACE_Asynch_Read_Dgram_Result_Impl (void) -{ -} - -//*********************************************** - -ACE_Asynch_Write_Dgram_Result_Impl::~ACE_Asynch_Write_Dgram_Result_Impl (void) -{ -} - -ACE_Asynch_Write_Dgram_Result_Impl::ACE_Asynch_Write_Dgram_Result_Impl (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ - diff --git a/dep/src/ace/Asynch_Pseudo_Task.cpp b/dep/src/ace/Asynch_Pseudo_Task.cpp deleted file mode 100644 index 891cb0cf4d0..00000000000 --- a/dep/src/ace/Asynch_Pseudo_Task.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// $Id: Asynch_Pseudo_Task.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Asynch_Pseudo_Task.h" - -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_signal.h" - -ACE_RCSID(ace, Asynch_Pseudo_Task, "$Id: Asynch_Pseudo_Task.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Asynch_Pseudo_Task::ACE_Asynch_Pseudo_Task () - : select_reactor_ (), // should be initialized before reactor_ - reactor_ (&select_reactor_, 0) // don't delete implementation -{ -} - -ACE_Asynch_Pseudo_Task::~ACE_Asynch_Pseudo_Task () -{ - this->stop (); -} - -int -ACE_Asynch_Pseudo_Task::start (void) -{ - if (this->reactor_.initialized () == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%N:%l:%p\n"), - ACE_TEXT ("start reactor is not initialized")), - -1); - - return this->activate () == -1 ? -1 : 0; // If started, return 0 -} - -int -ACE_Asynch_Pseudo_Task::stop (void) -{ - if (this->thr_count () == 0) // already stopped - return 0; - - if (this->reactor_.end_reactor_event_loop () == -1) - return -1; - - this->wait (); - this->reactor_.close (); - return 0; -} - -int -ACE_Asynch_Pseudo_Task::svc (void) -{ -#if !defined (ACE_WIN32) - - sigset_t RT_signals; - - sigemptyset (&RT_signals); - for (int si = ACE_SIGRTMIN; si <= ACE_SIGRTMAX; si++) - sigaddset (&RT_signals, si); - - if (ACE_OS::pthread_sigmask (SIG_BLOCK, &RT_signals, 0) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Error:(%P | %t):%p\n"), - ACE_TEXT ("pthread_sigmask"))); -#endif - - reactor_.owner (ACE_Thread::self ()); - reactor_.run_reactor_event_loop (); - - return 0; -} - -int -ACE_Asynch_Pseudo_Task::register_io_handler (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask, - int flg_suspend) -{ - // Register the handler with the reactor. - if (-1 == this->reactor_.register_handler (handle, handler, mask)) - return -1; - - if (flg_suspend == 0) - return 0; - - // Suspend the handle now. Enable only when the accept is issued - // by the application. - if (this->reactor_.suspend_handler (handle) == -1) - { - ACE_ERROR - ((LM_ERROR, - ACE_TEXT ("%N:%l:%p\n"), - ACE_TEXT ("register_io_handler (suspended)"))); - this->reactor_.remove_handler (handle, ACE_Event_Handler::ALL_EVENTS_MASK - | ACE_Event_Handler::DONT_CALL); - return -1; - } - - return 0; -} - -int -ACE_Asynch_Pseudo_Task::remove_io_handler (ACE_HANDLE handle) -{ - return this->reactor_.remove_handler (handle, - ACE_Event_Handler::ALL_EVENTS_MASK - | ACE_Event_Handler::DONT_CALL); -} - -int -ACE_Asynch_Pseudo_Task::remove_io_handler (ACE_Handle_Set &set) -{ - return this->reactor_.remove_handler (set, ACE_Event_Handler::ALL_EVENTS_MASK - | ACE_Event_Handler::DONT_CALL); -} - -int -ACE_Asynch_Pseudo_Task::suspend_io_handler (ACE_HANDLE handle) -{ - return this->reactor_.suspend_handler (handle); -} - -int -ACE_Asynch_Pseudo_Task::resume_io_handler (ACE_HANDLE handle) -{ - return this->reactor_.resume_handler (handle); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Atomic_Op.cpp b/dep/src/ace/Atomic_Op.cpp deleted file mode 100644 index 473c482adcd..00000000000 --- a/dep/src/ace/Atomic_Op.cpp +++ /dev/null @@ -1,311 +0,0 @@ -// $Id: Atomic_Op.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Atomic_Op.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID (ace, - Atomic_Op, - "$Id: Atomic_Op.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/Atomic_Op.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) - -#if defined (ACE_INCLUDE_ATOMIC_OP_SPARC) -# include "ace/Atomic_Op_Sparc.h" -#endif /* ACE_INCLUDE_ATOMIC_OP_SPARC */ - -namespace { - -#if defined (_MSC_VER) -// Disable "no return value" warning, as we will be putting -// the return values directly into the EAX register. -#pragma warning (push) -#pragma warning (disable: 4035) -#endif /* _MSC_VER */ - -long -single_cpu_increment (volatile long *value) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - long tmp = 1; - unsigned long addr = reinterpret_cast (value); - asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); - return tmp + 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_add_long ( - reinterpret_cast (value), 1); -#elif defined(__GNUC__) && defined(PPC) - long tmp; - asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); - asm("addi %0,%0,1" : "+r" (tmp) ); - asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); - return tmp; -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -single_cpu_decrement (volatile long *value) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - long tmp = -1; - unsigned long addr = reinterpret_cast (value); - asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); - return tmp - 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_add_long ( - reinterpret_cast (value), -1); -#elif defined(__GNUC__) && defined(PPC) - long tmp; - asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); - asm("addi %0,%0,-1" : "+r" (tmp) ); - asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); - return tmp; -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -single_cpu_exchange (volatile long *value, long rhs) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned long addr = reinterpret_cast (value); - asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); - return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_swap_long ( - reinterpret_cast (value), rhs); -#elif defined(__GNUC__) && defined(PPC) - long tmp; - asm("lwz %0,%1" : "=r" (tmp) : "m" (rhs) ); - asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); - return tmp; -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -single_cpu_exchange_add (volatile long *value, long rhs) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned long addr = reinterpret_cast (value); - asm( "xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); - return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_swap_add_long ( - reinterpret_cast (value), rhs); -#elif defined(__GNUC__) && defined(PPC) - long tmp; - asm("add %0,%1,%2" : "=r" (tmp) : "r" (*value), "r" (rhs) ); - asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); - return tmp; -#elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) -# if defined (_MSC_VER) - __asm - { - mov eax, rhs - mov edx, value - xadd [edx], eax - } - // Return value is already in EAX register. -# elif defined (__BORLANDC__) - _EAX = rhs; - _EDX = reinterpret_cast (value); - __emit__(0x0F, 0xC1, 0x02); // xadd [edx], eax - // Return value is already in EAX register. -# else /* _MSC_VER */ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -# endif /* _MSC_VER */ -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -multi_cpu_increment (volatile long *value) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - long tmp = 1; - unsigned long addr = reinterpret_cast (value); - asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); - return tmp + 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_add_long ( - reinterpret_cast (value), 1); -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -multi_cpu_decrement (volatile long *value) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - long tmp = -1; - unsigned long addr = reinterpret_cast (value); - asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); - return tmp - 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_add_long ( - reinterpret_cast (value), -1); -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -multi_cpu_exchange (volatile long *value, long rhs) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned long addr = reinterpret_cast (value); - // The XCHG instruction automatically follows LOCK semantics - asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); - return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_swap_long ( - reinterpret_cast (value), rhs); -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -long -multi_cpu_exchange_add (volatile long *value, long rhs) -{ -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned long addr = reinterpret_cast (value); - asm( "lock ; xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); - return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) - return ace_atomic_swap_add_long ( - reinterpret_cast (value), rhs); -#elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) -# if defined (_MSC_VER) - __asm - { - mov eax, rhs - mov edx, value - lock xadd [edx], eax - } - // Return value is already in EAX register. -# elif defined (__BORLANDC__) - _EAX = rhs; - _EDX = reinterpret_cast (value); - __emit__(0xF0, 0x0F, 0xC1, 0x02); // lock xadd [edx], eax - // Return value is already in EAX register. -# else /* _MSC_VER */ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -# endif /* _MSC_VER */ -#else /* ACE_HAS_INTEL_ASSEMBLY*/ - ACE_UNUSED_ARG (value); - ACE_UNUSED_ARG (rhs); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_INTEL_ASSEMBLY*/ -} - -#if defined (_MSC_VER) -#pragma warning (pop) -#endif /* _MSC_VER */ - -} // end namespace - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -long (*ACE_Atomic_Op::increment_fn_) (volatile long *) = multi_cpu_increment; -long (*ACE_Atomic_Op::decrement_fn_) (volatile long *) = multi_cpu_decrement; -long (*ACE_Atomic_Op::exchange_fn_) (volatile long *, long) = multi_cpu_exchange; -long (*ACE_Atomic_Op::exchange_add_fn_) (volatile long *, long) = multi_cpu_exchange_add; - -void -ACE_Atomic_Op::init_functions (void) -{ - if (ACE_OS::num_processors () == 1) - { - increment_fn_ = single_cpu_increment; - decrement_fn_ = single_cpu_decrement; - exchange_fn_ = single_cpu_exchange; - exchange_add_fn_ = single_cpu_exchange_add; - } - else - { - increment_fn_ = multi_cpu_increment; - decrement_fn_ = multi_cpu_decrement; - exchange_fn_ = multi_cpu_exchange; - exchange_add_fn_ = multi_cpu_exchange_add; - } -} - -void -ACE_Atomic_Op::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -long (*ACE_Atomic_Op::increment_fn_) (volatile long *) = multi_cpu_increment; -long (*ACE_Atomic_Op::decrement_fn_) (volatile long *) = multi_cpu_decrement; -long (*ACE_Atomic_Op::exchange_fn_) (volatile long *, long) = multi_cpu_exchange; -long (*ACE_Atomic_Op::exchange_add_fn_) (volatile long *, long) = multi_cpu_exchange_add; - -void -ACE_Atomic_Op::init_functions (void) -{ - if (ACE_OS::num_processors () == 1) - { - increment_fn_ = single_cpu_increment; - decrement_fn_ = single_cpu_decrement; - exchange_fn_ = single_cpu_exchange; - exchange_add_fn_ = single_cpu_exchange_add; - } - else - { - increment_fn_ = multi_cpu_increment; - decrement_fn_ = multi_cpu_decrement; - exchange_fn_ = multi_cpu_exchange; - exchange_add_fn_ = multi_cpu_exchange_add; - } -} - -void -ACE_Atomic_Op::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ - diff --git a/dep/src/ace/Atomic_Op_Sparc.c b/dep/src/ace/Atomic_Op_Sparc.c deleted file mode 100644 index 842673e58cc..00000000000 --- a/dep/src/ace/Atomic_Op_Sparc.c +++ /dev/null @@ -1,187 +0,0 @@ -/* $Id: Atomic_Op_Sparc.c 80826 2008-03-04 14:51:23Z wotte $ - * - * This is a C file for a reason. The Sun C++ compiler does not accept - * inline assembler. - * - * Portions of this code are based on atomic operations found in the - * linux kernel source code. - */ - -#if defined (ACE_INCLUDE_ATOMIC_OP_SPARC) - -#if defined(__i386) && defined(__SUNPRO_C) -static void -__sunpro_asm_code() { - __asm("\n\ - .globl ace_atomic_add_long \n\ - .type ace_atomic_add_long,@function \n\ - .align 4 \n\ -ace_atomic_add_long: \n\ - movl 0x00000004(%esp), %edx \n\ - movl 0x00000008(%esp), %eax \n\ - lock; xadd %eax, (%edx) \n\ - addl 0x00000008(%esp), %eax \n\ - ret \n\ - "); - - __asm("\n\ - .globl ace_atomic_swap_long \n\ - .type ace_atomic_swap_long,@function \n\ - .align 4 \n\ -ace_atomic_swap_long: \n\ - movl 0x00000004(%esp), %edx \n\ - movl 0x00000008(%esp), %eax \n\ - xchg %eax, (%edx) \n\ - ret \n\ - "); - - __asm("\n\ - .globl ace_atomic_swap_add_long \n\ - .type ace_atomic_swap_add_long,@function \n\ - .align 4 \n\ -ace_atomic_swap_add_long: \n\ - movl 0x00000004(%esp), %edx \n\ - movl 0x00000008(%esp), %eax \n\ - lock; xadd %eax, (%edx) \n\ - ret \n\ - "); -} - -#elif defined(__x86_64) && defined(__SUNPRO_C) - -static void -__sunpro_asm_code() { - __asm("\n\ - .globl ace_atomic_add_long \n\ - .type ace_atomic_add_long,@function \n\ - .align 16 \n\ -ace_atomic_add_long: \n\ - movq %rsi, %rax \n\ - lock; xaddq %rax, (%rdi) \n\ - addq %rsi, %rax \n\ - ret \n\ - "); - - __asm("\n\ - .globl ace_atomic_swap_long \n\ - .type ace_atomic_swap_long,@function \n\ - .align 16 \n\ -ace_atomic_swap_long: \n\ - xchgq %rsi, (%rdi) \n\ - movq %rsi, %rax \n\ - ret \n\ - "); - - __asm("\n\ - .globl ace_atomic_swap_add_long \n\ - .type ace_atomic_swap_add_long,@function \n\ - .align 16 \n\ -ace_atomic_swap_add_long: \n\ - lock; xaddq %rsi, (%rdi) \n\ - movq %rsi, %rax \n\ - ret \n\ - "); -} - -#elif defined (__sparcv9) - -unsigned long -ace_atomic_add_long (volatile unsigned long *dest, long rhs) -{ - __asm ("restore\n" - "ldx [%o0], %o2\n" - ".again_add:\n" - "add %o2, %o1, %o3\n" - "casx [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %xcc, .again_add\n" - "mov %o3, %o2\n" - "retl\n" - "add %o2, %o1, %o0\n"); -} - -unsigned long -ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs) -{ - __asm ("restore\n" - "ldx [%o0], %o2\n" - ".again_swap:\n" - "mov %o1, %o3\n" - "casx [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %xcc, .again_swap\n" - "mov %o3, %o2\n" - "retl\n" - "mov %o3, %o0\n"); -} - -unsigned long -ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs) -{ - __asm ("restore\n" - "ldx [%o0], %o2\n" - ".again_swap_add:\n" - "mov %o2, %o4\n" - "add %o2, %o1, %o3\n" - "casx [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %xcc, .again_swap_add\n" - "mov %o3, %o2\n" - "retl\n" - "mov %o4, %o0\n"); -} - -#else - -unsigned long -ace_atomic_add_long (volatile unsigned long *dest, long rhs) -{ - __asm ("restore\n" - "ld [%o0], %o2\n" - ".again_add:\n" - "add %o2, %o1, %o3\n" - "cas [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %icc, .again_add\n" - "mov %o3, %o2\n" - "retl\n" - "add %o2, %o1, %o0\n"); -} - -unsigned long -ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs) -{ - __asm ("restore\n" - "ld [%o0], %o2\n" - ".again_swap:\n" - "mov %o1, %o3\n" - "cas [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %icc, .again_swap\n" - "mov %o3, %o2\n" - "retl\n" - "mov %o3, %o0\n"); -} - -unsigned long -ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs) -{ - __asm ("restore\n" - "ld [%o0], %o2\n" - ".again_swap_add:\n" - "mov %o2, %o4\n" - "add %o2, %o1, %o3\n" - "cas [%o0], %o2, %o3\n" - "cmp %o2, %o3\n" - "bne,pn %icc, .again_swap_add\n" - "mov %o3, %o2\n" - "retl\n" - "mov %o4, %o0\n"); -} - -# endif /* __sparcv9 */ - -#elif !defined (__GNUC__) && !defined (__INTEL_COMPILER) -/* Make compilers stop complaining about an empty translation unit */ -static int shut_up_compiler = 0; -#endif /* ACE_INCLUDE_ATOMIC_OP_SPARC */ diff --git a/dep/src/ace/Atomic_Op_T.cpp b/dep/src/ace/Atomic_Op_T.cpp deleted file mode 100644 index bb47112e10a..00000000000 --- a/dep/src/ace/Atomic_Op_T.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef ACE_ATOMIC_OP_T_CPP -#define ACE_ATOMIC_OP_T_CPP - -#include "ace/Atomic_Op_T.h" - -#ifdef ACE_HAS_DUMP -# include "ace/Log_Msg.h" -#endif /* ACE_HAS_DUMP */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Atomic_Op_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op_Ex) -ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op) - -ACE_RCSID(ace, Atomic_Op_T, "$Id: Atomic_Op_T.cpp 80826 2008-03-04 14:51:23Z wotte $") - -// ************************************************* -template ACE_LOCK & -ACE_Atomic_Op_Ex::mutex (void) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::mutex"); - return this->mutex_; -} - -template -void -ACE_Atomic_Op_Ex::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Atomic_Op_Ex::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->mutex_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex (ACE_LOCK & mtx) - : mutex_ (mtx) - , value_ (0) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex"); -} - -template -ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex ( - ACE_LOCK & mtx, - typename ACE_Atomic_Op_Ex::arg_type c) - : mutex_ (mtx) - , value_ (c) -{ - // ACE_TRACE ("ACE_Atomic_Op_Ex::ACE_Atomic_Op_Ex"); -} - -// **************************************************************** - -template -ACE_Atomic_Op::ACE_Atomic_Op (void) - : impl_ (this->own_mutex_) -{ - // ACE_TRACE ("ACE_Atomic_Op::ACE_Atomic_Op"); -} - -template -ACE_Atomic_Op::ACE_Atomic_Op ( - typename ACE_Atomic_Op::arg_type c) - : impl_ (own_mutex_, c) -{ - // ACE_TRACE ("ACE_Atomic_Op::ACE_Atomic_Op"); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_ATOMIC_OP_T_CPP */ - diff --git a/dep/src/ace/Auto_Event.cpp b/dep/src/ace/Auto_Event.cpp deleted file mode 100644 index 875b7ad05cd..00000000000 --- a/dep/src/ace/Auto_Event.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// $Id: Auto_Event.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Auto_Event.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Auto_Event.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - Auto_Event, - "$Id: Auto_Event.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Auto_Event::ACE_Auto_Event (int initial_state, - int type, - const char *name, - void *arg) - : ACE_Event (0, - initial_state, - type, - ACE_TEXT_CHAR_TO_TCHAR (name), - arg) -{ -} - -#if defined (ACE_HAS_WCHAR) -ACE_Auto_Event::ACE_Auto_Event (int initial_state, - int type, - const wchar_t *name, - void *arg) - : ACE_Event (0, - initial_state, - type, - ACE_TEXT_WCHAR_TO_TCHAR (name), - arg) -{ -} -#endif /* ACE_HAS_WCHAR */ - -void -ACE_Auto_Event::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_Event::dump (); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Auto_Functor.cpp b/dep/src/ace/Auto_Functor.cpp deleted file mode 100644 index f0f8296e0be..00000000000 --- a/dep/src/ace/Auto_Functor.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// $Id: Auto_Functor.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_AUTO_FUNCTOR_CPP -#define ACE_AUTO_FUNCTOR_CPP - -#include "ace/Auto_Functor.h" - -#if !defined(__ACE_INLINE__) -# include "ace/Auto_Functor.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Utils::Auto_Functor::~Auto_Functor() -{ - reset(0); -} - -template void -ACE_Utils::Auto_Functor::reset(X * p) -{ - if(p_ != 0) - { - f_(p_); - } - p_ = p; -} - -templatevoid -ACE_Utils::Auto_Functor::reset(X * p, Functor f) -{ - reset(p); - f_ = f; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /*ACE_AUTO_FUNCTOR_CPP*/ - diff --git a/dep/src/ace/Auto_IncDec_T.cpp b/dep/src/ace/Auto_IncDec_T.cpp deleted file mode 100644 index 668b4c81cdc..00000000000 --- a/dep/src/ace/Auto_IncDec_T.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// $Id: Auto_IncDec_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_AUTO_INCDEC_T_CPP -#define ACE_AUTO_INCDEC_T_CPP - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Auto_IncDec_T.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Auto_IncDec_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_IncDec) - -template void -ACE_Auto_IncDec::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Auto_IncDec::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_AUTO_INCDEC_T_CPP */ - diff --git a/dep/src/ace/Auto_Ptr.cpp b/dep/src/ace/Auto_Ptr.cpp deleted file mode 100644 index 56fc9af0ee5..00000000000 --- a/dep/src/ace/Auto_Ptr.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// $Id: Auto_Ptr.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_AUTO_PTR_CPP -#define ACE_AUTO_PTR_CPP - -#include "ace/Auto_Ptr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Auto_Ptr.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Auto_Ptr, "$Id: Auto_Ptr.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Ptr) -ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Array_Ptr) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_AUTO_PTR_CPP */ - diff --git a/dep/src/ace/Barrier.cpp b/dep/src/ace/Barrier.cpp deleted file mode 100644 index 515a73f95a9..00000000000 --- a/dep/src/ace/Barrier.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// $Id: Barrier.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Barrier.h" - -#if defined (ACE_HAS_THREADS) - -#if !defined (__ACE_INLINE__) -#include "ace/Barrier.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Guard_T.h" -#include "ace/OS_NS_errno.h" - -#if defined (ACE_HAS_DUMP) -# include "ace/Log_Msg.h" -#endif /* ACE_HAS_DUMP */ - -ACE_RCSID (ace, - Barrier, - "$Id: Barrier.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Sub_Barrier) - -void -ACE_Sub_Barrier::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Sub_Barrier::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->barrier_finished_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("running_threads_ = %d"), this->running_threads_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Sub_Barrier::ACE_Sub_Barrier (unsigned int count, - ACE_Thread_Mutex &lock, - const ACE_TCHAR *name, - void *arg) - : barrier_finished_ (lock, name, arg), - running_threads_ (count) -{ -// ACE_TRACE ("ACE_Sub_Barrier::ACE_Sub_Barrier"); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Barrier) - -void -ACE_Barrier::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Barrier::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("current_generation_ = %d"), this->current_generation_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncount_ = %d"), this->count_)); - this->sub_barrier_1_.dump (); - this->sub_barrier_2_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Barrier::ACE_Barrier (unsigned int count, - const ACE_TCHAR *name, - void *arg) - : lock_ (name, (ACE_mutexattr_t *) arg), - current_generation_ (0), - count_ (count), - sub_barrier_1_ (count, lock_, name, arg), - sub_barrier_2_ (count, lock_, name, arg) -{ - ACE_TRACE ("ACE_Barrier::ACE_Barrier"); - this->sub_barrier_[0] = &this->sub_barrier_1_; - this->sub_barrier_[1] = &this->sub_barrier_2_; -} - -int -ACE_Barrier::wait (void) -{ - ACE_TRACE ("ACE_Barrier::wait"); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1); - - ACE_Sub_Barrier *sbp = - this->sub_barrier_[this->current_generation_]; - - // Check for shutdown... - if (sbp == 0) - { - errno = ESHUTDOWN; - return -1; - } - - int retval = 0; - - if (sbp->running_threads_ == 1) - { - // We're the last running thread, so swap generations and tell - // all the threads waiting on the barrier to continue on their - // way. - sbp->running_threads_ = this->count_; - // Swap generations. - this->current_generation_ = 1 - this->current_generation_; - sbp->barrier_finished_.broadcast (); - } - else - { - --sbp->running_threads_; - - // Block until all the other threads wait(). - while (sbp->running_threads_ != this->count_) - sbp->barrier_finished_.wait (); - - // We're awake and the count has completed. See if it completed - // because all threads hit the barrier, or because the barrier - // was shut down. - if (this->sub_barrier_[this->current_generation_] == 0) - { - errno = ESHUTDOWN; - retval = -1; - } - } - - return retval; -} - -int -ACE_Barrier::shutdown (void) -{ - ACE_TRACE ("ACE_Barrier::shutdown"); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1); - - ACE_Sub_Barrier *sbp = - this->sub_barrier_[this->current_generation_]; - - // Check for shutdown... - if (sbp == 0) - { - errno = ESHUTDOWN; - return -1; - } - - // Flag the shutdown - this->sub_barrier_[0] = 0; - this->sub_barrier_[1] = 0; - // Tell all the threads waiting on the barrier to continue on their way. - sbp->running_threads_ = this->count_; - sbp->barrier_finished_.broadcast (); - - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Barrier) - -ACE_Thread_Barrier::ACE_Thread_Barrier (unsigned int count, - const ACE_TCHAR *name) - : ACE_Barrier (count, name) -{ -// ACE_TRACE ("ACE_Thread_Barrier::ACE_Thread_Barrier"); -} - -void -ACE_Thread_Barrier::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Thread_Barrier::dump"); - ACE_Barrier::dump (); -#endif /* ACE_HAS_DUMP */ -} - -#if 0 -ACE_ALLOC_HOOK_DEFINE(ACE_Process_Barrier) - -ACE_Process_Barrier::ACE_Process_Barrier (u_int count, - const ACE_TCHAR *name) - : ACE_Barrier (count, USYNC_PROCESS, name) -{ -// ACE_TRACE ("ACE_Process_Barrier::ACE_Process_Barrier"); -} - -void -ACE_Process_Barrier::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Process_Barrier::dump"); - ACE_Barrier::dump (); -#endif /* ACE_HAS_DUMP */ -} -#endif /* 0 */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - diff --git a/dep/src/ace/Base_Thread_Adapter.cpp b/dep/src/ace/Base_Thread_Adapter.cpp deleted file mode 100644 index d74f1934161..00000000000 --- a/dep/src/ace/Base_Thread_Adapter.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// $Id: Base_Thread_Adapter.cpp 81239 2008-04-04 22:28:48Z iliyan $ - -#include "ace/Base_Thread_Adapter.h" - -ACE_RCSID (ace, - Base_Thread_Adapter, - "$Id: Base_Thread_Adapter.cpp 81239 2008-04-04 22:28:48Z iliyan $") - -#if !defined (ACE_HAS_INLINED_OSCALLS) -# include "ace/Base_Thread_Adapter.inl" -#endif /* ACE_HAS_INLINED_OSCALLS */ - -#if defined (ACE_HAS_TSS_EMULATION) -# include "ace/OS_NS_Thread.h" -#endif /* ACE_HAS_TSS_EMULATION */ - -#include "ace/Service_Config.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::init_log_msg_hook_ = 0; -ACE_INHERIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = 0; -ACE_CLOSE_LOG_MSG_HOOK ACE_Base_Thread_Adapter::close_log_msg_hook_ = 0; -ACE_SYNC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::sync_log_msg_hook_ = 0; -ACE_THR_DESC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = 0; - -ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter ( - ACE_THR_FUNC user_func, - void *arg, - ACE_THR_C_FUNC entry_point, - ACE_OS_Thread_Descriptor *td -#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector - , ACE_SEH_EXCEPT_HANDLER handler -#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ) - : user_func_ (user_func) - , arg_ (arg) - , entry_point_ (entry_point) - , thr_desc_ (td) - , ctx_ (ACE_Service_Config::current()) -{ - ACE_OS_TRACE ("ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter"); - - if (ACE_Base_Thread_Adapter::init_log_msg_hook_ != 0) - (*ACE_Base_Thread_Adapter::init_log_msg_hook_) ( - this->log_msg_attributes_ -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , selector - , handler -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ); -#ifdef ACE_USES_GPROF - getitimer (ITIMER_PROF, &itimer_); -#endif // ACE_USES_GPROF -} - -ACE_Base_Thread_Adapter::~ACE_Base_Thread_Adapter (void) -{ -} - -void -ACE_Base_Thread_Adapter::inherit_log_msg (void) -{ - if (ACE_Base_Thread_Adapter::inherit_log_msg_hook_ != 0) - (*ACE_Base_Thread_Adapter::inherit_log_msg_hook_)( - this->thr_desc_, - this->log_msg_attributes_); - - // Initialize the proper configuration context for the new thread - // Placed here since inherit_log_msg() gets called from any of our - // descendants (before self-destructing) - ACE_Service_Config::current (this->ctx_); -} - -void -ACE_Base_Thread_Adapter::close_log_msg (void) -{ - if (ACE_Base_Thread_Adapter::close_log_msg_hook_ != 0) - (*ACE_Base_Thread_Adapter::close_log_msg_hook_) (); -} - -void -ACE_Base_Thread_Adapter::sync_log_msg (const ACE_TCHAR *prg) -{ - if (ACE_Base_Thread_Adapter::sync_log_msg_hook_ != 0) - (*ACE_Base_Thread_Adapter::sync_log_msg_hook_) (prg); -} - -ACE_OS_Thread_Descriptor * -ACE_Base_Thread_Adapter::thr_desc_log_msg (void) -{ - if (ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ != 0) - return (*ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_) (); - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -// Run the thread entry point for the . This must -// be an extern "C" to make certain compilers happy... - -extern "C" ACE_THR_FUNC_RETURN -ACE_THREAD_ADAPTER_NAME (void *args) -{ - ACE_OS_TRACE ("ACE_THREAD_ADAPTER_NAME"); - -#if defined (ACE_HAS_TSS_EMULATION) - // As early as we can in the execution of the new thread, allocate - // its local TS storage. Allocate it on the stack, to save dynamic - // allocation/dealloction. - void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; - ACE_TSS_Emulation::tss_open (ts_storage); -#endif /* ACE_HAS_TSS_EMULATION */ - - ACE_Base_Thread_Adapter * const thread_args = - static_cast (args); - -#ifdef ACE_USES_GPROF - setitimer (ITIMER_PROF, thread_args->timerval (), 0); -#endif // ACE_USES_GPROF - - // Invoke the user-supplied function with the args. - ACE_THR_FUNC_RETURN status = thread_args->invoke (); - - return status; -} - - diff --git a/dep/src/ace/Based_Pointer_Repository.cpp b/dep/src/ace/Based_Pointer_Repository.cpp deleted file mode 100644 index c9bf92f78ee..00000000000 --- a/dep/src/ace/Based_Pointer_Repository.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// $Id: Based_Pointer_Repository.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Map_Manager.h" -#include "ace/Based_Pointer_Repository.h" -#include "ace/Guard_T.h" -#include "ace/Null_Mutex.h" -#include "ace/Synch_Traits.h" -#include "ace/RW_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Based_Pointer_Repository_Rep - * - * @brief Implementation for the ACE_Based_Pointer_Repository. - * - * Every memory pool in ACE binds it's mapping base address and - * the mapped size to this repository every time it maps/remaps a - * new chunk of memory successfully. - */ -class ACE_Based_Pointer_Repository_Rep -{ -public: - // Useful typedefs. - typedef ACE_Map_Manager MAP_MANAGER; - typedef ACE_Map_Iterator MAP_ITERATOR; - typedef ACE_Map_Entry MAP_ENTRY; - - /// Keeps track of the mapping between addresses and their associated - /// values. - MAP_MANAGER addr_map_; - - /// Synchronize concurrent access to the map. - ACE_SYNCH_MUTEX lock_; -}; - -ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository (void) -{ - ACE_TRACE ("ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository"); - ACE_NEW (this->rep_, - ACE_Based_Pointer_Repository_Rep); -} - -ACE_Based_Pointer_Repository::~ACE_Based_Pointer_Repository (void) -{ - ACE_TRACE ("ACE_Based_Pointer_Repository::~ACE_Based_Pointer_Repository"); - delete this->rep_; -} - -// Search for appropriate base address in repository - -int -ACE_Based_Pointer_Repository::find (void *addr, void *&base_addr) -{ - ACE_TRACE ("ACE_Based_Pointer_Repository::find"); - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); - ACE_Based_Pointer_Repository_Rep::MAP_ENTRY *ce = 0; - - for (ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR iter (this->rep_->addr_map_); - iter.next (ce) != 0; - iter.advance ()) - // Check to see if is within any of the regions. - if (addr >= ce->ext_id_ - && addr < ((char *)ce->ext_id_ + ce->int_id_)) - { - // Assign the base address. - base_addr = ce->ext_id_; - return 1; - } - - // Assume base address 0 (e.g., if new'ed). - base_addr = 0; - return 0; -} - -// Bind a new entry to the repository or update the size of an -// existing entry. - -int -ACE_Based_Pointer_Repository::bind (void *addr, size_t size) -{ - ACE_TRACE ("ACE_Based_Pointer_Repository::bind"); - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); - - return this->rep_->addr_map_.rebind (addr, size); -} - -// Unbind a base from the repository. - -int -ACE_Based_Pointer_Repository::unbind (void *addr) -{ - ACE_TRACE ("ACE_Based_Pointer_Repository::unbind"); - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); - ACE_Based_Pointer_Repository_Rep::MAP_ENTRY *ce = 0; - - // Search for service handlers that requested notification. - - for (ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR iter (this->rep_->addr_map_); - iter.next (ce) != 0; - iter.advance ()) - { - // Check to see if is within any of the regions and if - // so, unbind the key from the map. - if (addr >= ce->ext_id_ - && addr < ((char *)ce->ext_id_ + ce->int_id_)) - // Unbind base address. - return this->rep_->addr_map_.unbind (ce->ext_id_); - } - - return 0; -} - -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton * - ACE_Singleton::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Based_Pointer_T.cpp b/dep/src/ace/Based_Pointer_T.cpp deleted file mode 100644 index 81943797418..00000000000 --- a/dep/src/ace/Based_Pointer_T.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// $Id: Based_Pointer_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_BASED_POINTER_T_CPP -#define ACE_BASED_POINTER_T_CPP - -#include "ace/Based_Pointer_T.h" -#include "ace/Based_Pointer_Repository.h" -#include "ace/Log_Msg.h" - -# define ACE_TRACEX(X) ACE_Trace ____ (ACE_TEXT (X), __LINE__, ACE_TEXT (__FILE__)) - -#if !defined (__ACE_INLINE__) -#include "ace/Based_Pointer_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Based_Pointer::ACE_Based_Pointer (void) -{ - ACE_TRACE ("ACE_Based_Pointer::ACE_Based_Pointer"); -} - -template void -ACE_Based_Pointer_Basic::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Based_Pointer_Basic::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntarget_ = %d\n"), this->target_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base_offset_ = %d\n"), this->base_offset_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("computed pointer = %x\n"), - (CONCRETE *)(ACE_COMPUTE_BASED_POINTER (this)))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Based_Pointer::ACE_Based_Pointer (CONCRETE *initial) - : ACE_Based_Pointer_Basic (initial) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); -} - -template -ACE_Based_Pointer::ACE_Based_Pointer (const void* base_addr, int) - : ACE_Based_Pointer_Basic (base_addr, 0) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); -} - -template -ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic (void) - : target_ (0), - base_offset_ (0) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); - void *base_addr = 0; - - // Find the base address associated with our pointer. Note - // that it's ok for to return 0, which simply indicates that - // the address is not in memory-mapped virtual address space. - ACE_BASED_POINTER_REPOSITORY::instance ()->find (this, - base_addr); - this->base_offset_ = (char *) this - (char *) base_addr; -} - -template -ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic (const void *base_addr, int) - : target_ (0), - base_offset_ (0) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); - this->base_offset_ = (char *) this - (char *) base_addr; -} - -template -ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic (CONCRETE *rhs) - : target_ (0), - base_offset_ (0) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); - - if (rhs == 0) - // Store a value of that indicate "NULL" pointer. - this->target_ = -1; - else - { - void *base_addr = 0; - - // Find the base address associated with the pointer. - // Note that it's ok for to return 0, which simply - // indicates that the address is not in memory-mapped virtual - // address space. - ACE_BASED_POINTER_REPOSITORY::instance ()->find (this, - base_addr); - this->base_offset_ = (char *) this - (char *) base_addr; - this->target_ = ((char *) rhs - (char *) base_addr); - } -} - -template -ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic &) -{ - ACE_TRACE ("ACE_Based_Pointer_Basic::ACE_Based_Pointer_Basic"); - - ACE_ASSERT (0); // not implemented. -} - -template -ACE_Based_Pointer::ACE_Based_Pointer (const ACE_Based_Pointer &rhs) - : ACE_Based_Pointer_Basic (rhs) -{ - ACE_TRACE ("ACE_Based_Pointer::ACE_Based_Pointer"); - ACE_ASSERT (0); // not implemented. -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_BASED_POINTER_T_CPP */ - diff --git a/dep/src/ace/Basic_Stats.cpp b/dep/src/ace/Basic_Stats.cpp deleted file mode 100644 index 760afa35e6d..00000000000 --- a/dep/src/ace/Basic_Stats.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id: Basic_Stats.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Basic_Stats.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Basic_Stats.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, - Basic_Stats, - "$Id: Basic_Stats.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Basic_Stats::accumulate (const ACE_Basic_Stats &rhs) -{ - if (rhs.samples_count_ == 0) - return; - - if (this->samples_count_ == 0) - { - this->min_ = rhs.min_; - this->min_at_ = rhs.min_at_; - - this->max_ = rhs.max_; - this->max_at_ = rhs.max_at_; - } - else - { - if (this->min_ > rhs.min_) - { - this->min_ = rhs.min_; - this->min_at_ = rhs.min_at_; - } - if (this->max_ < rhs.max_) - { - this->max_ = rhs.max_; - this->max_at_ = rhs.max_at_; - } - } - - this->samples_count_ += rhs.samples_count_; - this->sum_ += rhs.sum_; -} - -void -ACE_Basic_Stats::dump_results (const ACE_TCHAR *msg, ACE_UINT32 sf) const -{ -#ifndef ACE_NLOGGING - if (this->samples_count () == 0u) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%s : no data collected\n"), msg)); - return; - } - - ACE_UINT64 avg = this->sum_ / this->samples_count_; - - ACE_UINT64 l_min = this->min_ / sf; - ACE_UINT64 l_max = this->max_ / sf; - ACE_UINT64 l_avg = avg / sf; - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%s latency : %Q[%d]/%Q/%Q[%d] (min/avg/max)\n"), - msg, - l_min, this->min_at_, - l_avg, - l_max, this->max_at_)); - -#else - ACE_UNUSED_ARG (msg); - ACE_UNUSED_ARG (sf); -#endif /* ACE_NLOGGING */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Basic_Types.cpp b/dep/src/ace/Basic_Types.cpp deleted file mode 100644 index 2aebf729b64..00000000000 --- a/dep/src/ace/Basic_Types.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "ace/Basic_Types.h" - -#if !defined (__ACE_INLINE__) -# include "ace/Basic_Types.inl" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (ace, - Basic_Types, - "$Id: Basic_Types.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_LACKS_LONGLONG_T) && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T) -# include "ace/Log_Msg.h" -# include "ace/OS_NS_stdio.h" -# include "ace/OS_NS_string.h" -# if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -// FUZZ: disable check_for_streams_include -# include "ace/streams.h" -# endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_U_LongLong::output (FILE *file) const -{ - if (h_ () > 0) - ACE_OS::fprintf (file, "0x%lx%0*lx", h_ (), 2 * sizeof l_ (), l_ ()); - else - ACE_OS::fprintf (file, "0x%lx", l_ ()); -} - -ACE_TCHAR * -ACE_U_LongLong::as_string (ACE_TCHAR *output, - unsigned int base, - unsigned int uppercase) const -{ - if (*this == 0) - { - ACE_OS::strcpy(output, "0"); - } - else - { - switch(base) - { - case 8: - { - unsigned int index = 0; - int bshift = 31; - while(bshift >= 1) - { - unsigned int sval = (this->h_ () >> bshift) & 7; - if (sval > 0 || index != 0) - { - output[index] = sval + '0'; - ++index; - } - bshift -= 3; - } - bshift = 30; - while(bshift >= 0) - { - unsigned int sval = (this->l_ () >> bshift) & 7; - // Combine the last bit of hi with the first 3-bit digit - if (bshift == 30) - { - sval |= (this->h_ () & 1) << 2; - } - if (sval > 0 || index != 0) - { - output[index] = sval + '0'; - ++index; - } - bshift -= 3; - } - output[index] = '\0'; - break; - } - case 10: - { - ACE_OS::sprintf(output, "%.0f", *this / 1.0); - break; - } - case 16: - { - if (this->h_ () != 0) - { - ACE_OS::sprintf(output, - (uppercase ? "%lX%0*lX" : "%lx%0*lx"), - this->h_ (), 2 * sizeof this->l_ (), - this->l_ ()); - } - else - { - ACE_OS::sprintf(output, - (uppercase ? "%lX" : "%lx"), this->l_ ()); - - } - break; - } - default: - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Unsupported base = %u\n"), base)); - output[0] = '\0'; - } - } - } - - return output; -} - -# if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -ostream& -operator<< (ostream& os, const ACE_U_LongLong& ll) -{ -#ifdef __TANDEM && (__CPLUSPLUS_VERSION >= 3) - unsigned long flags = os.flags(); -#else - unsigned long flags = os.setf(0); -#endif - char buffer[32]; - - if ((flags & ios::oct) != 0) - os << ll.as_string (buffer, 8); - else if ((flags & ios::hex) != 0) - os << ll.as_string (buffer, 16, (flags & ios::uppercase)); - else - os << ll.as_string (buffer); - return os; -} -# endif - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_LONGLONG_T */ - - diff --git a/dep/src/ace/CDR_Base.cpp b/dep/src/ace/CDR_Base.cpp deleted file mode 100644 index e37dbb71c2f..00000000000 --- a/dep/src/ace/CDR_Base.cpp +++ /dev/null @@ -1,800 +0,0 @@ -#include "ace/CDR_Base.h" - -#if !defined (__ACE_INLINE__) -# include "ace/CDR_Base.inl" -#endif /* ! __ACE_INLINE__ */ - -#include "ace/Message_Block.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (ace, - CDR_Base, - "$Id: CDR_Base.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -#if defined (NONNATIVE_LONGDOUBLE) -static const ACE_INT16 max_eleven_bit = 0x3ff; -static const ACE_INT16 max_fifteen_bit = 0x3fff; -#endif /* NONNATIVE_LONGDOUBLE */ - -// -// See comments in CDR_Base.inl about optimization cases for swap_XX_array. -// - -void -ACE_CDR::swap_2_array (char const * orig, char* target, size_t n) -{ - // ACE_ASSERT(n > 0); The caller checks that n > 0 - - // We pretend that AMD64/GNU G++ systems have a Pentium CPU to - // take advantage of the inline assembly implementation. - - // Later, we try to read in 32 or 64 bit chunks, - // so make sure we don't do that for unaligned addresses. -#if ACE_SIZEOF_LONG == 8 && \ - !((defined(__amd64__) || defined (__x86_64__)) && defined(__GNUG__)) - char const * const o8 = ACE_ptr_align_binary (orig, 8); - while (orig < o8 && n > 0) - { - ACE_CDR::swap_2 (orig, target); - orig += 2; - target += 2; - --n; - } -#else - char const * const o4 = ACE_ptr_align_binary (orig, 4); - // this is an _if_, not a _while_. The mistmatch can only be by 2. - if (orig != o4) - { - ACE_CDR::swap_2 (orig, target); - orig += 2; - target += 2; - --n; - } -#endif - if (n == 0) - return; - - // - // Loop unrolling. Here be dragons. - // - - // (n & (~3)) is the greatest multiple of 4 not bigger than n. - // In the while loop ahead, orig will move over the array by 8 byte - // increments (4 elements of 2 bytes). - // end marks our barrier for not falling outside. - char const * const end = orig + 2 * (n & (~3)); - - // See if we're aligned for writting in 64 or 32 bit chunks... -#if ACE_SIZEOF_LONG == 8 && \ - !((defined(__amd64__) || defined (__x86_64__)) && defined(__GNUG__)) - if (target == ACE_ptr_align_binary (target, 8)) -#else - if (target == ACE_ptr_align_binary (target, 4)) -#endif - { - while (orig < end) - { -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned int a = - * reinterpret_cast (orig); - unsigned int b = - * reinterpret_cast (orig + 4); - asm ( "bswap %1" : "=r" (a) : "0" (a) ); - asm ( "bswap %1" : "=r" (b) : "0" (b) ); - asm ( "rol $16, %1" : "=r" (a) : "0" (a) ); - asm ( "rol $16, %1" : "=r" (b) : "0" (b) ); - * reinterpret_cast (target) = a; - * reinterpret_cast (target + 4) = b; -#elif defined(ACE_HAS_PENTIUM) \ - && (defined(_MSC_VER) || defined(__BORLANDC__)) \ - && !defined(ACE_LACKS_INLINE_ASSEMBLY) - __asm mov ecx, orig; - __asm mov edx, target; - __asm mov eax, [ecx]; - __asm mov ebx, 4[ecx]; - __asm bswap eax; - __asm bswap ebx; - __asm rol eax, 16; - __asm rol ebx, 16; - __asm mov [edx], eax; - __asm mov 4[edx], ebx; -#elif ACE_SIZEOF_LONG == 8 - // 64 bit architecture. - register unsigned long a = - * reinterpret_cast (orig); - - register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; - register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; - - a = (a1 | a2); - - * reinterpret_cast (target) = a; -#else - register ACE_UINT32 a = - * reinterpret_cast (orig); - register ACE_UINT32 b = - * reinterpret_cast (orig + 4); - - register ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; - register ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; - register ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8; - register ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8; - - a = (a1 | a2); - b = (b1 | b2); - - * reinterpret_cast (target) = a; - * reinterpret_cast (target + 4) = b; -#endif - orig += 8; - target += 8; - } - } - else - { - // We're out of luck. We have to write in 2 byte chunks. - while (orig < end) - { -#if defined (ACE_HAS_INTEL_ASSEMBLY) - unsigned int a = - * reinterpret_cast (orig); - unsigned int b = - * reinterpret_cast (orig + 4); - asm ( "bswap %1" : "=r" (a) : "0" (a) ); - asm ( "bswap %1" : "=r" (b) : "0" (b) ); - // We're little endian. - * reinterpret_cast (target + 2) - = (unsigned short) (a & 0xffff); - * reinterpret_cast (target + 6) - = (unsigned short) (b & 0xffff); - asm ( "shrl $16, %1" : "=r" (a) : "0" (a) ); - asm ( "shrl $16, %1" : "=r" (b) : "0" (b) ); - * reinterpret_cast (target + 0) - = (unsigned short) (a & 0xffff); - * reinterpret_cast (target + 4) - = (unsigned short) (b & 0xffff); -#elif defined (ACE_HAS_PENTIUM) \ - && (defined (_MSC_VER) || defined (__BORLANDC__)) \ - && !defined (ACE_LACKS_INLINE_ASSEMBLY) - __asm mov ecx, orig; - __asm mov edx, target; - __asm mov eax, [ecx]; - __asm mov ebx, 4[ecx]; - __asm bswap eax; - __asm bswap ebx; - // We're little endian. - __asm mov 2[edx], ax; - __asm mov 6[edx], bx; - __asm shr eax, 16; - __asm shr ebx, 16; - __asm mov 0[edx], ax; - __asm mov 4[edx], bx; -#elif ACE_SIZEOF_LONG == 8 - // 64 bit architecture. - register unsigned long a = - * reinterpret_cast (orig); - - register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; - register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; - - a = (a1 | a2); - - ACE_UINT16 b1 = static_cast (a >> 48); - ACE_UINT16 b2 = static_cast ((a >> 32) & 0xffff); - ACE_UINT16 b3 = static_cast ((a >> 16) & 0xffff); - ACE_UINT16 b4 = static_cast (a & 0xffff); - -#if defined(ACE_LITTLE_ENDIAN) - * reinterpret_cast (target) = b4; - * reinterpret_cast (target + 2) = b3; - * reinterpret_cast (target + 4) = b2; - * reinterpret_cast (target + 6) = b1; -#else - * reinterpret_cast (target) = b1; - * reinterpret_cast (target + 2) = b2; - * reinterpret_cast (target + 4) = b3; - * reinterpret_cast (target + 6) = b4; -#endif -#else - register ACE_UINT32 a = - * reinterpret_cast (orig); - register ACE_UINT32 b = - * reinterpret_cast (orig + 4); - - register ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; - register ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; - register ACE_UINT32 a2 = (a & 0xff00ff00) >> 8; - register ACE_UINT32 b2 = (b & 0xff00ff00) >> 8; - - a = (a1 | a2); - b = (b1 | b2); - - ACE_UINT32 c1 = static_cast (a >> 16); - ACE_UINT32 c2 = static_cast (a & 0xffff); - ACE_UINT32 c3 = static_cast (b >> 16); - ACE_UINT32 c4 = static_cast (b & 0xffff); - -#if defined(ACE_LITTLE_ENDIAN) - * reinterpret_cast (target) = c2; - * reinterpret_cast (target + 2) = c1; - * reinterpret_cast (target + 4) = c4; - * reinterpret_cast (target + 6) = c3; -#else - * reinterpret_cast (target) = c1; - * reinterpret_cast (target + 2) = c2; - * reinterpret_cast (target + 4) = c3; - * reinterpret_cast (target + 6) = c4; -#endif -#endif - - orig += 8; - target += 8; - } - } - - // (n & 3) == (n % 4). - switch (n&3) { - case 3: - ACE_CDR::swap_2 (orig, target); - orig += 2; - target += 2; - case 2: - ACE_CDR::swap_2 (orig, target); - orig += 2; - target += 2; - case 1: - ACE_CDR::swap_2 (orig, target); - } -} - -void -ACE_CDR::swap_4_array (char const * orig, char* target, size_t n) -{ - // ACE_ASSERT (n > 0); The caller checks that n > 0 - -#if ACE_SIZEOF_LONG == 8 - // Later, we read from *orig in 64 bit chunks, - // so make sure we don't generate unaligned readings. - char const * const o8 = ACE_ptr_align_binary (orig, 8); - // The mismatch can only be by 4. - if (orig != o8) - { - ACE_CDR::swap_4 (orig, target); - orig += 4; - target += 4; - --n; - } -#endif /* ACE_SIZEOF_LONG == 8 */ - - if (n == 0) - return; - - // - // Loop unrolling. Here be dragons. - // - - // (n & (~3)) is the greatest multiple of 4 not bigger than n. - // In the while loop, orig will move over the array by 16 byte - // increments (4 elements of 4 bytes). - // ends marks our barrier for not falling outside. - char const * const end = orig + 4 * (n & (~3)); - -#if ACE_SIZEOF_LONG == 8 - // 64 bits architecture. - // See if we can write in 8 byte chunks. - if (target == ACE_ptr_align_binary (target, 8)) - { - while (orig < end) - { - register unsigned long a = - * reinterpret_cast (orig); - register unsigned long b = - * reinterpret_cast (orig + 8); - -#if defined(ACE_HAS_INTEL_ASSEMBLY) - asm ("bswapq %1" : "=r" (a) : "0" (a)); - asm ("bswapq %1" : "=r" (b) : "0" (b)); - asm ("rol $32, %1" : "=r" (a) : "0" (a)); - asm ("rol $32, %1" : "=r" (b) : "0" (b)); -#else - register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; - register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; - register unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; - register unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; - register unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; - register unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; - register unsigned long a51 = (a & 0xff000000ff000000L) >> 24; - register unsigned long b51 = (b & 0xff000000ff000000L) >> 24; - - a = (a84 | a73 | a62 | a51); - b = (b84 | b73 | b62 | b51); -#endif - - * reinterpret_cast (target) = a; - * reinterpret_cast (target + 8) = b; - - orig += 16; - target += 16; - } - } - else - { - // We are out of luck, we have to write in 4 byte chunks. - while (orig < end) - { - register unsigned long a = - * reinterpret_cast (orig); - register unsigned long b = - * reinterpret_cast (orig + 8); - -#if defined(ACE_HAS_INTEL_ASSEMBLY) - asm ("bswapq %1" : "=r" (a) : "0" (a)); - asm ("bswapq %1" : "=r" (b) : "0" (b)); - asm ("rol $32, %1" : "=r" (a) : "0" (a)); - asm ("rol $32, %1" : "=r" (b) : "0" (b)); -#else - register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; - register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; - register unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; - register unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; - register unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; - register unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; - register unsigned long a51 = (a & 0xff000000ff000000L) >> 24; - register unsigned long b51 = (b & 0xff000000ff000000L) >> 24; - - a = (a84 | a73 | a62 | a51); - b = (b84 | b73 | b62 | b51); -#endif - - ACE_UINT32 c1 = static_cast (a >> 32); - ACE_UINT32 c2 = static_cast (a & 0xffffffff); - ACE_UINT32 c3 = static_cast (b >> 32); - ACE_UINT32 c4 = static_cast (b & 0xffffffff); - -#if defined (ACE_LITTLE_ENDIAN) - * reinterpret_cast (target + 0) = c2; - * reinterpret_cast (target + 4) = c1; - * reinterpret_cast (target + 8) = c4; - * reinterpret_cast (target + 12) = c3; -#else - * reinterpret_cast (target + 0) = c1; - * reinterpret_cast (target + 4) = c2; - * reinterpret_cast (target + 8) = c3; - * reinterpret_cast (target + 12) = c4; -#endif - orig += 16; - target += 16; - } - } - -#else /* ACE_SIZEOF_LONG != 8 */ - - while (orig < end) - { -#if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) - register unsigned int a = - *reinterpret_cast (orig); - register unsigned int b = - *reinterpret_cast (orig + 4); - register unsigned int c = - *reinterpret_cast (orig + 8); - register unsigned int d = - *reinterpret_cast (orig + 12); - - asm ("bswap %1" : "=r" (a) : "0" (a)); - asm ("bswap %1" : "=r" (b) : "0" (b)); - asm ("bswap %1" : "=r" (c) : "0" (c)); - asm ("bswap %1" : "=r" (d) : "0" (d)); - - *reinterpret_cast (target) = a; - *reinterpret_cast (target + 4) = b; - *reinterpret_cast (target + 8) = c; - *reinterpret_cast (target + 12) = d; -#elif defined (ACE_HAS_PENTIUM) \ - && (defined (_MSC_VER) || defined (__BORLANDC__)) \ - && !defined (ACE_LACKS_INLINE_ASSEMBLY) - __asm mov eax, orig - __asm mov esi, target - __asm mov edx, [eax] - __asm mov ecx, 4[eax] - __asm mov ebx, 8[eax] - __asm mov eax, 12[eax] - __asm bswap edx - __asm bswap ecx - __asm bswap ebx - __asm bswap eax - __asm mov [esi], edx - __asm mov 4[esi], ecx - __asm mov 8[esi], ebx - __asm mov 12[esi], eax -#else - register ACE_UINT32 a = - * reinterpret_cast (orig); - register ACE_UINT32 b = - * reinterpret_cast (orig + 4); - register ACE_UINT32 c = - * reinterpret_cast (orig + 8); - register ACE_UINT32 d = - * reinterpret_cast (orig + 12); - - // Expect the optimizer reordering this A LOT. - // We leave it this way for clarity. - a = (a << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8) | (a >> 24); - b = (b << 24) | ((b & 0xff00) << 8) | ((b & 0xff0000) >> 8) | (b >> 24); - c = (c << 24) | ((c & 0xff00) << 8) | ((c & 0xff0000) >> 8) | (c >> 24); - d = (d << 24) | ((d & 0xff00) << 8) | ((d & 0xff0000) >> 8) | (d >> 24); - - * reinterpret_cast (target) = a; - * reinterpret_cast (target + 4) = b; - * reinterpret_cast (target + 8) = c; - * reinterpret_cast (target + 12) = d; -#endif - - orig += 16; - target += 16; - } - -#endif /* ACE_SIZEOF_LONG == 8 */ - - // (n & 3) == (n % 4). - switch (n & 3) { - case 3: - ACE_CDR::swap_4 (orig, target); - orig += 4; - target += 4; - case 2: - ACE_CDR::swap_4 (orig, target); - orig += 4; - target += 4; - case 1: - ACE_CDR::swap_4 (orig, target); - } -} - -// -// We don't benefit from unrolling in swap_8_array and swap_16_array -// (swap_8 and swap_16 are big enough). -// -void -ACE_CDR::swap_8_array (char const * orig, char* target, size_t n) -{ - // ACE_ASSERT(n > 0); The caller checks that n > 0 - - char const * const end = orig + 8*n; - while (orig < end) - { - swap_8 (orig, target); - orig += 8; - target += 8; - } -} - -void -ACE_CDR::swap_16_array (char const * orig, char* target, size_t n) -{ - // ACE_ASSERT(n > 0); The caller checks that n > 0 - - char const * const end = orig + 16*n; - while (orig < end) - { - swap_16 (orig, target); - orig += 16; - target += 16; - } -} - -void -ACE_CDR::mb_align (ACE_Message_Block *mb) -{ -#if !defined (ACE_CDR_IGNORE_ALIGNMENT) - char * const start = ACE_ptr_align_binary (mb->base (), - ACE_CDR::MAX_ALIGNMENT); -#else - char * const start = mb->base (); -#endif /* ACE_CDR_IGNORE_ALIGNMENT */ - mb->rd_ptr (start); - mb->wr_ptr (start); -} - -int -ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize) -{ - size_t newsize = - ACE_CDR::first_size (minsize + ACE_CDR::MAX_ALIGNMENT); - - if (newsize <= mb->size ()) - return 0; - - ACE_Data_Block *db = - mb->data_block ()->clone_nocopy (0, newsize); - - if (db == 0) - return -1; - - // Do the equivalent of ACE_CDR::mb_align() here to avoid having - // to allocate an ACE_Message_Block on the stack thereby avoiding - // the manipulation of the data blocks reference count - size_t mb_len = mb->length (); - char *start = ACE_ptr_align_binary (db->base (), - ACE_CDR::MAX_ALIGNMENT); - - ACE_OS::memcpy (start, mb->rd_ptr (), mb_len); - mb->data_block (db); - - // Setting the data block on the mb resets the read and write - // pointers back to the beginning. We must set the rd_ptr to the - // aligned start and adjust the write pointer to the end - mb->rd_ptr (start); - mb->wr_ptr (start + mb_len); - - // Remove the DONT_DELETE flags from mb - mb->clr_self_flags (ACE_Message_Block::DONT_DELETE); - - return 0; -} - -size_t -ACE_CDR::total_length (const ACE_Message_Block* begin, - const ACE_Message_Block* end) -{ - size_t l = 0; - // Compute the total size. - for (const ACE_Message_Block *i = begin; - i != end; - i = i->cont ()) - l += i->length (); - return l; -} - -void -ACE_CDR::consolidate (ACE_Message_Block *dst, - const ACE_Message_Block *src) -{ - if (src == 0) - return; - - size_t newsize = - ACE_CDR::first_size (ACE_CDR::total_length (src, 0) - + ACE_CDR::MAX_ALIGNMENT); - dst->size (newsize); - -#if !defined (ACE_CDR_IGNORE_ALIGNMENT) - // We must copy the contents of into the new buffer, but - // respecting the alignment. - ptrdiff_t srcalign = - ptrdiff_t(src->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT; - ptrdiff_t dstalign = - ptrdiff_t(dst->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT; - ptrdiff_t offset = srcalign - dstalign; - if (offset < 0) - offset += ACE_CDR::MAX_ALIGNMENT; - dst->rd_ptr (static_cast (offset)); - dst->wr_ptr (dst->rd_ptr ()); -#endif /* ACE_CDR_IGNORE_ALIGNMENT */ - - for (const ACE_Message_Block* i = src; - i != 0; - i = i->cont ()) - { - // If the destination and source are the same, do not - // attempt to copy the data. Just update the write pointer. - if (dst->wr_ptr () != i->rd_ptr ()) - dst->copy (i->rd_ptr (), i->length ()); - else - dst->wr_ptr (i->length ()); - } -} - -#if defined (NONNATIVE_LONGLONG) -bool -ACE_CDR::LongLong::operator== (const ACE_CDR::LongLong &rhs) const -{ - return this->h == rhs.h && this->l == rhs.l; -} - -bool -ACE_CDR::LongLong::operator!= (const ACE_CDR::LongLong &rhs) const -{ - return this->l != rhs.l || this->h != rhs.h; -} - -#endif /* NONNATIVE_LONGLONG */ - -#if defined (NONNATIVE_LONGDOUBLE) -ACE_CDR::LongDouble& -ACE_CDR::LongDouble::assign (const ACE_CDR::LongDouble::NativeImpl& rhs) -{ - ACE_OS::memset (this->ld, 0, sizeof (this->ld)); - - if (sizeof (rhs) == 8) - { -#if defined (ACE_LITTLE_ENDIAN) - static const size_t byte_zero = 1; - static const size_t byte_one = 0; - char rhs_ptr[16]; - ACE_CDR::swap_8 (reinterpret_cast (&rhs), rhs_ptr); -#else - static const size_t byte_zero = 0; - static const size_t byte_one = 1; - const char* rhs_ptr = reinterpret_cast (&rhs); -#endif - ACE_INT16 sign = static_cast ( - static_cast (rhs_ptr[0])) & 0x8000; - ACE_INT16 exponent = ((rhs_ptr[0] & 0x7f) << 4) | - ((rhs_ptr[1] >> 4) & 0xf); - const char* exp_ptr = reinterpret_cast (&exponent); - - // Infinity and NaN have an exponent of 0x7ff in 64-bit IEEE - if (exponent == 0x7ff) - { - exponent = 0x7fff; - } - else - { - exponent = (exponent - max_eleven_bit) + max_fifteen_bit; - } - exponent |= sign; - - // Store the sign bit and exponent - this->ld[0] = exp_ptr[byte_zero]; - this->ld[1] = exp_ptr[byte_one]; - - // Store the mantissa. In an 8 byte double, it is split by - // 4 bits (because of the 12 bits for sign and exponent), so - // we have to shift and or the rhs to get the right bytes. - size_t li = 2; - bool direction = true; - for (size_t ri = 1; ri < sizeof (rhs);) - { - if (direction) - { - this->ld[li] |= ((rhs_ptr[ri] << 4) & 0xf0); - direction = false; - ++ri; - } - else - { - this->ld[li] |= ((rhs_ptr[ri] >> 4) & 0xf); - direction = true; - ++li; - } - } -#if defined (ACE_LITTLE_ENDIAN) - ACE_OS::memcpy (rhs_ptr, this->ld, sizeof (this->ld)); - ACE_CDR::swap_16 (rhs_ptr, this->ld); -#endif - } - else - { - ACE_OS::memcpy(this->ld, - reinterpret_cast (&rhs), sizeof (rhs)); - } - return *this; -} - -ACE_CDR::LongDouble& -ACE_CDR::LongDouble::assign (const ACE_CDR::LongDouble& rhs) -{ - if (this != &rhs) - *this = rhs; - return *this; -} - -bool -ACE_CDR::LongDouble::operator== (const ACE_CDR::LongDouble &rhs) const -{ - return ACE_OS::memcmp (this->ld, rhs.ld, 16) == 0; -} - -bool -ACE_CDR::LongDouble::operator!= (const ACE_CDR::LongDouble &rhs) const -{ - return ACE_OS::memcmp (this->ld, rhs.ld, 16) != 0; -} - -ACE_CDR::LongDouble::operator ACE_CDR::LongDouble::NativeImpl () const -{ - ACE_CDR::LongDouble::NativeImpl ret = 0.0; - char* lhs_ptr = reinterpret_cast (&ret); - - if (sizeof (ret) == 8) - { -#if defined (ACE_LITTLE_ENDIAN) - static const size_t byte_zero = 1; - static const size_t byte_one = 0; - char copy[16]; - ACE_CDR::swap_16 (this->ld, copy); -#else - static const size_t byte_zero = 0; - static const size_t byte_one = 1; - const char* copy = this->ld; -#endif - ACE_INT16 exponent = 0; - char* exp_ptr = reinterpret_cast (&exponent); - exp_ptr[byte_zero] = copy[0]; - exp_ptr[byte_one] = copy[1]; - - ACE_INT16 sign = (exponent & 0x8000); - exponent &= 0x7fff; - - // Infinity and NaN have an exponent of 0x7fff in 128-bit IEEE - if (exponent == 0x7fff) - { - exponent = 0x7ff; - } - else - { - exponent = (exponent - max_fifteen_bit) + max_eleven_bit; - } - exponent = (exponent << 4) | sign; - - // Store the sign and exponent - lhs_ptr[0] = exp_ptr[byte_zero]; - lhs_ptr[1] = exp_ptr[byte_one]; - - // Store the mantissa. In an 8 byte double, it is split by - // 4 bits (because of the 12 bits for sign and exponent), so - // we have to shift and or the rhs to get the right bytes. - size_t li = 1; - bool direction = true; - for (size_t ri = 2; li < sizeof (ret); ) { - if (direction) - { - lhs_ptr[li] |= ((copy[ri] >> 4) & 0xf); - direction = false; - ++li; - } - else - { - lhs_ptr[li] |= ((copy[ri] & 0xf) << 4); - direction = true; - ++ri; - } - } - -#if defined (ACE_LITTLE_ENDIAN) - ACE_CDR::swap_8 (lhs_ptr, lhs_ptr); -#endif - } - else - { - ACE_OS::memcpy(lhs_ptr, this->ld, sizeof (ret)); - } - - // This bit of code is unnecessary. However, this code is - // necessary to work around a bug in the gcc 4.1.1 optimizer. - ACE_CDR::LongDouble tmp; - tmp.assign (ret); - - return ret; -} -#endif /* NONNATIVE_LONGDOUBLE */ - -#if defined(_UNICOS) && !defined(_CRAYMPP) -// placeholders to get things compiling -ACE_CDR::Float::Float (void) -{ -} - -ACE_CDR::Float::Float (const float & /* init */) -{ -} - -ACE_CDR::Float & -ACE_CDR::Float::operator= (const float & /* rhs */) -{ - return *this; -} - -bool -ACE_CDR::Float::operator!= (const ACE_CDR::Float & /* rhs */) const -{ - return false; -} -#endif /* _UNICOS */ - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/CDR_Size.cpp b/dep/src/ace/CDR_Size.cpp deleted file mode 100644 index f3c72df2734..00000000000 --- a/dep/src/ace/CDR_Size.cpp +++ /dev/null @@ -1,262 +0,0 @@ -#include "ace/CDR_Size.h" -#include "ace/SString.h" -#include "ace/OS_Memory.h" -#include "ace/Truncate.h" - -#if !defined (__ACE_INLINE__) -# include "ace/CDR_Size.inl" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (ace, - CDR_Size, - "$Id: CDR_Size.cpp 82559 2008-08-07 20:23:07Z parsons $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_CDR::Boolean -ACE_SizeCDR::write_wchar (ACE_CDR::WChar x) -{ - // Note: translator framework is not supported. - // - if (ACE_OutputCDR::wchar_maxbytes () == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - - if (static_cast (major_version_) == 1 - && static_cast (minor_version_) == 2) - { - ACE_CDR::Octet len = - static_cast (ACE_OutputCDR::wchar_maxbytes ()); - - if (this->write_1 (&len)) - { - if (ACE_OutputCDR::wchar_maxbytes () == sizeof(ACE_CDR::WChar)) - { - return - this->write_octet_array ( - reinterpret_cast (&x), - static_cast (len)); - } - else - { - if (ACE_OutputCDR::wchar_maxbytes () == 2) - { - ACE_CDR::Short sx = static_cast (x); - return - this->write_octet_array ( - reinterpret_cast (&sx), - static_cast (len)); - } - else - { - ACE_CDR::Octet ox = static_cast (x); - return - this->write_octet_array ( - reinterpret_cast (&ox), - static_cast (len)); - } - } - } - } - else if (static_cast (minor_version_) == 0) - { // wchar is not allowed with GIOP 1.0. - errno = EINVAL; - return (this->good_bit_ = false); - } - - if (ACE_OutputCDR::wchar_maxbytes () == sizeof (ACE_CDR::WChar)) - { - const void *temp = &x; - return this->write_4 (reinterpret_cast (temp)); - } - else if (ACE_OutputCDR::wchar_maxbytes () == 2) - { - ACE_CDR::Short sx = static_cast (x); - return this->write_2 (reinterpret_cast (&sx)); - } - - ACE_CDR::Octet ox = static_cast (x); - return this->write_1 (reinterpret_cast (&ox)); -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_string (ACE_CDR::ULong len, - const ACE_CDR::Char *x) -{ - // Note: translator framework is not supported. - // - if (len != 0) - { - if (this->write_ulong (len + 1)) - return this->write_char_array (x, len + 1); - } - else - { - // Be nice to programmers: treat nulls as empty strings not - // errors. (OMG-IDL supports languages that don't use the C/C++ - // notion of null v. empty strings; nulls aren't part of the OMG-IDL - // string model.) - if (this->write_ulong (1)) - return this->write_char (0); - } - - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_string (const ACE_CString &x) -{ - // @@ Leave this method in here, not the `.i' file so that we don't - // have to unnecessarily pull in the `ace/SString.h' header. - return this->write_string (static_cast (x.length ()), - x.c_str()); -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_wstring (ACE_CDR::ULong len, - const ACE_CDR::WChar *x) -{ - // Note: translator framework is not supported. - // - if (ACE_OutputCDR::wchar_maxbytes () == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - - if (static_cast (this->major_version_) == 1 - && static_cast (this->minor_version_) == 2) - { - if (x != 0) - { - //In GIOP 1.2 the length field contains the number of bytes - //the wstring occupies rather than number of wchars - //Taking sizeof might not be a good way! This is a temporary fix. - ACE_CDR::Boolean good_ulong = - this->write_ulong ( - ACE_Utils::truncate_cast ( - ACE_OutputCDR::wchar_maxbytes () * len)); - - if (good_ulong) - { - return this->write_wchar_array (x, len); - } - } - else - { - //In GIOP 1.2 zero length wstrings are legal - return this->write_ulong (0); - } - } - - else - if (x != 0) - { - if (this->write_ulong (len + 1)) - return this->write_wchar_array (x, len + 1); - } - else if (this->write_ulong (1)) - return this->write_wchar (0); - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_1 (const ACE_CDR::Octet *) -{ - this->adjust (1); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_2 (const ACE_CDR::UShort *) -{ - this->adjust (ACE_CDR::SHORT_SIZE); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_4 (const ACE_CDR::ULong *) -{ - this->adjust (ACE_CDR::LONG_SIZE); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_8 (const ACE_CDR::ULongLong *) -{ - this->adjust (ACE_CDR::LONGLONG_SIZE); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_16 (const ACE_CDR::LongDouble *) -{ - this->adjust (ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_wchar_array_i (const ACE_CDR::WChar *, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - - size_t const align = (ACE_OutputCDR::wchar_maxbytes () == 2) ? - ACE_CDR::SHORT_ALIGN : - ACE_CDR::OCTET_ALIGN; - - this->adjust (ACE_OutputCDR::wchar_maxbytes () * length, align); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_array (const void *, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - - this->adjust (size * length, align); - return true; -} - -ACE_CDR::Boolean -ACE_SizeCDR::write_boolean_array (const ACE_CDR::Boolean*, - ACE_CDR::ULong length) -{ - this->adjust (length, 1); - return true; -} - -void -ACE_SizeCDR::adjust (size_t size) -{ - adjust (size, size); -} - -void -ACE_SizeCDR::adjust (size_t size, - size_t align) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - const size_t offset = ACE_align_binary (size_, align) - size_; - size_ += offset; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - size_ += size; -} - -ACE_CDR::Boolean -operator<< (ACE_SizeCDR &ss, const ACE_CString &x) -{ - ss.write_string (x); - return ss.good_bit (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/CDR_Stream.cpp b/dep/src/ace/CDR_Stream.cpp deleted file mode 100644 index aa313cdff75..00000000000 --- a/dep/src/ace/CDR_Stream.cpp +++ /dev/null @@ -1,2060 +0,0 @@ -#include "ace/CDR_Stream.h" -#include "ace/SString.h" -#include "ace/Auto_Ptr.h" -#include "ace/Truncate.h" - -#if !defined (__ACE_INLINE__) -# include "ace/CDR_Stream.inl" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (ace, - CDR_Stream, - "$Id: CDR_Stream.cpp 82559 2008-08-07 20:23:07Z parsons $") - -// **************************************************************** - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -size_t ACE_OutputCDR::wchar_maxbytes_ = sizeof (ACE_CDR::WChar); - -ACE_OutputCDR::ACE_OutputCDR (size_t size, - int byte_order, - ACE_Allocator *buffer_allocator, - ACE_Allocator *data_block_allocator, - ACE_Allocator *message_block_allocator, - size_t memcpy_tradeoff, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ ((size ? size : (size_t) ACE_CDR::DEFAULT_BUFSIZE) + ACE_CDR::MAX_ALIGNMENT, - ACE_Message_Block::MB_DATA, - 0, - 0, - buffer_allocator, - 0, - 0, - ACE_Time_Value::zero, - ACE_Time_Value::max_time, - data_block_allocator, - message_block_allocator), -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - current_alignment_ (0), -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - current_is_writable_ (true), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - memcpy_tradeoff_ (memcpy_tradeoff), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) - -{ - ACE_CDR::mb_align (&this->start_); - this->current_ = &this->start_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->total_length ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_OutputCDR::ACE_OutputCDR (char *data, - size_t size, - int byte_order, - ACE_Allocator *buffer_allocator, - ACE_Allocator *data_block_allocator, - ACE_Allocator *message_block_allocator, - size_t memcpy_tradeoff, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (size, - ACE_Message_Block::MB_DATA, - 0, - data, - buffer_allocator, - 0, - 0, - ACE_Time_Value::zero, - ACE_Time_Value::max_time, - data_block_allocator, - message_block_allocator), -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - current_alignment_ (0), -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - current_is_writable_ (true), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - memcpy_tradeoff_ (memcpy_tradeoff), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ - // We cannot trust the buffer to be properly aligned - ACE_CDR::mb_align (&this->start_); - this->current_ = &this->start_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->total_length ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_OutputCDR::ACE_OutputCDR (ACE_Data_Block *data_block, - int byte_order, - ACE_Allocator *message_block_allocator, - size_t memcpy_tradeoff, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (data_block, - ACE_Message_Block::DONT_DELETE, - message_block_allocator), -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - current_alignment_ (0), -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - current_is_writable_ (true), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - memcpy_tradeoff_ (memcpy_tradeoff), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ - // We cannot trust the buffer to be properly aligned - ACE_CDR::mb_align (&this->start_); - this->current_ = &this->start_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->total_length ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_OutputCDR::ACE_OutputCDR (ACE_Message_Block *data, - int byte_order, - size_t memcpy_tradeoff, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (data->data_block ()->duplicate ()), -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - current_alignment_ (0), -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - current_is_writable_ (true), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - memcpy_tradeoff_ (memcpy_tradeoff), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ - // We cannot trust the buffer to be properly aligned - ACE_CDR::mb_align (&this->start_); - this->current_ = &this->start_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->total_length ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -/*static*/ void -ACE_OutputCDR::wchar_maxbytes (size_t maxbytes) -{ - ACE_OutputCDR::wchar_maxbytes_ = maxbytes; -} - -/*static*/ size_t -ACE_OutputCDR::wchar_maxbytes () -{ - return ACE_OutputCDR::wchar_maxbytes_; -} - -int -ACE_OutputCDR::grow_and_adjust (size_t size, - size_t align, - char*& buf) -{ - if (!this->current_is_writable_ - || this->current_->cont () == 0 - || this->current_->cont ()->size () < size + ACE_CDR::MAX_ALIGNMENT) - { - // Calculate the new buffer's length; if growing for encode, we - // don't grow in "small" chunks because of the cost. - size_t cursize = this->current_->size (); - if (this->current_->cont () != 0) - cursize = this->current_->cont ()->size (); - size_t minsize = size; - -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - minsize += ACE_CDR::MAX_ALIGNMENT; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - // Make sure that there is enough room for bytes, but - // also make it bigger than whatever our current size is. - if (minsize < cursize) - minsize = cursize; - - size_t const newsize = ACE_CDR::next_size (minsize); - - this->good_bit_ = false; - ACE_Message_Block* tmp = 0; - ACE_NEW_RETURN (tmp, - ACE_Message_Block (newsize, - ACE_Message_Block::MB_DATA, - 0, - 0, - this->current_->data_block ()->allocator_strategy (), - 0, - 0, - ACE_Time_Value::zero, - ACE_Time_Value::max_time, - this->current_->data_block ()->data_block_allocator ()), - -1); - - // Message block initialization may fail while the construction - // succeds. Since as a matter of policy, ACE may throw no - // exceptions, we have to do a separate check like this. - if (tmp != 0 && tmp->size () < newsize) - { - delete tmp; - errno = ENOMEM; - return -1; - } - - this->good_bit_ = true; - -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - // The new block must start with the same alignment as the - // previous block finished. - ptrdiff_t const tmpalign = - reinterpret_cast (tmp->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT; - ptrdiff_t const curalign = - static_cast (this->current_alignment_) % ACE_CDR::MAX_ALIGNMENT; - ptrdiff_t offset = curalign - tmpalign; - if (offset < 0) - offset += ACE_CDR::MAX_ALIGNMENT; - tmp->rd_ptr (static_cast (offset)); - tmp->wr_ptr (tmp->rd_ptr ()); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - // grow the chain and set the current block. - tmp->cont (this->current_->cont ()); - this->current_->cont (tmp); - } - this->current_ = this->current_->cont (); - this->current_is_writable_ = true; - - return this->adjust (size, align, buf); -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_wchar (ACE_CDR::WChar x) -{ - if (this->wchar_translator_ != 0) - return (this->good_bit_ = this->wchar_translator_->write_wchar (*this, x)); - if (ACE_OutputCDR::wchar_maxbytes_ == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - if (static_cast (major_version_) == 1 - && static_cast (minor_version_) == 2) - { - ACE_CDR::Octet len = - static_cast (ACE_OutputCDR::wchar_maxbytes_); - if (this->write_1 (&len)) - { - if (ACE_OutputCDR::wchar_maxbytes_ == sizeof(ACE_CDR::WChar)) - return - this->write_octet_array ( - reinterpret_cast (&x), - static_cast (len)); - else - if (ACE_OutputCDR::wchar_maxbytes_ == 2) - { - ACE_CDR::Short sx = static_cast (x); - return - this->write_octet_array ( - reinterpret_cast (&sx), - static_cast (len)); - } - else - { - ACE_CDR::Octet ox = static_cast (x); - return - this->write_octet_array ( - reinterpret_cast (&ox), - static_cast (len)); - } - } - } - else if (static_cast (minor_version_) == 0) - { // wchar is not allowed with GIOP 1.0. - errno = EINVAL; - return (this->good_bit_ = false); - } - if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar)) - { - void const * const temp = &x; - return - this->write_4 (reinterpret_cast (temp)); - } - else if (ACE_OutputCDR::wchar_maxbytes_ == 2) - { - ACE_CDR::Short sx = static_cast (x); - return this->write_2 (reinterpret_cast (&sx)); - } - ACE_CDR::Octet ox = static_cast (x); - return this->write_1 (reinterpret_cast (&ox)); -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_string (ACE_CDR::ULong len, - const ACE_CDR::Char *x) -{ - // @@ This is a slight violation of "Optimize for the common case", - // i.e. normally the translator will be 0, but OTOH the code is - // smaller and should be better for the cache ;-) ;-) - if (this->char_translator_ != 0) - return this->char_translator_->write_string (*this, len, x); - - if (len != 0) - { - if (this->write_ulong (len + 1)) - return this->write_char_array (x, len + 1); - } - else - { - // Be nice to programmers: treat nulls as empty strings not - // errors. (OMG-IDL supports languages that don't use the C/C++ - // notion of null v. empty strings; nulls aren't part of the OMG-IDL - // string model.) - if (this->write_ulong (1)) - return this->write_char (0); - } - - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_string (const ACE_CString &x) -{ - // @@ Leave this method in here, not the `.i' file so that we don't - // have to unnecessarily pull in the `ace/SString.h' header. - return this->write_string (static_cast (x.length ()), - x.c_str()); -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_wstring (ACE_CDR::ULong len, - const ACE_CDR::WChar *x) -{ - // @@ This is a slight violation of "Optimize for the common case", - // i.e. normally the translator will be 0, but OTOH the code is - // smaller and should be better for the cache ;-) ;-) - // What do we do for GIOP 1.2??? - if (this->wchar_translator_ != 0) - return this->wchar_translator_->write_wstring (*this, len, x); - if (ACE_OutputCDR::wchar_maxbytes_ == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - - if (static_cast (this->major_version_) == 1 - && static_cast (this->minor_version_) == 2) - { - if (x != 0) - { - //In GIOP 1.2 the length field contains the number of bytes - //the wstring occupies rather than number of wchars - //Taking sizeof might not be a good way! This is a temporary fix. - ACE_CDR::Boolean good_ulong = - this->write_ulong ( - ACE_Utils::truncate_cast ( - ACE_OutputCDR::wchar_maxbytes_ * len)); - - if (good_ulong) - { - return this->write_wchar_array (x, len); - } - } - else - { - //In GIOP 1.2 zero length wstrings are legal - return this->write_ulong (0); - } - } - - else - if (x != 0) - { - if (this->write_ulong (len + 1)) - return this->write_wchar_array (x, len + 1); - } - else if (this->write_ulong (1)) - return this->write_wchar (0); - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb) -{ - // If the buffer is small and it fits in the current message - // block it is be cheaper just to copy the buffer. - for (const ACE_Message_Block* i = mb; - i != 0; - i = i->cont ()) - { - size_t const length = i->length (); - - // If the mb does not own its data we are forced to make a copy. - if (ACE_BIT_ENABLED (i->flags (), - ACE_Message_Block::DONT_DELETE)) - { - if (! this->write_array (i->rd_ptr (), - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - static_cast (length))) - return (this->good_bit_ = false); - continue; - } - - if (length < this->memcpy_tradeoff_ - && this->current_->wr_ptr () + length < this->current_->end ()) - { - if (! this->write_array (i->rd_ptr (), - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - static_cast (length))) - return (this->good_bit_ = false); - continue; - } - - ACE_Message_Block* cont = 0; - this->good_bit_ = false; - ACE_NEW_RETURN (cont, - ACE_Message_Block (i->data_block ()->duplicate ()), - false); - this->good_bit_ = true; - - if (this->current_->cont () != 0) - ACE_Message_Block::release (this->current_->cont ()); - cont->rd_ptr (i->rd_ptr ()); - cont->wr_ptr (i->wr_ptr ()); - - this->current_->cont (cont); - this->current_ = cont; - this->current_is_writable_ = false; -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - this->current_alignment_ = - (this->current_alignment_ + cont->length ()) % ACE_CDR::MAX_ALIGNMENT; -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - } - - return true; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_1 (const ACE_CDR::Octet *x) -{ - char *buf = 0; - if (this->adjust (1, buf) == 0) - { - *reinterpret_cast (buf) = *x; - return true; - } - - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_2 (const ACE_CDR::UShort *x) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0) - { -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (buf) = *x; - return true; -#else - if (!this->do_byte_swap_) - { - *reinterpret_cast (buf) = *x; - return true; - } - else - { - ACE_CDR::swap_2 (reinterpret_cast (x), buf); - return true; - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - } - - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_4 (const ACE_CDR::ULong *x) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0) - { -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (buf) = *x; - return true; -#else - if (!this->do_byte_swap_) - { - *reinterpret_cast (buf) = *x; - return true; - } - else - { - ACE_CDR::swap_4 (reinterpret_cast (x), buf); - return true; - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - } - - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x) -{ - char *buf = 0; - - if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0) - { -#if defined (__arm__) - // Convert to Intel format (12345678 => 56781234) - const char *orig = reinterpret_cast (x); - char *target = buf; - register ACE_UINT32 x = - *reinterpret_cast (orig); - register ACE_UINT32 y = - *reinterpret_cast (orig + 4); - *reinterpret_cast (target) = y; - *reinterpret_cast (target + 4) = x; - return true; -#else -# if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (buf) = *x; - return true; -# else - if (!this->do_byte_swap_) - { - *reinterpret_cast (buf) = *x; - return true; - } - else - { - ACE_CDR::swap_8 (reinterpret_cast (x), buf); - return true; - } -# endif /* ACE_ENABLE_SWAP_ON_WRITE */ -#endif /* !__arm__ */ - } - - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_16 (const ACE_CDR::LongDouble *x) -{ - char* buf = 0; - if (this->adjust (ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - buf) == 0) - { -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (buf) = *x; - return 1; -#else - if (!this->do_byte_swap_) - { - *reinterpret_cast (buf) = *x; - return true; - } - else - { - ACE_CDR::swap_16 (reinterpret_cast (x), buf); - return true; - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - } - - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_wchar_array_i (const ACE_CDR::WChar *x, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - char* buf = 0; - size_t const align = (ACE_OutputCDR::wchar_maxbytes_ == 2) ? - ACE_CDR::SHORT_ALIGN : - ACE_CDR::OCTET_ALIGN; - - if (this->adjust (ACE_OutputCDR::wchar_maxbytes_ * length, align, buf) == 0) - { - if (ACE_OutputCDR::wchar_maxbytes_ == 2) - { - ACE_CDR::UShort *sb = reinterpret_cast (buf); - for (size_t i = 0; i < length; ++i) -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - sb[i] = static_cast (x[i]); -#else - if (!this->do_byte_swap_) - sb[i] = static_cast (x[i]); - else - { - ACE_CDR::UShort sx = static_cast (x[i]); - ACE_CDR::swap_2 (reinterpret_cast (&sx), &buf[i * 2]); - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - } - else - { - for (size_t i = 0; i < length; ++i) - buf[i] = static_cast (x[i]); - } - return this->good_bit_; - } - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_array (const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - char *buf = 0; - if (this->adjust (size * length, align, buf) == 0) - { -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - ACE_OS::memcpy (buf, x, size*length); - return true; -#else - if (!this->do_byte_swap_ || size == 1) - { - ACE_OS::memcpy (buf, x, size*length); - return true; - } - else - { - const char *source = reinterpret_cast (x); - switch (size) - { - case 2: - ACE_CDR::swap_2_array (source, buf, length); - return true; - case 4: - ACE_CDR::swap_4_array (source, buf, length); - return true; - case 8: - ACE_CDR::swap_8_array (source, buf, length); - return true; - case 16: - ACE_CDR::swap_16_array (source, buf, length); - return true; - default: - // TODO: print something? - this->good_bit_ = false; - return false; - } - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - } - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_OutputCDR::write_boolean_array (const ACE_CDR::Boolean* x, - ACE_CDR::ULong length) -{ - // It is hard to optimize this, the spec requires that on the wire - // booleans be represented as a byte with value 0 or 1, but in - // memory it is possible (though very unlikely) that a boolean has - // a non-zero value (different from 1). - // We resort to a simple loop. - ACE_CDR::Boolean const * const end = x + length; - - for (ACE_CDR::Boolean const * i = x; - i != end && this->good_bit (); - ++i) - (void) this->write_boolean (*i); - - return this->good_bit (); -} - -char * -ACE_OutputCDR::write_long_placeholder (void) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0) - *reinterpret_cast (buf) = 0; - else - buf = 0; - return buf; -} - -char * -ACE_OutputCDR::write_short_placeholder (void) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0) - *reinterpret_cast (buf) = 0; - else - buf = 0; - return buf; -} - -ACE_CDR::Boolean -ACE_OutputCDR::replace (ACE_CDR::Long x, char* loc) -{ - if (this->find (loc) == 0) - return false; - -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (loc) = x; -#else - if (!this->do_byte_swap_) - { - *reinterpret_cast (loc) = x; - } - else - { - ACE_CDR::swap_4 (reinterpret_cast (&x), loc); - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - - return true; -} - -ACE_CDR::Boolean -ACE_OutputCDR::replace (ACE_CDR::Short x, char* loc) -{ - if (this->find (loc) == 0) - return false; - -#if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *reinterpret_cast (loc) = x; -#else - if (!this->do_byte_swap_) - { - *reinterpret_cast (loc) = x; - } - else - { - ACE_CDR::swap_2 (reinterpret_cast (&x), loc); - } -#endif /* ACE_ENABLE_SWAP_ON_WRITE */ - - return true; -} - -int -ACE_OutputCDR::consolidate (void) -{ - // Optimize by only doing something if we need to - if (this->current_ != &this->start_) - { - // Set the number of bytes in the top-level block, reallocating - // if necessary. The rd_ptr and wr_ptr remain at the original offsets - // into the buffer, even if it is reallocated. - // Return an error if the allocation failed. - size_t const newsize = - ACE_CDR::first_size (this->total_length () - + ACE_CDR::MAX_ALIGNMENT); - if (this->start_.size (newsize) < 0) - { - return -1; - } - - // Consolidate the chain into the first block. NOTE that - // ACE_CDR::consolidate can not be used since we don't want to - // overwrite what is already in the first block. We just append it since - // the read and write pointers weren't affected by the resizing above. - // We also don't have to worry about alignment since the start block is - // already aligned. - // NOTE also we know there is a continuation since we checked for it - // above. There is therefore no reason to check for a 0 continuation - // field here. - ACE_Message_Block *cont = this->start_.cont (); - for (const ACE_Message_Block* i = cont; i != 0; i = i->cont ()) - { - this->start_.copy (i->rd_ptr (), i->length ()); - } - - // Release the old blocks that were consolidated and reset the - // current_ and current_is_writable_ to reflect the single used block. - ACE_Message_Block::release (cont); - this->start_.cont (0); - this->current_ = &this->start_; - this->current_is_writable_ = true; - } - - return 0; -} - -ACE_Message_Block* -ACE_OutputCDR::find (char* loc) -{ - ACE_Message_Block* mb = 0; - for (mb = &this->start_; mb != 0; mb = mb->cont ()) - { - if (loc <= mb->wr_ptr () && loc >= mb->rd_ptr ()) - { - break; - } - } - - return mb; -} - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - -void -ACE_OutputCDR::register_monitor (const char *id) -{ - this->monitor_->name (id); - this->monitor_->add_to_registry (); -} - -void -ACE_OutputCDR::unregister_monitor (void) -{ - this->monitor_->remove_from_registry (); -} - -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -// **************************************************************** - -ACE_InputCDR::ACE_InputCDR (const char *buf, - size_t bufsiz, - int byte_order, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (buf, bufsiz), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ - this->start_.wr_ptr (bufsiz); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (bufsiz); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (size_t bufsiz, - int byte_order, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (bufsiz), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (bufsiz); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (const ACE_Message_Block *data, - int byte_order, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version, - ACE_Lock* lock) - : start_ (0, ACE_Message_Block::MB_DATA, 0, 0, 0, lock), - good_bit_ (true), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - this->reset (data, byte_order); -} - -ACE_InputCDR::ACE_InputCDR (ACE_Data_Block *data, - ACE_Message_Block::Message_Flags flag, - int byte_order, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (data, flag), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (data->size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (ACE_Data_Block *data, - ACE_Message_Block::Message_Flags flag, - size_t rd_pos, - size_t wr_pos, - int byte_order, - ACE_CDR::Octet major_version, - ACE_CDR::Octet minor_version) - : start_ (data, flag), - do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER), - good_bit_ (true), - major_version_ (major_version), - minor_version_ (minor_version), - char_translator_ (0), - wchar_translator_ (0) -{ - // Set the read pointer - this->start_.rd_ptr (rd_pos); - - // Set the write pointer after doing a sanity check. - char* wrpos = this->start_.base () + wr_pos; - - if (this->start_.end () >= wrpos) - { - this->start_.wr_ptr (wr_pos); - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (data->size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (const ACE_InputCDR& rhs, - size_t size, - ACE_CDR::Long offset) - : start_ (rhs.start_, - ACE_CDR::MAX_ALIGNMENT), - do_byte_swap_ (rhs.do_byte_swap_), - good_bit_ (true), - major_version_ (rhs.major_version_), - minor_version_ (rhs.minor_version_), - char_translator_ (rhs.char_translator_), - wchar_translator_ (rhs.wchar_translator_) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - // Align the base pointer assuming that the incoming stream is also - // aligned the way we are aligned - char *incoming_start = ACE_ptr_align_binary (rhs.start_.base (), - ACE_CDR::MAX_ALIGNMENT); -#else - char *incoming_start = rhs.start_.base (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - const size_t newpos = - (rhs.start_.rd_ptr() - incoming_start) + offset; - - if (newpos <= this->start_.space () - && newpos + size <= this->start_.space ()) - { - this->start_.rd_ptr (newpos); - this->start_.wr_ptr (newpos + size); - } - else - { - this->good_bit_ = false; - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (const ACE_InputCDR& rhs, - size_t size) - : start_ (rhs.start_, - ACE_CDR::MAX_ALIGNMENT), - do_byte_swap_ (rhs.do_byte_swap_), - good_bit_ (true), - major_version_ (rhs.major_version_), - minor_version_ (rhs.minor_version_), - char_translator_ (rhs.char_translator_), - wchar_translator_ (rhs.wchar_translator_) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - // Align the base pointer assuming that the incoming stream is also - // aligned the way we are aligned - char *incoming_start = ACE_ptr_align_binary (rhs.start_.base (), - ACE_CDR::MAX_ALIGNMENT); -#else - char *incoming_start = rhs.start_.base (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - const size_t newpos = - rhs.start_.rd_ptr() - incoming_start; - - if (newpos <= this->start_.space () - && newpos + size <= this->start_.space ()) - { - // Notice that ACE_Message_Block::duplicate may leave the - // wr_ptr() with a higher value than what we actually want. - this->start_.rd_ptr (newpos); - this->start_.wr_ptr (newpos + size); - - ACE_CDR::Octet byte_order = 0; - (void) this->read_octet (byte_order); - this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER); - } - else - { - this->good_bit_ = false; - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (const ACE_InputCDR& rhs) - : start_ (rhs.start_, - ACE_CDR::MAX_ALIGNMENT), - do_byte_swap_ (rhs.do_byte_swap_), - good_bit_ (true), - major_version_ (rhs.major_version_), - minor_version_ (rhs.minor_version_), - char_translator_ (rhs.char_translator_), - wchar_translator_ (rhs.wchar_translator_) -{ -#if !defined (ACE_LACKS_CDR_ALIGNMENT) - char *buf = ACE_ptr_align_binary (rhs.start_.base (), - ACE_CDR::MAX_ALIGNMENT); -#else - char *buf = rhs.start_.base (); -#endif /* ACE_LACKS_CDR_ALIGNMENT */ - - size_t rd_offset = rhs.start_.rd_ptr () - buf; - size_t wr_offset = rhs.start_.wr_ptr () - buf; - this->start_.rd_ptr (rd_offset); - this->start_.wr_ptr (wr_offset); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR::ACE_InputCDR (ACE_InputCDR::Transfer_Contents x) - : start_ (x.rhs_.start_.data_block ()), - do_byte_swap_ (x.rhs_.do_byte_swap_), - good_bit_ (true), - major_version_ (x.rhs_.major_version_), - minor_version_ (x.rhs_.minor_version_), - char_translator_ (x.rhs_.char_translator_), - wchar_translator_ (x.rhs_.wchar_translator_) -{ - this->start_.rd_ptr (x.rhs_.start_.rd_ptr ()); - this->start_.wr_ptr (x.rhs_.start_.wr_ptr ()); - - ACE_Data_Block* db = this->start_.data_block ()->clone_nocopy (); - (void) x.rhs_.start_.replace_data_block (db); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_InputCDR& -ACE_InputCDR::operator= (const ACE_InputCDR& rhs) -{ - if (this != &rhs) - { - this->start_.data_block (rhs.start_.data_block ()->duplicate ()); - this->start_.rd_ptr (rhs.start_.rd_ptr ()); - this->start_.wr_ptr (rhs.start_.wr_ptr ()); - this->do_byte_swap_ = rhs.do_byte_swap_; - this->good_bit_ = true; - this->char_translator_ = rhs.char_translator_; - this->major_version_ = rhs.major_version_; - this->minor_version_ = rhs.minor_version_; - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - return *this; -} - -ACE_InputCDR::ACE_InputCDR (const ACE_OutputCDR& rhs, - ACE_Allocator* buffer_allocator, - ACE_Allocator* data_block_allocator, - ACE_Allocator* message_block_allocator) - : start_ (rhs.total_length () + ACE_CDR::MAX_ALIGNMENT, - ACE_Message_Block::MB_DATA, - 0, - 0, - buffer_allocator, - 0, - 0, - ACE_Time_Value::zero, - ACE_Time_Value::max_time, - data_block_allocator, - message_block_allocator), - do_byte_swap_ (rhs.do_byte_swap_), - good_bit_ (true), - major_version_ (rhs.major_version_), - minor_version_ (rhs.minor_version_), - char_translator_ (rhs.char_translator_), - wchar_translator_ (rhs.wchar_translator_) -{ - ACE_CDR::mb_align (&this->start_); - for (const ACE_Message_Block *i = rhs.begin (); - i != rhs.end (); - i = i->cont ()) - { - this->start_.copy (i->rd_ptr (), i->length ()); - } - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - ACE_NEW (this->monitor_, - ACE::Monitor_Control::Size_Monitor); - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_CDR::Boolean -ACE_InputCDR::skip_wchar (void) -{ - if (static_cast (major_version_) == 1 - && static_cast (minor_version_) == 2) - { - ACE_CDR::Octet len; - if (this->read_1 (&len)) - return this->skip_bytes (static_cast (len)); - } - else - { - ACE_CDR::WChar x; - void * const temp = &x; - if (ACE_OutputCDR::wchar_maxbytes_ == 2) - return this->read_2 (reinterpret_cast (temp)); - else - return this->read_4 (reinterpret_cast (temp)); - } - - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) -{ - if (this->wchar_translator_ != 0) - { - this->good_bit_ = this->wchar_translator_->read_wchar (*this,x); - return this->good_bit_; - } - if (ACE_OutputCDR::wchar_maxbytes_ == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - - if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar)) - { - if (static_cast (major_version_) == 1 - && static_cast (minor_version_) == 2) - { - ACE_CDR::Octet len; - - if (this->read_1 (&len)) - return this->read_array - (reinterpret_cast (&x), - static_cast (len), - ACE_CDR::OCTET_ALIGN, - 1); - - else - return (this->good_bit_ = false); - } - - void * const temp = &x; - if (sizeof (ACE_CDR::WChar) == 2) - return this->read_2 (reinterpret_cast (temp)); - else - return this->read_4 (reinterpret_cast (temp)); - } - - if (static_cast (major_version_) == 1 - && static_cast (minor_version_) == 2) - { - ACE_CDR::Octet len; - - if (this->read_1 (&len)) - { - if (len == 2) - { - ACE_CDR::Short sx; - if (this->read_array - (reinterpret_cast (&sx), - static_cast (len), - ACE_CDR::OCTET_ALIGN, - 1)) - { - x = static_cast (sx); - return true; - } - } - else - { - ACE_CDR::Octet ox; - if (this->read_array - (reinterpret_cast (&ox), - static_cast (len), - ACE_CDR::OCTET_ALIGN, - 1)) - { - x = static_cast (ox); - return true; - } - } - } - } - else - { - if (ACE_OutputCDR::wchar_maxbytes_ == 2) - { - ACE_CDR::UShort sx; - if (this->read_2 (reinterpret_cast (&sx))) - { - x = static_cast (sx); - return true; - } - } - else - { - ACE_CDR::Octet ox; - if (this->read_1 (&ox)) - { - x = static_cast (ox); - return true; - } - - } - } - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_InputCDR::read_string (ACE_CDR::Char *&x) -{ - // @@ This is a slight violation of "Optimize for the common case", - // i.e. normally the translator will be 0, but OTOH the code is - // smaller and should be better for the cache ;-) ;-) - if (this->char_translator_ != 0) - { - this->good_bit_ = this->char_translator_->read_string (*this, x); - return this->good_bit_; - } - - ACE_CDR::ULong len = 0; - - if (!this->read_ulong (len)) - return false; - - // A check for the length being too great is done later in the - // call to read_char_array but we want to have it done before - // the memory is allocated. - if (len > 0 && len <= this->length()) - { - ACE_NEW_RETURN (x, - ACE_CDR::Char[len], - 0); - - ACE_Auto_Basic_Array_Ptr safe_data (x); - - if (this->read_char_array (x, len)) - { - (void) safe_data.release (); - return true; - } - } - else if (len == 0) - { - // Convert any null strings to empty strings since empty - // strings can cause crashes. (See bug 58.) - ACE_NEW_RETURN (x, - ACE_CDR::Char[1], - 0); - ACE_OS::strcpy (const_cast (x), ""); - return true; - } - - x = 0; - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_InputCDR::read_string (ACE_CString &x) -{ - ACE_CDR::Char * data = 0; - if (this->read_string (data)) - { - ACE_Auto_Basic_Array_Ptr safe_data (data); - x = data; - return true; - } - - x = ""; - return (this->good_bit_ = false); -} - -ACE_CDR::Boolean -ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) -{ - // @@ This is a slight violation of "Optimize for the common case", - // i.e. normally the translator will be 0, but OTOH the code is - // smaller and should be better for the cache ;-) ;-) - if (this->wchar_translator_ != 0) - { - this->good_bit_ = this->wchar_translator_->read_wstring (*this, x); - return this->good_bit_; - } - if (ACE_OutputCDR::wchar_maxbytes_ == 0) - { - errno = EACCES; - return (this->good_bit_ = false); - } - - ACE_CDR::ULong len = 0; - - if (!this->read_ulong (len)) - { - return false; - } - - // A check for the length being too great is done later in the - // call to read_char_array but we want to have it done before - // the memory is allocated. - if (len > 0 && len <= this->length ()) - { - ACE_Auto_Basic_Array_Ptr safe_data; - - if (static_cast (this->major_version_) == 1 - && static_cast (this->minor_version_) == 2) - { - len /= - ACE_Utils::truncate_cast ( - ACE_OutputCDR::wchar_maxbytes_); - - //allocating one extra for the null character needed by applications - ACE_NEW_RETURN (x, - ACE_CDR::WChar [len + 1], - false); - - ACE_auto_ptr_reset (safe_data, x); - - if (this->read_wchar_array (x, len)) - { - - //Null character used by applications to find the end of - //the wstring - //Is this okay with the GIOP 1.2 spec?? - x[len] = '\x00'; - - (void) safe_data.release (); - - return true; - } - } - else - { - ACE_NEW_RETURN (x, - ACE_CDR::WChar [len], - false); - - ACE_auto_ptr_reset (safe_data, x); - - if (this->read_wchar_array (x, len)) - { - (void) safe_data.release (); - - return true; - } - } - } - else if (len == 0) - { - // Convert any null strings to empty strings since empty - // strings can cause crashes. (See bug 58.) - ACE_NEW_RETURN (x, - ACE_CDR::WChar[1], - false); - x[0] = '\x00'; - return true; - } - - this->good_bit_ = false; - x = 0; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_array (void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - char* buf = 0; - - if (this->adjust (size * length, align, buf) == 0) - { -#if defined (ACE_DISABLE_SWAP_ON_READ) - ACE_OS::memcpy (x, buf, size*length); -#else - if (!this->do_byte_swap_ || size == 1) - ACE_OS::memcpy (x, buf, size*length); - else - { - char *target = reinterpret_cast (x); - switch (size) - { - case 2: - ACE_CDR::swap_2_array (buf, target, length); - break; - case 4: - ACE_CDR::swap_4_array (buf, target, length); - break; - case 8: - ACE_CDR::swap_8_array (buf, target, length); - break; - case 16: - ACE_CDR::swap_16_array (buf, target, length); - break; - default: - // TODO: print something? - this->good_bit_ = false; - return false; - } - } -#endif /* ACE_DISABLE_SWAP_ON_READ */ - return this->good_bit_; - } - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_wchar_array_i (ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - if (length == 0) - return true; - char* buf = 0; - size_t const align = (ACE_OutputCDR::wchar_maxbytes_ == 2) ? - ACE_CDR::SHORT_ALIGN : - ACE_CDR::OCTET_ALIGN; - - if (this->adjust (ACE_OutputCDR::wchar_maxbytes_ * length, align, buf) == 0) - { - if (ACE_OutputCDR::wchar_maxbytes_ == 2) - { - ACE_CDR::UShort *sb = reinterpret_cast (buf); - for (size_t i = 0; i < length; ++i) -#if defined (ACE_DISABLE_SWAP_ON_READ) - x[i] = static_cast (sb[i]); -#else - if (!this->do_byte_swap_) - x[i] = static_cast (sb[i]); - else - { - ACE_CDR::UShort sx; - ACE_CDR::swap_2 (&buf[i * 2], reinterpret_cast (&sx)); - x[i] = static_cast (sx); - } -#endif /* ACE_DISABLE_SWAP_ON_READ */ - } - else - { - for (size_t i = 0; i < length; ++i) - x[i] = static_cast (buf[i]); - } - return this->good_bit_; - } - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_boolean_array (ACE_CDR::Boolean *x, - ACE_CDR::ULong length) -{ - // Make sure the length of the array isn't greater than the length of - // the stream. - if (length > this->length ()) - { - this->good_bit_ = false; - return false; - } - - // It is hard to optimize this, the spec requires that on the wire - // booleans be represented as a byte with value 0 or 1, but in - // memory it is possible (though very unlikely) that a boolean has - // a non-zero value (different from 1). - // We resort to a simple loop. - for (ACE_CDR::ULong i = 0; i != length && this->good_bit_; ++i) - (void) this->read_boolean (x[i]); - - return this->good_bit_; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_1 (ACE_CDR::Octet *x) -{ - if (this->rd_ptr () < this->wr_ptr ()) - { - *x = *reinterpret_cast (this->rd_ptr ()); - this->start_.rd_ptr (1); - return true; - } - - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_2 (ACE_CDR::UShort *x) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0) - { -#if !defined (ACE_DISABLE_SWAP_ON_READ) - if (!this->do_byte_swap_) - *x = *reinterpret_cast (buf); - else - ACE_CDR::swap_2 (buf, reinterpret_cast (x)); -#else - *x = *reinterpret_cast (buf); -#endif /* ACE_DISABLE_SWAP_ON_READ */ - return true; - } - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_4 (ACE_CDR::ULong *x) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0) - { -#if !defined (ACE_DISABLE_SWAP_ON_READ) - if (!this->do_byte_swap_) - *x = *reinterpret_cast (buf); - else - ACE_CDR::swap_4 (buf, reinterpret_cast (x)); -#else - *x = *reinterpret_cast (buf); -#endif /* ACE_DISABLE_SWAP_ON_READ */ - return true; - } - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_8 (ACE_CDR::ULongLong *x) -{ - char *buf = 0; - - if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0) - { -#if !defined (ACE_DISABLE_SWAP_ON_READ) -# if defined (__arm__) - if (!this->do_byte_swap_) - { - // Convert from Intel format (12345678 => 56781234) - const char *orig = buf; - char *target = reinterpret_cast (x); - register ACE_UINT32 x = - *reinterpret_cast (orig); - register ACE_UINT32 y = - *reinterpret_cast (orig + 4); - *reinterpret_cast (target) = y; - *reinterpret_cast (target + 4) = x; - } - else - { - // Convert from Sparc format (12345678 => 43218765) - const char *orig = buf; - char *target = reinterpret_cast (x); - register ACE_UINT32 x = - *reinterpret_cast (orig); - register ACE_UINT32 y = - *reinterpret_cast (orig + 4); - x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); - y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); - *reinterpret_cast (target) = x; - *reinterpret_cast (target + 4) = y; - } -# else - if (!this->do_byte_swap_) - *x = *reinterpret_cast (buf); - else - ACE_CDR::swap_8 (buf, reinterpret_cast (x)); -# endif /* !__arm__ */ -#else - *x = *reinterpret_cast (buf); -#endif /* ACE_DISABLE_SWAP_ON_READ */ - return true; - } - - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::read_16 (ACE_CDR::LongDouble *x) -{ - char *buf = 0; - if (this->adjust (ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - buf) == 0) - { -#if !defined (ACE_DISABLE_SWAP_ON_READ) - if (!this->do_byte_swap_) - *x = *reinterpret_cast (buf); - else - ACE_CDR::swap_16 (buf, reinterpret_cast (x)); -#else - *x = *reinterpret_cast (buf); -#endif /* ACE_DISABLE_SWAP_ON_READ */ - return true; - } - - this->good_bit_ = false; - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::skip_string (void) -{ - ACE_CDR::ULong len = 0; - if (this->read_ulong (len)) - { - if (this->rd_ptr () + len <= this->wr_ptr ()) - { - this->rd_ptr (len); - return true; - } - this->good_bit_ = false; - } - return false; -} - -ACE_CDR::Boolean -ACE_InputCDR::skip_wstring (void) -{ - ACE_CDR::ULong len = 0; - ACE_CDR::Boolean continue_skipping = read_ulong (len); - - if (continue_skipping && len != 0) - { - if (static_cast (this->major_version_) == 1 - && static_cast (this->minor_version_) == 2) - continue_skipping = this->skip_bytes ((size_t)len); - else - while (continue_skipping && len--) - continue_skipping = this->skip_wchar (); - } - return continue_skipping; -} - -ACE_CDR::Boolean -ACE_InputCDR::skip_bytes (size_t len) -{ - if (this->rd_ptr () + len <= this->wr_ptr ()) - { - this->rd_ptr (len); - return true; - } - this->good_bit_ = false; - return false; -} - -int -ACE_InputCDR::grow (size_t newsize) -{ - if (ACE_CDR::grow (&this->start_, newsize) == -1) - return -1; - - ACE_CDR::mb_align (&this->start_); - this->start_.wr_ptr (newsize); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - if (newsize > this->start_.total_size ()) - { - this->monitor_->receive (newsize); - } -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - return 0; -} - -void -ACE_InputCDR::reset (const ACE_Message_Block* data, - int byte_order) -{ - this->reset_byte_order (byte_order); - ACE_CDR::consolidate (&this->start_, data); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -void -ACE_InputCDR::steal_from (ACE_InputCDR &cdr) -{ - this->do_byte_swap_ = cdr.do_byte_swap_; - this->start_.data_block (cdr.start_.data_block ()->duplicate ()); - - // If the message block had a DONT_DELETE flags, just clear it off.. - this->start_.clr_self_flags (ACE_Message_Block::DONT_DELETE); - this->start_.rd_ptr (cdr.start_.rd_ptr ()); - - this->start_.wr_ptr (cdr.start_.wr_ptr ()); - this->major_version_ = cdr.major_version_; - this->minor_version_ = cdr.minor_version_; - cdr.reset_contents (); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -void -ACE_InputCDR::exchange_data_blocks (ACE_InputCDR &cdr) -{ - // Exchange byte orders - int const byte_order = cdr.do_byte_swap_; - cdr.do_byte_swap_ = this->do_byte_swap_; - this->do_byte_swap_ = byte_order; - - // Get the destination read and write pointers - size_t const drd_pos = - cdr.start_.rd_ptr () - cdr.start_.base (); - size_t const dwr_pos = - cdr.start_.wr_ptr () - cdr.start_.base (); - - // Get the source read & write pointers - size_t const srd_pos = - this->start_.rd_ptr () - this->start_.base (); - size_t const swr_pos = - this->start_.wr_ptr () - this->start_.base (); - - // Exchange data_blocks. Dont release any of the data blocks. - ACE_Data_Block *dnb = - this->start_.replace_data_block (cdr.start_.data_block ()); - cdr.start_.replace_data_block (dnb); - - // Exchange the flags information.. - ACE_Message_Block::Message_Flags df = cdr.start_.self_flags (); - ACE_Message_Block::Message_Flags sf = this->start_.self_flags (); - - cdr.start_.clr_self_flags (df); - this->start_.clr_self_flags (sf); - - cdr.start_.set_self_flags (sf); - this->start_.set_self_flags (df); - - // Reset the pointers to zero before it is set again. - cdr.start_.reset (); - this->start_.reset (); - - // Set the read and write pointers. - if (cdr.start_.size () >= srd_pos) - { - cdr.start_.rd_ptr (srd_pos); - } - - if (cdr.start_.size () >= swr_pos) - { - cdr.start_.wr_ptr (swr_pos); - } - - if (this->start_.size () >= drd_pos) - { - this->start_.rd_ptr (drd_pos); - } - - if (this->start_.size () >= dwr_pos) - { - this->start_.wr_ptr (dwr_pos); - } - - ACE_CDR::Octet const dmajor = cdr.major_version_; - ACE_CDR::Octet const dminor = cdr.minor_version_; - - // Exchange the GIOP version info - cdr.major_version_ = this->major_version_; - cdr.minor_version_ = this->minor_version_; - - this->major_version_ = dmajor; - this->minor_version_ = dminor; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -ACE_Data_Block * -ACE_InputCDR::clone_from (ACE_InputCDR &cdr) -{ - this->do_byte_swap_ = cdr.do_byte_swap_; - - // Get the read & write pointer positions in the incoming CDR - // streams - char *rd_ptr = cdr.start_.rd_ptr (); - char *wr_ptr = cdr.start_.wr_ptr (); - - // Now reset the incoming CDR stream - cdr.start_.reset (); - - // As we have reset the stream, try to align the underlying message - // block in the incoming stream - ACE_CDR::mb_align (&cdr.start_); - - // Get the read & write pointer positions again - char *nrd_ptr = cdr.start_.rd_ptr (); - char *nwr_ptr = cdr.start_.wr_ptr (); - - // Actual length of the stream is.. - // @todo: This will look idiotic, but we dont seem to have much of a - // choice. How do we calculate the length of the incoming stream? - // Calling the method before calling reset () would give us the - // wrong length of the stream that needs copying. So we do the - // calulation like this - // (1) We get the and positions of the incoming - // stream. - // (2) Then we reset the stream and then align it. - // (3) We get the and positions again. (Points #1 - // thru #3 has been done already) - // (4) The difference in the and positions gives - // us the following, the actual bytes traversed by the and - // . - // (5) The bytes traversed by the is the actual length of - // the stream. - - // Actual bytes traversed - size_t rd_bytes = rd_ptr - nrd_ptr; - size_t wr_bytes = wr_ptr - nwr_ptr; - - ACE_CDR::mb_align (&this->start_); - - ACE_Data_Block *db = - this->start_.data_block (); - - // If the size of the data that needs to be copied are higher than - // what is available, then do a reallocation. - if (wr_bytes > (this->start_.size () - ACE_CDR::MAX_ALIGNMENT)) - { - // @@NOTE: We need to probably add another method to the message - // block interface to simplify this - db = - cdr.start_.data_block ()->clone_nocopy (); - - if (db == 0 || db->size ((wr_bytes) + - ACE_CDR::MAX_ALIGNMENT) == -1) - return 0; - - // Replace our data block by using the incoming CDR stream. - db = this->start_.replace_data_block (db); - - // Align the start_ message block. - ACE_CDR::mb_align (&this->start_); - - // Clear the DONT_DELETE flag if it has been set - this->start_.clr_self_flags (ACE_Message_Block::DONT_DELETE); - } - - // Now do the copy - (void) ACE_OS::memcpy (this->start_.wr_ptr (), - cdr.start_.rd_ptr (), - wr_bytes); - - // Set the read pointer position to the same point as that was in - // cdr. - this->start_.rd_ptr (rd_bytes); - this->start_.wr_ptr (wr_bytes); - - // We have changed the read & write pointers for the incoming - // stream. Set them back to the positions that they were before.. - cdr.start_.rd_ptr (rd_bytes); - cdr.start_.wr_ptr (wr_bytes); - - this->major_version_ = cdr.major_version_; - this->minor_version_ = cdr.minor_version_; - - // Copy the char/wchar translators - this->char_translator_ = cdr.char_translator_; - this->wchar_translator_ = cdr.wchar_translator_; - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - return db; -} - -ACE_Message_Block* -ACE_InputCDR::steal_contents (void) -{ - ACE_Message_Block* block = this->start_.clone (); - this->start_.data_block (block->data_block ()->clone ()); - - // If at all our message had a DONT_DELETE flag set, just clear it - // off. - this->start_.clr_self_flags (ACE_Message_Block::DONT_DELETE); - - ACE_CDR::mb_align (&this->start_); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - - return block; -} - -void -ACE_InputCDR::reset_contents (void) -{ - this->start_.data_block (this->start_.data_block ()->clone_nocopy ()); - - // Reset the flags... - this->start_.clr_self_flags (ACE_Message_Block::DONT_DELETE); - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->start_.total_size ()); -#endif /* ACE_HAS_MONITOR_POINTS==1 */ -} - -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - -void -ACE_InputCDR::register_monitor (const char *id) -{ - this->monitor_->name (id); - this->monitor_->add_to_registry (); -} - -void -ACE_InputCDR::unregister_monitor (void) -{ - this->monitor_->remove_from_registry (); -} - -#endif /* ACE_HAS_MONITOR_POINTS==1 */ - -// -------------------------------------------------------------- - -ACE_Char_Codeset_Translator::~ACE_Char_Codeset_Translator (void) -{ -} - -// -------------------------------------------------------------- - -ACE_WChar_Codeset_Translator::~ACE_WChar_Codeset_Translator (void) -{ -} - -// -------------------------------------------------------------- - -ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CString &x) -{ - os.write_string (x); - return os.good_bit (); -} - -ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CString &x) -{ - is.read_string (x); - return is.good_bit (); -} - -#if defined (GEN_OSTREAM_OPS) - -std::ostream& -operator<< (std::ostream &os, ACE_OutputCDR::from_boolean x) -{ - return (x.val_ ? os << "true" : os << "false"); -} - -std::ostream& -operator<< (std::ostream &os, ACE_OutputCDR::from_char x) -{ - return os << '\'' << x.val_ << '\''; -} - -std::ostream& -operator<< (std::ostream &os, ACE_OutputCDR::from_wchar x) -{ - os.setf (ios_base::showbase); - os.setf (ios_base::hex, ios_base::basefield); - os << x.val_; - os.unsetf (ios_base::showbase); - os.setf (ios_base::dec, ios_base::basefield); - return os; -} - -std::ostream& -operator<< (std::ostream &os, ACE_OutputCDR::from_octet x) -{ - // Same format (hex) and no risk of overflow. - ACE_CDR::WChar w = static_cast (x.val_); - ACE_OutputCDR::from_wchar tmp (w); - return os << tmp; -} - -#endif /* GEN_OSTREAM_OPS */ - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/CE_Screen_Output.cpp b/dep/src/ace/CE_Screen_Output.cpp deleted file mode 100644 index c5cdc43d208..00000000000 --- a/dep/src/ace/CE_Screen_Output.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// $Id: CE_Screen_Output.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/CE_Screen_Output.h" -#if defined (ACE_HAS_WINCE) - -#include "ace/Log_Msg.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_CE_Screen_Output::ACE_CE_Screen_Output(HWND hEdit) -: handler_(hEdit) -, pFile_(0) -{ -} - -ACE_CE_Screen_Output::ACE_CE_Screen_Output() -: handler_(0) -, pFile_(0) -{ -} - -ACE_CE_Screen_Output::~ACE_CE_Screen_Output() -{ - if (pFile_ != 0) { - fclose(pFile_); - } -} - -void ACE_CE_Screen_Output::log(ACE_Log_Record &log_record) -{ - ACE_TCHAR verbose_msg[ACE_Log_Record::MAXVERBOSELOGMSGLEN]; - int result = log_record.format_msg (ACE_TEXT("WindozeCE"), // host name - 0, // verbose flag - verbose_msg); - - if (result == 0) - { - verbose_msg[ ACE_OS::strlen(verbose_msg) - 1 ] = 0; // CE does not like '\n' by itself. - *this << verbose_msg << endl; - } -} - -void ACE_CE_Screen_Output::SetOutputWindow(HWND hEdit) -{ - handler_ = hEdit; -} - -void ACE_CE_Screen_Output::clear() -{ - SetWindowText(handler_, 0); -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (ACE_TCHAR* output) -{ - int length = GetWindowTextLength(handler_); - SendMessage(handler_, EM_SETSEL, length, length); - SendMessage(handler_, EM_REPLACESEL, 0, (LPARAM)output); - - if (pFile_ != 0) - { - fwprintf(pFile_, L"%s", output); - } - - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (const ACE_TCHAR* output) -{ - ACE_TCHAR* buffer = ACE_OS::strdup(output); - if (buffer != 0) - { - *this << buffer; - delete buffer; - } - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (ACE_ANTI_TCHAR* output) -{ - *this << ACE_TEXT_CHAR_TO_TCHAR(output); - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (const ACE_ANTI_TCHAR* output) -{ - *this << ACE_TEXT_CHAR_TO_TCHAR(output); - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (char output) -{ - *this << (int)output; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned char output) -{ - *this << (int)output; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned short output) -{ - ACE_TCHAR buffer[20]; - wsprintf(buffer, ACE_TEXT("%u"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (int output) -{ - ACE_TCHAR buffer[20]; - wsprintf(buffer, ACE_TEXT("%d"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned int output) -{ - ACE_TCHAR buffer[20]; - wsprintf(buffer, ACE_TEXT("%du"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (float output) -{ - ACE_TCHAR buffer[20]; - swprintf(buffer, ACE_TEXT("%f"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (long output) -{ - ACE_TCHAR buffer[20]; - wsprintf(buffer, ACE_TEXT("%l"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned long output) -{ - ACE_TCHAR buffer[20]; - wsprintf(buffer, ACE_TEXT("%lu"), output); - *this << buffer; - return *this; -} - -ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (FILE* pFile) -{ - pFile_ = pFile; - return *this; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif // ACE_HAS_WINCE - diff --git a/dep/src/ace/Cache_Map_Manager_T.cpp b/dep/src/ace/Cache_Map_Manager_T.cpp deleted file mode 100644 index 59303acb515..00000000000 --- a/dep/src/ace/Cache_Map_Manager_T.cpp +++ /dev/null @@ -1,421 +0,0 @@ -// $Id: Cache_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CACHE_MAP_MANAGER_T_CPP -#define ACE_CACHE_MAP_MANAGER_T_CPP - -#include "ace/Cache_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Log_Msg.h" -#include "ace/Malloc_Base.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Cache_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Manager) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Iterator) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Reverse_Iterator) - -#define ACE_T1 class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES - -template -ACE_Cache_Map_Manager::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s, - size_t size, - ACE_Allocator *alloc) - : caching_strategy_ (caching_s) -{ - if (this->open (size, alloc) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Cache_Map_Manager::ACE_Cache_Map_Manager"))); - -} - -template -ACE_Cache_Map_Manager::~ACE_Cache_Map_Manager (void) -{ - this->close (); -} - -template int -ACE_Cache_Map_Manager::open (size_t length, - ACE_Allocator *alloc) -{ - return this->map_.open (length, - alloc); -} - -template int -ACE_Cache_Map_Manager::close (void) -{ - return this->map_.close (); -} - -template int -ACE_Cache_Map_Manager::bind (const KEY &key, - const VALUE &value) -{ - // Insert an entry which has the and the which - // is the combination of the and the attributes of the - // caching strategy. - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int bind_result = this->map_.bind (key, - cache_value); - - if (bind_result != -1) - { - - int result = this->caching_strategy_.notify_bind (bind_result, - cache_value.second ()); - - if (result == -1) - { - - this->map_.unbind (key); - - // Unless the notification goes thru the bind operation is - // not complete. - bind_result = -1; - - } - - } - - return bind_result; -} - - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - - } - - return rebind_result; -} - - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value, - VALUE &old_value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - CACHE_VALUE old_cache_value (old_value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value, - old_cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - else - { - - old_value = old_cache_value.first (); - - } - - } - - return rebind_result; -} - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value, - KEY &old_key, - VALUE &old_value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - CACHE_VALUE old_cache_value (old_value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value, - old_key, - old_cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - else - { - - old_value = old_cache_value.first (); - - } - - } - - return rebind_result; -} - -template int -ACE_Cache_Map_Manager::trybind (const KEY &key, - VALUE &value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int trybind_result = this->map_.trybind (key, - cache_value); - - if (trybind_result != -1) - { - - int result = this->caching_strategy_.notify_trybind (trybind_result, - cache_value.second ()); - - if (result == -1) - { - - // If the entry has got inserted into the map, it is removed - // due to failure. - if (trybind_result == 0) - this->map_.unbind (key); - - trybind_result = -1; - - } - else - { - - // If an attempt is made to bind an existing entry the value - // is overwritten with the value from the map. - if (trybind_result == 1) - value = cache_value.first (); - - } - - } - - return trybind_result; -} - -template int -ACE_Cache_Map_Manager::find (const KEY &key, - VALUE &value) -{ - // Lookup the key and populate the . - CACHE_VALUE cache_value; - - int find_result = this->map_.find (key, - cache_value); - - if (find_result != -1) - { - - int result = this->caching_strategy_.notify_find (find_result, - cache_value.second ()); - - // Unless the find and notification operations go thru, this - // method is not successful. - if (result == -1) - find_result = -1; - else - { - - // Since the has now changed after the - // notification, we need to bind to the map again. - int rebind_result = this->map_.rebind (key, - cache_value); - if (rebind_result == -1) - find_result = -1; - else - value = cache_value.first (); - - } - - } - - return find_result; -} - -template int -ACE_Cache_Map_Manager::find (const KEY &key) -{ - // Lookup the key and populate the . - CACHE_VALUE cache_value; - - int find_result = this->map_.find (key, - cache_value); - - if (find_result != -1) - { - - int result = this->caching_strategy_.notify_find (find_result, - cache_value.second ()); - - // Unless the find and notification operations go thru, this - // method is not successful. - if (result == -1) - find_result = -1; - else - { - - // Since the has now changed after the - // notification, we need to bind to the map again. - int rebind_result = this->map_.rebind (key, - cache_value); - - if (rebind_result == -1) - find_result = -1; - - } - - } - - return find_result; -} - - -template int -ACE_Cache_Map_Manager::unbind (const KEY &key) -{ - // Remove the entry from the cache. - CACHE_VALUE cache_value; - - int unbind_result = this->map_.unbind (key, - cache_value); - - if (unbind_result != -1) - { - - int result = this->caching_strategy_.notify_unbind (unbind_result, - cache_value.second ()); - - if (result == -1) - unbind_result = -1; - - } - - return unbind_result; -} - -template int -ACE_Cache_Map_Manager::unbind (const KEY &key, - VALUE &value) -{ - // Remove the entry from the cache. - CACHE_VALUE cache_value; - - int unbind_result = this->map_.unbind (key, - cache_value); - - if (unbind_result != -1) - { - - int result = this->caching_strategy_.notify_unbind (unbind_result, - cache_value.second ()); - - if (result == -1) - unbind_result = -1; - else - value = cache_value.first (); - - } - - return unbind_result; -} - -template void -ACE_Cache_Map_Manager::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->map_.dump (); - - this->caching_strategy_.dump (); -#endif /* ACE_HAS_DUMP */ -} - -#undef ACE_T1 -#undef ACE_T2 - -template -ACE_Cache_Map_Iterator::~ACE_Cache_Map_Iterator (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CACHE_MAP_MANAGER_T_CPP */ - diff --git a/dep/src/ace/Cached_Connect_Strategy_T.cpp b/dep/src/ace/Cached_Connect_Strategy_T.cpp deleted file mode 100644 index abf546c514f..00000000000 --- a/dep/src/ace/Cached_Connect_Strategy_T.cpp +++ /dev/null @@ -1,735 +0,0 @@ -//$Id: Cached_Connect_Strategy_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CACHED_CONNECT_STRATEGY_T_CPP -#define ACE_CACHED_CONNECT_STRATEGY_T_CPP - -#include "ace/Cached_Connect_Strategy_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/ACE.h" -#include "ace/Service_Repository.h" -#include "ace/Service_Types.h" -#include "ace/Thread_Manager.h" -#include "ace/WFMO_Reactor.h" -#include "ace/Pair_T.h" - -#define ACE_T1 class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX -#define ACE_T2 SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Cached_Connect_Strategy_Ex::ACE_Cached_Connect_Strategy_Ex -(CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s, - ACE_Concurrency_Strategy *con_s, - ACE_Recycling_Strategy *rec_s, - MUTEX *lock, - int delete_lock) - : CCSBASE (cre_s, con_s, rec_s, lock, delete_lock), - connection_cache_ (caching_s) -{ - if (this->open (cre_s, con_s, rec_s) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Cached_Connect_Strategy_Ex\n"))); -} - -template -ACE_Cached_Connect_Strategy_Ex::~ACE_Cached_Connect_Strategy_Ex (void) -{ - cleanup (); -} - - -template int -ACE_Cached_Connect_Strategy_Ex::check_hint_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found) -{ - ACE_UNUSED_ARG (remote_addr); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (local_addr); - ACE_UNUSED_ARG (reuse_addr); - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (perms); - - found = 0; - - // Get the recycling act for the svc_handler - CONNECTION_CACHE_ENTRY *possible_entry = - (CONNECTION_CACHE_ENTRY *) sh->recycling_act (); - - // Check to see if the hint svc_handler has been closed down - if (possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED) - { - // If close, decrement refcount - if (possible_entry->ext_id_.decrement () == 0) - { - // If refcount goes to zero, close down the svc_handler - possible_entry->int_id_.first ()->recycler (0, 0); - possible_entry->int_id_.first ()->close (); - this->purge_i (possible_entry); - } - - // Hint not successful - found = 0; - - // Reset hint - sh = 0; - } - - // If hint is not closed, see if it is connected to the correct - // address and is recyclable - else if ((possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) && - possible_entry->ext_id_.subject () == remote_addr) - { - // Hint successful - found = 1; - - // Tell the that it should prepare itself for - // being recycled. - this->prepare_for_recycling (sh); - - // - // Update the caching attributes directly since we don't do a - // find() on the cache map. - // - - // Indicates successful find. - int find_result = 0; - - int result = this->caching_strategy ().notify_find (find_result, - possible_entry->int_id_.second ()); - - if (result == -1) - return result; - } - else - { - // This hint will not be used. - possible_entry->ext_id_.decrement (); - - // Hint not successful - found = 0; - - // If is not connected to the correct address or is busy, - // we will not use it. - sh = 0; - } - - if (found) - entry = possible_entry; - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::find_or_create_svc_handler_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found) -{ - REFCOUNTED_HASH_RECYCLABLE_ADDRESS search_addr (remote_addr); - - // Try to find the address in the cache. Only if we don't find it - // do we create a new and connect it with the server. - while (this->find (search_addr, entry) != -1) - { - // We found a cached svc_handler. - // Get the cached - sh = entry->int_id_.first (); - - // Is the connection clean? - int state_result = - ACE::handle_ready (sh->peer ().get_handle (), - &ACE_Time_Value::zero, - 1, // read ready - 0, // write ready - 1);// exception ready - - if (state_result == 1) - { - - if (sh->close () == -1) - return -1; - - sh = 0; - - // Cycle it once again.. - } - else if ((state_result == -1) && (errno == ETIME)) - { - // Found!!! - // Set the flag - found = 1; - - // Tell the that it should prepare itself for - // being recycled. - if (this->prepare_for_recycling (sh) == -1) - return -1; - - return 0; - } - else - { - return -1; - } - } - - // Not found... - - // Set the flag - found = 0; - - // We need to use a temporary variable here since we are not - // allowed to change because other threads may use this - // when we let go of the lock during the OS level connect. - // - // Note that making a new svc_handler, connecting remotely, - // binding to the map, and assigning of the hint and recycler - // should be atomic to the outside world. - SVC_HANDLER *potential_handler = 0; - - // Create a new svc_handler - if (this->make_svc_handler (potential_handler) == -1) - return -1; - - // Connect using the svc_handler. - if (this->cached_connect (potential_handler, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - // Close the svc handler. - potential_handler->close (0); - - return -1; - } - else - { - // Insert the new SVC_HANDLER instance into the cache. - if (this->connection_cache_.bind (search_addr, - potential_handler, - entry) == -1) - { - // Close the svc handler and reset . - potential_handler->close (0); - - return -1; - } - - // Everything succeeded as planned. Assign to - // . - sh = potential_handler; - - // Set the recycler and the recycling act - - this->assign_recycler (sh, this, entry); - } - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::cached_connect (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - // Actively establish the connection. This is a timed blocking - // connect. - if (this->new_connection (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - // If connect() failed because of timeouts, we have to reject - // the connection entirely. This is necessary since currently - // there is no way for the non-blocking connects to complete and - // for the to notify the cache of the completion of - // connect(). - - if (errno == EWOULDBLOCK || errno == ETIMEDOUT) - errno = ENOTSUP; - else if (ACE::out_of_handles (errno) || errno == EADDRINUSE) - { - // If the connect failed due to the process running out of - // file descriptors then, auto_purging of some connections - // are done from the CONNECTION_CACHE. This frees the - // descriptors which get used in the connect process and - // hence the same method is called again! - if (this->purge_connections () == -1) - return -1; - - // Try connecting again. - if (this->new_connection (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - if (errno == EWOULDBLOCK || errno == ETIMEDOUT) - errno = ENOTSUP; - return -1; - } - } - else - { - return -1; - } - } - - return 0; - -} - - -template int -ACE_Cached_Connect_Strategy_Ex::connect_svc_handler_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int& found) -{ - CONNECTION_CACHE_ENTRY *entry = 0; - - // Check if the user passed a hint svc_handler - if (sh != 0) - { - int result = this->check_hint_i (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms, - entry, - found); - if (result != 0) - return result; - } - - // If not found - if (!found) - { - int result = this->find_or_create_svc_handler_i (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms, - entry, - found); - - if (result != 0) - return result; - - // Increment the refcount - entry->ext_id_.increment (); - } - - // For all successful cases: mark the in the cache - // as being . Therefore recyclable is BUSY. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY); - - return 0; -} - - -template int -ACE_Cached_Connect_Strategy_Ex::cache_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE); - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::recycle_state_i (const void *recycling_act, - ACE_Recyclable_State new_state) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - entry->ext_id_.recycle_state (new_state); - - return 0; -} - -template ACE_Recyclable_State -ACE_Cached_Connect_Strategy_Ex::recycle_state_i (const void *recycling_act) const -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - return entry->ext_id_.recycle_state (); -} - -template int -ACE_Cached_Connect_Strategy_Ex::purge_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - return this->connection_cache_.unbind (entry); -} - - -template int -ACE_Cached_Connect_Strategy_Ex::mark_as_closed_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as CLOSED. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_CLOSED); - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::cleanup_hint_i (const void *recycling_act, - void **act_holder) -{ - // Reset the <*act_holder> in the confines and protection of the - // lock. - if (act_holder) - *act_holder = 0; - - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Decrement the refcount on the . - int refcount = entry->ext_id_.decrement (); - - // If the svc_handler state is closed and the refcount == 0, call - // close() on svc_handler. - if (entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED && - refcount == 0) - { - entry->int_id_.first ()->recycler (0, 0); - entry->int_id_.first ()->close (); - this->purge_i (entry); - } - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::purge_connections (void) -{ - return this->connection_cache_.purge (); -} - -template CACHING_STRATEGY & -ACE_Cached_Connect_Strategy_Ex::caching_strategy (void) -{ - return this->connection_cache_.caching_strategy (); -} - -template int -ACE_Cached_Connect_Strategy_Ex::find (ACE_Refcounted_Hash_Recyclable &search_addr, - ACE_Hash_Map_Entry, ACE_Pair > *&entry) -{ - typedef ACE_Hash_Map_Bucket_Iterator, - ACE_Hash, - ACE_Equal_To, - ACE_Null_Mutex> - CONNECTION_CACHE_BUCKET_ITERATOR; - - CONNECTION_CACHE_BUCKET_ITERATOR iterator (this->connection_cache_.map (), - search_addr); - - CONNECTION_CACHE_BUCKET_ITERATOR end (this->connection_cache_.map (), - search_addr, - 1); - - for (; - iterator != end; - ++iterator) - { - REFCOUNTED_HASH_RECYCLABLE_ADDRESS &addr = (*iterator).ext_id_; - - if (addr.recycle_state () != ACE_RECYCLABLE_IDLE_AND_PURGABLE && - addr.recycle_state () != ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) - continue; - - if (addr.subject () != search_addr.subject ()) - continue; - - entry = &(*iterator); - - // - // Update the caching attributes directly since we don't do a - // find() on the cache map. - // - - // Indicates successful find. - int find_result = 0; - - int result = this->caching_strategy ().notify_find (find_result, - entry->int_id_.second ()); - - if (result == -1) - return result; - - return 0; - } - - return -1; -} - -template void -ACE_Cached_Connect_Strategy_Ex::cleanup (void) -{ - // Excluded other threads from changing the cache while we cleanup - ACE_GUARD (MUTEX, ace_mon, *this->lock_); - - // Close down all cached service handlers. - typename CONNECTION_CACHE::ITERATOR iter = this->connection_cache_.begin (); - while (iter != this->connection_cache_.end ()) - { - if ((*iter).second () != 0) - { - // save entry for future use - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) - (*iter).second ()->recycling_act (); - - // close handler - (*iter).second ()->recycler (0, 0); - (*iter).second ()->close (); - - // remember next iter - typename CONNECTION_CACHE::ITERATOR next_iter = iter; - ++next_iter; - - // purge the item from the hash - this->purge_i (entry); - - // assign next iter - iter = next_iter; - } - else - ++iter; - } -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Cached_Connect_Strategy_Ex) -///////////////////////////////////////////////////////////////////////// - -template -ACE_Bounded_Cached_Connect_Strategy::ACE_Bounded_Cached_Connect_Strategy -(size_t max_size, - CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s, - ACE_Concurrency_Strategy *con_s, - ACE_Recycling_Strategy *rec_s, - MUTEX *lock, - int delete_lock) - : CCSEBASE (caching_s, cre_s, con_s, rec_s, lock, delete_lock), - max_size_ (max_size) -{ -} - -template -ACE_Bounded_Cached_Connect_Strategy::~ACE_Bounded_Cached_Connect_Strategy(void) -{ -} - -template -int -ACE_Bounded_Cached_Connect_Strategy::find_or_create_svc_handler_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, - ACE_Pair > *&entry, - int &found) -{ - - REFCOUNTED_HASH_RECYCLABLE_ADDRESS search_addr (remote_addr); - - // Try to find the address in the cache. Only if we don't find it - // do we create a new and connect it with the server. - while (this->find (search_addr, entry) != -1) - { - // We found a cached svc_handler. - // Get the cached - sh = entry->int_id_.first (); - - // Is the connection clean? - int state_result= ACE::handle_ready (sh->peer ().get_handle (), - &ACE_Time_Value::zero, - 1, // read ready - 0, // write ready - 1);// exception ready - - if (state_result == 1) - { - // The connection was disconnected during idle. - // close the svc_handler down. - if (sh->close () == -1) - { - ACE_ASSERT (0); - return -1; - } - sh = 0; - // and rotate once more... - } - else if ((state_result == -1) && (errno == ETIME)) - { - // Found!!! - // Set the flag - found = 1; - - // Tell the that it should prepare itself for - // being recycled. - if (this->prepare_for_recycling (sh) == -1) - { - ACE_ASSERT (0); - return -1; - } - - return 0; - } - else // some other return value or error... - { - ACE_ASSERT (0); // just to see it coming - - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%t)ACE_Bounded_Cached_Connect_Strategy<>::") - ACE_TEXT ("find_or_create_svc_handler_i - ") - ACE_TEXT ("error polling server socket state.\n"))); - - return -1; - } - } - - // Not found... - - // Set the flag - found = 0; - - // Check the limit of handlers... - if ((this->max_size_ > 0) && - (this->connection_cache_.current_size () >= this->max_size_)) - { - // Try to purge idle connections - if (this->purge_connections () == -1) - return -1; - - // Check limit again. - if (this->connection_cache_.current_size () >= this->max_size_) - // still too much! - return -1; - - // OK, we have room now... - } - - // We need to use a temporary variable here since we are not - // allowed to change because other threads may use this - // when we let go of the lock during the OS level connect. - // - // Note that making a new svc_handler, connecting remotely, - // binding to the map, and assigning of the hint and recycler - // should be atomic to the outside world. - SVC_HANDLER *potential_handler = 0; - - // Create a new svc_handler - if (this->make_svc_handler (potential_handler) == -1) - return -1; - - // Connect using the svc_handler. - if (this->cached_connect (potential_handler, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - // Close the svc handler. - potential_handler->close (0); - return -1; - } - else - { - // Insert the new SVC_HANDLER instance into the cache. - if (this->connection_cache_.bind (search_addr, - potential_handler, - entry) == -1) - { - // Close the svc handler and reset . - potential_handler->close (0); - - return -1; - } - - // Everything succeeded as planned. Assign to - // . - sh = potential_handler; - - // Set the recycler and the recycling act - this->assign_recycler (sh, this, entry); - } - - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Cached_Connect_Strategy) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#undef ACE_T1 -#undef ACE_T2 - -#endif /* ACE_CACHED_CONNECT_STRATEGY_T_CPP */ - diff --git a/dep/src/ace/Caching_Strategies_T.cpp b/dep/src/ace/Caching_Strategies_T.cpp deleted file mode 100644 index f7c047fb5bb..00000000000 --- a/dep/src/ace/Caching_Strategies_T.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//$Id: Caching_Strategies_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CACHING_STRATEGIES_T_CPP -#define ACECACHING_STRATEGIES_T_CPP - -#include "ace/Caching_Strategies_T.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Caching_Strategies_T.inl" -#endif /* __ACE_INLINE__ */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Caching_Strategy::~ACE_Caching_Strategy (void) -{ -} - -////////////////////////////////////////////////////////////////////////////////// - -template -ACE_LRU_Caching_Strategy::ACE_LRU_Caching_Strategy (void) - : timer_ (0), - purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_LFU_Caching_Strategy::ACE_LFU_Caching_Strategy (void) - : purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_FIFO_Caching_Strategy::ACE_FIFO_Caching_Strategy (void) - : order_ (0), - purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -ACE_ALLOC_HOOK_DEFINE(ACE_LRU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_LFU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Null_Caching_Strategy) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CACHING_STRATEGIES_T_CPP */ - diff --git a/dep/src/ace/Caching_Utility_T.cpp b/dep/src/ace/Caching_Utility_T.cpp deleted file mode 100644 index 15e402985cc..00000000000 --- a/dep/src/ace/Caching_Utility_T.cpp +++ /dev/null @@ -1,500 +0,0 @@ -// $Id: Caching_Utility_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CACHING_UTILITY_T_CPP -#define ACE_CACHING_UTILITY_T_CPP - -#include "ace/Caching_Utility_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Min_Max.h" -#include "ace/OS_Memory.h" -#include "ace/Recyclable.h" - -////////////////////////////////////////////////////////////////////////////// - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Pair_Caching_Utility::ACE_Pair_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Pair_Caching_Utility::~ACE_Pair_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Pair_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache! - // Oops! then there is no way out but exiting. So return an error. - if (current_map_size == 0) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t const entries_to_remove - = ACE_MAX (static_cast (1), - static_cast (static_cast (purge_percent) - / 100 * current_map_size)); - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - - } - - return 0; -} - -template void -ACE_Pair_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR iter = container.begin (); - ITERATOR end = container.end (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (++iter; - iter != end; - ++iter) - { - if (min > (*iter).int_id_.second ()) - { - // Ah! an item with lower ATTTRIBUTES... - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_Recyclable_Handler_Caching_Utility::ACE_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Recyclable_Handler_Caching_Utility::~ACE_Recyclable_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Recyclable_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache is just one! - // Oops! then there is no way out but exiting. So return an error. - // if (current_map_size <= 1) - if (current_map_size == 0) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t const entries_to_remove - = ACE_MAX (static_cast (1), - static_cast (static_cast (purge_percent) - / 100 * current_map_size)); - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - } - - return 0; -} - -template void -ACE_Recyclable_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR end = container.end (); - ITERATOR iter = container.begin (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = 0; - value_to_remove = 0; - // Found the minimum entry to be purged? - int found = 0; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (; - iter != end; - ++iter) - { - // If the entry isnt IDLE_AND_PURGABLE continue until you reach - // the first entry which can be purged. This is the minimum with - // which you will compare the rest of the purgable entries. - if ((*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - (*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE) - { - if (found == 0) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - found = 1; - } - else - { - // Ah! an entry with lower ATTTRIBUTES... - if (min > (*iter).int_id_.second ()) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - -template -ACE_Refcounted_Recyclable_Handler_Caching_Utility::ACE_Refcounted_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy), - marked_as_closed_entries_ (0) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Refcounted_Recyclable_Handler_Caching_Utility::~ACE_Refcounted_Recyclable_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Refcounted_Recyclable_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container which can be considered for purging. - size_t const available_entries = - container.current_size () - this->marked_as_closed_entries_; - - // Also whether the number of entries in the cache zero. - // Oops! then there is no way out but exiting. - if (available_entries <= 0) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove - = ACE_MAX (static_cast (1), - static_cast (static_cast (purge_percent) - / 100 * available_entries)); - - if (entries_to_remove >= available_entries || entries_to_remove == 0) - entries_to_remove = available_entries - 1; - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - - ++this->marked_as_closed_entries_; - } - - return 0; -} - -template void -ACE_Refcounted_Recyclable_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR end = container.end (); - ITERATOR iter = container.begin (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = 0; - value_to_remove = 0; - // Found the minimum entry to be purged? - int found = 0; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (; - iter != end; - ++iter) - { - // If the entry isnt IDLE_AND_PURGABLE continue until you reach - // the first entry which can be purged. This is the minimum with - // which you will compare the rest of the purgable entries. - if ((*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - (*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE) - { - if (found == 0) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - found = 1; - } - else - { - // Ah! an entry with lower ATTTRIBUTES... - if (min > (*iter).int_id_.second ()) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - -template -ACE_Handler_Caching_Utility::ACE_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Handler_Caching_Utility::~ACE_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache is just one! - // Oops! then there is no way out but exiting. So return an error. - if (current_map_size == 0) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove - = ACE_MAX (static_cast (1), - static_cast (static_cast (purge_percent) - / 100 * current_map_size)); - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - } - - return 0; -} - -template void -ACE_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR iter = container.begin (); - ITERATOR end = container.end (); - ATTRIBUTES min = (*iter).int_id_->caching_attributes (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (++iter; - iter != end; - ++iter) - { - if (min > (*iter).int_id_->caching_attributes () && - (*iter).int_id_->active () != 1) - { - // Ah! an item with lower ATTTRIBUTES... - min = (*iter).int_id_->caching_attributes (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_Null_Caching_Utility::ACE_Null_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Null_Caching_Utility::~ACE_Null_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Null_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - ACE_UNUSED_ARG (container); - ACE_UNUSED_ARG (purge_percent); - - return 0; -} - -template void -ACE_Null_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - ACE_UNUSED_ARG (container); - ACE_UNUSED_ARG (key_to_remove); - ACE_UNUSED_ARG (value_to_remove); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CACHING_UTILITY_T_CPP */ - diff --git a/dep/src/ace/Capabilities.cpp b/dep/src/ace/Capabilities.cpp deleted file mode 100644 index 95bd812586f..00000000000 --- a/dep/src/ace/Capabilities.cpp +++ /dev/null @@ -1,355 +0,0 @@ -#include "ace/Capabilities.h" -#include "ace/OS_NS_ctype.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Capabilities.inl" -#endif /* !__ACE_INLINE__ */ - -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (ace, - Capabilities, - "$Id: Capabilities.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#define ACE_ESC ((ACE_TCHAR)0x1b) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_CapEntry::~ACE_CapEntry (void) -{ -} - -ACE_Capabilities::ACE_Capabilities (void) - : caps_ () -{ -} - -ACE_Capabilities::~ACE_Capabilities (void) -{ - this->resetcaps (); -} - -const ACE_TCHAR * -ACE_Capabilities::parse (const ACE_TCHAR *buf, ACE_TString &cap) -{ - while (*buf != ACE_TEXT ('\0') && *buf != ACE_TEXT (',')) - { - if (*buf == ACE_TEXT ('\\')) - { - ++buf; - if (*buf == ACE_TEXT ('E') || *buf == ACE_TEXT ('e')) - { - cap += ACE_ESC; - ++buf; - continue; - } - else if (*buf == ACE_TEXT ('r')) - { - cap += ACE_TEXT ('\r'); - ++buf; - continue; - } - else if (*buf == ACE_TEXT ('n')) - { - cap += ACE_TEXT ('\n'); - ++buf; - continue; - } - else if (*buf == ACE_TEXT ('t')) - { - cap += ACE_TEXT ('\t'); - ++buf; - continue; - } - else if (*buf == ACE_TEXT ('\\')) - { - cap += *buf++; - continue; - } - if (ACE_OS::ace_isdigit(*buf)) - { - // @@ UNICODE Does this work with unicode? - int oc = 0; - for (int i = 0; - i < 3 && *buf && ACE_OS::ace_isdigit (*buf); - i++) - oc = oc * 8 + (*buf++ - ACE_TEXT ('0')); - - cap += (ACE_TCHAR) oc; - continue; - } - } - cap += *buf++; - } - return buf; -} - -const ACE_TCHAR * -ACE_Capabilities::parse (const ACE_TCHAR *buf, int &cap) -{ - int n = 0; - - while (*buf && ACE_OS::ace_isdigit (*buf)) - n = n * 10 + (*buf++ - ACE_TEXT ('0')); - - cap = n; - - return buf; -} - -void -ACE_Capabilities::resetcaps (void) -{ - for (CAPABILITIES_MAP::ITERATOR iter (this->caps_); - !iter.done (); - iter.advance ()) - { - CAPABILITIES_MAP::ENTRY *entry = 0; - iter.next (entry); - delete entry->int_id_; - } - - this->caps_.close (); - this->caps_.open (); -} - -int -ACE_Capabilities::fillent (const ACE_TCHAR *buf) -{ - this->resetcaps (); - while (*buf) - { - ACE_TString s; - int n; - ACE_TString name; - ACE_CapEntry *ce; - - // Skip blanks - while (*buf && ACE_OS::ace_isspace(*buf)) buf++; - // If we get end of line return - - if (*buf == ACE_TEXT ('\0')) - break; - - if (*buf == ACE_TEXT ('#')) - { - while (*buf && *buf != ACE_TEXT ('\n')) - buf++; - if (*buf == ACE_TEXT ('\n')) - buf++; - continue; - } - while(*buf && *buf != ACE_TEXT ('=') - && *buf!= ACE_TEXT ('#') - && *buf != ACE_TEXT (',')) - name += *buf++; - - // If name is null. - switch (*buf) - { - case ACE_TEXT ('='): - // String property - buf = this->parse (buf + 1, s); - ACE_NEW_RETURN (ce, - ACE_StringCapEntry (s), - -1); - if (this->caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - case ACE_TEXT ('#'): - // Integer property - buf = this->parse (buf + 1, n); - ACE_NEW_RETURN (ce, - ACE_IntCapEntry (n), - -1); - if (this->caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - case ACE_TEXT (','): - // Boolean - ACE_NEW_RETURN (ce, - ACE_BoolCapEntry (1), - -1); - if (this->caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - default: - return 0; - } - - if (*buf++ != ACE_TEXT (',')) - return -1; - } - - return 0; -} - -int -ACE_Capabilities::is_entry (const ACE_TCHAR *name, const ACE_TCHAR *line) -{ - for (;;) - { - // Skip blanks or irrelevant characters - while (*line && ACE_OS::ace_isspace(*line)) - ++line; - - // End of line reached - if (*line == ACE_TEXT ('\0')) - break; - - // Build the entry name - ACE_TString nextname; - while (*line && *line != ACE_TEXT ('|') && *line != ACE_TEXT (',')) - nextname += *line++; - - // We have found the required entry? - if (ACE_OS::strcmp (nextname.c_str (), name) == 0) - return 1; - - // Skip puntuaction char if neccesary. - if (*line == ACE_TEXT ('|') || *line == ACE_TEXT (',')) - ++line; - else - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Invalid entry\n"))); - break; - } - } - return 0; -} - -int -ACE_Capabilities::getline (FILE *fp, ACE_TString &line) -{ - int ch; - - line.set (0, 0); - - while ((ch = ACE_OS::fgetc (fp)) != EOF && ch != ACE_TEXT ('\n')) - line += (ACE_TCHAR) ch; - - if (ch == EOF && line.length () == 0) - return -1; - else - return 0; -} - -int -ACE_Capabilities::getval (const ACE_TCHAR *keyname, ACE_TString &val) -{ - ACE_CapEntry* cap = 0; - if (this->caps_.find (keyname, cap) == -1) - return -1; - - ACE_StringCapEntry *scap = - dynamic_cast (cap); - if (scap == 0) - return -1; - - val = scap->getval (); - return 0; -} - -int -ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) -{ - ACE_CapEntry *cap = 0; - if (this->caps_.find (keyname, cap) == -1) - return -1; - - ACE_IntCapEntry *icap = - dynamic_cast (cap); - if (icap != 0) - { - val = icap->getval (); - return 0; - } - - ACE_BoolCapEntry *bcap = - dynamic_cast (cap); - - if (bcap == 0) - return -1; - - val = bcap->getval (); - return 0; -} - -#if !defined (ACE_IS_SPLITTING) -static int -is_empty (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line == ACE_TEXT ('\0') || *line == ACE_TEXT ('#'); -} - -static int -is_line (const ACE_TCHAR *line) -{ - while (*line && ACE_OS::ace_isspace (*line)) - ++line; - - return *line != ACE_TEXT ('\0'); -} -#endif /* !ACE_IS_SPLITTING */ - -int -ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) -{ - FILE *fp = ACE_OS::fopen (fname, ACE_TEXT ("r")); - - if (fp == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Can't open %s file\n"), - fname), - -1); - - int done; - ACE_TString line; - - while (0 == (done = (this->getline (fp, line) == -1)) - && is_empty (line.c_str ())) - continue; - - while (!done) - { - ACE_TString newline; - ACE_TString description; - - while (0 == (done = (this->getline (fp, newline) == -1))) - if (is_line (newline.c_str ())) - description += newline; - else - break; - - if (this->is_entry (name, line.c_str())) - { - ACE_OS::fclose (fp); - return this->fillent (description.c_str ()); - } - - line = newline; - while (!done && is_empty (line.c_str ())) - done = this->getline (fp, line) == -1; - } - - ACE_OS::fclose (fp); - return -1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Cleanup.cpp b/dep/src/ace/Cleanup.cpp deleted file mode 100644 index e7736972678..00000000000 --- a/dep/src/ace/Cleanup.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// $Id: Cleanup.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Cleanup.h" - -ACE_RCSID (ace, - Cleanup, - "$Id: Cleanup.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (ACE_HAS_INLINED_OSCALLS) -# include "ace/Cleanup.inl" -#endif /* ACE_HAS_INLINED_OSCALLS */ - -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Cleanup::cleanup (void *) -{ - delete this; -} - -ACE_Cleanup::~ACE_Cleanup (void) -{ -} - -/*****************************************************************************/ - -extern "C" void -ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *object, void *param) -{ - object->cleanup (param); -} - -/*****************************************************************************/ - -ACE_Cleanup_Info::ACE_Cleanup_Info (void) - : object_ (0), - cleanup_hook_ (0), - param_ (0) -{ -} - -bool -ACE_Cleanup_Info::operator== (const ACE_Cleanup_Info &o) const -{ - return o.object_ == this->object_ - && o.cleanup_hook_ == this->cleanup_hook_ - && o.param_ == this->param_; -} - -bool -ACE_Cleanup_Info::operator!= (const ACE_Cleanup_Info &o) const -{ - return !(*this == o); -} - -/*****************************************************************************/ - -/** - * @class ACE_Cleanup_Info_Node - * - * @brief For maintaining a list of ACE_Cleanup_Info items. - * - * For internal use by ACE_Object_Manager. - */ -class ACE_Cleanup_Info_Node -{ -public: - ACE_Cleanup_Info_Node (void); - ACE_Cleanup_Info_Node (const ACE_Cleanup_Info &new_info, - ACE_Cleanup_Info_Node *next); - ~ACE_Cleanup_Info_Node (void); - ACE_Cleanup_Info_Node *insert (const ACE_Cleanup_Info &); -private: - ACE_Cleanup_Info cleanup_info_; - ACE_Cleanup_Info_Node *next_; - - friend class ACE_OS_Exit_Info; -}; - -ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void) - : cleanup_info_ (), - next_ (0) -{ -} - -ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (const ACE_Cleanup_Info &new_info, - ACE_Cleanup_Info_Node *next) - : cleanup_info_ (new_info), - next_ (next) -{ -} - -ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) -{ - delete next_; -} - -ACE_Cleanup_Info_Node * -ACE_Cleanup_Info_Node::insert (const ACE_Cleanup_Info &new_info) -{ - ACE_Cleanup_Info_Node *new_node = 0; - - ACE_NEW_RETURN (new_node, - ACE_Cleanup_Info_Node (new_info, this), - 0); - - return new_node; -} - -/*****************************************************************************/ - -ACE_OS_Exit_Info::ACE_OS_Exit_Info (void) -{ - ACE_NEW (registered_objects_, ACE_Cleanup_Info_Node); -} - -ACE_OS_Exit_Info::~ACE_OS_Exit_Info (void) -{ - delete registered_objects_; - registered_objects_ = 0; -} - -int -ACE_OS_Exit_Info::at_exit_i (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param) -{ - ACE_Cleanup_Info new_info; - new_info.object_ = object; - new_info.cleanup_hook_ = cleanup_hook; - new_info.param_ = param; - - // Return -1 and sets errno if unable to allocate storage. Enqueue - // at the head and dequeue from the head to get LIFO ordering. - - ACE_Cleanup_Info_Node *new_node = 0; - - if ((new_node = registered_objects_->insert (new_info)) == 0) - return -1; - else - { - registered_objects_ = new_node; - return 0; - } -} - -int -ACE_OS_Exit_Info::find (void *object) -{ - // Check for already in queue, and return 1 if so. - for (ACE_Cleanup_Info_Node *iter = registered_objects_; - iter && iter->next_ != 0; - iter = iter->next_) - { - if (iter->cleanup_info_.object_ == object) - { - // The object has already been registered. - return 1; - } - } - - return 0; -} - -void -ACE_OS_Exit_Info::call_hooks (void) -{ - // Call all registered cleanup hooks, in reverse order of - // registration. - for (ACE_Cleanup_Info_Node *iter = registered_objects_; - iter && iter->next_ != 0; - iter = iter->next_) - { - ACE_Cleanup_Info &info = iter->cleanup_info_; - if (info.cleanup_hook_ == reinterpret_cast ( - ACE_CLEANUP_DESTROYER_NAME)) - // The object is an ACE_Cleanup. - ACE_CLEANUP_DESTROYER_NAME ( - reinterpret_cast (info.object_), - info.param_); - else if (info.object_ == &ace_exit_hook_marker) - // The hook is an ACE_EXIT_HOOK. - (* reinterpret_cast (info.cleanup_hook_)) (); - else - (*info.cleanup_hook_) (info.object_, info.param_); - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Cleanup_Strategies_T.cpp b/dep/src/ace/Cleanup_Strategies_T.cpp deleted file mode 100644 index b6e95e9692b..00000000000 --- a/dep/src/ace/Cleanup_Strategies_T.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//$Id: Cleanup_Strategies_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CLEANUP_STRATEGIES_T_CPP -#define ACE_CLEANUP_STRATEGIES_T_CPP - -#include "ace/Cleanup_Strategies_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -//////////////////////////////////////////////////////////////////////////// - -template -ACE_Cleanup_Strategy::~ACE_Cleanup_Strategy (void) -{ -} - -template int -ACE_Cleanup_Strategy::cleanup (CONTAINER &container, - KEY *key, - VALUE *) -{ - return container.unbind (*key); -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Recyclable_Handler_Cleanup_Strategy::cleanup ( - CONTAINER &container, - KEY *key, - VALUE *) -{ - VALUE value; - - if (container.unbind (*key, value) == -1) - return -1; - - value.first ()->recycler (0, 0); - - value.first ()->close (); - - return 0; -} - -///////////////////////////////////////////////////////////////////////////// - -template int -ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy::cleanup ( - CONTAINER &, - KEY *, - VALUE *value) -{ - return value->first ()->handle_close_i (); -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Handler_Cleanup_Strategy::cleanup ( - CONTAINER &container, - KEY *key, - VALUE *value) -{ - // Remove the item from cache only if the handler isnt in use. - if ((*value)->active () == 0) - { - (*value)->close (); - - if (container.unbind (*key) == -1) - return -1; - - } - - return 0; -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Null_Cleanup_Strategy::cleanup (CONTAINER &, - KEY *, - VALUE *) -{ - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CLEANUP_STRATEGIES_T_CPP */ - diff --git a/dep/src/ace/Codecs.cpp b/dep/src/ace/Codecs.cpp deleted file mode 100644 index d0bb0778304..00000000000 --- a/dep/src/ace/Codecs.cpp +++ /dev/null @@ -1,235 +0,0 @@ -#include "ace/Codecs.h" -#include "ace/Log_Msg.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_ctype.h" - -ACE_RCSID (ace, - Codecs, - "$Id: Codecs.cpp 80826 2008-03-04 14:51:23Z wotte $") - -namespace -{ - // Just in case ... -#undef alphabet -#undef pad -#undef max_columns - - // Symbols which form the Base64 alphabet (Defined as per RFC 2045) - ACE_Byte const alphabet[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - // The padding character used in the encoding - ACE_Byte const pad = '='; - - // Number of columns per line of encoded output (Can have a maximum - // value of 76). - int const max_columns = 72; -} - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -bool ACE_Base64::init_ = false; - -ACE_Byte ACE_Base64::decoder_[256]; - -ACE_Byte ACE_Base64::member_[256]; - -ACE_Byte* -ACE_Base64::encode (const ACE_Byte* input, - const size_t input_len, - size_t* output_len, - bool is_chunked) -{ - if (!ACE_Base64::init_) - ACE_Base64::init(); - - if (!input) - return 0; - - ACE_Byte* result = 0; - - size_t length = ((input_len + 2) / 3) * 4; - size_t num_lines = length / max_columns + 1; - length += num_lines + 1; - ACE_NEW_RETURN (result, ACE_Byte[length], 0); - - int char_count = 0; - int bits = 0; - size_t pos = 0; - int cols = 0; - - for (size_t i = 0; i < input_len; ++i) - { - bits += input[i]; - ++char_count; - - if (char_count == 3) - { - result[pos++] = alphabet[bits >> 18]; - result[pos++] = alphabet[(bits >> 12) & 0x3f]; - result[pos++] = alphabet[(bits >> 6) & 0x3f]; - result[pos++] = alphabet[bits & 0x3f]; - cols += 4; - if (cols == max_columns) { - if (is_chunked) - result[pos++] = '\n'; - cols = 0; - } - bits = 0; - char_count = 0; - } - else - { - bits <<= 8; - } - } - - if (char_count != 0) - { - bits <<= (16 - (8 * char_count)); - result[pos++] = alphabet[bits >> 18]; - result[pos++] = alphabet[(bits >> 12) & 0x3f]; - cols += 2; - if (char_count == 1) - { - result[pos++] = pad; - result[pos++] = pad; - cols += 2; - } - else - { - result[pos++] = alphabet[(bits >> 6) & 0x3f]; - result[pos++] = pad; - cols += 2; - } - } - - if (cols > 0 && is_chunked) - result[pos++] = '\n'; - - result[pos] = 0; - *output_len = pos; - return result; -} - -size_t -ACE_Base64::length (const ACE_Byte* input) -{ - if (!ACE_Base64::init_) - ACE_Base64::init(); - - ACE_Byte* ptr = const_cast (input); - while (*ptr != 0 && - (member_[*(ptr)] == 1 || *ptr == pad - || ACE_OS::ace_isspace (*ptr))) - ++ptr; - size_t len = ptr - input; - len = ((len + 3) / 4) * 3 + 1 ; - return len; -} - -ACE_Byte* -ACE_Base64::decode (const ACE_Byte* input, size_t* output_len) -{ - if (!ACE_Base64::init_) - ACE_Base64::init(); - - if (!input) - return 0; - - size_t result_len = ACE_Base64::length (input); - ACE_Byte* result = 0; - ACE_NEW_RETURN (result, ACE_Byte[result_len], 0); - - ACE_Byte* ptr = const_cast (input); - while (*ptr != 0 && - (member_[*(ptr)] == 1 || *ptr == pad - || ACE_OS::ace_isspace (*ptr))) - ++ptr; - size_t input_len = ptr - input; - - int char_count = 0; - int bits = 0; - size_t pos = 0; - - size_t i = 0; - for (; i < input_len; ++i) - { - if (input[i] == pad) - break; - if (!ACE_Base64::member_[input[i]]) - continue; - bits += decoder_[input[i]]; - ++char_count; - - if (char_count == 4) - { - result[pos++] = static_cast (bits >> 16); - result[pos++] = static_cast ((bits >> 8) & 0xff); - result[pos++] = static_cast (bits & 0xff); - bits = 0; - char_count = 0; - } - else - { - bits <<= 6; - } - } - - int errors = 0; - if ( i == input_len) - { - if (char_count) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Decoding incomplete: atleast %d bits truncated\n"), - (4 - char_count) * 6)); - ++errors; - } - } - else - { - switch (char_count) - { - case 1: - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Decoding incomplete: atleast 2 bits missing\n"))); - ++errors; - break; - case 2: - result[pos++] = static_cast (bits >> 10); - break; - case 3: - result[pos++] = static_cast (bits >> 16); - result[pos++] = static_cast ((bits >> 8) & 0xff); - break; - } - } - - if (errors) - { - delete[] result; - return 0; - } - result[pos] = 0; - *output_len = pos; - return result; -} - -void -ACE_Base64::init () -{ - if (!ACE_Base64::init_) - { - for (ACE_Byte i = 0; i < sizeof (alphabet); ++i) - { - ACE_Base64::decoder_[alphabet[i]] = i; - ACE_Base64::member_ [alphabet[i]] = 1; - } - ACE_Base64::init_ = true; - } - return; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Codeset_IBM1047.cpp b/dep/src/ace/Codeset_IBM1047.cpp deleted file mode 100644 index dde4eafb42c..00000000000 --- a/dep/src/ace/Codeset_IBM1047.cpp +++ /dev/null @@ -1,309 +0,0 @@ - -//============================================================================= -/** - * @file Codeset_IBM1047.cpp - * - * $Id: Codeset_IBM1047.cpp 81661 2008-05-09 12:05:34Z johnnyw $ - * - * Defines the arrays required to convert between ISO8859 (aka - * Latin/1) and IBM1047 (aka EBCDIC). - * - * - * @author Jim Rogers (jrogers@viasoft.com) - */ -//============================================================================= - -#include "ace/Codeset_IBM1047.h" - -#if defined (ACE_HAS_EBCDIC) - -ACE_RCSID (ace, - Codeset_IBM1047, - "$Id: Codeset_IBM1047.cpp 81661 2008-05-09 12:05:34Z johnnyw $") - -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" - -namespace -{ - char const to_IBM1047[] = - { - "\x00\x01\x02\x03\x37\x2D\x2E\x2F\x16\x05\x25\x0B\x0C\x0D\x0E\x0F" // 00-0F - "\x10\x11\x12\x13\x3C\x3D\x32\x26\x18\x19\x3F\x27\x22\x1D\x35\x1F" // 10-1F - "\x40\x5A\x7F\x7B\x5B\x6C\x50\x7D\x4D\x5D\x5C\x4E\x6B\x60\x4B\x61" // 20-2F - "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\x7A\x5E\x4C\x7E\x6E\x6F" // 30-3F - "\x7C\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xD1\xD2\xD3\xD4\xD5\xD6" // 40-4F - "\xD7\xD8\xD9\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xAD\xE0\xBD\x5F\x6D" // 50-5F - "\x79\x81\x82\x83\x84\x85\x86\x87\x88\x89\x91\x92\x93\x94\x95\x96" // 60-6F - "\x97\x98\x99\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xC0\x4F\xD0\xA1\x07" // 70-7F - "\x43\x20\x21\x1C\x23\xEB\x24\x9B\x71\x28\x38\x49\x90\xBA\xEC\xDF" // 80-8F - "\x45\x29\x2A\x9D\x72\x2B\x8A\x9A\x67\x56\x64\x4A\x53\x68\x59\x46" // 90-9F - "\xEA\xDA\x2C\xDE\x8B\x55\x41\xFE\x58\x51\x52\x48\x69\xDB\x8E\x8D" // A0-AF - "\x73\x74\x75\xFA\x15\xB0\xB1\xB3\xB4\xB5\x6A\xB7\xB8\xB9\xCC\xBC" // B0-BF - "\xAB\x3E\x3B\x0A\xBF\x8F\x3A\x14\xA0\x17\xCB\xCA\x1A\x1B\x9C\x04" // C0-CF - "\x34\xEF\x1E\x06\x08\x09\x77\x70\xBE\xBB\xAC\x54\x63\x65\x66\x62" // D0-DF - "\x30\x42\x47\x57\xEE\x33\xB6\xE1\xCD\xED\x36\x44\xCE\xCF\x31\xAA" // E0-EF - "\xFC\x9E\xAE\x8C\xDD\xDC\x39\xFB\x80\xAF\xFD\x78\x76\xB2\x9F\xFF" // F0-FF -}; - - char const from_IBM1047[] = - { - "\x00\x01\x02\x03\xCF\x09\xD3\x7F\xD4\xD5\xC3\x0B\x0C\x0D\x0E\x0F" // 00-0F - "\x10\x11\x12\x13\xC7\xB4\x08\xC9\x18\x19\xCC\xCD\x83\x1D\xD2\x1F" // 10-1F - "\x81\x82\x1C\x84\x86\x0A\x17\x1B\x89\x91\x92\x95\xA2\x05\x06\x07" // 20-2F - "\x20\xEE\x16\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xC1\x1A" // 30-3F - "\x20\xA6\xE1\x80\xEB\x90\x9F\xE2\xAB\x8B\x9B\x2E\x3C\x28\x2B\x7C" // 40-4F - "\x26\xA9\xAA\x9C\xDB\xA5\x99\xE3\xA8\x9E\x21\x24\x2A\x29\x3B\x5E" // 50-5F - "\x2D\x2F\xDF\xDC\x9A\xDD\xDE\x98\x9D\xAC\xBA\x2C\x25\x5F\x3E\x3F" // 60-6F - "\xD7\x88\x94\xB0\xB1\xB2\xFC\xD6\xFB\x60\x3A\x23\x40\x27\x3D\x22" // 70-7F - "\xF8\x61\x62\x63\x64\x65\x66\x67\x68\x69\x96\xA4\xF3\xAF\xAE\xC5" // 80-8F - "\x8C\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x97\x87\xCE\x93\xF1\xFE" // 90-9F - "\xC8\x7E\x73\x74\x75\x76\x77\x78\x79\x7A\xEF\xC0\xDA\x5B\xF2\xF9" // A0-AF - "\xB5\xB6\xFD\xB7\xB8\xB9\xE6\xBB\xBC\xBD\x8D\xD9\xBF\x5D\xD8\xC4" // B0-BF - "\x7B\x41\x42\x43\x44\x45\x46\x47\x48\x49\xCB\xCA\xBE\xE8\xEC\xED" // C0-CF - "\x7D\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\xA1\xAD\xF5\xF4\xA3\x8F" // D0-DF - "\x5C\xE7\x53\x54\x55\x56\x57\x58\x59\x5A\xA0\x85\x8E\xE9\xE4\xD1" // E0-EF - "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\xB3\xF7\xF0\xFA\xA7\xFF" // F0-FF - }; -} - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_IBM1047_ISO8859::ACE_IBM1047_ISO8859 (void) -{ -} - -ACE_IBM1047_ISO8859::~ACE_IBM1047_ISO8859 (void) -{ -} - -ACE_CDR::ULong -ACE_IBM1047_ISO8859::ncs () -{ - return 0x10020417; -} - -ACE_CDR::ULong -ACE_IBM1047_ISO8859::tcs () -{ - return 0x00010001; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_char (ACE_InputCDR &in, - ACE_CDR::Char &x) -{ - if (this->read_1 (in, reinterpret_cast (&x))) - { - x = to_IBM1047[x]; - return 1; - } - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_string (ACE_InputCDR& in, - ACE_CDR::Char *& x) -{ - ACE_CDR::ULong len; - - in.read_ulong (len); - - if (len > 0) - { - ACE_NEW_RETURN (x, - ACE_CDR::Char[len], - 0); - - if (this->read_char_array (in, x, len)) - return 1; - - delete [] x; - } - - x = 0; - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_char_array (ACE_InputCDR& in, - ACE_CDR::Char* x, - ACE_CDR::ULong len) -{ - if (this->read_array (in, - x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - len)) - { - for (ACE_CDR::ULong i = 0; i != len; ++i) - x[i] = to_IBM1047[x[i]]; - - return 1; - } - - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_char (ACE_OutputCDR& out, - ACE_CDR::Char x) -{ - return - this->write_1 (out, - reinterpret_cast (&from_IBM1047[x])); -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_string (ACE_OutputCDR& out, - ACE_CDR::ULong len, - const ACE_CDR::Char* x) -{ - if (out.write_ulong (len + 1)) - return this->write_char_array (out, x, len + 1); - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_char_array (ACE_OutputCDR& out, - const ACE_CDR::Char* x, - ACE_CDR::ULong len) -{ - char *buf = 0; - if (this->adjust (out, len, 1, buf) == 0) - { - ACE_OS::memcpy (buf, x, len); - - for (ACE_CDR::ULong i = 0; i != len; ++i) - buf[i] = from_IBM1047[buf[i]]; - - return 1; - } - - this->good_bit(out, 0); - return 0; -} - -// **************************************************************** - -ACE_ISO8859_IBM1047::ACE_ISO8859_IBM1047 (void) -{ -} - -ACE_ISO8859_IBM1047::~ACE_ISO8859_IBM1047 (void) -{ -} - -ACE_CDR::ULong -ACE_ISO8859_IBM1047::ncs () -{ - return 0x00010001; -} - -ACE_CDR::ULong -ACE_ISO8859_IBM1047::tcs () -{ - return 0x10020417; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_char (ACE_InputCDR& in, - ACE_CDR::Char& x) -{ - if (this->read_1 (in, reinterpret_cast (&x))) - { - x = from_IBM1047[x]; - return 1; - } - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_string (ACE_InputCDR &in, - ACE_CDR::Char *&x) -{ - ACE_CDR::ULong len; - - in.read_ulong (len); - - if (len > 0) - { - ACE_NEW_RETURN (x, - ACE_CDR::Char[len], - 0); - - if (this->read_char_array (in, x, len)) - return 1; - - delete [] x; - } - - x = 0; - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_char_array (ACE_InputCDR &in, - ACE_CDR::Char *x, - ACE_CDR::ULong len) -{ - if (this->read_array (in, - x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - len)) - { - for (ACE_CDR::ULong i = 0; i != len; ++i) - x[i] = from_IBM1047[x[i]]; - - return 1; - } - - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_char (ACE_OutputCDR &out, - ACE_CDR::Char x) -{ - return - this->write_1 (out, - reinterpret_cast (&to_IBM1047[x])); -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_string (ACE_OutputCDR& out, - ACE_CDR::ULong len, - const ACE_CDR::Char* x) -{ - if (out.write_ulong (len + 1)) - return this->write_char_array (out, x, len + 1); - else - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_char_array (ACE_OutputCDR &out, - const ACE_CDR::Char *x, - ACE_CDR::ULong len) -{ - char *buf = 0; - - if (this->adjust (out, len, 1, buf) == 0) - { - ACE_OS::memcpy (buf, x, len); - - for (ACE_CDR::ULong i = 0; i != len; ++i) - buf[i] = to_IBM1047[buf[i]]; - - return 1; - } - - this->good_bit (out, 0); - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_EBCDIC */ - diff --git a/dep/src/ace/Codeset_Registry.cpp b/dep/src/ace/Codeset_Registry.cpp deleted file mode 100644 index 789340af33c..00000000000 --- a/dep/src/ace/Codeset_Registry.cpp +++ /dev/null @@ -1,112 +0,0 @@ -//============================================================================= -/** - * @file Codeset_Registry.cpp - * - * $Id: Codeset_Registry.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * emulated codset regstry functions - * - * - * @author Phil Mesnier - */ -//============================================================================= - -#include "ace/Codeset_Registry.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" - -// $Id: Codeset_Registry.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#if !defined (__ACE_INLINE__) -#include "ace/Codeset_Registry.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - Codeset_Registry, - "$Id: Codeset_Registry.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -int -ACE_Codeset_Registry::locale_to_registry_i (const ACE_CString &locale, - ACE_CDR::ULong &codeset_id, - ACE_CDR::UShort *num_sets, - ACE_CDR::UShort **char_sets) -{ - registry_entry const *element = 0; - for (size_t i = 0; element == 0 && i < num_registry_entries_; i++) - if (ACE_OS::strcmp (registry_db_[i].loc_name_, locale.c_str ()) == 0) - element = ®istry_db_[i]; - if (element == 0) - return 0; - codeset_id = element->codeset_id_; - if (num_sets != 0) - *num_sets = element->num_sets_; - if (char_sets != 0) - { - ACE_NEW_RETURN (*char_sets,ACE_CDR::UShort[element->num_sets_],0); - ACE_OS::memcpy (*char_sets, element->char_sets_, - element->num_sets_ * sizeof (ACE_CDR::UShort)); - } - return 1; -} - -int -ACE_Codeset_Registry::registry_to_locale_i (ACE_CDR::ULong codeset_id, - ACE_CString &locale, - ACE_CDR::UShort *num_sets, - ACE_CDR::UShort **char_sets) -{ - registry_entry const *element = 0; - for (size_t i = 0; element == 0 && i < num_registry_entries_; i++) - if (codeset_id == registry_db_[i].codeset_id_) - element = ®istry_db_[i]; - if (element == 0) - return 0; - locale.set (element->loc_name_); - if (num_sets != 0) - *num_sets = element->num_sets_; - if (char_sets != 0) - { - ACE_NEW_RETURN (*char_sets,ACE_CDR::UShort[element->num_sets_],0); - ACE_OS::memcpy (*char_sets, element->char_sets_, - element->num_sets_ * sizeof (ACE_CDR::UShort)); - } - return 1; -} - -int -ACE_Codeset_Registry::is_compatible_i (ACE_CDR::ULong codeset_id, - ACE_CDR::ULong other) -{ - registry_entry const *lhs = 0; - registry_entry const *rhs = 0; - for (size_t i = 0; (lhs == 0 || rhs == 0) && i < num_registry_entries_; i++) - { - if (codeset_id == registry_db_[i].codeset_id_) - lhs = ®istry_db_[i]; - if (other == registry_db_[i].codeset_id_) - rhs = ®istry_db_[i]; - } - - if (lhs == 0 || rhs == 0) - return 0; - - for (ACE_CDR::UShort l = 0; l < lhs->num_sets_; l++) - for (ACE_CDR::UShort r = 0; r < rhs->num_sets_; r++) - if (rhs->char_sets_[r] == lhs->char_sets_[l]) - return 1; - return 0; -} - -ACE_CDR::Short -ACE_Codeset_Registry::get_max_bytes_i (ACE_CDR::ULong codeset_id) -{ - for (size_t i = 0; i < num_registry_entries_; i++) - if (codeset_id == registry_db_[i].codeset_id_) - return registry_db_[i].max_bytes_; - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Codeset_Registry_db.cpp b/dep/src/ace/Codeset_Registry_db.cpp deleted file mode 100644 index 1f900db9b4f..00000000000 --- a/dep/src/ace/Codeset_Registry_db.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id: Codeset_Registry_db.cpp 81756 2008-05-22 09:47:33Z johnnyw $ - * Codeset registry DB, generated Fri Feb 28 21:01:30 2003 - * source: code_set_registry1.2g.txt - * - * To populate the registry_db, construct a codeset registry text file based - * on the OSF's Character and Code Set Registry. See DCE RFC 40.1 for details - * on obtaining the full text for the current registry. Once you have composed - * a text file containing all the desired codeset information, build and run - * mkcsregdb. The source is in $ACE_ROOT/apps/mkcsregdb. It will generate a new - * copy of this file, with the registry_db_ array properly initialized. - */ - -#include "ace/Codeset_Registry.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Codeset_Registry::registry_entry const -ACE_Codeset_Registry::registry_db_[] = -{ - {"ISO/IEC 10646-1:1993; UCS-2, Level 1","UCS-2",0x00010100,1,{0x1000},2}, - {"ISO 8859-1:1987; Latin Alphabet No. 1","ISO8859_1",0x00010001,1,{0x0011},1}, - {"IBM-1047 (CCSID 01047); Latin-1 Open System","EBCDIC",0x10020417,1,{0x0011},1}, - {"ISO/IEC 10646-1:1993; UCS-4, Level 1","UCS-4",0x00010104,1,{0x1000},4}, - {"ISO/IEC 10646-1:1993; UTF-16, UCS Transformation Format 16-bit form","UTF-16",0x00010109,1,{0x1000},2}, - {"X/Open UTF-8; UCS Transformation Format 8 (UTF-8)","UTF-8",0x05010001,1,{0x1000},6}, - {"ISO/IEC 8859-5:1988; Latin-Cyrillic Alphabet","ISO-8859-5",0x00010005,1,{0x0015},1}, - {"IBM-1251 (CCSID 01251); MS Windows Cyrillic","CP1251",0x100204e3,1,{0x0015},1}, - {"IBM-855 (CCSID 04951); Cyrillic Personal Computer","CP855",0x10021357,1,{0x0015},1} -}; - -size_t const ACE_Codeset_Registry::num_registry_entries_ = 9; - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Condition_Recursive_Thread_Mutex.cpp b/dep/src/ace/Condition_Recursive_Thread_Mutex.cpp deleted file mode 100644 index 658100f1818..00000000000 --- a/dep/src/ace/Condition_Recursive_Thread_Mutex.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// -*- C++ -*- - -/** - * @file Condition_Recursive_Thread_Mutex.cpp - * - * $Id: Condition_Recursive_Thread_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * Originally in Synch.cpp - * - * @author Douglas C. Schmidt - */ - -#include "ace/Condition_Recursive_Thread_Mutex.h" - -#if defined (ACE_HAS_THREADS) - -#if defined (ACE_HAS_DUMP) -# include "ace/Log_Msg.h" -#endif /* ACE_HAS_DUMP */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -int -ACE_Condition::remove (void) -{ - return ACE_OS::cond_destroy (&this->cond_); -} - -void -ACE_Condition::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Condition::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - // No dump method for ACE_cond_t even in emulated mode. - // cond_.dump (); - this->mutex_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Condition::~ACE_Condition (void) -{ - this->remove (); -} - -ACE_Condition::ACE_Condition (ACE_Recursive_Thread_Mutex &m) - : mutex_ (m) -{ - ACE_OS::cond_init (&this->cond_); -} - -int -ACE_Condition::wait (const ACE_Time_Value *abstime) -{ - return this->wait (this->mutex_, abstime); -} - -int -ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mutex, - const ACE_Time_Value *abstime) -{ - ACE_recursive_mutex_state mutex_state_holder; - ACE_recursive_thread_mutex_t &recursive_mutex = mutex.mutex (); - - if (ACE_OS::recursive_mutex_cond_unlock (&recursive_mutex, - mutex_state_holder) == -1) - return -1; - - // We wait on the condition, specifying the nesting mutex. For platforms - // with ACE_HAS_RECURSIVE_MUTEXES, this is the recursive mutex itself, - // and is the same as recursive_mutex, above. The caller should have been - // holding the lock on entry to this method, and it is still held. - // For other platforms, this is the nesting mutex that guards the - // ACE_recursive_mutex_t internals, and recursive_mutex_cond_unlock() - // returned with the lock held, but waiters primed and waiting to be - // released. At cond_wait below, the mutex will be released. - // On return, it will be reacquired. - const int result = abstime == 0 - ? ACE_OS::cond_wait (&this->cond_, - &mutex.get_nesting_mutex ()) - : ACE_OS::cond_timedwait (&this->cond_, - &mutex.get_nesting_mutex (), - const_cast (abstime)); - // We are holding the mutex, whether the wait succeeded or failed. - // Stash errno (in case it failed) and then we need to reset the - // recursive mutex state to what it was on entry to this method. - // Resetting it may require a wait for another thread to release - // the ACE_recursive_thread_mutex_t if this is a platform without - // ACE_HAS_RECURSIVE_MUTEXES, and recursive_mutex_cond_relock() takes - // care of that. - { - ACE_Errno_Guard error (errno); - ACE_OS::recursive_mutex_cond_relock (&recursive_mutex, - mutex_state_holder); - } - - return result; -} - -int -ACE_Condition::signal (void) -{ - return ACE_OS::cond_signal (&this->cond_); -} - -int -ACE_Condition::broadcast (void) -{ - return ACE_OS::cond_broadcast (&this->cond_); -} - -ACE_Recursive_Thread_Mutex & -ACE_Condition::mutex (void) -{ - return this->mutex_; -} - -ACE_Condition_Recursive_Thread_Mutex::ACE_Condition_Recursive_Thread_Mutex ( - ACE_Recursive_Thread_Mutex &m) : - ACE_Condition (m) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - diff --git a/dep/src/ace/Condition_T.cpp b/dep/src/ace/Condition_T.cpp deleted file mode 100644 index 6bc7ce579ce..00000000000 --- a/dep/src/ace/Condition_T.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// $Id: Condition_T.cpp 81283 2008-04-09 01:28:18Z schmidt $ - -#ifndef ACE_CONDITION_T_CPP -#define ACE_CONDITION_T_CPP - -#include "ace/Condition_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Condition_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Condition) - -template void -ACE_Condition::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Condition::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Thread_Condition::ACE_Thread_Condition (MUTEX &m, - const ACE_TCHAR *name, - void *arg) - : ACE_Condition (m, USYNC_THREAD, name, arg) -{ -// ACE_TRACE ("ACE_Thread_Condition::ACE_Thread_Condition"); -} - -template void -ACE_Thread_Condition::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Thread_Condition::dump"); - - ACE_Condition::dump (); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Condition::ACE_Condition (MUTEX &m, - int type, - const ACE_TCHAR *name, - void *arg) - : - mutex_ (m) -{ - // ACE_TRACE ("ACE_Condition::ACE_Condition"); - - if (ACE_OS::cond_init (&this->cond_, - (short) type, - name, - arg) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Condition::ACE_Condition"))); -} - -template -ACE_Condition::~ACE_Condition (void) -{ - // ACE_TRACE ("ACE_Condition::~ACE_Condition"); - - if (this->remove () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Condition::~ACE_Condition"))); -} - -template int -ACE_Condition::wait (void) -{ - // ACE_TRACE ("ACE_Condition::wait"); - return ACE_OS::cond_wait (&this->cond_, - &this->mutex_.lock_); -} - -template int -ACE_Condition::wait (MUTEX &mutex, - const ACE_Time_Value *abstime) -{ -// ACE_TRACE ("ACE_Condition::wait"); - if (abstime == 0) - return ACE_OS::cond_wait (&this->cond_, - &mutex.lock_); - else - return ACE_OS::cond_timedwait (&this->cond_, - &mutex.lock_, - (ACE_Time_Value *) abstime); -} - -// Peform an "alertable" timed wait. If the argument ABSTIME == 0 -// then we do a regular cond_wait(), else we do a timed wait for up to -// ABSTIME using the Solaris cond_timedwait() function. - -template int -ACE_Condition::wait (const ACE_Time_Value *abstime) -{ -// ACE_TRACE ("ACE_Condition::wait"); - return this->wait (this->mutex_, abstime); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -#endif /* ACE_CONDITION_T_CPP */ - diff --git a/dep/src/ace/Condition_Thread_Mutex.cpp b/dep/src/ace/Condition_Thread_Mutex.cpp deleted file mode 100644 index d1142f72172..00000000000 --- a/dep/src/ace/Condition_Thread_Mutex.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- C++ -*- */ -/** - * @file Condition_Thread_Mutex.cpp - * - * $Id: Condition_Thread_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * Originally in Synch.cpp - * - * @author Douglas C. Schmidt - */ - -#include "ace/Condition_Thread_Mutex.h" - -#if defined (ACE_HAS_THREADS) - -#if !defined (__ACE_INLINE__) -#include "ace/Condition_Thread_Mutex.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, Condition_Thread_Mutex, "$Id: Condition_Thread_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Condition_Thread_Mutex) - -void -ACE_Condition_Thread_Mutex::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Condition_Thread_Mutex::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); -#if defined (ACE_WIN32) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("waiters = %d\n"), - this->cond_.waiters ())); -#endif /* ACE_WIN32 */ - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m, - const ACE_TCHAR *name, - void *arg) - : mutex_ (m), - removed_ (false) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex"); - if (ACE_OS::cond_init (&this->cond_, - (short) USYNC_THREAD, - name, - arg) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex"))); -} - -ACE_Condition_Thread_Mutex:: -ACE_Condition_Thread_Mutex (ACE_Thread_Mutex &m, - ACE_Condition_Attributes &attributes, - const ACE_TCHAR *name, - void *arg) - : mutex_ (m), - removed_ (false) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex"); - if (ACE_OS::cond_init (&this->cond_, attributes.attributes_, - name, arg) != 0) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Condition_Thread_Mutex::ACE_Condition_Thread_Mutex"))); -} - -ACE_Condition_Thread_Mutex::~ACE_Condition_Thread_Mutex (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::~ACE_Condition_Thread_Mutex"); - this->remove (); -} - -// Peform an "alertable" timed wait. If the argument == 0 -// then we do a regular , else we do a timed wait for up to -// using the function. - -int -ACE_Condition_Thread_Mutex::wait (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait"); - return ACE_OS::cond_wait (&this->cond_, &this->mutex_.lock_); -} - -int -ACE_Condition_Thread_Mutex::wait (ACE_Thread_Mutex &mutex, - const ACE_Time_Value *abstime) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait"); - return ACE_OS::cond_timedwait (&this->cond_, - &mutex.lock_, - const_cast (abstime)); -} - -int -ACE_Condition_Thread_Mutex::wait (const ACE_Time_Value *abstime) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::wait"); - return this->wait (this->mutex_, abstime); -} - -int -ACE_Condition_Thread_Mutex::signal (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::signal"); - return ACE_OS::cond_signal (&this->cond_); -} - -int -ACE_Condition_Thread_Mutex::broadcast (void) -{ -// ACE_TRACE ("ACE_Condition_Thread_Mutex::broadcast"); - return ACE_OS::cond_broadcast (&this->cond_); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - diff --git a/dep/src/ace/Configuration.cpp b/dep/src/ace/Configuration.cpp deleted file mode 100644 index 9c7f1d278b5..00000000000 --- a/dep/src/ace/Configuration.cpp +++ /dev/null @@ -1,2144 +0,0 @@ -// $Id: Configuration.cpp 80826 2008-03-04 14:51:23Z wotte $ -#include "ace/Configuration.h" -#include "ace/Auto_Ptr.h" -#include "ace/SString.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_strings.h" - -// Can remove this when import_config and export_config are removed from -// ACE_Configuration. They're deprecated at ACE 5.2. -#include "ace/Configuration_Import_Export.h" - -#if !defined (ACE_LACKS_ACCESS) -# include "ace/OS_NS_unistd.h" -#endif /* ACE_LACKS_ACCESS */ - -#if !defined (__ACE_INLINE__) -#include "ace/Configuration.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Section_Key_Internal::ACE_Section_Key_Internal (void) - : ref_count_ (0) -{ -} - -ACE_Section_Key_Internal::~ACE_Section_Key_Internal (void) -{ -} - -int -ACE_Section_Key_Internal::add_ref (void) -{ - ++ref_count_; - return 0; -} - -int -ACE_Section_Key_Internal::dec_ref (void) -{ - if (!--ref_count_) - delete this; - return 0; -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (void) - : key_ (0) -{ -} - -ACE_Configuration_Section_Key::~ACE_Configuration_Section_Key (void) -{ - if (key_) - key_->dec_ref (); -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (ACE_Section_Key_Internal* key) - : key_ (key) -{ - if (key_) - key_->add_ref (); -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (const ACE_Configuration_Section_Key& rhs) - : key_ (rhs.key_) -{ - if (key_) - key_->add_ref (); -} - -ACE_Configuration_Section_Key& -ACE_Configuration_Section_Key::operator= (const ACE_Configuration_Section_Key& rhs) -{ - if (this != &rhs) - { - if (key_) - key_->dec_ref (); - - key_ = rhs.key_; - - if (key_) - key_->add_ref (); - } - return *this; -} - -////////////////////////////////////////////////////////////////////////////// - -ACE_TCHAR ACE_Configuration::NULL_String_ = '\0'; - -ACE_Configuration::ACE_Configuration (void) - : root_ () -{ -} - -ACE_Configuration::~ACE_Configuration (void) -{ -} - -ACE_Section_Key_Internal* -ACE_Configuration::get_internal_key (const ACE_Configuration_Section_Key& key) -{ - return key.key_; -} - -int -ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key, - const ACE_TString& path_in, - ACE_Configuration_Section_Key& key_out, - int create) -{ - // Make a copy of key - ACE_Configuration_Section_Key current_section = key; - ACE_Auto_Basic_Array_Ptr pData (path_in.rep ()); - ACE_Tokenizer parser (pData.get ()); - parser.delimiter_replace ('\\', '\0'); - parser.delimiter_replace ('/', '\0'); - - for (ACE_TCHAR *temp = parser.next (); - temp != 0; - temp = parser.next ()) - { - // Open the section - if (open_section (current_section, - temp, - create, - key_out)) - return -1; - - current_section = key_out; - } - - return 0; - -} - -// import_config and export_config are here for backward compatibility, -// and have been deprecated. -int -ACE_Configuration::export_config (const ACE_TCHAR* filename) -{ - ACE_Registry_ImpExp exporter (*this); - return exporter.export_config (filename); -} - -int -ACE_Configuration::import_config (const ACE_TCHAR* filename) -{ - ACE_Registry_ImpExp importer (*this); - return importer.import_config (filename); -} - -int -ACE_Configuration::validate_name (const ACE_TCHAR* name, int allow_path) -{ - // Invalid character set - const ACE_TCHAR* reject = - allow_path ? ACE_TEXT ("][") : ACE_TEXT ("\\]["); - - // Position of the first invalid character or terminating null. - size_t const pos = ACE_OS::strcspn (name, reject); - - // Check if it is an invalid character. - if (name[pos] != ACE_TEXT ('\0')) - { - errno = EINVAL; - return -1; - } - - // The first character can never be a path separator. - if (name[0] == ACE_TEXT ('\\')) - { - errno = EINVAL; - return -1; - } - - // Validate length. - if (pos == 0 || pos > 255) - { - errno = ENAMETOOLONG; - return -1; - } - - return 0; -} - -int -ACE_Configuration::validate_value_name (const ACE_TCHAR* name) -{ - if (name == 0 || *name == this->NULL_String_) - return 0; - - return this->validate_name (name); -} - -const ACE_Configuration_Section_Key& -ACE_Configuration::root_section (void) const -{ - return root_; -} - -/** - * Determine if the contents of this object is the same as the - * contents of the object on the right hand side. - * Returns 1 (True) if they are equal and 0 (False) if they are not equal - */ -bool -ACE_Configuration::operator== (const ACE_Configuration& rhs) const -{ - bool rc = true; - int sectionIndex = 0; - ACE_TString sectionName; - ACE_Configuration *nonconst_this = const_cast (this); - ACE_Configuration &nonconst_rhs = const_cast (rhs); - - const ACE_Configuration_Section_Key& rhsRoot = rhs.root_section (); - ACE_Configuration_Section_Key rhsSection; - ACE_Configuration_Section_Key thisSection; - - // loop through each section in this object - while ((rc) && (nonconst_this->enumerate_sections (this->root_, - sectionIndex, - sectionName) == 0)) - { - // find that section in the rhs object - if (nonconst_rhs.open_section (rhsRoot, - sectionName.c_str (), - 0, - rhsSection) != 0) - { - // If the rhs object does not contain the section then we are - // not equal. - rc = false; - } - else if (nonconst_this->open_section (this->root_, - sectionName.c_str (), - 0, - thisSection) != 0) - { - // if there is some error opening the section in this object - rc = false; - } - else - { - // Well the sections match - int valueIndex = 0; - ACE_TString valueName; - VALUETYPE valueType; - VALUETYPE rhsType; - - // Enumerate each value in this section - while ((rc) && nonconst_this->enumerate_values (thisSection, - valueIndex, - valueName, - valueType) == 0) - { - // look for the same value in the rhs section - if (nonconst_rhs.find_value (rhsSection, - valueName.c_str (), - rhsType) != 0) - { - // We're not equal if the same value cannot - // be found in the rhs object. - rc = false; - } - else if (valueType != rhsType) - { - // we're not equal if the types do not match. - rc = false; - } - else - { - // finally compare values. - if (valueType == STRING) - { - ACE_TString thisString, rhsString; - if (nonconst_this->get_string_value (thisSection, - valueName.c_str (), - thisString) != 0) - { - // we're not equal if we cannot get this string - rc = false; - } - else if (nonconst_rhs.get_string_value ( - rhsSection, - valueName.c_str (), - rhsString) != 0) - { - // we're not equal if we cannot get rhs string - rc = false; - } - rc = (thisString == rhsString); - } - else if (valueType == INTEGER) - { - u_int thisInt = 0; - u_int rhsInt = 0; - if (nonconst_this->get_integer_value ( - thisSection, - valueName.c_str (), - thisInt) != 0) - { - // we're not equal if we cannot get this int - rc = false; - } - else if (nonconst_rhs.get_integer_value ( - rhsSection, - valueName.c_str (), - rhsInt) != 0) - { - // we're not equal if we cannot get rhs int - rc = false; - } - rc = (thisInt == rhsInt); - } - else if (valueType == BINARY) - { - void* thisData = 0; - void* rhsData = 0; - size_t thisLength = 0; - size_t rhsLength = 0; - if (nonconst_this->get_binary_value (thisSection, - valueName.c_str (), - thisData, - thisLength) != 0) - { - // we're not equal if we cannot get this data - rc = false; - } - else if (nonconst_rhs.get_binary_value ( - rhsSection, - valueName.c_str (), - rhsData, - rhsLength) != 0) - { - // we're not equal if we cannot get this data - rc = false; - } - - rc = (thisLength == rhsLength); - // are the length's the same? - - if (rc) - { - unsigned char* thisCharData = - (unsigned char*)thisData; - unsigned char* rhsCharData = (unsigned char*)rhsData; - // yes, then check each element - for (size_t count = 0; - (rc) && (count < thisLength); - count++) - { - rc = (* (thisCharData + count) == * (rhsCharData + count)); - } - - delete [] thisCharData; - delete [] rhsCharData; - }// end if the length's match - } - // We should never have valueTypes of INVALID, therefore - // we're not comparing them. How would we since we have - // no get operation for invalid types. - // So, if we have them, we guess they are equal. - - }// end else if values match. - - ++valueIndex; - - }// end value while loop - - // look in the rhs for values not in this - valueIndex = 0; - while ((rc) && (nonconst_rhs.enumerate_values (rhsSection, - valueIndex, - valueName, - rhsType) == 0)) - { - // look for the same value in this section - if (nonconst_this->find_value (thisSection, - valueName.c_str (), - valueType) != 0) - { - // We're not equal if the same value cannot - // be found in the rhs object. - rc = false; - } - ++valueIndex; - }// end while for rhs values not in this. - - }// end else if sections match. - - ++sectionIndex; - - }// end section while loop - - // Finally, make sure that there are no sections in rhs that do not - // exist in this - sectionIndex = 0; - while ((rc) - && (nonconst_rhs.enumerate_sections (rhsRoot, - sectionIndex, - sectionName) == 0)) - { - // find the section in this - if (nonconst_this->open_section (this->root_, - sectionName.c_str (), - 0, - thisSection) != 0) - { - // if there is some error opening the section in this object - rc = false; - } - else if (nonconst_rhs.open_section (rhsRoot, - sectionName.c_str (), - 0, - rhsSection) != 0) - { - // If the rhs object does not contain the section then we - // are not equal. - rc = false; - } - ++sectionIndex; - } - return rc; -} - -bool -ACE_Configuration::operator!= (const ACE_Configuration& rhs) const -{ - return !(*this == rhs); -} - -////////////////////////////////////////////////////////////////////////////// - -#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY) - -static const int ACE_DEFAULT_BUFSIZE = 256; - -static const ACE_TCHAR *temp_name (const ACE_TCHAR *name) -{ - if (name && *name == ACE_Configuration::NULL_String_) - return 0; - return name; -} - -ACE_Section_Key_Win32::ACE_Section_Key_Win32 (HKEY hKey) - : hKey_ (hKey) -{ -} - -ACE_Section_Key_Win32::~ACE_Section_Key_Win32 (void) -{ - ::RegCloseKey (hKey_); -} - -////////////////////////////////////////////////////////////////////////////// - -bool -ACE_Configuration_Win32Registry::operator== (const ACE_Configuration_Win32Registry &rhs) const -{ - ACE_UNUSED_ARG (rhs); - return true; -} - -bool -ACE_Configuration_Win32Registry::operator!= (const ACE_Configuration_Win32Registry &rhs) const -{ - ACE_UNUSED_ARG (rhs); - return true; -} - -ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey) -{ - ACE_Section_Key_Win32 *temp = 0; - - ACE_NEW (temp, ACE_Section_Key_Win32 (hKey)); - - root_ = ACE_Configuration_Section_Key (temp); -} - -ACE_Configuration_Win32Registry::~ACE_Configuration_Win32Registry (void) -{ -} - -int -ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result) -{ - if (validate_name (sub_section, 1)) - return -1; - - HKEY base_key; - if (load_key (base, base_key)) - return -1; - - int errnum; - HKEY result_key; - if ((errnum = ACE_TEXT_RegOpenKeyEx (base_key, - sub_section, - 0, - KEY_ALL_ACCESS, - &result_key)) != ERROR_SUCCESS) - { - if (!create) - { - errno = errnum; - return -1; - } - - if ((errnum = ACE_TEXT_RegCreateKeyEx (base_key, - sub_section, - 0, - 0, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - 0, - &result_key, -#if defined (__MINGW32__) - (PDWORD) 0 -#else - 0 -#endif /* __MINGW32__ */ - )) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - } - - ACE_Section_Key_Win32 *temp; - - ACE_NEW_RETURN (temp, ACE_Section_Key_Win32 (result_key), -1); - result = ACE_Configuration_Section_Key (temp); - return 0; -} - -int -ACE_Configuration_Win32Registry::remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive) -{ - if (validate_name (sub_section)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (recursive) - { - ACE_Configuration_Section_Key section; - if (open_section (key, sub_section, 0, section)) - return -1; - - HKEY sub_key; - if (load_key (section, sub_key)) - return -1; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - // Note we don't increment the index because the - // enumeration becomes invalid if we change the - // subkey, which we do when we delete it. By leaving - // it 0, we always delete the top entry - while (ACE_TEXT_RegEnumKeyEx (sub_key, - 0, - name_buffer, - &buffer_size, - 0, - 0, - 0, - 0) == ERROR_SUCCESS) - { - remove_section (section, name_buffer, 1); - buffer_size = ACE_DEFAULT_BUFSIZE; - } - } - - int errnum; - errnum = ACE_TEXT_RegDeleteKey (base_key, sub_section); - if (errnum != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type) -{ - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - DWORD value_type; - - int rc = ACE_TEXT_RegEnumValue (base_key, - index, - name_buffer, - &buffer_size, - 0, - &value_type, - 0, - 0); - if (rc == ERROR_NO_MORE_ITEMS) - return 1; - else if (rc != ERROR_SUCCESS) - { - errno = rc; - return -1; - } - - name = name_buffer; - - switch (value_type) - { - case REG_BINARY: - type = BINARY; - break; - case REG_SZ: - type = STRING; - break; - case REG_DWORD: - type = INTEGER; - break; - default: - type = INVALID; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name) -{ - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - int rc = ACE_TEXT_RegEnumKeyEx (base_key, - index, - name_buffer, - &buffer_size, - 0, - 0, - 0, - 0); - if (rc == ERROR_NO_MORE_ITEMS) - return 1; - else if (rc != ERROR_MORE_DATA && rc != ERROR_SUCCESS) - { - errno = rc; - return -1; - } - - name = name_buffer; - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - int errnum; - DWORD len = static_cast (value.length () + 1); - len *= sizeof (ACE_TCHAR); - if ((errnum = ACE_TEXT_RegSetValueEx (base_key, - t_name, - 0, - REG_SZ, - (BYTE *) value.fast_rep (), - len)) - != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - int errnum; - if ((errnum = ACE_TEXT_RegSetValueEx (base_key, - t_name, - 0, - REG_DWORD, - (BYTE *) &value, - sizeof (value))) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - size_t length) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - int errnum; - if ((errnum = ACE_TEXT_RegSetValueEx (base_key, - t_name, - 0, - REG_BINARY, - (BYTE *) data, - static_cast (length))) - != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - // Get the size of the binary data from windows - int errnum; - DWORD buffer_length = 0; - DWORD type; - if ((errnum = ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - (BYTE *) 0, - &buffer_length)) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - if (type != REG_SZ) - { - errno = ERROR_INVALID_DATATYPE; - return -1; - } - - ACE_TCHAR *temp = 0; - ACE_NEW_RETURN (temp, - ACE_TCHAR[buffer_length], - -1); - - ACE_Auto_Basic_Array_Ptr buffer (temp); - - if ((errnum = ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - (BYTE *) buffer.get (), - &buffer_length)) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - value = buffer.get (); - return 0; -} - -int -ACE_Configuration_Win32Registry::get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - int errnum; - DWORD length = sizeof (value); - DWORD type; - if ((errnum = ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - (BYTE *) &value, - &length)) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - if (type != REG_DWORD) - { - errno = ERROR_INVALID_DATATYPE; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::get_binary_value ( - const ACE_Configuration_Section_Key &key, - const ACE_TCHAR *name, - void *&data, - size_t &length) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - // Get the size of the binary data from windows - int errnum; - DWORD buffer_length = 0; - DWORD type; - if ((errnum = ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - (BYTE *) 0, - &buffer_length)) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - if (type != REG_BINARY) - { - errno = ERROR_INVALID_DATATYPE; - return -1; - } - - length = buffer_length; - - BYTE * the_data = 0; - ACE_NEW_RETURN (the_data, BYTE[length], -1); - ACE_Auto_Basic_Array_Ptr safe_data (the_data); - - if ((errnum = ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - the_data, - &buffer_length)) != ERROR_SUCCESS) - { - data = 0; - errno = errnum; - return -1; - } - - data = safe_data.release (); - - return 0; -} - -int -ACE_Configuration_Win32Registry::find_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - VALUETYPE& type_out) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - DWORD buffer_length=0; - DWORD type; - int result=ACE_TEXT_RegQueryValueEx (base_key, - t_name, - 0, - &type, - 0, - &buffer_length); - if (result != ERROR_SUCCESS) - { - errno = result; - return -1; - } - - switch (type) - { - case REG_SZ: - type_out = STRING; - break; - case REG_DWORD: - type_out = INTEGER; - break; - case REG_BINARY: - type_out = BINARY; - break; - default: - return -1; // unknown type - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) -{ - const ACE_TCHAR *t_name = temp_name (name); - if (validate_value_name (t_name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - int errnum; - if ((errnum = ACE_TEXT_RegDeleteValue (base_key, t_name)) != ERROR_SUCCESS) - { - errno = errnum; - return -1; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::load_key (const ACE_Configuration_Section_Key& key, - HKEY& hKey) -{ - ACE_Section_Key_Win32* pKey = dynamic_cast (get_internal_key (key)); - if (!pKey) - return -1; - - hKey = pKey->hKey_; - return 0; -} - -HKEY -ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, - const ACE_TCHAR* path, - int create) -{ - HKEY result = 0; - // Make a copy of hKey - int errnum; -#if defined (ACE_HAS_WINCE) - if ((errnum = RegOpenKeyEx (hKey, 0, 0, 0, &result)) != ERROR_SUCCESS) -#else - if ((errnum = RegOpenKey (hKey, 0, &result)) != ERROR_SUCCESS) -#endif // ACE_HAS_WINCE - { - errno = errnum; - return 0; - } - - // recurse through the path - ACE_TCHAR *temp_path = 0; - ACE_NEW_RETURN (temp_path, - ACE_TCHAR[ACE_OS::strlen (path) + 1], - 0); - ACE_Auto_Basic_Array_Ptr pData (temp_path); - ACE_OS::strcpy (pData.get (), path); - ACE_Tokenizer parser (pData.get ()); - parser.delimiter_replace ('\\', '\0'); - parser.delimiter_replace ('/', '\0'); - - for (ACE_TCHAR *temp = parser.next (); - temp != 0; - temp = parser.next ()) - { - // Open the key - HKEY subkey; - -#if defined (ACE_HAS_WINCE) - if ((errnum = ACE_TEXT_RegOpenKeyEx (result, - temp, - 0, - 0, - &subkey)) != ERROR_SUCCESS) -#else - if ((errnum = ACE_TEXT_RegOpenKey (result, - temp, - &subkey)) != ERROR_SUCCESS) -#endif // ACE_HAS_WINCE - { - // try creating it - if (!create || (errnum = ACE_TEXT_RegCreateKeyEx (result, - temp, - 0, - 0, - 0, - KEY_ALL_ACCESS, - 0, - &subkey, -#if defined (__MINGW32__) - (PDWORD) 0 -#else - 0 -#endif /* __MINGW32__ */ - )) !=ERROR_SUCCESS) - { - errno = errnum; - // error - ::RegCloseKey (result); - return 0; - } - } - // release our open key handle - ::RegCloseKey (result); - result = subkey; - } - - return result; -} - -#endif /* ACE_WIN32 && !ACE_LACKS_WIN32_REGISTRY */ - -/////////////////////////////////////////////////////////////// - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (void) - : type_ (ACE_Configuration::INVALID), - length_ (0) -{ - this->data_.ptr_ = 0; -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (ACE_TCHAR* string) - : type_ (ACE_Configuration::STRING), - length_ (0) -{ - this->data_.ptr_ = string; -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (u_int integer) - : type_ (ACE_Configuration::INTEGER), - length_ (0) -{ - this->data_.int_ = integer; -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (void* data, size_t length) - : type_ (ACE_Configuration::BINARY), - length_ (length) -{ - this->data_.ptr_ = data; -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (const ACE_Configuration_Value_IntId& rhs) - : type_ (rhs.type_), - data_ (rhs.data_), - length_ (rhs.length_) -{ -} - -ACE_Configuration_Value_IntId::~ACE_Configuration_Value_IntId (void) -{ -} - -ACE_Configuration_Value_IntId& ACE_Configuration_Value_IntId::operator= (const ACE_Configuration_Value_IntId& rhs) -{ - if (this != &rhs) - { - type_ = rhs.type_; - data_ = rhs.data_; - length_ = rhs.length_; - } - return *this; -} - -void -ACE_Configuration_Value_IntId::free (ACE_Allocator *alloc) -{ - if (this->type_ == ACE_Configuration::STRING - || this->type_ == ACE_Configuration::BINARY) - alloc->free (data_.ptr_); - // Do nothing in other cases... -} - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (void) - : name_ (0) -{ -} - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_TCHAR* name) - : name_ (name) -{ -} - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_Configuration_ExtId& rhs) - : name_ (rhs.name_) -{ -} - -ACE_Configuration_ExtId::~ACE_Configuration_ExtId (void) -{ -} - -ACE_Configuration_ExtId& ACE_Configuration_ExtId::operator= (const ACE_Configuration_ExtId& rhs) -{ - if (this != &rhs) - name_ = rhs.name_; - - return *this; -} - -bool -ACE_Configuration_ExtId::operator== (const ACE_Configuration_ExtId& rhs) const -{ - return (ACE_OS::strcasecmp (name_, rhs.name_) == 0); -} - -bool -ACE_Configuration_ExtId::operator!= (const ACE_Configuration_ExtId& rhs) const -{ - return !this->operator== (rhs); -} - -u_long -ACE_Configuration_ExtId::hash (void) const -{ - ACE_TString temp (name_, 0, false); - return temp.hash (); -} - -void -ACE_Configuration_ExtId::free (ACE_Allocator *alloc) -{ - alloc->free ((void *) (name_)); -} - -/////////////////////////////////////////////////////////////////////// - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (void) - : value_hash_map_ (0), - section_hash_map_ (0) -{ -} - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (VALUE_MAP* value_hash_map, SUBSECTION_MAP* section_hash_map) - : value_hash_map_ (value_hash_map), - section_hash_map_ (section_hash_map) -{ -} - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (const ACE_Configuration_Section_IntId& rhs) - : value_hash_map_ (rhs.value_hash_map_), - section_hash_map_ (rhs.section_hash_map_) -{ - -} - -ACE_Configuration_Section_IntId::~ACE_Configuration_Section_IntId () -{ -} - -ACE_Configuration_Section_IntId& -ACE_Configuration_Section_IntId::operator= (const ACE_Configuration_Section_IntId& rhs) -{ - if (this != &rhs) - { - value_hash_map_ = rhs.value_hash_map_; - section_hash_map_ = rhs.section_hash_map_; - } - return *this; -} - -void -ACE_Configuration_Section_IntId::free (ACE_Allocator *alloc) -{ - alloc->free ((void *) (value_hash_map_)); - alloc->free ((void *) (section_hash_map_)); -} - -ACE_Configuration_Section_Key_Heap::ACE_Configuration_Section_Key_Heap (const ACE_TCHAR* path) - : path_ (0), - value_iter_ (0), - section_iter_ (0) -{ - path_ = ACE_OS::strdup (path); -} - -ACE_Configuration_Section_Key_Heap::~ACE_Configuration_Section_Key_Heap () -{ - delete value_iter_; - delete section_iter_; - ACE_OS::free (path_); -} - -////////////////////////////////////////////////////////////////////////////// - -ACE_Configuration_Heap::ACE_Configuration_Heap (void) - : allocator_ (0), - index_ (0), - default_map_size_ (0) -{ - ACE_Configuration_Section_Key_Heap *temp = 0; - - ACE_NEW (temp, ACE_Configuration_Section_Key_Heap (ACE_TEXT (""))); - root_ = ACE_Configuration_Section_Key (temp); -} - -ACE_Configuration_Heap::~ACE_Configuration_Heap (void) -{ - if (allocator_) - allocator_->sync (); - - delete allocator_; -} - -int -ACE_Configuration_Heap::open (size_t default_map_size) -{ - default_map_size_ = default_map_size; - // Create the allocator with the appropriate options. - // The name used for the lock is the same as one used - // for the file. - ACE_NEW_RETURN (this->allocator_, - HEAP_ALLOCATOR (), - -1); - return create_index (); -} - -int -ACE_Configuration_Heap::open (const ACE_TCHAR* file_name, - void* base_address, - size_t default_map_size) -{ - default_map_size_ = default_map_size; - - // Make sure that the file name is of the legal length. - if (ACE_OS::strlen (file_name) >= MAXNAMELEN + MAXPATHLEN) - { - errno = ENAMETOOLONG; - return -1; - } - - ACE_MMAP_Memory_Pool::OPTIONS options (base_address); - - // Create the allocator with the appropriate options. The name used - // for the lock is the same as one used for the file. - ACE_NEW_RETURN (this->allocator_, - PERSISTENT_ALLOCATOR (file_name, - file_name, - &options), - -1); - -#if !defined (ACE_LACKS_ACCESS) - // Now check if the backing store has been created successfully. - if (ACE_OS::access (file_name, F_OK) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("create_index\n")), - -1); -#endif /* ACE_LACKS_ACCESS */ - - return create_index (); -} - -int -ACE_Configuration_Heap::create_index (void) -{ - void *section_index = 0; - - // This is the easy case since if we find hash table in the - // memory-mapped file we know it's already initialized. - if (this->allocator_->find (ACE_CONFIG_SECTION_INDEX, section_index) == 0) - this->index_ = (SECTION_MAP *) section_index; - - // Create a new (because we've just created a new - // memory-mapped file). - else - { - size_t index_size = sizeof (SECTION_MAP); - section_index = this->allocator_->malloc (index_size); - - if (section_index == 0 - || create_index_helper (section_index) == -1 - || this->allocator_->bind (ACE_CONFIG_SECTION_INDEX, - section_index) == -1) - { - // Attempt to clean up. - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("create_index failed\n"))); - this->allocator_->remove (); - return -1; - } - // Add the root section - return new_section (ACE_TEXT (""), root_); - } - return 0; -} - -int -ACE_Configuration_Heap::create_index_helper (void *buffer) -{ - ACE_ASSERT (this->allocator_); - this->index_ = new (buffer) SECTION_MAP (this->allocator_); - return 0; -} - -int -ACE_Configuration_Heap::load_key (const ACE_Configuration_Section_Key& key, - ACE_TString& name) -{ - ACE_ASSERT (this->allocator_); - ACE_Configuration_Section_Key_Heap* pKey = - dynamic_cast (get_internal_key (key)); - - if (!pKey) - { - return -1; - } - - ACE_TString temp (pKey->path_, 0, false); - name.assign_nocopy (temp); - return 0; -} - -int -ACE_Configuration_Heap::add_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - ACE_Configuration_Section_Key& result) -{ - ACE_ASSERT (this->allocator_); - ACE_TString section; - if (load_key (base, section)) - return -1; - - // Find the base section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; - - // See if this section already exists - ACE_Configuration_ExtId SubSectionExtId (sub_section); - int ignored = 0; - - if (!IntId.section_hash_map_->find (SubSectionExtId, ignored, allocator_)) - { - // already exists! - errno = EEXIST; - return -1; - } - - // Create the new section name - // only prepend a separater if were not at the root - if (section.length ()) - section += ACE_TEXT ("\\"); - - section += sub_section; - - // Add it to the base section - ACE_TCHAR* pers_name = (ACE_TCHAR *) allocator_->malloc ((ACE_OS::strlen (sub_section) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, sub_section); - ACE_Configuration_ExtId SSExtId (pers_name); - if (IntId.section_hash_map_->bind (SSExtId, ignored, allocator_)) - { - allocator_->free (pers_name); - return -1; - } - return (new_section (section, result)); -} - -int -ACE_Configuration_Heap::new_section (const ACE_TString& section, - ACE_Configuration_Section_Key& result) -{ - ACE_ASSERT (this->allocator_); - // Create a new section and add it to the global list - - // Allocate memory for items to be stored in the table. - size_t section_len = section.length () + 1; - ACE_TCHAR *ptr = (ACE_TCHAR*) this->allocator_->malloc (section_len * sizeof (ACE_TCHAR)); - - int return_value = -1; - - if (ptr == 0) - return -1; - else - { - // Populate memory with data. - ACE_OS::strcpy (ptr, section.fast_rep ()); - - void *value_hash_map = 0; - size_t map_size = sizeof (VALUE_MAP); - value_hash_map = this->allocator_->malloc (map_size); - - // If allocation failed ... - if (value_hash_map == 0) - return -1; - - // Initialize allocated hash map through placement new. - if (value_open_helper (default_map_size_, value_hash_map ) == -1) - { - this->allocator_->free (value_hash_map ); - return -1; - } - - // create the section map - void* section_hash_map = 0; - map_size = sizeof (SUBSECTION_MAP); - section_hash_map = this->allocator_->malloc (map_size); - - // If allocation failed - if (section_hash_map == 0) - return -1; - - // initialize allocated hash map through placement new - if (section_open_helper (default_map_size_, section_hash_map) == -1) - { - this->allocator_->free (value_hash_map ); - this->allocator_->free (section_hash_map); - return -1; - } - - ACE_Configuration_ExtId name (ptr); - ACE_Configuration_Section_IntId entry ((VALUE_MAP*) value_hash_map, - (SUBSECTION_MAP*) section_hash_map); - - // Do a normal bind. This will fail if there's already an - // entry with the same name. - return_value = this->index_->bind (name, entry, this->allocator_); - - if (return_value == 1 /* Entry already existed so bind failed. */ - || return_value == -1 /* Unable to bind for other reasons. */) - { - // Free our dynamically allocated memory. - this->allocator_->free (static_cast (ptr)); - return return_value; - } - - // If bind () succeed, it will automatically sync - // up the map manager entry. However, we must sync up our - // name/value memory. - this->allocator_->sync (ptr, section_len); - } - - // set the result - ACE_Configuration_Section_Key_Heap *temp; - ACE_NEW_RETURN (temp, - ACE_Configuration_Section_Key_Heap (ptr), - -1); - result = ACE_Configuration_Section_Key (temp); - return return_value; -} - -int -ACE_Configuration_Heap::value_open_helper (size_t hash_table_size, - void *buffer) -{ - ACE_ASSERT (this->allocator_); - new (buffer) VALUE_MAP (hash_table_size, this->allocator_); - return 0; -} - -int -ACE_Configuration_Heap::section_open_helper (size_t hash_table_size, - void *buffer) -{ - ACE_ASSERT (this->allocator_); - new (buffer) SUBSECTION_MAP (hash_table_size, this->allocator_); - return 0; -} - -int -ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result) -{ - ACE_ASSERT (this->allocator_); - if (validate_name (sub_section, 1)) // 1 == allow_path - return -1; - - result = base; - - for (const ACE_TCHAR* separator; - (separator = ACE_OS::strchr (sub_section, ACE_TEXT ('\\'))) != 0; - ) - { - ACE_TString simple_section (sub_section, separator - sub_section); - int ret_val = - open_simple_section (result, simple_section.c_str (), create, result); - if (ret_val) - return ret_val; - sub_section = separator + 1; - } - - return open_simple_section (result, sub_section, create, result); -} - -int -ACE_Configuration_Heap::open_simple_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result) -{ - ACE_TString section (0, 0, false); - - if (load_key (base, section)) - { - return -1; - } - - // Only add the \\ if were not at the root - if (section.length ()) - { - section += ACE_TEXT ("\\"); - } - - section += sub_section; - - // resolve the section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - - if (index_->find (ExtId, IntId, allocator_)) - { - if (!create) - { - errno = ENOENT; - return -1; - } - - return add_section (base, sub_section, result); - } - - ACE_Configuration_Section_Key_Heap *temp; - ACE_NEW_RETURN (temp, - ACE_Configuration_Section_Key_Heap (section.fast_rep ()), - -1); - result = ACE_Configuration_Section_Key (temp); - return 0; -} - -int -ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive) -{ - ACE_ASSERT (this->allocator_); - if (validate_name (sub_section)) - return -1; - - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this key - ACE_Configuration_ExtId ParentExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId ParentIntId; - if (index_->find (ParentExtId, ParentIntId, allocator_)) - return -1;// no parent key - - // Find this subkey - if (section.length ()) - section += ACE_TEXT ("\\"); - - section += sub_section; - ACE_Configuration_ExtId SectionExtId (section.fast_rep ()); - SECTION_HASH::ENTRY* section_entry; - SECTION_HASH* hashmap = index_; - if (hashmap->find (SectionExtId, section_entry)) - return -1; - - if (recursive) - { - ACE_Configuration_Section_Key section; - if (open_section (key, sub_section, 0, section)) - return -1; - - int index = 0; - ACE_TString name; - while (!enumerate_sections (section, index, name)) - { - if (remove_section (section, name.fast_rep (), 1)) - return -1; - - ++index; - } - } - - // Now make sure we dont have any subkeys - if (section_entry->int_id_.section_hash_map_->current_size ()) - { - errno = ENOTEMPTY; - return -1; - } - - // Now remove subkey from parent key - ACE_Configuration_ExtId SubSExtId (sub_section); - SUBSECTION_HASH::ENTRY* subsection_entry; - if (((SUBSECTION_HASH*)ParentIntId.section_hash_map_)-> - find (SubSExtId, subsection_entry)) - return -1; - - if (ParentIntId.section_hash_map_->unbind (SubSExtId, allocator_)) - return -1; - - subsection_entry->ext_id_.free (allocator_); - - // Remember the pointers so we can free them after we unbind - ACE_Configuration_ExtId ExtIdToFree (section_entry->ext_id_); - ACE_Configuration_Section_IntId IntIdToFree (section_entry->int_id_); - - // iterate over all values and free memory - VALUE_HASH* value_hash_map = section_entry->int_id_.value_hash_map_; - VALUE_HASH::ITERATOR value_iter = value_hash_map->begin (); - while (!value_iter.done ()) - { - VALUE_HASH::ENTRY* value_entry = 0; - if (!value_iter.next (value_entry)) - return 1; - - value_entry->ext_id_.free (allocator_); - value_entry->int_id_.free (allocator_); - - value_iter.advance (); - } - - // remove it - if (index_->unbind (SectionExtId, allocator_)) - return -1; - - value_hash_map->close (); - section_entry->int_id_.section_hash_map_->close (allocator_); - - // Free the memory - ExtIdToFree.free (allocator_); - IntIdToFree.free (allocator_); - - return 0; -} - -int -ACE_Configuration_Heap::enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type) -{ - ACE_ASSERT (this->allocator_); - ACE_Configuration_Section_Key_Heap* pKey = - dynamic_cast (get_internal_key (key)); - if (!pKey) - return -1; - - name = pKey->path_; - - // resolve the section - ACE_Configuration_ExtId ExtId (pKey->path_); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; - - // Handle iterator resets - if (index == 0) - { - ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex>* hash_map = IntId.value_hash_map_; - delete pKey->value_iter_; - - ACE_NEW_RETURN (pKey->value_iter_, - VALUE_HASH::ITERATOR (hash_map->begin ()), - -1); - } - - // Get the next entry - ACE_Hash_Map_Entry* entry = 0; - - if (!pKey->value_iter_->next (entry)) - return 1; - - // Return the value of the iterator and advance it - name = entry->ext_id_.name_; - type = entry->int_id_.type_; - pKey->value_iter_->advance (); - - return 0; -} - -int -ACE_Configuration_Heap::enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name) -{ - ACE_ASSERT (this->allocator_); - // cast to a heap section key - ACE_Configuration_Section_Key_Heap* pKey = - dynamic_cast (get_internal_key (key)); - if (!pKey) - return -1; // not a heap key! - - // resolve the section - ACE_Configuration_ExtId ExtId (pKey->path_); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; // unknown section - - // Handle iterator resets - if (index == 0) - { - if (pKey->section_iter_) - delete pKey->section_iter_; - - ACE_NEW_RETURN (pKey->section_iter_, - SUBSECTION_HASH::ITERATOR (IntId.section_hash_map_->begin ()), - -1); - } - - // Get the next entry - ACE_Hash_Map_Entry* entry = 0; - if (!pKey->section_iter_->next (entry)) - return 1; - - // Return the value of the iterator and advance it - pKey->section_iter_->advance (); - name = entry->ext_id_.name_; - - return 0; -} - -int -ACE_Configuration_Heap::set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - ACE_TString section; - if (load_key (key, section)) - return -1; - - ACE_Configuration_ExtId section_ext (section.fast_rep ()); - ACE_Configuration_Section_IntId section_int; - if (index_->find (section_ext, section_int, allocator_)) - return -1; - - // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; - ACE_Configuration_ExtId item_name (t_name); - if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) - { - // found item, replace it - // Free the old value - entry->int_id_.free (allocator_); - // Allocate the new value in this heap - ACE_TCHAR* pers_value = - (ACE_TCHAR *) allocator_->malloc ((value.length () + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_value, value.fast_rep ()); - ACE_Configuration_Value_IntId new_value_int (pers_value); - entry->int_id_ = new_value_int; - } - else - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = - (ACE_TCHAR *) allocator_->malloc ((ACE_OS::strlen (t_name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, t_name); - ACE_TCHAR* pers_value = - (ACE_TCHAR *) allocator_->malloc ((value.length () + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_value, value.fast_rep ()); - ACE_Configuration_ExtId item_name (pers_name); - ACE_Configuration_Value_IntId item_value (pers_value); - if (section_int.value_hash_map_->bind (item_name, item_value, allocator_)) - { - allocator_->free (pers_value); - allocator_->free (pers_name); - return -1; - } - return 0; - } - - return 0; -} - -int -ACE_Configuration_Heap::set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId section_ext (section.fast_rep ()); - ACE_Configuration_Section_IntId section_int; - if (index_->find (section_ext, section_int, allocator_)) - return -1; // section does not exist - - // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; - ACE_Configuration_ExtId item_name (t_name); - if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) - { - // found item, replace it - ACE_Configuration_Value_IntId new_value_int (value); - entry->int_id_ = new_value_int; - } - else - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = - (ACE_TCHAR *) allocator_->malloc ((ACE_OS::strlen (t_name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, t_name); - ACE_Configuration_ExtId item_name (pers_name); - ACE_Configuration_Value_IntId item_value (value); - if (section_int.value_hash_map_->bind (item_name, item_value, allocator_)) - { - allocator_->free (pers_name); - return -1; - } - return 0; - } - - return 0; -} - -int -ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - size_t length) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId section_ext (section.fast_rep ()); - ACE_Configuration_Section_IntId section_int; - if (index_->find (section_ext, section_int, allocator_)) - return -1; // section does not exist - - // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; - ACE_Configuration_ExtId item_name (t_name); - if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) - { - // found item, replace it - // Free the old value - entry->int_id_.free (allocator_); - // Allocate the new value in this heap - ACE_TCHAR* pers_value = (ACE_TCHAR *) allocator_->malloc (length); - ACE_OS::memcpy (pers_value, data, length); - ACE_Configuration_Value_IntId new_value_int (pers_value, length); - entry->int_id_ = new_value_int; - } - else - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = - (ACE_TCHAR *) allocator_->malloc ((ACE_OS::strlen (t_name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, t_name); - ACE_TCHAR* pers_value = (ACE_TCHAR *) allocator_->malloc (length); - ACE_OS::memcpy (pers_value, data, length); - ACE_Configuration_ExtId item_name (pers_name); - ACE_Configuration_Value_IntId item_value (pers_value, length); - if (section_int.value_hash_map_->bind (item_name, item_value, allocator_)) - { - allocator_->free (pers_value); - allocator_->free (pers_name); - return -1; - } - return 0; - } - - return 0; -} - -int -ACE_Configuration_Heap::get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; // section does not exist - - // See if it exists first - ACE_Configuration_ExtId VExtId (t_name); - ACE_Configuration_Value_IntId VIntId; - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - return -1; // unknown value - - // Check type - if (VIntId.type_ != ACE_Configuration::STRING) - { - errno = ENOENT; - return -1; - } - - // everythings ok, return the data - value = static_cast (VIntId.data_.ptr_); - return 0; -} - -int -ACE_Configuration_Heap::get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) -{ - ACE_ASSERT (this->allocator_); - - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section (0, 0, false); - - if (this->load_key (key, section) != 0) - { - return -1; - } - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - - if (index_->find (ExtId, IntId, allocator_) != 0) - { - return -1; // section does not exist - } - - // See if it exists first - ACE_Configuration_ExtId VExtId (t_name); - ACE_Configuration_Value_IntId VIntId; - - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_) != 0) - { - return -1; // unknown value - } - - // Check type - if (VIntId.type_ != ACE_Configuration::INTEGER) - { - errno = ENOENT; - return -1; - } - - // Everythings ok, return the data - value = VIntId.data_.int_; - return 0; -} - -int -ACE_Configuration_Heap::get_binary_value ( - const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - size_t& length) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; // section does not exist - - ACE_Configuration_ExtId VExtId (t_name); - ACE_Configuration_Value_IntId VIntId; - // See if it exists first - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - return -1; // unknown value - - // Check type - if (VIntId.type_ != ACE_Configuration::BINARY) - { - errno = ENOENT; - return -1; - } - - // Make a copy - ACE_NEW_RETURN (data, char[VIntId.length_], -1); - ACE_OS::memcpy (data, VIntId.data_.ptr_, VIntId.length_); - length = VIntId.length_; - return 0; -} - -int -ACE_Configuration_Heap::find_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - VALUETYPE& type_out) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; // section does not exist - - // Find it - ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; - if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) - return -1; // value does not exist - - type_out = value_entry->int_id_.type_; - return 0; -} - -int -ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) -{ - ACE_ASSERT (this->allocator_); - const ACE_TCHAR *t_name = name ? name : &this->NULL_String_; - if (validate_value_name (t_name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -1; // section does not exist - - // Find it - ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; - if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) - return -1; - - // free it - value_entry->ext_id_.free (allocator_); - value_entry->int_id_.free (allocator_); - - // Unbind it - if (IntId.value_hash_map_->unbind (ValueExtId, allocator_)) - return -1; - - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Configuration_Import_Export.cpp b/dep/src/ace/Configuration_Import_Export.cpp deleted file mode 100644 index 5225ec48331..00000000000 --- a/dep/src/ace/Configuration_Import_Export.cpp +++ /dev/null @@ -1,670 +0,0 @@ -// $Id: Configuration_Import_Export.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Configuration_Import_Export.h" -#include "ace/OS_Errno.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_ctype.h" -#include "ace/OS_NS_string.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Config_ImpExp_Base::ACE_Config_ImpExp_Base (ACE_Configuration& config) - : config_ (config) -{ -} - -ACE_Config_ImpExp_Base::~ACE_Config_ImpExp_Base (void) -{ -} - -ACE_Registry_ImpExp::ACE_Registry_ImpExp (ACE_Configuration& config) - : ACE_Config_ImpExp_Base (config) -{ -} - -ACE_Registry_ImpExp::~ACE_Registry_ImpExp (void) -{ -} - -// Imports the configuration database from filename. -// No existing data is removed. -int -ACE_Registry_ImpExp::import_config (const ACE_TCHAR* filename) -{ - if (0 == filename) - { - errno = EINVAL; - return -1; - } - FILE* in = ACE_OS::fopen (filename, ACE_TEXT ("r")); - if (!in) - return -1; - - u_int buffer_size = 4096; - u_int read_pos = 0; - ACE_TCHAR *buffer = 0; - ACE_NEW_NORETURN (buffer, ACE_TCHAR[buffer_size]); - if (!buffer) - { - ACE_Errno_Guard guard (errno); - (void) ACE_OS::fclose (in); - return -1; - } - ACE_Configuration_Section_Key section; - ACE_TCHAR *end = 0; - - while (ACE_OS::fgets (buffer+read_pos, buffer_size - read_pos, in)) - { - // Check if we got all the line. - end = ACE_OS::strrchr (buffer + read_pos, - ACE_TEXT ('\n')); // look for end of line - if (!end) // we havn't reach the end of the line yet - { - // allocate a new buffer - double size the previous one - ACE_TCHAR *temp_buffer; - ACE_NEW_NORETURN (temp_buffer, ACE_TCHAR[buffer_size * 2]); - if (!temp_buffer) - { - ACE_Errno_Guard guard (errno); - delete [] buffer; - (void) ACE_OS::fclose (in); - return -1; - } - - // copy the beginnning of the line - ACE_OS::memcpy (temp_buffer, buffer, buffer_size); - read_pos = buffer_size - 1; - buffer_size *= 2; - delete [] buffer; - buffer = temp_buffer; - continue; - } - read_pos = 0; - - // Check for a comment - if (buffer[0] == ACE_TEXT (';') || buffer[0] == ACE_TEXT ('#')) - continue; - - if (buffer[0] == ACE_TEXT ('[')) - { - // We have a new section here, strip out the section name - end = ACE_OS::strrchr (buffer, ACE_TEXT (']')); - if (!end) - { - ACE_OS::fclose (in); - delete [] buffer; - return -3; - } - *end = 0; - - if (config_.expand_path (config_.root_section (), buffer + 1, section, 1)) - { - ACE_OS::fclose (in); - delete [] buffer; - return -3; - } - continue; - } // end if firs char is a [ - - if (buffer[0] == ACE_TEXT ('"')) - { - // we have a value - end = ACE_OS::strchr (buffer+1, '"'); - if (!end) // no closing quote, not a value so just skip it - continue; - - // null terminate the name - *end = 0; - ACE_TCHAR* name = buffer + 1; - end+=2; - // determine the type - if (*end == '\"') - { - // string type - // truncate trailing " - ++end; - ACE_TCHAR* trailing = ACE_OS::strrchr (end, '"'); - if (trailing) - *trailing = 0; - if (config_.set_string_value (section, name, end)) - { - ACE_OS::fclose (in); - delete [] buffer; - return -4; - } - } - else if (ACE_OS::strncmp (end, ACE_TEXT ("dword:"), 6) == 0) - { - // number type - ACE_TCHAR* endptr = 0; - unsigned long value = ACE_OS::strtoul (end + 6, &endptr, 16); - if (config_.set_integer_value (section, name, value)) - { - ACE_OS::fclose (in); - delete [] buffer; - return -4; - } - } - else if (ACE_OS::strncmp (end, ACE_TEXT ("hex:"), 4) == 0) - { - // binary type - size_t string_length = ACE_OS::strlen (end + 4); - // divide by 3 to get the actual buffer length - size_t length = string_length / 3; - size_t remaining = length; - u_char* data = 0; - ACE_NEW_RETURN (data, - u_char[length], - -1); - u_char* out = data; - ACE_TCHAR* inb = end + 4; - ACE_TCHAR* endptr = 0; - while (remaining) - { - u_char charin = (u_char) ACE_OS::strtoul (inb, &endptr, 16); - *out = charin; - ++out; - --remaining; - inb += 3; - } - if (config_.set_binary_value (section, name, data, length)) - { - ACE_OS::fclose (in); - delete [] data; - delete [] buffer; - return -4; - } - else - delete [] data; - } - else - { - // invalid type, ignore - continue; - } - }// end if first char is a " - else - { - // if the first character is not a ", [, ;, or # we may be - // processing a file in the old format. - // Try and process the line as such and if it fails, - // return an error - int rc = process_previous_line_format (buffer, section); - if (rc != 0) - { - ACE_OS::fclose (in); - delete [] buffer; - return rc; - } - } // end if maybe old format - } // end while fgets - - if (ferror (in)) - { - ACE_OS::fclose (in); - delete [] buffer; - return -1; - } - - ACE_OS::fclose (in); - delete [] buffer; - return 0; -} - -// This method exports the entire configuration database to . -// Once the file is opened this method calls 'export_section' passing -// the root section. -int -ACE_Registry_ImpExp::export_config (const ACE_TCHAR* filename) -{ - if (0 == filename) - { - errno = EINVAL; - return -1; - } - int result = -1; - - FILE* out = ACE_OS::fopen (filename, ACE_TEXT ("w")); - if (out) - { - result = this->export_section (config_.root_section (), - ACE_TEXT (""), - out); - // The data may have been buffered and will be flush on close, - // so we need to check that the close succeeds. - if (ACE_OS::fclose (out) < 0) - result = -7; - } - return result; -} - -// Method provided by derived classes in order to write one section -// to the file specified. Called by export_config when exporting -// the entire configuration object. - -int -ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out) -{ - // don't export the root - if (path.length ()) - { - // Write out the section header - ACE_TString header = ACE_TEXT ("["); - header += path; - header += ACE_TEXT ("]"); - header += ACE_TEXT (" \n"); - if (ACE_OS::fputs (header.fast_rep (), out) < 0) - return -1; - // Write out each value - int index = 0; - ACE_TString name; - ACE_Configuration::VALUETYPE type; - ACE_TString line; - ACE_TCHAR int_value[32]; - ACE_TCHAR bin_value[3]; - void* binary_data; - size_t binary_length; - ACE_TString string_value; - while (!config_.enumerate_values (section, index, name, type)) - { - line = ACE_TEXT ("\"") + name + ACE_TEXT ("\"="); - switch (type) - { - case ACE_Configuration::INTEGER: - { - u_int value; - if (config_.get_integer_value (section, name.fast_rep (), value)) - return -2; - ACE_OS::sprintf (int_value, ACE_TEXT ("%08x"), value); - line += ACE_TEXT ("dword:"); - line += int_value; - break; - } - case ACE_Configuration::STRING: - { - if (config_.get_string_value (section, - name.fast_rep (), - string_value)) - return -2; - line += ACE_TEXT ("\""); - line += string_value + ACE_TEXT ("\""); - break; - } -#ifdef _WIN32 - case ACE_Configuration::INVALID: - break; // JDO added break. Otherwise INVALID is processed - // like BINARY. If that's correct, please remove the - // break and these comments -#endif - case ACE_Configuration::BINARY: - { - // not supported yet - maybe use BASE64 codeing? - if (config_.get_binary_value (section, - name.fast_rep (), - binary_data, - binary_length)) - return -2; - line += ACE_TEXT ("hex:"); - unsigned char* ptr = (unsigned char*)binary_data; - while (binary_length) - { - if (ptr != binary_data) - { - line += ACE_TEXT (","); - } - ACE_OS::sprintf (bin_value, ACE_TEXT ("%02x"), *ptr); - line += bin_value; - --binary_length; - ++ptr; - } - delete [] (char*) binary_data; - break; - } - default: - return -3; - } - line += ACE_TEXT ("\n"); - if (ACE_OS::fputs (line.fast_rep (), out) < 0) - return -4; - ++index; - } - } - // Export all sub sections - int index = 0; - ACE_TString name; - ACE_Configuration_Section_Key sub_key; - ACE_TString sub_section; - while (!config_.enumerate_sections (section, index, name)) - { - ACE_TString sub_section (path); - if (path.length ()) - sub_section += ACE_TEXT ("\\"); - sub_section += name; - if (config_.open_section (section, name.fast_rep (), 0, sub_key)) - return -5; - if (export_section (sub_key, sub_section.fast_rep (), out)) - return -6; - ++index; - } - return 0; -} - -// -// This method read the line format origionally used in ACE 5.1 -// -int -ACE_Registry_ImpExp::process_previous_line_format (ACE_TCHAR* buffer, - ACE_Configuration_Section_Key& section) -{ - // Chop any cr/lf at the end of the line. - ACE_TCHAR *endp = ACE_OS::strpbrk (buffer, ACE_TEXT ("\r\n")); - if (endp != 0) - *endp = '\0'; - - // assume this is a value, read in the value name - ACE_TCHAR* end = ACE_OS::strchr (buffer, '='); - if (end) // no =, not a value so just skip it - { - // null terminate the name - *end = 0; - ++end; - // determine the type - if (*end == '\"') - { - // string type - if(config_.set_string_value (section, buffer, end + 1)) - return -4; - } - else if (*end == '#') - { - // number type - u_int value = ACE_OS::atoi (end + 1); - if (config_.set_integer_value (section, buffer, value)) - return -4; - } - } - return 0; -} // end read_previous_line_format - -ACE_Ini_ImpExp::ACE_Ini_ImpExp (ACE_Configuration& config) - : ACE_Config_ImpExp_Base (config) -{ -} - -ACE_Ini_ImpExp::~ACE_Ini_ImpExp (void) -{ -} - -// Method to read file and populate object. -int -ACE_Ini_ImpExp::import_config (const ACE_TCHAR* filename) -{ - if (0 == filename) - { - errno = EINVAL; - return -1; - } - FILE* in = ACE_OS::fopen (filename, ACE_TEXT ("r")); - if (!in) - return -1; - - // @@ Make this a dynamic size! - ACE_TCHAR buffer[4096]; - ACE_Configuration_Section_Key section; - while (ACE_OS::fgets (buffer, sizeof buffer, in)) - { - ACE_TCHAR *line = this->squish (buffer); - // Check for a comment and blank line - if (line[0] == ACE_TEXT (';') || - line[0] == ACE_TEXT ('#') || - line[0] == '\0') - continue; - - if (line[0] == ACE_TEXT ('[')) - { - // We have a new section here, strip out the section name - ACE_TCHAR* end = ACE_OS::strrchr (line, ACE_TEXT (']')); - if (!end) - { - ACE_OS::fclose (in); - return -3; - } - *end = 0; - - if (config_.expand_path (config_.root_section (), - line + 1, - section, - 1)) - { - ACE_OS::fclose (in); - return -3; - } - - continue; - } - - // We have a line; name ends at equal sign. - ACE_TCHAR *end = ACE_OS::strchr (line, ACE_TEXT ('=')); - if (end == 0) // No '=' - { - ACE_OS::fclose (in); - return -3; - } - *end++ = '\0'; - ACE_TCHAR *name = this->squish (line); -#if 0 - if (ACE_OS::strlen (name) == 0) // No name; just an '=' - { - ACE_OS::fclose (in); - return -3; - } -#endif - // Now find the start of the value - ACE_TCHAR *value = this->squish (end); - size_t value_len = ACE_OS::strlen (value); - if (value_len > 0) - { - // ACE 5.2 (and maybe earlier) exported strings may be enclosed - // in quotes. If string is quote-delimited, strip the quotes. - // Newer exported files don't have quote delimiters. - if (value[0] == ACE_TEXT ('"') && - value[value_len - 1] == ACE_TEXT ('"')) - { - // Strip quotes off both ends. - value[value_len - 1] = '\0'; - ++value; - } - } - - if (config_.set_string_value (section, name, value)) - { - ACE_OS::fclose (in); - return -4; - } - } // end while fgets - - if (ferror (in)) - { - ACE_OS::fclose (in); - return -1; - } - - ACE_OS::fclose (in); - return 0; -} - -// This method exports the entire configuration database to . -// Once the file is opened this method calls 'export_section' passing -// the root section. -int -ACE_Ini_ImpExp::export_config (const ACE_TCHAR* filename) -{ - if (0 == filename) - { - errno = EINVAL; - return -1; - } - int result = -1; - - FILE* out = ACE_OS::fopen (filename, ACE_TEXT ("w")); - if (out) - { - result = this->export_section (config_.root_section (), - ACE_TEXT (""), - out); - // The data may have been buffered and will be flush on close, - // so we need to check that the close succeeds. - if (ACE_OS::fclose (out) < 0) - result = -7; - } - return result; -} - -// Method provided by derived classes in order to write one section to the -// file specified. Called by export_config when exporting the entire -// configuration objet - -int -ACE_Ini_ImpExp::export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out) -{ - // don't export the root - if (path.length ()) - { - // Write out the section header - ACE_TString header = ACE_TEXT ("["); - header += path; - header += ACE_TEXT ("]\n"); - if (ACE_OS::fputs (header.fast_rep (), out) < 0) - return -1; - // Write out each value - int index = 0; - ACE_TString name; - ACE_Configuration::VALUETYPE type; - ACE_TString line; - ACE_TCHAR int_value[32]; - ACE_TCHAR bin_value[3]; - void* binary_data; - size_t binary_length; - ACE_TString string_value; - while (!config_.enumerate_values (section, index, name, type)) - { - line = name + ACE_TEXT ("="); - switch (type) - { - case ACE_Configuration::INTEGER: - { - u_int value; - if (config_.get_integer_value (section, name.fast_rep (), value)) - return -2; - ACE_OS::sprintf (int_value, ACE_TEXT ("%08x"), value); - line += int_value; - break; - } - case ACE_Configuration::STRING: - { - if (config_.get_string_value (section, - name.fast_rep (), - string_value)) - return -2; - line += string_value; - break; - } -#ifdef _WIN32 - case ACE_Configuration::INVALID: - break; // JDO added break. Otherwise INVALID is processed - // like BINARY. If that's correct, please remove the - // break and these comments -#endif - case ACE_Configuration::BINARY: - { - // not supported yet - maybe use BASE64 codeing? - if (config_.get_binary_value (section, - name.fast_rep (), - binary_data, - binary_length)) - return -2; - line += ACE_TEXT ("\""); - unsigned char* ptr = (unsigned char*)binary_data; - while (binary_length) - { - if (ptr != binary_data) - { - line += ACE_TEXT (","); - } - ACE_OS::sprintf (bin_value, ACE_TEXT ("%02x"), *ptr); - line += bin_value; - --binary_length; - ++ptr; - } - line += ACE_TEXT ("\""); - delete [] (char *) binary_data; - break; - } - default: - return -3; - - }// end switch on type - - line += ACE_TEXT ("\n"); - if (ACE_OS::fputs (line.fast_rep (), out) < 0) - return -4; - ++index; - }// end while enumerating values - } - // Export all sub sections - int index = 0; - ACE_TString name; - ACE_Configuration_Section_Key sub_key; - ACE_TString sub_section; - while (!config_.enumerate_sections (section, index, name)) - { - ACE_TString sub_section (path); - if (path.length ()) - sub_section += ACE_TEXT ("\\"); - sub_section += name; - if (config_.open_section (section, name.fast_rep (), 0, sub_key)) - return -5; - if (export_section (sub_key, sub_section.fast_rep (), out)) - return -6; - ++index; - } - return 0; - -} - -// Method to squish leading and trailing whitespaces from a string. -// Whitespace is defined as: spaces (' '), tabs ('\t') or end-of-line -// (cr/lf). The terminating nul is moved up to expunge trailing -// whitespace and the returned pointer points at the first -// non-whitespace character in the string, which may be the nul -// terminator if the string is all whitespace. - -ACE_TCHAR * -ACE_Ini_ImpExp::squish (ACE_TCHAR *src) -{ - ACE_TCHAR *cp = 0; - - if (src == 0) - return 0; - - // Start at the end and work backwards over all whitespace. - for (cp = src + ACE_OS::strlen (src) - 1; - cp != src; - --cp) - if (!ACE_OS::ace_isspace (*cp)) - break; - cp[1] = '\0'; // Chop trailing whitespace - - // Now start at the beginning and move over all whitespace. - for (cp = src; ACE_OS::ace_isspace (*cp); ++cp) - continue; - - return cp; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Connection_Recycling_Strategy.cpp b/dep/src/ace/Connection_Recycling_Strategy.cpp deleted file mode 100644 index 752b2220bb3..00000000000 --- a/dep/src/ace/Connection_Recycling_Strategy.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "ace/Connection_Recycling_Strategy.h" - -ACE_RCSID(ace, Connection_Recycling_Strategy, "$Id: Connection_Recycling_Strategy.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Connection_Recycling_Strategy::~ACE_Connection_Recycling_Strategy (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Connector.cpp b/dep/src/ace/Connector.cpp deleted file mode 100644 index 6372ffb1a5a..00000000000 --- a/dep/src/ace/Connector.cpp +++ /dev/null @@ -1,967 +0,0 @@ -// $Id: Connector.cpp 81991 2008-06-16 19:05:40Z elliott_c $ - -#ifndef ACE_CONNECTOR_CPP -#define ACE_CONNECTOR_CPP - -#include "ace/Connector.h" -#include "ace/ACE.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" -#include "ace/os_include/os_fcntl.h" /* Has ACE_NONBLOCK */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Connector) - -template -ACE_NonBlocking_Connect_Handler::ACE_NonBlocking_Connect_Handler -(ACE_Connector_Base &connector, - SVC_HANDLER *sh, - long id) - : connector_ (connector) - , svc_handler_ (sh) - , timer_id_ (id) -{ - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::ACE_NonBlocking_Connect_Handler"); - - this->reference_counting_policy ().value - (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); -} - -template SVC_HANDLER * -ACE_NonBlocking_Connect_Handler::svc_handler (void) -{ - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::svc_handler"); - return this->svc_handler_; -} - -template long -ACE_NonBlocking_Connect_Handler::timer_id (void) -{ - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::timer_id"); - return this->timer_id_; -} - -template void -ACE_NonBlocking_Connect_Handler::timer_id (long id) -{ - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::timer_id"); - this->timer_id_ = id; -} - -template void -ACE_NonBlocking_Connect_Handler::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("svc_handler_ = %x"), this->svc_handler_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d"), this->timer_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template bool -ACE_NonBlocking_Connect_Handler::close (SVC_HANDLER *&sh) -{ - // Make sure that we haven't already initialized the Svc_Handler. - if (!this->svc_handler_) - return false; - - { - // Exclusive access to the Reactor. - ACE_GUARD_RETURN (ACE_Lock, - ace_mon, - this->reactor ()->lock (), - 0); - - // Double check. - if (!this->svc_handler_) - return false; - - // Remember the Svc_Handler. - sh = this->svc_handler_; - ACE_HANDLE h = sh->get_handle (); - this->svc_handler_ = 0; - - // Remove this handle from the set of non-blocking handles - // in the Connector. - this->connector_.non_blocking_handles ().remove (h); - - // Cancel timer. - if (this->reactor ()->cancel_timer (this->timer_id (), - 0, - 0) == -1) - return false; - - // Remove from Reactor. - if (this->reactor ()->remove_handler ( - h, - ACE_Event_Handler::ALL_EVENTS_MASK) == -1) - return false; - } - - return true; -} - - -template int -ACE_NonBlocking_Connect_Handler::handle_timeout -(const ACE_Time_Value &tv, - const void *arg) -{ - // This method is called if a connection times out before completing. - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::handle_timeout"); - - SVC_HANDLER *svc_handler = 0; - int retval = this->close (svc_handler) ? 0 : -1; - - // Forward to the SVC_HANDLER the that was passed in as a - // magic cookie during ACE_Connector::connect(). This gives the - // SVC_HANDLER an opportunity to take corrective action (e.g., wait - // a few milliseconds and try to reconnect again. - if (svc_handler != 0 && svc_handler->handle_timeout (tv, arg) == -1) - svc_handler->handle_close (svc_handler->get_handle (), - ACE_Event_Handler::TIMER_MASK); - - return retval; -} - - -template int -ACE_NonBlocking_Connect_Handler::handle_input (ACE_HANDLE) -{ - // Called when a failure occurs during asynchronous connection - // establishment. - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::handle_input"); - - SVC_HANDLER *svc_handler = 0; - int const retval = this->close (svc_handler) ? 0 : -1; - - // Close Svc_Handler. - if (svc_handler != 0) - svc_handler->close (NORMAL_CLOSE_OPERATION); - - return retval; -} - -template int -ACE_NonBlocking_Connect_Handler::handle_output (ACE_HANDLE handle) -{ - // Called when a connection is establishment asynchronous. - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::handle_output"); - - // Grab the connector ref before smashing ourselves in close(). - ACE_Connector_Base &connector = this->connector_; - SVC_HANDLER *svc_handler = 0; - int const retval = this->close (svc_handler) ? 0 : -1; - - if (svc_handler != 0) - connector.initialize_svc_handler (handle, svc_handler); - - return retval; -} - -template int -ACE_NonBlocking_Connect_Handler::handle_exception (ACE_HANDLE h) -{ - // On Win32, the except mask must also be set for asynchronous - // connects. - ACE_TRACE ("ACE_NonBlocking_Connect_Handler::handle_exception"); - return this->handle_output (h); -} - -template int -ACE_NonBlocking_Connect_Handler::resume_handler (void) -{ - return ACE_Event_Handler::ACE_EVENT_HANDLER_NOT_RESUMED; -} - -template void -ACE_Connector::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Connector::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nflags_ = %d"), this->flags_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template int -ACE_Connector::make_svc_handler (SVC_HANDLER *&sh) -{ - ACE_TRACE ("ACE_Connector::make_svc_handler"); - - if (sh == 0) - ACE_NEW_RETURN (sh, - SVC_HANDLER, - -1); - - // Set the reactor of the newly created to the same - // reactor that this is using. - sh->reactor (this->reactor ()); - return 0; -} - -template int -ACE_Connector::activate_svc_handler (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Connector::activate_svc_handler"); - // No errors initially - int error = 0; - - // See if we should enable non-blocking I/O on the 's - // peer. - if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0) - { - if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1) - error = 1; - } - // Otherwise, make sure it's disabled by default. - else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1) - error = 1; - - // We are connected now, so try to open things up. - if (error || svc_handler->open ((void *) this) == -1) - { - // Make sure to close down the to avoid descriptor - // leaks. - // The connection was already made; so this close is a "normal" - // close operation. - svc_handler->close (NORMAL_CLOSE_OPERATION); - return -1; - } - else - return 0; -} - -template ACE_PEER_CONNECTOR & -ACE_Connector::connector (void) const -{ - return const_cast (this->connector_); -} - -template int -ACE_Connector::connect_svc_handler -(SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect_svc_handler"); - - return this->connector_.connect (svc_handler->peer (), - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect_svc_handler -(SVC_HANDLER *&svc_handler, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect_svc_handler"); - - sh_copy = svc_handler; - return this->connector_.connect (svc_handler->peer (), - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::open (ACE_Reactor *r, int flags) -{ - ACE_TRACE ("ACE_Connector::open"); - this->reactor (r); - this->flags_ = flags; - return 0; -} - -template -ACE_Connector::ACE_Connector (ACE_Reactor *r, - int flags) -{ - ACE_TRACE ("ACE_Connector::ACE_Connector"); - (void) this->open (r, flags); -} - -template int -ACE_Connector::connect -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - // Initiate connection to peer. - return this->connect_i (sh, - 0, - remote_addr, - synch_options, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect -(SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - // Initiate connection to peer. - return this->connect_i (sh, - &sh_copy, - remote_addr, - synch_options, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect_i -(SVC_HANDLER *&sh, - SVC_HANDLER **sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect_i"); - - // If the user hasn't supplied us with a we'll use the - // factory method to create one. Otherwise, things will remain as - // they are... - if (this->make_svc_handler (sh) == -1) - return -1; - - ACE_Time_Value *timeout = 0; - int const use_reactor = synch_options[ACE_Synch_Options::USE_REACTOR]; - - if (use_reactor) - timeout = const_cast (&ACE_Time_Value::zero); - else - timeout = const_cast (synch_options.time_value ()); - - int result; - if (sh_copy == 0) - result = this->connect_svc_handler (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); - else - result = this->connect_svc_handler (sh, - *sh_copy, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); - - // Activate immediately if we are connected. - if (result != -1) - return this->activate_svc_handler (sh); - - // Delegate to connection strategy. - if (use_reactor && ACE_OS::last_error () == EWOULDBLOCK) - { - // If the connection hasn't completed and we are using - // non-blocking semantics then register - // ACE_NonBlocking_Connect_Handler with the ACE_Reactor so that - // it will call us back when the connection is complete or we - // timeout, whichever comes first... - int result; - - if (sh_copy == 0) - result = this->nonblocking_connect (sh, synch_options); - else - result = this->nonblocking_connect (*sh_copy, synch_options); - - // If for some reason the call failed, then - // will be set to the new error. If the call succeeds, however, - // we need to make sure that remains set to - // . - if (result == 0) - errno = EWOULDBLOCK; - } - else - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - // Make sure to close down the service handler to avoid handle - // leaks. - if (sh_copy == 0) - { - if (sh) - sh->close (CLOSE_DURING_NEW_CONNECTION); - } - else if (*sh_copy) - (*sh_copy)->close (CLOSE_DURING_NEW_CONNECTION); - } - - return -1; -} - -template int -ACE_Connector::connect_n -(size_t n, - SVC_HANDLER *sh[], - ACE_PEER_CONNECTOR_ADDR remote_addrs[], - ACE_TCHAR *failed_svc_handlers, - const ACE_Synch_Options &synch_options) -{ - int result = 0; - - for (size_t i = 0; i < n; i++) - { - if (this->connect (sh[i], remote_addrs[i], synch_options) == -1 - && !(synch_options[ACE_Synch_Options::USE_REACTOR] - && errno == EWOULDBLOCK)) - { - result = -1; - if (failed_svc_handlers != 0) - // Mark this entry as having failed. - failed_svc_handlers[i] = 1; - } - else if (failed_svc_handlers != 0) - // Mark this entry as having succeeded. - failed_svc_handlers[i] = 0; - } - - return result; -} - -// Cancel a that was started asynchronously. -template int -ACE_Connector::cancel (SVC_HANDLER *sh) -{ - ACE_TRACE ("ACE_Connector::cancel"); - - ACE_Event_Handler *handler = - this->reactor ()->find_handler (sh->get_handle ()); - - if (handler == 0) - return -1; - - // find_handler() increments handler's refcount; ensure we decrement it. - ACE_Event_Handler_var safe_handler (handler); - - NBCH *nbch = - dynamic_cast (handler); - - if (nbch == 0) - return -1; - - SVC_HANDLER *tmp_sh = 0; - - if (nbch->close (tmp_sh) == false) - return -1; - - return 0; -} - -template int -ACE_Connector::nonblocking_connect -(SVC_HANDLER *sh, - const ACE_Synch_Options &synch_options) -{ - ACE_TRACE ("ACE_Connector::nonblocking_connect"); - - // Must have a valid Reactor for non-blocking connects to work. - if (this->reactor () == 0) - return -1; - - // Register the pending SVC_HANDLER so that it can be activated - // later on when the connection completes. - - ACE_HANDLE handle = sh->get_handle (); - long timer_id = -1; - ACE_Time_Value *tv = 0; - NBCH *nbch = 0; - - ACE_NEW_RETURN (nbch, - NBCH (*this, - sh, - -1), - -1); - - ACE_Event_Handler_var safe_nbch (nbch); - - // Exclusive access to the Reactor. - ACE_GUARD_RETURN (ACE_Lock, ace_mon, this->reactor ()->lock (), -1); - - // Register handle with the reactor for connection events. - ACE_Reactor_Mask mask = ACE_Event_Handler::CONNECT_MASK; - if (this->reactor ()->register_handler (handle, - nbch, - mask) == -1) - goto reactor_registration_failure; - - // Add handle to non-blocking handle set. - this->non_blocking_handles ().insert (handle); - - // If we're starting connection under timer control then we need to - // schedule a timeout with the ACE_Reactor. - tv = const_cast (synch_options.time_value ()); - if (tv != 0) - { - timer_id = - this->reactor ()->schedule_timer (nbch, - synch_options.arg (), - *tv); - if (timer_id == -1) - goto timer_registration_failure; - - // Remember timer id. - nbch->timer_id (timer_id); - } - - return 0; - - // Undo previous actions using the ol' "goto label and fallthru" - // trick... - timer_registration_failure: - - // Remove from Reactor. - this->reactor ()->remove_handler (handle, mask); - - // Remove handle from the set of non-blocking handles. - this->non_blocking_handles ().remove (handle); - - /* FALLTHRU */ - - reactor_registration_failure: - // Close the svc_handler - - sh->close (CLOSE_DURING_NEW_CONNECTION); - - return -1; -} - -template -ACE_Connector::~ACE_Connector (void) -{ - ACE_TRACE ("ACE_Connector::~ACE_Connector"); - - this->close (); -} - -template void -ACE_Connector::initialize_svc_handler -(ACE_HANDLE handle, - SVC_HANDLER *svc_handler) -{ - // Try to find out if the reactor uses event associations for the - // handles it waits on. If so we need to reset it. - int reset_new_handle = - this->reactor ()->uses_event_associations (); - - if (reset_new_handle) - this->connector_.reset_new_handle (handle); - - // Transfer ownership of the ACE_HANDLE to the SVC_HANDLER. - svc_handler->set_handle (handle); - - ACE_PEER_CONNECTOR_ADDR raddr; - - // Check to see if we're connected. - if (svc_handler->peer ().get_remote_addr (raddr) != -1) - this->activate_svc_handler (svc_handler); - else // Somethings gone wrong, so close down... - { -#if defined (ACE_WIN32) - // Win32 (at least prior to Windows 2000) has a timing problem. - // If you check to see if the connection has completed too fast, - // it will fail - so wait 35 milliseconds to let it catch up. - ACE_Time_Value tv (0, ACE_NON_BLOCKING_BUG_DELAY); - ACE_OS::sleep (tv); - if (svc_handler->peer ().get_remote_addr (raddr) != -1) - this->activate_svc_handler (svc_handler); - else // do the svc handler close below... -#endif /* ACE_WIN32 */ - svc_handler->close (NORMAL_CLOSE_OPERATION); - } -} - -template void -ACE_Connector::reactor (ACE_Reactor *reactor) -{ - this->reactor_ = reactor; -} - -template ACE_Reactor * -ACE_Connector::reactor (void) const -{ - return this->reactor_; -} - -template ACE_Unbounded_Set & -ACE_Connector::non_blocking_handles (void) -{ - return this->non_blocking_handles_; -} - -template int -ACE_Connector::close (void) -{ - // If there are no non-blocking handle pending, return immediately. - if (this->non_blocking_handles ().size () == 0) - return 0; - - // Exclusive access to the Reactor. - ACE_GUARD_RETURN (ACE_Lock, ace_mon, this->reactor ()->lock (), -1); - - // Go through all the non-blocking handles. It is necessary to - // create a new iterator each time because we remove from the handle - // set when we cancel the Svc_Handler. - ACE_HANDLE *handle = 0; - while (1) - { - ACE_Unbounded_Set_Iterator - iterator (this->non_blocking_handles ()); - if (!iterator.next (handle)) - break; - - ACE_Event_Handler *handler = - this->reactor ()->find_handler (*handle); - if (handler == 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%t: Connector::close h %d, no handler\n"), - *handle)); - // Remove handle from the set of non-blocking handles. - this->non_blocking_handles ().remove (*handle); - continue; - } - - // find_handler() incremented handler's refcount; ensure it's decremented - ACE_Event_Handler_var safe_handler (handler); - NBCH *nbch = dynamic_cast (handler); - if (nbch == 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%t: Connector::close h %d handler %@ ") - ACE_TEXT ("not a legit handler\n"), - *handle, - handler)); - // Remove handle from the set of non-blocking handles. - this->non_blocking_handles ().remove (*handle); - continue; - } - SVC_HANDLER *svc_handler = nbch->svc_handler (); - - // Cancel the non-blocking connection. - this->cancel (svc_handler); - - // Close the associated Svc_Handler. - svc_handler->close (NORMAL_CLOSE_OPERATION); - } - - return 0; -} - -template int -ACE_Connector::fini (void) -{ - ACE_TRACE ("ACE_Connector::fini"); - - return this->close (); -} - -// Hook called by the explicit dynamic linking facility. - -template int -ACE_Connector::init (int, ACE_TCHAR *[]) -{ - ACE_TRACE ("ACE_Connector::init"); - return -1; -} - -template int -ACE_Connector::suspend (void) -{ - ACE_TRACE ("ACE_Connector::suspend"); - return -1; -} - -template int -ACE_Connector::resume (void) -{ - ACE_TRACE ("ACE_Connector::resume"); - return -1; -} - -template int -ACE_Connector::info (ACE_TCHAR **strp, size_t length) const -{ - ACE_TRACE ("ACE_Connector::info"); - ACE_TCHAR buf[BUFSIZ]; - - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s"), - ACE_TEXT ("ACE_Connector"), - ACE_TEXT ("# connector factory\n")); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strsncpy (*strp, buf, length); - return static_cast (ACE_OS::strlen (buf)); -} - -template int -ACE_Strategy_Connector::open (ACE_Reactor *r, - int flags) -{ - ACE_TRACE ("ACE_Strategy_Connector::open"); - return this->open (r, 0, 0, 0, flags); -} - -template int -ACE_Strategy_Connector::open -(ACE_Reactor *r, - ACE_Creation_Strategy *cre_s, - ACE_Connect_Strategy *conn_s, - ACE_Concurrency_Strategy *con_s, - int flags) -{ - ACE_TRACE ("ACE_Strategy_Connector::open"); - - this->reactor (r); - - // @@ Not implemented yet. - // this->flags_ = flags; - ACE_UNUSED_ARG (flags); - - // Initialize the creation strategy. - - // First we decide if we need to clean up. - if (this->creation_strategy_ != 0 && - this->delete_creation_strategy_ && - cre_s != 0) - { - delete this->creation_strategy_; - this->creation_strategy_ = 0; - this->delete_creation_strategy_ = false; - } - - if (cre_s != 0) - this->creation_strategy_ = cre_s; - else if (this->creation_strategy_ == 0) - { - ACE_NEW_RETURN (this->creation_strategy_, - CREATION_STRATEGY, - -1); - this->delete_creation_strategy_ = true; - } - - - // Initialize the accept strategy. - - if (this->connect_strategy_ != 0 && - this->delete_connect_strategy_ && - conn_s != 0) - { - delete this->connect_strategy_; - this->connect_strategy_ = 0; - this->delete_connect_strategy_ = false; - } - - if (conn_s != 0) - this->connect_strategy_ = conn_s; - else if (this->connect_strategy_ == 0) - { - ACE_NEW_RETURN (this->connect_strategy_, - CONNECT_STRATEGY, - -1); - this->delete_connect_strategy_ = true; - } - - // Initialize the concurrency strategy. - - if (this->concurrency_strategy_ != 0 && - this->delete_concurrency_strategy_ && - con_s != 0) - { - delete this->concurrency_strategy_; - this->concurrency_strategy_ = 0; - this->delete_concurrency_strategy_ = false; - } - - if (con_s != 0) - this->concurrency_strategy_ = con_s; - else if (this->concurrency_strategy_ == 0) - { - ACE_NEW_RETURN (this->concurrency_strategy_, - CONCURRENCY_STRATEGY, - -1); - this->delete_concurrency_strategy_ = true; - } - - return 0; -} - -template -ACE_Strategy_Connector::ACE_Strategy_Connector -(ACE_Reactor *reactor, - ACE_Creation_Strategy *cre_s, - ACE_Connect_Strategy *conn_s, - ACE_Concurrency_Strategy *con_s, - int flags) - : creation_strategy_ (0), - delete_creation_strategy_ (false), - connect_strategy_ (0), - delete_connect_strategy_ (false), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (false) -{ - ACE_TRACE ("ACE_Connector::ACE_Strategy_Connector"); - - if (this->open (reactor, cre_s, conn_s, con_s, flags) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Strategy_Connector::ACE_Strategy_Connector"))); -} - -template -ACE_Strategy_Connector::~ACE_Strategy_Connector (void) -{ - ACE_TRACE ("ACE_Strategy_Connector::~ACE_Strategy_Connector"); - - // Close down - this->close (); -} - -template int -ACE_Strategy_Connector::close (void) -{ - if (this->delete_creation_strategy_) - delete this->creation_strategy_; - this->delete_creation_strategy_ = false; - this->creation_strategy_ = 0; - - if (this->delete_connect_strategy_) - delete this->connect_strategy_; - this->delete_connect_strategy_ = false; - this->connect_strategy_ = 0; - - if (this->delete_concurrency_strategy_) - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = false; - this->concurrency_strategy_ = 0; - - return SUPER::close (); -} - -template int -ACE_Strategy_Connector::make_svc_handler (SVC_HANDLER *&sh) -{ - return this->creation_strategy_->make_svc_handler (sh); -} - -template int -ACE_Strategy_Connector::connect_svc_handler -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_strategy_->connect_svc_handler (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Strategy_Connector::connect_svc_handler -(SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_strategy_->connect_svc_handler (sh, - sh_copy, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Strategy_Connector::activate_svc_handler (SVC_HANDLER *svc_handler) -{ - return this->concurrency_strategy_->activate_svc_handler (svc_handler, this); -} - -template ACE_Creation_Strategy * -ACE_Strategy_Connector::creation_strategy (void) const -{ - return this->creation_strategy_; -} - -template ACE_Connect_Strategy * -ACE_Strategy_Connector::connect_strategy (void) const -{ - return this->connect_strategy_; -} - -template ACE_Concurrency_Strategy * -ACE_Strategy_Connector::concurrency_strategy (void) const -{ - return this->concurrency_strategy_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CONNECTOR_C */ - diff --git a/dep/src/ace/Containers.cpp b/dep/src/ace/Containers.cpp deleted file mode 100644 index 754ef0e5194..00000000000 --- a/dep/src/ace/Containers.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// $Id: Containers.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Containers.h" - -ACE_RCSID (ace, - Containers, - "$Id: Containers.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/Containers.inl" -#endif /* __ACE_INLINE__ */ - - diff --git a/dep/src/ace/Containers_T.cpp b/dep/src/ace/Containers_T.cpp deleted file mode 100644 index 29a4b35743c..00000000000 --- a/dep/src/ace/Containers_T.cpp +++ /dev/null @@ -1,1933 +0,0 @@ -// $Id: Containers_T.cpp 82588 2008-08-11 13:37:41Z johnnyw $ - -#ifndef ACE_CONTAINERS_T_CPP -#define ACE_CONTAINERS_T_CPP - -#include "ace/Log_Msg.h" -#include "ace/Malloc_Base.h" -#include "ace/OS_Memory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Containers.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Containers_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Stack) - -template void -ACE_Bounded_Stack::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Bounded_Stack::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Bounded_Stack::ACE_Bounded_Stack (size_t size) - : size_ (size), - top_ (0) -{ - ACE_NEW (this->stack_, - T[size]); - ACE_TRACE ("ACE_Bounded_Stack::ACE_Bounded_Stack"); -} - -template -ACE_Bounded_Stack::ACE_Bounded_Stack (const ACE_Bounded_Stack &s) - : size_ (s.size_), - top_ (s.top_) -{ - ACE_NEW (this->stack_, - T[s.size_]); - - ACE_TRACE ("ACE_Bounded_Stack::ACE_Bounded_Stack"); - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; -} - -template void -ACE_Bounded_Stack::operator= (const ACE_Bounded_Stack &s) -{ - ACE_TRACE ("ACE_Bounded_Stack::operator="); - - if (&s != this) - { - if (this->size_ < s.size_) - { - delete [] this->stack_; - ACE_NEW (this->stack_, - T[s.size_]); - this->size_ = s.size_; - } - this->top_ = s.top_; - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; - } -} - -template -ACE_Bounded_Stack::~ACE_Bounded_Stack (void) -{ - ACE_TRACE ("ACE_Bounded_Stack::~ACE_Bounded_Stack"); - delete [] this->stack_; -} - -// ---------------------------------------- - -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Stack) - -template void -ACE_Fixed_Stack::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Fixed_Stack::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Fixed_Stack::ACE_Fixed_Stack (void) - : size_ (ACE_SIZE), - top_ (0) -{ - ACE_TRACE ("ACE_Fixed_Stack::ACE_Fixed_Stack"); -} - -template -ACE_Fixed_Stack::ACE_Fixed_Stack (const ACE_Fixed_Stack &s) - : size_ (s.size_), - top_ (s.top_) -{ - ACE_TRACE ("ACE_Fixed_Stack::ACE_Fixed_Stack"); - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; -} - -template void -ACE_Fixed_Stack::operator= (const ACE_Fixed_Stack &s) -{ - ACE_TRACE ("ACE_Fixed_Stack::operator="); - - if (&s != this) - { - this->top_ = s.top_; - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; - } -} - -template -ACE_Fixed_Stack::~ACE_Fixed_Stack (void) -{ - ACE_TRACE ("ACE_Fixed_Stack::~ACE_Fixed_Stack"); -} - -//---------------------------------------- - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Stack) - -template void -ACE_Unbounded_Stack::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Unbounded_Stack::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Unbounded_Stack::ACE_Unbounded_Stack (ACE_Allocator *alloc) - : head_ (0), - cur_size_ (0), - allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::ACE_Unbounded_Stack"); - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; -} - -template void -ACE_Unbounded_Stack::delete_all_nodes (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::delete_all_nodes"); - - while (this->is_empty () == 0) - { - ACE_Node *temp = this->head_->next_; - this->head_->next_ = temp->next_; - ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free, - ACE_Node, ); - } - - this->cur_size_ = 0; - - ACE_ASSERT (this->head_ == this->head_->next_ - && this->is_empty ()); -} - -template void -ACE_Unbounded_Stack::copy_all_nodes (const ACE_Unbounded_Stack &s) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::copy_all_nodes"); - - ACE_ASSERT (this->head_ == this->head_->next_); - - ACE_Node *temp = this->head_; - - for (ACE_Node *s_temp = s.head_->next_; - s_temp != s.head_; - s_temp = s_temp->next_) - { - ACE_Node *nptr = temp->next_; - ACE_NEW_MALLOC (temp->next_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (s_temp->item_, nptr)); - temp = temp->next_; - } - this->cur_size_ = s.cur_size_; -} - -template -ACE_Unbounded_Stack::ACE_Unbounded_Stack (const ACE_Unbounded_Stack &s) - : head_ (0), - cur_size_ (0), - allocator_ (s.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; - - // ACE_TRACE ("ACE_Unbounded_Stack::ACE_Unbounded_Stack"); - this->copy_all_nodes (s); -} - -template void -ACE_Unbounded_Stack::operator= (const ACE_Unbounded_Stack &s) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::operator="); - - if (this != &s) - { - this->delete_all_nodes (); - this->copy_all_nodes (s); - } -} - -template -ACE_Unbounded_Stack::~ACE_Unbounded_Stack (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::~ACE_Unbounded_Stack"); - - this->delete_all_nodes (); - ACE_DES_FREE_TEMPLATE (head_, - this->allocator_->free, - ACE_Node, - ); -} - -template int -ACE_Unbounded_Stack::push (const T &new_item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::push"); - - ACE_Node *temp = 0; - - ACE_NEW_MALLOC_RETURN (temp, - static_cast *> (this->allocator_->malloc (sizeof (ACE_Node))), - ACE_Node (new_item, this->head_->next_), - -1); - this->head_->next_ = temp; - ++this->cur_size_; - return 0; -} - -template int -ACE_Unbounded_Stack::pop (T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::pop"); - - if (this->is_empty ()) - return -1; - else - { - ACE_Node *temp = this->head_->next_; - item = temp->item_; - this->head_->next_ = temp->next_; - - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - --this->cur_size_; - return 0; - } -} - -template int -ACE_Unbounded_Stack::find (const T &item) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::find"); - // Set into the dummy node. - this->head_->item_ = item; - - ACE_Node *temp = this->head_->next_; - - // Keep looping until we find the item. - while (!(temp->item_ == item)) - temp = temp->next_; - - // If we found the dummy node then it's not really there, otherwise, - // it is there. - return temp == this->head_ ? -1 : 0; -} - -template int -ACE_Unbounded_Stack::insert (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::insert"); - - if (this->find (item) == 0) - return 1; - else - return this->push (item); -} - -template int -ACE_Unbounded_Stack::remove (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::remove"); - - // Insert the item to be founded into the dummy node. - this->head_->item_ = item; - - ACE_Node *curr = this->head_; - - while (!(curr->next_->item_ == item)) - curr = curr->next_; - - if (curr->next_ == this->head_) - return -1; // Item was not found. - else - { - ACE_Node *temp = curr->next_; - // Skip over the node that we're deleting. - curr->next_ = temp->next_; - --this->cur_size_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - return 0; - } -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator_Base) - -template -ACE_Double_Linked_List_Iterator_Base::ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List &dll) - : current_ (0), dllist_ (&dll) -{ - // Do nothing -} - -template -ACE_Double_Linked_List_Iterator_Base::ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List_Iterator_Base &iter) - : current_ (iter.current_), - dllist_ (iter.dllist_) -{ - // Do nothing -} - - -template T * -ACE_Double_Linked_List_Iterator_Base::next (void) const -{ - return this->not_done (); -} - -template int -ACE_Double_Linked_List_Iterator_Base::next (T *&ptr) const -{ - ptr = this->not_done (); - return ptr ? 1 : 0; -} - - -template int -ACE_Double_Linked_List_Iterator_Base::done (void) const -{ - return this->not_done () ? 0 : 1; -} - -template T & -ACE_Double_Linked_List_Iterator_Base::operator* (void) const -{ - return *(this->not_done ()); -} - -// @@ Is this a valid retasking? Make sure to check with Purify and -// whatnot that we're not leaking memory or doing any other screwing things. -template void -ACE_Double_Linked_List_Iterator_Base::reset (ACE_Double_Linked_List &dll) -{ - current_ = 0; - dllist_ = &dll; -} - - template int -ACE_Double_Linked_List_Iterator_Base::go_head (void) -{ - this->current_ = static_cast (dllist_->head_->next_); - return this->current_ ? 1 : 0; -} - -template int -ACE_Double_Linked_List_Iterator_Base::go_tail (void) -{ - this->current_ = static_cast (dllist_->head_->prev_); - return this->current_ ? 1 : 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::not_done (void) const -{ - if (this->current_ != this->dllist_->head_) - return this->current_; - else - return 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::do_advance (void) -{ - if (this->not_done ()) - { - this->current_ = static_cast (this->current_->next_); - return this->not_done (); - } - else - return 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::do_retreat (void) -{ - if (this->not_done ()) - { - this->current_ = static_cast (this->current_->prev_); - return this->not_done (); - } - else - return 0; -} - -template void -ACE_Double_Linked_List_Iterator_Base::dump_i (void) const -{ - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("current_ = %x"), this->current_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator) - -template -ACE_Double_Linked_List_Iterator::ACE_Double_Linked_List_Iterator (const ACE_Double_Linked_List &dll) - : ACE_Double_Linked_List_Iterator_Base (dll) -{ - this->current_ = static_cast (dll.head_->next_); - // Advance current_ out of the null area and onto the first item in - // the list -} - -template void -ACE_Double_Linked_List_Iterator::reset (ACE_Double_Linked_List &dll) -{ - this->ACE_Double_Linked_List_Iterator_Base ::reset (dll); - this->current_ = static_cast (dll.head_->next_); - // Advance current_ out of the null area and onto the first item in - // the list -} - -template int -ACE_Double_Linked_List_Iterator::first (void) -{ - return this->go_head (); -} - -template int -ACE_Double_Linked_List_Iterator::advance (void) -{ - return this->do_advance () ? 1 : 0; -} - -template T* -ACE_Double_Linked_List_Iterator::advance_and_remove (bool dont_remove) -{ - T* item = 0; - if (dont_remove) - this->do_advance (); - else - { - item = this->next (); - this->do_advance (); - // It seems dangerous to remove nodes in an iterator, but so it goes... - ACE_Double_Linked_List *dllist = - const_cast *> (this->dllist_); - dllist->remove (item); - } - return item; -} - -template void -ACE_Double_Linked_List_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->dump_i (); -#endif /* ACE_HAS_DUMP */ -} - -// Prefix advance. - -template -ACE_Double_Linked_List_Iterator & -ACE_Double_Linked_List_Iterator::operator++ (void) -{ - this->do_advance (); - return *this; -} - - -// Postfix advance. - -template -ACE_Double_Linked_List_Iterator -ACE_Double_Linked_List_Iterator::operator++ (int) -{ - ACE_Double_Linked_List_Iterator retv (*this); - this->do_advance (); - return retv; -} - - -// Prefix reverse. - -template -ACE_Double_Linked_List_Iterator & -ACE_Double_Linked_List_Iterator::operator-- (void) -{ - this->do_retreat (); - return *this; -} - - -// Postfix reverse. - -template -ACE_Double_Linked_List_Iterator -ACE_Double_Linked_List_Iterator::operator-- (int) -{ - ACE_Double_Linked_List_Iterator retv (*this); - this->do_retreat (); - return retv; -} - - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Reverse_Iterator) - - template -ACE_Double_Linked_List_Reverse_Iterator::ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &dll) - : ACE_Double_Linked_List_Iterator_Base (dll) -{ - this->current_ = static_cast (dll.head_->prev_); - // Advance current_ out of the null area and onto the last item in - // the list -} - -template void -ACE_Double_Linked_List_Reverse_Iterator::reset (ACE_Double_Linked_List &dll) -{ - this->ACE_Double_Linked_List_Iterator_Base ::reset (dll); - this->current_ = static_cast (dll.head_->prev_); - // Advance current_ out of the null area and onto the last item in - // the list -} - -template int -ACE_Double_Linked_List_Reverse_Iterator::first (void) -{ - return this->go_tail (); -} - -template int -ACE_Double_Linked_List_Reverse_Iterator::advance (void) -{ - return this->do_retreat () ? 1 : 0; -} - -template T* -ACE_Double_Linked_List_Reverse_Iterator::advance_and_remove (bool dont_remove) -{ - T* item = 0; - if (dont_remove) - { - this->do_retreat (); - } - else - { - item = this->next (); - this->do_retreat (); - // It seems dangerous to remove nodes in an iterator, but so it goes... - ACE_Double_Linked_List *dllist = - const_cast *> (this->dllist_); - dllist->remove (item); - } - return item; -} - -template void -ACE_Double_Linked_List_Reverse_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->dump_i (); -#endif /* ACE_HAS_DUMP */ -} - -// Prefix advance. - -template -ACE_Double_Linked_List_Reverse_Iterator & -ACE_Double_Linked_List_Reverse_Iterator::operator++ (void) -{ - this->do_retreat (); - return *this; -} - - -// Postfix advance. - -template -ACE_Double_Linked_List_Reverse_Iterator -ACE_Double_Linked_List_Reverse_Iterator::operator++ (int) -{ - ACE_Double_Linked_List_Reverse_Iterator retv (*this); - this->do_retreat (); - return retv; -} - - -// Prefix reverse. - -template -ACE_Double_Linked_List_Reverse_Iterator & -ACE_Double_Linked_List_Reverse_Iterator::operator-- (void) -{ - this->do_advance (); - return *this; -} - - -// Postfix reverse. - -template -ACE_Double_Linked_List_Reverse_Iterator -ACE_Double_Linked_List_Reverse_Iterator::operator-- (int) -{ - ACE_Double_Linked_List_Reverse_Iterator retv (*this); - this->do_advance (); - return retv; -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List) - - template -ACE_Double_Linked_List:: ACE_Double_Linked_List (ACE_Allocator *alloc) - : size_ (0), allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (T *) this->allocator_->malloc (sizeof (T)), - T); - this->init_head (); -} - -template -ACE_Double_Linked_List::ACE_Double_Linked_List (const ACE_Double_Linked_List &cx) - : allocator_ (cx.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (T *) this->allocator_->malloc (sizeof (T)), - T); - this->init_head (); - this->copy_nodes (cx); - this->size_ = cx.size_; -} - -template void -ACE_Double_Linked_List::operator= (const ACE_Double_Linked_List &cx) -{ - if (this != &cx) - { - this->delete_nodes (); - this->copy_nodes (cx); - } -} - -template -ACE_Double_Linked_List::~ACE_Double_Linked_List (void) -{ - this->delete_nodes (); - - ACE_DES_FREE (head_, - this->allocator_->free, - T); - - this->head_ = 0; -} - -template int -ACE_Double_Linked_List::is_empty (void) const -{ - return this->size () ? 0 : 1; -} - -template int -ACE_Double_Linked_List::is_full (void) const -{ - return 0; // We have no bound. -} - -template T * -ACE_Double_Linked_List::insert_tail (T *new_item) -{ - // Insert it before , i.e., at tail. - this->insert_element (new_item, 1); - return new_item; -} - -template T * -ACE_Double_Linked_List::insert_head (T *new_item) -{ - this->insert_element (new_item); // Insert it after , i.e., at head. - return new_item; -} - -template T * -ACE_Double_Linked_List::delete_head (void) -{ - if (this->is_empty ()) - return 0; - - T *temp = static_cast (this->head_->next_); - // Detach it from the list. - this->remove_element (temp); - return temp; -} - -template T * -ACE_Double_Linked_List::delete_tail (void) -{ - if (this->is_empty ()) - return 0; - - T *temp = static_cast (this->head_->prev_); - // Detach it from the list. - this->remove_element (temp); - return temp; -} - -template void -ACE_Double_Linked_List::reset (void) -{ - this->delete_nodes (); -} - -template int -ACE_Double_Linked_List::get (T *&item, size_t slot) -{ - ACE_Double_Linked_List_Iterator iter (*this); - - for (size_t i = 0; - i < slot && !iter.done (); - i++) - iter.advance (); - - item = iter.next (); - return item ? 0 : -1; -} - -template size_t -ACE_Double_Linked_List::size (void) const -{ - return this->size_; -} - -template void -ACE_Double_Linked_List::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // Dump the state of an object. -#endif /* ACE_HAS_DUMP */ -} - -#if 0 -template T * -ACE_Double_Linked_List::find (const T &item) -{ - for (ACE_Double_Linked_List_Iterator iter (*this); - !iter.done (); - iter.advance ()) - { - T *temp = iter.next (); - - if (*temp == item) - return temp; - } - - return 0; -} - -template int -ACE_Double_Linked_List::remove (const T &item) -{ - T *temp = this->find (item); - - if (temp != 0) - return this->remove (temp); - else - return -1; -} -#endif /* 0 */ - -template int -ACE_Double_Linked_List::remove (T *n) -{ - return this->remove_element (n); -} - -template void -ACE_Double_Linked_List::delete_nodes (void) -{ - while (! this->is_empty ()) - { - T * temp = static_cast (this->head_->next_); - this->remove_element (temp); - ACE_DES_FREE (temp, - this->allocator_->free, - T); - } -} - -template void -ACE_Double_Linked_List::copy_nodes (const ACE_Double_Linked_List &c) -{ - for (ACE_Double_Linked_List_Iterator iter (c); - !iter.done (); - iter.advance ()) - { - T* temp = 0; - ACE_NEW_MALLOC (temp, - (T *)this->allocator_->malloc (sizeof (T)), - T (*iter.next ())); - this->insert_tail (temp); - } -} - -template void -ACE_Double_Linked_List::init_head (void) -{ - this->head_->next_ = this->head_; - this->head_->prev_ = this->head_; -} - -template int -ACE_Double_Linked_List::insert_element (T *new_item, - int before, - T *old_item) -{ - if (old_item == 0) - old_item = this->head_; - - if (before) - old_item = static_cast (old_item->prev_); - - new_item->next_ = old_item->next_; - new_item->next_->prev_ = new_item; - new_item->prev_ = old_item; - old_item->next_ = new_item; - ++this->size_; - return 0; // Well, what will cause errors here? -} - -template int -ACE_Double_Linked_List::remove_element (T *item) -{ - // Notice that you have to ensure that item is an element of this - // list. We can't do much checking here. - - if (item == this->head_ || item->next_ == 0 - || item->prev_ == 0 || this->size () == 0) // Can't remove head - return -1; - - item->prev_->next_ = item->next_; - item->next_->prev_ = item->prev_; - item->next_ = item->prev_ = 0; // reset pointers to prevent double removal. - --this->size_; - return 0; -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set) - -template size_t -ACE_Fixed_Set::size (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::size"); - return this->cur_size_; -} - -template void -ACE_Fixed_Set::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Fixed_Set::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Fixed_Set::~ACE_Fixed_Set (void) -{ - ACE_TRACE ("ACE_Fixed_Set::~ACE_Fixed_Set"); - this->cur_size_ = 0; -} - -template -ACE_Fixed_Set::ACE_Fixed_Set (const ACE_Fixed_Set &fs) - : cur_size_ (fs.cur_size_) -{ - ACE_TRACE ("ACE_Fixed_Set::ACE_Fixed_Set"); - - for (size_t i = 0, j = 0; i < fs.max_size_ && j < this->cur_size_; ++i) - if (fs.search_structure_[i].is_free_ == 0) - this->search_structure_[j++] = fs.search_structure_[i]; -} - -template void -ACE_Fixed_Set::operator= (const ACE_Fixed_Set &fs) -{ - ACE_TRACE ("ACE_Fixed_Set::operator="); - - if (this != &fs) - { - this->cur_size_ = fs.cur_size_; - - for (size_t i = 0, j = 0; i < fs.max_size_ && j < this->cur_size_; ++i) - if (fs.search_structure_[i].is_free_ == 0) - this->search_structure_[j++] = fs.search_structure_[i]; - } -} - -template -ACE_Fixed_Set::ACE_Fixed_Set (void) - : cur_size_ (0), - max_size_ (ACE_SIZE) -{ - ACE_TRACE ("ACE_Fixed_Set::ACE_Fixed_Set"); - for (size_t i = 0; i < this->max_size_; i++) - this->search_structure_[i].is_free_ = 1; -} - -template int -ACE_Fixed_Set::find (const T &item) const -{ - ACE_TRACE ("ACE_Fixed_Set::find"); - - for (size_t i = 0, j = 0; i < this->max_size_ && j < this->cur_size_; ++i) - if (this->search_structure_[i].is_free_ == 0) - { - if (this->search_structure_[i].item_ == item) - return 0; - ++j; - } - - return -1; -} - -template int -ACE_Fixed_Set::insert (const T &item) -{ - ACE_TRACE ("ACE_Fixed_Set::insert"); - ssize_t first_free = -1; // Keep track of first free slot. - size_t i; - - for (i = 0; - i < this->max_size_ && first_free == -1; - ++i) - - // First, make sure we don't allow duplicates. - - if (this->search_structure_[i].is_free_ == 0) - { - if (this->search_structure_[i].item_ == item) - return 1; - } - else - first_free = static_cast (i); - - // If we found a free spot let's reuse it. - - if (first_free > -1) - { - this->search_structure_[first_free].item_ = item; - this->search_structure_[first_free].is_free_ = 0; - this->cur_size_++; - return 0; - } - else /* No more room! */ - { - errno = ENOMEM; - return -1; - } -} - -template int -ACE_Fixed_Set::remove (const T &item) -{ - ACE_TRACE ("ACE_Fixed_Set::remove"); - - for (size_t i = 0, j = 0; - i < this->max_size_ && j < this->cur_size_; - ++i) - if (this->search_structure_[i].is_free_ == 0) - { - if (this->search_structure_[i].item_ == item) - { - // Mark this entry as being free. - this->search_structure_[i].is_free_ = 1; - - --this->cur_size_; - return 0; - } - else - ++j; - } - - return -1; -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Iterator_Base) - -template void -ACE_Fixed_Set_Iterator_Base::dump_i (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::dump_i"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Fixed_Set_Iterator_Base::ACE_Fixed_Set_Iterator_Base (ACE_Fixed_Set &s) - : s_ (s), - next_ (-1), - iterated_items_ (0) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::ACE_Fixed_Set_Iterator_Base"); - this->advance (); -} - -template int -ACE_Fixed_Set_Iterator_Base::advance (void) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::advance"); - - if (this->iterated_items_ < this->s_.cur_size_) - { - for (++this->next_; - static_cast (this->next_) < this->s_.max_size_; - ++this->next_) - if (this->s_.search_structure_[this->next_].is_free_ == 0) - { - ++this->iterated_items_; - return 1; - } - } - else - ++this->next_; - - return 0; -} - -template int -ACE_Fixed_Set_Iterator_Base::first (void) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::first"); - - next_ = -1; - iterated_items_ = 0; - return this->advance (); -} - -template int -ACE_Fixed_Set_Iterator_Base::done (void) const -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::done"); - - return ! (this->iterated_items_ < this->s_.cur_size_); -} - -template int -ACE_Fixed_Set_Iterator_Base::next_i (T *&item) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::next_i"); - - if (static_cast (this->next_) < this->s_.max_size_) - do - { - if (this->s_.search_structure_[this->next_].is_free_ == 0) - { - item = &this->s_.search_structure_[this->next_].item_; - this->advance (); - return 1; - } - } - while (this->advance () == 1); - - return 0; -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Iterator) - -template void -ACE_Fixed_Set_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->dump_i (); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Fixed_Set_Iterator::ACE_Fixed_Set_Iterator (ACE_Fixed_Set &s) - : ACE_Fixed_Set_Iterator_Base (s) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::ACE_Fixed_Set_Iterator"); -} - -template int -ACE_Fixed_Set_Iterator::next (T *&item) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::next"); - return this->next_i (item); -} - -template int -ACE_Fixed_Set_Iterator::remove (T *&item) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::remove"); - - if (this->s_.search_structure_[this->next_].is_free_ == 0) - { - item = &this->s_.search_structure_[this->next_].item_; - this->s_.remove (*item); - --(this->iterated_items_); - return 1; - } - - return 0; -} - -template T& -ACE_Fixed_Set_Iterator::operator* (void) -{ - T *retv = 0; - - if (this->s_.search_structure_[this->next_].is_free_ == 0) - retv = &this->s_.search_structure_[this->next_].item_; - - ACE_ASSERT (retv != 0); - - return *retv; -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Const_Iterator) - -template void -ACE_Fixed_Set_Const_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - this->dump_i (); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Fixed_Set_Const_Iterator::ACE_Fixed_Set_Const_Iterator (const ACE_Fixed_Set &s) - : ACE_Fixed_Set_Iterator_Base (s) -{ - ACE_TRACE ("ACE_Fixed_Set_Const_Iterator::ACE_Fixed_Set_Const_Iterator"); -} - -template int -ACE_Fixed_Set_Const_Iterator::next (const T *&item) -{ - ACE_TRACE ("ACE_Fixed_Set_Const_Iterator::next"); - - return this->next_i (item); -} - -template const T& -ACE_Fixed_Set_Const_Iterator::operator* (void) const -{ - const T *retv = 0; - - if (this->s_.search_structure_[this->next_].is_free_ == 0) - retv = &this->s_.search_structure_[this->next_].item_; - - ACE_ASSERT (retv != 0); - - return *retv; -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set) - -template void -ACE_Bounded_Set::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Bounded_Set::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Bounded_Set::~ACE_Bounded_Set (void) -{ - ACE_TRACE ("ACE_Bounded_Set::~ACE_Bounded_Set"); - delete [] this->search_structure_; -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (void) - : cur_size_ (0), - max_size_ (static_cast (ACE_Bounded_Set::DEFAULT_SIZE)) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - - ACE_NEW (this->search_structure_, - typename ACE_Bounded_Set::Search_Structure[this->max_size_]); - - for (size_t i = 0; i < this->max_size_; ++i) - this->search_structure_[i].is_free_ = 1; -} - -template size_t -ACE_Bounded_Set::size (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::size"); - return this->cur_size_; -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (const ACE_Bounded_Set &bs) - : cur_size_ (bs.cur_size_), - max_size_ (bs.max_size_) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - - ACE_NEW (this->search_structure_, - typename ACE_Bounded_Set::Search_Structure[this->max_size_]); - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = bs.search_structure_[i]; -} - -template void -ACE_Bounded_Set::operator= (const ACE_Bounded_Set &bs) -{ - ACE_TRACE ("ACE_Bounded_Set::operator="); - - if (this != &bs) - { - if (this->max_size_ < bs.cur_size_) - { - delete [] this->search_structure_; - ACE_NEW (this->search_structure_, - typename ACE_Bounded_Set::Search_Structure[bs.cur_size_]); - this->max_size_ = bs.cur_size_; - } - - this->cur_size_ = bs.cur_size_; - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = bs.search_structure_[i]; - } -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (size_t size) - : cur_size_ (0), - max_size_ (size) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - ACE_NEW (this->search_structure_, - typename ACE_Bounded_Set::Search_Structure[size]); - - for (size_t i = 0; i < this->max_size_; i++) - this->search_structure_[i].is_free_ = 1; -} - -template int -ACE_Bounded_Set::find (const T &item) const -{ - ACE_TRACE ("ACE_Bounded_Set::find"); - - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 0; - - return -1; -} - -template int -ACE_Bounded_Set::insert (const T &item) -{ - ACE_TRACE ("ACE_Bounded_Set::insert"); - int first_free = -1; // Keep track of first free slot. - size_t i; - - for (i = 0; i < this->cur_size_; i++) - // First, make sure we don't allow duplicates. - - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 1; - else if (this->search_structure_[i].is_free_ && first_free == -1) - first_free = static_cast (i); - - if (first_free > -1) // If we found a free spot let's reuse it. - { - this->search_structure_[first_free].item_ = item; - this->search_structure_[first_free].is_free_ = 0; - return 0; - } - else if (i < this->max_size_) // Insert at the end of the active portion. - { - this->search_structure_[i].item_ = item; - this->search_structure_[i].is_free_ = 0; - this->cur_size_++; - return 0; - } - else /* No more room! */ - { - errno = ENOMEM; - return -1; - } -} - -template int -ACE_Bounded_Set::remove (const T &item) -{ - ACE_TRACE ("ACE_Bounded_Set::remove"); - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item) - { - // Mark this entry as being free. - this->search_structure_[i].is_free_ = 1; - - // If we just unbound the highest entry, then we need to - // figure out where the next highest active entry is. - if (i + 1 == this->cur_size_) - { - while (i > 0 && this->search_structure_[--i].is_free_) - continue; - - if (i == 0 && this->search_structure_[i].is_free_) - this->cur_size_ = 0; - else - this->cur_size_ = i + 1; - } - return 0; - } - - return -1; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set_Iterator) - - template void -ACE_Bounded_Set_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Bounded_Set_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Bounded_Set_Iterator::ACE_Bounded_Set_Iterator (ACE_Bounded_Set &s) - : s_ (s), - next_ (-1) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::ACE_Bounded_Set_Iterator"); - this->advance (); -} - -template int -ACE_Bounded_Set_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::advance"); - - for (++this->next_; - static_cast (this->next_) < this->s_.cur_size_ - && this->s_.search_structure_[this->next_].is_free_; - ++this->next_) - continue; - - return static_cast (this->next_) < this->s_.cur_size_; -} - -template int -ACE_Bounded_Set_Iterator::first (void) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::first"); - - next_ = -1; - return this->advance (); -} - -template int -ACE_Bounded_Set_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::done"); - - return static_cast (this->next_) >= - this->s_.cur_size_; -} - -template int -ACE_Bounded_Set_Iterator::next (T *&item) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::next"); - if (static_cast (this->next_) < this->s_.cur_size_) - { - item = &this->s_.search_structure_[this->next_].item_; - return 1; - } - else - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_DNode) - - template -ACE_DNode::ACE_DNode (const T &i, ACE_DNode *n, ACE_DNode *p) - : next_ (n), prev_ (p), item_ (i) -{ -} - -template -ACE_DNode::~ACE_DNode (void) -{ -} - -// **************************************************************** - -template void -ACE_Unbounded_Stack_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Unbounded_Stack_Iterator::ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack &q) - : current_ (q.head_->next_), - stack_ (q) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::ACE_Unbounded_Stack_Iterator"); -} - -template int -ACE_Unbounded_Stack_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::advance"); - this->current_ = this->current_->next_; - return this->current_ != this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::first"); - this->current_ = this->stack_.head_->next_; - return this->current_ != this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Stack_Iterator::done"); - - return this->current_ == this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::next"); - if (this->current_ == this->stack_.head_) - return 0; - else - { - item = &this->current_->item_; - return 1; - } -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet) - - - template -ACE_Ordered_MultiSet::ACE_Ordered_MultiSet (ACE_Allocator *alloc) - : head_ (0) - , tail_ (0) - , cur_size_ (0) - , allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::ACE_Ordered_MultiSet"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); -} - -template -ACE_Ordered_MultiSet::ACE_Ordered_MultiSet (const ACE_Ordered_MultiSet &us) - : head_ (0) - , tail_ (0) - , cur_size_ (0) - , allocator_ (us.allocator_) -{ - ACE_TRACE ("ACE_Ordered_MultiSet::ACE_Ordered_MultiSet"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->copy_nodes (us); -} - -template -ACE_Ordered_MultiSet::~ACE_Ordered_MultiSet (void) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::~ACE_Ordered_MultiSet"); - - this->delete_nodes (); -} - - -template void -ACE_Ordered_MultiSet::operator= (const ACE_Ordered_MultiSet &us) -{ - ACE_TRACE ("ACE_Ordered_MultiSet::operator="); - - if (this != &us) - { - this->delete_nodes (); - this->copy_nodes (us); - } -} - - -template int -ACE_Ordered_MultiSet::insert (const T &item) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::insert"); - - return this->insert_from (item, this->head_, 0); -} - -template int -ACE_Ordered_MultiSet::insert (const T &new_item, - ITERATOR &iter) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::insert using iterator"); - - return this->insert_from (new_item, iter.current_, &iter.current_); -} - -template int -ACE_Ordered_MultiSet::remove (const T &item) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::remove"); - - ACE_DNode *node = 0; - - int result = locate (item, 0, node); - - // if we found the node, remove from list and free it - if (node && (result == 0)) - { - if (node->prev_) - node->prev_->next_ = node->next_; - else - head_ = node->next_; - - if (node->next_) - node->next_->prev_ = node->prev_; - else - tail_ = node->prev_; - - --this->cur_size_; - - ACE_DES_FREE_TEMPLATE (node, - this->allocator_->free, - ACE_DNode, - ); - return 0; - } - - return -1; -} - -template int -ACE_Ordered_MultiSet::find (const T &item, - ITERATOR &iter) const -{ - // search an occurance of item, using iterator's current position as a hint - ACE_DNode *node = iter.current_; - int const result = locate (item, node, node); - - // if we found the node, update the iterator and indicate success - if (node && (result == 0)) - { - iter.current_ = node; - return 0; - } - - return -1; -} - - - -template void -ACE_Ordered_MultiSet::reset (void) -{ - ACE_TRACE ("reset"); - - this->delete_nodes (); -} - -template void -ACE_Ordered_MultiSet::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Ordered_MultiSet::dump"); - // - // ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_ = %u"), this->head_)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_->next_ = %u"), this->head_->next_)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d\n"), this->cur_size_)); - // - // T *item = 0; - // size_t count = 1; - // - // for (ACE_Ordered_MultiSet_Iterator iter (*(ACE_Ordered_MultiSet *) this); - // iter.next (item) != 0; - // iter.advance ()) - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %d\n"), count++)); - // - // ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template int -ACE_Ordered_MultiSet::insert_from (const T &item, ACE_DNode *position, - ACE_DNode **new_position) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::insert_from"); - - // create a new node - ACE_DNode *temp = 0; - ACE_NEW_MALLOC_RETURN (temp, - static_cast*> (this->allocator_->malloc (sizeof (ACE_DNode))), - ACE_DNode (item), - -1); - // obtain approximate location of the node - int result = locate (item, position, position); - - // if there are nodes in the multiset - if (position) - { - switch (result) - { - // insert after the approximate position - case -1: - - // if there is a following node - if (position->next_) - { - // link up with the following node - position->next_->prev_ = temp; - temp->next_ = position->next_; - } - else - // appending to the end of the set - tail_ = temp; - - // link up with the preceeding node - temp->prev_ = position; - position->next_ = temp; - - break; - - // insert before the position - case 0: - case 1: - - // if there is a preceeding node - if (position->prev_) - { - // link up with the preceeding node - position->prev_->next_ = temp; - temp->prev_ = position->prev_; - } - else - // prepending to the start of the set - head_ = temp; - - // link up with the preceeding node - temp->next_ = position; - position->prev_ = temp; - - break; - - default: - return -1; - } - } - else - { - // point the head and tail to the new node. - this->head_ = temp; - this->tail_ = temp; - } - - ++this->cur_size_; - if (new_position) - *new_position = temp; - - return 0; -} - -template int -ACE_Ordered_MultiSet::locate (const T &item, ACE_DNode *start_position, - ACE_DNode *&new_position) const -{ - if (! start_position) - start_position = this->head_; - - // If starting before the item, move forward until at or just before - // item. - while (start_position && start_position->item_ < item && - start_position->next_) - start_position = start_position->next_; - - // If starting after the item, move back until at or just after item - while (start_position && item < start_position->item_ && - start_position->prev_) - start_position = start_position->prev_; - - // Save the (approximate) location in the passed pointer. - new_position = start_position; - - // Show the location is after (1), before (-1) , or at (0) the item - if (!new_position) - return 1; - else if (item < new_position->item_) - return 1; - else if (new_position->item_ < item) - return -1; - else - return 0; -} - -// Looks for first occurance of in the ordered set, using the -// passed starting position as a hint: if there is such an instance, -// it updates the new_position pointer to point to one such node and -// returns 0; if there is no such node, then if there is a node before -// where the item would have been, it updates the new_position pointer -// to point to this node and returns -1; if there is no such node, -// then if there is a node after where the item would have been, it -// updates the new_position pointer to point to this node (or 0 if -// there is no such node) and returns 1; - -template void -ACE_Ordered_MultiSet::copy_nodes (const ACE_Ordered_MultiSet &us) -{ - ACE_DNode *insertion_point = this->head_; - - for (ACE_DNode *curr = us.head_; - curr != 0; - curr = curr->next_) - this->insert_from (curr->item_, insertion_point, &insertion_point); -} - -template void -ACE_Ordered_MultiSet::delete_nodes (void) -{ - // iterate through list, deleting nodes - for (ACE_DNode *curr = this->head_; - curr != 0; - ) - { - ACE_DNode *temp = curr; - curr = curr->next_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_DNode, - ); - } - - this->head_ = 0; - this->tail_ = 0; - this->cur_size_ = 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet_Iterator) - -template -ACE_Ordered_MultiSet_Iterator::ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s) - : current_ (s.head_), - set_ (s) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::ACE_Ordered_MultiSet_Iterator"); -} - -template int -ACE_Ordered_MultiSet_Iterator::next (T *&item) const -{ - // ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::next"); - if (this->current_) - { - item = &this->current_->item_; - return 1; - } - - return 0; -} - -template T& -ACE_Ordered_MultiSet_Iterator::operator* (void) -{ - //ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::operator*"); - T *retv = 0; - - int const result = this->next (retv); - ACE_ASSERT (result != 0); - ACE_UNUSED_ARG (result); - - return *retv; -} - -ACE_ALLOC_HOOK_DEFINE (ACE_DLList_Node) - -template T * -ACE_DLList::insert_tail (T *new_item) -{ - ACE_DLList_Node *temp1 = 0; - ACE_NEW_MALLOC_RETURN (temp1, - static_cast (this->allocator_->malloc (sizeof (ACE_DLList_Node))), - ACE_DLList_Node (new_item), - 0); - ACE_DLList_Node *temp2 = ACE_DLList_Base::insert_tail (temp1); - return (T *) (temp2 ? temp2->item_ : 0); -} - -template T * -ACE_DLList::insert_head (T *new_item) -{ - ACE_DLList_Node *temp1 = 0; - ACE_NEW_MALLOC_RETURN (temp1, - (ACE_DLList_Node *) this->allocator_->malloc (sizeof (ACE_DLList_Node)), - ACE_DLList_Node (new_item), 0); - ACE_DLList_Node *temp2 = ACE_DLList_Base::insert_head (temp1); - return (T *) (temp2 ? temp2->item_ : 0); -} - -template T * -ACE_DLList::delete_head (void) -{ - ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_head (); - T *temp2 = (T *) (temp1 ? temp1->item_ : 0); - ACE_DES_FREE (temp1, - this->allocator_->free, - ACE_DLList_Node); - - return temp2; -} - -template T * -ACE_DLList::delete_tail (void) -{ - ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_tail (); - T *temp2 = (T *) (temp1 ? temp1->item_ : 0); - ACE_DES_FREE (temp1, - this->allocator_->free, - ACE_DLList_Node); - return temp2; -} - -// **************************************************************** - -// Compare this array with for equality. - -template bool -ACE_Array::operator== (const ACE_Array &s) const -{ - if (this == &s) - return true; - else if (this->size () != s.size ()) - return false; - - const size_t len = s.size (); - for (size_t slot = 0; slot < len; ++slot) - if ((*this)[slot] != s[slot]) - return false; - - return true; -} - -// **************************************************************** - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_CONTAINERS_T_CPP */ - diff --git a/dep/src/ace/Copy_Disabled.cpp b/dep/src/ace/Copy_Disabled.cpp deleted file mode 100644 index 8fa35ddb02f..00000000000 --- a/dep/src/ace/Copy_Disabled.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file Copy_Disabled.cpp - * - * $Id: Copy_Disabled.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Carlos O'Ryan - */ - -#include "ace/Copy_Disabled.h" - -ACE_RCSID (ace, - Copy_Disabled, - "$Id: Copy_Disabled.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Copy_Disabled::ACE_Copy_Disabled (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Countdown_Time.cpp b/dep/src/ace/Countdown_Time.cpp deleted file mode 100644 index 3b3eede4364..00000000000 --- a/dep/src/ace/Countdown_Time.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "ace/Countdown_Time.h" -#include "ace/OS_NS_sys_time.h" - -ACE_RCSID (ace, - Countdown_Time, - "$Id: Countdown_Time.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time) - : max_wait_time_ (max_wait_time), - stopped_ (false) -{ - this->start (); -} - -ACE_Countdown_Time::~ACE_Countdown_Time (void) -{ - this->stop (); -} - -void -ACE_Countdown_Time::start (void) -{ - if (this->max_wait_time_ != 0) - { - this->start_time_ = ACE_OS::gettimeofday (); - this->stopped_ = false; - } -} - -bool -ACE_Countdown_Time::stopped (void) const -{ - return stopped_; -} - -void -ACE_Countdown_Time::stop (void) -{ - if (this->max_wait_time_ != 0 && this->stopped_ == false) - { - ACE_Time_Value elapsed_time = ACE_OS::gettimeofday () - this->start_time_; - - if (*this->max_wait_time_ > elapsed_time) - { - *this->max_wait_time_ -= elapsed_time; - } - else - { - // Used all of timeout. - *this->max_wait_time_ = ACE_Time_Value::zero; - // errno = ETIME; - } - this->stopped_ = true; - } -} - -void -ACE_Countdown_Time::update (void) -{ - this->stop (); - this->start (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DEV.cpp b/dep/src/ace/DEV.cpp deleted file mode 100644 index 7b4fb00f2b2..00000000000 --- a/dep/src/ace/DEV.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id: DEV.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DEV.h" - -#include "ace/OS_NS_unistd.h" - -#if !defined (__ACE_INLINE__) -#include "ace/DEV.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, DEV, "$Id: DEV.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV) - -void -ACE_DEV::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_DEV::dump"); -#endif /* ACE_HAS_DUMP */ -} - -// This is the do-nothing constructor. - -ACE_DEV::ACE_DEV (void) -{ - ACE_TRACE ("ACE_DEV::ACE_DEV"); -} - -// Close the device - -int -ACE_DEV::close (void) -{ - ACE_TRACE ("ACE_DEV::close"); - int result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DEV_Addr.cpp b/dep/src/ace/DEV_Addr.cpp deleted file mode 100644 index 73abb6568aa..00000000000 --- a/dep/src/ace/DEV_Addr.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// $Id: DEV_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DEV_Addr.h" -#if !defined (__ACE_INLINE__) -#include "ace/DEV_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (ace, - DEV_Addr, - "$Id: DEV_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Addr) - -// Transform the current address into string format. - -int -ACE_DEV_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const -{ - ACE_TRACE ("ACE_DEV_Addr::addr_to_string"); - - ACE_OS::strsncpy (s, this->devname_, len); - return 0; -} - -// Return a pointer to the address. - -void * -ACE_DEV_Addr::get_addr (void) const -{ - ACE_TRACE ("ACE_DEV_Addr::get_addr"); - - return (void *) &this->devname_; -} - -void -ACE_DEV_Addr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_DEV_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("devname_ = %s"), this->devname_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Do nothing constructor. - -ACE_DEV_Addr::ACE_DEV_Addr (void) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - (void) ACE_OS::memset ((void *) &this->devname_, - 0, sizeof this->devname_); -} - -int -ACE_DEV_Addr::set (const ACE_DEV_Addr &sa) -{ - this->base_set (sa.get_type (), sa.get_size ()); - - if (sa.get_type () == AF_ANY) - (void) ACE_OS::memset ((void *) &this->devname_, - 0, - sizeof this->devname_); - else - (void) ACE_OS::strsncpy (this->devname_, - sa.devname_, - ACE_DEV_Addr::DEVNAME_LENGTH); - return 0; -} - -// Copy constructor. - -ACE_DEV_Addr::ACE_DEV_Addr (const ACE_DEV_Addr &sa) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - this->set (sa); -} - -ACE_DEV_Addr::ACE_DEV_Addr (const ACE_TCHAR *devname) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - this->set (devname); -} - -ACE_DEV_Addr & -ACE_DEV_Addr::operator= (const ACE_DEV_Addr &sa) -{ - ACE_TRACE ("ACE_DEV_Addr::operator="); - - if (this != &sa) - this->set (sa); - - return *this; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DEV_Connector.cpp b/dep/src/ace/DEV_Connector.cpp deleted file mode 100644 index 9f4c985b1d4..00000000000 --- a/dep/src/ace/DEV_Connector.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id: DEV_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DEV_Connector.h" - -#include "ace/Handle_Ops.h" - -#if !defined (__ACE_INLINE__) -#include "ace/DEV_Connector.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - DEV_Connector, - "$Id: DEV_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Connector) - -void -ACE_DEV_Connector::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_DEV_Connector::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_DEV_Connector::ACE_DEV_Connector (void) -{ - ACE_TRACE ("ACE_DEV_Connector::ACE_DEV_Connector"); -} - -int -ACE_DEV_Connector::connect (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) -{ - ACE_TRACE ("ACE_DEV_Connector::connect"); - - ACE_HANDLE handle = ACE::handle_timed_open (timeout, - remote_sap.get_path_name (), - flags, perms); - new_io.set_handle (handle); - new_io.addr_ = remote_sap; // class copy. - return handle == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DEV_IO.cpp b/dep/src/ace/DEV_IO.cpp deleted file mode 100644 index 82dd891b661..00000000000 --- a/dep/src/ace/DEV_IO.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// $Id: DEV_IO.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DEV_IO.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/DEV_IO.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, DEV_IO, "$Id: DEV_IO.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_IO) - -// Return the local endpoint address. - -int -ACE_DEV_IO::get_local_addr (ACE_DEV_Addr &addr) const -{ - ACE_TRACE ("ACE_DEV_IO::get_local_addr"); - - addr = this->addr_; - return 0; -} - -// Return the address of the remotely connected peer (if there is -// one). - -int -ACE_DEV_IO::get_remote_addr (ACE_DEV_Addr &addr) const -{ - ACE_TRACE ("ACE_DEV_IO::get_remote_addr"); - addr = this->addr_; - return 0; -} - -void -ACE_DEV_IO::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_DEV_IO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Simple-minded do nothing constructor. - -ACE_DEV_IO::ACE_DEV_IO (void) -{ - ACE_TRACE ("ACE_DEV_IO::ACE_DEV_IO"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_DEV_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - va_list argp; - int total_tuples = static_cast (n / 2); - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use the -// struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_DEV_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - va_list argp; - int total_tuples = static_cast (n / 2); - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DLL.cpp b/dep/src/ace/DLL.cpp deleted file mode 100644 index 7ed04b942c8..00000000000 --- a/dep/src/ace/DLL.cpp +++ /dev/null @@ -1,267 +0,0 @@ -// $Id: DLL.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DLL.h" - -#include "ace/Log_Msg.h" -#include "ace/ACE.h" -#include "ace/DLL_Manager.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_dlfcn.h" -#include "ace/OS_NS_Thread.h" - -#include - -ACE_RCSID(ace, DLL, "$Id: DLL.cpp 80826 2008-03-04 14:51:23Z wotte $") - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Default constructor. Also, by default, the object will be closed -// before it is destroyed. - -ACE_DLL::ACE_DLL (bool close_handle_on_destruction) - : open_mode_ (0), - dll_name_ (0), - close_handle_on_destruction_ (close_handle_on_destruction), - dll_handle_ (0), - error_ (0) -{ - ACE_TRACE ("ACE_DLL::ACE_DLL (int)"); -} - -ACE_DLL::ACE_DLL (const ACE_DLL &rhs) - : open_mode_ (0), - dll_name_ (0), - close_handle_on_destruction_ (false), - dll_handle_ (0), - error_ (0) -{ - ACE_TRACE ("ACE_DLL::ACE_DLL (const ACE_DLL &)"); - - if (rhs.dll_name_ - // This will automatically up the refcount. - && this->open (rhs.dll_name_, - rhs.open_mode_, - rhs.close_handle_on_destruction_) != 0 - && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL::copy_ctor: error: %s\n"), - this->error ())); -} - -// Assignment operator - -ACE_DLL & -ACE_DLL::operator= (const ACE_DLL &rhs) -{ - ACE_TRACE ("ACE_DLL::operator= (const ACE_DLL &)"); - - ACE_DLL tmp (rhs); - - std::swap (this->open_mode_, tmp.open_mode_); - std::swap (this->dll_name_, tmp.dll_name_); - std::swap (this->close_handle_on_destruction_, - tmp.close_handle_on_destruction_); - std::swap (this->dll_handle_, tmp.dll_handle_); - std::swap (this->error_, tmp.error_); - - return *this; -} - -// If the library name and the opening mode are specified than on -// object creation the library is implicitly opened. - -ACE_DLL::ACE_DLL (const ACE_TCHAR *dll_name, - int open_mode, - bool close_handle_on_destruction) - : open_mode_ (open_mode), - dll_name_ (0), - close_handle_on_destruction_ (close_handle_on_destruction), - dll_handle_ (0), - error_ (0) -{ - ACE_TRACE ("ACE_DLL::ACE_DLL"); - - if (this->open (dll_name, this->open_mode_, close_handle_on_destruction) != 0 - && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL::open: error calling open: %s\n"), - this->error ())); -} - -// The library is closed before the class gets destroyed depending on -// the close_handle_on_destruction value specified which is stored in -// close_handle_on_destruction_. - -ACE_DLL::~ACE_DLL (void) -{ - ACE_TRACE ("ACE_DLL::~ACE_DLL"); - - this->close (); - - // Normally delete()d in ACE_DLL::close(). However, that may not - // occur if full ACE_DLL initialization is interrupted due to errors - // (e.g. attempting to open a DSO/DLL that does not exist). Make - // sure this->dll_name_ is deallocated. - delete [] this->dll_name_; -} - -// This method opens the library based on the mode specified using the -// ACE_SHLIB_HANDLE which is obtained on making the ACE_OS::dlopen call. -// The default mode is: -// RTLD_LAZY Only references to data symbols are relocate when the -// object is first loaded. -// The other modes include: -// RTLD_NOW All necessary relocations are performed when the -// object is first loaded. -// RTLD_GLOBAL The object symbols are made available for the -// relocation processing of any other object. - -int -ACE_DLL::open (const ACE_TCHAR *dll_filename, - int open_mode, - bool close_handle_on_destruction) -{ - ACE_TRACE ("ACE_DLL::open"); - - return open_i (dll_filename, open_mode, close_handle_on_destruction); -} - -int -ACE_DLL::open_i (const ACE_TCHAR *dll_filename, - int open_mode, - bool close_handle_on_destruction, - ACE_SHLIB_HANDLE handle) -{ - ACE_TRACE ("ACE_DLL::open_i"); - - this->error_ = 0; - - if (!dll_filename) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL::open_i: dll_name is %s\n"), - this->dll_name_ == 0 ? ACE_TEXT ("(null)") - : this->dll_name_)); - return -1; - } - - if (this->dll_handle_) - { - // If we have a good handle and its the same name, just return. - if (ACE_OS::strcmp (this->dll_name_, dll_filename) == 0) - return 0; - else - this->close (); - } - - if (!this->dll_name_) - this->dll_name_ = ACE::strnew (dll_filename); - - this->open_mode_ = open_mode; - this->close_handle_on_destruction_ = close_handle_on_destruction; - - this->dll_handle_ = ACE_DLL_Manager::instance()->open_dll (this->dll_name_, - this->open_mode_, - handle); - - if (!this->dll_handle_) - this->error_ = 1; - - return this->error_ ? -1 : 0; -} - -// The symbol refernce of the name specified is obtained. - -void * -ACE_DLL::symbol (const ACE_TCHAR *sym_name, int ignore_errors) -{ - ACE_TRACE ("ACE_DLL::symbol"); - - this->error_ = 0; - - void *sym = 0; - if (this->dll_handle_) - sym = this->dll_handle_->symbol (sym_name, ignore_errors); - - if (!sym) - this->error_ = 1; - - return sym; -} - -// The library is closed using the ACE_SHLIB_HANDLE object, i.e., the -// shared object is now disassociated form the current process. - -int -ACE_DLL::close (void) -{ - ACE_TRACE ("ACE_DLL::close"); - - int retval = 0; - - if (this->dll_handle_ - && this->close_handle_on_destruction_ - && this->dll_name_ - && (retval = ACE_DLL_Manager::instance ()->close_dll (this->dll_name_)) != 0) - this->error_ = 1; - - // Even if close_dll() failed, go ahead and cleanup. - this->dll_handle_ = 0; - delete [] this->dll_name_; - this->dll_name_ = 0; - this->close_handle_on_destruction_ = false; - - return retval; -} - -// This method is used return the last error of a library operation. - -ACE_TCHAR * -ACE_DLL::error (void) const -{ - ACE_TRACE ("ACE_DLL::error"); - if (this->error_) - { - return ACE_OS::dlerror (); - } - - return 0; -} - -// Return the handle to the user either temporarily or forever, thus -// orphaning it. If 0 means the user wants the handle forever and if 1 -// means the user temporarily wants to take the handle. - -ACE_SHLIB_HANDLE -ACE_DLL::get_handle (int become_owner) const -{ - ACE_TRACE ("ACE_DLL::get_handle"); - - ACE_SHLIB_HANDLE handle = ACE_SHLIB_INVALID_HANDLE; - - if (this->dll_handle_) - handle = this->dll_handle_->get_handle (become_owner); - - return handle; -} - -// Set the handle for the DLL. By default, the object will be closed -// before it is destroyed. - -int -ACE_DLL::set_handle (ACE_SHLIB_HANDLE handle, - bool close_handle_on_destruction) -{ - ACE_TRACE ("ACE_DLL::set_handle"); - - // Create a unique name. Note that this name is only quaranteed - // to be unique for the life of this object. - ACE_TCHAR temp[ACE_UNIQUE_NAME_LEN]; - ACE_OS::unique_name (this, temp, ACE_UNIQUE_NAME_LEN); - - return this->open_i (temp, 1, close_handle_on_destruction, handle); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/DLL_Manager.cpp b/dep/src/ace/DLL_Manager.cpp deleted file mode 100644 index 997c4e13471..00000000000 --- a/dep/src/ace/DLL_Manager.cpp +++ /dev/null @@ -1,786 +0,0 @@ -// $Id: DLL_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/DLL_Manager.h" - -#include "ace/Log_Msg.h" -#include "ace/ACE.h" -#include "ace/Framework_Component.h" - -#include "ace/Lib_Find.h" -#include "ace/Object_Manager.h" -#include "ace/SString.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Guard_T.h" -#include "ace/OS_NS_dlfcn.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (ace, - DLL_Manager, - "DLL_Manager.cpp,v 4.23 2003/11/05 23:30:46 shuston Exp") - -/******************************************************************/ - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -sig_atomic_t ACE_DLL_Handle::open_called_ = 0; - -ACE_DLL_Handle::ACE_DLL_Handle (void) - : refcount_ (0), - dll_name_ (0), - handle_ (ACE_SHLIB_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_DLL_Handle::ACE_DLL_Handle"); -} - -ACE_DLL_Handle::~ACE_DLL_Handle (void) -{ - ACE_TRACE ("ACE_DLL_Handle::~ACE_DLL_Handle"); - this->close (1); - delete[] this->dll_name_; -} - -const ACE_TCHAR * -ACE_DLL_Handle::dll_name (void) const -{ - ACE_TRACE ("ACE_DLL_Handle::dll_name"); - return this->dll_name_; -} - -int -ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, - int open_mode, - ACE_SHLIB_HANDLE handle) -{ - ACE_TRACE ("ACE_DLL_Handle::open"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - if (this->dll_name_) - { - // Once dll_name_ has been set, it can't be changed.. - if (ACE_OS::strcmp (this->dll_name_, dll_name) != 0) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) DLL_Handle::open: error, ") - ACE_TEXT ("tried to reopen %s with name %s\n"), - this->dll_name_, - dll_name)); - - return -1; - } - } - else - this->dll_name_ = ACE::strnew (dll_name); - - if (!this->open_called_) - this->open_called_ = 1; - - // If it hasn't been loaded yet, go ahead and do that now. - if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) - { - if (handle) - this->handle_ = handle; - else - { - /* - ** Get the set of names to try loading. We need to do this to - ** properly support the ability for a user to specify a simple, - ** unadorned name (for example, "ACE") that will work across - ** platforms. We apply platform specifics to get a name that will - ** work (e.g. libACE, ACEd.dll, ACE.dll, etc.) We rely on the - ** underlying dlopen() implementation to "Do The Right Thing" in - ** terms of using relative paths, LD_LIBRARY_PATH, system security - ** rules, etc. except when ACE_MUST_HELP_DLOPEN_SEARCH_PATH is set. - ** If it is set, then ACE::ldfind() scans the configured path - ** looking for a match on the name and prefix/suffix applications. - ** NOTE: having ACE scan for a file and then pass a fully-qualified - ** pathname to dlopen() is a potential security hole; therefore, - ** do not use ACE_MUST_HELP_DLOPEN_SEARCH_PATH unless necessary - ** and only after considering the risks. - */ - ACE_Array dll_names; - dll_names.max_size (10); // Decent guess to avoid realloc later - -#if defined (ACE_MUST_HELP_DLOPEN_SEARCH_PATH) - // Find out where the library is - ACE_TCHAR dll_pathname[MAXPATHLEN + 1]; - - // Transform the pathname into the appropriate dynamic link library - // by searching the ACE_LD_SEARCH_PATH. - ACE::ldfind (dll_name, - dll_pathname, - (sizeof dll_pathname / sizeof (ACE_TCHAR))); - ACE_TString dll_str (dll_pathname); - dll_names.size (1); - dll_names.set (dll_str, 0); -#else - this->get_dll_names (dll_name, dll_names); -#endif - - ACE_Array_Iterator name_iter (dll_names); - ACE_TString *name = 0; - while (name_iter.next (name)) - { - // The ACE_SHLIB_HANDLE object is obtained. - this->handle_ = ACE_OS::dlopen (name->c_str (), - open_mode); - - if (ACE::debug ()) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"), - name->c_str (), - open_mode, - ((this->handle_ != ACE_SHLIB_INVALID_HANDLE) - ? ACE_TEXT ("succeeded") - : ACE_TEXT ("failed")), - this->error()->c_str())); - } - - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) // Good one? - break; - - // If errno is ENOENT we just skip over this one, - // anything else - like an undefined symbol, for - // instance must be flagged here or the next error will - // mask it. - // @TODO: If we've found our DLL _and_ it's - // broken, should we continue at all? - if ((errno != 0) && (errno != ENOENT) && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\'%s\') failed, errno=") - ACE_TEXT ("%d: %s\n"), - name->c_str (), - errno, - this->error ()->c_str ())); - -#if defined (AIX) - // AIX often puts the shared library file (most often named - // shr.o) inside an archive library. If this is an archive - // library name, then try appending [shr.o] and retry. - if (ACE_TString::npos != name->strstr (ACE_TEXT (".a"))) - { - ACE_TCHAR aix_pathname[MAXPATHLEN + 1]; - ACE_OS::strncpy (aix_pathname, - name->c_str (), - name->length ()); - aix_pathname[name->length ()] = '\0'; - ACE_OS::strcat (aix_pathname, ACE_TEXT ("(shr.o)")); - open_mode |= RTLD_MEMBER; - - if (ACE::debug ()) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"), - aix_pathname, - open_mode, - ACE_TEXT ((this->handle_ != ACE_SHLIB_INVALID_HANDLE) - ? "succeeded" - : "failed"), - this->error()->c_str())); - } - - this->handle_ = ACE_OS::dlopen (aix_pathname, open_mode); - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) - break; - - // If errno is ENOENT we just skip over this one, anything - // else - like an undefined symbol, for instance - // must be flagged here or the next error will mask it. - // - // @TODO: If we've found our DLL _and_ it's broken, - // should we continue at all? - if (ACE::debug () && (errno != 0) && (errno != ENOENT)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") - ACE_TEXT ("(\'%s\') failed, errno=") - ACE_TEXT ("%d: %s\n"), - name->c_str (), - errno, - this->error ()->c_str ())); - - } -#endif /* AIX */ - - name_iter.advance (); - } - - if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open (\"%s\"): ") - ACE_TEXT ("Invalid handle error: %s\n"), - this->dll_name_, - this->error ()->c_str ())); - - return -1; - } - } - } - - ++this->refcount_; - - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::open - %s (%d), refcount=%d\n"), - this->dll_name_, - this->handle_, - this->refcount_)); - return 0; -} - -int -ACE_DLL_Handle::close (int unload) -{ - ACE_TRACE ("ACE_DLL_Handle::close"); - - int retval = 0; - ACE_SHLIB_HANDLE h = ACE_SHLIB_INVALID_HANDLE; - - // Only hold the lock until it comes time to dlclose() the DLL. Closing - // the DLL can cause further shutdowns as DLLs and their dependents are - // unloaded. - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - // Since we don't actually unload the dll as soon as the refcount - // reaches zero, we need to make sure we don't decrement it below - // zero. - if (this->refcount_ > 0) - --this->refcount_; - else - this->refcount_ = 0; - - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::close - ") - ACE_TEXT ("%s (handle=%d, refcount=%d)\n"), - this->dll_name_, - this->handle_, - this->refcount_)); - - if (this->refcount_ == 0 && - this->handle_ != ACE_SHLIB_INVALID_HANDLE && - unload == 1) - { - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::close: ") - ACE_TEXT ("Unloading %s (handle=%d)\n"), - this->dll_name_, - this->handle_)); - - // First remove any associated Framework Components. - ACE_Framework_Repository *frPtr= ACE_Framework_Repository::instance (); - if (frPtr) - { - frPtr->remove_dll_components (this->dll_name_); - } - - h = this->handle_; - this->handle_ = ACE_SHLIB_INVALID_HANDLE; - } - } // Release lock_ here - - if (h != ACE_SHLIB_INVALID_HANDLE) - { - retval = ACE_OS::dlclose (h); - - if (retval != 0 && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::close - ") - ACE_TEXT ("Failed with: \"%s\".\n"), - this->error ()->c_str ())); - } - - return retval; -} - -sig_atomic_t -ACE_DLL_Handle::refcount (void) const -{ - return this->refcount_; -} - -void * -ACE_DLL_Handle::symbol (const ACE_TCHAR *sym_name, int ignore_errors) -{ - ACE_TRACE ("ACE_DLL_Handle::symbol"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - ACE_Auto_Array_Ptr auto_name (ACE::ldname (sym_name)); - // handle_ can be invalid especially when ACE_DLL_Handle resigned ownership - // BTW. Handle lifecycle management is a little crazy in ACE - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) - { -#if defined (ACE_OPENVMS) - void *sym = ACE::ldsymbol (this->handle_, auto_name.get ()); -#else - void *sym = ACE_OS::dlsym (this->handle_, auto_name.get ()); -#endif - - // Linux says that the symbol could be null and that it isn't an - // error. So you should check the error message also, but since - // null symbols won't do us much good anyway, let's still report - // an error. - if (!sym && ignore_errors != 1) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::symbol (\"%s\") ") - ACE_TEXT (" failed with \"%s\".\n"), - auto_name.get (), - this->error ()->c_str ())); - - return 0; - } - return sym; - } - return 0; -} - -ACE_SHLIB_HANDLE -ACE_DLL_Handle::get_handle (int become_owner) -{ - ACE_TRACE ("ACE_DLL_Handle::get_handle"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - if (this->refcount_ == 0 && become_owner != 0) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL_Handle::get_handle: ") - ACE_TEXT ("cannot become owner, refcount == 0.\n"))); - - return ACE_SHLIB_INVALID_HANDLE; - } - - ACE_SHLIB_HANDLE handle = this->handle_; - - if (become_owner != 0) - { - if (--this->refcount_ == 0) - this->handle_ = ACE_SHLIB_INVALID_HANDLE; - } - - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) ACE_DLL_Handle::get_handle: ") - ACE_TEXT ("post call: handle %s, refcount %d\n"), - this->handle_ == ACE_SHLIB_INVALID_HANDLE ? - ACE_TEXT ("invalid") : ACE_TEXT ("valid"), - this->refcount_)); - - return handle; -} - -// This method is used return the last error of a library operation. - -auto_ptr -ACE_DLL_Handle::error (void) -{ - ACE_TRACE ("ACE_DLL_Handle::error"); - const ACE_TCHAR *error = ACE_OS::dlerror (); - auto_ptr str - (new ACE_TString (error ? error : ACE_TEXT ("no error"))); - return str; -} - -void -ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, - ACE_Array &try_names) -{ - // Build the array of DLL names to try on this platform by applying the - // proper prefixes and/or suffixes to the specified dll_name. - ACE_TString base (dll_name); - ACE_TString base_dir, base_file, base_suffix; - - // 1. Separate the dll_name into the dir part and the file part. We - // only decorate the file part to determine the names to try loading. - ACE_TString::size_type pos = base.rfind (ACE_DIRECTORY_SEPARATOR_CHAR); - if (pos != ACE_TString::npos) - { - base_dir = base.substr (0, pos + 1); - base_file = base.substr (pos + 1); - } - else - base_file = base; - - // 2. Locate the file suffix, if there is one. Move the '.' and the - // suffix to base_suffix. - if ((pos = base_file.rfind (ACE_TEXT ('.'))) != ACE_TString::npos) - { - base_suffix = base_file.substr (pos); - base_file = base_file.substr (0, pos); - } - - // 3. Build the combinations to try for this platform. - // Try these combinations: - // - name with decorator and platform's suffix appended (if not supplied) - // - name with platform's suffix appended (if not supplied) - // - name with platform's dll prefix (if it has one) and suffix - // - name with platform's dll prefix, decorator, and suffix. - // - name as originally given - // We first try to find the file using the decorator so that when a - // filename with and without decorator is used, we get the file with - // the same decorator as the ACE dll has and then as last resort - // the one without. For example with msvc, the debug build has a "d" - // decorator, but the release build has none and we really want to get - // the debug version of the library in a debug application instead - // of the release one. - // So we need room for 5 entries in try_names. - try_names.size (0); - if ((try_names.max_size () - try_names.size ()) < 5) - try_names.max_size (try_names.max_size () + 5); -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - ACE_TString decorator (ACE_LD_DECORATOR_STR); -#endif - ACE_TString suffix (ACE_DLL_SUFFIX); - ACE_TString prefix (ACE_DLL_PREFIX); - - for (size_t i = 0; i < 5 && try_names.size () < try_names.max_size (); ++i) - { - ACE_TString try_this; - size_t j = try_names.size (); - switch (i) - { - case 0: // Name + decorator + suffix - case 1: // Name + suffix - case 2: // Prefix + name + decorator + suffix - case 3: // Prefix + name + suffix - if ( - base_suffix.length () > 0 -#if !(defined(ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK)) - || (i == 1 || i == 3) // No decorator desired; skip -#endif - ) - break; - try_this = base_dir; - if (i > 1) - try_this += prefix; - try_this += base_file; - if (base_suffix.length () > 0) - try_this += base_suffix; - else - { -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - try_this += decorator; -#endif - try_this += suffix; - } - break; - case 4: - try_this = dll_name; - break; - } - - if (try_this.length ()) - { - try_names.size (j + 1); - try_names.set (try_this, j); - } - } - return; -} - -/******************************************************************/ - -// Pointer to the Singleton instance. -ACE_DLL_Manager *ACE_DLL_Manager::instance_ = 0; - -ACE_DLL_Manager * -ACE_DLL_Manager::instance (int size) -{ - ACE_TRACE ("ACE_DLL_Manager::instance"); - - if (ACE_DLL_Manager::instance_ == 0) - { - // Perform Double-Checked Locking Optimization. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - if (ACE_DLL_Manager::instance_ == 0) - { - ACE_NEW_RETURN (ACE_DLL_Manager::instance_, - ACE_DLL_Manager (size), - 0); - } - } - - return ACE_DLL_Manager::instance_; -} - -void -ACE_DLL_Manager::close_singleton (void) -{ - ACE_TRACE ("ACE_DLL_Manager::close_singleton"); - - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance ())); - - delete ACE_DLL_Manager::instance_; - ACE_DLL_Manager::instance_ = 0; -} - -ACE_DLL_Manager::ACE_DLL_Manager (int size) - : handle_vector_ (0), - current_size_ (0), - total_size_ (0), - unload_policy_ (ACE_DLL_UNLOAD_POLICY_PER_DLL) -{ - ACE_TRACE ("ACE_DLL_Manager::ACE_DLL_Manager"); - - if (this->open (size) != 0 && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL_Manager ctor failed to allocate ") - ACE_TEXT ("handle_vector_.\n"))); -} - -ACE_DLL_Manager::~ACE_DLL_Manager (void) -{ - ACE_TRACE ("ACE_DLL_Manager::~ACE_DLL_Manager"); - - if (this->close () != 0 && ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL_Manager dtor failed to close ") - ACE_TEXT ("properly.\n"))); -} - -ACE_DLL_Handle * -ACE_DLL_Manager::open_dll (const ACE_TCHAR *dll_name, - int open_mode, - ACE_SHLIB_HANDLE handle) -{ - ACE_TRACE ("ACE_DLL_Manager::open_dll"); - - ACE_DLL_Handle *temp_handle = 0; - ACE_DLL_Handle *dll_handle = 0; - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - dll_handle = this->find_dll (dll_name); - if (!dll_handle) - { - if (this->current_size_ < this->total_size_) - { - ACE_NEW_RETURN (temp_handle, - ACE_DLL_Handle, - 0); - - dll_handle = temp_handle; - } - } - } - - if (dll_handle) - { - if (dll_handle->open (dll_name, open_mode, handle) != 0) - { - // Error while opening dll. Free temp handle - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL_Manager::open_dll: Could not ") - ACE_TEXT ("open dll %s.\n"), - dll_name)); - - delete temp_handle; - return 0; - } - - // Add the handle to the vector only if the dll is successfully - // opened. - if (temp_handle != 0) - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - this->handle_vector_[this->current_size_] = dll_handle; - ++this->current_size_; - } - } - - return dll_handle; -} - -int -ACE_DLL_Manager::close_dll (const ACE_TCHAR *dll_name) -{ - ACE_TRACE ("ACE_DLL_Manager::close_dll"); - ACE_DLL_Handle *handle = 0; - - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - handle = this->find_dll (dll_name); - } - - if (handle) - { - return this->unload_dll (handle, 0); - } - - return -1; -} - -u_long -ACE_DLL_Manager::unload_policy (void) const -{ - ACE_TRACE ("ACE_DLL_Manager::unload_policy"); - return this->unload_policy_; -} - -void -ACE_DLL_Manager::unload_policy (u_long unload_policy) -{ - ACE_TRACE ("ACE_DLL_Manager::unload_policy"); - ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_)); - - u_long old_policy = this->unload_policy_; - this->unload_policy_ = unload_policy; - - // If going from LAZY to EAGER or from PER_DLL to PER_PROCESS|EAGER, - // call close(1) on all the ACE_DLL_Handle objects with refcount == 0 - // which will force those that are still loaded to be unloaded. - if (this->handle_vector_) - if (( ACE_BIT_ENABLED (old_policy, ACE_DLL_UNLOAD_POLICY_LAZY) && - ACE_BIT_DISABLED (this->unload_policy_, ACE_DLL_UNLOAD_POLICY_LAZY) ) || - ( ACE_BIT_DISABLED (this->unload_policy_, ACE_DLL_UNLOAD_POLICY_LAZY) && - ACE_BIT_ENABLED (old_policy, ACE_DLL_UNLOAD_POLICY_PER_DLL) && - ACE_BIT_DISABLED (this->unload_policy_, ACE_DLL_UNLOAD_POLICY_PER_DLL) )) - { - for (int i = this->current_size_ - 1; i >= 0; i--) - { - if (this->handle_vector_[i] && - this->handle_vector_[i]->refcount () == 0) - this->handle_vector_[i]->close (1); - } - } -} - -int -ACE_DLL_Manager::open (int size) -{ - ACE_TRACE ("ACE_DLL_Manager::open"); - - ACE_DLL_Handle **temp = 0; - - ACE_NEW_RETURN (temp, - ACE_DLL_Handle *[size], - -1); - - this->handle_vector_ = temp; - this->total_size_ = size; - return 0; -} - -int -ACE_DLL_Manager::close (void) -{ - ACE_TRACE ("ACE_DLL_Manager::close"); - - int force_close = 1; - - if (this->handle_vector_ != 0) - { - // Delete components in reverse order. - for (int i = this->current_size_ - 1; i >= 0; i--) - { - if (this->handle_vector_[i]) - { - ACE_DLL_Handle *s = - const_cast (this->handle_vector_[i]); - this->handle_vector_[i] = 0; - this->unload_dll (s, force_close); - delete s; - } - } - - delete [] this->handle_vector_; - this->handle_vector_ = 0; - this->current_size_ = 0; - } - return 0; -} - -ACE_DLL_Handle * -ACE_DLL_Manager::find_dll (const ACE_TCHAR *dll_name) const -{ - ACE_TRACE ("ACE_DLL_Manager::find_dll"); - - for (int i = 0; i < this->current_size_; i++) - if (this->handle_vector_[i] && - ACE_OS::strcmp (this->handle_vector_[i]->dll_name (), dll_name) == 0) - { - return this->handle_vector_[i]; - } - - return 0; -} - -int -ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload) -{ - ACE_TRACE ("ACE_DLL_Manager::unload_dll"); - - if (dll_handle) - { - int unload = force_unload; - if (unload == 0) - { - // apply strategy - if (ACE_BIT_DISABLED (this->unload_policy_, - ACE_DLL_UNLOAD_POLICY_PER_DLL)) - { - unload = ACE_BIT_DISABLED (this->unload_policy_, - ACE_DLL_UNLOAD_POLICY_LAZY); - } - else - { - // Declare the type of the symbol: - typedef int (*dll_unload_policy)(void); - - void * const unload_policy_ptr = - dll_handle->symbol (ACE_TEXT ("_get_dll_unload_policy"), 1); -#if defined (ACE_OPENVMS) && (!defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64)) - int const temp_p = - reinterpret_cast (unload_policy_ptr); -#else - intptr_t const temp_p = - reinterpret_cast (unload_policy_ptr); -#endif - - dll_unload_policy const the_policy = - reinterpret_cast (temp_p); - - if (the_policy != 0) - unload = ACE_BIT_DISABLED (the_policy (), - ACE_DLL_UNLOAD_POLICY_LAZY); - else - unload = ACE_BIT_DISABLED (this->unload_policy_, - ACE_DLL_UNLOAD_POLICY_LAZY); - } - } - - if (dll_handle->close (unload) != 0) - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL_Manager::unload error.\n"))); - - return -1; - } - } - else - { - if (ACE::debug ()) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_DLL_Manager::unload_dll called with ") - ACE_TEXT ("null pointer.\n"))); - - return -1; - } - - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Date_Time.cpp b/dep/src/ace/Date_Time.cpp deleted file mode 100644 index 8b26d0dd925..00000000000 --- a/dep/src/ace/Date_Time.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Date_Time.cpp -// $Id: Date_Time.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Date_Time.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Date_Time.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Date_Time, "$Id: Date_Time.cpp 80826 2008-03-04 14:51:23Z wotte $") - diff --git a/dep/src/ace/Dev_Poll_Reactor.cpp b/dep/src/ace/Dev_Poll_Reactor.cpp deleted file mode 100644 index bcc3127003e..00000000000 --- a/dep/src/ace/Dev_Poll_Reactor.cpp +++ /dev/null @@ -1,2513 +0,0 @@ -// $Id: Dev_Poll_Reactor.cpp 81315 2008-04-10 07:14:15Z johnnyw $ - -#include "ace/OS_NS_errno.h" -#include "ace/Dev_Poll_Reactor.h" -#include "ace/Signal.h" -#include "ace/Sig_Handler.h" - -ACE_RCSID (ace, - Dev_Poll_Reactor, - "$Id: Dev_Poll_Reactor.cpp 81315 2008-04-10 07:14:15Z johnnyw $") - -#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) - -# include "ace/OS_NS_unistd.h" -# include "ace/OS_NS_fcntl.h" -# include "ace/OS_NS_stropts.h" - -# if defined (ACE_HAS_EVENT_POLL) && defined (linux) -# include /**/ -# elif defined (ACE_HAS_DEV_POLL) -# if defined (linux) -# include /**/ -# elif defined (HPUX_VERS) && HPUX_VERS < 1123 -# include /**/ -# else -# include /**/ -# endif /* linux */ -# endif /* ACE_HAS_DEV_POLL */ - -#if !defined (__ACE_INLINE__) -# include "ace/Dev_Poll_Reactor.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Handle_Set.h" -#include "ace/Reactor.h" -#include "ace/Timer_Heap.h" -#include "ace/Timer_Queue.h" -#include "ace/ACE.h" -#include "ace/Reverse_Lock_T.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Null_Mutex.h" -#include "ace/os_include/os_poll.h" -#include "ace/OS_NS_sys_mman.h" -#include "ace/Guard_T.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_sys_time.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Dev_Poll_Reactor_Notify::ACE_Dev_Poll_Reactor_Notify (void) - : dp_reactor_ (0) - , notification_pipe_ () - , max_notify_iterations_ (-1) -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - , notification_queue_ () -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ -{ -} - -int -ACE_Dev_Poll_Reactor_Notify::open (ACE_Reactor_Impl *r, - ACE_Timer_Queue * /* timer_queue */, - int disable_notify_pipe) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::open"); - - if (disable_notify_pipe == 0) - { - this->dp_reactor_ = dynamic_cast (r); - - if (this->dp_reactor_ == 0) - { - errno = EINVAL; - return -1; - } - - if (this->notification_pipe_.open () == -1) - return -1; - -#if defined (F_SETFD) - // close-on-exec - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); -#endif /* F_SETFD */ - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - if (notification_queue_.open () == -1) - { - return -1; - } - - if (ACE::set_flags (this->notification_pipe_.write_handle (), - ACE_NONBLOCK) == -1) - return -1; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - - // Set the read handle into non-blocking mode since we need to - // perform a "speculative" read when determining if there are - // notifications to dispatch. - if (ACE::set_flags (this->notification_pipe_.read_handle (), - ACE_NONBLOCK) == -1) - return -1; - } - - return 0; -} - -int -ACE_Dev_Poll_Reactor_Notify::close (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::close"); - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - notification_queue_.reset (); -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - - return this->notification_pipe_.close (); -} - -int -ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::notify"); - - // Just consider this method a "no-op" if there's no - // ACE_Dev_Poll_Reactor configured. - if (this->dp_reactor_ == 0) - return 0; - - ACE_Notification_Buffer buffer (eh, mask); - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - ACE_UNUSED_ARG (timeout); - ACE_Dev_Poll_Handler_Guard eh_guard (eh); - - int notification_required = - notification_queue_.push_new_notification (buffer); - - if (notification_required == -1) - return -1; // Also decrement eh's reference count - - // The notification has been queued, so it will be delivered at some - // point (and may have been already); release the refcnt guard. - eh_guard.release (); - - if (notification_required == 0) - return 0; - - // Now pop the pipe to force the callback for dispatching when ready. If - // the send fails due to a full pipe, don't fail - assume the already-sent - // pipe bytes will cause the entire notification queue to be processed. - ssize_t n = ACE::send (this->notification_pipe_.write_handle (), - (char *) &buffer, - 1, // Only need one byte to pop the pipe - &ACE_Time_Value::zero); - if (n == -1 && (errno != ETIME && errno != EAGAIN)) - return -1; - - return 0; -#else - - ACE_Dev_Poll_Handler_Guard eh_guard (eh); - - ssize_t n = ACE::send (this->notification_pipe_.write_handle (), - (char *) &buffer, - sizeof buffer, - timeout); - if (n == -1) - return -1; - - eh_guard.release (); - - return 0; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ -} - -int -ACE_Dev_Poll_Reactor_Notify::dispatch_notifications ( - int & /* number_of_active_handles */, - ACE_Handle_Set & /* rd_mask */) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::dispatch_notifications"); - - // This method is unimplemented in the ACE_Dev_Poll_Reactor. - // Instead, the notification handler is invoked as part of the IO - // event set. Doing so alters the some documented semantics that - // state that the notifications are handled before IO events. - // Enforcing such semantics does not appear to be beneficial, and - // also serves to slow down event dispatching particularly with this - // ACE_Dev_Poll_Reactor. - - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, - ACE_Notification_Buffer &buffer) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::read_notify_pipe"); - - // This is a (non-blocking) "speculative" read, i.e., we attempt to - // read even if no event was polled on the read handle. A - // speculative read is necessary since notifications must be - // dispatched before IO events. We can avoid the speculative read - // by "walking" the array of pollfd structures returned from - // `/dev/poll' or `/dev/epoll' but that is potentially much more - // expensive than simply checking for an EWOULDBLOCK. - size_t to_read; - char *read_p; - bool have_one = false; - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - // For the queued case, we'll try to read one byte (since that's what - // the notify () tried to put in) but we don't need it - notifications can - // be queued even if the pipe fills, so there may be more notifications - // queued than there are bytes in the pipe. - char b; - read_p = &b; - to_read = 1; - - // Before reading the byte, pop a message from the queue and queue a - // new message unless the queue is now empty. The protocol is to - // keep a byte in the pipe as long as the queue is not empty. - bool more_messages_queued = false; - ACE_Notification_Buffer next; - - int result = notification_queue_.pop_next_notification (buffer, - more_messages_queued, - next); - - if (result == 0) - { - // remove the notification byte from the pipe, avoiding notification loop - ACE::recv (handle, read_p, to_read); - return 0; - } - - if (result == -1) - return -1; - - if (more_messages_queued) - (void) ACE::send (this->notification_pipe_.write_handle (), - (char *)&next, - 1 /* one byte is enough */, - &ACE_Time_Value::zero); -#else - to_read = sizeof buffer; - read_p = (char *)&buffer; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - - ssize_t n = ACE::recv (handle, read_p, to_read); - - if (n > 0) - { - // Check to see if we've got a short read. - if (static_cast (n) != to_read) - { - size_t remainder = to_read - n; - - // If so, try to recover by reading the remainder. If this - // doesn't work we're in big trouble since the input stream - // won't be aligned correctly. I'm not sure quite what to - // do at this point. It's probably best just to return -1. - if (ACE::recv (handle, &read_p[n], remainder) <= 0) - return -1; - } - - return 1; - } - - // Return -1 if things have gone seriously wrong. - if (n <= 0 && (errno != EWOULDBLOCK && errno != EAGAIN)) - return -1; - - return have_one ? 1 : 0; -} - -int -ACE_Dev_Poll_Reactor_Notify::handle_input (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::handle_input"); - - // @@ We may end up dispatching this event handler twice: once when - // performing the speculative read on the notification pipe - // handle, and once more when dispatching the IO events. - - // Precondition: this->select_reactor_.token_.current_owner () == - // ACE_Thread::self (); - - int number_dispatched = 0; - int result = 0; - ACE_Notification_Buffer buffer; - - while ((result = this->read_notify_pipe (handle, buffer)) > 0) - { - // Dispatch the buffer - // NOTE: We count only if we made any dispatches ie. upcalls. - if (this->dispatch_notify (buffer) > 0) - ++number_dispatched; - - // Bail out if we've reached the . Note that - // by default is -1, so we'll loop until all - // the available notifications have been dispatched. - if (number_dispatched == this->max_notify_iterations_) - break; - } - - if (result == -1) - { - // Reassign number_dispatched to -1 if things have gone - // seriously wrong. - number_dispatched = -1; - } - - // Enqueue ourselves into the list of waiting threads. When we - // reacquire the token we'll be off and running again with ownership - // of the token. The postcondition of this call is that - // == . - //this->select_reactor_->renew (); - - return number_dispatched; -} - -ACE_HANDLE -ACE_Dev_Poll_Reactor_Notify::notify_handle (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::notify_handle"); - - return this->notification_pipe_.read_handle (); -} - -int -ACE_Dev_Poll_Reactor_Notify::is_dispatchable (ACE_Notification_Buffer &) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::is_dispatchable"); - - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::dispatch_notify"); - - // If eh == 0 then another thread is unblocking the - // ACE_Dev_Poll_Reactor to update the ACE_Dev_Poll_Reactor's - // internal structures. Otherwise, we need to dispatch the - // appropriate handle_* method on the ACE_Event_Handler - // pointer we've been passed. - if (buffer.eh_ != 0) - { - int result = 0; - - // Guard the handler's refcount. Recall that when the notify - // was queued, the refcount was incremented, so it need not be - // now. The guard insures that it is decremented properly. - ACE_Dev_Poll_Handler_Guard eh_guard (buffer.eh_, false); - - switch (buffer.mask_) - { - case ACE_Event_Handler::READ_MASK: - case ACE_Event_Handler::ACCEPT_MASK: - result = buffer.eh_->handle_input (ACE_INVALID_HANDLE); - break; - case ACE_Event_Handler::WRITE_MASK: - result = buffer.eh_->handle_output (ACE_INVALID_HANDLE); - break; - case ACE_Event_Handler::EXCEPT_MASK: - result = buffer.eh_->handle_exception (ACE_INVALID_HANDLE); - break; - default: - // Should we bail out if we get an invalid mask? - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("dispatch_notify invalid mask = %d\n"), - buffer.mask_)); - } - if (result == -1) - buffer.eh_->handle_close (ACE_INVALID_HANDLE, buffer.mask_); - } - - return 1; -} - -void -ACE_Dev_Poll_Reactor_Notify::max_notify_iterations (int iterations) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::max_notify_iterations"); - - // Must always be > 0 or < 0 to optimize the loop exit condition. - if (iterations == 0) - iterations = 1; - - this->max_notify_iterations_ = iterations; -} - -int -ACE_Dev_Poll_Reactor_Notify::max_notify_iterations (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::max_notify_iterations"); - - return this->max_notify_iterations_; -} - -int -ACE_Dev_Poll_Reactor_Notify::purge_pending_notifications ( - ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::purge_pending_notifications"); - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - - return notification_queue_.purge_pending_notifications (eh, mask); - -#else /* defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) */ - ACE_UNUSED_ARG (eh); - ACE_UNUSED_ARG (mask); - ACE_NOTSUP_RETURN (-1); -#endif /* defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) */ -} - -void -ACE_Dev_Poll_Reactor_Notify::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("dp_reactor_ = %@"), - this->dp_reactor_)); - this->notification_pipe_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// ----------------------------------------------------------------- - -ACE_Dev_Poll_Reactor_Handler_Repository:: -ACE_Dev_Poll_Reactor_Handler_Repository (void) - : max_size_ (0), - handlers_ (0) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::ACE_Dev_Poll_Reactor_Handler_Repository"); -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::invalid_handle ( - ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::invalid_handle"); - - if (handle < 0 || handle >= this->max_size_) - { - errno = EINVAL; - return 1; - } - else - return 0; -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::handle_in_range ( - ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::handle_in_range"); - - if (handle >= 0 && handle < this->max_size_) - return 1; - else - { - errno = EINVAL; - return 0; - } -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::open (size_t size) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::open"); - - this->max_size_ = size; - - // Try to allocate the memory. - ACE_NEW_RETURN (this->handlers_, - ACE_Dev_Poll_Event_Tuple[size], - -1); - - // Try to increase the number of handles if is greater than - // the current limit. - return ACE::set_handle_limit (size); -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::unbind_all (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::unbind_all"); - - // Unbind all of the event handlers. - for (int handle = 0; - handle < this->max_size_; - ++handle) - this->unbind (handle); - - return 0; -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::close (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::close"); - - if (this->handlers_ != 0) - { - this->unbind_all (); - - delete [] this->handlers_; - this->handlers_ = 0; - } - - return 0; -} - -ACE_Event_Handler * -ACE_Dev_Poll_Reactor_Handler_Repository::find (ACE_HANDLE handle, - size_t *index_p) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::find"); - - ACE_Event_Handler *eh = 0; - - // Only bother to search for the if it's in range. - if (this->handle_in_range (handle)) - { - eh = this->handlers_[handle].event_handler; - if (eh != 0) - { - if (index_p != 0) - *index_p = handle; - } - else - errno = ENOENT; - } - - return eh; -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::bind ( - ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::bind"); - - if (event_handler == 0) - return -1; - - if (handle == ACE_INVALID_HANDLE) - handle = event_handler->get_handle (); - - if (this->invalid_handle (handle)) - return -1; - - this->handlers_[handle].event_handler = event_handler; - this->handlers_[handle].mask = mask; - event_handler->add_reference (); - - return 0; -} - -int -ACE_Dev_Poll_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, - bool decr_refcnt) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::unbind"); - - if (this->find (handle) == 0) - return -1; - - if (decr_refcnt) - this->handlers_[handle].event_handler->remove_reference (); - this->handlers_[handle].event_handler = 0; - this->handlers_[handle].mask = ACE_Event_Handler::NULL_MASK; - this->handlers_[handle].suspended = 0; - - return 0; -} - -// ----------------------------------------------------------------- - -ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify, - int mask_signals, - int s_queue) - : initialized_ (false) - , poll_fd_ (ACE_INVALID_HANDLE) - , size_ (0) - // , ready_set_ () -#if defined (ACE_HAS_EVENT_POLL) - , events_ (0) - , start_pevents_ (0) - , end_pevents_ (0) -#else - , dp_fds_ (0) - , start_pfds_ (0) - , end_pfds_ (0) -#endif /* ACE_HAS_EVENT_POLL */ - , deactivated_ (0) - , token_ (*this, s_queue) - , lock_adapter_ (token_) - , timer_queue_ (0) - , delete_timer_queue_ (false) - , signal_handler_ (0) - , delete_signal_handler_ (false) - , notify_handler_ (0) - , delete_notify_handler_ (false) - , mask_signals_ (mask_signals) - , restart_ (0) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor"); - - if (this->open (ACE::max_handles (), - 0, - sh, - tq, - disable_notify_pipe, - notify) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Dev_Poll_Reactor::open ") - ACE_TEXT ("failed inside ") - ACE_TEXT ("ACE_Dev_Poll_Reactor::CTOR"))); -} - -ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (size_t size, - int rs, - ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify, - int mask_signals, - int s_queue) - : initialized_ (false) - , poll_fd_ (ACE_INVALID_HANDLE) - , size_ (0) - // , ready_set_ () -#if defined (ACE_HAS_EVENT_POLL) - , events_ (0) - , start_pevents_ (0) - , end_pevents_ (0) -#else - , dp_fds_ (0) - , start_pfds_ (0) - , end_pfds_ (0) -#endif /* ACE_HAS_EVENT_POLL */ - , deactivated_ (0) - , token_ (*this, s_queue) - , lock_adapter_ (token_) - , timer_queue_ (0) - , delete_timer_queue_ (false) - , signal_handler_ (0) - , delete_signal_handler_ (false) - , notify_handler_ (0) - , delete_notify_handler_ (false) - , mask_signals_ (mask_signals) - , restart_ (0) -{ - if (this->open (size, - rs, - sh, - tq, - disable_notify_pipe, - notify) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Dev_Poll_Reactor::open ") - ACE_TEXT ("failed inside ACE_Dev_Poll_Reactor::CTOR"))); -} - -ACE_Dev_Poll_Reactor::~ACE_Dev_Poll_Reactor (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::~ACE_Dev_Poll_Reactor"); - - (void) this->close (); -} - -int -ACE_Dev_Poll_Reactor::open (size_t size, - int restart, - ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::open"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - // Can't initialize ourselves more than once. - if (this->initialized_) - return -1; - - this->restart_ = restart; - this->signal_handler_ = sh; - this->timer_queue_ = tq; - this->notify_handler_ = notify; - - int result = 0; - - // Allows the signal handler to be overridden. - if (this->signal_handler_ == 0) - { - ACE_NEW_RETURN (this->signal_handler_, - ACE_Sig_Handler, - -1); - - if (this->signal_handler_ == 0) - result = -1; - else - this->delete_signal_handler_ = true; - } - - // Allows the timer queue to be overridden. - if (result != -1 && this->timer_queue_ == 0) - { - ACE_NEW_RETURN (this->timer_queue_, - ACE_Timer_Heap, - -1); - - if (this->timer_queue_ == 0) - result = -1; - else - this->delete_timer_queue_ = true; - } - - // Allows the Notify_Handler to be overridden. - if (result != -1 && this->notify_handler_ == 0) - { - ACE_NEW_RETURN (this->notify_handler_, - ACE_Dev_Poll_Reactor_Notify, - -1); - - if (this->notify_handler_ == 0) - result = -1; - else - this->delete_notify_handler_ = true; - } - -#if defined (ACE_HAS_EVENT_POLL) - - // Allocating event table: - ACE_NEW_RETURN (this->events_, epoll_event[size], -1); - - // Initializing epoll: - this->poll_fd_ = ::epoll_create (size); - if (this->poll_fd_ == -1) - result = -1; - -#else - - // Allocate the array before opening the device to avoid a potential - // resource leak if allocation fails. - ACE_NEW_RETURN (this->dp_fds_, - pollfd[size], - -1); - - // Open the `/dev/poll' character device. - this->poll_fd_ = ACE_OS::open ("/dev/poll", O_RDWR); - if (this->poll_fd_ == ACE_INVALID_HANDLE) - result = -1; - -#endif /* ACE_HAS_EVENT_POLL */ - - if (result != -1 && this->handler_rep_.open (size) == -1) - result = -1; - - // Registration of the notification handler must be done after the - // /dev/poll device has been fully initialized. - else if (this->notify_handler_->open (this, - 0, - disable_notify_pipe) == -1 - || (disable_notify_pipe == 0 - && this->register_handler_i ( - this->notify_handler_->notify_handle (), - this->notify_handler_, - ACE_Event_Handler::READ_MASK) == -1)) - result = -1; - - this->size_ = size; - - if (result != -1) - // We're all set to go. - this->initialized_ = true; - else - // This will close down all the allocated resources properly. - (void) this->close (); - - return result; -} - -int -ACE_Dev_Poll_Reactor::current_info (ACE_HANDLE, size_t & /* size */) -{ - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor::set_sig_handler (ACE_Sig_Handler *signal_handler) -{ - if (this->delete_signal_handler_) - delete this->signal_handler_; - - this->signal_handler_ = signal_handler; - this->delete_signal_handler_ = false; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::timer_queue (ACE_Timer_Queue *tq) -{ - if (this->delete_timer_queue_) - delete this->timer_queue_; - - this->timer_queue_ = tq; - this->delete_timer_queue_ = false; - - return 0; - -} - -ACE_Timer_Queue * -ACE_Dev_Poll_Reactor::timer_queue (void) const -{ - return this->timer_queue_; -} - -int -ACE_Dev_Poll_Reactor::close (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::close"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - int result = 0; - - if (this->poll_fd_ != ACE_INVALID_HANDLE) - { - result = ACE_OS::close (this->poll_fd_); - } - -#if defined (ACE_HAS_EVENT_POLL) - - delete [] this->events_; - this->events_ = 0; - -#else - - delete [] this->dp_fds_; - this->dp_fds_ = 0; - -#endif /* ACE_HAS_EVENT_POLL */ - - if (this->delete_signal_handler_) - { - delete this->signal_handler_; - this->signal_handler_ = 0; - this->delete_signal_handler_ = false; - } - - (void) this->handler_rep_.close (); - - if (this->delete_timer_queue_) - { - delete this->timer_queue_; - this->timer_queue_ = 0; - this->delete_timer_queue_ = false; - } - - if (this->notify_handler_ != 0) - this->notify_handler_->close (); - - if (this->delete_notify_handler_) - { - delete this->notify_handler_; - this->notify_handler_ = 0; - this->delete_notify_handler_ = false; - } - - this->poll_fd_ = ACE_INVALID_HANDLE; - -#if defined (ACE_HAS_EVENT_POLL) - this->start_pevents_ = 0; - this->end_pevents_ = 0; -#else - this->start_pfds_ = 0; - this->end_pfds_ = 0; -#endif /* ACE_HAS_EVENT_POLL */ - - this->initialized_ = false; - - return result; -} - -int -ACE_Dev_Poll_Reactor::work_pending (const ACE_Time_Value & max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::work_pending"); - - // Stash the current time - // - // The destructor of this object will automatically compute how much - // time elapsed since this method was called. - ACE_Time_Value mwt (max_wait_time); - ACE_MT (ACE_Countdown_Time countdown (&mwt)); - - Token_Guard guard (this->token_); - int const result = guard.acquire_quietly (&mwt); - - // If the guard is NOT the owner just return the retval - if (!guard.is_owner ()) - return result; - - // Update the countdown to reflect time waiting for the mutex. - ACE_MT (countdown.update ()); - - return this->work_pending_i (&mwt); -} - -int -ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::work_pending_i"); - - if (this->deactivated_) - return 0; - -#if defined (ACE_HAS_EVENT_POLL) - if (this->start_pevents_ != this->end_pevents_) -#else - if (this->start_pfds_ != this->end_pfds_) -#endif /* ACE_HAS_EVENT_POLL */ - return 1; // We still have work_pending (). Do not poll for - // additional events. - - ACE_Time_Value timer_buf (0); - ACE_Time_Value *this_timeout = - this->timer_queue_->calculate_timeout (max_wait_time, &timer_buf); - - // Check if we have timers to fire. - int const timers_pending = - ((this_timeout != 0 && max_wait_time == 0) - || (this_timeout != 0 && max_wait_time != 0 - && *this_timeout != *max_wait_time) ? 1 : 0); - - long const timeout = - (this_timeout == 0 - ? -1 /* Infinity */ - : static_cast (this_timeout->msec ())); - -#if defined (ACE_HAS_EVENT_POLL) - - // Wait for events. - int const nfds = ::epoll_wait (this->poll_fd_, - this->events_, - this->size_, - static_cast (timeout)); - - if (nfds > 0) - { - this->start_pevents_ = this->events_; - this->end_pevents_ = this->start_pevents_ + nfds; - } - -#else - - struct dvpoll dvp; - - dvp.dp_fds = this->dp_fds_; - dvp.dp_nfds = this->size_; - dvp.dp_timeout = timeout; // Milliseconds - - // Poll for events - int const nfds = ACE_OS::ioctl (this->poll_fd_, DP_POLL, &dvp); - - // Retrieve the results from the pollfd array. - this->start_pfds_ = dvp.dp_fds; - - // If nfds == 0 then end_pfds_ == start_pfds_ meaning that there is - // no work pending. If nfds > 0 then there is work pending. - // Otherwise an error occurred. - if (nfds > -1) - this->end_pfds_ = this->start_pfds_ + nfds; -#endif /* ACE_HAS_EVENT_POLL */ - - // If timers are pending, override any timeout from the poll. - return (nfds == 0 && timers_pending != 0 ? 1 : nfds); -} - -int -ACE_Dev_Poll_Reactor::handle_events (ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::handle_events"); - - // Stash the current time - // - // The destructor of this object will automatically compute how much - // time elapsed since this method was called. - ACE_MT (ACE_Countdown_Time countdown (max_wait_time)); - - Token_Guard guard (this->token_); - int const result = guard.acquire_quietly (max_wait_time); - - // If the guard is NOT the owner just return the retval - if (!guard.is_owner ()) - return result; - - if (this->deactivated_) - return -1; - - // Update the countdown to reflect time waiting for the mutex. - ACE_MT (countdown.update ()); - - return this->handle_events_i (max_wait_time, guard); -} - -int -ACE_Dev_Poll_Reactor::handle_events_i (ACE_Time_Value *max_wait_time, - Token_Guard &guard) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::handle_events_i"); - - int result = 0; - // int active_handle_count = 0; - - // Poll for events - // - // If the underlying ioctl () call was interrupted via the interrupt - // signal (i.e. returned -1 with errno == EINTR) then the loop will - // be restarted if so desired. - do - { - result = this->work_pending_i (max_wait_time); - if (result == -1) - ACE_ERROR ((LM_ERROR, "%t: %p\n", "work_pending_i")); - } - while (result == -1 && this->restart_ != 0 && errno == EINTR); - - if (result == 0 || (result == -1 && errno == ETIME)) - return 0; - else if (result == -1) - { - if (errno != EINTR) - return -1; - - // Bail out -- we got here since the poll was interrupted. - // If it was due to a signal registered through our ACE_Sig_Handler, - // then it was dispatched, so we count it in the number of events - // handled rather than cause an error return. - if (ACE_Sig_Handler::sig_pending () != 0) - { - ACE_Sig_Handler::sig_pending (0); - return 1; - } - return -1; - } - - // Dispatch an event. - return this->dispatch (guard); -} - -// Dispatch an event. On entry, the token is held by the caller. If an -// event is found to dispatch, the token is released before dispatching it. -int -ACE_Dev_Poll_Reactor::dispatch (Token_Guard &guard) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::dispatch"); - - // Perform the Template Method for dispatching the first located event. - // We dispatch only one to effectively dispatch events concurrently. - // As soon as an event is located, the token is released, allowing the - // next waiter to begin getting an event while we dispatch one here. - int result = 0; - - // Handle timers early since they may have higher latency - // constraints than I/O handlers. Ideally, the order of - // dispatching should be a strategy... - if ((result = this->dispatch_timer_handler (guard)) != 0) - return result; - - // Check to see if there are no more I/O handles left to - // dispatch AFTER we've handled the timers. - - // Finally, dispatch the I/O handlers. - result = this->dispatch_io_event (guard); - - return result; -} - -int -ACE_Dev_Poll_Reactor::dispatch_timer_handler (Token_Guard &guard) -{ - if (this->timer_queue_->is_empty ()) - return 0; // Empty timer queue so cannot have any expired timers. - - // Get the current time - ACE_Time_Value cur_time (this->timer_queue_->gettimeofday () + - this->timer_queue_->timer_skew ()); - - // Look for a node in the timer queue whose timer <= the present - // time. - ACE_Timer_Node_Dispatch_Info info; - if (this->timer_queue_->dispatch_info (cur_time, info)) - { - const void *upcall_act = 0; - - // Preinvoke (handles refcount if needed, etc.) - this->timer_queue_->preinvoke (info, cur_time, upcall_act); - - // Release the token before expiration upcall. - guard.release_token (); - - // call the functor - this->timer_queue_->upcall (info, cur_time); - - // Postinvoke (undo refcount if needed, etc.) - this->timer_queue_->postinvoke (info, cur_time, upcall_act); - - // We have dispatched a timer - return 1; - } - - return 0; -} - -#if 0 -int -ACE_Dev_Poll_Reactor::dispatch_notification_handlers ( - ACE_Select_Reactor_Handle_Set &dispatch_set, - int &number_of_active_handles, - int &number_of_handlers_dispatched) -{ - // Check to see if the ACE_HANDLE associated with the - // Dev_Poll_Reactor's notify hook is enabled. If so, it means that - // one or more other threads are trying to update the - // ACE_Dev_Poll_Reactor's internal tables or the notify pipe is - // enabled. We'll handle all these threads and notifications, and - // then break out to continue the event loop. - - const int n = - this->notify_handler_->dispatch_notifications (number_of_active_handles, - dispatch_set.rd_mask_); - - if (n == -1) - return -1; - else - number_of_handlers_dispatched += n; - - return /* this->state_changed_ ? -1 : */ 0; -} -#endif /* 0 */ - -int -ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) -{ - - // Define bits to check for while dispatching. -#if defined (ACE_HAS_EVENT_POLL) - const __uint32_t out_event = EPOLLOUT; - const __uint32_t exc_event = EPOLLPRI; - const __uint32_t in_event = EPOLLIN; - const __uint32_t err_event = EPOLLHUP | EPOLLERR; -#else - const short out_event = POLLOUT; - const short exc_event = POLLPRI; - const short in_event = POLLIN; - const short err_event = 0; // No known bits for this -#endif /* ACE_HAS_EVENT_POLL */ - - // Since the underlying event demultiplexing mechansim (`/dev/poll' - // or '/dev/epoll') is stateful, and since only one result buffer is - // used, all pending events (i.e. those retrieved from a previous - // poll) must be dispatched before any additional event can be - // polled. As such, the Dev_Poll_Reactor keeps track of the - // progress of events that have been dispatched. - - // Dispatch the events. - // - // Select the first available handle with event (s) pending. Check for - // event type in defined order of dispatch: output, exception, input. - // When an event is located, clear its bit in the dispatch set. If there - // are no more events for the handle, also increment the pfds pointer - // to move to the next handle ready. - // - // Notice that pfds only contains file descriptors that have - // received events. -#if defined (ACE_HAS_EVENT_POLL) - struct epoll_event *& pfds = this->start_pevents_; - if (pfds < this->end_pevents_) -#else - struct pollfd *& pfds = this->start_pfds_; - if (pfds < this->end_pfds_) -#endif /* ACE_HAS_EVENT_POLL */ - { -#if defined (ACE_HAS_EVENT_POLL) - const ACE_HANDLE handle = pfds->data.fd; - __uint32_t &revents = pfds->events; -#else - const ACE_HANDLE handle = pfds->fd; - short &revents = pfds->revents; -#endif /* ACE_HAS_EVENT_POLL */ - - // Figure out what to do first in order to make it easier to manage - // the bit twiddling and possible pfds increment before releasing - // the token for dispatch. - // Note that if there's an error (such as the handle was closed - // without being removed from the event set) the EPOLLHUP and/or - // EPOLLERR bits will be set in revents. - bool disp_out = false; - bool disp_exc = false; - bool disp_in = false; - if (ACE_BIT_ENABLED (revents, out_event)) - { - disp_out = true; - ACE_CLR_BITS (revents, out_event); - } - else if (ACE_BIT_ENABLED (revents, exc_event)) - { - disp_exc = true; - ACE_CLR_BITS (revents, exc_event); - } - else if (ACE_BIT_ENABLED (revents, in_event)) - { - disp_in = true; - ACE_CLR_BITS (revents, in_event); - } - else if (ACE_BIT_ENABLED (revents, err_event)) - { - this->remove_handler_i (handle, ACE_Event_Handler::ALL_EVENTS_MASK); - ++pfds; - return 1; - } - else - { - ACE_ERROR ((LM_ERROR, ACE_TEXT (" (%t) dispatch_io h %d unknown events 0x%x\n"), handle, revents)); - // ACE_ASSERT (0); - } - - // Increment the pointer to the next element before we - // release the token. Otherwise event handlers end up being - // dispatched multiple times for the same poll. - if (revents == 0) - ++pfds; - - /* When using sys_epoll, we can attach arbitrary user - data to the descriptor, so it can be delivered when - activity is detected. Perhaps we should store event - handler together with descriptor, instead of looking - it up in a repository ? Could it boost performance ? - */ - ACE_Event_Handler *eh = this->handler_rep_.find (handle); - - if (eh) - { - // Modify the reference count in an exception-safe way. - // Note that eh could be the notify handler. It's not strictly - // necessary to manage its refcount, but since we don't enable - // the counting policy, it won't do much. Management of the - // notified handlers themselves is done in the notify handler. - ACE_Dev_Poll_Handler_Guard eh_guard (eh); - - // Release the reactor token before upcall. - guard.release_token (); - - // Dispatch the detected event - if (disp_out) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_output, handle); - - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::WRITE_MASK); - return 1; - } - - if (disp_exc) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_exception, handle); - - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::EXCEPT_MASK); - return 1; - } - - if (disp_in) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_input, handle); - - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::READ_MASK); - return 1; - } - } // The reactor token is reacquired upon leaving this scope. - } - - return 0; -} - -int -ACE_Dev_Poll_Reactor::alertable_handle_events (ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::alertable_handle_events"); - - return this->handle_events (max_wait_time); -} - -int -ACE_Dev_Poll_Reactor::handle_events (ACE_Time_Value &max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::handle_events"); - - return this->handle_events (&max_wait_time); -} - -int -ACE_Dev_Poll_Reactor::alertable_handle_events (ACE_Time_Value &max_wait_time) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::alertable_handle_events"); - - return this->handle_events (max_wait_time); -} - -int -ACE_Dev_Poll_Reactor::deactivated (void) -{ - return this->deactivated_; -} - -void -ACE_Dev_Poll_Reactor::deactivate (int do_stop) -{ - this->deactivated_ = do_stop; - this->wakeup_all_threads (); -} - -int -ACE_Dev_Poll_Reactor::register_handler (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->register_handler_i (handler->get_handle (), - handler, - mask); -} - -int -ACE_Dev_Poll_Reactor::register_handler (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->register_handler_i (handle, - event_handler, - mask); -} - -int -ACE_Dev_Poll_Reactor::register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler_i"); - - if (handle == ACE_INVALID_HANDLE - || mask == ACE_Event_Handler::NULL_MASK) - { - errno = EINVAL; - return -1; - } - - if (this->handler_rep_.find (handle) == 0) - { - // Handler not present in the repository. Bind it. - if (this->handler_rep_.bind (handle, event_handler, mask) != 0) - return -1; - -#if defined (ACE_HAS_EVENT_POLL) - - struct epoll_event epev; - ACE_OS::memset (&epev, 0, sizeof (epev)); - static const int op = EPOLL_CTL_ADD; - - epev.events = this->reactor_mask_to_poll_event (mask); - epev.data.fd = handle; - - if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) - { - ACE_ERROR ((LM_ERROR, "%p\n", "epoll_ctl")); - (void) this->handler_rep_.unbind (handle); - return -1; - } - -#endif /* ACE_HAS_EVENT_POLL */ - } - else - { - // Handler is already present in the repository, so register it - // again, possibly for different event. Add new mask to the - // current one. - if (this->mask_ops_i (handle, mask, ACE_Reactor::ADD_MASK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "mask_ops_i"), -1); - } - -#ifndef ACE_HAS_EVENT_POLL - - struct pollfd pfd; - - pfd.fd = handle; - pfd.events = this->reactor_mask_to_poll_event (mask); - pfd.revents = 0; - - // Add file descriptor to the "interest set." - if (ACE_OS::write (this->poll_fd_, &pfd, sizeof (pfd)) != sizeof (pfd)) - { - (void) this->handler_rep_.unbind (handle); - return -1; - } -#endif /*ACE_HAS_EVENT_POLL*/ - - // Note the fact that we've changed the state of the wait_set_, - // which is used by the dispatching loop to determine whether it can - // keep going or if it needs to reconsult select (). - // this->state_changed_ = 1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::register_handler ( - ACE_HANDLE /* event_handle */, - ACE_HANDLE /* io_handle */, - ACE_Event_Handler * /* event_handler */, - ACE_Reactor_Mask /* mask */) -{ - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor::register_handler (const ACE_Handle_Set &handle_set, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler"); - - ACE_Handle_Set_Iterator handle_iter (handle_set); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - // @@ It might be more efficient to construct a pollfd array and - // pass it to the write () call in register_handler_i () only once, - // instead of calling write () (a system call) once for each file - // descriptor. - - for (ACE_HANDLE h = handle_iter (); - h != ACE_INVALID_HANDLE; - h = handle_iter ()) - if (this->register_handler_i (h, event_handler, mask) == -1) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp, - ACE_Event_Handler **old_sh, - ACE_Sig_Action *old_disp) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler"); - - return this->signal_handler_->register_handler (signum, - new_sh, - new_disp, - old_sh, - old_disp); -} - -int -ACE_Dev_Poll_Reactor::register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::register_handler"); - - int result = 0; - -#if (ACE_NSIG > 0) - - for (int s = 1; s < ACE_NSIG; ++s) - if ((sigset.is_member (s) == 1) - && this->signal_handler_->register_handler (s, - new_sh, - new_disp) == -1) - result = -1; - -#else /* ACE_NSIG <= 0 */ - - ACE_UNUSED_ARG (sigset); - ACE_UNUSED_ARG (new_sh); - ACE_UNUSED_ARG (new_disp); - -#endif /* ACE_NSIG <= 0 */ - - return result; -} - -int -ACE_Dev_Poll_Reactor::remove_handler (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->remove_handler_i (handler->get_handle (), mask); -} - -int -ACE_Dev_Poll_Reactor::remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->remove_handler_i (handle, mask); -} - -int -ACE_Dev_Poll_Reactor::remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler_i"); - - ACE_Event_Handler *eh = this->handler_rep_.find (handle); - - if (eh == 0 || - this->mask_ops_i (handle, mask, ACE_Reactor::CLR_MASK) == -1) - return -1; - - // Check for ref counting now - handle_close () may delete eh. - bool const requires_reference_counting = - eh->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - - if (ACE_BIT_DISABLED (mask, ACE_Event_Handler::DONT_CALL)) - (void) eh->handle_close (handle, mask); - - // If there are no longer any outstanding events on the given handle - // then remove it from the handler repository. - if (this->handler_rep_.mask (handle) == ACE_Event_Handler::NULL_MASK) - this->handler_rep_.unbind (handle, requires_reference_counting); - - // Note the fact that we've changed the state of the wait_set, - // i.e. the "interest set," which is used by the dispatching loop to - // determine whether it can keep going or if it needs to reconsult - // /dev/poll or /dev/epoll. - // this->state_changed_ = 1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler"); - - ACE_Handle_Set_Iterator handle_iter (handle_set); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - // @@ It might be more efficient to construct a pollfd array and - // pass it to the write () call in register_handler_i () only once, - // instead of calling write () (a system call) once for each file - // descriptor. - - for (ACE_HANDLE h = handle_iter (); - h != ACE_INVALID_HANDLE; - h = handle_iter ()) - if (this->remove_handler_i (h, mask) == -1) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp, - int sigkey) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler"); - - return this->signal_handler_->remove_handler (signum, - new_disp, - old_disp, - sigkey); -} - -int -ACE_Dev_Poll_Reactor::remove_handler (const ACE_Sig_Set &sigset) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler"); - - int result = 0; - -#if (ACE_NSIG > 0) - - for (int s = 1; s < ACE_NSIG; ++s) - if ((sigset.is_member (s) == 1) - && this->signal_handler_->remove_handler (s) == -1) - result = -1; - -#else /* ACE_NSIG <= 0 */ - - ACE_UNUSED_ARG (sigset); - -#endif /* ACE_NSIG <= 0 */ - - return result; -} - -int -ACE_Dev_Poll_Reactor::suspend_handler (ACE_Event_Handler *event_handler) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handler"); - - if (event_handler == 0) - { - errno = EINVAL; - return -1; - } - - ACE_HANDLE handle = event_handler->get_handle (); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->suspend_handler_i (handle); -} - -int -ACE_Dev_Poll_Reactor::suspend_handler (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->suspend_handler_i (handle); -} - -int -ACE_Dev_Poll_Reactor::suspend_handler (const ACE_Handle_Set &handles) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handler"); - - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->suspend_handler_i (h) == -1) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::suspend_handlers (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handlers"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - size_t const len = this->handler_rep_.size (); - - for (size_t i = 0; i < len; ++i) - if (this->handler_rep_.suspended (i) == 0 - && this->suspend_handler_i (i) != 0) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::suspend_handler_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handler_i"); - - if (this->handler_rep_.find (handle) == 0) - return -1; - - if (this->handler_rep_.suspended (handle)) - return 0; // Already suspended. @@ Should this be an error? - - // Remove the handle from the "interest set." - // - // Note that the associated event handler is still in the handler - // repository, but no events will be polled on the given handle thus - // no event will be dispatched to the event handler. - -#if defined (ACE_HAS_EVENT_POLL) - - struct epoll_event epev; - ACE_OS::memset (&epev, 0, sizeof (epev)); - static const int op = EPOLL_CTL_DEL; - - epev.events = 0; - epev.data.fd = handle; - - if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) - return -1; - -#else - - struct pollfd pfd[1]; - - pfd[0].fd = handle; - pfd[0].events = POLLREMOVE; - pfd[0].revents = 0; - - if (ACE_OS::write (this->poll_fd_, pfd, sizeof (pfd)) != sizeof (pfd)) - return -1; - -#endif /* ACE_HAS_EVENT_POLL */ - - this->handler_rep_.suspend (handle); - - return 0; -} - -int -ACE_Dev_Poll_Reactor::resume_handler (ACE_Event_Handler *event_handler) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handler"); - - if (event_handler == 0) - { - errno = EINVAL; - return -1; - } - - ACE_HANDLE handle = event_handler->get_handle (); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->resume_handler_i (handle); -} - -int -ACE_Dev_Poll_Reactor::resume_handler (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handler"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->resume_handler_i (handle); -} - -int -ACE_Dev_Poll_Reactor::resume_handler (const ACE_Handle_Set &handles) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handler"); - - ACE_Handle_Set_Iterator handle_iter (handles); - ACE_HANDLE h; - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->resume_handler_i (h) == -1) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::resume_handlers (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handlers"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - size_t const len = this->handler_rep_.size (); - - for (size_t i = 0; i < len; ++i) - if (this->handler_rep_.suspended (i) - && this->resume_handler_i (i) != 0) - return -1; - - return 0; -} - -int -ACE_Dev_Poll_Reactor::resume_handler_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handler_i"); - - if (this->handler_rep_.find (handle) == 0 - && this->handler_rep_.suspended (handle) == 0) - return -1; - - ACE_Reactor_Mask mask = this->handler_rep_.mask (handle); - - if (mask == ACE_Event_Handler::NULL_MASK) - return -1; - - // Place the handle back in to the "interest set." - // - // Events for the given handle will once again be polled. - -#if defined (ACE_HAS_EVENT_POLL) - - struct epoll_event epev; - ACE_OS::memset (&epev, 0, sizeof (epev)); - static const int op = EPOLL_CTL_ADD; - - epev.events = this->reactor_mask_to_poll_event (mask); - epev.data.fd = handle; - - if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) - return -1; - -#else - - struct pollfd pfd[1]; - - pfd[0].fd = handle; - pfd[0].events = this->reactor_mask_to_poll_event (mask); - pfd[0].revents = 0; - - if (ACE_OS::write (this->poll_fd_, pfd, sizeof (pfd)) != sizeof (pfd)) - return -1; - -#endif /* ACE_HAS_EVENT_POLL */ - - this->handler_rep_.resume (handle); - - return 0; -} - -int -ACE_Dev_Poll_Reactor::resumable_handler (void) -{ - // @@ Is this correct? - - return 0; -} - -int -ACE_Dev_Poll_Reactor::uses_event_associations (void) -{ - // Since the Dev_Poll_Reactor does not do any event associations, - // this method always return zero. - return 0; -} - -long -ACE_Dev_Poll_Reactor::schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::schedule_timer"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - if (0 != this->timer_queue_) - return this->timer_queue_->schedule - (event_handler, - arg, - this->timer_queue_->gettimeofday () + delay, - interval); - - errno = ESHUTDOWN; - return -1; -} - -int -ACE_Dev_Poll_Reactor::reset_timer_interval (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::reset_timer_interval"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - if (0 != this->timer_queue_) - return this->timer_queue_->reset_interval (timer_id, interval); - - errno = ESHUTDOWN; - return -1; -} - -int -ACE_Dev_Poll_Reactor::cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::cancel_timer"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return (this->timer_queue_ == 0 - ? 0 - : this->timer_queue_->cancel (event_handler, - dont_call_handle_close)); -} - -int -ACE_Dev_Poll_Reactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::cancel_timer"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return (this->timer_queue_ == 0 - ? 0 - : this->timer_queue_->cancel (timer_id, - arg, - dont_call_handle_close)); -} - -int -ACE_Dev_Poll_Reactor::schedule_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::schedule_wakeup"); - - return this->mask_ops (eh->get_handle (), mask, ACE_Reactor::ADD_MASK); -} - -int -ACE_Dev_Poll_Reactor::schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::schedule_wakeup"); - - return this->mask_ops (handle, mask, ACE_Reactor::ADD_MASK); -} - -int -ACE_Dev_Poll_Reactor::cancel_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::cancel_wakeup"); - - return this->mask_ops (eh->get_handle (), mask, ACE_Reactor::CLR_MASK); -} - -int -ACE_Dev_Poll_Reactor::cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::cancel_wakeup"); - - return this->mask_ops (handle, mask, ACE_Reactor::CLR_MASK); -} - -int -ACE_Dev_Poll_Reactor::notify (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::notify"); - - ssize_t n = 0; - - // Pass over both the Event_Handler *and* the mask to allow the - // caller to dictate which Event_Handler method the receiver - // invokes. Note that this call can timeout. - - n = this->notify_handler_->notify (eh, mask, timeout); - - return n == -1 ? -1 : 0; -} - -void -ACE_Dev_Poll_Reactor::max_notify_iterations (int iterations) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::max_notify_iterations"); - - ACE_MT (ACE_GUARD (ACE_Dev_Poll_Reactor_Token, mon, this->token_)); - - this->notify_handler_->max_notify_iterations (iterations); -} - -int -ACE_Dev_Poll_Reactor::max_notify_iterations (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::max_notify_iterations"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->notify_handler_->max_notify_iterations (); -} - -int -ACE_Dev_Poll_Reactor::purge_pending_notifications (ACE_Event_Handler * eh, - ACE_Reactor_Mask mask) -{ - if (this->notify_handler_ == 0) - return 0; - - return this->notify_handler_->purge_pending_notifications (eh, mask); -} - -ACE_Event_Handler * -ACE_Dev_Poll_Reactor::find_handler (ACE_HANDLE handle) -{ - ACE_MT (ACE_READ_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, 0)); - - ACE_Event_Handler *event_handler = this->handler_rep_.find (handle); - if (event_handler) - event_handler->add_reference (); - return event_handler; -} - -int -ACE_Dev_Poll_Reactor::handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::handler"); - - ACE_MT (ACE_READ_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - ACE_Event_Handler *h = this->handler_rep_.find (handle); - - if (h != 0 - && ACE_BIT_CMP_MASK (this->handler_rep_.mask (handle), - mask, // Compare all bits in the mask - mask)) - { - if (event_handler != 0) - *event_handler = h; - - return 0; - } - - return -1; -} - -int -ACE_Dev_Poll_Reactor::handler (int signum, - ACE_Event_Handler **eh) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::handler"); - - ACE_Event_Handler *handler = this->signal_handler_->handler (signum); - - if (handler == 0) - return -1; - else if (eh != 0) - *eh = handler; - - return 0; -} - -bool -ACE_Dev_Poll_Reactor::initialized (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::initialized"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, false)); - - return this->initialized_; -} - -size_t -ACE_Dev_Poll_Reactor::size (void) const -{ - return this->size_; -} - -ACE_Lock & -ACE_Dev_Poll_Reactor::lock (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::lock"); - - return this->lock_adapter_; -} - -void -ACE_Dev_Poll_Reactor::wakeup_all_threads (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::wakeup_all_threads"); - - // Send a notification, but don't block if there's no one to receive - // it. - this->notify (0, - ACE_Event_Handler::NULL_MASK, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -int -ACE_Dev_Poll_Reactor::owner (ACE_thread_t /* new_owner */, - ACE_thread_t * /* old_owner */) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::owner"); - - // There is no need to set the owner of the event loop. Multiple - // threads may invoke the event loop simulataneously. - - return 0; -} - -int -ACE_Dev_Poll_Reactor::owner (ACE_thread_t * /* owner */) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::owner"); - - // There is no need to set the owner of the event loop. Multiple - // threads may invoke the event loop simulataneously. - - return 0; -} - -int -ACE_Dev_Poll_Reactor::restart (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::restart"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->restart_; -} - -int -ACE_Dev_Poll_Reactor::restart (int r) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::restart"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - int current_value = this->restart_; - this->restart_ = r; - return current_value; -} - -void -ACE_Dev_Poll_Reactor::requeue_position (int) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::requeue_position"); -} - -int -ACE_Dev_Poll_Reactor::requeue_position (void) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::requeue_position"); - - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor::mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::mask_ops"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->mask_ops_i (event_handler->get_handle (), mask, ops); -} - -int -ACE_Dev_Poll_Reactor::mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::mask_ops"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - - return this->mask_ops_i (handle, mask, ops); -} - -int -ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::mask_ops_i"); - - if (this->handler_rep_.handle_in_range (handle) == 0) - return -1; - - // Block out all signals until method returns. - ACE_Sig_Guard sb; - - ACE_Reactor_Mask const old_mask = this->handler_rep_.mask (handle); - ACE_Reactor_Mask new_mask = old_mask; - - // Perform GET, CLR, SET, and ADD operations on the interest/wait - // set and the suspend set (if necessary). - // - // GET = 1, Retrieve current value - // SET = 2, Set value of bits to new mask (changes the entire mask) - // ADD = 3, Bitwise "or" the value into the mask (only changes - // enabled bits) - // CLR = 4 Bitwise "and" the negation of the value out of the mask - // (only changes enabled bits) - // - // Returns the original mask. - - switch (ops) - { - case ACE_Reactor::GET_MASK: - // The work for this operation is done in all cases at the - // begining of the function. - return old_mask; - - case ACE_Reactor::CLR_MASK: - ACE_CLR_BITS (new_mask, mask); - break; - - case ACE_Reactor::SET_MASK: - new_mask = mask; - break; - - case ACE_Reactor::ADD_MASK: - ACE_SET_BITS (new_mask, mask); - break; - - default: - return -1; - } - - /// Reset the mask for the given handle. - this->handler_rep_.mask (handle, new_mask); - - if (this->handler_rep_.suspended (handle) == 0) - { - // Only attempt to alter events for the handle from the - // "interest set" if it hasn't been suspended. - - short const events = this->reactor_mask_to_poll_event (new_mask); - -#if defined (sun) - // Apparently events cannot be updated on-the-fly on Solaris so - // remove the existing events, and then add the new ones. - struct pollfd pfd[2]; - - pfd[0].fd = handle; - pfd[0].events = POLLREMOVE; - pfd[0].revents = 0; - pfd[1].fd = (events == POLLREMOVE ? ACE_INVALID_HANDLE : handle); - pfd[1].events = events; - pfd[1].revents = 0; - - // Change the events associated with the given file descriptor. - if (ACE_OS::write (this->poll_fd_, - pfd, - sizeof (pfd)) != sizeof (pfd)) - return -1; -#elif defined (ACE_HAS_EVENT_POLL) - - struct epoll_event epev; - ACE_OS::memset (&epev, 0, sizeof (epev)); - int op; - - // ACE_Event_Handler::NULL_MASK ??? - if (new_mask == 0) - { - op = EPOLL_CTL_DEL; - epev.events = 0; - } - else - { - op = EPOLL_CTL_MOD; - epev.events = events; - } - - epev.data.fd = handle; - - if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) - { - // If a handle is closed, epoll removes it from the poll set - // automatically - we may not know about it yet. If that's the - // case, a mod operation will fail with ENOENT. Retry it as - // an add. - if (op == EPOLL_CTL_MOD && errno == ENOENT && - ::epoll_ctl (this->poll_fd_, EPOLL_CTL_ADD, handle, &epev) == -1) - return -1; - } - -#else - pollfd pfd[1]; - - pfd[0].fd = handle; - pfd[0].events = events; - pfd[0].revents = 0; - - // Change the events associated with the given file descriptor. - if (ACE_OS::write (this->poll_fd_, - pfd, - sizeof (pfd)) != sizeof (pfd)) - return -1; -#endif /*ACE_HAS_EVENT_POLL */ - } - - return old_mask; -} - -int -ACE_Dev_Poll_Reactor::ready_ops (ACE_Event_Handler * /* event_handler */, - ACE_Reactor_Mask /* mask */, - int /* ops */) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::ready_ops"); - - // Since the Dev_Poll_Reactor uses the poll result buffer, the - // ready_set cannot be directly manipulated outside of the event - // loop. - ACE_NOTSUP_RETURN (-1); -} - -int -ACE_Dev_Poll_Reactor::ready_ops (ACE_HANDLE /* handle */, - ACE_Reactor_Mask /* mask */, - int /* ops */) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::ready_ops"); - - // Since the Dev_Poll_Reactor uses the poll result buffer, the - // ready_set cannot be directly manipulated outside of the event - // loop. - ACE_NOTSUP_RETURN (-1); -} - -void -ACE_Dev_Poll_Reactor::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Dev_Poll_Reactor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("restart_ = %d\n"), this->restart_)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("initialized_ = %d"), - this->initialized_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("poll_fd_ = %d"), this->poll_fd_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("size_ = %u"), this->size_)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("deactivated_ = %d"), - this->deactivated_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -short -ACE_Dev_Poll_Reactor::reactor_mask_to_poll_event (ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::reactor_mask_to_poll_event"); - - if (mask == ACE_Event_Handler::NULL_MASK) - // No event. Remove from interest set. -#if defined (ACE_HAS_EVENT_POLL) - return EPOLL_CTL_DEL; -#else - return POLLREMOVE; -#endif /* ACE_HAS_EVENT_POLL */ - - short events = 0; - - // READ, ACCEPT, and CONNECT flag will place the handle in the - // read set. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK) - || ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK) - || ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)) - { -#if defined (ACE_HAS_EVENT_POLL) - ACE_SET_BITS (events, EPOLLIN); -#else - ACE_SET_BITS (events, POLLIN); -#endif /*ACE_HAS_EVENT_POLL*/ - } - - // WRITE and CONNECT flag will place the handle in the write set. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK) - || ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)) - { -#if defined (ACE_HAS_EVENT_POLL) - ACE_SET_BITS (events, EPOLLOUT); -#else - ACE_SET_BITS (events, POLLOUT); -#endif /*ACE_HAS_EVENT_POLL*/ - } - - // EXCEPT flag will place the handle in the except set. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - { -#if defined (ACE_HAS_EVENT_POLL) - ACE_SET_BITS (events, EPOLLPRI); -#else - ACE_SET_BITS (events, POLLPRI); -#endif /*ACE_HAS_EVENT_POLL*/ - } - - return events; -} - -namespace { - void polite_sleep_hook (void *) { } -} - -int -ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly (ACE_Time_Value *max_wait) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly"); - - // Acquire the token but don't ping any waiters; just queue up politely. - int result = 0; - if (max_wait) - { - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait; - - ACE_MT (result = this->token_.acquire_read (&polite_sleep_hook, - 0, - &tv)); - } - else - { - ACE_MT (result = this->token_.acquire_read (&polite_sleep_hook)); - } - - // Check for timeouts and errors. - if (result == -1) - { - if (errno == ETIME) - return 0; - else - { - ACE_ERROR ((LM_ERROR, "%t: %p\n", "token acquire_read")); - return -1; - } - } - - // We got the token and so let us mark ourselves as owner - this->owner_ = 1; - - return result; -} - -int -ACE_Dev_Poll_Reactor::Token_Guard::acquire (ACE_Time_Value *max_wait) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor::Token_Guard::acquire"); - - // Try to grab the token. If someone if already there, don't wake - // them up, just queue up in the thread pool. - int result = 0; - if (max_wait) - { - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait; - - ACE_MT (result = this->token_.acquire (0, 0, &tv)); - } - else - { - ACE_MT (result = this->token_.acquire ()); - } - - // Check for timeouts and errors. - if (result == -1) - { - if (errno == ETIME) - return 0; - else - return -1; - } - - // We got the token and so let us mark ourseleves as owner - this->owner_ = 1; - - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */ - diff --git a/dep/src/ace/Dirent.cpp b/dep/src/ace/Dirent.cpp deleted file mode 100644 index 180642fc0f9..00000000000 --- a/dep/src/ace/Dirent.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// $Id: Dirent.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Dirent.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dirent.inl" -#endif /* __ACE_INLINE__ */ - diff --git a/dep/src/ace/Dirent_Selector.cpp b/dep/src/ace/Dirent_Selector.cpp deleted file mode 100644 index 875a466e5b3..00000000000 --- a/dep/src/ace/Dirent_Selector.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id: Dirent_Selector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Dirent_Selector.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dirent_Selector.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS_NS_dirent.h" -#include "ace/OS_NS_stdlib.h" - -ACE_RCSID (ace, - Dirent_Selector, - "$Id: Dirent_Selector.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Construction/Destruction - -ACE_Dirent_Selector::ACE_Dirent_Selector (void) - : namelist_ (0), - n_ (0) -{ -} - -ACE_Dirent_Selector::~ACE_Dirent_Selector (void) -{ - // Free up any allocated resources. - this->close(); -} - -int -ACE_Dirent_Selector::open (const ACE_TCHAR *dir, - ACE_SCANDIR_SELECTOR sel, - ACE_SCANDIR_COMPARATOR cmp) -{ - n_ = ACE_OS::scandir (dir, &this->namelist_, sel, cmp); - return n_; -} - -int -ACE_Dirent_Selector::close (void) -{ - for (--n_; n_ >= 0; --n_) - { -#if defined (ACE_LACKS_STRUCT_DIR) - // Only the lacking-struct-dir emulation allocates this. Native - // scandir includes d_name in the dirent struct itself. - ACE_OS::free (this->namelist_[n_]->d_name); -#endif - ACE_OS::free (this->namelist_[n_]); - } - - ACE_OS::free (this->namelist_); - this->namelist_ = 0; - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Dump.cpp b/dep/src/ace/Dump.cpp deleted file mode 100644 index fce6bcc277a..00000000000 --- a/dep/src/ace/Dump.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// $Id: Dump.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Dump.h" -#include "ace/Guard_T.h" -#include "ace/Thread_Mutex.h" -#include "ace/Object_Manager.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, Dump, "$Id: Dump.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Implementations (very simple for now...) - -ACE_Dumpable::~ACE_Dumpable (void) -{ - ACE_TRACE ("ACE_Dumpable::~ACE_Dumpable"); -} - -ACE_Dumpable::ACE_Dumpable (const void *this_ptr) - : this_ (this_ptr) -{ - ACE_TRACE ("ACE_Dumpable::ACE_Dumpable"); -} - -ACE_Dumpable_Ptr::ACE_Dumpable_Ptr (const ACE_Dumpable *dumper) - : dumper_ (dumper) -{ - ACE_TRACE ("ACE_Dumpable_Ptr::ACE_Dumpable_Ptr"); -} - -const ACE_Dumpable * -ACE_Dumpable_Ptr::operator->() const -{ - ACE_TRACE ("ACE_Dumpable_Ptr::operator->"); - return this->dumper_; -} - -void -ACE_Dumpable_Ptr::operator= (const ACE_Dumpable *dumper) const -{ - ACE_TRACE ("ACE_Dumpable_Ptr::operator="); - if (this->dumper_ != dumper) - { - delete const_cast (this->dumper_); - (const_cast (this))->dumper_ = dumper; - } -} - -ACE_ODB::ACE_ODB (void) - // Let the Tuple default constructor initialize object_table_ - : current_size_ (0) -{ - ACE_TRACE ("ACE_ODB::ACE_ODB"); -} - -ACE_ODB * -ACE_ODB::instance (void) -{ - ACE_TRACE ("ACE_ODB::instance"); - - if (ACE_ODB::instance_ == 0) - { - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_DUMP_LOCK); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); - - if (ACE_ODB::instance_ == 0) - ACE_NEW_RETURN (ACE_ODB::instance_, - ACE_ODB, - 0); - } - - return ACE_ODB::instance_; -} - -void -ACE_ODB::dump_objects (void) -{ - ACE_TRACE ("ACE_ODB::dump_objects"); - for (int i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ != 0) - // Dump the state of the object. - this->object_table_[i].dumper_->dump (); - } -} - -// This method registers a new . It detects -// duplicates and simply overwrites them. - -void -ACE_ODB::register_object (const ACE_Dumpable *dumper) -{ - ACE_TRACE ("ACE_ODB::register_object"); - int i; - int slot = 0; - - for (i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ == 0) - slot = i; - else if (this->object_table_[i].this_ == dumper->this_) - { - slot = i; - break; - } - } - - if (i == this->current_size_) - { - slot = this->current_size_++; - ACE_ASSERT (this->current_size_ < ACE_ODB::MAX_TABLE_SIZE); - } - this->object_table_[slot].this_ = dumper->this_; - this->object_table_[slot].dumper_ = dumper; -} - -void -ACE_ODB::remove_object (const void *this_ptr) -{ - ACE_TRACE ("ACE_ODB::remove_object"); - int i; - - for (i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ == this_ptr) - break; - } - - if (i < this->current_size_) - { - this->object_table_[i].this_ = 0; - this->object_table_[i].dumper_ = 0; - } -} - -ACE_ODB *ACE_ODB::instance_ = 0; - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Dump_T.cpp b/dep/src/ace/Dump_T.cpp deleted file mode 100644 index 5432b1b6e51..00000000000 --- a/dep/src/ace/Dump_T.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Dump_T.cpp -// -// $Id: Dump_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_DUMP_T_CPP -#define ACE_DUMP_T_CPP - -#include "ace/Dump_T.h" -#include "ace/Global_Macros.h" -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Dumpable_Adapter::~ACE_Dumpable_Adapter (void) -{ - ACE_TRACE ("ACE_Dumpable_Adapter::~ACE_Dumpable_Adapter"); -} - -template -ACE_Dumpable_Adapter::ACE_Dumpable_Adapter (const Concrete *t) - : ACE_Dumpable ((const void *) t), this_ (t) -{ - ACE_TRACE ("ACE_Dumpable_Adapter::ACE_Dumpable_Adapter"); -} - -template Concrete * -ACE_Dumpable_Adapter::operator->() const -{ - return (Concrete *) this->this_; -} - -template void -ACE_Dumpable_Adapter::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Dumpable_Adapter::dump"); - this->this_->dump (); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_DUMP_T_CPP */ - diff --git a/dep/src/ace/Dynamic.cpp b/dep/src/ace/Dynamic.cpp deleted file mode 100644 index 2a3f8b0f26d..00000000000 --- a/dep/src/ace/Dynamic.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// $Id: Dynamic.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Dynamic.h" -#include "ace/Singleton.h" -#include "ace/TSS_T.h" -#include "ace/Synch_Traits.h" -#include "ace/Null_Mutex.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dynamic.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Dynamic, "$Id: Dynamic.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Dynamic::ACE_Dynamic (void) - : is_dynamic_ (false) -{ - ACE_TRACE ("ACE_Dynamic::ACE_Dynamic"); -} - -/* static */ ACE_Dynamic * -ACE_Dynamic::instance (void) -{ - return ACE_TSS_Singleton::instance (); -} - -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_TSS_Singleton * - ACE_TSS_Singleton::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Dynamic_Message_Strategy.cpp b/dep/src/ace/Dynamic_Message_Strategy.cpp deleted file mode 100644 index 1fa3320d5ae..00000000000 --- a/dep/src/ace/Dynamic_Message_Strategy.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "ace/Dynamic_Message_Strategy.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dynamic_Message_Strategy.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Guard_T.h" -#include "ace/Log_Msg.h" -#include "ace/Malloc_Base.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (ace, - Dynamic_Message_Strategy, - "$Id: Dynamic_Message_Strategy.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// ctor - -ACE_Dynamic_Message_Strategy::ACE_Dynamic_Message_Strategy (unsigned long static_bit_field_mask, - unsigned long static_bit_field_shift, - unsigned long dynamic_priority_max, - unsigned long dynamic_priority_offset) - : static_bit_field_mask_ (static_bit_field_mask), - static_bit_field_shift_ (static_bit_field_shift), - dynamic_priority_max_ (dynamic_priority_max), - dynamic_priority_offset_ (dynamic_priority_offset), - max_late_ (0, dynamic_priority_offset - 1), - min_pending_ (0, dynamic_priority_offset), - pending_shift_ (0, dynamic_priority_max) -{ -} - -// dtor - -ACE_Dynamic_Message_Strategy::~ACE_Dynamic_Message_Strategy (void) -{ -} - -ACE_Dynamic_Message_Strategy::Priority_Status -ACE_Dynamic_Message_Strategy::priority_status (ACE_Message_Block & mb, - const ACE_Time_Value & tv) -{ - // default the message to have pending priority status - Priority_Status status = ACE_Dynamic_Message_Strategy::PENDING; - - // start with the passed absolute time as the message's priority, then - // call the polymorphic hook method to (at least partially) convert - // the absolute time and message attributes into the message's priority - ACE_Time_Value priority (tv); - convert_priority (priority, mb); - - // if the priority is negative, the message is pending - if (priority < ACE_Time_Value::zero) - { - // priority for pending messages must be shifted - // upward above the late priority range - priority += pending_shift_; - if (priority < min_pending_) - priority = min_pending_; - } - // otherwise, if the priority is greater than the maximum late - // priority value that can be represented, it is beyond late - else if (priority > max_late_) - { - // all messages that are beyond late are assigned lowest priority (zero) - mb.msg_priority (0); - return ACE_Dynamic_Message_Strategy::BEYOND_LATE; - } - // otherwise, the message is late, but its priority is correct - else - status = ACE_Dynamic_Message_Strategy::LATE; - - // use (fast) bitwise operators to isolate and replace - // the dynamic portion of the message's priority - mb.msg_priority((mb.msg_priority() & static_bit_field_mask_) | - ((priority.usec () + - ACE_ONE_SECOND_IN_USECS * (suseconds_t)(priority.sec())) << - static_bit_field_shift_)); - - // returns the priority status of the message - return status; -} - -// Dump the state of the strategy. - -void -ACE_Dynamic_Message_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Dynamic_Message_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("static_bit_field_mask_ = %u\n") - ACE_TEXT ("static_bit_field_shift_ = %u\n") - ACE_TEXT ("dynamic_priority_max_ = %u\n") - ACE_TEXT ("dynamic_priority_offset_ = %u\n") - ACE_TEXT ("max_late_ = [%d sec, %d usec]\n") - ACE_TEXT ("min_pending_ = [%d sec, %d usec]\n") - ACE_TEXT ("pending_shift_ = [%d sec, %d usec]\n"), - this->static_bit_field_mask_, - this->static_bit_field_shift_, - this->dynamic_priority_max_, - this->dynamic_priority_offset_, - this->max_late_.sec (), - this->max_late_.usec (), - this->min_pending_.sec (), - this->min_pending_.usec (), - this->pending_shift_.sec (), - this->pending_shift_.usec ())); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Deadline_Message_Strategy::ACE_Deadline_Message_Strategy (unsigned long static_bit_field_mask, - unsigned long static_bit_field_shift, - unsigned long dynamic_priority_max, - unsigned long dynamic_priority_offset) - : ACE_Dynamic_Message_Strategy (static_bit_field_mask, - static_bit_field_shift, - dynamic_priority_max, - dynamic_priority_offset) -{ -} - -ACE_Deadline_Message_Strategy::~ACE_Deadline_Message_Strategy (void) -{ -} - -void -ACE_Deadline_Message_Strategy::convert_priority (ACE_Time_Value & priority, - const ACE_Message_Block & mb) -{ - // Convert absolute time passed in tv to negative time - // to deadline of mb with respect to that absolute time. - priority -= mb.msg_deadline_time (); -} - // dynamic priority conversion function based on time to deadline - -void -ACE_Deadline_Message_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Deadline_Message_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class: \n"))); - this->ACE_Dynamic_Message_Strategy::dump (); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nderived class: ACE_Deadline_Message_Strategy\n"))); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Laxity_Message_Strategy::ACE_Laxity_Message_Strategy (unsigned long static_bit_field_mask, - unsigned long static_bit_field_shift, - unsigned long dynamic_priority_max, - unsigned long dynamic_priority_offset) - : ACE_Dynamic_Message_Strategy (static_bit_field_mask, - static_bit_field_shift, - dynamic_priority_max, - dynamic_priority_offset) -{ -} - -ACE_Laxity_Message_Strategy::~ACE_Laxity_Message_Strategy (void) -{ -} - -void -ACE_Laxity_Message_Strategy::convert_priority (ACE_Time_Value & priority, - const ACE_Message_Block & mb) -{ - // Convert absolute time passed in tv to negative - // laxity of mb with respect to that absolute time. - priority += mb.msg_execution_time (); - priority -= mb.msg_deadline_time (); -} - // dynamic priority conversion function based on laxity - -void -ACE_Laxity_Message_Strategy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Laxity_Message_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class: \n"))); - this->ACE_Dynamic_Message_Strategy::dump (); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nderived class: ACE_Laxity_Message_Strategy\n"))); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - // Dump the state of the strategy. - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Dynamic_Service.cpp b/dep/src/ace/Dynamic_Service.cpp deleted file mode 100644 index 900419bd846..00000000000 --- a/dep/src/ace/Dynamic_Service.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// $Id: Dynamic_Service.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_DYNAMIC_SERVICE_CPP -#define ACE_DYNAMIC_SERVICE_CPP - -#include "ace/Dynamic_Service.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dynamic_Service.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - - -template TYPE * -ACE_Dynamic_Service::instance (const ACE_TCHAR *name) -{ - ACE_Service_Object * svc_obj = - static_cast - (ACE_Dynamic_Service_Base::instance (name,false)); - return dynamic_cast (svc_obj); -} - -template TYPE * -ACE_Dynamic_Service::instance (const ACE_TCHAR *name, - bool no_global) -{ - ACE_Service_Object * svc_obj = - static_cast - (ACE_Dynamic_Service_Base::instance (name, no_global)); - return dynamic_cast (svc_obj); -} - -template TYPE * -ACE_Dynamic_Service::instance (const ACE_Service_Gestalt* conf, - const ACE_TCHAR *name) -{ - ACE_Service_Object * svc_obj = - static_cast - (ACE_Dynamic_Service_Base::instance (conf, name, false)); - return dynamic_cast (svc_obj); -} - -template TYPE * -ACE_Dynamic_Service::instance (const ACE_Service_Gestalt* conf, - const ACE_TCHAR *name, - bool no_global) -{ - ACE_Service_Object * svc_obj = - static_cast - (ACE_Dynamic_Service_Base::instance (conf, name, no_global)); - return dynamic_cast (svc_obj); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_DYNAMIC_SERVICE_CPP */ - diff --git a/dep/src/ace/Dynamic_Service_Base.cpp b/dep/src/ace/Dynamic_Service_Base.cpp deleted file mode 100644 index 474c485b6ff..00000000000 --- a/dep/src/ace/Dynamic_Service_Base.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "ace/Dynamic_Service_Base.h" -#include "ace/ACE.h" -#include "ace/Service_Config.h" -#include "ace/Service_Repository.h" -#include "ace/Service_Types.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (ace, - Dynamic_Service_Base, - "$Id: Dynamic_Service_Base.cpp 80826 2008-03-04 14:51:23Z wotte $") - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Dynamic_Service_Base::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Dynamic_Service_Base::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Get the instance using for the current global -// service configuration repository. - -void * -ACE_Dynamic_Service_Base::instance (const ACE_TCHAR *name, bool no_global) -{ - ACE_TRACE ("ACE_Dynamic_Service_Base::instance"); - return instance (ACE_Service_Config::current (), name, no_global); -} - -// Find a service registration - -const ACE_Service_Type * -ACE_Dynamic_Service_Base::find_i (const ACE_Service_Gestalt* &repo, - const ACE_TCHAR *name, - bool no_global) -{ - ACE_TRACE ("ACE_Dynamic_Service_Base::find_i"); - const ACE_Service_Type *svc_rec = 0; - - ACE_Service_Gestalt* global = ACE_Service_Config::global (); - - for (; (repo->find (name, &svc_rec) == -1) && !no_global; repo = global) - { - // Check the static repo, too if different - if (repo == global) - break; - } - - return svc_rec; -} - -// Get the instance using for specific configuration repository. -void * -ACE_Dynamic_Service_Base::instance (const ACE_Service_Gestalt* repo, - const ACE_TCHAR *name, - bool no_global) -{ - ACE_TRACE ("ACE_Dynamic_Service_Base::instance"); - - void *obj = 0; - const ACE_Service_Type_Impl *type = 0; - - const ACE_Service_Gestalt* repo_found = repo; - const ACE_Service_Type *svc_rec = find_i (repo_found, name, no_global); - if (svc_rec != 0) - { - type = svc_rec->type (); - if (type != 0) - obj = type->object (); - } - - if (ACE::debug ()) - { - ACE_Guard log_guard (*ACE_Log_Msg::instance ()); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DSB::instance, repo=%@, name=%s") - ACE_TEXT (" type=%@ => %@"), - repo->repo_, name, type, obj)); - - if (repo->repo_ != repo_found->repo_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" [in repo=%@]\n"), - repo_found->repo_)); - else - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - } - - return obj; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Dynamic_Service_Dependency.cpp b/dep/src/ace/Dynamic_Service_Dependency.cpp deleted file mode 100644 index 8e814af86a7..00000000000 --- a/dep/src/ace/Dynamic_Service_Dependency.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "ace/ACE.h" -#include "ace/DLL_Manager.h" -#include "ace/Dynamic_Service_Dependency.h" -#include "ace/Service_Config.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (ace, - Dynamic_Service_Dependency, - "$Id: Dynamic_Service_Dependency.cpp 80826 2008-03-04 14:51:23Z wotte $") - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Dynamic_Service_Dependency::ACE_Dynamic_Service_Dependency (const ACE_TCHAR *principal) -{ - this->init (ACE_Service_Config::current (), principal); -} - -ACE_Dynamic_Service_Dependency::ACE_Dynamic_Service_Dependency (const ACE_Service_Gestalt *cfg, - const ACE_TCHAR *principal) -{ - this->init (cfg, principal); -} - -ACE_Dynamic_Service_Dependency::~ACE_Dynamic_Service_Dependency (void) -{ - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) DSD, this=%@ - destroying\n"), - this)); -} - -void -ACE_Dynamic_Service_Dependency::init (const ACE_Service_Gestalt *cfg, - const ACE_TCHAR *principal) -{ - const ACE_Service_Type* st = - ACE_Dynamic_Service_Base::find_i (cfg, principal,false); - if (ACE::debug ()) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) DSD, this=%@ - creating dependency on "), this)); - st->dump (); - } - this->tracker_ = st->dll (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Encoding_Converter.cpp b/dep/src/ace/Encoding_Converter.cpp deleted file mode 100644 index e01c15ef865..00000000000 --- a/dep/src/ace/Encoding_Converter.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// $Id: Encoding_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $ -#include "ace/Encoding_Converter.h" - -#if defined (ACE_USES_WCHAR) -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Encoding_Converter::~ACE_Encoding_Converter (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - diff --git a/dep/src/ace/Encoding_Converter_Factory.cpp b/dep/src/ace/Encoding_Converter_Factory.cpp deleted file mode 100644 index 3cd365f3ae1..00000000000 --- a/dep/src/ace/Encoding_Converter_Factory.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id: Encoding_Converter_Factory.cpp 80826 2008-03-04 14:51:23Z wotte $ -#include "ace/Encoding_Converter_Factory.h" - -#if defined (ACE_USES_WCHAR) -#include "ace/UTF32_Encoding_Converter.h" -#include "ace/UTF16_Encoding_Converter.h" -#include "ace/UTF8_Encoding_Converter.h" -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Encoding_Converter* -ACE_Encoding_Converter_Factory::create ( - const ACE_Byte* source, - size_t source_size, - ACE_Encoding_Converter_Factory::Encoding_Hint hint) -{ -#if defined (ACE_BIG_ENDIAN) - bool const convert_for_bigendian = true; -#else - bool const convert_for_bigendian = false; -#endif /* ACE_BIG_ENDIAN */ - ACE_Encoding_Converter* converter = 0; - - switch (hint) - { - case ACE_UTF_32BE: - ACE_NEW_RETURN (converter, - ACE_UTF32_Encoding_Converter (!convert_for_bigendian), - 0); - break; - case ACE_UTF_32LE: - ACE_NEW_RETURN (converter, - ACE_UTF32_Encoding_Converter (convert_for_bigendian), - 0); - break; - case ACE_UTF_16BE: - ACE_NEW_RETURN (converter, - ACE_UTF16_Encoding_Converter (!convert_for_bigendian), - 0); - break; - case ACE_UTF_16LE: - ACE_NEW_RETURN (converter, - ACE_UTF16_Encoding_Converter (convert_for_bigendian), - 0); - break; - case ACE_UTF_8: - ACE_NEW_RETURN (converter, - ACE_UTF8_Encoding_Converter, - 0); - break; - default: - // First check for ASCII since much of ASCII text will appear to - // convert from UTF-16 to UTF-8. - converter = ACE_UTF8_Encoding_Converter::encoded (source, source_size); - if (converter != 0) - return converter; - - // Check for UTF-32 - converter = ACE_UTF32_Encoding_Converter::encoded (source, source_size); - if (converter != 0) - return converter; - - // Check for UTF-16 - converter = ACE_UTF16_Encoding_Converter::encoded (source, source_size); - if (converter != 0) - return converter; - } - - return converter; -} - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_USES_WCHAR */ - diff --git a/dep/src/ace/Env_Value_T.cpp b/dep/src/ace/Env_Value_T.cpp deleted file mode 100644 index 15ff7524ccf..00000000000 --- a/dep/src/ace/Env_Value_T.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// $Id: Env_Value_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_ENV_VALUE_T_CPP -#define ACE_ENV_VALUE_T_CPP - -#include "ace/Env_Value_T.h" - -#if ! defined (__ACE_INLINE__) -#include "ace/Env_Value_T.inl" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_ENV_VALUE_T_CPP */ - diff --git a/dep/src/ace/Event.cpp b/dep/src/ace/Event.cpp deleted file mode 100644 index a5461de4bd9..00000000000 --- a/dep/src/ace/Event.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// $Id: Event.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Event.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Event.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, Event, "$Id: Event.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Event::ACE_Event (int manual_reset, - int initial_state, - int type, - const ACE_TCHAR *name, - void *arg, - LPSECURITY_ATTRIBUTES sa) - : removed_ (false) -{ - if (ACE_OS::event_init (&this->handle_, - manual_reset, - initial_state, - type, - name, - arg, - sa) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Event::ACE_Event"))); -} - -ACE_Event::~ACE_Event (void) -{ - this->remove (); -} - -int -ACE_Event::remove (void) -{ - int result = 0; - if (!this->removed_) - { - this->removed_ = true; - result = ACE_OS::event_destroy (&this->handle_); - } - return result; -} - -int -ACE_Event::wait (void) -{ - return ACE_OS::event_wait (&this->handle_); -} - -int -ACE_Event::wait (const ACE_Time_Value *abstime, int use_absolute_time) -{ - return ACE_OS::event_timedwait (&this->handle_, - const_cast (abstime), - use_absolute_time); -} - -int -ACE_Event::signal (void) -{ - return ACE_OS::event_signal (&this->handle_); -} - -int -ACE_Event::pulse (void) -{ - return ACE_OS::event_pulse (&this->handle_); -} - -int -ACE_Event::reset (void) -{ - return ACE_OS::event_reset (&this->handle_); -} - -void -ACE_Event::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Event_Handler.cpp b/dep/src/ace/Event_Handler.cpp deleted file mode 100644 index 52aa92f99fe..00000000000 --- a/dep/src/ace/Event_Handler.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// Event_Handler.cpp -// $Id: Event_Handler.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Event_Handler.h" -#include "ace/OS_Errno.h" -#include "ace/Reactor.h" -#include "ace/Thread_Manager.h" -/* Need to see if ACE_HAS_BUILTIN_ATOMIC_OP defined */ -#include "ace/Atomic_Op.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Event_Handler.inl" -#endif /* __ACE_INLINE__ */ - -#include - -ACE_RCSID(ace, Event_Handler, "$Id: Event_Handler.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Implement conceptually abstract virtual functions in the base class -// so derived classes don't have to implement unused ones. - -ACE_Event_Handler::ACE_Event_Handler (ACE_Reactor *r, - int p) - : reference_count_ (1), - priority_ (p), - reactor_ (r), - reference_counting_policy_ (Reference_Counting_Policy::DISABLED) -{ - // ACE_TRACE ("ACE_Event_Handler::ACE_Event_Handler"); -} - -ACE_Event_Handler::~ACE_Event_Handler (void) -{ - // ACE_TRACE ("ACE_Event_Handler::~ACE_Event_Handler"); -} - -// Gets the file descriptor associated with this I/O device. - -ACE_HANDLE -ACE_Event_Handler::get_handle (void) const -{ - ACE_TRACE ("ACE_Event_Handler::get_handle"); - return ACE_INVALID_HANDLE; -} - -// Sets the file descriptor associated with this I/O device. - -void -ACE_Event_Handler::set_handle (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::set_handle"); -} - -// Gets the priority of this handler. - -int -ACE_Event_Handler::priority (void) const -{ - ACE_TRACE ("ACE_Event_Handler::priority"); - return this->priority_; -} - -// Sets the priority - -void -ACE_Event_Handler::priority (int priority) -{ - ACE_TRACE ("ACE_Event_Handler::priority"); - this->priority_ = priority; -} - -// Called when the object is about to be removed from the Dispatcher -// tables. - -int -ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Event_Handler::handle_close"); - return -1; -} - -// Called when input becomes available on fd. - -int -ACE_Event_Handler::handle_input (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_input"); - return -1; -} - -// Called when output is possible on fd. - -int -ACE_Event_Handler::handle_output (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_output"); - return -1; -} - -// Called when urgent data is available on fd. - -int -ACE_Event_Handler::handle_exception (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_exception"); - return -1; -} - -// Called when timer expires, TV stores the current time. - -int -ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_timeout"); - return -1; -} - -// Called when a monitored Process exits - -int -ACE_Event_Handler::handle_exit (ACE_Process *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_exit"); - return -1; -} - -// Called when a registered signal occurs. - -int -ACE_Event_Handler::handle_signal (int, siginfo_t *, ucontext_t *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_signal"); - return -1; -} - -int -ACE_Event_Handler::resume_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler::resume_handler"); - - // Return a default value and allow the reactor to take care of - // resuming the handler - return ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER; -} - -int -ACE_Event_Handler::handle_qos (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_qos"); - return -1; -} - -int -ACE_Event_Handler::handle_group_qos (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_group_qos"); - return -1; -} - -void -ACE_Event_Handler::reactor (ACE_Reactor *reactor) -{ - ACE_TRACE ("ACE_Event_Handler::reactor"); - this->reactor_ = reactor; -} - -ACE_Reactor * -ACE_Event_Handler::reactor (void) const -{ - ACE_TRACE ("ACE_Event_Handler::reactor"); - return this->reactor_; -} - -ACE_Reactor_Timer_Interface * -ACE_Event_Handler::reactor_timer_interface (void) const -{ - ACE_TRACE ("ACE_Event_Handler::reactor_timer_interface"); - return this->reactor_; -} - -ACE_Event_Handler::Reference_Count -ACE_Event_Handler::add_reference (void) -{ - bool const reference_counting_required = - this->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - - if (reference_counting_required) - return ++this->reference_count_; - else - return 1; -} - -ACE_Event_Handler::Reference_Count -ACE_Event_Handler::remove_reference (void) -{ - bool const reference_counting_required = - this->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - - if (reference_counting_required) - { - Reference_Count result = - --this->reference_count_; - - if (result == 0) - delete this; - - return result; - } - else - { - return 1; - } -} - -ACE_Event_Handler::Policy::~Policy (void) -{ -} - -ACE_Event_Handler::Reference_Counting_Policy::Reference_Counting_Policy (Reference_Counting_Policy::Value value) - : value_ (value) -{ -} - -ACE_Event_Handler::Reference_Counting_Policy::Value -ACE_Event_Handler::Reference_Counting_Policy::value (void) const -{ - return this->value_; -} - -void -ACE_Event_Handler::Reference_Counting_Policy::value (ACE_Event_Handler::Reference_Counting_Policy::Value value) -{ - this->value_ = value; -} - -ACE_Event_Handler::Reference_Counting_Policy & -ACE_Event_Handler::reference_counting_policy (void) -{ - return this->reference_counting_policy_; -} - -//#if !defined (ACE_HAS_WINCE) - -ACE_THR_FUNC_RETURN -ACE_Event_Handler::read_adapter (void *args) -{ - ACE_Event_Handler *this_ptr = static_cast (args); - ACE_Reactor *r = this_ptr->reactor (); - - while (this_ptr->handle_input (ACE_STDIN) != -1) - continue; - - this_ptr->handle_close (ACE_STDIN, ACE_Event_Handler::READ_MASK); - // It's possible for handle_close() to "delete this" so we need to - // cache the reactor pointer and use it here. - r->notify (); - - return 0; -} - -int -ACE_Event_Handler::register_stdin_handler (ACE_Event_Handler *eh, - ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr, - int flags) -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (reactor); - - eh->reactor (reactor); - return thr_mgr->spawn (&read_adapter, static_cast (eh), flags); -#else - // Keep compilers happy. - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (thr_mgr); - return reactor->register_handler (ACE_STDIN, - eh, - ACE_Event_Handler::READ_MASK); -#endif /* ACE_WIN32 */ -} - -int -ACE_Event_Handler::remove_stdin_handler (ACE_Reactor *reactor, - ACE_Thread_Manager * /* thr_mgr */) -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (reactor); - - // What should we do here? - ACE_NOTSUP_RETURN (-1); -#else - return reactor->remove_handler (ACE_STDIN, - ACE_Event_Handler::READ_MASK); -#endif /* ACE_WIN32 */ -} - -//#endif /* ACE_HAS_WINCE */ - -// --------------------------------------------------------------------- - -ACE_Event_Handler_var::ACE_Event_Handler_var (void) - : ptr_ (0) -{ -} - -ACE_Event_Handler_var::ACE_Event_Handler_var (ACE_Event_Handler *p) - : ptr_ (p) -{ -} - -ACE_Event_Handler_var::ACE_Event_Handler_var (const ACE_Event_Handler_var &b) - : ptr_ (b.ptr_) -{ - if (this->ptr_ != 0) - { - this->ptr_->add_reference (); - } -} - -ACE_Event_Handler_var::~ACE_Event_Handler_var (void) -{ - if (this->ptr_ != 0) - { - ACE_Errno_Guard eguard (errno); - this->ptr_->remove_reference (); - } -} - -ACE_Event_Handler_var & -ACE_Event_Handler_var::operator= (ACE_Event_Handler *p) -{ - if (this->ptr_ != p) - { - ACE_Event_Handler_var tmp (p); - std::swap (this->ptr_, tmp.ptr_); - } - - return *this; -} - -ACE_Event_Handler_var & -ACE_Event_Handler_var::operator= (const ACE_Event_Handler_var &b) -{ - ACE_Event_Handler_var tmp (b); - std::swap (this->ptr_, tmp.ptr_); - - return *this; -} - -ACE_Event_Handler * -ACE_Event_Handler_var::operator->() const -{ - return this->ptr_; -} - -ACE_Event_Handler * -ACE_Event_Handler_var::handler (void) const -{ - return this->ptr_; -} - -ACE_Event_Handler * -ACE_Event_Handler_var::release (void) -{ - ACE_Event_Handler * const old = this->ptr_; - this->ptr_ = 0; - return old; -} - -void -ACE_Event_Handler_var::reset (ACE_Event_Handler *p) -{ - *this = p; -} - -// --------------------------------------------------------------------- - -ACE_Notification_Buffer::ACE_Notification_Buffer (void) -{ - ACE_TRACE ("ACE_Notification_Buffer::ACE_Notification_Buffer"); -} - -ACE_Notification_Buffer::ACE_Notification_Buffer (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) - : eh_ (eh), - mask_ (mask) -{ - ACE_TRACE ("ACE_Notification_Buffer::ACE_Notification_Buffer"); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Event_Handler_T.cpp b/dep/src/ace/Event_Handler_T.cpp deleted file mode 100644 index 76fb69877e5..00000000000 --- a/dep/src/ace/Event_Handler_T.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// Event_Handler_T.cpp -// -// $Id: Event_Handler_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_EVENT_HANDLER_T_CPP -#define ACE_EVENT_HANDLER_T_CPP - -#include "ace/Event_Handler_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -#if !defined (__ACE_INLINE__) -#include "ace/Event_Handler_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_T) - -template void -ACE_Event_Handler_T::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Event_Handler_T::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Event_Handler_T::~ACE_Event_Handler_T (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::~ACE_Event_Handler_T"); - if (this->delete_handler_) - delete this->op_handler_; -} - -template -ACE_Event_Handler_T::ACE_Event_Handler_T (T *op_handler, int delete_handler, - GET_HANDLE get_handle, - IO_HANDLER input_h, - CL_HANDLER close_h, - SIG_HANDLER sig_h, - TO_HANDLER timeout_h, - IO_HANDLER output_h, - SET_HANDLE set_handle, - IO_HANDLER except_h) - : op_handler_ (op_handler), - input_handler_ (input_h), - output_handler_ (output_h), - except_handler_ (except_h), - to_handler_ (timeout_h), - cl_handler_ (close_h), - sig_handler_ (sig_h), - delete_handler_ (delete_handler), - set_handle_ (set_handle), - get_handle_ (get_handle) -{ - ACE_TRACE ("ACE_Event_Handler_T::ACE_Event_Handler_T"); -} - -template ACE_HANDLE -ACE_Event_Handler_T::get_handle (void) const -{ - ACE_TRACE ("ACE_Event_Handler_T::get_handle"); - return this->get_handle_ == 0 ? ACE_INVALID_HANDLE : (this->op_handler_->*get_handle_) (); -} - -template void -ACE_Event_Handler_T::set_handle (ACE_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::set_handle"); - if (this->set_handle_ != 0) - (this->op_handler_->*set_handle_) (h); -} - -template int -ACE_Event_Handler_T::handle_input (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_input"); - return this->input_handler_ == 0 ? 0 : (this->op_handler_->*input_handler_) (fd); -} - -template int -ACE_Event_Handler_T::handle_output (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_output"); - return this->output_handler_ == 0 ? 0 : (this->op_handler_->*output_handler_) (fd); -} - -template int -ACE_Event_Handler_T::handle_exception (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_exception"); - return this->except_handler_ == 0 ? 0 : (this->op_handler_->*except_handler_) (fd); -} - -template int -ACE_Event_Handler_T::handle_timeout (const ACE_Time_Value &tv, const void *arg) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_timeout"); - return this->to_handler_ == 0 ? 0 : (this->op_handler_->*to_handler_) (tv, arg); -} - -template int -ACE_Event_Handler_T::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_close"); - return this->cl_handler_ == 0 ? 0 : (this->op_handler_->*cl_handler_) (fd, close_mask); -} - -template int -ACE_Event_Handler_T::handle_signal (int signum, siginfo_t *s, ucontext_t *u) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_signal"); - return this->sig_handler_ == 0 ? 0 : (this->op_handler_->*sig_handler_) (signum, s, u); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ - -#endif /* ACE_EVENT_HANDLER_T_CPP */ - diff --git a/dep/src/ace/FIFO.cpp b/dep/src/ace/FIFO.cpp deleted file mode 100644 index c5ace7f90d9..00000000000 --- a/dep/src/ace/FIFO.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id: FIFO.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FIFO.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_sys_stat.h" -#include "ace/OS_NS_fcntl.h" - -ACE_RCSID(ace, FIFO, "$Id: FIFO.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO) - -void -ACE_FIFO::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("rendezvous_ = %s"), this->rendezvous_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -int -ACE_FIFO::open (const ACE_TCHAR *r, int flags, mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO::open"); - ACE_OS::strsncpy (this->rendezvous_, r, MAXPATHLEN); - - if ((flags & O_CREAT) != 0 - && ACE_OS::mkfifo (this->rendezvous_, perms) == -1 - && !(errno == EEXIST)) - return -1; - - this->set_handle (ACE_OS::open (this->rendezvous_, flags, 0, sa)); - return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_FIFO::ACE_FIFO (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO::ACE_FIFO"); - if (this->open (fifo_name, flags, perms, sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO"))); -} - -ACE_FIFO::ACE_FIFO (void) -{ -// ACE_TRACE ("ACE_FIFO::ACE_FIFO"); -} - -int -ACE_FIFO::close (void) -{ - ACE_TRACE ("ACE_FIFO::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - } - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FIFO_Recv.cpp b/dep/src/ace/FIFO_Recv.cpp deleted file mode 100644 index 08eb20fb469..00000000000 --- a/dep/src/ace/FIFO_Recv.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// $Id: FIFO_Recv.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FIFO_Recv.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_fcntl.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO_Recv.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FIFO_Recv, "$Id: FIFO_Recv.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Recv) - -void -ACE_FIFO_Recv::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO_Recv::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_FIFO::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("aux_handle_ = %d"), this->aux_handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -int -ACE_FIFO_Recv::close (void) -{ - ACE_TRACE ("ACE_FIFO_Recv::close"); - int result = ACE_FIFO::close (); - - if (this->aux_handle_ != ACE_INVALID_HANDLE) - return ACE_OS::close (this->aux_handle_); - else - return result; -} - -// Note that persistent means "open fifo for writing, as well as -// reading." This ensures that the fifo never gets EOF, even if there -// aren't any writers at the moment! - -int -ACE_FIFO_Recv::open (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv::open"); - - if (ACE_FIFO::open (fifo_name, ACE_NONBLOCK | flags, perms, sa) == -1) - return -1; - else if (this->disable (ACE_NONBLOCK) == -1) - return -1; - else if (persistent - && (this->aux_handle_ = ACE_OS::open (fifo_name, O_WRONLY, 0, sa)) == ACE_INVALID_HANDLE) - return -1; - else - return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_FIFO_Recv::ACE_FIFO_Recv (void) - : aux_handle_ (ACE_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv"); -} - -ACE_FIFO_Recv::ACE_FIFO_Recv (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) - : aux_handle_ (ACE_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv"); - - if (this->ACE_FIFO_Recv::open (fifo_name, - flags, - perms, - persistent, - sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Recv"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FIFO_Recv_Msg.cpp b/dep/src/ace/FIFO_Recv_Msg.cpp deleted file mode 100644 index 5a8cb5c04d5..00000000000 --- a/dep/src/ace/FIFO_Recv_Msg.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// $Id: FIFO_Recv_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FIFO_Recv_Msg.h" - -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO_Recv_Msg.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FIFO_Recv_Msg, "$Id: FIFO_Recv_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Recv_Msg) - -void -ACE_FIFO_Recv_Msg::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO_Recv_Msg::dump"); - ACE_FIFO_Recv::dump (); -#endif /* ACE_HAS_DUMP */ -} - -// Note that persistent means "open FIFO for writing, as well as -// reading." This ensures that the FIFO never gets EOF, even if there -// aren't any writers at the moment! - -int -ACE_FIFO_Recv_Msg::open (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::open"); - - return ACE_FIFO_Recv::open (fifo_name, - flags, - perms, - persistent, - sa); -} - -ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (void) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg"); -} - -ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg"); - - if (this->ACE_FIFO_Recv_Msg::open (fifo_name, - flags, - perms, - persistent, - sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Recv_Msg"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FIFO_Send.cpp b/dep/src/ace/FIFO_Send.cpp deleted file mode 100644 index 79ea87682d3..00000000000 --- a/dep/src/ace/FIFO_Send.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// $Id: FIFO_Send.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FIFO_Send.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO_Send.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FIFO_Send, "$Id: FIFO_Send.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Send) - -void -ACE_FIFO_Send::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO_Send::dump"); - ACE_FIFO::dump (); -#endif /* ACE_HAS_DUMP */ -} - -ACE_FIFO_Send::ACE_FIFO_Send (void) -{ -// ACE_TRACE ("ACE_FIFO_Send::ACE_FIFO_Send"); -} - -int -ACE_FIFO_Send::open (const ACE_TCHAR *rendezvous_name, - int flags, - mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send::open"); - return ACE_FIFO::open (rendezvous_name, - flags | O_WRONLY, - perms, - sa); -} - -ACE_FIFO_Send::ACE_FIFO_Send (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send::ACE_FIFO_Send"); - if (this->ACE_FIFO_Send::open (fifo_name, - flags, - perms, - sa) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_FIFO_Send::ACE_FIFO_Send"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FIFO_Send_Msg.cpp b/dep/src/ace/FIFO_Send_Msg.cpp deleted file mode 100644 index 441a850c354..00000000000 --- a/dep/src/ace/FIFO_Send_Msg.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// $Id: FIFO_Send_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FIFO_Send_Msg.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_sys_uio.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO_Send_Msg.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FIFO_Send_Msg, "$Id: FIFO_Send_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Send_Msg) - -void -ACE_FIFO_Send_Msg::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FIFO_Send_Msg::dump"); - ACE_FIFO_Send::dump (); -#endif /* ACE_HAS_DUMP */ -} - -ssize_t -ACE_FIFO_Send_Msg::send (const ACE_Str_Buf &send_msg) -{ - // ACE_TRACE ("ACE_FIFO_Send_Msg::send"); -#if defined (ACE_HAS_STREAM_PIPES) - if (ACE_OS::putmsg (this->get_handle (), - (strbuf *) 0, - (strbuf *) &send_msg, - 0) == -1) - return -1; - else - return send_msg.len; -#else - iovec iov[2]; - - iov[0].iov_base = (char *) &send_msg.len; - iov[0].iov_len = sizeof send_msg.len; - - iov[1].iov_base = (char *) send_msg.buf; - iov[1].iov_len = static_cast (send_msg.len); - - ssize_t sent = ACE_OS::writev (this->get_handle (), iov, 2); - if (sent > 0) - sent -= iov[0].iov_len; // Don't count the length we added. - return sent; -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (void) -{ -// ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg"); -} - -int -ACE_FIFO_Send_Msg::open (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::open"); - return ACE_FIFO_Send::open (fifo_name, flags | O_WRONLY, perms, sa); -} - -ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const ACE_TCHAR *fifo_name, - int flags, - mode_t perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg"); - if (this->ACE_FIFO_Send_Msg::open (fifo_name, flags, perms, sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Send_Msg"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FILE.cpp b/dep/src/ace/FILE.cpp deleted file mode 100644 index 50b6342bc89..00000000000 --- a/dep/src/ace/FILE.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// $Id: FILE.cpp 80826 2008-03-04 14:51:23Z wotte $ - -/* Defines the member functions for the base class of the ACE_IO_SAP - ACE_FILE abstraction. */ - -#include "ace/FILE.h" - -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_sys_stat.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FILE.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FILE, "$Id: FILE.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE) - -void -ACE_FILE::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FILE::dump"); - ACE_IO_SAP::dump (); -#endif /* ACE_HAS_DUMP */ -} - -// This is the do-nothing constructor. - -ACE_FILE::ACE_FILE (void) -{ - ACE_TRACE ("ACE_FILE::ACE_FILE"); -} - -// Close the file - -int -ACE_FILE::close (void) -{ - ACE_TRACE ("ACE_FILE::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - } - return result; -} - -int -ACE_FILE::get_info (ACE_FILE_Info *finfo) -{ - ACE_TRACE ("ACE_FILE::get_info"); - ACE_stat filestatus; - - int const result = ACE_OS::fstat (this->get_handle (), &filestatus); - - if (result == 0) - { - finfo->mode_ = filestatus.st_mode; - finfo->nlink_ = filestatus.st_nlink; - finfo->size_ = filestatus.st_size; - } - - return result; -} - -int -ACE_FILE::get_info (ACE_FILE_Info &finfo) -{ - ACE_TRACE ("ACE_FILE::get_info"); - - return this->get_info (&finfo); -} - -int -ACE_FILE::truncate (ACE_OFF_T length) -{ - ACE_TRACE ("ACE_FILE::truncate"); - return ACE_OS::ftruncate (this->get_handle (), length); -} - -ACE_OFF_T -ACE_FILE::seek (ACE_OFF_T offset, int startpos) -{ - return ACE_OS::lseek (this->get_handle (), offset, startpos); -} - -ACE_OFF_T -ACE_FILE::tell (void) -{ - ACE_TRACE ("ACE_FILE::tell"); - return ACE_OS::lseek (this->get_handle (), 0, SEEK_CUR); -} - -// Return the local endpoint address. - -int -ACE_FILE::get_local_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE::get_local_addr"); - - // Perform the downcast since had better be an - // . - ACE_FILE_Addr *file_addr = - dynamic_cast (&addr); - - if (file_addr == 0) - return -1; - else - { - *file_addr = this->addr_; - return 0; - } -} - -// Return the same result as . - -int -ACE_FILE::get_remote_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE::get_remote_addr"); - - return this->get_local_addr (addr); -} - -int -ACE_FILE::remove (void) -{ - ACE_TRACE ("ACE_FILE::remove"); - - this->close (); - return ACE_OS::unlink (this->addr_.get_path_name ()); -} - -int -ACE_FILE::unlink (void) -{ - ACE_TRACE ("ACE_FILE::unlink"); - - return ACE_OS::unlink (this->addr_.get_path_name ()); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FILE_Addr.cpp b/dep/src/ace/FILE_Addr.cpp deleted file mode 100644 index 4b95a7db874..00000000000 --- a/dep/src/ace/FILE_Addr.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// $Id: FILE_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FILE_Addr.h" -#include "ace/Lib_Find.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_NS_string.h" -#include "ace/os_include/sys/os_socket.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FILE_Addr.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FILE_Addr, "$Id: FILE_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Addr) - -ACE_FILE_Addr::ACE_FILE_Addr (void) - : ACE_Addr (AF_FILE, sizeof this->filename_ / sizeof (ACE_TCHAR)) -{ - this->filename_[0] = '\0'; -} - -int -ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) -{ - if (sa.get_type () == AF_ANY) - { -#if defined (ACE_DEFAULT_TEMP_FILE) - // Create a temporary file. - ACE_OS::strcpy (this->filename_, - ACE_DEFAULT_TEMP_FILE); -#else /* ACE_DEFAULT_TEMP_FILE */ - if (ACE::get_temp_dir (this->filename_, MAXPATHLEN - 15) == -1) - // -15 for ace-file-XXXXXX - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Temporary path too long, ") - ACE_TEXT ("defaulting to current directory\n"))); - this->filename_[0] = 0; - } - - // Add the filename to the end - ACE_OS::strcat (this->filename_, ACE_TEXT ("ace-fileXXXXXX")); - -#endif /* ACE_DEFAULT_TEMP_FILE */ - - if (ACE_OS::mktemp (this->filename_) == 0) - return -1; - this->base_set (AF_FILE, - static_cast (ACE_OS::strlen (this->filename_) + 1)); - } - else - { - (void)ACE_OS::strsncpy (this->filename_, sa.filename_, sa.get_size ()); - - this->base_set (sa.get_type (), sa.get_size ()); - } - return 0; -} - -// Copy constructor. - -ACE_FILE_Addr::ACE_FILE_Addr (const ACE_FILE_Addr &sa) - : ACE_Addr (AF_FILE, sizeof this->filename_) -{ - this->set (sa); -} - -int -ACE_FILE_Addr::set (const ACE_TCHAR *filename) -{ - this->ACE_Addr::base_set (AF_FILE, - static_cast (ACE_OS::strlen (filename) + 1)); - (void) ACE_OS::strsncpy (this->filename_, - filename, - sizeof this->filename_ / sizeof (ACE_TCHAR)); - return 0; -} - -ACE_FILE_Addr & -ACE_FILE_Addr::operator= (const ACE_FILE_Addr &sa) -{ - if (this != &sa) - this->set (sa); - return *this; -} - -// Create a ACE_Addr from a ACE_FILE pathname. - -ACE_FILE_Addr::ACE_FILE_Addr (const ACE_TCHAR *filename) -{ - this->set (filename); -} - -int -ACE_FILE_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const -{ - ACE_OS::strsncpy (s, this->filename_, len); - return 0; -} - -// Return the address. - -void * -ACE_FILE_Addr::get_addr (void) const -{ - return (void *)&this->filename_; -} - -void -ACE_FILE_Addr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FILE_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("filename_ = %s"), this->filename_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FILE_Connector.cpp b/dep/src/ace/FILE_Connector.cpp deleted file mode 100644 index b4f4d09e3c6..00000000000 --- a/dep/src/ace/FILE_Connector.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// $Id: FILE_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/FILE_Connector.h" -#include "ace/Handle_Ops.h" -#include "ace/OS_NS_stdlib.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FILE_Connector.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FILE_Connector, "$Id: FILE_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Connector) - -void -ACE_FILE_Connector::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FILE_Connector::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_FILE_Connector::ACE_FILE_Connector (void) -{ - ACE_TRACE ("ACE_FILE_Connector::ACE_FILE_Connector"); -} - -int -ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) -{ - ACE_TRACE ("ACE_FILE_Connector::connect"); - ACE_ASSERT (new_io.get_handle () == ACE_INVALID_HANDLE); - - ACE_HANDLE handle = ACE_INVALID_HANDLE; - - // Check to see if caller has requested that we create the filename. - if (reinterpret_cast ( - const_cast (remote_sap)) == ACE_Addr::sap_any) - { - // Create a new temporary file. - // Use ACE_OS::mkstemp() if it is available since it avoids a - // race condition, and subsequently a security hole due to that - // race condition (specifically, a denial-of-service attack). - // - // However, using mkstemp() prevents us from doing a timed open - // since it opens the file for us. Better to avoid the race - // condition. - char filename[] = "ace-file-XXXXXX"; - - handle = ACE_OS::mkstemp (filename); // mkstemp() replaces "XXXXXX" - - if (handle == ACE_INVALID_HANDLE - || new_io.addr_.set (ACE_TEXT_CHAR_TO_TCHAR (filename)) != 0) - return -1; - - new_io.set_handle (handle); - - return 0; - } - else - new_io.addr_ = remote_sap; // class copy. - - handle = ACE::handle_timed_open (timeout, - new_io.addr_.get_path_name (), - flags, - perms); - - new_io.set_handle (handle); - return handle == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/FILE_IO.cpp b/dep/src/ace/FILE_IO.cpp deleted file mode 100644 index c68df3e0416..00000000000 --- a/dep/src/ace/FILE_IO.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// $Id: FILE_IO.cpp 82559 2008-08-07 20:23:07Z parsons $ - -#include "ace/FILE_IO.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_sys_stat.h" -#include "ace/OS_Memory.h" -#include "ace/Truncate.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FILE_IO.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FILE_IO, "$Id: FILE_IO.cpp 82559 2008-08-07 20:23:07Z parsons $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_IO) - -void -ACE_FILE_IO::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_FILE_IO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Simple-minded do nothing constructor. - -ACE_FILE_IO::ACE_FILE_IO (void) -{ - ACE_TRACE ("ACE_FILE_IO::ACE_FILE_IO"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_FILE_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - va_list argp; - int total_tuples = ACE_Utils::truncate_cast (n / 2); - iovec *iovp = 0; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_FILE_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - va_list argp; - int total_tuples = ACE_Utils::truncate_cast (n / 2); - iovec *iovp = 0; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (int i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t const result = ACE_OS::readv (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// Allows a client to read from a file without having to provide a -// buffer to read. This method determines how much data is in the -// file, allocates a buffer of this size, reads in the data, and -// returns the number of bytes read. - -ssize_t -ACE_FILE_IO::recvv (iovec *io_vec) -{ - ACE_TRACE ("ACE_FILE_IO::recvv"); - - io_vec->iov_base = 0; - size_t const length = - static_cast (ACE_OS::filesize (this->get_handle ())); - - if (length > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[length], - -1); - io_vec->iov_len = this->recv_n (io_vec->iov_base, - length); - return io_vec->iov_len; - } - else - { - return ACE_Utils::truncate_cast (length); - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/File_Lock.cpp b/dep/src/ace/File_Lock.cpp deleted file mode 100644 index 2b06ff26640..00000000000 --- a/dep/src/ace/File_Lock.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// $Id: File_Lock.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/File_Lock.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/File_Lock.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, File_Lock, "$Id: File_Lock.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_File_Lock) - -void -ACE_File_Lock::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_File_Lock::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_File_Lock::ACE_File_Lock (ACE_HANDLE h, - int unlink_in_destructor) - : removed_ (0), - unlink_in_destructor_ (unlink_in_destructor) -{ -// ACE_TRACE ("ACE_File_Lock::ACE_File_Lock"); - if (ACE_OS::flock_init (&this->lock_) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_File_Lock::ACE_File_Lock"))); - this->set_handle (h); -} - -ACE_File_Lock::ACE_File_Lock (const ACE_TCHAR *name, - int flags, - mode_t perms, - int unlink_in_destructor) - : unlink_in_destructor_ (unlink_in_destructor) -{ -// ACE_TRACE ("ACE_File_Lock::ACE_File_Lock"); - - if (this->open (name, flags, perms) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p %s\n"), - ACE_TEXT ("ACE_File_Lock::ACE_File_Lock"), - name)); -} - -int -ACE_File_Lock::open (const ACE_TCHAR *name, - int flags, - mode_t perms) -{ -// ACE_TRACE ("ACE_File_Lock::open"); - this->removed_ = 0; - return ACE_OS::flock_init (&this->lock_, flags, name, perms); -} - -ACE_File_Lock::~ACE_File_Lock (void) -{ -// ACE_TRACE ("ACE_File_Lock::~ACE_File_Lock"); - this->remove (this->unlink_in_destructor_); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Filecache.cpp b/dep/src/ace/Filecache.cpp deleted file mode 100644 index b57581e5668..00000000000 --- a/dep/src/ace/Filecache.cpp +++ /dev/null @@ -1,752 +0,0 @@ -// $Id: Filecache.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Filecache.h" -#include "ace/Object_Manager.h" -#include "ace/Log_Msg.h" -#include "ace/ACE.h" -#include "ace/Guard_T.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_time.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/Truncate.h" - -ACE_RCSID (ace, - Filecache, - "$Id: Filecache.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_WIN32) -// Specifies no sharing flags. -#define R_MASK ACE_DEFAULT_OPEN_PERMS -#define W_MASK 0 -#else -#define R_MASK S_IRUSR|S_IRGRP|S_IROTH -#define W_MASK S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH -#endif /* ACE_WIN32 */ - -#if defined (ACE_WIN32) -// See if you can get rid of some of these. -#define READ_FLAGS (FILE_FLAG_SEQUENTIAL_SCAN | \ - FILE_FLAG_OVERLAPPED | \ - O_RDONLY) -// static const int RCOPY_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | -// O_RDONLY); -#define WRITE_FLAGS (FILE_FLAG_SEQUENTIAL_SCAN | \ - FILE_FLAG_OVERLAPPED | \ - O_RDWR | O_CREAT | O_TRUNC) -// static const int WCOPY_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | -// O_RDWR | O_CREAT | O_TRUNC); -#else -#define READ_FLAGS O_RDONLY -// static const int RCOPY_FLAGS = O_RDONLY; -#define WRITE_FLAGS (O_RDWR | O_CREAT | O_TRUNC) -// static const int WCOPY_FLAGS = O_RDWR | O_CREAT | O_TRUNC; -#endif /* ACE_WIN32 */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// static data members -ACE_Filecache *ACE_Filecache::cvf_ = 0; - -void -ACE_Filecache_Handle::init (void) -{ - this->file_ = 0; - this->handle_ = ACE_INVALID_HANDLE; -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (void) - : file_ (0), handle_ (0), mapit_ (0) -{ - this->init (); -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (const ACE_TCHAR *filename, - ACE_Filecache_Flag mapit) - : file_ (0), handle_ (0), mapit_ (mapit) -{ - this->init (); - // Fetch the file from the Virtual_Filesystem let the - // Virtual_Filesystem do the work of cache coherency. - - // Filecache will also do the acquire, since it holds the lock at - // that time. - this->file_ = ACE_Filecache::instance ()->fetch (filename, mapit); -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (const ACE_TCHAR *filename, - int size, - ACE_Filecache_Flag mapit) - : file_ (0), handle_ (0), mapit_ (mapit) -{ - this->init (); - - if (size == 0) - ACE_Filecache::instance ()->remove (filename); - else - { - // Since this is being opened for a write, simply create a new - // ACE_Filecache_Object now, and let the destructor add it into CVF - // later - - // Filecache will also do the acquire, since it holds the lock at - // that time. - this->file_ = ACE_Filecache::instance ()->create (filename, size); - } -} - -ACE_Filecache_Handle::~ACE_Filecache_Handle (void) -{ - if (this->handle_ != ACE_INVALID_HANDLE) - // this was dup ()'d - ACE_OS::close (this->handle_); - - ACE_Filecache::instance ()->finish (this->file_); -} - -void * -ACE_Filecache_Handle::address (void) const -{ - return this->file_ == 0 ? 0 : this->file_->address (); -} - -ACE_HANDLE -ACE_Filecache_Handle::handle (void) const -{ - if (this->handle_ == ACE_INVALID_HANDLE && this->file_ != 0) - { - ACE_Filecache_Handle *mutable_this = - const_cast (this); - mutable_this->handle_ = ACE_OS::dup (this->file_->handle ()); - } - return this->handle_; -} - -int -ACE_Filecache_Handle::error (void) const -{ - if (this->file_ == 0) - return -1; - else - return this->file_->error (); -} - -ACE_OFF_T -ACE_Filecache_Handle::size (void) const -{ - if (this->file_ == 0) - return -1; - else - return this->file_->size (); -} - -// ------------------ -// ACE_Filecache_Hash -// ------------------ - -#define ACE_Filecache_Hash \ - ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#define ACE_Filecache_Hash_Entry \ - ACE_Hash_Map_Entry - -template <> -ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry ( - const ACE_TCHAR *const &ext_id, - ACE_Filecache_Object *const &int_id, - ACE_Filecache_Hash_Entry *next, - ACE_Filecache_Hash_Entry *prev) - : ext_id_ (ext_id - ? ACE_OS::strdup (ext_id) - : ACE_OS::strdup (ACE_TEXT (""))), - int_id_ (int_id), - next_ (next), - prev_ (prev) -{ -} - -template <> -ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, - ACE_Filecache_Hash_Entry *prev) - : ext_id_ (0), - next_ (next), - prev_ (prev) -{ -} - -template <> -ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) -{ - ACE_OS::free ((void *) ext_id_); -} - -// We need these template specializations since KEY is defined as a -// ACE_TCHAR*, which doesn't have a hash() or equal() method defined on it. - -template <> -unsigned long -ACE_Filecache_Hash::hash (const ACE_TCHAR *const &ext_id) -{ - return ACE::hash_pjw (ext_id); -} - -template <> -int -ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, - const ACE_TCHAR *const &id2) -{ - return ACE_OS::strcmp (id1, id2) == 0; -} - -#undef ACE_Filecache_Hash -#undef ACE_Filecache_Hash_Entry - -// ------------- -// ACE_Filecache -// ------------- - -ACE_Filecache * -ACE_Filecache::instance (void) -{ - // Double check locking pattern. - if (ACE_Filecache::cvf_ == 0) - { - ACE_SYNCH_RW_MUTEX &lock = - *ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_FILECACHE_LOCK); - ACE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, ace_mon, lock, 0); - - // @@ James, please check each of the ACE_NEW_RETURN calls to - // make sure that it is safe to return if allocation fails. - if (ACE_Filecache::cvf_ == 0) - ACE_NEW_RETURN (ACE_Filecache::cvf_, - ACE_Filecache, - 0); - } - - return ACE_Filecache::cvf_; -} - -ACE_Filecache::ACE_Filecache (void) - : size_ (ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE), - hash_ (size_) -{ -} - -ACE_Filecache::~ACE_Filecache (void) -{ -} - -ACE_Filecache_Object * -ACE_Filecache::insert_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit) -{ - ACE_Filecache_Object *handle = 0; - - if (this->hash_.find (filename, handle) == -1) - { - ACE_NEW_RETURN (handle, - ACE_Filecache_Object (filename, filelock, 0, mapit), - 0); - - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%t) CVF: creating %s\n"), filename)); - - if (this->hash_.bind (filename, handle) == -1) - { - delete handle; - handle = 0; - } - } - else - handle = 0; - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::remove_i (const ACE_TCHAR *filename) -{ - ACE_Filecache_Object *handle = 0; - - // Disassociate file from the cache. - if (this->hash_.unbind (filename, handle) == 0) - { - handle->stale_ = 1; - - // Try a lock. If it succeeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (handle->lock_.tryacquire_write () == 0) - { - delete handle; - handle = 0; - } - } - else - handle = 0; - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::update_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit) -{ - ACE_Filecache_Object *handle = 0; - - handle = this->remove_i (filename); - handle = this->insert_i (filename, filelock, mapit); - - return handle; -} - -int -ACE_Filecache::find (const ACE_TCHAR *filename) -{ - return this->hash_.find (filename); -} - -ACE_Filecache_Object * -ACE_Filecache::remove (const ACE_TCHAR *filename) -{ - ACE_Filecache_Object *handle = 0; - - ACE_OFF_T loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - // ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - if (this->hash_.find (filename, handle) != -1) - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - return this->remove_i (filename); - } - - return 0; -} - -ACE_Filecache_Object * -ACE_Filecache::fetch (const ACE_TCHAR *filename, int mapit) -{ - ACE_Filecache_Object *handle = 0; - - ACE_OFF_T loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - filelock.acquire_read (); - - if (this->hash_.find (filename, handle) == -1) - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - // Second check in the method call - handle = this->insert_i (filename, filelock, mapit); - - if (handle == 0) - filelock.release (); - } - else - { - if (handle->update ()) - { - { - // Double check locking pattern - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - // Second check in the method call - handle = this->update_i (filename, filelock, mapit); - - if (handle == 0) - filelock.release (); - } - } - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%t) CVF: found %s\n"), filename)); - } - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::create (const ACE_TCHAR *filename, int size) -{ - ACE_Filecache_Object *handle = 0; - - ACE_OFF_T loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - ACE_NEW_RETURN (handle, - ACE_Filecache_Object (filename, size, filelock), - 0); - handle->acquire (); - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::finish (ACE_Filecache_Object *&file) -{ - if (file == 0) - return file; - - ACE_OFF_T loc = ACE::hash_pjw (file->filename_) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - - if (file != 0) - switch (file->action_) - { - case ACE_Filecache_Object::ACE_WRITING: - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - file->release (); - - this->remove_i (file->filename_); -#if 0 - int result = this->hash_.bind (file->filename (), file); - - if (result == 0) - file->acquire (); -#else - // Last one using a stale file is resposible for deleting it. - if (file->stale_) - { - // Try a lock. If it succeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (file->lock_.tryacquire_write () == 0) - { - delete file; - file = 0; - } - } -#endif - } - - break; - default: - file->release (); - - // Last one using a stale file is resposible for deleting it. - if (file->stale_) - { - // Try a lock. If it succeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (file->lock_.tryacquire_write () == 0) - { - delete file; - file = 0; - } - } - - break; - } - - return file; -} - -void -ACE_Filecache_Object::init (void) -{ - this->filename_[0] = '\0'; - this->handle_ = ACE_INVALID_HANDLE; - this->error_ = ACE_SUCCESS; - this->tempname_ = 0; - this->size_ = 0; - - ACE_OS::memset (&(this->stat_), 0, sizeof (this->stat_)); -} - -ACE_Filecache_Object::ACE_Filecache_Object (void) - : tempname_ (0), - mmap_ (), - handle_ (0), - // stat_ (), - size_ (0), - action_ (0), - error_ (0), - stale_ (0), - // sa_ (), - junklock_ (), - lock_ (junklock_) -{ - this->init (); -} - -ACE_Filecache_Object::ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa, - int mapit) - : tempname_ (0), - mmap_ (), - handle_ (0), - // stat_ (), - size_ (0), - action_ (0), - error_ (0), - stale_ (0), - sa_ (sa), - junklock_ (), - lock_ (lock) -{ - this->init (); - - // ASSERT strlen(filename) < sizeof (this->filename_) - ACE_OS::strcpy (this->filename_, filename); - this->action_ = ACE_Filecache_Object::ACE_READING; - // place ourselves into the READING state - - // Can we access the file? - if (ACE_OS::access (this->filename_, R_OK) == -1) - { - this->error_i (ACE_Filecache_Object::ACE_ACCESS_FAILED); - return; - } - - // Can we stat the file? - if (ACE_OS::stat (this->filename_, &this->stat_) == -1) - { - this->error_i (ACE_Filecache_Object::ACE_STAT_FAILED); - return; - } - - this->size_ = ACE_Utils::truncate_cast (this->stat_.st_size); - this->tempname_ = this->filename_; - - // Can we open the file? - this->handle_ = ACE_OS::open (this->tempname_, - READ_FLAGS, R_MASK, this->sa_); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - ACE_TEXT ("ACE_Filecache_Object::ctor: open")); - return; - } - - if (mapit) - { - // Can we map the file? - if (this->mmap_.map (this->handle_, static_cast (-1), - PROT_READ, ACE_MAP_PRIVATE, 0, 0, this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - ACE_TEXT ("ACE_Filecache_Object::ctor: map")); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - return; - } - } - - // Ok, finished! - this->action_ = ACE_Filecache_Object::ACE_READING; -} - -ACE_Filecache_Object::ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_OFF_T size, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa) - : stale_ (0), - sa_ (sa), - lock_ (lock) -{ - this->init (); - - this->size_ = size; - ACE_OS::strcpy (this->filename_, filename); - this->action_ = ACE_Filecache_Object::ACE_WRITING; - - // Can we access the file? - if (ACE_OS::access (this->filename_, R_OK|W_OK) == -1 - // Does it exist? - && ACE_OS::access (this->filename_, F_OK) != -1) - { - // File exists, but we cannot access it. - this->error_i (ACE_Filecache_Object::ACE_ACCESS_FAILED); - return; - } - - this->tempname_ = this->filename_; - - // Can we open the file? - this->handle_ = ACE_OS::open (this->tempname_, WRITE_FLAGS, W_MASK, this->sa_); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: open")); - return; - } - - // Can we write? - if (ACE_OS::pwrite (this->handle_, "", 1, this->size_ - 1) != 1) - { - this->error_i (ACE_Filecache_Object::ACE_WRITE_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: write")); - ACE_OS::close (this->handle_); - return; - } - - // Can we map? - if (this->mmap_.map (this->handle_, this->size_, PROT_RDWR, MAP_SHARED, - 0, 0, this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: map")); - ACE_OS::close (this->handle_); - } - - // Ok, done! -} - -ACE_Filecache_Object::~ACE_Filecache_Object (void) -{ - if (this->error_ == ACE_SUCCESS) - { - this->mmap_.unmap (); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - } - - this->lock_.release (); -} - -int -ACE_Filecache_Object::acquire (void) -{ - return this->lock_.tryacquire_read (); -} - -int -ACE_Filecache_Object::release (void) -{ - if (this->action_ == ACE_WRITING) - { - // We are safe since only one thread has a writable Filecache_Object - -#if 0 - ACE_HANDLE original = ACE_OS::open (this->filename_, WRITE_FLAGS, W_MASK, - this->sa_); - if (original == ACE_INVALID_HANDLE) - this->error_ = ACE_Filecache_Object::ACE_OPEN_FAILED; - else if (ACE_OS::write (original, this->mmap_.addr (), - this->size_) == -1) - { - this->error_ = ACE_Filecache_Object::ACE_WRITE_FAILED; - ACE_OS::close (original); - ACE_OS::unlink (this->filename_); - } - else if (ACE_OS::stat (this->filename_, &this->stat_) == -1) - this->error_ = ACE_Filecache_Object::ACE_STAT_FAILED; -#endif - - this->mmap_.unmap (); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - -#if 0 - // Leave the file in an acquirable state. - this->handle_ = ACE_OS::open (this->tempname_, READ_FLAGS, R_MASK); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - "ACE_Filecache_Object::acquire: open"); - } - else if (this->mmap_.map (this->handle_, -1, - PROT_READ, - ACE_MAP_PRIVATE, - 0, - 0, - this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - "ACE_Filecache_Object::acquire: map"); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - } - - this->action_ = ACE_Filecache_Object::ACE_READING; -#endif - } - - return this->lock_.release (); -} - -int -ACE_Filecache_Object::error (void) const -{ - // The existence of the object means a read lock is being held. - return this->error_; -} - -int -ACE_Filecache_Object::error_i (int error_value, const ACE_TCHAR *s) -{ - s = s; - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p.\n"), s)); - this->error_ = error_value; - return error_value; -} - -const ACE_TCHAR * -ACE_Filecache_Object::filename (void) const -{ - // The existence of the object means a read lock is being held. - return this->filename_; -} - -ACE_OFF_T -ACE_Filecache_Object::size (void) const -{ - // The existence of the object means a read lock is being held. - return this->size_; -} - -ACE_HANDLE -ACE_Filecache_Object::handle (void) const -{ - // The existence of the object means a read lock is being held. - return this->handle_; -} - -void * -ACE_Filecache_Object::address (void) const -{ - // The existence of the object means a read lock is being held. - return this->mmap_.addr (); -} - -int -ACE_Filecache_Object::update (void) const -{ - // The existence of the object means a read lock is being held. - int result; - ACE_stat statbuf; - - if (ACE_OS::stat (this->filename_, &statbuf) == -1) - result = 1; - else - // non-portable code may follow -#if defined (ACE_HAS_WINCE) - // Yup, non-portable... there's probably a way to safely implement - // difftime() on WinCE, but for now, this will have to do. It flags - // every file as having changed since cached. - result = 1; -#else - result = ACE_OS::difftime (this->stat_.st_mtime, statbuf.st_mtime) < 0; -#endif /* ACE_HAS_WINCE */ - - return result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Flag_Manip.cpp b/dep/src/ace/Flag_Manip.cpp deleted file mode 100644 index 252ea6240da..00000000000 --- a/dep/src/ace/Flag_Manip.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// $Id: Flag_Manip.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Flag_Manip.h" - -#if defined (ACE_LACKS_FCNTL) -# include "ace/OS_NS_stropts.h" -# include "ace/OS_NS_errno.h" -#endif /* ACE_LACKS_FCNTL */ - -#if !defined (__ACE_INLINE__) -#include "ace/Flag_Manip.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (CYGWIN32) -# include "ace/os_include/os_termios.h" -#endif /* CYGWIN32 */ - -ACE_RCSID (ace, - Flag_Manip, - "$Id: Flag_Manip.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Flags are file status flags to turn on. - -int -ACE::set_flags (ACE_HANDLE handle, int flags) -{ - ACE_TRACE ("ACE::set_flags"); -#if defined (ACE_LACKS_FCNTL) - switch (flags) - { - case ACE_NONBLOCK: - // nonblocking argument (1) - // blocking: (0) - { - int nonblock = 1; - return ACE_OS::ioctl (handle, FIONBIO, &nonblock); - } - default: - ACE_NOTSUP_RETURN (-1); - } -#else - int val = ACE_OS::fcntl (handle, F_GETFL, 0); - - if (val == -1) - return -1; - - // Turn on flags. - ACE_SET_BITS (val, flags); - - if (ACE_OS::fcntl (handle, F_SETFL, val) == -1) - return -1; - else - return 0; -#endif /* ACE_LACKS_FCNTL */ -} - -// Flags are the file status flags to turn off. - -int -ACE::clr_flags (ACE_HANDLE handle, int flags) -{ - ACE_TRACE ("ACE::clr_flags"); - -#if defined (ACE_LACKS_FCNTL) - switch (flags) - { - case ACE_NONBLOCK: - // nonblocking argument (1) - // blocking: (0) - { - int nonblock = 0; - return ACE_OS::ioctl (handle, FIONBIO, &nonblock); - } - default: - ACE_NOTSUP_RETURN (-1); - } -#else - int val = ACE_OS::fcntl (handle, F_GETFL, 0); - - if (val == -1) - return -1; - - // Turn flags off. - ACE_CLR_BITS (val, flags); - - if (ACE_OS::fcntl (handle, F_SETFL, val) == -1) - return -1; - else - return 0; -#endif /* ACE_LACKS_FCNTL */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Framework_Component.cpp b/dep/src/ace/Framework_Component.cpp deleted file mode 100644 index 446df96fa31..00000000000 --- a/dep/src/ace/Framework_Component.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// Framework_Component.cpp -// $Id: Framework_Component.cpp 82238 2008-07-02 12:05:46Z sma $ - -#include "ace/Framework_Component.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Framework_Component.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Object_Manager.h" -#include "ace/Log_Msg.h" -#include "ace/DLL_Manager.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID(ace, Framework_Component, "$Id: Framework_Component.cpp 82238 2008-07-02 12:05:46Z sma $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Framework_Component::~ACE_Framework_Component (void) -{ - ACE_TRACE ("ACE_Framework_Component::~ACE_Framework_Component"); - - ACE::strdelete (const_cast (this->dll_name_)); - ACE::strdelete (const_cast (this->name_)); -} - -/***************************************************************/ - -ACE_ALLOC_HOOK_DEFINE(ACE_Framework_Repository) - -sig_atomic_t ACE_Framework_Repository::shutting_down_ = 0; - -// Pointer to the Singleton instance. -ACE_Framework_Repository *ACE_Framework_Repository::repository_ = 0; - -ACE_Framework_Repository::~ACE_Framework_Repository (void) -{ - ACE_TRACE ("ACE_Framework_Repository::~ACE_Framework_Repository"); - this->close (); -} - -int -ACE_Framework_Repository::open (int size) -{ - ACE_TRACE ("ACE_Framework_Repository::open"); - - ACE_Framework_Component **temp = 0; - - ACE_NEW_RETURN (temp, - ACE_Framework_Component *[size], - -1); - - this->component_vector_ = temp; - this->total_size_ = size; - return 0; -} - -int -ACE_Framework_Repository::close (void) -{ - ACE_TRACE ("ACE_Framework_Repository::close"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - this->shutting_down_ = 1; - - if (this->component_vector_ != 0) - { - // Delete components in reverse order. - for (int i = this->current_size_ - 1; i >= 0; i--) - if (this->component_vector_[i]) - { - ACE_Framework_Component *s = - const_cast ( - this->component_vector_[i]); - - this->component_vector_[i] = 0; - delete s; - } - - delete [] this->component_vector_; - this->component_vector_ = 0; - this->current_size_ = 0; - } - - ACE_DLL_Manager::close_singleton (); - return 0; -} - -ACE_Framework_Repository * -ACE_Framework_Repository::instance (int size) -{ - ACE_TRACE ("ACE_Framework_Repository::instance"); - - if (ACE_Framework_Repository::repository_ == 0) - { - // Perform Double-Checked Locking Optimization. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - if (ACE_Framework_Repository::repository_ == 0) - { - if (ACE_Object_Manager::starting_up () || - !ACE_Object_Manager::shutting_down ()) - { - ACE_NEW_RETURN (ACE_Framework_Repository::repository_, - ACE_Framework_Repository (size), - 0); - } - } - } - - return ACE_Framework_Repository::repository_; -} - -void -ACE_Framework_Repository::close_singleton (void) -{ - ACE_TRACE ("ACE_Framework_Repository::close_singleton"); - - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance ())); - - delete ACE_Framework_Repository::repository_; - ACE_Framework_Repository::repository_ = 0; -} - -int -ACE_Framework_Repository::register_component (ACE_Framework_Component *fc) -{ - ACE_TRACE ("ACE_Framework_Repository::register_component"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - int i; - - // Check to see if it's already registered - for (i = 0; i < this->current_size_; i++) - if (this->component_vector_[i] && - fc->this_ == this->component_vector_[i]->this_) - { - ACE_ERROR_RETURN ((LM_ERROR, - "AFR::register_component: error, compenent already registered\n"), - -1); - } - - if (i < this->total_size_) - { - this->component_vector_[i] = fc; - this->current_size_++; - return 0; - } - - return -1; -} - -int -ACE_Framework_Repository::remove_component (const ACE_TCHAR *name) -{ - ACE_TRACE ("ACE_Framework_Repository::remove_component"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - int i; - - for (i = 0; i < this->current_size_; i++) - if (this->component_vector_[i] && - ACE_OS::strcmp (this->component_vector_[i]->name_, name) == 0) - { - delete this->component_vector_[i]; - this->component_vector_[i] = 0; - this->compact (); - return 0; - } - - return -1; -} - -int -ACE_Framework_Repository::remove_dll_components (const ACE_TCHAR *dll_name) -{ - ACE_TRACE ("ACE_Framework_Repository::remove_dll_components"); - - if (this->shutting_down_) - return this->remove_dll_components_i (dll_name); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - return this->remove_dll_components_i (dll_name); -} - -int -ACE_Framework_Repository::remove_dll_components_i (const ACE_TCHAR *dll_name) -{ - ACE_TRACE ("ACE_Framework_Repository::remove_dll_components_i"); - - int i; - int retval = -1; - - for (i = 0; i < this->current_size_; i++) - if (this->component_vector_[i] && - ACE_OS::strcmp (this->component_vector_[i]->dll_name_, dll_name) == 0) - { - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("AFR::remove_dll_components_i (%s) ") - ACE_TEXT ("component \"%s\"\n"), - dll_name, this->component_vector_[i]->name_)); - delete this->component_vector_[i]; - this->component_vector_[i] = 0; - ++retval; - } - - this->compact (); - - return retval == -1 ? -1 : 0; -} - -void -ACE_Framework_Repository::compact (void) -{ - ACE_TRACE ("ACE_Framework_Repository::compact"); - - int i; - int start_hole; - int end_hole; - - do - { - start_hole = this->current_size_; - end_hole = this->current_size_; - - // Find hole - for (i = 0; i < this->current_size_; ++i) - { - if (this->component_vector_[i] == 0) - { - if (start_hole == this->current_size_) - { - start_hole = i; - end_hole = i; - } - else - end_hole = i; - } - else if (end_hole != this->current_size_) - break; - } - - if (start_hole != this->current_size_) - { - // move the contents and reset current_size_ - while (end_hole + 1 < this->current_size_) - { - this->component_vector_[start_hole++] = - this->component_vector_[++end_hole]; - } - // Since start_hole is now one past the last - // active slot. - this->current_size_ = start_hole; - } - - } while (start_hole != this->current_size_); -} - -void -ACE_Framework_Repository::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Framework_Repository::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Framework_Repository::ACE_Framework_Repository (int size) - : current_size_ (0) -{ - ACE_TRACE ("ACE_Framework_Repository::ACE_Framework_Repository"); - - if (this->open (size) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Framework_Repository"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Framework_Component_T.cpp b/dep/src/ace/Framework_Component_T.cpp deleted file mode 100644 index b4e8130086c..00000000000 --- a/dep/src/ace/Framework_Component_T.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// $Id: Framework_Component_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_FRAMEWORK_COMPONENT_T_CPP -#define ACE_FRAMEWORK_COMPONENT_T_CPP - -#include "ace/Framework_Component_T.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Framework_Component_T::ACE_Framework_Component_T (Concrete *concrete) - : ACE_Framework_Component ((void *) concrete, concrete->dll_name (), concrete->name ()) -{ - ACE_TRACE ("ACE_Framework_Component_T::ctor"); -} - -template -ACE_Framework_Component_T::~ACE_Framework_Component_T (void) -{ - ACE_TRACE ("ACE_Framework_Component_T::~ACE_Framework_Component_T"); - Concrete::close_singleton (); -} - -template void -ACE_Framework_Component_T::close_singleton (void) -{ - ACE_TRACE ("ACE_Framework_Component_T::close_singleton"); - Concrete::close_singleton (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_FRAMEWORK_COMPONENT_T_CPP */ - diff --git a/dep/src/ace/Free_List.cpp b/dep/src/ace/Free_List.cpp deleted file mode 100644 index 924665572de..00000000000 --- a/dep/src/ace/Free_List.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// $Id: Free_List.cpp 81107 2008-03-27 11:12:42Z johnnyw $ - -#ifndef ACE_FREE_LIST_CPP -#define ACE_FREE_LIST_CPP - -#include "ace/Free_List.h" -#include "ace/Guard_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Free_List::~ACE_Free_List (void) -{ -} - -// Default constructor that takes in a preallocation number -// (), a low and high water mark ( and ) and an -// increment value () - -template -ACE_Locked_Free_List::ACE_Locked_Free_List (int mode, - size_t prealloc, - size_t lwm, - size_t hwm, - size_t inc) - : mode_ (mode), - free_list_ (0), - lwm_ (lwm), - hwm_ (hwm), - inc_ (inc), - size_ (0) -{ - this->alloc (prealloc); -} - -// Destructor - removes all the elements from the free_list - -template -ACE_Locked_Free_List::~ACE_Locked_Free_List (void) -{ - if (this->mode_ != ACE_PURE_FREE_LIST) - while (this->free_list_ != 0) - { - T *temp = this->free_list_; - this->free_list_ = this->free_list_->get_next (); - delete temp; - } -} - -// Inserts an element onto the free list (if we are allowed to manage -// elements withing and it pasts the high water mark, delete the -// element) - -template void -ACE_Locked_Free_List::add (T *element) -{ - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); - - // Check to see that we not at the high water mark. - if (this->mode_ == ACE_PURE_FREE_LIST - || this->size_ < this->hwm_) - { - element->set_next (this->free_list_); - this->free_list_ = element; - this->size_++; - } - else - delete element; -} - -// Takes a element off the freelist and returns it. It creates -// new elements if we are allowed to do it and the size is at the low -// water mark. - -template T * -ACE_Locked_Free_List::remove (void) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0)); - - // If we are at the low water mark, add some nodes - if (this->mode_ != ACE_PURE_FREE_LIST && this->size_ <= this->lwm_) - this->alloc (this->inc_); - - // Remove a node - T *temp = this->free_list_; - - if (temp != 0) - { - this->free_list_ = this->free_list_->get_next (); - this->size_--; - } - - return temp; -} - - -// Returns the current size of the free list - -template size_t -ACE_Locked_Free_List::size (void) -{ - return this->size_; -} - -// Resizes the free list to - -template void -ACE_Locked_Free_List::resize (size_t newsize) -{ - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); - - // Check if we are allowed to resize - if (this->mode_ != ACE_PURE_FREE_LIST) - { - // Check to see if we grow or shrink - if (newsize < this->size_) - { - this->dealloc (this->size_ - newsize); - } - else - { - this->alloc (newsize - this->size_); - } - } -} - -// Allocates extra nodes for the freelist - -template void -ACE_Locked_Free_List::alloc (size_t n) -{ - for (; n > 0; n--) - { - T *temp = 0; - ACE_NEW (temp, T); - temp->set_next (this->free_list_); - this->free_list_ = temp; - this->size_++; - } -} - -// Removes and frees nodes from the freelist. - -template void -ACE_Locked_Free_List::dealloc (size_t n) -{ - for (; this->free_list_ != 0 && n > 0; - n--) - { - T *temp = this->free_list_; - this->free_list_ = this->free_list_->get_next (); - delete temp; - this->size_--; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_FREE_LIST_CPP */ - diff --git a/dep/src/ace/Functor.cpp b/dep/src/ace/Functor.cpp deleted file mode 100644 index 29db0244aac..00000000000 --- a/dep/src/ace/Functor.cpp +++ /dev/null @@ -1,43 +0,0 @@ - -//============================================================================= -/** - * @file Functor.cpp - * - * $Id: Functor.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * Non-inlinable method definitions for non-templatized classes - * and template specializations implementing the GOF Command Pattern, - * and STL-style functors. - * - * - * @author Chris Gill - * - * Based on Command Pattern implementations originally done by - * - * Carlos O'Ryan - * Douglas C. Schmidt - * Sergio Flores-Gaitan - * - * and on STL-style functor implementations originally done by - * - * Irfan Pyarali - */ -//============================================================================= - -#include "ace/Functor_T.h" -#include "ace/Functor.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Functor.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Functor, "$Id: Functor.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Command_Base::~ACE_Command_Base (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Functor_String.cpp b/dep/src/ace/Functor_String.cpp deleted file mode 100644 index 798c9d26286..00000000000 --- a/dep/src/ace/Functor_String.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "ace/Functor_String.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Functor_String.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Functor, "$Id: Functor_String.cpp 80826 2008-03-04 14:51:23Z wotte $") - diff --git a/dep/src/ace/Functor_T.cpp b/dep/src/ace/Functor_T.cpp deleted file mode 100644 index b3018ade8b7..00000000000 --- a/dep/src/ace/Functor_T.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// $Id: Functor_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_FUNCTOR_T_CPP -#define ACE_FUNCTOR_T_CPP - -#include "ace/Functor_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Functor_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Command_Callback) - -/////////////////////////////////// -// GOF Command Pattern Templates // -/////////////////////////////////// - -// Constructor. - -template -ACE_Command_Callback::ACE_Command_Callback (RECEIVER &recvr, - ACTION action) - : receiver_ (recvr), - action_ (action) -{ -} - -template -ACE_Command_Callback::~ACE_Command_Callback (void) -{ -} - -// Invokes an operation. - -template int -ACE_Command_Callback::execute (void *arg) -{ - return (receiver_.*action_) (arg); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_FUNCTOR_T_CPP */ - diff --git a/dep/src/ace/Future.cpp b/dep/src/ace/Future.cpp deleted file mode 100644 index af1321c4bd8..00000000000 --- a/dep/src/ace/Future.cpp +++ /dev/null @@ -1,437 +0,0 @@ - // $Id: Future.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_FUTURE_CPP -#define ACE_FUTURE_CPP - -#include "ace/Future.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID (ace, Future, "$Id: Future.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if defined (ACE_HAS_THREADS) - -# include "ace/Guard_T.h" -# include "ace/Recursive_Thread_Mutex.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Future_Holder::ACE_Future_Holder (void) -{ -} - -template -ACE_Future_Holder::ACE_Future_Holder (const ACE_Future &item) - : item_ (item) -{ -} - -template -ACE_Future_Holder::~ACE_Future_Holder (void) -{ -} - -template -ACE_Future_Observer::ACE_Future_Observer (void) -{ -} - -template -ACE_Future_Observer::~ACE_Future_Observer (void) -{ -} - -// Dump the state of an object. - -template void -ACE_Future_Rep::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, - "ref_count_ = %d\n", - (int) this->ref_count_)); - ACE_DEBUG ((LM_INFO,"value_: \n")); - if (this->value_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (NON-NULL)\n"))); - else - //FUZZ: disable check_for_NULL - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (NULL)\n"))); - //FUZZ: enable check_for_NULL - - ACE_DEBUG ((LM_INFO,"value_ready_: \n")); - this->value_ready_.dump (); - ACE_DEBUG ((LM_INFO,"value_ready_mutex_: \n")); - this->value_ready_mutex_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_Future_Rep * -ACE_Future_Rep::internal_create (void) -{ - ACE_Future_Rep *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Future_Rep (), - 0); - return temp; -} - -template ACE_Future_Rep * -ACE_Future_Rep::create (void) -{ - // Yes set ref count to zero. - ACE_Future_Rep *temp = internal_create (); -#if defined (ACE_NEW_THROWS_EXCEPTIONS) - if (temp == 0) - ACE_throw_bad_alloc; -#else - ACE_ASSERT (temp != 0); -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - return temp; - } - - -template ACE_Future_Rep * -ACE_Future_Rep::attach (ACE_Future_Rep*& rep) -{ - ACE_ASSERT (rep != 0); - // Use value_ready_mutex_ for both condition and ref count management - ACE_MT (ACE_Guard r_mon (rep->value_ready_mutex_)); - ++rep->ref_count_; - return rep; -} - -template void -ACE_Future_Rep::detach (ACE_Future_Rep*& rep) -{ - ACE_ASSERT (rep != 0); - // Use value_ready_mutex_ for both condition and ref count management - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, r_mon, rep->value_ready_mutex_)); - - if (rep->ref_count_-- == 0) - { - ACE_MT (r_mon.release ()); - // We do not need the lock when deleting the representation. - // There should be no side effects from deleting rep and we don - // not want to release a deleted mutex. - delete rep; - } -} - -template void -ACE_Future_Rep::assign (ACE_Future_Rep*& rep, ACE_Future_Rep* new_rep) -{ - ACE_ASSERT (rep != 0); - ACE_ASSERT (new_rep != 0); - // Use value_ready_mutex_ for both condition and ref count management - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, r_mon, rep->value_ready_mutex_)); - - ACE_Future_Rep* old = rep; - rep = new_rep; - - // detached old last for exception safety - if (old->ref_count_-- == 0) - { - ACE_MT (r_mon.release ()); - // We do not need the lock when deleting the representation. - // There should be no side effects from deleting rep and we don - // not want to release a deleted mutex. - delete old; - } -} - -template -ACE_Future_Rep::ACE_Future_Rep (void) - : value_ (0), - ref_count_ (0), - value_ready_ (value_ready_mutex_) -{ -} - -template -ACE_Future_Rep::~ACE_Future_Rep (void) -{ - delete this->value_; -} - -template int -ACE_Future_Rep::ready (void) const -{ - return this->value_ != 0; -} - -template int -ACE_Future_Rep::set (const T &r, - ACE_Future &caller) -{ - // If the value is already produced, ignore it... - if (this->value_ == 0) - { - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_mon, - this->value_ready_mutex_, - -1)); - // Otherwise, create a new result value. Note the use of the - // Double-checked locking pattern to avoid multiple allocations. - - if (this->value_ == 0) // Still no value, so proceed - { - ACE_NEW_RETURN (this->value_, - T (r), - -1); - - // Remove and notify all subscribed observers. - typename OBSERVER_COLLECTION::iterator iterator = - this->observer_collection_.begin (); - - typename OBSERVER_COLLECTION::iterator end = - this->observer_collection_.end (); - - while (iterator != end) - { - OBSERVER *observer = *iterator++; - observer->update (caller); - } - - // Signal all the waiting threads. - return this->value_ready_.broadcast (); - } - // Destructor releases the lock. - } - return 0; -} - -template int -ACE_Future_Rep::get (T &value, - ACE_Time_Value *tv) const -{ - // If the value is already produced, return it. - if (this->value_ == 0) - { - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - this->value_ready_mutex_, - -1)); - // If the value is not yet defined we must block until the - // producer writes to it. - - while (this->value_ == 0) - // Perform a timed wait. - if (this->value_ready_.wait (tv) == -1) - return -1; - - // Destructor releases the lock. - } - - value = *this->value_; - return 0; -} - -template int -ACE_Future_Rep::attach (ACE_Future_Observer *observer, - ACE_Future &caller) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1)); - - // Otherwise, create a new result value. Note the use of the - // Double-checked locking pattern to avoid corrupting the list. - - int result = 1; - - // If the value is already produced, then notify observer - if (this->value_ == 0) - result = this->observer_collection_.insert (observer); - else - observer->update (caller); - - return result; -} - -template int -ACE_Future_Rep::detach (ACE_Future_Observer *observer) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1)); - - // Remove all occurrences of the specified observer from this - // objects hash map. - return this->observer_collection_.remove (observer); -} - -template -ACE_Future_Rep::operator T () -{ - // If the value is already produced, return it. - if (this->value_ == 0) - { - // Constructor of ace_mon acquires the mutex. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, 0)); - - // If the value is not yet defined we must block until the - // producer writes to it. - - // Wait ``forever.'' - - while (this->value_ == 0) - if (this->value_ready_.wait () == -1) - // What to do in this case since we've got to indicate - // failure somehow? Exceptions would be nice, but they're - // not portable... - return 0; - - // Destructor releases the mutex - } - - return *this->value_; -} - -template -ACE_Future::ACE_Future (void) - : future_rep_ (FUTURE_REP::create ()) -{ -} - -template -ACE_Future::ACE_Future (const ACE_Future &r) - : future_rep_ (FUTURE_REP::attach (((ACE_Future &) r).future_rep_)) -{ -} - -template -ACE_Future::ACE_Future (const T &r) - : future_rep_ (FUTURE_REP::create ()) -{ - this->future_rep_->set (r, *this); -} - -template -ACE_Future::~ACE_Future (void) -{ - FUTURE_REP::detach (future_rep_); -} - -template bool -ACE_Future::operator== (const ACE_Future &r) const -{ - return r.future_rep_ == this->future_rep_; -} - -template bool -ACE_Future::operator!= (const ACE_Future &r) const -{ - return r.future_rep_ != this->future_rep_; -} - -template int -ACE_Future::cancel (const T &r) -{ - this->cancel (); - return this->future_rep_->set (r, - *this); -} - -template int -ACE_Future::cancel (void) -{ - // If this ACE_Future is already attached to a ACE_Future_Rep, - // detach it (maybe delete the ACE_Future_Rep). - FUTURE_REP::assign (this->future_rep_, - FUTURE_REP::create ()); - return 0; -} - -template int -ACE_Future::set (const T &r) -{ - // Give the pointer to the result to the ACE_Future_Rep. - return this->future_rep_->set (r, - *this); -} - -template int -ACE_Future::ready (void) const -{ - // We're ready if the ACE_Future_rep is ready... - return this->future_rep_->ready (); -} - -template int -ACE_Future::get (T &value, - ACE_Time_Value *tv) const -{ - // We return the ACE_Future_rep. - return this->future_rep_->get (value, tv); -} - -template int -ACE_Future::attach (ACE_Future_Observer *observer) -{ - return this->future_rep_->attach (observer, *this); -} - -template int -ACE_Future::detach (ACE_Future_Observer *observer) -{ - return this->future_rep_->detach (observer); -} - -template -ACE_Future::operator T () -{ - // note that this will fail (and COREDUMP!) - // if future_rep_ == 0 ! - // - // but... - // this is impossible unless somebody is so stupid to - // try something like this: - // - // Future futT; - // T t; - // t = futT; - - // perform type conversion on Future_Rep. - return *future_rep_; -} - -template void -ACE_Future::operator = (const ACE_Future &rhs) -{ - // assignment: - // - // bind to the same as . - - // This will work if &r == this, by first increasing the ref count - ACE_Future &r = (ACE_Future &) rhs; - FUTURE_REP::assign (this->future_rep_, - FUTURE_REP::attach (r.future_rep_)); -} - -template void -ACE_Future::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, - ACE_BEGIN_DUMP, this)); - - if (this->future_rep_) - this->future_rep_->dump (); - - ACE_DEBUG ((LM_DEBUG, - ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_Future_Rep * -ACE_Future::get_rep () -{ - return this->future_rep_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ - -#endif /* ACE_FUTURE_CPP */ - diff --git a/dep/src/ace/Future_Set.cpp b/dep/src/ace/Future_Set.cpp deleted file mode 100644 index 7c1ae7d9341..00000000000 --- a/dep/src/ace/Future_Set.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// $Id: Future_Set.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_FUTURE_SET_CPP -#define ACE_FUTURE_SET_CPP - -#include "ace/Future_Set.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_THREADS) - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Future_Set::ACE_Future_Set (ACE_Message_Queue *new_queue) - : delete_queue_ (false) -{ - if (new_queue) - this->future_notification_queue_ = new_queue; - else - { - ACE_NEW (this->future_notification_queue_, - ACE_Message_Queue); - this->delete_queue_ = true; - } -} - -template -ACE_Future_Set::~ACE_Future_Set (void) -{ - // Detach ourselves from all remaining futures, if any, in our map. - typename FUTURE_HASH_MAP::iterator iterator = - this->future_map_.begin (); - - typename FUTURE_HASH_MAP::iterator end = - this->future_map_.end (); - - for (; - iterator != end; - ++iterator) - { - FUTURE_HOLDER *future_holder = (*iterator).int_id_; - future_holder->item_.detach (this); - delete future_holder; - } - - if (this->delete_queue_) - delete this->future_notification_queue_; -} - -template int -ACE_Future_Set::is_empty () const -{ - return (((ACE_Future_Set*)this)->future_map_.current_size () == 0 ); -} - -template int -ACE_Future_Set::insert (ACE_Future &future) -{ - FUTURE_HOLDER *future_holder; - ACE_NEW_RETURN (future_holder, - FUTURE_HOLDER (future), - -1); - - FUTURE_REP *future_rep = future.get_rep (); - int result = this->future_map_.bind (future_rep, - future_holder); - - // If a new map entry was created, then attach to the future, - // otherwise we were already attached to the future or some error - // occurred so just delete the future holder. - if ( result == 0 ) - // Attach ourself to the ACE_Futures list of observer - future.attach (this); - else - delete future_holder; - - return result; -} - -template void -ACE_Future_Set::update (const ACE_Future &future) -{ - ACE_Message_Block *mb; - FUTURE &local_future = const_cast &> (future); - - ACE_NEW (mb, - ACE_Message_Block ((char *) local_future.get_rep (), 0)); - - // Enqueue in priority order. - this->future_notification_queue_->enqueue (mb, 0); -} - -template int -ACE_Future_Set::next_readable (ACE_Future &future, - ACE_Time_Value *tv) -{ - if (this->is_empty ()) - return 0; - - ACE_Message_Block *mb = 0; - FUTURE_REP *future_rep = 0; - - // Wait for a "readable future" signal from the message queue. - if (this->future_notification_queue_->dequeue_head (mb, - tv) != -1) - { - // Extract future rep from the message block. - future_rep = reinterpret_cast (mb->base ()); - - // Delete the message block. - mb->release (); - } - else - return 0; - - // Remove the hash map entry with the specified future rep from our map. - FUTURE_HOLDER *future_holder; - if (this->future_map_.find (future_rep, - future_holder) != -1) - { - future = future_holder->item_; - this->future_map_.unbind (future_rep); - delete future_holder; - return 1; - } - - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_THREADS */ -#endif /* ACE_FUTURE_SET_CPP */ - diff --git a/dep/src/ace/Get_Opt.cpp b/dep/src/ace/Get_Opt.cpp deleted file mode 100644 index 9725171701d..00000000000 --- a/dep/src/ace/Get_Opt.cpp +++ /dev/null @@ -1,735 +0,0 @@ -// $Id: Get_Opt.cpp 81840 2008-06-05 13:46:45Z sma $ - -#include "ace/Get_Opt.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Get_Opt.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/ACE.h" -#include "ace/Log_Msg.h" -#include "ace/SString.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_ctype.h" -#include "ace/OS_NS_stdlib.h" - -ACE_RCSID (ace, - Get_Opt, - "$Id: Get_Opt.cpp 81840 2008-06-05 13:46:45Z sma $") - -/* - * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/*- - * Copyright (c) 2000 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Dieter Baron and Thomas Klausner. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Get_Opt) - -#ifdef ACE_USES_WCHAR -void ACE_Get_Opt::ACE_Get_Opt_Init (const ACE_TCHAR *optstring) -#else -ACE_Get_Opt::ACE_Get_Opt (int argc, - ACE_TCHAR **argv, - const ACE_TCHAR *optstring, - int skip, - int report_errors, - int ordering, - int long_only) - : argc_ (argc), - argv_ (argv), - optind (skip), - opterr (report_errors), - optarg (0), - optstring_ (0), - long_only_ (long_only), - has_colon_ (0), - last_option_ (0), - nextchar_ (0), - optopt_ (0), - ordering_ (ordering), - nonopt_start_ (optind), - nonopt_end_ (optind), - long_option_ (0) -#endif -{ - ACE_TRACE ("ACE_Get_Opt::ACE_Get_Opt"); - - ACE_NEW (this->optstring_, ACE_TString (optstring)); - ACE_NEW (this->last_option_, ACE_TString (ACE_TEXT (""))); - - // First check to see if POSIXLY_CORRECT was set. - // Win32 is the only platform capable of wide-char env var. -#if defined (ACE_WIN32) - const ACE_TCHAR *env_check = ACE_TEXT ("POSIXLY_CORRECT"); -#else - const char *env_check = "POSIXLY_CORRECT"; -#endif - if (ACE_OS::getenv (env_check) != 0) - this->ordering_ = REQUIRE_ORDER; - - // Now, check to see if any or the following were passed at - // the begining of optstring: '+' same as POSIXLY_CORRECT; - // '-' turns off POSIXLY_CORRECT; or ':' which signifies we - // should return ':' if a parameter is missing for an option. - // We use a loop here, since a combination of "{+|-}:" in any - // order should be legal. - int done = 0; - int offset = 0; - while (!done) - { - switch (optstring[offset++]) - { - case '+': - this->ordering_ = REQUIRE_ORDER; - break; - case '-': - this->ordering_ = RETURN_IN_ORDER; - break; - case ':': - this->has_colon_ = 1; - break; - default: - // Quit as soon as we see something else... - done = 1; - break; - } - } -} - -ACE_Get_Opt::~ACE_Get_Opt (void) -{ - ACE_TRACE ("ACE_Get_Opt::~ACE_Get_Opt"); - - size_t i = 0; - size_t size = this->long_opts_.size (); - ACE_Get_Opt_Long_Option *option = 0; - for (i = 0; i < size; ++i) - { - int retval = this->long_opts_.get (option, i); - if (retval != 0) - { - // Should never happen. - retval = 0; - continue; - } - if (option) - { - delete option; - option = 0; - } - } - delete this->optstring_; - delete this->last_option_; -} - -int -ACE_Get_Opt::nextchar_i (void) -{ - ACE_TRACE ("ACE_Get_Opt::nextchar_i"); - - if (this->ordering_ == PERMUTE_ARGS) - if (this->permute () == EOF) - return EOF; - - // Update scanning pointer. - if (this->optind >= this->argc_) - { - // We're done... - this->nextchar_ = 0; - return EOF; - } - else if (*(this->nextchar_ = this->argv_[this->optind]) != '-' - || this->nextchar_[1] == '\0') - { - // We didn't get an option. - - if (this->ordering_ == REQUIRE_ORDER - || this->ordering_ == PERMUTE_ARGS) - // If we permuted or require the options to be in order, we're done. - return EOF; - - // It must be RETURN_IN_ORDER... - this->optarg = this->argv_[this->optind++]; - this->nextchar_ = 0; - return 1; - } - else if (this->nextchar_[1] != 0 - && *++this->nextchar_ == '-' - && this->nextchar_[1] == 0) - { - // Found "--" so we're done... - ++this->optind; - this->nextchar_ = 0; - return EOF; - } - - // If it's a long option, and we allow long options advance nextchar_. - if (*this->nextchar_ == '-' && this->long_opts_.size () != 0) - this->nextchar_++; - - return 0; -} - -int -ACE_Get_Opt::long_option_i (void) -{ - ACE_TRACE ("ACE_Get_Opt::long_option_i"); - - ACE_Get_Opt_Long_Option *p; - ACE_TCHAR *s = this->nextchar_; - int hits = 0; - int exact = 0; - ACE_Get_Opt_Long_Option *pfound = 0; - int indfound = 0; - - // Advance to the end of the long option name so we can use - // it to get the length for a string compare. - while (*s && *s != '=') - s++; - - size_t len = s - this->nextchar_; - // set last_option_ to nextchar_, up to the '='. - this->last_option (ACE_TString (this->nextchar_, len)); - - size_t size = this->long_opts_.size (); - u_int option_index = 0; - for (option_index = 0; option_index < size ; option_index++) - { - p = this->long_opts_[option_index]; - ACE_ASSERT (p); - - if (!ACE_OS::strncmp (p->name_, this->nextchar_, len)) - { - // Got at least a partial match. - pfound = p; - indfound = option_index; - hits += 1; - if (len == ACE_OS::strlen(p->name_)) - { - // And in fact, it's an exact match, so let's use it. - exact = 1; - break; - } - } - } - - if ((hits > 1) && !exact) - { - // Great, we found a match, but unfortunately we found more than - // one and it wasn't exact. - if (this->opterr) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s: option `%s' is ambiguous\n"), - this->argv_[0], this->argv_[this->optind])); - this->nextchar_ = 0; - this->optind++; - return '?'; - } - - if (pfound != 0) - { - // Okay, we found a good one (either a single hit or an exact match). - option_index = indfound; - this->optind++; - if (*s) - { - // s must point to '=' which means there's an argument (well - // close enough). - if (pfound->has_arg_ != NO_ARG) - // Good, we want an argument and here it is. - this->optarg = ++s; - else - { - // Whoops, we've got what looks like an argument, but we - // don't want one. - if (this->opterr) - ACE_ERROR - ((LM_ERROR, - ACE_TEXT ("%s: long option `--%s' doesn't allow ") - ACE_TEXT ("an argument\n"), - this->argv_[0], pfound->name_)); - // The spec doesn't cover this, so we keep going and the program - // doesn't know we ignored an argument if opt_err is off!!! - } - } - else if (pfound->has_arg_ == ARG_REQUIRED) - { - // s didn't help us, but we need an argument. Note that - // optional arguments for long options must use the "=" syntax, - // so we won't get here in that case. - if (this->optind < this->argc_) - // We still have some elements left, so use the next one. - this->optarg = this->argv_[this->optind++]; - else - { - // All out of elements, so we have to punt... - if (this->opterr) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s: long option '--%s' requires ") - ACE_TEXT ("an argument\n"), - this->argv_[0], pfound->name_)); - this->nextchar_ = 0; - this->optopt_ = pfound->val_; // Remember matching short equiv - return this->has_colon_ ? ':' : '?'; - } - } - this->nextchar_ = 0; - this->long_option_ = pfound; - // Since val_ has to be either a valid short option or 0, this works - // great. If the user really wants to know if a long option was passed. - this->optopt_ = pfound->val_; - return pfound->val_; - } - if (!this->long_only_ || this->argv_[this->optind][1] == '-' - || this->optstring_->find (*this->nextchar_) == ACE_TString::npos) - { - // Okay, we couldn't find a long option. If it isn't long_only (which - // means try the long first, and if not found try the short) or a long - // signature was passed, e.g. "--", or it's not a short (not sure when - // this could happen) it's an error. - if (this->opterr) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s: illegal long option '--%s'\n"), - this->argv_[0], this->nextchar_)); - this->nextchar_ = 0; - this->optind++; - return '?'; - } - return this->short_option_i (); -} - -int -ACE_Get_Opt::short_option_i (void) -{ - ACE_TRACE ("ACE_Get_Opt::short_option_i"); - - /* Look at and handle the next option-character. */ - ACE_TCHAR opt = *this->nextchar_++; - // Set last_option_ to opt - this->last_option (opt); - - ACE_TCHAR *oli = 0; - oli = - const_cast (ACE_OS::strchr (this->optstring_->c_str (), opt)); - - /* Increment `optind' when we start to process its last character. */ - if (*this->nextchar_ == '\0') - ++this->optind; - - if (oli == 0 || opt == ':') - { - if (this->opterr) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s: illegal short option -- %c\n"), - this->argv_[0], opt)); - return '?'; - } - if (opt == 'W' && oli[1] == ';') - { - if (this->nextchar_[0] == 0) - this->nextchar_ = this->argv_[this->optind]; - return long_option_i (); - } - this->optopt_ = oli[0]; // Remember the option that matched - if (oli[1] == ':') - { - if (oli[2] == ':') - { - // Takes an optional argument, and since short option args must - // must follow directly in the same argument, a NULL nextchar_ - // means we didn't get one. - if (*this->nextchar_ != '\0') - { - this->optarg = this->nextchar_; - this->optind++; - } - else - this->optarg = 0; - this->nextchar_ = 0; - } - else - { - // Takes a required argument. - if (*this->nextchar_ != '\0') - { - // Found argument in same argv-element. - this->optarg = this->nextchar_; - this->optind++; - } - else if (this->optind == this->argc_) - { - // Ran out of arguments before finding required argument. - if (this->opterr) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s: short option requires ") - ACE_TEXT ("an argument -- %c\n"), - this->argv_[0], opt)); - opt = this->has_colon_ ? ':' : '?'; - } - else - // Use the next argv-element as the argument. - this->optarg = this->argv_[this->optind++]; - this->nextchar_ = 0; - } - } - return opt; -} - -int -ACE_Get_Opt::operator () (void) -{ - ACE_TRACE ("ACE_Get_Opt_Long::operator"); - - // First of all, make sure we reinitialize any pointers.. - this->optarg = 0; - this->long_option_ = 0; - - if (this->argv_ == 0) - { - // It can happen, e.g., on VxWorks. - this->optind = 0; - return -1; - } - - // We check this because we can string short options together if the - // preceding one doesn't take an argument. - if (this->nextchar_ == 0 || *this->nextchar_ == '\0') - { - int retval = this->nextchar_i (); - if (retval != 0) - return retval; - } - - if (((this->argv_[this->optind][0] == '-') - && (this->argv_[this->optind][1] == '-')) || this->long_only_) - return this->long_option_i (); - - return this->short_option_i (); -} - -int -ACE_Get_Opt::long_option (const ACE_TCHAR *name, - OPTION_ARG_MODE has_arg) -{ - ACE_TRACE ("ACE_Get_Opt::long_option (const ACE_TCHAR *name, OPTION_ARG_MODE has_arg)"); - return this->long_option (name, 0, has_arg); -} - -int -ACE_Get_Opt::long_option (const ACE_TCHAR *name, - int short_option, - OPTION_ARG_MODE has_arg) -{ - ACE_TRACE ("ACE_Get_Opt::long_option (const ACE_TCHAR *name, int short_option, OPTION_ARG_MODE has_arg)"); - - // We only allow valid alpha-numeric characters as short options. - // If short_options is not a valid alpha-numeric, we can still return it - // when the long option is found, but won't allow the caller to pass it on - // the command line (how could they?). The special case is 0, but since - // we always return it, we let the caller worry about that. - if (ACE_OS::ace_isalnum (short_option) != 0) - { - // If the short_option already exists, make sure it matches, otherwise - // add it. - ACE_TCHAR *s = 0; - if ((s = const_cast ( - ACE_OS::strchr (this->optstring_->c_str (), - short_option))) != 0) - { - // Short option exists, so verify the argument options - if (s[1] == ':') - { - if (s[2] == ':') - { - if (has_arg != ARG_OPTIONAL) - { - if (this->opterr) - ACE_ERROR - ((LM_ERROR, - ACE_TEXT ("Existing short option '%c' takes ") - ACE_TEXT ("optional argument; adding %s ") - ACE_TEXT ("requires ARG_OPTIONAL\n"), - short_option, name)); - return -1; - } - } - else - if (has_arg != ARG_REQUIRED) - { - if (this->opterr) - ACE_ERROR - ((LM_ERROR, - ACE_TEXT ("Existing short option '%c' requires ") - ACE_TEXT ("an argument; adding %s ") - ACE_TEXT ("requires ARG_REQUIRED\n"), - short_option, name)); - return -1; - } - } - else if (has_arg != NO_ARG) - { - if (this->opterr) - ACE_ERROR - ((LM_ERROR, - ACE_TEXT ("Existing short option '%c' does not ") - ACE_TEXT ("accept an argument; adding %s ") - ACE_TEXT ("requires NO_ARG\n"), - short_option, name)); - return -1; - } - } - else - { - // Didn't find short option, so add it... - *this->optstring_ += (ACE_TCHAR) short_option; - if (has_arg == ARG_REQUIRED) - *this->optstring_ += ACE_TEXT (":"); - else if (has_arg == ARG_OPTIONAL) - *this->optstring_ += ACE_TEXT ("::"); - } - } - - ACE_Get_Opt_Long_Option *option = - new ACE_Get_Opt_Long_Option (name, has_arg, short_option); - - if (!option) - return -1; - - // Add to array - size_t size = this->long_opts_.size (); - if (this->long_opts_.size (size + 1) != 0 - || this->long_opts_.set (option, size) != 0) - { - delete option; - ACE_ERROR_RETURN - ((LM_ERROR, ACE_TEXT ("Could not add long option to array.\n")), - -1); - } - return 0; -} - -const ACE_TCHAR* -ACE_Get_Opt::long_option (void) const -{ - ACE_TRACE ("ACE_Get_Opt::long_option (void)"); - if (this->long_option_) - return this->long_option_->name_; - return 0; -} - -const ACE_TCHAR* -ACE_Get_Opt::last_option (void) const -{ - return this->last_option_->c_str (); -} - -void -ACE_Get_Opt::last_option (const ACE_TString &last_option) -{ - *this->last_option_ = last_option; -} - -void -ACE_Get_Opt::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Get_Opt::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n") - ACE_TEXT ("opstring_ = %s\n") - ACE_TEXT ("long_only_ = %d\n") - ACE_TEXT ("has_colon_ = %d\n") - ACE_TEXT ("last_option_ = %s\n") - ACE_TEXT ("nextchar_ = %s\n") - ACE_TEXT ("optopt_ = %c\n") - ACE_TEXT ("ordering_ = %d\n"), - this->optstring_->c_str (), - this->long_only_, - this->has_colon_, - this->last_option_->c_str (), - this->nextchar_, - this->optopt_, - this->ordering_)); - - // now loop through the - size_t size = this->long_opts_.size (); - for (u_int i = 0; i < size ; ++i) - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n") - ACE_TEXT ("long_option name_ = %s\n") - ACE_TEXT ("has_arg_ = %d\n") - ACE_TEXT ("val_ = %d\n"), - this->long_opts_[i]->name_, - this->long_opts_[i]->has_arg_, - this->long_opts_[i]->val_)); - } - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -void -ACE_Get_Opt::permute_args (void) -{ - ACE_TRACE ("ACE_Get_Opt::permute_args"); - - u_long cyclelen, i, j, ncycle, nnonopts, nopts; - u_long opt_end = this->optind; - int cstart, pos = 0; - ACE_TCHAR *swap = 0; - - nnonopts = this->nonopt_end_ - this->nonopt_start_; - nopts = opt_end - this->nonopt_end_; - ncycle = ACE::gcd (nnonopts, nopts); - cyclelen = (opt_end - this->nonopt_start_) / ncycle; - - this->optind = this->optind - nnonopts; - - for (i = 0; i < ncycle; i++) - { - cstart = this->nonopt_end_ + i; - pos = cstart; - for (j = 0; j < cyclelen; j++) - { - if (pos >= this->nonopt_end_) - pos -= nnonopts; - else - pos += nopts; - swap = this->argv_[pos]; - - ((ACE_TCHAR **)this->argv_)[pos] = argv_[cstart]; - - ((ACE_TCHAR **)this->argv_)[cstart] = swap; - } - } -} - -int -ACE_Get_Opt::permute (void) -{ - ACE_TRACE ("ACE_Get_Opt::permute"); - - if (this->nonopt_start_ != this->nonopt_end_ - && this->nonopt_start_ != this->optind) - this->permute_args (); - - this->nonopt_start_ = this->optind; - - // Skip over args untill we find the next option. - while (this->optind < this->argc_ - && (this->argv_[this->optind][0] != '-' - || this->argv_[this->optind][1] == '\0')) - this->optind++; - - // Got an option, so mark this as the end of the non options. - this->nonopt_end_ = this->optind; - - if (this->optind != this->argc_ - && ACE_OS::strcmp (this->argv_[this->optind], - ACE_TEXT ("--")) == 0) - { - // We found the marker for the end of the options. - ++this->optind; - - if (this->nonopt_start_ != this->nonopt_end_ - && this->nonopt_end_ != this->optind) - this->permute_args (); - } - - if (this->optind == this->argc_) - { - if (this->nonopt_start_ != this->nonopt_end_) - this->optind = this->nonopt_start_; - return EOF; - } - return 0; -} - -const ACE_TCHAR * -ACE_Get_Opt::optstring (void) const -{ - return this->optstring_->c_str (); -} - -ACE_Get_Opt::ACE_Get_Opt_Long_Option::ACE_Get_Opt_Long_Option ( - const ACE_TCHAR *name, - int has_arg, - int val) - : name_ (ACE::strnew (name)), - has_arg_ (has_arg), - val_ (val) -{} - -ACE_Get_Opt::ACE_Get_Opt_Long_Option::~ACE_Get_Opt_Long_Option (void) -{ - delete [] this->name_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Guard_T.cpp b/dep/src/ace/Guard_T.cpp deleted file mode 100644 index d35e27c4d99..00000000000 --- a/dep/src/ace/Guard_T.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// $Id: Guard_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_GUARD_T_CPP -#define ACE_GUARD_T_CPP - -#include "ace/Guard_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Guard_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_DUMP) -# include "ace/Log_Msg.h" -#endif /* ACE_HAS_DUMP */ - -// **************************************************************** - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// ACE_ALLOC_HOOK_DEFINE(ACE_Guard) - -template void -ACE_Guard::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Guard::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("mutex_ = %x\n"), this->lock_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("owner_ = %d\n"), this->owner_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// ACE_ALLOC_HOOK_DEFINE(ACE_Write_Guard) - -template void -ACE_Write_Guard::dump (void) const -{ -#if defined (ACE_HAS_DUMP) -// ACE_TRACE ("ACE_Write_Guard::dump"); - ACE_Guard::dump (); -#endif /* ACE_HAS_DUMP */ -} - -// ACE_ALLOC_HOOK_DEFINE(ACE_Read_Guard) - -template void -ACE_Read_Guard::dump (void) const -{ -// ACE_TRACE ("ACE_Read_Guard::dump"); - ACE_Guard::dump (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_GUARD_T_CPP */ - diff --git a/dep/src/ace/Handle_Ops.cpp b/dep/src/ace/Handle_Ops.cpp deleted file mode 100644 index ed19109b445..00000000000 --- a/dep/src/ace/Handle_Ops.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// $Id: Handle_Ops.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Handle_Ops.h" - -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/Time_Value.h" - -ACE_RCSID (ace, - Handle_Ops, - "$Id: Handle_Ops.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_HANDLE -ACE::handle_timed_open (ACE_Time_Value *timeout, - const ACE_TCHAR *name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE::handle_timed_open"); - - if (timeout != 0) - { -#if !defined (ACE_WIN32) - // On Win32, ACE_NONBLOCK gets recognized as O_WRONLY so we - // don't use it there - flags |= ACE_NONBLOCK; -#endif /* ACE_WIN32 */ - - // Open the named pipe or file using non-blocking mode... - ACE_HANDLE const handle = ACE_OS::open (name, flags, perms, sa); - - if (handle == ACE_INVALID_HANDLE - && (errno == EWOULDBLOCK - && (timeout->sec () > 0 || timeout->usec () > 0))) - // This expression checks if we were polling. - errno = ETIMEDOUT; - - return handle; - } - else - return ACE_OS::open (name, flags, perms, sa); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Handle_Set.cpp b/dep/src/ace/Handle_Set.cpp deleted file mode 100644 index cb460dcb798..00000000000 --- a/dep/src/ace/Handle_Set.cpp +++ /dev/null @@ -1,570 +0,0 @@ -// Handle_Set.cpp -// $Id: Handle_Set.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Handle_Set.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Handle_Set.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS_NS_string.h" - -ACE_RCSID(ace, Handle_Set, "$Id: Handle_Set.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Handle_Set) - - // ACE_MSB_MASK is only used here. - // This needs to go here to avoid overflow problems on some compilers. -#if defined (ACE_WIN32) - // Does ACE_WIN32 have an fd_mask? -# define ACE_MSB_MASK (~(1 << (NFDBITS - 1))) -#else /* ! ACE_WIN32 */ -# define ACE_MSB_MASK (~((fd_mask) 1 << (NFDBITS - 1))) -#endif /* ! ACE_WIN32 */ - -#if defined (__BORLANDC__) && !defined (ACE_WIN32) -// The Borland C++ compiler on Linux also doesn't have fds_bits, but has __fds_bits. -#define fds_bits __fds_bits -#endif - -#if defined (linux) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !defined (_XOPEN_SOURCE) - // XPG4.2 requires the fds_bits member name, so it is not enabled by - // default on Linux/glibc-2.1.x systems. Instead use "__fds_bits." - // Ugly, but "what are you going to do?" 8-) -#define fds_bits __fds_bits -#endif /* linux && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !_XOPEN_SOURCE */ - -void -ACE_Handle_Set::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Handle_Set::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nsize_ = %d"), this->size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmax_handle_ = %d"), this->max_handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n[ "))); - -#if defined (ACE_WIN32) - for (size_t i = 0; i < (size_t) this->mask_.fd_count + 1; i++) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" %x "), this->mask_.fd_array[i])); -#else /* !ACE_WIN32 */ - for (ACE_HANDLE i = 0; i < this->max_handle_ + 1; i++) - if (this->is_set (i)) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" %d "), i)); -#endif /* ACE_WIN32 */ - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" ]\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Table that maps bytes to counts of the enabled bits in each value -// from 0 to 255, -// -// nbits_[0] == 0 -// -// because there are no bits enabled for the value 0. -// -// nbits_[5] == 2 -// -// because there are 2 bits enabled in the value 5, i.e., it's -// 101 in binary. - -const char ACE_Handle_Set::nbits_[256] = -{ - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; - -// Constructor, initializes the bitmask to all 0s. - -ACE_Handle_Set::ACE_Handle_Set (void) -{ - ACE_TRACE ("ACE_Handle_Set::ACE_Handle_Set"); - this->reset (); -} - -ACE_Handle_Set::ACE_Handle_Set (const fd_set &fd_mask) -{ - ACE_TRACE ("ACE_Handle_Set::ACE_Handle_Set"); - this->reset (); - ACE_OS::memcpy ((void *) &this->mask_, - (void *) &fd_mask, - sizeof this->mask_); -#if !defined (ACE_WIN32) - this->sync (ACE_Handle_Set::MAXSIZE); -#if defined (ACE_HAS_BIG_FD_SET) - this->min_handle_ = 0; -#endif /* ACE_HAS_BIG_FD_SET */ -#endif /* !ACE_WIN32 */ -} - -// Counts the number of bits enabled in N. Uses a table lookup to -// speed up the count. - -int -ACE_Handle_Set::count_bits (u_long n) -{ - - ACE_TRACE ("ACE_Handle_Set::count_bits"); -#if defined (ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT) - register int rval = 0; - - // Count the number of enabled bits in . This algorithm is very - // fast, i.e., O(enabled bits in n). - - for (register u_long m = n; - m != 0; - m &= m - 1) - rval++; - - return rval; -#else - return (ACE_Handle_Set::nbits_[n & 0xff] - + ACE_Handle_Set::nbits_[(n >> 8) & 0xff] - + ACE_Handle_Set::nbits_[(n >> 16) & 0xff] - + ACE_Handle_Set::nbits_[(n >> 24) & 0xff]); -#endif /* ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT */ -} - -#if defined (ACE_HAS_BIG_FD_SET) -// Find the bit position counting from right to left worst case -// (1<<31) is 8. - -int -ACE_Handle_Set::bitpos (u_long bit) -{ - register int l = 0; - register u_long n = bit - 1; - - // This is a fast count method when have the most significative bit. - - while (n >> 8) - { - n >>= 8; - l += 8; - } - - // Is greater than 15? - if (n & 16) - { - n >>= 4; - l += 4; - } - - // Count number remaining bits. - while (n != 0) - { - n &= n - 1; - l++; - } - return l; -} -#endif /* ACE_HAS_BIG_FD_SET */ - -// Synchronize the underlying FD_SET with the MAX_FD and the SIZE. - -#if defined (ACE_USE_SHIFT_FOR_EFFICIENCY) -// These don't work because shifting right 3 bits is not the same as -// dividing by 3, e.g., dividing by 8 requires shifting right 3 bits. -// In order to do the shift, we need to calculate the number of bits -// at some point. -#define ACE_DIV_BY_WORDSIZE(x) ((x) >> ((int) ACE_Handle_Set::WORDSIZE)) -#define ACE_MULT_BY_WORDSIZE(x) ((x) << ((int) ACE_Handle_Set::WORDSIZE)) -#else -#define ACE_DIV_BY_WORDSIZE(x) ((x) / ((int) ACE_Handle_Set::WORDSIZE)) -#define ACE_MULT_BY_WORDSIZE(x) ((x) * ((int) ACE_Handle_Set::WORDSIZE)) -#endif /* ACE_USE_SHIFT_FOR_EFFICIENCY */ - -void -ACE_Handle_Set::sync (ACE_HANDLE max) -{ - ACE_TRACE ("ACE_Handle_Set::sync"); -#if !defined (ACE_WIN32) - fd_mask *maskp = (fd_mask *)(this->mask_.fds_bits); - this->size_ = 0; - - for (int i = ACE_DIV_BY_WORDSIZE (max - 1); - i >= 0; - i--) - this->size_ += ACE_Handle_Set::count_bits (maskp[i]); - - this->set_max (max); -#else - ACE_UNUSED_ARG (max); -#endif /* !ACE_WIN32 */ -} - -// Resets the MAX_FD after a clear of the original MAX_FD. - -void -ACE_Handle_Set::set_max (ACE_HANDLE current_max) -{ - ACE_TRACE ("ACE_Handle_Set::set_max"); -#if !defined(ACE_WIN32) - fd_mask * maskp = (fd_mask *)(this->mask_.fds_bits); - - if (this->size_ == 0) - this->max_handle_ = ACE_INVALID_HANDLE; - else - { - int i; - - for (i = ACE_DIV_BY_WORDSIZE (current_max - 1); - maskp[i] == 0; - i--) - continue; -#if defined (ACE_TANDEM_NSK_BIT_ORDER) - // bits are in reverse order, MSB (sign bit) = bit 0. - this->max_handle_ = ACE_MULT_BY_WORDSIZE (i); - for (fd_mask val = maskp[i]; - (val & ACE_MSB_MASK) != 0; - val = (val << 1)) - ++this->max_handle_; -#elif 1 /* !defined(ACE_HAS_BIG_FD_SET) */ - this->max_handle_ = ACE_MULT_BY_WORDSIZE (i); - for (fd_mask val = maskp[i]; - (val & ~1) != 0; // This obscure code is needed since "bit 0" is in location 1... - val = (val >> 1) & ACE_MSB_MASK) - ++this->max_handle_; -#else - register u_long val = this->mask_.fds_bits[i]; - this->max_handle_ = ACE_MULT_BY_WORDSIZE (i) - + ACE_Handle_Set::bitpos(val & ~(val - 1)); -#endif /* 1 */ - } - - // Do some sanity checking... - if (this->max_handle_ >= ACE_Handle_Set::MAXSIZE) - this->max_handle_ = ACE_Handle_Set::MAXSIZE - 1; -#else - ACE_UNUSED_ARG (current_max); -#endif /* !ACE_WIN32 */ -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Handle_Set_Iterator) - -void -ACE_Handle_Set_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Handle_Set_Iterator::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); -#if defined(ACE_WIN32) || !defined(ACE_HAS_BIG_FD_SET) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhandle_index_ = %d"), this->handle_index_)); -#elif defined(ACE_HAS_BIG_FD_SET) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nword_max_ = %d"), this->word_max_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nword_val_ = %d"), this->word_val_)); -#endif - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nword_num_ = %d"), this->word_num_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_HANDLE -ACE_Handle_Set_Iterator::operator () (void) -{ - ACE_TRACE ("ACE_Handle_Set_Iterator::operator"); -#if defined (ACE_WIN32) - if (this->handle_index_ < this->handles_.mask_.fd_count) - // Return the handle and advance the iterator. - return (ACE_HANDLE) this->handles_.mask_.fd_array[this->handle_index_++]; - else - return ACE_INVALID_HANDLE; - -#elif !defined (ACE_HAS_BIG_FD_SET) /* !ACE_WIN32 */ - // No sense searching further than the max_handle_ + 1; - ACE_HANDLE maxhandlep1 = this->handles_.max_handle_ + 1; - - // HP-UX 11 plays some games with the fd_mask type - fd_mask is - // defined as an int_32t, but the fds_bits is an array of longs. - // This makes plainly indexing through the array by hand tricky, - // since the FD_* macros treat the array as int32_t. So the bits - // are in the right place for int32_t, even though the array is - // long. This, they say, is to preserve the same in-memory layout - // for 32-bit and 64-bit processes. So, we play the same game as - // the FD_* macros to get the bits right. On all other systems, - // this amounts to practically a NOP, since this is what would have - // been done anyway, without all this type jazz. - fd_mask * maskp = (fd_mask *)(this->handles_.mask_.fds_bits); - - if (this->handle_index_ >= maxhandlep1) - // We've seen all the handles we're interested in seeing for this - // iterator. - return ACE_INVALID_HANDLE; - else - { - ACE_HANDLE result = this->handle_index_; - - // Increment the iterator and advance to the next bit in this - // word. - this->handle_index_++; -#if defined (ACE_TANDEM_NSK_BIT_ORDER) - // bits are in reverse order, MSB (sign bit) = bit 0. - this->word_val_ = (this->word_val_ << 1); -# else - this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK; -# endif /* ACE_TANDEM_NSK_BIT_ORDER */ - - // If we've examined all the bits in this word, we'll go onto - // the next word. - - if (this->word_val_ == 0) - { - // Start the handle_index_ at the beginning of the next word - // and then loop until we've found the first non-zero bit or - // we run past the of the bitset. - - for (this->handle_index_ = ACE_MULT_BY_WORDSIZE(++this->word_num_); - this->handle_index_ < maxhandlep1 - && maskp[this->word_num_] == 0; - this->word_num_++) - this->handle_index_ += ACE_Handle_Set::WORDSIZE; - - // If the bit index becomes >= the maxhandlep1 that means - // there weren't any more bits set that we want to consider. - // Therefore, we'll just store the maxhandlep1, which will - // cause to return - // immediately next time it's called. - if (this->handle_index_ >= maxhandlep1) - { - this->handle_index_ = maxhandlep1; - return result; - } - else - // Load the bits of the next word. - this->word_val_ = maskp[this->word_num_]; - } - - // Loop until we get to have its least significant - // bit enabled, keeping track of which this - // represents (this information is used by subsequent calls to - // ). - -#if defined (ACE_TANDEM_NSK_BIT_ORDER) - // bits are in reverse order, MSB (sign bit) = bit 0. - for (; - this->word_val_ > 0; - this->word_val_ = (this->word_val_ << 1)) - this->handle_index_++; -# else - for (; - ACE_BIT_DISABLED (this->word_val_, 1); - this->handle_index_++) - this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK; -# endif /* ACE_TANDEM_NSK_BIT_ORDER */ - - return result; - } -#else /* !ACE_HAS_BIG_FD_SET */ - // Find the first word in fds_bits with bit on - register u_long lsb = this->word_val_; - - if (lsb == 0) - { - do - { - // We have exceeded the word count in Handle_Set? - if (++this->word_num_ >= this->word_max_) - return ACE_INVALID_HANDLE; - - lsb = this->handles_.mask_.fds_bits[this->word_num_]; - } - while (lsb == 0); - - // Set index to word boundary. - this->handle_index_ = ACE_MULT_BY_WORDSIZE (this->word_num_); - - // Put new word_val. - this->word_val_ = lsb; - - // Find the least significative bit. - lsb &= ~(lsb - 1); - - // Remove least significative bit. - this->word_val_ ^= lsb; - - // Save to calculate bit distance. - this->oldlsb_ = lsb; - - // Move index to least significative bit. - while (lsb >>= 1) - this->handle_index_++; - } - else - { - // Find the least significative bit. - lsb &= ~(lsb - 1); - - // Remove least significative bit. - this->word_val_ ^= lsb; - - register u_long n = lsb - this->oldlsb_; - - // Move index to bit distance between new lsb and old lsb. - do - { - this->handle_index_++; - n &= n >> 1; - } - while (n != 0); - - this->oldlsb_ = lsb; - } - - return this->handle_index_; -#endif /* ACE_WIN32 */ -} - -ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs) - : handles_ (hs), -#if !defined (ACE_HAS_BIG_FD_SET) || defined (ACE_WIN32) - handle_index_ (0), - word_num_ (-1) -#elif defined (ACE_HAS_BIG_FD_SET) - oldlsb_ (0), - word_max_ (hs.max_handle_ == ACE_INVALID_HANDLE - ? 0 - : ((ACE_DIV_BY_WORDSIZE (hs.max_handle_)) + 1)) -#endif /* ACE_HAS_BIG_FD_SET */ -{ - ACE_TRACE ("ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator"); -#if !defined (ACE_WIN32) && !defined (ACE_HAS_BIG_FD_SET) - // No sense searching further than the max_handle_ + 1; - ACE_HANDLE maxhandlep1 = - this->handles_.max_handle_ + 1; - - fd_mask *maskp = - (fd_mask *)(this->handles_.mask_.fds_bits); - - // Loop until we've found the first non-zero bit or we run past the - // of the bitset. - while (this->handle_index_ < maxhandlep1 - && maskp[++this->word_num_] == 0) - this->handle_index_ += ACE_Handle_Set::WORDSIZE; - - // If the bit index becomes >= the maxhandlep1 that means there - // weren't any bits set. Therefore, we'll just store the - // maxhandlep1, which will cause to return - // immediately. - if (this->handle_index_ >= maxhandlep1) - this->handle_index_ = maxhandlep1; - else - // Loop until we get to have its least significant bit - // enabled, keeping track of which this represents - // (this information is used by ). -#if defined (ACE_TANDEM_NSK_BIT_ORDER) - // bits are in reverse order, MSB (sign bit) = bit 0. - for (this->word_val_ = maskp[this->word_num_]; - this->word_val_ > 0; - this->word_val_ = (this->word_val_ << 1)) - this->handle_index_++; -# else - for (this->word_val_ = maskp[this->word_num_]; - ACE_BIT_DISABLED (this->word_val_, 1) - && this->handle_index_ < maxhandlep1; - this->handle_index_++) - this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK; -# endif /* ACE_TANDEM_NSK_BIT_ORDER */ -#elif !defined (ACE_WIN32) && defined (ACE_HAS_BIG_FD_SET) - if (this->word_max_==0) - { - this->word_num_ = -1; - this->word_val_ = 0; - } - else - { - this->word_num_ = - ACE_DIV_BY_WORDSIZE (this->handles_.min_handle_) - 1; - this->word_val_ = 0; - } -#endif /* !ACE_WIN32 && !ACE_HAS_BIG_FD_SET */ -} - -void -ACE_Handle_Set_Iterator::reset_state (void) -{ - ACE_TRACE ("ACE_Handle_Set_Iterator::reset_state"); - -#if !defined (ACE_HAS_BIG_FD_SET) || defined (ACE_WIN32) - this->handle_index_ = 0; - this->word_num_ = -1; -#elif defined (ACE_HAS_BIG_FD_SET) - this->oldlsb_ = 0; - this->word_max_ = - this->handles_.max_handle_ == ACE_INVALID_HANDLE ? 0 - : ((ACE_DIV_BY_WORDSIZE (this->handles_.max_handle_)) + 1); -#endif /* ACE_HAS_BIG_FD_SET */ - -#if !defined (ACE_WIN32) && !defined (ACE_HAS_BIG_FD_SET) - // No sense searching further than the max_handle_ + 1; - ACE_HANDLE maxhandlep1 = - this->handles_.max_handle_ + 1; - - fd_mask *maskp = - (fd_mask *)(this->handles_.mask_.fds_bits); - - // Loop until we've found the first non-zero bit or we run past the - // of the bitset. - while (this->handle_index_ < maxhandlep1 - && maskp[++this->word_num_] == 0) - this->handle_index_ += ACE_Handle_Set::WORDSIZE; - - // If the bit index becomes >= the maxhandlep1 that means there - // weren't any bits set. Therefore, we'll just store the - // maxhandlep1, which will cause to return - // immediately. - if (this->handle_index_ >= maxhandlep1) - this->handle_index_ = maxhandlep1; - else - // Loop until we get to have its least significant bit - // enabled, keeping track of which this represents - // (this information is used by ). -#if defined (ACE_TANDEM_NSK_BIT_ORDER) - // bits are in reverse order, MSB (sign bit) = bit 0. - for (this->word_val_ = maskp[this->word_num_]; - this->word_val_ > 0; - this->word_val_ = (this->word_val_ << 1)) - this->handle_index_++; -# else - for (this->word_val_ = maskp[this->word_num_]; - ACE_BIT_DISABLED (this->word_val_, 1) - && this->handle_index_ < maxhandlep1; - this->handle_index_++) - this->word_val_ = (this->word_val_ >> 1) & ACE_MSB_MASK; -# endif /* ACE_TANDEM_NSK_BIT_ORDER */ -#elif !defined (ACE_WIN32) && defined (ACE_HAS_BIG_FD_SET) - if (this->word_max_==0) - { - this->word_num_ = -1; - this->word_val_ = 0; - } - else - { - this->word_num_ = - ACE_DIV_BY_WORDSIZE (this->handles_.min_handle_) - 1; - this->word_val_ = 0; - } -#endif /* !ACE_WIN32 && !ACE_HAS_BIG_FD_SET */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Hash_Cache_Map_Manager_T.cpp b/dep/src/ace/Hash_Cache_Map_Manager_T.cpp deleted file mode 100644 index 6601bd4bdd7..00000000000 --- a/dep/src/ace/Hash_Cache_Map_Manager_T.cpp +++ /dev/null @@ -1,233 +0,0 @@ -// $Id: Hash_Cache_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_HASH_CACHE_MAP_MANAGER_T_CPP -#define ACE_HASH_CACHE_MAP_MANAGER_T_CPP - -#include "ace/Hash_Cache_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Hash_Cache_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Cache_Map_Manager) - -#define ACE_T1 class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES - -template -ACE_Hash_Cache_Map_Manager::ACE_Hash_Cache_Map_Manager (CACHING_STRATEGY &caching_s, - size_t size, - ACE_Allocator *alloc) - : ACE_HCMM_BASE (caching_s, - size, - alloc) -{ -} - -template -ACE_Hash_Cache_Map_Manager::~ACE_Hash_Cache_Map_Manager (void) -{ -} - -template int -ACE_Hash_Cache_Map_Manager::bind (const KEY &key, - const VALUE &value, - CACHE_ENTRY *&entry) -{ - // Insert a entry which has the and the which is - // the combination of the and the attributes of the caching - // strategy. - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int bind_result = this->map_.bind (key, - cache_value, - entry); - - if (bind_result != -1) - { - - int result = this->caching_strategy_.notify_bind (bind_result, - cache_value.second ()); - - if (result == -1) - { - - this->map_.unbind (key); - - // Unless the notification goes thru the bind operation is - // not complete. - bind_result = -1; - - } - } - - return bind_result; -} - -template int -ACE_Hash_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value, - CACHE_ENTRY *&entry) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value, - entry); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - - } - - return rebind_result; -} - -template int -ACE_Hash_Cache_Map_Manager::trybind (const KEY &key, - VALUE &value, - CACHE_ENTRY *&entry) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int trybind_result = this->map_.trybind (key, - cache_value, - entry); - - if (trybind_result != -1) - { - int result = this->caching_strategy_.notify_trybind (trybind_result, - cache_value.second ()); - - if (result == -1) - { - - // If the entry has got inserted into the map, it is removed - // due to failure. - if (trybind_result == 0) - this->map_.unbind (key); - - trybind_result = -1; - - } - else - { - - // If an attempt is made to bind an existing entry the value - // is overwritten with the value from the map. - if (trybind_result == 1) - value = cache_value.first (); - - } - - } - - return trybind_result; -} - -template int -ACE_Hash_Cache_Map_Manager::find (const KEY &key, - CACHE_ENTRY *&entry) -{ - // Lookup the key and populate the . - int find_result = this->map_.find (key, - entry); - - if (find_result != -1) - { - - int result = this->caching_strategy_.notify_find (find_result, - entry->int_id_.second ()); - - // Unless the find and notification operations go thru, this - // method is not successful. - if (result == -1) - find_result = -1; - else - find_result = 0; - - } - - return find_result; -} - -template int -ACE_Hash_Cache_Map_Manager::find (const KEY &key, - VALUE &value) -{ - CACHE_ENTRY *entry = 0; - - int result = this->find (key, - entry); - - if (result != -1) - { - value = entry->int_id_.first (); - } - - return result; -} - -template int -ACE_Hash_Cache_Map_Manager::find (const KEY &key) -{ - CACHE_ENTRY *entry = 0; - - return this->find (key, - entry); -} - -template int -ACE_Hash_Cache_Map_Manager::unbind (CACHE_ENTRY *entry) -{ - // Remove the entry from the cache. - int unbind_result = this->map_.unbind (entry); - - if (unbind_result != -1) - { - - int result = this->caching_strategy_.notify_unbind (unbind_result, - entry->int_id_.second ()); - - if (result == -1) - unbind_result = -1; - - } - - return unbind_result; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#undef ACE_T1 -#undef ACE_T2 - -#endif /* ACE_HASH_CACHE_MAP_MANAGER_T_CPP */ - diff --git a/dep/src/ace/Hash_Map_Manager_T.cpp b/dep/src/ace/Hash_Map_Manager_T.cpp deleted file mode 100644 index d628ebdcec0..00000000000 --- a/dep/src/ace/Hash_Map_Manager_T.cpp +++ /dev/null @@ -1,531 +0,0 @@ - -//============================================================================= -/** - * @file Hash_Map_Manager_T.cpp - * - * $Id: Hash_Map_Manager_T.cpp 81735 2008-05-19 19:14:10Z johnnyw $ - * - * @author Douglas C. Schmidt - */ -//============================================================================= - - -#ifndef ACE_HASH_MAP_MANAGER_T_CPP -#define ACE_HASH_MAP_MANAGER_T_CPP - -#include "ace/Hash_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -# include "ace/Hash_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Malloc_Base.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Hash_Map_Entry::ACE_Hash_Map_Entry (ACE_Hash_Map_Entry *next, - ACE_Hash_Map_Entry *prev) - : next_ (next), - prev_ (prev) -{ -} - -template -ACE_Hash_Map_Entry::ACE_Hash_Map_Entry (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_Hash_Map_Entry *next, - ACE_Hash_Map_Entry *prev) - : ext_id_ (ext_id), - int_id_ (int_id), - next_ (next), - prev_ (prev) -{ -} - -template -ACE_Hash_Map_Entry::~ACE_Hash_Map_Entry (void) -{ -} - -template EXT_ID & -ACE_Hash_Map_Entry::key () -{ - return ext_id_; -} - -template INT_ID & -ACE_Hash_Map_Entry::item () -{ - return int_id_; -} - -template void -ACE_Hash_Map_Entry::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %d"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("prev_ = %d"), this->prev_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template void -ACE_Hash_Map_Manager_Ex::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d"), this->total_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); - this->table_allocator_->dump (); - this->entry_allocator_->dump (); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template int -ACE_Hash_Map_Manager_Ex::create_buckets (size_t size) -{ - size_t bytes = size * sizeof (ACE_Hash_Map_Entry); - void *ptr = 0; - - ACE_ALLOCATOR_RETURN (ptr, - this->table_allocator_->malloc (bytes), - -1); - - this->table_ = (ACE_Hash_Map_Entry *) ptr; - - this->total_size_ = size; - - // Initialize each entry in the hash table to be a circular linked - // list with the dummy node in the front serving as the anchor of - // the list. - for (size_t i = 0; i < size; i++) - new (&this->table_[i]) ACE_Hash_Map_Entry (&this->table_[i], - &this->table_[i]); - return 0; -} - -template int -ACE_Hash_Map_Manager_Ex::open (size_t size, - ACE_Allocator *table_alloc, - ACE_Allocator *entry_alloc) -{ - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - // Calling this->close_i () to ensure we release previous allocated - // memory before allocating new one. - this->close_i (); - - if (table_alloc == 0) - table_alloc = ACE_Allocator::instance (); - - this->table_allocator_ = table_alloc; - - if (entry_alloc == 0) - entry_alloc = table_alloc; - - this->entry_allocator_ = entry_alloc; - - // This assertion is here to help track a situation that shouldn't - // happen, but did with Sun C++ 4.1 (before a change to this class - // was made: it used to have an enum that was supposed to be defined - // to be ACE_DEFAULT_MAP_SIZE, but instead was defined to be 0). - if (size == 0) - return -1; - - return this->create_buckets (size); -} - -template int -ACE_Hash_Map_Manager_Ex::close_i (void) -{ - // Protect against "double-deletion" in case the destructor also - // gets called. - if (this->table_ != 0) - { - // Remove all the entries. - this->unbind_all_i (); - - // Iterate through the buckets cleaning up the sentinels. - for (size_t i = 0; i < this->total_size_; i++) - { - // Destroy the dummy entry. - ACE_Hash_Map_Entry *entry = &this->table_[i]; - - // The second argument results in a no-op instead of - // deallocation. - ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP, - ACE_Hash_Map_Entry, EXT_ID, INT_ID); - } - - // Reset size. - this->total_size_ = 0; - - // Free table memory. - this->table_allocator_->free (this->table_); - - // Should be done last... - this->table_ = 0; - } - - return 0; -} - -template int -ACE_Hash_Map_Manager_Ex::unbind_all_i (void) -{ - // Iterate through the entire map calling the destuctor of each - // . - for (size_t i = 0; i < this->total_size_; i++) - { - for (ACE_Hash_Map_Entry *temp_ptr = this->table_[i].next_; - temp_ptr != &this->table_[i]; - ) - { - ACE_Hash_Map_Entry *hold_ptr = temp_ptr; - temp_ptr = temp_ptr->next_; - - // Explicitly call the destructor. - ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->entry_allocator_->free, - ACE_Hash_Map_Entry, EXT_ID, INT_ID); - } - - // Restore the sentinel. - this->table_[i].next_ = &this->table_[i]; - this->table_[i].prev_ = &this->table_[i]; - } - - this->cur_size_ = 0; - - return 0; -} - -template int -ACE_Hash_Map_Manager_Ex::bind_i (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_Hash_Map_Entry *&entry) -{ - size_t loc = 0; - if (this->shared_find (ext_id, entry, loc) == -1) - { - void *ptr = 0; - // Not found. - ACE_ALLOCATOR_RETURN (ptr, - this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry)), - -1); - - entry = new (ptr) ACE_Hash_Map_Entry (ext_id, - int_id, - this->table_[loc].next_, - &this->table_[loc]); - this->table_[loc].next_ = entry; - entry->next_->prev_ = entry; - this->cur_size_++; - return 0; - } - else - return 1; -} - -template int -ACE_Hash_Map_Manager_Ex::trybind_i (const EXT_ID &ext_id, - INT_ID &int_id, - ACE_Hash_Map_Entry *&entry) -{ - size_t loc = 0; - if (this->shared_find (ext_id, entry, loc) == -1) - { - // Not found. - void *ptr = 0; - ACE_ALLOCATOR_RETURN (ptr, - this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry)), - -1); - - entry = new (ptr) ACE_Hash_Map_Entry (ext_id, - int_id, - this->table_[loc].next_, - &this->table_[loc]); - this->table_[loc].next_ = entry; - entry->next_->prev_ = entry; - this->cur_size_++; - return 0; - } - else - return 1; -} - -template int -ACE_Hash_Map_Manager_Ex::unbind_i (const EXT_ID &ext_id, - INT_ID &int_id) -{ - ACE_Hash_Map_Entry *temp; - - size_t loc = 0; - if (this->shared_find (ext_id, temp, loc) == -1) - { - errno = ENOENT; - return -1; - } - - int_id = temp->int_id_; - - return this->unbind_i (temp); -} - -template int -ACE_Hash_Map_Manager_Ex::unbind_i (ACE_Hash_Map_Entry *entry) -{ - entry->next_->prev_ = entry->prev_; - entry->prev_->next_ = entry->next_; - - // Explicitly call the destructor. - ACE_DES_FREE_TEMPLATE2 (entry, this->entry_allocator_->free, - ACE_Hash_Map_Entry, EXT_ID, INT_ID); - - --this->cur_size_; - return 0; -} - -template int -ACE_Hash_Map_Manager_Ex::shared_find (const EXT_ID &ext_id, - ACE_Hash_Map_Entry *&entry, - size_t &loc) -{ - if (this->total_size_ == 0) - { - errno = ENOENT; - return -1; - } - - loc = this->hash (ext_id) % this->total_size_; - - ACE_Hash_Map_Entry *temp = this->table_[loc].next_; - - while (temp != &this->table_[loc] && this->equal (temp->ext_id_, ext_id) == 0) - temp = temp->next_; - - if (temp == &this->table_[loc]) - { - errno = ENOENT; - return -1; - } - else - { - entry = temp; - return 0; - } -} - -template int -ACE_Hash_Map_Manager_Ex::rebind_i (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_Hash_Map_Entry *&entry) -{ - size_t dummy = 0; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id); - else - { - entry->ext_id_ = ext_id; - entry->int_id_ = int_id; - return 1; - } -} - -template int -ACE_Hash_Map_Manager_Ex::rebind_i (const EXT_ID &ext_id, - const INT_ID &int_id, - INT_ID &old_int_id, - ACE_Hash_Map_Entry *&entry) -{ - size_t dummy = 0; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id); - else - { - old_int_id = entry->int_id_; - entry->ext_id_ = ext_id; - entry->int_id_ = int_id; - return 1; - } -} - -template int -ACE_Hash_Map_Manager_Ex::rebind_i (const EXT_ID &ext_id, - const INT_ID &int_id, - EXT_ID &old_ext_id, - INT_ID &old_int_id, - ACE_Hash_Map_Entry *&entry) -{ - size_t dummy = 0; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id); - else - { - old_ext_id = entry->ext_id_; - old_int_id = entry->int_id_; - entry->ext_id_ = ext_id; - entry->int_id_ = int_id; - return 1; - } -} - -// ------------------------------------------------------------ - -ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Map_Iterator_Base_Ex) - -template void -ACE_Hash_Map_Iterator_Base_Ex::dump_i (void) const -{ - ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("index_ = %d "), this->index_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Hash_Map_Iterator_Base_Ex::forward_i (void) -{ - ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex::forward_i"); - - if (this->map_man_->table_ == 0) - return -1; - // Handle initial case specially. - else if (this->index_ == -1) - { - this->index_++; - return this->forward_i (); - } - else if (this->index_ >= static_cast (this->map_man_->total_size_)) - return 0; - - this->next_ = this->next_->next_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (++this->index_ < static_cast (this->map_man_->total_size_)) - { - this->next_ = this->map_man_->table_[this->index_].next_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ < static_cast (this->map_man_->total_size_); -} - -template int -ACE_Hash_Map_Iterator_Base_Ex::reverse_i (void) -{ - ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex::reverse_i"); - - if (this->map_man_->table_ == 0) - return -1; - else if (this->index_ == static_cast (this->map_man_->total_size_)) - { - --this->index_; - return this->reverse_i (); - } - else if (this->index_ < 0) - return 0; - - this->next_ = this->next_->prev_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (--this->index_ >= 0) - { - this->next_ = this->map_man_->table_[this->index_].prev_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ >= 0; -} - -// ------------------------------------------------------------ - -ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Map_Const_Iterator_Base_Ex) - -template void -ACE_Hash_Map_Const_Iterator_Base_Ex::dump_i (void) const -{ - ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("index_ = %d "), this->index_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Hash_Map_Const_Iterator_Base_Ex::forward_i (void) -{ - ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex::forward_i"); - - if (this->map_man_->table_ == 0) - return -1; - // Handle initial case specially. - else if (this->index_ == -1) - { - ++this->index_; - return this->forward_i (); - } - else if (this->index_ >= (ssize_t) this->map_man_->total_size_) - return 0; - - this->next_ = this->next_->next_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (++this->index_ < (ssize_t) this->map_man_->total_size_) - { - this->next_ = this->map_man_->table_[this->index_].next_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ < (ssize_t) this->map_man_->total_size_; -} - -template int -ACE_Hash_Map_Const_Iterator_Base_Ex::reverse_i (void) -{ - ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex::reverse_i"); - - if (this->map_man_->table_ == 0) - return -1; - else if (this->index_ == (ssize_t) this->map_man_->total_size_) - { - --this->index_; - return this->reverse_i (); - } - else if (this->index_ < 0) - return 0; - - this->next_ = this->next_->prev_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (--this->index_ >= 0) - { - this->next_ = this->map_man_->table_[this->index_].prev_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ >= 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HASH_MAP_MANAGER_T_CPP */ - diff --git a/dep/src/ace/Hash_Map_With_Allocator_T.cpp b/dep/src/ace/Hash_Map_With_Allocator_T.cpp deleted file mode 100644 index 09a5abf1d9c..00000000000 --- a/dep/src/ace/Hash_Map_With_Allocator_T.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// $Id: Hash_Map_With_Allocator_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_HASH_MAP_WITH_ALLOCATOR_T_CPP -#define ACE_HASH_MAP_WITH_ALLOCATOR_T_CPP - -#include "ace/Hash_Map_With_Allocator_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Hash_Map_With_Allocator_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Hash_Map_With_Allocator::ACE_Hash_Map_With_Allocator (ACE_Allocator *alloc) - : ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> (alloc) -{ - ACE_TRACE ("ACE_Hash_Map_With_Allocator::ACE_Hash_Map_With_Allocator"); -} - -template -ACE_Hash_Map_With_Allocator::ACE_Hash_Map_With_Allocator (size_t size, - ACE_Allocator *alloc) - : ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> (size, alloc) -{ - ACE_TRACE ("ACE_Hash_Map_With_Allocator::ACE_Hash_Map_With_Allocator"); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HASH_MAP_WITH_ALLOCATOR_T_CPP */ - diff --git a/dep/src/ace/Hash_Multi_Map_Manager_T.cpp b/dep/src/ace/Hash_Multi_Map_Manager_T.cpp deleted file mode 100644 index 939bf967433..00000000000 --- a/dep/src/ace/Hash_Multi_Map_Manager_T.cpp +++ /dev/null @@ -1,606 +0,0 @@ - -//============================================================================= -/** - * @file Hash_Multi_Map_Manager_T.cpp - * - * $Id: Hash_Multi_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Shanshan Jiang - */ -//============================================================================= - - -#ifndef ACE_Hash_Multi_Map_Manager_T_CPP -#define ACE_Hash_Multi_Map_Manager_T_CPP - -#include "ace/Hash_Multi_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -# include "ace/Hash_Multi_Map_Manager_T.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Malloc_Base.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - - -template -ACE_Hash_Multi_Map_Entry::ACE_Hash_Multi_Map_Entry (ACE_Hash_Multi_Map_Entry *next, - ACE_Hash_Multi_Map_Entry *prev) - : next_ (next), - prev_ (prev) -{ -} - -template -ACE_Hash_Multi_Map_Entry::ACE_Hash_Multi_Map_Entry (const EXT_ID &ext_id, - const ACE_Unbounded_Set &int_id_set, - ACE_Hash_Multi_Map_Entry *next, - ACE_Hash_Multi_Map_Entry *prev) - : ext_id_ (ext_id), - int_id_set_ (int_id_set), - next_ (next), - prev_ (prev) -{ -} - -# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) -template -ACE_Hash_Multi_Map_Entry::~ACE_Hash_Multi_Map_Entry (void) -{ -} -# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */ - -template EXT_ID & -ACE_Hash_Multi_Map_Entry::key () -{ - return ext_id_; -} - -template ACE_Unbounded_Set & -ACE_Hash_Multi_Map_Entry::item () -{ - return int_id_set_; -} - -template void -ACE_Hash_Multi_Map_Entry::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %d"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("prev_ = %d"), this->prev_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template void -ACE_Hash_Multi_Map_Manager::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d"), this->total_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); - this->table_allocator_->dump (); - this->entry_allocator_->dump (); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template int -ACE_Hash_Multi_Map_Manager::create_buckets (size_t size) -{ - size_t bytes = size * sizeof (ACE_Hash_Multi_Map_Entry); - void *ptr; - - ACE_ALLOCATOR_RETURN (ptr, - this->table_allocator_->malloc (bytes), - -1); - - this->table_ = (ACE_Hash_Multi_Map_Entry *) ptr; - - this->total_size_ = size; - - // Initialize each entry in the hash table to be a circular linked - // list with the dummy node in the front serving as the anchor of - // the list. - for (size_t i = 0; i < size; i++) - new (&this->table_[i]) ACE_Hash_Multi_Map_Entry (&this->table_[i], - &this->table_[i]); - return 0; -} - -template int -ACE_Hash_Multi_Map_Manager::open (size_t size, - ACE_Allocator *table_alloc, - ACE_Allocator *entry_alloc) -{ - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - // Calling this->close_i () to ensure we release previous allocated - // memory before allocating new one. - this->close_i (); - - if (table_alloc == 0) - table_alloc = ACE_Allocator::instance (); - - this->table_allocator_ = table_alloc; - - if (entry_alloc == 0) - entry_alloc = table_alloc; - - this->entry_allocator_ = entry_alloc; - - // This assertion is here to help track a situation that shouldn't - // happen, but did with Sun C++ 4.1 (before a change to this class - // was made: it used to have an enum that was supposed to be defined - // to be ACE_DEFAULT_MAP_SIZE, but instead was defined to be 0). - if (size == 0) - return -1; - - return this->create_buckets (size); -} - -template int -ACE_Hash_Multi_Map_Manager::close_i (void) -{ - // Protect against "double-deletion" in case the destructor also - // gets called. - if (this->table_ != 0) - { - // Remove all the entries. - this->unbind_all_i (); - - // Iterate through the buckets cleaning up the sentinels. - for (size_t i = 0; i < this->total_size_; i++) - { - // Destroy the dummy entry. - ACE_Hash_Multi_Map_Entry *entry = &this->table_[i]; - - // The second argument results in a no-op instead of - // deallocation. - ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP, - ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); - } - - // Reset size. - this->total_size_ = 0; - - // Free table memory. - this->table_allocator_->free (this->table_); - - // Should be done last... - this->table_ = 0; - } - - return 0; -} - -template int -ACE_Hash_Multi_Map_Manager::unbind_all_i (void) -{ - // Iterate through the entire map calling the destuctor of each - // . - for (size_t i = 0; i < this->total_size_; i++) - { - for (ACE_Hash_Multi_Map_Entry *temp_ptr = this->table_[i].next_; - temp_ptr != &this->table_[i]; - ) - { - ACE_Hash_Multi_Map_Entry *hold_ptr = temp_ptr; - temp_ptr = temp_ptr->next_; - - // Explicitly call the destructor. - ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->entry_allocator_->free, - ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); - } - - // Restore the sentinel. - this->table_[i].next_ = &this->table_[i]; - this->table_[i].prev_ = &this->table_[i]; - } - - this->cur_size_ = 0; - - return 0; -} - -template int -ACE_Hash_Multi_Map_Manager::bind_i (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t loc; - int result = this->shared_find (ext_id, entry, loc); - - ACE_Unbounded_Set int_id_set; - if (result == -1) - { - void *ptr; - // Not found. - ACE_ALLOCATOR_RETURN (ptr, - this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry)), - -1); - - int_id_set.insert (int_id); - - entry = new (ptr) ACE_Hash_Multi_Map_Entry (ext_id, - int_id_set, - this->table_[loc].next_, - &this->table_[loc]); - this->table_[loc].next_ = entry; - entry->next_->prev_ = entry; - this->cur_size_++; - return 0; - } - else - { - int_id_set = (*entry).int_id_set_; - - if (0 == int_id_set.insert (int_id)) - { - this->unbind_i (entry); - return this->bind_i (ext_id, int_id_set); - } - else - return 1; - } -} - -template int -ACE_Hash_Multi_Map_Manager::bind_i (const EXT_ID &ext_id, - const ACE_Unbounded_Set &int_id_set, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t loc; - int result = this->shared_find (ext_id, entry, loc); - - if (result == -1) - { - void *ptr; - // Not found. - ACE_ALLOCATOR_RETURN (ptr, - this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry)), - -1); - - entry = new (ptr) ACE_Hash_Multi_Map_Entry (ext_id, - int_id_set, - this->table_[loc].next_, - &this->table_[loc]); - this->table_[loc].next_ = entry; - entry->next_->prev_ = entry; - this->cur_size_++; - return 0; - } - else - return 1; -} - -template int -ACE_Hash_Multi_Map_Manager::trybind_i (const EXT_ID &ext_id, - ACE_Unbounded_Set &int_id_set, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t loc; - int result = this->shared_find (ext_id, entry, loc); - - if (result == -1) - { - // Not found. - void *ptr; - ACE_ALLOCATOR_RETURN (ptr, - this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry)), - -1); - - entry = new (ptr) ACE_Hash_Multi_Map_Entry (ext_id, - int_id_set, - this->table_[loc].next_, - &this->table_[loc]); - this->table_[loc].next_ = entry; - entry->next_->prev_ = entry; - this->cur_size_++; - return 0; - } - else - return 1; -} - -template int -ACE_Hash_Multi_Map_Manager::unbind_i (const EXT_ID &ext_id, - ACE_Unbounded_Set &int_id_set) -{ - ACE_Hash_Multi_Map_Entry *temp; - - size_t loc; - int result = this->shared_find (ext_id, temp, loc); - - if (result == -1) - { - errno = ENOENT; - return -1; - } - - int_id_set = temp->int_id_set_; - - return this->unbind_i (temp); -} - -template int -ACE_Hash_Multi_Map_Manager::unbind_i (ACE_Hash_Multi_Map_Entry *entry) -{ - entry->next_->prev_ = entry->prev_; - entry->prev_->next_ = entry->next_; - - // Explicitly call the destructor. - ACE_DES_FREE_TEMPLATE2 (entry, this->entry_allocator_->free, - ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); - - this->cur_size_--; - return 0; -} - -template int -ACE_Hash_Multi_Map_Manager::unbind_i (const EXT_ID &ext_id, - const INT_ID &int_id) -{ - ACE_Hash_Multi_Map_Entry *temp; - - size_t loc; - int result = this->shared_find (ext_id, temp, loc); - - if (result == -1) - { - errno = ENOENT; - return -1; - } - - ACE_Unbounded_Set int_id_set = (*temp).int_id_set_; - if (0 == int_id_set.remove (int_id)) - { - this->unbind_i (temp); - - if (0 != int_id_set.size ()) - return this->bind_i (ext_id, int_id_set); - else - return 0; - } - else - return -1; -} - - -template int -ACE_Hash_Multi_Map_Manager::shared_find (const EXT_ID &ext_id, - ACE_Hash_Multi_Map_Entry *&entry, - size_t &loc) -{ - loc = this->hash (ext_id) % this->total_size_; - - ACE_Hash_Multi_Map_Entry *temp = this->table_[loc].next_; - - while (temp != &this->table_[loc] && this->equal (temp->ext_id_, ext_id) == 0) - temp = temp->next_; - - if (temp == &this->table_[loc]) - { - errno = ENOENT; - return -1; - } - else - { - entry = temp; - return 0; - } -} - -template int -ACE_Hash_Multi_Map_Manager::rebind_i (const EXT_ID &ext_id, - const ACE_Unbounded_Set &int_id_set, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t dummy; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id_set); - else - { - entry->ext_id_ = ext_id; - entry->int_id_set_ = int_id_set; - return 1; - } -} - -template int -ACE_Hash_Multi_Map_Manager::rebind_i (const EXT_ID &ext_id, - const ACE_Unbounded_Set &int_id_set, - ACE_Unbounded_Set &old_int_id_set, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t dummy; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id_set); - else - { - old_int_id_set = entry->int_id_set_; - entry->ext_id_ = ext_id; - entry->int_id_set_ = int_id_set; - return 1; - } -} - -template int -ACE_Hash_Multi_Map_Manager::rebind_i (const EXT_ID &ext_id, - const ACE_Unbounded_Set &int_id_set, - EXT_ID &old_ext_id, - ACE_Unbounded_Set &old_int_id_set, - ACE_Hash_Multi_Map_Entry *&entry) -{ - size_t dummy; - if (this->shared_find (ext_id, entry, dummy) == -1) - return this->bind_i (ext_id, int_id_set); - else - { - old_ext_id = entry->ext_id_; - old_int_id_set = entry->int_id_set_; - entry->ext_id_ = ext_id; - entry->int_id_set_ = int_id_set; - return 1; - } -} - -// ------------------------------------------------------------ - -ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Multi_Map_Iterator_Base) - -template void -ACE_Hash_Multi_Map_Iterator_Base::dump_i (void) const -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Iterator_Base::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("index_ = %d "), this->index_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Hash_Multi_Map_Iterator_Base::forward_i (void) -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Iterator_Base::forward_i"); - - if (this->map_man_->table_ == 0) - return -1; - // Handle initial case specially. - else if (this->index_ == -1) - { - this->index_++; - return this->forward_i (); - } - else if (this->index_ >= static_cast (this->map_man_->total_size_)) - return 0; - - this->next_ = this->next_->next_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (++this->index_ < static_cast (this->map_man_->total_size_)) - { - this->next_ = this->map_man_->table_[this->index_].next_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ < static_cast (this->map_man_->total_size_); -} - -template int -ACE_Hash_Multi_Map_Iterator_Base::reverse_i (void) -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Iterator_Base::reverse_i"); - - if (this->map_man_->table_ == 0) - return -1; - else if (this->index_ == static_cast (this->map_man_->total_size_)) - { - this->index_--; - return this->reverse_i (); - } - else if (this->index_ < 0) - return 0; - - this->next_ = this->next_->prev_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (--this->index_ >= 0) - { - this->next_ = this->map_man_->table_[this->index_].prev_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ >= 0; -} - -// ------------------------------------------------------------ - -ACE_ALLOC_HOOK_DEFINE(ACE_Hash_Multi_Map_Const_Iterator_Base) - -template void -ACE_Hash_Multi_Map_Const_Iterator_Base::dump_i (void) const -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Const_Iterator_Base::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("index_ = %d "), this->index_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Hash_Multi_Map_Const_Iterator_Base::forward_i (void) -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Const_Iterator_Base::forward_i"); - - if (this->map_man_->table_ == 0) - return -1; - // Handle initial case specially. - else if (this->index_ == -1) - { - this->index_++; - return this->forward_i (); - } - else if (this->index_ >= (ssize_t) this->map_man_->total_size_) - return 0; - - this->next_ = this->next_->next_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (++this->index_ < (ssize_t) this->map_man_->total_size_) - { - this->next_ = this->map_man_->table_[this->index_].next_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ < (ssize_t) this->map_man_->total_size_; -} - -template int -ACE_Hash_Multi_Map_Const_Iterator_Base::reverse_i (void) -{ - ACE_TRACE ("ACE_Hash_Multi_Map_Const_Iterator_Base::reverse_i"); - - if (this->map_man_->table_ == 0) - return -1; - else if (this->index_ == (ssize_t) this->map_man_->total_size_) - { - this->index_--; - return this->reverse_i (); - } - else if (this->index_ < 0) - return 0; - - this->next_ = this->next_->prev_; - if (this->next_ == &this->map_man_->table_[this->index_]) - { - while (--this->index_ >= 0) - { - this->next_ = this->map_man_->table_[this->index_].prev_; - if (this->next_ != &this->map_man_->table_[this->index_]) - break; - } - } - - return this->index_ >= 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_Hash_Multi_Map_Manager_T_CPP */ - diff --git a/dep/src/ace/Hashable.cpp b/dep/src/ace/Hashable.cpp deleted file mode 100644 index 07723697b28..00000000000 --- a/dep/src/ace/Hashable.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Hashable.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Hashable.inl" -#endif /* __ACE_INLINE __ */ - -ACE_RCSID (ace, - Hashable, - "$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Hashable::~ACE_Hashable (void) -{ -} - -unsigned long -ACE_Hashable::hash (void) const -{ - // In doing the check below, we take chance of paying a performance - // price when the hash value is zero. But, that will (hopefully) - // happen far less often than a non-zero value, so this caching - // strategy should pay off, esp. if hash computation is expensive - // relative to the simple comparison. - - if (this->hash_value_ == 0) - this->hash_value_ = this->hash_i (); - - return this->hash_value_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/High_Res_Timer.cpp b/dep/src/ace/High_Res_Timer.cpp deleted file mode 100644 index 03b9d643418..00000000000 --- a/dep/src/ace/High_Res_Timer.cpp +++ /dev/null @@ -1,535 +0,0 @@ -// $Id: High_Res_Timer.cpp 81030 2008-03-20 12:43:29Z johnnyw $ - -// Be very carefull before changing the calculations inside -// ACE_High_Res_Timer. The precision matters and we are using integer -// calculations not floating point. Also look good at the emulated 64 -// bit int class (inside Basic_Types{h,i,cpp} before changing -// anything. It's operator/ only returns 32 bits not 64 bits, among -// other things. - -#include "ace/High_Res_Timer.h" - -#if !defined (__ACE_INLINE__) -#include "ace/High_Res_Timer.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Stats.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_sys_time.h" -#include "ace/OS_NS_time.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/Truncate.h" - -ACE_RCSID(ace, High_Res_Timer, "$Id: High_Res_Timer.cpp 81030 2008-03-20 12:43:29Z johnnyw $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_High_Res_Timer) - -ACE_END_VERSIONED_NAMESPACE_DECL - -// For Intel platforms, a scale factor is required for -// ACE_OS::gethrtime. We'll still set this to one to prevent division -// by zero errors. -#if (defined (ACE_WIN32) || defined (ACE_HAS_POWERPC_TIMER) || \ - defined (ACE_HAS_PENTIUM) || defined (ACE_HAS_ALPHA_TIMER)) && \ - !defined (ACE_HAS_HI_RES_TIMER) - -# include "ace/Guard_T.h" -# include "ace/Recursive_Thread_Mutex.h" -# include "ace/Object_Manager.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - - // Initialize the global_scale_factor_ to 1. The first - // ACE_High_Res_Timer instance construction will override this - // value. - /* static */ - ACE_UINT32 ACE_High_Res_Timer::global_scale_factor_ = 1u; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#else /* ! (ACE_WIN32 || ACE_HAS_POWERPC_TIMER || \ - ACE_HAS_PENTIUM || ACE_HAS_ALPHA_TIMER) || - ACE_HAS_HI_RES_TIMER */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - - // A scale_factor of 1000 converts nanosecond ticks to microseconds. - // That is, on these platforms, 1 tick == 1 nanosecond. - /* static */ - ACE_UINT32 ACE_High_Res_Timer::global_scale_factor_ = 1000u; - -ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ! (ACE_WIN32 || ACE_HAS_POWERPC_TIMER || \ - ACE_HAS_PENTIUM || ACE_HAS_ALPHA_TIMER) || - ACE_HAS_HI_RES_TIMER */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// This is used to tell if the global_scale_factor_ has been -// set, and if high resolution timers are supported. -/* static */ -int ACE_High_Res_Timer::global_scale_factor_status_ = 0; - -#if defined (linux) -// Determine the apparent CPU clock speed from /proc/cpuinfo -ACE_UINT32 -ACE_High_Res_Timer::get_cpuinfo (void) -{ - ACE_UINT32 scale_factor = 1u; - - // Get the BogoMIPS from /proc/cpuinfo. It works fine on Alpha and - // Pentium Pro. For other CPUs, it will be necessary to interpret - // the BogoMips, as described in the BogoMips mini-HOWTO. Note that - // this code assumes an order to the /proc/cpuinfo contents. The - // BogoMips rating had better come after CPU type and model info. -#if !defined (__alpha__) - bool supported = false; -#endif /* __alpha__ */ - - FILE *cpuinfo = ACE_OS::fopen (ACE_TEXT ("/proc/cpuinfo"), - ACE_TEXT ("r")); - - if (cpuinfo != 0) - { - char buf[128]; - - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nReading /proc/cpuinfo..."))); - - while (ACE_OS::fgets (buf, sizeof buf, cpuinfo)) - { -#if defined (__alpha__) - ACE_UINT32 whole; - ACE_UINT32 fractional; - if (::sscanf (buf, - "BogoMIPS : %d.%d\n", - &whole, - &fractional) == 2 - || ::sscanf (buf, - "bogomips : %d.%d\n", - &whole, - &fractional) == 2) - { - scale_factor = whole; - break; - } -#else - double mhertz = 1; - double bmips = 1; - char arg[128]; - - // CPU type? - if (::sscanf (buf, "cpu : %s\n", arg) == 1) - { - // If this is an Alpha chip, then the BogoMips rating is - // usable... - if (ACE_OS::strncmp (arg, - "Alpha", - 5) == 0) - { - supported = true; - } - } - // Pentium CPU model? - else if (!supported - && ::sscanf (buf, "model name : Pentium %s\n", arg) == 1) - { - // But if we don't have the right kind of Intel chip, - // just quit. - if (ACE_OS::strcmp (arg, "II") == 0 - || ACE_OS::strcmp (arg, "III") == 0 - || ACE_OS::strcmp (arg, "IV") == 0 - || ACE_OS::strcmp (arg, "Pro") == 0) - { - supported = true; - } - } - else if (::sscanf (buf, "cpu MHz : %lf\n", &mhertz) == 1) - { - // If the line "cpu MHz : xxx" is present, then it's a - // reliable measure of the CPU speed - according to the - // kernel-source. - scale_factor = (ACE_UINT32) (mhertz + 0.5); - break; - } - else if (::sscanf (buf, "bogomips : %lf\n", &bmips) == 1 - || ::sscanf (buf, "BogoMIPS : %lf\n", &bmips) == 1) - { - if (supported) - { - scale_factor = (ACE_UINT32) (bmips + 0.5); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" setting the clock scale factor to %u"), scale_factor)); - } -#if 0 - else - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\nThe BogoMIPS metric is not supported on this platform" - "\n\tReport the results of the clock calibration and" - "\n\tthe contents of /proc/cpuinfo to the ace-users mailing list"))); - } -#endif /* 0 */ - break; - } -#endif /* __alpha__ */ - } - - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (done)\n"))); - - ACE_OS::fclose (cpuinfo); - } - - return scale_factor; -} -#endif /* linux */ - -ACE_UINT32 -ACE_High_Res_Timer::global_scale_factor (void) -{ -#if (defined (ACE_WIN32) || defined (ACE_HAS_POWERPC_TIMER) || \ - defined (ACE_HAS_PENTIUM) || defined (ACE_HAS_ALPHA_TIMER)) && \ - !defined (ACE_HAS_HI_RES_TIMER) && \ - ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || \ - defined (ghs) || defined (__GNUG__) || \ - defined (__INTEL_COMPILER)) - // Check if the global scale factor needs to be set, and do if so. - if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) - { - // Grab ACE's static object lock. This doesn't have anything to - // do with static objects; it's just a convenient lock to use. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - - // Double check - if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) - { -# if defined (ACE_WIN32) - LARGE_INTEGER freq; - if (::QueryPerformanceFrequency (&freq)) - { - // We have a high-res timer -# if defined (ACE_LACKS_LONGLONG_T) - ACE_UINT64 uint64_freq(freq.u.LowPart, (ACE_UINT32) freq.u.HighPart); - ACE_High_Res_Timer::global_scale_factor - (uint64_freq / (ACE_UINT32) ACE_ONE_SECOND_IN_USECS); -# else - ACE_High_Res_Timer::global_scale_factor - (static_cast (freq.QuadPart / ACE_HR_SCALE_CONVERSION)); -# endif // (ACE_LACKS_LONGLONG_T) - - ACE_High_Res_Timer::global_scale_factor_status_ = 1; - } - else - // High-Res timers not supported - ACE_High_Res_Timer::global_scale_factor_status_ = -1; - - return ACE_High_Res_Timer::global_scale_factor_; - -# elif defined (linux) - ACE_High_Res_Timer::global_scale_factor (ACE_High_Res_Timer::get_cpuinfo ()); -# endif /* ! ACE_WIN32 && ! (linux && __alpha__) */ - -# if !defined (ACE_WIN32) - if (ACE_High_Res_Timer::global_scale_factor_ == 1u) - // Failed to retrieve CPU speed from system, so calculate it. - ACE_High_Res_Timer::calibrate (); -# endif // (ACE_WIN32) - } - } - - ACE_High_Res_Timer::global_scale_factor_status_ = 1; -#endif /* (ACE_WIN32 || ACE_HAS_POWERPC_TIMER || \ - ACE_HAS_PENTIUM || ACE_HAS_ALPHA_TIMER) && \ - ! ACE_HAS_HI_RES_TIMER && - ((WIN32 && ! WINCE) || ghs || __GNUG__) */ - - return ACE_High_Res_Timer::global_scale_factor_; -} - -ACE_High_Res_Timer::ACE_High_Res_Timer (void) -{ - ACE_TRACE ("ACE_High_Res_Timer::ACE_High_Res_Timer"); - - this->reset (); - - // Make sure that the global scale factor is set. - (void) global_scale_factor (); -} - -ACE_UINT32 -ACE_High_Res_Timer::calibrate (const ACE_UINT32 usec, - const u_int iterations) -{ - const ACE_Time_Value sleep_time (0, usec); - ACE_Stats delta_hrtime; - // In units of 100 usec, to avoid overflow. - ACE_Stats actual_sleeps; - - for (u_int i = 0; - i < iterations; - ++i) - { - const ACE_Time_Value actual_start = - ACE_OS::gettimeofday (); - const ACE_hrtime_t start = - ACE_OS::gethrtime (); - ACE_OS::sleep (sleep_time); - const ACE_hrtime_t stop = - ACE_OS::gethrtime (); - const ACE_Time_Value actual_delta = - ACE_OS::gettimeofday () - actual_start; - - // Store the sample. - delta_hrtime.sample (ACE_Utils::truncate_cast (stop - start)); - actual_sleeps.sample (actual_delta.msec () * 100u); - } - - // Calculate the mean value of the samples, with no fractional - // precision. Use it for the global scale factor. - ACE_Stats_Value ticks (0); - delta_hrtime.mean (ticks); - - ACE_Stats_Value actual_sleep (0); - actual_sleeps.mean (actual_sleep); - - // The addition of 5 below rounds instead of truncates. - const ACE_UINT32 scale_factor = - (ticks.whole () / actual_sleep.whole () + 5) / - 10u /* usec/100 usec */; - ACE_High_Res_Timer::global_scale_factor (scale_factor); - - return scale_factor; -} - -void -ACE_High_Res_Timer::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_High_Res_Timer::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nglobal_scale_factor_: %u\n"), - global_scale_factor ())); -#if defined (ACE_LACKS_LONGLONG_T) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n") - ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n") - ACE_TEXT ("total_.hi (): %8x; total_.lo (): %8x;\n") - ACE_TEXT ("start_incr_.hi () %8x; start_incr_.lo (): %8x;\n"), - start_.hi (), start_.lo (), - end_.hi (), end_.lo (), - total_.hi (), total_.lo (), - start_incr_.hi (), start_incr_.lo ())); -#else /* ! ACE_LACKS_LONGLONG_T */ - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n") - ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n") - ACE_TEXT ("total_.hi (): %8x; total_.lo (): %8x;\n") - ACE_TEXT ("start_incr_.hi () %8x; start_incr_.lo (): %8x;\n"), - static_cast (start_ >> 32), - static_cast (start_ & 0xfffffffful), - static_cast (end_ >> 32), - static_cast (end_ & 0xfffffffful), - static_cast (total_ >> 32), - static_cast (total_ & 0xfffffffful), - static_cast (start_incr_ >> 32), - static_cast (start_incr_ & 0xfffffffful))); -#endif /* ! ACE_LACKS_LONGLONG_T */ - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -void -ACE_High_Res_Timer::reset (void) -{ - ACE_TRACE ("ACE_High_Res_Timer::reset"); - - this->start_ = 0; - this->end_ = 0; - this->total_ = 0; - this->start_incr_ = 0; -} - -void -ACE_High_Res_Timer::elapsed_time (ACE_Time_Value &tv) const -{ - hrtime_to_tv (tv, - ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_)); -} - -#if defined (ACE_HAS_POSIX_TIME) -// Note... Win32 does not have ACE_HAS_POSIX_TIME, so the scale factor -// does not need to take into account the different units on Win32. - -void -ACE_High_Res_Timer::elapsed_time (struct timespec &elapsed_time) const -{ - // This implementation should be cleaned up. - - // Just grab the nanoseconds. That is, leave off all values above - // microsecond. This equation is right! Don't mess with me! (It - // first strips off everything but the portion less than 1 usec. - // Then it converts that to nanoseconds by dividing by the scale - // factor to convert to usec, and multiplying by 1000.) The cast - // avoids a MSVC 4.1 compiler warning about narrowing. - ACE_hrtime_t elapsed = - ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_); - u_long nseconds = static_cast (elapsed % - global_scale_factor () * 1000u / - global_scale_factor ()); - - // Get just the microseconds (dropping any left over nanoseconds). - ACE_UINT32 useconds = (ACE_UINT32) (elapsed / global_scale_factor ()); - - elapsed_time.tv_sec = (time_t) (useconds / ACE_ONE_SECOND_IN_USECS); - // Transforms one second in microseconds into nanoseconds. - elapsed_time.tv_nsec = (time_t) ((useconds % ACE_ONE_SECOND_IN_USECS) * 1000u + nseconds); -} -#endif /* ACE_HAS_POSIX_TIME */ - -void -ACE_High_Res_Timer::elapsed_time_incr (ACE_Time_Value &tv) const -{ - hrtime_to_tv (tv, total_); -} - -void -ACE_High_Res_Timer::elapsed_time (ACE_hrtime_t &nanoseconds) const -{ - // Please do _not_ rearrange this equation. It is carefully - // designed and tested to avoid overflow on machines that don't have - // native 64-bit ints. In particular, division can be a problem. - // For more background on this, please see bugzilla #1024. - nanoseconds = ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) - * (1024000u / ACE_High_Res_Timer::global_scale_factor ()); - // Caution - Borland has a problem with >>=, so resist the temptation. - nanoseconds = nanoseconds >> 10; - // Right shift is implemented for non native 64-bit ints - // operator/ only for a 32 bit result ! -} - -void -ACE_High_Res_Timer::elapsed_time_incr (ACE_hrtime_t &nanoseconds) const -{ - // Same as above. - nanoseconds = this->total_ - * (1024000u / ACE_High_Res_Timer::global_scale_factor ()); - // Caution - Borland has a problem with >>=, so resist the temptation. - nanoseconds = nanoseconds >> 10; -} - -#if !defined (ACE_HAS_WINCE) -void -ACE_High_Res_Timer::print_ave (const ACE_TCHAR *str, - const int count, - ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_High_Res_Timer::print_ave"); - - // Get the total number of nanoseconds elapsed. - ACE_hrtime_t total_nanoseconds; - this->elapsed_time (total_nanoseconds); - - // Separate to seconds and nanoseconds. - u_long total_secs = - static_cast (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); - ACE_UINT32 extra_nsecs = - static_cast (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); - - ACE_TCHAR buf[100]; - if (count > 1) - { - ACE_hrtime_t avg_nsecs = total_nanoseconds / (ACE_UINT32) count; - ACE_OS::sprintf (buf, - ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"), - count, - total_secs, - (extra_nsecs + 500u) / 1000u, - (u_long) ((avg_nsecs + 500u) / 1000u)); - } - else - ACE_OS::sprintf (buf, - ACE_TEXT (" total %3lu.%06lu secs\n"), - total_secs, - (extra_nsecs + 500lu) / 1000lu); - - ACE_OS::write (handle, - str, - ACE_OS::strlen (str)); - ACE_OS::write (handle, - buf, - ACE_OS::strlen (buf)); -} - -void -ACE_High_Res_Timer::print_total (const ACE_TCHAR *str, - const int count, - ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_High_Res_Timer::print_total"); - - // Get the total number of nanoseconds elapsed. - ACE_hrtime_t total_nanoseconds; - this->elapsed_time (total_nanoseconds); - - // Separate to seconds and nanoseconds. - u_long total_secs = - (u_long) (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); - ACE_UINT32 extra_nsecs = - (ACE_UINT32) (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); - - ACE_TCHAR buf[100]; - if (count > 1) - { - ACE_hrtime_t avg_nsecs = this->total_ / (ACE_UINT32) count; - - ACE_OS::sprintf (buf, - ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"), - count, - total_secs, - (extra_nsecs + 500u) / 1000u, - (u_long) ((avg_nsecs + 500u) / 1000u)); - } - else - ACE_OS::sprintf (buf, - ACE_TEXT (" total %3lu.%06u secs\n"), - total_secs, - (extra_nsecs + 500u) / 1000u); - - ACE_OS::write (handle, - str, - ACE_OS::strlen (str)); - ACE_OS::write (handle, - buf, - ACE_OS::strlen (buf)); -} -#endif /* !ACE_HAS_WINCE */ - -int -ACE_High_Res_Timer::get_env_global_scale_factor (const ACE_TCHAR *env) -{ -#if !defined (ACE_HAS_WINCE) - if (env != 0) - { - const char *env_value = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (env)); - if (env_value != 0) - { - int const value = ACE_OS::atoi (env_value); - if (value > 0) - { - ACE_High_Res_Timer::global_scale_factor (value); - return 0; - } - } - } -#else - ACE_UNUSED_ARG (env); -#endif /* !ACE_HAS_WINCE */ - return -1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/ICMP_Socket.cpp b/dep/src/ace/ICMP_Socket.cpp deleted file mode 100644 index 8274805d4ec..00000000000 --- a/dep/src/ace/ICMP_Socket.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// $Id: ICMP_Socket.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/ICMP_Socket.h" - -#if defined (ACE_HAS_ICMP_SUPPORT) && (ACE_HAS_ICMP_SUPPORT == 1) - -#include "ace/ACE.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_netdb.h" -#include "ace/OS_NS_sys_socket.h" - -ACE_RCSID (ace, - ICMP_Socket, - "$Id: ICMP_Socket.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE (ACE_ICMP_Socket) - -void -ACE_ICMP_Socket::dump (void) const -{ - ACE_TRACE ("ACE_ICMP_Socket::dump"); -} - -ACE_ICMP_Socket::ACE_ICMP_Socket (void) -{ - ACE_TRACE ("ACE_ICMP_Socket::ACE_ICMP_Socket"); -} - -ssize_t -ACE_ICMP_Socket::send (void const * buf, - size_t n, - ACE_Addr const & addr, - int flags) const -{ - ACE_TRACE ("ACE_ICMP_Socket::send"); - - return ACE_OS::sendto (this->get_handle (), - (char const *) buf, - n, - flags, - (sockaddr const *) addr.get_addr (), - addr.get_size ()); -} - -ssize_t -ACE_ICMP_Socket::recv (void * buf, - size_t n, - ACE_Addr & addr, - int flags) const -{ - ACE_TRACE ("ACE_ICMP_Socket::recv"); - - int addr_len = addr.get_size (); - ssize_t status = ACE_OS::recvfrom (this->get_handle (), - (char *) buf, - n, - flags, - (sockaddr *) addr.get_addr (), - (int*) &addr_len); - addr.set_size (addr_len); - - return status; -} - -ssize_t -ACE_ICMP_Socket::recv (void * buf, - size_t n, - int flags, - ACE_Time_Value const * timeout) const -{ - ACE_TRACE ("ACE_ICMP_Socket::recv"); - - return ACE::recv (this->get_handle (), - buf, - n, - flags, - timeout); -} - -int -ACE_ICMP_Socket::open (ACE_Addr const & local, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_ICMP_Socket::open"); - - // Check if icmp protocol is supported on this host - int proto_number = -1; - protoent *proto; - - if (! (proto = getprotobyname ("icmp"))) - { - ACE_ERROR_RETURN - ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE_ICMP_Socket::open: %p; %s\n"), - ACE_TEXT ("getprotobyname"), - ACE_TEXT ("ICMP protocol is not properly configured ") - ACE_TEXT ("or not supported.")), - -1); - } - proto_number = proto->p_proto; - - if (proto_number != IPPROTO_ICMP || proto_number != protocol) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) ACE::ICMP_Socket::open - ") - ACE_TEXT ("only IPPROTO_ICMP protocol is ") - ACE_TEXT ("currently supported.\n")), - -1); - } - - if (ACE_SOCK::open (SOCK_RAW, - AF_INET, - protocol, - reuse_addr) == -1) - { - return -1; - } - - return this->shared_open (local); -} - -int -ACE_ICMP_Socket::shared_open (ACE_Addr const & local) -{ - ACE_TRACE ("ACE_ICMP_Socket::shared_open"); - - int error = 0; - if (local == ACE_Addr::sap_any) - { - if (ACE::bind_port (this->get_handle ()) == -1) - { - error = 1; - } - } - else if (ACE_OS::bind (this->get_handle (), - reinterpret_cast (local.get_addr ()), - local.get_size ()) == -1) - { - error = 1; - } - - if (error != 0) - { - this->close (); - } - - return error ? -1 : 0; -} - -unsigned short -ACE_ICMP_Socket::calculate_checksum (unsigned short * paddress, - int len) -{ - int nleft = len; - int sum = 0; - unsigned short * w = paddress; - unsigned short answer = 0; - while (nleft > 1) - { - sum += *w++; - nleft -= 2; - } - - if (nleft == 1) - { - *((unsigned char *) &answer) = *((unsigned char *) w); - sum += answer; - } - - // add back carry outs from top 16 bits to low 16 bits - sum = (sum >> 16) + (sum & 0xffff); // add hi 16 to low 16 - sum += (sum >> 16); // add carry - answer = ~sum; // truncate to 16 bits - - return (answer); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_ICMP_SUPPORT == 1 */ - diff --git a/dep/src/ace/INET_Addr.cpp b/dep/src/ace/INET_Addr.cpp deleted file mode 100644 index 20b7bbb382f..00000000000 --- a/dep/src/ace/INET_Addr.cpp +++ /dev/null @@ -1,1158 +0,0 @@ -// $Id: INET_Addr.cpp 82434 2008-07-28 11:40:36Z johnnyw $ - -// Defines the Internet domain address family address format. - -#include "ace/INET_Addr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/INET_Addr.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_arpa_inet.h" -#include "ace/OS_NS_netdb.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_sys_socket.h" - -ACE_RCSID (ace, - INET_Addr, - "$Id: INET_Addr.cpp 82434 2008-07-28 11:40:36Z johnnyw $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_INET_Addr) - -// Transform the current address into string format. - -int -ACE_INET_Addr::addr_to_string (ACE_TCHAR s[], - size_t size, - int ipaddr_format) const -{ - ACE_TRACE ("ACE_INET_Addr::addr_to_string"); - - // XXX Can we (should we) include the scope id for IPv6 addresses? - char hoststr[MAXHOSTNAMELEN+1]; - - bool result = false; - if (ipaddr_format == 0) - result = (this->get_host_name (hoststr, MAXHOSTNAMELEN+1) == 0); - else - result = (this->get_host_addr (hoststr, MAXHOSTNAMELEN+1) != 0); - - if (!result) - return -1; - - size_t total_len = - ACE_OS::strlen (hoststr) - + 5 // ACE_OS::strlen ("65535"), Assuming the max port number. - + 1 // sizeof (':'), addr/port sep - + 1; // sizeof ('\0'), terminating NUL -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TCHAR const *format = ACE_TEXT("%ls:%d"); -#else - ACE_TCHAR const *format = ACE_TEXT("%s:%d"); -#endif /* !ACE_WIN32 && ACE_USES_WCHAR */ -#if defined (ACE_HAS_IPV6) - if (ACE_OS::strchr (hoststr, ACE_TEXT (':')) != 0) - { - total_len += 2; // ACE_OS::strlen ("[]") IPv6 addr frames -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - format = ACE_TEXT("[%ls]:%d"); -# else - format = ACE_TEXT("[%s]:%d"); -# endif /* !ACE_WIN32 && ACE_USES_WCHAR */ - } -#endif // ACE_HAS_IPV6 - - if (size < total_len) - return -1; - else - ACE_OS::sprintf (s, format, - ACE_TEXT_CHAR_TO_TCHAR (hoststr), - this->get_port_number ()); - return 0; -} - -void -ACE_INET_Addr::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_INET_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_TCHAR s[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16]; - this->addr_to_string(s, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s"), s)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Compare two addresses for inequality. - -bool -ACE_INET_Addr::operator != (const ACE_INET_Addr &sap) const -{ - ACE_TRACE ("ACE_INET_Addr::operator !="); - return !((*this) == sap); -} - -// Compare two addresses for equality. - -bool -ACE_INET_Addr::operator == (const ACE_INET_Addr &sap) const -{ - ACE_TRACE ("ACE_INET_Addr::operator =="); - - if (this->get_type () != sap.get_type () - || this->get_size () != sap.get_size ()) - return false; - - return (ACE_OS::memcmp (&this->inet_addr_, - &sap.inet_addr_, - this->get_size ()) == 0); -} - -bool -ACE_INET_Addr::is_ip_equal (const ACE_INET_Addr &sap) const -{ - if (this->get_type () != sap.get_type () - || this->get_size () != sap.get_size ()) - return false; - -#if defined (ACE_HAS_IPV6) - if (this->get_type () == PF_INET6) - { - const unsigned int *addr = - reinterpret_cast(this->ip_addr_pointer()); - const unsigned int *saddr = - reinterpret_cast(sap.ip_addr_pointer()); - return (addr[0] == saddr[0] && - addr[1] == saddr[1] && - addr[2] == saddr[2] && - addr[3] == saddr[3]); - } - else -#endif /* ACE_HAS_IPV6 */ - return this->get_ip_address () == sap.get_ip_address(); -} - -u_long -ACE_INET_Addr::hash (void) const -{ -#if defined (ACE_HAS_IPV6) - if (this->get_type () == PF_INET6) - { - const unsigned int *addr = (const unsigned int*)this->ip_addr_pointer(); - return addr[0] + addr[1] + addr[2] + addr[3] + this->get_port_number(); - } - else -#endif /* ACE_HAS_IPV6 */ - return this->get_ip_address () + this->get_port_number (); -} - -ACE_INET_Addr::ACE_INET_Addr (void) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - // ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); -} - -int -ACE_INET_Addr::set (const ACE_INET_Addr &sa) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - - if (sa.get_type () == AF_ANY) - // Ugh, this is really a base class, so don't copy it. - ACE_OS::memset (&this->inet_addr_, 0, sizeof (this->inet_addr_)); - else - { - // It's ok to make the copy. - ACE_OS::memcpy (&this->inet_addr_, - &sa.inet_addr_, - sa.get_size ()); - - this->set_type (sa.get_type()); - this->set_size (sa.get_size()); - } - - return 0; -} - -// Transform the string into the current addressing format. - -int -ACE_INET_Addr::string_to_addr (const char s[], int address_family) -{ - ACE_TRACE ("ACE_INET_Addr::string_to_addr"); - int result; - char *ip_buf = 0; - char *ip_addr = 0; - - // Need to make a duplicate since we'll be overwriting the string. - ACE_ALLOCATOR_RETURN (ip_buf, - ACE_OS::strdup (s), - -1); - ip_addr = ip_buf; - // We use strrchr because of IPv6 addresses. - char *port_p = ACE_OS::strrchr (ip_addr, ':'); -#if defined (ACE_HAS_IPV6) - // Check for extended IPv6 format : '[' ']' ':' - if (ip_addr[0] == '[') - { - // find closing bracket - char *cp_pos = ACE_OS::strchr (ip_addr, ']'); - // check for port separator after closing bracket - // if not found leave it, error will come later - if (cp_pos) - { - *cp_pos = '\0'; // blank out ']' - ++ip_addr; // skip over '[' - if (cp_pos[1] == ':') - port_p = cp_pos + 1; - else - port_p = cp_pos; // leads to error on missing port - } - } -#endif /* ACE_HAS_IPV6 */ - - if (port_p == 0) // Assume it's a port number. - { - char *endp = 0; - long const port = ACE_OS::strtol (ip_addr, &endp, 10); - - if (*endp == '\0') // strtol scanned the entire string - all digits - { - if (port < 0 || port > ACE_MAX_DEFAULT_PORT) - result = -1; - else - result = this->set (u_short (port), ACE_UINT32 (INADDR_ANY)); - } - else // port name - result = this->set (ip_addr, ACE_UINT32 (INADDR_ANY)); - } - else - { - *port_p = '\0'; ++port_p; // skip over ':' - - char *endp = 0; - long port = ACE_OS::strtol (port_p, &endp, 10); - - if (*endp == '\0') // strtol scanned the entire string - all digits - { - if (port < 0 || port > ACE_MAX_DEFAULT_PORT) - result = -1; - else - result = this->set (u_short (port), ip_addr, 1, address_family); - } - else - result = this->set (port_p, ip_addr); - } - - ACE_OS::free (ACE_MALLOC_T (ip_buf)); - return result; -} - -int -ACE_INET_Addr::set (const char address[], int address_family) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - return this->string_to_addr (address, address_family); -} - -ACE_INET_Addr::ACE_INET_Addr (const char address[], int address_family) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - this->set (address, address_family); -} - -#if defined (ACE_HAS_WCHAR) -ACE_INET_Addr::ACE_INET_Addr (const wchar_t address[], int address_family) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - this->set (address, address_family); -} - -#endif /* ACE_HAS_WCHAR */ - -// Copy constructor. - -ACE_INET_Addr::ACE_INET_Addr (const ACE_INET_Addr &sa) - : ACE_Addr (sa.get_type (), sa.get_size()) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - this->set (sa); -} - -// Initializes a ACE_INET_Addr from a PORT_NUMBER and a 32 bit Internet -// address. - -int -ACE_INET_Addr::set (u_short port_number, - ACE_UINT32 inet_address, - int encode, - int map) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - this->set_address (reinterpret_cast (&inet_address), - sizeof inet_address, - encode, map); - this->set_port_number (port_number, encode); - - return 0; -} - -// Initializes a ACE_INET_Addr from a PORT_NUMBER and the remote -// HOST_NAME. - -int -ACE_INET_Addr::set (u_short port_number, - const char host_name[], - int encode, - int address_family) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - - // Yow, someone gave us a NULL host_name! - if (host_name == 0) - { - errno = EINVAL; - return -1; - } - - ACE_OS::memset ((void *) &this->inet_addr_, - 0, - sizeof this->inet_addr_); - -#if defined (ACE_HAS_IPV6) - struct addrinfo hints; - struct addrinfo *res = 0; - int error = 0; - ACE_OS::memset (&hints, 0, sizeof (hints)); -# if defined (ACE_USES_IPV4_IPV6_MIGRATION) - if (address_family == AF_UNSPEC && !ACE::ipv6_enabled()) - address_family = AF_INET; -# endif /* ACE_USES_IPV4_IPV6_MIGRATION */ - if (address_family == AF_UNSPEC || address_family == AF_INET6) - { - hints.ai_family = AF_INET6; - error = ::getaddrinfo (host_name, 0, &hints, &res); - if (error) - { - if (address_family == AF_INET6) - { - if (res) - ::freeaddrinfo(res); - errno = error; - return -1; - } - address_family = AF_INET; - } - } - if (address_family == AF_INET) - { - hints.ai_family = AF_INET; - error = ::getaddrinfo (host_name, 0, &hints, &res); - if (error) - { - if (res) - ::freeaddrinfo(res); - errno = error; - return -1; - } - } - this->set_type (res->ai_family); - this->set_addr (res->ai_addr, res->ai_addrlen); - this->set_port_number (port_number, encode); - ::freeaddrinfo (res); - return 0; -#else /* ACE_HAS_IPV6 */ - - // IPv6 not supported... insure the family is set to IPv4 - address_family = AF_INET; - this->set_type (address_family); - this->inet_addr_.in4_.sin_family = static_cast (address_family); -#ifdef ACE_HAS_SOCKADDR_IN_SIN_LEN - this->inet_addr_.in4_.sin_len = sizeof (this->inet_addr_.in4_); -#endif - struct in_addr addrv4; - if (ACE_OS::inet_aton (host_name, - &addrv4) == 1) - return this->set (port_number, - encode ? ACE_NTOHL (addrv4.s_addr) : addrv4.s_addr, - encode); - else - { -# if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYNAME) - hostent *hp = ACE_OS::gethostbyname (host_name); -# else - hostent hentry; - ACE_HOSTENT_DATA buf; - int h_error = 0; // Not the same as errno! - - hostent *hp = ACE_OS::gethostbyname_r (host_name, &hentry, - buf, &h_error); - if (hp == 0) - errno = h_error; -# endif /* ACE_VXWORKS */ - - if (hp == 0) - { - return -1; - } - else - { - (void) ACE_OS::memcpy ((void *) &addrv4.s_addr, - hp->h_addr, - hp->h_length); - return this->set (port_number, - encode ? ACE_NTOHL (addrv4.s_addr) : addrv4.s_addr, - encode); - } - } -#endif /* ACE_HAS_IPV6 */ -} - -// Helper function to get a port number from a port name. - -static int get_port_number_from_name (const char port_name[], - const char protocol[]) -{ - // Maybe port_name is directly a port number? - char *endp = 0; - long port_number = ACE_OS::strtol (port_name, &endp, 10); - - if (*endp == '\0') - { - // port_name was really a number, and nothing else. - - // Check for overflow. - if (port_number < 0 || port_number > ACE_MAX_DEFAULT_PORT) - return -1; - - // Return the port number. NOTE: this number must - // be returned in network byte order! - u_short n = static_cast (port_number); - n = ACE_HTONS (n); - return n; - } - - // We try to resolve port number from its name. - -#if defined (ACE_LACKS_GETSERVBYNAME) - port_number = 0; - ACE_UNUSED_ARG (port_name); - ACE_UNUSED_ARG (protocol); -#else - port_number = -1; - servent sentry; - ACE_SERVENT_DATA buf; - servent *sp = ACE_OS::getservbyname_r (port_name, - protocol, - &sentry, - buf); - if (sp != 0) - port_number = sp->s_port; -#endif /* ACE_LACKS_GETSERVBYNAME */ - - return port_number; -} - -// Initializes a ACE_INET_Addr from a and the remote -// . - -int -ACE_INET_Addr::set (const char port_name[], - const char host_name[], - const char protocol[]) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - - int const port_number = get_port_number_from_name (port_name, protocol); - if (port_number == -1) - { - ACE_NOTSUP_RETURN (-1); - } - - int address_family = PF_UNSPEC; -# if defined (ACE_HAS_IPV6) - if (ACE_OS::strcmp (ACE_TEXT_CHAR_TO_TCHAR(protocol), ACE_TEXT ("tcp6")) == 0) - address_family = AF_INET6; -# endif /* ACE_HAS_IPV6 */ - - return this->set (static_cast (port_number), - host_name, 0, address_family); -} - -// Initializes a ACE_INET_Addr from a and a 32 bit -// Internet address. - -int -ACE_INET_Addr::set (const char port_name[], - ACE_UINT32 inet_address, - const char protocol[]) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - - int const port_number = get_port_number_from_name (port_name, protocol); - if (port_number == -1) - { - ACE_NOTSUP_RETURN (-1); - } - - return this->set (static_cast (port_number), - inet_address, 0); -} - -// Creates a ACE_INET_Addr from a PORT_NUMBER and the remote -// HOST_NAME. - -ACE_INET_Addr::ACE_INET_Addr (u_short port_number, - const char host_name[], - int address_family) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - ACE_OS::memset (&this->inet_addr_, 0, sizeof (this->inet_addr_)); - if (this->set (port_number, - host_name, - 1, - address_family) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr: %p\n"), - ACE_TEXT_CHAR_TO_TCHAR ((host_name == 0) ? - "" : host_name))); -} - -#if defined (ACE_HAS_WCHAR) -ACE_INET_Addr::ACE_INET_Addr (u_short port_number, - const wchar_t host_name[], - int address_family) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - ACE_OS::memset (&this->inet_addr_, 0, sizeof (this->inet_addr_)); - if (this->set (port_number, - host_name, - 1, - address_family) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr: %p\n"), - ACE_TEXT_WCHAR_TO_TCHAR ((host_name == 0) ? - ACE_TEXT_WIDE ("") : - host_name))); -} -#endif /* ACE_HAS_WCHAR */ - -// Creates a ACE_INET_Addr from a sockaddr_in structure. - -int -ACE_INET_Addr::set (const sockaddr_in *addr, int len) -{ - ACE_TRACE ("ACE_INET_Addr::set"); - - if (addr->sin_family == AF_INET) - { - int maxlen = static_cast (sizeof (this->inet_addr_.in4_)); - if (len > maxlen) - len = maxlen; - ACE_OS::memcpy (&this->inet_addr_.in4_, addr, len); - this->base_set (AF_INET, len); - return 0; - } -#if defined (ACE_HAS_IPV6) - else if (addr->sin_family == AF_INET6) - { - int maxlen = static_cast (sizeof (this->inet_addr_.in6_)); - if (len > maxlen) - len = maxlen; - ACE_OS::memcpy (&this->inet_addr_.in6_, addr, len); - this->base_set (AF_INET6, len); - return 0; - } -#endif /* ACE_HAS_IPV6 */ - - errno = EAFNOSUPPORT; - return -1; -} - -// Return the address. - -void * -ACE_INET_Addr::get_addr (void) const -{ - ACE_TRACE ("ACE_INET_Addr::get_addr"); - return (void*)&this->inet_addr_; -} - -void -ACE_INET_Addr::set_addr (void *addr, int len) -{ - this->set_addr (addr, len, 0); -} - -// Set a pointer to the address. -void -ACE_INET_Addr::set_addr (void *addr, int /* len */, int map) -{ - ACE_TRACE ("ACE_INET_Addr::set_addr"); - struct sockaddr_in *getfamily = static_cast (addr); - - if (getfamily->sin_family == AF_INET) - { -#if defined (ACE_HAS_IPV6) - if (map) - this->set_type (AF_INET6); - else -#endif /* ACE_HAS_IPV6 */ - this->set_type (AF_INET); - this->set_port_number (getfamily->sin_port, 0); - this->set_address (reinterpret_cast (&getfamily->sin_addr), - sizeof (getfamily->sin_addr), - 0, map); - } -#if defined (ACE_HAS_IPV6) - else if (getfamily->sin_family == AF_INET6) - { - struct sockaddr_in6 *in6 = static_cast (addr); - this->set_port_number (in6->sin6_port, 0); - this->set_address (reinterpret_cast (&in6->sin6_addr), - sizeof (in6->sin6_addr), - 0); - this->inet_addr_.in6_.sin6_scope_id = in6->sin6_scope_id; - } -#endif // ACE_HAS_IPV6 -} - -// Creates a ACE_INET_Addr from a sockaddr_in structure. - -ACE_INET_Addr::ACE_INET_Addr (const sockaddr_in *addr, int len) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - this->set (addr, len); -} - -// Creates a ACE_INET_Addr from a PORT_NUMBER and an Internet address. - -ACE_INET_Addr::ACE_INET_Addr (u_short port_number, - ACE_UINT32 inet_address) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - if (this->set (port_number, inet_address) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -} - -// Creates a ACE_INET_Addr from a PORT_NAME and the remote -// HOST_NAME. - -ACE_INET_Addr::ACE_INET_Addr (const char port_name[], - const char host_name[], - const char protocol[]) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - if (this->set (port_name, - host_name, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -} - -#if defined (ACE_HAS_WCHAR) -ACE_INET_Addr::ACE_INET_Addr (const wchar_t port_name[], - const wchar_t host_name[], - const wchar_t protocol[]) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - this->reset (); - if (this->set (port_name, - host_name, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -} -#endif /* ACE_HAS_WCHAR */ - -// Creates a ACE_INET_Addr from a PORT_NAME and an Internet address. - -ACE_INET_Addr::ACE_INET_Addr (const char port_name[], - ACE_UINT32 inet_address, - const char protocol[]) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); -#if !defined (ACE_LACKS_HTONL) - this->reset (); - if (this->set (port_name, - htonl (inet_address), - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -#else - ACE_UNUSED_ARG (port_name); - ACE_UNUSED_ARG (inet_address); - ACE_UNUSED_ARG (protocol); -#endif -} - -#if defined (ACE_HAS_WCHAR) -ACE_INET_Addr::ACE_INET_Addr (const wchar_t port_name[], - ACE_UINT32 inet_address, - const wchar_t protocol[]) - : ACE_Addr (determine_type (), sizeof (inet_addr_)) -{ - ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); -#if !defined (ACE_LACKS_HTONL) - this->reset (); - if (this->set (port_name, - htonl (inet_address), - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -#else - ACE_UNUSED_ARG (port_name); - ACE_UNUSED_ARG (inet_address); - ACE_UNUSED_ARG (protocol); -#endif -} -#endif /* ACE_HAS_WCHAR */ - -ACE_INET_Addr::~ACE_INET_Addr (void) -{ -} - -int -ACE_INET_Addr::get_host_name (char hostname[], - size_t len) const -{ - ACE_TRACE ("ACE_INET_Addr::get_host_name"); - - int result; - if (len > 1) - { - result = this->get_host_name_i (hostname,len); - if (result < 0) - { - if (result == -2) - // We know that hostname is nul-terminated - result = -1; - else - { - //result == -1; - // This could be worse than hostname[len -1] = '\0'? - hostname[0] = '\0'; - } - } - } - else - { - if (len == 1) - hostname[0] = '\0'; - result = -1; - } - - return result; -} - -#if defined (ACE_HAS_WCHAR) -int -ACE_INET_Addr::get_host_name (wchar_t hostname[], - size_t len) const -{ - ACE_TRACE ("ACE_INET_Addr::get_host_name"); - - char char_hostname [MAXHOSTNAMELEN + 1]; - - // We have a build in limitation of MAXHOSTNAMELEN - if (len > MAXHOSTNAMELEN + 1) - len = MAXHOSTNAMELEN + 1; - - // Call the char version - int result = this->get_host_name (char_hostname, len); - - // And copy it over, if successful - if (result == 0) - ACE_OS::strcpy (hostname, - ACE_Ascii_To_Wide (char_hostname).wchar_rep ()); - - return result; -} -#endif /* ACE_HAS_WCHAR */ - -// Return the character representation of the hostname. - -const char * -ACE_INET_Addr::get_host_name (void) const -{ - ACE_TRACE ("ACE_INET_Addr::get_host_name"); - - static char name[MAXHOSTNAMELEN + 1]; - if (this->get_host_name (name, MAXHOSTNAMELEN + 1) == -1) - ACE_OS::strcpy (name, ""); - return name; -} - -void -ACE_INET_Addr::set_port_number (u_short port_number, - int encode) -{ - ACE_TRACE ("ACE_INET_Addr::set_port_number"); - - if (encode) - port_number = ACE_HTONS (port_number); - -#if defined (ACE_HAS_IPV6) - if (this->get_type () == AF_INET6) - this->inet_addr_.in6_.sin6_port = port_number; - else -#endif /* ACE_HAS_IPV6 */ - this->inet_addr_.in4_.sin_port = port_number; -} - -// returns -2 when the hostname is truncated -int -ACE_INET_Addr::get_host_name_i (char hostname[], size_t len) const -{ - ACE_TRACE ("ACE_INET_Addr::get_host_name_i"); - -#if defined (ACE_HAS_IPV6) - if ((this->get_type () == PF_INET6 && - 0 == ACE_OS::memcmp (&this->inet_addr_.in6_.sin6_addr, - &in6addr_any, - sizeof (this->inet_addr_.in6_.sin6_addr))) - || - (this->get_type () == PF_INET && - this->inet_addr_.in4_.sin_addr.s_addr == INADDR_ANY)) -#else - if (this->inet_addr_.in4_.sin_addr.s_addr == INADDR_ANY) -#endif /* ACE_HAS_IPV6 */ - { - if (ACE_OS::hostname (hostname, len) == -1) - return -1; - else - return 0; - } - else - { -#if defined (ACE_VXWORKS) && defined (ACE_LACKS_GETHOSTBYADDR) - ACE_UNUSED_ARG (len); - int error = - ::hostGetByAddr ((int) this->inet_addr_.in4_.sin_addr.s_addr, - hostname); - if (error == OK) - return 0; - else - { - errno = error; - return -1; - } -#else - void* addr = this->ip_addr_pointer (); - int size = this->ip_addr_size (); - int type = this->get_type (); - -# if defined (ACE_HAS_IPV6) && defined (ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED) - // Most OS can not handle IPv6-mapped-IPv4 addresses (even - // though they are meant to) so map them back to IPv4 addresses - // before trying to resolve them - in_addr demapped_addr; - if (type == PF_INET6 && - (this->is_ipv4_mapped_ipv6 () || this->is_ipv4_compat_ipv6 ())) - { - ACE_OS::memcpy (&demapped_addr.s_addr, &this->inet_addr_.in6_.sin6_addr.s6_addr[12], 4); - addr = &demapped_addr; - size = sizeof(demapped_addr); - type = PF_INET; - } -# endif /* ACE_HAS_IPV6 */ - -# if defined (DIGITAL_UNIX) && defined (__GNUC__) - hostent * const hp = - ACE_OS::gethostbyaddr (static_cast (addr), size, type); -# else - int h_error; // Not the same as errno! - hostent hentry; - ACE_HOSTENT_DATA buf; - hostent * const hp = - ACE_OS::gethostbyaddr_r (static_cast (addr), - size, - type, - &hentry, - buf, - &h_error); -# endif /* DIGITAL_UNIX */ - - if (hp == 0 || hp->h_name == 0) - return -1; - - if (ACE_OS::strlen (hp->h_name) >= len) - { - // We know the length, so use memcpy - if (len > 0) - { - ACE_OS::memcpy (hostname, hp->h_name, len - 1); - hostname[len-1]= '\0'; - } - errno = ENOSPC; - return -2; // -2 Means that we have a good string - // Using errno looks ok, but ENOSPC could be set on - // other places. - } - - ACE_OS::strcpy (hostname, hp->h_name); - return 0; -#endif /* ACE_VXWORKS */ - } -} - -int ACE_INET_Addr::set_address (const char *ip_addr, - int len, - int encode /* = 1 */, - int map /* = 0 */) -{ - ACE_TRACE ("ACE_INET_Addr::set_address"); - // This is really intended for IPv4. If the object is IPv4, or the type - // hasn't been set but it's a 4-byte address, go ahead. If this is an - // IPv6 object and is requested, refuse. - if (encode && len != 4) - { - errno = EAFNOSUPPORT; - return -1; - } - - if (len == 4) - { - ACE_UINT32 ip4 = *reinterpret_cast (ip_addr); - if (encode) - ip4 = ACE_HTONL (ip4); - - if (this->get_type () == AF_INET && map == 0) { - this->base_set (AF_INET, sizeof (this->inet_addr_.in4_)); -#ifdef ACE_HAS_SOCKADDR_IN_SIN_LEN - this->inet_addr_.in4_.sin_len = sizeof (this->inet_addr_.in4_); -#endif - this->inet_addr_.in4_.sin_family = AF_INET; - this->set_size (sizeof (this->inet_addr_.in4_)); - ACE_OS::memcpy (&this->inet_addr_.in4_.sin_addr, - &ip4, - len); - } -#if defined (ACE_HAS_IPV6) - else if (map == 0) - { - // this->set_type (AF_INET); - this->base_set (AF_INET, sizeof (this->inet_addr_.in4_)); -#ifdef ACE_HAS_SOCKADDR_IN_SIN_LEN - this->inet_addr_.in4_.sin_len = sizeof (this->inet_addr_.in4_); -#endif - this->inet_addr_.in4_.sin_family = AF_INET; - this->set_size (sizeof (this->inet_addr_.in4_)); - ACE_OS::memcpy (&this->inet_addr_.in4_.sin_addr, - &ip4, len); - } - // If given an IPv4 address to copy to an IPv6 object, map it to - // an IPv4-mapped IPv6 address. - else - { - this->base_set (AF_INET6, sizeof (this->inet_addr_.in6_)); -#ifdef ACE_HAS_SOCKADDR_IN6_SIN6_LEN - this->inet_addr_.in6_.sin6_len = sizeof (this->inet_addr_.in6_); -#endif - this->inet_addr_.in6_.sin6_family = AF_INET6; - this->set_size (sizeof (this->inet_addr_.in6_)); - if (ip4 == ACE_HTONL (INADDR_ANY)) - { - in6_addr const ip6 = in6addr_any; - ACE_OS::memcpy (&this->inet_addr_.in6_.sin6_addr, - &ip6, - sizeof (ip6)); - return 0; - } - - // Build up a 128 bit address. An IPv4-mapped IPv6 address - // is defined as 0:0:0:0:0:ffff:IPv4_address. This is defined - // in RFC 1884 */ - ACE_OS::memset (&this->inet_addr_.in6_.sin6_addr, 0, 16); - this->inet_addr_.in6_.sin6_addr.s6_addr[10] = - this->inet_addr_.in6_.sin6_addr.s6_addr[11] = 0xff; - ACE_OS::memcpy - (&this->inet_addr_.in6_.sin6_addr.s6_addr[12], &ip4, 4); - } -#endif /* ACE_HAS_IPV6 */ - return 0; - } /* end if (len == 4) */ -#if defined (ACE_HAS_IPV6) - else if (len == 16) - { - if (this->get_type () != PF_INET6) - { - errno = EAFNOSUPPORT; - return -1; - } - // We protect ourselves up above so IPv6 must be possible here. - this->base_set (AF_INET6, sizeof (this->inet_addr_.in6_)); - this->inet_addr_.in6_.sin6_family = AF_INET6; -#ifdef ACE_HAS_SOCKADDR_IN6_SIN6_LEN - this->inet_addr_.in6_.sin6_len = sizeof (this->inet_addr_.in6_); -#endif - ACE_OS::memcpy (&this->inet_addr_.in6_.sin6_addr, ip_addr, len); - - return 0; - } /* end len == 16 */ -#endif /* ACE_HAS_IPV6 */ - - // Here with an unrecognized length. - errno = EAFNOSUPPORT; - return -1; - -} - -#if (defined (__linux__) || defined (ACE_WIN32)) && defined (ACE_HAS_IPV6) -int -ACE_INET_Addr::set_interface (const char *intf_name) -{ - if (this->get_type () == PF_INET6 && - (IN6_IS_ADDR_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr))) - { -#if defined (__linux__) - this->inet_addr_.in6_.sin6_scope_id = - ACE_OS::if_nametoindex (intf_name); -#else - this->inet_addr_.in6_.sin6_scope_id = - intf_name ? ACE_OS::atoi (intf_name) : 0; -#endif - // check to see if the interface lookup succeeded - if (this->inet_addr_.in6_.sin6_scope_id != 0) - return 0; - else - return -1; - } - else - return 0; - -} -#endif /* __linux && ACE_HAS_IPV6 */ - -const char * -ACE_INET_Addr::get_host_addr (char *dst, int size) const -{ -#if defined (ACE_HAS_IPV6) - if (this->get_type () == AF_INET6) - { - // mcorino@remedy.nl - Aug-26, 2005 - // I don't think this should be done because it results in a decimal address - // representation which is not distinguishable from the IPv4 form which makes - // it impossible to resolve back to an IPv6 INET_Addr without prior knowledge - // that this was such an address to begin with. - - //if (IN6_IS_ADDR_V4MAPPED (&this->inet_addr_.in6_.sin6_addr)) - //{ - // ACE_UINT32 addr; - // addr = this->get_ip_address(); - // addr = ACE_HTONL (addr); - // return ACE_OS::inet_ntop (AF_INET, &addr, dst, size); - //} - -# if defined (ACE_WIN32) - if (0 == ::getnameinfo (reinterpret_cast (&this->inet_addr_.in6_), - this->get_size (), - dst, - size, - 0, 0, // Don't want service name - NI_NUMERICHOST)) - return dst; - ACE_OS::set_errno_to_wsa_last_error (); - return 0; -# else - const char *ch = ACE_OS::inet_ntop (AF_INET6, - &this->inet_addr_.in6_.sin6_addr, - dst, - size); -#if defined (__linux__) - if ((IN6_IS_ADDR_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL (&this->inet_addr_.in6_.sin6_addr)) && - this->inet_addr_.in6_.sin6_scope_id != 0) - { - char scope_buf[32]; - ACE_OS::sprintf (scope_buf, "%%%u", this->inet_addr_.in6_.sin6_scope_id); - if ((ACE_OS::strlen (ch)+ACE_OS::strlen (scope_buf)) < (size_t)size) - { - ACE_OS::strcat (dst, scope_buf); - } - } -#endif - return ch; -# endif /* ACE_WIN32 */ - } -#endif /* ACE_HAS_IPV6 */ - - return ACE_OS::inet_ntop (AF_INET, - &this->inet_addr_.in4_.sin_addr, - dst, - size); -} - -// Return the dotted Internet address. -const char * -ACE_INET_Addr::get_host_addr (void) const -{ - ACE_TRACE ("ACE_INET_Addr::get_host_addr"); -#if defined (ACE_HAS_IPV6) - static char buf[INET6_ADDRSTRLEN]; - return this->get_host_addr (buf, INET6_ADDRSTRLEN); -#else /* ACE_HAS_IPV6 */ - static char buf[INET_ADDRSTRLEN]; - return this->get_host_addr (buf, INET_ADDRSTRLEN); -#endif /* !ACE_HAS_IPV6 */ -} - -// Return the 4-byte IP address, converting it into host byte order. -ACE_UINT32 -ACE_INET_Addr::get_ip_address (void) const -{ - ACE_TRACE ("ACE_INET_Addr::get_ip_address"); -#if defined (ACE_HAS_IPV6) - if (this->get_type () == AF_INET6) - { - if (IN6_IS_ADDR_V4MAPPED (&this->inet_addr_.in6_.sin6_addr) || - IN6_IS_ADDR_V4COMPAT (&this->inet_addr_.in6_.sin6_addr) ) - { - ACE_UINT32 addr; - // Return the last 32 bits of the address - char *thisaddrptr = (char*)this->ip_addr_pointer (); - thisaddrptr += 128/8 - 32/8; - ACE_OS::memcpy (&addr, thisaddrptr, sizeof (addr)); - return ACE_NTOHL (addr); - } - - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::get_ip_address: address is a IPv6 address not IPv4\n"))); - errno = EAFNOSUPPORT; - return 0; - } -#endif /* ACE_HAS_IPV6 */ - return ACE_NTOHL (ACE_UINT32 (this->inet_addr_.in4_.sin_addr.s_addr)); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/IOStream.cpp b/dep/src/ace/IOStream.cpp deleted file mode 100644 index 4fc8e851212..00000000000 --- a/dep/src/ace/IOStream.cpp +++ /dev/null @@ -1,664 +0,0 @@ -// $Id: IOStream.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_IOSTREAM_CPP -#define ACE_IOSTREAM_CPP - -#include "ace/IOStream.h" - -ACE_RCSID(ace, IOStream, "$Id: IOStream.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (ACE_LACKS_ACE_IOSTREAM) - -# include "ace/OS_NS_errno.h" -# include "ace/OS_Memory.h" - -/////////////////////////////////////////////////////////////////////////// - -/* Here's a simple example of how iostream's non-virtual operators can - get you in a mess: - - class myiostream : public iostream - { - public: - myiostream& operator>> (String & s) - { - ... - } - }; - - ... - - int i; - String s; - myiostream foo (...); - - foo >> s; - // OK - // invokes myiostream::operator>> (String&) returning myiostream& - - foo >> i; - // OK - // invokes iostream::operator>> (int&) returning iostream& - - foo >> i >> s; - // BAD - // invokes iostream::operator>> (int&) then iostream::operator>> (String&) - // - // What has happened is that the first >> is invoked on the base class and returns - // a reference to iostream. The second >> has no idea of the ACE_IOStream and - // gets invoked on iostream. Probably NOT what you wanted! - - // In order to make all of this work the way you want, you have to do this: - - class myiostream : public iostream - { - public: - myiostream& operator>> (int & i) - { - return ((myiostream&)iostream::operator>> (i)); - } - - myiostream& operator>> (String & s) - { - ... - } - }; - - ... - - int i; - String s; - myiostream foo (...); - - foo >> s; - // OK - // invokes myiostream::operator>> (String&) returning myiostream& - - foo >> i; - // OK - // invokes myiostream::operator>> (int&) returning myiostream& - - foo >> i >> s; - // OK - // Because you provided operator>> (int&) in class myiostream, that - // function will be invoked by the first >>. Since it returns - // a myiostream&, the second >> will be invoked as desired. */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_HANDLE -ACE_Streambuf::get_handle (void) -{ - return 0; -} - -ACE_Time_Value * -ACE_Streambuf::recv_timeout (ACE_Time_Value *tv) -{ - ACE_Time_Value * rval = recv_timeout_; - if (tv) - { - recv_timeout_value_ = *tv; - recv_timeout_ = &recv_timeout_value_; - } - else - recv_timeout_ = 0; - - return rval; -} - -int -ACE_Streambuf::underflow (void) -{ - // If input mode is not set, any attempt to read from the stream is - // a failure. - - if (ACE_BIT_DISABLED (mode_, ios::in)) - return EOF; - - // If base () is empty then this is the first time any get/put - // operation has been attempted on the stream. - - if (!this->base ()) - { - // Set base () to use our private read buffer. The arguments are: - // beginning of the buffer (base ()) - // one-beyond the end of the buffer (ebase ()) - // should base () be deleted on destruction - // - // We have to say "no" to the third parameter because we want to - // explicitly handle deletion of the TWO buffers at destruction. - - setb (this->eback_saved_, - this->eback_saved_ + streambuf_size_, 0); - - // Remember that we are now in getMode. This will help us if - // we're called prior to a mode change as well as helping us - // when the mode does change. - this->cur_mode_ = this->get_mode_; - // Using the new values for base (), initialize the get area. - // This simply sets eback (), gptr () and egptr () described - // earlier. - setg (base (), base (), base ()); - - // Set the put buffer such that puts will be disabled. Any - // attempt to put data will now cause overflow to be invoked. - setp (0, 0); - } - else // base () has been initialized already... - { - // If we are in put_mode_ now, then it is time to switch to get_mode_ - // - // 1. get rid of any pending output - // 2. rearrange base () to use our half of the buffer - // 3. reset the mode - // - if (this->cur_mode_ == this->put_mode_) - { - // Dump any pending output to the peer. This is not really - // necessary because of the dual-buffer arrangement we've - // set up but intuitively it makes sense to send the pending - // data before we request data since the peer will probably - // need what we're sending before it can respond. - if (out_waiting () && syncout () == EOF) - return EOF; - - if( ! pbase() ) - { - delete [] pbase_saved_; - (void) reset_put_buffer(); - } - else - { - // We're about to disable put mode but before we do - // that, we want to preserve it's state. - this->pbase_saved_ = pbase (); - this->pptr_saved_ = pptr (); - this->epptr_saved_ = epptr (); - } - - // Disable put mode as described in the constructor. - setp (0, 0); - - // Like the case where base () is false, we now point base - // () to use our private get buffer. - setb (this->eback_saved_, - this->eback_saved_ + streambuf_size_, - 0); - - // And restore the previous state of the get pointers. - - setg (this->eback_saved_, this->gptr_saved_, - this->egptr_saved_); - - // Finally, set our mode so that we don't get back into this - // if () and so that overflow can operate correctly. - cur_mode_ = get_mode_; - } - - // There could be data in the input buffer if we switched to put - // mode before reading everything. In that case, we take this - // opportunity to feed it back to the iostream. - if (in_avail ()) - // Remember that we return an int so that we can give back - // EOF. The explicit cast prevents us from returning a signed - // char when we're not returning EOF. - return (u_char) *gptr (); - } - - // We really shouldn't be here unless there is a lack of data in the - // read buffer. So... go get some more data from the peer. - - int result = fillbuf (); - - // Fillbuf will give us EOF if there was an error with the peer. In - // that case, we can do no more input. - - if (EOF == result) - { - // Disable ourselves and return failure to the iostream. That - // should result in a call to have oursleves closed. - setg (0, 0, 0); - return EOF; - } - - // Return the next available character in the input buffer. Again, - // we protect against sign extension. - - return (u_char) *gptr (); -} - -// Much of this is similar to underflow. I'll just hit the highlights -// rather than repeating a lot of what you've already seen. - -int -ACE_Streambuf::overflow (int c) -{ - // Check to see if output is allowed at all. - if (! (mode_ & ios::out)) - return EOF; - - if (!base ()) - { - // Set base () to use put's private buffer. - // - setb (this->pbase_saved_, - this->pbase_saved_ + streambuf_size_, 0); - - // Set the mode for optimization. - this->cur_mode_ = this->put_mode_; - // Set the put area using the new base () values. - setp (base (), ebuf ()); - - // Disable the get area. - setg (0, 0, 0); - } - else // We're already reading or writing - { - // If we're coming out of get mode... - if (this->cur_mode_ == this->get_mode_) - { - // --> JCEJ 6/6/98 - if (! eback()) - { - /* Something has happened to cause the streambuf - to get rid of our get area. - We could probably do this a bit cleaner but - this method is sure to cleanup the bits and - pieces. - */ - delete [] eback_saved_; - (void) reset_get_buffer(); - } - else - { - // Save the current get mode values - this->eback_saved_ = eback (); - this->gptr_saved_ = gptr (); - this->egptr_saved_ = egptr (); - } - // <-- JCEJ 6/6/98 - - // then disable the get buffer - setg (0, 0, 0); - - // Reconfigure base () and restore the put pointers. - setb (pbase_saved_, pbase_saved_ + streambuf_size_, 0); - setp (base (), ebuf ()); - - // Save the new mode. - this->cur_mode_ = this->put_mode_; - } - - // If there is output to be flushed, do so now. We shouldn't - // get here unless this is the case... - - if (out_waiting () && EOF == syncout ()) - return EOF; - } - - // If we're not putting EOF, then we have to deal with the character - // that is being put. Perhaps we should do something special with EOF??? - - if (c != EOF) - { - // We've already written any data that may have been in the - // buffer, so we're guaranteed to have room in the buffer for - // this new information. So... we add it to the buffer and - // adjust our 'next' pointer acordingly. - *pptr () = (char) c; - pbump (1); - } - - return 0; -} - -// syncin - -int -ACE_Streambuf::syncin (void) -{ - // As discussed, there really isn't any way to sync input from a - // socket-like device. We specifially override this base-class - // function so that it won't do anything evil to us. - return 0; -} - -// syncout - -int -ACE_Streambuf::syncout (void) -{ - // Unlike syncin, syncout is a doable thing. All we have to do is - // write whatever is in the output buffer to the peer. flushbuf () - // is how we do it. - - if (flushbuf () == EOF) - return EOF; - else - return 0; -} - -int -ACE_Streambuf::sync (void) -{ - // sync () is fairly traditional in that it syncs both input and - // output. We could have omitted the call to syncin () but someday, - // we may want it to do something. - - syncin (); - - // Don't bother syncing the output unless there is data to be - // sent... - - if (out_waiting ()) - return syncout (); - else - return 0; -} - -// flushbuf - -int -ACE_Streambuf::flushbuf (void) -{ - // pptr () is one character beyond the last character put into the - // buffer. pbase () points to the beginning of the put buffer. - // Unless pptr () is greater than pbase () there is nothing to be - // sent to the peer. - - if (pptr () <= pbase ()) - return 0; - - // 4/12/97 -- JCEJ - // Kludge!!! - // If the remote side shuts down the connection, an attempt to send - // () to the remote will result in the message 'Broken Pipe' I think - // this is an OS message, I've tracked it down to the ACE_OS::write - // () function. That's the last one to be called before the - // message. I can only test this on Linux though, so I don't know - // how other systems will react. - // - // To get around this gracefully, I do a PEEK recv () with an - // immediate (nearly) timeout. recv () is much more graceful on - // it's failure. If we get -1 from recv () not due to timeout then - // we know we're SOL. - // - // Q: Is 'errno' threadsafe? Should the section below be a - // critical section? - // - // char tbuf[1]; - // ACE_Time_Value to (0,1); - // if (this->recv (tbuf, 1, MSG_PEEK, &to) == -1) - // { - // if (errno != ETIME) - // { - // perror ("OOPS preparing to send to peer"); - // return EOF; - // } - // } - // - // The correct way to handle this is for the application to trap - // (and ignore?) SIGPIPE. Thanks to Amos Shapira for reminding me - // of this. - - // Starting at the beginning of the buffer, send as much data as - // there is waiting. send guarantees that all of the data will be - // sent or an error will be returned. - - if (this->send (pbase (), pptr () - pbase ()) == -1) - return EOF; - - // Now that we've sent everything in the output buffer, we reset the - // buffer pointers to appear empty. - setp (base (), ebuf ()); - - return 0; -} - -int -ACE_Streambuf::get_one_byte (void) -{ - this->timeout_ = 0; - - // The recv function will return immediately if there is no data - // waiting. So, we use recv_n to wait for exactly one byte to come - // from the peer. Later, we can use recv to see if there is - // anything else in the buffer. (Ok, we could use flags to tell it - // to block but I like this better.) - - if (this->recv_n (base (), 1, MSG_PEEK, this->recv_timeout_) != 1) - { - if (errno == ETIME) - this->timeout_ = 1; - return EOF; - } - else - return 1; -} - -// This will be called when the read (get) buffer has been exhausted -// (ie -- gptr == egptr). - -int -ACE_Streambuf::fillbuf (void) -{ - // Invoke recv_n to get exactly one byte from the remote. This will - // block until something shows up. - - if (get_one_byte () == EOF) - return EOF; - - // Now, get whatever else may be in the buffer. This will return if - // there is nothing in the buffer. - - int bc = this->recv (base (), blen (), this->recv_timeout_); - - // recv will give us -1 if there was a problem. If there was - // nothing waiting to be read, it will give us 0. That isn't an - // error. - - if (bc < 0) - { - if (errno == ETIME) - this->timeout_ = 1; - return EOF; - } - - // Move the get pointer to reflect the number of bytes we just read. - - setg (base (), base (), base () + bc); - - // Return the byte-read-count including the one from . - return bc; -} - -ACE_Streambuf::ACE_Streambuf (u_int streambuf_size, int io_mode) - : eback_saved_ (0), // to avoid Purify UMR - pbase_saved_ (0), // to avoid Purify UMR - get_mode_ (1), - put_mode_ (2), - mode_ (io_mode), - streambuf_size_ (streambuf_size), - recv_timeout_ (0) -{ - (void)reset_get_buffer (); - (void)reset_put_buffer (); -} - -u_int -ACE_Streambuf::streambuf_size (void) -{ - return streambuf_size_; -} - -// Return the number of bytes not yet gotten. eback + get_waiting = -// gptr. - -u_int -ACE_Streambuf::get_waiting (void) -{ - return this->gptr_saved_ - this->eback_saved_; -} - -// Return the number of bytes in the get area (includes some already -// gotten); eback + get_avail = egptr. - -u_int -ACE_Streambuf::get_avail (void) -{ - return this->egptr_saved_ - this->eback_saved_; -} - -// Return the number of bytes to be 'put' onto the stream media. -// pbase + put_avail = pptr. - -u_int -ACE_Streambuf::put_avail (void) -{ - return this->pptr_saved_ - this->pbase_saved_; -} - -// Typical usage: -// -// u_int newGptr = otherStream->get_waiting (); -// u_int newEgptr = otherStream->get_avail (); -// char * newBuf = otherStream->reset_get_buffer (); -// char * oldgetbuf = myStream->reset_get_buffer (newBuf, otherStream->streambuf_size (), newGptr, newEgptr); -// -// 'myStream' now has the get buffer of 'otherStream' and can use it in any way. -// 'otherStream' now has a new, empty get buffer. - -char * -ACE_Streambuf::reset_get_buffer (char *newBuffer, - u_int _streambuf_size, - u_int _gptr, - u_int _egptr) -{ - char * rval = this->eback_saved_; - - // The get area is where the iostream will get data from. This is - // our read buffer. There are three pointers which describe the - // read buffer: - // - // eback () - The beginning of the buffer. Also the furthest - // point at which putbacks can be done. Hence the name. - // - // gptr () - Where the next character is to be got from. - // - // egptr () - One position beyond the last get-able character. - // - // So that we can switch quicky from read to write mode without - // any data copying, we keep copies of these three pointers in - // the variables below. Initially, they all point to the beginning - // of our read-dedicated buffer. - // - if (newBuffer) - { - if (streambuf_size_ != _streambuf_size) - return 0; - this->eback_saved_ = newBuffer; - } - else - ACE_NEW_RETURN (this->eback_saved_, - char[streambuf_size_], - 0); - - this->gptr_saved_ = this->eback_saved_ + _gptr; - this->egptr_saved_ = this->eback_saved_ + _egptr; - - // Disable the get area initially. This will cause underflow to be - // invoked on the first get operation. - setg (0, 0, 0); - - reset_base (); - - return rval; -} - -// Typical usage: -// -// u_int newPptr = otherStream->put_avail (); -// char * newBuf = otherStream->reset_put_buffer (); -// char * oldputbuf = otherStream->reset_put_buffer (newBuf, otherStream->streambuf_size (), newPptr); - -char * -ACE_Streambuf::reset_put_buffer (char *newBuffer, - u_int _streambuf_size, - u_int _pptr) -{ - char *rval = this->pbase_saved_; - - // The put area is where the iostream will put data that needs to be - // sent to the peer. This becomes our write buffer. The three - // pointers which maintain this area are: - // - // pbase () - The beginning of the put area. - // - // pptr () - Where the next character is to be put. - // - // epptr () - One beyond the last valid position for putting. - // - // Again to switch quickly between modes, we keep copies of - // these three pointers. - // - if (newBuffer) - { - if (streambuf_size_ != _streambuf_size) - return 0; - this->pbase_saved_ = newBuffer; - } - else - ACE_NEW_RETURN (this->pbase_saved_, - char[streambuf_size_], - 0); - - this->pptr_saved_ = this->pbase_saved_ + _pptr; - this->epptr_saved_ = this->pbase_saved_ + streambuf_size_; - - // Disable the put area. Overflow will be called by the first call - // to any put operator. - setp (0, 0); - - reset_base (); - - return rval; -} - -void -ACE_Streambuf::reset_base (void) -{ - // Until we experience the first get or put operation, we do not - // know what our current IO mode is. - this->cur_mode_ = 0; - - // The common area used for reading and writting is called "base". - // We initialize it this way so that the first get/put operation - // will have to "allocate" base. This allocation will set base to - // the appropriate specific buffer and set the mode to the correct - // value. - setb (0, 0); -} - -// If the default allocation strategey were used the common buffer -// would be deleted when the object destructs. Since we are providing -// separate read/write buffers, it is up to us to manage their memory. - -ACE_Streambuf::~ACE_Streambuf (void) -{ - delete [] this->eback_saved_; - delete [] this->pbase_saved_; -} - -u_char ACE_Streambuf::timeout (void) -{ - u_char rval = this->timeout_; - this->timeout_ = 0; - return rval; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* !ACE_LACKS_ACE_IOSTREAM */ -#endif /* ACE_IOSTREAM_CPP */ - diff --git a/dep/src/ace/IOStream_T.cpp b/dep/src/ace/IOStream_T.cpp deleted file mode 100644 index 3bf109b6737..00000000000 --- a/dep/src/ace/IOStream_T.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// $Id: IOStream_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_IOSTREAM_T_CPP -#define ACE_IOSTREAM_T_CPP - -#include "ace/IOStream_T.h" -#include "ace/OS_Memory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ACE_IOSTREAM) - -#if !defined (__ACE_INLINE__) -#include "ace/IOStream_T.inl" -#endif /* !__ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// We will be given a STREAM by the iostream object which creates us. -// See the ACE_IOStream template for how that works. Like other -// streambuf objects, we can be input-only, output-only or both. - -template -ACE_Streambuf_T::ACE_Streambuf_T (STREAM *peer, - u_int streambuf_size, - int io_mode) - : ACE_Streambuf (streambuf_size, io_mode), - peer_ (peer) -{ - // A streambuf allows for unbuffered IO where every character is - // read as requested and written as provided. To me, this seems - // terribly inefficient for socket-type operations, so I've disabled - // it. All of the work would be done by the underflow/overflow - // functions anyway and I haven't implemented anything there to - // support unbuffered IO. - -#if !defined (ACE_LACKS_UNBUFFERED_STREAMBUF) - this->unbuffered (0); -#endif /* ! ACE_LACKS_UNBUFFERED_STREAMBUF */ - - // Linebuffered is similar to unbuffered. Again, I don't have any - // need for this and I don't see the advantage. I believe this - // would have to be supported by underflow/overflow to be effective. -#if !defined (ACE_LACKS_LINEBUFFERED_STREAMBUF) - this->linebuffered (0); -#endif /* ! ACE_LACKS_LINEBUFFERED_STREAMBUF */ -} - -template ssize_t -ACE_Streambuf_T::send (char *buf, ssize_t len) -{ - return peer_->send_n (buf,len); -} - -template ssize_t -ACE_Streambuf_T::recv (char *buf, - ssize_t len, - ACE_Time_Value *tv) -{ - return this->recv (buf, len, 0, tv); -} - -template ssize_t -ACE_Streambuf_T::recv (char *buf, - ssize_t len, - int flags, - ACE_Time_Value * tv) -{ - this->timeout_ = 0; - errno = ESUCCESS; - ssize_t rval = peer_->recv (buf, len, flags, tv); - if (errno == ETIME) - this->timeout_ = 1; - return rval; -} - -template ssize_t -ACE_Streambuf_T::recv_n (char *buf, - ssize_t len, - int flags, - ACE_Time_Value *tv) -{ - this->timeout_ = 0; - errno = ESUCCESS; - ssize_t rval = peer_->recv_n (buf, len, flags, tv); - if (errno == ETIME) - this->timeout_ = 1; - return rval; -} - -template ACE_HANDLE -ACE_Streambuf_T::get_handle (void) -{ - return peer_ ? peer_->get_handle () : 0; -} - -// The typical constructor. This will initiailze your STREAM and then -// setup the iostream baseclass to use a custom streambuf based on -// STREAM. - -template -ACE_IOStream::ACE_IOStream (STREAM &stream, - u_int streambuf_size) - : iostream (0), - STREAM (stream) -{ - ACE_NEW (streambuf_, - ACE_Streambuf_T ((STREAM *) this, - streambuf_size)); - iostream::init (this->streambuf_); -} - -template -ACE_IOStream::ACE_IOStream (u_int streambuf_size) - : iostream (0) -{ - ACE_NEW (this->streambuf_, - ACE_Streambuf_T ((STREAM *) this, - streambuf_size)); - iostream::init (this->streambuf_); -} - -// We have to get rid of the streambuf_ ourselves since we gave it to -// iostream () - -template -ACE_IOStream::~ACE_IOStream (void) -{ - delete this->streambuf_; -} - -// The only ambituity in the multiple inheritance is the close () -// function. - -template int -ACE_IOStream::close (void) -{ - return STREAM::close (); -} - -template ACE_IOStream & -ACE_IOStream::operator>> (ACE_Time_Value *&tv) -{ - ACE_Time_Value *old_tv = this->streambuf_->recv_timeout (tv); - tv = old_tv; - return *this; -} - -#if defined (ACE_HAS_STRING_CLASS) - -// A simple string operator. The base iostream has 'em for char* but -// that isn't always the best thing for a String. If we don't provide -// our own here, we may not get what we want. - -template ACE_IOStream & -ACE_IOStream::operator>> (ACE_IOStream_String &v) -{ - if (ipfx0 ()) - { - char c; - this->get (c); - - for (v = c; - this->get (c) && !isspace (c); - v += c) - continue; - } - - isfx (); - - return *this; -} - -template ACE_IOStream & -ACE_IOStream::operator<< (ACE_IOStream_String &v) -{ - if (opfx ()) - { -#if defined (ACE_WIN32) && defined (_MSC_VER) - for (int i = 0; i < v.GetLength (); ++i) -#else - for (u_int i = 0; i < (u_int) v.length (); ++i) -#endif /* ACE_WIN32 && defined (_MSC_VER) */ - this->put (v[i]); - } - - osfx (); - - return *this; -} - -// A more clever put operator for strings that knows how to deal with -// quoted strings containing back-quoted quotes. - -template STREAM & -operator>> (STREAM &stream, - ACE_Quoted_String &str) -{ - char c; - - if (!(stream >> c)) // eat space up to the first char - // stream.set (ios::eofbit|ios::failbit); - return stream; - - str = ""; // Initialize the string - - // if we don't have a quote, append until we see space - if (c != '"') - for (str = c; stream.get (c) && !isspace (c); str += c) - continue; - else - for (; stream.get (c) && c != '"'; str += c) - if (c == '\\') - { - stream.get (c); - if (c != '"') - str += '\\'; - } - - return stream; -} - -template STREAM & -operator<< (STREAM &stream, - ACE_Quoted_String &str) -{ - stream.put ('"'); - - for (u_int i = 0; i < str.length (); ++i) - { - if (str[i] == '"') - stream.put ('\\'); - stream.put (str[i]); - } - - stream.put ('"'); - - return stream; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_STRING_CLASS */ -#endif /* ACE_LACKS_ACE_IOSTREAM */ -#endif /* ACE_IOSTREAM_T_CPP */ - diff --git a/dep/src/ace/IO_Cntl_Msg.cpp b/dep/src/ace/IO_Cntl_Msg.cpp deleted file mode 100644 index 213237298c4..00000000000 --- a/dep/src/ace/IO_Cntl_Msg.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id: IO_Cntl_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/IO_Cntl_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/IO_Cntl_Msg.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, IO_Cntl_Msg, "$Id: IO_Cntl_Msg.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if 0 -// This is not meant to be used, it's just a place holder... - -#if !defined (__ACE_INLINE__) -#include "ace/Intrusive_List.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl -template class ACE_Module; - -/** - * @class ACE_Module_Link - * - * @brief Data structure used to link two modules together - */ -class ACE_Module_Link -{ -public: - ACE_Module_Link (ACE_Module *m1, ACE_Module *m2): mod_upper_ (m1), mod_lower_ (m2), count_ (0) {} - - ACE_Module *upper (void) { return this->mod_upper_; } - void upper (ACE_Module *u) { this->mod_upper_ = u; } - - ACE_Module *lower (void) { return this->mod_lower_; } - void lower (ACE_Module *l) { this->mod_lower_ = l; } - - int count (void) const { return this->count_; } - void count (int c) { this->count_ = c; } - -private: - ACE_Module *mod_upper_; - ACE_Module *mod_lower_; - int count_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif - - diff --git a/dep/src/ace/IO_SAP.cpp b/dep/src/ace/IO_SAP.cpp deleted file mode 100644 index bfb693f9871..00000000000 --- a/dep/src/ace/IO_SAP.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// $Id: IO_SAP.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/IO_SAP.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/os_include/os_signal.h" - -#if !defined (__ACE_INLINE__) -#include "ace/IO_SAP.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, IO_SAP, "$Id: IO_SAP.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_IO_SAP) - -// This is the do-nothing constructor. It does not perform a -// ACE_OS::open system call. - -ACE_IO_SAP::ACE_IO_SAP (void) - : handle_ (ACE_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_IO_SAP::ACE_IO_SAP"); -} - -void -ACE_IO_SAP::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_IO_SAP::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Cache for the process ID. -pid_t ACE_IO_SAP::pid_ = 0; - -int -ACE_IO_SAP::enable (int value) const -{ - ACE_TRACE ("ACE_IO_SAP::enable"); - /* First-time in initialization. */ - if (ACE_IO_SAP::pid_ == 0) - ACE_IO_SAP::pid_ = ACE_OS::getpid (); - - switch (value) - { -#if defined (SIGURG) - case SIGURG: - case ACE_SIGURG: -#if defined (F_SETOWN) - return ACE_OS::fcntl (this->handle_, - F_SETOWN, - ACE_IO_SAP::pid_); -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN */ -#endif /* SIGURG */ -#if defined (SIGIO) - case SIGIO: - case ACE_SIGIO: -#if defined (F_SETOWN) && defined (FASYNC) - if (ACE_OS::fcntl (this->handle_, - F_SETOWN, - ACE_IO_SAP::pid_) == -1 - || ACE::set_flags (this->handle_, - FASYNC) == -1) - return -1; - break; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN && FASYNC */ -#else // <== - ACE_NOTSUP_RETURN (-1); -#endif /* SIGIO <== */ - case ACE_NONBLOCK: - if (ACE::set_flags (this->handle_, - ACE_NONBLOCK) == -1) - return -1; - break; - default: - return -1; - } - - return 0; -} - -int -ACE_IO_SAP::disable (int value) const -{ - ACE_TRACE ("ACE_IO_SAP::disable"); - - switch (value) - { -#if defined (SIGURG) - case SIGURG: - case ACE_SIGURG: -#if defined (F_SETOWN) - if (ACE_OS::fcntl (this->handle_, - F_SETOWN, 0) == -1) - return -1; - break; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN */ -#endif /* SIGURG */ -#if defined (SIGIO) - case SIGIO: - case ACE_SIGIO: -#if defined (F_SETOWN) && defined (FASYNC) - if (ACE_OS::fcntl (this->handle_, - F_SETOWN, - 0) == -1 - || ACE::clr_flags (this->handle_, FASYNC) == -1) - return -1; - break; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN && FASYNC */ -#else // <== - ACE_NOTSUP_RETURN (-1); -#endif /* SIGIO <== */ - case ACE_NONBLOCK: - if (ACE::clr_flags (this->handle_, - ACE_NONBLOCK) == -1) - return -1; - break; - default: - return -1; - } - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/IPC_SAP.cpp b/dep/src/ace/IPC_SAP.cpp deleted file mode 100644 index d257bf60ea5..00000000000 --- a/dep/src/ace/IPC_SAP.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// $Id: IPC_SAP.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/IPC_SAP.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" -#include "ace/os_include/os_signal.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_fcntl.h" - -#if !defined (__ACE_INLINE__) -#include "ace/IPC_SAP.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, IPC_SAP, "$Id: IPC_SAP.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_IPC_SAP) - -void -ACE_IPC_SAP::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_IPC_SAP::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Cache for the process ID. -pid_t ACE_IPC_SAP::pid_ = 0; - -// This is the do-nothing constructor. It does not perform a -// ACE_OS::socket system call. - -ACE_IPC_SAP::ACE_IPC_SAP (void) - : handle_ (ACE_INVALID_HANDLE) -{ - // ACE_TRACE ("ACE_IPC_SAP::ACE_IPC_SAP"); -} - -int -ACE_IPC_SAP::enable (int value) const -{ - ACE_TRACE ("ACE_IPC_SAP::enable"); - - // First-time in initialization. - if (ACE_IPC_SAP::pid_ == 0) - ACE_IPC_SAP::pid_ = ACE_OS::getpid (); - -#if defined (ACE_WIN32) || defined (ACE_VXWORKS) - switch (value) - { - case ACE_NONBLOCK: - { - // nonblocking argument (1) - // blocking: (0) - int nonblock = 1; - return ACE_OS::ioctl (this->handle_, - FIONBIO, - &nonblock); - } - default: - ACE_NOTSUP_RETURN (-1); - } -#else /* ! ACE_WIN32 && ! ACE_VXWORKS */ - switch (value) - { -#if defined (SIGURG) - case SIGURG: - case ACE_SIGURG: -#if defined (F_SETOWN) - return ACE_OS::fcntl (this->handle_, - F_SETOWN, - ACE_IPC_SAP::pid_); -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN */ -#endif /* SIGURG */ -#if defined (SIGIO) - case SIGIO: - case ACE_SIGIO: -#if defined (F_SETOWN) && defined (FASYNC) - if (ACE_OS::fcntl (this->handle_, - F_SETOWN, - ACE_IPC_SAP::pid_) == -1 - || ACE::set_flags (this->handle_, - FASYNC) == -1) - return -1; - break; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN && FASYNC */ -#endif /* SIGIO <== */ -#if defined (F_SETFD) - case ACE_CLOEXEC: - // Enables the close-on-exec flag. - if (ACE_OS::fcntl (this->handle_, - F_SETFD, - 1) == -1) - return -1; - break; -#endif /* F_SETFD */ - case ACE_NONBLOCK: - if (ACE::set_flags (this->handle_, - ACE_NONBLOCK) == ACE_INVALID_HANDLE) - return -1; - break; - default: - return -1; - } - return 0; -#endif /* ! ACE_WIN32 && ! ACE_VXWORKS */ - - /* NOTREACHED */ -} - -int -ACE_IPC_SAP::disable (int value) const -{ - ACE_TRACE ("ACE_IPC_SAP::disable"); - -#if defined (ACE_WIN32) || defined (ACE_VXWORKS) - switch (value) - { - case ACE_NONBLOCK: - // nonblocking argument (1) - // blocking: (0) - { - int nonblock = 0; - return ACE_OS::ioctl (this->handle_, - FIONBIO, - &nonblock); - } - default: - ACE_NOTSUP_RETURN (-1); - } -#else /* ! ACE_WIN32 && ! ACE_VXWORKS */ - switch (value) - { -#if defined (SIGURG) - case SIGURG: - case ACE_SIGURG: -#if defined (F_SETOWN) - return ACE_OS::fcntl (this->handle_, - F_SETOWN, - 0); -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN */ -#endif /* SIGURG */ -#if defined (SIGIO) - case SIGIO: - case ACE_SIGIO: -#if defined (F_SETOWN) && defined (FASYNC) - if (ACE_OS::fcntl (this->handle_, - F_SETOWN, - 0) == -1 - || ACE::clr_flags (this->handle_, - FASYNC) == -1) - return -1; - break; -#else - ACE_NOTSUP_RETURN (-1); -#endif /* F_SETOWN && FASYNC */ -#endif /* SIGIO <== */ -#if defined (F_SETFD) - case ACE_CLOEXEC: - // Disables the close-on-exec flag. - if (ACE_OS::fcntl (this->handle_, - F_SETFD, - 0) == -1) - return -1; - break; -#endif /* F_SETFD */ - case ACE_NONBLOCK: - if (ACE::clr_flags (this->handle_, - ACE_NONBLOCK) == -1) - return -1; - break; - default: - return -1; - } - return 0; -#endif /* ! ACE_WIN32 && ! ACE_VXWORKS */ - /* NOTREACHED */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Init_ACE.cpp b/dep/src/ace/Init_ACE.cpp deleted file mode 100644 index a71f73b5992..00000000000 --- a/dep/src/ace/Init_ACE.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "ace/Init_ACE.h" - -#include "ace/Object_Manager.h" - -ACE_RCSID (ace, - Init_ACE, - "$Id: Init_ACE.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -unsigned int ACE::init_fini_count_ = 0; - -int -ACE::init (void) -{ - // Don't use ACE_TRACE, because Object_Manager might not have been - // instantiated yet. - // ACE_TRACE ("ACE::init"); - - ++ACE::init_fini_count_; - - return ACE_Object_Manager::instance ()->init (); -} - -int -ACE::fini (void) -{ - ACE_TRACE ("ACE::fini"); - - if (ACE::init_fini_count_ > 0) - { - if (--ACE::init_fini_count_ == 0) - return ACE_Object_Manager::instance ()->fini (); - else - // Wait for remaining fini () calls. - return 1; - } - else - // More ACE::fini () calls than ACE::init () calls. Bad - // application! - return -1; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Intrusive_Auto_Ptr.cpp b/dep/src/ace/Intrusive_Auto_Ptr.cpp deleted file mode 100644 index 0b27e72e02e..00000000000 --- a/dep/src/ace/Intrusive_Auto_Ptr.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id: Intrusive_Auto_Ptr.cpp 81166 2008-03-31 15:00:23Z iliyan $ - -#ifndef ACE_INTRUSIVE_AUTO_PTR_CPP -#define ACE_INTRUSIVE_AUTO_PTR_CPP - -#include "ace/Intrusive_Auto_Ptr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Intrusive_Auto_Ptr.inl" -#endif /* __ACE_INLINE __ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Intrusive_Auto_Ptr::~ACE_Intrusive_Auto_Ptr (void) -{ - reset (0); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* !ACE_INTRUSIVE_AUTO_PTR_CPP */ - diff --git a/dep/src/ace/Intrusive_List.cpp b/dep/src/ace/Intrusive_List.cpp deleted file mode 100644 index e8a3a951e1d..00000000000 --- a/dep/src/ace/Intrusive_List.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// $Id: Intrusive_List.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_INTRUSIVE_LIST_CPP -#define ACE_INTRUSIVE_LIST_CPP - -#include "ace/Intrusive_List.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Intrusive_List.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Intrusive_List::ACE_Intrusive_List (void) - : head_ (0) - , tail_ (0) -{ -} - -template -ACE_Intrusive_List::~ACE_Intrusive_List (void) -{ -} - -template void -ACE_Intrusive_List::push_back (T *node) -{ - if (this->tail_ == 0) - { - this->tail_ = node; - this->head_ = node; - node->next (0); - node->prev (0); - return; - } - - this->tail_->next (node); - node->prev (this->tail_); - node->next (0); - this->tail_ = node; -} - -template void -ACE_Intrusive_List::push_front (T *node) -{ - if (this->head_ == 0) - { - this->tail_ = node; - this->head_ = node; - node->next (0); - node->prev (0); - return; - } - - this->head_->prev (node); - node->next (this->head_); - node->prev (0); - this->head_ = node; -} - -template T * -ACE_Intrusive_List::pop_front (void) -{ - T *node = this->head_; - if (node == 0) - return 0; - this->unsafe_remove (node); - return node; -} - -template T * -ACE_Intrusive_List::pop_back (void) -{ - T *node = this->tail_; - if (node == 0) - return 0; - this->unsafe_remove (node); - return node; -} - -template void -ACE_Intrusive_List::remove (T *node) -{ - for (T *i = this->head_; i != 0; i = i->next ()) - { - if (node == i) - { - this->unsafe_remove (node); - return; - } - } -} - -template void -ACE_Intrusive_List::unsafe_remove (T *node) -{ - if (node->prev () != 0) - node->prev ()->next (node->next ()); - else - this->head_ = node->next (); - - if (node->next () != 0) - node->next ()->prev (node->prev ()); - else - this->tail_ = node->prev (); - - node->next (0); - node->prev (0); -} - -#if 0 -template void -ACE_Intrusive_List_Node::check_invariants (void) -{ - ACE_ASSERT ((this->next () == 0) || (this->next ()->prev () == this)); - ACE_ASSERT ((this->prev () == 0) || (this->prev ()->next () == this)); -} - -template void -ACE_Intrusive_List::check_invariants (void) -{ - ACE_ASSERT ((this->tail_ == 0) || (this->tail_->next () == 0)); - ACE_ASSERT ((this->head_ == 0) || (this->head_->prev () == 0)); - ACE_ASSERT (!((this->head_ == 0) ^ (this->tail_ == 0))); - - int found_tail = 0; - for (T *i = this->head_; i != 0; i = i->next ()) - { - if (i == this->tail_) - found_tail = 1; - i->check_invariants (); - } - ACE_ASSERT (this->tail_ == 0 || found_tail == 1); - - int found_head = 0; - for (T *j = this->tail_; j != 0; j = j->prev ()) - { - if (j == this->head_) - found_head = 1; - j->check_invariants (); - } - ACE_ASSERT (this->head_ == 0 || found_head == 1); -} -#endif /* 0 */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_INTRUSIVE_LIST_CPP */ - diff --git a/dep/src/ace/Intrusive_List_Node.cpp b/dep/src/ace/Intrusive_List_Node.cpp deleted file mode 100644 index 347bb677de6..00000000000 --- a/dep/src/ace/Intrusive_List_Node.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// $Id: Intrusive_List_Node.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_INTRUSIVE_LIST_NODE_CPP -#define ACE_INTRUSIVE_LIST_NODE_CPP - -#include "ace/Intrusive_List_Node.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Intrusive_List_Node.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Intrusive_List_Node::ACE_Intrusive_List_Node (void) - : prev_ (0) - , next_ (0) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_INTRUSIVE_LIST_NODE_CPP */ - diff --git a/dep/src/ace/LOCK_SOCK_Acceptor.cpp b/dep/src/ace/LOCK_SOCK_Acceptor.cpp deleted file mode 100644 index aa525a9b226..00000000000 --- a/dep/src/ace/LOCK_SOCK_Acceptor.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// $Id: LOCK_SOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_LOCK_SOCK_ACCEPTOR_CPP -#define ACE_LOCK_SOCK_ACCEPTOR_CPP - -#include "ace/Guard_T.h" -#include "ace/LOCK_SOCK_Acceptor.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template int -ACE_LOCK_SOCK_Acceptor::accept (ACE_SOCK_Stream &stream, - ACE_Addr *remote_address, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1); - - return ACE_SOCK_Acceptor::accept (stream, - remote_address, - timeout, - restart, - reset_new_handle); -} - -template ACE_LOCK & -ACE_LOCK_SOCK_Acceptor::lock (void) -{ - return this->lock_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LOCK_SOCK_ACCEPTOR_CPP */ - diff --git a/dep/src/ace/LSOCK.cpp b/dep/src/ace/LSOCK.cpp deleted file mode 100644 index 17c210aa9fc..00000000000 --- a/dep/src/ace/LSOCK.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// $Id: LSOCK.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK.h" - -ACE_RCSID(ace, LSOCK, "$Id: LSOCK.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_sys_socket.h" - -#if !defined (__ACE_INLINE__) -#include "ace/LSOCK.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK) - -void -ACE_LSOCK::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LSOCK::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("aux_handle_ = %d"), this->aux_handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -#if defined (ACE_HAS_MSG) -// This routine sends an open file descriptor to handle_>. - -ssize_t -ACE_LSOCK::send_handle (const ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_LSOCK::send_handle"); - u_char a[2]; - iovec iov; - msghdr send_msg; -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - char cmsgbuf[ACE_BSD_CONTROL_MSG_LEN]; - cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - a[0] = 0xab; - a[1] = 0xcd; - iov.iov_base = (char *) a; - iov.iov_len = sizeof a; - send_msg.msg_iov = &iov; - send_msg.msg_iovlen = 1; - send_msg.msg_name = 0; - send_msg.msg_namelen = 0; - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - cmsgptr->cmsg_level = SOL_SOCKET; - cmsgptr->cmsg_type = SCM_RIGHTS; - cmsgptr->cmsg_len = sizeof cmsgbuf; - send_msg.msg_control = cmsgbuf; - send_msg.msg_controllen = sizeof cmsgbuf; - *(ACE_HANDLE *) CMSG_DATA (cmsgptr) = handle; - send_msg.msg_flags = 0; -#else - send_msg.msg_accrights = (char *) &handle; - send_msg.msg_accrightslen = sizeof handle; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - return ACE_OS::sendmsg (this->get_handle (), &send_msg, 0); -} - -// This file receives an open file descriptor from handle_>. -// Note, this routine returns -1 if problems occur, 0 if we recv a -// message that does not have file descriptor in it, and 1 otherwise. - -ssize_t -ACE_LSOCK::recv_handle (ACE_HANDLE &handle, char *pbuf, ssize_t *len) const -{ - ACE_TRACE ("ACE_LSOCK::recv_handle"); - u_char a[2]; - iovec iov; - msghdr recv_msg; - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - char cmsgbuf[ACE_BSD_CONTROL_MSG_LEN]; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - if (pbuf != 0 && len != 0) - { - iov.iov_base = pbuf; - iov.iov_len = *len; - } - else - { - iov.iov_base = (char *) a; - iov.iov_len = sizeof a; - } - - recv_msg.msg_iov = &iov; - recv_msg.msg_iovlen = 1; - recv_msg.msg_name = 0; - recv_msg.msg_namelen = 0; -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - recv_msg.msg_control = cmsgbuf; - recv_msg.msg_controllen = sizeof cmsgbuf; -#else - recv_msg.msg_accrights = (char *) &handle; - recv_msg.msg_accrightslen = sizeof handle; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - -#if defined (ACE_HAS_STREAMS) - - ssize_t nbytes = ACE_OS::recvmsg (this->get_handle (), &recv_msg, 0); - - if (nbytes != ACE_INVALID_HANDLE) - { - if (len != 0) - *len = nbytes; - - if (nbytes == sizeof a - && ((u_char *) iov.iov_base)[0] == 0xab - && ((u_char *) iov.iov_base)[1] == 0xcd) - { -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; - handle = *(ACE_HANDLE *) CMSG_DATA (cmsgptr); -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - return 1; - } - else - return 0; - } -#else - ssize_t nbytes = ACE_OS::recvmsg (this->get_handle (), - &recv_msg, - MSG_PEEK); - - if (nbytes != ACE_INVALID_HANDLE) - { - if (nbytes == sizeof a - && ((u_char *) iov.iov_base)[0] == 0xab - && ((u_char *) iov.iov_base)[1] == 0xcd) - { -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - // Close down the socket that was returned by the MSG_PEEK. - ACE_OS::closesocket (*(ACE_HANDLE *) CMSG_DATA ((cmsghdr *) cmsgbuf)); - recv_msg.msg_control = cmsgbuf; - recv_msg.msg_controllen = sizeof cmsgbuf; -#else - recv_msg.msg_accrights = (char *) &handle; - recv_msg.msg_accrightslen = sizeof handle; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - if (ACE_OS::recvmsg (this->get_handle (), - &recv_msg, 0) == ACE_INVALID_HANDLE) - return ACE_INVALID_HANDLE; - else - { -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; - handle = *(ACE_HANDLE *) CMSG_DATA (cmsgptr); -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - return 1; - } - } - else - { - if (len != 0) - *len = nbytes; - return 0; - } - } -#endif /* ACE_HAS_STREAMS */ - else - return ACE_INVALID_HANDLE; -} -#endif /* ACE_HAS_MSG */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/LSOCK_Acceptor.cpp b/dep/src/ace/LSOCK_Acceptor.cpp deleted file mode 100644 index ece671beae3..00000000000 --- a/dep/src/ace/LSOCK_Acceptor.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// $Id: LSOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK_Acceptor.h" - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_sys_socket.h" - -ACE_RCSID(ace, LSOCK_Acceptor, "$Id: LSOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Acceptor) - -// Return the local endpoint address. - -int -ACE_LSOCK_Acceptor::get_local_addr (ACE_Addr &a) const -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::get_local_addr"); - - ACE_UNIX_Addr& target = dynamic_cast (a); - - target = this->local_addr_; - - return 0; -} - -void -ACE_LSOCK_Acceptor::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LSOCK_Acceptor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->local_addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// Do nothing routine for constructor. - -ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor"); -} - -int -ACE_LSOCK_Acceptor::open (const ACE_Addr &remote_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::open"); - this->local_addr_ = *((ACE_UNIX_Addr *) &remote_sap); // This is a gross hack... - return ACE_SOCK_Acceptor::open (remote_sap, reuse_addr, - protocol_family, backlog, protocol); -} - -// General purpose routine for performing server ACE_SOCK creation. - -ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor (const ACE_Addr &remote_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor"); - if (this->open (remote_sap, - reuse_addr, - protocol_family, - backlog, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - "ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor")); -} - -// General purpose routine for accepting new connections. - -int -ACE_LSOCK_Acceptor::accept (ACE_LSOCK_Stream &new_stream, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::accept"); - - int in_blocking_mode = 0; - if (this->shared_accept_start (timeout, - restart, - in_blocking_mode) == -1) - return -1; - else - { - sockaddr *addr = 0; - int len = 0; - - if (remote_addr != 0) - { - len = remote_addr->get_size (); - addr = (sockaddr *) remote_addr->get_addr (); - } - - do - new_stream.set_handle (ACE_OS::accept (this->get_handle (), - addr, - &len)); - while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 - && errno == EINTR - && timeout == 0); - - // Reset the size of the addr, which is only necessary for UNIX - // domain sockets. - if (new_stream.get_handle () != ACE_INVALID_HANDLE - && remote_addr != 0) - remote_addr->set_size (len); - } - - return this->shared_accept_finish (new_stream, - in_blocking_mode, - reset_new_handle); -} - -// Close down the UNIX domain stream and remove the rendezvous point -// from the file system. - -int -ACE_LSOCK_Acceptor::remove (void) -{ - ACE_TRACE ("ACE_LSOCK_Acceptor::remove"); - int result = this->close (); - return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 - || result == -1 ? -1 : 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/LSOCK_CODgram.cpp b/dep/src/ace/LSOCK_CODgram.cpp deleted file mode 100644 index 9f2b23574be..00000000000 --- a/dep/src/ace/LSOCK_CODgram.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// $Id: LSOCK_CODgram.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK_CODgram.h" -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, LSOCK_CODgram, "$Id: LSOCK_CODgram.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/LSOCK_CODgram.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_CODgram) - -void -ACE_LSOCK_CODgram::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LSOCK_CODgram::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_SOCK_CODgram::dump (); - ACE_LSOCK::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -/* Here's the general-purpose open routine. */ - -int -ACE_LSOCK_CODgram::open (const ACE_Addr &remote, - const ACE_Addr &local, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_CODgram::open"); - if (ACE_SOCK_CODgram::open (remote, local, protocol_family, - protocol) == -1) - return -1; - ACE_LSOCK::set_handle (this->get_handle ()); - return 0; -} - -/* Create a local ACE_SOCK datagram. */ - -ACE_LSOCK_CODgram::ACE_LSOCK_CODgram (const ACE_Addr &remote, - const ACE_Addr &local, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_CODgram::ACE_LSOCK_CODgram"); - if (this->open (remote, local, protocol_family, - protocol) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_LSOCK_CODgram"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/LSOCK_Connector.cpp b/dep/src/ace/LSOCK_Connector.cpp deleted file mode 100644 index efb2063320e..00000000000 --- a/dep/src/ace/LSOCK_Connector.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id: LSOCK_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK_Connector.h" -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, LSOCK_Connector, "$Id: LSOCK_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/LSOCK_Connector.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Connector) - -void -ACE_LSOCK_Connector::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LSOCK_Connector::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_LSOCK_Connector::ACE_LSOCK_Connector (void) -{ - ACE_TRACE ("ACE_LSOCK_Connector::ACE_LSOCK_Connector"); -} - -// Establish a connection. -ACE_LSOCK_Connector::ACE_LSOCK_Connector (ACE_LSOCK_Stream &new_stream, - const ACE_UNIX_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) - : ACE_SOCK_Connector (new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms) -{ - ACE_TRACE ("ACE_LSOCK_Connector::ACE_LSOCK_Connector"); - // This is necessary due to the weird inheritance relationships of - // ACE_LSOCK_Stream. - new_stream.set_handle (new_stream.get_handle ()); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/LSOCK_Dgram.cpp b/dep/src/ace/LSOCK_Dgram.cpp deleted file mode 100644 index 5cb18a611a4..00000000000 --- a/dep/src/ace/LSOCK_Dgram.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id: LSOCK_Dgram.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK_Dgram.h" -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, LSOCK_Dgram, "$Id: LSOCK_Dgram.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/LSOCK_Dgram.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Dgram) - -void -ACE_LSOCK_Dgram::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_LSOCK_Dgram::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_SOCK_Dgram::dump (); - ACE_LSOCK::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// The "do nothing" constructor. - -ACE_LSOCK_Dgram::ACE_LSOCK_Dgram (void) -{ - ACE_TRACE ("ACE_LSOCK_Dgram::ACE_LSOCK_Dgram"); -} - -// Here's the general-purpose open routine. - -int -ACE_LSOCK_Dgram::open (const ACE_Addr &local, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_Dgram::open"); - if (ACE_SOCK_Dgram::open (local, - protocol_family, - protocol) == -1) - return -1; - ACE_LSOCK::set_handle (this->ACE_SOCK_Dgram::get_handle ()); - return 0; -} - -// Create a local ACE_SOCK datagram. - -ACE_LSOCK_Dgram::ACE_LSOCK_Dgram (const ACE_Addr &local, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_LSOCK_Dgram::ACE_LSOCK_Dgram"); - if (this->open (local, - protocol_family, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_LSOCK_Dgram"))); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/LSOCK_Stream.cpp b/dep/src/ace/LSOCK_Stream.cpp deleted file mode 100644 index ab8110c7732..00000000000 --- a/dep/src/ace/LSOCK_Stream.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// $Id: LSOCK_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/LSOCK_Stream.h" -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_sys_socket.h" - -ACE_RCSID(ace, LSOCK_Stream, "$Id: LSOCK_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/LSOCK_Stream.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Stream) - -int -ACE_LSOCK_Stream::get_local_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_LSOCK_Stream::get_local_addr"); - - // Perform the downcast since had better be an - // . - ACE_UNIX_Addr *rhs_unix_addr = dynamic_cast (&addr); - ACE_UNIX_Addr lhs_unix_addr; - - if (rhs_unix_addr == 0) - return -1; - else if (ACE_SOCK::get_local_addr (lhs_unix_addr) == -1) - return -1; - else - { - *rhs_unix_addr = lhs_unix_addr; - return 0; - } -} - -int -ACE_LSOCK_Stream::get_remote_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_LSOCK_Stream::get_remote_addr"); - - return this->get_local_addr (addr); -} - -void -ACE_LSOCK_Stream::dump (void) const -{ - ACE_TRACE ("ACE_LSOCK_Stream::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_SOCK_Stream::dump (); - ACE_LSOCK::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -#if defined (ACE_HAS_MSG) - -// Send a readv-style vector of buffers, along with an open I/O -// handle. - -ssize_t -ACE_LSOCK_Stream::send_msg (const iovec iov[], - size_t n, - ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_LSOCK_Stream::send_msg"); - msghdr send_msg; -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - char cmsgbuf[ACE_BSD_CONTROL_MSG_LEN]; - cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - send_msg.msg_iov = const_cast (iov); - send_msg.msg_iovlen = n; - send_msg.msg_name = 0; - send_msg.msg_namelen = 0; - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - cmsgptr->cmsg_level = SOL_SOCKET; - cmsgptr->cmsg_type = SCM_RIGHTS; - cmsgptr->cmsg_len = sizeof cmsgbuf; - send_msg.msg_control = cmsgbuf; - send_msg.msg_controllen = sizeof cmsgbuf; - *(ACE_HANDLE *) CMSG_DATA (cmsgptr) = handle; - send_msg.msg_flags = 0 ; -#else - send_msg.msg_accrights = (char *) &handle; - send_msg.msg_accrightslen = sizeof handle; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - return ACE_OS::sendmsg (this->ACE_SOCK_Stream::get_handle (), - &send_msg, 0); -} - -// Read a readv-style vector of buffers, along with an open I/O -// handle. - -ssize_t -ACE_LSOCK_Stream::recv_msg (iovec iov[], - size_t n, - ACE_HANDLE &handle) -{ - ACE_TRACE ("ACE_LSOCK_Stream::recv_msg"); - msghdr recv_msg; -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - char cmsgbuf[ACE_BSD_CONTROL_MSG_LEN]; - cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - recv_msg.msg_iov = (iovec *) iov; - recv_msg.msg_iovlen = n; - recv_msg.msg_name = 0; - recv_msg.msg_namelen = 0; - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - recv_msg.msg_control = cmsgbuf; - recv_msg.msg_controllen = sizeof cmsgbuf; - ssize_t result = ACE_OS::recvmsg (this->ACE_SOCK_Stream::get_handle (), - &recv_msg, 0); - handle = *(ACE_HANDLE*) CMSG_DATA (cmsgptr) ; - return result; -#else - recv_msg.msg_accrights = (char *) &handle; - recv_msg.msg_accrightslen = sizeof handle; - - return ACE_OS::recvmsg (this->ACE_SOCK_Stream::get_handle (), - &recv_msg, 0); -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ -} -#endif /* ACE_HAS_MSG */ - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/src/ace/Lib_Find.cpp b/dep/src/ace/Lib_Find.cpp deleted file mode 100644 index 4584056b55c..00000000000 --- a/dep/src/ace/Lib_Find.cpp +++ /dev/null @@ -1,768 +0,0 @@ -// $Id: Lib_Find.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Lib_Find.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_fcntl.h" - -#if defined (ACE_WIN32) -# include "ace/OS_NS_strings.h" -#endif /* ACE_WIN32 */ - -#if defined (ACE_OPENVMS) -#include "ace/RB_Tree.h" -#include "ace/Thread_Mutex.h" -#include "ace/Singleton.h" - -#include /**/ "descrip.h" -#include /**/ "chfdef.h" -#include /**/ "stsdef.h" -#include /**/ "libdef.h" - -extern "C" int LIB$FIND_IMAGE_SYMBOL(...); - -class ACE_LD_Symbol_Registry -{ - // @internal - // = TITLE - // Implements a class to register symbols and addresses for use with DLL - // symbol retrieval. - // - // = DESCRIPTION - // OpenVMS restricts symbol length to 31 characters encoding any symbols - // longer than that. In these cases dlsym() only works with the encoded - // names. - // This creates serious problems for the service configurator framework - // where the factory method names often exceed 31 chars and where loading - // is based on retrieval of method pointers using the *full* name. - // For OpenVMS we therefor added this singleton class and the - // ACE_Dynamic_Svc_Registrar class which registers full names and function - // pointers with this singleton at the time the static ACE_Dynamic_Svc_Registrar - // object is created in a (service) DLL. - // By forcing the DLL to load using a common symbol ("NULL") we trigger static - // object creation *before* the full names are referenced. - // Symbol references will be resolved as follows on OpenVMS: - // - first try directly from DLL using the RTL dlsym() function and if that fails; - // - try to find symbol in singleton registry. -public: - - typedef ACE_RB_Tree, - ACE_Thread_Mutex> - TREE; - - void register_symbol (const ACE_TCHAR* symname, void* symaddr); - - void* find_symbol (const ACE_TCHAR* symname); - - ACE_LD_Symbol_Registry () {} -private: - - TREE symbol_registry_; -}; - -void -ACE_LD_Symbol_Registry::register_symbol (const ACE_TCHAR* symname, - void* symaddr) -{ - int const result = symbol_registry_.bind (symname, symaddr); - if (result == 1) - { - ACE_DEBUG((LM_INFO, ACE_TEXT ("ACE_LD_Symbol_Registry:") - ACE_TEXT (" duplicate symbol %s registered\n"), - ACE_TEXT_ALWAYS_CHAR (symname))); - } - else if (result == -1) - { - ACE_ERROR((LM_ERROR, ACE_TEXT ("ACE_LD_Symbol_Registry:") - ACE_TEXT (" failed to register symbol %s\n"), - ACE_TEXT_ALWAYS_CHAR (symname))); - } -} - -void* -ACE_LD_Symbol_Registry::find_symbol (const ACE_TCHAR* symname) -{ - void* symaddr = 0; - int const result = symbol_registry_.find (symname, symaddr); - - return (result == 0 ? symaddr : 0); -} - -/// Declare a process wide singleton -ACE_SINGLETON_DECLARE (ACE_Singleton, - ACE_LD_Symbol_Registry, - ACE_Thread_Mutex) - -typedef ACE_Singleton - ACE_LD_SYMBOL_REGISTRY; - -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton * - ACE_Singleton::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ -#endif - -ACE_RCSID(ace, Lib_Find, "$Id: Lib_Find.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -int -ACE::ldfind (const ACE_TCHAR* filename, - ACE_TCHAR pathname[], - size_t maxpathnamelen) -{ - ACE_TRACE ("ACE::ldfind"); -#if defined (ACE_OPENVMS) - if (ACE_OS::strlen(filename) >= maxpathnamelen) - { - errno = ENOMEM; - return -1; - } - - dsc$descriptor nameDsc; - nameDsc.dsc$b_class = DSC$K_CLASS_S; - nameDsc.dsc$b_dtype = DSC$K_DTYPE_T; - nameDsc.dsc$w_length = ACE_OS::strlen(filename); - nameDsc.dsc$a_pointer = (char*)filename; - - char symbol[] = "NULL"; - dsc$descriptor symbolDsc; - symbolDsc.dsc$b_class = DSC$K_CLASS_S; - symbolDsc.dsc$b_dtype = DSC$K_DTYPE_T; - symbolDsc.dsc$w_length = ACE_OS::strlen(symbol); - symbolDsc.dsc$a_pointer = symbol; - - int symbolValue; - int result; - try - { - result = LIB$FIND_IMAGE_SYMBOL(&nameDsc, &symbolDsc, &symbolValue, 0, 0); - } - catch (chf$signal_array& sig) - { - result = sig.chf$l_sig_name; - } - - int severity = result & STS$M_SEVERITY; - int conditionId = result & STS$M_COND_ID; - if (severity == STS$K_SUCCESS || severity == STS$K_WARNING || severity == STS$K_INFO || - (severity == STS$K_ERROR && conditionId == (LIB$_KEYNOTFOU & STS$M_COND_ID))) - { - ACE_OS::strcpy(pathname, filename); - return 0; - } - - if (ACE_OS::strlen(filename) + ACE_OS::strlen(ACE_DLL_PREFIX) >= maxpathnamelen) - { - errno = ENOMEM; - return -1; - } - - ACE_OS::strcpy(pathname, ACE_DLL_PREFIX); - ACE_OS::strcat(pathname, filename); - nameDsc.dsc$w_length = ACE_OS::strlen(pathname); - nameDsc.dsc$a_pointer = pathname; - try - { - result = LIB$FIND_IMAGE_SYMBOL(&nameDsc, &symbolDsc, &symbolValue, 0, 0); - } - catch (chf$signal_array& sig) - { - result = sig.chf$l_sig_name; - } - - severity = result & STS$M_SEVERITY; - conditionId = result & STS$M_COND_ID; - if (severity == STS$K_SUCCESS || severity == STS$K_WARNING || severity == STS$K_INFO || - (severity == STS$K_ERROR && conditionId == (LIB$_KEYNOTFOU & STS$M_COND_ID))) - { - return 0; - } - errno = ENOENT; - return -1; -#endif /* ACE_OPENVMS */ - -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && \ - !defined (ACE_HAS_PHARLAP) - ACE_TCHAR expanded_filename[MAXPATHLEN]; - if (ACE_TEXT_ExpandEnvironmentStrings (filename, - expanded_filename, - sizeof expanded_filename - / sizeof (ACE_TCHAR))) - filename = expanded_filename; -#endif /* ACE_WIN32 && !ACE_HAS_WINCE && !ACE_HAS_PHARLAP */ - - ACE_TCHAR tempcopy[MAXPATHLEN + 1]; - ACE_TCHAR searchpathname[MAXPATHLEN + 1]; -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - ACE_TCHAR decorator[] = ACE_LD_DECORATOR_STR; - ACE_TCHAR searchfilename[MAXPATHLEN + sizeof(decorator) / sizeof (ACE_TCHAR)]; -#else - ACE_TCHAR searchfilename[MAXPATHLEN + 1]; -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ - - // Create a copy of filename to work with. - if (ACE_OS::strlen (filename) + 1 - > (sizeof tempcopy / sizeof (ACE_TCHAR))) - { - errno = ENOMEM; - return -1; - } - else - ACE_OS::strcpy (tempcopy, filename); - - // Insert canonical directory separators. - ACE_TCHAR *separator_ptr; - -#if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') - // Make all the directory separators "canonical" to simplify - // subsequent code. - ACE::strrepl (tempcopy, ACE_DIRECTORY_SEPARATOR_CHAR, '/'); -#endif /* ACE_DIRECTORY_SEPARATOR_CHAR */ - - // Separate filename from pathname. - separator_ptr = ACE_OS::strrchr (tempcopy, '/'); - - // This is a relative path. - if (separator_ptr == 0) - { - searchpathname[0] = '\0'; - ACE_OS::strcpy (searchfilename, tempcopy); - } - else // This is an absolute path. - { - ACE_OS::strcpy (searchfilename, separator_ptr + 1); - separator_ptr[1] = '\0'; - ACE_OS::strcpy (searchpathname, tempcopy); - } - - bool has_suffix = false; - - // Check to see if this has an appropriate DLL suffix for the OS - // platform. - ACE_TCHAR *s = ACE_OS::strrchr (searchfilename, '.'); - - const ACE_TCHAR *dll_suffix = ACE_DLL_SUFFIX; - - if (s != 0) - { - // If we have a dot, we have a suffix - has_suffix = true; - - // Check whether this matches the appropriate platform-specific - // suffix. -#if defined (ACE_WIN32) - // Use on any platform with - // case-insensitive filenames. - if (ACE_OS::strcasecmp (s, dll_suffix) != 0) -#else - if (ACE_OS::strcmp (s, dll_suffix) != 0) -#endif /* ACE_WIN32 */ - { - ACE_ERROR ((LM_WARNING, - ACE_TEXT ("Warning: improper suffix for a ") - ACE_TEXT ("shared library on this platform: %s\n"), - s)); - } - } - - // Make sure we've got enough space in searchfilename. - if (ACE_OS::strlen (searchfilename) - + ACE_OS::strlen (ACE_DLL_PREFIX) - + (has_suffix ? 0 : ACE_OS::strlen (dll_suffix)) - >= (sizeof searchfilename / sizeof (ACE_TCHAR))) - { - errno = ENOMEM; - return -1; - } - -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - size_t len_searchfilename = ACE_OS::strlen (searchfilename); - if (! has_suffix) - ACE_OS::strcpy (searchfilename + len_searchfilename, - decorator); - - for (int tag = 1; tag >= 0; tag --) - { - if (tag == 0) - searchfilename [len_searchfilename] = 0; - -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ - // Use absolute pathname if there is one. - if (ACE_OS::strlen (searchpathname) > 0) - { - if (ACE_OS::strlen (searchfilename) - + ACE_OS::strlen (searchpathname) >= maxpathnamelen) - { - errno = ENOMEM; - return -1; - } - else - { -#if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') - // Revert to native path name separators. - ACE::strrepl (searchpathname, - '/', - ACE_DIRECTORY_SEPARATOR_CHAR); -#endif /* ACE_DIRECTORY_SEPARATOR_CHAR */ - // First, try matching the filename *without* adding a - // prefix. - ACE_OS::sprintf (pathname, - ACE_TEXT ("%s%s%s"), - searchpathname, - searchfilename, - has_suffix ? ACE_TEXT ("") : dll_suffix); - if (ACE_OS::access (pathname, F_OK) == 0) - return 0; - - // Second, try matching the filename *with* adding a prefix. - ACE_OS::sprintf (pathname, - ACE_TEXT ("%s%s%s%s"), - searchpathname, - ACE_DLL_PREFIX, - searchfilename, - has_suffix ? ACE_TEXT ("") : dll_suffix); - if (ACE_OS::access (pathname, F_OK) == 0) - return 0; - } - } - - // Use relative filenames via LD_LIBRARY_PATH or PATH (depending on - // OS platform). - else - { -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) - ACE_TCHAR *file_component = 0; - DWORD pathlen = - ACE_TEXT_SearchPath (0, - searchfilename, - dll_suffix, - static_cast (maxpathnamelen), - pathname, - &file_component); - if (pathlen >= maxpathnamelen) - { - errno = ENOMEM; - return -1; - } - else if (pathlen > 0) - return 0; - - // In case not found we should try again with the ACE_DLL_PREFIX - // prefixed - ACE_OS::strcpy (searchfilename, ACE_DLL_PREFIX); - ACE_OS::strcat (searchfilename, tempcopy); - pathlen = - ACE_TEXT_SearchPath (0, - searchfilename, - dll_suffix, - static_cast (maxpathnamelen), - pathname, - &file_component); - if (pathlen >= maxpathnamelen) - { - errno = ENOMEM; - return -1; - } - else if (pathlen > 0) - return 0; -#else - ACE_TCHAR *ld_path; -# if defined ACE_DEFAULT_LD_SEARCH_PATH - ld_path = ACE_DEFAULT_LD_SEARCH_PATH; -# else -# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - ld_path = ACE_OS::getenv (ACE_LD_SEARCH_PATH); -# else - // Wide-char, non-Windows only offers char * getenv. So capture - // it, translate to wide-char, and continue. - ACE_Ascii_To_Wide wide_ldpath - (ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (ACE_LD_SEARCH_PATH))); - ld_path = wide_ldpath.wchar_rep (); -# endif /* ACE_WIN32 || !ACE_USES_WCHAR */ -# endif /* ACE_DEFAULT_LD_SEARCH_PATH */ - -#if defined (ACE_HAS_WINCE) - ACE_TCHAR *ld_path_temp = 0; - if (ld_path != 0) - { - ld_path_temp = (ACE_TCHAR *) - ACE_OS::malloc ((ACE_OS::strlen (ld_path) + 2) - * sizeof (ACE_TCHAR)); - if (ld_path_temp != 0) - { - ACE_OS::strcpy (ld_path_temp, - ACE_LD_SEARCH_PATH_SEPARATOR_STR); - - ACE_OS::strcat (ld_path_temp, ld_path); - ld_path = ld_path_temp; - } - else - { - ACE_OS::free ((void *) ld_path_temp); - ld_path = ld_path_temp = 0; - } - } -#endif /* ACE_HAS_WINCE */ - - if (ld_path != 0 - && (ld_path = ACE_OS::strdup (ld_path)) != 0) - { - // strtok has the strange behavior of not separating the - // string ":/foo:/bar" into THREE tokens. One would expect - // that the first iteration the token would be an empty - // string, the second iteration would be "/foo", and the - // third iteration would be "/bar". However, this is not - // the case; one only gets two iterations: "/foo" followed - // by "/bar". - - // This is especially a problem in parsing Unix paths - // because it is permissible to specify 'the current - // directory' as an empty entry. So, we introduce the - // following special code to cope with this: - - // Look at each dynamic lib directory in the search path. - - ACE_TCHAR *nextholder = 0; - const ACE_TCHAR *path_entry = - ACE::strsplit_r (ld_path, - ACE_LD_SEARCH_PATH_SEPARATOR_STR, - nextholder); - int result = 0; - - for (;;) - { - // Check if at end of search path. - if (path_entry == 0) - { - errno = ENOENT; - result = -1; - break; - } - else if (ACE_OS::strlen (path_entry) - + 1 - + ACE_OS::strlen (searchfilename) - >= maxpathnamelen) - { - errno = ENOMEM; - result = -1; - break; - } - // This works around the issue where a path might have - // an empty component indicating 'current directory'. - // We need to do it here rather than anywhere else so - // that the loop condition will still work. - else if (path_entry[0] == '\0') - path_entry = ACE_TEXT ("."); - - // First, try matching the filename *without* adding a - // prefix. - ACE_OS::sprintf (pathname, - ACE_TEXT ("%s%c%s%s"), - path_entry, - ACE_DIRECTORY_SEPARATOR_CHAR, - searchfilename, - has_suffix ? ACE_TEXT ("") : dll_suffix); - if (ACE_OS::access (pathname, F_OK) == 0) - break; - - // Second, try matching the filename *with* adding a - // prefix. - ACE_OS::sprintf (pathname, - ACE_TEXT ("%s%c%s%s%s"), - path_entry, - ACE_DIRECTORY_SEPARATOR_CHAR, - ACE_DLL_PREFIX, - searchfilename, - has_suffix ? ACE_TEXT ("") : dll_suffix); - if (ACE_OS::access (pathname, F_OK) == 0) - break; - - // Fetch the next item in the path - path_entry = - ACE::strsplit_r (0, - ACE_LD_SEARCH_PATH_SEPARATOR_STR, - nextholder); - } - -#if defined (ACE_HAS_WINCE) - if (ld_path_temp != 0) - ACE_OS::free (ld_path_temp); -#endif /* ACE_HAS_WINCE */ - ACE_OS::free ((void *) ld_path); -#if defined (ACE_HAS_WINCE) && defined (ACE_LD_DECORATOR_STR) && \ - !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - if (result == 0 || tag == 0) -#endif /* ACE_HAS_WINCE && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ - return result; - } -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ - } -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - } -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ - - errno = ENOENT; - return -1; -} - -FILE * -ACE::ldopen (const ACE_TCHAR *filename, - const ACE_TCHAR *type) -{ - ACE_TRACE ("ACE::ldopen"); - - ACE_TCHAR buf[MAXPATHLEN + 1]; - if (ACE::ldfind (filename, - buf, - sizeof (buf) /sizeof (ACE_TCHAR)) == -1) - return 0; - else - return ACE_OS::fopen (buf, type); -} - -ACE_TCHAR * -ACE::ldname (const ACE_TCHAR *entry_point) -{ - ACE_TRACE ("ACE::ldname"); - -#if defined(ACE_NEEDS_DL_UNDERSCORE) - size_t size = - 1 // leading '_' - + ACE_OS::strlen (entry_point) - + 1; - - ACE_TCHAR *new_name; - ACE_NEW_RETURN (new_name, - ACE_TCHAR[size], - 0); - - ACE_OS::strcpy (new_name, ACE_TEXT ("_")); - ACE_OS::strcat (new_name, entry_point); - - return new_name; -#else /* ACE_NEEDS_DL_UNDERSCORE */ - size_t size = - ACE_OS::strlen (entry_point) - + 1; - - ACE_TCHAR *new_name; - ACE_NEW_RETURN (new_name, - ACE_TCHAR[size], - 0); - - ACE_OS::strcpy (new_name, entry_point); - return new_name; -#endif /* ACE_NEEDS_DL_UNDERSCORE */ -} - -#if defined (ACE_OPENVMS) -void -ACE::ldregister (const ACE_TCHAR *entry_point, - void* entry_addr) -{ - ACE_LD_SYMBOL_REGISTRY::instance ()->register_symbol (entry_point, - entry_addr); -} - -void * -ACE::ldsymbol (ACE_SHLIB_HANDLE sh, const ACE_TCHAR *entry_point) -{ - void* symaddr = ACE_OS::dlsym (sh, entry_point); - // if not found through dlsym() try registry - if (symaddr == 0) - symaddr = ACE_LD_SYMBOL_REGISTRY::instance ()->find_symbol (entry_point); - - return symaddr; -} -#endif - -int -ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) -{ - int result; -#if defined (ACE_WIN32) - result = ACE_TEXT_GetTempPath (static_cast (buffer_len), - buffer); - - // Make sure to return -1 if there is an error - if (result == 0 && ::GetLastError () != ERROR_SUCCESS - || result > static_cast (buffer_len)) - result = -1; - -#else /* ACE_WIN32 */ - - // NOTE! Non-Windows platforms don't deal with wide chars for env. - // variables, so do this narrow-char and convert to wide for the - // caller if necessary. - - // On non-win32 platforms, check to see what the TMPDIR environment - // variable is defined to be. If it doesn't exist, just use /tmp - const char *tmpdir = ACE_OS::getenv ("TMPDIR"); - - if (tmpdir == 0) - tmpdir = "/tmp"; - - size_t len = ACE_OS::strlen (tmpdir); - - // Check to see if the buffer is large enough for the string, - // another /, and its null character (hence the + 2) - if ((len + 2) > buffer_len) - { - result = -1; - } - else - { - ACE_OS::strcpy (buffer, ACE_TEXT_CHAR_TO_TCHAR (tmpdir)); - - // Add a trailing slash because we cannot assume there is already one - // at the end. And having an extra one should not cause problems. - buffer[len] = ACE_TEXT ('/'); - buffer[len + 1] = 0; - result = 0; - } -#endif /* ACE_WIN32 */ - return result; -} - -ACE_HANDLE -ACE::open_temp_file (const ACE_TCHAR *name, int mode, int perm) -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (perm); - ACE_HANDLE handle = ACE_OS::open (name, - mode, - FILE_SHARE_READ - | FILE_SHARE_WRITE - | FILE_SHARE_DELETE); -#else - // Open it. - ACE_HANDLE handle = ACE_OS::open (name, mode, perm); -#endif /* ACE_WIN32 */ - - if (handle == ACE_INVALID_HANDLE) - return ACE_INVALID_HANDLE; - - // Unlink it so that the file will be removed automatically when the - // process goes away. - if (ACE_OS::unlink (name) == -1) - return ACE_INVALID_HANDLE; - else - // Return the handle. - return handle; -} - -size_t -ACE::strrepl (char *s, char search, char replace) -{ - ACE_TRACE ("ACE::strrepl"); - - size_t replaced = 0; - - for (size_t i = 0; s[i] != '\0'; i++) - if (s[i] == search) - { - s[i] = replace; - ++replaced; - } - - return replaced; -} - -// Split a string up into 'token'-delimited pieces, ala Perl's -// "split". - -char * -ACE::strsplit_r (char *str, - const char *token, - char *&next_start) -{ - char *result = 0; - - if (str != 0) - next_start = str; - - if (next_start != 0) - { - char *tok_loc = ACE_OS::strstr (next_start, token); - - if (tok_loc != 0) - { - // Return the beginning of the string. - result = next_start; - - // Insure it's terminated. - *tok_loc = '\0'; - next_start = tok_loc + ACE_OS::strlen (token); - } - else - { - result = next_start; - next_start = (char *) 0; - } - } - - return result; -} - -#if defined (ACE_HAS_WCHAR) -wchar_t * -ACE::strsplit_r (wchar_t *str, - const wchar_t *token, - wchar_t *&next_start) -{ - wchar_t *result = 0; - - if (str != 0) - next_start = str; - - if (next_start != 0) - { - wchar_t *tok_loc = ACE_OS::strstr (next_start, token); - - if (tok_loc != 0) - { - // Return the beginning of the string. - result = next_start; - - // Insure it's terminated. - *tok_loc = '\0'; - next_start = tok_loc + ACE_OS::strlen (token); - } - else - { - result = next_start; - next_start = (wchar_t *) 0; - } - } - - return result; -} - -size_t -ACE::strrepl (wchar_t *s, wchar_t search, wchar_t replace) -{ - ACE_TRACE ("ACE::strrepl"); - - size_t replaced = 0; - - for (size_t i = 0; s[i] != '\0'; i++) - if (s[i] == search) - { - s[i] = replace; - ++replaced; - } - - return replaced; -} -#endif /* ACE_HAS_WCHAR */ - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Local_Memory_Pool.cpp b/dep/src/ace/Local_Memory_Pool.cpp deleted file mode 100644 index ebec0ad75aa..00000000000 --- a/dep/src/ace/Local_Memory_Pool.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// $Id: Local_Memory_Pool.cpp 80826 2008-03-04 14:51:23Z wotte $ - -// Local_Memory_Pool.cpp -#include "ace/Local_Memory_Pool.h" -#include "ace/Auto_Ptr.h" -#include "ace/OS_Memory.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(ace, Local_Memory_Pool, "$Id: Local_Memory_Pool.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Local_Memory_Pool) - -void -ACE_Local_Memory_Pool::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Local_Memory_Pool::dump"); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Local_Memory_Pool::ACE_Local_Memory_Pool (const ACE_TCHAR *, - const OPTIONS *) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::ACE_Local_Memory_Pool"); -} - -ACE_Local_Memory_Pool::~ACE_Local_Memory_Pool (void) -{ - // Free up all memory allocated by this pool. - this->release (); -} - -// Ask system for initial chunk of local memory. -void * -ACE_Local_Memory_Pool::init_acquire (size_t nbytes, - size_t &rounded_bytes, - int &first_time) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::init_acquire"); - // Note that we assume that when ACE_Local_Memory_Pool is used, - // ACE_Malloc's constructor will only get called once. If this - // assumption doesn't hold, we are in deep trouble! - - first_time = 1; - return this->acquire (nbytes, rounded_bytes); -} - -void * -ACE_Local_Memory_Pool::acquire (size_t nbytes, - size_t &rounded_bytes) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::acquire"); - rounded_bytes = this->round_up (nbytes); - - char *temp = 0; - ACE_NEW_RETURN (temp, - char[rounded_bytes], - 0); - - ACE_Auto_Basic_Array_Ptr cp (temp); - - if (this->allocated_chunks_.insert (cp.get ()) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) insertion into set failed\n")), - 0); - - return cp.release (); -} - -int -ACE_Local_Memory_Pool::release (int) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::release"); - - // Zap the memory we allocated. - for (ACE_Unbounded_Set::iterator i = this->allocated_chunks_.begin (); - i != this->allocated_chunks_.end (); - ++i) - delete [] *i; - this->allocated_chunks_.reset (); - return 0; -} - -int -ACE_Local_Memory_Pool::sync (ssize_t, int) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::sync"); - return 0; -} - -int -ACE_Local_Memory_Pool::sync (void *, size_t, int) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::sync"); - return 0; -} - -int -ACE_Local_Memory_Pool::protect (ssize_t, int) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::protect"); - return 0; -} - -int -ACE_Local_Memory_Pool::protect (void *, size_t, int) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::protect"); - return 0; -} - -#if defined (ACE_WIN32) -int -ACE_Local_Memory_Pool::seh_selector (void *) -{ - return 0; - // Continue propagate the structural exception up. -} -#endif /* ACE_WIN32 */ - -int -ACE_Local_Memory_Pool::remap (void *) -{ - return 0; - // Not much can be done. -} - -void * -ACE_Local_Memory_Pool::base_addr (void) const -{ - return 0; -} - -// Let the underlying new operator figure out the alignment... -size_t -ACE_Local_Memory_Pool::round_up (size_t nbytes) -{ - ACE_TRACE ("ACE_Local_Memory_Pool::round_up"); - return ACE::round_to_pagesize (nbytes); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Local_Name_Space.cpp b/dep/src/ace/Local_Name_Space.cpp deleted file mode 100644 index deba2ab215d..00000000000 --- a/dep/src/ace/Local_Name_Space.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include "ace/Local_Name_Space.h" -#include "ace/ACE.h" -#include "ace/RW_Process_Mutex.h" -#include "ace/SString.h" -#include "ace/OS_NS_string.h" -#include "ace/Truncate.h" - -ACE_RCSID (ace, - Local_Name_Space, - "$Id: Local_Name_Space.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_NS_String::~ACE_NS_String (void) -{ - if (this->delete_rep_) - delete [] this->rep_; -} - -ACE_WCHAR_T * -ACE_NS_String::fast_rep (void) const -{ - ACE_TRACE ("ACE_NS_String::fast_rep"); - return this->rep_; -} - -ACE_NS_String::operator ACE_NS_WString () const -{ - ACE_TRACE ("ACE_NS_String::operator ACE_NS_WString"); - return ACE_NS_WString (this->rep_, - (this->len_ / sizeof (ACE_WCHAR_T)) - 1); -} - -size_t -ACE_NS_String::len (void) const -{ - ACE_TRACE ("ACE_NS_String::len"); - return this->len_; -} - -char * -ACE_NS_String::char_rep (void) const -{ - ACE_TRACE ("ACE_NS_String::char_rep"); - ACE_NS_WString w_string (this->rep_, - (this->len_ / sizeof (ACE_WCHAR_T)) - 1); - return w_string.char_rep (); -} - -ACE_NS_String::ACE_NS_String (void) - : len_ (0), - rep_ (0), - delete_rep_ (false) -{ - ACE_TRACE ("ACE_NS_String::ACE_NS_String"); -} - -ACE_NS_String::ACE_NS_String (const ACE_NS_WString &s) - : len_ ((s.length () + 1) * sizeof (ACE_WCHAR_T)), - rep_ (s.rep ()), - delete_rep_ (true) -{ - ACE_TRACE ("ACE_NS_String::ACE_NS_String"); -} - -int -ACE_NS_String::strstr (const ACE_NS_String &s) const -{ - ACE_TRACE ("ACE_NS_String::strstr"); - - if (this->len_ < s.len_) - // If they're larger than we are they can't be a substring of us! - return -1; - else if (this->len_ == s.len_) - // Check if we're equal. - return *this == s ? 0 : -1; - else - { - // They're smaller than we are... - const size_t len = (this->len_ - s.len_) / sizeof (ACE_WCHAR_T); - const size_t pat_len = s.len_ / sizeof (ACE_WCHAR_T) - 1; - - for (size_t i = 0; i <= len; ++i) - { - size_t j; - - for (j = 0; j < pat_len; ++j) - if (this->rep_[i + j] != s.rep_[j]) - break; - - if (j == pat_len) - // Found a match! Return the index. - return ACE_Utils::truncate_cast (i); - } - - return -1; - } -} - -bool -ACE_NS_String::operator == (const ACE_NS_String &s) const -{ - ACE_TRACE ("ACE_NS_String::operator =="); - return this->len_ == s.len_ - && ACE_OS::memcmp ((void *) this->rep_, - (void *) s.rep_, this->len_) == 0; -} - -bool -ACE_NS_String::operator != (const ACE_NS_String &s) const -{ - ACE_TRACE ("ACE_NS_String::operator !="); - return !this->operator == (s); -} - -ACE_NS_String::ACE_NS_String (ACE_WCHAR_T *dst, - const ACE_WCHAR_T *src, - size_t bytes) - : len_ (bytes), - rep_ (dst), - delete_rep_ (false) -{ - ACE_TRACE ("ACE_NS_String::ACE_NS_String"); - ACE_OS::memcpy (this->rep_, src, bytes); -} - -u_long -ACE_NS_String::hash (void) const -{ - return ACE::hash_pjw - (reinterpret_cast (const_cast (this->rep_)), - this->len_); -} - -ACE_NS_Internal::ACE_NS_Internal (void) - : value_ (), - type_ () -{ -} - -ACE_NS_Internal::ACE_NS_Internal (ACE_NS_String &value, const char *type) - : value_ (value), - type_ (type) -{ - ACE_TRACE ("ACE_NS_Internal::ACE_NS_Internal"); -} - -bool -ACE_NS_Internal::operator == (const ACE_NS_Internal &s) const -{ - ACE_TRACE ("ACE_NS_Internal::operator =="); - return this->value_ == s.value_; -} - -ACE_NS_String -ACE_NS_Internal::value (void) -{ - ACE_TRACE ("ACE_NS_Internal::value"); - return this->value_; -} - -const char * -ACE_NS_Internal::type (void) -{ - ACE_TRACE ("ACE_NS_Internal::type"); - return this->type_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Local_Name_Space_T.cpp b/dep/src/ace/Local_Name_Space_T.cpp deleted file mode 100644 index 1c249586767..00000000000 --- a/dep/src/ace/Local_Name_Space_T.cpp +++ /dev/null @@ -1,967 +0,0 @@ -// $Id: Local_Name_Space_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_LOCAL_NAME_SPACE_T_CPP -#define ACE_LOCAL_NAME_SPACE_T_CPP - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Local_Name_Space.h" -#include "ace/Auto_Ptr.h" -#include "ace/Guard_T.h" -#include "ace/OS_NS_regex.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_unistd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template -ACE_Name_Space_Map::ACE_Name_Space_Map (ALLOCATOR *alloc) - : MAP_MANAGER (alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::ACE_Name_Space_Map"); -} - -template int -ACE_Name_Space_Map::close (ALLOCATOR *alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::close"); - - this->table_allocator_ = alloc; - this->entry_allocator_ = alloc; - return this->close_i (); -} - -template int -ACE_Name_Space_Map::bind (const ACE_NS_String &ext_id, - const ACE_NS_Internal &int_id, - ALLOCATOR *alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::bind"); - - this->table_allocator_ = alloc; - this->entry_allocator_ = alloc; - return this->bind_i (ext_id, int_id); -} - -template int -ACE_Name_Space_Map::unbind (const ACE_NS_String &ext_id, - ACE_NS_Internal &int_id, - ALLOCATOR *alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::unbind"); - - this->table_allocator_ = alloc; - this->entry_allocator_ = alloc; - return this->unbind_i (ext_id, int_id); -} - -template int -ACE_Name_Space_Map::rebind (const ACE_NS_String &ext_id, - const ACE_NS_Internal &int_id, - ACE_NS_String &old_ext_id, - ACE_NS_Internal &old_int_id, - ALLOCATOR *alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::rebind"); - - this->table_allocator_ = alloc; - this->entry_allocator_ = alloc; - return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id); -} - -template int -ACE_Name_Space_Map::find (const ACE_NS_String &ext_id, - ACE_NS_Internal &int_id, - ALLOCATOR *alloc) -{ - ACE_TRACE ("ACE_Name_Space_Map::find"); - - this->table_allocator_ = alloc; - this->entry_allocator_ = alloc; - return this->find_i (ext_id, int_id); -} - -#if defined (ACE_WIN32) -template int -ACE_Local_Name_Space::remap (EXCEPTION_POINTERS *ep) -{ - ACE_TRACE ("ACE_Local_Name_Space::remap"); - - void *addr = (void *) ep->ExceptionRecord->ExceptionInformation[1]; - - // The following requires Memory Pool to have ::remap() - // defined. Thus currently this will only work for - // ACE_MMap_Memory_Pool. - if (this->allocator_->alloc ().memory_pool ().remap (addr) == -1) - // Kick it upstairs... - return EXCEPTION_CONTINUE_SEARCH; - -#if __X86__ - // This is 80x86-specific. - ep->ContextRecord->Edi = (DWORD) addr; -#elif __MIPS__ - ep->ContextRecord->IntA0 = - ep->ContextRecord->IntV0 = (DWORD) addr; - ep->ContextRecord->IntT5 = ep->ContextRecord->IntA0 + 3; -#endif /* __X86__ */ - // Resume execution at the original point of "failure." - return EXCEPTION_CONTINUE_EXECUTION; -} -#endif /* ACE_WIN32 */ - -template int -ACE_Local_Name_Space::shared_bind ( - const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type, - int rebind) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->shared_bind_i (name, value, type, rebind); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space::shared_bind_i ( - const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type, - int rebind) -{ - - ACE_TRACE ("ACE_Local_Name_Space::shared_bind_i"); - const size_t name_len = (name.length () + 1) * sizeof (ACE_WCHAR_T); - const size_t value_len = (value.length () + 1) * sizeof (ACE_WCHAR_T); - const size_t type_len = ACE_OS::strlen (type) + 1; - const size_t total_len = name_len + value_len + type_len; - char *ptr = (char *) this->allocator_->malloc (total_len); - - if (ptr == 0) - return -1; - else - { - // Note that the value_rep *must* come first to make sure we can - // retrieve this pointer later on in unbind(). - ACE_WCHAR_T *value_rep = (ACE_WCHAR_T *) (ptr); - ACE_WCHAR_T *name_rep = (ACE_WCHAR_T *) (ptr + value_len); - char *new_type = (char *) (ptr + value_len + name_len); - - ACE_Auto_Basic_Array_Ptr name_urep (name.rep ()); - ACE_Auto_Basic_Array_Ptr value_urep (value.rep ()); - ACE_NS_String new_name (name_rep, name_urep.get (), name_len); - ACE_NS_String new_value (value_rep, value_urep.get (), value_len); - - ACE_OS::strcpy (new_type, type); - ACE_NS_Internal new_internal (new_value, new_type); - int result = -1; - - if (rebind == 0) - { - // Do a normal bind. This will fail if there's already an - // with the same name. - result = this->name_space_map_->bind (new_name, - new_internal, - this->allocator_); - - if (result == 1) - { - // Entry already existed so bind failed. Free our - // dynamically allocated memory. - this->allocator_->free ((void *) ptr); - return result; - } - } - else - { - // Do a rebind. If there's already any entry, this will - // return the existing and and - // overwrite the existing name binding. - ACE_NS_String old_name; - ACE_NS_Internal old_internal; - - result = this->name_space_map_->rebind (new_name, new_internal, - old_name, old_internal, - this->allocator_); - if (result == 1) - { - // Free up the memory we allocated in shared_bind(). - // Note that this assumes that the "value" pointer comes - // first and that the value, name, and type are - // contiguously allocated (see above for details) - this->allocator_->free ((void *) (old_internal.value ()).fast_rep ()); - } - } - - if (result == -1) - // Free our dynamically allocated memory. - this->allocator_->free ((void *) ptr); - else - // If bind() or rebind() succeed, they will automatically sync - // up the map manager entry. However, we must sync up our - // name/value memory. - this->allocator_->sync (ptr, total_len); - - return result; - } -} - -template int -ACE_Local_Name_Space::unbind ( - const ACE_NS_WString &name) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->unbind_i (name); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; - -} - -template int -ACE_Local_Name_Space::unbind_i ( - const ACE_NS_WString &name) -{ - ACE_TRACE ("ACE_Local_Name_Space::unbind_i"); - - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - ACE_NS_String ns_name (name); - ACE_NS_Internal ns_internal; - if (this->name_space_map_->unbind (ns_name, - ns_internal, - this->allocator_) != 0) - return -1; - - // Free up the memory we allocated in shared_bind(). Note that this - // assumes that the "value" pointer comes first and that the value, - // name and type are contiguously allocated (see shared_bind() for - // details) - this->allocator_->free ((void *) (ns_internal.value ()).fast_rep ()); - return 0; -} - -template int -ACE_Local_Name_Space::bind ( - const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type) -{ - ACE_TRACE ("ACE_Local_Name_Space::bind"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - return this->shared_bind (name, value, type, 0); -} - -template int -ACE_Local_Name_Space::rebind ( - const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type) -{ - ACE_TRACE ("ACE_Local_Name_Space::rebind"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - return this->shared_bind (name, value, type, 1); -} - -template int -ACE_Local_Name_Space::resolve ( - const ACE_NS_WString &name, - ACE_NS_WString &value, - char *&type) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->resolve_i (name, value, type); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - - -template int -ACE_Local_Name_Space::resolve_i ( - const ACE_NS_WString &name, - ACE_NS_WString &value, - char *&type) -{ - ACE_TRACE ("ACE_Local_Name_Space::resolve_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - ACE_NS_String ns_name (name); - ACE_NS_Internal ns_internal; - ACE_NS_String nbc_string; // Note the classy variable name! :) - - if (this->name_space_map_->find (ns_name, - ns_internal, - this->allocator_) != 0) - return -1; - - // Calls conversion operator and then calls the ACE_NS_WString - // assignment operator to get a fresh copy. (*#*(@#&!*@!!*@&( HP - // compiler causes us to add an extra copy explicitly !! :) - nbc_string = ns_internal.value (); - value = nbc_string; - - // Gets type and then the actual reprsentation which is a - // ACE_WCHAR_T - const char *temp = ns_internal.type (); - - size_t len = ACE_OS::strlen (ns_internal.type ()); - // Makes a copy here. Caller needs to call delete to free up - // memory. - char *new_type = 0; - ACE_NEW_RETURN (new_type, - char [len + 1], - -1); - - ACE_OS::strsncpy (new_type, temp, len + 1); - type = new_type; - return 0; -} - -template int -ACE_Local_Name_Space::open ( - ACE_Naming_Context::Context_Scope_Type scope_in) -{ - ACE_TRACE ("ACE_Local_Name_Space::open"); - this->ns_scope_ = scope_in; - - return this->create_manager (); -} - -template -ACE_Local_Name_Space::ACE_Local_Name_Space (void) - : allocator_ (0), - name_space_map_ (0), - name_options_ (0) -{ - ACE_TRACE ("ACE_Local_Name_Space::ACE_Local_Name_Space"); -} - -template -ACE_Local_Name_Space::ACE_Local_Name_Space ( - ACE_Naming_Context::Context_Scope_Type scope_in, - ACE_Name_Options *name_options) - : name_options_ (name_options) -{ - ACE_TRACE ("ACE_Local_Name_Space::ACE_Local_Name_Space"); - if (this->open (scope_in) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Local_Name_Space::ACE_Local_Name_Space"))); -} - -template -ACE_Local_Name_Space::~ACE_Local_Name_Space (void) -{ - ACE_TRACE ("ACE_Local_Name_Space::~ACE_Local_Name_Space"); - - // Remove the map. - delete this->allocator_; - delete this->lock_; -} - -template int -ACE_Local_Name_Space::create_manager (void) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->create_manager_i (); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - - -template int -ACE_Local_Name_Space::create_manager_i (void) -{ - ACE_TRACE ("ACE_Local_Name_Space::create_manager_i"); - // Get directory name - const ACE_TCHAR *dir = this->name_options_->namespace_dir (); - const ACE_TCHAR *database = this->name_options_->database (); - - // Use process name as the file name. - size_t len = ACE_OS::strlen (dir); - len += ACE_OS::strlen (ACE_DIRECTORY_SEPARATOR_STR); - len += ACE_OS::strlen (database) + 1; - - if (len >= MAXNAMELEN + MAXPATHLEN) - { - errno = ENAMETOOLONG; - return -1; - } - - ACE_OS::strcpy (this->context_file_, dir); - ACE_OS::strcat (this->context_file_, ACE_DIRECTORY_SEPARATOR_STR); - ACE_OS::strcat (this->context_file_, database); - - ACE_MEM_POOL_OPTIONS options (this->name_options_->base_address ()); - - ACE_TCHAR lock_name_for_local_name_space [MAXNAMELEN + MAXPATHLEN]; - ACE_TCHAR lock_name_for_backing_store [MAXPATHLEN + MAXNAMELEN]; - const ACE_TCHAR *postfix = database; - - size_t length = 0; - length = sizeof lock_name_for_local_name_space / sizeof (ACE_TCHAR); - ACE_OS::strsncpy (lock_name_for_local_name_space, - dir, - length); - - ACE_OS::strncat (lock_name_for_local_name_space, - ACE_DIRECTORY_SEPARATOR_STR, - length - ACE_OS::strlen (lock_name_for_local_name_space)); - ACE_OS::strncat (lock_name_for_local_name_space, - ACE_TEXT ("name_space_"), - length - ACE_OS::strlen (lock_name_for_local_name_space)); - ACE_OS::strncat (lock_name_for_local_name_space, - postfix, - length - ACE_OS::strlen (lock_name_for_local_name_space)); - - length = sizeof lock_name_for_backing_store / sizeof (ACE_TCHAR); - ACE_OS::strsncpy (lock_name_for_backing_store, - dir, - length); - ACE_OS::strncat (lock_name_for_backing_store, - ACE_DIRECTORY_SEPARATOR_STR, - length - ACE_OS::strlen (lock_name_for_backing_store)); - ACE_OS::strncat (lock_name_for_backing_store, - ACE_TEXT ("backing_store_"), - length - ACE_OS::strlen (lock_name_for_backing_store)); - ACE_OS::strncat (lock_name_for_backing_store, - postfix, - length - ACE_OS::strlen (ACE_TEXT ("backing_store_"))); - - // Create the allocator with the appropriate options. - ACE_NEW_RETURN (this->allocator_, - ALLOCATOR (this->context_file_, - lock_name_for_backing_store, - &options), -1); - - if (ACE_LOG_MSG->op_status ()) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Allocator::Allocator\n")), - -1); - - ACE_NEW_RETURN (this->lock_, - ACE_LOCK (lock_name_for_local_name_space), - -1); - -#if !defined (ACE_LACKS_ACCESS) - // Now check if the backing store has been created successfully - if (ACE_OS::access (this->context_file_, F_OK) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("create_manager\n")), - -1); -#endif /* ACE_LACKS_ACCESS */ - - void *ns_map = 0; - - // This is the easy case since if we find the Name Server Map - // Manager we know it's already initialized. - if (this->allocator_->find (ACE_NAME_SERVER_MAP, ns_map) == 0) - { - this->name_space_map_ = (ACE_Name_Space_Map *) ns_map; - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("name_space_map_ = %@, ns_map = %@\n"), - this->name_space_map_, ns_map)); - } - - // This is the hard part since we have to avoid potential race - // conditions... We will use the double check here - else - { - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - // This is the easy case since if we find the Name Server Map - // Manager we know it's already initialized. - if (this->allocator_->find (ACE_NAME_SERVER_MAP, ns_map) == 0) - { - this->name_space_map_ = (ACE_Name_Space_Map *) ns_map; - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("name_space_map_ = %@, ns_map = %@\n"), - this->name_space_map_, ns_map)); - } - else - { - size_t map_size = sizeof *this->name_space_map_; - ns_map = this->allocator_->malloc (map_size); - - // Initialize the map into its memory location (e.g., shared memory). - this->name_space_map_ = - new (ns_map) ACE_Name_Space_Map (this->allocator_); - - if (this->allocator_->bind (ACE_NAME_SERVER_MAP, ns_map) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("create_manager\n")), -1); - } - - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("name_space_map_ = %@, ns_map = %@\n"), - this->name_space_map_, ns_map)); - } - - return 0; -} - -template int -ACE_Local_Name_Space::list_names_i ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_names_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - int result = 1; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance()) - { - if (map_entry->ext_id_.strstr (pattern) != -1) - { - ACE_NS_WString entry (map_entry->ext_id_ ); - - if (set.insert (entry) == -1) - { - result = -1; - break; - } - else - result = 0; - } - } - - return result; -} - -template int -ACE_Local_Name_Space::list_values_i ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_values_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - int result = 1; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance ()) - { - if (map_entry->int_id_.value ().strstr (pattern) != -1) - { - ACE_NS_WString entry (map_entry->int_id_.value ()); - - if (set.insert (entry) == -1) - { - result = -1; - break; - } - else - result = 0; - } - } - - return result; -} - -template int -ACE_Local_Name_Space::list_types_i ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_types_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - char *compiled_regexp = 0; - - // Note that char_rep() allocates memory so we need to delete it - char *pattern_rep = pattern.char_rep (); - - // Check for wildcard case first. - if (ACE_OS::strcmp ("", pattern_rep) == 0) - ACE_ALLOCATOR_RETURN (compiled_regexp, - ACE_OS::strdup (""), - -1); - else - // Compile the regular expression (the 0's cause ACE_OS::compile - // to allocate space). -#if defined (ACE_HAS_REGEX) - compiled_regexp = ACE_OS::compile (pattern_rep, 0, 0); -#else - // If we don't have regular expressions just use the pattern - // directly. - compiled_regexp = pattern_rep; -#endif /* ACE_HAS_REGEX */ - - int result = 1; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance ()) - { - // Get the type - const char *type = map_entry->int_id_.type (); - - // Everything matches the wildcard. - if (ACE_OS::strcmp ("", pattern_rep) == 0 -#if defined (ACE_HAS_REGEX) - || ACE_OS::step (type, compiled_regexp) != 0) -#else - // If we don't have regular expressions just use strstr() for - // substring matching. - || ACE_OS::strstr (type, compiled_regexp) != 0) -#endif /* ACE_HAS_REGEX */ - - { - ACE_NS_WString entry (type); - - if (set.insert (entry) == -1) - { - result = -1; - break; - } - else - result = 0; - } - } -#if defined (ACE_HAS_REGEX) - if (compiled_regexp) - ACE_OS::free ((void *) compiled_regexp); -#endif /* ACE_HAS_REGEX */ - delete [] pattern_rep; // delete pattern_rep; - return result; -} - -template int -ACE_Local_Name_Space ::list_name_entries_i ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_name_entries_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance()) - { - if (map_entry->ext_id_.strstr (pattern) != -1) - { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); - - if (set.insert (entry) == -1) - return -1; - } - } - - return 0; -} - -template int -ACE_Local_Name_Space::list_value_entries_i ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_value_entries_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance ()) - { - if (map_entry->int_id_.value ().strstr (pattern) != -1) - { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); - - if (set.insert (entry) == -1) - return -1; - } - } - return 0; -} - -template int -ACE_Local_Name_Space::list_type_entries_i ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - ACE_TRACE ("ACE_Local_Name_Space::list_type_entries_i"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - char *compiled_regexp = 0; - // Note that char_rep() allocates memory so we need to delete it - char *pattern_rep = pattern.char_rep (); - - // Check for wildcard case first. - if (ACE_OS::strcmp ("", pattern_rep) == 0) - compiled_regexp = ACE_OS::strdup (""); - else - // Compile the regular expression (the 0's cause ACE_OS::compile - // to allocate space). -#if defined (ACE_HAS_REGEX) - compiled_regexp = ACE_OS::compile (pattern_rep, 0, 0); -#else /* If we don't have regular expressions just the pattern - directly. */ - compiled_regexp = pattern_rep; -#endif /* ACE_HAS_REGEX */ - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance ()) - { - // Get the type. - const char *type = map_entry->int_id_.type (); - - if (ACE_OS::strcmp ("", pattern_rep) == 0 // Everything matches - // the wildcard. -#if defined (ACE_HAS_REGEX) - || ACE_OS::step (type, compiled_regexp) != 0) -#else /* If we don't have regular expressions just use strstr() for - substring matching. */ - || ACE_OS::strstr (type, compiled_regexp) != 0) -#endif /* ACE_HAS_REGEX */ - { - ACE_Name_Binding entry (map_entry->ext_id_, - map_entry->int_id_.value (), - map_entry->int_id_.type ()); - - if (set.insert (entry) == -1) - return -1; - } - } -#if defined (ACE_HAS_REGEX) - if (compiled_regexp) - ACE_OS::free ((void *) compiled_regexp); -#endif /* ACE_HAS_REGEX */ - delete [] pattern_rep; // delete pattern_rep; - return 0; -} - -template void -ACE_Local_Name_Space::dump_i (void) const -{ - ACE_TRACE ("ACE_Local_Name_Space::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); - MAP_MANAGER::ENTRY *map_entry; - - for (map_entry = 0; - map_iterator.next (map_entry) != 0; - map_iterator.advance()) - { - char *key = map_entry->ext_id_.char_rep (); - char *value = map_entry->int_id_.value ().char_rep (); -#if !defined (ACE_NLOGGING) - const char *type = map_entry->int_id_.type (); -#endif /* ! ACE_NLOGGING */ - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("key=%s\nvalue=%s\ntype=%s\n"), - ACE_TEXT_CHAR_TO_TCHAR (key), ACE_TEXT_CHAR_TO_TCHAR (value), ACE_TEXT_CHAR_TO_TCHAR (type))); - // We need to delete key and value since char_rep allocates - // memory for them - delete [] key; - delete [] value; - } - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Local_Name_Space::list_names ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_names_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space::list_values ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_values_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space::list_types ( - ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_types_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space ::list_name_entries ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_name_entries_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space::list_value_entries ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_value_entries_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template int -ACE_Local_Name_Space::list_type_entries ( - ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) -{ - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - int result = 0; - ACE_SEH_TRY - { - result = this->list_type_entries_i (set, pattern); - } - ACE_SEH_EXCEPT (this->remap (GetExceptionInformation ())) - { - } - return result; -} - -template void -ACE_Local_Name_Space::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // Note that we *must* use structured exception handling here - // because (1) we may need to commit virtual memory pages and (2) - // C++ exception handling doesn't support resumption. - - // This should really be a const cast - ACE_Local_Name_Space *fake_this = - (ACE_Local_Name_Space *) this; - ACE_UNUSED_ARG (fake_this); - - ACE_SEH_TRY - { - this->dump_i (); - } - ACE_SEH_EXCEPT (fake_this->remap (GetExceptionInformation ())) - { - } -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LOCAL_NAME_SPACE_T_CPP */ - diff --git a/dep/src/ace/Local_Tokens.cpp b/dep/src/ace/Local_Tokens.cpp deleted file mode 100644 index 248f7dee9c0..00000000000 --- a/dep/src/ace/Local_Tokens.cpp +++ /dev/null @@ -1,1621 +0,0 @@ -// $Id: Local_Tokens.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Local_Tokens.h" - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -#include "ace/Thread.h" -#include "ace/Token_Manager.h" -#include "ace/OS_NS_unistd.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Local_Tokens.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - Local_Tokens, - "$Id: Local_Tokens.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Tokens::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Tokens::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Tokens::dump:\n") - ACE_TEXT (" reference_cont_ = %d\n") - ACE_TEXT (" token_name_ = %s\n"), - reference_count_, token_name_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("waiters_\n"))); - this->waiters_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Tokens::ACE_Tokens (void) - : visited_ (0), - reference_count_ (0) -{ - ACE_TRACE ("ACE_Tokens::ACE_Tokens"); -} - -ACE_Tokens::~ACE_Tokens (void) -{ -} - -void -ACE_Tokens::make_owner (ACE_TPQ_Entry *caller) -{ - this->waiters_.remove (caller); - this->waiters_.enqueue (caller, 0); -} - -ACE_Token_Proxy_Queue * -ACE_Tokens::waiters () -{ - ACE_TRACE ("ACE_Tokens::waiters"); - return &this->waiters_; -} - -int -ACE_Tokens::no_of_waiters () -{ - ACE_TRACE ("ACE_Tokens::no_of_waiters"); - return this->waiters_.size (); -} - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -ACE_Null_Token::ACE_Null_Token (void) -{ -} - -ACE_Null_Token::~ACE_Null_Token (void) -{ -} -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -void -ACE_TPQ_Entry::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_TPQ_Entry::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE_TPQ_Entry::dump:\n") - ACE_TEXT (" nesting_level_ = %d\n") - ACE_TEXT (" client_id_ = %s\n"), - nesting_level_, - client_id_)); - - if (next_ != 0) - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("next:.\n"))); - next_->dump (); - } - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_TPQ_Entry::dump end.\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_TPQ_Entry::ACE_TPQ_Entry (const ACE_Token_Proxy *new_proxy, - const ACE_TCHAR *client_id) - : cond_var_ (lock_), - next_ (0), - // This const typecast is safe. - proxy_ ((ACE_Token_Proxy *) new_proxy), - nesting_level_ (0), - sleep_hook_ (0) -{ - ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry"); - - if (client_id != 0) - this->client_id (client_id); - else - { - // Just make sure we have enough space. - ACE_TCHAR host_name[MAXHOSTNAMELEN]; - ACE_TCHAR name[(sizeof host_name / sizeof (ACE_TCHAR)) + 256]; - ACE_OS::hostname (host_name, sizeof host_name); - - ACE_thread_t thread_id = ACE_Thread::self (); - - // The cast is an attempt to get this to compile (and run, - // hopefully) regardless of the type of ACE_thread_t. - ACE_OS::sprintf (name, - ACE_TEXT ("/%s/%u/%lu"), - host_name, - static_cast (ACE_OS::getpid ()), - *reinterpret_cast (&thread_id)); - - this->client_id (name); - } -} - -ACE_TPQ_Entry::ACE_TPQ_Entry (void) - : cond_var_ (lock_), - proxy_ (0), - nesting_level_ (0), - sleep_hook_ (0) -{ - ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry null const."); -} - -ACE_TPQ_Entry::ACE_TPQ_Entry (const ACE_TPQ_Entry &rhs) -: cond_var_ (lock_) -{ - ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry copy const."); - *this = rhs; -} - -ACE_TPQ_Entry::~ACE_TPQ_Entry (void) -{ - ACE_TRACE ("ACE_TPQ_Entry::~ACE_TPQ_Entry"); -} - -void -ACE_TPQ_Entry::operator= (const ACE_TPQ_Entry& rhs) -{ - ACE_TRACE ("ACE_TPQ_Entry::operator="); - if (&rhs == this) - return; - this->proxy_ = rhs.proxy (); - this->nesting_level_ = rhs.nesting_level (); - this->client_id (rhs.client_id ()); - this->sleep_hook_ = rhs.sleep_hook (); -} - -void -ACE_TPQ_Entry::client_id (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_TPQ_Entry::client_id"); - - if (id == 0) - return; - - ACE_OS::strsncpy (this->client_id_, - (ACE_TCHAR *) id, - ACE_MAXCLIENTIDLEN); -} - -ACE_TSS_TPQ_Entry::~ACE_TSS_TPQ_Entry (void) -{ -} - -void -ACE_TSS_TPQ_Entry::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_TSS_TPQ_Entry::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_TSS_TPQ_Entry::dump:\n") - ACE_TEXT (" client_id_ = %s\n"), - client_id_ == 0 ? ACE_TEXT ("0") : client_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_TPQ_ENTRY::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_TSS_TPQ_Entry::ACE_TSS_TPQ_Entry (const ACE_Token_Proxy *proxy, - const ACE_TCHAR *client_id) -: proxy_ (proxy), - client_id_ (client_id) -{ - ACE_TRACE ("ACE_TSS_TPQ_Entry::ACE_TSS_TPQ_Entry"); -} - -ACE_TPQ_Entry * -ACE_TSS_TPQ_Entry::make_TSS_TYPE (void) const -{ - ACE_TRACE ("ACE_TSS_TPQ_Entry::make_TSS_TYPE"); - ACE_TPQ_Entry *temp; - - ACE_NEW_RETURN (temp, - ACE_TPQ_Entry (this->proxy_, - this->client_id_), - 0); - return temp; -} - -ACE_TSS_TPQ_Entry::operator ACE_TPQ_Entry * (void) -{ -#if !defined (ACE_NO_TSS_TOKENS) - return (ACE_TPQ_Entry *) (*((ACE_TSS *) this)); -#else - // Not sure this is the right thing to do, but it seems to work. - // The base class ALSO has a proxy_ and client_id_ members (weird?) - // which don't get initialised. The following two lines make this - // the same as the subclass, so that the slicing works . - ACE_TPQ_ENTRY::proxy ((ACE_Token_Proxy *)(this->proxy_)); - ACE_TPQ_ENTRY::client_id (this->client_id_); - return (ACE_TPQ_Entry *) this;; -#endif /* !ACE_NO_TSS_TOKENS */ -} - -ACE_TPQ_Iterator::ACE_TPQ_Iterator (ACE_Token_Proxy_Queue &q) - : current_ (q.head_) -{ - ACE_TRACE ("ACE_TPQ_Iterator::ACE_TPQ_Iterator"); -} - -int -ACE_TPQ_Iterator::next (ACE_TPQ_Entry *&next_item) -{ - ACE_TRACE ("ACE_TPQ_Iterator::next"); - - next_item = this->current_; - - return current_ != 0; -} - -int -ACE_TPQ_Iterator::done (void) const -{ - ACE_TRACE ("ACE_TPQ_Iterator::done"); - - return this->current_ == 0; -} - -void -ACE_TPQ_Iterator::advance (void) -{ - ACE_TRACE ("ACE_TPQ_Iterator::advance"); - - if (current_ != 0) - this->current_ = this->current_->next_; -} - -void -ACE_TPQ_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_TPQ_Iterator::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_TPQ_Iterator::dump:\n") - ACE_TEXT (" current_ = %d\n"), - (long) this->current_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("head_ and tail_\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -void -ACE_Token_Proxy_Queue::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Token_Proxy_Queue::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Token_Proxy_Queue::dump:\n") - ACE_TEXT (" size_ = %d\n"), - size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("head_ and tail_\n"))); - if (this->head_ != 0) - this->head_->dump (); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Token_Proxy_Queue::dump end.\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Token_Proxy_Queue::ACE_Token_Proxy_Queue (void) - : head_ (0), - tail_ (0), - size_ (0) -{ - ACE_TRACE ("ACE_Token_Proxy_Queue::ACE_Token_Proxy_Queue"); -} - -void -ACE_Token_Proxy_Queue::enqueue (ACE_TPQ_Entry *tpq, - int position) -{ - ACE_TRACE ("ACE_Token_Proxy_Queue::enqueue"); - tpq->next_ = 0; - - ++this->size_; - - if (this->head_ == 0) - { - // make tpq the entire list - this->head_ = this->tail_ = tpq; - return; - } - - if (position == 0) - { - // make head of list - tpq->next_ = this->head_; - this->head_ = tpq; - return; - } - - if (position == -1) - { - // stick at back of list - this->tail_->next_ = tpq; - this->tail_ = tpq; - return; - } - - // walk through list to insertion point - ACE_TPQ_Entry *temp = head_; - - for (int x = position; - x > 1; - --x) - { - // end of queue? - if (temp->next_ == 0) - break; - // advance pointer - else - temp = temp->next_; - } - - // insert new tpq after temp - tpq->next_ = temp->next_; - temp->next_ = tpq; -} - -void -ACE_Token_Proxy_Queue::dequeue (void) -{ - ACE_TRACE ("ACE_Token_Proxy_Queue::dequeue"); - - if (head_ == 0) - return; - - ACE_TPQ_Entry *temp = this->head_; - - this->head_ = this->head_->next_; - - temp->next_ = 0; - - --this->size_; - - if (this->head_ == 0 && this->size_ != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("incorrect size = %d\n"), - this->size_)); -} - -/* -int -ACE_Token_Proxy_Queue::member (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_Token_Proxy_Queue::member"); - - for (ACE_TPQ_Entry *temp = this->head_; - temp != 0; - temp = temp->next_) - if (ACE_OS::strcmp (temp->client_id (), id) == 0) - // We found it! - return 1; - - // We didn't find it :-( - return 0; -} -*/ - -void -ACE_Token_Proxy_Queue::remove (const ACE_TPQ_Entry *remove_me) -{ - ACE_TRACE ("ACE_Token_Proxy_Queue::remove"); - // sanity - if ((remove_me == 0) || (this->head_ == 0)) - return; - - // is it the head? - if (this->head_ == remove_me) // pointer comparison. - { - this->head_ = this->head_->next_; - if (this->head_ == 0) - this->tail_ = 0; - - --this->size_; - return; - } - - ACE_TPQ_Entry *temp = this->head_; - ACE_TPQ_Entry *previous = 0; - - // is it in the middle or tail? - while (temp != 0) - { - if (temp == remove_me) - { - // previous should never be null since the first if - // conditional should always be false - previous->next_ = temp->next_; - // is it the tail? - if (this->tail_ == temp) - this->tail_ = previous; - - --this->size_; - return; - } - - previous = temp; - temp = temp->next_; - } - - // it wasn't in the list. - return; -} - -void -ACE_Mutex_Token::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Mutex_Token::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Mutex_Token::dump:\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("lock_\n"))); - lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Tokens::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Mutex_Token::dump end.\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_Mutex_Token::ACE_Mutex_Token (const ACE_TCHAR *name) -{ - ACE_TRACE ("ACE_Mutex_Token::ACE_Mutex_Token"); - - ACE_OS::strsncpy (this->token_name_, - name, - ACE_MAXTOKENNAMELEN); -} - -ACE_Mutex_Token::~ACE_Mutex_Token (void) -{ - ACE_TRACE ("ACE_Mutex_Token::~ACE_Mutex_Token"); -} - -int -ACE_Mutex_Token::acquire (ACE_TPQ_Entry *caller, - int ignore_deadlock, - int notify) -{ - ACE_TRACE ("ACE_Mutex_Token::acquire"); - // We need to acquire two locks. This one to ensure that only one - // thread uses this token at a time. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon1, this->lock_, -1); - // This one to ensure an atomic transaction across all tokens. Note - // that this order is crucial too. It's resource coloring for other - // threads which may be calling this same token. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon2, ACE_Token_Manager::instance ()->mutex (), -1); - - // Does _anyone_ own the token? - if (this->owner () == 0) - { - // there are no waiters, so queue as the first waiter (the owner.) - this->waiters_.enqueue (caller, -1); - return 0; // success - } - - // Does the caller already own it? - if (this->is_owner (caller->client_id ())) - { - // Recursive acquisition. - caller->nesting_level (1); - return 0; // success - } - - // Check for deadlock. - if (!ignore_deadlock - && ACE_Token_Manager::instance ()->check_deadlock (caller->proxy ()) == 1) - { - errno = EDEADLK; - ACE_RETURN (-1); - } - - // Someone owns it. Sorry, you're getting queued up at the end of - // the waiter queue. - this->waiters_.enqueue (caller, -1); - - if (notify) - this->owner ()->call_sleep_hook (); - - errno = EWOULDBLOCK; - ACE_RETURN (-1); - - ACE_NOTREACHED (return -1); -} - -int -ACE_Mutex_Token::tryacquire (ACE_TPQ_Entry *caller) -{ - ACE_TRACE ("ACE_Mutex_Token::tryacquire"); - // We need to acquire two locks. This one to ensure that only one - // thread uses this token at a time. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon1, this->lock_, -1); - // This one to ensure an atomic transaction across all tokens. Note - // that this order is crucial too. It's resource coloring for other - // threads which may be calling this same token. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon2, ACE_Token_Manager::instance ()->mutex (), -1); - - // Does _anyone_ own the token? - if (this->owner () == 0) - { - this->waiters_.enqueue (caller, -1); - return 0; // success - } - // Does the caller already own it? - if (this->is_owner (caller->client_id ())) - { - // recursive acquisition - caller->nesting_level (1); - return 0; // success - } - else - // Someone owns it. Fail. - { - errno = EWOULDBLOCK; - ACE_RETURN (-1); - } - - ACE_NOTREACHED (return -1); -} - -int -ACE_Mutex_Token::renew (ACE_TPQ_Entry *caller, - int requeue_position) -{ - ACE_TRACE ("ACE_Mutex_Token::renew"); - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_, -1); - - // Verify that the caller is the owner. - if (this->is_owner (caller->client_id ()) == 0) - { - errno = EACCES; - ACE_RETURN (-1); - } - - // The caller is the owner, so check to see if there are any - // waiters. If not, we just keep the token. == 1 means that there - // is only the owner. - if (this->waiters_.size () == 1 || requeue_position == 0) - return 0; - - // Requeue the caller. - this->waiters_.dequeue (); - - this->waiters_.enqueue (caller, requeue_position); - - // Notify new owner. - if (this->owner () != 0) - this->owner ()->proxy ()->token_acquired (this->owner ()); - - // Tell the caller that the operation would block. - errno = EWOULDBLOCK; - ACE_RETURN (-1); - - ACE_NOTREACHED (return -1); -} - -// Release the current holder of the token (which had -// better be the caller's thread!). - -int -ACE_Mutex_Token::release (ACE_TPQ_Entry *caller) -{ - ACE_TRACE ("ACE_Mutex_Token::release"); - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_, -1); - - // Does anyone own the token? - if (this->owner () == 0) - { - errno = EACCES; - ACE_RETURN (-1); - } - - // Is the caller the owner. - if (this->is_owner (caller->client_id ())) - { - // Check the nesting level. - if (caller->nesting_level () > 0) - caller->nesting_level (-1); - else - { - this->waiters_.dequeue (); - // Notify new owner. - if (this->owner () != 0) - this->owner ()->proxy ()->token_acquired (this->owner ()); - } - } - else - this->remove (caller); - - return 0; -} - -int -ACE_Mutex_Token::owners (OWNER_STACK &stack, - const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_Mutex_Token::owners"); - if (this->owner () != 0) - { - stack.push (this->owner ()); - // If an is specified, return whether it is the owner being - // returned. - if (id != 0) - return this->owner ()->equal_client_id (id); - } - - return 0; -} - -int -ACE_Mutex_Token::is_waiting_for (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_Mutex_Token::is_waiting_for"); - // If there is no owner, or is the owner, return false. - if ((this->owner () == 0) || this->is_owner (id)) - return 0; - - // Step through each waiter looking for . - ACE_TPQ_Iterator iterator (waiters_); - iterator.advance (); - for (ACE_TPQ_Entry *temp = 0; - iterator.next (temp) != 0; - iterator.advance ()) - { - if (temp->equal_client_id (id)) - return 1; - } - - return 0; -} - -int -ACE_Mutex_Token::is_owner (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_Mutex_Token::is_owner"); - // If there is an owner, return whether it is . - if ((this->owner () != 0) && - this->owner ()->equal_client_id (id)) - return 1; - else - return 0; -} - -int -ACE_Mutex_Token::type (void) const -{ - ACE_TRACE ("ACE_Mutex_Token::type"); - return (int) ACE_Tokens::MUTEX; -} - -// ************************************************************ - -int -ACE_RW_Token::type (void) const -{ - ACE_TRACE ("ACE_RW_Token::type"); - return (int) ACE_Tokens::RWLOCK; -} - -void -ACE_RW_Token::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_RW_Token::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_RW_Token::dump:\n") - ACE_TEXT ("num_writers_ = %d\n"), num_writers_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("lock_\n"))); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Tokens::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_RW_Token::dump end.\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -ACE_RW_Token::ACE_RW_Token (const ACE_TCHAR *name) -: num_writers_ (0) -{ - ACE_TRACE ("ACE_RW_Token::ACE_RW_Token"); - - ACE_OS::strsncpy (this->token_name_, - name, - ACE_MAXTOKENNAMELEN); -} - -ACE_RW_Token::~ACE_RW_Token (void) -{ - ACE_TRACE ("ACE_RW_Token::~ACE_RW_Token"); -} - -int -ACE_RW_Token::acquire (ACE_TPQ_Entry *caller, - int ignore_deadlock, - int notify) -{ - ACE_TRACE ("ACE_RW_Token::acquire"); - // We need to acquire two locks. This one to ensure that only one - // thread uses this token at a time. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon1, this->lock_, -1); - // This one to ensure an atomic transaction across all tokens. Note - // that this order is crucial too. It's resource coloring for other - // threads which may be calling this same token. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon2, ACE_Token_Manager::instance ()->mutex (), -1); - - if (caller->proxy ()->type () == ACE_RW_Token::WRITER) - this->num_writers_++; - - // Does _anyone_ own the token? - if (this->owner () == 0) - { - // There are no waiters, so queue as the first waiter (the owner). - this->waiters_.enqueue (caller, -1); - return 0; - } - - // Check for recursive acquisition. - if (this->is_owner (caller->client_id ())) - { - caller->nesting_level (1); - return 0; // Success. - } - - // Reader. - if (caller->proxy ()->type () == ACE_RW_Token::READER) - { - // Are there any writers? - if (this->num_writers_ == 0) - { - // Queue the caller at the end of the queue. - this->waiters_.enqueue (caller, -1); - return 0; - } - // Else failure. - } - - // Failure code. - - // Check for deadlock. - if (!ignore_deadlock && - ACE_Token_Manager::instance ()->check_deadlock (caller->proxy ()) == 1) - { - if (caller->proxy ()->type () == ACE_RW_Token::WRITER) - this->num_writers_--; - errno = EDEADLK; - ACE_RETURN (-1); - } - - // Queue the caller at the end of the queue. - this->waiters_.enqueue (caller, -1); - - if (notify) - { - // If it's a writer, just notify it. - if (this->owner ()->proxy ()->type () == ACE_RW_Token::WRITER) - this->owner ()->call_sleep_hook (); - else - { - // Call back all reader owners. - ACE_TPQ_Entry *temp = this->owner (); - do - { - temp->call_sleep_hook (); - temp = temp->next_; - } - while (temp != 0 && - temp->proxy ()->type () == ACE_RW_Token::READER); - } - } - - errno = EWOULDBLOCK; - ACE_RETURN (-1); - - ACE_NOTREACHED (return -1); -} - -int -ACE_RW_Token::tryacquire (ACE_TPQ_Entry *caller) -{ - ACE_TRACE ("ACE_RW_Token::tryacquire"); - // We need to acquire two locks. This one to ensure that only one - // thread uses this token at a time. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon1, this->lock_, -1); - // This one to ensure an atomic transaction across all tokens. Note - // that this order is crucial too. It's resource coloring for other - // threads which may be calling this same token. - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon2, ACE_Token_Manager::instance ()->mutex (), -1); - - if (caller->proxy ()->type () == ACE_RW_Token::WRITER) - { - this->num_writers_++; - } - - // Does _anyone_ own the token? - if (this->owner () == 0) - { - // There are no waiters, so queue as the first waiter (the owner). - this->waiters_.enqueue (caller, -1); - return 0; - } - - // Check for recursive acquisition. - if (this->is_owner (caller->client_id ())) - { - caller->nesting_level (1); - return 0; // Success. - } - - // Reader. - if (caller->proxy ()->type () == ACE_RW_Token::READER) - { - // Are there any writers? - if (this->num_writers_ == 0) - { - // queue the caller at the end of the queue. - this->waiters_.enqueue (caller, -1); - return 0; - } - // Else, fail. - } - else // Writer. - // We're going to fail, so decrement the num_writers. - { - this->num_writers_--; - } - - errno = EWOULDBLOCK; - ACE_RETURN (-1); - - ACE_NOTREACHED (return -1); -} - -int -ACE_RW_Token::renew (ACE_TPQ_Entry *caller, - int requeue_position) -{ - ACE_TRACE ("ACE_RW_Token::renew"); - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_, -1); - - // Werify that the caller is the owner - if (this->is_owner (caller->client_id ()) == 0) - { - errno = EACCES; - ACE_RETURN (-1); - } - - // The caller is the owner, so check to see if there are any - // waiters. If not, we just keep the token. - if (this->waiters_.size () == 1 || requeue_position == 0) - return 0; - - // There are waiters, so remove the caller. - this->remove (caller); - - // Requeue the caller. - this->waiters_.enqueue (caller, requeue_position); - - if (caller->proxy ()->type () == ACE_RW_Token::READER) - { - // If the caller got queued before any writers, the caller is - // still the owner. - if (this->is_owner (caller->client_id ())) - return 0; // success - // else fallthrough and return would block. - } - // Writers will always have to block since waiters_.size () == 1 or - // requeue_position == 0. - - // Get a new owner. - this->notify_new_owner (caller); - - // Tell the caller that the operation would block. - errno = EWOULDBLOCK; - ACE_RETURN (-1); - - ACE_NOTREACHED (return -1); -} - -int -ACE_RW_Token::release (ACE_TPQ_Entry *caller) -{ - ACE_TRACE ("ACE_RW_Token::release"); - ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_, -1); - - // Check for errors. - if ((this->owner () == 0) || - (this->is_owner (caller->client_id ()) == 0)) - { - errno = EACCES; - ACE_RETURN (-1); - } - - if (caller->proxy ()->type () == ACE_RW_Token::WRITER) - num_writers_--; - - // Recursive release. - if (caller->nesting_level () > 0) - { - caller->nesting_level (-1); - return 0; - } - - // Remove the caller and notify the new owner(s). - this->remove (caller); - this->notify_new_owner (caller); - - return 0; -} - -void -ACE_RW_Token::notify_new_owner (ACE_TPQ_Entry *old_owner) -{ - ACE_TRACE ("ACE_RW_Token::notify_new_owner"); - - if (this->owner () == 0) - return; - - if (this->owner ()->proxy ()->type () == ACE_RW_Token::READER) - { - if (old_owner->proxy ()->type () == ACE_RW_Token::READER) - // the owners already know that they're owners - return; - - // The current owner is a reader and the previous owner was a - // writer, so notify all waiting readers up to the first writer. - // call back all reader owners. - ACE_TPQ_Iterator iterator (waiters_); - for (ACE_TPQ_Entry *temp = 0; - iterator.next (temp) != 0; - iterator.advance ()) - { - if (temp->proxy ()->type () == WRITER) - // We've gone through all the readers. - break; - - temp->proxy ()->token_acquired (temp); - } - } - else // writer - this->owner ()->proxy ()->token_acquired (this->owner ()); -} - -int -ACE_RW_Token::owners (OWNER_STACK &stack, - const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_RW_Token::owners"); - - if (this->owner () == 0) - return 0; - - int id_is_owner = 0; - - // The first waiter is a writer, so there is only one owner. - if (this->owner ()->proxy ()->type () == WRITER) - { - stack.push (this->owner ()); - // If an is specified, return whether it is the owner being - // returned. - if ((id != 0) && - (ACE_OS::strcmp (id, this->owner ()->client_id ()) == 0)) - id_is_owner = 1; - } - // The first waiter is a reader, so there can be multiple owning - // readers. - else - { - ACE_TPQ_Iterator iterator (waiters_); - for (ACE_TPQ_Entry *temp = 0; - iterator.next (temp) != 0; - iterator.advance ()) - { - if (temp->proxy ()->type () == WRITER) - // We've gone through all the readers. - break; - - stack.push (temp); - - if (!id_is_owner && (id != 0) && - (ACE_OS::strcmp (id, temp->client_id ()) == 0)) - id_is_owner = 1; - } - } - - return id_is_owner; -} - -int -ACE_RW_Token::is_waiting_for (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_RW_Token::is_waiting_for"); - // If there is no owner, or is the owner, return false. - if ((this->owner () == 0) || - this->is_owner (id)) - return 0; - - // Step through each waiter looking for . - ACE_TPQ_Iterator iterator (waiters_); - iterator.advance (); - for (ACE_TPQ_Entry *temp = 0; - iterator.next (temp) != 0; - iterator.advance ()) - { - if (temp->equal_client_id (id)) - return 1; - } - - return 0; -} - -int -ACE_RW_Token::is_owner (const ACE_TCHAR *id) -{ - ACE_TRACE ("ACE_RW_Token::is_owner"); - // If there is no owner, return false. - if (this->owner () == 0) - return 0; - - // A writer owns us. - if (this->owner ()->proxy ()->type () == ACE_RW_Token::WRITER) - return this->owner ()->equal_client_id (id); - - // Readers own us. - // Step through each owning reader looking for . - ACE_TPQ_Iterator iterator (waiters_); - for (ACE_TPQ_Entry *temp = 0; - iterator.next (temp) != 0; - iterator.advance ()) - { - if (temp->proxy ()->type () != ACE_RW_Token::READER) - break; - - if (temp->equal_client_id (id)) - return 1; - } - - return 0; -} - -void -ACE_Token_Proxy::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Token_Proxy::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Token_Proxy::dump:\n") - ACE_TEXT (" type = %d\n") - ACE_TEXT (" ignore_deadlock_ = %d\n") - ACE_TEXT (" debug_ = %d\n"), - (int) this->type (), ignore_deadlock_, debug_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("mutex_, and waiter_\n"))); - - if (this->token_ != 0) - this->token_->dump (); - - this->waiter_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Token_Proxy::dump end.\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -const ACE_TCHAR * -ACE_Token_Proxy::client_id (void) const -{ - ACE_TRACE ("ACE_Token_Proxy::client_id"); - // Thread-specific. - const ACE_TPQ_Entry *temp = this->waiter_.operator->(); - const ACE_TCHAR *id = temp->client_id (); - - if (id == 0) - return ACE_TEXT ("ERROR NO CLIENT ID"); - else - return id; -} - -void -ACE_Token_Proxy::client_id (const ACE_TCHAR *client_id) -{ - ACE_TRACE ("ACE_Token_Proxy::client_id"); - this->waiter_->client_id (client_id); -} - -const ACE_TCHAR * -ACE_Token_Proxy::owner_id (void) -{ - ACE_TRACE ("ACE_Token_Proxy::owner_id"); - return this->token_->owner_id (); -} - -const ACE_TCHAR * -ACE_Token_Proxy::name (void) const -{ - ACE_TRACE ("ACE_Token_Proxy::name"); - return this->token_->name (); -} - -#if defined (ACE_WIN32_VC8) -# pragma warning (push) -# pragma warning (disable:4355) /* Use of 'this' in initializer list */ -#endif -ACE_Token_Proxy::ACE_Token_Proxy (void) -: token_ (0), - waiter_ (this, 0) -{ - ACE_TRACE ("ACE_Token_Proxy::ACE_Token_Proxy"); -} - -// Notice the token_ (0). Do *not* copy the token pointer. This must -// be obtained through the token manager. Also, we don't copy any -// waiter info. A copied Proxy does *not* inherit client_id. - -ACE_Token_Proxy::ACE_Token_Proxy (const ACE_Token_Proxy &) - : token_ (0), - waiter_ (this, 0) -{ - ACE_TRACE ("ACE_Token_Proxy::ACE_Token_Proxy"); -} -#if defined (ACE_WIN32_VC8) -# pragma warning (pop) -#endif - -// @@ should I do a mutex_->release ()? -ACE_Token_Proxy::~ACE_Token_Proxy (void) -{ - ACE_TRACE ("ACE_Token_Proxy::~ACE_Token_Proxy"); - - if (token_ != 0) - // notify token manager that we are done with it so it can - // free it if necessary - ACE_Token_Manager::instance ()->release_token (token_); -} - -int -ACE_Token_Proxy::open (const ACE_TCHAR *token_name, - int ignore_deadlock, - int debug) -{ - ACE_TRACE ("ACE_Token_Proxy::open"); - - // Store some parameters. - this->ignore_deadlock_ = ignore_deadlock; - this->debug_ = debug; - - // Used in case a name was not specified. - ACE_TCHAR name[BUFSIZ]; - - // We must have a name. - if (token_name == 0) - { - ACE_OS::sprintf (name, ACE_TEXT ("token %lx"), - reinterpret_cast (this)); - token_name = name; - } - - // Get or create the underlying token. The Token Manager will call - // us back to set token_. - ACE_Token_Manager::instance ()->get_token (this, token_name); - - // Check for failed get or failed new. - if (this->token_ == 0) - { - errno = ENOMEM; - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Can't allocate mutex")), -1); - } - - return 0; -} - -int -ACE_Token_Proxy::acquire (int notify, - void (*sleep_hook)(void *), - ACE_Synch_Options &options) -{ - ACE_TRACE ("ACE_Token_Proxy::acquire"); - if (this->token_ == 0) - { - errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Not open.\n")), -1); - } - - // Make sure no one calls our token_acquired until we have a chance - // to sleep first! If after we call an EWOULDBLOCK - // mutex_->acquire() below, but before we enter handle_options to - // wait on the cond_var, a thread tries to give take us off the - // waiter queue and signal us, IT WILL FIRST HAVE TO ACQUIRE THIS - // cond_var.mutex (). _This_ is why we acquire it. - this->waiter_->cond_var_.mutex ().acquire (); - - this->waiter_->sleep_hook (sleep_hook); - - if (this->token_->acquire (this->waiter_, this->ignore_deadlock_, notify) == -1) - // acquire failed - { - switch (errno) - { - case EDEADLK : - if (!ignore_deadlock_) - { - waiter_->cond_var_.mutex ().release (); - errno = EDEADLK; - ACE_RETURN (-1); - } - // Else, fallthrough and block! - - case EWOULDBLOCK : - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) waiting for %s, owner is %s, ") - ACE_TEXT ("total waiters == %d\n"), - this->name (), - this->token_->owner_id (), - token_->no_of_waiters ())); - - // no error, but would block, if error, return error (-1), - // otherwise, return whether we called the holder or not. - int return_value; - if (this->handle_options (options, - waiter_->cond_var_) == -1) - return_value = -1; - else - return_value = notify == 1; - - errno = EWOULDBLOCK; - ACE_RETURN (return_value); - - default : - waiter_->cond_var_.mutex ().release (); - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("Token Proxy acquire.")), - -1); - } - } - else - // we have the token - { - if (debug_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) acquired %s\n"), - this->name ())); - waiter_->cond_var_.mutex ().release (); - } - - return 0; -} - -int -ACE_Token_Proxy::tryacquire (void (*sleep_hook)(void *)) -{ - ACE_TRACE ("ACE_Token_Proxy::tryacquire"); - if (this->token_ == 0) - { - errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Not open.\n")), - -1); - } - - this->waiter_->sleep_hook (sleep_hook); - - return this->token_->tryacquire (waiter_); -} - -int -ACE_Token_Proxy::renew (int requeue_position, - ACE_Synch_Options &options) -{ - ACE_TRACE ("ACE_Token_Proxy::renew"); - if (this->token_ == 0) - { - errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Not open.\n")), - -1); - } - - // Make sure no one calls our token_acquired until we have a chance - // to sleep first! - this->waiter_->cond_var_.mutex ().acquire (); - - if (this->token_->renew (this->waiter_, requeue_position) == -1) - { - // check for error - if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p renew failed\n"), ACE_TEXT ("ACE_Token_Proxy")), -1); - - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) renew blocking for %s, owner is %s\n"), - this->name (), - token_->owner_id ())); - - // no error, but would block, so block or return - return this->handle_options (options, waiter_->cond_var_); - } - else - // we have the token - { - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) renewed %s\n"), - this->name ())); - waiter_->cond_var_.mutex ().release (); - return 0; - } -} - -int -ACE_Token_Proxy::handle_options (ACE_Synch_Options &options, - ACE_TOKEN_CONST::COND_VAR &cv) -{ - // Some operation failed with EWOULDBLOCK. - ACE_TRACE ("ACE_Token_Proxy::handle_options"); - - if (options[ACE_Synch_Options::USE_REACTOR] == 1) - // Asynchronous. - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - cv.mutex ().release (); - ACE_RETURN (-1); - } - else - // Synchronous. - { - // Block on condition variable. - while (cv.wait ((ACE_Time_Value *) options.time_value ()) == -1) - { - // Note, this should obey whatever thread-specific - // interrupt policy is currently in place... - if (errno == EINTR) - continue; - // We come here if a timeout occurs or some serious - // ACE_Condition object error. - cv.mutex ().release (); - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("condition variable wait") - ACE_TEXT (" bombed.")), -1); - } - - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) unblocking %s.\n"), - this->client_id ())); - cv.mutex ().release (); - return 0; // operation succeeded - } -} - -int -ACE_Token_Proxy::release (ACE_Synch_Options &) -{ - ACE_TRACE ("ACE_Token_Proxy::release"); - - if (this->token_ == 0) - { - errno = ENOENT; - if (debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Must open before releasing.\n"))); - ACE_RETURN (-1); - } - - if (this->token_->release (waiter_) != 0) - { - // Release failed. - this->token_->remove (this->waiter_); - if (debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) %p.\n"), ACE_TEXT ("release failed"))); - return -1; - } - else - { - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) released %s, owner is %s\n"), - this->name (), - token_->owner_id ())); - - return 0; - } -} - -int -ACE_Token_Proxy::remove (ACE_Synch_Options &) -{ - ACE_TRACE ("ACE_Token_Proxy::remove"); - return 0; -} - -void -ACE_Token_Proxy::sleep_hook (void) -{ - ACE_TRACE ("ACE_Token_Proxy::sleep_hook"); - // Somebody wants our token! (Let'em wait...) - return; -} - -void -ACE_Token_Proxy::token_acquired (ACE_TPQ_Entry *e) -{ - ACE_TRACE ("ACE_Token_Proxy::token_acquired"); - e->cond_var_.mutex ().acquire (); - // We've been taken off the waiters list and given the token! - // This implementation signals the internal condition - // variable. Thus, if asynchronous acquires are used, this must be - // overriden to do something more useful! - e->cond_var_.signal (); - e->cond_var_.mutex ().release (); - - return; -} - -int -ACE_Token_Proxy::type (void) const -{ - ACE_TRACE ("ACE_Token_Proxy::type"); - return 0; -} - -int -ACE_Token_Proxy::acquire_read (int notify, - void (*sleep_hook)(void *), - ACE_Synch_Options &options) -{ - return this->acquire (notify, - sleep_hook, - options); -} - -int -ACE_Token_Proxy::acquire_write (int notify, - void (*sleep_hook)(void *), - ACE_Synch_Options &options) -{ - return this->acquire (notify, - sleep_hook, - options); -} - -int -ACE_Token_Proxy::tryacquire_read (void (*sleep_hook)(void *)) -{ - return this->tryacquire (sleep_hook); -} - -int -ACE_Token_Proxy::tryacquire_write (void (*sleep_hook)(void *)) -{ - return this->tryacquire (sleep_hook); -} - -ACE_Token_Name::ACE_Token_Name (const ACE_TCHAR *token_name) -{ - ACE_TRACE ("ACE_Token_Name::ACE_Token_Name"); - this->name (token_name); -} - -ACE_Token_Name::ACE_Token_Name (const ACE_Token_Name &rhs) -{ - ACE_TRACE ("ACE_Token_Name::ACE_Token_Name"); - this->name (rhs.name ()); -} - -ACE_Token_Name::~ACE_Token_Name () -{ - ACE_TRACE ("ACE_Token_Name::~ACE_Token_Name"); -} - -void -ACE_Token_Name::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Token_Name::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Token_Name::dump:\n") - ACE_TEXT (" token_name_ = %s\n"), - token_name_ == 0 ? ACE_TEXT ("no name") : token_name_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -// ************************************************************ - -ACE_Token_Proxy * -ACE_Local_Mutex::clone (void) const -{ - ACE_Token_Proxy *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Local_Mutex (token_->name (), - ignore_deadlock_, - debug_), - 0); - return temp; -} - -ACE_Tokens * -ACE_Local_Mutex::create_token (const ACE_TCHAR *name) -{ - ACE_Tokens *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Mutex_Token (name), - 0); - return temp; -} - -ACE_Local_Mutex::~ACE_Local_Mutex (void) -{ -} - -// ************************************************************ - -ACE_Local_RLock::~ACE_Local_RLock (void) -{ -} - -ACE_Tokens * -ACE_Local_RLock::create_token (const ACE_TCHAR *name) -{ - ACE_Tokens *temp = 0; - ACE_NEW_RETURN (temp, - ACE_RW_Token (name), - 0); - return temp; -} - -int -ACE_Local_RLock::type (void) const -{ - return ACE_RW_Token::READER; -} - -ACE_Token_Proxy * -ACE_Local_RLock::clone (void) const -{ - ACE_Token_Proxy *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Local_RLock (token_->name (), - ignore_deadlock_, - debug_), - 0); - return temp; -} - -// ************************************************************ - -ACE_Local_WLock::~ACE_Local_WLock (void) -{ -} - -ACE_Tokens * -ACE_Local_WLock::create_token (const ACE_TCHAR *name) -{ - ACE_Tokens *temp = 0; - ACE_NEW_RETURN (temp, - ACE_RW_Token (name), - 0); - return temp; -} - -int -ACE_Local_WLock::type (void) const -{ - return ACE_RW_Token::WRITER; -} - -ACE_Token_Proxy * -ACE_Local_WLock::clone (void) const -{ - ACE_Token_Proxy *temp = 0; - ACE_NEW_RETURN (temp, - ACE_Local_WLock (token_->name (), - ignore_deadlock_, - debug_), - 0); - return temp; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/src/ace/Lock.cpp b/dep/src/ace/Lock.cpp deleted file mode 100644 index f3fd45f4b95..00000000000 --- a/dep/src/ace/Lock.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// $Id: Lock.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Lock.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Lock.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Lock, "$Id: Lock.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Lock::~ACE_Lock (void) -{ -} - -ACE_Adaptive_Lock::ACE_Adaptive_Lock (void) - : lock_ (0) -{ -} - -ACE_Adaptive_Lock::~ACE_Adaptive_Lock (void) -{ -} - -int -ACE_Adaptive_Lock::remove (void) -{ - return this->lock_->remove (); -} - -int -ACE_Adaptive_Lock::acquire (void) -{ - return this->lock_->acquire (); -} - -int -ACE_Adaptive_Lock::tryacquire (void) -{ - return this->lock_->tryacquire (); -} - -int -ACE_Adaptive_Lock::release (void) -{ - return this->lock_->release (); -} - -int -ACE_Adaptive_Lock::acquire_read (void) -{ - return this->lock_->acquire_read (); -} - -int -ACE_Adaptive_Lock::acquire_write (void) -{ - return this->lock_->acquire_write (); -} - -int -ACE_Adaptive_Lock::tryacquire_read (void) -{ - return this->lock_->tryacquire_read (); -} - -int -ACE_Adaptive_Lock::tryacquire_write (void) -{ - return this->lock_->tryacquire_write (); -} - -int -ACE_Adaptive_Lock::tryacquire_write_upgrade (void) -{ - return this->lock_->tryacquire_write_upgrade (); -} - -void -ACE_Adaptive_Lock::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // return this->lock_->dump (); -#endif /* ACE_HAS_DUMP */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Lock_Adapter_T.cpp b/dep/src/ace/Lock_Adapter_T.cpp deleted file mode 100644 index c4685def246..00000000000 --- a/dep/src/ace/Lock_Adapter_T.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// $Id: Lock_Adapter_T.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_LOCK_ADAPTER_T_CPP -#define ACE_LOCK_ADAPTER_T_CPP - -#include "ace/Lock_Adapter_T.h" -#include "ace/OS_Memory.h" // for ACE_NEW - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Lock_Adapter_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// This constructor isn't inlined, because SunPRO C++ 4.2 + patch -// 104631-07 has trouble compiling TAO with it inline. -template -ACE_Lock_Adapter::ACE_Lock_Adapter (void) - : lock_ (0), - delete_lock_ (true) -{ - ACE_NEW (this->lock_, - ACE_LOCKING_MECHANISM); -} - -template -ACE_Lock_Adapter::~ACE_Lock_Adapter (void) -{ - if (this->delete_lock_) - delete this->lock_; -} - -// Explicitly destroy the lock. -template int -ACE_Lock_Adapter::remove (void) -{ - return this->lock_->remove (); -} - -// Block the thread until the lock is acquired. -template int -ACE_Lock_Adapter::acquire (void) -{ - return this->lock_->acquire (); -} - -// Conditionally acquire the lock (i.e., won't block). - -template int -ACE_Lock_Adapter::tryacquire (void) -{ - return this->lock_->tryacquire (); -} - -// Release the lock. - -template int -ACE_Lock_Adapter::release (void) -{ - return this->lock_->release (); -} - -// Block until the thread acquires a read lock. If the locking -// mechanism doesn't support read locks then this just calls -// . - -template int -ACE_Lock_Adapter::acquire_read (void) -{ - return this->lock_->acquire_read (); -} - -// Block until the thread acquires a write lock. If the locking -// mechanism doesn't support read locks then this just calls -// . - -template int -ACE_Lock_Adapter::acquire_write (void) -{ - return this->lock_->acquire_write (); -} - -// Conditionally acquire a read lock. If the locking mechanism -// doesn't support read locks then this just calls . - -template int -ACE_Lock_Adapter::tryacquire_read (void) -{ - return this->lock_->tryacquire_read (); -} - -// Conditionally acquire a write lock. If the locking mechanism -// doesn't support write locks then this just calls . - -template int -ACE_Lock_Adapter::tryacquire_write (void) -{ - return this->lock_->tryacquire_write (); -} - -// Conditionally try to upgrade a lock held for read to a write lock. -// If the locking mechanism doesn't support read locks then this just -// calls . Returns 0 on success, -1 on failure. - -template int -ACE_Lock_Adapter::tryacquire_write_upgrade (void) -{ - return this->lock_->tryacquire_write_upgrade (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_LOCK_ADAPTER_T_CPP */ - diff --git a/dep/src/ace/Log_Msg.cpp b/dep/src/ace/Log_Msg.cpp deleted file mode 100644 index 4040a4b1978..00000000000 --- a/dep/src/ace/Log_Msg.cpp +++ /dev/null @@ -1,2524 +0,0 @@ -// $Id: Log_Msg.cpp 82581 2008-08-11 08:58:24Z johnnyw $ - -// We need this to get the status of ACE_NTRACE... -#include "ace/config-all.h" - -// Turn off tracing for the duration of this file. -#if defined (ACE_NTRACE) -# undef ACE_NTRACE -#endif /* ACE_NTRACE */ -#define ACE_NTRACE 1 - -#include "ace/ACE.h" -#include "ace/Thread_Manager.h" -#include "ace/Guard_T.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_sys_time.h" -#include "ace/OS_NS_wchar.h" -#include "ace/OS_NS_signal.h" - -#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) -# include "ace/Object_Manager_Base.h" -#endif /* ! ACE_MT_SAFE */ - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -// FUZZ: disable check_for_streams_include -# include "ace/streams.h" -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -#if defined (ACE_HAS_TRACE) -# include "ace/Trace.h" -#endif /* ACE_HAS_TRACE */ - -#include "ace/Log_Msg.h" -#include "ace/Log_Msg_Callback.h" -#include "ace/Log_Msg_IPC.h" -#include "ace/Log_Msg_NT_Event_Log.h" -#include "ace/Log_Msg_UNIX_Syslog.h" -#include "ace/Log_Record.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Stack_Trace.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Log_Msg.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Log_Msg, "$Id: Log_Msg.cpp 82581 2008-08-11 08:58:24Z johnnyw $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_Log_Msg) - -// only used here... dhinton -#if defined (ACE_HAS_SYS_SIGLIST) -# if !defined (_sys_siglist) -# define _sys_siglist sys_siglist -# endif /* !defined (sys_siglist) */ -//extern char **_sys_siglist; -#endif /* ACE_HAS_SYS_SIGLIST */ - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - bool ACE_Log_Msg::key_created_ = 0; -# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ - defined (ACE_HAS_TSS_EMULATION) - -#if defined (ACE_MVS) - static ACE_thread_key_t the_log_msg_tss_key = - #if !defined(_LP64) - { '\0','\0','\0','\0' }; - #else - { '\0','\0','\0','\0','\0','\0','\0','\0' }; - #endif -#else - static ACE_thread_key_t the_log_msg_tss_key = 0; -#endif /* defined (ACE_MVS) */ - -ACE_thread_key_t *log_msg_tss_key (void) -{ - return &the_log_msg_tss_key; -} - -# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ -#else -static ACE_Cleanup_Adapter* log_msg_cleanup = 0; -class ACE_Msg_Log_Cleanup: public ACE_Cleanup_Adapter -{ -public: - virtual ~ACE_Msg_Log_Cleanup (void) { - if (this == log_msg_cleanup) - log_msg_cleanup = 0; - } -}; -#endif /* ACE_MT_SAFE */ - -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) -# define ACE_LOG_MSG_SYSLOG_BACKEND ACE_Log_Msg_NT_Event_Log -#elif !defined (ACE_LACKS_UNIX_SYSLOG) && !defined (ACE_HAS_WINCE) -# define ACE_LOG_MSG_SYSLOG_BACKEND ACE_Log_Msg_UNIX_Syslog -#else -# define ACE_LOG_MSG_SYSLOG_BACKEND ACE_Log_Msg_IPC -#endif /* ! ACE_WIN32 */ - -// When doing ACE_OS::s[n]printf() calls in log(), we need to update -// the space remaining in the output buffer based on what's returned from -// the output function. If we could rely on more modern compilers, this -// would be in an unnamed namespace, but it's a macro instead. -// count is a size_t, len is an int and assumed to be non-negative. -#define ACE_UPDATE_COUNT(COUNT, LEN) \ - do { if (static_cast (LEN) > COUNT) COUNT = 0; \ - else COUNT -= static_cast (LEN); \ - } while (0) - -/// Instance count for Log_Msg - used to know when dynamically -/// allocated storage (program name and host name) can be safely -/// deleted. -int ACE_Log_Msg::instance_count_ = 0; - -/** - * @class ACE_Log_Msg_Manager - * - * @brief Synchronize output operations. - * - * Provides global point of contact for all ACE_Log_Msg instances - * in a process. - * - * For internal use by ACE, only! - */ -class ACE_Log_Msg_Manager -{ -public: - static ACE_Log_Msg_Backend *log_backend_; - static ACE_Log_Msg_Backend *custom_backend_; - - static u_long log_backend_flags_; - - static int init_backend (const u_long *flags = 0); - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - //FUZZ: disable check_for_lack_ACE_OS - static void close (void); - //FUZZ: enable check_for_lack_ACE_OS - - static ACE_Recursive_Thread_Mutex *get_lock (void); - -private: - static ACE_Recursive_Thread_Mutex *lock_; -#endif /* ! ACE_MT_SAFE */ -}; - -ACE_Log_Msg_Backend *ACE_Log_Msg_Manager::log_backend_ = 0; -ACE_Log_Msg_Backend *ACE_Log_Msg_Manager::custom_backend_ = 0; - -u_long ACE_Log_Msg_Manager::log_backend_flags_ = 0; - -int ACE_Log_Msg_Manager::init_backend (const u_long *flags) -{ - // If flags have been supplied, and they are different from the flags - // we had last time, then we may have to re-create the backend as a - // different type. - if (flags) - { - // Sanity check for custom backend. - if (ACE_BIT_ENABLED (*flags, ACE_Log_Msg::CUSTOM) && - ACE_Log_Msg_Manager::custom_backend_ == 0) - { - return -1; - } - - if ((ACE_BIT_ENABLED (*flags, ACE_Log_Msg::SYSLOG) - && ACE_BIT_DISABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG)) - || (ACE_BIT_DISABLED (*flags, ACE_Log_Msg::SYSLOG) - && ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG))) - { - delete ACE_Log_Msg_Manager::log_backend_; - ACE_Log_Msg_Manager::log_backend_ = 0; - } - - ACE_Log_Msg_Manager::log_backend_flags_ = *flags; - } - - if (ACE_Log_Msg_Manager::log_backend_ == 0) - { - ACE_NO_HEAP_CHECK; - -#if (defined (WIN32) || !defined (ACE_LACKS_UNIX_SYSLOG)) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) - // Allocate the ACE_Log_Msg_Backend instance. - if (ACE_BIT_ENABLED (ACE_Log_Msg_Manager::log_backend_flags_, ACE_Log_Msg::SYSLOG)) - ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_, - ACE_LOG_MSG_SYSLOG_BACKEND, - -1); - else -#endif /* defined (WIN32) && !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_PHARLAP) */ - ACE_NEW_RETURN (ACE_Log_Msg_Manager::log_backend_, - ACE_Log_Msg_IPC, - -1); - } - - return 0; -} - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -ACE_Recursive_Thread_Mutex *ACE_Log_Msg_Manager::lock_ = 0; - -ACE_Recursive_Thread_Mutex * -ACE_Log_Msg_Manager::get_lock (void) -{ - // This function is called by the first thread to create an ACE_Log_Msg - // instance. It makes the call while holding a mutex, so we don't have - // to grab another one here. - - if (ACE_Log_Msg_Manager::lock_ == 0) - { - ACE_NO_HEAP_CHECK; - - ACE_NEW_RETURN (ACE_Log_Msg_Manager::lock_, - ACE_Recursive_Thread_Mutex, - 0); - } - - if (init_backend () == -1) - return 0; - - return ACE_Log_Msg_Manager::lock_; -} - -void -ACE_Log_Msg_Manager::close (void) -{ -#if defined (ACE_HAS_STHREADS) && ! defined (ACE_HAS_TSS_EMULATION) && ! defined (ACE_HAS_EXCEPTIONS) - // Delete the (main thread's) Log_Msg instance. I think that this - // is only "necessary" if exception handling is not enabled. - // Without exception handling, main thread TSS destructors don't - // seem to be called. It's not really necessary anyways, because - // this one leak is harmless on Solaris. - delete ACE_Log_Msg::instance (); -#endif /* ACE_HAS_STHREADS && ! TSS_EMULATION && ! ACE_HAS_EXCEPTIONS */ - - // Ugly, ugly, but don't know a better way. - delete ACE_Log_Msg_Manager::lock_; - ACE_Log_Msg_Manager::lock_ = 0; - - delete ACE_Log_Msg_Manager::log_backend_; - ACE_Log_Msg_Manager::log_backend_ = 0; - - // we are never responsible for custom backend - ACE_Log_Msg_Manager::custom_backend_ = 0; -} - -# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ - defined (ACE_HAS_TSS_EMULATION) -/* static */ -# if defined (ACE_HAS_THR_C_DEST) -# define LOCAL_EXTERN_PREFIX extern "C" -# else -# define LOCAL_EXTERN_PREFIX -# endif /* ACE_HAS_THR_C_DEST */ -LOCAL_EXTERN_PREFIX -void -ACE_TSS_CLEANUP_NAME (void *ptr) -{ - // Delegate to thr_desc if this not has terminated - ACE_Log_Msg* log_msg = (ACE_Log_Msg*) ptr; - if (log_msg->thr_desc()!=0) - log_msg->thr_desc()->log_msg_cleanup(log_msg); - else - delete (ACE_Log_Msg *) ptr; -} -# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ -#endif /* ! ACE_MT_SAFE */ - -/* static */ -int -ACE_Log_Msg::exists (void) -{ -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ - defined (ACE_HAS_TSS_EMULATION) - void *tss_log_msg = 0; // The actual type is ACE_Log_Msg*, but we need this - // void to keep G++ from complaining. - - // Get the tss_log_msg from thread-specific storage. - return ACE_Log_Msg::key_created_ - && ACE_Thread::getspecific (*(log_msg_tss_key ()), &tss_log_msg) != -1 - && tss_log_msg != 0; -# else -# error "Platform must support thread-specific storage if threads are used." -# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ -#else /* ! ACE_MT_SAFE */ - return 1; -#endif /* ! ACE_MT_SAFE */ -} - -ACE_Log_Msg * -ACE_Log_Msg::instance (void) -{ -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ - defined (ACE_HAS_TSS_EMULATION) - // TSS Singleton implementation. - - if (!ACE_Log_Msg::key_created_) - { - ACE_thread_mutex_t *lock = - reinterpret_cast ( - ACE_OS_Object_Manager::preallocated_object - [ACE_OS_Object_Manager::ACE_LOG_MSG_INSTANCE_LOCK]); - - if (1 == ACE_OS_Object_Manager::starting_up()) - //This function is called before ACE_OS_Object_Manager is - //initialized. So the lock might not be valid. Assume it's - //single threaded and so don't need the lock. - ; - else - ACE_OS::thread_mutex_lock (lock); - - if (!ACE_Log_Msg::key_created_) - { - // Allocate the Singleton lock. - ACE_Log_Msg_Manager::get_lock (); - - { - ACE_NO_HEAP_CHECK; - if (ACE_Thread::keycreate (log_msg_tss_key (), - &ACE_TSS_CLEANUP_NAME) != 0) - { - if (1 == ACE_OS_Object_Manager::starting_up()) - //This function is called before ACE_OS_Object_Manager is - //initialized. So the lock might not be valid. Assume it's - //single threaded and so don't need the lock. - ; - else - ACE_OS::thread_mutex_unlock (lock); - return 0; // Major problems, this should *never* happen! - } - } - - ACE_Log_Msg::key_created_ = true; - } - - if (1 == ACE_OS_Object_Manager::starting_up()) - //This function is called before ACE_OS_Object_Manager is - //initialized. So the lock might not be valid. Assume it's - //single threaded and so don't need the lock. - ; - else - ACE_OS::thread_mutex_unlock (lock); - } - - ACE_Log_Msg *tss_log_msg = 0; - void *temp = 0; - - // Get the tss_log_msg from thread-specific storage. - if (ACE_Thread::getspecific (*(log_msg_tss_key ()), &temp) == -1) - return 0; // This should not happen! - - tss_log_msg = static_cast (temp); - - // Check to see if this is the first time in for this thread. - if (tss_log_msg == 0) - { - // Allocate memory off the heap and store it in a pointer in - // thread-specific storage (on the stack...). Stop heap - // checking, the memory will always be freed by the thread - // rundown because of the TSS callback set up when the key was - // created. This prevents from getting these blocks reported as - // memory leaks. - { - ACE_NO_HEAP_CHECK; - - ACE_NEW_RETURN (tss_log_msg, - ACE_Log_Msg, - 0); - // Store the dynamically allocated pointer in thread-specific - // storage. It gets deleted via the ACE_TSS_cleanup function - // when the thread terminates. - - if (ACE_Thread::setspecific (*(log_msg_tss_key()), - reinterpret_cast (tss_log_msg)) - != 0) - return 0; // Major problems, this should *never* happen! - } - } - - return tss_log_msg; -# else -# error "Platform must support thread-specific storage if threads are used." -# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ -#else /* ! ACE_MT_SAFE */ - // We don't have threads, we cannot call - // ACE_Log_Msg_Manager::get_lock () to initialize the logger - // callback, so instead we do it here. - if (ACE_Log_Msg_Manager::init_backend () == -1) - return 0; - - // Singleton implementation. - - if (log_msg_cleanup == 0) - { - ACE_NEW_RETURN (log_msg_cleanup, ACE_Msg_Log_Cleanup, 0); - // Register the instance for destruction at program termination. - ACE_Object_Manager::at_exit (log_msg_cleanup); - } - - return &log_msg_cleanup->object (); -#endif /* ! ACE_MT_SAFE */ -} - -// Not inlined to help prevent having to include OS.h just to -// get ACE_DEBUG, et al, macros. -int -ACE_Log_Msg::last_error_adapter (void) -{ - return ACE_OS::last_error (); -} - -// Sets the flag in the default priority mask used to initialize -// ACE_Log_Msg instances, as well as the current per-thread instance. - -void -ACE_Log_Msg::enable_debug_messages (ACE_Log_Priority priority) -{ - ACE_SET_BITS (ACE_Log_Msg::default_priority_mask_, priority); - ACE_Log_Msg *i = ACE_Log_Msg::instance (); - i->priority_mask (i->priority_mask () | priority); -} - -// Clears the flag in the default priority mask used to initialize -// ACE_Log_Msg instances, as well as the current per-thread instance. - -void -ACE_Log_Msg::disable_debug_messages (ACE_Log_Priority priority) -{ - ACE_CLR_BITS (ACE_Log_Msg::default_priority_mask_, priority); - ACE_Log_Msg *i = ACE_Log_Msg::instance (); - i->priority_mask (i->priority_mask () & ~priority); -} - -const ACE_TCHAR * -ACE_Log_Msg::program_name (void) -{ - return ACE_Log_Msg::program_name_; -} - -/// Name of the local host. -const ACE_TCHAR *ACE_Log_Msg::local_host_ = 0; - -/// Records the program name. -const ACE_TCHAR *ACE_Log_Msg::program_name_ = 0; - -/// Default is to use stderr. -u_long ACE_Log_Msg::flags_ = ACE_Log_Msg::STDERR; - -/// Process id of the current process. -pid_t ACE_Log_Msg::pid_ = -2; - -/// Current offset of msg_[]. -ptrdiff_t ACE_Log_Msg::msg_off_ = 0; - -/// Default per-thread priority mask -/// By default, no priorities are enabled. -u_long ACE_Log_Msg::default_priority_mask_ = 0; - -/// Default per-process priority mask -/// By default, all priorities are enabled. -u_long ACE_Log_Msg::process_priority_mask_ = LM_SHUTDOWN - | LM_TRACE - | LM_DEBUG - | LM_INFO - | LM_NOTICE - | LM_WARNING - | LM_STARTUP - | LM_ERROR - | LM_CRITICAL - | LM_ALERT - | LM_EMERGENCY; - -void -ACE_Log_Msg::close (void) -{ - // This call needs to go here to avoid memory leaks. - ACE_MT (ACE_Log_Msg_Manager::close ()); - - // Please note that this will be called by a statement that is - // harded coded into the ACE_Object_Manager's shutdown sequence, in - // its destructor. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && \ - (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ - defined (ACE_HAS_TSS_EMULATION)) - - if (ACE_Log_Msg::key_created_) - { - ACE_thread_mutex_t *lock = - reinterpret_cast - (ACE_OS_Object_Manager::preallocated_object - [ACE_OS_Object_Manager::ACE_LOG_MSG_INSTANCE_LOCK]); - ACE_OS::thread_mutex_lock (lock); - - if (ACE_Log_Msg::key_created_) - { - // Clean up this ACE_Log_Msg instance and reset the TSS to - // prevent any future cleanup attempts via TSS mechanisms at - // thread exit. Otherwise in the event of a dynamic library - // unload of libACE, by a program not linked with libACE, - // ACE_TSS_cleanup will be invoked after libACE has been unloaded. - // See Bugzilla 2980 for lots of details. - ACE_Log_Msg *tss_log_msg = 0; - void *temp = 0; - - // Get the tss_log_msg from thread-specific storage. - if (ACE_Thread::getspecific (*(log_msg_tss_key ()), &temp) != -1 - && temp) - { - tss_log_msg = static_cast (temp); - // we haven't been cleaned up - ACE_TSS_CLEANUP_NAME(tss_log_msg); - if (ACE_Thread::setspecific(*(log_msg_tss_key()), - reinterpret_cast (0)) != 0) - ACE_OS::printf ("ACE_Log_Msg::close failed to ACE_Thread::setspecific to 0\n"); - } - - // The key is not needed any longer; ACE_Log_Msg is closing - // and will need to be reopened if this process wishes to use - // logging again. So delete the key. - ACE_Thread::keyfree (*(log_msg_tss_key())); - ACE_Log_Msg::key_created_ = false; - } - - ACE_OS::thread_mutex_unlock (lock); - } -#endif /* (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) && ACE_MT_SAFE */ -} - -void -ACE_Log_Msg::sync_hook (const ACE_TCHAR *prg_name) -{ - ACE_LOG_MSG->sync (prg_name); -} - -ACE_OS_Thread_Descriptor * -ACE_Log_Msg::thr_desc_hook (void) -{ - return ACE_LOG_MSG->thr_desc (); -} - -// Call after a fork to resynchronize the PID and PROGRAM_NAME -// variables. -void -ACE_Log_Msg::sync (const ACE_TCHAR *prog_name) -{ - ACE_TRACE ("ACE_Log_Msg::sync"); - - if (prog_name) - { - // Must free if already allocated!!! - ACE_OS::free ((void *) ACE_Log_Msg::program_name_); - - // Stop heap checking, block will be freed by the destructor when - // the last ACE_Log_Msg instance is deleted. - // Heap checking state will be restored when the block is left. - { - ACE_NO_HEAP_CHECK; - - ACE_Log_Msg::program_name_ = ACE_OS::strdup (prog_name); - } - } - - ACE_Log_Msg::pid_ = ACE_OS::getpid (); - ACE_Log_Msg::msg_off_ = 0; -} - -u_long -ACE_Log_Msg::flags (void) -{ - ACE_TRACE ("ACE_Log_Msg::flags"); - u_long result; - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock (), 0)); - - result = ACE_Log_Msg::flags_; - return result; -} - -void -ACE_Log_Msg::set_flags (u_long flgs) -{ - ACE_TRACE ("ACE_Log_Msg::set_flags"); - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock ())); - - ACE_SET_BITS (ACE_Log_Msg::flags_, flgs); -} - -void -ACE_Log_Msg::clr_flags (u_long flgs) -{ - ACE_TRACE ("ACE_Log_Msg::clr_flags"); - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock ())); - - ACE_CLR_BITS (ACE_Log_Msg::flags_, flgs); -} - -int -ACE_Log_Msg::acquire (void) -{ - ACE_TRACE ("ACE_Log_Msg::acquire"); -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - return ACE_Log_Msg_Manager::get_lock ()->acquire (); -#else /* ! ACE_MT_SAFE */ - return 0; -#endif /* ! ACE_MT_SAFE */ -} - -u_long -ACE_Log_Msg::priority_mask (u_long n_mask, MASK_TYPE mask_type) -{ - u_long o_mask; - - if (mask_type == THREAD) - { - o_mask = this->priority_mask_; - this->priority_mask_ = n_mask; - } - else - { - o_mask = ACE_Log_Msg::process_priority_mask_; - ACE_Log_Msg::process_priority_mask_ = n_mask; - } - - return o_mask; -} - -int -ACE_Log_Msg::release (void) -{ - ACE_TRACE ("ACE_Log_Msg::release"); - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - return ACE_Log_Msg_Manager::get_lock ()->release (); -#else /* ! ACE_MT_SAFE */ - return 0; -#endif /* ! ACE_MT_SAFE */ -} - -ACE_Log_Msg::ACE_Log_Msg (void) - : status_ (0), - errnum_ (0), - linenum_ (0), - msg_ (0), - restart_ (1), // Restart by default... - ostream_ (0), - msg_callback_ (0), - trace_depth_ (0), - trace_active_ (false), - tracing_enabled_ (true), // On by default? - delete_ostream_(false), - thr_desc_ (0), - priority_mask_ (default_priority_mask_), - timestamp_ (0) -{ - // ACE_TRACE ("ACE_Log_Msg::ACE_Log_Msg"); - - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock ())); - ++instance_count_; - - if (this->instance_count_ == 1) - ACE_Base_Thread_Adapter::set_log_msg_hooks (ACE_Log_Msg::init_hook, - ACE_Log_Msg::inherit_hook, - ACE_Log_Msg::close, - ACE_Log_Msg::sync_hook, - ACE_Log_Msg::thr_desc_hook); - - this->conditional_values_.is_set_ = false; - - char *timestamp = ACE_OS::getenv ("ACE_LOG_TIMESTAMP"); - if (timestamp != 0) - { - // If variable is set or is set to date tag so we print date and time. - if (ACE_OS::strcmp (timestamp, "TIME") == 0) - { - this->timestamp_ = 1; - } - else if (ACE_OS::strcmp (timestamp, "DATE") == 0) - { - this->timestamp_ = 2; - } - } - - ACE_NEW_NORETURN (this->msg_, ACE_TCHAR[ACE_MAXLOGMSGLEN+1]); -} - -ACE_Log_Msg::~ACE_Log_Msg (void) -{ -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - - int instance_count = 0; - - // Only hold the guard while updating the instance_count_. - // If ACE_Log_Msg_Manager::close () is called, the lock will - // be deleted. - { - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock ())); - instance_count = --instance_count_; - } - // Release the guard. - -#else /* ! ACE_MT_SAFE */ - int instance_count = --instance_count_; -#endif /* ! ACE_MT_SAFE */ - - // If this is the last instance then cleanup. Only the last - // thread to destroy its ACE_Log_Msg instance should execute - // this block. - if (instance_count == 0) - { - // Destroy the message queue instance. - if (ACE_Log_Msg_Manager::log_backend_ != 0) - ACE_Log_Msg_Manager::log_backend_->close (); - - // Close down custom backend - if (ACE_Log_Msg_Manager::custom_backend_ != 0) - ACE_Log_Msg_Manager::custom_backend_->close (); - -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# if defined (ACE_HAS_TSS_EMULATION) - ACE_Log_Msg_Manager::close (); -# endif /* ACE_HAS_TSS_EMULATION */ -# endif /* ACE_MT_SAFE */ - - if (ACE_Log_Msg::program_name_) - { - ACE_OS::free ((void *) ACE_Log_Msg::program_name_); - ACE_Log_Msg::program_name_ = 0; - } - - if (ACE_Log_Msg::local_host_) - { - ACE_OS::free ((void *) ACE_Log_Msg::local_host_); - ACE_Log_Msg::local_host_ = 0; - } - } - - // - // do we need to close and clean up? - // - if (this->delete_ostream_) -#if defined (ACE_LACKS_IOSTREAM_TOTALLY) - { - ACE_OS::fclose (this->ostream_); - } -#else - { - delete ostream_; - ostream_ = 0; - } -#endif - - delete[] this->msg_; -} - -// Open the sender-side of the message queue. - -int -ACE_Log_Msg::open (const ACE_TCHAR *prog_name, - u_long flags, - const ACE_TCHAR *logger_key) -{ - ACE_TRACE ("ACE_Log_Msg::open"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock (), -1)); - - if (prog_name) - { - ACE_OS::free ((void *) ACE_Log_Msg::program_name_); - - // Stop heap checking, block will be freed by the destructor. - { - ACE_NO_HEAP_CHECK; - - ACE_ALLOCATOR_RETURN (ACE_Log_Msg::program_name_, - ACE_OS::strdup (prog_name), - -1); - } - } - else if (ACE_Log_Msg::program_name_ == 0) - { - // Stop heap checking, block will be freed by the destructor. - ACE_NO_HEAP_CHECK; - ACE_ALLOCATOR_RETURN (ACE_Log_Msg::program_name_, - ACE_OS::strdup (ACE_TEXT ("")), - -1); - } - - int status = 0; - - // Be sure that there is a message_queue_, with multiple threads. - ACE_MT (ACE_Log_Msg_Manager::init_backend (&flags)); - - // Always close the current handle before doing anything else. - if (ACE_Log_Msg_Manager::log_backend_ != 0) - ACE_Log_Msg_Manager::log_backend_->reset (); - - if (ACE_Log_Msg_Manager::custom_backend_ != 0) - ACE_Log_Msg_Manager::custom_backend_->reset (); - - // Note that if we fail to open the message queue the default action - // is to use stderr (set via static initialization in the - // Log_Msg.cpp file). - - if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::LOGGER) - || ACE_BIT_ENABLED (flags, ACE_Log_Msg::SYSLOG)) - { - // The SYSLOG backends (both NT and UNIX) can get along fine - // without the logger_key - they will default to prog_name if - // logger key is 0. - if (logger_key == 0 && ACE_BIT_ENABLED (flags, ACE_Log_Msg::LOGGER)) - status = -1; - else - status = ACE_Log_Msg_Manager::log_backend_->open (logger_key); - - if (status == -1) - ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::STDERR); - else - { - if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::LOGGER)) - ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER); - if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::SYSLOG)) - ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG); - } - } - else if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER) - || ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG)) - { - // If we are closing down logger, redirect logging to stderr. - ACE_CLR_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER); - ACE_CLR_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG); - ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::STDERR); - } - - if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::CUSTOM)) - { - status = - ACE_Log_Msg_Manager::custom_backend_->open (logger_key); - - if (status != -1) - ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::CUSTOM); - } - - // Remember, ACE_Log_Msg::STDERR bit is on by default... - if (status != -1 - && ACE_BIT_ENABLED (flags, - ACE_Log_Msg::STDERR) == 0) - ACE_CLR_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::STDERR); - - // VERBOSE takes precedence over VERBOSE_LITE... - if (ACE_BIT_ENABLED (flags, - ACE_Log_Msg::VERBOSE_LITE)) - ACE_SET_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::VERBOSE_LITE); - else if (ACE_BIT_ENABLED (flags, - ACE_Log_Msg::VERBOSE)) - ACE_SET_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::VERBOSE); - - if (ACE_BIT_ENABLED (flags, - ACE_Log_Msg::OSTREAM)) - { - ACE_SET_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::OSTREAM); - // Only set this to cerr if it hasn't already been set. - if (this->msg_ostream () == 0) - this->msg_ostream (ACE_DEFAULT_LOG_STREAM); - } - - if (ACE_BIT_ENABLED (flags, - ACE_Log_Msg::MSG_CALLBACK)) - ACE_SET_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::MSG_CALLBACK); - - if (ACE_BIT_ENABLED (flags, - ACE_Log_Msg::SILENT)) - ACE_SET_BITS (ACE_Log_Msg::flags_, - ACE_Log_Msg::SILENT); - - return status; -} - -/** - * Valid Options (prefixed by '%', as in printf format strings) include: - * 'A': print an ACE_timer_t value - * 'a': exit the program at this point (var-argument is the exit status!) - * 'b': print a ssize_t value - * 'B': print a size_t value - * 'c': print a character - * 'C': print a character string - * 'i', 'd': print a decimal number - * 'I', indent according to nesting depth - * 'e', 'E', 'f', 'F', 'g', 'G': print a double - * 'l', print line number where an error occurred. - * 'M': print the name of the priority of the message. - * 'm': Return the message corresponding to errno value, e.g., as done by - * 'N': print file name where the error occurred. - * 'n': print the name of the program (or "" if not set) - * 'o': print as an octal number - * 'P': format the current process id - * 'p': format the appropriate errno message from sys_errlist, e.g., as done by - * 'Q': print out the uint64 number - * 'q': print out the int64 number - * '@': print a void* pointer (in hexadecimal) - * 'r': call the function pointed to by the corresponding argument - * 'R': print return status - * 'S': format the appropriate _sys_siglist entry corresponding to var-argument. - * 's': format a character string - * 'T': print timestamp in hour:minute:sec:usec format. - * 'D': print timestamp in month/day/year hour:minute:sec:usec format. - * 't': print thread id (1 if single-threaded) - * 'u': print as unsigned int - * 'x': print as a hex number - * 'X': print as a hex number - * 'w': print a wide character - * 'W': print out a wide character string. - * 'z': print an ACE_OS::WChar character - * 'Z': print an ACE_OS::WChar character string - * ':': print a time_t value as an integral number - * '%': format a single percent sign, '%' - */ -ssize_t -ACE_Log_Msg::log (ACE_Log_Priority log_priority, - const ACE_TCHAR *format_str, ...) -{ - ACE_TRACE ("ACE_Log_Msg::log"); - - // Start of variable args section. - va_list argp; - - va_start (argp, format_str); - - ssize_t const result = this->log (format_str, - log_priority, - argp); - va_end (argp); - - return result; -} - -#if defined (ACE_HAS_WCHAR) -/** - * Since this is the ANTI_TCHAR version, we need to convert - * the format string over. - */ -ssize_t -ACE_Log_Msg::log (ACE_Log_Priority log_priority, - const ACE_ANTI_TCHAR *format_str, ...) -{ - ACE_TRACE ("ACE_Log_Msg::log"); - - // Start of variable args section. - va_list argp; - - va_start (argp, format_str); - - ssize_t const result = this->log (ACE_TEXT_ANTI_TO_TCHAR (format_str), - log_priority, - argp); - va_end (argp); - - return result; -} -#endif /* ACE_HAS_WCHAR */ - -ssize_t -ACE_Log_Msg::log (const ACE_TCHAR *format_str, - ACE_Log_Priority log_priority, - va_list argp) -{ - ACE_TRACE ("ACE_Log_Msg::log"); - // External decls. - - typedef void (*PTF)(...); - - // Check if there were any conditional values set. - bool const conditional_values = this->conditional_values_.is_set_; - - // Reset conditional values. - this->conditional_values_.is_set_ = false; - - // Only print the message if hasn't been reset to - // exclude this logging priority. - if (this->log_priority_enabled (log_priority) == 0) - return 0; - - // If conditional values were set and the log priority is correct, - // then the values are actually set. - if (conditional_values) - this->set (this->conditional_values_.file_, - this->conditional_values_.line_, - this->conditional_values_.op_status_, - this->conditional_values_.errnum_, - this->restart (), - this->msg_ostream (), - this->msg_callback ()); - - // Logging is supposed to be a benign activity (i.e., not interfer - // with normal application operations), so don't inadvertently smash - // errno! - ACE_Errno_Guard guard (errno); - - ACE_Log_Record log_record (log_priority, - ACE_OS::gettimeofday (), - this->getpid ()); - - // bp is pointer to where to put next part of logged message. - // bspace is the number of characters remaining in msg_. - ACE_TCHAR *bp = const_cast (this->msg ()); - size_t bspace = ACE_Log_Record::MAXLOGMSGLEN; // Leave room for Nul term. - if (this->msg_off_ <= ACE_Log_Record::MAXLOGMSGLEN) - bspace -= static_cast (this->msg_off_); - - // If this platform has snprintf() capability to prevent overrunning the - // output buffer, use it. To avoid adding a maintenance-hassle compile- - // time couple between here and OS.cpp, don't try to figure this out at - // compile time. Instead, do a quick check now; if we get a -1 return, - // the platform doesn't support the length-limiting capability. - ACE_TCHAR test[2]; - bool can_check = ACE_OS::snprintf (test, 1, ACE_TEXT ("x")) != -1; - - bool abort_prog = false; - int exit_value = 0; - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::VERBOSE)) - { - // Prepend the program name onto this message - - if (ACE_Log_Msg::program_name_ != 0) - { - for (const ACE_TCHAR *s = ACE_Log_Msg::program_name_; - bspace > 1 && (*bp = *s) != '\0'; - ++s, --bspace) - bp++; - - *bp++ = '|'; - --bspace; - } - } - - if (timestamp_ > 0) - { - ACE_TCHAR day_and_time[35]; - const ACE_TCHAR *s = 0; - if (timestamp_ == 1) - { - // Print just the time - s = ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR), 1); - } - else - { - // Print time and date - ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR)); - s = day_and_time; - } - - for (; bspace > 1 && (*bp = *s) != '\0'; ++s, --bspace) - ++bp; - - *bp++ = '|'; - --bspace; - } - - while (*format_str != '\0' && bspace > 0) - { - // Copy input to output until we encounter a %, however a - // % followed by another % is not a format specification. - - if (*format_str != '%') - { - *bp++ = *format_str++; - --bspace; - } - else if (format_str[1] == '%') // An "escaped" '%' (just print one '%'). - { - *bp++ = *format_str++; // Store first % - ++format_str; // but skip second % - --bspace; - } - else - { - // This is most likely a format specification that ends with - // one of the valid options described previously. To enable full - // use of all sprintf capabilities, save the format specifier - // from the '%' up to the format letter in a new char array. - // This allows the full sprintf capability for padding, field - // widths, alignment, etc. Any width/precision requiring a - // caller-supplied argument is extracted and placed as text - // into the format array. Lastly, we convert the caller-supplied - // format specifier from the ACE_Log_Msg-supported list to the - // equivalent sprintf specifier, and run the new format spec - // through sprintf, adding it to the bp string. - - const ACE_TCHAR *abort_str = ACE_TEXT ("Aborting..."); - const ACE_TCHAR *start_format = format_str; - ACE_TCHAR format[128]; // Converted format string - ACE_TCHAR *fp; // Current format pointer - int wp = 0; // Width/precision extracted from args - bool done = false; - bool skip_nul_locate = false; - int this_len = 0; // How many chars s[n]printf wrote - - fp = format; - *fp++ = *format_str++; // Copy in the % - - // Initialization to satisfy VC6 - int tmp_indent = 0; - // Work through the format string to copy in the format - // from the caller. While it's going across, extract ints - // for '*' width/precision values from the argument list. - // When the real format specifier is located, change it to - // one recognized by sprintf, if needed, and do the sprintf - // call. - - while (!done) - { - done = true; // Unless a conversion spec changes it - - switch (*format_str) - { - // The initial set of cases are the conversion - // specifiers. Copy them in to the format array. - // Note we don't use 'l', a normal conversion spec, - // as a conversion because it is a ACE_Log_Msg format - // specifier. - case '-': - case '+': - case '0': - case ' ': - case '#': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '.': - case 'L': - case 'h': - *fp++ = *format_str; - done = false; - break; - - case '*': - wp = va_arg (argp, int); - ACE_OS::sprintf (fp, ACE_TEXT ("%d"), wp); - fp += ACE_OS::strlen (fp); - done = false; - break; - - case 'A': // ACE_timer_t - { - ACE_OS::strcpy (fp, ACE_TEXT ("f")); - double value = va_arg (argp, double); - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, value); - else - this_len = ACE_OS::sprintf (bp, format, value); - ACE_UPDATE_COUNT (bspace, this_len); - } - break; - - case 'a': // Abort program after handling all of format string. - abort_prog = true; - exit_value = va_arg (argp, int); - ACE_OS::strsncpy (bp, abort_str, bspace); - if (bspace > ACE_OS::strlen (abort_str)) - bspace -= ACE_OS::strlen (abort_str); - else - bspace = 0; - break; - - case 'l': // Source file line number - ACE_OS::strcpy (fp, ACE_TEXT ("d")); - if (can_check) - this_len = ACE_OS::snprintf (bp, - bspace, - format, - this->linenum ()); - else - this_len = ACE_OS::sprintf (bp, format, this->linenum ()); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'N': // Source file name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, - this->file () ? - ACE_TEXT_CHAR_TO_TCHAR (this->file ()) - : ACE_TEXT ("")); - else - this_len = ACE_OS::sprintf (bp, format, - this->file () ? - ACE_TEXT_CHAR_TO_TCHAR (this->file ()) - : ACE_TEXT ("")); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'n': // Program name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, - ACE_Log_Msg::program_name_ ? - ACE_Log_Msg::program_name_ : - ACE_TEXT ("")); - else - this_len = ACE_OS::sprintf (bp, format, - ACE_Log_Msg::program_name_ ? - ACE_Log_Msg::program_name_ : - ACE_TEXT ("")); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'P': // Process ID -#if defined (ACE_OPENVMS) - // Print the process id in hex on OpenVMS. - ACE_OS::strcpy (fp, ACE_TEXT ("x")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("d")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - static_cast (this->getpid ())); - else - this_len = ACE_OS::sprintf - (bp, format, static_cast (this->getpid ())); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'p': // string, ala perror() - { - errno = 0; - char *msg = ACE_OS::strerror (ACE::map_errno (this->errnum ())); - // Windows can try to translate the errnum using - // system calls if strerror() doesn't get anything useful. -#if defined (ACE_WIN32) - if (errno == 0) - { -#endif - -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls: %ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s: %s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, ACE_TCHAR *), - ACE_TEXT_CHAR_TO_TCHAR (msg)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, ACE_TCHAR *), - ACE_TEXT_CHAR_TO_TCHAR (msg)); -#if defined (ACE_WIN32) - } - else - { - errno = ACE::map_errno (this->errnum ()); - ACE_TCHAR *lpMsgBuf = 0; - - // PharLap can't do FormatMessage, so try for socket - // error. -# if !defined (ACE_HAS_PHARLAP) - ACE_TEXT_FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_MAX_WIDTH_MASK - | FORMAT_MESSAGE_FROM_SYSTEM, - 0, - errno, - MAKELANGID (LANG_NEUTRAL, - SUBLANG_DEFAULT), - // Default language - (ACE_TCHAR *) &lpMsgBuf, - 0, - 0); -# endif /* ACE_HAS_PHARLAP */ - - // If we don't get a valid response from - // , we'll assume this is a - // WinSock error and so we'll try to convert - // it into a string. If this doesn't work it - // returns "unknown error" which is fine for - // our purposes. - if (lpMsgBuf == 0) - { - const ACE_TCHAR *message = - ACE::sock_error (errno); - ACE_OS::strcpy (fp, ACE_TEXT ("s: %s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - va_arg (argp, const ACE_TCHAR *), - message); - else - this_len = ACE_OS::sprintf - (bp, format, - va_arg (argp, const ACE_TCHAR *), - message); - } - else - { - ACE_OS::strcpy (fp, ACE_TEXT ("s: %s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - va_arg (argp, ACE_TCHAR *), - lpMsgBuf); - else - this_len = ACE_OS::sprintf - (bp, format, - va_arg (argp, ACE_TCHAR *), - lpMsgBuf); - // Free the buffer. - ::LocalFree (lpMsgBuf); - } - } -#endif /* ACE_WIN32 */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'M': // Print the name of the priority of the message. -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - ACE_Log_Record::priority_name (log_priority)); - else - this_len = ACE_OS::sprintf - (bp, format, - ACE_Log_Record::priority_name (log_priority)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'm': // Format the string assocated with the errno value. - { - errno = 0; - char *msg = 0; - msg = ACE_OS::strerror (ACE::map_errno (this->errnum ())); - // Windows can try to translate the errnum using - // system calls if strerror() doesn't get anything useful. -#if defined (ACE_WIN32) - if (errno == 0) - { -#endif - -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, ACE_TEXT_CHAR_TO_TCHAR (msg)); - else - this_len = ACE_OS::sprintf - (bp, format, ACE_TEXT_CHAR_TO_TCHAR (msg)); -#if defined (ACE_WIN32) - } - else - { - errno = ACE::map_errno (this->errnum ()); - ACE_TCHAR *lpMsgBuf = 0; - - // PharLap can't do FormatMessage, so try for socket - // error. -# if !defined (ACE_HAS_PHARLAP) - ACE_TEXT_FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_MAX_WIDTH_MASK - | FORMAT_MESSAGE_FROM_SYSTEM, - 0, - errno, - MAKELANGID (LANG_NEUTRAL, - SUBLANG_DEFAULT), - // Default language - (ACE_TCHAR *) &lpMsgBuf, - 0, - 0); -# endif /* ACE_HAS_PHARLAP */ - - // If we don't get a valid response from - // , we'll assume this is a - // WinSock error and so we'll try to convert - // it into a string. If this doesn't work it - // returns "unknown error" which is fine for - // our purposes. - if (lpMsgBuf == 0) - { - const ACE_TCHAR *message = - ACE::sock_error (errno); - ACE_OS::strcpy (fp, ACE_TEXT ("s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, message); - else - this_len = ACE_OS::sprintf (bp, format, message); - } - else - { - ACE_OS::strcpy (fp, ACE_TEXT ("s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, lpMsgBuf); - else - this_len = ACE_OS::sprintf - (bp, format, lpMsgBuf); - // Free the buffer. - ::LocalFree (lpMsgBuf); - } - } -#endif /* ACE_WIN32 */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'R': // Format the return status of the operation. - this->op_status (va_arg (argp, int)); - ACE_OS::strcpy (fp, ACE_TEXT ("d")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, this->op_status ()); - else - this_len = ACE_OS::sprintf - (bp, format, this->op_status ()); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case '{': // Increment the trace_depth, then indent - skip_nul_locate = true; - (void) this->inc (); - break; - - case '}': // indent, then decrement trace_depth - skip_nul_locate = true; - (void) this->dec (); - break; - - case '$': // insert a newline, then indent the next line - // according to %I - *bp++ = '\n'; - --bspace; - /* fallthrough */ - - case 'I': // Indent with nesting_depth*width spaces - // Caller can do %*I to override nesting indent, and - // if %*I was done, wp has the extracted width. -#if defined (ACE_HAS_TRACE) - if (0 == wp) - wp = ACE_Trace::get_nesting_indent (); -#else - if (0 == wp) - wp = 4; -#endif /* ACE_HAS_TRACE */ - wp *= this->trace_depth_; - if (static_cast (wp) > bspace) - wp = static_cast (bspace); - for (tmp_indent = wp; - tmp_indent; - --tmp_indent) - *bp++ = ' '; - - *bp = '\0'; - bspace -= static_cast (wp); - skip_nul_locate = true; - break; - - case 'r': // Run (invoke) this subroutine. - { - ptrdiff_t const osave = ACE_Log_Msg::msg_off_; - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::SILENT) && - bspace > 1) - { - *bp++ = '{'; - --bspace; - } - ACE_Log_Msg::msg_off_ = bp - this->msg_; - - (*va_arg (argp, PTF))(); - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::SILENT) && - bspace > (1 + ACE_OS::strlen (bp))) - { - bspace -= (ACE_OS::strlen (bp) + 1); - bp += ACE_OS::strlen (bp); - *bp++ = '}'; - } - *bp = '\0'; - skip_nul_locate = true; - ACE_Log_Msg::msg_off_ = osave; - break; - } - - case 'S': // format the string for with this signal number. - { - int sig = va_arg (argp, int); -#if defined (ACE_HAS_SYS_SIGLIST) - if (sig >= 0 && sig < ACE_NSIG) - { - ACE_OS::strcpy (fp, ACE_TEXT ("s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, _sys_siglist[sig]); - else - this_len = ACE_OS::sprintf - (bp, format, _sys_siglist[sig]); - } - else - { - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, - ACE_TEXT(" %d"), sig); - else - this_len = ACE_OS::sprintf - (bp, ACE_TEXT (" %d"), sig); - } -#else - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, ACE_TEXT ("signal %d"), sig); - else - this_len = ACE_OS::sprintf - (bp, ACE_TEXT ("signal %d"), sig); -#endif /* ACE_HAS_SYS_SIGLIST */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'D': // Format the timestamp in format: - // Weekday Month day year hour:minute:sec.usec - { - ACE_TCHAR day_and_time[35]; - ACE::timestamp (day_and_time, - sizeof day_and_time / sizeof (ACE_TCHAR)); -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, day_and_time); - else - this_len = ACE_OS::sprintf (bp, format, day_and_time); - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'T': // Format the timestamp in - // hour:minute:sec:usec format. - { - ACE_TCHAR day_and_time[35]; -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR))); - else - this_len = ACE_OS::sprintf - (bp, format, ACE::timestamp (day_and_time, - sizeof day_and_time / sizeof (ACE_TCHAR))); - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 't': // Format thread id. -#if defined (ACE_WIN32) - ACE_OS::strcpy (fp, ACE_TEXT ("u")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - static_cast (ACE_Thread::self ())); - else - this_len = - ACE_OS::sprintf (bp, - format, - static_cast (ACE_Thread::self ())); -#elif defined (DIGITAL_UNIX) - ACE_OS::strcpy (fp, ACE_TEXT ("u")); - { - int id = -# if defined (ACE_HAS_THREADS) - pthread_getselfseq_np (); -# else - ACE_Thread::self (); -# endif /* ACE_HAS_THREADS */ - - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, id); - else - this_len = ACE_OS::sprintf (bp, format, id); - } -#else - ACE_hthread_t t_id; - ACE_Thread::self (t_id); - -# if defined (ACE_MVS) || defined (ACE_TANDEM_T1248_PTHREADS) - // MVS's pthread_t is a struct... yuck. So use the ACE 5.0 - // code for it. - ACE_OS::strcpy (fp, ACE_TEXT ("u")); - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, t_id); - else - this_len = ACE_OS::sprintf (bp, format, t_id); -# else - // Yes, this is an ugly C-style cast, but the correct - // C++ cast is different depending on whether the t_id - // is an integral type or a pointer type. FreeBSD uses - // a pointer type, but doesn't have a _np function to - // get an integral type, like the OSes above. - ACE_OS::strcpy (fp, ACE_TEXT ("lu")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, (unsigned long)t_id); - else - this_len = ACE_OS::sprintf - (bp, format, (unsigned long)t_id); -# endif /* ACE_MWS || ACE_TANDEM_T1248_PTHREADS */ - -#endif /* ACE_WIN32 */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 's': // String - { -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - wchar_t *str = va_arg (argp, wchar_t *); - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_TCHAR *str = va_arg (argp, ACE_TCHAR *); - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif /* ACE_WIN32 && ACE_USES_WCHAR */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, str ? str : ACE_TEXT ("(null)")); - else - this_len = ACE_OS::sprintf - (bp, format, str ? str : ACE_TEXT ("(null)")); - ACE_UPDATE_COUNT (bspace, this_len); - } - break; - - case 'C': // Narrow-char string - { - char *cstr = va_arg (argp, char *); -#if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("S")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif /* ACE_WIN32 && ACE_USES_WCHAR */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, cstr ? cstr : "(null)"); - else - this_len = ACE_OS::sprintf - (bp, format, cstr ? cstr : "(null)"); - ACE_UPDATE_COUNT (bspace, this_len); - } - break; - - case 'W': - { -#if defined (ACE_HAS_WCHAR) - wchar_t *wchar_str = va_arg (argp, wchar_t *); -# if defined (HPUX) - ACE_OS::strcpy (fp, ACE_TEXT ("S")); -# elif defined (ACE_WIN32) -# if defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -# else /* ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("S")); -# endif /* ACE_USES_WCHAR */ -# else - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -# endif /* HPUX */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, wchar_str ? wchar_str : ACE_TEXT_WIDE("(null)")); - else - this_len = ACE_OS::sprintf - (bp, format, wchar_str ? wchar_str : ACE_TEXT_WIDE("(null)")); -#endif /* ACE_HAS_WCHAR */ - ACE_UPDATE_COUNT (bspace, this_len); - } - break; - - case 'w': // Wide character -#if defined (ACE_WIN32) -# if defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("c")); -# else /* ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("C")); -# endif /* ACE_USES_WCHAR */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, int)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, int)); -#elif defined (ACE_USES_WCHAR) -# if defined (HPUX) - ACE_OS::strcpy (fp, ACE_TEXT ("C")); -# else - ACE_OS::strcpy (fp, ACE_TEXT ("lc")); -# endif /* HPUX */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, wint_t)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, wint_t)); -#else /* ACE_WIN32 */ - ACE_OS::strcpy (fp, ACE_TEXT ("u")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, int)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, int)); -#endif /* ACE_WIN32 */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'z': // ACE_OS::WChar character - { - // On some platforms sizeof (wchar_t) can be 2 - // on the others 4 ... - wchar_t wtchar = - static_cast (va_arg (argp, int)); -#if defined (ACE_WIN32) -# if defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("c")); -# else /* ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("C")); -# endif /* ACE_USES_WCHAR */ -#elif defined (ACE_USES_WCHAR) -# if defined (HPUX) - ACE_OS::strcpy (fp, ACE_TEXT ("C")); -# else - ACE_OS::strcpy (fp, ACE_TEXT ("lc")); -# endif /* HPUX */ -#else /* ACE_WIN32 */ - ACE_OS::strcpy (fp, ACE_TEXT ("u")); -#endif /* ACE_WIN32 */ - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, format, wtchar); - else - this_len = ACE_OS::sprintf (bp, format, wtchar); - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'Z': // ACE_OS::WChar character string - { - ACE_OS::WChar *wchar_str = va_arg (argp, ACE_OS::WChar*); - if (wchar_str == 0) - break; - - wchar_t *wchar_t_str = 0; - if (sizeof (ACE_OS::WChar) != sizeof (wchar_t)) - { - size_t len = ACE_OS::wslen (wchar_str) + 1; - ACE_NEW_NORETURN(wchar_t_str, wchar_t[len]); - if (wchar_t_str == 0) - break; - - for (size_t i = 0; i < len; ++i) - { - wchar_t_str[i] = wchar_str[i]; - } - } - - if (wchar_t_str == 0) - { - wchar_t_str = reinterpret_cast (wchar_str); - } -#if defined (ACE_WIN32) -# if defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -# else /* ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("S")); -# endif /* ACE_USES_WCHAR */ -#elif defined (ACE_HAS_WCHAR) -# if defined (HPUX) - ACE_OS::strcpy (fp, ACE_TEXT ("S")); -# else - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -# endif /* HPUX */ -#endif /* ACE_WIN32 / ACE_HAS_WCHAR */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, wchar_t_str); - else - this_len = ACE_OS::sprintf (bp, format, wchar_t_str); - if(sizeof(ACE_OS::WChar) != sizeof(wchar_t)) - { - delete [] wchar_t_str; - } - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - case 'c': -#if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("C")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("c")); -#endif /* ACE_WIN32 && ACE_USES_WCHAR */ - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, int)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, int)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'd': case 'i': case 'o': - case 'u': case 'x': case 'X': - fp[0] = *format_str; - fp[1] = '\0'; - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, int)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, int)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'F': case 'f': case 'e': case 'E': - case 'g': case 'G': - fp[0] = *format_str; - fp[1] = '\0'; - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, double)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, double)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'Q': -#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T) - { - // This relies on the ACE_U_LongLong storage layout. - ACE_UINT32 hi = va_arg (argp, ACE_UINT32); - ACE_UINT32 lo = va_arg (argp, ACE_UINT32); - if (hi > 0) - this_len = ACE_OS::sprintf (bp, - "0x%lx%0*lx", - hi, - 2 * sizeof lo, - lo); - else - this_len = ACE_OS::sprintf (bp, "0x%lx", lo); - } -#else /* ! ACE_LACKS_LONGLONG_T */ - { - const ACE_TCHAR *fmt = ACE_UINT64_FORMAT_SPECIFIER; - ACE_OS::strcpy (fp, &fmt[1]); // Skip leading % - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, - format, - va_arg (argp, ACE_UINT64)); - else - this_len = ACE_OS::sprintf (bp, - format, - va_arg (argp, ACE_UINT64)); - } -#endif /* ! ACE_LACKS_LONGLONG_T || ACE_LACKS_UNSIGNEDLONGLONG_T */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'q': - #if defined (ACE_LACKS_LONGLONG_T) - // No implementation available yet, no ACE_INT64 emulation - // available yet - #else /* ! ACE_LACKS_LONGLONG_T */ - { - const ACE_TCHAR *fmt = ACE_INT64_FORMAT_SPECIFIER; - ACE_OS::strcpy (fp, &fmt[1]); // Skip leading % - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, - format, - va_arg (argp, ACE_INT64)); - else - this_len = ACE_OS::sprintf (bp, - format, - va_arg (argp, ACE_INT64)); - } - #endif /* ! ACE_LACKS_LONGLONG_T */ - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'b': - { - const ACE_TCHAR *fmt = ACE_SSIZE_T_FORMAT_SPECIFIER; - ACE_OS::strcpy (fp, &fmt[1]); // Skip leading % - } - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, - format, - va_arg (argp, ssize_t)); - else - this_len = ACE_OS::sprintf (bp, - format, - va_arg (argp, ssize_t)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case 'B': - { - const ACE_TCHAR *fmt = ACE_SIZE_T_FORMAT_SPECIFIER; - ACE_OS::strcpy (fp, &fmt[1]); // Skip leading % - } - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, - format, - va_arg (argp, size_t)); - else - this_len = ACE_OS::sprintf (bp, - format, - va_arg (argp, size_t)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case ':': - { - // Assume a 32 bit time_t and change if needed. - const ACE_TCHAR *fmt = ACE_TEXT ("%d"); - if (sizeof (time_t) == 8) - fmt = ACE_INT64_FORMAT_SPECIFIER; - - ACE_OS::strcpy (fp, &fmt[1]); // Skip leading % - } - if (can_check) - this_len = ACE_OS::snprintf (bp, bspace, - format, - va_arg (argp, time_t)); - else - this_len = ACE_OS::sprintf (bp, - format, - va_arg (argp, time_t)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case '@': - ACE_OS::strcpy (fp, ACE_TEXT ("p")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, void*)); - else - this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, void*)); - ACE_UPDATE_COUNT (bspace, this_len); - break; - - case '?': - // Stack trace up to this point - { - // skip the frame that we're currently in - ACE_Stack_Trace t(2); - ACE_OS::strcpy (fp, ACE_TEXT ("s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, t.c_str ()); - else - this_len = ACE_OS::sprintf - (bp, format, t.c_str ()); - ACE_UPDATE_COUNT (bspace, this_len); - break; - } - - default: - // So, it's not a legit format specifier after all... - // Copy from the original % to where we are now, then - // continue with whatever comes next. - while (start_format != format_str && bspace > 0) - { - *bp++ = *start_format++; - --bspace; - } - if (bspace > 0) - { - *bp++ = *format_str; - --bspace; - } - break; - } - - // Bump to the next char in the caller's format_str - ++format_str; - } - - if (!skip_nul_locate) - while (*bp != '\0') // Locate end of bp. - ++bp; - } - } - - *bp = '\0'; // Terminate bp, but don't auto-increment this! - - ssize_t result = 0; - - // Check that memory was not corrupted, if it corrupted we can't log anything - // anymore because all our members could be corrupted. - if (bp >= (this->msg_ + ACE_MAXLOGMSGLEN+1)) - { - abort_prog = true; - ACE_OS::fprintf (stderr, - "The following logged message is too long!\n"); - } - else - { - // Copy the message from thread-specific storage into the transfer - // buffer (this can be optimized away by changing other code...). - log_record.msg_data (this->msg ()); - - // Write the to the appropriate location. - result = this->log (log_record, - abort_prog); - } - - if (abort_prog) - { - // Since we are now calling abort instead of exit, this value is - // not used. - ACE_UNUSED_ARG (exit_value); - - // *Always* print a message to stderr if we're aborting. We - // don't use verbose, however, to avoid recursive aborts if - // something is hosed. - log_record.print (ACE_Log_Msg::local_host_, 0, stderr); - ACE_OS::abort (); - } - - return result; -} - -#if !defined (ACE_WIN32) -/** - * @class ACE_Log_Msg_Sig_Guard - * - * @brief For use only by ACE_Log_Msg. - * - * Doesn't require the use of global variables or global - * functions in an application). - */ -class ACE_Log_Msg_Sig_Guard -{ -private: - ACE_Log_Msg_Sig_Guard (void); - ~ACE_Log_Msg_Sig_Guard (void); - - /// Original signal mask. - sigset_t omask_; - - friend ssize_t ACE_Log_Msg::log (ACE_Log_Record &log_record, - int suppress_stderr); -}; - -ACE_Log_Msg_Sig_Guard::ACE_Log_Msg_Sig_Guard (void) -{ -#if !defined (ACE_LACKS_UNIX_SIGNALS) - ACE_OS::sigemptyset (&this->omask_); - -# if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) - ACE_OS::sigprocmask (SIG_BLOCK, - ACE_OS_Object_Manager::default_mask (), - &this->omask_); -# else - ACE_OS::thr_sigsetmask (SIG_BLOCK, - ACE_OS_Object_Manager::default_mask (), - &this->omask_); -# endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */ -#endif /* ACE_LACKS_UNIX_SIGNALS */ -} - -ACE_Log_Msg_Sig_Guard::~ACE_Log_Msg_Sig_Guard (void) -{ -#if !defined (ACE_LACKS_UNIX_SIGNALS) -# if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) - ACE_OS::sigprocmask (SIG_SETMASK, - &this->omask_, - 0); -# else - ACE_OS::thr_sigsetmask (SIG_SETMASK, - &this->omask_, - 0); -# endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */ -#endif /* ! ACE_LACKS_UNIX_SIGNALS */ -} -#endif /* ! ACE_WIN32 */ - -ssize_t -ACE_Log_Msg::log (ACE_Log_Record &log_record, - int suppress_stderr) -{ - ssize_t result = 0; - - // Format the message and print it to stderr and/or ship it off to - // the log_client daemon, and/or print it to the ostream. Of - // course, only print the message if "SILENT" mode is disabled. - if (ACE_BIT_DISABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::SILENT)) - { - bool tracing = this->tracing_enabled (); - this->stop_tracing (); - -#if !defined (ACE_WIN32) - // Make this block signal-safe. - ACE_Log_Msg_Sig_Guard sb; -#endif /* !ACE_WIN32 */ - - // Do the callback, if needed, before acquiring the lock - // to avoid holding the lock during the callback so we don't - // have deadlock if the callback uses the logger. - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::MSG_CALLBACK) - && this->msg_callback () != 0) - this->msg_callback ()->log (log_record); - - // Make sure that the lock is held during all this. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock (), - -1)); - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::STDERR) - && !suppress_stderr) // This is taken care of by our caller. - log_record.print (ACE_Log_Msg::local_host_, - ACE_Log_Msg::flags_, - stderr); - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::CUSTOM) || - ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG) || - ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER)) - { - // Be sure that there is a message_queue_, with multiple threads. - ACE_MT (ACE_Log_Msg_Manager::init_backend ()); - } - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER) || - ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG)) - { - result = - ACE_Log_Msg_Manager::log_backend_->log (log_record); - } - - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::CUSTOM) && - ACE_Log_Msg_Manager::custom_backend_ != 0) - { - result = - ACE_Log_Msg_Manager::custom_backend_->log (log_record); - } - - // This must come last, after the other two print operations - // (see the method for details). - if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, - ACE_Log_Msg::OSTREAM) - && this->msg_ostream () != 0) - log_record.print (ACE_Log_Msg::local_host_, - ACE_Log_Msg::flags_, -#if defined (ACE_LACKS_IOSTREAM_TOTALLY) - static_cast (this->msg_ostream ()) -#else /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - *this->msg_ostream () -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - ); - - if (tracing) - this->start_tracing (); - } - - return result; -} - -// Calls log to do the actual print, but formats first. - -int -ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, - const char *buffer, - size_t size, - const ACE_TCHAR *text) -{ - // Only print the message if hasn't been reset to - // exclude this logging priority. - if (this->log_priority_enabled (log_priority) == 0) - return 0; - - ACE_TCHAR* buf = 0; - const size_t buf_sz = - ACE_Log_Record::MAXLOGMSGLEN - ACE_Log_Record::VERBOSE_LEN - 58; - ACE_NEW_RETURN (buf, ACE_TCHAR[buf_sz], -1); - - ACE_TCHAR *msg_buf = 0; - const size_t text_sz = text ? ACE_OS::strlen(text) : 0; - ACE_NEW_RETURN (msg_buf, - ACE_TCHAR[text_sz + 58], - -1); - - buf[0] = 0; // in case size = 0 - - size_t const len = ACE::format_hexdump - (buffer, size, buf, buf_sz / sizeof (ACE_TCHAR) - text_sz); - - int sz = 0; - - if (text) - sz = ACE_OS::sprintf (msg_buf, - ACE_TEXT ("%s - "), - text); - - sz += ACE_OS::sprintf (msg_buf + sz, - ACE_TEXT ("HEXDUMP ") - ACE_SIZE_T_FORMAT_SPECIFIER - ACE_TEXT (" bytes"), - size); - - if (len < size) - ACE_OS::sprintf (msg_buf + sz, - ACE_TEXT (" (showing first ") - ACE_SIZE_T_FORMAT_SPECIFIER - ACE_TEXT (" bytes)"), - len); - - // Now print out the formatted buffer. - this->log (log_priority, - ACE_TEXT ("%s\n%s"), - msg_buf, - buf); - - delete [] msg_buf; - delete [] buf; - return 0; -} - -void -ACE_Log_Msg::set (const char *filename, - int line, - int status, - int err, - int rs, - ACE_OSTREAM_TYPE *os, - ACE_Log_Msg_Callback *c) -{ - ACE_TRACE ("ACE_Log_Msg::set"); - this->file (filename); - this->linenum (line); - this->op_status (status); - this->errnum (err); - this->restart (rs); - this->msg_ostream (os); - this->msg_callback (c); -} - -void -ACE_Log_Msg::conditional_set (const char *filename, - int line, - int status, - int err) -{ - this->conditional_values_.is_set_ = true; - this->conditional_values_.file_ = filename; - this->conditional_values_.line_ = line; - this->conditional_values_.op_status_ = status; - this->conditional_values_.errnum_ = err; -} - -void -ACE_Log_Msg::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Log_Msg::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("status_ = %d\n"), this->status_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nerrnum_ = %d\n"), this->errnum_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nlinenum_ = %d\n"), this->linenum_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nfile_ = %C\n"), this->file_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmsg_ = %s\n"), this->msg_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nrestart_ = %d\n"), this->restart_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nostream_ = %@\n"), this->ostream_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmsg_callback_ = %@\n"), - this->msg_callback_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprogram_name_ = %s\n"), - this->program_name_ ? this->program_name_ - : ACE_TEXT (""))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nlocal_host_ = %s\n"), - this->local_host_ ? this->local_host_ - : ACE_TEXT (""))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d\n"), this->getpid ())); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nflags_ = 0x%x\n"), this->flags_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntrace_depth_ = %d\n"), - this->trace_depth_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntrace_active_ = %d\n"), - this->trace_active_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntracing_enabled_ = %d\n"), - this->tracing_enabled_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npriority_mask_ = 0x%x\n"), - this->priority_mask_)); - if (this->thr_desc_ != 0 && this->thr_desc_->state () != 0) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_state_ = %d\n"), - this->thr_desc_->state ())); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmsg_off_ = %d\n"), this->msg_off_)); - - // Be sure that there is a message_queue_, with multiple threads. - ACE_MT (ACE_Log_Msg_Manager::init_backend ()); - - ACE_MT (ACE_Log_Msg_Manager::get_lock ()->dump ()); - // Synchronize output operations. - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -void -ACE_Log_Msg::thr_desc (ACE_Thread_Descriptor *td) -{ - this->thr_desc_ = td; - - if (td != 0) - td->acquire_release (); -} - -#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) && defined(ACE_LEGACY_MODE) -ACE_SEH_EXCEPT_HANDLER -ACE_Log_Msg::seh_except_selector (void) -{ - return ACE_OS_Object_Manager::seh_except_selector (); -} - -ACE_SEH_EXCEPT_HANDLER -ACE_Log_Msg::seh_except_selector (ACE_SEH_EXCEPT_HANDLER n) -{ - return ACE_OS_Object_Manager::seh_except_selector (n); -} - -ACE_SEH_EXCEPT_HANDLER -ACE_Log_Msg::seh_except_handler (void) -{ - return ACE_OS_Object_Manager::seh_except_handler (); -} - -ACE_SEH_EXCEPT_HANDLER -ACE_Log_Msg::seh_except_handler (ACE_SEH_EXCEPT_HANDLER n) -{ - return ACE_OS_Object_Manager::seh_except_handler (n); -} -#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS && ACE_LEGACY_MODE */ - -ACE_Log_Msg_Backend * -ACE_Log_Msg::msg_backend (ACE_Log_Msg_Backend *b) -{ - ACE_TRACE ("ACE_Log_Msg::msg_backend"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock (), 0)); - - ACE_Log_Msg_Backend *tmp = ACE_Log_Msg_Manager::custom_backend_; - ACE_Log_Msg_Manager::custom_backend_ = b; - return tmp; -} - -ACE_Log_Msg_Backend * -ACE_Log_Msg::msg_backend (void) -{ - ACE_TRACE ("ACE_Log_Msg::msg_backend"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Log_Msg_Manager::get_lock (), 0)); - - return ACE_Log_Msg_Manager::custom_backend_; -} - -void -ACE_Log_Msg::msg_ostream (ACE_OSTREAM_TYPE *m, bool delete_ostream) -{ - if (this->ostream_ == m) - return; - - if (this->delete_ostream_) - { -#if defined (ACE_LACKS_IOSTREAM_TOTALLY) - ACE_OS::fclose (this->ostream_); -#else - delete this->ostream_; -#endif - } - - this->delete_ostream_ = delete_ostream; - this->ostream_ = m; -} - -void -ACE_Log_Msg::local_host (const ACE_TCHAR *s) -{ - if (s) - { - ACE_OS::free ((void *) ACE_Log_Msg::local_host_); - { - ACE_NO_HEAP_CHECK; - - ACE_ALLOCATOR (ACE_Log_Msg::local_host_, ACE_OS::strdup (s)); - } - } -} - -int -ACE_Log_Msg::log_priority_enabled (ACE_Log_Priority log_priority, - const char *, - ...) -{ - return this->log_priority_enabled (log_priority); -} - -#if defined (ACE_USES_WCHAR) -int -ACE_Log_Msg::log_priority_enabled (ACE_Log_Priority log_priority, - const wchar_t *, - ...) -{ - return this->log_priority_enabled (log_priority); -} -#endif /* ACE_USES_WCHAR */ - -// **************************************************************** - -void -ACE_Log_Msg::init_hook (ACE_OS_Log_Msg_Attributes &attributes -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector - , ACE_SEH_EXCEPT_HANDLER handler -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ) -{ -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - attributes.seh_except_selector_ = selector; - attributes.seh_except_handler_ = handler; -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - if (ACE_Log_Msg::exists ()) - { - ACE_Log_Msg *inherit_log = ACE_LOG_MSG; - attributes.ostream_ = inherit_log->msg_ostream (); - attributes.priority_mask_ = inherit_log->priority_mask (); - attributes.tracing_enabled_ = inherit_log->tracing_enabled (); - attributes.restart_ = inherit_log->restart (); - attributes.trace_depth_ = inherit_log->trace_depth (); - } -} - -void -ACE_Log_Msg::inherit_hook (ACE_OS_Thread_Descriptor *thr_desc, - ACE_OS_Log_Msg_Attributes &attributes) -{ -#if !defined (ACE_THREADS_DONT_INHERIT_LOG_MSG) && \ - !defined (ACE_HAS_MINIMAL_ACE_OS) - // Inherit the logging features if the parent thread has an - // . Note that all of the following operations occur - // within thread-specific storage. - ACE_Log_Msg *new_log = ACE_LOG_MSG; - - // Note that we do not inherit the callback because this might have - // been allocated off of the stack of the original thread, in which - // case all hell would break loose... - - if (attributes.ostream_) - { - new_log->msg_ostream (attributes.ostream_); - new_log->priority_mask (attributes.priority_mask_); - - if (attributes.tracing_enabled_) - new_log->start_tracing (); - - new_log->restart (attributes.restart_); - new_log->trace_depth (attributes.trace_depth_); - } - - // @@ Now the TSS Log_Msg has been created, cache my thread - // descriptor in. - - if (thr_desc != 0) - // This downcast is safe. We do it to avoid having to #include - // ace/Thread_Manager.h. - new_log->thr_desc (static_cast (thr_desc)); - // Block the thread from proceeding until - // thread manager has thread descriptor ready. -#endif /* ! ACE_THREADS_DONT_INHERIT_LOG_MSG && ! ACE_HAS_MINIMAL_ACE_OS */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Log_Msg_Backend.cpp b/dep/src/ace/Log_Msg_Backend.cpp deleted file mode 100644 index 8f7e930ae0d..00000000000 --- a/dep/src/ace/Log_Msg_Backend.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// $Id: Log_Msg_Backend.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg_Backend.h" - -ACE_RCSID(ace, Log_Msg_Backend, "$Id: Log_Msg_Backend.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Log_Msg_Backend::~ACE_Log_Msg_Backend (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Log_Msg_Callback.cpp b/dep/src/ace/Log_Msg_Callback.cpp deleted file mode 100644 index 7d1a57d5f4a..00000000000 --- a/dep/src/ace/Log_Msg_Callback.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// $Id: Log_Msg_Callback.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg_Callback.h" - -ACE_RCSID(ace, Log_Msg_Callback, "$Id: Log_Msg_Callback.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Log_Msg_Callback::~ACE_Log_Msg_Callback (void) -{ -} -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Log_Msg_IPC.cpp b/dep/src/ace/Log_Msg_IPC.cpp deleted file mode 100644 index 7c61ac45979..00000000000 --- a/dep/src/ace/Log_Msg_IPC.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// $Id: Log_Msg_IPC.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg_IPC.h" -#include "ace/Log_Record.h" -#include "ace/CDR_Stream.h" -#include "ace/Truncate.h" - -ACE_RCSID(ace, Log_Msg_IPC, "$Id: Log_Msg_IPC.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Log_Msg_IPC::ACE_Log_Msg_IPC (void) -{ -} - -ACE_Log_Msg_IPC::~ACE_Log_Msg_IPC (void) -{ - (void) this->close (); -} - -int -ACE_Log_Msg_IPC::open (const ACE_TCHAR *logger_key) -{ - ACE_LOG_MSG_IPC_CONNECTOR con; - return con.connect (this->message_queue_, - ACE_LOG_MSG_IPC_ADDR (logger_key)); -} - -int -ACE_Log_Msg_IPC::reset (void) -{ - if (this->message_queue_.get_handle () != ACE_INVALID_HANDLE) - { - // If we don't do this, handles aren't reused on Win32 and the - // server eventually crashes! - return this->close (); - } - return 0; -} - -int -ACE_Log_Msg_IPC::close (void) -{ - return this->message_queue_.close (); -} - -ssize_t -ACE_Log_Msg_IPC::log (ACE_Log_Record &log_record) -{ - // Serialize the log record using a CDR stream, allocate enough - // space for the complete . - size_t const max_payload_size = - 4 // type - + 4 // pid - + 12 // timestamp - + 4 // process id - + 4 // data length -#if defined (ACE_USES_WCHAR) - + (log_record.msg_data_len () * ACE_OutputCDR::wchar_maxbytes()) // message -#else - + log_record.msg_data_len () // message -#endif - + ACE_CDR::MAX_ALIGNMENT; // padding; - - // Insert contents of into payload stream. - ACE_OutputCDR payload (max_payload_size); - payload << log_record; - - // Get the number of bytes used by the CDR stream. If it becomes desireable - // to support payloads more than 4GB, this field will need to be changed - // to a 64-bit value. - ACE_CDR::ULong length = - ACE_Utils::truncate_cast (payload.total_length ()); - - // Send a header so the receiver can determine the byte order and - // size of the incoming CDR stream. - ACE_OutputCDR header (ACE_CDR::MAX_ALIGNMENT + 8); - header << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER); - - // Store the size of the payload that follows - header << ACE_CDR::ULong (length); - - // Use an iovec to send both buffer and payload simultaneously. - iovec iov[2]; - iov[0].iov_base = header.begin ()->rd_ptr (); - iov[0].iov_len = 8; - iov[1].iov_base = payload.begin ()->rd_ptr (); - iov[1].iov_len = length; - -#if defined (ACE_HAS_STREAM_PIPES) - // Use the API if supported to ensure correct message - // queueing according to priority. - - ACE_Str_Buf header_msg (static_cast (header.begin ()->rd_ptr ()), - static_cast (8)); - - ACE_Str_Buf payload_msg (static_cast (payload.begin ()->rd_ptr ()), - static_cast (length)); - - return this->message_queue_.send (&header_msg, - &payload_msg, - static_cast (log_record.priority ()), - MSG_BAND); -#else - // We're running over sockets, so send header and payload - // efficiently using "gather-write". - return this->message_queue_.sendv_n (iov, 2); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/Log_Msg_NT_Event_Log.cpp b/dep/src/ace/Log_Msg_NT_Event_Log.cpp deleted file mode 100644 index c895373c95d..00000000000 --- a/dep/src/ace/Log_Msg_NT_Event_Log.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// $Id: Log_Msg_NT_Event_Log.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/config-all.h" - -#if defined (ACE_HAS_LOG_MSG_NT_EVENT_LOG) - -#include "ace/Log_Msg_NT_Event_Log.h" -#include "ace/Log_Msg.h" -#include "ace/Log_Record.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID(ace, Log_Msg_NT_Event_Log, "$Id: Log_Msg_NT_Event_Log.cpp 80826 2008-03-04 14:51:23Z wotte $") - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_Log_Msg_NT_Event_Log::ACE_Log_Msg_NT_Event_Log (void) - : evlog_handle_(0) -{ -} - -ACE_Log_Msg_NT_Event_Log::~ACE_Log_Msg_NT_Event_Log (void) -{ - this->close (); -} - -int -ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key) -{ - // ACE's "resource module" contains the message resource required - // for event logging. - ACE_TCHAR msg_file [MAXPATHLEN]; - - if (!ACE_TEXT_GetModuleFileName (ACE_OS::get_win32_resource_module (), - msg_file, - MAXPATHLEN)) - return -1; - DWORD msg_file_length = - static_cast ((ACE_OS::strlen (msg_file) + 1) * sizeof (ACE_TCHAR)); - - // If a logger_key has been supplied then we use that as the event - // source name, otherwise we default to the program name. - const ACE_TCHAR *event_source_name = logger_key ? logger_key : ACE_Log_Msg::program_name (); - - // Information is stored in the registry at a location based on the - // program name. - ACE_TCHAR reg_key [MAXPATHLEN]; - ACE_OS::strcpy (reg_key, - ACE_TEXT ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\")); - size_t reg_key_length = ACE_OS::strlen(reg_key); - ACE_OS::strncat (reg_key, - event_source_name, - MAXPATHLEN - reg_key_length); - - // Add the event source to the registry. Note that if this fails it - // is not fatal. The application will still be able to write entries - // to the event log, they just won't be formatted correctly. - HKEY hkey; - ACE_TEXT_RegCreateKey (HKEY_LOCAL_MACHINE, - reg_key, - &hkey); - DWORD flags = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; - ACE_TEXT_RegSetValueEx (hkey, - ACE_TEXT ("TypesSupported"), - 0, - REG_DWORD, - (LPBYTE) &flags, - sizeof (DWORD)); - ACE_TEXT_RegSetValueEx (hkey, - ACE_TEXT ("EventMessageFile"), - 0, - REG_SZ, - (LPBYTE) msg_file, - msg_file_length); - RegCloseKey (hkey); - - // Obtain a handle to the event source. - this->evlog_handle_ = ACE_TEXT_RegisterEventSource (0, - event_source_name); - return this->evlog_handle_ ? 0 : -1; -} - -int -ACE_Log_Msg_NT_Event_Log::reset (void) -{ - return this->close (); -} - -int -ACE_Log_Msg_NT_Event_Log::close (void) -{ - if (this->evlog_handle_ == 0 - || DeregisterEventSource (this->evlog_handle_)) - { - this->evlog_handle_ = 0; - return 0; - } - else - return -1; -} - -ssize_t -ACE_Log_Msg_NT_Event_Log::log (ACE_Log_Record &log_record) -{ - // Make a copy of the log text and replace any newlines with - // CR-LF. Newline characters on their own do not appear correctly in - // the event viewer. We allow for a doubling in the size of the msg - // data for the worst case of all newlines. - const ACE_TCHAR* src_msg_data = log_record.msg_data (); - ACE_TCHAR msg_data [ACE_Log_Record::MAXLOGMSGLEN * 2]; - - for (size_t i = 0, j = 0; - i < log_record.msg_data_len (); - ++i) - { - if (src_msg_data[i] == '\n') - { - msg_data[j++] = '\r'; - msg_data[j++] = '\n'; - } - else - msg_data[j++] = src_msg_data[i]; - } - - // Map the ACE log record type to an event log type. - WORD event_type; - switch (log_record.type ()) - { - case LM_STARTUP: - case LM_SHUTDOWN: - case LM_TRACE: - case LM_DEBUG: - case LM_INFO: - event_type = EVENTLOG_INFORMATION_TYPE; - break; - case LM_NOTICE: - case LM_WARNING: - event_type = EVENTLOG_WARNING_TYPE; - break; - case LM_ERROR: - case LM_CRITICAL: - case LM_ALERT: - case LM_EMERGENCY: - default: - event_type = EVENTLOG_ERROR_TYPE; - break; - } - - // Send the log message to the system event log. - const ACE_TCHAR* msgs [1]; - msgs[0] = msg_data; - - if (ACE_TEXT_ReportEvent (this->evlog_handle_, - event_type, 0, 0, 0, 1, 0, msgs, 0) == 0) - return -1; - else - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_LOG_MSG_NT_EVENT_LOG */ - diff --git a/dep/src/ace/Log_Msg_UNIX_Syslog.cpp b/dep/src/ace/Log_Msg_UNIX_Syslog.cpp deleted file mode 100644 index 715886cef18..00000000000 --- a/dep/src/ace/Log_Msg_UNIX_Syslog.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// $Id: Log_Msg_UNIX_Syslog.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_UNIX_SYSLOG) - -#include "ace/ACE.h" -#include "ace/Log_Msg.h" -#include "ace/Log_Msg_UNIX_Syslog.h" -#include "ace/Log_Record.h" -#include "ace/OS_NS_string.h" -#include "ace/os_include/os_syslog.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// NOTE: -// The ACE_Log_Msg_UNIX_Syslog class can use the openlog(), -// setlogmask(), syslog() and closelog() routines in a thread safe -// manner (versus using openlog_r(), et. al.), as the ACE_Log_Msg -// class uses the lock provided by its local ACE_Log_Msg_Manager -// class when calling the methods of the backend classes. As a -// result, logging semantics with respect to the UNIX syslog -// facility, will be the same for all threads in a process. This -// should not be too limiting, as the ACE_Log_Msg class itself can -// be used to control thread specific logging behavior. - -ACE_Log_Msg_UNIX_Syslog::ACE_Log_Msg_UNIX_Syslog (void) -{ -} - -ACE_Log_Msg_UNIX_Syslog::~ACE_Log_Msg_UNIX_Syslog (void) -{ - (void) this->close (); -} - -int -ACE_Log_Msg_UNIX_Syslog::open (const ACE_TCHAR * logger_key) -{ - if (logger_key == 0) - logger_key = ACE_Log_Msg::program_name (); - - // Initialize the UNIX syslog facility. Default the syslog log - // options LOG_CONS and LOG_PID to be set. There really should be a - // logging strategy option to control the syslog log options, - // however, we'll take the easy way out for now. -#if defined (ACE_USES_WCHAR) - openlog (ACE_TEXT_ALWAYS_CHAR (logger_key), - LOG_CONS|LOG_PID, - ACE_DEFAULT_SYSLOG_FACILITY); -#else - openlog (const_cast (logger_key), - LOG_CONS|LOG_PID, - ACE_DEFAULT_SYSLOG_FACILITY); -#endif /* ACE_USES_WCHAR */ - - // Enable logging of all syslog priorities. If logging of all - // priorities is not desired, use the ACE_Log_Msg::priority_mask() - // method to control the log output sent to the syslog daemon via - // the log() method, or use the system's syslog.conf file to select - // desired level of information. - -#if !defined (ACE_LACKS_SETLOGMASK) - (void) setlogmask (LOG_UPTO (LOG_DEBUG)); -#endif /* ACE_LACKS_SETLOGMASK */ - - return 0; -} - -int -ACE_Log_Msg_UNIX_Syslog::reset (void) -{ - return this->close (); -} - -int -ACE_Log_Msg_UNIX_Syslog::close (void) -{ - closelog(); - return 0; -} - -ssize_t -ACE_Log_Msg_UNIX_Syslog::log (ACE_Log_Record &log_record) -{ - int syslog_priority = this->convert_log_priority (log_record.type ()); - u_long flags = ACE_LOG_MSG->flags (); - - // The UNIX syslog() facility does not support multi-line messages. - // Break up the message data into separate lines and send each line - // to the syslog daemon. - - ACE_TCHAR message[ACE_Log_Record::MAXVERBOSELOGMSGLEN]; - ACE_OS::strcpy (message, log_record.msg_data ()); - ACE_TCHAR *strtokp = 0; - - for (ACE_TCHAR *line = ACE_OS::strtok_r (message, - ACE_TEXT ("\n"), - &strtokp); - line != 0; - line = ACE_OS::strtok_r (0, - ACE_TEXT ("\n"), - &strtokp)) - { - // Format the message line. Note that the processing for - // VERBOSE is the same as for VERBOSE_LITE, since syslog() - // already provides us with the hostname and PID. However, the - // timestamp is duplicated (albeit a shortened version) to - // provide a timestamp with greater precision than that provided - // by syslog(). - if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::VERBOSE) - || ACE_BIT_ENABLED (flags, ACE_Log_Msg::VERBOSE_LITE)) - { - ACE_TCHAR date_and_time[35]; - if (0 == ACE::timestamp (date_and_time, sizeof (date_and_time), 1)) - ACE_OS::strcpy (date_and_time, ACE_TEXT ("