Browse Source

When producing man page from texi: substitute @minus{} within @item

master
Thomas Schmitt 11 years ago
parent
commit
39c3fc6da1
  1. 31
      xorriso/make_xorriso_1.c

31
xorriso/make_xorriso_1.c

@ -3,11 +3,12 @@
( cd xorriso ; cc -g -Wall -o make_xorriso_1 make_xorriso_1.c )
*/
/*
Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1.
Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1
resp. from xorriso/xorrisofs.texi to xorriso/xorrisofs.1
The conversion rules are described at the beginning of xorriso/xorriso.texi
Copyright 2010 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2010 - 2011 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -228,10 +229,20 @@ int Mx1_convert(struct Mx1 *m, char line_in[256], char line_out[256], int flag)
}
strcat(buf, "\\");
}
/* Substitute option text */
raw= strlen(buf);
strcat(buf, word);
ret= Mx1_substitute(m, buf, line_out, raw, 0);
if(ret <= 0)
return(-1);
strcpy(buf, line_out);
strcat(buf, "\\fR");
raw= strlen(buf);
strcat(buf, remainder);
/* Substitute arguments text */
ret= Mx1_substitute(m, buf, line_out, raw, 0);
if(ret <= 0)
return(-1);
@ -271,8 +282,8 @@ int main(int argc, char **argv)
{
int ret, l, as_filter= 0, i;
char line_in[256], line_out[256], *got;
static char name_in[]= {"xorriso/xorriso.texi"};
static char name_out[]= {"xorriso/xorriso.1"};
static char name_in[1024]= {"xorriso/xorriso.texi"};
static char name_out[1024]= {"xorriso/xorriso.1"};
struct Mx1 m;
FILE *fp_in= stdin, *fp_out= stdout;
@ -280,9 +291,10 @@ int main(int argc, char **argv)
if(argc < 2) {
usage:;
fprintf(stderr, "usage: %s -auto|-filter\n", argv[0]);
fprintf(stderr, " -auto xorriso/xorriso.texi -> xorriso/xorriso.1\n");
fprintf(stderr, " -filter stdin -> stdout\n");
fprintf(stderr, "usage: %s -auto|-filter|[-xorrisofs]\n", argv[0]);
fprintf(stderr, " -auto xorriso/xorriso.texi -> xorriso/xorriso.1\n");
fprintf(stderr, " -filter stdin -> stdout\n");
fprintf(stderr, " -xorrisofs process xorriso/xorrisofs.texi\n");
exit(2);
}
for(i= 1; i < argc; i++) {
@ -290,7 +302,10 @@ usage:;
as_filter= 1;
else if(strcmp(argv[i], "-auto") == 0)
as_filter= 0;
else {
else if(strcmp(argv[i], "-xorrisofs") == 0) {
strcpy(name_in, "xorriso/xorrisofs.texi");
strcpy(name_out, "xorriso/xorrisofs.1");
} else {
fprintf(stderr, "%s : unknown option %s\n", argv[0], argv[i]);
goto usage;
}

Loading…
Cancel
Save