err = dc_parse_stream (fp, filename);
- if (fp != stdin && FCLOSE (fp) == EOF)
+ if (fp != stdin && fclose (fp) == EOF)
{
error (0, errno, "%s", filename);
return 1;
int i;
for (i = 0; i < G_N_LINES; i++)
{
- FWRITE (G_line[i], 1, G_line_length[i], stdout);
- FPUTC ('\n', stdout);
+ fwrite (G_line[i], 1, G_line_length[i], stdout);
+ fputc ('\n', stdout);
}
}
else
suffix = "'\n";
}
fputs (prefix, stdout);
- FWRITE (s, 1, len, stdout);
+ fwrite (s, 1, len, stdout);
fputs (suffix, stdout);
}
}
close_stdout ();
- if (have_read_stdin && FCLOSE (stdin) == EOF)
+ if (have_read_stdin && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, _("standard input"));
exit (err == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
and later output themselves. */
static size_t dired_pos;
-#define DIRED_PUTCHAR(c) do {PUTCHAR ((c)); ++dired_pos;} while (0)
+#define DIRED_PUTCHAR(c) do {putchar ((c)); ++dired_pos;} while (0)
/* Write S to STREAM and increment DIRED_POS by S_LEN. */
#define DIRED_FPUTS(s, stream, s_len) \
for (i = 0; i < files_index; i++)
{
print_file_name_and_frills (files + i);
- PUTCHAR ('\n');
+ putchar ('\n');
}
break;
buf[i] = '?';
}
- FWRITE (buf, 1, len, out);
+ fwrite (buf, 1, len, out);
return len;
}
p = ind->string;
for (i = ind->len; i > 0; --i)
- PUTCHAR (*(p++));
+ putchar (*(p++));
}
static int
indent (pos + name_length, pos + max_name_length);
pos += max_name_length;
}
- PUTCHAR ('\n');
+ putchar ('\n');
}
}
if (col == 0)
{
- PUTCHAR ('\n');
+ putchar ('\n');
pos = 0;
}
else
name_length = length_of_file_name_and_frills (files + filesno);
max_name_length = line_fmt->col_arr[col];
}
- PUTCHAR ('\n');
+ putchar ('\n');
}
static void
if (old_pos != 0 && pos >= line_length)
{
- PUTCHAR ('\n');
+ putchar ('\n');
pos -= old_pos;
}
print_file_name_and_frills (files + filesno);
if (filesno + 1 < files_index)
{
- PUTCHAR (',');
- PUTCHAR (' ');
+ putchar (',');
+ putchar (' ');
}
}
- PUTCHAR ('\n');
+ putchar ('\n');
}
/* Assuming cursor is at position FROM, indent up to position TO.
{
if (tabsize > 0 && to / tabsize > (from + 1) / tabsize)
{
- PUTCHAR ('\t');
+ putchar ('\t');
from += tabsize - from % tabsize;
}
else
{
- PUTCHAR (' ');
+ putchar (' ');
from++;
}
}
are more efficient but not thread-safe. That they're not thread-safe
is fine since all these applications are single threaded. */
-#undef CLEARERR
#ifdef HAVE_CLEARERR_UNLOCKED
-# define CLEARERR(S) clearerr_unlocked (S)
-#else
-# define CLEARERR(S) clearerr (S)
+# undef clearerr
+# define clearerr(S) clearerr_unlocked (S)
#endif
-#undef FCLOSE
#ifdef HAVE_FCLOSE_UNLOCKED
-# define FCLOSE(S) fclose_unlocked (S)
-#else
-# define FCLOSE(S) fclose (S)
+# undef fclose
+# define fclose(S) fclose_unlocked (S)
#endif
-#undef FEOF
#ifdef HAVE_FEOF_UNLOCKED
-# define FEOF(S) feof_unlocked (S)
-#else
-# define FEOF(S) feof (S)
+# undef feof
+# define feof(S) feof_unlocked (S)
#endif
-#undef FERROR
#ifdef HAVE_FERROR_UNLOCKED
-# define FERROR(S) ferror_unlocked (S)
-#else
-# define FERROR(S) ferror (S)
+# undef ferror
+# define ferror(S) ferror_unlocked (S)
#endif
-#undef FFLUSH
#ifdef HAVE_FFLUSH_UNLOCKED
-# define FFLUSH(S) fflush_unlocked (S)
-#else
-# define FFLUSH(S) fflush (S)
+# undef fflush
+# define fflush(S) fflush_unlocked (S)
#endif
-#undef FPUTC
#ifdef HAVE_FPUTC_UNLOCKED
-# define FPUTC(C, S) fputc_unlocked (C, S)
-#else
-# define FPUTC(C, S) fputc (C, S)
+# undef fputc
+# define fputc(C, S) fputc_unlocked (C, S)
#endif
-#undef FREAD
#ifdef HAVE_FREAD_UNLOCKED
-# define FREAD(P, Z, N, S) fread_unlocked (P, Z, N, S)
-#else
-# define FREAD(P, Z, N, S) fread (P, Z, N, S)
+# undef fread
+# define fread(P, Z, N, S) fread_unlocked (P, Z, N, S)
#endif
-#undef FWRITE
#ifdef HAVE_FWRITE_UNLOCKED
-# define FWRITE(P, Z, N, S) fwrite_unlocked (P, Z, N, S)
-#else
-# define FWRITE(P, Z, N, S) fwrite (P, Z, N, S)
+# undef fwrite
+# define fwrite(P, Z, N, S) fwrite_unlocked (P, Z, N, S)
#endif
-#undef GETC
#ifdef HAVE_GETC_UNLOCKED
-# define GETC(S) getc_unlocked (S)
-#else
-# define GETC(S) getc (S)
+# undef getc
+# define getc(S) getc_unlocked (S)
#endif
-#undef GETCHAR
#ifdef HAVE_GETCHAR_UNLOCKED
-# define GETCHAR(S) getchar_unlocked (S)
-#else
-# define GETCHAR(S) getchar (S)
+# undef getchar
+# define getchar(S) getchar_unlocked (S)
#endif
-#undef PUTC
#ifdef HAVE_PUTC_UNLOCKED
-# define PUTC(C, S) putc_unlocked (C, S)
-#else
-# define PUTC(C, S) putc (C, S)
+# undef putc
+# define putc(C, S) putc_unlocked (C, S)
#endif
-#undef PUTCHAR
#ifdef HAVE_PUTCHAR_UNLOCKED
-# define PUTCHAR(C) putchar_unlocked (C)
-#else
-# define PUTCHAR(C) putchar (C)
+# undef putchar
+# define putchar(C) putchar_unlocked (C)
#endif