aboutsummaryrefslogtreecommitdiff
path: root/thing.c
diff options
context:
space:
mode:
Diffstat (limited to 'thing.c')
-rw-r--r--thing.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/thing.c b/thing.c
index 6ea805a..3f84948 100644
--- a/thing.c
+++ b/thing.c
@@ -1,25 +1,4 @@
-#ifdef LOCAL
-#define HOST "0.0.0.0"
-#define PORT "6971"
-#define SOCKETNAME "bees.sock"
-#else
-#define HOST "ubq323.website"
-#define PORT "6667"
-#define SOCKETNAME "/srv/apiobot/bees.sock"
-#endif
-
-#ifdef DEBUG
-#define DP(x) puts(x)
-#else
-#define DP(x)
-#endif
-
-#define NICK "Bee"
-#define USERNAME "apiobot"
-#define REALNAME "apiobot"
-#define CHANNEL "#a"
-
-#define SOCKETGROUP "apionet"
+#include "conf.h"
#include <stdio.h>
#include <stdlib.h>
@@ -37,22 +16,6 @@
#include <arpa/inet.h>
#include <netinet/in.h>
-ssize_t sendall(int sockfd, void *buf, size_t len) {
- ssize_t total_sent = 0;
- ssize_t sent;
- do {
- if ((sent = send(sockfd, buf+total_sent, len-total_sent, 0)) == -1) {
- return -1;
- }
- total_sent += sent;
- } while (total_sent < len);
-#ifdef DEBUG
- char *the = strndup(buf, len);
- printf("SEND [%s]\n",the);
- free(the);
-#endif
- return total_sent;
-}
int irc_connect() {
struct addrinfo hints;