home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / fbm / src / uunet2fb.c < prev   
C/C++ Source or Header  |  1990-06-24  |  1KB  |  47 lines

  1. /*****************************************************************
  2.  * uunet2fbm.c: FBM Release 1.0 25-Feb-90 Michael Mauldin
  3.  *
  4.  * uunet2fbm.c: convert a bitmap to Targa format
  5.  *
  6.  * USAGE
  7.  *      % uunet2fbm [ image ] > image.fbm
  8.  *
  9.  * HISTORY
  10.  * 05-July-89 Dan Sahlin (dan@sics.se) at SICS
  11.  *    Created from a copy of pic2fbm
  12.  *****************************************************************/
  13.  
  14. # include <stdio.h>
  15. # include <math.h>
  16. # include "fbm.h"
  17.  
  18. # define USAGE\
  19. "Usage: uunet2fbm [ image ] > image.fbm"
  20.  
  21. #ifndef lint
  22. static char *fbmid =
  23. "$FBM uunet2fbm.c <1.0> written by Dan Sahlin, source code available \
  24. free from MLM@CS.CMU.EDU and from UUNET archives$";
  25. #endif
  26. main(argc,argv)
  27. int argc; char *argv[];
  28. { FBM image;
  29.  
  30.   /* Clear pointers */
  31.   image.cm = image.bm = (unsigned char *) NULL;
  32.  
  33.   /* Open input if given */
  34.   if (argc > 1)
  35.   { if (freopen (argv[1], "r", stdin) != stdin)
  36.     { perror (argv[1]);
  37.       exit(1);
  38.     }
  39.   }
  40.  
  41.   if (read_uunet (&image, stdin, "", 0) &&
  42.        write_fbm (&image, stdout))
  43.   { exit(0); }
  44.   else
  45.   { exit (1); }
  46. }
  47.