index_ipc.h File Reference

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

Go to the source code of this file.

Functions

G_BEGIN_DECLS void ipc_set_services ()
 Setup IPC connection and register API functions.
void ipc_unset_services (void)
 Unregister API functions.
gboolean ipc_send_store_metadata (const char *dir, const char *document)
 Send message to store metadata to UDS.

Function Documentation

gboolean ipc_send_store_metadata ( const char *  dir,
const char *  document 
)

Send message to store metadata to UDS.

---------------------------------------------------------------------------

Name : ipc_send_store_metadata

Parameters:
[in] document String of document to open
Returns:
TRUE on success, FALSE otherwise

--------------------------------------------------------------------------

Definition at line 117 of file index_ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_UDS, DBUS_STORE_METADATA_TIMEOUT, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string_and_wait(), eripc_set_timeout(), ERRORPRINTF, and LOGPRINTF.

Referenced by send_store_metadata().

00118 {
00119     LOGPRINTF("entry");
00120     
00121     char* fullpath = (char *)calloc(strlen(dir) + strlen(document) + 2, sizeof(char));
00122     strcat(fullpath, dir);
00123     strcat(fullpath, "/");
00124     strcat(fullpath, document);    
00125     
00126     eripc_error_t retval;
00127 
00128     g_return_val_if_fail(document != NULL, FALSE);
00129     
00130     int status = (int)eripc_set_timeout(eripcClient->context,  DBUS_STORE_METADATA_TIMEOUT);
00131     if (status != 0)
00132     {
00133         ERRORPRINTF("Could not set timeout, status = [%d]", status);
00134     }
00135 
00136     retval = eripc_send_string_and_wait(eripcClient->context,
00137                                NULL,
00138                                ERIPC_BUS_SESSION,
00139                                DBUS_SERVICE_UDS,
00140                                "storeMetadata",
00141                                fullpath);
00142                                
00143     // Fullpath can be freed here because send_string_and_wait only returns
00144     // after executing (and it makes a copy of it anyway) [MDB]
00145     free(fullpath);
00146     
00147     if (retval != ERIPC_ERROR_SUCCESS) 
00148     {
00149         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00150         return FALSE;
00151     }
00152 
00153     return TRUE;
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:

G_BEGIN_DECLS void ipc_set_services (  ) 

Setup IPC connection and register API functions.

File Name : index_ipc.h

Description: The dbus-based eripc functions Copyright (C) 2009 IREX Technologies B.V. All rights reserved.---------------------------------------------------------------------------

Name : ipc_set_services

Parameters:
None 
Returns:
--

--------------------------------------------------------------------------

Definition at line 95 of file index_ipc.c.

Referenced by main().

00096 {
00097     eripcClient = eripc_client_context_new(
00098                     DBUS_APPL_NAME, 
00099                     "1.0",
00100                     DBUS_SERVICE, 
00101                     DBUS_PATH,
00102                     DBUS_INTERFACE,
00103                     service_functions);
00104 }

Here is the caller graph for this function:

void ipc_unset_services ( void   ) 

Unregister API functions.

---------------------------------------------------------------------------

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 108 of file index_ipc.c.

Referenced by main(), and main_quit().

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208