czmq-ffi-gen 0.9.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +1 -0
  3. data/CHANGES.md +88 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE +14 -0
  6. data/README.md +112 -0
  7. data/lib/czmq-ffi-gen.rb +7 -0
  8. data/lib/czmq-ffi-gen/czmq/ffi.rb +1210 -0
  9. data/lib/czmq-ffi-gen/czmq/ffi/version.rb +15 -0
  10. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +186 -0
  11. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +286 -0
  12. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +307 -0
  13. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +222 -0
  14. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +388 -0
  15. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +140 -0
  16. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +442 -0
  17. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +156 -0
  18. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +283 -0
  19. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +194 -0
  20. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +353 -0
  21. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +359 -0
  22. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +416 -0
  23. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +659 -0
  24. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +189 -0
  25. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +365 -0
  26. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +478 -0
  27. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +396 -0
  28. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +515 -0
  29. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +194 -0
  30. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +294 -0
  31. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +3479 -0
  32. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +203 -0
  33. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +203 -0
  34. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +221 -0
  35. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +227 -0
  36. data/lib/czmq-ffi-gen/errors.rb +12 -0
  37. data/lib/czmq-ffi-gen/gem_version.rb +5 -0
  38. data/lib/czmq-ffi-gen/legacy.rb +16 -0
  39. data/lib/czmq-ffi-gen/libzmq.rb +18 -0
  40. data/lib/czmq-ffi-gen/signals.rb +27 -0
  41. data/lib/czmq-ffi-gen/vendor.rb +5 -0
  42. data/lib/czmq-ffi-gen/versions.rb +19 -0
  43. data/vendor/local/bin/inproc_lat.exe +0 -0
  44. data/vendor/local/bin/inproc_thr.exe +0 -0
  45. data/vendor/local/bin/libczmq.dll +0 -0
  46. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  47. data/vendor/local/bin/libstdc++-6.dll +0 -0
  48. data/vendor/local/bin/libzmq.dll +0 -0
  49. data/vendor/local/bin/local_lat.exe +0 -0
  50. data/vendor/local/bin/local_thr.exe +0 -0
  51. data/vendor/local/bin/remote_lat.exe +0 -0
  52. data/vendor/local/bin/remote_thr.exe +0 -0
  53. data/vendor/local/include/czmq.h +31 -0
  54. data/vendor/local/include/czmq_library.h +199 -0
  55. data/vendor/local/include/czmq_prelude.h +641 -0
  56. data/vendor/local/include/readme.txt +83 -0
  57. data/vendor/local/include/sha1.h +76 -0
  58. data/vendor/local/include/sha1.inc_c +335 -0
  59. data/vendor/local/include/slre.h +92 -0
  60. data/vendor/local/include/slre.inc_c +660 -0
  61. data/vendor/local/include/zactor.h +76 -0
  62. data/vendor/local/include/zarmour.h +114 -0
  63. data/vendor/local/include/zauth.h +100 -0
  64. data/vendor/local/include/zauth_v2.h +88 -0
  65. data/vendor/local/include/zbeacon.h +86 -0
  66. data/vendor/local/include/zbeacon_v2.h +75 -0
  67. data/vendor/local/include/zcert.h +136 -0
  68. data/vendor/local/include/zcertstore.h +100 -0
  69. data/vendor/local/include/zchunk.h +163 -0
  70. data/vendor/local/include/zclock.h +73 -0
  71. data/vendor/local/include/zconfig.h +185 -0
  72. data/vendor/local/include/zctx.h +107 -0
  73. data/vendor/local/include/zdigest.h +65 -0
  74. data/vendor/local/include/zdir.h +149 -0
  75. data/vendor/local/include/zdir_patch.h +82 -0
  76. data/vendor/local/include/zfile.h +177 -0
  77. data/vendor/local/include/zframe.h +176 -0
  78. data/vendor/local/include/zgossip.h +95 -0
  79. data/vendor/local/include/zgossip_engine.inc +927 -0
  80. data/vendor/local/include/zgossip_msg.h +129 -0
  81. data/vendor/local/include/zhash.h +195 -0
  82. data/vendor/local/include/zhash_primes.inc +329 -0
  83. data/vendor/local/include/zhashx.h +298 -0
  84. data/vendor/local/include/ziflist.h +77 -0
  85. data/vendor/local/include/zlist.h +158 -0
  86. data/vendor/local/include/zlistx.h +205 -0
  87. data/vendor/local/include/zloop.h +168 -0
  88. data/vendor/local/include/zmonitor.h +73 -0
  89. data/vendor/local/include/zmonitor_v2.h +56 -0
  90. data/vendor/local/include/zmq.h +617 -0
  91. data/vendor/local/include/zmq_utils.h +48 -0
  92. data/vendor/local/include/zmsg.h +280 -0
  93. data/vendor/local/include/zmutex.h +55 -0
  94. data/vendor/local/include/zpoller.h +92 -0
  95. data/vendor/local/include/zproc.h +168 -0
  96. data/vendor/local/include/zproxy.h +111 -0
  97. data/vendor/local/include/zproxy_v2.h +62 -0
  98. data/vendor/local/include/zrex.h +82 -0
  99. data/vendor/local/include/zsock.h +912 -0
  100. data/vendor/local/include/zsock_option.inc +4126 -0
  101. data/vendor/local/include/zsocket.h +110 -0
  102. data/vendor/local/include/zsockopt.h +256 -0
  103. data/vendor/local/include/zstr.h +110 -0
  104. data/vendor/local/include/zsys.h +386 -0
  105. data/vendor/local/include/zthread.h +50 -0
  106. data/vendor/local/include/ztimerset.h +90 -0
  107. data/vendor/local/include/ztrie.h +106 -0
  108. data/vendor/local/include/zuuid.h +96 -0
  109. data/vendor/local/lib/libczmq.dll.a +0 -0
  110. data/vendor/local/lib/liblibzmq.dll.a +0 -0
  111. data/vendor/local/lib/libzmq-static.a +0 -0
  112. data/vendor/local/lib/pkgconfig/libczmq.pc +23 -0
  113. data/vendor/local/lib/pkgconfig/libzmq.pc +11 -0
  114. data/vendor/local/share/zmq/AUTHORS.txt +147 -0
  115. data/vendor/local/share/zmq/COPYING.LESSER.txt +181 -0
  116. data/vendor/local/share/zmq/COPYING.txt +674 -0
  117. data/vendor/local/share/zmq/NEWS.txt +978 -0
  118. metadata +230 -0
@@ -0,0 +1,73 @@
1
+ /* =========================================================================
2
+ zclock - millisecond clocks and delays
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZCLOCK_H_INCLUDED__
15
+ #define __ZCLOCK_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zclock.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // Sleep for a number of milliseconds
27
+ CZMQ_EXPORT void
28
+ zclock_sleep (int msecs);
29
+
30
+ // Return current system clock as milliseconds. Note that this clock can
31
+ // jump backwards (if the system clock is changed) so is unsafe to use for
32
+ // timers and time offsets. Use zclock_mono for that instead.
33
+ CZMQ_EXPORT int64_t
34
+ zclock_time (void);
35
+
36
+ // Return current monotonic clock in milliseconds. Use this when you compute
37
+ // time offsets. The monotonic clock is not affected by system changes and
38
+ // so will never be reset backwards, unlike a system clock.
39
+ CZMQ_EXPORT int64_t
40
+ zclock_mono (void);
41
+
42
+ // Return current monotonic clock in microseconds. Use this when you compute
43
+ // time offsets. The monotonic clock is not affected by system changes and
44
+ // so will never be reset backwards, unlike a system clock.
45
+ CZMQ_EXPORT int64_t
46
+ zclock_usecs (void);
47
+
48
+ // Return formatted date/time as fresh string. Free using zstr_free().
49
+ // Caller owns return value and must destroy it when done.
50
+ CZMQ_EXPORT char *
51
+ zclock_timestr (void);
52
+
53
+ // Self test of this class.
54
+ CZMQ_EXPORT void
55
+ zclock_test (bool verbose);
56
+
57
+ // @end
58
+
59
+
60
+ // DEPRECATED in favor of zsys logging, see issue #519
61
+ // Print formatted string to stdout, prefixed by date/time and
62
+ // terminated with a newline.
63
+ CZMQ_EXPORT void
64
+ zclock_log (const char *format, ...);
65
+
66
+ // Compiler hints
67
+ CZMQ_EXPORT void zclock_log (const char *format, ...) CHECK_PRINTF (1);
68
+
69
+ #ifdef __cplusplus
70
+ }
71
+ #endif
72
+
73
+ #endif
@@ -0,0 +1,185 @@
1
+ /* =========================================================================
2
+ zconfig - work with config files written in rfc.zeromq.org/spec:4/ZPL.
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZCONFIG_H_INCLUDED__
15
+ #define __ZCONFIG_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zconfig.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ //
27
+ typedef int (zconfig_fct) (
28
+ zconfig_t *self, void *arg, int level);
29
+
30
+ // Create new config item
31
+ CZMQ_EXPORT zconfig_t *
32
+ zconfig_new (const char *name, zconfig_t *parent);
33
+
34
+ // Load a config tree from a specified ZPL text file; returns a zconfig_t
35
+ // reference for the root, if the file exists and is readable. Returns NULL
36
+ // if the file does not exist.
37
+ CZMQ_EXPORT zconfig_t *
38
+ zconfig_load (const char *filename);
39
+
40
+ // Equivalent to zconfig_load, taking a format string instead of a fixed
41
+ // filename.
42
+ CZMQ_EXPORT zconfig_t *
43
+ zconfig_loadf (const char *format, ...) CHECK_PRINTF (1);
44
+
45
+ // Destroy a config item and all its children
46
+ CZMQ_EXPORT void
47
+ zconfig_destroy (zconfig_t **self_p);
48
+
49
+ // Return name of config item
50
+ CZMQ_EXPORT char *
51
+ zconfig_name (zconfig_t *self);
52
+
53
+ // Return value of config item
54
+ CZMQ_EXPORT char *
55
+ zconfig_value (zconfig_t *self);
56
+
57
+ // Insert or update configuration key with value
58
+ CZMQ_EXPORT void
59
+ zconfig_put (zconfig_t *self, const char *path, const char *value);
60
+
61
+ // Equivalent to zconfig_put, accepting a format specifier and variable
62
+ // argument list, instead of a single string value.
63
+ CZMQ_EXPORT void
64
+ zconfig_putf (zconfig_t *self, const char *path, const char *format, ...) CHECK_PRINTF (3);
65
+
66
+ // Get value for config item into a string value; leading slash is optional
67
+ // and ignored.
68
+ CZMQ_EXPORT char *
69
+ zconfig_get (zconfig_t *self, const char *path, const char *default_value);
70
+
71
+ // Set config item name, name may be NULL
72
+ CZMQ_EXPORT void
73
+ zconfig_set_name (zconfig_t *self, const char *name);
74
+
75
+ // Set new value for config item. The new value may be a string, a printf
76
+ // format, or NULL. Note that if string may possibly contain '%', or if it
77
+ // comes from an insecure source, you must use '%s' as the format, followed
78
+ // by the string.
79
+ CZMQ_EXPORT void
80
+ zconfig_set_value (zconfig_t *self, const char *format, ...) CHECK_PRINTF (2);
81
+
82
+ // Find our first child, if any
83
+ CZMQ_EXPORT zconfig_t *
84
+ zconfig_child (zconfig_t *self);
85
+
86
+ // Find our first sibling, if any
87
+ CZMQ_EXPORT zconfig_t *
88
+ zconfig_next (zconfig_t *self);
89
+
90
+ // Find a config item along a path; leading slash is optional and ignored.
91
+ CZMQ_EXPORT zconfig_t *
92
+ zconfig_locate (zconfig_t *self, const char *path);
93
+
94
+ // Locate the last config item at a specified depth
95
+ CZMQ_EXPORT zconfig_t *
96
+ zconfig_at_depth (zconfig_t *self, int level);
97
+
98
+ // Execute a callback for each config item in the tree; returns zero if
99
+ // successful, else -1.
100
+ CZMQ_EXPORT int
101
+ zconfig_execute (zconfig_t *self, zconfig_fct handler, void *arg);
102
+
103
+ // Add comment to config item before saving to disk. You can add as many
104
+ // comment lines as you like. If you use a null format, all comments are
105
+ // deleted.
106
+ CZMQ_EXPORT void
107
+ zconfig_set_comment (zconfig_t *self, const char *format, ...) CHECK_PRINTF (2);
108
+
109
+ // Return comments of config item, as zlist.
110
+ CZMQ_EXPORT zlist_t *
111
+ zconfig_comments (zconfig_t *self);
112
+
113
+ // Save a config tree to a specified ZPL text file, where a filename
114
+ // "-" means dump to standard output.
115
+ CZMQ_EXPORT int
116
+ zconfig_save (zconfig_t *self, const char *filename);
117
+
118
+ // Equivalent to zconfig_save, taking a format string instead of a fixed
119
+ // filename.
120
+ CZMQ_EXPORT int
121
+ zconfig_savef (zconfig_t *self, const char *format, ...) CHECK_PRINTF (2);
122
+
123
+ // Report filename used during zconfig_load, or NULL if none
124
+ CZMQ_EXPORT const char *
125
+ zconfig_filename (zconfig_t *self);
126
+
127
+ // Reload config tree from same file that it was previously loaded from.
128
+ // Returns 0 if OK, -1 if there was an error (and then does not change
129
+ // existing data).
130
+ CZMQ_EXPORT int
131
+ zconfig_reload (zconfig_t **self_p);
132
+
133
+ // Load a config tree from a memory chunk
134
+ CZMQ_EXPORT zconfig_t *
135
+ zconfig_chunk_load (zchunk_t *chunk);
136
+
137
+ // Save a config tree to a new memory chunk
138
+ CZMQ_EXPORT zchunk_t *
139
+ zconfig_chunk_save (zconfig_t *self);
140
+
141
+ // Load a config tree from a null-terminated string
142
+ // Caller owns return value and must destroy it when done.
143
+ CZMQ_EXPORT zconfig_t *
144
+ zconfig_str_load (const char *string);
145
+
146
+ // Save a config tree to a new null terminated string
147
+ // Caller owns return value and must destroy it when done.
148
+ CZMQ_EXPORT char *
149
+ zconfig_str_save (zconfig_t *self);
150
+
151
+ // Return true if a configuration tree was loaded from a file and that
152
+ // file has changed in since the tree was loaded.
153
+ CZMQ_EXPORT bool
154
+ zconfig_has_changed (zconfig_t *self);
155
+
156
+ // Print the config file to open stream
157
+ CZMQ_EXPORT void
158
+ zconfig_fprint (zconfig_t *self, FILE *file);
159
+
160
+ // Print properties of object
161
+ CZMQ_EXPORT void
162
+ zconfig_print (zconfig_t *self);
163
+
164
+ // Self test of this class
165
+ CZMQ_EXPORT void
166
+ zconfig_test (bool verbose);
167
+
168
+ // @end
169
+
170
+ // Self test of this class
171
+ CZMQ_EXPORT void
172
+ zconfig_test (bool verbose);
173
+
174
+ // Compiler hints
175
+ CZMQ_EXPORT void zconfig_set_value (zconfig_t *self, const char *format, ...) CHECK_PRINTF (2);
176
+
177
+ #ifdef __cplusplus
178
+ }
179
+ #endif
180
+
181
+ // Deprecated method aliases
182
+ #define zconfig_dump(s) zconfig_print(s)
183
+ #define zconfig_resolve(s,p,d) zconfig_get((s),(p),(d))
184
+
185
+ #endif
@@ -0,0 +1,107 @@
1
+ /* =========================================================================
2
+ zctx - working with 0MQ contexts
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZCTX_H_INCLUDED__
15
+ #define __ZCTX_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+
22
+ // @interface
23
+ // Create new context, returns context object, replaces zmq_init
24
+ CZMQ_EXPORT zctx_t *
25
+ zctx_new (void);
26
+
27
+ // Destroy context and all sockets in it, replaces zmq_term
28
+ CZMQ_EXPORT void
29
+ zctx_destroy (zctx_t **self_p);
30
+
31
+ // Create new shadow context, returns context object
32
+ CZMQ_EXPORT zctx_t *
33
+ zctx_shadow (zctx_t *self);
34
+ // @end
35
+
36
+ // Create a new context by shadowing a plain zmq context
37
+ CZMQ_EXPORT zctx_t *
38
+ zctx_shadow_zmq_ctx (void *zmqctx);
39
+
40
+ // @interface
41
+ // Raise default I/O threads from 1, for crazy heavy applications
42
+ // The rule of thumb is one I/O thread per gigabyte of traffic in
43
+ // or out. Call this method before creating any sockets on the context,
44
+ // or calling zctx_shadow, or the setting will have no effect.
45
+ CZMQ_EXPORT void
46
+ zctx_set_iothreads (zctx_t *self, int iothreads);
47
+
48
+ // Set msecs to flush sockets when closing them, see the ZMQ_LINGER
49
+ // man page section for more details. By default, set to zero, so
50
+ // any in-transit messages are discarded when you destroy a socket or
51
+ // a context.
52
+ CZMQ_EXPORT void
53
+ zctx_set_linger (zctx_t *self, int linger);
54
+
55
+ // Set initial high-water mark for inter-thread pipe sockets. Note that
56
+ // this setting is separate from the default for normal sockets. You
57
+ // should change the default for pipe sockets *with care*. Too low values
58
+ // will cause blocked threads, and an infinite setting can cause memory
59
+ // exhaustion. The default, no matter the underlying ZeroMQ version, is
60
+ // 1,000.
61
+ CZMQ_EXPORT void
62
+ zctx_set_pipehwm (zctx_t *self, int pipehwm);
63
+
64
+ // Set initial send HWM for all new normal sockets created in context.
65
+ // You can set this per-socket after the socket is created.
66
+ // The default, no matter the underlying ZeroMQ version, is 1,000.
67
+ CZMQ_EXPORT void
68
+ zctx_set_sndhwm (zctx_t *self, int sndhwm);
69
+
70
+ // Set initial receive HWM for all new normal sockets created in context.
71
+ // You can set this per-socket after the socket is created.
72
+ // The default, no matter the underlying ZeroMQ version, is 1,000.
73
+ CZMQ_EXPORT void
74
+ zctx_set_rcvhwm (zctx_t *self, int rcvhwm);
75
+
76
+ // Return low-level 0MQ context object, will be NULL before first socket
77
+ // is created. Use with care.
78
+ CZMQ_EXPORT void *
79
+ zctx_underlying (zctx_t *self);
80
+
81
+ // Self test of this class
82
+ CZMQ_EXPORT void
83
+ zctx_test (bool verbose);
84
+ // @end
85
+
86
+ // Create socket within this context, for CZMQ use only
87
+ void *
88
+ zctx__socket_new (zctx_t *self, int type);
89
+
90
+ // Create pipe socket within this context, for CZMQ use only
91
+ void *
92
+ zctx__socket_pipe (zctx_t *self);
93
+
94
+ // Destroy socket within this context, for CZMQ use only
95
+ void
96
+ zctx__socket_destroy (zctx_t *self, void *socket);
97
+
98
+ // Initialize the low-level 0MQ context object, for CZMQ use only
99
+ void
100
+ zctx__initialize_underlying(zctx_t *self);
101
+ // @end
102
+
103
+ #ifdef __cplusplus
104
+ }
105
+ #endif
106
+
107
+ #endif
@@ -0,0 +1,65 @@
1
+ /* =========================================================================
2
+ zdigest - provides hashing functions (SHA-1 at present)
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZDIGEST_H_INCLUDED__
15
+ #define __ZDIGEST_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zdigest.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // Constructor - creates new digest object, which you use to build up a
27
+ // digest by repeatedly calling zdigest_update() on chunks of data.
28
+ CZMQ_EXPORT zdigest_t *
29
+ zdigest_new (void);
30
+
31
+ // Destroy a digest object
32
+ CZMQ_EXPORT void
33
+ zdigest_destroy (zdigest_t **self_p);
34
+
35
+ // Add buffer into digest calculation
36
+ CZMQ_EXPORT void
37
+ zdigest_update (zdigest_t *self, const byte *buffer, size_t length);
38
+
39
+ // Return final digest hash data. If built without crypto support,
40
+ // returns NULL.
41
+ CZMQ_EXPORT const byte *
42
+ zdigest_data (zdigest_t *self);
43
+
44
+ // Return final digest hash size
45
+ CZMQ_EXPORT size_t
46
+ zdigest_size (zdigest_t *self);
47
+
48
+ // Return digest as printable hex string; caller should not modify nor
49
+ // free this string. After calling this, you may not use zdigest_update()
50
+ // on the same digest. If built without crypto support, returns NULL.
51
+ CZMQ_EXPORT char *
52
+ zdigest_string (zdigest_t *self);
53
+
54
+ // Self test of this class.
55
+ CZMQ_EXPORT void
56
+ zdigest_test (bool verbose);
57
+
58
+ // @end
59
+
60
+
61
+ #ifdef __cplusplus
62
+ }
63
+ #endif
64
+
65
+ #endif
@@ -0,0 +1,149 @@
1
+ /* =========================================================================
2
+ zdir - work with file-system directories
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZDIR_H_INCLUDED__
15
+ #define __ZDIR_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zdir.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // Create a new directory item that loads in the full tree of the specified
27
+ // path, optionally located under some parent path. If parent is "-", then
28
+ // loads only the top-level directory, and does not use parent as a path.
29
+ CZMQ_EXPORT zdir_t *
30
+ zdir_new (const char *path, const char *parent);
31
+
32
+ // Destroy a directory tree and all children it contains.
33
+ CZMQ_EXPORT void
34
+ zdir_destroy (zdir_t **self_p);
35
+
36
+ // Return directory path
37
+ CZMQ_EXPORT const char *
38
+ zdir_path (zdir_t *self);
39
+
40
+ // Return last modification time for directory.
41
+ CZMQ_EXPORT time_t
42
+ zdir_modified (zdir_t *self);
43
+
44
+ // Return total hierarchy size, in bytes of data contained in all files
45
+ // in the directory tree.
46
+ CZMQ_EXPORT off_t
47
+ zdir_cursize (zdir_t *self);
48
+
49
+ // Return directory count
50
+ CZMQ_EXPORT size_t
51
+ zdir_count (zdir_t *self);
52
+
53
+ // Returns a sorted list of zfile objects; Each entry in the list is a pointer
54
+ // to a zfile_t item already allocated in the zdir tree. Do not destroy the
55
+ // original zdir tree until you are done with this list.
56
+ // Caller owns return value and must destroy it when done.
57
+ CZMQ_EXPORT zlist_t *
58
+ zdir_list (zdir_t *self);
59
+
60
+ // Remove directory, optionally including all files that it contains, at
61
+ // all levels. If force is false, will only remove the directory if empty.
62
+ // If force is true, will remove all files and all subdirectories.
63
+ CZMQ_EXPORT void
64
+ zdir_remove (zdir_t *self, bool force);
65
+
66
+ // Calculate differences between two versions of a directory tree.
67
+ // Returns a list of zdir_patch_t patches. Either older or newer may
68
+ // be null, indicating the directory is empty/absent. If alias is set,
69
+ // generates virtual filename (minus path, plus alias).
70
+ // Caller owns return value and must destroy it when done.
71
+ CZMQ_EXPORT zlist_t *
72
+ zdir_diff (zdir_t *older, zdir_t *newer, const char *alias);
73
+
74
+ // Return full contents of directory as a zdir_patch list.
75
+ // Caller owns return value and must destroy it when done.
76
+ CZMQ_EXPORT zlist_t *
77
+ zdir_resync (zdir_t *self, const char *alias);
78
+
79
+ // Load directory cache; returns a hash table containing the SHA-1 digests
80
+ // of every file in the tree. The cache is saved between runs in .cache.
81
+ // Caller owns return value and must destroy it when done.
82
+ CZMQ_EXPORT zhash_t *
83
+ zdir_cache (zdir_t *self);
84
+
85
+ // Print contents of directory to open stream
86
+ CZMQ_EXPORT void
87
+ zdir_fprint (zdir_t *self, FILE *file, int indent);
88
+
89
+ // Print contents of directory to stdout
90
+ CZMQ_EXPORT void
91
+ zdir_print (zdir_t *self, int indent);
92
+
93
+ // Create a new zdir_watch actor instance:
94
+ //
95
+ // zactor_t *watch = zactor_new (zdir_watch, NULL);
96
+ //
97
+ // Destroy zdir_watch instance:
98
+ //
99
+ // zactor_destroy (&watch);
100
+ //
101
+ // Enable verbose logging of commands and activity:
102
+ //
103
+ // zstr_send (watch, "VERBOSE");
104
+ //
105
+ // Subscribe to changes to a directory path:
106
+ //
107
+ // zsock_send (watch, "ss", "SUBSCRIBE", "directory_path");
108
+ //
109
+ // Unsubscribe from changes to a directory path:
110
+ //
111
+ // zsock_send (watch, "ss", "UNSUBSCRIBE", "directory_path");
112
+ //
113
+ // Receive directory changes:
114
+ // zsock_recv (watch, "sp", &path, &patches);
115
+ //
116
+ // // Delete the received data.
117
+ // free (path);
118
+ // zlist_destroy (&patches);
119
+ CZMQ_EXPORT void
120
+ zdir_watch (zsock_t *pipe, void *unused);
121
+
122
+ // Self test of this class.
123
+ CZMQ_EXPORT void
124
+ zdir_test (bool verbose);
125
+
126
+ // @end
127
+
128
+
129
+ // Returns a sorted array of zfile objects; returns a single block of memory,
130
+ // that you destroy by calling zstr_free(). Each entry in the array is a pointer
131
+ // to a zfile_t item already allocated in the zdir tree. The array ends with
132
+ // a null pointer. Do not destroy the original zdir tree until you are done
133
+ // with this array.
134
+ CZMQ_EXPORT zfile_t **
135
+ zdir_flatten (zdir_t *self);
136
+
137
+ // Free a provided string, and nullify the parent pointer. Safe to call on
138
+ // a null pointer.
139
+ CZMQ_EXPORT void
140
+ zdir_flatten_free (zfile_t ***files_p);
141
+
142
+ #ifdef __cplusplus
143
+ }
144
+ #endif
145
+
146
+ // Deprecated method aliases
147
+ #define zdir_dump(s,i) zdir_print(s,i)
148
+
149
+ #endif