In file useracc.h:

int usr_injoth_ack

(onlinerec_t* user, char* msg, char* ack,
int force)

Page another user with a message and acknowledgement

Documentation

Page another user with a message and acknowledgement

`Injects' a string to another user and sends back delivery ackowledgement to the original user. Injected messages are displayed asynchronously. If the recipient user is in the process of typing a line, the message will not appear until the user has pressed Enter (there's a way to force synchronous delivery, but it's not considered polite to the user because it disrupts their typing). However, the user may be unable to receive the message for a considerable length of time: maybe they're the Sysop and currently running a UNIX shell, or in the full screen editor. In such cases, it may be necessary to send an acknowledgement note back to the sender of the injected message when that message finally gets delivered. The /p(age) command does that if the recipient allows it.

Parameters:
- user A pointer to the other user's onlinerec_t. You should obviously attach the other user's shared segment first, by calling usr_insys(). As a side effect, this will also make sure the other user is actually on-line.
msg - A null-terminated string holding the message to send to the user. No need for the message to be fully formatted, but it should in the other user's language. Having attached the other user's online record, you know what language they're using. Use the function msg_getl() to obtain prompts in the other user's language, and sprintf() to embed information in them. Any substitution variables in the string will be expanded in the other user's context.
ack - A null-terminated string holding the acknowledgement to be injected back to the original user upon delivery of the injected message. The total length of msg and ack must be less than the maximum System V IPC message size, MSGMAX (4080 bytes on Linux, your mileage may vary). This is acceptable, though. You should aim to send really small messages to other users. Large ones are bound to be annoying in the superlative.
force - If non-zero, the function will not respect the OLF_BUSY flag in the user's online record, sending the message even if the user is unable to receive it. Never do this unless absolutely necessary. The system does this to notify the user of imminent disconnections, but that's usually an emergency for the user. Bear in mind that the user may not be able to receive the message immediately. Stored pages work this way.
Returns:
Zero if the message could not be injected. One if it was successfully sent. This is asynchronous: the user may actually see the message at a later time. An acknowledgement will eventually be injected back to the sender only if the return value is 1 (i.e. no errors have occurred).
See Also:
{\tt usr_injoth()}.

Alphabetic index



This page was generated with the help of DOC++.