# ipc.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  $RCSfile: ipc.h,v $
    00003                              -------------------
    00004     cvs         : $Id: ipc.h,v 1.29 2005/03/04 22:06:24 aquamaniac Exp $
    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/nettransport.h>
    00021 #include <gwenhywfar/netconnection.h>
    00022
    00023 #include <time.h>
    00024 #include <stdio.h>
    00025
    00026 #ifdef __cplusplus
    00027 extern "C" {
    00028 #endif
    00029
    00034 #define GWEN_IPC_ERROR_CODES   0x80000000
    00035 #define GWEN_IPC_ERROR_GENERIC 0x80000001
    00036 #define GWEN_IPC_ERROR_CONNERR 0x80000002
    00037 #define GWEN_IPC_ERROR_TIMEOUT 0x80000003
    00038
    00042 typedef struct GWEN_IPCMANAGER GWEN_IPCMANAGER;
    00043
    00044
    00045 GWENHYWFAR_API
    00046 GWEN_IPCMANAGER *GWEN_IPCManager_new();
    00047
    00048 GWENHYWFAR_API
    00049 void GWEN_IPCManager_free(GWEN_IPCMANAGER *mgr);
    00050
    00051 GWENHYWFAR_API
    00052 void GWEN_IPCManager_Attach(GWEN_IPCMANAGER *mgr);
    00053
    00054 GWENHYWFAR_API
    00055 void GWEN_IPCManager_Dump(GWEN_IPCMANAGER *mgr, FILE *f, int indent);
    00056
    00057
    00058 GWENHYWFAR_API
    00059 const char *GWEN_IPCManager_GetApplicationName(const GWEN_IPCMANAGER *mgr);
    00060
    00061 GWENHYWFAR_API
    00062 void GWEN_IPCManager_SetApplicationName(GWEN_IPCMANAGER *mgr,
    00063                                         const char *name);
    00064
    00065
    00070 GWENHYWFAR_API
    00071 void GWEN_IPCManager_SetUpFn(GWEN_IPCMANAGER *mgr,
    00072                              GWEN_TYPE_UINT32 id,
    00073                              GWEN_NETCONNECTION_UPFN fn);
    00074
    00079 GWENHYWFAR_API
    00080 void GWEN_IPCManager_SetDownFn(GWEN_IPCMANAGER *mgr,
    00081                                GWEN_TYPE_UINT32 id,
    00082                                GWEN_NETCONNECTION_DOWNFN fn);
    00083
    00087 GWENHYWFAR_API
    00088 int GWEN_IPCManager_Disconnect(GWEN_IPCMANAGER *mgr, GWEN_TYPE_UINT32 nid);
    00089
    00094 GWENHYWFAR_API
    00095 GWEN_NETTRANSPORT_STATUS
    00096 GWEN_IPCManager_CheckConnection(GWEN_IPCMANAGER *mgr, GWEN_TYPE_UINT32 nid);
    00097
    00098
    00111 GWENHYWFAR_API
    00112 GWEN_TYPE_UINT32 GWEN_IPCManager_AddServer(GWEN_IPCMANAGER *mgr,
    00113                                            GWEN_NETTRANSPORT *tr,
    00114                                            GWEN_TYPE_UINT32 mark);
    00115
    00130 GWENHYWFAR_API
    00131 GWEN_TYPE_UINT32 GWEN_IPCManager_AddClient(GWEN_IPCMANAGER *mgr,
    00132                                            GWEN_NETTRANSPORT *tr,
    00133                                            const char *userName,
    00134                                            const char *passwd,
    00135                                            GWEN_TYPE_UINT32 mark);
    00142 GWENHYWFAR_API
    00143 int GWEN_IPCManager_RemoveClient(GWEN_IPCMANAGER *mgr,
    00144                                  GWEN_TYPE_UINT32 nid);
    00145
    00155 GWENHYWFAR_API
    00156 GWEN_TYPE_UINT32 GWEN_IPCManager_SendRequest(GWEN_IPCMANAGER *mgr,
    00157                                              GWEN_TYPE_UINT32 nid,
    00158                                              GWEN_DB_NODE *req);
    00159
    00168 GWENHYWFAR_API
    00169 GWEN_TYPE_UINT32 GWEN_IPCManager_SendMultiRequest(GWEN_IPCMANAGER *mgr,
    00170                                                   GWEN_TYPE_UINT32 mark,
    00171                                                   GWEN_DB_NODE *req);
    00172
    00181 GWENHYWFAR_API
    00182 int GWEN_IPCManager_SendResponse(GWEN_IPCMANAGER *mgr,
    00183                                  GWEN_TYPE_UINT32 rid,
    00184                                  GWEN_DB_NODE *rsp);
    00185
    00196 GWENHYWFAR_API
    00197 int GWEN_IPCManager_RemoveRequest(GWEN_IPCMANAGER *mgr,
    00198                                   GWEN_TYPE_UINT32 rid,
    00199                                   int outbound);
    00200
    00210 GWENHYWFAR_API
    00211 GWEN_TYPE_UINT32 GWEN_IPCManager_GetNextInRequest(GWEN_IPCMANAGER *mgr,
    00212                                                   GWEN_TYPE_UINT32 mark);
    00213
    00231 GWENHYWFAR_API
    00232 GWEN_DB_NODE *GWEN_IPCManager_GetInRequestData(GWEN_IPCMANAGER *mgr,
    00233                                                GWEN_TYPE_UINT32 rid);
    00234
    00235
    00245 GWENHYWFAR_API
    00246 GWEN_DB_NODE *GWEN_IPCManager_GetResponseData(GWEN_IPCMANAGER *mgr,
    00247                                               GWEN_TYPE_UINT32 rid);
    00248
    00258 GWENHYWFAR_API
    00259 GWEN_DB_NODE *GWEN_IPCManager_PeekResponseData(GWEN_IPCMANAGER *mgr,
    00260                                                GWEN_TYPE_UINT32 rid);
    00261
    00262
    00268 GWENHYWFAR_API
    00269 int GWEN_IPCManager_Work(GWEN_IPCMANAGER *mgr, int maxmsg);
    00270
    00271
    00275 GWENHYWFAR_API
    00276 GWEN_NETCONNECTION *GWEN_IPCManager_GetConnection(GWEN_IPCMANAGER *mgr,
    00277                                                   GWEN_TYPE_UINT32 nid);
    00278
    00279 #ifdef __cplusplus
    00280 }
    00281 #endif
    00282
    00283 #endif /* GWEN_IPC_H */
    00284
    00285
    00286
    00287