From: Michael D. Lowis Date: Fri, 16 Oct 2020 18:29:18 +0000 (+0000) Subject: hack it up X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=0fb2124a348a1c6dc55c417323d05a9dd30b83c9;p=proto%2Fsic.git hack it up --- diff --git a/config.h b/config.h new file mode 100644 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 774f357..5fb9a5e 100644 --- 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);