home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the DOOM Gurus / TricksOfTheDoomGurus.iso / bonus / linux / dm2ppm / main.c < prev    next >
C/C++ Source or Header  |  1994-07-12  |  385b  |  24 lines

  1.  
  2. #include    <sys/types.h>
  3. #include    <fcntl.h>
  4. #include    <stdio.h>
  5.  
  6. #define DOOM_WAD    "doom.wad"
  7.  
  8. main(int argc, char *argv[])
  9. {
  10.     int fd;
  11.  
  12.     if ( (fd=open(DOOM_WAD, O_RDONLY, 0)) < 0 ) {
  13.         perror(DOOM_WAD);
  14.         exit(2);
  15.     }
  16.     if ( argc != 2 ) {
  17.         fprintf(stderr, "Usage: %s picname\n", argv[0]);
  18.         exit(1);
  19.     }
  20.     if ( convert_rawpic(fd, argv[1]) < 0 )
  21.         exit(2);
  22.     exit(0);
  23. }
  24.