From 7ea1cdb7d31f00024f5a1d124b42cd19a03b959a Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 10 Nov 2021 20:12:45 -0800 Subject: chore: libunicode -> libutf --- sys/cmd/dwm/dwm.h | 2 +- sys/cmd/dwm/rules.mk | 2 +- sys/cmd/ic/ic.c | 40 ++++++++++++++++++++-------------------- sys/cmd/ic/rules.mk | 2 +- sys/cmd/ic/strlcpy.c | 14 +++++++------- sys/cmd/menu/menu.h | 2 +- sys/cmd/rc/rc.h | 2 +- sys/cmd/rc/rules.mk | 2 +- sys/cmd/rules.mk | 3 +++ sys/cmd/term/rules.mk | 4 ++-- sys/cmd/term/term.h | 2 +- 11 files changed, 39 insertions(+), 36 deletions(-) (limited to 'sys/cmd') diff --git a/sys/cmd/dwm/dwm.h b/sys/cmd/dwm/dwm.h index 9b616d1..afec1f2 100644 --- a/sys/cmd/dwm/dwm.h +++ b/sys/cmd/dwm/dwm.h @@ -2,7 +2,7 @@ #pragma once #include #include -#include +#include #include #include diff --git a/sys/cmd/dwm/rules.mk b/sys/cmd/dwm/rules.mk index f7254cd..79c4548 100644 --- a/sys/cmd/dwm/rules.mk +++ b/sys/cmd/dwm/rules.mk @@ -22,7 +22,7 @@ $(BINS_$(d)): TCLIBS = \ `$(PKG) --libs freetype2` \ -lX11 -lXinerama -lXft -lX11-xcb -lxcb -lxcb-res -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libunicode/libunicode.a $(OBJ_DIR)/sys/base/base.a +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a $(COMPLINK) include share/pop.mk diff --git a/sys/cmd/ic/ic.c b/sys/cmd/ic/ic.c index 19b868d..7fc37d8 100644 --- a/sys/cmd/ic/ic.c +++ b/sys/cmd/ic/ic.c @@ -1,6 +1,6 @@ /* See LICENSE file for license details. */ #include -#include +#include #include #include @@ -308,7 +308,7 @@ channel_rm(Channel *c) free(c); } -static +static void channel_leave(Channel *c) { @@ -321,7 +321,7 @@ channel_leave(Channel *c) channel_rm(c); } -static +static void loginkey(int ircfd, const char *key) { @@ -347,13 +347,13 @@ udsopen(const char *uds) size_t len; int fd; - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { + if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "%s: socket: %s\n", argv0, strerror(errno)); exit(1); } sun.sun_family = AF_UNIX; - if (strlcpy(sun.sun_path, uds, sizeof(sun.sun_path)) >= sizeof(sun.sun_path)) { + if(strlcpy(sun.sun_path, uds, sizeof(sun.sun_path)) >= sizeof(sun.sun_path)) { fprintf(stderr, "%s: UNIX domain socket path truncation\n", argv0); exit(1); } @@ -403,7 +403,7 @@ tcpopen(const char *host, const char *service) return fd; } -static +static int isnumeric(const char *s) { @@ -464,7 +464,7 @@ proc_channels_privmsg(int ircfd, Channel *c, char *buf) ewritestr(ircfd, msg); } -static +static void proc_channels_input(int ircfd, Channel *c, char *buf) { @@ -700,8 +700,8 @@ handle_channels_input(int ircfd, Channel *c) { char buf[IRC_MSG_MAX]; - if (read_line(c->fdin, buf, sizeof(buf)) == -1) { - if (channel_reopen(c) == -1) + if(read_line(c->fdin, buf, sizeof(buf)) == -1) { + if(channel_reopen(c) == -1) channel_rm(c); return; } @@ -755,7 +755,7 @@ run(int ircfd, const char *host) int r, maxfd; snprintf(ping_msg, sizeof(ping_msg), "PING %s\r\n", host); - while (isrunning) { + while(isrunning) { maxfd = ircfd; FD_ZERO(&rdset); FD_SET(ircfd, &rdset); @@ -767,12 +767,12 @@ run(int ircfd, const char *host) memset(&tv, 0, sizeof(tv)); tv.tv_sec = 120; r = select(maxfd + 1, &rdset, 0, 0, &tv); - if (r < 0) { + if(r < 0){ if (errno == EINTR) continue; fprintf(stderr, "%s: select: %s\n", argv0, strerror(errno)); exit(1); - } else if (r == 0) { + }else if(r == 0){ if (time(nil) - last_response >= PING_TIMEOUT) { channel_print(channelmaster, "-!- ii shutting down: ping timeout"); exit(2); /* status code 2 for timeout */ @@ -780,11 +780,11 @@ run(int ircfd, const char *host) ewritestr(ircfd, ping_msg); continue; } - if (FD_ISSET(ircfd, &rdset)) { + if(FD_ISSET(ircfd, &rdset)) { handle_server_output(ircfd); last_response = time(nil); } - for (c = channels; c; c = tmp) { + for(c = channels; c; c = tmp) { tmp = c->next; if (FD_ISSET(c->fdin, &rdset)) handle_channels_input(ircfd, c); @@ -803,7 +803,7 @@ main(int argc, char *argv[]) int ircfd, r; /* use nickname and home dir of user by default */ - if (!(spw = getpwuid(getuid()))) { + if(!(spw = getpwuid(getuid()))) { fprintf(stderr, "%s: getpwuid: %s\n", argv0, strerror(errno)); exit(1); } @@ -837,10 +837,10 @@ main(int argc, char *argv[]) break; } ARGEND - if (!*host) + if(!*host) usage(); - if (uds) + if(uds) ircfd = udsopen(uds); else ircfd = tcpopen(host, service); @@ -861,15 +861,15 @@ main(int argc, char *argv[]) create_dirtree(ircpath); channelmaster = channel_add(""); /* master channel */ - if (key) + if(key) loginkey(ircfd, key); loginuser(ircfd, host, fullname && *fullname ? fullname : nick); setup(); run(ircfd, host); - if (channelmaster) + if(channelmaster) channel_leave(channelmaster); - for (c = channels; c; c = tmp) { + for(c = channels; c; c = tmp) { tmp = c->next; channel_leave(c); } diff --git a/sys/cmd/ic/rules.mk b/sys/cmd/ic/rules.mk index c373dfb..649c9ac 100644 --- a/sys/cmd/ic/rules.mk +++ b/sys/cmd/ic/rules.mk @@ -8,7 +8,7 @@ BINS_$(d) := $(d)/ic include share/paths.mk # Local rules -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libn/libn.a +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a $(COMPLINK) include share/pop.mk diff --git a/sys/cmd/ic/strlcpy.c b/sys/cmd/ic/strlcpy.c index db0e6f0..5af7906 100644 --- a/sys/cmd/ic/strlcpy.c +++ b/sys/cmd/ic/strlcpy.c @@ -15,18 +15,18 @@ strlcpy(char *dst, const char *src, size_t siz) size_t n = siz; /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') + if(n != 0) { + while(--n != 0) { + if((*d++ = *s++) == '\0') break; } } /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) + if(n == 0) { + if(siz != 0) *d = '\0'; /* NUL-terminate dst */ - while (*s++) + while(*s++) ; } - return(s - src - 1); /* count does not include NUL */ + return s - src - 1; /* count does not include NUL */ } diff --git a/sys/cmd/menu/menu.h b/sys/cmd/menu/menu.h index 8f1d6d7..f4345bb 100644 --- a/sys/cmd/menu/menu.h +++ b/sys/cmd/menu/menu.h @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include #include -#include +#include #include #include diff --git a/sys/cmd/rc/rc.h b/sys/cmd/rc/rc.h index 83c39e9..9b415fc 100644 --- a/sys/cmd/rc/rc.h +++ b/sys/cmd/rc/rc.h @@ -1,7 +1,7 @@ #include #include -#include +#include // ----------------------------------------------------------------------- // types diff --git a/sys/cmd/rc/rules.mk b/sys/cmd/rc/rules.mk index ceec50b..a2fd058 100644 --- a/sys/cmd/rc/rules.mk +++ b/sys/cmd/rc/rules.mk @@ -25,7 +25,7 @@ $(d)/parse.h $(d)/parse.c: $(d)/syntax.y yacc --header=$( #include -#include +#include #include #include -- cgit v1.2.1