PUBLIC: Read-Buffer object
[PUBLIC: struct MqLinkS]

Read and split a libmsgque_private package into several items. More...

Collaboration diagram for PUBLIC: Read-Buffer object:

Functions

MQ_EXTERN enum MqErrorE MqReadL_START (struct MqS *const context, MQ_BUF buf)
 creating a LST reference for reading the list items
MQ_EXTERN enum MqErrorE MqReadL_END (struct MqS *const context)
 deleting a LST reference after reading the list items was finished
MQ_EXTERN enum MqErrorE MqReadY (struct MqS *const context, MQ_BYT *const valP)
 read a native typed value from the Read-Buffer object
MQ_EXTERN enum MqErrorE MqReadO (struct MqS *const context, MQ_BOL *const valP)
MQ_EXTERN enum MqErrorE MqReadS (struct MqS *const context, MQ_SRT *const valP)
MQ_EXTERN enum MqErrorE MqReadI (struct MqS *const context, MQ_INT *const valP)
MQ_EXTERN enum MqErrorE MqReadF (struct MqS *const context, MQ_FLT *const valP)
MQ_EXTERN enum MqErrorE MqReadW (struct MqS *const context, MQ_WID *const valP)
MQ_EXTERN enum MqErrorE MqReadD (struct MqS *const context, MQ_DBL *const valP)
MQ_EXTERN enum MqErrorE MqReadC (struct MqS *const context, MQ_CST *const out)
 generic function to read an MQ_STR object from the Read-Buffer object
MQ_EXTERN enum MqErrorE MqReadB (struct MqS *const context, MQ_BIN *const out, MQ_SIZE *const len)
 generic function to read an MQ_BIN object from the Read-Buffer object
MQ_EXTERN enum MqErrorE MqReadU (struct MqS *const context, MQ_BUF *const out)
 generic function to read a MQ_BUF object from the Read-Buffer object
MQ_EXTERN enum MqErrorE MqReadL (struct MqS *const context, struct MqBufferLS **const out)
 read an MqBufferLS object from all items of the Read-Buffer object
MQ_EXTERN enum MqErrorE MqReadProxy (struct MqS *const readctx, struct MqS *const sendctx)
MQ_EXTERN enum MqErrorE MqReadUndo (struct MqS *const context)
 undo the last MqReadX operation
MQ_EXTERN MQ_SIZE MqReadGetNumItems (struct MqS const *const context)
 get the number of items left in the Read-Buffer object
MQ_EXTERN MQ_BOL MqReadItemExists (struct MqS const *const context)
 does an additional item exits in the Read-Buffer object

Detailed Description

Read and split a libmsgque_private package into several items.

The reading is done by an Read-Buffer object using an MqIoS object for doing the socket io. Every MqS object has only one Read-Buffer object and every Read-Buffer object has only one MqS object. The interface is used to extract the different MqTypeE data-types from the package doing the casting from one type to an other type if necessary.


Function Documentation

MQ_EXTERN enum MqErrorE MqReadB ( struct MqS *const   context,
MQ_BIN *const   out,
MQ_SIZE *const   len 
)

generic function to read an MQ_BIN object from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
Return values:
out the binary data to return
len the length of the binary data
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 674 of file read.c.

References MqReadS::bdy, MqReadS::canUndo, MqReadS::cur, MqBufferS::cur, MqBufferS::cursize, MqBufferS::data, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MQ_YES, MqErrorDbV, pReadWordM, MqLinkS::read, and unlikely.

MQ_EXTERN enum MqErrorE MqReadC ( struct MqS *const   context,
MQ_CST *const   out 
)

generic function to read an MQ_STR object from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
Return values:
out the string to return
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE
Attention:
the string returned has static allocation and have to be duplicated for long term storage.

Definition at line 652 of file read.c.

References MqReadS::bdy, MqReadS::canUndo, MqReadS::cur, MqBufferS::cur, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MQ_YES, MqBufferGetC(), MqErrorCheck, MqErrorDbV, MqErrorStack, pReadWordM, MqLinkS::read, and unlikely.

Referenced by MqSendEND_AND_WAIT(), pTokenCheckSystem(), and pTransSetResult().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadD ( struct MqS *const   context,
MQ_DBL *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 643 of file read.c.

References MQ_DBLT, and sReadA8().

MQ_EXTERN enum MqErrorE MqReadF ( struct MqS *const   context,
MQ_FLT *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 625 of file read.c.

References MQ_FLTT, and sReadA4().

MQ_EXTERN MQ_SIZE MqReadGetNumItems ( struct MqS const *const   context  ) 

get the number of items left in the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
Returns:
the number of items

Definition at line 771 of file read.c.

References MqReadS::bdy, MqS::link, MqBufferS::numItems, and MqLinkS::read.

Referenced by pTransSetResult().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadI ( struct MqS *const   context,
MQ_INT *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 616 of file read.c.

References MQ_INTT, and sReadA4().

Referenced by pTokenCheckSystem().

Here is the caller graph for this function:

MQ_EXTERN MQ_BOL MqReadItemExists ( struct MqS const *const   context  ) 

does an additional item exits in the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
Returns:
the number of items

Definition at line 779 of file read.c.

References MqReadS::bdy, MqS::link, MQ_NO, MQ_YES, MqBufferS::numItems, and MqLinkS::read.

Referenced by MqSendEND_AND_WAIT(), MqSendU(), and pTokenCheckSystem().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadL ( struct MqS *const   context,
struct MqBufferLS **const   out 
)

read an MqBufferLS object from all items of the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[in,out] out data will be appended to *out, if *out != NULL the *out value will be used otherwise *out will be set to a new MqBufferLS object
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 463 of file read.c.

References MqReadS::bdy, MqReadS::canUndo, MqS::link, MQ_ERROR_CONNECTED, MQ_NO, MQ_OK, MqBufferDup(), MqBufferLAppend(), MqBufferLCreate(), MqErrorCheck, MqErrorDbV, MqErrorStack, MqReadU(), MqBufferS::numItems, MqLinkS::read, and unlikely.

MQ_EXTERN enum MqErrorE MqReadL_END ( struct MqS *const   context  ) 

deleting a LST reference after reading the list items was finished

Parameters:
[in] context the initial MqS object created by MqContextCreate
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 178 of file read.c.

References ReadSaveS::bdy, MqReadS::bdy, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MqErrorDbV, pCachePush(), MqLinkS::read, MqReadS::save, ReadSaveS::save, MqReadS::saveCache, and unlikely.

Referenced by MqSendU(), pReadDelete(), and pReadL_CLEANUP().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadL_START ( struct MqS *const   context,
MQ_BUF  buf 
)

creating a LST reference for reading the list items

Parameters:
[in] context the initial MqS object created by MqContextCreate
[in] buf the buffer object to read the LST object data from or NULL to use new data from the Read-Buffer object. The object buf is the return value MqReadU
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE
Example:
 MQ_BUF buf = MqReadU(read);
 ...
 MqRead_LST_START(read,buf);
 MQ_INT myInt = MqReadI(read);
 ...
 MqRead_LST_END(read);

Definition at line 139 of file read.c.

References MqBufferU::B, ReadSaveS::bdy, MqReadS::bdy, MqBufferU::C, MqBufferS::cur, MqBufferS::cursize, MqBufferS::data, HDR_INT_LEN, iBufU2INT(), MqS::link, MQ_BINT, MQ_ERROR_CONNECTED, MQ_ERROR_TYPE, MQ_LSTT, MqErrorCheck, MqErrorDbV, MqErrorStack, MqLogTypeName(), MqReadU(), MqBufferS::numItems, pCachePop(), MqLinkS::read, MqReadS::save, ReadSaveS::save, MqReadS::saveCache, MqBufferS::size, str2int, MqReadS::type, MqBufferS::type, and unlikely.

Referenced by MqSendU().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadO ( struct MqS *const   context,
MQ_BOL *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 598 of file read.c.

References MQ_BOLT, and sReadA1().

Referenced by MqLinkCreate(), and pTokenCheckSystem().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadProxy ( struct MqS *const   readctx,
struct MqS *const   sendctx 
)

Definition at line 714 of file read.c.

References MQ_OK, MqErrorCheck, MqErrorCheckI, MqErrorCopy(), MqErrorGetCode(), MqReadU(), and MqSendU().

MQ_EXTERN enum MqErrorE MqReadS ( struct MqS *const   context,
MQ_SRT *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 607 of file read.c.

References MQ_SRTT, and sReadA2().

MQ_EXTERN enum MqErrorE MqReadU ( struct MqS *const   context,
MQ_BUF *const   out 
)

generic function to read a MQ_BUF object from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
Return values:
out the buffer to return
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE
Attention:
the object returned out is owned by Read-Buffer object and is only valid up to the next call to any MqRead? function. If a long-term object is required use the MqBufferDup function.
 MQ_BUF buf = MqBufferDup(MqReadU(read);

Definition at line 695 of file read.c.

References MqReadS::bdy, MqReadS::canUndo, MqReadS::cur, MqBufferS::cur, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MQ_YES, MqErrorDbV, pReadWordM, MqLinkS::read, and unlikely.

Referenced by MqReadL(), MqReadL_START(), MqReadProxy(), MqSendU(), pRead_RET_START(), and pTokenCheckSystem().

Here is the caller graph for this function:

MQ_EXTERN enum MqErrorE MqReadUndo ( struct MqS *const   context  ) 

undo the last MqReadX operation

Parameters:
[in] context the initial MqS object created by MqContextCreate
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE
Attention:
Can undo only the last MqReadX operation, multiple undo will corrupt the memory.

Definition at line 737 of file read.c.

References MqBufferU::B, MqReadS::bdy, MqReadS::canUndo, MqReadS::cur, MqBufferS::cur, MqBufferS::cursize, HDR_INT_LEN, MqS::link, MQ_ERROR_CONNECTED, MQ_ERROR_UNDO_FORBIDDEN, MQ_NO, MQ_OK, MQ_TYPE_IS_NATIVE, MqErrorDb, MqErrorDbV, MqBufferS::numItems, MqLinkS::read, MqBufferS::type, and unlikely.

MQ_EXTERN enum MqErrorE MqReadW ( struct MqS *const   context,
MQ_WID *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 634 of file read.c.

References MQ_WIDT, and sReadA8().

MQ_EXTERN enum MqErrorE MqReadY ( struct MqS *const   context,
MQ_BYT *const   valP 
)

read a native typed value from the Read-Buffer object

Parameters:
[in] context the initial MqS object created by MqContextCreate
[out] valP a pointer of the value to read
Returns:
the MqErrorE return status MQ_OK, MQ_ERROR or MQ_CONTINUE

Definition at line 589 of file read.c.

References MQ_BYTT, and sReadA1().


libmsgque project on SF: Get libmsgque at SourceForge.net. Fast, secure and Free Open Source software downloads    Generated on Mon Nov 9 16:57:13 2009 by doxygen 1.5.8