#include <stdio.h>

extern int command_stack;
extern int commands;
extern char **commandline;


extern int s;		/* server socket */
extern FILE *out;	/* current redirection */
extern FILE *log;	/* log file */
extern char mode;  /* current prompt mode.  Correct only if commands==0. */
extern int verbose;  /* whether to spit out all the messages or not */


/* global routines in lafe */

extern char *expand_tilde(char *path);
extern char *expand_alias(char *);
extern char *getvar(char *);
extern void putvar(char *,char *);
extern char *expand_variables(char *);
extern void parse_command(char *);
extern void queue_command(char *);

/* local commands */
extern void clearvar(char *);
extern void setvar(char *);
extern void history(char *);
extern void alias(char *);
extern void execute(char *);
extern void runfeed(char *);
extern void shell(char *);
extern void help(char *);
extern void addgame(char *);
extern void verbosity(char *);
extern void waitsync(char *);

/* game database */
struct game {
  char *name;
  char *country;
  char *password;
  char *host;
  char *port;
  char *logfile;
  char *directory;
};

extern int games;
extern struct game *game;

/* global routine in game.c */
int lookup_game(char *);
