summary refs log tree commit diff stats
path: root/main.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2013-08-10 13:02:52 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2013-08-10 13:02:52 -0400
commitc5bf41e4c8ba513602e835c50ea815d6cc9de335 (patch)
tree54a15c4d4202b246a86fa240c7f39546d9b996e5 /main.cpp
parent17dec0f70d683ffe217173f9de4ad2a92128487c (diff)
downloadkankri-c5bf41e4c8ba513602e835c50ea815d6cc9de335.tar.gz
kankri-c5bf41e4c8ba513602e835c50ea815d6cc9de335.tar.bz2
kankri-c5bf41e4c8ba513602e835c50ea815d6cc9de335.zip
Added Makefile
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp index 99f8cad..1ef7833 100644 --- a/main.cpp +++ b/main.cpp
@@ -20,7 +20,11 @@
20 * 20 *
21 */ 21 */
22 22
23char* hostname, nick, port, password, channel; 23char* hostname;
24char* nick;
25int port;
26char* password;
27char* channel;
24 28
25char* _(const char* str) 29char* _(const char* str)
26{ 30{
@@ -32,8 +36,6 @@ char* _(const char* str)
32int message(char* params, irc_reply_data* hostd, void* conn) 36int message(char* params, irc_reply_data* hostd, void* conn)
33{ 37{
34 std::string str(params); 38 std::string str(params);
35 std::string thetime(asctime(gettime()));
36 thetime = thetime.substr(4,15);
37 39
38 if (*hostd->target != '#') 40 if (*hostd->target != '#')
39 { 41 {
@@ -62,12 +64,11 @@ void terminate(int param)
62 64
63int main(int argc, char** argv) 65int main(int argc, char** argv)
64{ 66{
65 atexit(end_logging);
66 signal(SIGTERM, terminate); 67 signal(SIGTERM, terminate);
67 68
68 YAML::Node config = YAML::LoadFile("config.yml"); 69 YAML::Node config = YAML::LoadFile("config.yml");
69 hostname = _(config["hostname"].as<std::string>().c_str()); 70 hostname = _(config["hostname"].as<std::string>().c_str());
70 port = _(config["port"].as<std::string>().c_str()); 71 port = config["port"].as<int>();
71 nick = _(config["nick"].as<std::string>().c_str()); 72 nick = _(config["nick"].as<std::string>().c_str());
72 password = _(config["password"].as<std::string>().c_str()); 73 password = _(config["password"].as<std::string>().c_str());
73 channel = _(config["password"].as<std::string>().c_str()); 74 channel = _(config["password"].as<std::string>().c_str());