def nl_cache_mngt_register(ops):
global cache_ops<EOL>if not ops.co_name or not ops.co_obj_ops:<EOL><INDENT>return -NLE_INVAL<EOL><DEDENT>with cache_ops_lock:<EOL><INDENT>if _nl_cache_ops_lookup(ops.co_name):<EOL><INDENT>return -NLE_EXIST<EOL><DEDENT>ops.co_refcnt = <NUM_LIT:0><EOL>ops.co_next = cache_ops<EOL>cache_ops = ops<EOL><DEDENT>_LOGGER.debug('<STR_LIT>'.format(ops.co_name))<EOL>return <NUM_LIT:0><EOL>
Register a set of cache operations.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L252

    Called by users of caches to announce the availability of a certain cache type.

    Positional arguments:
    ops -- cache operations (nl_cache_ops class instance).

    Returns:
    0 on success or a negative error code.