Index: /zzuf/trunk/doc/zzuf.1
===================================================================
--- /zzuf/trunk/doc/zzuf.1	(revision 2333)
+++ /zzuf/trunk/doc/zzuf.1	(revision 2334)
@@ -418,6 +418,6 @@
 Standard IO streams:
 \fBfopen\fR(), \fBfreopen\fR(), \fBfseek\fR(), \fBfseeko\fR(), \fBrewind\fR(),
-\fBfread\fR(), \fBgetc\fR(), \fBfgetc\fR(), \fBfgets\fR(), \fBungetc\fR(),
-\fBfclose\fR()
+\fBfread\fR(), \fBgetc\fR(), \fBgetchar\fR(), \fBfgetc\fR(), \fBfgets\fR(),
+\fBungetc\fR(), \fBfclose\fR()
 .TP
 Memory management:
@@ -428,5 +428,6 @@
 \fBopen64\fR(), \fBlseek64\fR(), \fBmmap64\fR(), \fB_IO_getc\fR(),
 \fBgetline\fR(), \fBgetdelim\fR(), \fB__getdelim\fR(), \fBgetc_unlocked\fR(),
-\fBfgetc_unlocked\fR(), \fBfgets_unlocked\fR(), \fBfread_unlocked\fR()
+\fBgetchar_unlocked\fR(), \fBfgetc_unlocked\fR(), \fBfgets_unlocked\fR(),
+\fBfread_unlocked\fR()
 .TP
 BSD-specific:
@@ -463,3 +464,3 @@
 \fBhttp://sam.zoy.org/wtfpl/COPYING\fR for more details.
 .PP
-\fBzzuf\fR's webpage can be found at \fBhttp://libcaca.zoy.org/wiki/zzuf/\fR.
+\fBzzuf\fR's webpage can be found at \fBhttp://libcaca.zoy.org/wiki/zzuf\fR.
Index: /zzuf/trunk/src/lib-stream.c
===================================================================
--- /zzuf/trunk/src/lib-stream.c	(revision 2333)
+++ /zzuf/trunk/src/lib-stream.c	(revision 2334)
@@ -63,4 +63,5 @@
 #endif
 static int     (*ORIG(getc))     (FILE *stream);
+static int     (*ORIG(getchar))  (void);
 static int     (*ORIG(fgetc))    (FILE *stream);
 #if defined HAVE__IO_GETC
@@ -68,12 +69,15 @@
 #endif
 #if defined HAVE_GETC_UNLOCKED
-static int     (*ORIG(getc_unlocked))  (FILE *stream);
+static int     (*ORIG(getc_unlocked))    (FILE *stream);
+#endif
+#if defined HAVE_GETCHAR_UNLOCKED
+static int     (*ORIG(getchar_unlocked)) (void);
 #endif
 #if defined HAVE_FGETC_UNLOCKED
-static int     (*ORIG(fgetc_unlocked)) (FILE *stream);
+static int     (*ORIG(fgetc_unlocked))   (FILE *stream);
 #endif
 static char *  (*ORIG(fgets))    (char *s, int size, FILE *stream);
 #if defined HAVE_FGETS_UNLOCKED
-static char *  (*ORIG(fgets_unlocked)) (char *s, int size, FILE *stream);
+static char *  (*ORIG(fgets_unlocked))   (char *s, int size, FILE *stream);
 #endif
 static int     (*ORIG(ungetc))   (int c, FILE *stream);
@@ -318,13 +322,13 @@
 #endif
 
-#define FGETC(fn) \
+#define FGETC(fn, s, arg) \
     do { \
         int fd; \
         LOADSYM(fn); \
-        fd = fileno(stream); \
+        fd = fileno(s); \
         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \
-            return ORIG(fn)(stream); \
+            return ORIG(fn)(arg); \
         _zz_lock(fd); \
-        ret = ORIG(fn)(stream); \
+        ret = ORIG(fn)(arg); \
         _zz_unlock(fd); \
         FGETC_FUZZ \
@@ -338,10 +342,16 @@
 int NEW(getc)(FILE *stream)
 {
-    int ret; FGETC(getc); return ret;
+    int ret; FGETC(getc, stream, stream); return ret;
+}
+
+#undef getchar /* can be a macro; we don’t want that */
+int NEW(getchar)(void)
+{
+    int ret; FGETC(getchar, stdin, /* empty */); return ret;
 }
 
 int NEW(fgetc)(FILE *stream)
 {
-    int ret; FGETC(fgetc); return ret;
+    int ret; FGETC(fgetc, stream, stream); return ret;
 }
 
@@ -349,5 +359,5 @@
 int NEW(_IO_getc)(FILE *stream)
 {
-    int ret; FGETC(_IO_getc); return ret;
+    int ret; FGETC(_IO_getc, stream, stream); return ret;
 }
 #endif
@@ -357,5 +367,13 @@
 int NEW(getc_unlocked)(FILE *stream)
 {
-    int ret; FGETC(getc_unlocked); return ret;
+    int ret; FGETC(getc_unlocked, stream, stream); return ret;
+}
+#endif
+
+#if defined HAVE_GETCHAR_UNLOCKED
+#undef getchar_unlocked /* can be a macro; we don’t want that */
+int NEW(getchar_unlocked)(void)
+{
+    int ret; FGETC(getchar_unlocked, stdin, /* empty */); return ret;
 }
 #endif
@@ -365,5 +383,5 @@
 int NEW(fgetc_unlocked)(FILE *stream)
 {
-    int ret; FGETC(fgetc_unlocked); return ret;
+    int ret; FGETC(fgetc_unlocked, stream, stream); return ret;
 }
 #endif
