Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 28 Feb 2005 21:35:20 +0000 (21:35 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 28 Feb 2005 21:35:20 +0000 (21:35 +0000)
documentation update: makedoc finally sorts is output; way more to come

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@120 e385b8ad-14ed-0310-8656-cc95a2468c6d

init.h
makedoc.c

diff --git a/init.h b/init.h
index c494970..5e8cd10 100644 (file)
--- a/init.h
+++ b/init.h
@@ -101,6 +101,12 @@ struct option_t
 # ifndef USE_LIBESMTP
 #  define USE_LIBESMTP
 # endif
 # ifndef USE_LIBESMTP
 #  define USE_LIBESMTP
 # endif
+# ifndef USE_NNTP
+#  define USE_NNTP
+# endif
+# ifndef USE_GNUTLS
+#  define USE_GNUTLS
+# endif
 #endif
 
 struct option_t MuttVars[] = {
 #endif
 
 struct option_t MuttVars[] = {
@@ -2199,27 +2205,8 @@ struct option_t MuttVars[] = {
   ** .pp
   ** Example: set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt
   */
   ** .pp
   ** Example: set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt
   */
-#ifdef USE_GNUTLS
-  { "ssl_min_dh_prime_bits", DT_NUM, R_NONE, UL &SslDHPrimeBits, 0 },
-  /*
-  ** .pp
-  ** This variable specifies the minimum acceptable prime size (in bits)
-  ** for use in any Diffie-Hellman key exchange. A value of 0 will use
-  ** the default from the GNUTLS library.
-  */
-  { "ssl_ca_certificates_file", DT_PATH, R_NONE, UL &SslCACertFile, 0 },
-  /*
-  ** .pp
-  ** This variable specifies a file containing trusted CA certificates.
-  ** Any server certificate that is signed with one of these CA
-  ** certificates are also automatically accepted.
-  ** .pp
-  ** Example: set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt
-  */
 #endif
 #endif
 #endif
 #endif
-#endif
-
   { "pipe_split",      DT_BOOL, R_NONE, OPTPIPESPLIT, 0 },
   /*
   ** .pp
   { "pipe_split",      DT_BOOL, R_NONE, OPTPIPESPLIT, 0 },
   /*
   ** .pp
index cbbc427..08fd73e 100644 (file)
--- a/makedoc.c
+++ b/makedoc.c
@@ -59,22 +59,34 @@ extern int optind;
 
 #define BUFFSIZE 2048
 
 
 #define BUFFSIZE 2048
 
-static char lastvar[BUFFSIZE];
-static int sort_error = 0;
+#define STRLEN(s) (s ? strlen(s) : 0)
+
+typedef struct {
+  short seen;
+  char* name;
+  char* descr;
+} var_t;
+
+static int outcount = 0;
+static var_t* outbuf = NULL;
+
+static int var_cmp (const void* a, const void* b) {
+  return (strcmp (((var_t*) a)->name, ((var_t*) b)->name));
+}
 
 enum output_formats_t
 {
   F_CONF, F_MAN, F_SGML, F_NONE
 };
 
 
 enum output_formats_t
 {
   F_CONF, F_MAN, F_SGML, F_NONE
 };
 
-#define D_NL           (1 << 0)
-#define D_EM           (1 << 1)
-#define D_BF           (1 << 2)
-#define D_TAB          (1 << 3)
-#define D_NP           (1 << 4)
-#define D_INIT         (1 << 5)
-#define D_DL           (1 << 6)
-#define D_DT           (1 << 7)
+#define D_NL            (1 << 0)
+#define D_EM            (1 << 1)
+#define D_BF            (1 << 2)
+#define D_TAB           (1 << 3)
+#define D_NP            (1 << 4)
+#define D_INIT          (1 << 5)
+#define D_DL            (1 << 6)
+#define D_DT            (1 << 7)
 
 enum
 {
 
 enum
 {
@@ -101,15 +113,18 @@ static char *get_token (char *, size_t, char *);
 static char *skip_ws (char *);
 static const char *type2human (int);
 static int buff2type (const char *);
 static char *skip_ws (char *);
 static const char *type2human (int);
 static int buff2type (const char *);
-static int flush_doc (int, FILE *);
-static int handle_docline (char *, FILE *, int);
-static int print_it (int, char *, FILE *, int);
-static void print_confline (const char *, int, const char *, FILE *);
-static void handle_confline (char *, FILE *);
+static int flush_doc (int);
+static int handle_docline (char *, int);
+static int print_it (int, char *, int);
+static void print_confline (const char *, int, const char *);
+static void handle_confline (char *);
 static void makedoc (FILE *, FILE *);
 static void pretty_default (char *, size_t, const char *, int);
 static void makedoc (FILE *, FILE *);
 static void pretty_default (char *, size_t, const char *, int);
-static int sgml_fputc (int, FILE *);
-static int sgml_fputs (const char *, FILE *);
+static int sgml_fputc (int);
+static int sgml_fputs (const char *);
+static void add_var (const char*);
+static int add_s (const char*);
+static int add_c (int);
 
 int main (int argc, char *argv[])
 {
 
 int main (int argc, char *argv[])
 {
@@ -131,8 +146,8 @@ int main (int argc, char *argv[])
       case 'd': Debug++; break;
       default: 
       {
       case 'd': Debug++; break;
       default: 
       {
-       fprintf (stderr, "%s: bad command line parameter.\n", Progname);
-       exit (1);
+        fprintf (stderr, "%s: bad command line parameter.\n", Progname);
+        exit (1);
       }
     }
   }
       }
     }
   }
@@ -142,7 +157,7 @@ int main (int argc, char *argv[])
     if ((f = fopen (argv[optind], "r")) == NULL)
     {
       fprintf (stderr, "%s: Can't open %s (%s).\n",
     if ((f = fopen (argv[optind], "r")) == NULL)
     {
       fprintf (stderr, "%s: Can't open %s (%s).\n",
-              Progname, argv[optind], strerror (errno));
+               Progname, argv[optind], strerror (errno));
       exit (1);
     }
   }
       exit (1);
     }
   }
@@ -153,13 +168,11 @@ int main (int argc, char *argv[])
   {
     case F_CONF: 
     case F_MAN:  
   {
     case F_CONF: 
     case F_MAN:  
-    case F_SGML:
-      lastvar[0] = '\0';
-      makedoc (f, stdout); break;
+    case F_SGML: makedoc (f, stdout); break;
     default:
     {
       fprintf (stderr, "%s: No output format specified.\n",
     default:
     {
       fprintf (stderr, "%s: No output format specified.\n",
-              Progname);
+               Progname);
       exit (1);
     }
   }
       exit (1);
     }
   }
@@ -170,12 +183,37 @@ int main (int argc, char *argv[])
   exit (1);
 }
 
   exit (1);
 }
 
-static void remember (const char* s)
-{
-  int l = strlen (s);
-  lastvar[0] = '\0';
-  strncpy (lastvar, s, strlen (s));
-  lastvar[l] = '\0';
+static void add_var (const char* name) {
+  outbuf = realloc (outbuf, (++outcount) * sizeof(var_t));
+  outbuf[outcount-1].seen = 0;
+  outbuf[outcount-1].name = strdup (name);
+  outbuf[outcount-1].descr = NULL;
+}
+
+static int add (const char* s) {
+  size_t lnew = STRLEN(s), lold = STRLEN(outbuf[outcount-1].descr);
+
+  if (lnew == 0)
+    return (0);
+  if (!outbuf[outcount-1].seen) {
+    lold = 0;
+    outbuf[outcount-1].seen = 1;
+  }
+
+  if (lold == 0)
+    outbuf[outcount-1].descr = strdup (s);
+  else {
+    outbuf[outcount-1].descr = realloc (outbuf[outcount-1].descr, lold + lnew + 1);
+    memcpy (&(outbuf[outcount-1].descr[lold-1])+1, s, lnew);
+  }
+  outbuf[outcount-1].descr[lold+lnew] = '\0';
+  return (1);
+}
+
+static int add_c (int c) {
+  char buf[2] = "\0\0";
+  buf[0] = c;
+  return (add (buf));
 }
 
 static void makedoc (FILE *in, FILE *out)
 }
 
 static void makedoc (FILE *in, FILE *out)
@@ -193,7 +231,7 @@ static void makedoc (FILE *in, FILE *out)
     if ((p = strchr (buffer, '\n')) == NULL)
     {
       fprintf (stderr, "%s: Line %d too long.  Ask a wizard to enlarge\n"
     if ((p = strchr (buffer, '\n')) == NULL)
     {
       fprintf (stderr, "%s: Line %d too long.  Ask a wizard to enlarge\n"
-                      "%s: my buffer size.\n", Progname, line, Progname);
+                       "%s: my buffer size.\n", Progname, line, Progname);
       exit (1);
     }
     else
       exit (1);
     }
     else
@@ -205,28 +243,35 @@ static void makedoc (FILE *in, FILE *out)
     if (Debug)
     {
       fprintf (stderr, "%s: line %d.  first token: \"%s\".\n",
     if (Debug)
     {
       fprintf (stderr, "%s: line %d.  first token: \"%s\".\n",
-              Progname, line, token);
+               Progname, line, token);
     }
     
     if (!strcmp (token, "/*++*/"))
       active = 1;
     else if (!strcmp (token, "/*--*/"))
     {
     }
     
     if (!strcmp (token, "/*++*/"))
       active = 1;
     else if (!strcmp (token, "/*--*/"))
     {
-      docstat = flush_doc (docstat, out);
+      docstat = flush_doc (docstat);
       active = 0;
     }
     else if (active && (!strcmp (token, "/**") || !strcmp (token, "**")))
       active = 0;
     }
     else if (active && (!strcmp (token, "/**") || !strcmp (token, "**")))
-      docstat = handle_docline (p, out, docstat);
+      docstat = handle_docline (p, docstat);
     else if (active && !strcmp (token, "{"))
     {
     else if (active && !strcmp (token, "{"))
     {
-      docstat = flush_doc (docstat, out);
-      handle_confline (p, out);
+      docstat = flush_doc (docstat);
+      handle_confline (p);
     }
   }
     }
   }
-  flush_doc (docstat, out);
+  flush_doc (docstat);
   fputs ("\n", out);
   fputs ("\n", out);
-  if (sort_error == 1)
-    fputs ("makedoc: warning: there're sorting errors in vars\n", stderr);
+  qsort (outbuf, outcount, sizeof (var_t), &var_cmp);
+  for (line = 0; line < outcount; line++) {
+    if (outbuf[line].descr) {
+      fprintf (out, "%s\n", outbuf[line].descr);
+      free (outbuf[line].descr);
+    }
+    free (outbuf[line].name);
+  }
+  free (outbuf);
 }
 
 /* skip whitespace */
 }
 
 /* skip whitespace */
@@ -251,13 +296,13 @@ static char *get_token (char *d, size_t l, char *s)
 
   if (Debug)
      fprintf (stderr, "%s: get_token called for `%s'.\n",
 
   if (Debug)
      fprintf (stderr, "%s: get_token called for `%s'.\n",
-             Progname, s);
+              Progname, s);
   
   s = skip_ws (s);
 
   if (Debug > 1)
     fprintf (stderr, "%s: argumet after skip_ws():  `%s'.\n",
   
   s = skip_ws (s);
 
   if (Debug > 1)
     fprintf (stderr, "%s: argumet after skip_ws():  `%s'.\n",
-            Progname, s);
+             Progname, s);
 
   if (!*s)
   {
 
   if (!*s)
   {
@@ -271,7 +316,7 @@ static char *get_token (char *d, size_t l, char *s)
     if (Debug)
     {
       fprintf (stderr, "%s: found single character token `%c'.\n",
     if (Debug)
     {
       fprintf (stderr, "%s: found single character token `%c'.\n",
-              Progname, *s);
+               Progname, *s);
     }
     d[0] = *s++;
     d[1] = 0;
     }
     d[0] = *s++;
     d[1] = 0;
@@ -298,10 +343,10 @@ static char *get_token (char *d, size_t l, char *s)
     {
       switch ((*d = *++t))
       {
     {
       switch ((*d = *++t))
       {
-       case 'n': *d = '\n'; break;
-       case 't': *d = '\t'; break;
-       case 'r': *d = '\r'; break;
-       case 'a': *d = '\a'; break;
+        case 'n': *d = '\n'; break;
+        case 't': *d = '\t'; break;
+        case 'r': *d = '\r'; break;
+        case 'a': *d = '\a'; break;
       }
 
       d++;
       }
 
       d++;
@@ -326,9 +371,9 @@ static char *get_token (char *d, size_t l, char *s)
   if (Debug)
   {
     fprintf (stderr, "%s: Got %stoken: `%s'.\n",
   if (Debug)
   {
     fprintf (stderr, "%s: Got %stoken: `%s'.\n",
-            Progname, is_quoted ? "quoted " : "", dd);
+             Progname, is_quoted ? "quoted " : "", dd);
     fprintf (stderr, "%s: Remainder: `%s'.\n",
     fprintf (stderr, "%s: Remainder: `%s'.\n",
-            Progname, t);
+             Progname, t);
   }
   
   return t;
   }
   
   return t;
@@ -369,17 +414,17 @@ struct
 }
 types[] = 
 {
 }
 types[] = 
 {
-  { "DT_NONE", "-none-"        },
-  { "DT_BOOL",  "boolean"      },
-  { "DT_NUM",   "number"       },
-  { "DT_STR",  "string"        },
-  { "DT_PATH", "path"          },
-  { "DT_QUAD", "quadoption"    },
-  { "DT_SORT", "sort order"    },
-  { "DT_RX",   "regular expression" },
-  { "DT_MAGIC",        "folder magic" },
-  { "DT_SYN",  NULL },
-  { "DT_ADDR", "e-mail address" },
+  { "DT_NONE",  "-none-" },
+  { "DT_BOOL",  "boolean" },
+  { "DT_NUM",   "number" },
+  { "DT_STR",   "string" },
+  { "DT_PATH",  "path" },
+  { "DT_QUAD",  "quadoption" },
+  { "DT_SORT",  "sort order" },
+  { "DT_RX",    "regular expression" },
+  { "DT_MAGIC", "folder magic" },
+  { "DT_SYN",   NULL },
+  { "DT_ADDR",  "e-mail address" },
   { NULL, NULL }
 };
     
   { NULL, NULL }
 };
     
@@ -390,7 +435,7 @@ static int buff2type (const char *s)
   
   for (type = DT_NONE; types[type].machine; type++)
     if (!strcmp (types[type].machine, s))
   
   for (type = DT_NONE; types[type].machine; type++)
     if (!strcmp (types[type].machine, s))
-       return type;
+        return type;
   
   return DT_NONE;
 }
   
   return DT_NONE;
 }
@@ -399,7 +444,7 @@ static const char *type2human (int type)
 {
   return types[type].human;
 }
 {
   return types[type].human;
 }
-static void handle_confline (char *s, FILE *out)
+static void handle_confline (char *s)
 {
   char varname[BUFFSIZE];
   char buff[BUFFSIZE];
 {
   char varname[BUFFSIZE];
   char buff[BUFFSIZE];
@@ -411,14 +456,7 @@ static void handle_confline (char *s, FILE *out)
   /* xxx - put this into an actual state machine? */
 
   /* variable name */
   /* xxx - put this into an actual state machine? */
 
   /* variable name */
-  if (!(s = get_token (varname, sizeof (varname), s)))
-    return;
-  else
-  {
-    if (lastvar[0] && strncmp (lastvar, varname, strlen (lastvar)) > 0)
-      sort_error = 1;
-    remember (varname);
-  }
+  if (!(s = get_token (varname, sizeof (varname), s))) return;
   
   /* comma */
   if (!(s = get_token (buff, sizeof (buff), s))) return;
   
   /* comma */
   if (!(s = get_token (buff, sizeof (buff), s))) return;
@@ -473,12 +511,13 @@ static void handle_confline (char *s, FILE *out)
     if (!strcmp (buff, "}"))
       break;
 
     if (!strcmp (buff, "}"))
       break;
 
-    strncpy (tmp + strlen (tmp), buff, sizeof (tmp) - strlen (tmp));
+    strncpy (tmp + STRLEN(tmp), buff, sizeof (tmp) - STRLEN(tmp));
   }
   while ((s = get_token (buff, sizeof (buff), s)));
 
   pretty_default (val, sizeof (val), tmp, type);
   }
   while ((s = get_token (buff, sizeof (buff), s)));
 
   pretty_default (val, sizeof (val), tmp, type);
-  print_confline (varname, type, val, out);
+  add_var (varname);
+  print_confline (varname, type, val);
 }
 
 static void pretty_default (char *t, size_t l, const char *s, int type)
 }
 
 static void pretty_default (char *t, size_t l, const char *s, int type)
@@ -499,9 +538,9 @@ static void pretty_default (char *t, size_t l, const char *s, int type)
     case DT_BOOL:
     {
       if (atoi (s))
     case DT_BOOL:
     {
       if (atoi (s))
-       strncpy (t, "yes", l);
+        strncpy (t, "yes", l);
       else
       else
-       strncpy (t, "no", l);
+        strncpy (t, "no", l);
       break;
     }
     case DT_SORT:
       break;
     }
     case DT_SORT:
@@ -524,7 +563,7 @@ static void pretty_default (char *t, size_t l, const char *s, int type)
     case DT_PATH:
     {
       if (!strcmp (s, "0"))
     case DT_PATH:
     {
       if (!strcmp (s, "0"))
-       break;
+        break;
       /* fallthrough */
     }
     default:
       /* fallthrough */
     }
     default:
@@ -539,57 +578,57 @@ static void char_to_escape (char *dest, unsigned int c)
 {
   switch (c)
   {
 {
   switch (c)
   {
-    case '\r': strcpy (dest, "\\r"); break;    /* __STRCPY_CHECKED__ */
-    case '\n': strcpy (dest, "\\n"); break;    /* __STRCPY_CHECKED__ */
-    case '\t': strcpy (dest, "\\t"); break;    /* __STRCPY_CHECKED__ */
-    case '\f': strcpy (dest, "\\f"); break;    /* __STRCPY_CHECKED__ */
+    case '\r': strcpy (dest, "\\r"); break;        /* __STRCPY_CHECKED__ */
+    case '\n': strcpy (dest, "\\n"); break;        /* __STRCPY_CHECKED__ */
+    case '\t': strcpy (dest, "\\t"); break;        /* __STRCPY_CHECKED__ */
+    case '\f': strcpy (dest, "\\f"); break;        /* __STRCPY_CHECKED__ */
     default: sprintf (dest, "\\%03o", c); break;
   }
 }
     default: sprintf (dest, "\\%03o", c); break;
   }
 }
-static void conf_char_to_escape (unsigned int c , FILE *out)
+static void conf_char_to_escape (unsigned int c)
 {
   char buff[16];
   char_to_escape (buff, c);
 {
   char buff[16];
   char_to_escape (buff, c);
-  fputs (buff, out);
+  add (buff);
 }
 
 }
 
-static void conf_print_strval (const char *v, FILE *out)
+static void conf_print_strval (const char *v)
 {
   for (; *v; v++)
   {
     if (*v < ' ' || *v & 0x80)
     {
 {
   for (; *v; v++)
   {
     if (*v < ' ' || *v & 0x80)
     {
-      conf_char_to_escape ((unsigned int) *v, out);
+      conf_char_to_escape ((unsigned int) *v);
       continue;
     }
 
     if (*v == '"'  || *v == '\\')
       continue;
     }
 
     if (*v == '"'  || *v == '\\')
-      fputc ('\\', out);
-    fputc (*v, out);
+      add_c ('\\');
+    add_c (*v);
   }
 }
 
   }
 }
 
-static void man_print_strval (const char *v, FILE *out)
+static void man_print_strval (const char *v)
 {
   for (; *v; v++)
   {
     if (*v < ' ' || *v & 0x80)
     {
 {
   for (; *v; v++)
   {
     if (*v < ' ' || *v & 0x80)
     {
-      fputc ('\\', out);
-      conf_char_to_escape ((unsigned int) *v, out);
+      add_c ('\\');
+      conf_char_to_escape ((unsigned int) *v);
       continue;
     }
     
     if (*v == '"')
       continue;
     }
     
     if (*v == '"')
-      fputs ("\\(rq", out);
+      add ("\\(rq");
     else if (*v == '\\')
     else if (*v == '\\')
-      fputs ("\\\\", out);
+      add ("\\\\");
     else
     else
-      fputc (*v, out);
+      add_c (*v);
   }
 }
 
   }
 }
 
-static void sgml_print_strval (const char *v, FILE *out)
+static void sgml_print_strval (const char *v)
 {
   char buff[16];
   for (; *v; v++)
 {
   char buff[16];
   for (; *v; v++)
@@ -597,42 +636,42 @@ static void sgml_print_strval (const char *v, FILE *out)
     if (*v <  ' ' || *v & 0x80)
     {
       char_to_escape (buff, (unsigned int) *v);
     if (*v <  ' ' || *v & 0x80)
     {
       char_to_escape (buff, (unsigned int) *v);
-      sgml_fputs (buff, out);
+      sgml_fputs (buff);
       continue;
     }
       continue;
     }
-    sgml_fputc ((unsigned int) *v, out);
+    sgml_fputc ((unsigned int) *v);
   }
 }
 
   }
 }
 
-static int sgml_fputc (int c, FILE *out)
+static int sgml_fputc (int c)
 {
   switch (c)
   {
 {
   switch (c)
   {
-    case '<': return fputs ("&lt;", out);
-    case '>': return fputs ("&gt;", out);
-    case '$': return fputs ("&dollar;", out);
-    case '_': return fputs ("&lowbar;", out);
-    case '%': return fputs ("&percnt;", out);
-    case '&': return fputs ("&amp;", out);
-    case '\\': return fputs ("&bsol;", out);
-    case '"': return fputs ("&dquot;", out);
-    case '[': return fputs ("&lsqb;", out);
-    case ']': return fputs ("&rsqb;", out);
-    case '~': return fputs ("&tilde;", out);
-    default:  return fputc (c, out);
+    case '<': return add ("&lt;");
+    case '>': return add ("&gt;");
+    case '$': return add ("&dollar;");
+    case '_': return add ("&lowbar;");
+    case '%': return add ("&percnt;");
+    case '&': return add ("&amp;");
+    case '\\': return add ("&bsol;");
+    case '"': return add ("&dquot;");
+    case '[': return add ("&lsqb;");
+    case ']': return add ("&rsqb;");
+    case '~': return add ("&tilde;");
+    default:  return add_c (c);
   }
 }
 
   }
 }
 
-static int sgml_fputs (const char *s, FILE *out)
+static int sgml_fputs (const char *s)
 {
   for (; *s; s++)
 {
   for (; *s; s++)
-    if (sgml_fputc ((unsigned int) *s, out) == EOF)
+    if (sgml_fputc ((unsigned int) *s) == EOF)
       return EOF;
   
   return 0;
 }
 
       return EOF;
   
   return 0;
 }
 
-static void print_confline (const char *varname, int type, const char *val, FILE *out)
+static void print_confline (const char *varname, int type, const char *val)
 {
   if (type == DT_SYN) return;
   
 {
   if (type == DT_SYN) return;
   
@@ -643,44 +682,61 @@ static void print_confline (const char *varname, int type, const char *val, FILE
     {
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
     {
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
-       fprintf (out, "\n# set %s=\"", varname);
-       conf_print_strval (val, out);
-       fputs ("\"", out);
+        add ("\n# set ");
+        add (varname);
+        add ("\"");
+        conf_print_strval (val);
+        add ("\"");
       }
       else if (type != DT_SYN)
       }
       else if (type != DT_SYN)
-       fprintf (out, "\n# set %s=%s", varname, val);
+      {
+        add ("\n# set ");
+        add (varname);
+        add ("=");
+        add (val);
+      }
       
       
-      fprintf (out, "\n#\n# Name: %s", varname);
-      fprintf (out, "\n# Type: %s", type2human (type));
+      add ("\n#\n# Name: ");
+      add (varname);
+      add ("\n# Type: ");
+      add (type2human (type));
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
-       fputs ("\n# Default: \"", out);
-       conf_print_strval (val, out);
-       fputs ("\"", out);
+        add ("\n# Default: \"");
+        conf_print_strval (val);
+        add ("\"");
       }
       else
       }
       else
-       fprintf (out, "\n# Default: %s", val);
+      {
+        add ("\n# Default: ");
+        add (val);
+      }
 
 
-      fputs ("\n# ", out);
+      add ("\n# ");
       break;
     }
 
     /* manual page */
     case F_MAN:
     {
       break;
     }
 
     /* manual page */
     case F_MAN:
     {
-      fprintf (out, "\n.TP\n.B %s\n", varname);
-      fputs (".nf\n", out);
-      fprintf (out, "Type: %s\n", type2human (type));
+      add ("\n.TP\n.B %s\n");
+      add (varname);
+      add (".nf\n");
+      add ("Type: %s\n");
+      add (type2human (type));
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
-       fputs ("Default: \\(lq", out);
-       man_print_strval (val, out);
-       fputs ("\\(rq\n", out);
+        add ("Default: \\(lq");
+        man_print_strval (val);
+        add ("\\(rq\n");
+      }
+      else {
+        add ("Default: ");
+        add (val);
+        add_c ('\n');
       }
       }
-      else
-       fprintf (out, "Default: %s\n", val);
 
 
-      fputs (".fi", out);
+      add (".fi");
 
       break;
     }
 
       break;
     }
@@ -688,18 +744,27 @@ static void print_confline (const char *varname, int type, const char *val, FILE
     /* SGML based manual */
     case F_SGML:
     {
     /* SGML based manual */
     case F_SGML:
     {
-      fputs ("\n<sect2>", out);  sgml_fputs (varname, out);
-      fprintf (out, "<label id=\"%s\">", varname);
-      fprintf (out, "\n<p>\nType: %s<newline>", type2human (type));
+      add ("\n<sect2>");
+      sgml_fputs (varname);
+      add ("<label id=\"");
+      add (varname);
+      add ("\">");
+      add ("\n<p>\nType: ");
+      add (type2human (type));
+      add ("<newline>");
       
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
       
       if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH)
       {
-       fputs ("\nDefault: &dquot;", out);
-       sgml_print_strval (val, out);
-       fputs ("&dquot;\n", out);
+        add ("\nDefault: &dquot;");
+        sgml_print_strval (val);
+        add ("&dquot;\n");
       }
       else
       }
       else
-       fprintf (out, "\nDefault: %s\n", val);
+      {
+        add ("\nDefault: ");
+        add (val);
+        add ("\n");
+      }
       break;
     }
     /* make gcc happy */
       break;
     }
     /* make gcc happy */
@@ -738,7 +803,7 @@ static void print_confline (const char *varname, int type, const char *val, FILE
 
 static int fd_recurse = 0;
 
 
 static int fd_recurse = 0;
 
-static int flush_doc (int docstat, FILE *out)
+static int flush_doc (int docstat)
 {
   if (docstat & D_INIT)
     return D_INIT;
 {
   if (docstat & D_INIT)
     return D_INIT;
@@ -750,15 +815,15 @@ static int flush_doc (int docstat, FILE *out)
   }
 
   if (docstat & (D_TAB))
   }
 
   if (docstat & (D_TAB))
-    docstat = print_it (SP_END_TAB, NULL, out, docstat);
+    docstat = print_it (SP_END_TAB, NULL, docstat);
 
   if (docstat & (D_DL))
 
   if (docstat & (D_DL))
-    docstat = print_it (SP_END_DL, NULL, out, docstat);
+    docstat = print_it (SP_END_DL, NULL, docstat);
 
   if (docstat & (D_EM | D_BF))
 
   if (docstat & (D_EM | D_BF))
-    docstat = print_it (SP_END_FT, NULL, out, docstat);
+    docstat = print_it (SP_END_FT, NULL, docstat);
 
 
-  docstat = print_it (SP_NEWLINE, NULL, out, 0);
+  docstat = print_it (SP_NEWLINE, NULL, 0);
 
   fd_recurse--;
   return D_INIT;
 
   fd_recurse--;
   return D_INIT;
@@ -766,7 +831,7 @@ static int flush_doc (int docstat, FILE *out)
 
 /* print something. */
 
 
 /* print something. */
 
-static int print_it (int special, char *str, FILE *out, int docstat)
+static int print_it (int special, char *str, int docstat)
 {
   int onl = docstat & (D_NL|D_NP);
   
 {
   int onl = docstat & (D_NL|D_NP);
   
@@ -779,92 +844,92 @@ static int print_it (int special, char *str, FILE *out, int docstat)
     {
       switch (special)
       {
     {
       switch (special)
       {
-       static int Continuation = 0;
-
-       case SP_END_FT: docstat &= ~(D_EM|D_BF); break;
-       case SP_START_BF: docstat |= D_BF; break;
-       case SP_START_EM: docstat |= D_EM; break;
-       case SP_NEWLINE: 
-       {
-         if (onl)
-           docstat |= onl;
-         else
-         {
-           fputs ("\n# ", out);
-           docstat |= D_NL;
-         }
-         if (docstat & D_DL)
-           ++ Continuation;
-         break;
-       }
-       case SP_NEWPAR:
-       {
-         if (onl & D_NP)
-         {
-           docstat |= onl;
-           break;
-         }
-
-         if (!(onl & D_NL))
-           fputs ("\n# ", out);
-         fputs ("\n# ", out);
-         docstat |= D_NP;
-         break;
-       }
-       case SP_START_TAB: 
-       {
-         if (!onl) 
-           fputs ("\n# ", out);
-         docstat |= D_TAB;
-         break;
-       }
-       case SP_END_TAB:
-       {
-         docstat &= ~D_TAB;
-         docstat |= D_NL;
-         break;
-       }
-       case SP_START_DL:
-       {
-         docstat |= D_DL;
-         break;
-       }
-       case SP_DT:
-       {
-         Continuation = 0;
-         docstat |= D_DT;
-         break;
-       }
-       case SP_DD:
-       {
-         Continuation = 0;
-         break;
-       }
-       case SP_END_DL:
-       {
-         Continuation = 0;
-         docstat &= ~D_DL;
-         break;
-       }
-       case SP_STR:
-       {
-         if (Continuation)
-         {
-           Continuation = 0;
-           fputs ("        ", out);
-         }
-         fputs (str, out);
-         if (docstat & D_DT)
-         { 
-           int i;
-
-           for (i = strlen (str) ; i < 8 ; i++)
-             putc (' ', out);
-           docstat &= ~D_DT;
-           docstat |= D_NL;
-         }
-         break;
-       }
+        static int Continuation = 0;
+
+        case SP_END_FT: docstat &= ~(D_EM|D_BF); break;
+        case SP_START_BF: docstat |= D_BF; break;
+        case SP_START_EM: docstat |= D_EM; break;
+        case SP_NEWLINE: 
+        {
+          if (onl)
+            docstat |= onl;
+          else
+          {
+            add ("\n# ");
+            docstat |= D_NL;
+          }
+          if (docstat & D_DL)
+            ++ Continuation;
+          break;
+        }
+        case SP_NEWPAR:
+        {
+          if (onl & D_NP)
+          {
+            docstat |= onl;
+            break;
+          }
+
+          if (!(onl & D_NL))
+            add ("\n# ");
+          add ("\n# ");
+          docstat |= D_NP;
+          break;
+        }
+        case SP_START_TAB: 
+        {
+          if (!onl) 
+            add ("\n# ");
+          docstat |= D_TAB;
+          break;
+        }
+        case SP_END_TAB:
+        {
+          docstat &= ~D_TAB;
+          docstat |= D_NL;
+          break;
+        }
+        case SP_START_DL:
+        {
+          docstat |= D_DL;
+          break;
+        }
+        case SP_DT:
+        {
+          Continuation = 0;
+          docstat |= D_DT;
+          break;
+        }
+        case SP_DD:
+        {
+          Continuation = 0;
+          break;
+        }
+        case SP_END_DL:
+        {
+          Continuation = 0;
+          docstat &= ~D_DL;
+          break;
+        }
+        case SP_STR:
+        {
+          if (Continuation)
+          {
+            Continuation = 0;
+            add ("        ");
+          }
+          add (str);
+          if (docstat & D_DT)
+          
+            int i;
+
+            for (i = STRLEN(str) ; i < 8 ; i++)
+              add_c (' ');
+            docstat &= ~D_DT;
+            docstat |= D_NL;
+          }
+          break;
+        }
       }
       break;
     }
       }
       break;
     }
@@ -874,113 +939,113 @@ static int print_it (int special, char *str, FILE *out, int docstat)
     {
       switch (special)
       {
     {
       switch (special)
       {
-       case SP_END_FT: 
-       {
-         fputs ("\\fP", out);
-         docstat &= ~(D_EM|D_BF);
-         break;
-       }
-       case SP_START_BF: 
-       {
-         fputs ("\\fB", out);
-         docstat |= D_BF;
-         docstat &= ~D_EM;
-         break;
-       }
-       case SP_START_EM:
-       {
-         fputs ("\\fI", out);
-         docstat |= D_EM;
-         docstat &= ~D_BF;
-         break;
-       }
-       case SP_NEWLINE:
-       {
-         if (onl)
-           docstat |= onl;
-         else
-         {
-           fputc ('\n', out);
-           docstat |= D_NL;
-         }
-         break;
-       }
-       case SP_NEWPAR:
-       {
-         if (onl & D_NP)
-         {
-           docstat |= onl;
-           break;
-         }
-
-         if (!(onl & D_NL))
-           fputc ('\n', out);
-         fputs (".IP\n", out);
-
-         docstat |= D_NP;
-         break;
-       }
-       case SP_START_TAB:
-       {
-         fputs ("\n.IP\n.DS\n.sp\n.ft CR\n.nf\n", out);
-         docstat |= D_TAB | D_NL;
-         break;
-       }
-       case SP_END_TAB:
-       {
-         fputs ("\n.fi\n.ec\n.ft P\n.sp\n", out);
-         docstat &= ~D_TAB;
-         docstat |= D_NL;
-         break;
-       }
-       case SP_START_DL:
-       {
-         fputs ("\n.RS", out);
-         docstat |= D_DL;
-         break;
-       }
-       case SP_DT:
-       {
-         fputs ("\n.IP ", out);
-         break;
-       }
-       case SP_DD:
-       {
-         fputs ("\n", out);
-         break;
-       }
-       case SP_END_DL:
-       {
-         fputs ("\n.RE", out);
-         docstat &= ~D_DL;
-         break;
-       }
-       case SP_STR:
-       {
-         while (*str)
-         {
-           for (; *str; str++)
-           {
-             if (*str == '"')
-               fputs ("\\(rq", out);
-             else if (*str == '\\')
-               fputs ("\\\\", out);
-             else if (!strncmp (str, "``", 2))
-             {
-               fputs ("\\(lq", out);
-               str++;
-             }
-             else if (!strncmp (str, "''", 2))
-             {
-               fputs ("\\(rq", out);
-               str++;
-             }
-             else
-               fputc (*str, out);
-           }
-         }
-         break;
-       }
+        case SP_END_FT: 
+        {
+          add ("\\fP");
+          docstat &= ~(D_EM|D_BF);
+          break;
+        }
+        case SP_START_BF: 
+        {
+          add ("\\fB");
+          docstat |= D_BF;
+          docstat &= ~D_EM;
+          break;
+        }
+        case SP_START_EM:
+        {
+          add ("\\fI");
+          docstat |= D_EM;
+          docstat &= ~D_BF;
+          break;
+        }
+        case SP_NEWLINE:
+        {
+          if (onl)
+            docstat |= onl;
+          else
+          {
+            add_c ('\n');
+            docstat |= D_NL;
+          }
+          break;
+        }
+        case SP_NEWPAR:
+        {
+          if (onl & D_NP)
+          {
+            docstat |= onl;
+            break;
+          }
+
+          if (!(onl & D_NL))
+            add_c ('\n');
+          add (".IP\n");
+
+          docstat |= D_NP;
+          break;
+        }
+        case SP_START_TAB:
+        {
+          add ("\n.IP\n.DS\n.sp\n.ft CR\n.nf\n");
+          docstat |= D_TAB | D_NL;
+          break;
+        }
+        case SP_END_TAB:
+        {
+          add ("\n.fi\n.ec\n.ft P\n.sp\n");
+          docstat &= ~D_TAB;
+          docstat |= D_NL;
+          break;
+        }
+        case SP_START_DL:
+        {
+          add ("\n.RS");
+          docstat |= D_DL;
+          break;
+        }
+        case SP_DT:
+        {
+          add ("\n.IP ");
+          break;
+        }
+        case SP_DD:
+        {
+          add ("\n");
+          break;
+        }
+        case SP_END_DL:
+        {
+          add ("\n.RE");
+          docstat &= ~D_DL;
+          break;
+        }
+        case SP_STR:
+        {
+          while (*str)
+          {
+            for (; *str; str++)
+            {
+              if (*str == '"')
+                add ("\\(rq");
+              else if (*str == '\\')
+                add ("\\\\");
+              else if (!strncmp (str, "``", 2))
+              {
+                add ("\\(lq");
+                str++;
+              }
+              else if (!strncmp (str, "''", 2))
+              {
+                add ("\\(rq");
+                str++;
+              }
+              else
+                add_c (*str);
+            }
+          }
+          break;
+        }
       }
       break;
     }
       }
       break;
     }
@@ -990,96 +1055,96 @@ static int print_it (int special, char *str, FILE *out, int docstat)
     {
       switch (special)
       {
     {
       switch (special)
       {
-       case SP_END_FT: 
-       {
-         if (docstat & D_EM) fputs ("</em>", out);
-         if (docstat & D_BF) fputs ("</bf>", out);
-         docstat &= ~(D_EM|D_BF);
-         break;
-       }
-       case SP_START_BF: 
-       {
-         fputs ("<bf>", out);
-         docstat |= D_BF;
-         docstat &= ~D_EM;
-         break;
-       }
-       case SP_START_EM:
-       {
-         fputs ("<em>", out);
-         docstat |= D_EM;
-         docstat &= ~D_BF;
-         break;
-       }
-       case SP_NEWLINE:
-       {
-         if (onl)
-           docstat |= onl;
-         else
-         {
-           fputc ('\n', out);
-           docstat |= D_NL;
-         }
-         break;
-       }
-       case SP_NEWPAR:
-       {
-         if (onl & D_NP)
-         {
-           docstat |= onl;
-           break;
-         }
-
-         if (!(onl & D_NL))
-           fputc ('\n', out);
-         fputs ("<p>\n", out);
-
-         docstat |= D_NP;
-         break;
-       }
-       case SP_START_TAB:
-       {
-         fputs ("\n<tscreen><verb>\n", out);
-         docstat |= D_TAB | D_NL;
-         break;
-       }
-       case SP_END_TAB:
-       {
-         fputs ("\n</verb></tscreen>", out);
-         docstat &= ~D_TAB;
-         docstat |= D_NL;
-         break;
-       }
-       case SP_START_DL:
-       {
-         fputs ("\n<descrip>\n", out);
-         docstat |= D_DL;
-         break;
-       }
-       case SP_DT:
-       {
-         fputs ("<tag>", out);
-         break;
-       }
-       case SP_DD:
-       {
-         fputs ("</tag>", out);
-         break;
-       }
-       case SP_END_DL:
-       {
-         fputs ("</descrip>\n", out);
-         docstat &= ~D_DL;
-         break;
-       }
-       case SP_STR:
-       {
-         if (docstat & D_TAB)
-           fputs (str, out);
-         else
-           sgml_fputs (str, out);
-         break;
-       }
+        case SP_END_FT: 
+        {
+          if (docstat & D_EM) add("</em>");
+          if (docstat & D_BF) add("</bf>");
+          docstat &= ~(D_EM|D_BF);
+          break;
+        }
+        case SP_START_BF: 
+        {
+          add ("<bf>");
+          docstat |= D_BF;
+          docstat &= ~D_EM;
+          break;
+        }
+        case SP_START_EM:
+        {
+          add ("<em>");
+          docstat |= D_EM;
+          docstat &= ~D_BF;
+          break;
+        }
+        case SP_NEWLINE:
+        {
+          if (onl)
+            docstat |= onl;
+          else
+          {
+            add ("\n");
+                   docstat |= D_NL;
+          }
+          break;
+        }
+        case SP_NEWPAR:
+        {
+          if (onl & D_NP)
+          {
+            docstat |= onl;
+            break;
+          }
+
+          if (!(onl & D_NL))
+            add ("\n");
+          add ("<p>\n");
+
+          docstat |= D_NP;
+          break;
+        }
+        case SP_START_TAB:
+        {
+          add ("\n<tscreen><verb>\n");
+          docstat |= D_TAB | D_NL;
+          break;
+        }
+        case SP_END_TAB:
+        {
+          add ("\n</verb></tscreen>");
+          docstat &= ~D_TAB;
+          docstat |= D_NL;
+          break;
+        }
+        case SP_START_DL:
+        {
+          add ("\n<descrip>\n");
+          docstat |= D_DL;
+          break;
+        }
+        case SP_DT:
+        {
+          add ("<tag>");
+          break;
+        }
+        case SP_DD:
+        {
+          add ("</tag>");
+          break;
+        }
+        case SP_END_DL:
+        {
+          add ("</descrip>\n");
+          docstat &= ~D_DL;
+          break;
+        }
+        case SP_STR:
+        {
+          if (docstat & D_TAB)
+            add (str);
+          else
+            sgml_fputs (str);
+          break;
+        }
       }
       break;
     }
       }
       break;
     }
@@ -1091,23 +1156,25 @@ static int print_it (int special, char *str, FILE *out, int docstat)
   return docstat;
 }
 
   return docstat;
 }
 
-void print_ref (FILE *out, int output_dollar, const char *ref)
+void print_ref (int output_dollar, const char *ref)
 {
   switch (OutputFormat)
   {
   case F_CONF:
   case F_MAN:
     if (output_dollar)
 {
   switch (OutputFormat)
   {
   case F_CONF:
   case F_MAN:
     if (output_dollar)
-      putc ('$', out);
-    fputs (ref, out);
+      add_c ('$');
+    add (ref);
     break;
 
   case F_SGML:
     break;
 
   case F_SGML:
-    fprintf (out, "<ref id=\"%s\" name=\"", ref);
+    add ("<ref id=\"");
+    add (ref);
+    add ("\" name=\"");
     if (output_dollar)
     if (output_dollar)
-      fputs ("&dollar;", out);
-    sgml_fputs (ref, out);
-    fputs ("\">", out);
+      add ("&dollar;");
+    sgml_fputs (ref);
+    add ("\">");
     break;
 
   default:
     break;
 
   default:
@@ -1115,19 +1182,19 @@ void print_ref (FILE *out, int output_dollar, const char *ref)
   }
 }
 
   }
 }
 
-static int commit_buff (char *buff, char **d, FILE *out, int docstat)
+static int commit_buff (char *buff, char **d, int docstat)
 {
   if (*d > buff)
   {
     **d = '\0';
 {
   if (*d > buff)
   {
     **d = '\0';
-    docstat = print_it (SP_STR, buff, out, docstat);
+    docstat = print_it (SP_STR, buff, docstat);
     *d = buff;
   }
 
   return docstat;
 }
 
     *d = buff;
   }
 
   return docstat;
 }
 
-static int handle_docline (char *l, FILE *out, int docstat)
+static int handle_docline (char *l, int docstat)
 {
   char buff[BUFFSIZE];
   char *s, *d;
 {
   char buff[BUFFSIZE];
   char *s, *d;
@@ -1137,15 +1204,15 @@ static int handle_docline (char *l, FILE *out, int docstat)
     fprintf (stderr, "%s: handle_docline `%s'\n", Progname, l);
   
   if (!strncmp (l, ".pp", 3))
     fprintf (stderr, "%s: handle_docline `%s'\n", Progname, l);
   
   if (!strncmp (l, ".pp", 3))
-    return print_it (SP_NEWPAR, NULL, out, docstat);
+    return print_it (SP_NEWPAR, NULL, docstat);
   else if (!strncmp (l, ".ts", 3))
   else if (!strncmp (l, ".ts", 3))
-    return print_it (SP_START_TAB, NULL, out, docstat);
+    return print_it (SP_START_TAB, NULL, docstat);
   else if (!strncmp (l, ".te", 3))
   else if (!strncmp (l, ".te", 3))
-    return print_it (SP_END_TAB, NULL, out, docstat);
+    return print_it (SP_END_TAB, NULL, docstat);
   else if (!strncmp (l, ".dl", 3))
   else if (!strncmp (l, ".dl", 3))
-    return print_it (SP_START_DL, NULL, out, docstat);
+    return print_it (SP_START_DL, NULL, docstat);
   else if (!strncmp (l, ".de", 3))
   else if (!strncmp (l, ".de", 3))
-    return print_it (SP_END_DL, NULL, out, docstat);
+    return print_it (SP_END_DL, NULL, docstat);
   else if (!strncmp (l, ". ", 2))
     *l = ' ';
 
   else if (!strncmp (l, ". ", 2))
     *l = ' ';
 
@@ -1163,32 +1230,32 @@ static int handle_docline (char *l, FILE *out, int docstat)
     }
     else if (!strncmp (s, "\\fI", 3))
     {
     }
     else if (!strncmp (s, "\\fI", 3))
     {
-      docstat = commit_buff (buff, &d, out, docstat);
-      docstat = print_it (SP_START_EM, NULL, out, docstat);
+      docstat = commit_buff (buff, &d, docstat);
+      docstat = print_it (SP_START_EM, NULL, docstat);
       s += 2;
     }
     else if (!strncmp (s, "\\fB", 3))
     {
       s += 2;
     }
     else if (!strncmp (s, "\\fB", 3))
     {
-      docstat = commit_buff (buff, &d, out, docstat);
-      docstat = print_it (SP_START_BF, NULL, out, docstat);
+      docstat = commit_buff (buff, &d, docstat);
+      docstat = print_it (SP_START_BF, NULL, docstat);
       s += 2;
     }
     else if (!strncmp (s, "\\fP", 3))
     {
       s += 2;
     }
     else if (!strncmp (s, "\\fP", 3))
     {
-      docstat = commit_buff (buff, &d, out, docstat);
-      docstat = print_it (SP_END_FT, NULL, out, docstat);
+      docstat = commit_buff (buff, &d, docstat);
+      docstat = print_it (SP_END_FT, NULL, docstat);
       s += 2;
     }
     else if (!strncmp (s, ".dt", 3))
     {
       s += 2;
     }
     else if (!strncmp (s, ".dt", 3))
     {
-      docstat = commit_buff (buff, &d, out, docstat);
-      docstat = print_it (SP_DT, NULL, out, docstat);
+      docstat = commit_buff (buff, &d, docstat);
+      docstat = print_it (SP_DT, NULL, docstat);
       s += 3;
     }
     else if (!strncmp (s, ".dd", 3))
     {
       s += 3;
     }
     else if (!strncmp (s, ".dd", 3))
     {
-      docstat = commit_buff (buff, &d, out, docstat);
-      docstat = print_it (SP_DD, NULL, out, docstat);
+      docstat = commit_buff (buff, &d, docstat);
+      docstat = print_it (SP_DD, NULL, docstat);
       s += 3;
     }
     else if (*s == '$')
       s += 3;
     }
     else if (*s == '$')
@@ -1200,31 +1267,31 @@ static int handle_docline (char *l, FILE *out, int docstat)
       ++s;
       if (*s == '$')
       {
       ++s;
       if (*s == '$')
       {
-       output_dollar = 1;
-       ++s;
+        output_dollar = 1;
+        ++s;
       }
       if (*s == '$')
       {
       }
       if (*s == '$')
       {
-       *d++ = '$';
+        *d++ = '$';
       }
       else
       {
       }
       else
       {
-       ref = s;
-       while (isalnum ((unsigned char) *s) || *s == '-' || *s == '_')
-         ++s;
-
-       docstat = commit_buff (buff, &d, out, docstat);
-       save = *s;
-       *s = 0;
-       print_ref (out, output_dollar, ref);
-       *s = save;
-       --s;
+        ref = s;
+        while (isalnum ((unsigned char) *s) || *s == '-' || *s == '_')
+          ++s;
+
+        docstat = commit_buff (buff, &d, docstat);
+        save = *s;
+        *s = 0;
+        print_ref (output_dollar, ref);
+        *s = save;
+        --s;
       }
     }
     else
       *d++ = *s;
   }
 
       }
     }
     else
       *d++ = *s;
   }
 
-  docstat = commit_buff (buff, &d, out, docstat);
-  return print_it (SP_NEWLINE, NULL, out, docstat);
+  docstat = commit_buff (buff, &d, docstat);
+  return print_it (SP_NEWLINE, NULL, docstat);
 }
 }