libsrsirc  0.0.14
Lightweight, cross-platform IRC library
irc.h
Go to the documentation of this file.
1 /* irc.h - very basic front-end interface (irc_ext.h has the rest)
2  * libsrsirc - a lightweight serious IRC lib - (C) 2012-15, Timo Buhrmester
3  * See README for contact-, COPYING for license information. */
4 
5 #ifndef LIBSRSIRC_IRC_H
6 #define LIBSRSIRC_IRC_H 1
7 
8 
9 #include <stdarg.h>
10 #include <stdbool.h>
11 #include <stddef.h>
12 
13 #include <libsrsirc/defs.h>
14 
15 
135 irc *irc_init(void);
136 
149 void irc_dispose(irc *ctx);
150 
179 bool irc_connect(irc *ctx);
180 
194 void irc_reset(irc *ctx);
195 
210 bool irc_online(irc *ctx);
211 
261 int irc_read(irc *ctx, tokarr *tok, uint64_t to_us);
262 
276 bool irc_write(irc *ctx, const char *line);
277 
291 bool irc_printf(irc *ctx, const char *fmt, ...);
292 
311 const char *irc_mynick(irc *ctx);
312 
328 bool irc_set_server(irc *ctx, const char *host, uint16_t port);
329 
345 bool irc_set_pass(irc *ctx, const char *srvpass);
346 
366 bool irc_set_uname(irc *ctx, const char *uname);
367 
386 bool irc_set_fname(irc *ctx, const char *fname);
387 
408 bool irc_set_nick(irc *ctx, const char *nick);
409 
417 void irc_dump(irc *ctx);
418 
421 #endif /* LIBSRSIRC_IRC_H */
void irc_dispose(irc *ctx)
Destroy an IRC context, invalidating the provided pointer.
bool irc_set_uname(irc *ctx, const char *uname)
set IRC &#39;user name&#39; (not the same as nickname).
bool irc_printf(irc *ctx, const char *fmt,...)
Send a formatted message to the IRC server, printf-style.
bool irc_set_nick(irc *ctx, const char *nick)
set IRC &#39;nickname&#39; for the next connection.
struct irc_s irc
IRC context; pointers to this are our IRC context handle type.
Definition: defs.h:144
bool irc_write(irc *ctx, const char *line)
Send a protocol message to the IRC server.
char * tokarr[18]
Field array for the parts of incoming IRC protocol messages.
Definition: defs.h:174
int irc_read(irc *ctx, tokarr *tok, uint64_t to_us)
Read and process the next protocol message from the IRC server.
bool irc_set_server(irc *ctx, const char *host, uint16_t port)
Set IRC server and port to connect to.
const char * irc_mynick(irc *ctx)
Tell what our nickname is or was.
void irc_dump(irc *ctx)
Dump state for debugging purposes.
bool irc_set_fname(irc *ctx, const char *fname)
set IRC &#39;full name&#39; for the next connection.
bool irc_set_pass(irc *ctx, const char *srvpass)
Set server password (NULL means no password).
irc * irc_init(void)
Allocate and initialize a new IRC context.
bool irc_connect(irc *ctx)
Connect and log on to IRC.
bool irc_online(irc *ctx)
Tell whether or not we (think we) are connected.
void irc_reset(irc *ctx)
Force a disconnect from the IRC server.