$ ); echo $? echoed 0,all other shells echo 2.
[unix-history] / usr / src / bin / sh / output.h
index 6ce4c40..dff4c45 100644 (file)
@@ -1,17 +1,23 @@
 /*-
 /*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * Kenneth Almquist.
  *
  * %sccs.include.redist.c%
  *
  *
  * This code is derived from software contributed to Berkeley by
  * Kenneth Almquist.
  *
  * %sccs.include.redist.c%
  *
- *     @(#)output.h    5.1 (Berkeley) %G%
+ *     @(#)output.h    8.2 (Berkeley) %G%
  */
 
 #ifndef OUTPUT_INCL
 
  */
 
 #ifndef OUTPUT_INCL
 
+#if __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
 struct output {
        char *nextc;
        int nleft;
 struct output {
        char *nextc;
        int nleft;
@@ -27,38 +33,21 @@ extern struct output memout;
 extern struct output *out1;
 extern struct output *out2;
 
 extern struct output *out1;
 extern struct output *out2;
 
-
-#ifdef __STDC__
-void outstr(char *, struct output *);
-void out1str(char *);
-void out2str(char *);
-void outfmt(struct output *, char *, ...);
-void out1fmt(char *, ...);
-void fmtstr(char *, int, char *, ...);
-/* void doformat(struct output *, char *, va_list); */
-void doformat();
-void emptyoutbuf(struct output *);
-void flushall(void);
-void flushout(struct output *);
-void freestdout(void);
-int xwrite(int, char *, int);
-int xioctl(int, int, int);
-#else
-void outstr();
-void out1str();
-void out2str();
-void outfmt();
-void out1fmt();
-void fmtstr();
-/* void doformat(); */
-void doformat();
-void emptyoutbuf();
-void flushall();
-void flushout();
-void freestdout();
-int xwrite();
-int xioctl();
-#endif
+void open_mem __P((char *, int, struct output *));
+void out1str __P((const char *));
+void out2str __P((const char *));
+void outstr __P((const char *, struct output *));
+void emptyoutbuf __P((struct output *));
+void flushall __P((void));
+void flushout __P((struct output *));
+void freestdout __P((void));
+void outfmt __P((struct output *, char *, ...));
+void out1fmt __P((char *, ...)); 
+void dprintf __P((char *, ...));
+void fmtstr __P((char *, int, char *, ...));
+void doformat __P((struct output *, char *, va_list));
+int xwrite __P((int, char *, int));
+int xioctl __P((int, unsigned long, char *));
 
 #define outc(c, file)  (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c)))
 #define out1c(c)       outc(c, out1);
 
 #define outc(c, file)  (--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c)))
 #define out1c(c)       outc(c, out1);