summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
339dabd)
add \fT for typewriter font (for PS and HTML output) (much more option documentation cleanup to come for that)
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@241
e385b8ad-14ed-0310-8656-
cc95a2468c6d
- \fB switches to boldface
- \fB switches to boldface
+ - \fT switches to typewriter (only for SGML and ignored otherwise)
+
- \fP switches to normal display
- \(as can be used to represent an asterisk (*). This is intended
- \fP switches to normal display
- \(as can be used to represent an asterisk (*). This is intended
#define D_NL (1 << 0)
#define D_EM (1 << 1)
#define D_BF (1 << 2)
#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,
enum {
SP_START_EM,
SP_START_BF,
SP_END_FT,
SP_NEWLINE,
SP_NEWPAR,
SP_END_FT,
SP_NEWLINE,
SP_NEWPAR,
outbuf[outcount - 1].descr = NULL;
}
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);
{
size_t lnew = STRLEN (s), lold = STRLEN (outbuf[outcount - 1].descr);
char buf[2] = "\0\0";
buf[0] = c;
char buf[2] = "\0\0";
buf[0] = c;
}
static void makedoc (FILE * in, FILE * out)
}
static void makedoc (FILE * in, FILE * out)
char buff[16];
char_to_escape (buff, c);
char buff[16];
char_to_escape (buff, c);
}
static void conf_print_strval (const char *v)
}
static void conf_print_strval (const char *v)
- return add ("$");
+ return add_s ("$");
- return add ("_");
+ return add_s ("_");
- return add ("%");
+ return add_s ("%");
+ return add_s ("&");
+ return add_s ("\");
- return add ("&dquot;");
+ return add_s ("&dquot;");
+ return add_s ("[");
+ return add_s ("]");
- return add ("˜");
+ return add_s ("˜");
default:
return add_c (c);
}
default:
return add_c (c);
}
{
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) {
- add ("\n# set ");
- add (varname);
- add ("\"");
+ add_s ("\n# set ");
+ add_s (varname);
+ add_s ("\"");
}
else if (type != DT_SYN) {
}
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) {
if (type == DT_STR || type == DT_RX || type == DT_ADDR
|| type == DT_PATH) {
- add ("\n# Default: \"");
+ add_s ("\n# Default: \"");
- add ("\n# Default: ");
- add (val);
+ add_s ("\n# Default: ");
+ add_s (val);
break;
}
/* manual page */
case F_MAN:
{
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_c ('\n');
if (type == DT_STR || type == DT_RX || type == DT_ADDR
|| type == DT_PATH) {
- add ("Default: \\(lq");
+ add_s ("Default: \\(lq");
- add ("Default: ");
- add (val);
+ add_s ("Default: ");
+ add_s (val);
/* SGML based manual */
case F_SGML:
{
/* SGML based manual */
case F_SGML:
{
- add ("<label id=\"");
- add (varname);
- add ("\">");
- add ("\n<p>\nType: <tt>");
- add (type2human (type));
- add ("</tt>\n\n");
+ add_s ("<label id=\"");
+ add_s (varname);
+ add_s ("\">");
+ add_s ("\n<p>\nType: <tt>");
+ add_s (type2human (type));
+ add_s ("</tt>\n\n");
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) {
- add ("<p>\nDefault: <tt>&dquot;");
+ add_s ("<p>\nDefault: <tt>&dquot;");
+ add_s ("&dquot;</tt>");
- add ("<p>\nDefault: <tt>");
- add (val);
- add ("</tt>");
+ add_s ("<p>\nDefault: <tt>");
+ add_s (val);
+ add_s ("</tt>");
if (docstat & (D_DL))
docstat = print_it (SP_END_DL, NULL, docstat);
if (docstat & (D_DL))
docstat = print_it (SP_END_DL, NULL, docstat);
- if (docstat & (D_EM | D_BF))
+ if (docstat & (D_EM | D_BF | D_TT))
docstat = print_it (SP_END_FT, NULL, docstat);
docstat = print_it (SP_NEWLINE, NULL, 0);
docstat = print_it (SP_END_FT, NULL, docstat);
docstat = print_it (SP_NEWLINE, NULL, 0);
static int Continuation = 0;
case SP_END_FT:
static int Continuation = 0;
case SP_END_FT:
- docstat &= ~(D_EM | D_BF);
+ docstat &= ~(D_EM | D_BF | D_TT);
break;
case SP_START_BF:
docstat |= D_BF;
break;
case SP_START_BF:
docstat |= D_BF;
case SP_START_EM:
docstat |= D_EM;
break;
case SP_START_EM:
docstat |= D_EM;
break;
+ case SP_START_TT:
+ docstat |= D_TT;
+ break;
case SP_NEWLINE:
{
if (onl)
docstat |= onl;
else {
case SP_NEWLINE:
{
if (onl)
docstat |= onl;
else {
docstat |= D_NL;
}
if (docstat & D_DL)
docstat |= D_NL;
}
if (docstat & D_DL)
- add ("\n# ");
- add ("\n# ");
+ add_s ("\n# ");
+ add_s ("\n# ");
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
if (!onl)
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
if (!onl)
docstat |= D_TAB;
break;
}
docstat |= D_TAB;
break;
}
{
if (Continuation) {
Continuation = 0;
{
if (Continuation) {
Continuation = 0;
if (docstat & D_DT) {
int i;
if (docstat & D_DT) {
int i;
switch (special) {
case SP_END_FT:
{
switch (special) {
case SP_END_FT:
{
docstat &= ~(D_EM | D_BF);
break;
}
case SP_START_BF:
{
docstat &= ~(D_EM | D_BF);
break;
}
case SP_START_BF:
{
docstat |= D_BF;
docstat &= ~D_EM;
break;
}
case SP_START_EM:
{
docstat |= D_BF;
docstat &= ~D_EM;
break;
}
case SP_START_EM:
{
docstat |= D_EM;
docstat &= ~D_BF;
break;
}
docstat |= D_EM;
docstat &= ~D_BF;
break;
}
+ case SP_START_TT:
+ {
+ docstat |= D_TT;
+ break;
+ }
case SP_NEWLINE:
{
if (onl)
case SP_NEWLINE:
{
if (onl)
if (!(onl & D_NL))
add_c ('\n');
if (!(onl & D_NL))
add_c ('\n');
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
- add ("\n.IP\n.DS\n.sp\n.ft CR\n.nf\n");
+ add_s ("\n.IP\n.DS\n.sp\n.ft CR\n.nf\n");
docstat |= D_TAB | D_NL;
break;
}
case SP_END_TAB:
{
docstat |= D_TAB | D_NL;
break;
}
case SP_END_TAB:
{
- add ("\n.fi\n.ec\n.ft P\n.sp\n");
+ add_s ("\n.fi\n.ec\n.ft P\n.sp\n");
docstat &= ~D_TAB;
docstat |= D_NL;
break;
}
case SP_START_DL:
{
docstat &= ~D_TAB;
docstat |= D_NL;
break;
}
case SP_START_DL:
{
docstat |= D_DL;
break;
}
case SP_DT:
{
docstat |= D_DL;
break;
}
case SP_DT:
{
break;
}
case SP_END_DL:
{
break;
}
case SP_END_DL:
{
docstat &= ~D_DL;
break;
}
docstat &= ~D_DL;
break;
}
while (*str) {
for (; *str; str++) {
if (*str == '"')
while (*str) {
for (; *str; str++) {
if (*str == '"')
else if (!strncmp (str, "``", 2)) {
else if (!strncmp (str, "``", 2)) {
str++;
}
else if (!strncmp (str, "''", 2)) {
str++;
}
else if (!strncmp (str, "''", 2)) {
case SP_END_FT:
{
if (docstat & D_EM)
case SP_END_FT:
{
if (docstat & D_EM)
- add ("</bf>");
- docstat &= ~(D_EM | D_BF);
+ add_s ("</bf>");
+ if (docstat & D_TT)
+ add_s ("</tt>");
+ docstat &= ~(D_EM | D_BF | D_TT);
break;
}
case SP_START_BF:
{
break;
}
case SP_START_BF:
{
+ docstat &= ~(D_EM | D_TT);
break;
}
case SP_START_EM:
{
break;
}
case SP_START_EM:
{
+ docstat &= ~(D_BF | D_TT);
+ break;
+ }
+ case SP_START_TT:
+ {
+ add_s ("<tt>");
+ docstat |= D_TT;
+ docstat &= ~(D_EM | D_BF);
break;
}
case SP_NEWLINE:
break;
}
case SP_NEWLINE:
if (onl)
docstat |= onl;
else {
if (onl)
docstat |= onl;
else {
docstat |= D_NL;
}
break;
docstat |= D_NL;
}
break;
- add ("\n");
- add ("\n<p>\n");
+ add_s ("\n");
+ add_s ("\n<p>\n");
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
docstat |= D_NP;
break;
}
case SP_START_TAB:
{
- add ("\n<tscreen><verb>\n");
+ add_s ("\n<tscreen><verb>\n");
docstat |= D_TAB | D_NL;
break;
}
case SP_END_TAB:
{
docstat |= D_TAB | D_NL;
break;
}
case SP_END_TAB:
{
- add ("\n</verb></tscreen>");
+ add_s ("\n</verb></tscreen>");
docstat &= ~D_TAB;
docstat |= D_NL;
break;
}
case SP_START_DL:
{
docstat &= ~D_TAB;
docstat |= D_NL;
break;
}
case SP_START_DL:
{
+ add_s ("\n<descrip>\n");
docstat |= D_DL;
break;
}
case SP_DT:
{
docstat |= D_DL;
break;
}
case SP_DT:
{
break;
}
case SP_END_DL:
{
break;
}
case SP_END_DL:
{
+ add_s ("</descrip>\n");
docstat &= ~D_DL;
break;
}
case SP_STR:
{
if (docstat & D_TAB)
docstat &= ~D_DL;
break;
}
case SP_STR:
{
if (docstat & D_TAB)
else
sgml_fputs (str);
break;
else
sgml_fputs (str);
break;
case F_MAN:
if (output_dollar)
add_c ('$');
case F_MAN:
if (output_dollar)
add_c ('$');
- add ("<ref id=\"");
- add (ref);
- add ("\" name=\"");
+ add_s ("<ref id=\"");
+ add_s (ref);
+ add_s ("\" name=\"");
docstat = print_it (SP_START_BF, NULL, docstat);
s += 2;
}
docstat = print_it (SP_START_BF, NULL, docstat);
s += 2;
}
+ else if (!strncmp (s, "\\fT", 3)) {
+ docstat = commit_buff (buff, &d, docstat);
+ docstat = print_it (SP_START_TT, NULL, docstat);
+ s += 2;
+ }
else if (!strncmp (s, "\\fP", 3)) {
docstat = commit_buff (buff, &d, docstat);
docstat = print_it (SP_END_FT, NULL, docstat);
else if (!strncmp (s, "\\fP", 3)) {
docstat = commit_buff (buff, &d, docstat);
docstat = print_it (SP_END_FT, NULL, docstat);