1 /***************************************************************************
2 message.h - Class for a protocol messages
4 begin : Sun Mar 12 2006
5 copyright : (C) 2006 by Yannick Lecaillez, Avi Alkalay
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the BSD License (revised). *
14 ***************************************************************************/
16 /***************************************************************************
18 * Class for messages, to be passed over a protocol line. *
20 ***************************************************************************/
35 #define MSG_MAX_ARGS 8
42 #define INTERNAL_ERROR 1<<15
48 DataType args[MSG_MAX_ARGS];
52 /* In memory, this struct is followed by
53 * the serialized arguments. "size" reflect that. */
56 Message *messageNew(MessageType msgType, int procedure, ...);
57 MessageType messageGetType(const Message *msg);
58 int messageGetProcedure(const Message *msg);
59 int messageGetNbArgs(const Message *msg);
60 int messageExtractArgs(const Message *msg, ...);
61 void messageDel(Message *msg);
63 #endif /* __MESSAGE__ */