home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / HTMTL090.ZIP / RTF2HTML.C (.txt) < prev    next >
C/C++ Source or Header  |  1995-06-28  |  1KB  |  46 lines

  1. /* rtf2html.c */
  2.  
  3. #include    <stdio.h>
  4. #include    <malloc.h>
  5. #include    <io.h>
  6.  
  7. #include    "rtftohtm.h"
  8.  
  9. //typedef char*   LPSTR;
  10.                      
  11. extern  int main(int argc, LPSTR* argv);
  12.  
  13. /**************************************/
  14.                     
  15. main(int argc, LPSTR* argv){
  16.     char    arg[256];
  17.     char*   ofile;
  18.     long    rc = 0;
  19.     char*   buf;
  20.     unsigned    bl = 20000;
  21.     
  22.     if (argc==1){
  23.         buf = malloc(bl);
  24.         // no arguments: ask user the input filename.
  25.         puts("Give an input filename");
  26.         rc = RTFtoHTM(gets(arg),0,buf,bl);
  27.         puts(buf);
  28.     }    
  29.     else if (argc>2){
  30.         _wsetexit(_WINEXITNOPERSIST);
  31.         // both arguments: do the conversion from file to file.
  32.         rc = RTFtoHTM(argv[1],0,argv[2],0);
  33.         ofile = argv[2];
  34.     }    
  35.     else{
  36.         buf = malloc(bl);
  37.         // one argument: do the conversion from file to buffer.
  38.         // puts the buffer to the screen.
  39.         rc = RTFtoHTM(argv[1],0,buf,bl);
  40.         puts(buf);
  41.     }
  42.     
  43.             
  44.     return 0;
  45. }
  46.