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

struct nl_cache* nl_cache_mngt_require ( const char *  name  )  [read]

Demand the use of a global cache

  • name name of the required object type
Trys to find a cache of the specified type for global use.

Returns:
A cache provided by another subsystem of the specified type marked to be available.

Definition at line 230 of file cache_mngt.c.

References nl_cache_ops::co_major_cache, and nl_cache_ops_lookup().

{
      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;
}


Generated by  Doxygen 1.6.0   Back to index