37 #include "platform.hpp" 38 #if defined ZMQ_HAVE_WINDOWS 60 for (
unsigned short i = 0; i !=
count; ++i) {
75 unsigned char c = *prefix_;
87 unsigned char oldc =
min;
93 for (
unsigned short i = 0; i !=
count; ++i)
101 unsigned short old_count =
count;
106 for (
unsigned short i = old_count; i !=
count; i++)
107 next.table [i] = NULL;
112 unsigned short old_count =
count;
118 old_count * sizeof (
trie_t*));
119 for (
unsigned short i = 0; i !=
min - c; i++)
120 next.table [i] = NULL;
133 return next.node->add (prefix_ + 1, size_ - 1);
142 return next.table [c -
min]->add (prefix_ + 1, size_ - 1);
155 unsigned char c = *prefix_;
165 bool ret = next_node->
rm (prefix_ + 1, size_ - 1);
202 node =
next.table [0];
214 unsigned char new_min =
min;
215 for (
unsigned short i = 1; i <
count; ++i) {
216 if (
next.table [i]) {
227 count = count - (new_min -
min);
231 memmove (
next.table, old_table + (new_min -
min),
232 sizeof (
trie_t*) * count);
242 unsigned short new_count =
count;
243 for (
unsigned short i = 1; i <
count; ++i) {
244 if (
next.table [count - 1 - i]) {
245 new_count = count - i;
256 memmove (
next.table, old_table, sizeof (
trie_t*) * count);
281 unsigned char c = *data_;
282 if (c < current->
min || c >= current->
min + current->
count)
286 if (current->
count == 1)
299 void *arg_),
void *arg_)
301 unsigned char *buff = NULL;
307 unsigned char **buff_,
size_t buffsize_,
size_t maxbuffsize_,
308 void (*func_) (
unsigned char *data_,
size_t size_,
void *arg_),
void *arg_)
312 func_ (*buff_, buffsize_, arg_);
315 if (buffsize_ >= maxbuffsize_) {
316 maxbuffsize_ = buffsize_ + 256;
317 *buff_ = (
unsigned char*) realloc (*buff_, maxbuffsize_);
327 (*buff_) [buffsize_] =
min;
329 next.node->apply_helper (buff_, buffsize_, maxbuffsize_, func_, arg_);
334 for (
unsigned short c = 0; c !=
count; c++) {
335 (*buff_) [buffsize_] =
min + c;
337 next.table [c]->apply_helper (buff_, buffsize_ + 1, maxbuffsize_,
#define LIBZMQ_DELETE(p_object)
unsigned short live_nodes
bool is_redundant() const
union zmq::trie_t::@62 next
void apply_helper(unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void(*func_)(unsigned char *data_, size_t size_, void *arg_), void *arg_)
bool add(unsigned char *prefix_, size_t size_)
bool check(unsigned char *data_, size_t size_)
void apply(void(*func_)(unsigned char *data_, size_t size_, void *arg_), void *arg_)
bool rm(unsigned char *prefix_, size_t size_)