]> git.mdlowis.com Git - proto/sic.git/commitdiff
hack it up master
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 16 Oct 2020 18:29:18 +0000 (18:29 +0000)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 16 Oct 2020 18:29:18 +0000 (18:29 +0000)
config.h [new file with mode: 0644]
sic.c

diff --git a/config.h b/config.h
new file mode 100644 (file)
index 0000000..1f2f86a
--- /dev/null
+++ b/config.h
@@ -0,0 +1,14 @@
+/* Host used when "-h" is not given */
+#define DEFAULT_HOST "localhost"
+
+/* Port used when "-p" is not given */
+#define DEFAULT_PORT "6667"
+
+/* Timestamp format; see strftime(3). */
+#define TIMESTAMP_FORMAT "%Y-%m-%d %R"
+
+/* Command prefix character. In most IRC clients this is '/'. */
+#define COMMAND_PREFIX_CHARACTER ':'
+
+/* Parting message used when none is specified with ":l ..." command. */
+#define DEFAULT_PARTING_MESSAGE "sic - 250 LOC are too much!"
diff --git a/sic.c b/sic.c
index 774f357aff161655e710fd60d26e79be871d1d24..5fb9a5e73f8418939207c7e63788f172bee55571 100644 (file)
--- a/sic.c
+++ b/sic.c
@@ -20,7 +20,7 @@ static char *password;
 static char nick[32];
 static char bufin[4096];
 static char bufout[4096];
-static char channel[256];
+static char channel[256] = "#chat";
 static time_t trespond;
 static FILE *srv;
 
@@ -178,18 +178,15 @@ main(int argc, char *argv[]) {
        if (!srv)
                eprint("fdopen:");
        /* login */
-       if(password)
-               sout("PASS %s", password);
-       sout("NICK %s", nick);
-       sout("USER %s localhost %s :%s", nick, host, nick);
+//     if(password)
+//             sout("PASS %s", password);
+       sout("NICK tortoise");
+       sout("USER tortoise localhost localhost :tortoise");
+       sout("JOIN #chat");
        fflush(srv);
        setbuf(stdout, NULL);
        setbuf(srv, NULL);
        setbuf(stdin, NULL);
-#ifdef __OpenBSD__
-       if (pledge("stdio", NULL) == -1)
-               eprint("error: pledge:");
-#endif
        for(;;) { /* main loop */
                FD_ZERO(&rd);
                FD_SET(0, &rd);