laag-libczmq 4.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (697) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +57 -0
  3. data/LICENSE.txt +373 -0
  4. data/README.org +34 -0
  5. data/ext/laag/libczmq/extconf.rb +24 -0
  6. data/laag-libczmq.gemspec +21 -0
  7. data/lib/laag/libczmq.rb +30 -0
  8. data/vendor/github.com/zeromq/czmq/.editorconfig +19 -0
  9. data/vendor/github.com/zeromq/czmq/.gitattributes +5 -0
  10. data/vendor/github.com/zeromq/czmq/.github/PULL_REQUEST_TEMPLATE.md +28 -0
  11. data/vendor/github.com/zeromq/czmq/.gitignore +137 -0
  12. data/vendor/github.com/zeromq/czmq/.travis.yml +126 -0
  13. data/vendor/github.com/zeromq/czmq/AUTHORS +69 -0
  14. data/vendor/github.com/zeromq/czmq/CMakeLists.txt +653 -0
  15. data/vendor/github.com/zeromq/czmq/CONTRIBUTING.md +19 -0
  16. data/vendor/github.com/zeromq/czmq/Dockerfile +29 -0
  17. data/vendor/github.com/zeromq/czmq/Findlibsodium.cmake +47 -0
  18. data/vendor/github.com/zeromq/czmq/Findlibzmq.cmake +49 -0
  19. data/vendor/github.com/zeromq/czmq/Findlz4.cmake +49 -0
  20. data/vendor/github.com/zeromq/czmq/Findsystemd.cmake +49 -0
  21. data/vendor/github.com/zeromq/czmq/Finduuid.cmake +49 -0
  22. data/vendor/github.com/zeromq/czmq/INSTALL.cygwin +13 -0
  23. data/vendor/github.com/zeromq/czmq/ISSUES.cygwin +6 -0
  24. data/vendor/github.com/zeromq/czmq/Jenkinsfile +439 -0
  25. data/vendor/github.com/zeromq/czmq/LICENSE +373 -0
  26. data/vendor/github.com/zeromq/czmq/Makefile.am +70 -0
  27. data/vendor/github.com/zeromq/czmq/NEWS +823 -0
  28. data/vendor/github.com/zeromq/czmq/README.cygwin +23 -0
  29. data/vendor/github.com/zeromq/czmq/README.md +9345 -0
  30. data/vendor/github.com/zeromq/czmq/README.txt +512 -0
  31. data/vendor/github.com/zeromq/czmq/Vagrantfile +49 -0
  32. data/vendor/github.com/zeromq/czmq/acinclude.m4 +7 -0
  33. data/vendor/github.com/zeromq/czmq/api/zactor.api +77 -0
  34. data/vendor/github.com/zeromq/czmq/api/zargs.api +110 -0
  35. data/vendor/github.com/zeromq/czmq/api/zarmour.api +103 -0
  36. data/vendor/github.com/zeromq/czmq/api/zcert.api +128 -0
  37. data/vendor/github.com/zeromq/czmq/api/zcertstore.api +80 -0
  38. data/vendor/github.com/zeromq/czmq/api/zchunk.api +171 -0
  39. data/vendor/github.com/zeromq/czmq/api/zclock.api +43 -0
  40. data/vendor/github.com/zeromq/czmq/api/zconfig.api +205 -0
  41. data/vendor/github.com/zeromq/czmq/api/zdigest.api +45 -0
  42. data/vendor/github.com/zeromq/czmq/api/zdir.api +124 -0
  43. data/vendor/github.com/zeromq/czmq/api/zdir_patch.api +62 -0
  44. data/vendor/github.com/zeromq/czmq/api/zfile.api +157 -0
  45. data/vendor/github.com/zeromq/czmq/api/zframe.api +157 -0
  46. data/vendor/github.com/zeromq/czmq/api/zgossip_msg.api +104 -0
  47. data/vendor/github.com/zeromq/czmq/api/zhash.api +184 -0
  48. data/vendor/github.com/zeromq/czmq/api/zhashx.api +295 -0
  49. data/vendor/github.com/zeromq/czmq/api/ziflist.api +73 -0
  50. data/vendor/github.com/zeromq/czmq/api/zlist.api +158 -0
  51. data/vendor/github.com/zeromq/czmq/api/zlistx.api +220 -0
  52. data/vendor/github.com/zeromq/czmq/api/zloop.api +176 -0
  53. data/vendor/github.com/zeromq/czmq/api/zmsg.api +250 -0
  54. data/vendor/github.com/zeromq/czmq/api/zpoller.api +71 -0
  55. data/vendor/github.com/zeromq/czmq/api/zproc.api +247 -0
  56. data/vendor/github.com/zeromq/czmq/api/zsock.api +412 -0
  57. data/vendor/github.com/zeromq/czmq/api/zsock_option.api +847 -0
  58. data/vendor/github.com/zeromq/czmq/api/zstr.api +119 -0
  59. data/vendor/github.com/zeromq/czmq/api/zsys.api +490 -0
  60. data/vendor/github.com/zeromq/czmq/api/ztimerset.api +69 -0
  61. data/vendor/github.com/zeromq/czmq/api/ztrie.api +80 -0
  62. data/vendor/github.com/zeromq/czmq/api/zuuid.api +82 -0
  63. data/vendor/github.com/zeromq/czmq/appveyor.yml +73 -0
  64. data/vendor/github.com/zeromq/czmq/autogen.sh +52 -0
  65. data/vendor/github.com/zeromq/czmq/bindings/jni/.gitignore +8 -0
  66. data/vendor/github.com/zeromq/czmq/bindings/jni/CMakeLists.txt +79 -0
  67. data/vendor/github.com/zeromq/czmq/bindings/jni/Findczmq.cmake +47 -0
  68. data/vendor/github.com/zeromq/czmq/bindings/jni/README.md +130 -0
  69. data/vendor/github.com/zeromq/czmq/bindings/jni/android/CMakeLists.txt +79 -0
  70. data/vendor/github.com/zeromq/czmq/bindings/jni/android/android_toolchain.cmake +52 -0
  71. data/vendor/github.com/zeromq/czmq/bindings/jni/android/build.sh +68 -0
  72. data/vendor/github.com/zeromq/czmq/bindings/jni/build.gradle +151 -0
  73. data/vendor/github.com/zeromq/czmq/bindings/jni/ci_build.sh +96 -0
  74. data/vendor/github.com/zeromq/czmq/bindings/jni/gradle/wrapper/gradle-wrapper.jar +0 -0
  75. data/vendor/github.com/zeromq/czmq/bindings/jni/gradle/wrapper/gradle-wrapper.properties +6 -0
  76. data/vendor/github.com/zeromq/czmq/bindings/jni/gradlew +164 -0
  77. data/vendor/github.com/zeromq/czmq/bindings/jni/gradlew.bat +90 -0
  78. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/.gitignore +8 -0
  79. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/configure.bat +93 -0
  80. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/platform.h +1 -0
  81. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Common.props +21 -0
  82. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DLL.props +16 -0
  83. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Debug.props +29 -0
  84. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugDEXE.props +21 -0
  85. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugDLL.props +20 -0
  86. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugLEXE.props +20 -0
  87. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugLIB.props +21 -0
  88. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugLTCG.props +20 -0
  89. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/DebugSEXE.props +21 -0
  90. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/EXE.props +17 -0
  91. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/LIB.props +16 -0
  92. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/LTCG.props +13 -0
  93. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Link.props +21 -0
  94. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Messages.props +15 -0
  95. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Output.props +30 -0
  96. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Release.props +41 -0
  97. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseDEXE.props +20 -0
  98. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseDLL.props +19 -0
  99. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseLEXE.props +20 -0
  100. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseLIB.props +19 -0
  101. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseLTCG.props +19 -0
  102. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/ReleaseSEXE.props +20 -0
  103. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/Win32.props +20 -0
  104. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/properties/x64.props +23 -0
  105. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/resource.h +14 -0
  106. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/resource.rc +94 -0
  107. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/build.bat +48 -0
  108. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/call_javah.bat +84 -0
  109. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/czmq.sln +25 -0
  110. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/libczmqjni/libczmqjni.props +69 -0
  111. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/libczmqjni/libczmqjni.vcxproj +165 -0
  112. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2010/libczmqjni/libczmqjni.vcxproj.filters +210 -0
  113. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/build.bat +48 -0
  114. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/call_javah.bat +84 -0
  115. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/czmq.sln +25 -0
  116. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/libczmqjni/libczmqjni.props +69 -0
  117. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/libczmqjni/libczmqjni.vcxproj +165 -0
  118. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2012/libczmqjni/libczmqjni.vcxproj.filters +210 -0
  119. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/build.bat +48 -0
  120. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/call_javah.bat +84 -0
  121. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/czmq.sln +25 -0
  122. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/libczmqjni/libczmqjni.props +69 -0
  123. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/libczmqjni/libczmqjni.vcxproj +165 -0
  124. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2013/libczmqjni/libczmqjni.vcxproj.filters +210 -0
  125. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/build.bat +48 -0
  126. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/call_javah.bat +84 -0
  127. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/czmq.sln +25 -0
  128. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/libczmqjni/libczmqjni.props +69 -0
  129. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/libczmqjni/libczmqjni.vcxproj +165 -0
  130. data/vendor/github.com/zeromq/czmq/bindings/jni/msvc/vs2015/libczmqjni/libczmqjni.vcxproj.filters +210 -0
  131. data/vendor/github.com/zeromq/czmq/bindings/jni/settings.gradle +1 -0
  132. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zarmour.c +132 -0
  133. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zcert.c +188 -0
  134. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zcertstore.c +69 -0
  135. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zchunk.c +191 -0
  136. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zclock.c +54 -0
  137. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zconfig.c +252 -0
  138. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zdigest.c +66 -0
  139. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zdir.c +116 -0
  140. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_ZdirPatch.c +88 -0
  141. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zfile.c +186 -0
  142. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zframe.c +199 -0
  143. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zhash.c +174 -0
  144. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zhashx.c +175 -0
  145. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Ziflist.c +112 -0
  146. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zlist.c +135 -0
  147. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zlistx.c +189 -0
  148. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zloop.c +95 -0
  149. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zmsg.c +261 -0
  150. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zpoller.c +74 -0
  151. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zproc.c +278 -0
  152. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zsock.c +1310 -0
  153. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zstr.c +108 -0
  154. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zsys.c +445 -0
  155. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Ztimerset.c +68 -0
  156. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Ztrie.c +86 -0
  157. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/c/org_zeromq_czmq_Zuuid.c +125 -0
  158. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zarmour.java +148 -0
  159. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zcert.java +178 -0
  160. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zcertstore.java +94 -0
  161. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zchunk.java +204 -0
  162. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zclock.java +67 -0
  163. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zconfig.java +253 -0
  164. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zdigest.java +78 -0
  165. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zdir.java +159 -0
  166. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/ZdirPatch.java +96 -0
  167. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zfile.java +217 -0
  168. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zframe.java +212 -0
  169. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zhash.java +223 -0
  170. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zhashx.java +248 -0
  171. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Ziflist.java +124 -0
  172. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zlist.java +171 -0
  173. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zlistx.java +247 -0
  174. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zloop.java +134 -0
  175. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zmsg.java +308 -0
  176. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zpoller.java +105 -0
  177. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zproc.java +331 -0
  178. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zsock.java +1556 -0
  179. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zstr.java +117 -0
  180. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zsys.java +534 -0
  181. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Ztimerset.java +87 -0
  182. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Ztrie.java +102 -0
  183. data/vendor/github.com/zeromq/czmq/bindings/jni/src/main/java/org/zeromq/czmq/Zuuid.java +127 -0
  184. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZarmourTest.java +25 -0
  185. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZcertTest.java +25 -0
  186. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZcertstoreTest.java +25 -0
  187. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZchunkTest.java +25 -0
  188. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZclockTest.java +25 -0
  189. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZconfigTest.java +25 -0
  190. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZdigestTest.java +25 -0
  191. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZdirPatchTest.java +25 -0
  192. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZdirTest.java +25 -0
  193. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZfileTest.java +25 -0
  194. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZframeTest.java +25 -0
  195. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZhashTest.java +25 -0
  196. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZhashxTest.java +25 -0
  197. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZiflistTest.java +25 -0
  198. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZlistTest.java +25 -0
  199. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZlistxTest.java +25 -0
  200. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZloopTest.java +25 -0
  201. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZmsgTest.java +25 -0
  202. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZpollerTest.java +25 -0
  203. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZprocTest.java +25 -0
  204. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZsockTest.java +25 -0
  205. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZstrTest.java +25 -0
  206. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZsysTest.java +25 -0
  207. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZtimersetTest.java +25 -0
  208. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZtrieTest.java +25 -0
  209. data/vendor/github.com/zeromq/czmq/bindings/jni/src/test/java/org/zeromq/czmq/ZuuidTest.java +25 -0
  210. data/vendor/github.com/zeromq/czmq/bindings/lua_ffi/czmq_ffi.lua +4079 -0
  211. data/vendor/github.com/zeromq/czmq/bindings/nodejs/.gitignore +10 -0
  212. data/vendor/github.com/zeromq/czmq/bindings/nodejs/.prebuildrc +2 -0
  213. data/vendor/github.com/zeromq/czmq/bindings/nodejs/README.md +4373 -0
  214. data/vendor/github.com/zeromq/czmq/bindings/nodejs/binding.cc +8324 -0
  215. data/vendor/github.com/zeromq/czmq/bindings/nodejs/binding.gyp +49 -0
  216. data/vendor/github.com/zeromq/czmq/bindings/nodejs/binding.h +952 -0
  217. data/vendor/github.com/zeromq/czmq/bindings/nodejs/build.sh +79 -0
  218. data/vendor/github.com/zeromq/czmq/bindings/nodejs/index.js +39 -0
  219. data/vendor/github.com/zeromq/czmq/bindings/nodejs/package.json +26 -0
  220. data/vendor/github.com/zeromq/czmq/bindings/nodejs/test_binding.js +32 -0
  221. data/vendor/github.com/zeromq/czmq/bindings/python/ci_build.sh +59 -0
  222. data/vendor/github.com/zeromq/czmq/bindings/python/czmq/__init__.py +3 -0
  223. data/vendor/github.com/zeromq/czmq/bindings/python/czmq/_czmq_ctypes.py +8344 -0
  224. data/vendor/github.com/zeromq/czmq/bindings/python/test.py +1078 -0
  225. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/README.md +28 -0
  226. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zactor.py +78 -0
  227. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zargs.py +133 -0
  228. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zarmour.py +124 -0
  229. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zcert.py +132 -0
  230. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zcertstore.py +84 -0
  231. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zchunk.py +192 -0
  232. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zclock.py +59 -0
  233. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zconfig.py +211 -0
  234. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zdigest.py +64 -0
  235. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zdir.py +144 -0
  236. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/ZdirPatch.py +79 -0
  237. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zfile.py +185 -0
  238. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zframe.py +160 -0
  239. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zhash.py +197 -0
  240. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zhashx.py +271 -0
  241. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Ziflist.py +103 -0
  242. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zlist.py +176 -0
  243. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zlistx.py +235 -0
  244. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zloop.py +171 -0
  245. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zmsg.py +250 -0
  246. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zpoller.py +89 -0
  247. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zproc.py +287 -0
  248. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zsock.py +1283 -0
  249. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zstr.py +123 -0
  250. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zsys.py +532 -0
  251. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Ztimerset.py +78 -0
  252. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Ztrie.py +93 -0
  253. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/Zuuid.py +100 -0
  254. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/__init__.py +33 -0
  255. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/_cdefs.inc +4081 -0
  256. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/build.py +345 -0
  257. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/cdefs.py +4086 -0
  258. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/dlopen.py +33 -0
  259. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/czmq_cffi/utils.py +50 -0
  260. data/vendor/github.com/zeromq/czmq/bindings/python_cffi/setup.py +23 -0
  261. data/vendor/github.com/zeromq/czmq/bindings/qml/.gitignore +1 -0
  262. data/vendor/github.com/zeromq/czmq/bindings/qml/README.md +157 -0
  263. data/vendor/github.com/zeromq/czmq/bindings/qml/Rakefile +34 -0
  264. data/vendor/github.com/zeromq/czmq/bindings/qml/qml_czmq_bindings.pro +136 -0
  265. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZactor.cpp +88 -0
  266. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZactor.h +86 -0
  267. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZargs.cpp +121 -0
  268. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZargs.h +105 -0
  269. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZarmour.cpp +135 -0
  270. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZarmour.h +108 -0
  271. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZcert.cpp +166 -0
  272. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZcert.h +122 -0
  273. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZcertstore.cpp +95 -0
  274. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZcertstore.h +93 -0
  275. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZchunk.cpp +214 -0
  276. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZchunk.h +149 -0
  277. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZclock.cpp +67 -0
  278. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZclock.h +77 -0
  279. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZconfig.cpp +255 -0
  280. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZconfig.h +165 -0
  281. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdigest.cpp +70 -0
  282. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdigest.h +78 -0
  283. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdir.cpp +158 -0
  284. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdir.h +134 -0
  285. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdirPatch.cpp +89 -0
  286. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZdirPatch.h +84 -0
  287. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZfile.cpp +204 -0
  288. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZfile.h +152 -0
  289. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZframe.cpp +200 -0
  290. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZframe.h +143 -0
  291. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZhash.cpp +219 -0
  292. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZhash.h +174 -0
  293. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZhashx.cpp +308 -0
  294. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZhashx.h +225 -0
  295. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZiflist.cpp +111 -0
  296. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZiflist.h +96 -0
  297. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZlist.cpp +184 -0
  298. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZlist.h +148 -0
  299. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZlistx.cpp +244 -0
  300. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZlistx.h +184 -0
  301. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZloop.cpp +177 -0
  302. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZloop.h +149 -0
  303. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZmsg.cpp +313 -0
  304. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZmsg.h +209 -0
  305. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZpoller.cpp +95 -0
  306. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZpoller.h +97 -0
  307. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZproc.cpp +296 -0
  308. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZproc.h +211 -0
  309. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZsock.cpp +1471 -0
  310. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZsock.h +882 -0
  311. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZstr.cpp +137 -0
  312. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZstr.h +120 -0
  313. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZsys.cpp +541 -0
  314. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZsys.h +373 -0
  315. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZtimerset.cpp +84 -0
  316. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZtimerset.h +86 -0
  317. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZtrie.cpp +101 -0
  318. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZtrie.h +95 -0
  319. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZuuid.cpp +116 -0
  320. data/vendor/github.com/zeromq/czmq/bindings/qml/src/QmlZuuid.h +99 -0
  321. data/vendor/github.com/zeromq/czmq/bindings/qml/src/qml_czmq_plugin.h +174 -0
  322. data/vendor/github.com/zeromq/czmq/bindings/qml/src/qmldir +2 -0
  323. data/vendor/github.com/zeromq/czmq/bindings/qml/test/tst_QmlCZMQ.qml +16 -0
  324. data/vendor/github.com/zeromq/czmq/bindings/qt/README.md +87 -0
  325. data/vendor/github.com/zeromq/czmq/bindings/qt/buildlib/buildlib.pro +36 -0
  326. data/vendor/github.com/zeromq/czmq/bindings/qt/common.pri +20 -0
  327. data/vendor/github.com/zeromq/czmq/bindings/qt/config.pri +1 -0
  328. data/vendor/github.com/zeromq/czmq/bindings/qt/qczmq.pro +13 -0
  329. data/vendor/github.com/zeromq/czmq/bindings/qt/selftest/main.cpp +57 -0
  330. data/vendor/github.com/zeromq/czmq/bindings/qt/selftest/selftest.pro +19 -0
  331. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qczmq.h +96 -0
  332. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qczmq.pri +81 -0
  333. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzactor.cpp +98 -0
  334. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzactor.h +61 -0
  335. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzargs.cpp +130 -0
  336. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzargs.h +72 -0
  337. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzarmour.cpp +162 -0
  338. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzarmour.h +83 -0
  339. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzcert.cpp +191 -0
  340. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzcert.h +97 -0
  341. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzcertstore.cpp +105 -0
  342. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzcertstore.h +68 -0
  343. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzchunk.cpp +250 -0
  344. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzchunk.h +124 -0
  345. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzclock.cpp +78 -0
  346. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzclock.h +52 -0
  347. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzconfig.cpp +292 -0
  348. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzconfig.h +140 -0
  349. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdigest.cpp +80 -0
  350. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdigest.h +53 -0
  351. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdir.cpp +176 -0
  352. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdir.h +109 -0
  353. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdirpatch.cpp +101 -0
  354. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzdirpatch.h +59 -0
  355. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzfile.cpp +243 -0
  356. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzfile.h +127 -0
  357. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzframe.cpp +231 -0
  358. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzframe.h +118 -0
  359. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzhash.cpp +250 -0
  360. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzhash.h +149 -0
  361. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzhashx.cpp +350 -0
  362. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzhashx.h +200 -0
  363. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qziflist.cpp +133 -0
  364. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qziflist.h +71 -0
  365. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzlist.cpp +220 -0
  366. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzlist.h +123 -0
  367. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzlistx.cpp +296 -0
  368. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzlistx.h +159 -0
  369. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzloop.cpp +211 -0
  370. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzloop.h +124 -0
  371. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzmsg.cpp +354 -0
  372. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzmsg.h +184 -0
  373. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzpoller.cpp +100 -0
  374. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzpoller.h +67 -0
  375. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzproc.cpp +365 -0
  376. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzproc.h +186 -0
  377. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzsock.cpp +1719 -0
  378. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzsock.h +815 -0
  379. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzstr.cpp +128 -0
  380. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzstr.h +78 -0
  381. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzsys.cpp +600 -0
  382. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzsys.h +321 -0
  383. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qztimerset.cpp +98 -0
  384. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qztimerset.h +61 -0
  385. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qztrie.cpp +117 -0
  386. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qztrie.h +70 -0
  387. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzuuid.cpp +135 -0
  388. data/vendor/github.com/zeromq/czmq/bindings/qt/src/qzuuid.h +74 -0
  389. data/vendor/github.com/zeromq/czmq/bindings/ruby/Rakefile +8 -0
  390. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi.rb +875 -0
  391. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/version.rb +15 -0
  392. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zactor.rb +219 -0
  393. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zargs.rb +259 -0
  394. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zarmour.rb +286 -0
  395. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zcert.rb +304 -0
  396. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zcertstore.rb +224 -0
  397. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zchunk.rb +388 -0
  398. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zclock.rb +140 -0
  399. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zconfig.rb +462 -0
  400. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zdigest.rb +156 -0
  401. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zdir.rb +283 -0
  402. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zdir_patch.rb +194 -0
  403. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zfile.rb +361 -0
  404. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zframe.rb +360 -0
  405. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zhash.rb +386 -0
  406. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zhashx.rb +617 -0
  407. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/ziflist.rb +219 -0
  408. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zlist.rb +365 -0
  409. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zlistx.rb +478 -0
  410. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zloop.rb +396 -0
  411. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zmsg.rb +515 -0
  412. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zpoller.rb +194 -0
  413. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zproc.rb +497 -0
  414. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zsock.rb +4673 -0
  415. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zstr.rb +242 -0
  416. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zsys.rb +836 -0
  417. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/ztimerset.rb +203 -0
  418. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/ztrie.rb +221 -0
  419. data/vendor/github.com/zeromq/czmq/bindings/ruby/lib/czmq/ffi/zuuid.rb +227 -0
  420. data/vendor/github.com/zeromq/czmq/bindings/ruby/spec/ffi_spec.rb +15 -0
  421. data/vendor/github.com/zeromq/czmq/bindings/ruby/spec/spec_helper.rb +8 -0
  422. data/vendor/github.com/zeromq/czmq/builds/android/android_build_helper.sh +298 -0
  423. data/vendor/github.com/zeromq/czmq/builds/android/build.sh +94 -0
  424. data/vendor/github.com/zeromq/czmq/builds/android/ci_build.sh +41 -0
  425. data/vendor/github.com/zeromq/czmq/builds/check_zproject/ci_build.sh +52 -0
  426. data/vendor/github.com/zeromq/czmq/builds/check_zproto/ci_build.sh +23 -0
  427. data/vendor/github.com/zeromq/czmq/builds/cmake/ci_build.sh +93 -0
  428. data/vendor/github.com/zeromq/czmq/builds/cygwin/Makefile.cygwin +32 -0
  429. data/vendor/github.com/zeromq/czmq/builds/docs/ci_build.sh +24 -0
  430. data/vendor/github.com/zeromq/czmq/builds/gyp/.gitignore +5 -0
  431. data/vendor/github.com/zeromq/czmq/builds/gyp/README.md +33 -0
  432. data/vendor/github.com/zeromq/czmq/builds/gyp/platform.h +46 -0
  433. data/vendor/github.com/zeromq/czmq/builds/gyp/project.gyp +195 -0
  434. data/vendor/github.com/zeromq/czmq/builds/mingw32/Makefile.mingw32 +33 -0
  435. data/vendor/github.com/zeromq/czmq/builds/mingw32/platform.h +0 -0
  436. data/vendor/github.com/zeromq/czmq/builds/msvc/.gitignore +8 -0
  437. data/vendor/github.com/zeromq/czmq/builds/msvc/configure.bat +93 -0
  438. data/vendor/github.com/zeromq/czmq/builds/msvc/nuget/package.bat +14 -0
  439. data/vendor/github.com/zeromq/czmq/builds/msvc/nuget/package.nuspec +92 -0
  440. data/vendor/github.com/zeromq/czmq/builds/msvc/nuget/package.targets +128 -0
  441. data/vendor/github.com/zeromq/czmq/builds/msvc/nuget/package.xml +29 -0
  442. data/vendor/github.com/zeromq/czmq/builds/msvc/platform.h +1 -0
  443. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Common.props +21 -0
  444. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DLL.props +16 -0
  445. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Debug.props +29 -0
  446. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugDEXE.props +21 -0
  447. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugDLL.props +20 -0
  448. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugLEXE.props +20 -0
  449. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugLIB.props +21 -0
  450. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugLTCG.props +20 -0
  451. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/DebugSEXE.props +21 -0
  452. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/EXE.props +17 -0
  453. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/LIB.props +16 -0
  454. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/LTCG.props +13 -0
  455. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Link.props +21 -0
  456. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Messages.props +15 -0
  457. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Output.props +30 -0
  458. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Release.props +41 -0
  459. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseDEXE.props +20 -0
  460. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseDLL.props +19 -0
  461. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseLEXE.props +20 -0
  462. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseLIB.props +19 -0
  463. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseLTCG.props +19 -0
  464. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/ReleaseSEXE.props +20 -0
  465. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/Win32.props +20 -0
  466. data/vendor/github.com/zeromq/czmq/builds/msvc/properties/x64.props +23 -0
  467. data/vendor/github.com/zeromq/czmq/builds/msvc/resource.h +14 -0
  468. data/vendor/github.com/zeromq/czmq/builds/msvc/resource.rc +94 -0
  469. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2008/czmq/czmq.sln +65 -0
  470. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2008/czmq/czmq.vcproj +1411 -0
  471. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/.gitignore +1 -0
  472. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/build.bat +129 -0
  473. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/czmq.import.props +59 -0
  474. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/czmq.sln +81 -0
  475. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/czmq_selftest/czmq_selftest.props +75 -0
  476. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/czmq_selftest/czmq_selftest.vcxproj +146 -0
  477. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/libczmq/libczmq.import.xml +29 -0
  478. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/libczmq/libczmq.props +81 -0
  479. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/libczmq/libczmq.vcxproj +215 -0
  480. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/libczmq/libczmq.vcxproj.filters +203 -0
  481. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/test_randof/test_randof.props +75 -0
  482. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/test_randof/test_randof.vcxproj +146 -0
  483. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/zmakecert/zmakecert.props +75 -0
  484. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/zmakecert/zmakecert.vcxproj +146 -0
  485. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/zsp/zsp.props +75 -0
  486. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2010/zsp/zsp.vcxproj +146 -0
  487. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/.gitignore +1 -0
  488. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/build.bat +129 -0
  489. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/czmq.import.props +59 -0
  490. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/czmq.sln +81 -0
  491. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/czmq_selftest/czmq_selftest.props +75 -0
  492. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/czmq_selftest/czmq_selftest.vcxproj +146 -0
  493. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/libczmq/libczmq.import.xml +29 -0
  494. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/libczmq/libczmq.props +81 -0
  495. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/libczmq/libczmq.vcxproj +215 -0
  496. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/libczmq/libczmq.vcxproj.filters +203 -0
  497. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/test_randof/test_randof.props +75 -0
  498. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/test_randof/test_randof.vcxproj +146 -0
  499. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/zmakecert/zmakecert.props +75 -0
  500. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/zmakecert/zmakecert.vcxproj +146 -0
  501. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/zsp/zsp.props +75 -0
  502. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2012/zsp/zsp.vcxproj +146 -0
  503. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/build.bat +129 -0
  504. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/czmq.import.props +59 -0
  505. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/czmq.sln +81 -0
  506. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/czmq_selftest/czmq_selftest.props +75 -0
  507. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/czmq_selftest/czmq_selftest.vcxproj +146 -0
  508. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/libczmq/libczmq.import.xml +29 -0
  509. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/libczmq/libczmq.props +81 -0
  510. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/libczmq/libczmq.vcxproj +215 -0
  511. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/libczmq/libczmq.vcxproj.filters +203 -0
  512. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/test_randof/test_randof.props +75 -0
  513. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/test_randof/test_randof.vcxproj +146 -0
  514. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/zmakecert/zmakecert.props +75 -0
  515. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/zmakecert/zmakecert.vcxproj +146 -0
  516. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/zsp/zsp.props +75 -0
  517. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2013/zsp/zsp.vcxproj +146 -0
  518. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/build.bat +129 -0
  519. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/czmq.import.props +59 -0
  520. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/czmq.sln +81 -0
  521. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/czmq_selftest/czmq_selftest.props +75 -0
  522. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/czmq_selftest/czmq_selftest.vcxproj +146 -0
  523. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/libczmq/libczmq.import.xml +29 -0
  524. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/libczmq/libczmq.props +81 -0
  525. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/libczmq/libczmq.vcxproj +215 -0
  526. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/libczmq/libczmq.vcxproj.filters +203 -0
  527. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/test_randof/test_randof.props +75 -0
  528. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/test_randof/test_randof.vcxproj +146 -0
  529. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/zmakecert/zmakecert.props +75 -0
  530. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/zmakecert/zmakecert.vcxproj +146 -0
  531. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/zsp/zsp.props +75 -0
  532. data/vendor/github.com/zeromq/czmq/builds/msvc/vs2015/zsp/zsp.vcxproj +146 -0
  533. data/vendor/github.com/zeromq/czmq/builds/nuget/czmq.autobuild +49 -0
  534. data/vendor/github.com/zeromq/czmq/builds/nuget/readme.nuget +18 -0
  535. data/vendor/github.com/zeromq/czmq/builds/rpi/.gitignore +8 -0
  536. data/vendor/github.com/zeromq/czmq/builds/rpi/README.md +62 -0
  537. data/vendor/github.com/zeromq/czmq/builds/rpi/build.sh +142 -0
  538. data/vendor/github.com/zeromq/czmq/builds/rpi/build_image.sh +32 -0
  539. data/vendor/github.com/zeromq/czmq/builds/rpi/prepare_img.sh +111 -0
  540. data/vendor/github.com/zeromq/czmq/builds/stable_zmq/ci_build.sh +62 -0
  541. data/vendor/github.com/zeromq/czmq/builds/valgrind/ci_build.sh +43 -0
  542. data/vendor/github.com/zeromq/czmq/ci_build.sh +317 -0
  543. data/vendor/github.com/zeromq/czmq/ci_deploy.sh +29 -0
  544. data/vendor/github.com/zeromq/czmq/ci_deploy_obs.sh +23 -0
  545. data/vendor/github.com/zeromq/czmq/configure.ac +856 -0
  546. data/vendor/github.com/zeromq/czmq/doc/.gitignore +91 -0
  547. data/vendor/github.com/zeromq/czmq/doc/Makefile.am +222 -0
  548. data/vendor/github.com/zeromq/czmq/doc/asciidoc.conf +64 -0
  549. data/vendor/github.com/zeromq/czmq/doc/czmq.adoc +51 -0
  550. data/vendor/github.com/zeromq/czmq/doc/czmq.txt +380 -0
  551. data/vendor/github.com/zeromq/czmq/doc/mkman +217 -0
  552. data/vendor/github.com/zeromq/czmq/doc/mkmans +15 -0
  553. data/vendor/github.com/zeromq/czmq/doc/wdput +43 -0
  554. data/vendor/github.com/zeromq/czmq/examples/security/LICENSE +18 -0
  555. data/vendor/github.com/zeromq/czmq/examples/security/README.txt +9 -0
  556. data/vendor/github.com/zeromq/czmq/examples/security/grasslands.c +32 -0
  557. data/vendor/github.com/zeromq/czmq/examples/security/hello.c +13 -0
  558. data/vendor/github.com/zeromq/czmq/examples/security/ironhouse.c +64 -0
  559. data/vendor/github.com/zeromq/czmq/examples/security/ironhouse2.c +123 -0
  560. data/vendor/github.com/zeromq/czmq/examples/security/ironhouse2_v2.c +107 -0
  561. data/vendor/github.com/zeromq/czmq/examples/security/passwords +2 -0
  562. data/vendor/github.com/zeromq/czmq/examples/security/stonehouse.c +59 -0
  563. data/vendor/github.com/zeromq/czmq/examples/security/strawhouse.c +49 -0
  564. data/vendor/github.com/zeromq/czmq/examples/security/woodhouse.c +47 -0
  565. data/vendor/github.com/zeromq/czmq/images/README_1.png +0 -0
  566. data/vendor/github.com/zeromq/czmq/include/.gitignore +1 -0
  567. data/vendor/github.com/zeromq/czmq/include/czmq.h +39 -0
  568. data/vendor/github.com/zeromq/czmq/include/czmq_library.h +190 -0
  569. data/vendor/github.com/zeromq/czmq/include/czmq_prelude.h +735 -0
  570. data/vendor/github.com/zeromq/czmq/include/test_zgossip.h +44 -0
  571. data/vendor/github.com/zeromq/czmq/include/zactor.h +94 -0
  572. data/vendor/github.com/zeromq/czmq/include/zargs.h +134 -0
  573. data/vendor/github.com/zeromq/czmq/include/zarmour.h +114 -0
  574. data/vendor/github.com/zeromq/czmq/include/zauth.h +100 -0
  575. data/vendor/github.com/zeromq/czmq/include/zbeacon.h +86 -0
  576. data/vendor/github.com/zeromq/czmq/include/zcert.h +133 -0
  577. data/vendor/github.com/zeromq/czmq/include/zcertstore.h +101 -0
  578. data/vendor/github.com/zeromq/czmq/include/zchunk.h +163 -0
  579. data/vendor/github.com/zeromq/czmq/include/zclock.h +73 -0
  580. data/vendor/github.com/zeromq/czmq/include/zconfig.h +199 -0
  581. data/vendor/github.com/zeromq/czmq/include/zdigest.h +65 -0
  582. data/vendor/github.com/zeromq/czmq/include/zdir.h +149 -0
  583. data/vendor/github.com/zeromq/czmq/include/zdir_patch.h +82 -0
  584. data/vendor/github.com/zeromq/czmq/include/zfile.h +185 -0
  585. data/vendor/github.com/zeromq/czmq/include/zframe.h +177 -0
  586. data/vendor/github.com/zeromq/czmq/include/zgossip.h +95 -0
  587. data/vendor/github.com/zeromq/czmq/include/zhash.h +183 -0
  588. data/vendor/github.com/zeromq/czmq/include/zhashx.h +279 -0
  589. data/vendor/github.com/zeromq/czmq/include/ziflist.h +98 -0
  590. data/vendor/github.com/zeromq/czmq/include/zlist.h +158 -0
  591. data/vendor/github.com/zeromq/czmq/include/zlistx.h +205 -0
  592. data/vendor/github.com/zeromq/czmq/include/zloop.h +163 -0
  593. data/vendor/github.com/zeromq/czmq/include/zmonitor.h +73 -0
  594. data/vendor/github.com/zeromq/czmq/include/zmsg.h +280 -0
  595. data/vendor/github.com/zeromq/czmq/include/zpoller.h +87 -0
  596. data/vendor/github.com/zeromq/czmq/include/zproc.h +270 -0
  597. data/vendor/github.com/zeromq/czmq/include/zproxy.h +111 -0
  598. data/vendor/github.com/zeromq/czmq/include/zrex.h +82 -0
  599. data/vendor/github.com/zeromq/czmq/include/zsock.h +1209 -0
  600. data/vendor/github.com/zeromq/czmq/include/zstr.h +135 -0
  601. data/vendor/github.com/zeromq/czmq/include/zsys.h +439 -0
  602. data/vendor/github.com/zeromq/czmq/include/ztimerset.h +90 -0
  603. data/vendor/github.com/zeromq/czmq/include/ztrie.h +106 -0
  604. data/vendor/github.com/zeromq/czmq/include/zuuid.h +96 -0
  605. data/vendor/github.com/zeromq/czmq/issues/README.md +6 -0
  606. data/vendor/github.com/zeromq/czmq/issues/c +520 -0
  607. data/vendor/github.com/zeromq/czmq/issues/issue-407.c +146 -0
  608. data/vendor/github.com/zeromq/czmq/license.xml +9 -0
  609. data/vendor/github.com/zeromq/czmq/mkdoc +7 -0
  610. data/vendor/github.com/zeromq/czmq/model/chkopts.pl +47 -0
  611. data/vendor/github.com/zeromq/czmq/model/rename_class +42 -0
  612. data/vendor/github.com/zeromq/czmq/packaging/debian/changelog +5 -0
  613. data/vendor/github.com/zeromq/czmq/packaging/debian/compat +1 -0
  614. data/vendor/github.com/zeromq/czmq/packaging/debian/control +86 -0
  615. data/vendor/github.com/zeromq/czmq/packaging/debian/copyright +13 -0
  616. data/vendor/github.com/zeromq/czmq/packaging/debian/czmq.dsc.obs +20 -0
  617. data/vendor/github.com/zeromq/czmq/packaging/debian/czmq.install +2 -0
  618. data/vendor/github.com/zeromq/czmq/packaging/debian/czmq.manpages +1 -0
  619. data/vendor/github.com/zeromq/czmq/packaging/debian/format +1 -0
  620. data/vendor/github.com/zeromq/czmq/packaging/debian/libczmq-dev.install +4 -0
  621. data/vendor/github.com/zeromq/czmq/packaging/debian/libczmq-dev.manpages +2 -0
  622. data/vendor/github.com/zeromq/czmq/packaging/debian/libczmq4.install +1 -0
  623. data/vendor/github.com/zeromq/czmq/packaging/debian/rules +96 -0
  624. data/vendor/github.com/zeromq/czmq/packaging/dist/gitlog2changelog.py +125 -0
  625. data/vendor/github.com/zeromq/czmq/packaging/obs/_service +91 -0
  626. data/vendor/github.com/zeromq/czmq/packaging/redhat/czmq.spec +202 -0
  627. data/vendor/github.com/zeromq/czmq/project.gyp +121 -0
  628. data/vendor/github.com/zeromq/czmq/project.xml +99 -0
  629. data/vendor/github.com/zeromq/czmq/setup.py +9 -0
  630. data/vendor/github.com/zeromq/czmq/src/.gitignore +20 -0
  631. data/vendor/github.com/zeromq/czmq/src/.valgrind.supp +33 -0
  632. data/vendor/github.com/zeromq/czmq/src/CMakeLists-local.txt +22 -0
  633. data/vendor/github.com/zeromq/czmq/src/Makemodule-local.am +15 -0
  634. data/vendor/github.com/zeromq/czmq/src/Makemodule.am +353 -0
  635. data/vendor/github.com/zeromq/czmq/src/czmq_classes.h +388 -0
  636. data/vendor/github.com/zeromq/czmq/src/czmq_private_selftest.c +40 -0
  637. data/vendor/github.com/zeromq/czmq/src/czmq_selftest.c +220 -0
  638. data/vendor/github.com/zeromq/czmq/src/foreign/sha1/sha1.h +76 -0
  639. data/vendor/github.com/zeromq/czmq/src/foreign/sha1/sha1.inc_c +335 -0
  640. data/vendor/github.com/zeromq/czmq/src/foreign/slre/readme.txt +83 -0
  641. data/vendor/github.com/zeromq/czmq/src/foreign/slre/slre.h +92 -0
  642. data/vendor/github.com/zeromq/czmq/src/foreign/slre/slre.inc_c +660 -0
  643. data/vendor/github.com/zeromq/czmq/src/libczmq.pc.in +24 -0
  644. data/vendor/github.com/zeromq/czmq/src/python_cffi.inc +17 -0
  645. data/vendor/github.com/zeromq/czmq/src/selftest-ro/.gitkeep +0 -0
  646. data/vendor/github.com/zeromq/czmq/src/selftest.cfg +5 -0
  647. data/vendor/github.com/zeromq/czmq/src/sockopts.gsl +36 -0
  648. data/vendor/github.com/zeromq/czmq/src/sockopts.xml +193 -0
  649. data/vendor/github.com/zeromq/czmq/src/test_randof.c +182 -0
  650. data/vendor/github.com/zeromq/czmq/src/test_zgossip.c +188 -0
  651. data/vendor/github.com/zeromq/czmq/src/valgrind.supp +14 -0
  652. data/vendor/github.com/zeromq/czmq/src/zactor.c +338 -0
  653. data/vendor/github.com/zeromq/czmq/src/zargs.c +289 -0
  654. data/vendor/github.com/zeromq/czmq/src/zarmour.c +941 -0
  655. data/vendor/github.com/zeromq/czmq/src/zauth.c +821 -0
  656. data/vendor/github.com/zeromq/czmq/src/zbeacon.c +651 -0
  657. data/vendor/github.com/zeromq/czmq/src/zcert.c +557 -0
  658. data/vendor/github.com/zeromq/czmq/src/zcertstore.c +407 -0
  659. data/vendor/github.com/zeromq/czmq/src/zchunk.c +609 -0
  660. data/vendor/github.com/zeromq/czmq/src/zclock.c +237 -0
  661. data/vendor/github.com/zeromq/czmq/src/zconfig.c +1369 -0
  662. data/vendor/github.com/zeromq/czmq/src/zdigest.c +163 -0
  663. data/vendor/github.com/zeromq/czmq/src/zdir.c +1138 -0
  664. data/vendor/github.com/zeromq/czmq/src/zdir_patch.c +227 -0
  665. data/vendor/github.com/zeromq/czmq/src/zfile.c +920 -0
  666. data/vendor/github.com/zeromq/czmq/src/zframe.c +756 -0
  667. data/vendor/github.com/zeromq/czmq/src/zgossip.c +689 -0
  668. data/vendor/github.com/zeromq/czmq/src/zgossip.xml +57 -0
  669. data/vendor/github.com/zeromq/czmq/src/zgossip_engine.inc +1008 -0
  670. data/vendor/github.com/zeromq/czmq/src/zgossip_msg.bnf +43 -0
  671. data/vendor/github.com/zeromq/czmq/src/zgossip_msg.c +688 -0
  672. data/vendor/github.com/zeromq/czmq/src/zgossip_msg.h +127 -0
  673. data/vendor/github.com/zeromq/czmq/src/zgossip_msg.xml +46 -0
  674. data/vendor/github.com/zeromq/czmq/src/zhash.c +956 -0
  675. data/vendor/github.com/zeromq/czmq/src/zhash_primes.inc +329 -0
  676. data/vendor/github.com/zeromq/czmq/src/zhashx.c +1369 -0
  677. data/vendor/github.com/zeromq/czmq/src/ziflist.c +517 -0
  678. data/vendor/github.com/zeromq/czmq/src/zlist.c +634 -0
  679. data/vendor/github.com/zeromq/czmq/src/zlistx.c +753 -0
  680. data/vendor/github.com/zeromq/czmq/src/zloop.c +1000 -0
  681. data/vendor/github.com/zeromq/czmq/src/zmakecert.c +64 -0
  682. data/vendor/github.com/zeromq/czmq/src/zmonitor.c +447 -0
  683. data/vendor/github.com/zeromq/czmq/src/zmsg.c +1258 -0
  684. data/vendor/github.com/zeromq/czmq/src/zpoller.c +397 -0
  685. data/vendor/github.com/zeromq/czmq/src/zproc.c +1160 -0
  686. data/vendor/github.com/zeromq/czmq/src/zproxy.c +791 -0
  687. data/vendor/github.com/zeromq/czmq/src/zrex.c +310 -0
  688. data/vendor/github.com/zeromq/czmq/src/zsock.c +2207 -0
  689. data/vendor/github.com/zeromq/czmq/src/zsock_option.gsl +404 -0
  690. data/vendor/github.com/zeromq/czmq/src/zsock_option.inc +3946 -0
  691. data/vendor/github.com/zeromq/czmq/src/zsp.c +118 -0
  692. data/vendor/github.com/zeromq/czmq/src/zstr.c +548 -0
  693. data/vendor/github.com/zeromq/czmq/src/zsys.c +2225 -0
  694. data/vendor/github.com/zeromq/czmq/src/ztimerset.c +227 -0
  695. data/vendor/github.com/zeromq/czmq/src/ztrie.c +809 -0
  696. data/vendor/github.com/zeromq/czmq/src/zuuid.c +344 -0
  697. metadata +780 -0
@@ -0,0 +1,329 @@
1
+ /* =========================================================================
2
+ zhash_primes.h - 5 largest primes less than 2^n for n = 4...63
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZHASH_PRIMES_H_INCLUDED__
15
+ #define __ZHASH_PRIMES_H_INCLUDED__
16
+
17
+ #ifdef _MSC_VER
18
+ # define PORTABLE_LLU(number) number##ULL
19
+ #else
20
+ # define PORTABLE_LLU(number) number##LLU
21
+ #endif
22
+
23
+ static size_t primes [] = {
24
+ PORTABLE_LLU(3),
25
+ PORTABLE_LLU(5),
26
+ PORTABLE_LLU(7),
27
+ PORTABLE_LLU(11),
28
+ PORTABLE_LLU(13), // 2^4
29
+ PORTABLE_LLU(17),
30
+ PORTABLE_LLU(19),
31
+ PORTABLE_LLU(23),
32
+ PORTABLE_LLU(29),
33
+ PORTABLE_LLU(31), // 2^5
34
+ PORTABLE_LLU(43),
35
+ PORTABLE_LLU(47),
36
+ PORTABLE_LLU(53),
37
+ PORTABLE_LLU(59),
38
+ PORTABLE_LLU(61), // 2^6
39
+ PORTABLE_LLU(103),
40
+ PORTABLE_LLU(107),
41
+ PORTABLE_LLU(109),
42
+ PORTABLE_LLU(113),
43
+ PORTABLE_LLU(127), // 2^7
44
+ PORTABLE_LLU(229),
45
+ PORTABLE_LLU(233),
46
+ PORTABLE_LLU(239),
47
+ PORTABLE_LLU(241),
48
+ PORTABLE_LLU(251), // 2^8
49
+ PORTABLE_LLU(487),
50
+ PORTABLE_LLU(491),
51
+ PORTABLE_LLU(499),
52
+ PORTABLE_LLU(503),
53
+ PORTABLE_LLU(509), // 2^9
54
+ PORTABLE_LLU(997),
55
+ PORTABLE_LLU(1009),
56
+ PORTABLE_LLU(1013),
57
+ PORTABLE_LLU(1019),
58
+ PORTABLE_LLU(1021), // 2^10
59
+ PORTABLE_LLU(2011),
60
+ PORTABLE_LLU(2017),
61
+ PORTABLE_LLU(2027),
62
+ PORTABLE_LLU(2029),
63
+ PORTABLE_LLU(2039), // 2^11
64
+ PORTABLE_LLU(4057),
65
+ PORTABLE_LLU(4073),
66
+ PORTABLE_LLU(4079),
67
+ PORTABLE_LLU(4091),
68
+ PORTABLE_LLU(4093), // 2^12
69
+ PORTABLE_LLU(8161),
70
+ PORTABLE_LLU(8167),
71
+ PORTABLE_LLU(8171),
72
+ PORTABLE_LLU(8179),
73
+ PORTABLE_LLU(8191), // 2^13
74
+ PORTABLE_LLU(16349),
75
+ PORTABLE_LLU(16361),
76
+ PORTABLE_LLU(16363),
77
+ PORTABLE_LLU(16369),
78
+ PORTABLE_LLU(16381), // 2^14
79
+ PORTABLE_LLU(32707),
80
+ PORTABLE_LLU(32713),
81
+ PORTABLE_LLU(32717),
82
+ PORTABLE_LLU(32719),
83
+ PORTABLE_LLU(32749), // 2^15
84
+ PORTABLE_LLU(65449),
85
+ PORTABLE_LLU(65479),
86
+ PORTABLE_LLU(65497),
87
+ PORTABLE_LLU(65519),
88
+ PORTABLE_LLU(65521), // 2^16
89
+ PORTABLE_LLU(131023),
90
+ PORTABLE_LLU(131041),
91
+ PORTABLE_LLU(131059),
92
+ PORTABLE_LLU(131063),
93
+ PORTABLE_LLU(131071), // 2^17
94
+ PORTABLE_LLU(262111),
95
+ PORTABLE_LLU(262121),
96
+ PORTABLE_LLU(262127),
97
+ PORTABLE_LLU(262133),
98
+ PORTABLE_LLU(262139), // 2^18
99
+ PORTABLE_LLU(524243),
100
+ PORTABLE_LLU(524257),
101
+ PORTABLE_LLU(524261),
102
+ PORTABLE_LLU(524269),
103
+ PORTABLE_LLU(524287), // 2^19
104
+ PORTABLE_LLU(1048517),
105
+ PORTABLE_LLU(1048549),
106
+ PORTABLE_LLU(1048559),
107
+ PORTABLE_LLU(1048571),
108
+ PORTABLE_LLU(1048573), // 2^20
109
+ PORTABLE_LLU(2097091),
110
+ PORTABLE_LLU(2097097),
111
+ PORTABLE_LLU(2097131),
112
+ PORTABLE_LLU(2097133),
113
+ PORTABLE_LLU(2097143), // 2^21
114
+ PORTABLE_LLU(4194247),
115
+ PORTABLE_LLU(4194271),
116
+ PORTABLE_LLU(4194277),
117
+ PORTABLE_LLU(4194287),
118
+ PORTABLE_LLU(4194301), // 2^22
119
+ PORTABLE_LLU(8388547),
120
+ PORTABLE_LLU(8388571),
121
+ PORTABLE_LLU(8388581),
122
+ PORTABLE_LLU(8388587),
123
+ PORTABLE_LLU(8388593), // 2^23
124
+ PORTABLE_LLU(16777141),
125
+ PORTABLE_LLU(16777153),
126
+ PORTABLE_LLU(16777183),
127
+ PORTABLE_LLU(16777199),
128
+ PORTABLE_LLU(16777213), // 2^24
129
+ PORTABLE_LLU(33554341),
130
+ PORTABLE_LLU(33554347),
131
+ PORTABLE_LLU(33554371),
132
+ PORTABLE_LLU(33554383),
133
+ PORTABLE_LLU(33554393), // 2^25
134
+ PORTABLE_LLU(67108763),
135
+ PORTABLE_LLU(67108777),
136
+ PORTABLE_LLU(67108819),
137
+ PORTABLE_LLU(67108837),
138
+ PORTABLE_LLU(67108859), // 2^26
139
+ PORTABLE_LLU(134217593),
140
+ PORTABLE_LLU(134217613),
141
+ PORTABLE_LLU(134217617),
142
+ PORTABLE_LLU(134217649),
143
+ PORTABLE_LLU(134217689), // 2^27
144
+ PORTABLE_LLU(268435331),
145
+ PORTABLE_LLU(268435337),
146
+ PORTABLE_LLU(268435361),
147
+ PORTABLE_LLU(268435367),
148
+ PORTABLE_LLU(268435399), // 2^28
149
+ PORTABLE_LLU(536870839),
150
+ PORTABLE_LLU(536870849),
151
+ PORTABLE_LLU(536870869),
152
+ PORTABLE_LLU(536870879),
153
+ PORTABLE_LLU(536870909), // 2^29
154
+ PORTABLE_LLU(1073741719),
155
+ PORTABLE_LLU(1073741723),
156
+ PORTABLE_LLU(1073741741),
157
+ PORTABLE_LLU(1073741783),
158
+ PORTABLE_LLU(1073741789), // 2^30
159
+ PORTABLE_LLU(2147483563),
160
+ PORTABLE_LLU(2147483579),
161
+ PORTABLE_LLU(2147483587),
162
+ PORTABLE_LLU(2147483629),
163
+ PORTABLE_LLU(2147483647), // 2^31
164
+ PORTABLE_LLU(4294967197),
165
+ PORTABLE_LLU(4294967231),
166
+ PORTABLE_LLU(4294967279),
167
+ PORTABLE_LLU(4294967291),
168
+ PORTABLE_LLU(4294967295), // 2^32
169
+ #if __WORDSIZE == 64
170
+ PORTABLE_LLU(8589934581),
171
+ PORTABLE_LLU(8589934585),
172
+ PORTABLE_LLU(8589934587),
173
+ PORTABLE_LLU(8589934589),
174
+ PORTABLE_LLU(8589934591), // 2^33
175
+ PORTABLE_LLU(17179869175),
176
+ PORTABLE_LLU(17179869177),
177
+ PORTABLE_LLU(17179869179),
178
+ PORTABLE_LLU(17179869181),
179
+ PORTABLE_LLU(17179869183), // 2^34
180
+ PORTABLE_LLU(34359738359),
181
+ PORTABLE_LLU(34359738361),
182
+ PORTABLE_LLU(34359738363),
183
+ PORTABLE_LLU(34359738365),
184
+ PORTABLE_LLU(34359738367), // 2^35
185
+ PORTABLE_LLU(68719476725),
186
+ PORTABLE_LLU(68719476727),
187
+ PORTABLE_LLU(68719476729),
188
+ PORTABLE_LLU(68719476733),
189
+ PORTABLE_LLU(68719476735), // 2^36
190
+ PORTABLE_LLU(137438953463),
191
+ PORTABLE_LLU(137438953465),
192
+ PORTABLE_LLU(137438953467),
193
+ PORTABLE_LLU(137438953469),
194
+ PORTABLE_LLU(137438953471), // 2^37
195
+ PORTABLE_LLU(274877906935),
196
+ PORTABLE_LLU(274877906937),
197
+ PORTABLE_LLU(274877906939),
198
+ PORTABLE_LLU(274877906941),
199
+ PORTABLE_LLU(274877906943), // 2^38
200
+ PORTABLE_LLU(549755813877),
201
+ PORTABLE_LLU(549755813879),
202
+ PORTABLE_LLU(549755813883),
203
+ PORTABLE_LLU(549755813885),
204
+ PORTABLE_LLU(549755813887), // 2^39
205
+ PORTABLE_LLU(1099511627767),
206
+ PORTABLE_LLU(1099511627769),
207
+ PORTABLE_LLU(1099511627771),
208
+ PORTABLE_LLU(1099511627773),
209
+ PORTABLE_LLU(1099511627775), // 2^40
210
+ PORTABLE_LLU(2199023255543),
211
+ PORTABLE_LLU(2199023255545),
212
+ PORTABLE_LLU(2199023255547),
213
+ PORTABLE_LLU(2199023255549),
214
+ PORTABLE_LLU(2199023255551), // 2^41
215
+ PORTABLE_LLU(4398046511095),
216
+ PORTABLE_LLU(4398046511097),
217
+ PORTABLE_LLU(4398046511099),
218
+ PORTABLE_LLU(4398046511101),
219
+ PORTABLE_LLU(4398046511103), // 2^42
220
+ PORTABLE_LLU(8796093022199),
221
+ PORTABLE_LLU(8796093022201),
222
+ PORTABLE_LLU(8796093022203),
223
+ PORTABLE_LLU(8796093022205),
224
+ PORTABLE_LLU(8796093022207), // 2^43
225
+ PORTABLE_LLU(17592186044407),
226
+ PORTABLE_LLU(17592186044409),
227
+ PORTABLE_LLU(17592186044411),
228
+ PORTABLE_LLU(17592186044413),
229
+ PORTABLE_LLU(17592186044415), // 2^44
230
+ PORTABLE_LLU(35184372088823),
231
+ PORTABLE_LLU(35184372088825),
232
+ PORTABLE_LLU(35184372088827),
233
+ PORTABLE_LLU(35184372088829),
234
+ PORTABLE_LLU(35184372088831), // 2^45
235
+ PORTABLE_LLU(70368744177655),
236
+ PORTABLE_LLU(70368744177657),
237
+ PORTABLE_LLU(70368744177659),
238
+ PORTABLE_LLU(70368744177661),
239
+ PORTABLE_LLU(70368744177663), // 2^46
240
+ PORTABLE_LLU(140737488355319),
241
+ PORTABLE_LLU(140737488355321),
242
+ PORTABLE_LLU(140737488355323),
243
+ PORTABLE_LLU(140737488355325),
244
+ PORTABLE_LLU(140737488355327), // 2^47
245
+ PORTABLE_LLU(281474976710647),
246
+ PORTABLE_LLU(281474976710649),
247
+ PORTABLE_LLU(281474976710651),
248
+ PORTABLE_LLU(281474976710653),
249
+ PORTABLE_LLU(281474976710655), // 2^48
250
+ PORTABLE_LLU(562949953421303),
251
+ PORTABLE_LLU(562949953421305),
252
+ PORTABLE_LLU(562949953421307),
253
+ PORTABLE_LLU(562949953421309),
254
+ PORTABLE_LLU(562949953421311), // 2^49
255
+ PORTABLE_LLU(1125899906842615),
256
+ PORTABLE_LLU(1125899906842617),
257
+ PORTABLE_LLU(1125899906842619),
258
+ PORTABLE_LLU(1125899906842621),
259
+ PORTABLE_LLU(1125899906842623), // 2^50
260
+ PORTABLE_LLU(2251799813685239),
261
+ PORTABLE_LLU(2251799813685241),
262
+ PORTABLE_LLU(2251799813685243),
263
+ PORTABLE_LLU(2251799813685245),
264
+ PORTABLE_LLU(2251799813685247), // 2^51
265
+ PORTABLE_LLU(4503599627370487),
266
+ PORTABLE_LLU(4503599627370489),
267
+ PORTABLE_LLU(4503599627370491),
268
+ PORTABLE_LLU(4503599627370493),
269
+ PORTABLE_LLU(4503599627370495), // 2^52
270
+ PORTABLE_LLU(9007199254740983),
271
+ PORTABLE_LLU(9007199254740985),
272
+ PORTABLE_LLU(9007199254740987),
273
+ PORTABLE_LLU(9007199254740989),
274
+ PORTABLE_LLU(9007199254740991), // 2^53
275
+ PORTABLE_LLU(18014398509481975),
276
+ PORTABLE_LLU(18014398509481977),
277
+ PORTABLE_LLU(18014398509481979),
278
+ PORTABLE_LLU(18014398509481981),
279
+ PORTABLE_LLU(18014398509481983), // 2^54
280
+ PORTABLE_LLU(36028797018963959),
281
+ PORTABLE_LLU(36028797018963961),
282
+ PORTABLE_LLU(36028797018963963),
283
+ PORTABLE_LLU(36028797018963965),
284
+ PORTABLE_LLU(36028797018963967), // 2^55
285
+ PORTABLE_LLU(72057594037927925),
286
+ PORTABLE_LLU(72057594037927927),
287
+ PORTABLE_LLU(72057594037927929),
288
+ PORTABLE_LLU(72057594037927933),
289
+ PORTABLE_LLU(72057594037927935), // 2^56
290
+ PORTABLE_LLU(144115188075855863),
291
+ PORTABLE_LLU(144115188075855865),
292
+ PORTABLE_LLU(144115188075855867),
293
+ PORTABLE_LLU(144115188075855869),
294
+ PORTABLE_LLU(144115188075855871), // 2^57
295
+ PORTABLE_LLU(288230376151711735),
296
+ PORTABLE_LLU(288230376151711737),
297
+ PORTABLE_LLU(288230376151711739),
298
+ PORTABLE_LLU(288230376151711741),
299
+ PORTABLE_LLU(288230376151711743), // 2^58
300
+ PORTABLE_LLU(576460752303423479),
301
+ PORTABLE_LLU(576460752303423481),
302
+ PORTABLE_LLU(576460752303423483),
303
+ PORTABLE_LLU(576460752303423485),
304
+ PORTABLE_LLU(576460752303423487), // 2^59
305
+ PORTABLE_LLU(1152921504606846967),
306
+ PORTABLE_LLU(1152921504606846969),
307
+ PORTABLE_LLU(1152921504606846971),
308
+ PORTABLE_LLU(1152921504606846973),
309
+ PORTABLE_LLU(1152921504606846975), // 2^60
310
+ PORTABLE_LLU(2305843009213693941),
311
+ PORTABLE_LLU(2305843009213693943),
312
+ PORTABLE_LLU(2305843009213693945),
313
+ PORTABLE_LLU(2305843009213693947),
314
+ PORTABLE_LLU(2305843009213693949), // 2^61
315
+ PORTABLE_LLU(4611686018427387895),
316
+ PORTABLE_LLU(4611686018427387897),
317
+ PORTABLE_LLU(4611686018427387899),
318
+ PORTABLE_LLU(4611686018427387901),
319
+ PORTABLE_LLU(4611686018427387903), // 2^62
320
+ PORTABLE_LLU(9223372036854775799),
321
+ PORTABLE_LLU(9223372036854775801),
322
+ PORTABLE_LLU(9223372036854775803),
323
+ PORTABLE_LLU(9223372036854775805),
324
+ PORTABLE_LLU(9223372036854775807) // 2^63
325
+ #endif
326
+ };
327
+
328
+ #endif
329
+
@@ -0,0 +1,1369 @@
1
+ /* =========================================================================
2
+ zhashx - extended generic hash container
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ /*
15
+ @header
16
+ zhashx is an extended hash table container with more functionality than
17
+ zhash, its simpler cousin.
18
+ @discuss
19
+ The hash table always has a size that is prime and roughly doubles its
20
+ size when 75% full. In case of hash collisions items are chained in a
21
+ linked list. The hash table size is increased slightly (up to 5 times
22
+ before roughly doubling the size) when an overly long chain (between 1
23
+ and 63 items depending on table size) is detected.
24
+ @end
25
+ */
26
+
27
+ #include "czmq_classes.h"
28
+
29
+ // Hash table performance parameters
30
+
31
+ #define INITIAL_PRIME 0 // Initial size in items (index into primes)
32
+ #define GROWTH_FACTOR 5 // Increase after splitting (index into primes)
33
+ #define LOAD_FACTOR 75 // Percent loading before splitting
34
+ #define INITIAL_CHAIN 1 // Initial chaining limit
35
+ #define CHAIN_GROWS 1 // Increase after splitting (chaining limit)
36
+
37
+ #include "zhash_primes.inc"
38
+
39
+
40
+ // Hash item, used internally only
41
+
42
+ typedef struct _item_t {
43
+ void *value; // Opaque item value
44
+ struct _item_t *next; // Next item in the hash slot
45
+ size_t index; // Index of item in table
46
+ const void *key; // Item's original key
47
+ zhashx_free_fn *free_fn; // Value free function if any
48
+ } item_t;
49
+
50
+
51
+ // ---------------------------------------------------------------------
52
+ // Structure of our class
53
+
54
+ struct _zhashx_t {
55
+ size_t size; // Current size of hash table
56
+ uint prime_index; // Current prime number used as limit
57
+ uint chain_limit; // Current limit on chain length
58
+ item_t **items; // Array of items
59
+ size_t cached_index; // Avoids duplicate hash calculations
60
+ size_t cursor_index; // For first/next iteration
61
+ item_t *cursor_item; // For first/next iteration
62
+ const void *cursor_key; // After first/next call, points to key
63
+ zlistx_t *comments; // File comments, if any
64
+ time_t modified; // Set during zhashx_load
65
+ char *filename; // Set during zhashx_load
66
+ // Function callbacks for duplicating and destroying items, if any
67
+ zhashx_duplicator_fn *duplicator;
68
+ zhashx_destructor_fn *destructor;
69
+ // Function callbacks for duplicating and destroying keys, if any
70
+ zhashx_duplicator_fn *key_duplicator;
71
+ zhashx_destructor_fn *key_destructor;
72
+ zhashx_comparator_fn *key_comparator;
73
+ // Custom hash function
74
+ zhashx_hash_fn *hasher;
75
+ };
76
+
77
+ // Local helper functions
78
+ static item_t *s_item_lookup (zhashx_t *self, const void *key);
79
+ static item_t *s_item_insert (zhashx_t *self, const void *key, void *value);
80
+ static void s_item_destroy (zhashx_t *self, item_t *item, bool hard);
81
+
82
+
83
+ // --------------------------------------------------------------------------
84
+ // Modified Bernstein hashing function
85
+
86
+ static size_t
87
+ s_bernstein_hash (const void *key)
88
+ {
89
+ const char *pointer = (const char *) key;
90
+ size_t key_hash = 0;
91
+ while (*pointer)
92
+ key_hash = 33 * key_hash ^ *pointer++;
93
+ return key_hash;
94
+ }
95
+
96
+
97
+ // --------------------------------------------------------------------------
98
+ // Hash table constructor
99
+
100
+ zhashx_t *
101
+ zhashx_new (void)
102
+ {
103
+ zhashx_t *self = (zhashx_t *) zmalloc (sizeof (zhashx_t));
104
+ assert (self);
105
+ self->prime_index = INITIAL_PRIME;
106
+ self->chain_limit = INITIAL_CHAIN;
107
+ size_t limit = primes [self->prime_index];
108
+ self->items = (item_t **) zmalloc (sizeof (item_t *) * limit);
109
+ assert (self->items);
110
+ self->hasher = s_bernstein_hash;
111
+ self->key_destructor = (zhashx_destructor_fn *) zstr_free;
112
+ self->key_duplicator = (zhashx_duplicator_fn *) strdup;
113
+ self->key_comparator = (zhashx_comparator_fn *) strcmp;
114
+
115
+ return self;
116
+ }
117
+
118
+
119
+ // --------------------------------------------------------------------------
120
+ // Purge all items from a hash table
121
+
122
+ static void
123
+ s_purge (zhashx_t *self)
124
+ {
125
+ uint index;
126
+ size_t limit = primes [self->prime_index];
127
+
128
+ for (index = 0; index < limit; index++) {
129
+ // Destroy all items in this hash bucket
130
+ item_t *cur_item = self->items [index];
131
+ while (cur_item) {
132
+ item_t *next_item = cur_item->next;
133
+ s_item_destroy (self, cur_item, true);
134
+ cur_item = next_item;
135
+ }
136
+ self->items [index] = NULL;
137
+ }
138
+ }
139
+
140
+ // --------------------------------------------------------------------------
141
+ // Hash table destructor
142
+
143
+ void
144
+ zhashx_destroy (zhashx_t **self_p)
145
+ {
146
+ assert (self_p);
147
+ if (*self_p) {
148
+ zhashx_t *self = *self_p;
149
+ if (self->items) {
150
+ s_purge (self);
151
+ freen (self->items);
152
+ }
153
+ zlistx_destroy (&self->comments);
154
+ freen (self->filename);
155
+ freen (self);
156
+ *self_p = NULL;
157
+ }
158
+ }
159
+
160
+
161
+ // --------------------------------------------------------------------------
162
+ // Local helper function
163
+ // Destroy item in hash table, item must exist in table
164
+
165
+ static void
166
+ s_item_destroy (zhashx_t *self, item_t *item, bool hard)
167
+ {
168
+ // Find previous item since it's a singly-linked list
169
+ item_t *cur_item = self->items [item->index];
170
+ item_t **prev_item = &(self->items [item->index]);
171
+ while (cur_item) {
172
+ if (cur_item == item)
173
+ break;
174
+ prev_item = &(cur_item->next);
175
+ cur_item = cur_item->next;
176
+ }
177
+ assert (cur_item);
178
+ *prev_item = item->next;
179
+ self->size--;
180
+ if (hard) {
181
+ if (self->destructor)
182
+ (self->destructor)(&item->value);
183
+ else
184
+ if (item->free_fn)
185
+ (item->free_fn)(item->value);
186
+
187
+ self->cursor_item = NULL;
188
+ self->cursor_key = NULL;
189
+
190
+ if (self->key_destructor)
191
+ (self->key_destructor)((void **) &item->key);
192
+ freen (item);
193
+ }
194
+ }
195
+
196
+
197
+ // --------------------------------------------------------------------------
198
+ // Rehash hash table with specified new prime index
199
+ // Returns 0 on success, or fails the assertions (e.g. insufficient memory)
200
+ // Note: Older code used to return -1 in case of errors - this is no longer so
201
+
202
+ static int
203
+ s_zhashx_rehash (zhashx_t *self, uint new_prime_index)
204
+ {
205
+ assert (self);
206
+ assert (new_prime_index < sizeof (primes));
207
+
208
+ size_t limit = primes [self->prime_index];
209
+ size_t new_limit = primes [new_prime_index];
210
+ item_t **new_items = (item_t **) zmalloc (sizeof (item_t *) * new_limit);
211
+ assert (new_items);
212
+
213
+ // Move all items to the new hash table, rehashing to
214
+ // take into account new hash table limit
215
+ size_t index;
216
+ for (index = 0; index < limit; index++) {
217
+ item_t *cur_item = self->items [index];
218
+ while (cur_item) {
219
+ item_t *next_item = cur_item->next;
220
+ size_t new_index = self->hasher (cur_item->key);
221
+ new_index %= new_limit;
222
+ cur_item->index = new_index;
223
+ cur_item->next = new_items [new_index];
224
+ new_items [new_index] = cur_item;
225
+ cur_item = next_item;
226
+ }
227
+ }
228
+ // Destroy old hash table
229
+ freen (self->items);
230
+ self->items = new_items;
231
+ self->prime_index = new_prime_index;
232
+ return 0;
233
+ }
234
+
235
+
236
+ // --------------------------------------------------------------------------
237
+ // Insert item into hash table with specified key and item. Returns 0 on
238
+ // success. If the key is already present, returns -1 and leaves existing
239
+ // item unchanged. Sets the hash cursor to the item, if found. Dies with
240
+ // assertion if the process heap memory ran out. (Note: older code returned
241
+ // -1 in such cases; this is no longer so).
242
+
243
+ int
244
+ zhashx_insert (zhashx_t *self, const void *key, void *value)
245
+ {
246
+ assert (self);
247
+ assert (key);
248
+
249
+ // If we're exceeding the load factor of the hash table,
250
+ // resize it according to the growth factor
251
+ size_t limit = primes [self->prime_index];
252
+ if (self->size >= limit * LOAD_FACTOR / 100) {
253
+ // Create new hash table
254
+ uint new_prime_index = self->prime_index + GROWTH_FACTOR;
255
+ assert (s_zhashx_rehash (self, new_prime_index) == 0);
256
+ self->chain_limit += CHAIN_GROWS;
257
+ }
258
+ return s_item_insert (self, key, value)? 0: -1;
259
+ }
260
+
261
+
262
+ // --------------------------------------------------------------------------
263
+ // Local helper function
264
+ // Insert new item into hash table, returns item
265
+ // If item already existed, returns NULL
266
+ // Sets the hash cursor to the item, if found.
267
+
268
+ static item_t *
269
+ s_item_insert (zhashx_t *self, const void *key, void *value)
270
+ {
271
+ // Check that item does not already exist in hash table
272
+ // Leaves self->cached_index with calculated hash item
273
+ item_t *item = s_item_lookup (self, key);
274
+ if (item == NULL) {
275
+ item = (item_t *) zmalloc (sizeof (item_t));
276
+ assert (item);
277
+
278
+ // If necessary, take duplicate of item key
279
+ if (self->key_duplicator)
280
+ item->key = (self->key_duplicator)((void *) key);
281
+ else
282
+ item->key = key;
283
+
284
+ // If necessary, take duplicate of item value
285
+ if (self->duplicator)
286
+ item->value = (self->duplicator)(value);
287
+ else
288
+ item->value = value;
289
+
290
+ item->index = self->cached_index;
291
+
292
+ // Insert into start of bucket list
293
+ item->next = self->items [self->cached_index];
294
+ self->items [self->cached_index] = item;
295
+ self->size++;
296
+ self->cursor_item = item;
297
+ self->cursor_key = item->key;
298
+ }
299
+ else
300
+ item = NULL; // Signal duplicate insertion
301
+
302
+ return item;
303
+ }
304
+
305
+
306
+ // --------------------------------------------------------------------------
307
+ // Local helper function
308
+ // Lookup item in hash table, returns item or NULL
309
+ // Dies with assertion if the process heap memory ran out (Note: older code
310
+ // returned NULL in such cases; this is no longer so).
311
+
312
+ static item_t *
313
+ s_item_lookup (zhashx_t *self, const void *key)
314
+ {
315
+ // Look in bucket list for item by key
316
+ size_t limit = primes [self->prime_index];
317
+ self->cached_index = self->hasher (key) % limit;
318
+ item_t *item = self->items [self->cached_index];
319
+ uint len = 0;
320
+ while (item) {
321
+ if ((self->key_comparator)(item->key, key) == 0)
322
+ break;
323
+ item = item->next;
324
+ ++len;
325
+ }
326
+ if (len > self->chain_limit) {
327
+ // Create new hash table
328
+ uint new_prime_index = self->prime_index + GROWTH_FACTOR;
329
+ assert (s_zhashx_rehash (self, new_prime_index) == 0);
330
+ limit = primes [self->prime_index];
331
+ self->cached_index = self->hasher (key) % limit;
332
+ }
333
+ return item;
334
+ }
335
+
336
+
337
+ // --------------------------------------------------------------------------
338
+ // Update or insert item into hash table with specified key and item. If the
339
+ // key is already present, destroys old item and inserts new one. If you set
340
+ // a container item destructor, this is called on the old value. If the key
341
+ // was not already present, inserts a new item. Sets the hash cursor to the
342
+ // new item.
343
+
344
+ void
345
+ zhashx_update (zhashx_t *self, const void *key, void *value)
346
+ {
347
+ assert (self);
348
+ assert (key);
349
+
350
+ item_t *item = s_item_lookup (self, key);
351
+ if (item) {
352
+ if (self->destructor)
353
+ (self->destructor)(&item->value);
354
+ else
355
+ if (item->free_fn)
356
+ (item->free_fn)(item->value);
357
+
358
+ // If necessary, take duplicate of item value
359
+ if (self->duplicator)
360
+ item->value = (self->duplicator)(value);
361
+ else
362
+ item->value = value;
363
+ }
364
+ else
365
+ zhashx_insert (self, key, value);
366
+ }
367
+
368
+
369
+ // --------------------------------------------------------------------------
370
+ // Remove an item specified by key from the hash table. If there was no such
371
+ // item, this function does nothing.
372
+
373
+ void
374
+ zhashx_delete (zhashx_t *self, const void *key)
375
+ {
376
+ assert (self);
377
+ assert (key);
378
+
379
+ item_t *item = s_item_lookup (self, key);
380
+ if (item)
381
+ s_item_destroy (self, item, true);
382
+ }
383
+
384
+
385
+ // --------------------------------------------------------------------------
386
+ // Delete all items from the hash table. If the key destructor is
387
+ // set, calls it on every key. If the item destructor is set, calls
388
+ // it on every item.
389
+ void
390
+ zhashx_purge (zhashx_t *self)
391
+ {
392
+ assert (self);
393
+ s_purge (self);
394
+
395
+ if (self->prime_index > INITIAL_PRIME) {
396
+ // Try to shrink hash table
397
+ size_t limit = primes [INITIAL_PRIME];
398
+ item_t **items = (item_t **) zmalloc (sizeof (item_t *) * limit);
399
+ assert (items);
400
+ freen (self->items);
401
+ self->prime_index = INITIAL_PRIME;
402
+ self->chain_limit = INITIAL_CHAIN;
403
+ self->items = items;
404
+ }
405
+ }
406
+
407
+
408
+ // --------------------------------------------------------------------------
409
+ // Look for item in hash table and return its item, or NULL. Sets the hash
410
+ // cursor to the item, if found.
411
+
412
+ void *
413
+ zhashx_lookup (zhashx_t *self, const void *key)
414
+ {
415
+ assert (self);
416
+ assert (key);
417
+
418
+ item_t *item = s_item_lookup (self, key);
419
+ if (item) {
420
+ self->cursor_item = item;
421
+ self->cursor_key = item->key;
422
+ return item->value;
423
+ }
424
+ else
425
+ return NULL;
426
+ }
427
+
428
+
429
+ // --------------------------------------------------------------------------
430
+ // Reindexes an item from an old key to a new key. If there was no such
431
+ // item, does nothing. If the new key already exists, deletes old item.
432
+ // Sets the item cursor to the renamed item.
433
+
434
+ int
435
+ zhashx_rename (zhashx_t *self, const void *old_key, const void *new_key)
436
+ {
437
+ item_t *old_item = s_item_lookup (self, old_key);
438
+ item_t *new_item = s_item_lookup (self, new_key);
439
+ if (old_item && !new_item) {
440
+ s_item_destroy (self, old_item, false);
441
+ if (self->key_destructor)
442
+ (self->key_destructor)((void **) &old_item->key);
443
+
444
+ if (self->key_duplicator)
445
+ old_item->key = (self->key_duplicator)(new_key);
446
+ else
447
+ old_item->key = new_key;
448
+
449
+ old_item->index = self->cached_index;
450
+ old_item->next = self->items [self->cached_index];
451
+ self->items [self->cached_index] = old_item;
452
+ self->size++;
453
+ self->cursor_item = old_item;
454
+ self->cursor_key = old_item->key;
455
+ return 0;
456
+ }
457
+ else
458
+ return -1;
459
+ }
460
+
461
+
462
+ // --------------------------------------------------------------------------
463
+ // Set a free function for the specified hash table item. When the item is
464
+ // destroyed, the free function, if any, is called on that item.
465
+ // Use this when hash items are dynamically allocated, to ensure that
466
+ // you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
467
+ // Returns the item, or NULL if there is no such item.
468
+
469
+ void *
470
+ zhashx_freefn (zhashx_t *self, const void *key, zhashx_free_fn free_fn)
471
+ {
472
+ assert (self);
473
+ assert (key);
474
+
475
+ item_t *item = s_item_lookup (self, key);
476
+ if (item) {
477
+ item->free_fn = free_fn;
478
+ return item->value;
479
+ }
480
+ else
481
+ return NULL;
482
+ }
483
+
484
+
485
+ // --------------------------------------------------------------------------
486
+ // Return size of hash table
487
+
488
+ size_t
489
+ zhashx_size (zhashx_t *self)
490
+ {
491
+ assert (self);
492
+ return self->size;
493
+ }
494
+
495
+
496
+ // --------------------------------------------------------------------------
497
+ // Return a zlistx_t containing the keys for the items in the
498
+ // table. Uses the key_duplicator to duplicate all keys and sets the
499
+ // key_destructor as destructor for the list.
500
+
501
+ zlistx_t *
502
+ zhashx_keys (zhashx_t *self)
503
+ {
504
+ assert (self);
505
+ zlistx_t *keys = zlistx_new ();
506
+ if (!keys)
507
+ return NULL;
508
+ zlistx_set_destructor (keys, self->key_destructor);
509
+ zlistx_set_duplicator (keys, self->key_duplicator);
510
+
511
+ uint index;
512
+ size_t limit = primes [self->prime_index];
513
+ for (index = 0; index < limit; index++) {
514
+ item_t *item = self->items [index];
515
+ while (item) {
516
+ if (zlistx_add_end (keys, (void *) item->key) == NULL) {
517
+ zlistx_destroy (&keys);
518
+ return NULL;
519
+ }
520
+ item = item->next;
521
+ }
522
+ }
523
+ return keys;
524
+ }
525
+
526
+ // Return a zlistx_t containing the items in the table. If there exists
527
+ // a duplicator, then it is used to duplicate all items, and if there
528
+ // is a destructor then it set as the destructor for the list.
529
+
530
+ zlistx_t *
531
+ zhashx_values (zhashx_t *self)
532
+ {
533
+ assert (self);
534
+
535
+ zlistx_t *values = zlistx_new ();
536
+ if (!values)
537
+ return NULL;
538
+
539
+ zlistx_set_destructor (values, self->destructor);
540
+ zlistx_set_duplicator (values, self->duplicator);
541
+
542
+ uint index;
543
+ size_t limit = primes [self->prime_index];
544
+ for (index = 0; index < limit; index++) {
545
+ item_t *item = self->items [index];
546
+ while (item) {
547
+ if (zlistx_add_end (values, (void *) item->value) == NULL) {
548
+ zlistx_destroy (&values);
549
+ return NULL;
550
+ }
551
+ item = item->next;
552
+ }
553
+ }
554
+ return values;
555
+ }
556
+
557
+
558
+ // --------------------------------------------------------------------------
559
+ // Simple iterator; returns first item in hash table, in no given order,
560
+ // or NULL if the table is empty. This method is simpler to use than the
561
+ // foreach() method, which is deprecated. NOTE: do NOT modify the table
562
+ // while iterating.
563
+
564
+ void *
565
+ zhashx_first (zhashx_t *self)
566
+ {
567
+ assert (self);
568
+ // Point to before or at first item
569
+ self->cursor_index = 0;
570
+ self->cursor_item = self->items [self->cursor_index];
571
+ // Now scan forwards to find it, leave cursor after item
572
+ return zhashx_next (self);
573
+ }
574
+
575
+
576
+ // --------------------------------------------------------------------------
577
+ // Simple iterator; returns next item in hash table, in no given order,
578
+ // or NULL if the last item was already returned. Use this together with
579
+ // zhashx_first() to process all items in a hash table. If you need the
580
+ // items in sorted order, use zhashx_keys() and then zlistx_sort(). NOTE:
581
+ // do NOT modify the table while iterating.
582
+
583
+ void *
584
+ zhashx_next (zhashx_t *self)
585
+ {
586
+ assert (self);
587
+ // Scan forward from cursor until we find an item
588
+ size_t limit = primes [self->prime_index];
589
+ while (self->cursor_item == NULL) {
590
+ if (self->cursor_index < limit - 1)
591
+ self->cursor_index++;
592
+ else
593
+ return NULL; // At end of table
594
+
595
+ // Get first item in next bucket
596
+ self->cursor_item = self->items [self->cursor_index];
597
+ }
598
+ // We have an item, so return it, and bump past it
599
+ assert (self->cursor_item);
600
+ item_t *item = self->cursor_item;
601
+ self->cursor_key = item->key;
602
+ self->cursor_item = self->cursor_item->next;
603
+ return item->value;
604
+ }
605
+
606
+
607
+ // --------------------------------------------------------------------------
608
+ // After a successful insert, update, or first/next method, returns the key
609
+ // for the item that was returned. You may not modify or deallocate
610
+ // the key, and it lasts as long as the item in the hash.
611
+ // After an unsuccessful first/next, returns NULL.
612
+
613
+ const void *
614
+ zhashx_cursor (zhashx_t *self)
615
+ {
616
+ assert (self);
617
+ return self->cursor_key;
618
+ }
619
+
620
+
621
+ // --------------------------------------------------------------------------
622
+ // Add a comment to hash table before saving to disk. You can add as many
623
+ // comment lines as you like. These comment lines are discarded when loading
624
+ // the file. If you use a null format, all comments are deleted.
625
+ // FIXME: return 0 on success, -1 on error
626
+
627
+ void
628
+ zhashx_comment (zhashx_t *self, const char *format, ...)
629
+ {
630
+ if (format) {
631
+ if (!self->comments) {
632
+ self->comments = zlistx_new ();
633
+ if (!self->comments)
634
+ return;
635
+ zlistx_set_destructor (self->comments, (zhashx_destructor_fn *) zstr_free);
636
+ }
637
+ va_list argptr;
638
+ va_start (argptr, format);
639
+ char *string = zsys_vprintf (format, argptr);
640
+ va_end (argptr);
641
+ if (string)
642
+ zlistx_add_end (self->comments, string);
643
+ }
644
+ else
645
+ zlistx_destroy (&self->comments);
646
+ }
647
+
648
+
649
+ // --------------------------------------------------------------------------
650
+ // Save hash table to a text file in name=value format
651
+ // Hash values must be printable strings.
652
+ // Returns 0 if OK, else -1 if a file error occurred
653
+
654
+ int
655
+ zhashx_save (zhashx_t *self, const char *filename)
656
+ {
657
+ assert (self);
658
+
659
+ FILE *handle = fopen (filename, "w");
660
+ if (!handle)
661
+ return -1; // Failed to create file
662
+
663
+ if (self->comments) {
664
+ char *comment = (char *) zlistx_first (self->comments);
665
+ while (comment) {
666
+ fprintf (handle, "# %s\n", comment);
667
+ comment = (char *) zlistx_next (self->comments);
668
+ }
669
+ fprintf (handle, "\n");
670
+ }
671
+ uint index;
672
+ size_t limit = primes [self->prime_index];
673
+ for (index = 0; index < limit; index++) {
674
+ item_t *item = self->items [index];
675
+ while (item) {
676
+ fprintf (handle, "%s=%s\n", (char *) item->key, (char *) item->value);
677
+ item = item->next;
678
+ }
679
+ }
680
+ fclose (handle);
681
+ return 0;
682
+ }
683
+
684
+
685
+ // --------------------------------------------------------------------------
686
+ // Load hash table from a text file in name=value format; hash table must
687
+ // already exist. Hash values must printable strings.
688
+ // Returns 0 if OK, else -1 if a file was not readable.
689
+
690
+ int
691
+ zhashx_load (zhashx_t *self, const char *filename)
692
+ {
693
+ assert (self);
694
+ zhashx_set_destructor (self, (zhashx_destructor_fn *) zstr_free);
695
+ zhashx_set_duplicator (self, (zhashx_duplicator_fn *) strdup);
696
+
697
+ // Whether or not file exists, we'll track the filename and last
698
+ // modification date (0 for unknown files), so that zhashx_refresh ()
699
+ // will always work after zhashx_load (), to load a newly-created
700
+ // file.
701
+
702
+ // Take copy of filename in case self->filename is same string.
703
+ char *filename_copy = strdup (filename);
704
+ assert (filename_copy);
705
+ freen (self->filename);
706
+ self->filename = filename_copy;
707
+ self->modified = zsys_file_modified (self->filename);
708
+ FILE *handle = fopen (self->filename, "r");
709
+ if (handle) {
710
+ char *buffer = (char *) zmalloc (1024);
711
+ assert (buffer);
712
+ while (fgets (buffer, 1024, handle)) {
713
+ // Skip lines starting with "#" or that do not look like
714
+ // name=value data.
715
+ char *equals = strchr (buffer, '=');
716
+ if (buffer [0] == '#' || equals == buffer || !equals)
717
+ continue;
718
+
719
+ // Buffer may end in newline, which we don't want
720
+ if (buffer [strlen (buffer) - 1] == '\n')
721
+ buffer [strlen (buffer) - 1] = 0;
722
+ *equals++ = 0;
723
+ zhashx_update (self, buffer, equals);
724
+ }
725
+ freen (buffer);
726
+ fclose (handle);
727
+ }
728
+ else
729
+ return -1; // Failed to open file for reading
730
+
731
+ return 0;
732
+ }
733
+
734
+
735
+ // --------------------------------------------------------------------------
736
+ // When a hash table was loaded from a file by zhashx_load, this method will
737
+ // reload the file if it has been modified since, and is "stable", i.e. not
738
+ // still changing. Returns 0 if OK, -1 if there was an error reloading the
739
+ // file.
740
+
741
+ int
742
+ zhashx_refresh (zhashx_t *self)
743
+ {
744
+ assert (self);
745
+
746
+ if (self->filename) {
747
+ if (zsys_file_modified (self->filename) > self->modified
748
+ && zsys_file_stable (self->filename)) {
749
+ // Empty the hash table; code is copied from zhashx_destroy
750
+ uint index;
751
+ size_t limit = primes [self->prime_index];
752
+ for (index = 0; index < limit; index++) {
753
+ // Destroy all items in this hash bucket
754
+ item_t *cur_item = self->items [index];
755
+ while (cur_item) {
756
+ item_t *next_item = cur_item->next;
757
+ s_item_destroy (self, cur_item, true);
758
+ cur_item = next_item;
759
+ }
760
+ }
761
+ zhashx_load (self, self->filename);
762
+ }
763
+ }
764
+ return 0;
765
+ }
766
+
767
+
768
+ // --------------------------------------------------------------------------
769
+ // Same as pack but uses a user-defined serializer function to convert items
770
+ // into longstr.
771
+ // Caller owns return value and must destroy it when done.
772
+
773
+ zframe_t *
774
+ zhashx_pack_own (zhashx_t *self, zhashx_serializer_fn serializer)
775
+ {
776
+ assert (self);
777
+
778
+ // First, calculate packed data size
779
+ size_t frame_size = 4; // Dictionary size, number-4
780
+ uint index;
781
+ uint vindex = 0;
782
+ size_t limit = primes [self->prime_index];
783
+ char **values = (char **) zmalloc (self->size * sizeof (char*));
784
+ for (index = 0; index < limit; index++) {
785
+ item_t *item = self->items [index];
786
+ while (item) {
787
+ // We store key as short string
788
+ frame_size += 1 + strlen ((char *) item->key);
789
+ // We store value as long string
790
+ if (serializer != NULL)
791
+ values [vindex] = serializer (item->value);
792
+ else
793
+ values [vindex] = (char *) item->value;
794
+
795
+ frame_size += 4 + strlen ((char *) values [vindex]);
796
+ item = item->next;
797
+ vindex++;
798
+ }
799
+ }
800
+ // Now serialize items into the frame
801
+ zframe_t *frame = zframe_new (NULL, frame_size);
802
+ if (!frame) {
803
+ freen (values);
804
+ return NULL;
805
+ }
806
+
807
+ byte *needle = zframe_data (frame);
808
+ // Store size as number-4
809
+ *(uint32_t *) needle = htonl ((u_long) self->size);
810
+ needle += 4;
811
+ vindex = 0;
812
+ for (index = 0; index < limit; index++) {
813
+ item_t *item = self->items [index];
814
+ while (item) {
815
+ // Store key as string
816
+ *needle++ = (byte) strlen ((char *) item->key);
817
+ memcpy (needle, item->key, strlen ((char *) item->key));
818
+ needle += strlen ((char *) item->key);
819
+
820
+ // Store value as longstr
821
+ size_t lenth = strlen (values [vindex]);
822
+ *(uint32_t *) needle = htonl ((u_long) lenth);
823
+ needle += 4;
824
+ memcpy (needle, (char *) values [vindex], strlen ((char *) values [vindex]));
825
+ needle += strlen ((char *) values [vindex]);
826
+ item = item->next;
827
+
828
+ // Destroy serialized value
829
+ if (serializer != NULL)
830
+ zstr_free (&values [vindex]);
831
+
832
+ vindex++;
833
+ }
834
+ }
835
+ freen (values);
836
+ return frame;
837
+ }
838
+
839
+
840
+ // --------------------------------------------------------------------------
841
+ // Serialize hash table to a binary frame that can be sent in a message.
842
+ // The packed format is compatible with the 'dictionary' type defined in
843
+ // http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
844
+ //
845
+ // ; A list of name/value pairs
846
+ // dictionary = dict-count *( dict-name dict-value )
847
+ // dict-count = number-4
848
+ // dict-value = longstr
849
+ // dict-name = string
850
+ //
851
+ // ; Strings are always length + text contents
852
+ // longstr = number-4 *VCHAR
853
+ // string = number-1 *VCHAR
854
+ //
855
+ // ; Numbers are unsigned integers in network byte order
856
+ // number-1 = 1OCTET
857
+ // number-4 = 4OCTET
858
+ //
859
+ // Comments are not included in the packed data. Item values MUST be
860
+ // strings.
861
+
862
+ zframe_t *
863
+ zhashx_pack (zhashx_t *self)
864
+ {
865
+ return zhashx_pack_own (self, NULL);
866
+ }
867
+
868
+
869
+ // --------------------------------------------------------------------------
870
+ // Same as unpack but uses a user-defined deserializer function to convert
871
+ // a longstr back into item format.
872
+
873
+ zhashx_t *
874
+ zhashx_unpack_own (zframe_t *frame, zhashx_deserializer_fn deserializer)
875
+ {
876
+ zhashx_t *self = zhashx_new ();
877
+ if (!self)
878
+ return NULL;
879
+
880
+ assert (frame);
881
+ if (zframe_size (frame) < 4)
882
+ return self; // Arguable...
883
+
884
+ byte *needle = zframe_data (frame);
885
+ byte *ceiling = needle + zframe_size (frame);
886
+ size_t nbr_items = ntohl (*(uint32_t *) needle);
887
+ needle += 4;
888
+ while (nbr_items && needle < ceiling) {
889
+ // Get key as string
890
+ size_t key_size = *needle++;
891
+ if (needle + key_size <= ceiling) {
892
+ char key [256];
893
+ memcpy (key, needle, key_size);
894
+ key [key_size] = 0;
895
+ needle += key_size;
896
+
897
+ // Get value as longstr
898
+ if (needle + 4 <= ceiling) {
899
+ size_t value_size = ntohl (*(uint32_t *) needle);
900
+ needle += 4;
901
+ // Be wary of malformed frames
902
+ if (needle + value_size <= ceiling) {
903
+ char *value = (char *) zmalloc (value_size + 1);
904
+ assert (value);
905
+ memcpy (value, needle, value_size);
906
+ value [value_size] = 0;
907
+ needle += value_size;
908
+
909
+ // Convert string to real value
910
+ void *real_value;
911
+ if (deserializer != NULL) {
912
+ real_value = deserializer (value);
913
+ zstr_free (&value);
914
+ }
915
+ else
916
+ real_value = value;
917
+
918
+ // Hash takes ownership of real_value
919
+ if (zhashx_insert (self, key, real_value)) {
920
+ zhashx_destroy (&self);
921
+ break;
922
+ }
923
+ }
924
+ }
925
+ }
926
+ }
927
+ // Hash will free values in destructor
928
+ if (self) {
929
+ zhashx_set_destructor (self, (zhashx_destructor_fn *) zstr_free);
930
+ zhashx_set_duplicator (self, (zhashx_duplicator_fn *) strdup);
931
+ }
932
+
933
+ return self;
934
+ }
935
+
936
+
937
+ // --------------------------------------------------------------------------
938
+ // Unpack binary frame into a new hash table. Packed data must follow format
939
+ // defined by zhashx_pack. Hash table is set to autofree. An empty frame
940
+ // unpacks to an empty hash table.
941
+
942
+ zhashx_t *
943
+ zhashx_unpack (zframe_t *frame)
944
+ {
945
+ return zhashx_unpack_own (frame, NULL);
946
+ }
947
+
948
+
949
+ // --------------------------------------------------------------------------
950
+ // Make a copy of the list; items are duplicated if you set a duplicator
951
+ // for the list, otherwise not. Copying a null reference returns a null
952
+ // reference. Note that this method's behavior changed slightly for CZMQ
953
+ // v3.x, as it does not set nor respect autofree. It does however let you
954
+ // duplicate any hash table safely. The old behavior is in zhashx_dup_v2.
955
+
956
+ zhashx_t *
957
+ zhashx_dup (zhashx_t *self)
958
+ {
959
+ if (!self)
960
+ return NULL;
961
+
962
+ zhashx_t *copy = zhashx_new ();
963
+ if (copy) {
964
+ copy->destructor = self->destructor;
965
+ copy->duplicator = self->duplicator;
966
+ uint index;
967
+ size_t limit = primes [self->prime_index];
968
+ for (index = 0; index < limit; index++) {
969
+ item_t *item = self->items [index];
970
+ while (item) {
971
+ if (zhashx_insert (copy, item->key, item->value)) {
972
+ zhashx_destroy (&copy);
973
+ break;
974
+ }
975
+ item = item->next;
976
+ }
977
+ }
978
+ }
979
+ return copy;
980
+ }
981
+
982
+
983
+ // --------------------------------------------------------------------------
984
+ // Set a user-defined deallocator for hash items; by default items are not
985
+ // freed when the hash is destroyed.
986
+
987
+ void
988
+ zhashx_set_destructor (zhashx_t *self, zhashx_destructor_fn destructor)
989
+ {
990
+ assert (self);
991
+ self->destructor = destructor;
992
+ }
993
+
994
+
995
+ // --------------------------------------------------------------------------
996
+ // Set a user-defined duplicator for hash items; by default items are not
997
+ // copied when the hash is duplicated.
998
+
999
+ void
1000
+ zhashx_set_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator)
1001
+ {
1002
+ assert (self);
1003
+ self->duplicator = duplicator;
1004
+ }
1005
+
1006
+
1007
+ // --------------------------------------------------------------------------
1008
+ // Set a user-defined deallocator for keys; by default keys are
1009
+ // freed when the hash is destroyed by calling free().
1010
+
1011
+ void
1012
+ zhashx_set_key_destructor (zhashx_t *self, zhashx_destructor_fn destructor)
1013
+ {
1014
+ assert (self);
1015
+ self->key_destructor = destructor;
1016
+ }
1017
+
1018
+
1019
+ // --------------------------------------------------------------------------
1020
+ // Set a user-defined duplicator for keys; by default keys are
1021
+ // duplicated by calling strdup().
1022
+
1023
+ void
1024
+ zhashx_set_key_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator)
1025
+ {
1026
+ assert (self);
1027
+ self->key_duplicator = duplicator;
1028
+ }
1029
+
1030
+
1031
+ // --------------------------------------------------------------------------
1032
+ // Set a user-defined comparator for keys; by default keys are
1033
+ // compared using streq.
1034
+
1035
+ void
1036
+ zhashx_set_key_comparator (zhashx_t *self, zhashx_comparator_fn comparator)
1037
+ {
1038
+ assert (self);
1039
+ assert (comparator != NULL);
1040
+ self->key_comparator = comparator;
1041
+ }
1042
+
1043
+
1044
+ // --------------------------------------------------------------------------
1045
+ // Set a user-defined hash function for keys; by default keys are
1046
+ // hashed by a modified Bernstein hashing function.
1047
+
1048
+ void
1049
+ zhashx_set_key_hasher (zhashx_t *self, zhashx_hash_fn hasher)
1050
+ {
1051
+ assert (self);
1052
+ self->hasher = hasher;
1053
+ }
1054
+
1055
+
1056
+ // --------------------------------------------------------------------------
1057
+ // DEPRECATED by zhashx_dup
1058
+ // Make copy of hash table; if supplied table is null, returns null.
1059
+ // Does not copy items themselves. Rebuilds new table so may be slow on
1060
+ // very large tables. NOTE: only works with item values that are strings
1061
+ // since there's no other way to know how to duplicate the item value.
1062
+
1063
+ zhashx_t *
1064
+ zhashx_dup_v2 (zhashx_t *self)
1065
+ {
1066
+ if (!self)
1067
+ return NULL;
1068
+
1069
+ zhashx_t *copy = zhashx_new ();
1070
+ if (copy) {
1071
+ zhashx_set_destructor (copy, (zhashx_destructor_fn *) zstr_free);
1072
+ zhashx_set_duplicator (copy, (zhashx_duplicator_fn *) strdup);
1073
+ uint index;
1074
+ size_t limit = primes [self->prime_index];
1075
+ for (index = 0; index < limit; index++) {
1076
+ item_t *item = self->items [index];
1077
+ while (item) {
1078
+ if (zhashx_insert (copy, item->key, item->value)) {
1079
+ zhashx_destroy (&copy);
1080
+ break;
1081
+ }
1082
+ item = item->next;
1083
+ }
1084
+ }
1085
+ }
1086
+ return copy;
1087
+ }
1088
+
1089
+
1090
+ // --------------------------------------------------------------------------
1091
+ // Runs selftest of class
1092
+ //
1093
+
1094
+ #ifdef CZMQ_BUILD_DRAFT_API
1095
+ static char *
1096
+ s_test_serialize_int (const void *item)
1097
+ {
1098
+ int *int_item = (int *) item;
1099
+ char *str_item = (char *) zmalloc (sizeof (char) * 10);
1100
+ sprintf (str_item, "%d", *int_item);
1101
+ return str_item;
1102
+ }
1103
+
1104
+ static void *
1105
+ s_test_deserialze_int (const char *str_item)
1106
+ {
1107
+ int *int_item = (int *) zmalloc (sizeof (int));
1108
+ sscanf (str_item, "%d", int_item);
1109
+ return int_item;
1110
+ }
1111
+
1112
+ static void
1113
+ s_test_destroy_int (void **item)
1114
+ {
1115
+ int *int_item = (int *) *item;
1116
+ freen (int_item);
1117
+ }
1118
+ #endif // CZMQ_BUILD_DRAFT_API
1119
+
1120
+ void
1121
+ zhashx_test (bool verbose)
1122
+ {
1123
+ printf (" * zhashx: ");
1124
+
1125
+ // @selftest
1126
+ zhashx_t *hash = zhashx_new ();
1127
+ assert (hash);
1128
+ assert (zhashx_size (hash) == 0);
1129
+ assert (zhashx_first (hash) == NULL);
1130
+ assert (zhashx_cursor (hash) == NULL);
1131
+
1132
+ // Insert some items
1133
+ int rc;
1134
+ rc = zhashx_insert (hash, "DEADBEEF", "dead beef");
1135
+ char *item = (char *) zhashx_first (hash);
1136
+ assert (streq ((char *) zhashx_cursor (hash), "DEADBEEF"));
1137
+ assert (streq (item, "dead beef"));
1138
+ assert (rc == 0);
1139
+ rc = zhashx_insert (hash, "ABADCAFE", "a bad cafe");
1140
+ assert (rc == 0);
1141
+ rc = zhashx_insert (hash, "C0DEDBAD", "coded bad");
1142
+ assert (rc == 0);
1143
+ rc = zhashx_insert (hash, "DEADF00D", "dead food");
1144
+ assert (rc == 0);
1145
+ assert (zhashx_size (hash) == 4);
1146
+
1147
+ // Look for existing items
1148
+ item = (char *) zhashx_lookup (hash, "DEADBEEF");
1149
+ assert (streq (item, "dead beef"));
1150
+ item = (char *) zhashx_lookup (hash, "ABADCAFE");
1151
+ assert (streq (item, "a bad cafe"));
1152
+ item = (char *) zhashx_lookup (hash, "C0DEDBAD");
1153
+ assert (streq (item, "coded bad"));
1154
+ item = (char *) zhashx_lookup (hash, "DEADF00D");
1155
+ assert (streq (item, "dead food"));
1156
+
1157
+ // Look for non-existent items
1158
+ item = (char *) zhashx_lookup (hash, "foo");
1159
+ assert (item == NULL);
1160
+
1161
+ // Try to insert duplicate items
1162
+ rc = zhashx_insert (hash, "DEADBEEF", "foo");
1163
+ assert (rc == -1);
1164
+ item = (char *) zhashx_lookup (hash, "DEADBEEF");
1165
+ assert (streq (item, "dead beef"));
1166
+
1167
+ // Some rename tests
1168
+
1169
+ // Valid rename, key is now LIVEBEEF
1170
+ rc = zhashx_rename (hash, "DEADBEEF", "LIVEBEEF");
1171
+ assert (rc == 0);
1172
+ item = (char *) zhashx_lookup (hash, "LIVEBEEF");
1173
+ assert (streq (item, "dead beef"));
1174
+
1175
+ // Trying to rename an unknown item to a non-existent key
1176
+ rc = zhashx_rename (hash, "WHATBEEF", "NONESUCH");
1177
+ assert (rc == -1);
1178
+
1179
+ // Trying to rename an unknown item to an existing key
1180
+ rc = zhashx_rename (hash, "WHATBEEF", "LIVEBEEF");
1181
+ assert (rc == -1);
1182
+ item = (char *) zhashx_lookup (hash, "LIVEBEEF");
1183
+ assert (streq (item, "dead beef"));
1184
+
1185
+ // Trying to rename an existing item to another existing item
1186
+ rc = zhashx_rename (hash, "LIVEBEEF", "ABADCAFE");
1187
+ assert (rc == -1);
1188
+ item = (char *) zhashx_lookup (hash, "LIVEBEEF");
1189
+ assert (streq (item, "dead beef"));
1190
+ item = (char *) zhashx_lookup (hash, "ABADCAFE");
1191
+ assert (streq (item, "a bad cafe"));
1192
+
1193
+ // Test keys method
1194
+ zlistx_t *keys = zhashx_keys (hash);
1195
+ assert (zlistx_size (keys) == 4);
1196
+ zlistx_destroy (&keys);
1197
+
1198
+ zlistx_t *values = zhashx_values(hash);
1199
+ assert (zlistx_size (values) == 4);
1200
+ zlistx_destroy (&values);
1201
+
1202
+ // Test dup method
1203
+ zhashx_t *copy = zhashx_dup (hash);
1204
+ assert (zhashx_size (copy) == 4);
1205
+ item = (char *) zhashx_lookup (copy, "LIVEBEEF");
1206
+ assert (item);
1207
+ assert (streq (item, "dead beef"));
1208
+ zhashx_destroy (&copy);
1209
+
1210
+ // Test pack/unpack methods
1211
+ zframe_t *frame = zhashx_pack (hash);
1212
+ copy = zhashx_unpack (frame);
1213
+ zframe_destroy (&frame);
1214
+ assert (zhashx_size (copy) == 4);
1215
+ item = (char *) zhashx_lookup (copy, "LIVEBEEF");
1216
+ assert (item);
1217
+ assert (streq (item, "dead beef"));
1218
+ zhashx_destroy (&copy);
1219
+
1220
+ #ifdef CZMQ_BUILD_DRAFT_API
1221
+ // Test own pack/unpack methods
1222
+ zhashx_t *own_hash = zhashx_new ();
1223
+ zhashx_set_destructor (own_hash, s_test_destroy_int);
1224
+ assert (own_hash);
1225
+ int *val1 = (int *) zmalloc (sizeof (int));
1226
+ int *val2 = (int *) zmalloc (sizeof (int));
1227
+ *val1 = 25;
1228
+ *val2 = 100;
1229
+ zhashx_insert (own_hash, "val1", val1);
1230
+ zhashx_insert (own_hash, "val2", val2);
1231
+ frame = zhashx_pack_own (own_hash, s_test_serialize_int);
1232
+ copy = zhashx_unpack_own (frame, s_test_deserialze_int);
1233
+ zhashx_set_destructor (copy, s_test_destroy_int);
1234
+ zframe_destroy (&frame);
1235
+ assert (zhashx_size (copy) == 2);
1236
+ assert (*((int *) zhashx_lookup (copy, "val1")) == 25);
1237
+ assert (*((int *) zhashx_lookup (copy, "val2")) == 100);
1238
+ zhashx_destroy (&copy);
1239
+ zhashx_destroy (&own_hash);
1240
+ #endif // CZMQ_BUILD_DRAFT_API
1241
+
1242
+ // Test save and load
1243
+ zhashx_comment (hash, "This is a test file");
1244
+ zhashx_comment (hash, "Created by %s", "czmq_selftest");
1245
+ zhashx_save (hash, ".cache");
1246
+ copy = zhashx_new ();
1247
+ assert (copy);
1248
+ zhashx_load (copy, ".cache");
1249
+ item = (char *) zhashx_lookup (copy, "LIVEBEEF");
1250
+ assert (item);
1251
+ assert (streq (item, "dead beef"));
1252
+ zhashx_destroy (&copy);
1253
+ zsys_file_delete (".cache");
1254
+
1255
+ // Delete a item
1256
+ zhashx_delete (hash, "LIVEBEEF");
1257
+ item = (char *) zhashx_lookup (hash, "LIVEBEEF");
1258
+ assert (item == NULL);
1259
+ assert (zhashx_size (hash) == 3);
1260
+
1261
+ // Check that the queue is robust against random usage
1262
+ struct {
1263
+ char name [100];
1264
+ bool exists;
1265
+ } testset [200];
1266
+ memset (testset, 0, sizeof (testset));
1267
+ int testmax = 200, testnbr, iteration;
1268
+
1269
+ srandom ((unsigned) time (NULL));
1270
+ for (iteration = 0; iteration < 25000; iteration++) {
1271
+ testnbr = randof (testmax);
1272
+ assert (testnbr != testmax);
1273
+ assert (testnbr < testmax);
1274
+ if (testset [testnbr].exists) {
1275
+ item = (char *) zhashx_lookup (hash, testset [testnbr].name);
1276
+ assert (item);
1277
+ zhashx_delete (hash, testset [testnbr].name);
1278
+ testset [testnbr].exists = false;
1279
+ }
1280
+ else {
1281
+ sprintf (testset [testnbr].name, "%x-%x", rand (), rand ());
1282
+ if (zhashx_insert (hash, testset [testnbr].name, "") == 0)
1283
+ testset [testnbr].exists = true;
1284
+ }
1285
+ }
1286
+ // Test 10K lookups
1287
+ for (iteration = 0; iteration < 10000; iteration++)
1288
+ item = (char *) zhashx_lookup (hash, "DEADBEEFABADCAFE");
1289
+
1290
+ // Destructor should be safe to call twice
1291
+ zhashx_destroy (&hash);
1292
+ zhashx_destroy (&hash);
1293
+ assert (hash == NULL);
1294
+
1295
+ // Test randof() limits - should be within (0..testmax)
1296
+ // and randomness distribution - should not have (many) zero-counts
1297
+ // If there are - maybe the ZSYS_RANDOF_MAX is too big for this platform
1298
+ // Note: This test can take a while on systems with weak floating point HW
1299
+ testmax = 999;
1300
+ size_t rndcnt[999];
1301
+ assert ((sizeof (rndcnt)/sizeof(rndcnt[0])) == testmax);
1302
+ memset (rndcnt, 0, sizeof (rndcnt));
1303
+ for (iteration = 0; iteration < 10000000; iteration++) {
1304
+ testnbr = randof (testmax);
1305
+ assert (testnbr != testmax);
1306
+ assert (testnbr < testmax);
1307
+ assert (testnbr >= 0);
1308
+ rndcnt[testnbr]++;
1309
+ }
1310
+ int rndmisses = 0;
1311
+ for (iteration = 0; iteration < testmax; iteration++) {
1312
+ if (rndcnt[iteration] == 0) {
1313
+ zsys_warning("zhashx_test() : random distribution fault : got 0 hits for %d/%d",
1314
+ iteration, testmax);
1315
+ rndmisses++;
1316
+ }
1317
+ }
1318
+ // Too many misses are suspicious... we can lose half the entries
1319
+ // for each bit not used in the assumed ZSYS_RANDOF_MAX...
1320
+ assert ( (rndmisses < (testmax / 3 )) );
1321
+
1322
+ // Test destructor; automatically copies and frees string values
1323
+ hash = zhashx_new ();
1324
+ assert (hash);
1325
+ zhashx_set_destructor (hash, (zhashx_destructor_fn *) zstr_free);
1326
+ zhashx_set_duplicator (hash, (zhashx_duplicator_fn *) strdup);
1327
+ char value [255];
1328
+ strcpy (value, "This is a string");
1329
+ rc = zhashx_insert (hash, "key1", value);
1330
+ assert (rc == 0);
1331
+ strcpy (value, "Ring a ding ding");
1332
+ rc = zhashx_insert (hash, "key2", value);
1333
+ assert (rc == 0);
1334
+ assert (streq ((char *) zhashx_lookup (hash, "key1"), "This is a string"));
1335
+ assert (streq ((char *) zhashx_lookup (hash, "key2"), "Ring a ding ding"));
1336
+ zhashx_destroy (&hash);
1337
+
1338
+ // Test purger and shrinker: no data should end up unreferenced in valgrind
1339
+ hash = zhashx_new ();
1340
+ assert (hash);
1341
+ zhashx_set_destructor (hash, (zhashx_destructor_fn *) zstr_free);
1342
+ zhashx_set_duplicator (hash, (zhashx_duplicator_fn *) strdup);
1343
+ char valuep [255];
1344
+ strcpy (valuep, "This is a string");
1345
+ rc = zhashx_insert (hash, "key1", valuep);
1346
+ assert (rc == 0);
1347
+ strcpy (valuep, "Ring a ding ding");
1348
+ rc = zhashx_insert (hash, "key2", valuep);
1349
+ assert (rc == 0);
1350
+ strcpy (valuep, "Cartahena delenda est");
1351
+ rc = zhashx_insert (hash, "key3", valuep);
1352
+ assert (rc == 0);
1353
+ strcpy (valuep, "So say we all!");
1354
+ rc = zhashx_insert (hash, "key4", valuep);
1355
+ assert (rc == 0);
1356
+ assert (streq ((char *) zhashx_lookup (hash, "key1"), "This is a string"));
1357
+ assert (streq ((char *) zhashx_lookup (hash, "key2"), "Ring a ding ding"));
1358
+ assert (streq ((char *) zhashx_lookup (hash, "key3"), "Cartahena delenda est"));
1359
+ assert (streq ((char *) zhashx_lookup (hash, "key4"), "So say we all!"));
1360
+ zhashx_purge (hash);
1361
+ zhashx_destroy (&hash);
1362
+
1363
+ #if defined (__WINDOWS__)
1364
+ zsys_shutdown();
1365
+ #endif
1366
+ // @end
1367
+
1368
+ printf ("OK\n");
1369
+ }