#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);
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
- 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 0 on success, or OSKIT_E_OUTOFMEMORY if the services object could not be created because of a memory shortage.