home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computerworld 1996 March
/
Computerworld_1996-03_cd.bin
/
idg_cd3
/
utility
/
htmtl090
/
rtf2html.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-19
|
1KB
|
46 lines
/* rtf2html.c */
#include <stdio.h>
#include <malloc.h>
#include <io.h>
#include "rtftohtm.h"
//typedef char* LPSTR;
extern int main(int argc, LPSTR* argv);
/**************************************/
main(int argc, LPSTR* argv){
char arg[256];
char* ofile;
long rc = 0;
char* buf;
unsigned bl = 20000;
if (argc==1){
buf = malloc(bl);
// no arguments: ask user the input filename.
puts("Give an input filename");
rc = RTFtoHTM(gets(arg),0,buf,bl);
puts(buf);
}
else if (argc>2){
_wsetexit(_WINEXITNOPERSIST);
// both arguments: do the conversion from file to file.
rc = RTFtoHTM(argv[1],0,argv[2],0);
ofile = argv[2];
}
else{
buf = malloc(bl);
// one argument: do the conversion from file to buffer.
// puts the buffer to the screen.
rc = RTFtoHTM(argv[1],0,buf,bl);
puts(buf);
}
return 0;
}