Previous | Contents | Index |
Read a line from a message file.
status = PMDF_read_text (dq_context, text, text_len)
Argument Data type Access Mechanism dq_context context pointer read/write reference text descriptor read/write reference text_len unsigned word write reference
status = PMDFreadText (dq_context, text, text_len)
int PMDFreadText(PMDF_dq **dq_context, char *text, int *text_len)
dq_context
A message dequeue context created withPMDFdequeueInitialize
.text
A buffer to receive the line read from the message file. Length must be at leastBIGALFA_SIZE+1
bytes.text_len
Length in bytes of the line read from the message file. Callers usingPMDFreadText
must, on input, supply the maximum length in bytes of text.
Lines from a message file can be read, one at a time, usingPMDFreadLine
orPMDFreadText
. The only difference betweenPMDFreadLine
andPMDFreadText
is thatPMDFreadLine
removes the trailing line terminator, a line feed, from the end of the line before returning it to the caller. After reading the last line from the message, any subsequent calls toPMDFreadLine
orPMDFreadText
will return thePMDF__EOF
status code. That is, if two lines remain to be read, then the next two calls will read those two lines and returnPMDF__OK
. A third call will not read any line and will returnPMDF__EOF
.PMDFreadLine
andPMDFreadText
can be used to read both message header lines and the content of the message body. When either of these routines are used to read the message header, then the first blank line encountered signifies the end of the message header and the start of the message body. IfPMDFreadHeader
is used to read the message header, thenPMDFreadLine
andPMDFreadText
will only read the message body and the blank line separating the message header from message body will not be seen.PMDFrewindMessage
can be called to reset the read position to the start of the message header.
PMDF__OK Normal, successful completion. PMDF__BADCONTEXT Illegal or corrupt context. No data returned; no line read. PMDF__EOF End of message. PMDF__FATERRLIB Call to LIB$SCOPY_R_DX failed owing to a fatal internal error in the OpenVMS Run Time Library. No data returned although a line was read. PMDF__INSVIRMEM Insufficient virtual memory: call to LIB$GET_VM made by LIB$SCOPY_R_DX has failed. No data returned although a line was read. PMDF__INVSTRDES Invalid string descriptor for text: descriptor has an invalid value in its DSC$B_CLASS field. No data returned; however, a line was read. PMDF__STRTRU Supplied string was too long; value truncated to fit.
Previous | Next | Contents | Index |