struct s_color {
  unsigned int red, grn, blu;
};

typedef struct s_color color;

struct s_imageinfo {
  int itis87a;
  int  gct_p; /* GlobalColorTableFlag */
  int  size_gct; /* SizeofGlobalColorTable */
  int  trans_index; /* TransColorIndex */
  unsigned int width, height;
  int interlaced_p;
  color *colortable;
  int   ct_length; /* note that this has NOTHING to do with code tables */

  unsigned char color_res, sort_flag;
  unsigned char  bkg_color_index; /* BackgroundColorIndex */
  unsigned char  pixel_aratio; /* PixelAspectRatio */
};

typedef struct s_imageinfo imageinfo;

#define GET_PIXEL 0
#define TRANS_IMG 1

struct s_what_to_do {
  int   doing;
  int   x, y;
  int   red, grn, blu;
  color *the_color;
  int   answer;
  FILE  *spewout;
};

typedef struct s_what_to_do what_to_do;

int read_gif(FILE *fp_in, what_to_do *directive);

void init_trans_directive(what_to_do *to_do, int r, int g, int b, FILE *fp);
void init_pixel_directive(what_to_do *to_do, int x, int y, color *col);
