From 7cc95a79a7a4ed8fb8fb3c5e1946a59c93ff335e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 1 Aug 2015 11:48:59 -0500 Subject: Move strlower() from find to lib. --- lib/lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 3183f32..39212df 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -160,6 +160,7 @@ long xstrtol(char *str, char **end, int base); long atolx(char *c); long atolx_range(char *numstr, long low, long high); int stridx(char *haystack, char needle); +char *strlower(char *s); int unescape(char c); int strstart(char **a, char *b); off_t fdlength(int fd); -- cgit v1.2.3 From ea75e752f930df7b740a773294b997f46927c716 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 3 Aug 2015 14:34:01 -0500 Subject: Factor out xconnect(), plus some other small cleanups to telnet.c. --- lib/lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 39212df..8e6a8e2 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -205,6 +205,8 @@ void tty_sigreset(int i); // net.c int xsocket(int domain, int type, int protocol); void xsetsockopt(int fd, int level, int opt, void *val, socklen_t len); +int xconnect(char *host, int port, int family, int socktype, int protocol, + int flags); // password.c int get_salt(char *salt, char * algo); -- cgit v1.2.3 From 35dafc7b17ce23da62dcce2195bed9b370680e65 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 5 Aug 2015 20:32:49 -0500 Subject: Tweak xconnect: socket can be a string (ala "ftp") from /etc/services. Still need a rethink on how to handle socket/bind/connect sequence. --- lib/lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 8e6a8e2..1b3f957 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -205,7 +205,7 @@ void tty_sigreset(int i); // net.c int xsocket(int domain, int type, int protocol); void xsetsockopt(int fd, int level, int opt, void *val, socklen_t len); -int xconnect(char *host, int port, int family, int socktype, int protocol, +int xconnect(char *host, char *port, int family, int socktype, int protocol, int flags); // password.c -- cgit v1.2.3 From 0fb465194789965b6fb2efd31995a2441144d650 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 8 Aug 2015 21:10:44 -0500 Subject: Different tools have different ideas about what human-readable output looks like. dd uses "7 MB" where du uses "7M", for example. this patch adds flags, similar to the BSD humanize_number. most callers will pass 0. --- lib/lib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 1b3f957..17a4a97 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -177,7 +177,9 @@ void replace_tempfile(int fdin, int fdout, char **tempname); void crc_init(unsigned int *crc_table, int little_endian); void base64_init(char *p); int yesno(char *prompt, int def); -int human_readable(char *buf, unsigned long long num); +#define HR_SPACE 1 +#define HR_B 2 +int human_readable(char *buf, unsigned long long num, int style); int qstrcmp(const void *a, const void *b); int xpoll(struct pollfd *fds, int nfds, int timeout); -- cgit v1.2.3