00001 /*************************************************************************** 00002 $RCSfile: netmsg.h,v $ 00003 ------------------- 00004 cvs : $Id: netmsg.h,v 1.10 2005/01/13 17:30:36 aquamaniac Exp $ 00005 begin : Mon Feb 09 2004 00006 copyright : (C) 2004 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 GWEN_NETMSG_H 00030 #define GWEN_NETMSG_H 00031 00032 #include <gwenhywfar/gwenhywfarapi.h> 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 typedef struct GWEN_NETMSG GWEN_NETMSG; 00037 #ifdef __cplusplus 00038 } 00039 #endif 00040 00041 #include <gwenhywfar/buffer.h> 00042 #include <gwenhywfar/db.h> 00043 #include <gwenhywfar/types.h> 00044 #include <gwenhywfar/misc.h> 00045 #include <gwenhywfar/bufferedio.h> 00046 00047 #ifdef __cplusplus 00048 extern "C" { 00049 #endif 00050 00051 00052 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_NETMSG, GWEN_NetMsg, GWENHYWFAR_API) 00053 /* No trailing semicolon here because this is a macro call */ 00054 00055 00056 00060 GWENHYWFAR_API 00061 GWEN_NETMSG *GWEN_NetMsg_new(GWEN_TYPE_UINT32 bufferSize); 00062 GWENHYWFAR_API 00063 void GWEN_NetMsg_free(GWEN_NETMSG *msg); 00064 GWENHYWFAR_API 00065 void GWEN_NetMsg_Attach(GWEN_NETMSG *msg); 00066 00078 GWENHYWFAR_API 00079 GWEN_BUFFER *GWEN_NetMsg_GetBuffer(const GWEN_NETMSG *msg); 00080 00081 GWENHYWFAR_API 00082 GWEN_BUFFER *GWEN_NetMsg_TakeBuffer(GWEN_NETMSG *msg); 00083 00088 GWENHYWFAR_API 00089 void GWEN_NetMsg_SetBuffer(GWEN_NETMSG *msg, 00090 GWEN_BUFFER *buf); 00091 00096 GWENHYWFAR_API 00097 GWEN_TYPE_UINT32 GWEN_NetMsg_GetSize(const GWEN_NETMSG *msg); 00098 GWENHYWFAR_API 00099 void GWEN_NetMsg_SetSize(GWEN_NETMSG *msg, 00100 GWEN_TYPE_UINT32 size); 00101 00105 GWENHYWFAR_API 00106 void GWEN_NetMsg_DecrementSize(GWEN_NETMSG *msg, 00107 GWEN_TYPE_UINT32 offs); 00108 00113 GWENHYWFAR_API 00114 void GWEN_NetMsg_IncrementSize(GWEN_NETMSG *msg, 00115 GWEN_TYPE_UINT32 offs); 00116 00121 GWENHYWFAR_API 00122 GWEN_DB_NODE *GWEN_NetMsg_GetDB(const GWEN_NETMSG *msg); 00123 00124 00125 GWENHYWFAR_API 00126 GWEN_BUFFEREDIO *GWEN_NetMsg_GetBufferedIO(const GWEN_NETMSG *msg); 00127 00128 GWENHYWFAR_API 00129 GWEN_BUFFEREDIO *GWEN_NetMsg_TakeBufferedIO(GWEN_NETMSG *msg); 00130 00135 GWENHYWFAR_API 00136 void GWEN_NetMsg_SetBufferedIO(GWEN_NETMSG *msg, 00137 GWEN_BUFFEREDIO *bio); 00138 00139 GWENHYWFAR_API 00140 int GWEN_NetMsg_GetProtocolMajorVersion(const GWEN_NETMSG *msg); 00141 00142 GWENHYWFAR_API 00143 int GWEN_NetMsg_GetProtocolMinorVersion(const GWEN_NETMSG *msg); 00144 00145 GWENHYWFAR_API 00146 void GWEN_NetMsg_SetProtocolVersion(GWEN_NETMSG *msg, 00147 int pmajor, int pminor); 00148 00149 00153 GWENHYWFAR_API 00154 void GWEN_NetMsg_Dump(const GWEN_NETMSG *msg); 00155 00156 00157 #ifdef __cplusplus 00158 } 00159 #endif 00160 00161 00162 #endif