ipc.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: ipc.h 1393 2007-11-22 18:26:05Z martin $
00005     begin       : Fri May 07 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *          Please see toplevel file COPYING for license details           *
00011  ***************************************************************************/
00012 
00013 
00014 #ifndef GWEN_IPC_H
00015 #define GWEN_IPC_H
00016 
00017 
00018 #include <gwenhywfar/types.h>
00019 #include <gwenhywfar/db.h>
00020 #include <gwenhywfar/iolayer.h>
00021 #include <gwenhywfar/inherit.h>
00022 #include <gwenhywfar/list2.h>
00023 
00024 #include <time.h>
00025 #include <stdio.h>
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00035 #define GWEN_IPC_ERROR_CODES   0x80000000
00036 #define GWEN_IPC_ERROR_GENERIC 0x80000001
00037 #define GWEN_IPC_ERROR_CONNERR 0x80000002
00038 #define GWEN_IPC_ERROR_TIMEOUT 0x80000003
00039 
00043 typedef struct GWEN_IPCMANAGER GWEN_IPCMANAGER;
00044 
00045 
00046 
00047 typedef void (*GWEN_IPCMANAGER_CLIENTDOWN_FN)(GWEN_IPCMANAGER *mgr,
00048                                               uint32_t id,
00049                                               GWEN_IO_LAYER *io,
00050                                               void *user_data);
00051 
00052 
00053 GWENHYWFAR_API
00054 GWEN_IPCMANAGER *GWEN_IpcManager_new();
00055 
00056 GWENHYWFAR_API
00057 void GWEN_IpcManager_free(GWEN_IPCMANAGER *mgr);
00058 
00059 GWENHYWFAR_API
00060 void GWEN_IpcManager_Attach(GWEN_IPCMANAGER *mgr);
00061 
00062 GWENHYWFAR_API
00063 void GWEN_IpcManager_Dump(GWEN_IPCMANAGER *mgr, FILE *f, int indent);
00064 
00065 
00066 GWENHYWFAR_API
00067 const char *GWEN_IpcManager_GetApplicationName(const GWEN_IPCMANAGER *mgr);
00068 
00069 GWENHYWFAR_API
00070 void GWEN_IpcManager_SetApplicationName(GWEN_IPCMANAGER *mgr,
00071                                         const char *name);
00072 
00073 
00077 GWENHYWFAR_API
00078 int GWEN_IpcManager_Disconnect(GWEN_IPCMANAGER *mgr, uint32_t nid);
00079 
00093 GWENHYWFAR_API
00094 uint32_t GWEN_IpcManager_AddServer(GWEN_IPCMANAGER *mgr,
00095                                    GWEN_IO_LAYER *ioBase,
00096                                    uint32_t mark);
00097 
00111 GWENHYWFAR_API
00112 uint32_t GWEN_IpcManager_AddClient(GWEN_IPCMANAGER *mgr,
00113                                    GWEN_IO_LAYER *ioBase,
00114                                    uint32_t mark);
00121 GWENHYWFAR_API
00122 int GWEN_IpcManager_RemoveClient(GWEN_IPCMANAGER *mgr,
00123                                  uint32_t nid);
00124 
00134 GWENHYWFAR_API
00135 int GWEN_IpcManager_SendRequest(GWEN_IPCMANAGER *mgr,
00136                                 uint32_t nid,
00137                                 GWEN_DB_NODE *req,
00138                                 uint32_t *pReqId);
00139 
00148 GWENHYWFAR_API
00149 int GWEN_IpcManager_SendResponse(GWEN_IPCMANAGER *mgr,
00150                                  uint32_t rid,
00151                                  GWEN_DB_NODE *rsp);
00152 
00163 GWENHYWFAR_API
00164 int GWEN_IpcManager_RemoveRequest(GWEN_IPCMANAGER *mgr,
00165                                   uint32_t rid,
00166                                   int outbound);
00167 
00177 GWENHYWFAR_API
00178 uint32_t GWEN_IpcManager_GetNextInRequest(GWEN_IPCMANAGER *mgr,
00179                                           uint32_t mark);
00180 
00198 GWENHYWFAR_API
00199 GWEN_DB_NODE *GWEN_IpcManager_GetInRequestData(GWEN_IPCMANAGER *mgr,
00200                                                uint32_t rid);
00201 
00202 
00212 GWENHYWFAR_API
00213 GWEN_DB_NODE *GWEN_IpcManager_GetResponseData(GWEN_IPCMANAGER *mgr,
00214                                               uint32_t rid);
00215 
00225 GWENHYWFAR_API
00226 GWEN_DB_NODE *GWEN_IpcManager_PeekResponseData(GWEN_IPCMANAGER *mgr,
00227                                                uint32_t rid);
00228 
00229 
00235 GWENHYWFAR_API
00236 int GWEN_IpcManager_Work(GWEN_IPCMANAGER *mgr);
00237 
00238 
00242 GWENHYWFAR_API
00243 GWEN_IO_LAYER *GWEN_IpcManager_GetIoLayer(GWEN_IPCMANAGER *mgr, uint32_t nid);
00244 
00245 GWENHYWFAR_API
00246 uint32_t GWEN_IpcManager_GetClientForIoLayer(const GWEN_IPCMANAGER *mgr, const GWEN_IO_LAYER *io);
00247 
00248 
00249 
00250 GWENHYWFAR_API
00251 void GWEN_IpcManager_SetClientDownFn(GWEN_IPCMANAGER *mgr,
00252                                      GWEN_IPCMANAGER_CLIENTDOWN_FN f,
00253                                      void *user_data);
00254 
00255 #ifdef __cplusplus
00256 }
00257 #endif
00258 
00259 #endif /* GWEN_IPC_H */
00260 
00261 
00262 
00263 

Generated on Fri Apr 11 01:53:47 2008 for gwenhywfar by  doxygen 1.5.5