aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-10 20:12:45 -0800
committerNicholas <nbnoll@eml.cc>2021-11-11 08:16:47 -0800
commit7ea1cdb7d31f00024f5a1d124b42cd19a03b959a (patch)
treef65abf9fa32856287de586129d4ed7c1c473864a /sys/cmd
parent43688fe7190d0350349d47727c3663421d5618dc (diff)
chore: libunicode -> libutf
Diffstat (limited to 'sys/cmd')
-rw-r--r--sys/cmd/dwm/dwm.h2
-rw-r--r--sys/cmd/dwm/rules.mk2
-rw-r--r--sys/cmd/ic/ic.c40
-rw-r--r--sys/cmd/ic/rules.mk2
-rw-r--r--sys/cmd/ic/strlcpy.c14
-rw-r--r--sys/cmd/menu/menu.h2
-rw-r--r--sys/cmd/rc/rc.h2
-rw-r--r--sys/cmd/rc/rules.mk2
-rw-r--r--sys/cmd/rules.mk3
-rw-r--r--sys/cmd/term/rules.mk4
-rw-r--r--sys/cmd/term/term.h2
11 files changed, 39 insertions, 36 deletions
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 <u.h>
#include <base.h>
-#include <libunicode.h>
+#include <libutf.h>
#include <errno.h>
#include <locale.h>
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 <u.h>
-#include <libn.h>
+#include <base.h>
#include <sys/select.h>
#include <sys/socket.h>
@@ -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 <u.h>
#include <base.h>
-#include <libunicode.h>
+#include <libutf.h>
#include <time.h>
#include <locale.h>
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 <u.h>
#include <base.h>
-#include <libunicode.h>
+#include <libutf.h>
// -----------------------------------------------------------------------
// 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=$(<D)/parse.h --output=$(<D)/parse.c $(<)
# Local rules
-$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libunicode/libunicode.a $(OBJ_DIR)/sys/base/base.a $(d)/parse.h
+$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a $(d)/parse.h
$(COMPLINK)
include share/pop.mk
diff --git a/sys/cmd/rules.mk b/sys/cmd/rules.mk
index 07adaf1..52a059b 100644
--- a/sys/cmd/rules.mk
+++ b/sys/cmd/rules.mk
@@ -17,6 +17,9 @@ include $(DIR)/rules.mk
# DIR := $(d)/test
# include $(DIR)/rules.mk
+DIR := $(d)/ic
+include $(DIR)/rules.mk
+
DIR := $(d)/dwm
include $(DIR)/rules.mk
diff --git a/sys/cmd/term/rules.mk b/sys/cmd/term/rules.mk
index ef307c1..4011839 100644
--- a/sys/cmd/term/rules.mk
+++ b/sys/cmd/term/rules.mk
@@ -2,7 +2,7 @@ include share/push.mk
# Iterate through subdirectory tree
# Local sources
-SRCS_$(d) := $(d)/term.c $(d)/x.c $(d)/hb.c
+SRCS_$(d) := $(d)/term.c $(d)/x.c #$(d)/hb.c
BINS_$(d) := $(d)/term
include share/paths.mk
@@ -18,7 +18,7 @@ $(BINS_$(d)): TCLIBS = \
`$(PKG) --libs freetype2` \
-lm -lrt -lX11 -lutil -lXft -lXrender -lharfbuzz
-$(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/term/term.h b/sys/cmd/term/term.h
index 3ff2852..f779654 100644
--- a/sys/cmd/term/term.h
+++ b/sys/cmd/term/term.h
@@ -3,7 +3,7 @@
#include <u.h>
#include <base.h>
-#include <libunicode.h>
+#include <libutf.h>
#include <signal.h>
#include <sys/ioctl.h>