#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hipc/client.h>
Go to the source code of this file.
Functions | |
static void * | hipcClientMalloc (struct HIPC_client *const cl_p, size_t size) |
Allocates memory by using malloc. More... | |
static void * | hipcClientCalloc (struct HIPC_client *const cl_p, size_t nmemb, size_t size) |
Allocates memory by using calloc. More... | |
void | hipcClientSetStdErrno (struct HIPC_client *const cl_p) |
Sets errno value to a HIPC client. More... | |
int | hipcClientGetStdErrno (const struct HIPC_client *const cl_p) |
Gets an errno value saved by hipcClientSetStdErrno(). More... | |
enum HIPC_errno | hipcClientGetHipcErrno (const struct HIPC_client *const cl_p) |
Gets a HIPC error number that has been set. More... | |
const char * | hipcClientGetErrStr (const struct HIPC_client *const cl_p) |
Gets a string describing a HIPC error number that has been set to a HIPC client. More... | |
const char * | hipcClientGetErrDtlStr (const struct HIPC_client *const cl_p) |
Gets a string describing details of an error that has been set to a HIPC client. More... | |
static void | hipcClientSetErrDtlStr (struct HIPC_client *const cl_p, char const *const str0, char const *const str1, size_t ls1) |
Sets a string describing details of an error, which will be a concatenation of str0 and str1 . More... | |
enum HIPC_errno | hipcClientSetError (struct HIPC_client *const cl_p, enum HIPC_errno hipc_errno, char const *const str) |
Sets an error to a client with error detail. More... | |
void | hipcClientSetCimg (struct HIPC_client *const cl_p, const unsigned char struno, void *cimg_p) |
Sets a client-side image that is a structure instance of a structure. More... | |
void | hipcClientSetHandler (struct HIPC_client *const cl_p, const unsigned char struno, enum HIPC_errno(*hndlr_p)(struct HIPC_client *, const hipc_msg, void *, void *), void *const arg) |
Sets an handler hndlr_p to a structure number struno . More... | |
enum HIPC_errno | hipcClientCallHandler (struct HIPC_client *const cl_p, const unsigned char struno, const hipc_msg msgR) |
Calls a handler that corresponds to struno . More... | |
unsigned char | hipcClientGetNsysmsg (struct HIPC_client const *const cl_p) |
Gets the number of system messages. More... | |
enum HIPC_errno | hipcClientInit (struct HIPC_client *const cl_p, struct HIPC_client const *const clbase_p) |
Initializes a HIPC client with allocating memory space if necessary. More... | |
void | hipcClientTerminate (struct HIPC_client *const cl_p) |
Terminates a HIPC client with releasing the memory space that the client has. More... | |
enum HIPC_errno | hipcClientCheckMbrSize (struct HIPC_client *const cl_p) |
Checks whether sizes of members in structures in a server are the same as sizes in a client. More... | |
enum HIPC_errno | hipcClientCheckStrutpl (struct HIPC_client *const cl_p, const unsigned char struno, const size_t offset, const size_t rngsize) |
Checks a combination of a structure number, an offset, and a size for a HIPC message. More... | |
static enum HIPC_errno | GetStrutpl_mbr (struct HIPC_client *const cl_p, char const *const str, struct HIPC_cl_indp_mbr const *const mbr_p, size_t *offset_p, size_t *size_p) |
Gets offset, and size from member structure and a string that specify further. More... | |
enum HIPC_errno | hipcClientGetStrutpl (struct HIPC_client *const cl_p, char const *const str, unsigned char *struno_p, size_t *offset_p, size_t *size_p) |
Gets structure number, offset, and size from ID string. More... | |
enum HIPC_errno | hipcClientEachMbr (struct HIPC_client *const cl_p, struct HIPC_cl_indp_mbr const *const mbr_p, unsigned char *const begin, unsigned char *const end, unsigned char *const scur_p, unsigned char *const ccur_p, const size_t ssize, const size_t csize, void(*fnc_p)(void *const ccur_p, void *const scur_p, const size_t n)) |
Calls the function specified by fnc_p with each member between begin and end. More... | |
static void | memcpy_wrapper (void *const scur_p, void *const ccur_p, const size_t n) |
static void | contra_memcpy (void *const scur_p, void *const ccur_p, const size_t n) |
static void | convert_endian (void *const scur_p, void *const ccur_p, const size_t n) |
static void | contra_convert_endian (void *const scur_p, void *const ccur_p, const size_t n) |
enum HIPC_errno | hipcClientUnpack (struct HIPC_client *const cl_p, const unsigned char struno, const size_t offset, const size_t size, void *simg, void *cimg) |
Unpacks a range of contents of simg into cimg. More... | |
enum HIPC_errno | hipcClientPack (struct HIPC_client *const cl_p, const unsigned char struno, const size_t offset, const size_t size, void *simg, void *cimg) |
Packs a range of contents of cimg into simg. More... | |
enum HIPC_errno | hipcClientFeedUnstrumsgAsError (struct HIPC_client *const cl_p, const hipc_msg msgR) |
Feeds a message and sets an error specified by the message. More... | |
static enum HIPC_errno | FeedSysmsg_OFFSET_SIZE (struct HIPC_client *const cl_p, const hipc_msg msg, unsigned char **const tgtadr) |
Feeds a system message whose type is HIPC_SYSMSG_TYPE_OFFSET or HIPC_SYSMSG_TYPE_SIZE. More... | |
enum HIPC_errno | hipcClientFeedSysmsg (struct HIPC_client *const cl_p, const hipc_msg msgR) |
Feeds a system message and incorporates it to the internal data of the client. More... | |
enum HIPC_errno | hipcClientFeedStrumsg (struct HIPC_client *const cl_p, const hipc_msg msgR) |
Feeds a message and incorporates it to the internal data of a client. More... | |
void | hipcGenmsgHello (hipc_msg msg, const struct HIPC_client *const cl_p) |
Generates HELLO message. More... | |
enum HIPC_errno | hipcGenmsgGet (hipc_msg msg, struct HIPC_client *const cl_p, const unsigned char struno, const size_t offset, const size_t size) |
Generates GET message. More... | |
enum HIPC_errno | hipcGenmsgPut (hipc_msg msg, struct HIPC_client *const cl_p, const unsigned char struno, const size_t offset, const size_t size) |
Generates PUT message. More... | |
void | hipcGenmsgBye (hipc_msg msg) |
Initializes a HIPC message as a BYE message. More... | |
Variables | |
static const char * | hipc_errstr [HIPC_N_ERR] |
|
static |
Allocates memory by using malloc.
A HIPC client keeps track of memory allocation.
cl_p | pointer to a HIPC client |
size | size of memory to be allocated |
Definition at line 49 of file client.c.
References HIPC_ERR_C_STD, HIPC_client::hipc_errno, HIPC_ptr_link_list::next, HIPC_client::pllist_p, HIPC_ptr_link_list::ptr, and HIPC_client::std_errno.
Referenced by FeedSysmsg_OFFSET_SIZE(), hipcClientFeedSysmsg(), hipcClientInit(), test_client_memope_malloc(), and test_client_memope_multi().
|
static |
Allocates memory by using calloc.
A HIPC client keeps track of memory allocation.
cl_p | pointer to a HIPC client |
size | size of an element to be allocated |
nmemb | number of elements to be allocated |
Definition at line 84 of file client.c.
References HIPC_ERR_C_STD, HIPC_client::hipc_errno, HIPC_ptr_link_list::next, HIPC_client::pllist_p, HIPC_ptr_link_list::ptr, and HIPC_client::std_errno.
Referenced by hipcClientInit(), test_client_memope_calloc(), and test_client_memope_multi().
void hipcClientSetStdErrno | ( | struct HIPC_client *const | cl_p | ) |
Sets errno value to a HIPC client.
The value comes from errno
in the C standard library, so this function takes no arguments.
cl_p | pointer to the HIPC client |
Definition at line 119 of file client.c.
References HIPC_client::std_errno.
Referenced by hipcRecvMsg(), hipcSendMsg(), and test_StdErrno().
int hipcClientGetStdErrno | ( | const struct HIPC_client *const | cl_p | ) |
Gets an errno value saved by hipcClientSetStdErrno().
cl_p | pointer to a HIPC client |
Definition at line 131 of file client.c.
References HIPC_client::std_errno.
Referenced by hipcERRCHECK(), and test_StdErrno().
enum HIPC_errno hipcClientGetHipcErrno | ( | const struct HIPC_client *const | cl_p | ) |
Gets a HIPC error number that has been set.
cl_p | pointer to a HIPC client |
Definition at line 143 of file client.c.
References HIPC_client::hipc_errno.
Referenced by hipcERRCHECK(), hipcWaitReturn(), and test_Err().
const char* hipcClientGetErrStr | ( | const struct HIPC_client *const | cl_p | ) |
Gets a string describing a HIPC error number that has been set to a HIPC client.
cl_p | pointer to the HIPC client |
Definition at line 155 of file client.c.
References HIPC_client::hipc_errno, hipc_errstr, and HIPC_N_ERR.
Referenced by hipcERRCHECK(), and test_Err().
const char* hipcClientGetErrDtlStr | ( | const struct HIPC_client *const | cl_p | ) |
Gets a string describing details of an error that has been set to a HIPC client.
cl_p | pointer to the HIPC client |
Definition at line 171 of file client.c.
References HIPC_client::err_detail_str.
Referenced by hipcERRCHECK(), test_Err(), test_ErrorDetailStr(), test_ErrorDetailStr_longStr(), test_hipcClientCheckMbrSize(), test_hipcClientGetStrutpl_tooLargeName(), and test_hipcWaitReturn_err().
|
static |
Sets a string describing details of an error, which will be a concatenation of str0
and str1
.
If str0
is NULL
, this function does nothing. If str1
is NULL
, only str0
will be set, and ls1
is ignored. If ls1
is zero, the length of str1
is determined by strlen()
, so str1
must terminate with a null character. If ls1
is not zero, ls1
characters are concatenated to str0
. If the length of str0
or the concatenation of str0
and str1
is over the size of a buffer in a client structure, a string written to the buffer will be curtailed to just fit to the buffer, and the last character of the buffer will be a null character.
str0 | string no. 0, which must terminate with a null character |
str1 | string no. 1 |
ls1 | length of the string no. 1 |
cl_p | pointer to a HIPC client |
Definition at line 196 of file client.c.
References HIPC_client::err_detail_str.
Referenced by GetStrutpl_mbr(), hipcClientCheckMbrSize(), hipcClientGetStrutpl(), hipcClientSetError(), test_ErrorDetailStr(), and test_ErrorDetailStr_longStr().
enum HIPC_errno hipcClientSetError | ( | struct HIPC_client *const | cl_p, |
enum HIPC_errno | hipc_errno, | ||
char const *const | str | ||
) |
Sets an error to a client with error detail.
cl_p | pointer to the HIPC client |
hipc_errno | HIPC error number to be set |
str | string of the error detail |
hipc_errno
. Definition at line 240 of file client.c.
References HIPC_client::hipc_errno, and hipcClientSetErrDtlStr().
Referenced by FeedSysmsg_OFFSET_SIZE(), GetStrutpl_mbr(), handler_err(), hipcClientCheckStrutpl(), hipcClientEachMbr(), hipcClientFeedSysmsg(), hipcClientFeedUnstrumsgAsError(), hipcClientInit(), hipcGet(), hipcPut(), hipcRecvMsg(), hipcSendMsg(), hipcSetHandler(), hipcWaitReturn(), and test_Err().
void hipcClientSetCimg | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
void * | cimg_p | ||
) |
Sets a client-side image that is a structure instance of a structure.
cimg_p
points the client-side image. struno
must correspond to the type of the client-side image.
cl_p | pointer to a HIPC client |
struno | structure number |
cimg_p | address that points the structure instance |
Definition at line 260 of file client.c.
References HIPC_client::cimg_pp.
Referenced by hipcSetHandler(), test_handler(), test_hipcClientPack_NULLarg(), and test_hipcClientUnpack_NULLarg().
void hipcClientSetHandler | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
enum HIPC_errno(*)(struct HIPC_client *, const hipc_msg, void *, void *) | hndlr_p, | ||
void *const | arg | ||
) |
Sets an handler hndlr_p
to a structure number struno
.
arg
will be passed to the handler when the handler is called.
cl_p | pointer to a HIPC client |
struno | structure number |
hndlr_p | function pointer, which is the handler. |
arg | argument for the handler |
Definition at line 279 of file client.c.
References HIPC_client::hdarg_pp, and HIPC_client::hndlr_pp.
Referenced by hipcSetHandler(), and test_handler().
enum HIPC_errno hipcClientCallHandler | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
const hipc_msg | msgR | ||
) |
Calls a handler that corresponds to struno
.
msgR
is passed to the handler as an argument.
cl_p | pointer to a HIPC client |
struno | structure number |
msgR | HIPC message to be passed to the handler |
Definition at line 303 of file client.c.
References HIPC_client::cimg_pp, HIPC_client::hdarg_pp, HIPC_SUCCESS, and HIPC_client::hndlr_pp.
Referenced by hipcWaitReturn(), and test_handler().
unsigned char hipcClientGetNsysmsg | ( | struct HIPC_client const *const | cl_p | ) |
Gets the number of system messages.
cl_p | Pointer to a HIPC client |
Definition at line 326 of file client.c.
References HIPC_client::indp_p, and HIPC_cl_indp::n_sysmsg.
Referenced by hipcOpen(), and test_hipcClientGetNsysmsg().
enum HIPC_errno hipcClientInit | ( | struct HIPC_client *const | cl_p, |
struct HIPC_client const *const | clbase_p | ||
) |
Initializes a HIPC client with allocating memory space if necessary.
cl_p | pointer to a HIPC client to be initialized. This must not be NULL. |
clbase_p | pointer to a HIPC client with which cl_p is initialized. |
Definition at line 339 of file client.c.
References HIPC_client::cimg_pp, HIPC_client::cmdp_p, HIPC_cl_dp::endian, HIPC_client::endian_convert, HIPC_client::err_detail_str, HIPC_client::hdarg_pp, HIPC_ERR_INV_BASE_CLIENT, HIPC_ERR_INV_ENDIAN, HIPC_client::hipc_errno, HIPC_SUCCESS, hipcClientCalloc(), hipcClientMalloc(), hipcClientSetError(), hipcEndian(), HIPC_client::hndlr_pp, HIPC_client::indp_p, HIPC_cl_indp::n_struct, HIPC_client::pllist_p, HIPC_client::simg_pp, HIPC_client::smdp_p, HIPC_client::std_errno, HIPC_cl_dp::struct_p, and HIPC_cl_dp::struct_size_p.
Referenced by hipcOpen(), routine_hipcClientEachMbr(), setupTestClient(), test_handler(), test_hipcClientEachMbr_err(), test_hipcClientFeedSysmsg(), and test_hipcClientInit().
void hipcClientTerminate | ( | struct HIPC_client *const | cl_p | ) |
Terminates a HIPC client with releasing the memory space that the client has.
cl_p | pointer to a HIPC client |
Definition at line 438 of file client.c.
References HIPC_ptr_link_list::next, HIPC_client::pllist_p, and HIPC_ptr_link_list::ptr.
Referenced by hipcClose(), routine_hipcClientEachMbr(), test_client_memope_calloc(), test_client_memope_malloc(), test_client_memope_multi(), test_client_memope_no_allocation(), test_hipcClientEachMbr_err(), test_hipcClientFeedStrumsg(), test_hipcClientFeedSysmsg(), test_hipcClientFeedUnstrumsgAsError(), and test_hipcClientInit().
enum HIPC_errno hipcClientCheckMbrSize | ( | struct HIPC_client *const | cl_p | ) |
Checks whether sizes of members in structures in a server are the same as sizes in a client.
Only sizes of structures may differ.
cl_p | pointer to a HIPC client |
Definition at line 458 of file client.c.
References HIPC_client::cmdp_p, HIPC_cl_indp_mbr::elm_type, HIPC_ERR_MBR_SIZE_MISMATCH, HIPC_client::hipc_errno, HIPC_MBR_ARRAY, HIPC_MBR_SIMPLE, HIPC_SUCCESS, hipcClientSetErrDtlStr(), HIPC_client::indp_p, HIPC_cl_indp_stru::mbr_p, HIPC_cl_indp_stru::n_member, HIPC_cl_indp::n_struct, HIPC_cl_indp_mbr::name, HIPC_cl_indp_stru::name, HIPC_cl_dp_stru::size_p, HIPC_client::smdp_p, HIPC_cl_indp::struct_p, HIPC_cl_dp::struct_p, and HIPC_cl_indp_mbr::type.
Referenced by hipcOpen(), and test_hipcClientCheckMbrSize().
enum HIPC_errno hipcClientCheckStrutpl | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
const size_t | offset, | ||
const size_t | rngsize | ||
) |
Checks a combination of a structure number, an offset, and a size for a HIPC message.
cl_p | pointer to a HIPC client |
struno | structure number for a message |
offset | offset for a message |
rngsize | range size for a message |
Definition at line 509 of file client.c.
References HIPC_ERR_PROTOCOL_VIOLATION, HIPC_SUCCESS, hipcClientSetError(), HIPC_client::indp_p, HIPC_cl_indp::n_struct, HIPC_client::smdp_p, and HIPC_cl_dp::struct_size_p.
Referenced by hipcClientFeedStrumsg(), hipcClientGetStrutpl(), hipcClientPack(), hipcClientUnpack(), hipcGenmsgGet(), hipcGenmsgPut(), and test_hipcClientCheckStrutpl().
|
static |
Gets offset, and size from member structure and a string that specify further.
cl_p | pointer to a HIPC client |
str | string that identifies an item beneath the member specified by mbr_p |
mbr_p | a member of a structure |
offset_p | pointer to receive the offset value |
size_p | pointer to receive the size |
Definition at line 565 of file client.c.
References HIPC_cl_indp_mbr::ary_dim, HIPC_cl_indp_mbr::ary_max_idxs, HIPC_cl_indp_mbr::elm_struno, HIPC_cl_indp_mbr::elm_type, HIPC_ERR_INTERNAL_ERROR, HIPC_ERR_INV_ID_STR, HIPC_client::hipc_errno, HIPC_MBR_ARRAY, HIPC_MBR_SIMPLE, HIPC_MBR_STRUCT, HIPC_SUCCESS, hipcClientSetErrDtlStr(), hipcClientSetError(), HIPC_client::indp_p, HIPC_cl_indp_stru::mbr_p, HIPC_cl_indp_stru::n_member, HIPC_cl_indp_mbr::name, HIPC_cl_dp_stru::offset_p, HIPC_cl_dp_stru::size_p, HIPC_client::smdp_p, HIPC_cl_indp::struct_p, HIPC_cl_dp::struct_p, HIPC_cl_indp_mbr::struno, and HIPC_cl_indp_mbr::type.
Referenced by hipcClientGetStrutpl().
enum HIPC_errno hipcClientGetStrutpl | ( | struct HIPC_client *const | cl_p, |
char const *const | str, | ||
unsigned char * | struno_p, | ||
size_t * | offset_p, | ||
size_t * | size_p | ||
) |
Gets structure number, offset, and size from ID string.
cl_p | pointer to a HIPC client |
str | string that identifies an item |
struno_p | pointer to receive the structure number |
offset_p | pointer to receive the offset value |
size_p | pointer to receive the size |
Definition at line 698 of file client.c.
References GetStrutpl_mbr(), HIPC_ERR_INV_ID_STR, HIPC_client::hipc_errno, HIPC_MBR_STRUCT, HIPC_SUCCESS, hipcClientCheckStrutpl(), hipcClientSetErrDtlStr(), HIPC_client::indp_p, HIPC_cl_indp::n_struct, HIPC_cl_indp_stru::name, HIPC_client::smdp_p, HIPC_cl_indp::struct_p, HIPC_cl_dp::struct_size_p, HIPC_cl_indp_mbr::struno, and HIPC_cl_indp_mbr::type.
Referenced by hipcGet(), hipcPut(), hipcSetHandler(), test_hipcClientGetStrutpl(), and test_hipcClientGetStrutpl_tooLargeName().
enum HIPC_errno hipcClientEachMbr | ( | struct HIPC_client *const | cl_p, |
struct HIPC_cl_indp_mbr const *const | mbr_p, | ||
unsigned char *const | begin, | ||
unsigned char *const | end, | ||
unsigned char *const | scur_p, | ||
unsigned char *const | ccur_p, | ||
const size_t | ssize, | ||
const size_t | csize, | ||
void(*)(void *const ccur_p, void *const scur_p, const size_t n) | fnc_p | ||
) |
Calls the function specified by fnc_p with each member between begin and end.
When mbr_p points structure type, zeros can be passed as ssize and csize.
cl_p | pointer to a HIPC client. |
mbr_p | pointer to an object that has data of the member. |
begin | beginning address in the image for the server. |
end | ending address in the image for the server. |
scur_p | server's cuurent pointer. |
ccur_p | client's cuurent pointer. |
ssize | size of the item (member) in the server |
csize | size of the item (member) in the client |
fnc_p | pointer to the function to be called. |
Definition at line 756 of file client.c.
References HIPC_cl_indp_mbr::ary_dim, HIPC_cl_indp_mbr::ary_max_idxs, HIPC_client::cmdp_p, HIPC_cl_indp_mbr::elm_struno, HIPC_cl_indp_mbr::elm_type, HIPC_ERR_INTERNAL_ERROR, HIPC_MBR_ARRAY, HIPC_MBR_SIMPLE, HIPC_MBR_STRUCT, HIPC_SUCCESS, hipcClientEachMbr(), hipcClientSetError(), HIPC_client::indp_p, HIPC_cl_indp_stru::mbr_p, HIPC_cl_indp_stru::n_member, HIPC_cl_dp_stru::offset_p, HIPC_cl_dp_stru::size_p, HIPC_client::smdp_p, HIPC_cl_indp::struct_p, HIPC_cl_dp::struct_p, HIPC_cl_indp_mbr::struno, and HIPC_cl_indp_mbr::type.
Referenced by hipcClientEachMbr(), hipcClientPack(), hipcClientUnpack(), routine_hipcClientEachMbr(), and test_hipcClientEachMbr_err().
|
static |
Definition at line 852 of file client.c.
Referenced by hipcClientPack().
|
static |
Definition at line 859 of file client.c.
Referenced by hipcClientUnpack().
|
static |
Definition at line 866 of file client.c.
Referenced by hipcClientPack().
|
static |
Definition at line 879 of file client.c.
Referenced by hipcClientUnpack().
enum HIPC_errno hipcClientUnpack | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
const size_t | offset, | ||
const size_t | size, | ||
void * | simg, | ||
void * | cimg | ||
) |
Unpacks a range of contents of simg into cimg.
struno, offset, and size determine the range. If simg is NULL, this function uses memory that has been internally allocated. If cimg is NULL, this function uses memory that was set by hipcClientSetCimg(). If cimg is NULL and no memory has been set yet, this function does nothing.
cl_p | pointer to a HIPC client. |
struno | structure number for the structure to be unpacked |
offset | offset of the range in the server representation |
size | size of the range in the server representation |
simg | Server-side image of the structure |
cimg | Client-side image of the structure |
Definition at line 908 of file client.c.
References HIPC_client::cimg_pp, contra_convert_endian(), contra_memcpy(), HIPC_client::endian_convert, HIPC_MBR_STRUCT, HIPC_SUCCESS, hipcClientCheckStrutpl(), hipcClientEachMbr(), HIPC_client::simg_pp, HIPC_cl_indp_mbr::struno, and HIPC_cl_indp_mbr::type.
Referenced by hipcGet(), hipcWaitReturn(), test_hipcClientUnpack(), and test_hipcClientUnpack_NULLarg().
enum HIPC_errno hipcClientPack | ( | struct HIPC_client *const | cl_p, |
const unsigned char | struno, | ||
const size_t | offset, | ||
const size_t | size, | ||
void * | simg, | ||
void * | cimg | ||
) |
Packs a range of contents of cimg into simg.
struno, offset, and size determine the range. If simg is NULL, this function uses memory that has been internally allocated. If cimg is NULL, this function uses memory that was set by hipcClientSetCimg(). If cimg is NULL and no memory has been set yet, this function does nothing.
cl_p | pointer to a HIPC client. |
struno | structure number for the structure to be packed |
offset | offset of the range in the server representation |
size | size of the range in the server representation |
simg | Server-side image of the structure |
cimg | Client-side image of the structure |
Definition at line 962 of file client.c.
References HIPC_client::cimg_pp, convert_endian(), HIPC_client::endian_convert, HIPC_MBR_STRUCT, HIPC_SUCCESS, hipcClientCheckStrutpl(), hipcClientEachMbr(), memcpy_wrapper(), HIPC_client::simg_pp, HIPC_cl_indp_mbr::struno, and HIPC_cl_indp_mbr::type.
Referenced by hipcPut(), test_hipcClientPack(), and test_hipcClientPack_NULLarg().
enum HIPC_errno hipcClientFeedUnstrumsgAsError | ( | struct HIPC_client *const | cl_p, |
const hipc_msg | msgR | ||
) |
Feeds a message and sets an error specified by the message.
The message must have an unstructured body.
cl_p | pointer to a HIPC client. |
msgR | message to be fed |
Definition at line 1011 of file client.c.
References HIPC_client::err_detail_str, HIPC_ERR_PROTOCOL_VIOLATION, HIPC_client::hipc_errno, HIPC_IMG_ALLOCSIZE, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_SIZE, HIPC_UNSTRU, and hipcClientSetError().
Referenced by hipcOpen(), hipcWaitReturn(), and test_hipcClientFeedUnstrumsgAsError().
|
static |
Feeds a system message whose type is HIPC_SYSMSG_TYPE_OFFSET or HIPC_SYSMSG_TYPE_SIZE.
cl_p | pointer to a HIPC client. |
msg | system message to be fed |
tgtadr | target address to which new data will be set |
Definition at line 1038 of file client.c.
References HIPC_ERR_PROTOCOL_VIOLATION, HIPC_client::hipc_errno, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcClientMalloc(), hipcClientSetError(), HIPC_client::indp_p, HIPC_cl_indp_stru::n_member, HIPC_cl_indp::n_struct, and HIPC_cl_indp::struct_p.
Referenced by hipcClientFeedSysmsg().
enum HIPC_errno hipcClientFeedSysmsg | ( | struct HIPC_client *const | cl_p, |
const hipc_msg | msgR | ||
) |
Feeds a system message and incorporates it to the internal data of the client.
cl_p | pointer to a HIPC client. |
msgR | system message to be fed |
Definition at line 1087 of file client.c.
References HIPC_client::cmdp_p, HIPC_cl_dp::endian, HIPC_client::endian_convert, FeedSysmsg_OFFSET_SIZE(), HIPC_ERR_INV_ENDIAN, HIPC_ERR_PROTOCOL_VIOLATION, HIPC_client::hipc_errno, HIPC_MESSAGE_TYPE_SYS, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, HIPC_SYSMSG_TYPE_OFFSET, HIPC_SYSMSG_TYPE_OVERVIEW, HIPC_SYSMSG_TYPE_SIZE, hipcClientMalloc(), hipcClientSetError(), HIPC_client::indp_p, HIPC_cl_indp::n_struct, HIPC_cl_dp_stru::offset_p, HIPC_client::simg_pp, HIPC_cl_dp_stru::size_p, HIPC_client::smdp_p, HIPC_cl_dp::struct_p, HIPC_cl_dp::struct_size_p, and HIPC_cl_indp_mbr::struno.
Referenced by hipcOpen(), and test_hipcClientFeedSysmsg().
enum HIPC_errno hipcClientFeedStrumsg | ( | struct HIPC_client *const | cl_p, |
const hipc_msg | msgR | ||
) |
Feeds a message and incorporates it to the internal data of a client.
The message must have a structured body.
cl_p | pointer to a HIPC client. |
msgR | message to be fed |
Definition at line 1174 of file client.c.
References HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcClientCheckStrutpl(), and HIPC_client::simg_pp.
Referenced by hipcWaitReturn(), and test_hipcClientFeedStrumsg().
void hipcGenmsgHello | ( | hipc_msg | msg, |
const struct HIPC_client *const | cl_p | ||
) |
Generates HELLO message.
cl_p | pointer to a HIPC client |
msg | HIPC message to be set as HELLO |
Definition at line 1201 of file client.c.
References HIPC_cl_indp::cfgid, HIPC_cl_indp::cfgid_size, HIPC_MESSAGE_TYPE_HELLO, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, HIPC_MSGHDR_SIZE, HIPC_UNSTRU, and HIPC_client::indp_p.
Referenced by hipcOpen(), and test_hipcGenmsgHello().
enum HIPC_errno hipcGenmsgGet | ( | hipc_msg | msg, |
struct HIPC_client *const | cl_p, | ||
const unsigned char | struno, | ||
const size_t | offset, | ||
const size_t | size | ||
) |
Generates GET message.
cl_p | pointer to a HIPC client |
msg | HIPC message to be set as GET |
struno | structure number of the message |
offset | offset of the message |
size | size of the message |
Definition at line 1223 of file client.c.
References HIPC_MESSAGE_TYPE_GET, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, HIPC_SUCCESS, hipcClientCheckStrutpl(), and HIPC_cl_indp_mbr::struno.
Referenced by hipcGet(), and test_hipcGenmsgGet().
enum HIPC_errno hipcGenmsgPut | ( | hipc_msg | msg, |
struct HIPC_client *const | cl_p, | ||
const unsigned char | struno, | ||
const size_t | offset, | ||
const size_t | size | ||
) |
Generates PUT message.
cl_p | pointer to a HIPC client |
msg | HIPC message to be set as PUT |
struno | structure number of the message |
offset | offset of the message |
size | size of the message |
Definition at line 1253 of file client.c.
References HIPC_MESSAGE_TYPE_PUT, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcClientCheckStrutpl(), HIPC_client::simg_pp, and HIPC_cl_indp_mbr::struno.
Referenced by hipcPut(), and test_hipcGenmsgPut().
void hipcGenmsgBye | ( | hipc_msg | msg | ) |
Initializes a HIPC message as a BYE message.
msg | HIPC message to be initialized as BYE |
Definition at line 1279 of file client.c.
References HIPC_MESSAGE_TYPE_BYE, HIPC_MSGHDR_BYTE_BDYSZ, HIPC_MSGHDR_BYTE_OFFSET, HIPC_MSGHDR_BYTE_STRUNO, HIPC_MSGHDR_BYTE_TYPE, and HIPC_UNSTRU.
Referenced by hipcClose(), and test_hipcGenmsgBye().
|
static |
Definition at line 10 of file client.c.
Referenced by hipcClientGetErrStr().