/* xwdtohdf.c */

#include <stdio.h>

char *readxwd();
char *pgm;

main(argc,argv)
	int argc;
	char *argv[];
{
  char *image;
  char pal[768], *input_file, *output_file;
  int x,y,palsize,pad;
/* parse command line */
  pgm = argv[0];
  if (argc < 3)
    usage();

  input_file = argv[1];
  output_file = argv[2];
  
  if (argc > 3)			/* Options */
    {
    }

/* read XWD file */
  image = readxwd(input_file,pal,&palsize,&x,&y);

/* write HDF file */
  writehdf(output_file,pal,palsize,image,x,y);

}

usage()
{
  fprintf(stderr,"Usage:\n");
  fprintf(stderr,"      %s infile outfile [-options] \n",pgm);
  fprintf(stderr,"      outfile MUST be present, infile may be stdin (use -)\n");
}
