laag-libczmq 4.1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,345 @@
1
+ ################################################################################
2
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
3
+ # Read the zproject/README.md for information about making permanent changes. #
4
+ ################################################################################
5
+
6
+ from __future__ import print_function
7
+ import os
8
+ import re
9
+ import sys
10
+
11
+ import subprocess
12
+ def pkgconfig_installed ():
13
+ try:
14
+ subprocess.check_output (["pkg-config", "--version"])
15
+ return True
16
+ except subprocess.CalledProcessError:
17
+ return False
18
+
19
+ def pkgconfig_kwargs (libs):
20
+ """If pkg-config is available, then return kwargs for set_source based on pkg-config output
21
+
22
+ It setup include_dirs, library_dirs, libraries and define_macros
23
+ """
24
+
25
+ # make API great again!
26
+ if isinstance (libs, (str, bytes)):
27
+ libs = (libs, )
28
+
29
+ # drop starting -I -L -l from cflags
30
+ def dropILl (string):
31
+ def _dropILl (string):
32
+ if string.startswith (b"-I") or string.startswith (b"-L") or string.startswith (b"-l"):
33
+ return string [2:]
34
+ return [_dropILl (x) for x in string.split ()]
35
+
36
+ # convert -Dfoo=bar to list of tuples [("foo", "bar")] expected by cffi
37
+ def macros (string):
38
+ def _macros (string):
39
+ return tuple (string [2:].split (b'=', 2))
40
+ return [_macros (x) for x in string.split () if x.startswith (b"-D")]
41
+
42
+ # pkg-config call
43
+ def pc (libname, *args):
44
+ a = ["pkg-config", "--print-errors"]
45
+ a.extend (args)
46
+ a.append (libname)
47
+ return subprocess.check_output (a)
48
+
49
+ # return kwargs for given libname
50
+ def kwargs (libname):
51
+ return {
52
+ "include_dirs" : dropILl (pc (libname, "--cflags-only-I")),
53
+ "library_dirs" : dropILl (pc (libname, "--libs-only-L")),
54
+ "libraries" : dropILl (pc (libname, "--libs-only-l")),
55
+ "define_macros" : macros (pc (libname, "--cflags")),
56
+ }
57
+
58
+ # merge all arguments together
59
+ ret = {}
60
+ for libname in libs:
61
+ foo = kwargs (libname)
62
+ for key, value in foo.items ():
63
+ if not key in ret:
64
+ ret [key] = value
65
+ else:
66
+ ret [key].extend (value)
67
+
68
+ # Python3 and strict unicode
69
+ for key, value in ret.items ():
70
+ if isinstance (value, bytes):
71
+ ret [key] = value.decode ("utf-8")
72
+ elif isinstance (value, list):
73
+ if len (value) == 0:
74
+ continue
75
+ if isinstance (value[0], tuple):
76
+ ret [key] = [(v[0].decode ("utf-8"), v[1].decode ("utf-8")) for v in value]
77
+ else:
78
+ ret [key] = [v.decode ("utf-8") for v in value]
79
+
80
+ return ret
81
+
82
+ if not pkgconfig_installed ():
83
+ print ("ERROR: build without pkg-config not supported", file=sys.stderr)
84
+ sys.exit (1)
85
+
86
+ kwargs = pkgconfig_kwargs ([
87
+ "libzmq",
88
+ "uuid",
89
+ "libsystemd",
90
+ "liblz4",
91
+ "libczmq"
92
+ ])
93
+ import cffi
94
+ # can't import does not work, read and exec manually
95
+ with open (os.path.join (
96
+ os.path.dirname (__file__),
97
+ "cdefs.py"), 'r') as fp:
98
+ cdefs_py = fp.read()
99
+ gl = {}
100
+ exec (cdefs_py, gl)
101
+ czmq_cdefs = gl ["czmq_cdefs"]
102
+
103
+ ffibuilder = cffi.FFI ()
104
+ ffibuilder.set_source ("czmq_cffi.native", "#include <czmq.h>", **kwargs)
105
+
106
+ # Custom setup for czmq
107
+ for item in czmq_cdefs:
108
+ ffibuilder.cdef(item)
109
+
110
+ ffidestructorbuilder = cffi.FFI ()
111
+ ffidestructorbuilder.cdef('''
112
+ void
113
+ zactor_destroy_py (void *self);
114
+
115
+ void
116
+ zargs_destroy_py (void *self);
117
+
118
+ void
119
+ zarmour_destroy_py (void *self);
120
+
121
+ void
122
+ zcert_destroy_py (void *self);
123
+
124
+ void
125
+ zcertstore_destroy_py (void *self);
126
+
127
+ void
128
+ zchunk_destroy_py (void *self);
129
+
130
+ void
131
+ zconfig_destroy_py (void *self);
132
+
133
+ void
134
+ zdigest_destroy_py (void *self);
135
+
136
+ void
137
+ zdir_destroy_py (void *self);
138
+
139
+ void
140
+ zdir_patch_destroy_py (void *self);
141
+
142
+ void
143
+ zfile_destroy_py (void *self);
144
+
145
+ void
146
+ zframe_destroy_py (void *self);
147
+
148
+ void
149
+ zhash_destroy_py (void *self);
150
+
151
+ void
152
+ zhashx_destroy_py (void *self);
153
+
154
+ void
155
+ ziflist_destroy_py (void *self);
156
+
157
+ void
158
+ zlist_destroy_py (void *self);
159
+
160
+ void
161
+ zlistx_destroy_py (void *self);
162
+
163
+ void
164
+ zloop_destroy_py (void *self);
165
+
166
+ void
167
+ zmsg_destroy_py (void *self);
168
+
169
+ void
170
+ zpoller_destroy_py (void *self);
171
+
172
+ void
173
+ zproc_destroy_py (void *self);
174
+
175
+ void
176
+ zsock_destroy_py (void *self);
177
+
178
+ void
179
+ ztimerset_destroy_py (void *self);
180
+
181
+ void
182
+ ztrie_destroy_py (void *self);
183
+
184
+ void
185
+ zuuid_destroy_py (void *self);
186
+
187
+ ''')
188
+
189
+ ffidestructorbuilder.set_source ("czmq_cffi.destructors", '''
190
+ #include <czmq.h>
191
+ void
192
+ zactor_destroy_py (void *self)
193
+ {
194
+ zactor_destroy ((zactor_t **) &self);
195
+ }
196
+
197
+ void
198
+ zargs_destroy_py (void *self)
199
+ {
200
+ zargs_destroy ((zargs_t **) &self);
201
+ }
202
+
203
+ void
204
+ zarmour_destroy_py (void *self)
205
+ {
206
+ zarmour_destroy ((zarmour_t **) &self);
207
+ }
208
+
209
+ void
210
+ zcert_destroy_py (void *self)
211
+ {
212
+ zcert_destroy ((zcert_t **) &self);
213
+ }
214
+
215
+ void
216
+ zcertstore_destroy_py (void *self)
217
+ {
218
+ zcertstore_destroy ((zcertstore_t **) &self);
219
+ }
220
+
221
+ void
222
+ zchunk_destroy_py (void *self)
223
+ {
224
+ zchunk_destroy ((zchunk_t **) &self);
225
+ }
226
+
227
+ void
228
+ zconfig_destroy_py (void *self)
229
+ {
230
+ zconfig_destroy ((zconfig_t **) &self);
231
+ }
232
+
233
+ void
234
+ zdigest_destroy_py (void *self)
235
+ {
236
+ zdigest_destroy ((zdigest_t **) &self);
237
+ }
238
+
239
+ void
240
+ zdir_destroy_py (void *self)
241
+ {
242
+ zdir_destroy ((zdir_t **) &self);
243
+ }
244
+
245
+ void
246
+ zdir_patch_destroy_py (void *self)
247
+ {
248
+ zdir_patch_destroy ((zdir_patch_t **) &self);
249
+ }
250
+
251
+ void
252
+ zfile_destroy_py (void *self)
253
+ {
254
+ zfile_destroy ((zfile_t **) &self);
255
+ }
256
+
257
+ void
258
+ zframe_destroy_py (void *self)
259
+ {
260
+ zframe_destroy ((zframe_t **) &self);
261
+ }
262
+
263
+ void
264
+ zhash_destroy_py (void *self)
265
+ {
266
+ zhash_destroy ((zhash_t **) &self);
267
+ }
268
+
269
+ void
270
+ zhashx_destroy_py (void *self)
271
+ {
272
+ zhashx_destroy ((zhashx_t **) &self);
273
+ }
274
+
275
+ void
276
+ ziflist_destroy_py (void *self)
277
+ {
278
+ ziflist_destroy ((ziflist_t **) &self);
279
+ }
280
+
281
+ void
282
+ zlist_destroy_py (void *self)
283
+ {
284
+ zlist_destroy ((zlist_t **) &self);
285
+ }
286
+
287
+ void
288
+ zlistx_destroy_py (void *self)
289
+ {
290
+ zlistx_destroy ((zlistx_t **) &self);
291
+ }
292
+
293
+ void
294
+ zloop_destroy_py (void *self)
295
+ {
296
+ zloop_destroy ((zloop_t **) &self);
297
+ }
298
+
299
+ void
300
+ zmsg_destroy_py (void *self)
301
+ {
302
+ zmsg_destroy ((zmsg_t **) &self);
303
+ }
304
+
305
+ void
306
+ zpoller_destroy_py (void *self)
307
+ {
308
+ zpoller_destroy ((zpoller_t **) &self);
309
+ }
310
+
311
+ void
312
+ zproc_destroy_py (void *self)
313
+ {
314
+ zproc_destroy ((zproc_t **) &self);
315
+ }
316
+
317
+ void
318
+ zsock_destroy_py (void *self)
319
+ {
320
+ zsock_destroy ((zsock_t **) &self);
321
+ }
322
+
323
+ void
324
+ ztimerset_destroy_py (void *self)
325
+ {
326
+ ztimerset_destroy ((ztimerset_t **) &self);
327
+ }
328
+
329
+ void
330
+ ztrie_destroy_py (void *self)
331
+ {
332
+ ztrie_destroy ((ztrie_t **) &self);
333
+ }
334
+
335
+ void
336
+ zuuid_destroy_py (void *self)
337
+ {
338
+ zuuid_destroy ((zuuid_t **) &self);
339
+ }
340
+
341
+ ''', **kwargs)
342
+
343
+ if __name__ == "__main__":
344
+ ffibuilder.compile (verbose=True)
345
+ ffidestructorbuilder.compile (verbose=True)
@@ -0,0 +1,4086 @@
1
+ ################################################################################
2
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
3
+ # Read the zproject/README.md for information about making permanent changes. #
4
+ ################################################################################
5
+ import re
6
+ czmq_cdefs = list ()
7
+ # Custom setup for czmq
8
+ czmq_cdefs.append ('''
9
+ typedef int time_t;
10
+ typedef int off_t;
11
+
12
+ typedef unsigned char byte; // Single unsigned byte = 8 bits
13
+ typedef unsigned short dbyte; // Double byte = 16 bits
14
+ typedef unsigned int qbyte; // Quad byte = 32 bits
15
+ typedef int SOCKET;
16
+ typedef struct sockaddr_in inaddr_t;
17
+
18
+ // -- destroy an item
19
+ typedef void (czmq_destructor) (void **item);
20
+ // -- duplicate an item
21
+ typedef void *(czmq_duplicator) (const void *item);
22
+ // - compare two items, for sorting
23
+ typedef int (czmq_comparator) (const void *item1, const void *item2);
24
+ ''')
25
+
26
+
27
+ #Import definitions from dependent projects
28
+
29
+ czmq_cdefs.append ('''
30
+ typedef struct _zsock_t zsock_t;
31
+ typedef struct _zactor_t zactor_t;
32
+ typedef struct _zmsg_t zmsg_t;
33
+ typedef struct _zargs_t zargs_t;
34
+ typedef struct _zarmour_t zarmour_t;
35
+ typedef struct _zchunk_t zchunk_t;
36
+ typedef struct _char_t char_t;
37
+ typedef struct _zcert_t zcert_t;
38
+ typedef struct _zlist_t zlist_t;
39
+ typedef struct _zcertstore_t zcertstore_t;
40
+ typedef struct _zlistx_t zlistx_t;
41
+ typedef struct _zframe_t zframe_t;
42
+ typedef struct _msecs_t msecs_t;
43
+ typedef struct _zclock_t zclock_t;
44
+ typedef struct _zconfig_t zconfig_t;
45
+ typedef struct _zdigest_t zdigest_t;
46
+ typedef struct _zdir_t zdir_t;
47
+ typedef struct _zhash_t zhash_t;
48
+ typedef struct _zfile_t zfile_t;
49
+ typedef struct _zdir_patch_t zdir_patch_t;
50
+ typedef struct _zhashx_t zhashx_t;
51
+ typedef struct _ziflist_t ziflist_t;
52
+ typedef struct _zloop_t zloop_t;
53
+ typedef struct _zmq_pollitem_t zmq_pollitem_t;
54
+ typedef struct _zpoller_t zpoller_t;
55
+ typedef struct _zproc_t zproc_t;
56
+ typedef struct _va_list_t va_list_t;
57
+ typedef struct _socket_t socket_t;
58
+ typedef struct _zstr_t zstr_t;
59
+ typedef struct _zsys_t zsys_t;
60
+ typedef struct _ztimerset_t ztimerset_t;
61
+ typedef struct _ztrie_t ztrie_t;
62
+ typedef struct _zuuid_t zuuid_t;
63
+ // Actors get a pipe and arguments from caller
64
+ typedef void (zactor_fn) (
65
+ zsock_t *pipe, void *args);
66
+
67
+ // Function to be called on zactor_destroy. Default behavior is to send zmsg_t with string "$TERM" in a first frame.
68
+ //
69
+ // An example - to send $KTHXBAI string
70
+ //
71
+ // if (zstr_send (self->pipe, "$KTHXBAI") == 0)
72
+ // zsock_wait (self->pipe);
73
+ typedef void (zactor_destructor_fn) (
74
+ zactor_t *self);
75
+
76
+ // Loaders retrieve certificates from an arbitrary source.
77
+ typedef void (zcertstore_loader) (
78
+ zcertstore_t *self);
79
+
80
+ // Destructor for loader state.
81
+ typedef void (zcertstore_destructor) (
82
+ void **self_p);
83
+
84
+ //
85
+ typedef int (zconfig_fct) (
86
+ zconfig_t *self, void *arg, int level);
87
+
88
+ // Callback function for zhash_freefn method
89
+ typedef void (zhash_free_fn) (
90
+ void *data);
91
+
92
+ // Destroy an item
93
+ typedef void (zhashx_destructor_fn) (
94
+ void **item);
95
+
96
+ // Duplicate an item
97
+ typedef void * (zhashx_duplicator_fn) (
98
+ const void *item);
99
+
100
+ // Compare two items, for sorting
101
+ typedef int (zhashx_comparator_fn) (
102
+ const void *item1, const void *item2);
103
+
104
+ // Destroy an item.
105
+ typedef void (zhashx_free_fn) (
106
+ void *data);
107
+
108
+ // Hash function for keys.
109
+ typedef size_t (zhashx_hash_fn) (
110
+ const void *key);
111
+
112
+ // Serializes an item to a longstr.
113
+ // The caller takes ownership of the newly created object.
114
+ typedef char * (zhashx_serializer_fn) (
115
+ const void *item);
116
+
117
+ // Deserializes a longstr into an item.
118
+ // The caller takes ownership of the newly created object.
119
+ typedef void * (zhashx_deserializer_fn) (
120
+ const char *item_str);
121
+
122
+ // Comparison function e.g. for sorting and removing.
123
+ typedef int (zlist_compare_fn) (
124
+ void *item1, void *item2);
125
+
126
+ // Callback function for zlist_freefn method
127
+ typedef void (zlist_free_fn) (
128
+ void *data);
129
+
130
+ // Destroy an item
131
+ typedef void (zlistx_destructor_fn) (
132
+ void **item);
133
+
134
+ // Duplicate an item
135
+ typedef void * (zlistx_duplicator_fn) (
136
+ const void *item);
137
+
138
+ // Compare two items, for sorting
139
+ typedef int (zlistx_comparator_fn) (
140
+ const void *item1, const void *item2);
141
+
142
+ // Callback function for reactor socket activity
143
+ typedef int (zloop_reader_fn) (
144
+ zloop_t *loop, zsock_t *reader, void *arg);
145
+
146
+ // Callback function for reactor events (low-level)
147
+ typedef int (zloop_fn) (
148
+ zloop_t *loop, zmq_pollitem_t *item, void *arg);
149
+
150
+ // Callback for reactor timer events
151
+ typedef int (zloop_timer_fn) (
152
+ zloop_t *loop, int timer_id, void *arg);
153
+
154
+ // Callback for interrupt signal handler
155
+ typedef void (zsys_handler_fn) (
156
+ int signal_value);
157
+
158
+ // Callback function for timer event.
159
+ typedef void (ztimerset_fn) (
160
+ int timer_id, void *arg);
161
+
162
+ // Callback function for ztrie_node to destroy node data.
163
+ typedef void (ztrie_destroy_data_fn) (
164
+ void **data);
165
+
166
+ // CLASS: zactor
167
+ // Create a new actor passing arbitrary arguments reference.
168
+ zactor_t *
169
+ zactor_new (zactor_fn task, void *args);
170
+
171
+ // Destroy an actor.
172
+ void
173
+ zactor_destroy (zactor_t **self_p);
174
+
175
+ // Send a zmsg message to the actor, take ownership of the message
176
+ // and destroy when it has been sent.
177
+ int
178
+ zactor_send (zactor_t *self, zmsg_t **msg_p);
179
+
180
+ // Receive a zmsg message from the actor. Returns NULL if the actor
181
+ // was interrupted before the message could be received, or if there
182
+ // was a timeout on the actor.
183
+ zmsg_t *
184
+ zactor_recv (zactor_t *self);
185
+
186
+ // Probe the supplied object, and report if it looks like a zactor_t.
187
+ bool
188
+ zactor_is (void *self);
189
+
190
+ // Probe the supplied reference. If it looks like a zactor_t instance,
191
+ // return the underlying libzmq actor handle; else if it looks like
192
+ // a libzmq actor handle, return the supplied value.
193
+ void *
194
+ zactor_resolve (void *self);
195
+
196
+ // Return the actor's zsock handle. Use this when you absolutely need
197
+ // to work with the zsock instance rather than the actor.
198
+ zsock_t *
199
+ zactor_sock (zactor_t *self);
200
+
201
+ // Change default destructor by custom function. Actor MUST be able to handle new message instead of default $TERM.
202
+ void
203
+ zactor_set_destructor (zactor_t *self, zactor_destructor_fn destructor);
204
+
205
+ // Self test of this class.
206
+ void
207
+ zactor_test (bool verbose);
208
+
209
+ // CLASS: zargs
210
+ // Create a new zargs from command line arguments.
211
+ zargs_t *
212
+ zargs_new (int argc, char **argv);
213
+
214
+ // Destroy zargs instance.
215
+ void
216
+ zargs_destroy (zargs_t **self_p);
217
+
218
+ // Return program name (argv[0])
219
+ const char *
220
+ zargs_progname (zargs_t *self);
221
+
222
+ // Return number of positional arguments
223
+ size_t
224
+ zargs_arguments (zargs_t *self);
225
+
226
+ // Return first positional argument or NULL
227
+ const char *
228
+ zargs_first (zargs_t *self);
229
+
230
+ // Return next positional argument or NULL
231
+ const char *
232
+ zargs_next (zargs_t *self);
233
+
234
+ // Return first named parameter value, or NULL if there are no named
235
+ // parameters, or value for which zargs_param_empty (arg) returns true.
236
+ const char *
237
+ zargs_param_first (zargs_t *self);
238
+
239
+ // Return next named parameter value, or NULL if there are no named
240
+ // parameters, or value for which zargs_param_empty (arg) returns true.
241
+ const char *
242
+ zargs_param_next (zargs_t *self);
243
+
244
+ // Return current parameter name, or NULL if there are no named
245
+ // parameters.
246
+ const char *
247
+ zargs_param_name (zargs_t *self);
248
+
249
+ // Return value of named parameter, NULL if no given parameter has
250
+ // been specified, or special value for wich zargs_param_empty ()
251
+ // returns true.
252
+ const char *
253
+ zargs_param_lookup (zargs_t *self, const char *keys);
254
+
255
+ // Return value of named parameter(s), NULL if no given parameter has
256
+ // been specified, or special value for wich zargs_param_empty ()
257
+ // returns true.
258
+ const char *
259
+ zargs_param_lookupx (zargs_t *self, const char *keys, ...);
260
+
261
+ // Returns true if there are --help -h arguments
262
+ bool
263
+ zargs_has_help (zargs_t *self);
264
+
265
+ // Returns true if parameter did not have a value
266
+ bool
267
+ zargs_param_empty (const char *arg);
268
+
269
+ // Print an instance of zargs.
270
+ void
271
+ zargs_print (zargs_t *self);
272
+
273
+ // Self test of this class.
274
+ void
275
+ zargs_test (bool verbose);
276
+
277
+ // CLASS: zarmour
278
+ // Create a new zarmour
279
+ zarmour_t *
280
+ zarmour_new (void);
281
+
282
+ // Destroy the zarmour
283
+ void
284
+ zarmour_destroy (zarmour_t **self_p);
285
+
286
+ // Encode a stream of bytes into an armoured string. Returns the armoured
287
+ // string, or NULL if there was insufficient memory available to allocate
288
+ // a new string.
289
+ char *
290
+ zarmour_encode (zarmour_t *self, const byte *data, size_t size);
291
+
292
+ // Decode an armoured string into a chunk. The decoded output is
293
+ // null-terminated, so it may be treated as a string, if that's what
294
+ // it was prior to encoding.
295
+ zchunk_t *
296
+ zarmour_decode (zarmour_t *self, const char *data);
297
+
298
+ // Get the mode property.
299
+ int
300
+ zarmour_mode (zarmour_t *self);
301
+
302
+ // Get printable string for mode.
303
+ const char *
304
+ zarmour_mode_str (zarmour_t *self);
305
+
306
+ // Set the mode property.
307
+ void
308
+ zarmour_set_mode (zarmour_t *self, int mode);
309
+
310
+ // Return true if padding is turned on.
311
+ bool
312
+ zarmour_pad (zarmour_t *self);
313
+
314
+ // Turn padding on or off. Default is on.
315
+ void
316
+ zarmour_set_pad (zarmour_t *self, bool pad);
317
+
318
+ // Get the padding character.
319
+ char
320
+ zarmour_pad_char (zarmour_t *self);
321
+
322
+ // Set the padding character.
323
+ void
324
+ zarmour_set_pad_char (zarmour_t *self, char pad_char);
325
+
326
+ // Return if splitting output into lines is turned on. Default is off.
327
+ bool
328
+ zarmour_line_breaks (zarmour_t *self);
329
+
330
+ // Turn splitting output into lines on or off.
331
+ void
332
+ zarmour_set_line_breaks (zarmour_t *self, bool line_breaks);
333
+
334
+ // Get the line length used for splitting lines.
335
+ size_t
336
+ zarmour_line_length (zarmour_t *self);
337
+
338
+ // Set the line length used for splitting lines.
339
+ void
340
+ zarmour_set_line_length (zarmour_t *self, size_t line_length);
341
+
342
+ // Print properties of object
343
+ void
344
+ zarmour_print (zarmour_t *self);
345
+
346
+ // Self test of this class.
347
+ void
348
+ zarmour_test (bool verbose);
349
+
350
+ // CLASS: zcert
351
+ // Create and initialize a new certificate in memory
352
+ zcert_t *
353
+ zcert_new (void);
354
+
355
+ // Accepts public/secret key pair from caller
356
+ zcert_t *
357
+ zcert_new_from (const byte *public_key, const byte *secret_key);
358
+
359
+ // Accepts public/secret key text pair from caller
360
+ zcert_t *
361
+ zcert_new_from_txt (const char *public_txt, const char *secret_txt);
362
+
363
+ // Load certificate from file
364
+ zcert_t *
365
+ zcert_load (const char *filename);
366
+
367
+ // Destroy a certificate in memory
368
+ void
369
+ zcert_destroy (zcert_t **self_p);
370
+
371
+ // Return public part of key pair as 32-byte binary string
372
+ const byte *
373
+ zcert_public_key (zcert_t *self);
374
+
375
+ // Return secret part of key pair as 32-byte binary string
376
+ const byte *
377
+ zcert_secret_key (zcert_t *self);
378
+
379
+ // Return public part of key pair as Z85 armored string
380
+ const char *
381
+ zcert_public_txt (zcert_t *self);
382
+
383
+ // Return secret part of key pair as Z85 armored string
384
+ const char *
385
+ zcert_secret_txt (zcert_t *self);
386
+
387
+ // Set certificate metadata from formatted string.
388
+ void
389
+ zcert_set_meta (zcert_t *self, const char *name, const char *format, ...);
390
+
391
+ // Unset certificate metadata.
392
+ void
393
+ zcert_unset_meta (zcert_t *self, const char *name);
394
+
395
+ // Get metadata value from certificate; if the metadata value doesn't
396
+ // exist, returns NULL.
397
+ const char *
398
+ zcert_meta (zcert_t *self, const char *name);
399
+
400
+ // Get list of metadata fields from certificate. Caller is responsible for
401
+ // destroying list. Caller should not modify the values of list items.
402
+ zlist_t *
403
+ zcert_meta_keys (zcert_t *self);
404
+
405
+ // Save full certificate (public + secret) to file for persistent storage
406
+ // This creates one public file and one secret file (filename + "_secret").
407
+ int
408
+ zcert_save (zcert_t *self, const char *filename);
409
+
410
+ // Save public certificate only to file for persistent storage
411
+ int
412
+ zcert_save_public (zcert_t *self, const char *filename);
413
+
414
+ // Save secret certificate only to file for persistent storage
415
+ int
416
+ zcert_save_secret (zcert_t *self, const char *filename);
417
+
418
+ // Apply certificate to socket, i.e. use for CURVE security on socket.
419
+ // If certificate was loaded from public file, the secret key will be
420
+ // undefined, and this certificate will not work successfully.
421
+ void
422
+ zcert_apply (zcert_t *self, void *socket);
423
+
424
+ // Return copy of certificate; if certificate is NULL or we exhausted
425
+ // heap memory, returns NULL.
426
+ zcert_t *
427
+ zcert_dup (zcert_t *self);
428
+
429
+ // Return true if two certificates have the same keys
430
+ bool
431
+ zcert_eq (zcert_t *self, zcert_t *compare);
432
+
433
+ // Print certificate contents to stdout
434
+ void
435
+ zcert_print (zcert_t *self);
436
+
437
+ // Self test of this class
438
+ void
439
+ zcert_test (bool verbose);
440
+
441
+ // CLASS: zcertstore
442
+ // Create a new certificate store from a disk directory, loading and
443
+ // indexing all certificates in that location. The directory itself may be
444
+ // absent, and created later, or modified at any time. The certificate store
445
+ // is automatically refreshed on any zcertstore_lookup() call. If the
446
+ // location is specified as NULL, creates a pure-memory store, which you
447
+ // can work with by inserting certificates at runtime.
448
+ zcertstore_t *
449
+ zcertstore_new (const char *location);
450
+
451
+ // Destroy a certificate store object in memory. Does not affect anything
452
+ // stored on disk.
453
+ void
454
+ zcertstore_destroy (zcertstore_t **self_p);
455
+
456
+ // Override the default disk loader with a custom loader fn.
457
+ void
458
+ zcertstore_set_loader (zcertstore_t *self, zcertstore_loader loader, zcertstore_destructor destructor, void *state);
459
+
460
+ // Look up certificate by public key, returns zcert_t object if found,
461
+ // else returns NULL. The public key is provided in Z85 text format.
462
+ zcert_t *
463
+ zcertstore_lookup (zcertstore_t *self, const char *public_key);
464
+
465
+ // Insert certificate into certificate store in memory. Note that this
466
+ // does not save the certificate to disk. To do that, use zcert_save()
467
+ // directly on the certificate. Takes ownership of zcert_t object.
468
+ void
469
+ zcertstore_insert (zcertstore_t *self, zcert_t **cert_p);
470
+
471
+ // Empty certificate hashtable. This wrapper exists to be friendly to bindings,
472
+ // which don't usually have access to struct internals.
473
+ void
474
+ zcertstore_empty (zcertstore_t *self);
475
+
476
+ // Print list of certificates in store to logging facility
477
+ void
478
+ zcertstore_print (zcertstore_t *self);
479
+
480
+ // Return a list of all the certificates in the store.
481
+ // The caller takes ownership of the zlistx_t object and is responsible
482
+ // for destroying it. The caller does not take ownership of the zcert_t
483
+ // objects.
484
+ zlistx_t *
485
+ zcertstore_certs (zcertstore_t *self);
486
+
487
+ // Self test of this class
488
+ void
489
+ zcertstore_test (bool verbose);
490
+
491
+ // CLASS: zchunk
492
+ // Create a new chunk of the specified size. If you specify the data, it
493
+ // is copied into the chunk. If you do not specify the data, the chunk is
494
+ // allocated and left empty, and you can then add data using zchunk_append.
495
+ zchunk_t *
496
+ zchunk_new (const void *data, size_t size);
497
+
498
+ // Destroy a chunk
499
+ void
500
+ zchunk_destroy (zchunk_t **self_p);
501
+
502
+ // Resizes chunk max_size as requested; chunk_cur size is set to zero
503
+ void
504
+ zchunk_resize (zchunk_t *self, size_t size);
505
+
506
+ // Return chunk cur size
507
+ size_t
508
+ zchunk_size (zchunk_t *self);
509
+
510
+ // Return chunk max size
511
+ size_t
512
+ zchunk_max_size (zchunk_t *self);
513
+
514
+ // Return chunk data
515
+ byte *
516
+ zchunk_data (zchunk_t *self);
517
+
518
+ // Set chunk data from user-supplied data; truncate if too large. Data may
519
+ // be null. Returns actual size of chunk
520
+ size_t
521
+ zchunk_set (zchunk_t *self, const void *data, size_t size);
522
+
523
+ // Fill chunk data from user-supplied octet
524
+ size_t
525
+ zchunk_fill (zchunk_t *self, byte filler, size_t size);
526
+
527
+ // Append user-supplied data to chunk, return resulting chunk size. If the
528
+ // data would exceeded the available space, it is truncated. If you want to
529
+ // grow the chunk to accommodate new data, use the zchunk_extend method.
530
+ size_t
531
+ zchunk_append (zchunk_t *self, const void *data, size_t size);
532
+
533
+ // Append user-supplied data to chunk, return resulting chunk size. If the
534
+ // data would exceeded the available space, the chunk grows in size.
535
+ size_t
536
+ zchunk_extend (zchunk_t *self, const void *data, size_t size);
537
+
538
+ // Copy as much data from 'source' into the chunk as possible; returns the
539
+ // new size of chunk. If all data from 'source' is used, returns exhausted
540
+ // on the source chunk. Source can be consumed as many times as needed until
541
+ // it is exhausted. If source was already exhausted, does not change chunk.
542
+ size_t
543
+ zchunk_consume (zchunk_t *self, zchunk_t *source);
544
+
545
+ // Returns true if the chunk was exhausted by consume methods, or if the
546
+ // chunk has a size of zero.
547
+ bool
548
+ zchunk_exhausted (zchunk_t *self);
549
+
550
+ // Read chunk from an open file descriptor
551
+ zchunk_t *
552
+ zchunk_read (FILE *handle, size_t bytes);
553
+
554
+ // Write chunk to an open file descriptor
555
+ int
556
+ zchunk_write (zchunk_t *self, FILE *handle);
557
+
558
+ // Try to slurp an entire file into a chunk. Will read up to maxsize of
559
+ // the file. If maxsize is 0, will attempt to read the entire file and
560
+ // fail with an assertion if that cannot fit into memory. Returns a new
561
+ // chunk containing the file data, or NULL if the file could not be read.
562
+ zchunk_t *
563
+ zchunk_slurp (const char *filename, size_t maxsize);
564
+
565
+ // Create copy of chunk, as new chunk object. Returns a fresh zchunk_t
566
+ // object, or null if there was not enough heap memory. If chunk is null,
567
+ // returns null.
568
+ zchunk_t *
569
+ zchunk_dup (zchunk_t *self);
570
+
571
+ // Return chunk data encoded as printable hex string. Caller must free
572
+ // string when finished with it.
573
+ char *
574
+ zchunk_strhex (zchunk_t *self);
575
+
576
+ // Return chunk data copied into freshly allocated string
577
+ // Caller must free string when finished with it.
578
+ char *
579
+ zchunk_strdup (zchunk_t *self);
580
+
581
+ // Return TRUE if chunk body is equal to string, excluding terminator
582
+ bool
583
+ zchunk_streq (zchunk_t *self, const char *string);
584
+
585
+ // Transform zchunk into a zframe that can be sent in a message.
586
+ zframe_t *
587
+ zchunk_pack (zchunk_t *self);
588
+
589
+ // Transform a zframe into a zchunk.
590
+ zchunk_t *
591
+ zchunk_unpack (zframe_t *frame);
592
+
593
+ // Calculate SHA1 digest for chunk, using zdigest class.
594
+ const char *
595
+ zchunk_digest (zchunk_t *self);
596
+
597
+ // Dump chunk to FILE stream, for debugging and tracing.
598
+ void
599
+ zchunk_fprint (zchunk_t *self, FILE *file);
600
+
601
+ // Dump message to stderr, for debugging and tracing.
602
+ // See zchunk_fprint for details
603
+ void
604
+ zchunk_print (zchunk_t *self);
605
+
606
+ // Probe the supplied object, and report if it looks like a zchunk_t.
607
+ bool
608
+ zchunk_is (void *self);
609
+
610
+ // Self test of this class.
611
+ void
612
+ zchunk_test (bool verbose);
613
+
614
+ // CLASS: zclock
615
+ // Sleep for a number of milliseconds
616
+ void
617
+ zclock_sleep (int msecs);
618
+
619
+ // Return current system clock as milliseconds. Note that this clock can
620
+ // jump backwards (if the system clock is changed) so is unsafe to use for
621
+ // timers and time offsets. Use zclock_mono for that instead.
622
+ int64_t
623
+ zclock_time (void);
624
+
625
+ // Return current monotonic clock in milliseconds. Use this when you compute
626
+ // time offsets. The monotonic clock is not affected by system changes and
627
+ // so will never be reset backwards, unlike a system clock.
628
+ int64_t
629
+ zclock_mono (void);
630
+
631
+ // Return current monotonic clock in microseconds. Use this when you compute
632
+ // time offsets. The monotonic clock is not affected by system changes and
633
+ // so will never be reset backwards, unlike a system clock.
634
+ int64_t
635
+ zclock_usecs (void);
636
+
637
+ // Return formatted date/time as fresh string. Free using zstr_free().
638
+ char *
639
+ zclock_timestr (void);
640
+
641
+ // Self test of this class.
642
+ void
643
+ zclock_test (bool verbose);
644
+
645
+ // CLASS: zconfig
646
+ // Create new config item
647
+ zconfig_t *
648
+ zconfig_new (const char *name, zconfig_t *parent);
649
+
650
+ // Destroy a config item and all its children
651
+ void
652
+ zconfig_destroy (zconfig_t **self_p);
653
+
654
+ // Load a config tree from a specified ZPL text file; returns a zconfig_t
655
+ // reference for the root, if the file exists and is readable. Returns NULL
656
+ // if the file does not exist.
657
+ zconfig_t *
658
+ zconfig_load (const char *filename);
659
+
660
+ // Equivalent to zconfig_load, taking a format string instead of a fixed
661
+ // filename.
662
+ zconfig_t *
663
+ zconfig_loadf (const char *format, ...);
664
+
665
+ // Return name of config item
666
+ char *
667
+ zconfig_name (zconfig_t *self);
668
+
669
+ // Return value of config item
670
+ char *
671
+ zconfig_value (zconfig_t *self);
672
+
673
+ // Insert or update configuration key with value
674
+ void
675
+ zconfig_put (zconfig_t *self, const char *path, const char *value);
676
+
677
+ // Equivalent to zconfig_put, accepting a format specifier and variable
678
+ // argument list, instead of a single string value.
679
+ void
680
+ zconfig_putf (zconfig_t *self, const char *path, const char *format, ...);
681
+
682
+ // Get value for config item into a string value; leading slash is optional
683
+ // and ignored.
684
+ char *
685
+ zconfig_get (zconfig_t *self, const char *path, const char *default_value);
686
+
687
+ // Set config item name, name may be NULL
688
+ void
689
+ zconfig_set_name (zconfig_t *self, const char *name);
690
+
691
+ // Set new value for config item. The new value may be a string, a printf
692
+ // format, or NULL. Note that if string may possibly contain '%', or if it
693
+ // comes from an insecure source, you must use '%s' as the format, followed
694
+ // by the string.
695
+ void
696
+ zconfig_set_value (zconfig_t *self, const char *format, ...);
697
+
698
+ // Find our first child, if any
699
+ zconfig_t *
700
+ zconfig_child (zconfig_t *self);
701
+
702
+ // Find our first sibling, if any
703
+ zconfig_t *
704
+ zconfig_next (zconfig_t *self);
705
+
706
+ // Find a config item along a path; leading slash is optional and ignored.
707
+ zconfig_t *
708
+ zconfig_locate (zconfig_t *self, const char *path);
709
+
710
+ // Locate the last config item at a specified depth
711
+ zconfig_t *
712
+ zconfig_at_depth (zconfig_t *self, int level);
713
+
714
+ // Execute a callback for each config item in the tree; returns zero if
715
+ // successful, else -1.
716
+ int
717
+ zconfig_execute (zconfig_t *self, zconfig_fct handler, void *arg);
718
+
719
+ // Add comment to config item before saving to disk. You can add as many
720
+ // comment lines as you like. If you use a null format, all comments are
721
+ // deleted.
722
+ void
723
+ zconfig_set_comment (zconfig_t *self, const char *format, ...);
724
+
725
+ // Return comments of config item, as zlist.
726
+ zlist_t *
727
+ zconfig_comments (zconfig_t *self);
728
+
729
+ // Save a config tree to a specified ZPL text file, where a filename
730
+ // "-" means dump to standard output.
731
+ int
732
+ zconfig_save (zconfig_t *self, const char *filename);
733
+
734
+ // Equivalent to zconfig_save, taking a format string instead of a fixed
735
+ // filename.
736
+ int
737
+ zconfig_savef (zconfig_t *self, const char *format, ...);
738
+
739
+ // Report filename used during zconfig_load, or NULL if none
740
+ const char *
741
+ zconfig_filename (zconfig_t *self);
742
+
743
+ // Reload config tree from same file that it was previously loaded from.
744
+ // Returns 0 if OK, -1 if there was an error (and then does not change
745
+ // existing data).
746
+ int
747
+ zconfig_reload (zconfig_t **self_p);
748
+
749
+ // Load a config tree from a memory chunk
750
+ zconfig_t *
751
+ zconfig_chunk_load (zchunk_t *chunk);
752
+
753
+ // Save a config tree to a new memory chunk
754
+ zchunk_t *
755
+ zconfig_chunk_save (zconfig_t *self);
756
+
757
+ // Load a config tree from a null-terminated string
758
+ zconfig_t *
759
+ zconfig_str_load (const char *string);
760
+
761
+ // Save a config tree to a new null terminated string
762
+ char *
763
+ zconfig_str_save (zconfig_t *self);
764
+
765
+ // Return true if a configuration tree was loaded from a file and that
766
+ // file has changed in since the tree was loaded.
767
+ bool
768
+ zconfig_has_changed (zconfig_t *self);
769
+
770
+ // Destroy subtree (all children)
771
+ void
772
+ zconfig_remove_subtree (zconfig_t *self);
773
+
774
+ // Destroy node and subtree (all children)
775
+ void
776
+ zconfig_remove (zconfig_t **self_p);
777
+
778
+ // Print the config file to open stream
779
+ void
780
+ zconfig_fprint (zconfig_t *self, FILE *file);
781
+
782
+ // Print properties of object
783
+ void
784
+ zconfig_print (zconfig_t *self);
785
+
786
+ // Self test of this class
787
+ void
788
+ zconfig_test (bool verbose);
789
+
790
+ // CLASS: zdigest
791
+ // Constructor - creates new digest object, which you use to build up a
792
+ // digest by repeatedly calling zdigest_update() on chunks of data.
793
+ zdigest_t *
794
+ zdigest_new (void);
795
+
796
+ // Destroy a digest object
797
+ void
798
+ zdigest_destroy (zdigest_t **self_p);
799
+
800
+ // Add buffer into digest calculation
801
+ void
802
+ zdigest_update (zdigest_t *self, const byte *buffer, size_t length);
803
+
804
+ // Return final digest hash data. If built without crypto support,
805
+ // returns NULL.
806
+ const byte *
807
+ zdigest_data (zdigest_t *self);
808
+
809
+ // Return final digest hash size
810
+ size_t
811
+ zdigest_size (zdigest_t *self);
812
+
813
+ // Return digest as printable hex string; caller should not modify nor
814
+ // free this string. After calling this, you may not use zdigest_update()
815
+ // on the same digest. If built without crypto support, returns NULL.
816
+ char *
817
+ zdigest_string (zdigest_t *self);
818
+
819
+ // Self test of this class.
820
+ void
821
+ zdigest_test (bool verbose);
822
+
823
+ // CLASS: zdir
824
+ // Create a new directory item that loads in the full tree of the specified
825
+ // path, optionally located under some parent path. If parent is "-", then
826
+ // loads only the top-level directory, and does not use parent as a path.
827
+ zdir_t *
828
+ zdir_new (const char *path, const char *parent);
829
+
830
+ // Destroy a directory tree and all children it contains.
831
+ void
832
+ zdir_destroy (zdir_t **self_p);
833
+
834
+ // Return directory path
835
+ const char *
836
+ zdir_path (zdir_t *self);
837
+
838
+ // Return last modification time for directory.
839
+ time_t
840
+ zdir_modified (zdir_t *self);
841
+
842
+ // Return total hierarchy size, in bytes of data contained in all files
843
+ // in the directory tree.
844
+ off_t
845
+ zdir_cursize (zdir_t *self);
846
+
847
+ // Return directory count
848
+ size_t
849
+ zdir_count (zdir_t *self);
850
+
851
+ // Returns a sorted list of zfile objects; Each entry in the list is a pointer
852
+ // to a zfile_t item already allocated in the zdir tree. Do not destroy the
853
+ // original zdir tree until you are done with this list.
854
+ zlist_t *
855
+ zdir_list (zdir_t *self);
856
+
857
+ // Remove directory, optionally including all files that it contains, at
858
+ // all levels. If force is false, will only remove the directory if empty.
859
+ // If force is true, will remove all files and all subdirectories.
860
+ void
861
+ zdir_remove (zdir_t *self, bool force);
862
+
863
+ // Calculate differences between two versions of a directory tree.
864
+ // Returns a list of zdir_patch_t patches. Either older or newer may
865
+ // be null, indicating the directory is empty/absent. If alias is set,
866
+ // generates virtual filename (minus path, plus alias).
867
+ zlist_t *
868
+ zdir_diff (zdir_t *older, zdir_t *newer, const char *alias);
869
+
870
+ // Return full contents of directory as a zdir_patch list.
871
+ zlist_t *
872
+ zdir_resync (zdir_t *self, const char *alias);
873
+
874
+ // Load directory cache; returns a hash table containing the SHA-1 digests
875
+ // of every file in the tree. The cache is saved between runs in .cache.
876
+ zhash_t *
877
+ zdir_cache (zdir_t *self);
878
+
879
+ // Print contents of directory to open stream
880
+ void
881
+ zdir_fprint (zdir_t *self, FILE *file, int indent);
882
+
883
+ // Print contents of directory to stdout
884
+ void
885
+ zdir_print (zdir_t *self, int indent);
886
+
887
+ // Create a new zdir_watch actor instance:
888
+ //
889
+ // zactor_t *watch = zactor_new (zdir_watch, NULL);
890
+ //
891
+ // Destroy zdir_watch instance:
892
+ //
893
+ // zactor_destroy (&watch);
894
+ //
895
+ // Enable verbose logging of commands and activity:
896
+ //
897
+ // zstr_send (watch, "VERBOSE");
898
+ //
899
+ // Subscribe to changes to a directory path:
900
+ //
901
+ // zsock_send (watch, "ss", "SUBSCRIBE", "directory_path");
902
+ //
903
+ // Unsubscribe from changes to a directory path:
904
+ //
905
+ // zsock_send (watch, "ss", "UNSUBSCRIBE", "directory_path");
906
+ //
907
+ // Receive directory changes:
908
+ // zsock_recv (watch, "sp", &path, &patches);
909
+ //
910
+ // // Delete the received data.
911
+ // free (path);
912
+ // zlist_destroy (&patches);
913
+ void
914
+ zdir_watch (zsock_t *pipe, void *unused);
915
+
916
+ // Self test of this class.
917
+ void
918
+ zdir_test (bool verbose);
919
+
920
+ // CLASS: zdir_patch
921
+ // Create new patch
922
+ zdir_patch_t *
923
+ zdir_patch_new (const char *path, zfile_t *file, int op, const char *alias);
924
+
925
+ // Destroy a patch
926
+ void
927
+ zdir_patch_destroy (zdir_patch_t **self_p);
928
+
929
+ // Create copy of a patch. If the patch is null, or memory was exhausted,
930
+ // returns null.
931
+ zdir_patch_t *
932
+ zdir_patch_dup (zdir_patch_t *self);
933
+
934
+ // Return patch file directory path
935
+ const char *
936
+ zdir_patch_path (zdir_patch_t *self);
937
+
938
+ // Return patch file item
939
+ zfile_t *
940
+ zdir_patch_file (zdir_patch_t *self);
941
+
942
+ // Return operation
943
+ int
944
+ zdir_patch_op (zdir_patch_t *self);
945
+
946
+ // Return patch virtual file path
947
+ const char *
948
+ zdir_patch_vpath (zdir_patch_t *self);
949
+
950
+ // Calculate hash digest for file (create only)
951
+ void
952
+ zdir_patch_digest_set (zdir_patch_t *self);
953
+
954
+ // Return hash digest for patch file
955
+ const char *
956
+ zdir_patch_digest (zdir_patch_t *self);
957
+
958
+ // Self test of this class.
959
+ void
960
+ zdir_patch_test (bool verbose);
961
+
962
+ // CLASS: zfile
963
+ // If file exists, populates properties. CZMQ supports portable symbolic
964
+ // links, which are files with the extension ".ln". A symbolic link is a
965
+ // text file containing one line, the filename of a target file. Reading
966
+ // data from the symbolic link actually reads from the target file. Path
967
+ // may be NULL, in which case it is not used.
968
+ zfile_t *
969
+ zfile_new (const char *path, const char *name);
970
+
971
+ // Create new temporary file for writing via tmpfile. File is automaticaly
972
+ // deleted on destroy
973
+ zfile_t *
974
+ zfile_tmp (void);
975
+
976
+ // Destroy a file item
977
+ void
978
+ zfile_destroy (zfile_t **self_p);
979
+
980
+ // Duplicate a file item, returns a newly constructed item. If the file
981
+ // is null, or memory was exhausted, returns null.
982
+ zfile_t *
983
+ zfile_dup (zfile_t *self);
984
+
985
+ // Return file name, remove path if provided
986
+ const char *
987
+ zfile_filename (zfile_t *self, const char *path);
988
+
989
+ // Refresh file properties from disk; this is not done automatically
990
+ // on access methods, otherwise it is not possible to compare directory
991
+ // snapshots.
992
+ void
993
+ zfile_restat (zfile_t *self);
994
+
995
+ // Return when the file was last modified. If you want this to reflect the
996
+ // current situation, call zfile_restat before checking this property.
997
+ time_t
998
+ zfile_modified (zfile_t *self);
999
+
1000
+ // Return the last-known size of the file. If you want this to reflect the
1001
+ // current situation, call zfile_restat before checking this property.
1002
+ off_t
1003
+ zfile_cursize (zfile_t *self);
1004
+
1005
+ // Return true if the file is a directory. If you want this to reflect
1006
+ // any external changes, call zfile_restat before checking this property.
1007
+ bool
1008
+ zfile_is_directory (zfile_t *self);
1009
+
1010
+ // Return true if the file is a regular file. If you want this to reflect
1011
+ // any external changes, call zfile_restat before checking this property.
1012
+ bool
1013
+ zfile_is_regular (zfile_t *self);
1014
+
1015
+ // Return true if the file is readable by this process. If you want this to
1016
+ // reflect any external changes, call zfile_restat before checking this
1017
+ // property.
1018
+ bool
1019
+ zfile_is_readable (zfile_t *self);
1020
+
1021
+ // Return true if the file is writeable by this process. If you want this
1022
+ // to reflect any external changes, call zfile_restat before checking this
1023
+ // property.
1024
+ bool
1025
+ zfile_is_writeable (zfile_t *self);
1026
+
1027
+ // Check if file has stopped changing and can be safely processed.
1028
+ // Updates the file statistics from disk at every call.
1029
+ bool
1030
+ zfile_is_stable (zfile_t *self);
1031
+
1032
+ // Return true if the file was changed on disk since the zfile_t object
1033
+ // was created, or the last zfile_restat() call made on it.
1034
+ bool
1035
+ zfile_has_changed (zfile_t *self);
1036
+
1037
+ // Remove the file from disk
1038
+ void
1039
+ zfile_remove (zfile_t *self);
1040
+
1041
+ // Open file for reading
1042
+ // Returns 0 if OK, -1 if not found or not accessible
1043
+ int
1044
+ zfile_input (zfile_t *self);
1045
+
1046
+ // Open file for writing, creating directory if needed
1047
+ // File is created if necessary; chunks can be written to file at any
1048
+ // location. Returns 0 if OK, -1 if error.
1049
+ int
1050
+ zfile_output (zfile_t *self);
1051
+
1052
+ // Read chunk from file at specified position. If this was the last chunk,
1053
+ // sets the eof property. Returns a null chunk in case of error.
1054
+ zchunk_t *
1055
+ zfile_read (zfile_t *self, size_t bytes, off_t offset);
1056
+
1057
+ // Returns true if zfile_read() just read the last chunk in the file.
1058
+ bool
1059
+ zfile_eof (zfile_t *self);
1060
+
1061
+ // Write chunk to file at specified position
1062
+ // Return 0 if OK, else -1
1063
+ int
1064
+ zfile_write (zfile_t *self, zchunk_t *chunk, off_t offset);
1065
+
1066
+ // Read next line of text from file. Returns a pointer to the text line,
1067
+ // or NULL if there was nothing more to read from the file.
1068
+ const char *
1069
+ zfile_readln (zfile_t *self);
1070
+
1071
+ // Close file, if open
1072
+ void
1073
+ zfile_close (zfile_t *self);
1074
+
1075
+ // Return file handle, if opened
1076
+ FILE *
1077
+ zfile_handle (zfile_t *self);
1078
+
1079
+ // Calculate SHA1 digest for file, using zdigest class.
1080
+ const char *
1081
+ zfile_digest (zfile_t *self);
1082
+
1083
+ // Self test of this class.
1084
+ void
1085
+ zfile_test (bool verbose);
1086
+
1087
+ // CLASS: zframe
1088
+ // Create a new frame. If size is not null, allocates the frame data
1089
+ // to the specified size. If additionally, data is not null, copies
1090
+ // size octets from the specified data into the frame body.
1091
+ zframe_t *
1092
+ zframe_new (const void *data, size_t size);
1093
+
1094
+ // Destroy a frame
1095
+ void
1096
+ zframe_destroy (zframe_t **self_p);
1097
+
1098
+ // Create an empty (zero-sized) frame
1099
+ zframe_t *
1100
+ zframe_new_empty (void);
1101
+
1102
+ // Create a frame with a specified string content.
1103
+ zframe_t *
1104
+ zframe_from (const char *string);
1105
+
1106
+ // Receive frame from socket, returns zframe_t object or NULL if the recv
1107
+ // was interrupted. Does a blocking recv, if you want to not block then use
1108
+ // zpoller or zloop.
1109
+ zframe_t *
1110
+ zframe_recv (void *source);
1111
+
1112
+ // Send a frame to a socket, destroy frame after sending.
1113
+ // Return -1 on error, 0 on success.
1114
+ int
1115
+ zframe_send (zframe_t **self_p, void *dest, int flags);
1116
+
1117
+ // Return number of bytes in frame data
1118
+ size_t
1119
+ zframe_size (zframe_t *self);
1120
+
1121
+ // Return address of frame data
1122
+ byte *
1123
+ zframe_data (zframe_t *self);
1124
+
1125
+ // Return meta data property for frame
1126
+ // The caller shall not modify or free the returned value, which shall be
1127
+ // owned by the message.
1128
+ const char *
1129
+ zframe_meta (zframe_t *self, const char *property);
1130
+
1131
+ // Create a new frame that duplicates an existing frame. If frame is null,
1132
+ // or memory was exhausted, returns null.
1133
+ zframe_t *
1134
+ zframe_dup (zframe_t *self);
1135
+
1136
+ // Return frame data encoded as printable hex string, useful for 0MQ UUIDs.
1137
+ // Caller must free string when finished with it.
1138
+ char *
1139
+ zframe_strhex (zframe_t *self);
1140
+
1141
+ // Return frame data copied into freshly allocated string
1142
+ // Caller must free string when finished with it.
1143
+ char *
1144
+ zframe_strdup (zframe_t *self);
1145
+
1146
+ // Return TRUE if frame body is equal to string, excluding terminator
1147
+ bool
1148
+ zframe_streq (zframe_t *self, const char *string);
1149
+
1150
+ // Return frame MORE indicator (1 or 0), set when reading frame from socket
1151
+ // or by the zframe_set_more() method
1152
+ int
1153
+ zframe_more (zframe_t *self);
1154
+
1155
+ // Set frame MORE indicator (1 or 0). Note this is NOT used when sending
1156
+ // frame to socket, you have to specify flag explicitly.
1157
+ void
1158
+ zframe_set_more (zframe_t *self, int more);
1159
+
1160
+ // Return frame routing ID, if the frame came from a ZMQ_SERVER socket.
1161
+ // Else returns zero.
1162
+ uint32_t
1163
+ zframe_routing_id (zframe_t *self);
1164
+
1165
+ // Set routing ID on frame. This is used if/when the frame is sent to a
1166
+ // ZMQ_SERVER socket.
1167
+ void
1168
+ zframe_set_routing_id (zframe_t *self, uint32_t routing_id);
1169
+
1170
+ // Return frame group of radio-dish pattern.
1171
+ const char *
1172
+ zframe_group (zframe_t *self);
1173
+
1174
+ // Set group on frame. This is used if/when the frame is sent to a
1175
+ // ZMQ_RADIO socket.
1176
+ // Return -1 on error, 0 on success.
1177
+ int
1178
+ zframe_set_group (zframe_t *self, const char *group);
1179
+
1180
+ // Return TRUE if two frames have identical size and data
1181
+ // If either frame is NULL, equality is always false.
1182
+ bool
1183
+ zframe_eq (zframe_t *self, zframe_t *other);
1184
+
1185
+ // Set new contents for frame
1186
+ void
1187
+ zframe_reset (zframe_t *self, const void *data, size_t size);
1188
+
1189
+ // Send message to zsys log sink (may be stdout, or system facility as
1190
+ // configured by zsys_set_logstream). Prefix shows before frame, if not null.
1191
+ void
1192
+ zframe_print (zframe_t *self, const char *prefix);
1193
+
1194
+ // Probe the supplied object, and report if it looks like a zframe_t.
1195
+ bool
1196
+ zframe_is (void *self);
1197
+
1198
+ // Self test of this class.
1199
+ void
1200
+ zframe_test (bool verbose);
1201
+
1202
+ // CLASS: zhash
1203
+ // Create a new, empty hash container
1204
+ zhash_t *
1205
+ zhash_new (void);
1206
+
1207
+ // Destroy a hash container and all items in it
1208
+ void
1209
+ zhash_destroy (zhash_t **self_p);
1210
+
1211
+ // Unpack binary frame into a new hash table. Packed data must follow format
1212
+ // defined by zhash_pack. Hash table is set to autofree. An empty frame
1213
+ // unpacks to an empty hash table.
1214
+ zhash_t *
1215
+ zhash_unpack (zframe_t *frame);
1216
+
1217
+ // Insert item into hash table with specified key and item.
1218
+ // If key is already present returns -1 and leaves existing item unchanged
1219
+ // Returns 0 on success.
1220
+ int
1221
+ zhash_insert (zhash_t *self, const char *key, void *item);
1222
+
1223
+ // Update item into hash table with specified key and item.
1224
+ // If key is already present, destroys old item and inserts new one.
1225
+ // Use free_fn method to ensure deallocator is properly called on item.
1226
+ void
1227
+ zhash_update (zhash_t *self, const char *key, void *item);
1228
+
1229
+ // Remove an item specified by key from the hash table. If there was no such
1230
+ // item, this function does nothing.
1231
+ void
1232
+ zhash_delete (zhash_t *self, const char *key);
1233
+
1234
+ // Return the item at the specified key, or null
1235
+ void *
1236
+ zhash_lookup (zhash_t *self, const char *key);
1237
+
1238
+ // Reindexes an item from an old key to a new key. If there was no such
1239
+ // item, does nothing. Returns 0 if successful, else -1.
1240
+ int
1241
+ zhash_rename (zhash_t *self, const char *old_key, const char *new_key);
1242
+
1243
+ // Set a free function for the specified hash table item. When the item is
1244
+ // destroyed, the free function, if any, is called on that item.
1245
+ // Use this when hash items are dynamically allocated, to ensure that
1246
+ // you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
1247
+ // Returns the item, or NULL if there is no such item.
1248
+ void *
1249
+ zhash_freefn (zhash_t *self, const char *key, zhash_free_fn free_fn);
1250
+
1251
+ // Return the number of keys/items in the hash table
1252
+ size_t
1253
+ zhash_size (zhash_t *self);
1254
+
1255
+ // Make copy of hash table; if supplied table is null, returns null.
1256
+ // Does not copy items themselves. Rebuilds new table so may be slow on
1257
+ // very large tables. NOTE: only works with item values that are strings
1258
+ // since there's no other way to know how to duplicate the item value.
1259
+ zhash_t *
1260
+ zhash_dup (zhash_t *self);
1261
+
1262
+ // Return keys for items in table
1263
+ zlist_t *
1264
+ zhash_keys (zhash_t *self);
1265
+
1266
+ // Simple iterator; returns first item in hash table, in no given order,
1267
+ // or NULL if the table is empty. This method is simpler to use than the
1268
+ // foreach() method, which is deprecated. To access the key for this item
1269
+ // use zhash_cursor(). NOTE: do NOT modify the table while iterating.
1270
+ void *
1271
+ zhash_first (zhash_t *self);
1272
+
1273
+ // Simple iterator; returns next item in hash table, in no given order,
1274
+ // or NULL if the last item was already returned. Use this together with
1275
+ // zhash_first() to process all items in a hash table. If you need the
1276
+ // items in sorted order, use zhash_keys() and then zlist_sort(). To
1277
+ // access the key for this item use zhash_cursor(). NOTE: do NOT modify
1278
+ // the table while iterating.
1279
+ void *
1280
+ zhash_next (zhash_t *self);
1281
+
1282
+ // After a successful first/next method, returns the key for the item that
1283
+ // was returned. This is a constant string that you may not modify or
1284
+ // deallocate, and which lasts as long as the item in the hash. After an
1285
+ // unsuccessful first/next, returns NULL.
1286
+ const char *
1287
+ zhash_cursor (zhash_t *self);
1288
+
1289
+ // Add a comment to hash table before saving to disk. You can add as many
1290
+ // comment lines as you like. These comment lines are discarded when loading
1291
+ // the file. If you use a null format, all comments are deleted.
1292
+ void
1293
+ zhash_comment (zhash_t *self, const char *format, ...);
1294
+
1295
+ // Serialize hash table to a binary frame that can be sent in a message.
1296
+ // The packed format is compatible with the 'dictionary' type defined in
1297
+ // http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
1298
+ //
1299
+ // ; A list of name/value pairs
1300
+ // dictionary = dict-count *( dict-name dict-value )
1301
+ // dict-count = number-4
1302
+ // dict-value = longstr
1303
+ // dict-name = string
1304
+ //
1305
+ // ; Strings are always length + text contents
1306
+ // longstr = number-4 *VCHAR
1307
+ // string = number-1 *VCHAR
1308
+ //
1309
+ // ; Numbers are unsigned integers in network byte order
1310
+ // number-1 = 1OCTET
1311
+ // number-4 = 4OCTET
1312
+ //
1313
+ // Comments are not included in the packed data. Item values MUST be
1314
+ // strings.
1315
+ zframe_t *
1316
+ zhash_pack (zhash_t *self);
1317
+
1318
+ // Save hash table to a text file in name=value format. Hash values must be
1319
+ // printable strings; keys may not contain '=' character. Returns 0 if OK,
1320
+ // else -1 if a file error occurred.
1321
+ int
1322
+ zhash_save (zhash_t *self, const char *filename);
1323
+
1324
+ // Load hash table from a text file in name=value format; hash table must
1325
+ // already exist. Hash values must printable strings; keys may not contain
1326
+ // '=' character. Returns 0 if OK, else -1 if a file was not readable.
1327
+ int
1328
+ zhash_load (zhash_t *self, const char *filename);
1329
+
1330
+ // When a hash table was loaded from a file by zhash_load, this method will
1331
+ // reload the file if it has been modified since, and is "stable", i.e. not
1332
+ // still changing. Returns 0 if OK, -1 if there was an error reloading the
1333
+ // file.
1334
+ int
1335
+ zhash_refresh (zhash_t *self);
1336
+
1337
+ // Set hash for automatic value destruction. Note that this assumes that
1338
+ // values are NULL-terminated strings. Do not use with different types.
1339
+ void
1340
+ zhash_autofree (zhash_t *self);
1341
+
1342
+ // Self test of this class.
1343
+ void
1344
+ zhash_test (bool verbose);
1345
+
1346
+ // CLASS: zhashx
1347
+ // Create a new, empty hash container
1348
+ zhashx_t *
1349
+ zhashx_new (void);
1350
+
1351
+ // Destroy a hash container and all items in it
1352
+ void
1353
+ zhashx_destroy (zhashx_t **self_p);
1354
+
1355
+ // Unpack binary frame into a new hash table. Packed data must follow format
1356
+ // defined by zhashx_pack. Hash table is set to autofree. An empty frame
1357
+ // unpacks to an empty hash table.
1358
+ zhashx_t *
1359
+ zhashx_unpack (zframe_t *frame);
1360
+
1361
+ // Same as unpack but uses a user-defined deserializer function to convert
1362
+ // a longstr back into item format.
1363
+ zhashx_t *
1364
+ zhashx_unpack_own (zframe_t *frame, zhashx_deserializer_fn deserializer);
1365
+
1366
+ // Insert item into hash table with specified key and item.
1367
+ // If key is already present returns -1 and leaves existing item unchanged
1368
+ // Returns 0 on success.
1369
+ int
1370
+ zhashx_insert (zhashx_t *self, const void *key, void *item);
1371
+
1372
+ // Update or insert item into hash table with specified key and item. If the
1373
+ // key is already present, destroys old item and inserts new one. If you set
1374
+ // a container item destructor, this is called on the old value. If the key
1375
+ // was not already present, inserts a new item. Sets the hash cursor to the
1376
+ // new item.
1377
+ void
1378
+ zhashx_update (zhashx_t *self, const void *key, void *item);
1379
+
1380
+ // Remove an item specified by key from the hash table. If there was no such
1381
+ // item, this function does nothing.
1382
+ void
1383
+ zhashx_delete (zhashx_t *self, const void *key);
1384
+
1385
+ // Delete all items from the hash table. If the key destructor is
1386
+ // set, calls it on every key. If the item destructor is set, calls
1387
+ // it on every item.
1388
+ void
1389
+ zhashx_purge (zhashx_t *self);
1390
+
1391
+ // Return the item at the specified key, or null
1392
+ void *
1393
+ zhashx_lookup (zhashx_t *self, const void *key);
1394
+
1395
+ // Reindexes an item from an old key to a new key. If there was no such
1396
+ // item, does nothing. Returns 0 if successful, else -1.
1397
+ int
1398
+ zhashx_rename (zhashx_t *self, const void *old_key, const void *new_key);
1399
+
1400
+ // Set a free function for the specified hash table item. When the item is
1401
+ // destroyed, the free function, if any, is called on that item.
1402
+ // Use this when hash items are dynamically allocated, to ensure that
1403
+ // you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
1404
+ // Returns the item, or NULL if there is no such item.
1405
+ void *
1406
+ zhashx_freefn (zhashx_t *self, const void *key, zhashx_free_fn free_fn);
1407
+
1408
+ // Return the number of keys/items in the hash table
1409
+ size_t
1410
+ zhashx_size (zhashx_t *self);
1411
+
1412
+ // Return a zlistx_t containing the keys for the items in the
1413
+ // table. Uses the key_duplicator to duplicate all keys and sets the
1414
+ // key_destructor as destructor for the list.
1415
+ zlistx_t *
1416
+ zhashx_keys (zhashx_t *self);
1417
+
1418
+ // Return a zlistx_t containing the values for the items in the
1419
+ // table. Uses the duplicator to duplicate all items and sets the
1420
+ // destructor as destructor for the list.
1421
+ zlistx_t *
1422
+ zhashx_values (zhashx_t *self);
1423
+
1424
+ // Simple iterator; returns first item in hash table, in no given order,
1425
+ // or NULL if the table is empty. This method is simpler to use than the
1426
+ // foreach() method, which is deprecated. To access the key for this item
1427
+ // use zhashx_cursor(). NOTE: do NOT modify the table while iterating.
1428
+ void *
1429
+ zhashx_first (zhashx_t *self);
1430
+
1431
+ // Simple iterator; returns next item in hash table, in no given order,
1432
+ // or NULL if the last item was already returned. Use this together with
1433
+ // zhashx_first() to process all items in a hash table. If you need the
1434
+ // items in sorted order, use zhashx_keys() and then zlistx_sort(). To
1435
+ // access the key for this item use zhashx_cursor(). NOTE: do NOT modify
1436
+ // the table while iterating.
1437
+ void *
1438
+ zhashx_next (zhashx_t *self);
1439
+
1440
+ // After a successful first/next method, returns the key for the item that
1441
+ // was returned. This is a constant string that you may not modify or
1442
+ // deallocate, and which lasts as long as the item in the hash. After an
1443
+ // unsuccessful first/next, returns NULL.
1444
+ const void *
1445
+ zhashx_cursor (zhashx_t *self);
1446
+
1447
+ // Add a comment to hash table before saving to disk. You can add as many
1448
+ // comment lines as you like. These comment lines are discarded when loading
1449
+ // the file. If you use a null format, all comments are deleted.
1450
+ void
1451
+ zhashx_comment (zhashx_t *self, const char *format, ...);
1452
+
1453
+ // Save hash table to a text file in name=value format. Hash values must be
1454
+ // printable strings; keys may not contain '=' character. Returns 0 if OK,
1455
+ // else -1 if a file error occurred.
1456
+ int
1457
+ zhashx_save (zhashx_t *self, const char *filename);
1458
+
1459
+ // Load hash table from a text file in name=value format; hash table must
1460
+ // already exist. Hash values must printable strings; keys may not contain
1461
+ // '=' character. Returns 0 if OK, else -1 if a file was not readable.
1462
+ int
1463
+ zhashx_load (zhashx_t *self, const char *filename);
1464
+
1465
+ // When a hash table was loaded from a file by zhashx_load, this method will
1466
+ // reload the file if it has been modified since, and is "stable", i.e. not
1467
+ // still changing. Returns 0 if OK, -1 if there was an error reloading the
1468
+ // file.
1469
+ int
1470
+ zhashx_refresh (zhashx_t *self);
1471
+
1472
+ // Serialize hash table to a binary frame that can be sent in a message.
1473
+ // The packed format is compatible with the 'dictionary' type defined in
1474
+ // http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
1475
+ //
1476
+ // ; A list of name/value pairs
1477
+ // dictionary = dict-count *( dict-name dict-value )
1478
+ // dict-count = number-4
1479
+ // dict-value = longstr
1480
+ // dict-name = string
1481
+ //
1482
+ // ; Strings are always length + text contents
1483
+ // longstr = number-4 *VCHAR
1484
+ // string = number-1 *VCHAR
1485
+ //
1486
+ // ; Numbers are unsigned integers in network byte order
1487
+ // number-1 = 1OCTET
1488
+ // number-4 = 4OCTET
1489
+ //
1490
+ // Comments are not included in the packed data. Item values MUST be
1491
+ // strings.
1492
+ zframe_t *
1493
+ zhashx_pack (zhashx_t *self);
1494
+
1495
+ // Same as pack but uses a user-defined serializer function to convert items
1496
+ // into longstr.
1497
+ zframe_t *
1498
+ zhashx_pack_own (zhashx_t *self, zhashx_serializer_fn serializer);
1499
+
1500
+ // Make a copy of the list; items are duplicated if you set a duplicator
1501
+ // for the list, otherwise not. Copying a null reference returns a null
1502
+ // reference. Note that this method's behavior changed slightly for CZMQ
1503
+ // v3.x, as it does not set nor respect autofree. It does however let you
1504
+ // duplicate any hash table safely. The old behavior is in zhashx_dup_v2.
1505
+ zhashx_t *
1506
+ zhashx_dup (zhashx_t *self);
1507
+
1508
+ // Set a user-defined deallocator for hash items; by default items are not
1509
+ // freed when the hash is destroyed.
1510
+ void
1511
+ zhashx_set_destructor (zhashx_t *self, zhashx_destructor_fn destructor);
1512
+
1513
+ // Set a user-defined duplicator for hash items; by default items are not
1514
+ // copied when the hash is duplicated.
1515
+ void
1516
+ zhashx_set_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator);
1517
+
1518
+ // Set a user-defined deallocator for keys; by default keys are freed
1519
+ // when the hash is destroyed using free().
1520
+ void
1521
+ zhashx_set_key_destructor (zhashx_t *self, zhashx_destructor_fn destructor);
1522
+
1523
+ // Set a user-defined duplicator for keys; by default keys are duplicated
1524
+ // using strdup.
1525
+ void
1526
+ zhashx_set_key_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator);
1527
+
1528
+ // Set a user-defined comparator for keys; by default keys are
1529
+ // compared using strcmp.
1530
+ // The callback function should return zero (0) on matching
1531
+ // items.
1532
+ void
1533
+ zhashx_set_key_comparator (zhashx_t *self, zhashx_comparator_fn comparator);
1534
+
1535
+ // Set a user-defined hash function for keys; by default keys are
1536
+ // hashed by a modified Bernstein hashing function.
1537
+ void
1538
+ zhashx_set_key_hasher (zhashx_t *self, zhashx_hash_fn hasher);
1539
+
1540
+ // Make copy of hash table; if supplied table is null, returns null.
1541
+ // Does not copy items themselves. Rebuilds new table so may be slow on
1542
+ // very large tables. NOTE: only works with item values that are strings
1543
+ // since there's no other way to know how to duplicate the item value.
1544
+ zhashx_t *
1545
+ zhashx_dup_v2 (zhashx_t *self);
1546
+
1547
+ // Self test of this class.
1548
+ void
1549
+ zhashx_test (bool verbose);
1550
+
1551
+ // CLASS: ziflist
1552
+ // Get a list of network interfaces currently defined on the system
1553
+ ziflist_t *
1554
+ ziflist_new (void);
1555
+
1556
+ // Destroy a ziflist instance
1557
+ void
1558
+ ziflist_destroy (ziflist_t **self_p);
1559
+
1560
+ // Reload network interfaces from system
1561
+ void
1562
+ ziflist_reload (ziflist_t *self);
1563
+
1564
+ // Return the number of network interfaces on system
1565
+ size_t
1566
+ ziflist_size (ziflist_t *self);
1567
+
1568
+ // Get first network interface, return NULL if there are none
1569
+ const char *
1570
+ ziflist_first (ziflist_t *self);
1571
+
1572
+ // Get next network interface, return NULL if we hit the last one
1573
+ const char *
1574
+ ziflist_next (ziflist_t *self);
1575
+
1576
+ // Return the current interface IP address as a printable string
1577
+ const char *
1578
+ ziflist_address (ziflist_t *self);
1579
+
1580
+ // Return the current interface broadcast address as a printable string
1581
+ const char *
1582
+ ziflist_broadcast (ziflist_t *self);
1583
+
1584
+ // Return the current interface network mask as a printable string
1585
+ const char *
1586
+ ziflist_netmask (ziflist_t *self);
1587
+
1588
+ // Return the list of interfaces.
1589
+ void
1590
+ ziflist_print (ziflist_t *self);
1591
+
1592
+ // Get a list of network interfaces currently defined on the system
1593
+ // Includes IPv6 interfaces
1594
+ ziflist_t *
1595
+ ziflist_new_ipv6 (void);
1596
+
1597
+ // Reload network interfaces from system, including IPv6
1598
+ void
1599
+ ziflist_reload_ipv6 (ziflist_t *self);
1600
+
1601
+ // Return true if the current interface uses IPv6
1602
+ bool
1603
+ ziflist_is_ipv6 (ziflist_t *self);
1604
+
1605
+ // Self test of this class.
1606
+ void
1607
+ ziflist_test (bool verbose);
1608
+
1609
+ // CLASS: zlist
1610
+ // Create a new list container
1611
+ zlist_t *
1612
+ zlist_new (void);
1613
+
1614
+ // Destroy a list container
1615
+ void
1616
+ zlist_destroy (zlist_t **self_p);
1617
+
1618
+ // Return the item at the head of list. If the list is empty, returns NULL.
1619
+ // Leaves cursor pointing at the head item, or NULL if the list is empty.
1620
+ void *
1621
+ zlist_first (zlist_t *self);
1622
+
1623
+ // Return the next item. If the list is empty, returns NULL. To move to
1624
+ // the start of the list call zlist_first (). Advances the cursor.
1625
+ void *
1626
+ zlist_next (zlist_t *self);
1627
+
1628
+ // Return the item at the tail of list. If the list is empty, returns NULL.
1629
+ // Leaves cursor pointing at the tail item, or NULL if the list is empty.
1630
+ void *
1631
+ zlist_last (zlist_t *self);
1632
+
1633
+ // Return first item in the list, or null, leaves the cursor
1634
+ void *
1635
+ zlist_head (zlist_t *self);
1636
+
1637
+ // Return last item in the list, or null, leaves the cursor
1638
+ void *
1639
+ zlist_tail (zlist_t *self);
1640
+
1641
+ // Return the current item of list. If the list is empty, returns NULL.
1642
+ // Leaves cursor pointing at the current item, or NULL if the list is empty.
1643
+ void *
1644
+ zlist_item (zlist_t *self);
1645
+
1646
+ // Append an item to the end of the list, return 0 if OK or -1 if this
1647
+ // failed for some reason (out of memory). Note that if a duplicator has
1648
+ // been set, this method will also duplicate the item.
1649
+ int
1650
+ zlist_append (zlist_t *self, void *item);
1651
+
1652
+ // Push an item to the start of the list, return 0 if OK or -1 if this
1653
+ // failed for some reason (out of memory). Note that if a duplicator has
1654
+ // been set, this method will also duplicate the item.
1655
+ int
1656
+ zlist_push (zlist_t *self, void *item);
1657
+
1658
+ // Pop the item off the start of the list, if any
1659
+ void *
1660
+ zlist_pop (zlist_t *self);
1661
+
1662
+ // Checks if an item already is present. Uses compare method to determine if
1663
+ // items are equal. If the compare method is NULL the check will only compare
1664
+ // pointers. Returns true if item is present else false.
1665
+ bool
1666
+ zlist_exists (zlist_t *self, void *item);
1667
+
1668
+ // Remove the specified item from the list if present
1669
+ void
1670
+ zlist_remove (zlist_t *self, void *item);
1671
+
1672
+ // Make a copy of list. If the list has autofree set, the copied list will
1673
+ // duplicate all items, which must be strings. Otherwise, the list will hold
1674
+ // pointers back to the items in the original list. If list is null, returns
1675
+ // NULL.
1676
+ zlist_t *
1677
+ zlist_dup (zlist_t *self);
1678
+
1679
+ // Purge all items from list
1680
+ void
1681
+ zlist_purge (zlist_t *self);
1682
+
1683
+ // Return number of items in the list
1684
+ size_t
1685
+ zlist_size (zlist_t *self);
1686
+
1687
+ // Sort the list. If the compare function is null, sorts the list by
1688
+ // ascending key value using a straight ASCII comparison. If you specify
1689
+ // a compare function, this decides how items are sorted. The sort is not
1690
+ // stable, so may reorder items with the same keys. The algorithm used is
1691
+ // combsort, a compromise between performance and simplicity.
1692
+ void
1693
+ zlist_sort (zlist_t *self, zlist_compare_fn compare);
1694
+
1695
+ // Set list for automatic item destruction; item values MUST be strings.
1696
+ // By default a list item refers to a value held elsewhere. When you set
1697
+ // this, each time you append or push a list item, zlist will take a copy
1698
+ // of the string value. Then, when you destroy the list, it will free all
1699
+ // item values automatically. If you use any other technique to allocate
1700
+ // list values, you must free them explicitly before destroying the list.
1701
+ // The usual technique is to pop list items and destroy them, until the
1702
+ // list is empty.
1703
+ void
1704
+ zlist_autofree (zlist_t *self);
1705
+
1706
+ // Sets a compare function for this list. The function compares two items.
1707
+ // It returns an integer less than, equal to, or greater than zero if the
1708
+ // first item is found, respectively, to be less than, to match, or be
1709
+ // greater than the second item.
1710
+ // This function is used for sorting, removal and exists checking.
1711
+ void
1712
+ zlist_comparefn (zlist_t *self, zlist_compare_fn fn);
1713
+
1714
+ // Set a free function for the specified list item. When the item is
1715
+ // destroyed, the free function, if any, is called on that item.
1716
+ // Use this when list items are dynamically allocated, to ensure that
1717
+ // you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
1718
+ // Returns the item, or NULL if there is no such item.
1719
+ void *
1720
+ zlist_freefn (zlist_t *self, void *item, zlist_free_fn fn, bool at_tail);
1721
+
1722
+ // Self test of this class.
1723
+ void
1724
+ zlist_test (bool verbose);
1725
+
1726
+ // CLASS: zlistx
1727
+ // Create a new, empty list.
1728
+ zlistx_t *
1729
+ zlistx_new (void);
1730
+
1731
+ // Destroy a list. If an item destructor was specified, all items in the
1732
+ // list are automatically destroyed as well.
1733
+ void
1734
+ zlistx_destroy (zlistx_t **self_p);
1735
+
1736
+ // Add an item to the head of the list. Calls the item duplicator, if any,
1737
+ // on the item. Resets cursor to list head. Returns an item handle on
1738
+ // success, NULL if memory was exhausted.
1739
+ void *
1740
+ zlistx_add_start (zlistx_t *self, void *item);
1741
+
1742
+ // Add an item to the tail of the list. Calls the item duplicator, if any,
1743
+ // on the item. Resets cursor to list head. Returns an item handle on
1744
+ // success, NULL if memory was exhausted.
1745
+ void *
1746
+ zlistx_add_end (zlistx_t *self, void *item);
1747
+
1748
+ // Return the number of items in the list
1749
+ size_t
1750
+ zlistx_size (zlistx_t *self);
1751
+
1752
+ // Return first item in the list, or null, leaves the cursor
1753
+ void *
1754
+ zlistx_head (zlistx_t *self);
1755
+
1756
+ // Return last item in the list, or null, leaves the cursor
1757
+ void *
1758
+ zlistx_tail (zlistx_t *self);
1759
+
1760
+ // Return the item at the head of list. If the list is empty, returns NULL.
1761
+ // Leaves cursor pointing at the head item, or NULL if the list is empty.
1762
+ void *
1763
+ zlistx_first (zlistx_t *self);
1764
+
1765
+ // Return the next item. At the end of the list (or in an empty list),
1766
+ // returns NULL. Use repeated zlistx_next () calls to work through the list
1767
+ // from zlistx_first (). First time, acts as zlistx_first().
1768
+ void *
1769
+ zlistx_next (zlistx_t *self);
1770
+
1771
+ // Return the previous item. At the start of the list (or in an empty list),
1772
+ // returns NULL. Use repeated zlistx_prev () calls to work through the list
1773
+ // backwards from zlistx_last (). First time, acts as zlistx_last().
1774
+ void *
1775
+ zlistx_prev (zlistx_t *self);
1776
+
1777
+ // Return the item at the tail of list. If the list is empty, returns NULL.
1778
+ // Leaves cursor pointing at the tail item, or NULL if the list is empty.
1779
+ void *
1780
+ zlistx_last (zlistx_t *self);
1781
+
1782
+ // Returns the value of the item at the cursor, or NULL if the cursor is
1783
+ // not pointing to an item.
1784
+ void *
1785
+ zlistx_item (zlistx_t *self);
1786
+
1787
+ // Returns the handle of the item at the cursor, or NULL if the cursor is
1788
+ // not pointing to an item.
1789
+ void *
1790
+ zlistx_cursor (zlistx_t *self);
1791
+
1792
+ // Returns the item associated with the given list handle, or NULL if passed
1793
+ // in handle is NULL. Asserts that the passed in handle points to a list element.
1794
+ void *
1795
+ zlistx_handle_item (void *handle);
1796
+
1797
+ // Find an item in the list, searching from the start. Uses the item
1798
+ // comparator, if any, else compares item values directly. Returns the
1799
+ // item handle found, or NULL. Sets the cursor to the found item, if any.
1800
+ void *
1801
+ zlistx_find (zlistx_t *self, void *item);
1802
+
1803
+ // Detach an item from the list, using its handle. The item is not modified,
1804
+ // and the caller is responsible for destroying it if necessary. If handle is
1805
+ // null, detaches the first item on the list. Returns item that was detached,
1806
+ // or null if none was. If cursor was at item, moves cursor to previous item,
1807
+ // so you can detach items while iterating forwards through a list.
1808
+ void *
1809
+ zlistx_detach (zlistx_t *self, void *handle);
1810
+
1811
+ // Detach item at the cursor, if any, from the list. The item is not modified,
1812
+ // and the caller is responsible for destroying it as necessary. Returns item
1813
+ // that was detached, or null if none was. Moves cursor to previous item, so
1814
+ // you can detach items while iterating forwards through a list.
1815
+ void *
1816
+ zlistx_detach_cur (zlistx_t *self);
1817
+
1818
+ // Delete an item, using its handle. Calls the item destructor is any is
1819
+ // set. If handle is null, deletes the first item on the list. Returns 0
1820
+ // if an item was deleted, -1 if not. If cursor was at item, moves cursor
1821
+ // to previous item, so you can delete items while iterating forwards
1822
+ // through a list.
1823
+ int
1824
+ zlistx_delete (zlistx_t *self, void *handle);
1825
+
1826
+ // Move an item to the start of the list, via its handle.
1827
+ void
1828
+ zlistx_move_start (zlistx_t *self, void *handle);
1829
+
1830
+ // Move an item to the end of the list, via its handle.
1831
+ void
1832
+ zlistx_move_end (zlistx_t *self, void *handle);
1833
+
1834
+ // Remove all items from the list, and destroy them if the item destructor
1835
+ // is set.
1836
+ void
1837
+ zlistx_purge (zlistx_t *self);
1838
+
1839
+ // Sort the list. If an item comparator was set, calls that to compare
1840
+ // items, otherwise compares on item value. The sort is not stable, so may
1841
+ // reorder equal items.
1842
+ void
1843
+ zlistx_sort (zlistx_t *self);
1844
+
1845
+ // Create a new node and insert it into a sorted list. Calls the item
1846
+ // duplicator, if any, on the item. If low_value is true, starts searching
1847
+ // from the start of the list, otherwise searches from the end. Use the item
1848
+ // comparator, if any, to find where to place the new node. Returns a handle
1849
+ // to the new node, or NULL if memory was exhausted. Resets the cursor to the
1850
+ // list head.
1851
+ void *
1852
+ zlistx_insert (zlistx_t *self, void *item, bool low_value);
1853
+
1854
+ // Move an item, specified by handle, into position in a sorted list. Uses
1855
+ // the item comparator, if any, to determine the new location. If low_value
1856
+ // is true, starts searching from the start of the list, otherwise searches
1857
+ // from the end.
1858
+ void
1859
+ zlistx_reorder (zlistx_t *self, void *handle, bool low_value);
1860
+
1861
+ // Make a copy of the list; items are duplicated if you set a duplicator
1862
+ // for the list, otherwise not. Copying a null reference returns a null
1863
+ // reference.
1864
+ zlistx_t *
1865
+ zlistx_dup (zlistx_t *self);
1866
+
1867
+ // Set a user-defined deallocator for list items; by default items are not
1868
+ // freed when the list is destroyed.
1869
+ void
1870
+ zlistx_set_destructor (zlistx_t *self, zlistx_destructor_fn destructor);
1871
+
1872
+ // Set a user-defined duplicator for list items; by default items are not
1873
+ // copied when the list is duplicated.
1874
+ void
1875
+ zlistx_set_duplicator (zlistx_t *self, zlistx_duplicator_fn duplicator);
1876
+
1877
+ // Set a user-defined comparator for zlistx_find and zlistx_sort; the method
1878
+ // must return -1, 0, or 1 depending on whether item1 is less than, equal to,
1879
+ // or greater than, item2.
1880
+ void
1881
+ zlistx_set_comparator (zlistx_t *self, zlistx_comparator_fn comparator);
1882
+
1883
+ // Self test of this class.
1884
+ void
1885
+ zlistx_test (bool verbose);
1886
+
1887
+ // CLASS: zloop
1888
+ // Create a new zloop reactor
1889
+ zloop_t *
1890
+ zloop_new (void);
1891
+
1892
+ // Destroy a reactor
1893
+ void
1894
+ zloop_destroy (zloop_t **self_p);
1895
+
1896
+ // Register socket reader with the reactor. When the reader has messages,
1897
+ // the reactor will call the handler, passing the arg. Returns 0 if OK, -1
1898
+ // if there was an error. If you register the same socket more than once,
1899
+ // each instance will invoke its corresponding handler.
1900
+ int
1901
+ zloop_reader (zloop_t *self, zsock_t *sock, zloop_reader_fn handler, void *arg);
1902
+
1903
+ // Cancel a socket reader from the reactor. If multiple readers exist for
1904
+ // same socket, cancels ALL of them.
1905
+ void
1906
+ zloop_reader_end (zloop_t *self, zsock_t *sock);
1907
+
1908
+ // Configure a registered reader to ignore errors. If you do not set this,
1909
+ // then readers that have errors are removed from the reactor silently.
1910
+ void
1911
+ zloop_reader_set_tolerant (zloop_t *self, zsock_t *sock);
1912
+
1913
+ // Register low-level libzmq pollitem with the reactor. When the pollitem
1914
+ // is ready, will call the handler, passing the arg. Returns 0 if OK, -1
1915
+ // if there was an error. If you register the pollitem more than once, each
1916
+ // instance will invoke its corresponding handler. A pollitem with
1917
+ // socket=NULL and fd=0 means 'poll on FD zero'.
1918
+ int
1919
+ zloop_poller (zloop_t *self, zmq_pollitem_t *item, zloop_fn handler, void *arg);
1920
+
1921
+ // Cancel a pollitem from the reactor, specified by socket or FD. If both
1922
+ // are specified, uses only socket. If multiple poll items exist for same
1923
+ // socket/FD, cancels ALL of them.
1924
+ void
1925
+ zloop_poller_end (zloop_t *self, zmq_pollitem_t *item);
1926
+
1927
+ // Configure a registered poller to ignore errors. If you do not set this,
1928
+ // then poller that have errors are removed from the reactor silently.
1929
+ void
1930
+ zloop_poller_set_tolerant (zloop_t *self, zmq_pollitem_t *item);
1931
+
1932
+ // Register a timer that expires after some delay and repeats some number of
1933
+ // times. At each expiry, will call the handler, passing the arg. To run a
1934
+ // timer forever, use 0 times. Returns a timer_id that is used to cancel the
1935
+ // timer in the future. Returns -1 if there was an error.
1936
+ int
1937
+ zloop_timer (zloop_t *self, size_t delay, size_t times, zloop_timer_fn handler, void *arg);
1938
+
1939
+ // Cancel a specific timer identified by a specific timer_id (as returned by
1940
+ // zloop_timer).
1941
+ int
1942
+ zloop_timer_end (zloop_t *self, int timer_id);
1943
+
1944
+ // Register a ticket timer. Ticket timers are very fast in the case where
1945
+ // you use a lot of timers (thousands), and frequently remove and add them.
1946
+ // The main use case is expiry timers for servers that handle many clients,
1947
+ // and which reset the expiry timer for each message received from a client.
1948
+ // Whereas normal timers perform poorly as the number of clients grows, the
1949
+ // cost of ticket timers is constant, no matter the number of clients. You
1950
+ // must set the ticket delay using zloop_set_ticket_delay before creating a
1951
+ // ticket. Returns a handle to the timer that you should use in
1952
+ // zloop_ticket_reset and zloop_ticket_delete.
1953
+ void *
1954
+ zloop_ticket (zloop_t *self, zloop_timer_fn handler, void *arg);
1955
+
1956
+ // Reset a ticket timer, which moves it to the end of the ticket list and
1957
+ // resets its execution time. This is a very fast operation.
1958
+ void
1959
+ zloop_ticket_reset (zloop_t *self, void *handle);
1960
+
1961
+ // Delete a ticket timer. We do not actually delete the ticket here, as
1962
+ // other code may still refer to the ticket. We mark as deleted, and remove
1963
+ // later and safely.
1964
+ void
1965
+ zloop_ticket_delete (zloop_t *self, void *handle);
1966
+
1967
+ // Set the ticket delay, which applies to all tickets. If you lower the
1968
+ // delay and there are already tickets created, the results are undefined.
1969
+ void
1970
+ zloop_set_ticket_delay (zloop_t *self, size_t ticket_delay);
1971
+
1972
+ // Set hard limit on number of timers allowed. Setting more than a small
1973
+ // number of timers (10-100) can have a dramatic impact on the performance
1974
+ // of the reactor. For high-volume cases, use ticket timers. If the hard
1975
+ // limit is reached, the reactor stops creating new timers and logs an
1976
+ // error.
1977
+ void
1978
+ zloop_set_max_timers (zloop_t *self, size_t max_timers);
1979
+
1980
+ // Set verbose tracing of reactor on/off. The default verbose setting is
1981
+ // off (false).
1982
+ void
1983
+ zloop_set_verbose (zloop_t *self, bool verbose);
1984
+
1985
+ // By default the reactor stops if the process receives a SIGINT or SIGTERM
1986
+ // signal. This makes it impossible to shut-down message based architectures
1987
+ // like zactors. This method lets you switch off break handling. The default
1988
+ // nonstop setting is off (false).
1989
+ void
1990
+ zloop_set_nonstop (zloop_t *self, bool nonstop);
1991
+
1992
+ // Start the reactor. Takes control of the thread and returns when the 0MQ
1993
+ // context is terminated or the process is interrupted, or any event handler
1994
+ // returns -1. Event handlers may register new sockets and timers, and
1995
+ // cancel sockets. Returns 0 if interrupted, -1 if canceled by a handler.
1996
+ int
1997
+ zloop_start (zloop_t *self);
1998
+
1999
+ // Self test of this class.
2000
+ void
2001
+ zloop_test (bool verbose);
2002
+
2003
+ // CLASS: zmsg
2004
+ // Create a new empty message object
2005
+ zmsg_t *
2006
+ zmsg_new (void);
2007
+
2008
+ // Destroy a message object and all frames it contains
2009
+ void
2010
+ zmsg_destroy (zmsg_t **self_p);
2011
+
2012
+ // Receive message from socket, returns zmsg_t object or NULL if the recv
2013
+ // was interrupted. Does a blocking recv. If you want to not block then use
2014
+ // the zloop class or zmsg_recv_nowait or zmq_poll to check for socket input
2015
+ // before receiving.
2016
+ zmsg_t *
2017
+ zmsg_recv (void *source);
2018
+
2019
+ // Load/append an open file into new message, return the message.
2020
+ // Returns NULL if the message could not be loaded.
2021
+ zmsg_t *
2022
+ zmsg_load (FILE *file);
2023
+
2024
+ // Decodes a serialized message frame created by zmsg_encode () and returns
2025
+ // a new zmsg_t object. Returns NULL if the frame was badly formatted or
2026
+ // there was insufficient memory to work.
2027
+ zmsg_t *
2028
+ zmsg_decode (zframe_t *frame);
2029
+
2030
+ // Generate a signal message encoding the given status. A signal is a short
2031
+ // message carrying a 1-byte success/failure code (by convention, 0 means
2032
+ // OK). Signals are encoded to be distinguishable from "normal" messages.
2033
+ zmsg_t *
2034
+ zmsg_new_signal (byte status);
2035
+
2036
+ // Send message to destination socket, and destroy the message after sending
2037
+ // it successfully. If the message has no frames, sends nothing but destroys
2038
+ // the message anyhow. Nullifies the caller's reference to the message (as
2039
+ // it is a destructor).
2040
+ int
2041
+ zmsg_send (zmsg_t **self_p, void *dest);
2042
+
2043
+ // Send message to destination socket as part of a multipart sequence, and
2044
+ // destroy the message after sending it successfully. Note that after a
2045
+ // zmsg_sendm, you must call zmsg_send or another method that sends a final
2046
+ // message part. If the message has no frames, sends nothing but destroys
2047
+ // the message anyhow. Nullifies the caller's reference to the message (as
2048
+ // it is a destructor).
2049
+ int
2050
+ zmsg_sendm (zmsg_t **self_p, void *dest);
2051
+
2052
+ // Return size of message, i.e. number of frames (0 or more).
2053
+ size_t
2054
+ zmsg_size (zmsg_t *self);
2055
+
2056
+ // Return total size of all frames in message.
2057
+ size_t
2058
+ zmsg_content_size (zmsg_t *self);
2059
+
2060
+ // Return message routing ID, if the message came from a ZMQ_SERVER socket.
2061
+ // Else returns zero.
2062
+ uint32_t
2063
+ zmsg_routing_id (zmsg_t *self);
2064
+
2065
+ // Set routing ID on message. This is used if/when the message is sent to a
2066
+ // ZMQ_SERVER socket.
2067
+ void
2068
+ zmsg_set_routing_id (zmsg_t *self, uint32_t routing_id);
2069
+
2070
+ // Push frame to the front of the message, i.e. before all other frames.
2071
+ // Message takes ownership of frame, will destroy it when message is sent.
2072
+ // Returns 0 on success, -1 on error. Deprecates zmsg_push, which did not
2073
+ // nullify the caller's frame reference.
2074
+ int
2075
+ zmsg_prepend (zmsg_t *self, zframe_t **frame_p);
2076
+
2077
+ // Add frame to the end of the message, i.e. after all other frames.
2078
+ // Message takes ownership of frame, will destroy it when message is sent.
2079
+ // Returns 0 on success. Deprecates zmsg_add, which did not nullify the
2080
+ // caller's frame reference.
2081
+ int
2082
+ zmsg_append (zmsg_t *self, zframe_t **frame_p);
2083
+
2084
+ // Remove first frame from message, if any. Returns frame, or NULL.
2085
+ zframe_t *
2086
+ zmsg_pop (zmsg_t *self);
2087
+
2088
+ // Push block of memory to front of message, as a new frame.
2089
+ // Returns 0 on success, -1 on error.
2090
+ int
2091
+ zmsg_pushmem (zmsg_t *self, const void *data, size_t size);
2092
+
2093
+ // Add block of memory to the end of the message, as a new frame.
2094
+ // Returns 0 on success, -1 on error.
2095
+ int
2096
+ zmsg_addmem (zmsg_t *self, const void *data, size_t size);
2097
+
2098
+ // Push string as new frame to front of message.
2099
+ // Returns 0 on success, -1 on error.
2100
+ int
2101
+ zmsg_pushstr (zmsg_t *self, const char *string);
2102
+
2103
+ // Push string as new frame to end of message.
2104
+ // Returns 0 on success, -1 on error.
2105
+ int
2106
+ zmsg_addstr (zmsg_t *self, const char *string);
2107
+
2108
+ // Push formatted string as new frame to front of message.
2109
+ // Returns 0 on success, -1 on error.
2110
+ int
2111
+ zmsg_pushstrf (zmsg_t *self, const char *format, ...);
2112
+
2113
+ // Push formatted string as new frame to end of message.
2114
+ // Returns 0 on success, -1 on error.
2115
+ int
2116
+ zmsg_addstrf (zmsg_t *self, const char *format, ...);
2117
+
2118
+ // Pop frame off front of message, return as fresh string. If there were
2119
+ // no more frames in the message, returns NULL.
2120
+ char *
2121
+ zmsg_popstr (zmsg_t *self);
2122
+
2123
+ // Push encoded message as a new frame. Message takes ownership of
2124
+ // submessage, so the original is destroyed in this call. Returns 0 on
2125
+ // success, -1 on error.
2126
+ int
2127
+ zmsg_addmsg (zmsg_t *self, zmsg_t **msg_p);
2128
+
2129
+ // Remove first submessage from message, if any. Returns zmsg_t, or NULL if
2130
+ // decoding was not successful.
2131
+ zmsg_t *
2132
+ zmsg_popmsg (zmsg_t *self);
2133
+
2134
+ // Remove specified frame from list, if present. Does not destroy frame.
2135
+ void
2136
+ zmsg_remove (zmsg_t *self, zframe_t *frame);
2137
+
2138
+ // Set cursor to first frame in message. Returns frame, or NULL, if the
2139
+ // message is empty. Use this to navigate the frames as a list.
2140
+ zframe_t *
2141
+ zmsg_first (zmsg_t *self);
2142
+
2143
+ // Return the next frame. If there are no more frames, returns NULL. To move
2144
+ // to the first frame call zmsg_first(). Advances the cursor.
2145
+ zframe_t *
2146
+ zmsg_next (zmsg_t *self);
2147
+
2148
+ // Return the last frame. If there are no frames, returns NULL.
2149
+ zframe_t *
2150
+ zmsg_last (zmsg_t *self);
2151
+
2152
+ // Save message to an open file, return 0 if OK, else -1. The message is
2153
+ // saved as a series of frames, each with length and data. Note that the
2154
+ // file is NOT guaranteed to be portable between operating systems, not
2155
+ // versions of CZMQ. The file format is at present undocumented and liable
2156
+ // to arbitrary change.
2157
+ int
2158
+ zmsg_save (zmsg_t *self, FILE *file);
2159
+
2160
+ // Serialize multipart message to a single message frame. Use this method
2161
+ // to send structured messages across transports that do not support
2162
+ // multipart data. Allocates and returns a new frame containing the
2163
+ // serialized message. To decode a serialized message frame, use
2164
+ // zmsg_decode ().
2165
+ zframe_t *
2166
+ zmsg_encode (zmsg_t *self);
2167
+
2168
+ // Create copy of message, as new message object. Returns a fresh zmsg_t
2169
+ // object. If message is null, or memory was exhausted, returns null.
2170
+ zmsg_t *
2171
+ zmsg_dup (zmsg_t *self);
2172
+
2173
+ // Send message to zsys log sink (may be stdout, or system facility as
2174
+ // configured by zsys_set_logstream).
2175
+ void
2176
+ zmsg_print (zmsg_t *self);
2177
+
2178
+ // Return true if the two messages have the same number of frames and each
2179
+ // frame in the first message is identical to the corresponding frame in the
2180
+ // other message. As with zframe_eq, return false if either message is NULL.
2181
+ bool
2182
+ zmsg_eq (zmsg_t *self, zmsg_t *other);
2183
+
2184
+ // Return signal value, 0 or greater, if message is a signal, -1 if not.
2185
+ int
2186
+ zmsg_signal (zmsg_t *self);
2187
+
2188
+ // Probe the supplied object, and report if it looks like a zmsg_t.
2189
+ bool
2190
+ zmsg_is (void *self);
2191
+
2192
+ // Self test of this class.
2193
+ void
2194
+ zmsg_test (bool verbose);
2195
+
2196
+ // CLASS: zpoller
2197
+ // Create new poller, specifying zero or more readers. The list of
2198
+ // readers ends in a NULL. Each reader can be a zsock_t instance, a
2199
+ // zactor_t instance, a libzmq socket (void *), or a file handle.
2200
+ zpoller_t *
2201
+ zpoller_new (void *reader, ...);
2202
+
2203
+ // Destroy a poller
2204
+ void
2205
+ zpoller_destroy (zpoller_t **self_p);
2206
+
2207
+ // Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may
2208
+ // be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.
2209
+ int
2210
+ zpoller_add (zpoller_t *self, void *reader);
2211
+
2212
+ // Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
2213
+ // must have been passed during construction, or in an zpoller_add () call.
2214
+ int
2215
+ zpoller_remove (zpoller_t *self, void *reader);
2216
+
2217
+ // By default the poller stops if the process receives a SIGINT or SIGTERM
2218
+ // signal. This makes it impossible to shut-down message based architectures
2219
+ // like zactors. This method lets you switch off break handling. The default
2220
+ // nonstop setting is off (false).
2221
+ void
2222
+ zpoller_set_nonstop (zpoller_t *self, bool nonstop);
2223
+
2224
+ // Poll the registered readers for I/O, return first reader that has input.
2225
+ // The reader will be a libzmq void * socket, or a zsock_t or zactor_t
2226
+ // instance as specified in zpoller_new/zpoller_add. The timeout should be
2227
+ // zero or greater, or -1 to wait indefinitely. Socket priority is defined
2228
+ // by their order in the poll list. If you need a balanced poll, use the low
2229
+ // level zmq_poll method directly. If the poll call was interrupted (SIGINT),
2230
+ // or the ZMQ context was destroyed, or the timeout expired, returns NULL.
2231
+ // You can test the actual exit condition by calling zpoller_expired () and
2232
+ // zpoller_terminated (). The timeout is in msec.
2233
+ void *
2234
+ zpoller_wait (zpoller_t *self, int timeout);
2235
+
2236
+ // Return true if the last zpoller_wait () call ended because the timeout
2237
+ // expired, without any error.
2238
+ bool
2239
+ zpoller_expired (zpoller_t *self);
2240
+
2241
+ // Return true if the last zpoller_wait () call ended because the process
2242
+ // was interrupted, or the parent context was destroyed.
2243
+ bool
2244
+ zpoller_terminated (zpoller_t *self);
2245
+
2246
+ // Self test of this class.
2247
+ void
2248
+ zpoller_test (bool verbose);
2249
+
2250
+ // CLASS: zproc
2251
+ // Create a new zproc.
2252
+ // NOTE: On Windows and with libzmq3 and libzmq2 this function
2253
+ // returns NULL. Code needs to be ported there.
2254
+ zproc_t *
2255
+ zproc_new (void);
2256
+
2257
+ // Destroy zproc, wait until process ends.
2258
+ void
2259
+ zproc_destroy (zproc_t **self_p);
2260
+
2261
+ // Setup the command line arguments, the first item must be an (absolute) filename
2262
+ // to run.
2263
+ void
2264
+ zproc_set_args (zproc_t *self, zlistx_t *args);
2265
+
2266
+ // Setup the environment variables for the process.
2267
+ void
2268
+ zproc_set_env (zproc_t *self, zhashx_t *args);
2269
+
2270
+ // Connects process stdin with a readable ('>', connect) zeromq socket. If
2271
+ // socket argument is NULL, zproc creates own managed pair of inproc
2272
+ // sockets. The writable one is then accessbile via zproc_stdin method.
2273
+ void
2274
+ zproc_set_stdin (zproc_t *self, void *socket);
2275
+
2276
+ // Connects process stdout with a writable ('@', bind) zeromq socket. If
2277
+ // socket argument is NULL, zproc creates own managed pair of inproc
2278
+ // sockets. The readable one is then accessbile via zproc_stdout method.
2279
+ void
2280
+ zproc_set_stdout (zproc_t *self, void *socket);
2281
+
2282
+ // Connects process stderr with a writable ('@', bind) zeromq socket. If
2283
+ // socket argument is NULL, zproc creates own managed pair of inproc
2284
+ // sockets. The readable one is then accessbile via zproc_stderr method.
2285
+ void
2286
+ zproc_set_stderr (zproc_t *self, void *socket);
2287
+
2288
+ // Return subprocess stdin writable socket. NULL for
2289
+ // not initialized or external sockets.
2290
+ void *
2291
+ zproc_stdin (zproc_t *self);
2292
+
2293
+ // Return subprocess stdout readable socket. NULL for
2294
+ // not initialized or external sockets.
2295
+ void *
2296
+ zproc_stdout (zproc_t *self);
2297
+
2298
+ // Return subprocess stderr readable socket. NULL for
2299
+ // not initialized or external sockets.
2300
+ void *
2301
+ zproc_stderr (zproc_t *self);
2302
+
2303
+ // Starts the process.
2304
+ int
2305
+ zproc_run (zproc_t *self);
2306
+
2307
+ // process exit code
2308
+ int
2309
+ zproc_returncode (zproc_t *self);
2310
+
2311
+ // PID of the process
2312
+ int
2313
+ zproc_pid (zproc_t *self);
2314
+
2315
+ // return true if process is running, false if not yet started or finished
2316
+ bool
2317
+ zproc_running (zproc_t *self);
2318
+
2319
+ // wait or poll process status, return return code
2320
+ int
2321
+ zproc_wait (zproc_t *self, bool hang);
2322
+
2323
+ // return internal actor, usefull for the polling if process died
2324
+ void *
2325
+ zproc_actor (zproc_t *self);
2326
+
2327
+ // send a signal to the subprocess
2328
+ void
2329
+ zproc_kill (zproc_t *self, int signal);
2330
+
2331
+ // set verbose mode
2332
+ void
2333
+ zproc_set_verbose (zproc_t *self, bool verbose);
2334
+
2335
+ // Returns CZMQ version as a single 6-digit integer encoding the major
2336
+ // version (x 10000), the minor version (x 100) and the patch.
2337
+ int
2338
+ zproc_czmq_version (void);
2339
+
2340
+ // Returns true if the process received a SIGINT or SIGTERM signal.
2341
+ // It is good practice to use this method to exit any infinite loop
2342
+ // processing messages.
2343
+ bool
2344
+ zproc_interrupted (void);
2345
+
2346
+ // Returns true if the underlying libzmq supports CURVE security.
2347
+ bool
2348
+ zproc_has_curve (void);
2349
+
2350
+ // Return current host name, for use in public tcp:// endpoints.
2351
+ // If the host name is not resolvable, returns NULL.
2352
+ char *
2353
+ zproc_hostname (void);
2354
+
2355
+ // Move the current process into the background. The precise effect
2356
+ // depends on the operating system. On POSIX boxes, moves to a specified
2357
+ // working directory (if specified), closes all file handles, reopens
2358
+ // stdin, stdout, and stderr to the null device, and sets the process to
2359
+ // ignore SIGHUP. On Windows, does nothing. Returns 0 if OK, -1 if there
2360
+ // was an error.
2361
+ void
2362
+ zproc_daemonize (const char *workdir);
2363
+
2364
+ // Drop the process ID into the lockfile, with exclusive lock, and
2365
+ // switch the process to the specified group and/or user. Any of the
2366
+ // arguments may be null, indicating a no-op. Returns 0 on success,
2367
+ // -1 on failure. Note if you combine this with zsys_daemonize, run
2368
+ // after, not before that method, or the lockfile will hold the wrong
2369
+ // process ID.
2370
+ void
2371
+ zproc_run_as (const char *lockfile, const char *group, const char *user);
2372
+
2373
+ // Configure the number of I/O threads that ZeroMQ will use. A good
2374
+ // rule of thumb is one thread per gigabit of traffic in or out. The
2375
+ // default is 1, sufficient for most applications. If the environment
2376
+ // variable ZSYS_IO_THREADS is defined, that provides the default.
2377
+ // Note that this method is valid only before any socket is created.
2378
+ void
2379
+ zproc_set_io_threads (size_t io_threads);
2380
+
2381
+ // Configure the number of sockets that ZeroMQ will allow. The default
2382
+ // is 1024. The actual limit depends on the system, and you can query it
2383
+ // by using zsys_socket_limit (). A value of zero means "maximum".
2384
+ // Note that this method is valid only before any socket is created.
2385
+ void
2386
+ zproc_set_max_sockets (size_t max_sockets);
2387
+
2388
+ // Set network interface name to use for broadcasts, particularly zbeacon.
2389
+ // This lets the interface be configured for test environments where required.
2390
+ // For example, on Mac OS X, zbeacon cannot bind to 255.255.255.255 which is
2391
+ // the default when there is no specified interface. If the environment
2392
+ // variable ZSYS_INTERFACE is set, use that as the default interface name.
2393
+ // Setting the interface to "*" means "use all available interfaces".
2394
+ void
2395
+ zproc_set_biface (const char *value);
2396
+
2397
+ // Return network interface to use for broadcasts, or "" if none was set.
2398
+ const char *
2399
+ zproc_biface (void);
2400
+
2401
+ // Set log identity, which is a string that prefixes all log messages sent
2402
+ // by this process. The log identity defaults to the environment variable
2403
+ // ZSYS_LOGIDENT, if that is set.
2404
+ void
2405
+ zproc_set_log_ident (const char *value);
2406
+
2407
+ // Sends log output to a PUB socket bound to the specified endpoint. To
2408
+ // collect such log output, create a SUB socket, subscribe to the traffic
2409
+ // you care about, and connect to the endpoint. Log traffic is sent as a
2410
+ // single string frame, in the same format as when sent to stdout. The
2411
+ // log system supports a single sender; multiple calls to this method will
2412
+ // bind the same sender to multiple endpoints. To disable the sender, call
2413
+ // this method with a null argument.
2414
+ void
2415
+ zproc_set_log_sender (const char *endpoint);
2416
+
2417
+ // Enable or disable logging to the system facility (syslog on POSIX boxes,
2418
+ // event log on Windows). By default this is disabled.
2419
+ void
2420
+ zproc_set_log_system (bool logsystem);
2421
+
2422
+ // Log error condition - highest priority
2423
+ void
2424
+ zproc_log_error (const char *format, ...);
2425
+
2426
+ // Log warning condition - high priority
2427
+ void
2428
+ zproc_log_warning (const char *format, ...);
2429
+
2430
+ // Log normal, but significant, condition - normal priority
2431
+ void
2432
+ zproc_log_notice (const char *format, ...);
2433
+
2434
+ // Log informational message - low priority
2435
+ void
2436
+ zproc_log_info (const char *format, ...);
2437
+
2438
+ // Log debug-level message - lowest priority
2439
+ void
2440
+ zproc_log_debug (const char *format, ...);
2441
+
2442
+ // Self test of this class.
2443
+ void
2444
+ zproc_test (bool verbose);
2445
+
2446
+ // CLASS: zsock
2447
+ // Create a new socket. Returns the new socket, or NULL if the new socket
2448
+ // could not be created. Note that the symbol zsock_new (and other
2449
+ // constructors/destructors for zsock) are redirected to the *_checked
2450
+ // variant, enabling intelligent socket leak detection. This can have
2451
+ // performance implications if you use a LOT of sockets. To turn off this
2452
+ // redirection behaviour, define ZSOCK_NOCHECK.
2453
+ zsock_t *
2454
+ zsock_new (int type);
2455
+
2456
+ // Destroy the socket. You must use this for any socket created via the
2457
+ // zsock_new method.
2458
+ void
2459
+ zsock_destroy (zsock_t **self_p);
2460
+
2461
+ // Create a PUB socket. Default action is bind.
2462
+ zsock_t *
2463
+ zsock_new_pub (const char *endpoint);
2464
+
2465
+ // Create a SUB socket, and optionally subscribe to some prefix string. Default
2466
+ // action is connect.
2467
+ zsock_t *
2468
+ zsock_new_sub (const char *endpoint, const char *subscribe);
2469
+
2470
+ // Create a REQ socket. Default action is connect.
2471
+ zsock_t *
2472
+ zsock_new_req (const char *endpoint);
2473
+
2474
+ // Create a REP socket. Default action is bind.
2475
+ zsock_t *
2476
+ zsock_new_rep (const char *endpoint);
2477
+
2478
+ // Create a DEALER socket. Default action is connect.
2479
+ zsock_t *
2480
+ zsock_new_dealer (const char *endpoint);
2481
+
2482
+ // Create a ROUTER socket. Default action is bind.
2483
+ zsock_t *
2484
+ zsock_new_router (const char *endpoint);
2485
+
2486
+ // Create a PUSH socket. Default action is connect.
2487
+ zsock_t *
2488
+ zsock_new_push (const char *endpoint);
2489
+
2490
+ // Create a PULL socket. Default action is bind.
2491
+ zsock_t *
2492
+ zsock_new_pull (const char *endpoint);
2493
+
2494
+ // Create an XPUB socket. Default action is bind.
2495
+ zsock_t *
2496
+ zsock_new_xpub (const char *endpoint);
2497
+
2498
+ // Create an XSUB socket. Default action is connect.
2499
+ zsock_t *
2500
+ zsock_new_xsub (const char *endpoint);
2501
+
2502
+ // Create a PAIR socket. Default action is connect.
2503
+ zsock_t *
2504
+ zsock_new_pair (const char *endpoint);
2505
+
2506
+ // Create a STREAM socket. Default action is connect.
2507
+ zsock_t *
2508
+ zsock_new_stream (const char *endpoint);
2509
+
2510
+ // Create a SERVER socket. Default action is bind.
2511
+ zsock_t *
2512
+ zsock_new_server (const char *endpoint);
2513
+
2514
+ // Create a CLIENT socket. Default action is connect.
2515
+ zsock_t *
2516
+ zsock_new_client (const char *endpoint);
2517
+
2518
+ // Create a RADIO socket. Default action is bind.
2519
+ zsock_t *
2520
+ zsock_new_radio (const char *endpoint);
2521
+
2522
+ // Create a DISH socket. Default action is connect.
2523
+ zsock_t *
2524
+ zsock_new_dish (const char *endpoint);
2525
+
2526
+ // Create a GATHER socket. Default action is bind.
2527
+ zsock_t *
2528
+ zsock_new_gather (const char *endpoint);
2529
+
2530
+ // Create a SCATTER socket. Default action is connect.
2531
+ zsock_t *
2532
+ zsock_new_scatter (const char *endpoint);
2533
+
2534
+ // Bind a socket to a formatted endpoint. For tcp:// endpoints, supports
2535
+ // ephemeral ports, if you specify the port number as "*". By default
2536
+ // zsock uses the IANA designated range from C000 (49152) to FFFF (65535).
2537
+ // To override this range, follow the "*" with "[first-last]". Either or
2538
+ // both first and last may be empty. To bind to a random port within the
2539
+ // range, use "!" in place of "*".
2540
+ //
2541
+ // Examples:
2542
+ // tcp://127.0.0.1:* bind to first free port from C000 up
2543
+ // tcp://127.0.0.1:! bind to random port from C000 to FFFF
2544
+ // tcp://127.0.0.1:*[60000-] bind to first free port from 60000 up
2545
+ // tcp://127.0.0.1:![-60000] bind to random port from C000 to 60000
2546
+ // tcp://127.0.0.1:![55000-55999]
2547
+ // bind to random port from 55000 to 55999
2548
+ //
2549
+ // On success, returns the actual port number used, for tcp:// endpoints,
2550
+ // and 0 for other transports. On failure, returns -1. Note that when using
2551
+ // ephemeral ports, a port may be reused by different services without
2552
+ // clients being aware. Protocols that run on ephemeral ports should take
2553
+ // this into account.
2554
+ int
2555
+ zsock_bind (zsock_t *self, const char *format, ...);
2556
+
2557
+ // Returns last bound endpoint, if any.
2558
+ const char *
2559
+ zsock_endpoint (zsock_t *self);
2560
+
2561
+ // Unbind a socket from a formatted endpoint.
2562
+ // Returns 0 if OK, -1 if the endpoint was invalid or the function
2563
+ // isn't supported.
2564
+ int
2565
+ zsock_unbind (zsock_t *self, const char *format, ...);
2566
+
2567
+ // Connect a socket to a formatted endpoint
2568
+ // Returns 0 if OK, -1 if the endpoint was invalid.
2569
+ int
2570
+ zsock_connect (zsock_t *self, const char *format, ...);
2571
+
2572
+ // Disconnect a socket from a formatted endpoint
2573
+ // Returns 0 if OK, -1 if the endpoint was invalid or the function
2574
+ // isn't supported.
2575
+ int
2576
+ zsock_disconnect (zsock_t *self, const char *format, ...);
2577
+
2578
+ // Attach a socket to zero or more endpoints. If endpoints is not null,
2579
+ // parses as list of ZeroMQ endpoints, separated by commas, and prefixed by
2580
+ // '@' (to bind the socket) or '>' (to connect the socket). Returns 0 if all
2581
+ // endpoints were valid, or -1 if there was a syntax error. If the endpoint
2582
+ // does not start with '@' or '>', the serverish argument defines whether
2583
+ // it is used to bind (serverish = true) or connect (serverish = false).
2584
+ int
2585
+ zsock_attach (zsock_t *self, const char *endpoints, bool serverish);
2586
+
2587
+ // Returns socket type as printable constant string.
2588
+ const char *
2589
+ zsock_type_str (zsock_t *self);
2590
+
2591
+ // Send a 'picture' message to the socket (or actor). The picture is a
2592
+ // string that defines the type of each frame. This makes it easy to send
2593
+ // a complex multiframe message in one call. The picture can contain any
2594
+ // of these characters, each corresponding to one or two arguments:
2595
+ //
2596
+ // i = int (signed)
2597
+ // 1 = uint8_t
2598
+ // 2 = uint16_t
2599
+ // 4 = uint32_t
2600
+ // 8 = uint64_t
2601
+ // s = char *
2602
+ // b = byte *, size_t (2 arguments)
2603
+ // c = zchunk_t *
2604
+ // f = zframe_t *
2605
+ // h = zhashx_t *
2606
+ // U = zuuid_t *
2607
+ // p = void * (sends the pointer value, only meaningful over inproc)
2608
+ // m = zmsg_t * (sends all frames in the zmsg)
2609
+ // z = sends zero-sized frame (0 arguments)
2610
+ // u = uint (deprecated)
2611
+ //
2612
+ // Note that s, b, c, and f are encoded the same way and the choice is
2613
+ // offered as a convenience to the sender, which may or may not already
2614
+ // have data in a zchunk or zframe. Does not change or take ownership of
2615
+ // any arguments. Returns 0 if successful, -1 if sending failed for any
2616
+ // reason.
2617
+ int
2618
+ zsock_send (void *self, const char *picture, ...);
2619
+
2620
+ // Send a 'picture' message to the socket (or actor). This is a va_list
2621
+ // version of zsock_send (), so please consult its documentation for the
2622
+ // details.
2623
+ int
2624
+ zsock_vsend (void *self, const char *picture, va_list argptr);
2625
+
2626
+ // Receive a 'picture' message to the socket (or actor). See zsock_send for
2627
+ // the format and meaning of the picture. Returns the picture elements into
2628
+ // a series of pointers as provided by the caller:
2629
+ //
2630
+ // i = int * (stores signed integer)
2631
+ // 4 = uint32_t * (stores 32-bit unsigned integer)
2632
+ // 8 = uint64_t * (stores 64-bit unsigned integer)
2633
+ // s = char ** (allocates new string)
2634
+ // b = byte **, size_t * (2 arguments) (allocates memory)
2635
+ // c = zchunk_t ** (creates zchunk)
2636
+ // f = zframe_t ** (creates zframe)
2637
+ // U = zuuid_t * (creates a zuuid with the data)
2638
+ // h = zhashx_t ** (creates zhashx)
2639
+ // p = void ** (stores pointer)
2640
+ // m = zmsg_t ** (creates a zmsg with the remaing frames)
2641
+ // z = null, asserts empty frame (0 arguments)
2642
+ // u = uint * (stores unsigned integer, deprecated)
2643
+ //
2644
+ // Note that zsock_recv creates the returned objects, and the caller must
2645
+ // destroy them when finished with them. The supplied pointers do not need
2646
+ // to be initialized. Returns 0 if successful, or -1 if it failed to recv
2647
+ // a message, in which case the pointers are not modified. When message
2648
+ // frames are truncated (a short message), sets return values to zero/null.
2649
+ // If an argument pointer is NULL, does not store any value (skips it).
2650
+ // An 'n' picture matches an empty frame; if the message does not match,
2651
+ // the method will return -1.
2652
+ int
2653
+ zsock_recv (void *self, const char *picture, ...);
2654
+
2655
+ // Receive a 'picture' message from the socket (or actor). This is a
2656
+ // va_list version of zsock_recv (), so please consult its documentation
2657
+ // for the details.
2658
+ int
2659
+ zsock_vrecv (void *self, const char *picture, va_list argptr);
2660
+
2661
+ // Send a binary encoded 'picture' message to the socket (or actor). This
2662
+ // method is similar to zsock_send, except the arguments are encoded in a
2663
+ // binary format that is compatible with zproto, and is designed to reduce
2664
+ // memory allocations. The pattern argument is a string that defines the
2665
+ // type of each argument. Supports these argument types:
2666
+ //
2667
+ // pattern C type zproto type:
2668
+ // 1 uint8_t type = "number" size = "1"
2669
+ // 2 uint16_t type = "number" size = "2"
2670
+ // 4 uint32_t type = "number" size = "3"
2671
+ // 8 uint64_t type = "number" size = "4"
2672
+ // s char *, 0-255 chars type = "string"
2673
+ // S char *, 0-2^32-1 chars type = "longstr"
2674
+ // c zchunk_t * type = "chunk"
2675
+ // f zframe_t * type = "frame"
2676
+ // u zuuid_t * type = "uuid"
2677
+ // m zmsg_t * type = "msg"
2678
+ // p void *, sends pointer value, only over inproc
2679
+ //
2680
+ // Does not change or take ownership of any arguments. Returns 0 if
2681
+ // successful, -1 if sending failed for any reason.
2682
+ int
2683
+ zsock_bsend (void *self, const char *picture, ...);
2684
+
2685
+ // Receive a binary encoded 'picture' message from the socket (or actor).
2686
+ // This method is similar to zsock_recv, except the arguments are encoded
2687
+ // in a binary format that is compatible with zproto, and is designed to
2688
+ // reduce memory allocations. The pattern argument is a string that defines
2689
+ // the type of each argument. See zsock_bsend for the supported argument
2690
+ // types. All arguments must be pointers; this call sets them to point to
2691
+ // values held on a per-socket basis.
2692
+ // For types 1, 2, 4 and 8 the caller must allocate the memory itself before
2693
+ // calling zsock_brecv.
2694
+ // For types S, the caller must free the value once finished with it, as
2695
+ // zsock_brecv will allocate the buffer.
2696
+ // For type s, the caller must not free the value as it is stored in a
2697
+ // local cache for performance purposes.
2698
+ // For types c, f, u and m the caller must call the appropriate destructor
2699
+ // depending on the object as zsock_brecv will create new objects.
2700
+ // For type p the caller must coordinate with the sender, as it is just a
2701
+ // pointer value being passed.
2702
+ int
2703
+ zsock_brecv (void *self, const char *picture, ...);
2704
+
2705
+ // Return socket routing ID if any. This returns 0 if the socket is not
2706
+ // of type ZMQ_SERVER or if no request was already received on it.
2707
+ uint32_t
2708
+ zsock_routing_id (zsock_t *self);
2709
+
2710
+ // Set routing ID on socket. The socket MUST be of type ZMQ_SERVER.
2711
+ // This will be used when sending messages on the socket via the zsock API.
2712
+ void
2713
+ zsock_set_routing_id (zsock_t *self, uint32_t routing_id);
2714
+
2715
+ // Set socket to use unbounded pipes (HWM=0); use this in cases when you are
2716
+ // totally certain the message volume can fit in memory. This method works
2717
+ // across all versions of ZeroMQ. Takes a polymorphic socket reference.
2718
+ void
2719
+ zsock_set_unbounded (void *self);
2720
+
2721
+ // Send a signal over a socket. A signal is a short message carrying a
2722
+ // success/failure code (by convention, 0 means OK). Signals are encoded
2723
+ // to be distinguishable from "normal" messages. Accepts a zsock_t or a
2724
+ // zactor_t argument, and returns 0 if successful, -1 if the signal could
2725
+ // not be sent. Takes a polymorphic socket reference.
2726
+ int
2727
+ zsock_signal (void *self, byte status);
2728
+
2729
+ // Wait on a signal. Use this to coordinate between threads, over pipe
2730
+ // pairs. Blocks until the signal is received. Returns -1 on error, 0 or
2731
+ // greater on success. Accepts a zsock_t or a zactor_t as argument.
2732
+ // Takes a polymorphic socket reference.
2733
+ int
2734
+ zsock_wait (void *self);
2735
+
2736
+ // If there is a partial message still waiting on the socket, remove and
2737
+ // discard it. This is useful when reading partial messages, to get specific
2738
+ // message types.
2739
+ void
2740
+ zsock_flush (void *self);
2741
+
2742
+ // Join a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.
2743
+ // Returns 0 if OK, -1 if failed.
2744
+ int
2745
+ zsock_join (void *self, const char *group);
2746
+
2747
+ // Leave a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.
2748
+ // Returns 0 if OK, -1 if failed.
2749
+ int
2750
+ zsock_leave (void *self, const char *group);
2751
+
2752
+ // Probe the supplied object, and report if it looks like a zsock_t.
2753
+ // Takes a polymorphic socket reference.
2754
+ bool
2755
+ zsock_is (void *self);
2756
+
2757
+ // Probe the supplied reference. If it looks like a zsock_t instance, return
2758
+ // the underlying libzmq socket handle; else if it looks like a file
2759
+ // descriptor, return NULL; else if it looks like a libzmq socket handle,
2760
+ // return the supplied value. Takes a polymorphic socket reference.
2761
+ void *
2762
+ zsock_resolve (void *self);
2763
+
2764
+ // Get socket option `heartbeat_ivl`.
2765
+ // Available from libzmq 4.2.0.
2766
+ int
2767
+ zsock_heartbeat_ivl (void *self);
2768
+
2769
+ // Set socket option `heartbeat_ivl`.
2770
+ // Available from libzmq 4.2.0.
2771
+ void
2772
+ zsock_set_heartbeat_ivl (void *self, int heartbeat_ivl);
2773
+
2774
+ // Get socket option `heartbeat_ttl`.
2775
+ // Available from libzmq 4.2.0.
2776
+ int
2777
+ zsock_heartbeat_ttl (void *self);
2778
+
2779
+ // Set socket option `heartbeat_ttl`.
2780
+ // Available from libzmq 4.2.0.
2781
+ void
2782
+ zsock_set_heartbeat_ttl (void *self, int heartbeat_ttl);
2783
+
2784
+ // Get socket option `heartbeat_timeout`.
2785
+ // Available from libzmq 4.2.0.
2786
+ int
2787
+ zsock_heartbeat_timeout (void *self);
2788
+
2789
+ // Set socket option `heartbeat_timeout`.
2790
+ // Available from libzmq 4.2.0.
2791
+ void
2792
+ zsock_set_heartbeat_timeout (void *self, int heartbeat_timeout);
2793
+
2794
+ // Get socket option `use_fd`.
2795
+ // Available from libzmq 4.2.0.
2796
+ int
2797
+ zsock_use_fd (void *self);
2798
+
2799
+ // Set socket option `use_fd`.
2800
+ // Available from libzmq 4.2.0.
2801
+ void
2802
+ zsock_set_use_fd (void *self, int use_fd);
2803
+
2804
+ // Set socket option `xpub_manual`.
2805
+ // Available from libzmq 4.2.0.
2806
+ void
2807
+ zsock_set_xpub_manual (void *self, int xpub_manual);
2808
+
2809
+ // Set socket option `xpub_welcome_msg`.
2810
+ // Available from libzmq 4.2.0.
2811
+ void
2812
+ zsock_set_xpub_welcome_msg (void *self, const char *xpub_welcome_msg);
2813
+
2814
+ // Set socket option `stream_notify`.
2815
+ // Available from libzmq 4.2.0.
2816
+ void
2817
+ zsock_set_stream_notify (void *self, int stream_notify);
2818
+
2819
+ // Get socket option `invert_matching`.
2820
+ // Available from libzmq 4.2.0.
2821
+ int
2822
+ zsock_invert_matching (void *self);
2823
+
2824
+ // Set socket option `invert_matching`.
2825
+ // Available from libzmq 4.2.0.
2826
+ void
2827
+ zsock_set_invert_matching (void *self, int invert_matching);
2828
+
2829
+ // Set socket option `xpub_verboser`.
2830
+ // Available from libzmq 4.2.0.
2831
+ void
2832
+ zsock_set_xpub_verboser (void *self, int xpub_verboser);
2833
+
2834
+ // Get socket option `connect_timeout`.
2835
+ // Available from libzmq 4.2.0.
2836
+ int
2837
+ zsock_connect_timeout (void *self);
2838
+
2839
+ // Set socket option `connect_timeout`.
2840
+ // Available from libzmq 4.2.0.
2841
+ void
2842
+ zsock_set_connect_timeout (void *self, int connect_timeout);
2843
+
2844
+ // Get socket option `tcp_maxrt`.
2845
+ // Available from libzmq 4.2.0.
2846
+ int
2847
+ zsock_tcp_maxrt (void *self);
2848
+
2849
+ // Set socket option `tcp_maxrt`.
2850
+ // Available from libzmq 4.2.0.
2851
+ void
2852
+ zsock_set_tcp_maxrt (void *self, int tcp_maxrt);
2853
+
2854
+ // Get socket option `thread_safe`.
2855
+ // Available from libzmq 4.2.0.
2856
+ int
2857
+ zsock_thread_safe (void *self);
2858
+
2859
+ // Get socket option `multicast_maxtpdu`.
2860
+ // Available from libzmq 4.2.0.
2861
+ int
2862
+ zsock_multicast_maxtpdu (void *self);
2863
+
2864
+ // Set socket option `multicast_maxtpdu`.
2865
+ // Available from libzmq 4.2.0.
2866
+ void
2867
+ zsock_set_multicast_maxtpdu (void *self, int multicast_maxtpdu);
2868
+
2869
+ // Get socket option `vmci_buffer_size`.
2870
+ // Available from libzmq 4.2.0.
2871
+ int
2872
+ zsock_vmci_buffer_size (void *self);
2873
+
2874
+ // Set socket option `vmci_buffer_size`.
2875
+ // Available from libzmq 4.2.0.
2876
+ void
2877
+ zsock_set_vmci_buffer_size (void *self, int vmci_buffer_size);
2878
+
2879
+ // Get socket option `vmci_buffer_min_size`.
2880
+ // Available from libzmq 4.2.0.
2881
+ int
2882
+ zsock_vmci_buffer_min_size (void *self);
2883
+
2884
+ // Set socket option `vmci_buffer_min_size`.
2885
+ // Available from libzmq 4.2.0.
2886
+ void
2887
+ zsock_set_vmci_buffer_min_size (void *self, int vmci_buffer_min_size);
2888
+
2889
+ // Get socket option `vmci_buffer_max_size`.
2890
+ // Available from libzmq 4.2.0.
2891
+ int
2892
+ zsock_vmci_buffer_max_size (void *self);
2893
+
2894
+ // Set socket option `vmci_buffer_max_size`.
2895
+ // Available from libzmq 4.2.0.
2896
+ void
2897
+ zsock_set_vmci_buffer_max_size (void *self, int vmci_buffer_max_size);
2898
+
2899
+ // Get socket option `vmci_connect_timeout`.
2900
+ // Available from libzmq 4.2.0.
2901
+ int
2902
+ zsock_vmci_connect_timeout (void *self);
2903
+
2904
+ // Set socket option `vmci_connect_timeout`.
2905
+ // Available from libzmq 4.2.0.
2906
+ void
2907
+ zsock_set_vmci_connect_timeout (void *self, int vmci_connect_timeout);
2908
+
2909
+ // Get socket option `tos`.
2910
+ // Available from libzmq 4.1.0.
2911
+ int
2912
+ zsock_tos (void *self);
2913
+
2914
+ // Set socket option `tos`.
2915
+ // Available from libzmq 4.1.0.
2916
+ void
2917
+ zsock_set_tos (void *self, int tos);
2918
+
2919
+ // Set socket option `router_handover`.
2920
+ // Available from libzmq 4.1.0.
2921
+ void
2922
+ zsock_set_router_handover (void *self, int router_handover);
2923
+
2924
+ // Set socket option `connect_rid`.
2925
+ // Available from libzmq 4.1.0.
2926
+ void
2927
+ zsock_set_connect_rid (void *self, const char *connect_rid);
2928
+
2929
+ // Set socket option `connect_rid` from 32-octet binary
2930
+ // Available from libzmq 4.1.0.
2931
+ void
2932
+ zsock_set_connect_rid_bin (void *self, const byte *connect_rid);
2933
+
2934
+ // Get socket option `handshake_ivl`.
2935
+ // Available from libzmq 4.1.0.
2936
+ int
2937
+ zsock_handshake_ivl (void *self);
2938
+
2939
+ // Set socket option `handshake_ivl`.
2940
+ // Available from libzmq 4.1.0.
2941
+ void
2942
+ zsock_set_handshake_ivl (void *self, int handshake_ivl);
2943
+
2944
+ // Get socket option `socks_proxy`.
2945
+ // Available from libzmq 4.1.0.
2946
+ char *
2947
+ zsock_socks_proxy (void *self);
2948
+
2949
+ // Set socket option `socks_proxy`.
2950
+ // Available from libzmq 4.1.0.
2951
+ void
2952
+ zsock_set_socks_proxy (void *self, const char *socks_proxy);
2953
+
2954
+ // Set socket option `xpub_nodrop`.
2955
+ // Available from libzmq 4.1.0.
2956
+ void
2957
+ zsock_set_xpub_nodrop (void *self, int xpub_nodrop);
2958
+
2959
+ // Set socket option `router_mandatory`.
2960
+ // Available from libzmq 4.0.0.
2961
+ void
2962
+ zsock_set_router_mandatory (void *self, int router_mandatory);
2963
+
2964
+ // Set socket option `probe_router`.
2965
+ // Available from libzmq 4.0.0.
2966
+ void
2967
+ zsock_set_probe_router (void *self, int probe_router);
2968
+
2969
+ // Set socket option `req_relaxed`.
2970
+ // Available from libzmq 4.0.0.
2971
+ void
2972
+ zsock_set_req_relaxed (void *self, int req_relaxed);
2973
+
2974
+ // Set socket option `req_correlate`.
2975
+ // Available from libzmq 4.0.0.
2976
+ void
2977
+ zsock_set_req_correlate (void *self, int req_correlate);
2978
+
2979
+ // Set socket option `conflate`.
2980
+ // Available from libzmq 4.0.0.
2981
+ void
2982
+ zsock_set_conflate (void *self, int conflate);
2983
+
2984
+ // Get socket option `zap_domain`.
2985
+ // Available from libzmq 4.0.0.
2986
+ char *
2987
+ zsock_zap_domain (void *self);
2988
+
2989
+ // Set socket option `zap_domain`.
2990
+ // Available from libzmq 4.0.0.
2991
+ void
2992
+ zsock_set_zap_domain (void *self, const char *zap_domain);
2993
+
2994
+ // Get socket option `mechanism`.
2995
+ // Available from libzmq 4.0.0.
2996
+ int
2997
+ zsock_mechanism (void *self);
2998
+
2999
+ // Get socket option `plain_server`.
3000
+ // Available from libzmq 4.0.0.
3001
+ int
3002
+ zsock_plain_server (void *self);
3003
+
3004
+ // Set socket option `plain_server`.
3005
+ // Available from libzmq 4.0.0.
3006
+ void
3007
+ zsock_set_plain_server (void *self, int plain_server);
3008
+
3009
+ // Get socket option `plain_username`.
3010
+ // Available from libzmq 4.0.0.
3011
+ char *
3012
+ zsock_plain_username (void *self);
3013
+
3014
+ // Set socket option `plain_username`.
3015
+ // Available from libzmq 4.0.0.
3016
+ void
3017
+ zsock_set_plain_username (void *self, const char *plain_username);
3018
+
3019
+ // Get socket option `plain_password`.
3020
+ // Available from libzmq 4.0.0.
3021
+ char *
3022
+ zsock_plain_password (void *self);
3023
+
3024
+ // Set socket option `plain_password`.
3025
+ // Available from libzmq 4.0.0.
3026
+ void
3027
+ zsock_set_plain_password (void *self, const char *plain_password);
3028
+
3029
+ // Get socket option `curve_server`.
3030
+ // Available from libzmq 4.0.0.
3031
+ int
3032
+ zsock_curve_server (void *self);
3033
+
3034
+ // Set socket option `curve_server`.
3035
+ // Available from libzmq 4.0.0.
3036
+ void
3037
+ zsock_set_curve_server (void *self, int curve_server);
3038
+
3039
+ // Get socket option `curve_publickey`.
3040
+ // Available from libzmq 4.0.0.
3041
+ char *
3042
+ zsock_curve_publickey (void *self);
3043
+
3044
+ // Set socket option `curve_publickey`.
3045
+ // Available from libzmq 4.0.0.
3046
+ void
3047
+ zsock_set_curve_publickey (void *self, const char *curve_publickey);
3048
+
3049
+ // Set socket option `curve_publickey` from 32-octet binary
3050
+ // Available from libzmq 4.0.0.
3051
+ void
3052
+ zsock_set_curve_publickey_bin (void *self, const byte *curve_publickey);
3053
+
3054
+ // Get socket option `curve_secretkey`.
3055
+ // Available from libzmq 4.0.0.
3056
+ char *
3057
+ zsock_curve_secretkey (void *self);
3058
+
3059
+ // Set socket option `curve_secretkey`.
3060
+ // Available from libzmq 4.0.0.
3061
+ void
3062
+ zsock_set_curve_secretkey (void *self, const char *curve_secretkey);
3063
+
3064
+ // Set socket option `curve_secretkey` from 32-octet binary
3065
+ // Available from libzmq 4.0.0.
3066
+ void
3067
+ zsock_set_curve_secretkey_bin (void *self, const byte *curve_secretkey);
3068
+
3069
+ // Get socket option `curve_serverkey`.
3070
+ // Available from libzmq 4.0.0.
3071
+ char *
3072
+ zsock_curve_serverkey (void *self);
3073
+
3074
+ // Set socket option `curve_serverkey`.
3075
+ // Available from libzmq 4.0.0.
3076
+ void
3077
+ zsock_set_curve_serverkey (void *self, const char *curve_serverkey);
3078
+
3079
+ // Set socket option `curve_serverkey` from 32-octet binary
3080
+ // Available from libzmq 4.0.0.
3081
+ void
3082
+ zsock_set_curve_serverkey_bin (void *self, const byte *curve_serverkey);
3083
+
3084
+ // Get socket option `gssapi_server`.
3085
+ // Available from libzmq 4.0.0.
3086
+ int
3087
+ zsock_gssapi_server (void *self);
3088
+
3089
+ // Set socket option `gssapi_server`.
3090
+ // Available from libzmq 4.0.0.
3091
+ void
3092
+ zsock_set_gssapi_server (void *self, int gssapi_server);
3093
+
3094
+ // Get socket option `gssapi_plaintext`.
3095
+ // Available from libzmq 4.0.0.
3096
+ int
3097
+ zsock_gssapi_plaintext (void *self);
3098
+
3099
+ // Set socket option `gssapi_plaintext`.
3100
+ // Available from libzmq 4.0.0.
3101
+ void
3102
+ zsock_set_gssapi_plaintext (void *self, int gssapi_plaintext);
3103
+
3104
+ // Get socket option `gssapi_principal`.
3105
+ // Available from libzmq 4.0.0.
3106
+ char *
3107
+ zsock_gssapi_principal (void *self);
3108
+
3109
+ // Set socket option `gssapi_principal`.
3110
+ // Available from libzmq 4.0.0.
3111
+ void
3112
+ zsock_set_gssapi_principal (void *self, const char *gssapi_principal);
3113
+
3114
+ // Get socket option `gssapi_service_principal`.
3115
+ // Available from libzmq 4.0.0.
3116
+ char *
3117
+ zsock_gssapi_service_principal (void *self);
3118
+
3119
+ // Set socket option `gssapi_service_principal`.
3120
+ // Available from libzmq 4.0.0.
3121
+ void
3122
+ zsock_set_gssapi_service_principal (void *self, const char *gssapi_service_principal);
3123
+
3124
+ // Get socket option `ipv6`.
3125
+ // Available from libzmq 4.0.0.
3126
+ int
3127
+ zsock_ipv6 (void *self);
3128
+
3129
+ // Set socket option `ipv6`.
3130
+ // Available from libzmq 4.0.0.
3131
+ void
3132
+ zsock_set_ipv6 (void *self, int ipv6);
3133
+
3134
+ // Get socket option `immediate`.
3135
+ // Available from libzmq 4.0.0.
3136
+ int
3137
+ zsock_immediate (void *self);
3138
+
3139
+ // Set socket option `immediate`.
3140
+ // Available from libzmq 4.0.0.
3141
+ void
3142
+ zsock_set_immediate (void *self, int immediate);
3143
+
3144
+ // Get socket option `sndhwm`.
3145
+ // Available from libzmq 3.0.0.
3146
+ int
3147
+ zsock_sndhwm (void *self);
3148
+
3149
+ // Set socket option `sndhwm`.
3150
+ // Available from libzmq 3.0.0.
3151
+ void
3152
+ zsock_set_sndhwm (void *self, int sndhwm);
3153
+
3154
+ // Get socket option `rcvhwm`.
3155
+ // Available from libzmq 3.0.0.
3156
+ int
3157
+ zsock_rcvhwm (void *self);
3158
+
3159
+ // Set socket option `rcvhwm`.
3160
+ // Available from libzmq 3.0.0.
3161
+ void
3162
+ zsock_set_rcvhwm (void *self, int rcvhwm);
3163
+
3164
+ // Get socket option `maxmsgsize`.
3165
+ // Available from libzmq 3.0.0.
3166
+ int
3167
+ zsock_maxmsgsize (void *self);
3168
+
3169
+ // Set socket option `maxmsgsize`.
3170
+ // Available from libzmq 3.0.0.
3171
+ void
3172
+ zsock_set_maxmsgsize (void *self, int maxmsgsize);
3173
+
3174
+ // Get socket option `multicast_hops`.
3175
+ // Available from libzmq 3.0.0.
3176
+ int
3177
+ zsock_multicast_hops (void *self);
3178
+
3179
+ // Set socket option `multicast_hops`.
3180
+ // Available from libzmq 3.0.0.
3181
+ void
3182
+ zsock_set_multicast_hops (void *self, int multicast_hops);
3183
+
3184
+ // Set socket option `xpub_verbose`.
3185
+ // Available from libzmq 3.0.0.
3186
+ void
3187
+ zsock_set_xpub_verbose (void *self, int xpub_verbose);
3188
+
3189
+ // Get socket option `tcp_keepalive`.
3190
+ // Available from libzmq 3.0.0.
3191
+ int
3192
+ zsock_tcp_keepalive (void *self);
3193
+
3194
+ // Set socket option `tcp_keepalive`.
3195
+ // Available from libzmq 3.0.0.
3196
+ void
3197
+ zsock_set_tcp_keepalive (void *self, int tcp_keepalive);
3198
+
3199
+ // Get socket option `tcp_keepalive_idle`.
3200
+ // Available from libzmq 3.0.0.
3201
+ int
3202
+ zsock_tcp_keepalive_idle (void *self);
3203
+
3204
+ // Set socket option `tcp_keepalive_idle`.
3205
+ // Available from libzmq 3.0.0.
3206
+ void
3207
+ zsock_set_tcp_keepalive_idle (void *self, int tcp_keepalive_idle);
3208
+
3209
+ // Get socket option `tcp_keepalive_cnt`.
3210
+ // Available from libzmq 3.0.0.
3211
+ int
3212
+ zsock_tcp_keepalive_cnt (void *self);
3213
+
3214
+ // Set socket option `tcp_keepalive_cnt`.
3215
+ // Available from libzmq 3.0.0.
3216
+ void
3217
+ zsock_set_tcp_keepalive_cnt (void *self, int tcp_keepalive_cnt);
3218
+
3219
+ // Get socket option `tcp_keepalive_intvl`.
3220
+ // Available from libzmq 3.0.0.
3221
+ int
3222
+ zsock_tcp_keepalive_intvl (void *self);
3223
+
3224
+ // Set socket option `tcp_keepalive_intvl`.
3225
+ // Available from libzmq 3.0.0.
3226
+ void
3227
+ zsock_set_tcp_keepalive_intvl (void *self, int tcp_keepalive_intvl);
3228
+
3229
+ // Get socket option `tcp_accept_filter`.
3230
+ // Available from libzmq 3.0.0.
3231
+ char *
3232
+ zsock_tcp_accept_filter (void *self);
3233
+
3234
+ // Set socket option `tcp_accept_filter`.
3235
+ // Available from libzmq 3.0.0.
3236
+ void
3237
+ zsock_set_tcp_accept_filter (void *self, const char *tcp_accept_filter);
3238
+
3239
+ // Get socket option `last_endpoint`.
3240
+ // Available from libzmq 3.0.0.
3241
+ char *
3242
+ zsock_last_endpoint (void *self);
3243
+
3244
+ // Set socket option `router_raw`.
3245
+ // Available from libzmq 3.0.0.
3246
+ void
3247
+ zsock_set_router_raw (void *self, int router_raw);
3248
+
3249
+ // Get socket option `ipv4only`.
3250
+ // Available from libzmq 3.0.0.
3251
+ int
3252
+ zsock_ipv4only (void *self);
3253
+
3254
+ // Set socket option `ipv4only`.
3255
+ // Available from libzmq 3.0.0.
3256
+ void
3257
+ zsock_set_ipv4only (void *self, int ipv4only);
3258
+
3259
+ // Set socket option `delay_attach_on_connect`.
3260
+ // Available from libzmq 3.0.0.
3261
+ void
3262
+ zsock_set_delay_attach_on_connect (void *self, int delay_attach_on_connect);
3263
+
3264
+ // Get socket option `hwm`.
3265
+ // Available from libzmq 2.0.0 to 3.0.0.
3266
+ int
3267
+ zsock_hwm (void *self);
3268
+
3269
+ // Set socket option `hwm`.
3270
+ // Available from libzmq 2.0.0 to 3.0.0.
3271
+ void
3272
+ zsock_set_hwm (void *self, int hwm);
3273
+
3274
+ // Get socket option `swap`.
3275
+ // Available from libzmq 2.0.0 to 3.0.0.
3276
+ int
3277
+ zsock_swap (void *self);
3278
+
3279
+ // Set socket option `swap`.
3280
+ // Available from libzmq 2.0.0 to 3.0.0.
3281
+ void
3282
+ zsock_set_swap (void *self, int swap);
3283
+
3284
+ // Get socket option `affinity`.
3285
+ // Available from libzmq 2.0.0.
3286
+ int
3287
+ zsock_affinity (void *self);
3288
+
3289
+ // Set socket option `affinity`.
3290
+ // Available from libzmq 2.0.0.
3291
+ void
3292
+ zsock_set_affinity (void *self, int affinity);
3293
+
3294
+ // Get socket option `identity`.
3295
+ // Available from libzmq 2.0.0.
3296
+ char *
3297
+ zsock_identity (void *self);
3298
+
3299
+ // Set socket option `identity`.
3300
+ // Available from libzmq 2.0.0.
3301
+ void
3302
+ zsock_set_identity (void *self, const char *identity);
3303
+
3304
+ // Get socket option `rate`.
3305
+ // Available from libzmq 2.0.0.
3306
+ int
3307
+ zsock_rate (void *self);
3308
+
3309
+ // Set socket option `rate`.
3310
+ // Available from libzmq 2.0.0.
3311
+ void
3312
+ zsock_set_rate (void *self, int rate);
3313
+
3314
+ // Get socket option `recovery_ivl`.
3315
+ // Available from libzmq 2.0.0.
3316
+ int
3317
+ zsock_recovery_ivl (void *self);
3318
+
3319
+ // Set socket option `recovery_ivl`.
3320
+ // Available from libzmq 2.0.0.
3321
+ void
3322
+ zsock_set_recovery_ivl (void *self, int recovery_ivl);
3323
+
3324
+ // Get socket option `recovery_ivl_msec`.
3325
+ // Available from libzmq 2.0.0 to 3.0.0.
3326
+ int
3327
+ zsock_recovery_ivl_msec (void *self);
3328
+
3329
+ // Set socket option `recovery_ivl_msec`.
3330
+ // Available from libzmq 2.0.0 to 3.0.0.
3331
+ void
3332
+ zsock_set_recovery_ivl_msec (void *self, int recovery_ivl_msec);
3333
+
3334
+ // Get socket option `mcast_loop`.
3335
+ // Available from libzmq 2.0.0 to 3.0.0.
3336
+ int
3337
+ zsock_mcast_loop (void *self);
3338
+
3339
+ // Set socket option `mcast_loop`.
3340
+ // Available from libzmq 2.0.0 to 3.0.0.
3341
+ void
3342
+ zsock_set_mcast_loop (void *self, int mcast_loop);
3343
+
3344
+ // Get socket option `rcvtimeo`.
3345
+ // Available from libzmq 2.2.0.
3346
+ int
3347
+ zsock_rcvtimeo (void *self);
3348
+
3349
+ // Set socket option `rcvtimeo`.
3350
+ // Available from libzmq 2.2.0.
3351
+ void
3352
+ zsock_set_rcvtimeo (void *self, int rcvtimeo);
3353
+
3354
+ // Get socket option `sndtimeo`.
3355
+ // Available from libzmq 2.2.0.
3356
+ int
3357
+ zsock_sndtimeo (void *self);
3358
+
3359
+ // Set socket option `sndtimeo`.
3360
+ // Available from libzmq 2.2.0.
3361
+ void
3362
+ zsock_set_sndtimeo (void *self, int sndtimeo);
3363
+
3364
+ // Get socket option `sndbuf`.
3365
+ // Available from libzmq 2.0.0.
3366
+ int
3367
+ zsock_sndbuf (void *self);
3368
+
3369
+ // Set socket option `sndbuf`.
3370
+ // Available from libzmq 2.0.0.
3371
+ void
3372
+ zsock_set_sndbuf (void *self, int sndbuf);
3373
+
3374
+ // Get socket option `rcvbuf`.
3375
+ // Available from libzmq 2.0.0.
3376
+ int
3377
+ zsock_rcvbuf (void *self);
3378
+
3379
+ // Set socket option `rcvbuf`.
3380
+ // Available from libzmq 2.0.0.
3381
+ void
3382
+ zsock_set_rcvbuf (void *self, int rcvbuf);
3383
+
3384
+ // Get socket option `linger`.
3385
+ // Available from libzmq 2.0.0.
3386
+ int
3387
+ zsock_linger (void *self);
3388
+
3389
+ // Set socket option `linger`.
3390
+ // Available from libzmq 2.0.0.
3391
+ void
3392
+ zsock_set_linger (void *self, int linger);
3393
+
3394
+ // Get socket option `reconnect_ivl`.
3395
+ // Available from libzmq 2.0.0.
3396
+ int
3397
+ zsock_reconnect_ivl (void *self);
3398
+
3399
+ // Set socket option `reconnect_ivl`.
3400
+ // Available from libzmq 2.0.0.
3401
+ void
3402
+ zsock_set_reconnect_ivl (void *self, int reconnect_ivl);
3403
+
3404
+ // Get socket option `reconnect_ivl_max`.
3405
+ // Available from libzmq 2.0.0.
3406
+ int
3407
+ zsock_reconnect_ivl_max (void *self);
3408
+
3409
+ // Set socket option `reconnect_ivl_max`.
3410
+ // Available from libzmq 2.0.0.
3411
+ void
3412
+ zsock_set_reconnect_ivl_max (void *self, int reconnect_ivl_max);
3413
+
3414
+ // Get socket option `backlog`.
3415
+ // Available from libzmq 2.0.0.
3416
+ int
3417
+ zsock_backlog (void *self);
3418
+
3419
+ // Set socket option `backlog`.
3420
+ // Available from libzmq 2.0.0.
3421
+ void
3422
+ zsock_set_backlog (void *self, int backlog);
3423
+
3424
+ // Set socket option `subscribe`.
3425
+ // Available from libzmq 2.0.0.
3426
+ void
3427
+ zsock_set_subscribe (void *self, const char *subscribe);
3428
+
3429
+ // Set socket option `unsubscribe`.
3430
+ // Available from libzmq 2.0.0.
3431
+ void
3432
+ zsock_set_unsubscribe (void *self, const char *unsubscribe);
3433
+
3434
+ // Get socket option `type`.
3435
+ // Available from libzmq 2.0.0.
3436
+ int
3437
+ zsock_type (void *self);
3438
+
3439
+ // Get socket option `rcvmore`.
3440
+ // Available from libzmq 2.0.0.
3441
+ int
3442
+ zsock_rcvmore (void *self);
3443
+
3444
+ // Get socket option `fd`.
3445
+ // Available from libzmq 2.0.0.
3446
+ SOCKET
3447
+ zsock_fd (void *self);
3448
+
3449
+ // Get socket option `events`.
3450
+ // Available from libzmq 2.0.0.
3451
+ int
3452
+ zsock_events (void *self);
3453
+
3454
+ // Self test of this class.
3455
+ void
3456
+ zsock_test (bool verbose);
3457
+
3458
+ // CLASS: zstr
3459
+ // Receive C string from socket. Caller must free returned string using
3460
+ // zstr_free(). Returns NULL if the context is being terminated or the
3461
+ // process was interrupted.
3462
+ char *
3463
+ zstr_recv (void *source);
3464
+
3465
+ // Receive a series of strings (until NULL) from multipart data.
3466
+ // Each string is allocated and filled with string data; if there
3467
+ // are not enough frames, unallocated strings are set to NULL.
3468
+ // Returns -1 if the message could not be read, else returns the
3469
+ // number of strings filled, zero or more. Free each returned string
3470
+ // using zstr_free(). If not enough strings are provided, remaining
3471
+ // multipart frames in the message are dropped.
3472
+ int
3473
+ zstr_recvx (void *source, char **string_p, ...);
3474
+
3475
+ // De-compress and receive C string from socket, received as a message
3476
+ // with two frames: size of the uncompressed string, and the string itself.
3477
+ // Caller must free returned string using zstr_free(). Returns NULL if the
3478
+ // context is being terminated or the process was interrupted.
3479
+ char *
3480
+ zstr_recv_compress (void *source);
3481
+
3482
+ // Send a C string to a socket, as a frame. The string is sent without
3483
+ // trailing null byte; to read this you can use zstr_recv, or a similar
3484
+ // method that adds a null terminator on the received string. String
3485
+ // may be NULL, which is sent as "".
3486
+ int
3487
+ zstr_send (void *dest, const char *string);
3488
+
3489
+ // Send a C string to a socket, as zstr_send(), with a MORE flag, so that
3490
+ // you can send further strings in the same multi-part message.
3491
+ int
3492
+ zstr_sendm (void *dest, const char *string);
3493
+
3494
+ // Send a formatted string to a socket. Note that you should NOT use
3495
+ // user-supplied strings in the format (they may contain '%' which
3496
+ // will create security holes).
3497
+ int
3498
+ zstr_sendf (void *dest, const char *format, ...);
3499
+
3500
+ // Send a formatted string to a socket, as for zstr_sendf(), with a
3501
+ // MORE flag, so that you can send further strings in the same multi-part
3502
+ // message.
3503
+ int
3504
+ zstr_sendfm (void *dest, const char *format, ...);
3505
+
3506
+ // Send a series of strings (until NULL) as multipart data
3507
+ // Returns 0 if the strings could be sent OK, or -1 on error.
3508
+ int
3509
+ zstr_sendx (void *dest, const char *string, ...);
3510
+
3511
+ // Compress and send a C string to a socket, as a message with two frames:
3512
+ // size of the uncompressed string, and the string itself. The string is
3513
+ // sent without trailing null byte; to read this you can use
3514
+ // zstr_recv_compress, or a similar method that de-compresses and adds a
3515
+ // null terminator on the received string.
3516
+ int
3517
+ zstr_send_compress (void *dest, const char *string);
3518
+
3519
+ // Compress and send a C string to a socket, as zstr_send_compress(),
3520
+ // with a MORE flag, so that you can send further strings in the same
3521
+ // multi-part message.
3522
+ int
3523
+ zstr_sendm_compress (void *dest, const char *string);
3524
+
3525
+ // Accepts a void pointer and returns a fresh character string. If source
3526
+ // is null, returns an empty string.
3527
+ char *
3528
+ zstr_str (void *source);
3529
+
3530
+ // Free a provided string, and nullify the parent pointer. Safe to call on
3531
+ // a null pointer.
3532
+ void
3533
+ zstr_free (char **string_p);
3534
+
3535
+ // Self test of this class.
3536
+ void
3537
+ zstr_test (bool verbose);
3538
+
3539
+ // CLASS: zsys
3540
+ // Initialize CZMQ zsys layer; this happens automatically when you create
3541
+ // a socket or an actor; however this call lets you force initialization
3542
+ // earlier, so e.g. logging is properly set-up before you start working.
3543
+ // Not threadsafe, so call only from main thread. Safe to call multiple
3544
+ // times. Returns global CZMQ context.
3545
+ void *
3546
+ zsys_init (void);
3547
+
3548
+ // Optionally shut down the CZMQ zsys layer; this normally happens automatically
3549
+ // when the process exits; however this call lets you force a shutdown
3550
+ // earlier, avoiding any potential problems with atexit() ordering, especially
3551
+ // with Windows dlls.
3552
+ void
3553
+ zsys_shutdown (void);
3554
+
3555
+ // Get a new ZMQ socket, automagically creating a ZMQ context if this is
3556
+ // the first time. Caller is responsible for destroying the ZMQ socket
3557
+ // before process exits, to avoid a ZMQ deadlock. Note: you should not use
3558
+ // this method in CZMQ apps, use zsock_new() instead.
3559
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3560
+ void *
3561
+ zsys_socket (int type, const char *filename, size_t line_nbr);
3562
+
3563
+ // Destroy/close a ZMQ socket. You should call this for every socket you
3564
+ // create using zsys_socket().
3565
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3566
+ int
3567
+ zsys_close (void *handle, const char *filename, size_t line_nbr);
3568
+
3569
+ // Return ZMQ socket name for socket type
3570
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3571
+ char *
3572
+ zsys_sockname (int socktype);
3573
+
3574
+ // Create a pipe, which consists of two PAIR sockets connected over inproc.
3575
+ // The pipe is configured to use the zsys_pipehwm setting. Returns the
3576
+ // frontend socket successful, NULL if failed.
3577
+ zsock_t *
3578
+ zsys_create_pipe (zsock_t **backend_p);
3579
+
3580
+ // Set interrupt handler; this saves the default handlers so that a
3581
+ // zsys_handler_reset () can restore them. If you call this multiple times
3582
+ // then the last handler will take affect. If handler_fn is NULL, disables
3583
+ // default SIGINT/SIGTERM handling in CZMQ.
3584
+ void
3585
+ zsys_handler_set (zsys_handler_fn *handler_fn);
3586
+
3587
+ // Reset interrupt handler, call this at exit if needed
3588
+ void
3589
+ zsys_handler_reset (void);
3590
+
3591
+ // Set default interrupt handler, so Ctrl-C or SIGTERM will set
3592
+ // zsys_interrupted. Idempotent; safe to call multiple times.
3593
+ // Can be supressed by ZSYS_SIGHANDLER=false
3594
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3595
+ void
3596
+ zsys_catch_interrupts (void);
3597
+
3598
+ // Return 1 if file exists, else zero
3599
+ bool
3600
+ zsys_file_exists (const char *filename);
3601
+
3602
+ // Return file modification time. Returns 0 if the file does not exist.
3603
+ time_t
3604
+ zsys_file_modified (const char *filename);
3605
+
3606
+ // Return file mode; provides at least support for the POSIX S_ISREG(m)
3607
+ // and S_ISDIR(m) macros and the S_IRUSR and S_IWUSR bits, on all boxes.
3608
+ // Returns a mode_t cast to int, or -1 in case of error.
3609
+ int
3610
+ zsys_file_mode (const char *filename);
3611
+
3612
+ // Delete file. Does not complain if the file is absent
3613
+ int
3614
+ zsys_file_delete (const char *filename);
3615
+
3616
+ // Check if file is 'stable'
3617
+ bool
3618
+ zsys_file_stable (const char *filename);
3619
+
3620
+ // Create a file path if it doesn't exist. The file path is treated as
3621
+ // printf format.
3622
+ int
3623
+ zsys_dir_create (const char *pathname, ...);
3624
+
3625
+ // Remove a file path if empty; the pathname is treated as printf format.
3626
+ int
3627
+ zsys_dir_delete (const char *pathname, ...);
3628
+
3629
+ // Move to a specified working directory. Returns 0 if OK, -1 if this failed.
3630
+ int
3631
+ zsys_dir_change (const char *pathname);
3632
+
3633
+ // Set private file creation mode; all files created from here will be
3634
+ // readable/writable by the owner only.
3635
+ void
3636
+ zsys_file_mode_private (void);
3637
+
3638
+ // Reset default file creation mode; all files created from here will use
3639
+ // process file mode defaults.
3640
+ void
3641
+ zsys_file_mode_default (void);
3642
+
3643
+ // Return the CZMQ version for run-time API detection; returns version
3644
+ // number into provided fields, providing reference isn't null in each case.
3645
+ void
3646
+ zsys_version (int *major, int *minor, int *patch);
3647
+
3648
+ // Format a string using printf formatting, returning a freshly allocated
3649
+ // buffer. If there was insufficient memory, returns NULL. Free the returned
3650
+ // string using zstr_free().
3651
+ char *
3652
+ zsys_sprintf (const char *format, ...);
3653
+
3654
+ // Format a string with a va_list argument, returning a freshly allocated
3655
+ // buffer. If there was insufficient memory, returns NULL. Free the returned
3656
+ // string using zstr_free().
3657
+ char *
3658
+ zsys_vprintf (const char *format, va_list argptr);
3659
+
3660
+ // Create UDP beacon socket; if the routable option is true, uses
3661
+ // multicast (not yet implemented), else uses broadcast. This method
3662
+ // and related ones might _eventually_ be moved to a zudp class.
3663
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3664
+ SOCKET
3665
+ zsys_udp_new (bool routable);
3666
+
3667
+ // Close a UDP socket
3668
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3669
+ int
3670
+ zsys_udp_close (SOCKET handle);
3671
+
3672
+ // Send zframe to UDP socket, return -1 if sending failed due to
3673
+ // interface having disappeared (happens easily with WiFi)
3674
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3675
+ int
3676
+ zsys_udp_send (SOCKET udpsock, zframe_t *frame, inaddr_t *address, int addrlen);
3677
+
3678
+ // Receive zframe from UDP socket, and set address of peer that sent it
3679
+ // The peername must be a char [INET_ADDRSTRLEN] array if IPv6 is disabled or
3680
+ // NI_MAXHOST if it's enabled. Returns NULL when failing to get peer address.
3681
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3682
+ zframe_t *
3683
+ zsys_udp_recv (SOCKET udpsock, char *peername, int peerlen);
3684
+
3685
+ // Handle an I/O error on some socket operation; will report and die on
3686
+ // fatal errors, and continue silently on "try again" errors.
3687
+ // *** This is for CZMQ internal use only and may change arbitrarily ***
3688
+ void
3689
+ zsys_socket_error (const char *reason);
3690
+
3691
+ // Return current host name, for use in public tcp:// endpoints. Caller gets
3692
+ // a freshly allocated string, should free it using zstr_free(). If the host
3693
+ // name is not resolvable, returns NULL.
3694
+ char *
3695
+ zsys_hostname (void);
3696
+
3697
+ // Move the current process into the background. The precise effect depends
3698
+ // on the operating system. On POSIX boxes, moves to a specified working
3699
+ // directory (if specified), closes all file handles, reopens stdin, stdout,
3700
+ // and stderr to the null device, and sets the process to ignore SIGHUP. On
3701
+ // Windows, does nothing. Returns 0 if OK, -1 if there was an error.
3702
+ int
3703
+ zsys_daemonize (const char *workdir);
3704
+
3705
+ // Drop the process ID into the lockfile, with exclusive lock, and switch
3706
+ // the process to the specified group and/or user. Any of the arguments
3707
+ // may be null, indicating a no-op. Returns 0 on success, -1 on failure.
3708
+ // Note if you combine this with zsys_daemonize, run after, not before
3709
+ // that method, or the lockfile will hold the wrong process ID.
3710
+ int
3711
+ zsys_run_as (const char *lockfile, const char *group, const char *user);
3712
+
3713
+ // Returns true if the underlying libzmq supports CURVE security.
3714
+ // Uses a heuristic probe according to the version of libzmq being used.
3715
+ bool
3716
+ zsys_has_curve (void);
3717
+
3718
+ // Configure the number of I/O threads that ZeroMQ will use. A good
3719
+ // rule of thumb is one thread per gigabit of traffic in or out. The
3720
+ // default is 1, sufficient for most applications. If the environment
3721
+ // variable ZSYS_IO_THREADS is defined, that provides the default.
3722
+ // Note that this method is valid only before any socket is created.
3723
+ void
3724
+ zsys_set_io_threads (size_t io_threads);
3725
+
3726
+ // Configure the scheduling policy of the ZMQ context thread pool.
3727
+ // Not available on Windows. See the sched_setscheduler man page or sched.h
3728
+ // for more information. If the environment variable ZSYS_THREAD_SCHED_POLICY
3729
+ // is defined, that provides the default.
3730
+ // Note that this method is valid only before any socket is created.
3731
+ void
3732
+ zsys_set_thread_sched_policy (int policy);
3733
+
3734
+ // Configure the scheduling priority of the ZMQ context thread pool.
3735
+ // Not available on Windows. See the sched_setscheduler man page or sched.h
3736
+ // for more information. If the environment variable ZSYS_THREAD_PRIORITY is
3737
+ // defined, that provides the default.
3738
+ // Note that this method is valid only before any socket is created.
3739
+ void
3740
+ zsys_set_thread_priority (int priority);
3741
+
3742
+ // Configure the number of sockets that ZeroMQ will allow. The default
3743
+ // is 1024. The actual limit depends on the system, and you can query it
3744
+ // by using zsys_socket_limit (). A value of zero means "maximum".
3745
+ // Note that this method is valid only before any socket is created.
3746
+ void
3747
+ zsys_set_max_sockets (size_t max_sockets);
3748
+
3749
+ // Return maximum number of ZeroMQ sockets that the system will support.
3750
+ size_t
3751
+ zsys_socket_limit (void);
3752
+
3753
+ // Configure the maximum allowed size of a message sent.
3754
+ // The default is INT_MAX.
3755
+ void
3756
+ zsys_set_max_msgsz (int max_msgsz);
3757
+
3758
+ // Return maximum message size.
3759
+ int
3760
+ zsys_max_msgsz (void);
3761
+
3762
+ // Configure the threshold value of filesystem object age per st_mtime
3763
+ // that should elapse until we consider that object "stable" at the
3764
+ // current zclock_time() moment.
3765
+ // The default is S_DEFAULT_ZSYS_FILE_STABLE_AGE_MSEC defined in zsys.c
3766
+ // which generally depends on host OS, with fallback value of 5000.
3767
+ void
3768
+ zsys_set_file_stable_age_msec (int64_t file_stable_age_msec);
3769
+
3770
+ // Return current threshold value of file stable age in msec.
3771
+ // This can be used in code that chooses to wait for this timeout
3772
+ // before testing if a filesystem object is "stable" or not.
3773
+ int64_t
3774
+ zsys_file_stable_age_msec (void);
3775
+
3776
+ // Configure the default linger timeout in msecs for new zsock instances.
3777
+ // You can also set this separately on each zsock_t instance. The default
3778
+ // linger time is zero, i.e. any pending messages will be dropped. If the
3779
+ // environment variable ZSYS_LINGER is defined, that provides the default.
3780
+ // Note that process exit will typically be delayed by the linger time.
3781
+ void
3782
+ zsys_set_linger (size_t linger);
3783
+
3784
+ // Configure the default outgoing pipe limit (HWM) for new zsock instances.
3785
+ // You can also set this separately on each zsock_t instance. The default
3786
+ // HWM is 1,000, on all versions of ZeroMQ. If the environment variable
3787
+ // ZSYS_SNDHWM is defined, that provides the default. Note that a value of
3788
+ // zero means no limit, i.e. infinite memory consumption.
3789
+ void
3790
+ zsys_set_sndhwm (size_t sndhwm);
3791
+
3792
+ // Configure the default incoming pipe limit (HWM) for new zsock instances.
3793
+ // You can also set this separately on each zsock_t instance. The default
3794
+ // HWM is 1,000, on all versions of ZeroMQ. If the environment variable
3795
+ // ZSYS_RCVHWM is defined, that provides the default. Note that a value of
3796
+ // zero means no limit, i.e. infinite memory consumption.
3797
+ void
3798
+ zsys_set_rcvhwm (size_t rcvhwm);
3799
+
3800
+ // Configure the default HWM for zactor internal pipes; this is set on both
3801
+ // ends of the pipe, for outgoing messages only (sndhwm). The default HWM is
3802
+ // 1,000, on all versions of ZeroMQ. If the environment var ZSYS_ACTORHWM is
3803
+ // defined, that provides the default. Note that a value of zero means no
3804
+ // limit, i.e. infinite memory consumption.
3805
+ void
3806
+ zsys_set_pipehwm (size_t pipehwm);
3807
+
3808
+ // Return the HWM for zactor internal pipes.
3809
+ size_t
3810
+ zsys_pipehwm (void);
3811
+
3812
+ // Configure use of IPv6 for new zsock instances. By default sockets accept
3813
+ // and make only IPv4 connections. When you enable IPv6, sockets will accept
3814
+ // and connect to both IPv4 and IPv6 peers. You can override the setting on
3815
+ // each zsock_t instance. The default is IPv4 only (ipv6 set to 0). If the
3816
+ // environment variable ZSYS_IPV6 is defined (as 1 or 0), this provides the
3817
+ // default. Note: has no effect on ZMQ v2.
3818
+ void
3819
+ zsys_set_ipv6 (int ipv6);
3820
+
3821
+ // Return use of IPv6 for zsock instances.
3822
+ int
3823
+ zsys_ipv6 (void);
3824
+
3825
+ // Set network interface name to use for broadcasts, particularly zbeacon.
3826
+ // This lets the interface be configured for test environments where required.
3827
+ // For example, on Mac OS X, zbeacon cannot bind to 255.255.255.255 which is
3828
+ // the default when there is no specified interface. If the environment
3829
+ // variable ZSYS_INTERFACE is set, use that as the default interface name.
3830
+ // Setting the interface to "*" means "use all available interfaces".
3831
+ void
3832
+ zsys_set_interface (const char *value);
3833
+
3834
+ // Return network interface to use for broadcasts, or "" if none was set.
3835
+ const char *
3836
+ zsys_interface (void);
3837
+
3838
+ // Set IPv6 address to use zbeacon socket, particularly for receiving zbeacon.
3839
+ // This needs to be set IPv6 is enabled as IPv6 can have multiple addresses
3840
+ // on a given interface. If the environment variable ZSYS_IPV6_ADDRESS is set,
3841
+ // use that as the default IPv6 address.
3842
+ void
3843
+ zsys_set_ipv6_address (const char *value);
3844
+
3845
+ // Return IPv6 address to use for zbeacon reception, or "" if none was set.
3846
+ const char *
3847
+ zsys_ipv6_address (void);
3848
+
3849
+ // Set IPv6 milticast address to use for sending zbeacon messages. This needs
3850
+ // to be set if IPv6 is enabled. If the environment variable
3851
+ // ZSYS_IPV6_MCAST_ADDRESS is set, use that as the default IPv6 multicast
3852
+ // address.
3853
+ void
3854
+ zsys_set_ipv6_mcast_address (const char *value);
3855
+
3856
+ // Return IPv6 multicast address to use for sending zbeacon, or "" if none was
3857
+ // set.
3858
+ const char *
3859
+ zsys_ipv6_mcast_address (void);
3860
+
3861
+ // Configure the automatic use of pre-allocated FDs when creating new sockets.
3862
+ // If 0 (default), nothing will happen. Else, when a new socket is bound, the
3863
+ // system API will be used to check if an existing pre-allocated FD with a
3864
+ // matching port (if TCP) or path (if IPC) exists, and if it does it will be
3865
+ // set via the ZMQ_USE_FD socket option so that the library will use it
3866
+ // instead of creating a new socket.
3867
+ void
3868
+ zsys_set_auto_use_fd (int auto_use_fd);
3869
+
3870
+ // Return use of automatic pre-allocated FDs for zsock instances.
3871
+ int
3872
+ zsys_auto_use_fd (void);
3873
+
3874
+ // Set log identity, which is a string that prefixes all log messages sent
3875
+ // by this process. The log identity defaults to the environment variable
3876
+ // ZSYS_LOGIDENT, if that is set.
3877
+ void
3878
+ zsys_set_logident (const char *value);
3879
+
3880
+ // Set stream to receive log traffic. By default, log traffic is sent to
3881
+ // stdout. If you set the stream to NULL, no stream will receive the log
3882
+ // traffic (it may still be sent to the system facility).
3883
+ void
3884
+ zsys_set_logstream (FILE *stream);
3885
+
3886
+ // Sends log output to a PUB socket bound to the specified endpoint. To
3887
+ // collect such log output, create a SUB socket, subscribe to the traffic
3888
+ // you care about, and connect to the endpoint. Log traffic is sent as a
3889
+ // single string frame, in the same format as when sent to stdout. The
3890
+ // log system supports a single sender; multiple calls to this method will
3891
+ // bind the same sender to multiple endpoints. To disable the sender, call
3892
+ // this method with a null argument.
3893
+ void
3894
+ zsys_set_logsender (const char *endpoint);
3895
+
3896
+ // Enable or disable logging to the system facility (syslog on POSIX boxes,
3897
+ // event log on Windows). By default this is disabled.
3898
+ void
3899
+ zsys_set_logsystem (bool logsystem);
3900
+
3901
+ // Log error condition - highest priority
3902
+ void
3903
+ zsys_error (const char *format, ...);
3904
+
3905
+ // Log warning condition - high priority
3906
+ void
3907
+ zsys_warning (const char *format, ...);
3908
+
3909
+ // Log normal, but significant, condition - normal priority
3910
+ void
3911
+ zsys_notice (const char *format, ...);
3912
+
3913
+ // Log informational message - low priority
3914
+ void
3915
+ zsys_info (const char *format, ...);
3916
+
3917
+ // Log debug-level message - lowest priority
3918
+ void
3919
+ zsys_debug (const char *format, ...);
3920
+
3921
+ // Self test of this class.
3922
+ void
3923
+ zsys_test (bool verbose);
3924
+
3925
+ // CLASS: ztimerset
3926
+ // Create new timer set.
3927
+ ztimerset_t *
3928
+ ztimerset_new (void);
3929
+
3930
+ // Destroy a timer set
3931
+ void
3932
+ ztimerset_destroy (ztimerset_t **self_p);
3933
+
3934
+ // Add a timer to the set. Returns timer id if OK, -1 on failure.
3935
+ int
3936
+ ztimerset_add (ztimerset_t *self, size_t interval, ztimerset_fn handler, void *arg);
3937
+
3938
+ // Cancel a timer. Returns 0 if OK, -1 on failure.
3939
+ int
3940
+ ztimerset_cancel (ztimerset_t *self, int timer_id);
3941
+
3942
+ // Set timer interval. Returns 0 if OK, -1 on failure.
3943
+ // This method is slow, canceling the timer and adding a new one yield better performance.
3944
+ int
3945
+ ztimerset_set_interval (ztimerset_t *self, int timer_id, size_t interval);
3946
+
3947
+ // Reset timer to start interval counting from current time. Returns 0 if OK, -1 on failure.
3948
+ // This method is slow, canceling the timer and adding a new one yield better performance.
3949
+ int
3950
+ ztimerset_reset (ztimerset_t *self, int timer_id);
3951
+
3952
+ // Return the time until the next interval.
3953
+ // Should be used as timeout parameter for the zpoller wait method.
3954
+ // The timeout is in msec.
3955
+ int
3956
+ ztimerset_timeout (ztimerset_t *self);
3957
+
3958
+ // Invoke callback function of all timers which their interval has elapsed.
3959
+ // Should be call after zpoller wait method.
3960
+ // Returns 0 if OK, -1 on failure.
3961
+ int
3962
+ ztimerset_execute (ztimerset_t *self);
3963
+
3964
+ // Self test of this class.
3965
+ void
3966
+ ztimerset_test (bool verbose);
3967
+
3968
+ // CLASS: ztrie
3969
+ // Creates a new ztrie.
3970
+ ztrie_t *
3971
+ ztrie_new (char delimiter);
3972
+
3973
+ // Destroy the ztrie.
3974
+ void
3975
+ ztrie_destroy (ztrie_t **self_p);
3976
+
3977
+ // Inserts a new route into the tree and attaches the data. Returns -1
3978
+ // if the route already exists, otherwise 0. This method takes ownership of
3979
+ // the provided data if a destroy_data_fn is provided.
3980
+ int
3981
+ ztrie_insert_route (ztrie_t *self, const char *path, void *data, ztrie_destroy_data_fn destroy_data_fn);
3982
+
3983
+ // Removes a route from the trie and destroys its data. Returns -1 if the
3984
+ // route does not exists, otherwise 0.
3985
+ // the start of the list call zlist_first (). Advances the cursor.
3986
+ int
3987
+ ztrie_remove_route (ztrie_t *self, const char *path);
3988
+
3989
+ // Returns true if the path matches a route in the tree, otherwise false.
3990
+ bool
3991
+ ztrie_matches (ztrie_t *self, const char *path);
3992
+
3993
+ // Returns the data of a matched route from last ztrie_matches. If the path
3994
+ // did not match, returns NULL. Do not delete the data as it's owned by
3995
+ // ztrie.
3996
+ void *
3997
+ ztrie_hit_data (ztrie_t *self);
3998
+
3999
+ // Returns the count of parameters that a matched route has.
4000
+ size_t
4001
+ ztrie_hit_parameter_count (ztrie_t *self);
4002
+
4003
+ // Returns the parameters of a matched route with named regexes from last
4004
+ // ztrie_matches. If the path did not match or the route did not contain any
4005
+ // named regexes, returns NULL.
4006
+ zhashx_t *
4007
+ ztrie_hit_parameters (ztrie_t *self);
4008
+
4009
+ // Returns the asterisk matched part of a route, if there has been no match
4010
+ // or no asterisk match, returns NULL.
4011
+ const char *
4012
+ ztrie_hit_asterisk_match (ztrie_t *self);
4013
+
4014
+ // Print the trie
4015
+ void
4016
+ ztrie_print (ztrie_t *self);
4017
+
4018
+ // Self test of this class.
4019
+ void
4020
+ ztrie_test (bool verbose);
4021
+
4022
+ // CLASS: zuuid
4023
+ // Create a new UUID object.
4024
+ zuuid_t *
4025
+ zuuid_new (void);
4026
+
4027
+ // Destroy a specified UUID object.
4028
+ void
4029
+ zuuid_destroy (zuuid_t **self_p);
4030
+
4031
+ // Create UUID object from supplied ZUUID_LEN-octet value.
4032
+ zuuid_t *
4033
+ zuuid_new_from (const byte *source);
4034
+
4035
+ // Set UUID to new supplied ZUUID_LEN-octet value.
4036
+ void
4037
+ zuuid_set (zuuid_t *self, const byte *source);
4038
+
4039
+ // Set UUID to new supplied string value skipping '-' and '{' '}'
4040
+ // optional delimiters. Return 0 if OK, else returns -1.
4041
+ int
4042
+ zuuid_set_str (zuuid_t *self, const char *source);
4043
+
4044
+ // Return UUID binary data.
4045
+ const byte *
4046
+ zuuid_data (zuuid_t *self);
4047
+
4048
+ // Return UUID binary size
4049
+ size_t
4050
+ zuuid_size (zuuid_t *self);
4051
+
4052
+ // Returns UUID as string
4053
+ const char *
4054
+ zuuid_str (zuuid_t *self);
4055
+
4056
+ // Return UUID in the canonical string format: 8-4-4-4-12, in lower
4057
+ // case. Caller does not modify or free returned value. See
4058
+ // http://en.wikipedia.org/wiki/Universally_unique_identifier
4059
+ const char *
4060
+ zuuid_str_canonical (zuuid_t *self);
4061
+
4062
+ // Store UUID blob in target array
4063
+ void
4064
+ zuuid_export (zuuid_t *self, byte *target);
4065
+
4066
+ // Check if UUID is same as supplied value
4067
+ bool
4068
+ zuuid_eq (zuuid_t *self, const byte *compare);
4069
+
4070
+ // Check if UUID is different from supplied value
4071
+ bool
4072
+ zuuid_neq (zuuid_t *self, const byte *compare);
4073
+
4074
+ // Make copy of UUID object; if uuid is null, or memory was exhausted,
4075
+ // returns null.
4076
+ zuuid_t *
4077
+ zuuid_dup (zuuid_t *self);
4078
+
4079
+ // Self test of this class.
4080
+ void
4081
+ zuuid_test (bool verbose);
4082
+
4083
+ ''')
4084
+ for i, item in enumerate (czmq_cdefs):
4085
+ czmq_cdefs [i] = re.sub(r';[^;]*\bva_list\b[^;]*;', ';', item, flags=re.S) # we don't support anything with a va_list arg
4086
+