Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
JAM_ReadMsgText(3)	    JAM	subroutine library	    JAM_ReadMsgText(3)

NAME
       JAM_ReadMsgText - Read a	message's text

SYNOPSIS
       #include	<jamlib/jam.h>

       int JAM_ReadMsgText(s_JamBase* Base_PS,
			   ulong      Offset_I,
			   ulong      Length_I,
			   uchar*     Buffer_PC);

DESCRIPTION
       Reads the body text associated with a message.

   Arguments
       Base_PS
	      The message base to use

       Offset_I
	      The  text	 position in the text file. This information is	stored
	      in the message header.

       Length_I
	      The text length. This  information  is  stored  in  the  message
	      header.

       Buffer_PC
	      A	pointer	to where the text should be stored.

RETURN VALUE
       0      if successful

       JAM_IO_ERROR
	      if an I/O	error occured. See JAM_Errno(3)

EXAMPLES
       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);

AUTHOR
       This manual page	was created by Sir Raorn <raorn@altlinux.ru>, based on
       original	JAMlib documentation by	Bjorn Stenberg <bjorn@haxx.nu> and Jo-
       han Billing <billing@df.lth.se>.

SEE ALSO
       jamlib(3), JAM_ReadMsgHeader(3),	JAM_Errno(3)

				  2002-11-07		    JAM_ReadMsgText(3)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | EXAMPLES | AUTHOR | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=JAM_ReadMsgText&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help