CLIENTLIB(3)

πŸ“¦
version 1.7.2q Β· 2 versions
  • 1.7.2q Β· debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.6.4 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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) β€” calls GetConfigValue to get the name of the local NNTP server. It returns a pointer to static space. The file parameter is ignored. πŸŽ€
  • server_init(host) β€” opens a connection to the NNTP server at the specified host. It returns the server’s response code or -1 on error. If a connection was made, then ser_rd_fp and ser_wr_fp can be used to read from and write to the server, respectively, and ser_line will contain the server’s response. ser_line can also be used in other routines. 🫢
  • handle_server_response(response, host) β€” decodes the response, which comes from the server on host. If the client is authorized, it returns 0. A client that is only allowed to read is authorized, but handle_server_response will 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 in buff to the server, adding the necessary NNTP line terminators, and flushing the I/O buffer.
bestie note: the synopsis calls the argument text, but the description says buff β€” I’m not fixing the lore, I’m just reporting it 😭
  • get_server(buff, buffsize) β€” reads a line of text from the server into buff, reading at most buffsize characters. Any trailing \r\n terminators are stripped off. get_server returns -1 on error. 🌸
  • close_server() β€” sends a quit command 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 πŸ’‹