diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-12-10 16:02:49 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-12-10 16:02:49 +0000 |
commit | e52bfb0ef0e1e2d08892e9401fd2510ecdf403dc (patch) | |
tree | fa4ba380dc1d56eb83a526c84d4fbcc117fecc12 /package/libs/libnl-tiny/src/cache_mngt.c | |
parent | b689b5cb8ac3e67e663a3a4b0cf17ba8f334d052 (diff) | |
download | master-187ad058-e52bfb0ef0e1e2d08892e9401fd2510ecdf403dc.tar.gz master-187ad058-e52bfb0ef0e1e2d08892e9401fd2510ecdf403dc.tar.bz2 master-187ad058-e52bfb0ef0e1e2d08892e9401fd2510ecdf403dc.zip |
libnl-tiny: remove dead code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43599 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/libs/libnl-tiny/src/cache_mngt.c')
-rw-r--r-- | package/libs/libnl-tiny/src/cache_mngt.c | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/package/libs/libnl-tiny/src/cache_mngt.c b/package/libs/libnl-tiny/src/cache_mngt.c index 5c32d2a1ff..8adbe51b0a 100644 --- a/package/libs/libnl-tiny/src/cache_mngt.c +++ b/package/libs/libnl-tiny/src/cache_mngt.c @@ -73,55 +73,6 @@ struct nl_cache_ops *nl_cache_ops_associate(int protocol, int msgtype) return NULL; } -#ifdef disabled - -/** - * Lookup message type cache association - * @arg ops cache operations - * @arg msgtype netlink message type - * - * Searches for a matching message type association ing the specified - * cache operations. - * - * @return A message type association or NULL. - */ -struct nl_msgtype *nl_msgtype_lookup(struct nl_cache_ops *ops, int msgtype) -{ - int i; - - for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) - if (ops->co_msgtypes[i].mt_id == msgtype) - return &ops->co_msgtypes[i]; - - return NULL; -} - -static struct nl_cache_ops *cache_ops_lookup_for_obj(struct nl_object_ops *obj_ops) -{ - struct nl_cache_ops *ops; - - for (ops = cache_ops; ops; ops = ops->co_next) - if (ops->co_obj_ops == obj_ops) - return ops; - - return NULL; - -} - -/** - * Call a function for each registered cache operation - * @arg cb Callback function to be called - * @arg arg User specific argument. - */ -void nl_cache_ops_foreach(void (*cb)(struct nl_cache_ops *, void *), void *arg) -{ - struct nl_cache_ops *ops; - - for (ops = cache_ops; ops; ops = ops->co_next) - cb(ops, arg); -} -#endif - /** * Register a set of cache operations * @arg ops cache operations @@ -177,77 +128,4 @@ int nl_cache_mngt_unregister(struct nl_cache_ops *ops) /** @} */ -/** - * @name Global Cache Provisioning/Requiring - * @{ - */ -#ifdef disabled -/** - * Provide a cache for global use - * @arg cache cache to provide - * - * Offers the specified cache to be used by other modules. - * Only one cache per type may be shared at a time, - * a previsouly provided caches will be overwritten. - */ -void nl_cache_mngt_provide(struct nl_cache *cache) -{ - struct nl_cache_ops *ops; - - ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); - if (!ops) - BUG(); - else - ops->co_major_cache = cache; -} - -/** - * Unprovide a cache for global use - * @arg cache cache to unprovide - * - * Cancels the offer to use a cache globally. The - * cache will no longer be returned via lookups but - * may still be in use. - */ -void nl_cache_mngt_unprovide(struct nl_cache *cache) -{ - struct nl_cache_ops *ops; - - ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); - if (!ops) - BUG(); - else if (ops->co_major_cache == cache) - ops->co_major_cache = NULL; -} - -/** - * Demand the use of a global cache - * @arg name name of the required object type - * - * Trys to find a cache of the specified type for global - * use. - * - * @return A cache provided by another subsystem of the - * specified type marked to be available. - */ -struct nl_cache *nl_cache_mngt_require(const char *name) -{ - struct nl_cache_ops *ops; - - ops = nl_cache_ops_lookup(name); - if (!ops || !ops->co_major_cache) { - fprintf(stderr, "Application BUG: Your application must " - "call nl_cache_mngt_provide() and\nprovide a valid " - "%s cache to be used for internal lookups.\nSee the " - " API documentation for more details.\n", name); - - return NULL; - } - - return ops->co_major_cache; -} - -#endif -/** @} */ - /** @} */ |