Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

struct nl_cache* nl_cache_alloc ( struct nl_cache_ops ops  )  [read]

Allocate an empty cache

  • ops cache operations to base the cache on
Returns:
A newly allocated and initialized cache.

Definition at line 173 of file cache.c.

Referenced by flnl_result_alloc_cache(), nl_cache_alloc_name(), nl_cache_mngr_add(), nl_cache_subset(), rtnl_class_alloc_cache(), rtnl_cls_alloc_cache(), rtnl_route_alloc_cache(), and rtnl_rule_alloc_cache().

{
      struct nl_cache *cache;

      cache = calloc(1, sizeof(*cache));
      if (!cache)
            return NULL;

      nl_init_list_head(&cache->c_items);
      cache->c_ops = ops;

      NL_DBG(2, "Allocated cache %p <%s>.\n", cache, nl_cache_name(cache));

      return cache;
}


Generated by  Doxygen 1.6.0   Back to index