zeroc-ice 3.7.0 → 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (684) hide show
  1. checksums.yaml +4 -4
  2. data/ICE_LICENSE +1 -1
  3. data/bin/slice2rb +1 -1
  4. data/ext/Communicator.cpp +72 -2
  5. data/ext/Communicator.h +1 -1
  6. data/ext/Config.h +11 -1
  7. data/ext/Connection.cpp +22 -2
  8. data/ext/Connection.h +4 -1
  9. data/ext/Endpoint.cpp +1 -1
  10. data/ext/Endpoint.h +1 -1
  11. data/ext/ImplicitContext.cpp +1 -1
  12. data/ext/ImplicitContext.h +1 -1
  13. data/ext/Init.cpp +1 -1
  14. data/ext/Logger.cpp +1 -1
  15. data/ext/Logger.h +1 -1
  16. data/ext/Operation.cpp +1 -1
  17. data/ext/Operation.h +1 -1
  18. data/ext/Properties.cpp +1 -1
  19. data/ext/Properties.h +1 -1
  20. data/ext/Proxy.cpp +70 -1
  21. data/ext/Proxy.h +1 -1
  22. data/ext/Slice.cpp +1 -1
  23. data/ext/Slice.h +1 -1
  24. data/ext/Types.cpp +21 -5
  25. data/ext/Types.h +1 -1
  26. data/ext/Util.cpp +1 -1
  27. data/ext/Util.h +1 -1
  28. data/ext/ValueFactoryManager.cpp +2 -2
  29. data/ext/ValueFactoryManager.h +2 -2
  30. data/ext/ice/cpp/include/Ice/Application.h +234 -76
  31. data/ext/ice/cpp/include/Ice/AsyncResult.h +77 -1
  32. data/ext/ice/cpp/include/Ice/AsyncResultF.h +1 -1
  33. data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +35 -2
  34. data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +1 -1
  35. data/ext/ice/cpp/include/Ice/Buffer.h +1 -1
  36. data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +43 -1
  37. data/ext/ice/cpp/include/Ice/Comparable.h +81 -1
  38. data/ext/ice/cpp/include/Ice/Config.h +8 -1
  39. data/ext/ice/cpp/include/Ice/ConnectionAsync.h +97 -1
  40. data/ext/ice/cpp/include/Ice/ConnectionIF.h +3 -1
  41. data/ext/ice/cpp/include/Ice/ConsoleUtil.h +1 -1
  42. data/ext/ice/cpp/include/Ice/DefaultValueFactory.h +1 -1
  43. data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +17 -2
  44. data/ext/ice/cpp/include/Ice/Dispatcher.h +22 -2
  45. data/ext/ice/cpp/include/Ice/DynamicLibrary.h +1 -1
  46. data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +1 -1
  47. data/ext/ice/cpp/include/Ice/Exception.h +57 -15
  48. data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +19 -1
  49. data/ext/ice/cpp/include/Ice/FactoryTable.h +12 -2
  50. data/ext/ice/cpp/include/Ice/FactoryTableInit.h +1 -1
  51. data/ext/ice/cpp/include/Ice/Format.h +13 -14
  52. data/ext/ice/cpp/include/Ice/Functional.h +6 -1
  53. data/ext/ice/cpp/include/Ice/GCObject.h +1 -1
  54. data/ext/ice/cpp/include/Ice/Handle.h +1 -1
  55. data/ext/ice/cpp/include/Ice/Ice.h +1 -1
  56. data/ext/ice/cpp/include/Ice/IconvStringConverter.h +38 -3
  57. data/ext/ice/cpp/include/Ice/Incoming.h +15 -2
  58. data/ext/ice/cpp/include/Ice/IncomingAsync.h +37 -4
  59. data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +1 -1
  60. data/ext/ice/cpp/include/Ice/Initialize.h +764 -98
  61. data/ext/ice/cpp/include/Ice/InputStream.h +637 -112
  62. data/ext/ice/cpp/include/Ice/InstanceF.h +1 -1
  63. data/ext/ice/cpp/include/Ice/InterfaceByValue.h +17 -1
  64. data/ext/ice/cpp/include/Ice/LocalObject.h +5 -1
  65. data/ext/ice/cpp/include/Ice/LocalObjectF.h +1 -1
  66. data/ext/ice/cpp/include/Ice/LoggerUtil.h +37 -6
  67. data/ext/ice/cpp/include/Ice/MetricsAdminI.h +3 -1
  68. data/ext/ice/cpp/include/Ice/MetricsFunctional.h +3 -1
  69. data/ext/ice/cpp/include/Ice/MetricsObserverI.h +3 -1
  70. data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +46 -23
  71. data/ext/ice/cpp/include/Ice/Object.h +338 -47
  72. data/ext/ice/cpp/include/Ice/ObjectF.h +5 -1
  73. data/ext/ice/cpp/include/Ice/ObserverHelper.h +1 -1
  74. data/ext/ice/cpp/include/Ice/Optional.h +22 -6
  75. data/ext/ice/cpp/include/Ice/OutgoingAsync.h +15 -1
  76. data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +1 -1
  77. data/ext/ice/cpp/include/Ice/OutputStream.h +436 -92
  78. data/ext/ice/cpp/include/Ice/Protocol.h +31 -1
  79. data/ext/ice/cpp/include/Ice/Proxy.h +2244 -190
  80. data/ext/ice/cpp/include/Ice/ProxyF.h +3 -1
  81. data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +1 -1
  82. data/ext/ice/cpp/include/Ice/ProxyHandle.h +10 -1
  83. data/ext/ice/cpp/include/Ice/ReferenceF.h +1 -1
  84. data/ext/ice/cpp/include/Ice/RegisterPlugins.h +67 -9
  85. data/ext/ice/cpp/include/Ice/RequestHandlerF.h +1 -1
  86. data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +1 -1
  87. data/ext/ice/cpp/include/Ice/SHA1.h +1 -1
  88. data/ext/ice/cpp/include/Ice/ServantManagerF.h +1 -1
  89. data/ext/ice/cpp/include/Ice/Service.h +267 -138
  90. data/ext/ice/cpp/include/Ice/SliceChecksums.h +5 -1
  91. data/ext/ice/cpp/include/Ice/SlicedData.h +80 -33
  92. data/ext/ice/cpp/include/Ice/SlicedDataF.h +4 -1
  93. data/ext/ice/cpp/include/Ice/StreamHelpers.h +324 -116
  94. data/ext/ice/cpp/include/Ice/StringConverter.h +32 -1
  95. data/ext/ice/cpp/include/Ice/ThreadPoolF.h +1 -1
  96. data/ext/ice/cpp/include/Ice/UUID.h +2 -1
  97. data/ext/ice/cpp/include/Ice/UniquePtr.h +2 -2
  98. data/ext/ice/cpp/include/Ice/UniqueRef.h +6 -2
  99. data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +6 -1
  100. data/ext/ice/cpp/include/Ice/Value.h +41 -1
  101. data/ext/ice/cpp/include/Ice/ValueF.h +3 -1
  102. data/ext/ice/cpp/include/IceSSL/Config.h +1 -1
  103. data/ext/ice/cpp/include/IceSSL/IceSSL.h +1 -1
  104. data/ext/ice/cpp/include/IceSSL/OpenSSL.h +75 -53
  105. data/ext/ice/cpp/include/IceSSL/Plugin.h +323 -218
  106. data/ext/ice/cpp/include/IceSSL/SChannel.h +34 -27
  107. data/ext/ice/cpp/include/IceSSL/SecureTransport.h +35 -28
  108. data/ext/ice/cpp/include/IceSSL/UWP.h +33 -24
  109. data/ext/ice/cpp/include/IceUtil/Atomic.h +1 -1
  110. data/ext/ice/cpp/include/IceUtil/Cond.h +1 -1
  111. data/ext/ice/cpp/include/IceUtil/Config.h +11 -3
  112. data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +1 -1
  113. data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +1 -1
  114. data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +59 -31
  115. data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +1 -1
  116. data/ext/ice/cpp/include/IceUtil/Exception.h +1 -1
  117. data/ext/ice/cpp/include/IceUtil/FileUtil.h +1 -1
  118. data/ext/ice/cpp/include/IceUtil/Functional.h +1 -1
  119. data/ext/ice/cpp/include/IceUtil/Handle.h +1 -1
  120. data/ext/ice/cpp/include/IceUtil/IceUtil.h +1 -1
  121. data/ext/ice/cpp/include/IceUtil/InputUtil.h +1 -1
  122. data/ext/ice/cpp/include/IceUtil/Iterator.h +1 -1
  123. data/ext/ice/cpp/include/IceUtil/Lock.h +1 -1
  124. data/ext/ice/cpp/include/IceUtil/Monitor.h +1 -1
  125. data/ext/ice/cpp/include/IceUtil/Mutex.h +2 -5
  126. data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +1 -1
  127. data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +1 -1
  128. data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +1 -1
  129. data/ext/ice/cpp/include/IceUtil/Optional.h +95 -1
  130. data/ext/ice/cpp/include/IceUtil/Options.h +1 -1
  131. data/ext/ice/cpp/include/IceUtil/OutputUtil.h +1 -1
  132. data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +1 -1
  133. data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +1 -1
  134. data/ext/ice/cpp/include/IceUtil/Random.h +1 -1
  135. data/ext/ice/cpp/include/IceUtil/RecMutex.h +1 -1
  136. data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +4 -4
  137. data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +5 -3
  138. data/ext/ice/cpp/include/IceUtil/ScopedArray.h +1 -1
  139. data/ext/ice/cpp/include/IceUtil/Shared.h +1 -1
  140. data/ext/ice/cpp/include/IceUtil/StopWatch.h +1 -1
  141. data/ext/ice/cpp/include/IceUtil/StringConverter.h +106 -86
  142. data/ext/ice/cpp/include/IceUtil/StringUtil.h +1 -1
  143. data/ext/ice/cpp/include/IceUtil/Thread.h +1 -1
  144. data/ext/ice/cpp/include/IceUtil/ThreadException.h +1 -1
  145. data/ext/ice/cpp/include/IceUtil/Time.h +1 -1
  146. data/ext/ice/cpp/include/IceUtil/Timer.h +5 -1
  147. data/ext/ice/cpp/include/IceUtil/UUID.h +5 -1
  148. data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +1 -1
  149. data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +80 -20
  150. data/ext/ice/cpp/include/generated/Ice/Communicator.h +927 -130
  151. data/ext/ice/cpp/include/generated/Ice/CommunicatorF.h +13 -5
  152. data/ext/ice/cpp/include/generated/Ice/Connection.h +990 -194
  153. data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +21 -9
  154. data/ext/ice/cpp/include/generated/Ice/Current.h +180 -17
  155. data/ext/ice/cpp/include/generated/Ice/Endpoint.h +484 -118
  156. data/ext/ice/cpp/include/generated/Ice/EndpointF.h +41 -17
  157. data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +29 -3
  158. data/ext/ice/cpp/include/generated/Ice/FacetMap.h +11 -5
  159. data/ext/ice/cpp/include/generated/Ice/Identity.h +56 -7
  160. data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +150 -28
  161. data/ext/ice/cpp/include/generated/Ice/ImplicitContextF.h +13 -5
  162. data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +629 -83
  163. data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +19 -7
  164. data/ext/ice/cpp/include/generated/Ice/LocalException.h +5104 -794
  165. data/ext/ice/cpp/include/generated/Ice/Locator.h +2222 -443
  166. data/ext/ice/cpp/include/generated/Ice/LocatorF.h +27 -9
  167. data/ext/ice/cpp/include/generated/Ice/Logger.h +104 -26
  168. data/ext/ice/cpp/include/generated/Ice/LoggerF.h +13 -5
  169. data/ext/ice/cpp/include/generated/Ice/Metrics.h +2534 -455
  170. data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +1004 -126
  171. data/ext/ice/cpp/include/generated/Ice/ObjectAdapterF.h +13 -5
  172. data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +72 -12
  173. data/ext/ice/cpp/include/generated/Ice/Plugin.h +142 -28
  174. data/ext/ice/cpp/include/generated/Ice/PluginF.h +17 -7
  175. data/ext/ice/cpp/include/generated/Ice/Process.h +511 -71
  176. data/ext/ice/cpp/include/generated/Ice/ProcessF.h +18 -6
  177. data/ext/ice/cpp/include/generated/Ice/Properties.h +306 -58
  178. data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +737 -121
  179. data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +22 -8
  180. data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +1526 -279
  181. data/ext/ice/cpp/include/generated/Ice/Router.h +1009 -198
  182. data/ext/ice/cpp/include/generated/Ice/RouterF.h +18 -6
  183. data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +174 -18
  184. data/ext/ice/cpp/include/generated/Ice/ServantLocatorF.h +13 -5
  185. data/ext/ice/cpp/include/generated/Ice/SliceChecksumDict.h +13 -3
  186. data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +177 -23
  187. data/ext/ice/cpp/include/generated/Ice/Version.h +43 -13
  188. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +71 -15
  189. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +13 -5
  190. data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +39 -9
  191. data/ext/ice/cpp/src/Ice/ACM.cpp +12 -3
  192. data/ext/ice/cpp/src/Ice/ACM.h +1 -1
  193. data/ext/ice/cpp/src/Ice/ACMF.h +1 -1
  194. data/ext/ice/cpp/src/Ice/Acceptor.cpp +1 -1
  195. data/ext/ice/cpp/src/Ice/Acceptor.h +1 -1
  196. data/ext/ice/cpp/src/Ice/AcceptorF.h +1 -1
  197. data/ext/ice/cpp/src/Ice/ArgVector.cpp +1 -1
  198. data/ext/ice/cpp/src/Ice/ArgVector.h +1 -1
  199. data/ext/ice/cpp/src/Ice/AsyncResult.cpp +1 -1
  200. data/ext/ice/cpp/src/Ice/Base64.cpp +1 -1
  201. data/ext/ice/cpp/src/Ice/Base64.h +1 -1
  202. data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +1 -1
  203. data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +1 -1
  204. data/ext/ice/cpp/src/Ice/Buffer.cpp +1 -1
  205. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +3 -3
  206. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +1 -1
  207. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
  208. data/ext/ice/cpp/src/Ice/Communicator.cpp +6 -4
  209. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +3 -3
  210. data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +34 -13
  211. data/ext/ice/cpp/src/Ice/CommunicatorI.h +10 -10
  212. data/ext/ice/cpp/src/Ice/Cond.cpp +1 -1
  213. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +11 -6
  214. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
  215. data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +1 -1
  216. data/ext/ice/cpp/src/Ice/Connection.cpp +27 -11
  217. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +3 -3
  218. data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +24 -19
  219. data/ext/ice/cpp/src/Ice/ConnectionFactory.h +1 -1
  220. data/ext/ice/cpp/src/Ice/ConnectionFactoryF.h +1 -1
  221. data/ext/ice/cpp/src/Ice/ConnectionI.cpp +45 -37
  222. data/ext/ice/cpp/src/Ice/ConnectionI.h +10 -8
  223. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +1 -1
  224. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +1 -1
  225. data/ext/ice/cpp/src/Ice/Connector.cpp +1 -1
  226. data/ext/ice/cpp/src/Ice/Connector.h +1 -1
  227. data/ext/ice/cpp/src/Ice/ConnectorF.h +1 -1
  228. data/ext/ice/cpp/src/Ice/CountDownLatch.cpp +1 -1
  229. data/ext/ice/cpp/src/Ice/Current.cpp +3 -3
  230. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +5 -7
  231. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +1 -1
  232. data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +1 -1
  233. data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +1 -1
  234. data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +1 -1
  235. data/ext/ice/cpp/src/Ice/Endpoint.cpp +24 -10
  236. data/ext/ice/cpp/src/Ice/EndpointF.cpp +3 -3
  237. data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +1 -1
  238. data/ext/ice/cpp/src/Ice/EndpointFactory.h +1 -1
  239. data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +1 -1
  240. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +7 -13
  241. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +1 -1
  242. data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +1 -1
  243. data/ext/ice/cpp/src/Ice/EndpointI.cpp +2 -2
  244. data/ext/ice/cpp/src/Ice/EndpointI.h +5 -5
  245. data/ext/ice/cpp/src/Ice/EndpointIF.h +1 -1
  246. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +3 -3
  247. data/ext/ice/cpp/src/Ice/EventHandler.cpp +1 -1
  248. data/ext/ice/cpp/src/Ice/EventHandler.h +1 -1
  249. data/ext/ice/cpp/src/Ice/EventHandlerF.h +1 -1
  250. data/ext/ice/cpp/src/Ice/Exception.cpp +1 -1
  251. data/ext/ice/cpp/src/Ice/FacetMap.cpp +3 -3
  252. data/ext/ice/cpp/src/Ice/FactoryTable.cpp +1 -1
  253. data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +1 -1
  254. data/ext/ice/cpp/src/Ice/GCObject.cpp +1 -1
  255. data/ext/ice/cpp/src/Ice/HashUtil.h +1 -1
  256. data/ext/ice/cpp/src/Ice/HttpParser.cpp +1 -1
  257. data/ext/ice/cpp/src/Ice/HttpParser.h +1 -1
  258. data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +24 -29
  259. data/ext/ice/cpp/src/Ice/IPEndpointI.h +5 -5
  260. data/ext/ice/cpp/src/Ice/IPEndpointIF.h +1 -1
  261. data/ext/ice/cpp/src/Ice/IconvStringConverter.cpp +1 -1
  262. data/ext/ice/cpp/src/Ice/Identity.cpp +3 -3
  263. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +6 -4
  264. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +3 -3
  265. data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +2 -13
  266. data/ext/ice/cpp/src/Ice/ImplicitContextI.h +1 -1
  267. data/ext/ice/cpp/src/Ice/Incoming.cpp +1 -1
  268. data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +1 -1
  269. data/ext/ice/cpp/src/Ice/IncomingRequest.h +1 -1
  270. data/ext/ice/cpp/src/Ice/Initialize.cpp +10 -16
  271. data/ext/ice/cpp/src/Ice/InputStream.cpp +1 -1
  272. data/ext/ice/cpp/src/Ice/Instance.cpp +13 -34
  273. data/ext/ice/cpp/src/Ice/Instance.h +1 -1
  274. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +33 -13
  275. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +3 -3
  276. data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1 -1
  277. data/ext/ice/cpp/src/Ice/InstrumentationI.h +1 -1
  278. data/ext/ice/cpp/src/Ice/LocalException.cpp +279 -279
  279. data/ext/ice/cpp/src/Ice/LocalObject.cpp +1 -1
  280. data/ext/ice/cpp/src/Ice/Locator.cpp +287 -174
  281. data/ext/ice/cpp/src/Ice/LocatorF.cpp +3 -3
  282. data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +4 -9
  283. data/ext/ice/cpp/src/Ice/LocatorInfo.h +1 -1
  284. data/ext/ice/cpp/src/Ice/LocatorInfoF.h +1 -1
  285. data/ext/ice/cpp/src/Ice/Logger.cpp +6 -4
  286. data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +1 -1
  287. data/ext/ice/cpp/src/Ice/LoggerAdminI.h +1 -1
  288. data/ext/ice/cpp/src/Ice/LoggerF.cpp +3 -3
  289. data/ext/ice/cpp/src/Ice/LoggerI.cpp +1 -1
  290. data/ext/ice/cpp/src/Ice/LoggerI.h +1 -1
  291. data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +1 -1
  292. data/ext/ice/cpp/src/Ice/Metrics.cpp +297 -109
  293. data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +2 -7
  294. data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +1 -1
  295. data/ext/ice/cpp/src/Ice/Network.cpp +188 -225
  296. data/ext/ice/cpp/src/Ice/Network.h +3 -12
  297. data/ext/ice/cpp/src/Ice/NetworkF.h +1 -1
  298. data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +1 -1
  299. data/ext/ice/cpp/src/Ice/NetworkProxy.h +1 -1
  300. data/ext/ice/cpp/src/Ice/NetworkProxyF.h +1 -1
  301. data/ext/ice/cpp/src/Ice/Object.cpp +7 -4
  302. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +6 -4
  303. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +3 -3
  304. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +53 -19
  305. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +1 -1
  306. data/ext/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +1 -1
  307. data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +116 -150
  308. data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +11 -11
  309. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +6 -4
  310. data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +1 -1
  311. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +25 -42
  312. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +2 -2
  313. data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +1 -1
  314. data/ext/ice/cpp/src/Ice/OutputStream.cpp +1 -1
  315. data/ext/ice/cpp/src/Ice/Plugin.cpp +9 -5
  316. data/ext/ice/cpp/src/Ice/PluginF.cpp +3 -3
  317. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +15 -34
  318. data/ext/ice/cpp/src/Ice/PluginManagerI.h +3 -3
  319. data/ext/ice/cpp/src/Ice/Process.cpp +69 -40
  320. data/ext/ice/cpp/src/Ice/ProcessF.cpp +3 -3
  321. data/ext/ice/cpp/src/Ice/Properties.cpp +6 -4
  322. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +89 -54
  323. data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +1 -1
  324. data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +1 -1
  325. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +3 -3
  326. data/ext/ice/cpp/src/Ice/PropertiesI.cpp +15 -21
  327. data/ext/ice/cpp/src/Ice/PropertiesI.h +10 -10
  328. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +4 -2
  329. data/ext/ice/cpp/src/Ice/PropertyNames.h +2 -2
  330. data/ext/ice/cpp/src/Ice/Protocol.cpp +5 -13
  331. data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +1 -1
  332. data/ext/ice/cpp/src/Ice/ProtocolInstance.h +1 -1
  333. data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +1 -1
  334. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +1 -1
  335. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +1 -1
  336. data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +1 -1
  337. data/ext/ice/cpp/src/Ice/Proxy.cpp +46 -1
  338. data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +1 -1
  339. data/ext/ice/cpp/src/Ice/ProxyFactory.h +1 -1
  340. data/ext/ice/cpp/src/Ice/Reference.cpp +56 -6
  341. data/ext/ice/cpp/src/Ice/Reference.h +13 -2
  342. data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +51 -90
  343. data/ext/ice/cpp/src/Ice/ReferenceFactory.h +1 -1
  344. data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +1 -1
  345. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.cpp +1 -1
  346. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.h +1 -1
  347. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +203 -117
  348. data/ext/ice/cpp/src/Ice/ReplyStatus.h +1 -1
  349. data/ext/ice/cpp/src/Ice/RequestHandler.cpp +1 -1
  350. data/ext/ice/cpp/src/Ice/RequestHandler.h +1 -1
  351. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +1 -1
  352. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +1 -1
  353. data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +1 -1
  354. data/ext/ice/cpp/src/Ice/ResponseHandler.h +1 -1
  355. data/ext/ice/cpp/src/Ice/RetryQueue.cpp +1 -1
  356. data/ext/ice/cpp/src/Ice/RetryQueue.h +1 -1
  357. data/ext/ice/cpp/src/Ice/RetryQueueF.h +1 -1
  358. data/ext/ice/cpp/src/Ice/Router.cpp +167 -89
  359. data/ext/ice/cpp/src/Ice/RouterF.cpp +3 -3
  360. data/ext/ice/cpp/src/Ice/RouterInfo.cpp +6 -28
  361. data/ext/ice/cpp/src/Ice/RouterInfo.h +1 -3
  362. data/ext/ice/cpp/src/Ice/RouterInfoF.h +1 -1
  363. data/ext/ice/cpp/src/Ice/SHA1.cpp +1 -1
  364. data/ext/ice/cpp/src/Ice/Selector.cpp +19 -26
  365. data/ext/ice/cpp/src/Ice/Selector.h +1 -1
  366. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +6 -4
  367. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +3 -3
  368. data/ext/ice/cpp/src/Ice/ServantManager.cpp +15 -31
  369. data/ext/ice/cpp/src/Ice/ServantManager.h +1 -1
  370. data/ext/ice/cpp/src/Ice/SharedContext.h +1 -1
  371. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +3 -3
  372. data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +1 -1
  373. data/ext/ice/cpp/src/Ice/SlicedData.cpp +1 -1
  374. data/ext/ice/cpp/src/Ice/StreamSocket.cpp +32 -52
  375. data/ext/ice/cpp/src/Ice/StreamSocket.h +1 -1
  376. data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +10 -1
  377. data/ext/ice/cpp/src/Ice/StringUtil.h +1 -1
  378. data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +1 -1
  379. data/ext/ice/cpp/src/Ice/SysLoggerI.h +1 -1
  380. data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +5 -13
  381. data/ext/ice/cpp/src/Ice/TcpAcceptor.h +1 -1
  382. data/ext/ice/cpp/src/Ice/TcpConnector.cpp +1 -1
  383. data/ext/ice/cpp/src/Ice/TcpConnector.h +1 -1
  384. data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +8 -11
  385. data/ext/ice/cpp/src/Ice/TcpEndpointI.h +2 -2
  386. data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +1 -1
  387. data/ext/ice/cpp/src/Ice/TcpTransceiver.h +1 -1
  388. data/ext/ice/cpp/src/Ice/Thread.cpp +1 -1
  389. data/ext/ice/cpp/src/Ice/ThreadPool.cpp +13 -13
  390. data/ext/ice/cpp/src/Ice/ThreadPool.h +1 -1
  391. data/ext/ice/cpp/src/Ice/Timer.cpp +1 -1
  392. data/ext/ice/cpp/src/Ice/TraceLevels.cpp +1 -1
  393. data/ext/ice/cpp/src/Ice/TraceLevels.h +1 -1
  394. data/ext/ice/cpp/src/Ice/TraceLevelsF.h +1 -1
  395. data/ext/ice/cpp/src/Ice/TraceUtil.cpp +1 -1
  396. data/ext/ice/cpp/src/Ice/TraceUtil.h +1 -1
  397. data/ext/ice/cpp/src/Ice/Transceiver.cpp +1 -1
  398. data/ext/ice/cpp/src/Ice/Transceiver.h +1 -1
  399. data/ext/ice/cpp/src/Ice/TransceiverF.h +1 -1
  400. data/ext/ice/cpp/src/Ice/UdpConnector.cpp +1 -1
  401. data/ext/ice/cpp/src/Ice/UdpConnector.h +1 -1
  402. data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +19 -27
  403. data/ext/ice/cpp/src/Ice/UdpEndpointI.h +2 -2
  404. data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +17 -54
  405. data/ext/ice/cpp/src/Ice/UdpTransceiver.h +1 -1
  406. data/ext/ice/cpp/src/Ice/Value.cpp +1 -1
  407. data/ext/ice/cpp/src/Ice/ValueFactory.cpp +9 -5
  408. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +3 -6
  409. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.h +2 -2
  410. data/ext/ice/cpp/src/Ice/Version.cpp +3 -3
  411. data/ext/ice/cpp/src/Ice/VirtualShared.h +1 -1
  412. data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +1 -1
  413. data/ext/ice/cpp/src/Ice/WSAcceptor.h +1 -1
  414. data/ext/ice/cpp/src/Ice/WSConnector.cpp +1 -1
  415. data/ext/ice/cpp/src/Ice/WSConnector.h +1 -1
  416. data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +4 -5
  417. data/ext/ice/cpp/src/Ice/WSEndpoint.h +2 -2
  418. data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +8 -9
  419. data/ext/ice/cpp/src/Ice/WSTransceiver.h +1 -1
  420. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +85 -27
  421. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +599 -113
  422. data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +1 -1
  423. data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +1 -1
  424. data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +1 -1
  425. data/ext/ice/cpp/src/IceDiscovery/LookupI.h +1 -1
  426. data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +1 -1
  427. data/ext/ice/cpp/src/IceDiscovery/PluginI.h +1 -1
  428. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +70 -24
  429. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +635 -69
  430. data/ext/ice/cpp/src/IceLocatorDiscovery/Plugin.h +1 -1
  431. data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +71 -9
  432. data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +2 -4
  433. data/ext/ice/cpp/src/IceSSL/AcceptorI.h +1 -1
  434. data/ext/ice/cpp/src/IceSSL/CertificateI.cpp +1 -1
  435. data/ext/ice/cpp/src/IceSSL/CertificateI.h +1 -1
  436. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +6 -4
  437. data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +3 -3
  438. data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +2 -4
  439. data/ext/ice/cpp/src/IceSSL/ConnectorI.h +1 -1
  440. data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +2 -2
  441. data/ext/ice/cpp/src/IceSSL/EndpointI.h +2 -2
  442. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +6 -4
  443. data/ext/ice/cpp/src/IceSSL/Instance.cpp +1 -1
  444. data/ext/ice/cpp/src/IceSSL/Instance.h +1 -1
  445. data/ext/ice/cpp/src/IceSSL/InstanceF.h +1 -1
  446. data/ext/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +1 -1
  447. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +1 -1
  448. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.h +1 -1
  449. data/ext/ice/cpp/src/IceSSL/OpenSSLEngineF.h +1 -1
  450. data/ext/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +1 -1
  451. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +25 -62
  452. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +1 -1
  453. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +1 -1
  454. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.h +1 -1
  455. data/ext/ice/cpp/src/IceSSL/PluginI.cpp +1 -1
  456. data/ext/ice/cpp/src/IceSSL/PluginI.h +1 -1
  457. data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +1 -1
  458. data/ext/ice/cpp/src/IceSSL/RFC2253.h +1 -1
  459. data/ext/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +1 -1
  460. data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +1 -1
  461. data/ext/ice/cpp/src/IceSSL/SChannelEngine.h +1 -1
  462. data/ext/ice/cpp/src/IceSSL/SChannelEngineF.h +1 -1
  463. data/ext/ice/cpp/src/IceSSL/SChannelPluginI.cpp +1 -1
  464. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +19 -27
  465. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +1 -1
  466. data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +7 -16
  467. data/ext/ice/cpp/src/IceSSL/SSLEngine.h +1 -1
  468. data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +1 -1
  469. data/ext/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +1 -1
  470. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +1 -1
  471. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.h +1 -1
  472. data/ext/ice/cpp/src/IceSSL/SecureTransportEngineF.h +1 -1
  473. data/ext/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +1 -1
  474. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +1 -1
  475. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +1 -1
  476. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +7 -10
  477. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.h +1 -1
  478. data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +4 -5
  479. data/ext/ice/cpp/src/IceSSL/TrustManager.h +1 -1
  480. data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +1 -1
  481. data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +1 -1
  482. data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +1 -1
  483. data/ext/ice/cpp/src/IceSSL/UWPEngine.h +1 -1
  484. data/ext/ice/cpp/src/IceSSL/UWPEngineF.h +1 -1
  485. data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +1 -1
  486. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +1 -1
  487. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +1 -1
  488. data/ext/ice/cpp/src/IceSSL/Util.cpp +1 -1
  489. data/ext/ice/cpp/src/IceSSL/Util.h +1 -1
  490. data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +1 -1
  491. data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +1 -1
  492. data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +1 -1
  493. data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +1 -1
  494. data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +5 -5
  495. data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +1 -1
  496. data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +1 -1
  497. data/ext/ice/cpp/src/IceUtil/Options.cpp +1 -1
  498. data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +1 -1
  499. data/ext/ice/cpp/src/IceUtil/Random.cpp +1 -1
  500. data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +1 -5
  501. data/ext/ice/cpp/src/IceUtil/Shared.cpp +1 -1
  502. data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +1 -1
  503. data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +1 -1
  504. data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +1 -1
  505. data/ext/ice/cpp/src/IceUtil/Time.cpp +1 -1
  506. data/ext/ice/cpp/src/IceUtil/UUID.cpp +3 -3
  507. data/ext/ice/cpp/src/IceUtil/Unicode.cpp +1 -1
  508. data/ext/ice/cpp/src/IceUtil/Unicode.h +1 -1
  509. data/ext/ice/cpp/src/IceUtil/UtilException.cpp +1 -1
  510. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +160 -150
  511. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.h +9 -8
  512. data/ext/ice/cpp/src/Slice/Checksum.cpp +1 -1
  513. data/ext/ice/cpp/src/Slice/Checksum.h +1 -1
  514. data/ext/ice/cpp/src/Slice/FileTracker.cpp +1 -1
  515. data/ext/ice/cpp/src/Slice/FileTracker.h +1 -1
  516. data/ext/ice/cpp/src/Slice/Grammar.cpp +567 -585
  517. data/ext/ice/cpp/src/Slice/Grammar.h +2 -2
  518. data/ext/ice/cpp/src/Slice/GrammarUtil.h +1 -1
  519. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +131 -47
  520. data/ext/ice/cpp/src/Slice/JavaUtil.h +10 -5
  521. data/ext/ice/cpp/src/Slice/MD5.cpp +1 -1
  522. data/ext/ice/cpp/src/Slice/MD5.h +1 -1
  523. data/ext/ice/cpp/src/Slice/PHPUtil.cpp +1 -1
  524. data/ext/ice/cpp/src/Slice/PHPUtil.h +1 -1
  525. data/ext/ice/cpp/src/Slice/Parser.cpp +383 -101
  526. data/ext/ice/cpp/src/Slice/Parser.h +40 -3
  527. data/ext/ice/cpp/src/Slice/Preprocessor.cpp +2 -1
  528. data/ext/ice/cpp/src/Slice/Preprocessor.h +2 -2
  529. data/ext/ice/cpp/src/Slice/Python.cpp +7 -15
  530. data/ext/ice/cpp/src/Slice/PythonUtil.cpp +66 -9
  531. data/ext/ice/cpp/src/Slice/PythonUtil.h +2 -2
  532. data/ext/ice/cpp/src/Slice/Ruby.cpp +1 -1
  533. data/ext/ice/cpp/src/Slice/RubyUtil.cpp +2 -2
  534. data/ext/ice/cpp/src/Slice/RubyUtil.h +1 -1
  535. data/ext/ice/cpp/src/Slice/Scanner.cpp +214 -135
  536. data/ext/ice/cpp/src/Slice/SliceUtil.cpp +1 -1
  537. data/ext/ice/cpp/src/Slice/StringLiteralUtil.cpp +99 -17
  538. data/ext/ice/cpp/src/Slice/Util.h +5 -4
  539. data/ice.gemspec +2 -2
  540. data/lib/Glacier2.rb +1 -1
  541. data/lib/Glacier2/Metrics.rb +2 -2
  542. data/lib/Glacier2/PermissionsVerifier.rb +2 -2
  543. data/lib/Glacier2/PermissionsVerifierF.rb +2 -2
  544. data/lib/Glacier2/Router.rb +2 -2
  545. data/lib/Glacier2/RouterF.rb +2 -2
  546. data/lib/Glacier2/SSLInfo.rb +2 -2
  547. data/lib/Glacier2/Session.rb +2 -2
  548. data/lib/Ice.rb +2 -2
  549. data/lib/Ice/BuiltinSequences.rb +2 -2
  550. data/lib/Ice/Communicator.rb +2 -2
  551. data/lib/Ice/CommunicatorF.rb +2 -2
  552. data/lib/Ice/Connection.rb +2 -2
  553. data/lib/Ice/ConnectionF.rb +2 -2
  554. data/lib/Ice/Current.rb +2 -2
  555. data/lib/Ice/Endpoint.rb +2 -2
  556. data/lib/Ice/EndpointF.rb +2 -2
  557. data/lib/Ice/EndpointTypes.rb +2 -2
  558. data/lib/Ice/FacetMap.rb +2 -2
  559. data/lib/Ice/Identity.rb +2 -2
  560. data/lib/Ice/ImplicitContext.rb +2 -2
  561. data/lib/Ice/ImplicitContextF.rb +2 -2
  562. data/lib/Ice/Instrumentation.rb +2 -2
  563. data/lib/Ice/InstrumentationF.rb +2 -2
  564. data/lib/Ice/LocalException.rb +2 -2
  565. data/lib/Ice/Locator.rb +2 -2
  566. data/lib/Ice/LocatorF.rb +2 -2
  567. data/lib/Ice/Logger.rb +2 -2
  568. data/lib/Ice/LoggerF.rb +2 -2
  569. data/lib/Ice/Metrics.rb +2 -2
  570. data/lib/Ice/ObjectAdapter.rb +2 -2
  571. data/lib/Ice/ObjectAdapterF.rb +2 -2
  572. data/lib/Ice/ObjectFactory.rb +2 -2
  573. data/lib/Ice/Plugin.rb +2 -2
  574. data/lib/Ice/PluginF.rb +2 -2
  575. data/lib/Ice/Process.rb +2 -2
  576. data/lib/Ice/ProcessF.rb +2 -2
  577. data/lib/Ice/Properties.rb +2 -2
  578. data/lib/Ice/PropertiesAdmin.rb +2 -2
  579. data/lib/Ice/PropertiesF.rb +2 -2
  580. data/lib/Ice/RemoteLogger.rb +2 -2
  581. data/lib/Ice/Router.rb +2 -2
  582. data/lib/Ice/RouterF.rb +2 -2
  583. data/lib/Ice/ServantLocator.rb +2 -2
  584. data/lib/Ice/ServantLocatorF.rb +2 -2
  585. data/lib/Ice/SliceChecksumDict.rb +2 -2
  586. data/lib/Ice/ValueFactory.rb +2 -2
  587. data/lib/Ice/Version.rb +2 -2
  588. data/lib/IceBox.rb +1 -1
  589. data/lib/IceBox/IceBox.rb +2 -2
  590. data/lib/IceGrid.rb +1 -1
  591. data/lib/IceGrid/Admin.rb +2 -2
  592. data/lib/IceGrid/Descriptor.rb +2 -2
  593. data/lib/IceGrid/Exception.rb +2 -2
  594. data/lib/IceGrid/FileParser.rb +2 -2
  595. data/lib/IceGrid/PluginFacade.rb +2 -2
  596. data/lib/IceGrid/Registry.rb +2 -2
  597. data/lib/IceGrid/Session.rb +2 -2
  598. data/lib/IceGrid/UserAccountMapper.rb +2 -2
  599. data/lib/IcePatch2.rb +1 -1
  600. data/lib/IcePatch2/FileInfo.rb +2 -2
  601. data/lib/IcePatch2/FileServer.rb +2 -2
  602. data/lib/IceStorm.rb +1 -1
  603. data/lib/IceStorm/IceStorm.rb +2 -2
  604. data/lib/IceStorm/Metrics.rb +2 -2
  605. data/slice/Glacier2/Metrics.ice +2 -2
  606. data/slice/Glacier2/PermissionsVerifier.ice +2 -2
  607. data/slice/Glacier2/PermissionsVerifierF.ice +2 -2
  608. data/slice/Glacier2/Router.ice +2 -2
  609. data/slice/Glacier2/RouterF.ice +2 -2
  610. data/slice/Glacier2/SSLInfo.ice +2 -2
  611. data/slice/Glacier2/Session.ice +2 -2
  612. data/slice/Ice/BuiltinSequences.ice +2 -2
  613. data/slice/Ice/Communicator.ice +66 -73
  614. data/slice/Ice/CommunicatorF.ice +2 -2
  615. data/slice/Ice/Connection.ice +47 -17
  616. data/slice/Ice/ConnectionF.ice +2 -2
  617. data/slice/Ice/Current.ice +4 -5
  618. data/slice/Ice/Endpoint.ice +16 -16
  619. data/slice/Ice/EndpointF.ice +2 -2
  620. data/slice/Ice/EndpointTypes.ice +2 -2
  621. data/slice/Ice/FacetMap.ice +2 -2
  622. data/slice/Ice/Identity.ice +2 -2
  623. data/slice/Ice/ImplicitContext.ice +6 -6
  624. data/slice/Ice/ImplicitContextF.ice +2 -2
  625. data/slice/Ice/Instrumentation.ice +2 -2
  626. data/slice/Ice/InstrumentationF.ice +2 -2
  627. data/slice/Ice/LocalException.ice +2 -2
  628. data/slice/Ice/Locator.ice +3 -3
  629. data/slice/Ice/LocatorF.ice +2 -2
  630. data/slice/Ice/Logger.ice +2 -2
  631. data/slice/Ice/LoggerF.ice +2 -2
  632. data/slice/Ice/Metrics.ice +2 -2
  633. data/slice/Ice/ObjectAdapter.ice +10 -10
  634. data/slice/Ice/ObjectAdapterF.ice +2 -2
  635. data/slice/Ice/ObjectFactory.ice +3 -3
  636. data/slice/Ice/Plugin.ice +4 -4
  637. data/slice/Ice/PluginF.ice +2 -2
  638. data/slice/Ice/Process.ice +2 -2
  639. data/slice/Ice/ProcessF.ice +2 -2
  640. data/slice/Ice/Properties.ice +11 -11
  641. data/slice/Ice/PropertiesAdmin.ice +2 -2
  642. data/slice/Ice/PropertiesF.ice +2 -2
  643. data/slice/Ice/RemoteLogger.ice +12 -23
  644. data/slice/Ice/Router.ice +2 -2
  645. data/slice/Ice/RouterF.ice +2 -2
  646. data/slice/Ice/ServantLocator.ice +2 -2
  647. data/slice/Ice/ServantLocatorF.ice +2 -2
  648. data/slice/Ice/SliceChecksumDict.ice +2 -2
  649. data/slice/Ice/ValueFactory.ice +14 -16
  650. data/slice/Ice/Version.ice +2 -2
  651. data/slice/IceBT/ConnectionInfo.ice +2 -2
  652. data/slice/IceBT/EndpointInfo.ice +2 -2
  653. data/slice/IceBT/Types.ice +2 -2
  654. data/slice/IceBox/IceBox.ice +3 -4
  655. data/slice/IceDiscovery/IceDiscovery.ice +2 -2
  656. data/slice/IceGrid/Admin.ice +2 -2
  657. data/slice/IceGrid/Descriptor.ice +2 -2
  658. data/slice/IceGrid/Exception.ice +2 -2
  659. data/slice/IceGrid/FileParser.ice +2 -2
  660. data/slice/IceGrid/PluginFacade.ice +6 -6
  661. data/slice/IceGrid/Registry.ice +2 -2
  662. data/slice/IceGrid/Session.ice +2 -2
  663. data/slice/IceGrid/UserAccountMapper.ice +2 -2
  664. data/slice/IceIAP/ConnectionInfo.ice +2 -2
  665. data/slice/IceIAP/EndpointInfo.ice +2 -2
  666. data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +2 -2
  667. data/slice/IcePatch2/FileInfo.ice +2 -2
  668. data/slice/IcePatch2/FileServer.ice +2 -2
  669. data/slice/IceSSL/ConnectionInfo.ice +2 -2
  670. data/slice/IceSSL/ConnectionInfoF.ice +2 -2
  671. data/slice/IceSSL/EndpointInfo.ice +2 -2
  672. data/slice/IceStorm/IceStorm.ice +5 -6
  673. data/slice/IceStorm/Metrics.ice +2 -2
  674. metadata +3 -13
  675. data/BZIP2_LICENSE +0 -42
  676. data/ext/ice/bzip2/blocksort.c +0 -1094
  677. data/ext/ice/bzip2/bzlib.c +0 -1572
  678. data/ext/ice/bzip2/bzlib.h +0 -282
  679. data/ext/ice/bzip2/bzlib_private.h +0 -509
  680. data/ext/ice/bzip2/compress.c +0 -672
  681. data/ext/ice/bzip2/crctable.c +0 -104
  682. data/ext/ice/bzip2/decompress.c +0 -646
  683. data/ext/ice/bzip2/huffman.c +0 -205
  684. data/ext/ice/bzip2/randtable.c +0 -84
@@ -1,1572 +0,0 @@
1
-
2
- /*-------------------------------------------------------------*/
3
- /*--- Library top-level functions. ---*/
4
- /*--- bzlib.c ---*/
5
- /*-------------------------------------------------------------*/
6
-
7
- /* ------------------------------------------------------------------
8
- This file is part of bzip2/libbzip2, a program and library for
9
- lossless, block-sorting data compression.
10
-
11
- bzip2/libbzip2 version 1.0.6 of 6 September 2010
12
- Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
13
-
14
- Please read the WARNING, DISCLAIMER and PATENTS sections in the
15
- README file.
16
-
17
- This program is released under the terms of the license contained
18
- in the file LICENSE.
19
- ------------------------------------------------------------------ */
20
-
21
- /* CHANGES
22
- 0.9.0 -- original version.
23
- 0.9.0a/b -- no changes in this file.
24
- 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress().
25
- fixed bzWrite/bzRead to ignore zero-length requests.
26
- fixed bzread to correctly handle read requests after EOF.
27
- wrong parameter order in call to bzDecompressInit in
28
- bzBuffToBuffDecompress. Fixed.
29
- */
30
-
31
- #include "bzlib_private.h"
32
-
33
-
34
- /*---------------------------------------------------*/
35
- /*--- Compression stuff ---*/
36
- /*---------------------------------------------------*/
37
-
38
-
39
- /*---------------------------------------------------*/
40
- #ifndef BZ_NO_STDIO
41
- void BZ2_bz__AssertH__fail ( int errcode )
42
- {
43
- fprintf(stderr,
44
- "\n\nbzip2/libbzip2: internal error number %d.\n"
45
- "This is a bug in bzip2/libbzip2, %s.\n"
46
- "Please report it to me at: jseward@bzip.org. If this happened\n"
47
- "when you were using some program which uses libbzip2 as a\n"
48
- "component, you should also report this bug to the author(s)\n"
49
- "of that program. Please make an effort to report this bug;\n"
50
- "timely and accurate bug reports eventually lead to higher\n"
51
- "quality software. Thanks. Julian Seward, 10 December 2007.\n\n",
52
- errcode,
53
- BZ2_bzlibVersion()
54
- );
55
-
56
- if (errcode == 1007) {
57
- fprintf(stderr,
58
- "\n*** A special note about internal error number 1007 ***\n"
59
- "\n"
60
- "Experience suggests that a common cause of i.e. 1007\n"
61
- "is unreliable memory or other hardware. The 1007 assertion\n"
62
- "just happens to cross-check the results of huge numbers of\n"
63
- "memory reads/writes, and so acts (unintendedly) as a stress\n"
64
- "test of your memory system.\n"
65
- "\n"
66
- "I suggest the following: try compressing the file again,\n"
67
- "possibly monitoring progress in detail with the -vv flag.\n"
68
- "\n"
69
- "* If the error cannot be reproduced, and/or happens at different\n"
70
- " points in compression, you may have a flaky memory system.\n"
71
- " Try a memory-test program. I have used Memtest86\n"
72
- " (www.memtest86.com). At the time of writing it is free (GPLd).\n"
73
- " Memtest86 tests memory much more thorougly than your BIOSs\n"
74
- " power-on test, and may find failures that the BIOS doesn't.\n"
75
- "\n"
76
- "* If the error can be repeatably reproduced, this is a bug in\n"
77
- " bzip2, and I would very much like to hear about it. Please\n"
78
- " let me know, and, ideally, save a copy of the file causing the\n"
79
- " problem -- without which I will be unable to investigate it.\n"
80
- "\n"
81
- );
82
- }
83
-
84
- exit(3);
85
- }
86
- #endif
87
-
88
-
89
- /*---------------------------------------------------*/
90
- static
91
- int bz_config_ok ( void )
92
- {
93
- if (sizeof(int) != 4) return 0;
94
- if (sizeof(short) != 2) return 0;
95
- if (sizeof(char) != 1) return 0;
96
- return 1;
97
- }
98
-
99
-
100
- /*---------------------------------------------------*/
101
- static
102
- void* default_bzalloc ( void* opaque, Int32 items, Int32 size )
103
- {
104
- void* v = malloc ( items * size );
105
- return v;
106
- }
107
-
108
- static
109
- void default_bzfree ( void* opaque, void* addr )
110
- {
111
- if (addr != NULL) free ( addr );
112
- }
113
-
114
-
115
- /*---------------------------------------------------*/
116
- static
117
- void prepare_new_block ( EState* s )
118
- {
119
- Int32 i;
120
- s->nblock = 0;
121
- s->numZ = 0;
122
- s->state_out_pos = 0;
123
- BZ_INITIALISE_CRC ( s->blockCRC );
124
- for (i = 0; i < 256; i++) s->inUse[i] = False;
125
- s->blockNo++;
126
- }
127
-
128
-
129
- /*---------------------------------------------------*/
130
- static
131
- void init_RL ( EState* s )
132
- {
133
- s->state_in_ch = 256;
134
- s->state_in_len = 0;
135
- }
136
-
137
-
138
- static
139
- Bool isempty_RL ( EState* s )
140
- {
141
- if (s->state_in_ch < 256 && s->state_in_len > 0)
142
- return False; else
143
- return True;
144
- }
145
-
146
-
147
- /*---------------------------------------------------*/
148
- int BZ_API(BZ2_bzCompressInit)
149
- ( bz_stream* strm,
150
- int blockSize100k,
151
- int verbosity,
152
- int workFactor )
153
- {
154
- Int32 n;
155
- EState* s;
156
-
157
- if (!bz_config_ok()) return BZ_CONFIG_ERROR;
158
-
159
- if (strm == NULL ||
160
- blockSize100k < 1 || blockSize100k > 9 ||
161
- workFactor < 0 || workFactor > 250)
162
- return BZ_PARAM_ERROR;
163
-
164
- if (workFactor == 0) workFactor = 30;
165
- if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
166
- if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
167
-
168
- s = BZALLOC( sizeof(EState) );
169
- if (s == NULL) return BZ_MEM_ERROR;
170
- s->strm = strm;
171
-
172
- s->arr1 = NULL;
173
- s->arr2 = NULL;
174
- s->ftab = NULL;
175
-
176
- n = 100000 * blockSize100k;
177
- s->arr1 = BZALLOC( n * sizeof(UInt32) );
178
- s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
179
- s->ftab = BZALLOC( 65537 * sizeof(UInt32) );
180
-
181
- if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
182
- if (s->arr1 != NULL) BZFREE(s->arr1);
183
- if (s->arr2 != NULL) BZFREE(s->arr2);
184
- if (s->ftab != NULL) BZFREE(s->ftab);
185
- if (s != NULL) BZFREE(s);
186
- return BZ_MEM_ERROR;
187
- }
188
-
189
- s->blockNo = 0;
190
- s->state = BZ_S_INPUT;
191
- s->mode = BZ_M_RUNNING;
192
- s->combinedCRC = 0;
193
- s->blockSize100k = blockSize100k;
194
- s->nblockMAX = 100000 * blockSize100k - 19;
195
- s->verbosity = verbosity;
196
- s->workFactor = workFactor;
197
-
198
- s->block = (UChar*)s->arr2;
199
- s->mtfv = (UInt16*)s->arr1;
200
- s->zbits = NULL;
201
- s->ptr = (UInt32*)s->arr1;
202
-
203
- strm->state = s;
204
- strm->total_in_lo32 = 0;
205
- strm->total_in_hi32 = 0;
206
- strm->total_out_lo32 = 0;
207
- strm->total_out_hi32 = 0;
208
- init_RL ( s );
209
- prepare_new_block ( s );
210
- return BZ_OK;
211
- }
212
-
213
-
214
- /*---------------------------------------------------*/
215
- static
216
- void add_pair_to_block ( EState* s )
217
- {
218
- Int32 i;
219
- UChar ch = (UChar)(s->state_in_ch);
220
- for (i = 0; i < s->state_in_len; i++) {
221
- BZ_UPDATE_CRC( s->blockCRC, ch );
222
- }
223
- s->inUse[s->state_in_ch] = True;
224
- switch (s->state_in_len) {
225
- case 1:
226
- s->block[s->nblock] = (UChar)ch; s->nblock++;
227
- break;
228
- case 2:
229
- s->block[s->nblock] = (UChar)ch; s->nblock++;
230
- s->block[s->nblock] = (UChar)ch; s->nblock++;
231
- break;
232
- case 3:
233
- s->block[s->nblock] = (UChar)ch; s->nblock++;
234
- s->block[s->nblock] = (UChar)ch; s->nblock++;
235
- s->block[s->nblock] = (UChar)ch; s->nblock++;
236
- break;
237
- default:
238
- s->inUse[s->state_in_len-4] = True;
239
- s->block[s->nblock] = (UChar)ch; s->nblock++;
240
- s->block[s->nblock] = (UChar)ch; s->nblock++;
241
- s->block[s->nblock] = (UChar)ch; s->nblock++;
242
- s->block[s->nblock] = (UChar)ch; s->nblock++;
243
- s->block[s->nblock] = ((UChar)(s->state_in_len-4));
244
- s->nblock++;
245
- break;
246
- }
247
- }
248
-
249
-
250
- /*---------------------------------------------------*/
251
- static
252
- void flush_RL ( EState* s )
253
- {
254
- if (s->state_in_ch < 256) add_pair_to_block ( s );
255
- init_RL ( s );
256
- }
257
-
258
-
259
- /*---------------------------------------------------*/
260
- #define ADD_CHAR_TO_BLOCK(zs,zchh0) \
261
- { \
262
- UInt32 zchh = (UInt32)(zchh0); \
263
- /*-- fast track the common case --*/ \
264
- if (zchh != zs->state_in_ch && \
265
- zs->state_in_len == 1) { \
266
- UChar ch = (UChar)(zs->state_in_ch); \
267
- BZ_UPDATE_CRC( zs->blockCRC, ch ); \
268
- zs->inUse[zs->state_in_ch] = True; \
269
- zs->block[zs->nblock] = (UChar)ch; \
270
- zs->nblock++; \
271
- zs->state_in_ch = zchh; \
272
- } \
273
- else \
274
- /*-- general, uncommon cases --*/ \
275
- if (zchh != zs->state_in_ch || \
276
- zs->state_in_len == 255) { \
277
- if (zs->state_in_ch < 256) \
278
- add_pair_to_block ( zs ); \
279
- zs->state_in_ch = zchh; \
280
- zs->state_in_len = 1; \
281
- } else { \
282
- zs->state_in_len++; \
283
- } \
284
- }
285
-
286
-
287
- /*---------------------------------------------------*/
288
- static
289
- Bool copy_input_until_stop ( EState* s )
290
- {
291
- Bool progress_in = False;
292
-
293
- if (s->mode == BZ_M_RUNNING) {
294
-
295
- /*-- fast track the common case --*/
296
- while (True) {
297
- /*-- block full? --*/
298
- if (s->nblock >= s->nblockMAX) break;
299
- /*-- no input? --*/
300
- if (s->strm->avail_in == 0) break;
301
- progress_in = True;
302
- ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
303
- s->strm->next_in++;
304
- s->strm->avail_in--;
305
- s->strm->total_in_lo32++;
306
- if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
307
- }
308
-
309
- } else {
310
-
311
- /*-- general, uncommon case --*/
312
- while (True) {
313
- /*-- block full? --*/
314
- if (s->nblock >= s->nblockMAX) break;
315
- /*-- no input? --*/
316
- if (s->strm->avail_in == 0) break;
317
- /*-- flush/finish end? --*/
318
- if (s->avail_in_expect == 0) break;
319
- progress_in = True;
320
- ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
321
- s->strm->next_in++;
322
- s->strm->avail_in--;
323
- s->strm->total_in_lo32++;
324
- if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
325
- s->avail_in_expect--;
326
- }
327
- }
328
- return progress_in;
329
- }
330
-
331
-
332
- /*---------------------------------------------------*/
333
- static
334
- Bool copy_output_until_stop ( EState* s )
335
- {
336
- Bool progress_out = False;
337
-
338
- while (True) {
339
-
340
- /*-- no output space? --*/
341
- if (s->strm->avail_out == 0) break;
342
-
343
- /*-- block done? --*/
344
- if (s->state_out_pos >= s->numZ) break;
345
-
346
- progress_out = True;
347
- *(s->strm->next_out) = s->zbits[s->state_out_pos];
348
- s->state_out_pos++;
349
- s->strm->avail_out--;
350
- s->strm->next_out++;
351
- s->strm->total_out_lo32++;
352
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
353
- }
354
-
355
- return progress_out;
356
- }
357
-
358
-
359
- /*---------------------------------------------------*/
360
- static
361
- Bool handle_compress ( bz_stream* strm )
362
- {
363
- Bool progress_in = False;
364
- Bool progress_out = False;
365
- EState* s = strm->state;
366
-
367
- while (True) {
368
-
369
- if (s->state == BZ_S_OUTPUT) {
370
- progress_out |= copy_output_until_stop ( s );
371
- if (s->state_out_pos < s->numZ) break;
372
- if (s->mode == BZ_M_FINISHING &&
373
- s->avail_in_expect == 0 &&
374
- isempty_RL(s)) break;
375
- prepare_new_block ( s );
376
- s->state = BZ_S_INPUT;
377
- if (s->mode == BZ_M_FLUSHING &&
378
- s->avail_in_expect == 0 &&
379
- isempty_RL(s)) break;
380
- }
381
-
382
- if (s->state == BZ_S_INPUT) {
383
- progress_in |= copy_input_until_stop ( s );
384
- if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
385
- flush_RL ( s );
386
- BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
387
- s->state = BZ_S_OUTPUT;
388
- }
389
- else
390
- if (s->nblock >= s->nblockMAX) {
391
- BZ2_compressBlock ( s, False );
392
- s->state = BZ_S_OUTPUT;
393
- }
394
- else
395
- if (s->strm->avail_in == 0) {
396
- break;
397
- }
398
- }
399
-
400
- }
401
-
402
- return progress_in || progress_out;
403
- }
404
-
405
-
406
- /*---------------------------------------------------*/
407
- int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
408
- {
409
- Bool progress;
410
- EState* s;
411
- if (strm == NULL) return BZ_PARAM_ERROR;
412
- s = strm->state;
413
- if (s == NULL) return BZ_PARAM_ERROR;
414
- if (s->strm != strm) return BZ_PARAM_ERROR;
415
-
416
- preswitch:
417
- switch (s->mode) {
418
-
419
- case BZ_M_IDLE:
420
- return BZ_SEQUENCE_ERROR;
421
-
422
- case BZ_M_RUNNING:
423
- if (action == BZ_RUN) {
424
- progress = handle_compress ( strm );
425
- return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
426
- }
427
- else
428
- if (action == BZ_FLUSH) {
429
- s->avail_in_expect = strm->avail_in;
430
- s->mode = BZ_M_FLUSHING;
431
- goto preswitch;
432
- }
433
- else
434
- if (action == BZ_FINISH) {
435
- s->avail_in_expect = strm->avail_in;
436
- s->mode = BZ_M_FINISHING;
437
- goto preswitch;
438
- }
439
- else
440
- return BZ_PARAM_ERROR;
441
-
442
- case BZ_M_FLUSHING:
443
- if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
444
- if (s->avail_in_expect != s->strm->avail_in)
445
- return BZ_SEQUENCE_ERROR;
446
- progress = handle_compress ( strm );
447
- if (s->avail_in_expect > 0 || !isempty_RL(s) ||
448
- s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
449
- s->mode = BZ_M_RUNNING;
450
- return BZ_RUN_OK;
451
-
452
- case BZ_M_FINISHING:
453
- if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
454
- if (s->avail_in_expect != s->strm->avail_in)
455
- return BZ_SEQUENCE_ERROR;
456
- progress = handle_compress ( strm );
457
- if (!progress) return BZ_SEQUENCE_ERROR;
458
- if (s->avail_in_expect > 0 || !isempty_RL(s) ||
459
- s->state_out_pos < s->numZ) return BZ_FINISH_OK;
460
- s->mode = BZ_M_IDLE;
461
- return BZ_STREAM_END;
462
- }
463
- return BZ_OK; /*--not reached--*/
464
- }
465
-
466
-
467
- /*---------------------------------------------------*/
468
- int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
469
- {
470
- EState* s;
471
- if (strm == NULL) return BZ_PARAM_ERROR;
472
- s = strm->state;
473
- if (s == NULL) return BZ_PARAM_ERROR;
474
- if (s->strm != strm) return BZ_PARAM_ERROR;
475
-
476
- if (s->arr1 != NULL) BZFREE(s->arr1);
477
- if (s->arr2 != NULL) BZFREE(s->arr2);
478
- if (s->ftab != NULL) BZFREE(s->ftab);
479
- BZFREE(strm->state);
480
-
481
- strm->state = NULL;
482
-
483
- return BZ_OK;
484
- }
485
-
486
-
487
- /*---------------------------------------------------*/
488
- /*--- Decompression stuff ---*/
489
- /*---------------------------------------------------*/
490
-
491
- /*---------------------------------------------------*/
492
- int BZ_API(BZ2_bzDecompressInit)
493
- ( bz_stream* strm,
494
- int verbosity,
495
- int small )
496
- {
497
- DState* s;
498
-
499
- if (!bz_config_ok()) return BZ_CONFIG_ERROR;
500
-
501
- if (strm == NULL) return BZ_PARAM_ERROR;
502
- if (small != 0 && small != 1) return BZ_PARAM_ERROR;
503
- if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR;
504
-
505
- if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
506
- if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
507
-
508
- s = BZALLOC( sizeof(DState) );
509
- if (s == NULL) return BZ_MEM_ERROR;
510
- s->strm = strm;
511
- strm->state = s;
512
- s->state = BZ_X_MAGIC_1;
513
- s->bsLive = 0;
514
- s->bsBuff = 0;
515
- s->calculatedCombinedCRC = 0;
516
- strm->total_in_lo32 = 0;
517
- strm->total_in_hi32 = 0;
518
- strm->total_out_lo32 = 0;
519
- strm->total_out_hi32 = 0;
520
- s->smallDecompress = (Bool)small;
521
- s->ll4 = NULL;
522
- s->ll16 = NULL;
523
- s->tt = NULL;
524
- s->currBlockNo = 0;
525
- s->verbosity = verbosity;
526
-
527
- return BZ_OK;
528
- }
529
-
530
-
531
- /*---------------------------------------------------*/
532
- /* Return True iff data corruption is discovered.
533
- Returns False if there is no problem.
534
- */
535
- static
536
- Bool unRLE_obuf_to_output_FAST ( DState* s )
537
- {
538
- UChar k1;
539
-
540
- if (s->blockRandomised) {
541
-
542
- while (True) {
543
- /* try to finish existing run */
544
- while (True) {
545
- if (s->strm->avail_out == 0) return False;
546
- if (s->state_out_len == 0) break;
547
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
548
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
549
- s->state_out_len--;
550
- s->strm->next_out++;
551
- s->strm->avail_out--;
552
- s->strm->total_out_lo32++;
553
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
554
- }
555
-
556
- /* can a new run be started? */
557
- if (s->nblock_used == s->save_nblock+1) return False;
558
-
559
- /* Only caused by corrupt data stream? */
560
- if (s->nblock_used > s->save_nblock+1)
561
- return True;
562
-
563
- s->state_out_len = 1;
564
- s->state_out_ch = s->k0;
565
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
566
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
567
- if (s->nblock_used == s->save_nblock+1) continue;
568
- if (k1 != s->k0) { s->k0 = k1; continue; };
569
-
570
- s->state_out_len = 2;
571
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
572
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
573
- if (s->nblock_used == s->save_nblock+1) continue;
574
- if (k1 != s->k0) { s->k0 = k1; continue; };
575
-
576
- s->state_out_len = 3;
577
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
578
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
579
- if (s->nblock_used == s->save_nblock+1) continue;
580
- if (k1 != s->k0) { s->k0 = k1; continue; };
581
-
582
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
583
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
584
- s->state_out_len = ((Int32)k1) + 4;
585
- BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
586
- s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
587
- }
588
-
589
- } else {
590
-
591
- /* restore */
592
- UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC;
593
- UChar c_state_out_ch = s->state_out_ch;
594
- Int32 c_state_out_len = s->state_out_len;
595
- Int32 c_nblock_used = s->nblock_used;
596
- Int32 c_k0 = s->k0;
597
- UInt32* c_tt = s->tt;
598
- UInt32 c_tPos = s->tPos;
599
- char* cs_next_out = s->strm->next_out;
600
- unsigned int cs_avail_out = s->strm->avail_out;
601
- Int32 ro_blockSize100k = s->blockSize100k;
602
- /* end restore */
603
-
604
- UInt32 avail_out_INIT = cs_avail_out;
605
- Int32 s_save_nblockPP = s->save_nblock+1;
606
- unsigned int total_out_lo32_old;
607
-
608
- while (True) {
609
-
610
- /* try to finish existing run */
611
- if (c_state_out_len > 0) {
612
- while (True) {
613
- if (cs_avail_out == 0) goto return_notr;
614
- if (c_state_out_len == 1) break;
615
- *( (UChar*)(cs_next_out) ) = c_state_out_ch;
616
- BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
617
- c_state_out_len--;
618
- cs_next_out++;
619
- cs_avail_out--;
620
- }
621
- s_state_out_len_eq_one:
622
- {
623
- if (cs_avail_out == 0) {
624
- c_state_out_len = 1; goto return_notr;
625
- };
626
- *( (UChar*)(cs_next_out) ) = c_state_out_ch;
627
- BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
628
- cs_next_out++;
629
- cs_avail_out--;
630
- }
631
- }
632
- /* Only caused by corrupt data stream? */
633
- if (c_nblock_used > s_save_nblockPP)
634
- return True;
635
-
636
- /* can a new run be started? */
637
- if (c_nblock_used == s_save_nblockPP) {
638
- c_state_out_len = 0; goto return_notr;
639
- };
640
- c_state_out_ch = c_k0;
641
- BZ_GET_FAST_C(k1); c_nblock_used++;
642
- if (k1 != c_k0) {
643
- c_k0 = k1; goto s_state_out_len_eq_one;
644
- };
645
- if (c_nblock_used == s_save_nblockPP)
646
- goto s_state_out_len_eq_one;
647
-
648
- c_state_out_len = 2;
649
- BZ_GET_FAST_C(k1); c_nblock_used++;
650
- if (c_nblock_used == s_save_nblockPP) continue;
651
- if (k1 != c_k0) { c_k0 = k1; continue; };
652
-
653
- c_state_out_len = 3;
654
- BZ_GET_FAST_C(k1); c_nblock_used++;
655
- if (c_nblock_used == s_save_nblockPP) continue;
656
- if (k1 != c_k0) { c_k0 = k1; continue; };
657
-
658
- BZ_GET_FAST_C(k1); c_nblock_used++;
659
- c_state_out_len = ((Int32)k1) + 4;
660
- BZ_GET_FAST_C(c_k0); c_nblock_used++;
661
- }
662
-
663
- return_notr:
664
- total_out_lo32_old = s->strm->total_out_lo32;
665
- s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);
666
- if (s->strm->total_out_lo32 < total_out_lo32_old)
667
- s->strm->total_out_hi32++;
668
-
669
- /* save */
670
- s->calculatedBlockCRC = c_calculatedBlockCRC;
671
- s->state_out_ch = c_state_out_ch;
672
- s->state_out_len = c_state_out_len;
673
- s->nblock_used = c_nblock_used;
674
- s->k0 = c_k0;
675
- s->tt = c_tt;
676
- s->tPos = c_tPos;
677
- s->strm->next_out = cs_next_out;
678
- s->strm->avail_out = cs_avail_out;
679
- /* end save */
680
- }
681
- return False;
682
- }
683
-
684
-
685
-
686
- /*---------------------------------------------------*/
687
- __inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
688
- {
689
- Int32 nb, na, mid;
690
- nb = 0;
691
- na = 256;
692
- do {
693
- mid = (nb + na) >> 1;
694
- if (indx >= cftab[mid]) nb = mid; else na = mid;
695
- }
696
- while (na - nb != 1);
697
- return nb;
698
- }
699
-
700
-
701
- /*---------------------------------------------------*/
702
- /* Return True iff data corruption is discovered.
703
- Returns False if there is no problem.
704
- */
705
- static
706
- Bool unRLE_obuf_to_output_SMALL ( DState* s )
707
- {
708
- UChar k1;
709
-
710
- if (s->blockRandomised) {
711
-
712
- while (True) {
713
- /* try to finish existing run */
714
- while (True) {
715
- if (s->strm->avail_out == 0) return False;
716
- if (s->state_out_len == 0) break;
717
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
718
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
719
- s->state_out_len--;
720
- s->strm->next_out++;
721
- s->strm->avail_out--;
722
- s->strm->total_out_lo32++;
723
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
724
- }
725
-
726
- /* can a new run be started? */
727
- if (s->nblock_used == s->save_nblock+1) return False;
728
-
729
- /* Only caused by corrupt data stream? */
730
- if (s->nblock_used > s->save_nblock+1)
731
- return True;
732
-
733
- s->state_out_len = 1;
734
- s->state_out_ch = s->k0;
735
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
736
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
737
- if (s->nblock_used == s->save_nblock+1) continue;
738
- if (k1 != s->k0) { s->k0 = k1; continue; };
739
-
740
- s->state_out_len = 2;
741
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
742
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
743
- if (s->nblock_used == s->save_nblock+1) continue;
744
- if (k1 != s->k0) { s->k0 = k1; continue; };
745
-
746
- s->state_out_len = 3;
747
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
748
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
749
- if (s->nblock_used == s->save_nblock+1) continue;
750
- if (k1 != s->k0) { s->k0 = k1; continue; };
751
-
752
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
753
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
754
- s->state_out_len = ((Int32)k1) + 4;
755
- BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
756
- s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
757
- }
758
-
759
- } else {
760
-
761
- while (True) {
762
- /* try to finish existing run */
763
- while (True) {
764
- if (s->strm->avail_out == 0) return False;
765
- if (s->state_out_len == 0) break;
766
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
767
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
768
- s->state_out_len--;
769
- s->strm->next_out++;
770
- s->strm->avail_out--;
771
- s->strm->total_out_lo32++;
772
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
773
- }
774
-
775
- /* can a new run be started? */
776
- if (s->nblock_used == s->save_nblock+1) return False;
777
-
778
- /* Only caused by corrupt data stream? */
779
- if (s->nblock_used > s->save_nblock+1)
780
- return True;
781
-
782
- s->state_out_len = 1;
783
- s->state_out_ch = s->k0;
784
- BZ_GET_SMALL(k1); s->nblock_used++;
785
- if (s->nblock_used == s->save_nblock+1) continue;
786
- if (k1 != s->k0) { s->k0 = k1; continue; };
787
-
788
- s->state_out_len = 2;
789
- BZ_GET_SMALL(k1); s->nblock_used++;
790
- if (s->nblock_used == s->save_nblock+1) continue;
791
- if (k1 != s->k0) { s->k0 = k1; continue; };
792
-
793
- s->state_out_len = 3;
794
- BZ_GET_SMALL(k1); s->nblock_used++;
795
- if (s->nblock_used == s->save_nblock+1) continue;
796
- if (k1 != s->k0) { s->k0 = k1; continue; };
797
-
798
- BZ_GET_SMALL(k1); s->nblock_used++;
799
- s->state_out_len = ((Int32)k1) + 4;
800
- BZ_GET_SMALL(s->k0); s->nblock_used++;
801
- }
802
-
803
- }
804
- }
805
-
806
-
807
- /*---------------------------------------------------*/
808
- int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
809
- {
810
- Bool corrupt;
811
- DState* s;
812
- if (strm == NULL) return BZ_PARAM_ERROR;
813
- s = strm->state;
814
- if (s == NULL) return BZ_PARAM_ERROR;
815
- if (s->strm != strm) return BZ_PARAM_ERROR;
816
-
817
- while (True) {
818
- if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
819
- if (s->state == BZ_X_OUTPUT) {
820
- if (s->smallDecompress)
821
- corrupt = unRLE_obuf_to_output_SMALL ( s ); else
822
- corrupt = unRLE_obuf_to_output_FAST ( s );
823
- if (corrupt) return BZ_DATA_ERROR;
824
- if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
825
- BZ_FINALISE_CRC ( s->calculatedBlockCRC );
826
- if (s->verbosity >= 3)
827
- VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC,
828
- s->calculatedBlockCRC );
829
- if (s->verbosity >= 2) VPrintf0 ( "]" );
830
- if (s->calculatedBlockCRC != s->storedBlockCRC)
831
- return BZ_DATA_ERROR;
832
- s->calculatedCombinedCRC
833
- = (s->calculatedCombinedCRC << 1) |
834
- (s->calculatedCombinedCRC >> 31);
835
- s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
836
- s->state = BZ_X_BLKHDR_1;
837
- } else {
838
- return BZ_OK;
839
- }
840
- }
841
- if (s->state >= BZ_X_MAGIC_1) {
842
- Int32 r = BZ2_decompress ( s );
843
- if (r == BZ_STREAM_END) {
844
- if (s->verbosity >= 3)
845
- VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x",
846
- s->storedCombinedCRC, s->calculatedCombinedCRC );
847
- if (s->calculatedCombinedCRC != s->storedCombinedCRC)
848
- return BZ_DATA_ERROR;
849
- return r;
850
- }
851
- if (s->state != BZ_X_OUTPUT) return r;
852
- }
853
- }
854
-
855
- AssertH ( 0, 6001 );
856
-
857
- return 0; /*NOTREACHED*/
858
- }
859
-
860
-
861
- /*---------------------------------------------------*/
862
- int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
863
- {
864
- DState* s;
865
- if (strm == NULL) return BZ_PARAM_ERROR;
866
- s = strm->state;
867
- if (s == NULL) return BZ_PARAM_ERROR;
868
- if (s->strm != strm) return BZ_PARAM_ERROR;
869
-
870
- if (s->tt != NULL) BZFREE(s->tt);
871
- if (s->ll16 != NULL) BZFREE(s->ll16);
872
- if (s->ll4 != NULL) BZFREE(s->ll4);
873
-
874
- BZFREE(strm->state);
875
- strm->state = NULL;
876
-
877
- return BZ_OK;
878
- }
879
-
880
-
881
- #ifndef BZ_NO_STDIO
882
- /*---------------------------------------------------*/
883
- /*--- File I/O stuff ---*/
884
- /*---------------------------------------------------*/
885
-
886
- #define BZ_SETERR(eee) \
887
- { \
888
- if (bzerror != NULL) *bzerror = eee; \
889
- if (bzf != NULL) bzf->lastErr = eee; \
890
- }
891
-
892
- typedef
893
- struct {
894
- FILE* handle;
895
- Char buf[BZ_MAX_UNUSED];
896
- Int32 bufN;
897
- Bool writing;
898
- bz_stream strm;
899
- Int32 lastErr;
900
- Bool initialisedOk;
901
- }
902
- bzFile;
903
-
904
-
905
- /*---------------------------------------------*/
906
- static Bool myfeof ( FILE* f )
907
- {
908
- Int32 c = fgetc ( f );
909
- if (c == EOF) return True;
910
- ungetc ( c, f );
911
- return False;
912
- }
913
-
914
-
915
- /*---------------------------------------------------*/
916
- BZFILE* BZ_API(BZ2_bzWriteOpen)
917
- ( int* bzerror,
918
- FILE* f,
919
- int blockSize100k,
920
- int verbosity,
921
- int workFactor )
922
- {
923
- Int32 ret;
924
- bzFile* bzf = NULL;
925
-
926
- BZ_SETERR(BZ_OK);
927
-
928
- if (f == NULL ||
929
- (blockSize100k < 1 || blockSize100k > 9) ||
930
- (workFactor < 0 || workFactor > 250) ||
931
- (verbosity < 0 || verbosity > 4))
932
- { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
933
-
934
- if (ferror(f))
935
- { BZ_SETERR(BZ_IO_ERROR); return NULL; };
936
-
937
- bzf = malloc ( sizeof(bzFile) );
938
- if (bzf == NULL)
939
- { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
940
-
941
- BZ_SETERR(BZ_OK);
942
- bzf->initialisedOk = False;
943
- bzf->bufN = 0;
944
- bzf->handle = f;
945
- bzf->writing = True;
946
- bzf->strm.bzalloc = NULL;
947
- bzf->strm.bzfree = NULL;
948
- bzf->strm.opaque = NULL;
949
-
950
- if (workFactor == 0) workFactor = 30;
951
- ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
952
- verbosity, workFactor );
953
- if (ret != BZ_OK)
954
- { BZ_SETERR(ret); free(bzf); return NULL; };
955
-
956
- bzf->strm.avail_in = 0;
957
- bzf->initialisedOk = True;
958
- return bzf;
959
- }
960
-
961
-
962
-
963
- /*---------------------------------------------------*/
964
- void BZ_API(BZ2_bzWrite)
965
- ( int* bzerror,
966
- BZFILE* b,
967
- void* buf,
968
- int len )
969
- {
970
- Int32 n, n2, ret;
971
- bzFile* bzf = (bzFile*)b;
972
-
973
- BZ_SETERR(BZ_OK);
974
- if (bzf == NULL || buf == NULL || len < 0)
975
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
976
- if (!(bzf->writing))
977
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
978
- if (ferror(bzf->handle))
979
- { BZ_SETERR(BZ_IO_ERROR); return; };
980
-
981
- if (len == 0)
982
- { BZ_SETERR(BZ_OK); return; };
983
-
984
- bzf->strm.avail_in = len;
985
- bzf->strm.next_in = buf;
986
-
987
- while (True) {
988
- bzf->strm.avail_out = BZ_MAX_UNUSED;
989
- bzf->strm.next_out = bzf->buf;
990
- ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
991
- if (ret != BZ_RUN_OK)
992
- { BZ_SETERR(ret); return; };
993
-
994
- if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
995
- n = BZ_MAX_UNUSED - bzf->strm.avail_out;
996
- n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
997
- n, bzf->handle );
998
- if (n != n2 || ferror(bzf->handle))
999
- { BZ_SETERR(BZ_IO_ERROR); return; };
1000
- }
1001
-
1002
- if (bzf->strm.avail_in == 0)
1003
- { BZ_SETERR(BZ_OK); return; };
1004
- }
1005
- }
1006
-
1007
-
1008
- /*---------------------------------------------------*/
1009
- void BZ_API(BZ2_bzWriteClose)
1010
- ( int* bzerror,
1011
- BZFILE* b,
1012
- int abandon,
1013
- unsigned int* nbytes_in,
1014
- unsigned int* nbytes_out )
1015
- {
1016
- BZ2_bzWriteClose64 ( bzerror, b, abandon,
1017
- nbytes_in, NULL, nbytes_out, NULL );
1018
- }
1019
-
1020
-
1021
- void BZ_API(BZ2_bzWriteClose64)
1022
- ( int* bzerror,
1023
- BZFILE* b,
1024
- int abandon,
1025
- unsigned int* nbytes_in_lo32,
1026
- unsigned int* nbytes_in_hi32,
1027
- unsigned int* nbytes_out_lo32,
1028
- unsigned int* nbytes_out_hi32 )
1029
- {
1030
- Int32 n, n2, ret;
1031
- bzFile* bzf = (bzFile*)b;
1032
-
1033
- if (bzf == NULL)
1034
- { BZ_SETERR(BZ_OK); return; };
1035
- if (!(bzf->writing))
1036
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
1037
- if (ferror(bzf->handle))
1038
- { BZ_SETERR(BZ_IO_ERROR); return; };
1039
-
1040
- if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0;
1041
- if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0;
1042
- if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0;
1043
- if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0;
1044
-
1045
- if ((!abandon) && bzf->lastErr == BZ_OK) {
1046
- while (True) {
1047
- bzf->strm.avail_out = BZ_MAX_UNUSED;
1048
- bzf->strm.next_out = bzf->buf;
1049
- ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
1050
- if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END)
1051
- { BZ_SETERR(ret); return; };
1052
-
1053
- if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
1054
- n = BZ_MAX_UNUSED - bzf->strm.avail_out;
1055
- n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
1056
- n, bzf->handle );
1057
- if (n != n2 || ferror(bzf->handle))
1058
- { BZ_SETERR(BZ_IO_ERROR); return; };
1059
- }
1060
-
1061
- if (ret == BZ_STREAM_END) break;
1062
- }
1063
- }
1064
-
1065
- if ( !abandon && !ferror ( bzf->handle ) ) {
1066
- fflush ( bzf->handle );
1067
- if (ferror(bzf->handle))
1068
- { BZ_SETERR(BZ_IO_ERROR); return; };
1069
- }
1070
-
1071
- if (nbytes_in_lo32 != NULL)
1072
- *nbytes_in_lo32 = bzf->strm.total_in_lo32;
1073
- if (nbytes_in_hi32 != NULL)
1074
- *nbytes_in_hi32 = bzf->strm.total_in_hi32;
1075
- if (nbytes_out_lo32 != NULL)
1076
- *nbytes_out_lo32 = bzf->strm.total_out_lo32;
1077
- if (nbytes_out_hi32 != NULL)
1078
- *nbytes_out_hi32 = bzf->strm.total_out_hi32;
1079
-
1080
- BZ_SETERR(BZ_OK);
1081
- BZ2_bzCompressEnd ( &(bzf->strm) );
1082
- free ( bzf );
1083
- }
1084
-
1085
-
1086
- /*---------------------------------------------------*/
1087
- BZFILE* BZ_API(BZ2_bzReadOpen)
1088
- ( int* bzerror,
1089
- FILE* f,
1090
- int verbosity,
1091
- int small,
1092
- void* unused,
1093
- int nUnused )
1094
- {
1095
- bzFile* bzf = NULL;
1096
- int ret;
1097
-
1098
- BZ_SETERR(BZ_OK);
1099
-
1100
- if (f == NULL ||
1101
- (small != 0 && small != 1) ||
1102
- (verbosity < 0 || verbosity > 4) ||
1103
- (unused == NULL && nUnused != 0) ||
1104
- (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))
1105
- { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
1106
-
1107
- if (ferror(f))
1108
- { BZ_SETERR(BZ_IO_ERROR); return NULL; };
1109
-
1110
- bzf = malloc ( sizeof(bzFile) );
1111
- if (bzf == NULL)
1112
- { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
1113
-
1114
- BZ_SETERR(BZ_OK);
1115
-
1116
- bzf->initialisedOk = False;
1117
- bzf->handle = f;
1118
- bzf->bufN = 0;
1119
- bzf->writing = False;
1120
- bzf->strm.bzalloc = NULL;
1121
- bzf->strm.bzfree = NULL;
1122
- bzf->strm.opaque = NULL;
1123
-
1124
- while (nUnused > 0) {
1125
- bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
1126
- unused = ((void*)( 1 + ((UChar*)(unused)) ));
1127
- nUnused--;
1128
- }
1129
-
1130
- ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
1131
- if (ret != BZ_OK)
1132
- { BZ_SETERR(ret); free(bzf); return NULL; };
1133
-
1134
- bzf->strm.avail_in = bzf->bufN;
1135
- bzf->strm.next_in = bzf->buf;
1136
-
1137
- bzf->initialisedOk = True;
1138
- return bzf;
1139
- }
1140
-
1141
-
1142
- /*---------------------------------------------------*/
1143
- void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
1144
- {
1145
- bzFile* bzf = (bzFile*)b;
1146
-
1147
- BZ_SETERR(BZ_OK);
1148
- if (bzf == NULL)
1149
- { BZ_SETERR(BZ_OK); return; };
1150
-
1151
- if (bzf->writing)
1152
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
1153
-
1154
- if (bzf->initialisedOk)
1155
- (void)BZ2_bzDecompressEnd ( &(bzf->strm) );
1156
- free ( bzf );
1157
- }
1158
-
1159
-
1160
- /*---------------------------------------------------*/
1161
- int BZ_API(BZ2_bzRead)
1162
- ( int* bzerror,
1163
- BZFILE* b,
1164
- void* buf,
1165
- int len )
1166
- {
1167
- Int32 n, ret;
1168
- bzFile* bzf = (bzFile*)b;
1169
-
1170
- BZ_SETERR(BZ_OK);
1171
-
1172
- if (bzf == NULL || buf == NULL || len < 0)
1173
- { BZ_SETERR(BZ_PARAM_ERROR); return 0; };
1174
-
1175
- if (bzf->writing)
1176
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };
1177
-
1178
- if (len == 0)
1179
- { BZ_SETERR(BZ_OK); return 0; };
1180
-
1181
- bzf->strm.avail_out = len;
1182
- bzf->strm.next_out = buf;
1183
-
1184
- while (True) {
1185
-
1186
- if (ferror(bzf->handle))
1187
- { BZ_SETERR(BZ_IO_ERROR); return 0; };
1188
-
1189
- if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
1190
- n = fread ( bzf->buf, sizeof(UChar),
1191
- BZ_MAX_UNUSED, bzf->handle );
1192
- if (ferror(bzf->handle))
1193
- { BZ_SETERR(BZ_IO_ERROR); return 0; };
1194
- bzf->bufN = n;
1195
- bzf->strm.avail_in = bzf->bufN;
1196
- bzf->strm.next_in = bzf->buf;
1197
- }
1198
-
1199
- ret = BZ2_bzDecompress ( &(bzf->strm) );
1200
-
1201
- if (ret != BZ_OK && ret != BZ_STREAM_END)
1202
- { BZ_SETERR(ret); return 0; };
1203
-
1204
- if (ret == BZ_OK && myfeof(bzf->handle) &&
1205
- bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
1206
- { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
1207
-
1208
- if (ret == BZ_STREAM_END)
1209
- { BZ_SETERR(BZ_STREAM_END);
1210
- return len - bzf->strm.avail_out; };
1211
- if (bzf->strm.avail_out == 0)
1212
- { BZ_SETERR(BZ_OK); return len; };
1213
-
1214
- }
1215
-
1216
- return 0; /*not reached*/
1217
- }
1218
-
1219
-
1220
- /*---------------------------------------------------*/
1221
- void BZ_API(BZ2_bzReadGetUnused)
1222
- ( int* bzerror,
1223
- BZFILE* b,
1224
- void** unused,
1225
- int* nUnused )
1226
- {
1227
- bzFile* bzf = (bzFile*)b;
1228
- if (bzf == NULL)
1229
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
1230
- if (bzf->lastErr != BZ_STREAM_END)
1231
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
1232
- if (unused == NULL || nUnused == NULL)
1233
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
1234
-
1235
- BZ_SETERR(BZ_OK);
1236
- *nUnused = bzf->strm.avail_in;
1237
- *unused = bzf->strm.next_in;
1238
- }
1239
- #endif
1240
-
1241
-
1242
- /*---------------------------------------------------*/
1243
- /*--- Misc convenience stuff ---*/
1244
- /*---------------------------------------------------*/
1245
-
1246
- /*---------------------------------------------------*/
1247
- int BZ_API(BZ2_bzBuffToBuffCompress)
1248
- ( char* dest,
1249
- unsigned int* destLen,
1250
- char* source,
1251
- unsigned int sourceLen,
1252
- int blockSize100k,
1253
- int verbosity,
1254
- int workFactor )
1255
- {
1256
- bz_stream strm;
1257
- int ret;
1258
-
1259
- if (dest == NULL || destLen == NULL ||
1260
- source == NULL ||
1261
- blockSize100k < 1 || blockSize100k > 9 ||
1262
- verbosity < 0 || verbosity > 4 ||
1263
- workFactor < 0 || workFactor > 250)
1264
- return BZ_PARAM_ERROR;
1265
-
1266
- if (workFactor == 0) workFactor = 30;
1267
- strm.bzalloc = NULL;
1268
- strm.bzfree = NULL;
1269
- strm.opaque = NULL;
1270
- ret = BZ2_bzCompressInit ( &strm, blockSize100k,
1271
- verbosity, workFactor );
1272
- if (ret != BZ_OK) return ret;
1273
-
1274
- strm.next_in = source;
1275
- strm.next_out = dest;
1276
- strm.avail_in = sourceLen;
1277
- strm.avail_out = *destLen;
1278
-
1279
- ret = BZ2_bzCompress ( &strm, BZ_FINISH );
1280
- if (ret == BZ_FINISH_OK) goto output_overflow;
1281
- if (ret != BZ_STREAM_END) goto errhandler;
1282
-
1283
- /* normal termination */
1284
- *destLen -= strm.avail_out;
1285
- BZ2_bzCompressEnd ( &strm );
1286
- return BZ_OK;
1287
-
1288
- output_overflow:
1289
- BZ2_bzCompressEnd ( &strm );
1290
- return BZ_OUTBUFF_FULL;
1291
-
1292
- errhandler:
1293
- BZ2_bzCompressEnd ( &strm );
1294
- return ret;
1295
- }
1296
-
1297
-
1298
- /*---------------------------------------------------*/
1299
- int BZ_API(BZ2_bzBuffToBuffDecompress)
1300
- ( char* dest,
1301
- unsigned int* destLen,
1302
- char* source,
1303
- unsigned int sourceLen,
1304
- int small,
1305
- int verbosity )
1306
- {
1307
- bz_stream strm;
1308
- int ret;
1309
-
1310
- if (dest == NULL || destLen == NULL ||
1311
- source == NULL ||
1312
- (small != 0 && small != 1) ||
1313
- verbosity < 0 || verbosity > 4)
1314
- return BZ_PARAM_ERROR;
1315
-
1316
- strm.bzalloc = NULL;
1317
- strm.bzfree = NULL;
1318
- strm.opaque = NULL;
1319
- ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
1320
- if (ret != BZ_OK) return ret;
1321
-
1322
- strm.next_in = source;
1323
- strm.next_out = dest;
1324
- strm.avail_in = sourceLen;
1325
- strm.avail_out = *destLen;
1326
-
1327
- ret = BZ2_bzDecompress ( &strm );
1328
- if (ret == BZ_OK) goto output_overflow_or_eof;
1329
- if (ret != BZ_STREAM_END) goto errhandler;
1330
-
1331
- /* normal termination */
1332
- *destLen -= strm.avail_out;
1333
- BZ2_bzDecompressEnd ( &strm );
1334
- return BZ_OK;
1335
-
1336
- output_overflow_or_eof:
1337
- if (strm.avail_out > 0) {
1338
- BZ2_bzDecompressEnd ( &strm );
1339
- return BZ_UNEXPECTED_EOF;
1340
- } else {
1341
- BZ2_bzDecompressEnd ( &strm );
1342
- return BZ_OUTBUFF_FULL;
1343
- };
1344
-
1345
- errhandler:
1346
- BZ2_bzDecompressEnd ( &strm );
1347
- return ret;
1348
- }
1349
-
1350
-
1351
- /*---------------------------------------------------*/
1352
- /*--
1353
- Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
1354
- to support better zlib compatibility.
1355
- This code is not _officially_ part of libbzip2 (yet);
1356
- I haven't tested it, documented it, or considered the
1357
- threading-safeness of it.
1358
- If this code breaks, please contact both Yoshioka and me.
1359
- --*/
1360
- /*---------------------------------------------------*/
1361
-
1362
- /*---------------------------------------------------*/
1363
- /*--
1364
- return version like "0.9.5d, 4-Sept-1999".
1365
- --*/
1366
- const char * BZ_API(BZ2_bzlibVersion)(void)
1367
- {
1368
- return BZ_VERSION;
1369
- }
1370
-
1371
-
1372
- #ifndef BZ_NO_STDIO
1373
- /*---------------------------------------------------*/
1374
-
1375
- #if defined(_WIN32) || defined(OS2) || defined(MSDOS)
1376
- # include <fcntl.h>
1377
- # include <io.h>
1378
- # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
1379
- #else
1380
- # define SET_BINARY_MODE(file)
1381
- #endif
1382
- static
1383
- BZFILE * bzopen_or_bzdopen
1384
- ( const char *path, /* no use when bzdopen */
1385
- int fd, /* no use when bzdopen */
1386
- const char *mode,
1387
- int open_mode) /* bzopen: 0, bzdopen:1 */
1388
- {
1389
- int bzerr;
1390
- char unused[BZ_MAX_UNUSED];
1391
- int blockSize100k = 9;
1392
- int writing = 0;
1393
- char mode2[10] = "";
1394
- FILE *fp = NULL;
1395
- BZFILE *bzfp = NULL;
1396
- int verbosity = 0;
1397
- int workFactor = 30;
1398
- int smallMode = 0;
1399
- int nUnused = 0;
1400
-
1401
- if (mode == NULL) return NULL;
1402
- while (*mode) {
1403
- switch (*mode) {
1404
- case 'r':
1405
- writing = 0; break;
1406
- case 'w':
1407
- writing = 1; break;
1408
- case 's':
1409
- smallMode = 1; break;
1410
- default:
1411
- if (isdigit((int)(*mode))) {
1412
- blockSize100k = *mode-BZ_HDR_0;
1413
- }
1414
- }
1415
- mode++;
1416
- }
1417
- strcat(mode2, writing ? "w" : "r" );
1418
- strcat(mode2,"b"); /* binary mode */
1419
-
1420
- if (open_mode==0) {
1421
- if (path==NULL || strcmp(path,"")==0) {
1422
- fp = (writing ? stdout : stdin);
1423
- SET_BINARY_MODE(fp);
1424
- } else {
1425
- fp = fopen(path,mode2);
1426
- }
1427
- } else {
1428
- #ifdef BZ_STRICT_ANSI
1429
- fp = NULL;
1430
- #else
1431
- fp = fdopen(fd,mode2);
1432
- #endif
1433
- }
1434
- if (fp == NULL) return NULL;
1435
-
1436
- if (writing) {
1437
- /* Guard against total chaos and anarchy -- JRS */
1438
- if (blockSize100k < 1) blockSize100k = 1;
1439
- if (blockSize100k > 9) blockSize100k = 9;
1440
- bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
1441
- verbosity,workFactor);
1442
- } else {
1443
- bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
1444
- unused,nUnused);
1445
- }
1446
- if (bzfp == NULL) {
1447
- if (fp != stdin && fp != stdout) fclose(fp);
1448
- return NULL;
1449
- }
1450
- return bzfp;
1451
- }
1452
-
1453
-
1454
- /*---------------------------------------------------*/
1455
- /*--
1456
- open file for read or write.
1457
- ex) bzopen("file","w9")
1458
- case path="" or NULL => use stdin or stdout.
1459
- --*/
1460
- BZFILE * BZ_API(BZ2_bzopen)
1461
- ( const char *path,
1462
- const char *mode )
1463
- {
1464
- return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);
1465
- }
1466
-
1467
-
1468
- /*---------------------------------------------------*/
1469
- BZFILE * BZ_API(BZ2_bzdopen)
1470
- ( int fd,
1471
- const char *mode )
1472
- {
1473
- return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);
1474
- }
1475
-
1476
-
1477
- /*---------------------------------------------------*/
1478
- int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )
1479
- {
1480
- int bzerr, nread;
1481
- if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0;
1482
- nread = BZ2_bzRead(&bzerr,b,buf,len);
1483
- if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) {
1484
- return nread;
1485
- } else {
1486
- return -1;
1487
- }
1488
- }
1489
-
1490
-
1491
- /*---------------------------------------------------*/
1492
- int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )
1493
- {
1494
- int bzerr;
1495
-
1496
- BZ2_bzWrite(&bzerr,b,buf,len);
1497
- if(bzerr == BZ_OK){
1498
- return len;
1499
- }else{
1500
- return -1;
1501
- }
1502
- }
1503
-
1504
-
1505
- /*---------------------------------------------------*/
1506
- int BZ_API(BZ2_bzflush) (BZFILE *b)
1507
- {
1508
- /* do nothing now... */
1509
- return 0;
1510
- }
1511
-
1512
-
1513
- /*---------------------------------------------------*/
1514
- void BZ_API(BZ2_bzclose) (BZFILE* b)
1515
- {
1516
- int bzerr;
1517
- FILE *fp;
1518
-
1519
- if (b==NULL) {return;}
1520
- fp = ((bzFile *)b)->handle;
1521
- if(((bzFile*)b)->writing){
1522
- BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
1523
- if(bzerr != BZ_OK){
1524
- BZ2_bzWriteClose(NULL,b,1,NULL,NULL);
1525
- }
1526
- }else{
1527
- BZ2_bzReadClose(&bzerr,b);
1528
- }
1529
- if(fp!=stdin && fp!=stdout){
1530
- fclose(fp);
1531
- }
1532
- }
1533
-
1534
-
1535
- /*---------------------------------------------------*/
1536
- /*--
1537
- return last error code
1538
- --*/
1539
- static const char *bzerrorstrings[] = {
1540
- "OK"
1541
- ,"SEQUENCE_ERROR"
1542
- ,"PARAM_ERROR"
1543
- ,"MEM_ERROR"
1544
- ,"DATA_ERROR"
1545
- ,"DATA_ERROR_MAGIC"
1546
- ,"IO_ERROR"
1547
- ,"UNEXPECTED_EOF"
1548
- ,"OUTBUFF_FULL"
1549
- ,"CONFIG_ERROR"
1550
- ,"???" /* for future */
1551
- ,"???" /* for future */
1552
- ,"???" /* for future */
1553
- ,"???" /* for future */
1554
- ,"???" /* for future */
1555
- ,"???" /* for future */
1556
- };
1557
-
1558
-
1559
- const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
1560
- {
1561
- int err = ((bzFile *)b)->lastErr;
1562
-
1563
- if(err>0) err = 0;
1564
- *errnum = err;
1565
- return bzerrorstrings[err*-1];
1566
- }
1567
- #endif
1568
-
1569
-
1570
- /*-------------------------------------------------------------*/
1571
- /*--- end bzlib.c ---*/
1572
- /*-------------------------------------------------------------*/