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

int nl_cache_mngt_register ( struct nl_cache_ops ops  ) 

Register a set of cache operations

  • ops cache operations
Called by users of caches to announce the avaibility of a certain cache type.

Returns:
0 on success or a negative error code.

Definition at line 131 of file cache_mngt.c.

References nl_cache_ops::co_name, nl_cache_ops::co_next, nl_cache_ops::co_obj_ops, and nl_cache_ops_lookup().

Referenced by genl_register().

{
      if (!ops->co_name || !ops->co_obj_ops)
            return -NLE_INVAL;

      if (nl_cache_ops_lookup(ops->co_name))
            return -NLE_EXIST;

      ops->co_next = cache_ops;
      cache_ops = ops;

      NL_DBG(1, "Registered cache operations %s\n", ops->co_name);

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index