CLIENTLIB(3)
π CLIENTLIB(3) β NNTP clientlib, but make it make sense π
okay so this is the CLIENTLIB(3) page from the Library Functions Manual, and itβs literally the NNTP clientlib part of the InterNetNews library. bestie, these routines are the group chat between your program and an NNTP server, and they are lowkey iconic. π¦
β¨ NAME β¨
clientlib β NNTP clientlib part of InterNetNews library. no cap, thatβs the name. π
π«Ά SYNOPSIS π«Ά
extern FILE *ser_rd_fp;
extern FILE *ser_wr_fp;
extern char ser_line[];
char *
getserverbyfile(file)
char *file;
int
server_init(host)
char *host;
int
handle_server_response(response, host)
int reponse;
char *host;
void
put_server(text)
char *text;
int
get_server(buff, buffsize)
char *buff;
int buffsize;
void
close_server()
π DESCRIPTION π
The routines described in this manual page are part of the InterNetNews library, libinn(3). They are replacements for the ``clientlib'' part of the NNTP distribution, and theyβre intended to be used in building programs like rrn. slay. β¨
getserverbyfile(file)β callsGetConfigValueto get the name of the local NNTP server. It returns a pointer to static space. Thefileparameter is ignored. πserver_init(host)β opens a connection to the NNTP server at the specifiedhost. It returns the serverβs response code or-1on error. If a connection was made, thenser_rd_fpandser_wr_fpcan be used to read from and write to the server, respectively, andser_linewill contain the serverβs response.ser_linecan also be used in other routines. π«Άhandle_server_response(response, host)β decodes the response, which comes from the server onhost. If the client is authorized, it returns0. A client that is only allowed to read is authorized, buthandle_server_responsewill print a message on the standard output. If the client is not authorized to talk to the server, then a message is printed and the routine returns-1. πput_server(text)β sends the text inbuffto the server, adding the necessary NNTP line terminators, and flushing the I/O buffer.
bestie note: the synopsis calls the argumenttext, but the description saysbuffβ Iβm not fixing the lore, Iβm just reporting it π
get_server(buff, buffsize)β reads a line of text from the server intobuff, reading at mostbuffsizecharacters. Any trailing\r\nterminators are stripped off.get_serverreturns-1on error. πΈclose_server()β sends aquitcommand to the server and closes the connection. bye server, it was real π
π¦ HISTORY π¦
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.4, dated 1992/04/03. vintage, honestly. π
π SEE ALSO π
libinn(3)β go read that one too, bestie. π
π thatβs the whole CLIENTLIB(3) page, bestie: InterNetNews library, revision 1.4, dated 1992/04/03. mwah π
π¦ where this page comes from
- debian bookworm: inn 1:1.7.2q-47
- debian trixie: inn 1:1.7.2q-52
- ubuntu jammy: inn 1:1.7.2q-46build3
- ubuntu noble: inn 1:1.7.2q-50
- ubuntu questing: inn 1:1.7.2q-52
- ubuntu resolute: inn 1:1.7.2q-52build1
- ubuntu stonking: inn 1:1.7.2q-52build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms