/*********************                                    Michael Campbell
 * File: VEDBASE.INC *                                       06 Jun 85
 *********************/


/* VE common data base: variables shared across all of VE                    */

extern char ve_masthead [];
extern BOOL ve_initializing;   /* Signal to ve parts that it is still init   */
extern BOOL init_help_shown;   /* The initial help message is showing        */

extern WINDOW *ve_win;   /* ncurses window token for ve                      */
extern char divider_char;/* The char used to make up the divider line        */
extern int ve_mode;      /* mode of the editor: either INSERT or OVERWRITE   */
extern int last_ve_mode; /* mode of VE before the last key was entered       */

extern int displayed_mode;

extern int ve_exception; /* exception code from the last command             */
extern char *ve_msg;     /* Message to print when ve_exception = E_OK        */
extern char ve_msg_buf[];     /* Buffer to use to construct dynamic ve_msg's */

extern int MODE_X;       /* X coordinate for VE mode display                 */
extern int MODE_Y;       /* Y coordinate for VE mode display                 */            

extern int ERR_X;        /* X coordinate for error message displays          */
extern int ERR_Y;        /* Y coordinate for error message displays          */

extern int MSG_X;        /* X coordinate for ve_msg message displays         */
extern int MSG_Y;        /* Y coordinate for ve_msg message displays         */

extern int FN_FIELD_WIDTH;   /* Width of the filename display on status line */

extern int rs_reps_left; /* Repititions of state machine for read_char       */
extern int rs_ix;        /* Index within current read state macro            */
extern int read_state;   /* State of read_char state machine                 */

extern int undo_state;   /* Undo state - monitoring changes or undoing them  */

extern int rep_ix;         /* index into the ASCII repitition buffer         */
extern int requested_reps; /* the converted value of the contents of rep_ix  */
extern int curr_rep;       /* this repitition                                */
extern int ext_cmd;        /* Is this an extended command sequence?          */

extern struct stack_type status_stack;   /* Status line stack                */

extern char curr_cmd;    /* The currently entered command key                */
extern char last_cmd;    /* The last executed command key                    */
extern int  last_cmd_ix; /* Index of the last command in table commands[]    */
extern int  last_reps;   /* The repetition count for the last command        */

extern BOOL in_again_cmd_set[NUM_CMDS]; /* Is cmd_idx in set of again cmds?  */
extern BOOL undo_supported[NUM_CMDS];   /* Is undo supported for this cmd?   */

extern int status;               /* general purpose status for func calls    */

extern FILE *curr_conn;          /* connection to the currently editing file */
extern char curr_filename [256]; /* Same size as file_des->filename          */

extern struct file_ctl   curr_file;
extern struct screen_ctl curr_screen;
extern struct option_ctl options;

extern struct file_ctl   line_block;
extern struct file_ctl   line_del_block;
extern struct node       *block_start, *block_end, *block [2];

extern int               curr_line_num;
extern struct node       *curr_line, *new_line;
extern struct node       *cnode,     *pnode,    *nnode;

extern struct node       line_buf;
extern struct node       filename_buf;
extern struct node       temp;

extern struct asc_buf    rep_buf;
extern struct asc_buf    find_buf;
extern struct asc_buf    subs_buf;

/* Global variables for multi-file support */

extern int curr_file_ix;
extern int files_open;

extern struct file_ctl     open_file_list;
extern struct file_des_str *file_des;
extern struct file_des_str *curr_file_des;

extern struct macro_str    *curr_macro;
extern struct file_ctl     macro_list;

extern char *mode_msg [];
extern char *err_msg [];
extern char *prompt_msg [];
extern char *invalid_msg;
extern char *default_ve_msg;
extern char *enter_to_edit_msg;


extern char *select_file_open;
extern char *select_file_read;
extern char *select_file_write;

extern char *no_file_select_open;
extern char *no_file_select_read;
extern char *no_file_select_write;

/* VE command table: Procedures to implement all VE commands are called     */
/* from this table.  This table must agree in order and content with the    */
/* commands table in the file TERMCTL.C                                     */

extern int (*cmd_proc[NUM_CMDS]) ();

