home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1995 May
/
cica_0595_4.zip
/
cica_0595_4
/
WINWORD
/
HTMTL050
/
RTF2HTML.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-07
|
985b
|
43 lines
/* rtf2html.c */
#include <stdio.h>
#include <malloc.h>
#include <io.h>
#include "rtftohtm.h"
/**************************************/
main(int argc, char* argv[]){
char arg[256];
char* ofile;
int 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);
}
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;
}