Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ctclient.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 $RCSfile: ctclient.h,v $ 00003 ------------------- 00004 cvs : $Id: ctclient.h,v 1.14 2003/05/09 01:35:56 aquamaniac Exp $ 00005 begin : Fri Nov 29 2002 00006 copyright : (C) 2002 by Martin Preuss 00007 email : martin@libchipcard.de 00008 00009 *************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00024 * MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 00029 #ifndef CTCLIENT_H 00030 #define CTCLIENT_H 00031 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 #define CTCLIENT_MAX_DISMISSED_REQUESTS 64 00038 00039 #include <chameleon/chameleon.h> 00040 #include <chameleon/ipcservicelayer.h> 00041 #include <ctservice.h> 00042 00043 00044 struct CTCLIENTDATASTRUCT { 00045 IPCSERVICELAYER *service; 00046 char *clientIdString; 00047 int nextPeerId; 00048 int nextMessageId; 00049 int shared; 00050 int mark; 00051 int dismissedRequests[CTCLIENT_MAX_DISMISSED_REQUESTS]; 00052 int nextDismissedRequest; 00053 }; 00054 typedef struct CTCLIENTDATASTRUCT CTCLIENTDATA; 00055 00056 00057 CTCLIENTDATA *CTClient_new(); 00058 void CTClient_free(CTCLIENTDATA *cd); 00059 00060 ERRORCODE CTClient_Init(CTCLIENTDATA *cd); 00061 ERRORCODE CTClient_InitShared(CTCLIENTDATA *cd, 00062 IPCSERVICELAYER *service); 00063 ERRORCODE CTClient_Fini(CTCLIENTDATA *cd); 00064 00070 ERRORCODE CTClient_AddServer(CTCLIENTDATA *cd, 00071 const char *addr, 00072 int port, 00073 int *id); 00074 00075 ERRORCODE CTClient_RemoveServer(CTCLIENTDATA *cd, int id); 00076 00077 void CTClient_SetClientIdString(CTCLIENTDATA *cd, 00078 const char *cid); 00079 00080 ERRORCODE CTClient_CheckErrorMessage(CTCLIENTDATA *cd, 00081 IPCMESSAGE *msg); 00082 00083 ERRORCODE CTClient_Work(CTCLIENTDATA *cd, 00084 int timeout, 00085 int maxmsg); 00086 00087 ERRORCODE CTClient_SendRequest(CTCLIENTDATA *cd, 00088 CTSERVICEREQUEST *req, 00089 int id); 00090 00091 ERRORCODE CTClient_CheckResponse(CTCLIENTDATA *cd, 00092 int requestid); 00093 00097 void CTClient_WithdrawRequest(CTCLIENTDATA *cd, 00098 int requestid); 00099 00106 void CTClient_AbandonRequest(CTCLIENTDATA *cd, 00107 int requestid); 00108 00109 CTSERVICEREQUEST *CTClient_FindRequest(CTCLIENTDATA *cd, 00110 int requestid); 00111 void CTClient_DequeueRequest(CTCLIENTDATA *cd, 00112 CTSERVICEREQUEST *req); 00113 00114 00115 #ifdef __cplusplus 00116 } 00117 #endif 00118 00119 00120 #endif 00121 00122 00123

Generated on Wed Jul 28 14:56:49 2004 for libchipcard by doxygen 1.3.7