Go to the source code of this file.
Data Structures | |
struct | HIPC_msgdata |
Macros | |
#define | hipcGenmdQuit(md_p, hipc_errno, errdtlstr) hipcGenmdUnstru((md_p), HIPC_MESSAGE_TYPE_QUIT, (hipc_errno), (errdtlstr), sizeof(errdtlstr)) |
Initializes a HIPC message data as a QUIT message. More... | |
#define | hipcGenmdSuccess(md_p) hipcGenmdUnstru((md_p), HIPC_MESSAGE_TYPE_SUCCESS, HIPC_SUCCESS, 0, 0) |
Initializes a HIPC message data as a SUCCESS message. More... | |
#define | hipcMsgdHdrPtr(md_p) ((md_p)->header) |
Returns a pointer to a header of a HIPC message data. More... | |
#define | hipcMsgdBdyPtr(md_p) ((md_p)->body_p) |
Returns a pointer to a body of a HIPC message data. More... | |
Typedefs | |
typedef struct HIPC_msgdata | hipc_msgd |
Functions | |
unsigned char | hipcMsgdBdySize (hipc_msgd const *const md_p) |
Returns body size of a HIPC message data. More... | |
unsigned char | hipcMsgdType (hipc_msgd const *const md_p) |
Returns type of a HIPC message data. More... | |
unsigned char | hipcMsgdStruno (hipc_msgd const *const md_p) |
Returns structure number of a HIPC message data. More... | |
unsigned char | hipcMsgdOffset (hipc_msgd const *const md_p) |
Returns offset of a HIPC message data. More... | |
unsigned char | hipcMsgdRngsize (hipc_msgd const *const md_p) |
Returns range size of a HIPC message data. More... | |
enum HIPC_errno | hipcGenmdUnstru (hipc_msgd *const md_p, const unsigned char type, const enum HIPC_errno hipc_errno, char *const errdtlstr, size_t errdtlstr_size) |
Initializes a HIPC message data as a unstructured type message. More... | |
enum HIPC_errno | hipcGenmdSuccessToGet (hipc_msgd *const mds_p, hipc_msgd const *const mdr_p, void *const stru_p, const size_t stru_size) |
Initializes mds_p as a response to mdr_p whose type must be GET. More... | |
enum HIPC_errno | hipcMsgdSetBdyForPut (hipc_msgd *const mdr_p, void *const stru_p, const size_t stru_size) |
Sets a body to a HIPC message data that contains a header of a PUT message. More... | |
#define hipcGenmdQuit | ( | md_p, | |
hipc_errno, | |||
errdtlstr | |||
) | hipcGenmdUnstru((md_p), HIPC_MESSAGE_TYPE_QUIT, (hipc_errno), (errdtlstr), sizeof(errdtlstr)) |
Initializes a HIPC message data as a QUIT message.
errdtlstr
must have both an address and a size of the string, so errdtlstr
must be a string literal or a variable whose type is array of char. errdtlstr
must not be a simple pointer to char because sizeof(char *)
equals a constant value.
md_p | pointer to a HIPC message data |
hipc_errno | HIPC error number |
errdtlstr | error detail string |
hipc_errno
. #define hipcGenmdSuccess | ( | md_p | ) | hipcGenmdUnstru((md_p), HIPC_MESSAGE_TYPE_SUCCESS, HIPC_SUCCESS, 0, 0) |
#define hipcMsgdHdrPtr | ( | md_p | ) | ((md_p)->header) |
Returns a pointer to a header of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 44 of file msgd.h.
Referenced by hipcUsocWriteMsgd().
#define hipcMsgdBdyPtr | ( | md_p | ) | ((md_p)->body_p) |
Returns a pointer to a body of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 52 of file msgd.h.
Referenced by hipcUsocWriteMsgd().
typedef struct HIPC_msgdata hipc_msgd |
unsigned char hipcMsgdBdySize | ( | hipc_msgd const *const | md_p | ) |
Returns body size of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 9 of file msgd.c.
References HIPC_msgdata::header, and hipcMsghdrBdysize().
Referenced by hipcUsocWriteMsgd().
unsigned char hipcMsgdType | ( | hipc_msgd const *const | md_p | ) |
Returns type of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 20 of file msgd.c.
References HIPC_msgdata::header, and HIPC_MSGHDR_BYTE_TYPE.
unsigned char hipcMsgdStruno | ( | hipc_msgd const *const | md_p | ) |
Returns structure number of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 31 of file msgd.c.
References HIPC_msgdata::header, and HIPC_MSGHDR_BYTE_STRUNO.
unsigned char hipcMsgdOffset | ( | hipc_msgd const *const | md_p | ) |
Returns offset of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 42 of file msgd.c.
References HIPC_msgdata::header, and HIPC_MSGHDR_BYTE_OFFSET.
unsigned char hipcMsgdRngsize | ( | hipc_msgd const *const | md_p | ) |
Returns range size of a HIPC message data.
md_p | pointer to a HIPC message data |
Definition at line 53 of file msgd.c.
References HIPC_msgdata::header, and HIPC_MSGHDR_BYTE_BDYSZ.
enum HIPC_errno hipcGenmdUnstru | ( | hipc_msgd *const | md_p, |
const unsigned char | type, | ||
const enum HIPC_errno | hipc_errno, | ||
char *const | errdtlstr, | ||
size_t | errdtlstr_size | ||
) |
Initializes a HIPC message data as a unstructured type message.
md_p | pointer to a HIPC message data |
type | message type |
hipc_errno | HIPC error number |
errdtlstr | error detail string |
errdtlstr_size | size of the error detail string |
hipc_errno
. Definition at line 68 of file msgd.c.
References HIPC_msgdata::body_p, HIPC_msgdata::header, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, and HIPC_UNSTRU.
enum HIPC_errno hipcGenmdSuccessToGet | ( | hipc_msgd *const | mds_p, |
hipc_msgd const *const | mdr_p, | ||
void *const | stru_p, | ||
const size_t | stru_size | ||
) |
Initializes mds_p
as a response to mdr_p
whose type must be GET.
stru_p
should be the beginning of a structure specified by the GET message.
mds_p | pointer to a HIPC message data to be sent |
mdr_p | pointer to a HIPC message data received |
stru_p | pointer to a structure object |
stru_size | size of the structure object |
Definition at line 102 of file msgd.c.
References HIPC_msgdata::body_p, HIPC_msgdata::header, HIPC_ERR_S_INV_RW_RANGE, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, and HIPC_SUCCESS.
enum HIPC_errno hipcMsgdSetBdyForPut | ( | hipc_msgd *const | mdr_p, |
void *const | stru_p, | ||
const size_t | stru_size | ||
) |
Sets a body to a HIPC message data that contains a header of a PUT message.
The body will be a part of stru_p
. stru_p
should be the beginning of a structure which is specified by the header of md_p
so that the following statement reads the body of the PUT message into correct place.
hipcUsocRead(so_p, hipcMsgdBdyPtr(md_p), hipcMsgdBdySize(md_p));
mdr_p | pointer to a HIPC message data |
stru_p | pointer to a structure object |
stru_size | size of the structure object |
Definition at line 140 of file msgd.c.
References HIPC_msgdata::body_p, HIPC_msgdata::header, HIPC_ERR_S_INV_RW_RANGE, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, and HIPC_SUCCESS.