skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit e8fe8ed8117bb1a58cd588b295352875d3c08c1a
parent 0a181fc1b38a62e583f13ccc1550f7ffc8f5896b
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Sat, 21 Jul 2018 11:16:11 +0000

 Remove mininetstring, absolutepath, absolutepath_tmp

Diffstat:
MNEWS | 2++
Mdoc/upgrade.html | 6+++++-
Mpackage/deps.mak | 8++------
Msrc/include/skalibs/djbunix.h | 3---
Dsrc/include/skalibs/mininetstring.h | 12------------
Msrc/include/skalibs/stddjb.h | 1-
Dsrc/libstddjb/mininetstring_read.c | 43-------------------------------------------
Dsrc/libstddjb/mininetstring_write.c | 36------------------------------------
Msrc/libstddjb/sarealpath.c | 2+-
Dsrc/libstddjb/sarealpath_tmp.c | 11-----------
10 files changed, 10 insertions(+), 114 deletions(-)

diff --git a/NEWS b/NEWS @@ -6,6 +6,8 @@ In 2.7.0.0 - Bugfixes. - New functions: ipc_timed_sendv(), unlink_void() - dir_close() now returns void and leaves errno unchanged + - absolutepath(), sarealpath_tmp(), mininetstring functions removed + - djbunix.h doesn't include env.h anymore In 2.6.4.0 diff --git a/doc/upgrade.html b/doc/upgrade.html @@ -20,8 +20,12 @@ <ul> <li> New functions: <tt>ipc_timed_sendv()</tt>, <tt>unlink_void()</tt> </li> - <li> The <a href="djbunix.html">dir_close()</a> function now returns void + <li> The <a href="libstddjb/djbunix.html">dir_close()</a> function now returns void and leaves errno unchanged. </li> + <li> The <tt>absolutepath()</tt> and <tt>sarealpath_tmp()</tt> functions, as well +as the <tt>skalibs/mininetstring.h</tt> family of functions, have been removed. </li> + <li> <a href="libstddjb/djbunix.html">skalibs/djbunix.h</a> does not include +<tt>skalibs/env.h</tt> anymore. </li> </ul> <h2> in 2.6.4.0 </h2> diff --git a/package/deps.mak b/package/deps.mak @@ -18,7 +18,7 @@ src/include/skalibs/cdb.h: src/include/skalibs/gccattributes.h src/include/skalibs/cdb_make.h: src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/diuint32.h src/include/skalibs/genalloc.h src/include/skalibs/datastruct.h: src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/avltreen.h src/include/skalibs/genqdyn.h src/include/skalibs/genset.h src/include/skalibs/gensetdyn.h src/include/skalibs/djbtime.h: src/include/skalibs/tai.h src/include/skalibs/uint64.h -src/include/skalibs/djbunix.h: src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h src/include/skalibs/stralloc.h +src/include/skalibs/djbunix.h: src/include/skalibs/envalloc.h src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h src/include/skalibs/stralloc.h src/include/skalibs/env.h: src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h src/include/skalibs/envalloc.h: src/include/skalibs/genalloc.h src/include/skalibs/environ.h: src/include/skalibs/posixplz.h @@ -32,7 +32,6 @@ src/include/skalibs/iobuffer.h: src/include/skalibs/buffer.h src/include/skalibs src/include/skalibs/iopause.h: src/include/skalibs/tai.h src/include/skalibs/kolbak.h: src/include/skalibs/unixmessage.h src/include/skalibs/lolstdio.h: src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/strerr2.h -src/include/skalibs/mininetstring.h: src/include/skalibs/stralloc.h src/include/skalibs/netstring.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h src/include/skalibs/posixplz.h: src/include/skalibs/gccattributes.h src/include/skalibs/random.h: src/include/skalibs/stralloc.h @@ -45,7 +44,7 @@ src/include/skalibs/skalibs.h: src/include/skalibs/biguint.h src/include/skalibs src/include/skalibs/skamisc.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h src/include/skalibs/socket.h: src/include/skalibs/djbunix.h src/include/skalibs/gccattributes.h src/include/skalibs/tai.h src/include/skalibs/webipc.h src/include/skalibs/stdcrypto.h: src/include/skalibs/md5.h src/include/skalibs/rc4.h src/include/skalibs/sha1.h src/include/skalibs/sha256.h src/include/skalibs/sha512.h -src/include/skalibs/stddjb.h: src/include/skalibs/alarm.h src/include/skalibs/alloc.h src/include/skalibs/allreadwrite.h src/include/skalibs/bitarray.h src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/cbuffer.h src/include/skalibs/cdb.h src/include/skalibs/cdb_make.h src/include/skalibs/config.h src/include/skalibs/direntry.h src/include/skalibs/disize.h src/include/skalibs/diuint.h src/include/skalibs/diuint32.h src/include/skalibs/djbtime.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/error.h src/include/skalibs/fmtscan.h src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h src/include/skalibs/genwrite.h src/include/skalibs/iobuffer.h src/include/skalibs/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/mininetstring.h src/include/skalibs/netstring.h src/include/skalibs/nsig.h src/include/skalibs/segfault.h src/include/skalibs/selfpipe.h src/include/skalibs/setgroups.h src/include/skalibs/sgetopt.h src/include/skalibs/sig.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/socket.h src/include/skalibs/stralloc.h src/include/skalibs/strerr.h src/include/skalibs/strerr2.h src/include/skalibs/tai.h src/include/skalibs/types.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h src/include/skalibs/webipc.h +src/include/skalibs/stddjb.h: src/include/skalibs/alarm.h src/include/skalibs/alloc.h src/include/skalibs/allreadwrite.h src/include/skalibs/bitarray.h src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/cbuffer.h src/include/skalibs/cdb.h src/include/skalibs/cdb_make.h src/include/skalibs/config.h src/include/skalibs/direntry.h src/include/skalibs/disize.h src/include/skalibs/diuint.h src/include/skalibs/diuint32.h src/include/skalibs/djbtime.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/error.h src/include/skalibs/fmtscan.h src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h src/include/skalibs/genwrite.h src/include/skalibs/iobuffer.h src/include/skalibs/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/netstring.h src/include/skalibs/nsig.h src/include/skalibs/segfault.h src/include/skalibs/selfpipe.h src/include/skalibs/setgroups.h src/include/skalibs/sgetopt.h src/include/skalibs/sig.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/socket.h src/include/skalibs/stralloc.h src/include/skalibs/strerr.h src/include/skalibs/strerr2.h src/include/skalibs/tai.h src/include/skalibs/types.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h src/include/skalibs/webipc.h src/include/skalibs/strerr.h: src/include/skalibs/gccattributes.h src/include/skalibs/strerr2.h: src/include/skalibs/strerr.h src/include/skalibs/tai.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint64.h @@ -419,8 +418,6 @@ src/libstddjb/ltm64_from_localtm.o src/libstddjb/ltm64_from_localtm.lo: src/libs src/libstddjb/ltm64_from_sysclock.o src/libstddjb/ltm64_from_sysclock.lo: src/libstddjb/ltm64_from_sysclock.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/libstddjb/ltm64_from_tai.o src/libstddjb/ltm64_from_tai.lo: src/libstddjb/ltm64_from_tai.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/libstddjb/ltm64_from_utc.o src/libstddjb/ltm64_from_utc.lo: src/libstddjb/ltm64_from_utc.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/uint64.h -src/libstddjb/mininetstring_read.o src/libstddjb/mininetstring_read.lo: src/libstddjb/mininetstring_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/mininetstring.h src/include/skalibs/stralloc.h -src/libstddjb/mininetstring_write.o src/libstddjb/mininetstring_write.lo: src/libstddjb/mininetstring_write.c src/include/skalibs/allreadwrite.h src/include/skalibs/mininetstring.h src/include/skalibs/uint16.h src/libstddjb/ndelay_off.o src/libstddjb/ndelay_off.lo: src/libstddjb/ndelay_off.c src/include/skalibs/djbunix.h src/libstddjb/ndelay_on.o src/libstddjb/ndelay_on.lo: src/libstddjb/ndelay_on.c src/include/skalibs/djbunix.h src/libstddjb/netstring_append.o src/libstddjb/netstring_append.lo: src/libstddjb/netstring_append.c src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h @@ -472,7 +469,6 @@ src/libstddjb/sagethostname.o src/libstddjb/sagethostname.lo: src/libstddjb/sage src/libstddjb/sanitize_read.o src/libstddjb/sanitize_read.lo: src/libstddjb/sanitize_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/error.h src/libstddjb/sareadlink.o src/libstddjb/sareadlink.lo: src/libstddjb/sareadlink.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/libstddjb/sarealpath.o src/libstddjb/sarealpath.lo: src/libstddjb/sarealpath.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h -src/libstddjb/sarealpath_tmp.o src/libstddjb/sarealpath_tmp.lo: src/libstddjb/sarealpath_tmp.c src/include/skalibs/djbunix.h src/libstddjb/satmp.o src/libstddjb/satmp.lo: src/libstddjb/satmp.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/libstddjb/sauniquename.o src/libstddjb/sauniquename.lo: src/libstddjb/sauniquename.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h src/include/skalibs/types.h src/libstddjb/selfpipe_finish.o src/libstddjb/selfpipe_finish.lo: src/libstddjb/selfpipe_finish.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h @@ -9,7 +9,6 @@ #include <skalibs/gccattributes.h> #include <skalibs/stralloc.h> #include <skalibs/envalloc.h> -#include <skalibs/env.h> /* will disappear */ #include <skalibs/posixplz.h> #define DJBUNIX_FLAG_NB 0x01U @@ -92,9 +91,7 @@ extern int waitn_reap (pid_t *, unsigned int) ; extern int fd_chdir (int) ; -#define absolutepath(sa, s) sarealpath(sa, s) /* will disappear */ extern int sarealpath (stralloc *, char const *) ; -extern int sarealpath_tmp (stralloc *, char const *, stralloc *) ; extern int sabasename (stralloc *, char const *, size_t) ; extern int sadirname (stralloc *, char const *, size_t) ; extern int sagetcwd (stralloc *) ; diff --git a/src/include/skalibs/mininetstring.h b/src/include/skalibs/mininetstring.h @@ -1,12 +0,0 @@ -/* ISC license. */ - -#ifndef MININETSTRING_H -#define MININETSTRING_H - -#include <stdint.h> -#include <skalibs/stralloc.h> - -extern int mininetstring_read (int, stralloc *, uint32_t *) ; -extern int mininetstring_write (int, char const *, uint16_t, uint32_t *) ; - -#endif diff --git a/src/include/skalibs/stddjb.h b/src/include/skalibs/stddjb.h @@ -37,7 +37,6 @@ #include <skalibs/iobuffer.h> #include <skalibs/iopause.h> #include <skalibs/lolstdio.h> -#include <skalibs/mininetstring.h> /* will disappear */ #include <skalibs/netstring.h> #include <skalibs/nsig.h> #include <skalibs/segfault.h> diff --git a/src/libstddjb/mininetstring_read.c b/src/libstddjb/mininetstring_read.c @@ -1,43 +0,0 @@ -/* ISC license. */ - -#include <errno.h> -#include <skalibs/allreadwrite.h> -#include <skalibs/stralloc.h> -#include <skalibs/mininetstring.h> - -int mininetstring_read (int fd, stralloc *sa, uint32_t *w) -{ - if (!*w) - { - char pack[2] ; - switch (fd_read(fd, pack, 2)) - { - case -1 : return -1 ; - case 0 : return 0 ; - case 1 : *w = ((uint32_t)pack[0] << 8) | (1U << 31) ; break ; - case 2 : *w = ((uint32_t)pack[0] << 8) | (uint32_t)pack[1] | (1U << 30) ; break ; - default : return (errno = EDOM, -1) ; - } - } - if (*w & (1U << 31)) - { - unsigned char c ; - switch (fd_read(fd, (char *)&c, 1)) - { - case -1 : return -1 ; - case 0 : return (errno = EPIPE, -1) ; - case 1 : *w |= (uint32_t)c | (1U << 30) ; *w &= ~(1U << 31) ; break ; - default : return (errno = EDOM, -1) ; - } - } - if (*w & (1U << 30)) - { - if (!stralloc_readyplus(sa, *w & ~(1U << 30))) return -1 ; - *w &= ~(1U << 30) ; - } - { - size_t r = allread(fd, sa->s + sa->len, *w) ; - sa->len += r ; *w -= r ; - } - return *w ? -1 : 1 ; -} diff --git a/src/libstddjb/mininetstring_write.c b/src/libstddjb/mininetstring_write.c @@ -1,36 +0,0 @@ -/* ISC license. */ - -#include <errno.h> -#include <skalibs/uint16.h> -#include <skalibs/allreadwrite.h> -#include <skalibs/mininetstring.h> - -int mininetstring_write (int fd, char const *s, uint16_t len, uint32_t *w) -{ - if (!*w) - { - char pack[2] ; - uint16_pack_big(pack, len) ; - switch (fd_write(fd, pack, 2)) - { - case -1 : return -1 ; - case 0 : return (errno = EAGAIN, -1) ; - case 1 : *w = (1U << 31) ; break ; - case 2 : *w = len ; break ; - default : return (errno = EDOM, -1) ; - } - } - if (*w & (1U << 31)) - { - unsigned char c = len & 0xFFU ; - switch (fd_write(fd, (char const *)&c, 1)) - { - case -1 : return -1 ; - case 0 : return (errno = EAGAIN, -1) ; - case 1 : *w = len ; break ; - default : return (errno = EDOM, -1) ; - } - } - *w -= allwrite(fd, s + len - *w, *w) ; - return *w ? -1 : 1 ; -} diff --git a/src/libstddjb/sarealpath.c b/src/libstddjb/sarealpath.c @@ -18,7 +18,7 @@ int sarealpath (stralloc *sa, char const *path) { char *p = realpath(path, 0) ; if (!p) return -1 ; - sa->s = p ; + sa->s = p ; /* XXX: incompatible with alloc() interposition */ sa->len = strlen(p) ; sa->a = sa->len + 1 ; } diff --git a/src/libstddjb/sarealpath_tmp.c b/src/libstddjb/sarealpath_tmp.c @@ -1,11 +0,0 @@ -/* ISC license. */ - -/* This function is now obsolete. */ - -#include <skalibs/djbunix.h> - -int sarealpath_tmp (stralloc *sa, char const *path, stralloc *tmp) -{ - (void)tmp ; - return sarealpath(sa, path) ; -}