PMDF Programmer's Reference Manual


Previous Contents Index


PMDFreadLine

Read a line from a message file.

PASCAL

status = PMDF_read_line (dq_context, line, line_len)

argument information

Argument Data type Access Mechanism
dq_context context pointer read/write reference
line descriptor read/write reference
line_len unsigned word write reference

C

status = PMDFreadLine (dq_context, line, line_len)

argument information


int PMDFreadLine(PMDF_dq **dq_context, 
                 char     *line, 
                 int      *line_len) 


Arguments

dq_context

A message dequeue context created with PMDFdequeueInitialize .

line

A buffer to receive the line read from the message file. Length must be at least BIGALFA_SIZE bytes.

line_len

Length in bytes of the line read. Callers using PMDFreadLine must, on input, supply the maximum length in bytes of line.

Description

Lines from a message file can be read, one at a time, using PMDFreadLine or PMDFreadText . The only difference between PMDFreadLine and PMDFreadText is that PMDFreadLine 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 to PMDFreadLine or PMDFreadText will return the PMDF__EOF status code. That is, if two lines remain to be read, then the next two calls will read those two lines and return PMDF__OK . A third call will not read any line and will return PMDF__EOF . PMDFreadLine and PMDFreadText 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. If PMDFreadHeader is used to read the message header, then PMDFreadLine and PMDFreadText 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.

Return Values

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