Skip to content

Commit

Permalink
Problem: project files are out of date
Browse files Browse the repository at this point in the history
Solution: regenerate via zproject
  • Loading branch information
hintjens committed Feb 23, 2015
1 parent 3e2882e commit 728e993
Show file tree
Hide file tree
Showing 17 changed files with 258 additions and 164 deletions.
4 changes: 2 additions & 2 deletions bindings/python/czmq.py
Expand Up @@ -985,8 +985,8 @@ def test(verbose):


# zhash
zhash_free_fn = CFUNCTYPE(None, c_void_p)
zhash_foreach_fn = CFUNCTYPE(c_int, c_char_p, c_void_p, c_void_p)
free_fn = CALLBACK(None, c_void_p)
foreach_fn = CALLBACK(c_int, c_char_p, c_void_p, c_void_p)
lib.zhash_new.restype = zhash_p
lib.zhash_new.argtypes = []
lib.zhash_destroy.restype = None
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2008/czmq/czmq.vcproj
Expand Up @@ -1557,9 +1557,9 @@
<File RelativePath="..\..\..\..\include\czmq_library.h" />
<File RelativePath="..\..\..\..\include\czmq_prelude.h" />
<File RelativePath="..\..\..\..\include\czmq.h" />
<File RelativePath="..\..\..\..\src\zgossip_engine.inc" />
<File RelativePath="..\..\..\..\src\zhash_primes.inc" />
<File RelativePath="..\..\..\..\src\zclass_example.xml" />
<File RelativePath="..\..\..\..\src\zgossip_engine_inc" />
<File RelativePath="..\..\..\..\src\zhash_primes_inc" />
<File RelativePath="..\..\..\..\src\zclass_example_xml" />
</Filter>
</Files>
<Globals />
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2010/czmq/czmq.vcxproj
Expand Up @@ -80,9 +80,9 @@
<ClInclude Include="..\..\..\..\include\czmq_library.h" />
<ClInclude Include="..\..\..\..\include\czmq_prelude.h" />
<ClInclude Include="..\..\..\..\include\czmq.h" />
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes.inc" />
<ClInclude Include="..\..\..\..\src\zclass_example.xml" />
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes_inc" />
<ClInclude Include="..\..\..\..\src\zclass_example_xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zactor.c">
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2010/czmq/czmq.vcxproj.filters
Expand Up @@ -141,13 +141,13 @@
<ClInclude Include="..\..\..\..\include\czmq.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc">
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zhash_primes.inc">
<ClInclude Include="..\..\..\..\src\zhash_primes_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zclass_example.xml">
<ClInclude Include="..\..\..\..\src\zclass_example_xml">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2012/czmq/czmq.vcxproj
Expand Up @@ -80,9 +80,9 @@
<ClInclude Include="..\..\..\..\include\czmq_library.h" />
<ClInclude Include="..\..\..\..\include\czmq_prelude.h" />
<ClInclude Include="..\..\..\..\include\czmq.h" />
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes.inc" />
<ClInclude Include="..\..\..\..\src\zclass_example.xml" />
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes_inc" />
<ClInclude Include="..\..\..\..\src\zclass_example_xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zactor.c">
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2012/czmq/czmq.vcxproj.filters
Expand Up @@ -141,13 +141,13 @@
<ClInclude Include="..\..\..\..\include\czmq.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc">
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zhash_primes.inc">
<ClInclude Include="..\..\..\..\src\zhash_primes_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zclass_example.xml">
<ClInclude Include="..\..\..\..\src\zclass_example_xml">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2013/czmq/czmq.vcxproj
Expand Up @@ -80,9 +80,9 @@
<ClInclude Include="..\..\..\..\include\czmq_library.h" />
<ClInclude Include="..\..\..\..\include\czmq_prelude.h" />
<ClInclude Include="..\..\..\..\include\czmq.h" />
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes.inc" />
<ClInclude Include="..\..\..\..\src\zclass_example.xml" />
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc" />
<ClInclude Include="..\..\..\..\src\zhash_primes_inc" />
<ClInclude Include="..\..\..\..\src\zclass_example_xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zactor.c">
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2013/czmq/czmq.vcxproj.filters
Expand Up @@ -141,13 +141,13 @@
<ClInclude Include="..\..\..\..\include\czmq.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zgossip_engine.inc">
<ClInclude Include="..\..\..\..\src\zgossip_engine_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zhash_primes.inc">
<ClInclude Include="..\..\..\..\src\zhash_primes_inc">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\zclass_example.xml">
<ClInclude Include="..\..\..\..\src\zclass_example_xml">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion doc/zframe.doc
Expand Up @@ -16,7 +16,8 @@ This is the class interface:
#define ZFRAME_REUSE 2
#define ZFRAME_DONTWAIT 4

// Create a new frame with optional size, and optional data
// Constructor; if size is >0, allocates frame with that size, and if data
// is not null, copies data into frame.
CZMQ_EXPORT zframe_t *
zframe_new (const void *data, size_t size);

Expand Down
3 changes: 2 additions & 1 deletion doc/zframe.txt
Expand Up @@ -12,7 +12,8 @@ SYNOPSIS
#define ZFRAME_REUSE 2
#define ZFRAME_DONTWAIT 4

// Create a new frame with optional size, and optional data
// Constructor; if size is >0, allocates frame with that size, and if data
// is not null, copies data into frame.
CZMQ_EXPORT zframe_t *
zframe_new (const void *data, size_t size);

Expand Down
134 changes: 68 additions & 66 deletions doc/zhash.doc
Expand Up @@ -9,31 +9,36 @@ do ~2.5M lookups per second for 16-char keys. Timed on a 1.6GHz CPU.

This is the class interface:

// Callback function for zhash_freefn method
typedef void (zhash_free_fn) (void *data);
// Callback function for zhash_freefn method
typedef void (zhash_free_fn) (
void *data);

// DEPRECATED as clumsy -- use zhash_first/_next instead
typedef int (zhash_foreach_fn) (
const char *key, void *item, void *argument);

// Create a new, empty hash container
CZMQ_EXPORT zhash_t *
zhash_new (void);
zhash_new ();

// Destroy a hash container and all items in it
CZMQ_EXPORT void
zhash_destroy (zhash_t **self_p);

// Insert item into hash table with specified key and item.
// Insert item into hash table with specified key and item.
// If key is already present returns -1 and leaves existing item unchanged
// Returns 0 on success.
// Returns 0 on success.
CZMQ_EXPORT int
zhash_insert (zhash_t *self, const char *key, void *item);

// Update item into hash table with specified key and item.
// If key is already present, destroys old item and inserts new one.
// Update item into hash table with specified key and item.
// If key is already present, destroys old item and inserts new one.
// Use free_fn method to ensure deallocator is properly called on item.
CZMQ_EXPORT void
zhash_update (zhash_t *self, const char *key, void *item);

// Remove an item specified by key from the hash table. If there was no such
// item, this function does nothing.
// item, this function does nothing.
CZMQ_EXPORT void
zhash_delete (zhash_t *self, const char *key);

Expand All @@ -42,124 +47,121 @@ This is the class interface:
zhash_lookup (zhash_t *self, const char *key);

// Reindexes an item from an old key to a new key. If there was no such
// item, does nothing. Returns 0 if successful, else -1.
// item, does nothing. Returns 0 if successful, else -1.
CZMQ_EXPORT int
zhash_rename (zhash_t *self, const char *old_key, const char *new_key);

// Set a free function for the specified hash table item. When the item is
// destroyed, the free function, if any, is called on that item.
// Use this when hash items are dynamically allocated, to ensure that
// you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
// Returns the item, or NULL if there is no such item.
// destroyed, the free function, if any, is called on that item.
// Use this when hash items are dynamically allocated, to ensure that
// you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
// Returns the item, or NULL if there is no such item.
CZMQ_EXPORT void *
zhash_freefn (zhash_t *self, const char *key, zhash_free_fn *free_fn);
zhash_freefn (zhash_t *self, const char *key, zhash_free_fn free_fn);

// Return the number of keys/items in the hash table
CZMQ_EXPORT size_t
CZMQ_EXPORT size_t *
zhash_size (zhash_t *self);

// Make copy of hash table; if supplied table is null, returns null.
// Does not copy items themselves. Rebuilds new table so may be slow on
// Make copy of hash table; if supplied table is null, returns null.
// Does not copy items themselves. Rebuilds new table so may be slow on
// very large tables. NOTE: only works with item values that are strings
// since there's no other way to know how to duplicate the item value.
// since there's no other way to know how to duplicate the item value.
CZMQ_EXPORT zhash_t *
zhash_dup (zhash_t *self);

// Return keys for items in table
CZMQ_EXPORT zlist_t *
zhash_keys (zhash_t *self);
// Simple iterator; returns first item in hash table, in no given order,
// or NULL if the table is empty. This method is simpler to use than the

// Simple iterator; returns first item in hash table, in no given order,
// or NULL if the table is empty. This method is simpler to use than the
// foreach() method, which is deprecated. To access the key for this item
// use zhash_cursor(). NOTE: do NOT modify the table while iterating.
// use zhash_cursor(). NOTE: do NOT modify the table while iterating.
CZMQ_EXPORT void *
zhash_first (zhash_t *self);

// Simple iterator; returns next item in hash table, in no given order,
// Simple iterator; returns next item in hash table, in no given order,
// or NULL if the last item was already returned. Use this together with
// zhash_first() to process all items in a hash table. If you need the
// items in sorted order, use zhash_keys() and then zlist_sort(). To
// access the key for this item use zhash_cursor(). NOTE: do NOT modify
// the table while iterating.
// zhash_first() to process all items in a hash table. If you need the
// items in sorted order, use zhash_keys() and then zlist_sort(). To
// access the key for this item use zhash_cursor(). NOTE: do NOT modify
// the table while iterating.
CZMQ_EXPORT void *
zhash_next (zhash_t *self);

// After a successful first/next method, returns the key for the item that
// was returned. This is a constant string that you may not modify or
// deallocate, and which lasts as long as the item in the hash. After an
// unsuccessful first/next, returns NULL.
// was returned. This is a constant string that you may not modify or
// deallocate, and which lasts as long as the item in the hash. After an
// unsuccessful first/next, returns NULL.
CZMQ_EXPORT const char *
zhash_cursor (zhash_t *self);

// Add a comment to hash table before saving to disk. You can add as many
// Add a comment to hash table before saving to disk. You can add as many
// comment lines as you like. These comment lines are discarded when loading
// the file. If you use a null format, all comments are deleted.
// the file. If you use a null format, all comments are deleted.
CZMQ_EXPORT void
zhash_comment (zhash_t *self, const char *format, ...);
zhash_comment (zhash_t *self, format_t *format);

// Serialize hash table to a binary frame that can be sent in a message.
// The packed format is compatible with the 'dictionary' type defined in
// http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
//
// ; A list of name/value pairs
// dictionary = dict-count *( dict-name dict-value )
// dict-count = number-4
// dict-value = longstr
// dict-name = string
//
// ; Strings are always length + text contents
// longstr = number-4 *VCHAR
// string = number-1 *VCHAR
//
// ; Numbers are unsigned integers in network byte order
// number-1 = 1OCTET
// number-4 = 4OCTET
//
// Comments are not included in the packed data. Item values MUST be
// strings.
// http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
//
// ; A list of name/value pairs
// dictionary = dict-count *( dict-name dict-value )
// dict-count = number-4
// dict-value = longstr
// dict-name = string
//
// ; Strings are always length + text contents
// longstr = number-4 *VCHAR
// string = number-1 *VCHAR
//
// ; Numbers are unsigned integers in network byte order
// number-1 = 1OCTET
// number-4 = 4OCTET
//
// Comments are not included in the packed data. Item values MUST be
// strings.
CZMQ_EXPORT zframe_t *
zhash_pack (zhash_t *self);

// Unpack binary frame into a new hash table. Packed data must follow format
// defined by zhash_pack. Hash table is set to autofree. An empty frame
// unpacks to an empty hash table.
// defined by zhash_pack. Hash table is set to autofree. An empty frame
// unpacks to an empty hash table.
CZMQ_EXPORT zhash_t *
zhash_unpack (zframe_t *frame);

// Save hash table to a text file in name=value format. Hash values must be
// printable strings; keys may not contain '=' character. Returns 0 if OK,
// else -1 if a file error occurred.
// printable strings; keys may not contain '=' character. Returns 0 if OK,
// else -1 if a file error occurred.
CZMQ_EXPORT int
zhash_save (zhash_t *self, const char *filename);

// Load hash table from a text file in name=value format; hash table must
// Load hash table from a text file in name=value format; hash table must
// already exist. Hash values must printable strings; keys may not contain
// '=' character. Returns 0 if OK, else -1 if a file was not readable.
// '=' character. Returns 0 if OK, else -1 if a file was not readable.
CZMQ_EXPORT int
zhash_load (zhash_t *self, const char *filename);

// When a hash table was loaded from a file by zhash_load, this method will
// reload the file if it has been modified since, and is "stable", i.e. not
// still changing. Returns 0 if OK, -1 if there was an error reloading the
// file.
// file.
CZMQ_EXPORT int
zhash_refresh (zhash_t *self);

// Set hash for automatic value destruction
CZMQ_EXPORT void
zhash_autofree (zhash_t *self);

// DEPRECATED as clumsy -- use zhash_first/_next instead
typedef int (zhash_foreach_fn) (const char *key, void *item, void *argument);

// DEPRECATED as clumsy -- use zhash_first/_next instead
// DEPRECATED as clumsy -- use zhash_first/_next instead
// Apply function to each item in the hash table. Items are iterated in no
// defined order. Stops if callback function returns non-zero and returns
// final return code from callback function (zero = success).
// Callback function for zhash_foreach method
// defined order. Stops if callback function returns non-zero and returns
// final return code from callback function (zero = success).
// Callback function for zhash_foreach method
CZMQ_EXPORT int
zhash_foreach (zhash_t *self, zhash_foreach_fn *callback, void *argument);
zhash_foreach (zhash_t *self, zhash_foreach_fn callback, void *argument);

// Self test of this class
CZMQ_EXPORT void
Expand Down

0 comments on commit 728e993

Please sign in to comment.