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

FreeBSD Manual Pages

  
 
  

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

NAME
       JAM_ChangeMsgHeader - Change a message's	header

SYNOPSIS
       #include	<jamlib/jam.h>

       int JAM_ChangeMsgHeader(s_JamBase*      Base_PS,
			       ulong	       MsgNo_I,
			       s_JamMsgHeader* Header_PS);

DESCRIPTION
       Writes over an old message header with a	new one. Only the header - not
       the subfields - can be changed due to the subfields' dynamic size.

       If message have MSG_DELETED attribute set, UserCRC field	in  index  and
       ActiveMsgs in base header are also updated.

   Arguments
       Base_PS
	      The message base to use

       MsgNo_I
	      The absolute message number. Message #0 is the first in the mes-
	      sage base.

       Header_PS
	      A	pointer	to the header structure	to write.

RETURN VALUE
       0      if successful

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

       JAM_NOT_LOCKED
	      if the message base is not locked

EXAMPLES
       s_JamMsgHeader  Header_S;
       int	       Result_I;

       /* [lock	the message base] */

       Result_I	= JAM_ReadMsgHeader(Base_PS, 0,	&Header_S, NULL);
       if (Result_I)
	 printf("JAM_ReadMsgHeader returned %d.\n", Result_I);

       Header_S.TimesRead++;

       Result_I	= JAM_ChangeMsgHeader(Base_PS, 0, &Header_S);
       if (Result_I)
	 printf("JAM_ChangeMsgHeader returned %d.\n", Result_I);

       /* [unlock the message base] */

NOTES
       Use this	function with caution. It is easy to corrupt a message by giv-
       ing it an incorrect header.

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_ClearMsgHeader(3),	JAM_LockMB(3),
       JAM_Errno(3)

				  2002-11-07		JAM_ChangeMsgHeader(3)

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

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

home | help