/* Allocate an empty cache based on type name  */
int nl_cache_alloc_name(const char *kind, struct nl_cache **result)
/* Allocate an empty cache based on type name  */
int nl_cache_alloc_name(const char *kind, struct nl_cache **result)
{
	struct nl_cache_ops *ops;
	struct nl_cache *cache;
	ops = nl_cache_ops_lookup(kind);
	if (!ops)
		return -NLE_NOCACHE;
	if (!(cache = nl_cache_alloc(ops)))
		return -NLE_NOMEM;
	*result = cache;
	return 0;
}