#ifndef __MAIN_H__
#define __MAIN_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
  char *RomFile;
  char *RamFile;
  char *ScratchFile;
  char *Debugging;
  char *DebugArgs;
  unsigned Serial;
  char *SerialPort;
  unsigned RamSize;
  unsigned PrivateColormap;
  unsigned MemVersion;
  unsigned ResetPilot;
  unsigned NoCheck;
  unsigned DoublePixels;
  unsigned MagFactor;
  char *DataDir;
  int argc;
  char **argv;

  /* ipc variables */
  int shmid;          /* share mem id */
  int serial_pipefd[2];
  int gdb_pipefd[2];
#define serial_in     serial_pipefd[0]        /* read from this fd */
#define serial_out    serial_pipefd[1]        /* write to this fd */
#define gdb_in                gdb_pipefd[0]           /* read from this fd */
#define gdb_out               gdb_pipefd[1]           /* write to this fd */
 
  /* thread variables */
  int threads;        /* number of threads created */
} Pilot;

int init(Pilot *pilot);
void expand_tilde(char **string);

#ifdef __cplusplus
}
#endif

#endif
