Updated ERR function
This commit is contained in:
parent
f62c8d4f75
commit
77d5a79c73
@ -6,14 +6,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <libircclient/libircclient.h>
|
#include <libircclient.h>
|
||||||
|
|
||||||
#define SERVER "irc.rizon.net"
|
#define SERVER "irc.rizon.net"
|
||||||
#define PORT 6667
|
#define PORT 6667
|
||||||
#define CHANNEL "#/g/chad"
|
#define CHANNEL "#/g/chad"
|
||||||
#define USERNAME "probotic"
|
#define USERNAME "probotic"
|
||||||
|
|
||||||
#define ERR(msg,ret) do { fputs(msg); return ret; } while (0)
|
#define ERR(ret,msg) do { fputs(msg "\n", stderr); return ret; } while (0)
|
||||||
|
|
||||||
irc_session_t * session;
|
irc_session_t * session;
|
||||||
irc_callbacks_t callbacks;
|
irc_callbacks_t callbacks;
|
||||||
@ -83,10 +83,10 @@ init(void)
|
|||||||
|
|
||||||
session = irc_create_session(&callbacks);
|
session = irc_create_session(&callbacks);
|
||||||
if (!session)
|
if (!session)
|
||||||
{ ERR("Error creating IRC session\n", 1); }
|
{ ERR(1, "Error creating IRC session"); }
|
||||||
irc_connect(session, SERVER, PORT, 0, USERNAME, USERNAME, USERNAME);
|
irc_connect(session, SERVER, PORT, 0, USERNAME, USERNAME, USERNAME);
|
||||||
if (irc_run(session) != 0)
|
if (irc_run(session) != 0)
|
||||||
{ ERR("Error running IRC session\nNo net?", 1); }
|
{ ERR(1, "Error running IRC session\nNo net?"); }
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user