#ifndef __DAVIS_SYSDEP_H__
#define __DAVIS_SYSDEP_H__

#include <stdio.h>
  
#ifdef VMS
#include <ssdef.h>
#include <rmsdef.h>
#include <dvidef.h>
#include <jpidef.h>
#include <libdef.h>
#include <descrip.h>
#include <iodef.h>
#include <ttdef.h>
#include <unixlib.h>
#else
extern char *getenv( char *);
extern int read (int,  char *, int);
extern int unlink( char *);
extern int sleep(unsigned);
#endif  
  
#ifdef VMS
extern unsigned long SHELL_PID;  

extern int do_shell_command();
extern int expand_file_name(char *,char *);
extern char *unix2vms(char *);

#endif /* VMS */

#ifdef VMS
typedef struct {                /* I/O status block     */
        short i_cond;           /* Condition value      */
        short i_xfer;           /* Transfer count     */
        long  i_info;           /* Device information     */
} iosb;
 
typedef struct {                /* Terminal characteristics   */
        char  t_class;          /* Terminal class     */
        char  t_type;           /* Terminal type      */
        short t_width;          /* Terminal width in characters   */
        long  t_mandl;          /* Terminal's mode and length   */
        long  t_extend;         /* Extended terminal characteristics  */
}  termchar;                    

short TTY_CHANNEL_GLOBAL;

#else
#define TTY_DESCR 2
extern int ioctl(int, int, ...);

#ifdef BSD
#include <sgtty.h>
     struct ltchars  OLDTTY_LC;
     struct tchars   OLDTTY_TC;
     struct sgttyb   OLDTTY;
#else
#include <sys/termio.h>
     struct termio OLDTTY;
#endif
#endif /* VMS */

extern int INPUT_BUFFER_LEN;
extern char INPUT_BUFFER[80];

extern void init_tty();
extern void reset_tty();
extern char getkey();
extern void ungetkey(char);
extern void sys_resume();
extern void get_term_dimensions(int *, int *);
extern int sys_delete_file(char *);

extern char *get_time();
#endif /* __DAVIS_SYSDEP_H__ */

