X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=makedoc.c;h=279168bf23cafe5279d1878f1a82adf6a57c19a1;hp=42dcc601297c86eae180073c0b18640608e93ae5;hb=f0d5ecf432102dc3e6430ceb2a6c692ee856f4d4;hpb=c3e57678c8be193fc137854020f3a90887be97c9 diff --git a/makedoc.c b/makedoc.c index 42dcc60..279168b 100644 --- a/makedoc.c +++ b/makedoc.c @@ -2,6 +2,9 @@ * Copyright notice from original mutt: * Copyright (C) 1999-2000 Thomas Roessler * + * Parts were written/modified by: + * Rocco Rutte + * * This file is part of mutt-ng, see http://www.muttng.org/. * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. @@ -73,15 +76,17 @@ enum output_formats_t { #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_TT (1 << 3) +#define D_TAB (1 << 4) +#define D_NP (1 << 5) +#define D_INIT (1 << 6) +#define D_DL (1 << 7) +#define D_DT (1 << 8) enum { SP_START_EM, SP_START_BF, + SP_START_TT, SP_END_FT, SP_NEWLINE, SP_NEWPAR, @@ -185,7 +190,7 @@ static void add_var (const char *name) outbuf[outcount - 1].descr = NULL; } -static int add (const char *s) +static int add_s (const char *s) { size_t lnew = STRLEN (s), lold = STRLEN (outbuf[outcount - 1].descr); @@ -212,7 +217,7 @@ static int add_c (int c) char buf[2] = "\0\0"; buf[0] = c; - return (add (buf)); + return (add_s (buf)); } static void makedoc (FILE * in, FILE * out) @@ -601,7 +606,7 @@ static void conf_char_to_escape (unsigned int c) char buff[16]; char_to_escape (buff, c); - add (buff); + add_s (buff); } static void conf_print_strval (const char *v) @@ -628,9 +633,9 @@ static void man_print_strval (const char *v) } if (*v == '"') - add ("\\(rq"); + add_s ("\\(rq"); else if (*v == '\\') - add ("\\\\"); + add_s ("\\\\"); else add_c (*v); } @@ -654,27 +659,27 @@ static int sgml_fputc (int c) { switch (c) { case '<': - return add ("<"); + return add_s ("<"); case '>': - return add (">"); + return add_s (">"); case '$': - return add ("$"); + return add_s ("$"); case '_': - return add ("_"); + return add_s ("_"); case '%': - return add ("%"); + return add_s ("%"); case '&': - return add ("&"); + return add_s ("&"); case '\\': - return add ("\"); + return add_s ("\"); case '"': - return add ("&dquot;"); + return add_s ("&dquot;"); case '[': - return add ("["); + return add_s ("["); case ']': - return add ("]"); + return add_s ("]"); case '~': - return add ("˜"); + return add_s ("˜"); default: return add_c (c); } @@ -700,59 +705,59 @@ static void print_confline (const char *varname, int type, const char *val) { if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH) { - add ("\n# set "); - add (varname); - add ("\""); + add_s ("\n# set "); + add_s (varname); + add_s ("=\""); conf_print_strval (val); - add ("\""); + add_s ("\""); } else if (type != DT_SYN) { - add ("\n# set "); - add (varname); - add ("="); - add (val); + add_s ("\n# set "); + add_s (varname); + add_s ("="); + add_s (val); } - add ("\n#\n# Name: "); - add (varname); - add ("\n# Type: "); - add (type2human (type)); + add_s ("\n#\n# Name: "); + add_s (varname); + add_s ("\n# Type: "); + add_s (type2human (type)); if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH) { - add ("\n# Default: \""); + add_s ("\n# Default: \""); conf_print_strval (val); - add ("\""); + add_s ("\""); } else { - add ("\n# Default: "); - add (val); + add_s ("\n# Default: "); + add_s (val); } - add ("\n# "); + add_s ("\n# "); break; } /* manual page */ case F_MAN: { - add (".TP\n.B "); - add (varname); - add ("\n.nf\n"); - add ("Type: "); - add (type2human (type)); + add_s (".TP\n.B "); + add_s (varname); + add_s ("\n.nf\n"); + add_s ("Type: "); + add_s (type2human (type)); add_c ('\n'); if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH) { - add ("Default: \\(lq"); + add_s ("Default: \\(lq"); man_print_strval (val); - add ("\\(rq\n"); + add_s ("\\(rq\n"); } else { - add ("Default: "); - add (val); + add_s ("Default: "); + add_s (val); add_c ('\n'); } - add (".fi"); + add_s (".fi"); break; } @@ -760,25 +765,25 @@ static void print_confline (const char *varname, int type, const char *val) /* SGML based manual */ case F_SGML: { - add ("\n"); + add_s ("\n"); sgml_fputs (varname); - add ("