Skip to main content

Name

config_rsrc_setup — Register a resource

Synopsis

#include "hooks/core/config_resource_setup.h"

| int **config_rsrc_setup** ( | closure, |   | |   | transaction); |   |

void * <var class="pdparam">closure</var>; ec_config_header *<var class="pdparam">transaction</var>;

Description

This hook point is suitable for registering resources using the [ec_config_rsrc_get](/momentum/4/apis-ec-config-rsrc-get) function with the EC_CFG_RSRC_REGISTERING flag. This hook must be used by non-singleton modules to register their resources and can optionally be used by singleton modules.

This hook allows resources to be set up within the current configuration transaction. If this hook is not used, then resources may "disappear" when a configuration option is changed with config set or config unset . For documentation of these console commands, see config.

Parameters

closure

Pointer to the closure

transaction

For a description of this data type, see ec_config_header.

Return Values

This hook returns void.

Threading

This hook will be called in any thread.

See Also

Was this page helpful?