79 lines
1.8 KiB
Groff
79 lines
1.8 KiB
Groff
|
.\" $Id: JAM_ReadMsgText.3,v 1.1 2002/11/09 00:37:16 raorn Exp $
|
||
|
.\"
|
||
|
.TH JAM_ReadMsgText 3 2002-11-07 "" "JAM subroutine library"
|
||
|
.SH NAME
|
||
|
JAM_ReadMsgText \- Read a message\'s text
|
||
|
.SH SYNOPSIS
|
||
|
.nf
|
||
|
.B #include <jamlib/jam.h>
|
||
|
|
||
|
.BI "int JAM_ReadMsgText(s_JamBase* " Base_PS ","
|
||
|
.BI " ulong " Offset_I ","
|
||
|
.BI " ulong " Length_I ","
|
||
|
.BI " uchar* " Buffer_PC ");"
|
||
|
.RE
|
||
|
.fi
|
||
|
.SH DESCRIPTION
|
||
|
Reads the body text associated with a message.
|
||
|
.SS Arguments
|
||
|
.TP
|
||
|
.I Base_PS
|
||
|
The message base to use
|
||
|
.TP
|
||
|
.I Offset_I
|
||
|
The text position in the text file. This information is stored in the message
|
||
|
header.
|
||
|
.TP
|
||
|
.I Length_I
|
||
|
The text length. This information is stored in the message header.
|
||
|
.TP
|
||
|
.I Buffer_PC
|
||
|
A pointer to where the text should be stored.
|
||
|
.SH "RETURN VALUE"
|
||
|
.TP
|
||
|
.B 0
|
||
|
if successful
|
||
|
.TP
|
||
|
.B JAM_IO_ERROR
|
||
|
if an I/O error occured. See
|
||
|
.BR JAM_Errno (3)
|
||
|
.SH EXAMPLES
|
||
|
.nf
|
||
|
s_JamMsgHeader Header_S;
|
||
|
uchar* Buffer_PC;
|
||
|
int Result_I;
|
||
|
|
||
|
/* read msg header */
|
||
|
Result_I = JAM_ReadMsgHeader(Base_PS, 0, &Header_S, &SubPack_PS);
|
||
|
if (Result_I) {
|
||
|
printf("JAM_ReadMsgHeader returned %d.\\n", Result_I);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
/* allocate buffer text */
|
||
|
Buffer_PC = (uchar*) malloc(Header_S.TxtLen);
|
||
|
if (!Buffer_PC) {
|
||
|
printf("malloc failed.\\n");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
/* read text */
|
||
|
Result_I = JAM_ReadMsgText(Base_PS,
|
||
|
Header_S.TxtOffset,
|
||
|
Header_S.TxtLen,
|
||
|
Buffer_PC);
|
||
|
if (Result_I)
|
||
|
printf("JAM_ReadMsgText returned %d.\\n", Result_I);
|
||
|
|
||
|
free(Buffer_PC);
|
||
|
.fi
|
||
|
.SH AUTHOR
|
||
|
This manual page was created by Sir Raorn <raorn@altlinux.ru>,
|
||
|
based on original JAMlib documentation by Bjorn Stenberg
|
||
|
<bjorn@haxx.nu> and Johan Billing <billing@df.lth.se>.
|
||
|
.SH SEE ALSO
|
||
|
.BR jamlib (3),
|
||
|
.BR JAM_ReadMsgHeader (3),
|
||
|
.BR JAM_Errno (3)
|
||
|
.\" vim: ft=nroff
|