]> granicus.if.org Git - libnl/commitdiff
hashtable: remove internal data structures from public API
authorThomas Haller <thaller@redhat.com>
Wed, 29 Jun 2016 10:06:08 +0000 (12:06 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 8 Jul 2016 10:02:07 +0000 (12:02 +0200)
Hide the internal data structures for hashtable from public header
"hashtable.h".

Note that we just recently broke ABI/API by modifying these structs.

Maybe the entire hashtable API should be private. Anyway, that seems
to late now.

Fixes: c6f89ed02f04ac4984be34418774a7b06ff54f79
Signed-off-by: Thomas Haller <thaller@redhat.com>
include/netlink-private/cache-api.h
include/netlink/hashtable.h

index 0b39bfacb46249453146cacc1d2070dffb1acf2c..7ab4bc774262eb76d2901492fcda92d1020c422c 100644 (file)
@@ -276,6 +276,18 @@ struct nl_cache_ops
        struct nl_msgtype       co_msgtypes[];
 };
 
+struct nl_hash_node {
+       uint32_t key;
+       uint32_t key_size;
+       struct nl_object *obj;
+       struct nl_list_head list;
+};
+
+struct nl_hash_table {
+       int size;
+       struct nl_hash_node **nodes;
+};
+
 /** @} */
 
 #ifdef __cplusplus
index c52f6e129cf80d1b87192af1ee0957c1e5dd36b6..c0c0f2ce78f5bf62352e5c80961d80db14c0ef31 100644 (file)
 extern "C" {
 #endif
 
-typedef struct nl_hash_node {
-    uint32_t                   key;
-    uint32_t                   key_size;
-    struct nl_object *         obj;
-    struct nl_list_head                list;
-} nl_hash_node_t;
-
-typedef struct nl_hash_table {
-    int                        size;
-    nl_hash_node_t **          nodes;
-} nl_hash_table_t;
+typedef struct nl_hash_node nl_hash_node_t;
+typedef struct nl_hash_table nl_hash_table_t;
 
 /* Default hash table size */
 #define NL_MAX_HASH_ENTRIES 1024