#include <stdio.h>

#ifndef GW_H
#define GW_H

#define FX  1
#define E_NO_INDEX 1
#define FXI 2
#define E_INDEXED  2
#define FXT 3
#define E_TIME_INDEXED  3
#define E_TIME_INDEX  3
#define E_TIME_INDEXED_ADD_POINTS  7
#define FXT_ADD_POINTS 7
#define FXM 0
#define SURFACE 6
#define E_SURFACE_NOT_FOUND -6
#define XY 5
#define E_XY  5
#define DATA_TABLE  8
#define E_DATA_TABLE 8
#define E_TABLE_NOT_FOUND -8
#define AUTOMATIC 0
#define ALGEBRAIC 1
#define SCIENTIFIC 2
#define E_LINEAR  3
#define E_LOGARITHMIC  4
#define E_FAIL  -1
#define E_SUCCESS  1
#define E_GRAPH_NOT_FOUND -2
#define E_ALLOCATE_FAIL -10
#define	E_TRUE 1
#define E_FALSE 0

#define COMMAND_END 10
#define DATASET_ADD_POINTS 70

extern void E_PrintGraphWindows();

extern void E_PrintGraphWindow(
   struct GraphWindow *gw
);

extern void E_PrintFxDatasets();

extern void E_PrintFxDataset(
   struct FxDataset *d
);

extern void E_writeHandle(
   int sockfd
);

extern struct GraphWindow *E_GetGraphWindow(
   char *name
);

extern struct FxDataset *E_GetFxDatasetID(
   int  id
);

extern struct FxyDataset *E_GetFxyDataset(
   char *name
);

extern void E_FreeLabels();
extern void E_FreeFxDatasets();
extern void E_FreeFxyDatasets();
extern void E_FreeGraphs();
extern void E_FreeGraphWindows();
extern void E_Free();
extern void E_Strcat(
  char *first,
  char *second,
  char **cat);

extern int E_FxDatasetDisplay(
   char *windowName,
   char *graphName,
   struct FxDataset *dataset
);
                                                                                                 
extern int E_FxtDatasetDisplay(
   char *windowName,
   char *graphName,
   struct FxDataset *dataset
);
                                                                                                 
extern int E_FxtDatasetDisplayID(
   char *windowName,
   char *graphName,
   int id
);

extern void e_close(
	int f
);

extern FILE* fileCreate(
	char *filename
);

extern FILE* fileOpen(
	char *filename
);

extern int fileClose(
	char *filename
);

extern void xmlFixString(
	char *s
);

extern void xmlInsert(
	int start,
	char *s
);
#endif
