13 #define MSH_ASSERT(X) {assert(X);}
15 #define MSH_HEADER_SIZE (sizeof(int)*2)
18 #define MSH_TOTALSIZE_OFFSET (sizeof(int))
19 #define MSH_TYPECHOICE_OFFSET 0
21 #define MSH_SET_TYPECHOICE(X) { memcpy(msh_buffer+MSH_TYPECHOICE_OFFSET,&(X),sizeof(int));}
22 #define MSH_SET_TOTALSIZE(X) { memcpy(msh_buffer+MSH_TOTALSIZE_OFFSET,&(X),sizeof(int));}
23 #define MSH_GET_TYPECHOICE(X,BUF) { memcpy(&(X), ((char*)BUF)+MSH_TYPECHOICE_OFFSET,sizeof(int));}
24 #define MSH_GET_TOTALSIZE(X,BUF) { memcpy(&(X), ((char*)BUF)+MSH_TOTALSIZE_OFFSET,sizeof(int));}
30 static const int WORD_SIZE =
sizeof(long);
33 return (((x)+(WORD_SIZE-1)) / WORD_SIZE) * WORD_SIZE;
65 if(chIsUnmarshaling !=
'u') {
66 printf(
"MarshaledObj(void*, char): wrong argument\n");
136 msh_buffer = (
char *)realloc( msh_buffer,
msh_extent);
157 throw "Tried to marshal in object marked isUnmarshaling = true";
158 msh_currentSize = size;
162 memcpy(
msh_cursor, &msh_currentSize,
sizeof(
int));
175 msh_currentSize = size;
185 template <
class T,
class>
#define MSH_GET_TOTALSIZE(X, BUF)
void unmarshalPrimitive(void *p, int size)
MarshaledObj(void *buf, char chIsUnmarshaling)
static int ROUND_UP(int x)
#define MSH_SET_TYPECHOICE(X)
void resizeBuffer(size_t new_size)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_GET_TYPECHOICE(X, BUF)
void EXTEND_BUFFER(int size)
void marshalPrimitive(void *p, int size)
#define MSH_SET_TOTALSIZE(X)