ipcmessage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
#ifndef IPCMESSAGE_H
00030
#define IPCMESSAGE_H
00031
00032
#include "chameleon/error.h"
00033
00034
#ifdef __cplusplus
00035
extern "C" {
00036
#endif
00037
00038 #define IPCMESSAGE_HEADERSIZE 2
00039
00040 #define IPCMESSAGE_MAXMSGSIZE 4096
00041
00042 #define IPCMESSAGE_ERROR_TYPE "IPC"
00043 #define IPCMESSAGE_ERROR_COMMAND_END 1
00044 #define IPCMESSAGE_ERROR_COMMAND_FULL 2
00045 #define IPCMESSAGE_ERROR_COMMAND_EMPTY 3
00046 #define IPCMESSAGE_ERROR_COMMAND_CORRUPTED 4
00047 #define IPCMESSAGE_ERROR_COMMAND_TOO_BIG 5
00048 #define IPCMESSAGE_ERROR_BAD_MESSAGE 6
00049 #define IPCMESSAGE_ERROR_NO_MESSAGE 7
00050 #define IPCMESSAGE_ERROR_NO_MESSAGELAYER 8
00051 #define IPCMESSAGE_ERROR_BUFFER_TOO_SMALL 9
00052 #define IPCMESSAGE_ERROR_NO_TRANSPORTLAYER 10
00053 #define IPCMESSAGE_ERROR_NO_SOCKETNAME 11
00054
00055
struct IPCMESSAGESTRUCT;
00056
00057
00058 CHIPCARD_API struct IPCMESSAGESTRUCT {
00059 int ownPointer;
00060 char *
ptr;
00061 int bsize;
00062 int size;
00063 int pos;
00064 struct IPCMESSAGESTRUCT *
next;
00065 };
00066
00067 CHIPCARD_API typedef struct IPCMESSAGESTRUCT IPCMESSAGE;
00068
00069
00070
CHIPCARD_API ERRORCODE IPCMessage_ModuleInit();
00071
CHIPCARD_API ERRORCODE IPCMessage_ModuleFini();
00072
00073
00074
CHIPCARD_API IPCMESSAGE *
IPCMessage_new();
00075
CHIPCARD_API void IPCMessage_free(IPCMESSAGE *cmd);
00076
00077
00082
CHIPCARD_API ERRORCODE IPCMessage_SetBuffer(IPCMESSAGE *cmd,
00083
char *ptr,
00084
int size);
00085
00089
CHIPCARD_API ERRORCODE IPCMessage_UseBuffer(IPCMESSAGE *cmd,
00090
char *ptr,
00091
int size);
00092
00093
CHIPCARD_API ERRORCODE IPCMessage_GetBuffer(
const IPCMESSAGE *cmd,
00094
const char **ptr,
00095
int *size);
00096
00097
CHIPCARD_API const char *
IPCMessage_GetMessageBegin(IPCMESSAGE *cmd);
00098
00099
CHIPCARD_API int IPCMessage_GetMessageSize(IPCMESSAGE *cmd);
00100
00101
00102
CHIPCARD_API ERRORCODE IPCMessage_FirstParameter(IPCMESSAGE *cmd,
00103
char **ptr,
00104
int *size);
00105
CHIPCARD_API ERRORCODE IPCMessage_FirstIntParameter(IPCMESSAGE *cmd,
00106
int *param);
00107
CHIPCARD_API ERRORCODE IPCMessage_FirstStringParameter(IPCMESSAGE *cmd,
00108
char **param);
00109
00110
CHIPCARD_API ERRORCODE IPCMessage_NextParameter(IPCMESSAGE *cmd,
00111
char **ptr,
00112
int *size);
00113
CHIPCARD_API ERRORCODE IPCMessage_NextIntParameter(IPCMESSAGE *cmd,
00114
int *param);
00115
CHIPCARD_API ERRORCODE IPCMessage_NextStringParameter(IPCMESSAGE *cmd,
00116
char **param);
00117
CHIPCARD_API ERRORCODE IPCMessage_Parameter(IPCMESSAGE *cmd,
00118
int idx,
00119
char **ptr,
00120
int *size);
00121
CHIPCARD_API ERRORCODE IPCMessage_IntParameter(IPCMESSAGE *cmd,
00122
int idx,
00123
int *param);
00124
CHIPCARD_API ERRORCODE IPCMessage_StringParameter(IPCMESSAGE *cmd,
00125
int idx,
00126
char **param);
00127
00128
00129
CHIPCARD_API ERRORCODE IPCMessage_AddParameter(IPCMESSAGE *cmd,
00130
const char *ptr,
00131
int size);
00132
CHIPCARD_API ERRORCODE IPCMessage_AddIntParameter(IPCMESSAGE *cmd,
00133
int param);
00134
CHIPCARD_API ERRORCODE IPCMessage_AddStringParameter(IPCMESSAGE *cmd,
00135
const char *param);
00136
00137
00138
CHIPCARD_API ERRORCODE IPCMessage_BuildMessage(IPCMESSAGE *cmd);
00139
00140
00141
CHIPCARD_API void IPCMessage_AddMessage(IPCMESSAGE *cmd, IPCMESSAGE **head);
00142
CHIPCARD_API void IPCMessage_RemoveMessage(IPCMESSAGE *cmd, IPCMESSAGE **head);
00143
00144
00145
00146
#ifdef __cplusplus
00147
}
00148
#endif
00149
00150
#endif
00151
00152
00153
Generated on Wed Jul 28 14:56:49 2004 for libchipcard by
1.3.7