diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-10-26 12:52:31 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-10-26 12:52:31 +0000 |
commit | ad90bc1107ef9a76f4ca530cc41e86d4f352e3d9 (patch) | |
tree | 7a949f8a814a6a9624e6bb0246ec1db4c3dd30b7 | |
parent | 9806a4f3bb81f71c46735a2b378cb074fef6e27b (diff) | |
download | skalibs-ad90bc1107ef9a76f4ca530cc41e86d4f352e3d9.tar.xz |
Change new function names to openc_*; update deps.mak
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | doc/libstddjb/djbunix.html | 16 | ||||
-rw-r--r-- | doc/upgrade.html | 4 | ||||
-rw-r--r-- | package/deps.mak | 8 | ||||
-rw-r--r-- | src/include/skalibs/djbunix.h | 16 | ||||
-rw-r--r-- | src/libstddjb/openbc_read.c (renamed from src/libstddjb/openb_readcoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_append.c (renamed from src/libstddjb/open_appendcoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_create.c (renamed from src/libstddjb/open_createcoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_excl.c (renamed from src/libstddjb/open_exclcoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_read.c (renamed from src/libstddjb/open_readcoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_readb.c (renamed from src/libstddjb/open_readbcoe.c) | 4 | ||||
-rw-r--r-- | src/libstddjb/openc_trunc.c (renamed from src/libstddjb/open_trunccoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openc_write.c (renamed from src/libstddjb/open_writecoe.c) | 2 | ||||
-rw-r--r-- | src/libstddjb/openreadfileclose.c | 2 | ||||
-rw-r--r-- | src/libstddjb/openreadnclose.c | 4 | ||||
-rw-r--r-- | src/libstddjb/openslurpclose.c | 2 | ||||
-rw-r--r-- | src/libstddjb/openwritenclose_unsafe.c | 2 | ||||
-rw-r--r-- | src/libstddjb/openwritevnclose_unsafe.c | 2 |
18 files changed, 42 insertions, 34 deletions
@@ -3,7 +3,7 @@ Changelog for skalibs. In 2.9.4.0 ---------- - - New open*coe functions. + - New openc_* functions. In 2.9.3.0 diff --git a/doc/libstddjb/djbunix.html b/doc/libstddjb/djbunix.html index 0ac0a2c..9a921de 100644 --- a/doc/libstddjb/djbunix.html +++ b/doc/libstddjb/djbunix.html @@ -254,7 +254,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_readcoe (char const *file) </code> <br /> +<code> int openc_read (char const *file) </code> <br /> Opens <em>file</em> in read-only, non-blocking mode, close-on-exec. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> @@ -266,7 +266,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int openb_readcoe (char const *file) </code> <br /> +<code> int openbc_read (char const *file) </code> <br /> Opens <em>file</em> in read-only, blocking mode, close-on-exec. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> @@ -283,7 +283,7 @@ with FIFOs. </p> <p> -<code> int open_readbcoe (char const *file) </code> <br /> +<code> int openc_readb (char const *file) </code> <br /> Same as above, but the file is opened close-on-exec. </p> @@ -295,7 +295,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_exclcoe (char const *file) </code> <br /> +<code> int openc_excl (char const *file) </code> <br /> Opens <em>file</em> in write-only, non-blocking mode, close-on-exec, with the additional O_EXCL and O_CREAT flags. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. @@ -309,7 +309,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_appendcoe (char const *file) </code> <br /> +<code> int openc_append (char const *file) </code> <br /> Opens <em>file</em> in write-only, non-blocking mode, close-on-exec, with the additional O_APPEND and O_CREAT flags. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. @@ -323,7 +323,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_trunccoe (char const *file) </code> <br /> +<code> int openc_trunc (char const *file) </code> <br /> Opens <em>file</em> in write-only, non-blocking mode, close-on-exec, with the additional O_TRUNC and O_CREAT flags. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. @@ -337,7 +337,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_createcoe (char const *file) </code> <br /> +<code> int openc_create (char const *file) </code> <br /> Opens <em>file</em> in write-only, non-blocking mode, close-on-exec, with the additional O_CREAT flag. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. @@ -350,7 +350,7 @@ Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> <p> -<code> int open_writecoe (char const *file) </code> <br /> +<code> int openc_write (char const *file) </code> <br /> Opens <em>file</em> in write-only, non-blocking mode, close-on-exec. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails. </p> diff --git a/doc/upgrade.html b/doc/upgrade.html index 0f1aee8..dac82ce 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -19,8 +19,8 @@ <h2> in 2.9.4.0 </h2> <ul> - <li> New <tt>open*coe</tt> functions, which are O_CLOEXEC versions of the -<a href="libstddjb/djbunix.html">djbunix.h</a> functions without <tt>coe</tt>. </li> + <li> New <tt>openc_*</tt> functions, which are O_CLOEXEC versions of the +<a href="libstddjb/djbunix.html">djbunix.h</a> <tt>open_*</tt> functions. </li> </ul> <h2> in 2.9.3.0 </h2> diff --git a/package/deps.mak b/package/deps.mak index 3f1bc4f..f64adc1 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -454,6 +454,14 @@ src/libstddjb/open_readb.o src/libstddjb/open_readb.lo: src/libstddjb/open_readb src/libstddjb/open_trunc.o src/libstddjb/open_trunc.lo: src/libstddjb/open_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/libstddjb/open_write.o src/libstddjb/open_write.lo: src/libstddjb/open_write.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/libstddjb/openb_read.o src/libstddjb/openb_read.lo: src/libstddjb/openb_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openbc_read.o src/libstddjb/openbc_read.lo: src/libstddjb/openbc_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_append.o src/libstddjb/openc_append.lo: src/libstddjb/openc_append.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_create.o src/libstddjb/openc_create.lo: src/libstddjb/openc_create.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_excl.o src/libstddjb/openc_excl.lo: src/libstddjb/openc_excl.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_read.o src/libstddjb/openc_read.lo: src/libstddjb/openc_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_readb.o src/libstddjb/openc_readb.lo: src/libstddjb/openc_readb.c src/include/skalibs/djbunix.h +src/libstddjb/openc_trunc.o src/libstddjb/openc_trunc.lo: src/libstddjb/openc_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h +src/libstddjb/openc_write.o src/libstddjb/openc_write.lo: src/libstddjb/openc_write.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/libstddjb/openreadfileclose.o src/libstddjb/openreadfileclose.lo: src/libstddjb/openreadfileclose.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/libstddjb/openreadnclose.o src/libstddjb/openreadnclose.lo: src/libstddjb/openreadnclose.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/libstddjb/openslurpclose.o src/libstddjb/openslurpclose.lo: src/libstddjb/openslurpclose.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h index 2a6fdd4..3c52f6a 100644 --- a/src/include/skalibs/djbunix.h +++ b/src/include/skalibs/djbunix.h @@ -43,21 +43,21 @@ extern void lock_unx (int) ; extern int open2 (char const *, unsigned int) ; extern int open3 (char const *, unsigned int, unsigned int) ; extern int open_read (char const *) ; -extern int open_readcoe (char const *) ; +extern int openc_read (char const *) ; extern int openb_read (char const *) ; -extern int openb_readcoe (char const *) ; +extern int openbc_read (char const *) ; extern int open_readb (char const *) ; -extern int open_readbcoe (char const *) ; +extern int openc_readb (char const *) ; extern int open_excl (char const *) ; -extern int open_exclcoe (char const *) ; +extern int openc_excl (char const *) ; extern int open_append (char const *) ; -extern int open_appendcoe (char const *) ; +extern int openc_append (char const *) ; extern int open_create (char const *) ; -extern int open_createcoe (char const *) ; +extern int openc_create (char const *) ; extern int open_trunc (char const *) ; -extern int open_trunccoe (char const *) ; +extern int openc_trunc (char const *) ; extern int open_write (char const *) ; -extern int open_writecoe (char const *) ; +extern int openc_write (char const *) ; extern int socket_internal (int, int, int, unsigned int) ; extern int socketpair_internal (int, int, int, unsigned int, int *) ; diff --git a/src/libstddjb/openb_readcoe.c b/src/libstddjb/openbc_read.c index 933830e..4783780 100644 --- a/src/libstddjb/openb_readcoe.c +++ b/src/libstddjb/openbc_read.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int openb_readcoe (char const *fn) +int openbc_read (char const *fn) { return open2(fn, O_RDONLY | O_CLOEXEC) ; } diff --git a/src/libstddjb/open_appendcoe.c b/src/libstddjb/openc_append.c index 3bda62e..9765aa6 100644 --- a/src/libstddjb/open_appendcoe.c +++ b/src/libstddjb/openc_append.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_appendcoe (char const *fn) +int openc_append (char const *fn) { return open3(fn, O_WRONLY | O_NONBLOCK | O_APPEND | O_CREAT | O_CLOEXEC, 0666) ; } diff --git a/src/libstddjb/open_createcoe.c b/src/libstddjb/openc_create.c index 4f42f78..2c0dd86 100644 --- a/src/libstddjb/open_createcoe.c +++ b/src/libstddjb/openc_create.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_createcoe (char const *fn) +int openc_create (char const *fn) { return open3(fn, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0666) ; } diff --git a/src/libstddjb/open_exclcoe.c b/src/libstddjb/openc_excl.c index b24786c..9a45913 100644 --- a/src/libstddjb/open_exclcoe.c +++ b/src/libstddjb/openc_excl.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_exclcoe (char const *fn) +int openc_excl (char const *fn) { return open3(fn, O_WRONLY | O_CREAT | O_EXCL | O_NONBLOCK | O_CLOEXEC, 0666) ; } diff --git a/src/libstddjb/open_readcoe.c b/src/libstddjb/openc_read.c index cd6a69d..57a23bc 100644 --- a/src/libstddjb/open_readcoe.c +++ b/src/libstddjb/openc_read.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_readcoe (char const *fn) +int openc_read (char const *fn) { return open2(fn, O_RDONLY | O_NONBLOCK | O_CLOEXEC) ; } diff --git a/src/libstddjb/open_readbcoe.c b/src/libstddjb/openc_readb.c index d461854..e0bfcc0 100644 --- a/src/libstddjb/open_readbcoe.c +++ b/src/libstddjb/openc_readb.c @@ -2,9 +2,9 @@ #include <skalibs/djbunix.h> -int open_readbcoe (char const *fn) +int openc_readb (char const *fn) { - int fd = open_readbcoe(fn) ; + int fd = openc_read(fn) ; if (fd < 0) return -1 ; if (ndelay_off(fd) < 0) { diff --git a/src/libstddjb/open_trunccoe.c b/src/libstddjb/openc_trunc.c index 3be3df6..ca39160 100644 --- a/src/libstddjb/open_trunccoe.c +++ b/src/libstddjb/openc_trunc.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_trunccoe (char const *fn) +int openc_trunc (char const *fn) { return open3(fn, O_WRONLY | O_NONBLOCK | O_TRUNC | O_CREAT | O_CLOEXEC, 0666) ; } diff --git a/src/libstddjb/open_writecoe.c b/src/libstddjb/openc_write.c index d04c4c5..518c460 100644 --- a/src/libstddjb/open_writecoe.c +++ b/src/libstddjb/openc_write.c @@ -4,7 +4,7 @@ #include <fcntl.h> #include <skalibs/djbunix.h> -int open_writecoe (char const *fn) +int openc_write (char const *fn) { return open2(fn, O_WRONLY | O_NONBLOCK | O_CLOEXEC) ; } diff --git a/src/libstddjb/openreadfileclose.c b/src/libstddjb/openreadfileclose.c index 95895e8..afa895a 100644 --- a/src/libstddjb/openreadfileclose.c +++ b/src/libstddjb/openreadfileclose.c @@ -8,7 +8,7 @@ int openreadfileclose (char const *file, stralloc *sa, size_t limit) { size_t n ; - int fd = openb_readcoe(file) ; + int fd = openbc_read(file) ; if (fd < 0) return 0 ; { struct stat st ; diff --git a/src/libstddjb/openreadnclose.c b/src/libstddjb/openreadnclose.c index 0853c87..4466796 100644 --- a/src/libstddjb/openreadnclose.c +++ b/src/libstddjb/openreadnclose.c @@ -22,12 +22,12 @@ static ssize_t readnclose (int fd, char *s, size_t n) ssize_t openreadnclose (char const *file, char *s, size_t n) { - int fd = openb_readcoe(file) ; + int fd = openbc_read(file) ; return fd < 0 ? fd : readnclose(fd, s, n) ; } ssize_t openreadnclose_nb (char const *file, char *s, size_t n) { - int fd = open_readcoe(file) ; + int fd = openc_read(file) ; return fd < 0 ? fd : readnclose(fd, s, n) ; } diff --git a/src/libstddjb/openslurpclose.c b/src/libstddjb/openslurpclose.c index 6a431d0..8485413 100644 --- a/src/libstddjb/openslurpclose.c +++ b/src/libstddjb/openslurpclose.c @@ -6,7 +6,7 @@ int openslurpclose (stralloc *sa, char const *fn) { int r ; - int fd = openb_readcoe(fn) ; + int fd = openbc_read(fn) ; if (fd == -1) return 0 ; r = slurp(sa, fd) ; fd_close(fd) ; diff --git a/src/libstddjb/openwritenclose_unsafe.c b/src/libstddjb/openwritenclose_unsafe.c index 893fc3a..8022f74 100644 --- a/src/libstddjb/openwritenclose_unsafe.c +++ b/src/libstddjb/openwritenclose_unsafe.c @@ -6,7 +6,7 @@ int openwritenclose_unsafe_internal (char const *fn, char const *s, size_t len, dev_t *dev, ino_t *ino, int dosync) { - int fd = open_trunccoe(fn) ; + int fd = openc_trunc(fn) ; if (fd < 0) return 0 ; if (!writenclose_unsafe_internal(fd, s, len, dev, ino, dosync)) { diff --git a/src/libstddjb/openwritevnclose_unsafe.c b/src/libstddjb/openwritevnclose_unsafe.c index d707fb0..ca98f1c 100644 --- a/src/libstddjb/openwritevnclose_unsafe.c +++ b/src/libstddjb/openwritevnclose_unsafe.c @@ -8,7 +8,7 @@ int openwritevnclose_unsafe_internal (char const *fn, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino, int dosync) { - int fd = open_trunccoe(fn) ; + int fd = openc_trunc(fn) ; if (fd < 0) return 0 ; if (!writevnclose_unsafe_internal(fd, v, vlen, dev, ino, dosync)) { |