/Users/maurits/Documents/studie/afstuderen/biosphere/daemon/service.h File Reference

#include <biosphere.h>
#include <biosphere_module.h>
#include <apr_pools.h>

Include dependency graph for service.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bs_status init_service (apr_pool_t *mp)
bs_status add_service (bs_definition *def, service_request_handler handler)
bs_status remove_service (const char *name)
bs_status get_services (bs_definition **def, apr_pool_t *mp)
bs_status handle_service_request (const bs_service_request *request, bs_service_response **response, void *mp)


Function Documentation

bs_status add_service ( bs_definition def,
service_request_handler  handler 
)

Add a service to the services pool. Since the service is meant to persist, it will be allocated from the global memory pool.

Parameters:
def Service definition structure
handler Function pointer to handler function
Returns:
status code

Definition at line 105 of file service.c.

References BS_OK, BS_SERVICE_DOUBLE, service_info::def, global_mp, service_info::handler, list_append(), list_index(), list_size(), lock_pool_mux(), lock_service_mux(), bs_definition::name, services_pool, streq(), unlock_pool_mux(), and unlock_service_mux().

Referenced by init_service(), and load_module().

Here is the call graph for this function:

bs_status get_services ( bs_definition **  def,
apr_pool_t *  mp 
)

Gather all service definitions of the core services and the various modules into a single definition.

Parameters:
def Result pointer to the definition to populate
mp Memory pool to allocate from
Returns:
Status code.

Definition at line 154 of file service.c.

References BS_ERROR, BS_OK, service_info::def, list_index(), list_size(), lock_service_mux(), merge_def_with_def(), new_bs_definition(), runtestsuite::rv, services_pool, and unlock_service_mux().

Referenced by handle_http_get().

Here is the call graph for this function:

bs_status handle_service_request ( const bs_service_request request,
bs_service_response **  response,
void *  mp 
)

Handle a service request. First, the pool of installed services is searched for a suitable service. Then the handler of this service is called and the response is returned in the result pointer argument.

Parameters:
request The service request to be serviced
response Pointer where the result will be stored
mp Memory pool to allocate from (void pointer for compatibility).
Returns:
Status code

Definition at line 205 of file service.c.

References BS_ERROR, BS_OK, copy_response(), global_mp, handle_service_request_remotely(), list_index(), list_size(), lock_pool_mux(), lock_service_mux(), pool, request_corresponds_with_definition(), runtestsuite::rv, services_pool, unlock_pool_mux(), and unlock_service_mux().

Referenced by handle_http_post(), and load_module().

Here is the call graph for this function:

bs_status init_service ( apr_pool_t *  mp  ) 

Initialize the services subsystem by setting up the appropriate data structures. After that create the wrapper around several functions that makes up the core service.

Parameters:
mp Memory pool to use.
Returns:
Status code

Definition at line 71 of file service.c.

References add_service(), BIOSPHERED_PREFIX, BS_OK, core_service_request_handler(), CORE_SERVICES_DEFINITION_FILE, len(), new_list(), read_file_into_buf(), runtestsuite::rv, services_pool, and xlate_from_xml().

Referenced by main().

Here is the call graph for this function:

bs_status remove_service ( const char *  name  ) 

Remove the named service.

Parameters:
name Name of the service
Returns:
Status code.

Definition at line 136 of file service.c.

References BS_OK, list_index(), list_remove(), list_size(), lock_service_mux(), services_pool, streq(), and unlock_service_mux().

Referenced by unload_all_modules(), and unload_module().

Here is the call graph for this function:


Generated on Tue Jul 17 09:51:13 2007 for Bio-SPHERE by  doxygen 1.5.1