Previous | Contents | Index |
Read a line from a message file.
status = PMDF_read_line (dq_context, line, line_len)
Argument Data type Access Mechanism dq_context context pointer read/write reference line descriptor read/write reference line_len unsigned word write reference
status = PMDFreadLine (dq_context, line, line_len)
int PMDFreadLine(PMDF_dq **dq_context, char *line, int *line_len)
dq_context
A message dequeue context created withPMDFdequeueInitialize
.line
A buffer to receive the line read from the message file. Length must be at leastBIGALFA_SIZE
bytes.line_len
Length in bytes of the line read. Callers usingPMDFreadLine
must, on input, supply the maximum length in bytes of line.
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 line: 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 |