chiark / gitweb /
some fixes; debug for missing
[inn-innduct.git] / doc / man / clientlib.3
1 .\" $Revision: 6312 $
2 .TH CLIENTLIB 3
3 .SH NAME
4 clientlib \- NNTP clientlib part of InterNetNews library
5 .SH SYNOPSIS
6 .nf
7 .ta \w'    unsigned long    'u
8 .B "extern FILE *ser_rd_fp;"
9 .B "extern FILE *ser_wr_fp;"
10 .B "extern char ser_line[];"
11
12 .B "char *"
13 .B "getserverbyfile(file)"
14 .B "    char    *file;"
15
16 .B "int"
17 .B "server_init(host)"
18 .B "    char    *host;"
19
20 .B "int"
21 .B "handle_server_response(response, host)"
22 .B "    int     reponse;"
23 .B "    char    *host;"
24
25 .B "void"
26 .B "put_server(text)"
27 .B "    char    *text;"
28
29 .B "int"
30 .B "get_server(buff, buffsize)"
31 .B "    char    *buff;"
32 .B "    int     buffsize;"
33
34 .B "void"
35 .B "close_server()"
36 .fi
37 .SH DESCRIPTION
38 The routines described in this manual page are part of the InterNetNews
39 library,
40 .IR libinn (3).
41 They are replacements for the ``clientlib'' part of the NNTP distribution,
42 and are intended to be used in building programs like
43 .IR rrn .
44 .PP
45 .I Getserverbyfile
46 calls
47 .I GetConfigValue
48 to get the name of the local NNTP server.
49 It returns a pointer to static space.
50 The
51 .I file
52 parameter is ignored.
53 .PP
54 .I Server_init
55 opens a connect to the NNTP server at the specified
56 .IR host .
57 It returns the server's response code or \-1 on error.
58 If a connection was made, then
59 .I ser_rd_fp
60 and
61 .I ser_wr_fp
62 can be used to read from and write to the server, respectively, and
63 .I ser_line
64 will contain the server's response.
65 .I Ser_line
66 can also be used in other routines.
67 .PP
68 .I Handle_server_response
69 decodes the
70 .IR response ,
71 which comes from the server on
72 .IR host.
73 If the client is authorized, it returns 0.
74 A client that is only allowed to read is authorized, but
75 .I handle_server_response
76 will print a message on the standard output.
77 If the client is not authorized to talk to the server, then a message is
78 printed and the routine returns \-1.
79 .PP
80 .I Put_server
81 sends the text in
82 .I buff
83 to the server, adding the necessary NNTP line terminators, and flushing
84 the I/O buffer.
85 .PP
86 .I Get_server
87 reads a line of text from the server into
88 .IR buff ,
89 reading at most
90 .I buffsize
91 characters.
92 Any trailing \er\en terminators are stripped off.
93 .I Get_server
94 returns \-1 on error.
95 .PP
96 .I Close_server
97 sends a ``quit'' command to the server and closes the connection.
98 .SH HISTORY
99 Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.
100 .de R$
101 This is revision \\$3, dated \\$4.
102 ..
103 .R$ $Id: clientlib.3 6312 2003-05-04 21:40:11Z rra $
104 .SH "SEE ALSO"
105 libinn(3).