X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=makedoc.c;h=e2cfc67cfd759436d76da7a14f55e85e5031d0cd;hp=df72d5d1dfd9f915f2121c91daf600fddfc3710a;hb=6ebff74ad242d4c56fb7762965b19cee14fd2daa;hpb=5cfa41634d9a2c2e8bcf392ff0f2ee0c93794b37 diff --git a/makedoc.c b/makedoc.c index df72d5d..e2cfc67 100644 --- a/makedoc.c +++ b/makedoc.c @@ -21,21 +21,7 @@ ** **/ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #ifdef HAVE_GETOPT_H # include @@ -108,7 +94,6 @@ enum { enum output_formats_t OutputFormat = F_NONE; char *Progname; -short Debug = 0; static char *get_token (char *, size_t, char *); static char *skip_ws (char *); @@ -148,9 +133,6 @@ int main (int argc, char *argv[]) case 's': OutputFormat = F_SGML; break; - case 'd': - Debug++; - break; default: { fprintf (stderr, "%s: bad command line parameter.\n", Progname); @@ -183,7 +165,7 @@ int main (int argc, char *argv[]) } if (f != stdin) - fclose (f); + m_fclose(&f); exit (1); } @@ -248,11 +230,6 @@ static void makedoc (FILE * in, FILE * out) if (!(p = get_token (token, sizeof (token), buffer))) continue; - if (Debug) { - fprintf (stderr, "%s: line %d. first token: \"%s\".\n", - Progname, line, token); - } - if (!strcmp (token, "/*++*/")) active = 1; else if (!strcmp (token, "/*--*/")) { @@ -299,35 +276,19 @@ static char *get_token (char *d, size_t l, char *s) short is_quoted = 0; char *dd = d; - if (Debug) - fprintf (stderr, "%s: get_token called for `%s'.\n", Progname, s); - s = skip_ws (s); - if (Debug > 1) - fprintf (stderr, "%s: argumet after skip_ws(): `%s'.\n", Progname, s); - if (!*s) { - if (Debug) - fprintf (stderr, "%s: no more tokens on this line.\n", Progname); return NULL; } if (strchr (single_char_tokens, *s)) { - if (Debug) { - fprintf (stderr, "%s: found single character token `%c'.\n", - Progname, *s); - } d[0] = *s++; d[1] = 0; return s; } if (*s == '"') { - if (Debug) { - fprintf (stderr, "%s: found quote character.\n", Progname); - } - s++; is_quoted = 1; } @@ -370,12 +331,6 @@ static char *get_token (char *d, size_t l, char *s) *d = '\0'; - if (Debug) { - fprintf (stderr, "%s: Got %stoken: `%s'.\n", - Progname, is_quoted ? "quoted " : "", dd); - fprintf (stderr, "%s: Remainder: `%s'.\n", Progname, t); - } - return t; } @@ -472,8 +427,6 @@ static void handle_confline (char *s) return; if (!strcmp (buff, "|")) { - if (Debug) - fprintf (stderr, "%s: Expecting .\n", Progname); /* ignore subtype and comma */ if (!(s = get_token (buff, sizeof (buff), s))) return; @@ -501,15 +454,10 @@ static void handle_confline (char *s) if (!(s = get_token (buff, sizeof (buff), s))) return; - if (Debug) - fprintf (stderr, "%s: Expecting default value.\n", Progname); - /* or UL */ if (!(s = get_token (buff, sizeof (buff), s))) return; if (!strcmp (buff, "UL")) { - if (Debug) - fprintf (stderr, "%s: Skipping UL.\n", Progname); if (!(s = get_token (buff, sizeof (buff), s))) return; } @@ -1229,9 +1177,6 @@ static int handle_docline (char *l, int docstat) l = skip_ws (l); - if (Debug) - fprintf (stderr, "%s: handle_docline `%s'\n", Progname, l); - if (!strncmp (l, ".pp", 3)) return print_it (SP_NEWPAR, NULL, docstat); else if (!strncmp (l, ".ts", 3))