Previous | Contents | Index |
Sequentially read a message from disk.
int POPSTORE_message_read (message_context, buffer, buffer_len, bytes_read) int message_context; char *buffer; int buffer_len; int *bytes_read;
Message context returned by a previous call to
message_context
POPSTORE_message_begin
. Used for input only.Pointer to a buffer into which to read message data. Used for output only.
buffer
Maximum length in bytes of the buffer. Used for input only.
buffer_len
On output, the number of bytes read and stored in the buffer. Used for output only.
bytes_read
A message accessed with a call toPOPSTORE_message_begin
can be sequentially read withPOPSTORE_message_read
.POPSTORE_message_read
will read up tobuflen-1
bytes of data, storing them in the buffer pointed at bybuffer
and terminating the data with a null.POPSTORE_message_read
should be repeatedly called until either POPSTORE_EOM or an error is returned. Note that whenPOPSTORE_EOM
is returned, data can also have been returned as indicated by a non-zero value forbytes_read
. Note that the data returned byPOPSTORE_message_read
will have embedded CRLF pairs marking the end of message records. Moreover, the data will be "dot stuffed" as per the POP protocol. An example of usingPOPSTORE_message_read
is given in Example 12-8.
POPSTORE_SUCCESS Normal, successful completion. POPSTORE_EOM End of message reached; normal, successful completion. POPSTORE_READERROR Error reading message file.
Previous | Next | Contents | Index |