/*
 * Copyright 1988, 1989, 1990, 1991 Massachusetts Institute of Technology
 */
#ifndef EXTERNS_H
#define EXTERNS_H

#ifdef MAINFILE

RPD_ptr players[30];
/* RPD_ptr rpd; */
SWTR_ptr switchers[30];
INPUT_ptr inputs[30];
MOUNT_TABLE mtbl;
DeviceList *volumes = NULL;

/* Statistics */
int revision = 0, num_requests = 0, start_time = 0, num_collisions = 0,
  num_connections = 0, max_connections = 0, delayed_requests = 0;
#ifdef OBSOLETE
int starts = 0;
#endif /* OBSOLETE */
int realswitcher[30];
int need_to_rebuild_list = 0, run_state = 0;
char configfile[1024];
Forward *remote_servers;
Server **servs;
int sync_mode = SYNC_MODE;

Client clients[MAXSOCKETS];

fd_set allavail, lockavail;
int h_errno, errno, sock, num_players = 0, num_switchers = 0, 
  num_volumes = 0, num_inputs = 0, cur_volume_l = 0, 
  cur_volume_r = 0, cur_volume_v = 0, whichlock, 
  notice_socket, num_forwards = 0;
#ifdef FORKLOCK
int timer_pid;
#endif /* FORKLOCK */
#ifdef UNIXCONN
int unix_sock;
#ifdef SERVER_REVISION /* == 24 */
int old_unix_sock;
#endif /* SERVER_REVISION == 24 */
#endif /* UNIXCONN */
char **notify_list, localaddress[64];
struct hostent *lhp;
struct sockaddr_in notice;

short DEBUG = 0, RESTRICT = 0, ANSWER = 1, LOCKED = 0, SPINUP = 0;
VCONF_DEVTABLE vdt;

#else /* MAINFILE */

extern RPD_ptr players[];
/*extern RPD_ptr rpd;*/
extern SWTR_ptr switchers[];
extern INPUT_ptr inputs[];
extern MOUNT_TABLE mtbl;
extern DeviceList *volumes;

/* Statistics */
extern int revision, num_requests, start_time, num_collisions,
  num_connections, max_connections, delayed_requests;
#ifdef OBSOLETE
extern int starts;
#endif /* OBSOLETE */
extern int realswitcher[];
extern int need_to_rebuild_list, run_state;
extern char configfile[];
extern Forward *remote_servers;
extern Server **servs;
extern int sync_mode;

extern Client clients[];

extern fd_set allavail, lockavail;
extern int h_errno, errno, sock, num_players, num_switchers, 
  num_volumes, num_inputs, cur_volume_l, 
  cur_volume_r, cur_volume_v, whichlock, 
  notice_socket, num_forwards;
#ifdef FORKLOCK
extern int timer_pid;
#endif /* FORKLOCK */
#ifdef UNIXCONN
extern int unix_sock;
#ifdef SERVER_REVISION /* == 24 */
extern int old_unix_sock;
#endif /* SERVER_REVISION == 24 */
#endif /* UNIXCONN */
extern char **notify_list, localaddress[];
extern struct hostent *lhp;
extern struct sockaddr_in notice;

extern short DEBUG, RESTRICT, ANSWER, LOCKED, SPINUP;
extern VCONF_DEVTABLE vdt;
#endif /* MAINFILE */

extern Output volumeoutput();
extern int dienow();
extern char *strchr();
extern char *getenv();
extern int sigrebuild();
extern int unlock_self();
extern int handle_fatal();
extern char *calloc();
extern int (*vconf_find_set_func())();
extern int errno, sys_nerr;
extern char *sys_errlist[];
#endif /* EXTERNS_H */







