/*
 *				**** TVNOW ****
 *
 * This is the header file for the tvnow extraction program
 */

int split_flds(char *str,char **flds,char delim,int skip,int maxflds);
void wanted_init(void);
void wanted_process(char *fname);
void wanted_done(void);
char *wanted(char *str);
void process_title(char *dest, char *src);
void print_movie(char *flds[], char *title, FILE *fp);
char *get_channel_code(int loc);
char *get_channel_name(int loc);
char *get_channel_num(int loc);
int find_channel(char *code);

/* routines that make a list of unique movie titles */
void init_movie_titles(void);
void add_movie_title(char *flds[], int nflds);
int close_movie_titles(int nchan, char *chans[]);	/* returns number of unique titles */

#define TV_TYPE	1
#define TV_DATE	2
#define TV_TIME	3
#define TV_CHAN	4
#define TV_LEN		5
#define TV_TITLE	7
#define TV_STITLE	9
#define TV_COUNTRY	10
#define TV_YEAR	11
#define TV_STARS  12
#define TV_RATING 13
#define TV_DESC   14
#define TV_DIRECTOR 15
#define TV_GENRE  16
#define TV_ACTOR1 17
#define TV_ACTOR2 18
#define TV_ACTOR3 19
#define TV_ACTOR4 20
#define TV_ACTOR5 21
#define TV_ACTOR6 22

struct Channel {
	char *ch_code;	/* channel code */
	char *ch_name;	/* channel name */
	char *ch_num;	/* channel number */
};

struct Show {
	struct Show *next;	/* pointer to next show */
	char *channel;	/* channel */
	char *date;		/* date of showing */
	char *btime;	/* beginning time */
	char *len;		/* length of show */
};

struct Movie {
	char *title;	/* movie name */
	char *sort;	/* movie sort key */
	char *year;	/* movie year */
	char *desc; /* movie description */
	char *stars; /* movie rating */
	char *actors; /* list of actors */
	struct Show *show; /* when scheduled */
};

