about summary refs log tree commit diff
path: root/irc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--irc.c (renamed from client.c)20
1 files changed, 10 insertions, 10 deletions
diff --git a/client.c b/irc.c
index 64f14cf..02a9f64 100644
--- a/client.c
+++ b/irc.c
@@ -36,13 +36,13 @@ static void webirc(const char *pass) {
 	int len = strlen(ssh);
 	const char *sp = strchr(ssh, ' ');
 	if (sp) len = sp - ssh;
-	clientFmt(
+	ircFmt(
 		"WEBIRC %s %s %.*s %.*s\r\n",
 		pass, chat.user, len, ssh, len, ssh
 	);
 }
 
-int clientConnect(const char *host, const char *port, const char *webPass) {
+int ircConnect(const char *host, const char *port, const char *webPass) {
 	int error;
 
 	struct tls_config *config = tls_config_new();
@@ -76,13 +76,13 @@ int clientConnect(const char *host, const char *port, const char *webPass) {
 	if (error) err(EX_PROTOCOL, "tls_connect");
 
 	if (webPass) webirc(webPass);
-	clientFmt("NICK %s\r\n", chat.nick);
-	clientFmt("USER %s 0 * :%s\r\n", chat.user, chat.nick);
+	ircFmt("NICK %s\r\n", chat.nick);
+	ircFmt("USER %s 0 * :%s\r\n", chat.user, chat.nick);
 
 	return sock;
 }
 
-void clientWrite(const char *ptr, size_t len) {
+void ircWrite(const char *ptr, size_t len) {
 	while (len) {
 		ssize_t ret = tls_write(client, ptr, len);
 		if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) continue;
@@ -92,7 +92,7 @@ void clientWrite(const char *ptr, size_t len) {
 	}
 }
 
-void clientFmt(const char *format, ...) {
+void ircFmt(const char *format, ...) {
 	char *buf;
 	va_list ap;
 	va_start(ap, format);
@@ -100,14 +100,14 @@ void clientFmt(const char *format, ...) {
 	va_end(ap);
 	if (!buf) err(EX_OSERR, "vasprintf");
 	if (chat.verbose) uiFmt("<<< %.*s", len - 2, buf);
-	clientWrite(buf, len);
+	ircWrite(buf, len);
 	free(buf);
 }
 
-void clientRead(void) {
-	static char buf[4096];
-	static size_t len;
+static char buf[4096];
+static size_t len;
 
+void ircRead(void) {
 	ssize_t read = tls_read(client, &buf[len], sizeof(buf) - len);
 	if (read < 0) errx(EX_IOERR, "tls_read: %s", tls_error(client));
 	if (!read) {
b9&follow=1'>Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe