/* Header for module NEWKBD, generated by p2c */
#ifndef NEWKBD_H
#define NEWKBD_H



#ifndef SYSGLOBALS_H
#include <p2c/sysglobals.h>
#endif

#ifndef SYSDEVS_H
#include <p2c/sysdevs.h>
#endif

#ifndef ASM_H
#include <p2c/asm.h>
#endif

#ifndef MISC_H
#include <p2c/misc.h>
#endif



#ifdef NEWKBD_G
# define vextern
#else
# define vextern extern
#endif



#define nk_newkbddatestamp "Version of Jan 15, 1985 6:12 pm"



typedef CRTWORD nk_scrtype[];



/*caged stuff has been removed*/

typedef Char nk_progkeys[20][72];



#define nk_keylow       (-2)
#define nk_keyhigh      125
#define nk_keyshift     1
#define nk_keyctrl      2
#define nk_keyext1      4
#define nk_keymodlow    0
#define nk_keymodhigh   (nk_keyshift + nk_keyctrl)
#define nk_kknone       0
#define nk_kknormal     1
#define nk_kkesc        2
#define nk_kkprog       3
#define nk_kkcmd        4
#define nk_kkproc       5
#define nk_ktcurrent    0
#define nk_ktstandard   1
#define nk_ktcaged      2
#define nk_ktsupplied   (-1)



typedef struct nk_keyinforec {
    uchar k, c;
} nk_keyinforec;

typedef nk_keyinforec nk_keyinfovector[nk_keymodhigh - nk_keymodlow + 1];

typedef nk_keyinfovector nk_keymatrix[nk_keyhigh - nk_keylow + 1];

typedef uchar nk_keycapsvector[(nk_keyhigh - nk_keylow + 8) / 8];

typedef struct nk_keytransinfo {
    nk_keymatrix matrix;
    nk_keycapsvector caps;
    short rpgbufsize;
} nk_keytransinfo;



typedef struct nk_userkeyrec {
    struct nk_userkeyrec *next;
    _PROCEDURE proc;
    uchar kn, km;
    short special;
} nk_userkeyrec;



typedef struct nk_remap_info {
    short rnum, rmod;
    nk_keyinforec rinfo;
} nk_remap_info;

typedef nk_remap_info nk_remap_array[];



vextern Char nk_error_fid[fidleng + 1];
vextern CRTWORD *nk_screen;
#define nk_screenhigh        nc_highlight
#define nk_screenwidth       (80)
/*  vextern short nk_screenwidth, nk_screenhigh;  */
vextern Char (*nk_k0k9)[72];
vextern boolean nk_capslock;



extern Void nk_lockkeyboard PV();
extern Void nk_unlockkeyboard PV();
#define nk_keybufsize m_pollkbd
/*  extern long nk_keybufsize PV();  */
extern long nk_keybuffree PV();
extern long nk_keybufmax PV();
extern Void nk_keybufclear PV();
extern Void nk_keylastclear PV();
#define nk_getkey m_inkey
/*  extern Char nk_getkey PV();  */
extern Void nk_ungetkey PP((int c));
extern Void nk_addkey PP((int c));
#define nk_testkey(x)        m_testkey()
/*  extern Char nk_testkey PP((int whichkey));  */
extern Void nk_getstr PP((Char *s));
extern Void nk_getstruntil PP((int c, Char *s));
extern Void nk_ungetstr PP((Char *s));
extern Void nk_addstr PP((Char *s));
#define nk_gotoxy(x,y)      nc_gotoXY(x,y)
#define nk_getxy(x,y)       nc_getXY(x,y)
/*  extern Void nk_gotoxy PP((int x, int y));  */
/*  extern Void nk_getxy PP((long *x, long *y));  */
extern Void nk_crtwritestr PP((int x, int y, Char *s, int field));
extern Void nk_crtreadstr PP((int x, int y, Char *s));
extern Void nk_getcomperr PP((long errnum, Char *errstr));
#define nk_setrpgbufsize(x)     0
/*  extern short nk_setrpgbufsize PP((int newsize));  */
extern boolean nk_setcapslock PP((int newcaps));
extern Void nk_settransarray PP((int opcode, nk_keytransinfo **table));
extern Void nk_set_trans_array PP((int opcode, int rpgbuf,
				   nk_keytransinfo **table));
extern Void nk_adduserkey PP((int perm, int keynum, int keymod,
			      _PROCEDURE proc, nk_userkeyrec *ukr));
extern Void nk_deluserkey PP((nk_userkeyrec *ukr));
extern Void nk_restoreuserkeys PV();
extern Void nk_remap PP((int numkeys, nk_remap_info *newdefs));
extern Void nk_unmap PP((int numkeys, nk_remap_info *newdefs));
extern Void nk_newkbdinstall PV();
extern Void nk_newkbdremove PV();



#undef vextern

#endif /*NEWKBD_H*/

/* End. */

