JAM_FindUser - Find message to a user
#include <jamlib/jam.h>
int JAM_FindUser(s_JamBase* Base_PS,
ulong UserCrc_I,
ulong StartMsg_I,
ulong* MsgNo_PI);
Scans the message base looking for a message written to a specific user.
- Base_PS
- The message base to use
- UserCrc_I
- The CRC32 value for the searched name
- StartMsg_I
- The first message number to look at. This value is not the
message´s unique number, but rather the absolute position of the
message in the message base. Message 0 therefore means the first
message.
- MsgNo_PI
- A pointer to a variable where the message number for the found message
will be stored. This number is the absolute message position in the
message base. Message 0 means the first message.
- 0
- if successful
- JAM_IO_ERROR
- if an I/O error occured. See JAM_Errno(3)
- JAM_NO_USER
- if no message was found
uchar Name_AC[32];
int Result_I;
ulong Crc_I;
ulong Msg_I;
strcpy(Name_AC, "Bjorn Stenberg");
Crc_I = JAM_Crc32(Name_AC, strlen(Name_AC));
Result_I = JAM_FindUser(Base_PS, Crc_I, 0, &Msg_I);
switch (Result_I) {
case JAM_NO_USER:
printf("No message for me.\n");
break;
case JAM_IO_ERROR:
printf("IO error %d\n", JAM_Errno());
break;
}
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_Crc32(3), JAM_Errno(3)