JAM_ChangeMsgHeader - Change a message's header
#include <jamlib/jam.h>
int JAM_ChangeMsgHeader(s_JamBase* Base_PS,
ulong MsgNo_I,
s_JamMsgHeader* Header_PS);
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.
- Base_PS
- The message base to use
- MsgNo_I
- The absolute message number. Message #0 is the first in the message
base.
- Header_PS
- A pointer to the header structure to write.
- 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
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] */
Use this function with caution. It is easy to corrupt a message by giving it an
incorrect header.
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>.
jamlib(3), JAM_ReadMsgHeader(3), JAM_ClearMsgHeader(3),
JAM_LockMB(3), JAM_Errno(3)