next up previous contents index
Next: 5.2 Global Registry Up: 5.1 oskit_services: registration database Previous: 5.1.4 lookup_first: Obtain the

5.1.5 create: Create a new services database object

 

SYNOPSIS

#include <oskit/com/services.h> #include <oskit/com/mem.h>

oskit_error_t oskit_services_create(struct oskit_mem *memobject, [out] oskit_services_t **out_interface);

DESCRIPTION

Create a new oskit_services object. An optional oskit_mem COM object, which if provided, is used to satisfy memory requests inside the services object. If a memory object is not provided, the global registry is consulted for the default memory object.

The reason for the providing a memory object is so that the internal implementation does not need to depend on malloc for creating its internal data structures. This makes is possible to use services objects in different environments, such as device driver libraries. Note that the array returned from oskit_services_lookup is allocated with malloc, and should be released with free

PARAMETERS

memobject
An optional oskit_mem COM interface. May be NULL, in which case the global registry is consulted for the default memory object.
out_interface
The location to store the new oskit_services COM interface object.

RETURNS

Returns 0 on success, or OSKIT_E_OUTOFMEMORY if the services object could not be created because of a memory shortage.



Utah Flux Research Group