libmcs  0.6.0
Functions | Variables
mcs_backends.c File Reference
#include "libmcs/mcs.h"

Functions

mcs_response_t mcs_backend_register (mcs_backend_t *b)
 Registers a custom mcs.backend.
mcs_response_t mcs_backend_unregister (mcs_backend_t *b)
 Unregisters a custom mcs.backend.
mowgli_queue_t * mcs_backend_get_list (void)
 Returns a mowgli.queue representing the backends list.
const char * mcs_backend_select (void)
 Determines the backend that should be used.

Variables

mowgli_queue_t * mcs_backends_lst

Function Documentation

mowgli_queue_t* mcs_backend_get_list ( void  )

Returns a mowgli.queue representing the backends list.

This is the portable version of using the mcs_backends_lst symbol.

Returns:
A mowgli.queue representing the backend list.

References mcs_backends_lst.

Referenced by mcs_backend_select().

mcs_response_t mcs_backend_register ( mcs_backend_t b)

Registers a custom mcs.backend.

This is used to register a named mcs.backend vtable with mcs. This should be unregistered with mcs_backend_unregister() when it is no longer needed, such as during an application unload.

Parameters:
bAn mcs.backend vtable to register.
Returns:
A mcs_response_t code depending on success or failure of the registration.

References mcs_backends_lst, and MCS_OK.

Referenced by mcs_load_plugins().

const char* mcs_backend_select ( void  )

Determines the backend that should be used.

This function checks the environment variable, MCS_BACKEND first. If that is empty, it checks $HOME/.mcs-backend, followed by /etc/mcs-backend. If no preference is found, it returns "default".

Returns:
The name of the backend that should be used.

References mcs_backend_get_list(), and mcs_backend_t::name.

Referenced by mcs_new().

mcs_response_t mcs_backend_unregister ( mcs_backend_t b)

Unregisters a custom mcs.backend.

This is used to unregister a named mcs.backend vtable with mcs. This should be called when you are no longer interested in using the backend implementation with mcs.

Parameters:
bAn mcs.backend vtable to register.
Returns:
A mcs_response_t code depending on success or failure of the deregistration.

References mcs_backends_lst, and MCS_OK.


Variable Documentation

mowgli_queue_t* mcs_backends_lst