hand Module
[Bio-SPHERE Modules]

Collaboration diagram for hand Module:


Functions

static bs_status bsmod_hand_init (void)
static void remove_temp_file (void)
static bs_status bsmod_hand_cleanup (void)
static bs_service_responsecreate_status_response (const bs_service_request *request, bs_status status, char *message)
static bs_service_responsemake_answer (const bs_service_request *request)
static void wait_for_answer (void)
static bs_status bsmod_hand_handle_service (const bs_service_request *request, bs_service_response **response, void *extra)

Variables

bs_module bsmod_symtable
static FILE * companion
static apr_pool_t * mempool
bs_module bsmod_symtable

Function Documentation

static bs_status bsmod_hand_cleanup ( void   )  [static]

Cleanup the hand module by destroying its memory pool

Definition at line 107 of file bsmod_hand.c.

References BS_OK, companion, and mempool.

static bs_status bsmod_hand_handle_service ( const bs_service_request request,
bs_service_response **  response,
void *  extra 
) [static]

Service handling routine. Since the hand module doesn't offer any services, it will return BS_NO_SERVICE on all occasions.

Definition at line 191 of file bsmod_hand.c.

References BS_NO_SERVICE, BS_OK, companion, bs_part_instance::data, bs_service_request::input, make_answer(), bs_service_request::operation, bs_message_instance::parts, remove_temp_file(), streq(), and wait_for_answer().

Here is the call graph for this function:

static bs_status bsmod_hand_init ( void   )  [static]

Initialize the hand module by creating a UUID for it.

Definition at line 75 of file bsmod_hand.c.

References BS_ERROR, BS_OK, companion, and mempool.

static bs_service_response* create_status_response ( const bs_service_request request,
bs_status  status,
char *  message 
) [static]

Create a correct service response message for all the operations in the module.

Parameters:
request The original request issued
status The status code part of the message
message The message part of the return message
Returns:
Service response structure or NULL if there was an error.

Definition at line 123 of file bsmod_hand.c.

References data, mempool, new_bs_data_type(), new_bs_message_instance(), new_bs_part_instance(), new_bs_service_response(), bs_service_request::operation, bs_message_instance::parts, bs_service_request::port, bs_service_request::service, and bs_service_request::uuid.

Referenced by bsmod_password_handle_service(), and make_answer().

Here is the call graph for this function:

static bs_service_response* make_answer ( const bs_service_request request  )  [static]

Reads the produced answer file and creates an appropriate status response. Aftwerwards, the answer file is deleted.

Definition at line 160 of file bsmod_hand.c.

References BS_OK, create_status_response(), len(), mempool, read_file_into_buf(), remove_temp_file(), and runtestsuite::rv.

Referenced by bsmod_hand_handle_service(), and bsmod_keystroke_handle_service().

Here is the call graph for this function:

static void remove_temp_file ( void   )  [static]

The companion java program leaves a temporary file called answer.tmp. Because this file is overwritten each time a request is made, it should be deleted before making the request.

Definition at line 98 of file bsmod_hand.c.

Referenced by bsmod_hand_handle_service(), bsmod_keystroke_handle_service(), and make_answer().

static void wait_for_answer ( void   )  [static]

Keep waiting until the temporary file shows up.

Definition at line 179 of file bsmod_hand.c.

Referenced by bsmod_hand_handle_service(), and bsmod_keystroke_handle_service().


Variable Documentation

bs_module bsmod_symtable

Initial value:

 {
        
        0,
        0,
        
        
        0,
        1,
        
        
        "hand module",
        "M.A.Hartman",
        "apr 10, 2007",
        "(c) 2007, M.A.Hartman. See distributed LICENSE file for more information.",
        "A keystroking biometrics module. It implements some basic keystroking "
        "methods based mostly on text-dependent input, such as passwords.",
        
        
        bsmod_hand_init,
        bsmod_hand_cleanup,
        
        
        bsmod_hand_handle_service,
        NULL,
        "bsmod_hand.wsdl"
}

Definition at line 238 of file bsmod_hand.c.

bs_module bsmod_symtable

The symbol table of the hand module.

Definition at line 59 of file bsmod_hand.c.

FILE* companion [static]

Pipe to the companion program for writing commands.

Definition at line 64 of file bsmod_hand.c.

Referenced by bsmod_hand_cleanup(), bsmod_hand_handle_service(), bsmod_hand_init(), bsmod_keystroke_cleanup(), bsmod_keystroke_handle_service(), and bsmod_keystroke_init().

apr_pool_t* mempool [static]

Private memory pool used by the module.

Definition at line 69 of file bsmod_hand.c.

Referenced by bsmod_hand_cleanup(), bsmod_hand_init(), bsmod_keystroke_cleanup(), bsmod_keystroke_init(), create_status_response(), and make_answer().


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