summaryrefslogtreecommitdiff
path: root/lib/binary-io.h
Commit message (Collapse)AuthorAgeFilesLines
* gnulib-common.m4: Use C2x [[maybe_unused]] when possible.Bruno Haible2021-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_UNUSED as an alias of _GL_ATTRIBUTE_MAYBE_UNUSED, not of _GL_ATTRIBUTE_UNUSED. * lib/binary-io.h (__gl_setmode): Put _GL_UNUSED before, not after, the declaration. * lib/c-stack.c (null_action, segv_handler, overflow_handler, c_stack_action): Likewise. * lib/chown.c (chown): Likewise. * lib/clean-temp-simple.c (cleanup_action): Likewise. * lib/fts.c (dirent_inode_sort_may_be_useful, leaf_optimization, fts_set): Likewise. * lib/getgroups.c (getgroups): Likewise. * lib/getopt.c (_getopt_initialize): Likewise. * lib/getugroups.c (getugroups): Likewise. * lib/localename.c (gl_locale_name_thread_unsafe, gl_locale_name_thread, gl_locale_name_posix, gl_locale_name_environ): Likewise. * lib/mkdir.c (rpl_mkdir): Likewise. * lib/mkfifo.c (mkfifo): Likewise. * lib/mkfifoat.c (mkfifoat): Likewise. * lib/mknod.c (mknod): Likewise. * lib/mknodat.c (mknodat): Likewise. * lib/mountlist.c (me_remote): Likewise. * lib/openpty.c (openpty): Likewise. * lib/parse-datetime.y (yyerror): Likewise. * lib/passfd.c (sendfd, recvfd): Likewise. * lib/pthread-cond.c (pthread_condattr_destroy, pthread_cond_init, pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy): Likewise. * lib/pthread-mutex.c (pthread_mutexattr_destroy, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock, pthread_mutex_unlock, pthread_mutex_destroy): Likewise. * lib/pthread-rwlock.c (pthread_rwlockattr_destroy, pthread_rwlock_init, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock): Likewise. * lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): Likewise. * lib/pthread-thread.c (pthread_attr_destroy): Likewise. * lib/readlink.c (readlink): Likewise. * lib/rename.c (rpl_rename): Likewise. * lib/set-permissions.c (set_permissions): Likewise. * lib/sockets.c (gl_sockets_startup): Likewise. * lib/stat-time.h (get_stat_birthtime_ns, get_stat_birthtime, stat_time_normalize): Likewise. * lib/strptime.c (__strptime_internal): Likewise. * lib/strtod.c (LDEXP): Likewise. * lib/symlink.c (symlink): Likewise. * lib/symlinkat.c (symlinkat): Likewise. * lib/tempname.c (try_dir, try_nocreate): Likewise. * lib/textstyle.in.h (styled_ostream_begin_use_class, styled_ostream_end_use_class, styled_ostream_get_hyperlink_ref, styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink, styled_ostream_flush_to_current_style, fd_ostream_create, term_ostream_get_color, term_ostream_set_color, term_ostream_get_bgcolor, term_ostream_set_bgcolor, term_ostream_get_weight, term_ostream_set_weight, term_ostream_get_posture, term_ostream_set_posture, term_ostream_get_underline, term_ostream_set_underline, term_ostream_get_hyperlink_ref, term_ostream_get_hyperlink_id, term_ostream_set_hyperlink, term_ostream_create, term_styled_ostream_create, html_styled_ostream_create, handle_color_option, handle_style_option, style_file_prepare, styled_ostream_create, libtextstyle_set_failure_exit_code): Likewise. * lib/unicodeio.c (exit_failure_callback, fallback_failure_callback): Likewise. * lib/wait-process.c (cleanup_slaves_action): Likewise. * tests/signature.h (SIGNATURE_CHECK2): Likewise. * tests/test-areadlink.c (do_areadlink): Likewise. * tests/test-areadlinkat.c (do_areadlinkat): Likewise. * tests/test-ceilf-ieee.c (main): Likewise. * tests/test-ceilf1.c (main): Likewise. * tests/test-dirent.c (dir): Likewise. * tests/test-fchownat.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-filenamecat.c (main): Likewise. * tests/test-floor1.c (main): Likewise. * tests/test-floorf-ieee.c (main): Likewise. * tests/test-floorf1.c (main): Likewise. * tests/test-fseeko.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-ftello.c (main): Likewise. * tests/test-getdomainname.c (main): Likewise. * tests/test-getgroups.c (main): Likewise. * tests/test-gethostname.c (main): Likewise. * tests/test-math-c++.cc (OVERLOADED_CHECK): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-openat.c (main): Likewise. * tests/test-parse-datetime.c (main): Likewise. * tests/test-quotearg-simple.c (main): Likewise. * tests/test-quotearg.c (main): Likewise. * tests/test-sethostname2.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-version-etc.c (main): Likewise. * tests/test-xalloc-die.c (main): Likewise. * tests/test-xfprintf-posix.c (main): Likewise. * tests/test-xprintf-posix.c (main): Likewise. * tests/test-xvasprintf.c (main): Likewise.
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-7/+7
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* fcntl: On native Windows, use _setmode, not setmode.Bruno Haible2020-08-111-1/+1
| | | | | | | | | * lib/fcntl.c (dupfd): Use _setmode, not setmode. * lib/binary-io.h: Update comment. * tests/test-cloexec.c: Call set_binary_mode, not setmode. * tests/test-dup2.c: Likewise. * tests/test-dup-safer.c: Likewise. * tests/test-fcntl.c: Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* binary-io: Attempted use of O_BINARY on consoles no longer fails.Bruno Haible2019-05-311-9/+5
| | | | | | | | | | | Reported by KO Myung-Hun <komh78@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2019-05/msg00124.html>. * lib/binary-io.h (__gl_setmode_check): Remove function. (set_binary_mode): Declare as notinline on DJGPP and EMX. * lib/binary-io.c (__gl_setmode_check): Remove function. (set_binary_mode): Define here on DJGPP and EMX. Inline __gl_setmode_check. In case of a tty, don't return an error code.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* binary-io: pacify gcc -Wunused-parameterPaul Eggert2018-03-051-4/+2
| | | | | | | Problem reported by Reuben Thomas in: https://lists.gnu.org/r/bug-gnulib/2018-03/msg00005.html * lib/binary-io.h (__gl_setmode, __gl_setmode_check): Use _GL_UNUSED where appropriate.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* xbinary-io: rename from xsetmodePaul Eggert2017-02-161-3/+9
| | | | | | | | | | | | | | | | | | This patch is taken from suggestions by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00060.html http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00061.html * lib/binary-io.c (__gl_setmode_check): Set errno to EINVAL, not ENOTTY, when it is an inappropriate device. * lib/binary-io.h (SET_BINARY): Resurrect. * lib/xbinary-io.c: Rename from lib/xsetmode.c. (xset_binary_mode_error): Rename from xsetmode_error. * lib/xbinary-io.h: Rename from lib/xsetmode.h. (xset_binary_mode): Rename from xsetmode. All uses changed. * modules/xbinary-io: Rename from modules/xsetmode. Update file names. * tests/test-binary-io.sh (tmpfiles): Remove no-longer-used file name. * NEWS: Update to match revised behavior.
* xsetmode: new modulePaul Eggert2017-02-151-14/+16
| | | | | | | | | | | | | This is to fix a problem noted by Eric Blake. Code was using xfreopen to change files to binary mode, but this fails for stdout when in append mode. Such code should use xsetmode instead. * NEWS: Document incompatible changes to binary-io module. * lib/binary-io.c (__gl_setmode_check) [__DJGPP__ || __EMX__]: New function. * lib/binary-io.h (__gl_setmode): Rename from set_binary_mode. (set_binary_mode): New function, which also checks for tty. * lib/xsetmode.c, lib/xsetmode.h, modules/xsetmode: New files.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* binary-io: don't put fd in binary mode if it is a console on EMXKO Myung-Hun2016-01-141-1/+1
| | | | | * lib/binary-io.h (SET_BINARY): Don't put fd in binary mode if it is a console on EMX.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* headers: check that _GL_INLINE_HEADER_BEGIN is definedPaul Eggert2013-08-281-0/+3
| | | | | | | | | | | | | | | | | | | | Suggested by Bruce Korb in: http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html * doc/extern-inline.texi (extern inline): Suggest checking that _GL_INLINE_HEADER_BEGIN is defined. * lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h: * lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h: * lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h: * lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h: * lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h: * lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h: * lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h: * lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h: * lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h: * lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h: * lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h: * lib/xtime.h: Check that _GL_INLINE_HEADER_BEGIN is defined.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* binary-io, eealloc, mbfile, mbiter, mbutil, xsize: better 'inline'Paul Eggert2012-09-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/binary-io.c, lib/eealloc.c, lib/mbfile.c, lib/mbiter.c: * lib/mbuiter.c, lib/xsize.c: New files. * lib/binary-io.h (BINARY_IO_INLINE): * lib/eealloc.h (EEALLOC_INLINE): * lib/mbfile.h (MBFILE_INLINE): * lib/mbiter.h (MBITER_INLINE): * lib/mbuiter.h (MBUITER_INLINE): * lib/xsize.h (XSIZE_INLINE): New macros. Replace all uses of 'static inline' with them. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. * m4/eealloc.m4 (gl_EEALLOC): * m4/mbfile.m4 (gl_MBFILE): * m4/mbiter.m4 (gl_MBITER): * m4/xsize.m4 (gl_XSIZE): Do not require AC_C_INLINE. * modules/binary-io (Files, lib_SOURCES): Add lib/binary-io.c * modules/eealloc (Files, lib_SOURCES): Add lib/eealloc.c. * modules/mbfile (Files, lib_SOURCES): Add lib/mbfile.c. * modules/mbiter (Files, lib_SOURCES): Add lib/mbiter.c. * modules/mbuiter (Files, lib_SOURCES): Add lib/mbuiter.c. * modules/xsize (Files, lib_SOURCES): Add lib/xsize.c. * modules/binary-io, modules/eealloc, modules/mbfile: * modules/mbiter, modules/mbuiter: (Depends-on): Add extern-inline.
* misc: don't limit commentary to inline functionsPaul Eggert2012-09-221-1/+1
| | | | | | | * lib/binary-io.h, lib/malloca.h, lib/safe-alloc.c: * lib/xalloc-oversized.h, lib/xsize.h: Contrast macros to functions in general, not just to inline functions, when the commentary does not apply only to inline functions.
* binary-io: Define set_binary_mode function.Bruno Haible2012-05-131-14/+27
| | | | | | | | | | * lib/binary-io.h (set_binary_mode): New function. (SET_BINARY): Define in terms of set_binary_mode. * modules/binary-io (configure.ac): Require AC_C_INLINE. * tests/test-binary-io.c (main): Accept an argument, and test either set_binary_mode or SET_BINARY depending on the argument. * tests/test-binary-io.sh: Invoke test-binary-io twice, with an argument. Clean up also t-bin-out0.tmp.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* binary-io: fix O_TEXT on HaikuEric Blake2011-01-191-14/+1
| | | | | | | | | * modules/binary-io (Depends-on): Add fcntl-h. * lib/binary-io.h (O_TEXT): Rely on replacement <fcntl.h> rather than blindly undefining O_TEXT. Reported by Scott McCreary. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-2/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-2/+2
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* binary-io: Avoid gcc warning due to SET_BINARY.Bruno Haible2009-12-241-3/+6
|
* binary-io: avoid potential compilation warningEric Blake2009-12-161-4/+5
| | | | | | | * lib/binary-io.h [__DJGPP__]: Avoid null preprocessor directives. Signed-off-by: Eric Blake <ebb9@byu.net>
* Treat Haiku like BeOS.Ingo Weinhold2008-11-101-2/+2
|
* Avoid warning on emx+gcc.Bruno Haible2008-04-131-5/+4
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Avoid gcc warning on mingw.Bruno Haible2005-06-081-1/+2
|
* *** empty log message ***Paul Eggert2005-05-141-1/+1
|
* Avoid compilation warnings on Cygwin.Bruno Haible2004-01-201-2/+4
|
* Avoid warning on QNX.Bruno Haible2003-08-281-0/+1
|
* Make it work with MSVC.Bruno Haible2003-08-251-1/+6
|
* New module 'binary-io'.Bruno Haible2003-04-021-0/+55