.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "libinn_inndcomm 3" .TH libinn_inndcomm 3 2024-04-01 "INN 2.7.2" "InterNetNews Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME inndcomm \- Routines for managing innd control commands .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #include \& \& #define SC_ADDHIST ... \& #define SC_ALLOW ... \& #define SC_BEGIN ... \& #define SC_CANCEL ... \& #define SC_CHANGEGROUP ... \& #define SC_CHECKFILE ... \& #define SC_DROP ... \& #define SC_FEEDINFO ... \& #define SC_FLUSH ... \& #define SC_FLUSHLOGS ... \& #define SC_GO ... \& #define SC_HANGUP ... \& #define SC_LOGMODE ... \& #define SC_LOWMARK ... \& #define SC_MODE ... \& #define SC_NAME ... \& #define SC_NEWGROUP ... \& #define SC_PARAM ... \& #define SC_PAUSE ... \& #define SC_PERL ... \& #define SC_PYTHON ... \& #define SC_READERS ... \& #define SC_REJECT ... \& #define SC_RELOAD ... \& #define SC_RENUMBER ... \& #define SC_RESERVE ... \& #define SC_RMGROUP ... \& #define SC_SEND ... \& #define SC_SHUTDOWN ... \& #define SC_STATHIST ... \& #define SC_STATUS ... \& #define SC_SIGNAL ... \& #define SC_THROTTLE ... \& #define SC_TIMER ... \& #define SC_TRACE ... \& #define SC_XABORT ... \& #define SC_XEXEC ... \& \& #define MAX_REASON_LEN ... \& \& extern int ICCopen(void); \& extern int ICCclose(void); \& extern void ICCsettimeout(int i); \& extern int ICCcommand(char cmd, const char *argv[], char **replyp); \& extern int ICCcancel(const char *msgid); \& extern int ICCpause(const char *why); \& extern int ICCreserve(const char *why); \& extern int ICCgo(const char *why); \& \& extern const char *ICCfailure; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The routines described in this manual page are part of the InterNetNews library, libinn(3). They are used to send commands to a running \fBinnd\fR daemon on the local host. The letters \f(CW\*(C`ICC\*(C'\fR stand for \fBI\fRnnd \fBC\fRontrol \&\fBC\fRommand. .PP The \fBICCopen\fR function creates a Unix-domain datagram socket and binds it to the server's control socket, if such sockets are supported. Otherwise, it creates a named pipe for communicating with the server. It returns \&\f(CW\*(C`\-1\*(C'\fR on failure or \f(CW\*(C`0\*(C'\fR on success. This routine must be called before any other routine. .PP The \fBICCclose\fR function closes any descriptors that have been created by \fBICCopen\fR. It returns \f(CW\*(C`\-1\*(C'\fR on failure or \f(CW\*(C`0\*(C'\fR on success. .PP The \fBICCsettimeout\fR function can be called before any of the following routines to determine how long the library should wait before giving up on getting the server's reply. This is done by setting and catching a SIGALRM signal(2). If the timeout is less than zero, then no reply will be waited for. The \fBSC_SHUTDOWN\fR, \fBSC_XABORT\fR, and \fBSC_XEXEC\fR commands do not get a reply either. The default, which can be obtained by setting the timeout to <0>, is to wait during 2 minutes. .PP The \fBICCcommand\fR function sends the command \fIcmd\fR with parameters \fIargv\fR to the server. It returns \f(CW\*(C`\-1\*(C'\fR on error. If the server replies, and \&\fIreplyp\fR is not NULL, it will be filled in with an allocated buffer that contains the full text of the server's reply. This buffer is a string in the form of "\fIdigits\fR \fItext\fR" where \fIdigits\fR is the text value of the recommended exit code (usually \f(CW\*(C`1\*(C'\fR, followed with \fItext\fR, giving the reason of the failure); a \f(CW\*(C`0\*(C'\fR value indicates success. Replies longer than 64KB will be truncated. The possible values of \fIcmd\fR are defined in the \fIinn/inndcomm.h\fR header file, and also in the SYNOPSIS of this man page. The parameters for each command are described in ctlinnd(8). This routine returns \f(CW\*(C`\-1\*(C'\fR on communication failure, or the exit status sent by the server which will never be negative. .PP The \fBICCcancel\fR function sends a \f(CW\*(C`cancel\*(C'\fR message to the server. Its \fImsgid\fR argument is the Message-ID of the article that should be cancelled. The return value is the same as for \fBICCcommand\fR. .PP The \fBICCpause\fR, \fBICCreserve\fR, and \fBICCgo\fR functions send a \f(CW\*(C`pause\*(C'\fR, \&\f(CW\*(C`reserve\*(C'\fR, or \f(CW\*(C`go\*(C'\fR command to the server, respectively. If \fBICCreserve\fR is used, then the \fIwhy\fR value used in the \fBICCpause\fR invocation must match; the value used in the \fBICCgo\fR invocation must always match the one used in the \fBICCpause\fR invocation. The return value for all three routines is the same as for \fBICCcommand\fR. .PP If any routine described above fails, the \fIICCfailure\fR variable will identify the system call that failed. .SH HISTORY .IX Header "HISTORY" Written by Rich $alz for InterNetNews. Rewritten into POD by Julien Elie. .SH "SEE ALSO" .IX Header "SEE ALSO" ctlinnd(8), innd(8), libinn(3).