DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# ResourceSubscribe

Track a resource

## SYNOPSIS

dip_Error dip_ResourceSubscribe( resource, freeResourceHandler, resources )

## FUNCTION

Track a resource. The resource must be represented by a `void *`. A handler function to free the resource must be given. This function will be called through dip_ResourcesFree with the resource as its only parameter. If `dip_ResourceSubscribe` fails, the resource is not registered. It is allowed to pass a zero instead of a `dip_Resources` structure, in which case `dip_ResourceSubscribe` returns silently.

## ARGUMENTS

Data type | Name | Description
`void *` | `resource` | The resource that must be registered
`dip_ResourcesFreeHandler` | `freeResourceHandler` | The handler function that will be invoked by `dip_ResourcesFree` to free the resource
`dip_Resources` | `resources` | `dip_Resources` structure to register the resource with

## SEE ALSO

`ResourcesNew`, `ResourcesFree`, `ResourcesMerge`, `ResourceUnsubscribe`