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