winsz-termios
write-any-file
xalloc
+ xbinary-io
xdectoint
xfts
xgetcwd
xprintf
xprintf-posix
xreadlink
- xsetmode
xstrtod
xstrtoimax
xstrtol
#include "quote.h"
#include "xstrtol.h"
#include "xdectoint.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
#define AUTHORS proper_name ("Simon Josefsson")
if (STREQ (infile, "-"))
{
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
input_fh = stdin;
}
else
#include "fadvise.h"
#include "full-write.h"
#include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cat"
if (! (number || show_ends || squeeze_blank))
{
file_open_mode |= O_BINARY;
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
}
/* Check if any of the input files are the same as the output file. */
have_read_stdin = true;
input_desc = STDIN_FILENO;
if (file_open_mode & O_BINARY)
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
#include <stdint.h>
#include "system.h"
#include "fadvise.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
#ifdef CRCTAB
{
fp = stdin;
have_read_stdin = true;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
#include "quote.h"
#include "safe-read.h"
#include "stat-size.h"
+#include "xbinary-io.h"
#include "xdectoint.h"
-#include "xsetmode.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "head"
have_read_stdin = true;
fd = STDIN_FILENO;
filename = _("standard input");
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
? (char const *const *) &argv[optind]
: default_file_list);
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
for (i = 0; file_list[i]; ++i)
ok &= head_file (file_list[i], n_units, count_lines, elide_from_end);
#include "error.h"
#include "fadvise.h"
#include "stdio--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#if HASH_ALGO_MD5
if (*binary < 0)
*binary = ! isatty (STDIN_FILENO);
if (*binary)
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
}
else
#include "ftoastr.h"
#include "quote.h"
#include "stat-size.h"
+#include "xbinary-io.h"
#include "xprintf.h"
-#include "xsetmode.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no 'g' prefix). */
input_filename = _("standard input");
in_stream = stdin;
have_read_stdin = true;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
#include "quote.h"
#include "safe-read.h"
#include "sig2str.h"
+#include "xbinary-io.h"
#include "xdectoint.h"
-#include "xsetmode.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no 'g' prefix). */
quoteaf (infile));
/* Binary I/O is safer when byte counts are used. */
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
/* Get the optimal block size of input device and make a buffer. */
#include "fadvise.h"
#include "human.h"
#include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "sum"
{
fp = stdin;
have_read_stdin = true;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
{
fd = STDIN_FILENO;
have_read_stdin = true;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
#include "filenamecat.h"
#include "safe-read.h"
#include "stdlib--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tac"
have_read_stdin = true;
fd = STDIN_FILENO;
filename = _("standard input");
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
{
? (char const *const *) &argv[optind]
: default_file_list);
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
{
size_t i;
#include "safe-read.h"
#include "stat-size.h"
#include "stat-time.h"
-#include "xnanosleep.h"
+#include "xbinary-io.h"
#include "xdectoint.h"
-#include "xsetmode.h"
+#include "xnanosleep.h"
#include "xstrtol.h"
#include "xstrtod.h"
{
have_read_stdin = true;
fd = STDIN_FILENO;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
}
else
fd = open (f->name, O_RDONLY | O_BINARY);
|| (header_mode == multiple_files && n_files > 1))
print_headers = true;
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
for (i = 0; i < n_files; i++)
ok &= tail_file (&F[i], n_units);
#include "error.h"
#include "fadvise.h"
#include "stdio--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tee"
? (append ? "ab" : "wb")
: (append ? "a" : "w"));
- xsetmode (STDIN_FILENO, O_BINARY);
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
fadvise (stdin, FADVISE_SEQUENTIAL);
/* Set up FILES[0 .. NFILES] and DESCRIPTORS[0 .. NFILES].
#include "fadvise.h"
#include "quote.h"
#include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no 'g' prefix). */
/* Use binary I/O, since 'tr' is sometimes used to transliterate
non-printable characters, or characters which are stripped away
by text-mode reads (like CR and ^Z). */
- xsetmode (STDIN_FILENO, O_BINARY);
- xsetmode (STDOUT_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDOUT_FILENO, O_BINARY);
fadvise (stdin, FADVISE_SEQUENTIAL);
if (squeeze_repeats && non_option_args == 1)
#include "readtokens0.h"
#include "safe-read.h"
#include "stat-size.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
#if !defined iswspace && !HAVE_ISWSPACE
# define iswspace(wc) \
if (! file || STREQ (file, "-"))
{
have_read_stdin = true;
- xsetmode (STDIN_FILENO, O_BINARY);
+ xset_binary_mode (STDIN_FILENO, O_BINARY);
return wc (STDIN_FILENO, file, fstatus, -1);
}
else