Back to index

tetex-bin  3.0
Functions
define_key.c File Reference
#include <curses.priv.h>

Go to the source code of this file.

Functions

 define_key (const char *str, int keycode)

Function Documentation

define_key ( const char *  str,
int  keycode 
)

Definition at line 38 of file define_key.c.

{
    int code = ERR;

    T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode));
    if (keycode > 0) {
       if (str != 0) {
           define_key(str, 0);
       } else if (has_key(keycode)) {
           while (_nc_remove_key(&(SP->_keytry), keycode))
              code = OK;
       }
       if (str != 0) {
           if (key_defined(str) == 0) {
              (void) _nc_add_to_try(&(SP->_keytry), str, keycode);
              code = OK;
           } else {
              code = ERR;
           }
       }
    } else {
       while (_nc_remove_string(&(SP->_keytry), str))
           code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function: