PMDF popstore & MessageStore Manager's Guide
PMDF-POP-6.0
Previous
| Contents
POPSTORE_message_read
Sequentially read a message from disk.
FORMAT
int POPSTORE_message_read (message_context, buffer,
buffer_len, bytes_read)
int message_context;
char *buffer;
int buffer_len;
int *bytes_read;
ARGUMENTS
message_context
Message context returned by a previous call to POPSTORE_message_begin.
Used for input only.
buffer
Pointer to a buffer into which to read message data. Used for output
only.
buffer_len
Maximum length in bytes of the buffer. Used for input only.
bytes_read
On output, the number of bytes read and stored in the buffer. Used for
output only.
DESCRIPTION
A message accessed with a call to POPSTORE_message_begin may be
sequentially read with POPSTORE_message_read. POPSTORE_message_read
will read up to buflen-1 bytes of data, storing them in
the buffer pointed at by buffer 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 when
POPSTORE_EOM is returned, data may also have been returned as indicated
by a non-zero value for bytes_read. Note that the data
returned by POPSTORE_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 using POPSTORE_message_read is
given in Examples
12-8 .
Return Values
| POPSTORE_SUCCESS |
Normal, successful completion. |
| POPSTORE_EOM |
End of message reached; normal, successful completion. |
| POPSTORE_READERROR |
Error reading message file. |
Previous
| Next
| Contents