home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 45
/
Amiga_Dream_45.iso
/
Amiga
/
Magazine
/
Dossier-LaTeX
/
AmiWeb2C.lha
/
source
/
web2c-6.1
/
web2c
/
mpware
/
mptotex.ch
< prev
next >
Wrap
Text File
|
1995-03-26
|
2KB
|
97 lines
Changes for MPTOTEX.C by Andreas Scherer, March 26, 1995.
@x l.31
#include <stdio.h>
@y
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _AMIGA
const unsigned char Version[] =
"$VER: MPtoTeX 0.60 ("__DATE__", "__TIME__")\n";
#endif
void usage(char *);
void err(char *);
char *getline(void);
int match_str(char *, char *);
int getbta(char *);
void copytex(void);
void do_line(void);
@z
@x l.52
fprintf(stderr, "Usage: %s <mp-file>\n", nam);
@y
#ifdef _AMIGA
fprintf(stderr, "Usage: %s <mp-file> [-E<errlog-file>]\n", nam);
#else /* _AMIGA */
fprintf(stderr, "Usage: %s <mp-file>\n", nam);
#endif /* _AMIGA */
@z
The Amiga CLI doesn't provide the redirection of STDERR like UNIX /bin/sh.
For use of `MPtoTeX' in `makempx.rexx', the standard error channel can be
reopened to the file specified in the third argument after the `-E' option.
There is a BUG in the original version.
@x l.212
void main(argc, argv)
char *argv[];
{
if (argc!=2) usage(argv[0]);
mpname = argv[1];
mpfile = fopen(mpname, "r");
if (mpname==NULL) usage(argv[0]);
printf("%s",predoc);
while (getline()!=NULL)
do_line();
printf("%s",postdoc);
exit(0);
}
@y
#ifdef _AMIGA
void main(argc, argv)
char *argv[];
{
switch(argc) {
case 3:
if (strncmp(argv[2], "-E", 2) || (argv[2]+2 == NULL))
usage(argv[0]);
else
freopen(argv[2]+2, "w", stderr);
/* Fall through. */
case 2:
break; /* Continue. */
default:
usage(argv[0]);
}
mpname = argv[1];
mpfile = fopen(mpname, "r");
if (mpfile==NULL) usage(argv[0]); /* BUG fixed */
printf("%s",predoc);
while (getline()!=NULL)
do_line();
printf("%s",postdoc);
exit(0);
}
#else /* _AMIGA */
void main(argc, argv)
char *argv[];
{
if (argc!=2) usage(argv[0]);
mpname = argv[1];
mpfile = fopen(mpname, "r");
if (mpfile==NULL) usage(argv[0]); /* BUG fixed anyway */
printf("%s",predoc);
while (getline()!=NULL)
do_line();
printf("%s",postdoc);
exit(0);
}
#endif /* _AMIGA */
@z