home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / bindings.h < prev    next >
C/C++ Source or Header  |  1990-10-21  |  3KB  |  119 lines

  1. /* bindings.h  -- command bindings */
  2.  
  3. #define MAX_BIND_LEN 20   /* max length a string can be to bind to a command */
  4. #define MAX_MACRO_LEN 256 /* max length of a macro bound to a command */
  5.  
  6. /* to see if a key sequence matches, prefixes or misses a set binding */
  7. #define NO_MATCH    0
  8. #define MATCH        1
  9. #define A_PREFIX_B    2
  10. #define B_PREFIX_A    3
  11.  
  12. /*
  13.  * Constants to define curses mode functions.
  14.  */
  15. #ifdef NULL_MAP
  16. #undef NULL_MAP
  17. #endif /* NULL_MAP */
  18. #define NULL_MAP    (struct cmd_map *)0
  19.  
  20. #define C_ERROR        (-1L)
  21. #define C_NULL        0L
  22. #define C_GOTO_MSG    1L
  23. #define C_WRITE_LIST    2L
  24. #define C_WRITE_MSG    3L
  25. #define C_SAVE_LIST    4L
  26. #define C_SAVE_MSG    5L
  27. #define C_COPY_LIST    6L
  28. #define C_COPY_MSG    7L
  29. #define C_DELETE_LIST    8L
  30. #define C_DELETE_MSG    9L
  31. #define C_UNDEL_LIST    10L
  32. #define C_UNDEL_MSG    11L
  33. #define C_REDRAW    12L
  34. #define C_REVERSE    13L
  35. #define C_NEXT_MSG    14L
  36. #define C_PREV_MSG    15L
  37. #define C_FIRST_MSG    16L
  38. #define C_LAST_MSG    17L
  39. #define C_TOP_PAGE    18L
  40. #define C_BOTTOM_PAGE    19L
  41. #define C_NEXT_SCREEN    20L
  42. #define C_PREV_SCREEN    21L
  43. #define C_SOURCE    22L
  44. #define C_SAVEOPTS    23L
  45. #define C_NEXT_SEARCH    24L
  46. #define C_PREV_SEARCH    25L
  47. #define C_CONT_SEARCH    26L
  48. #define C_PRESERVE    27L
  49. #define C_REV_SORT    28L
  50. #define C_SORT        29L
  51. #define C_QUIT_HARD    30L
  52. #define C_QUIT        31L
  53. #define C_EXIT_HARD    32L
  54. #define C_EXIT        33L
  55. #define C_UPDATE    34L
  56. #define C_FOLDER    35L
  57. #define C_SHELL_ESC    36L
  58. #define C_CURSES_ESC    37L
  59. #define C_PRINT_MSG    38L
  60. #define C_CHDIR        39L
  61. #define C_VAR_SET    40L
  62. #define C_IGNORE    41L
  63. #define C_ALIAS        42L
  64. #define C_OWN_HDR    43L
  65. #define C_VERSION    44L
  66. #define C_MAIL_FLAGS    45L
  67. #define C_MAIL        46L
  68. #define C_REPLY_ALL    47L
  69. #define C_REPLY_SENDER    48L
  70. #define C_DISPLAY_NEXT    49L
  71. #define C_DISPLAY_MSG    50L
  72. #define C_TOP_MSG    51L
  73. #define C_BIND_MACRO    52L
  74. #define C_BIND        53L
  75. #define C_UNBIND    54L
  76. #define C_MAP_BANG    55L
  77. #define C_MAP        56L
  78. #define C_MACRO        57L
  79. #define C_MARK_MSG    58L
  80. #define C_HELP        59L/* THIS MUST BE THE LAST ITEM */
  81.  
  82. struct cmd_map {
  83.     /* long so glob_flags can be saved in mac_stack */
  84.     long m_cmd;   /* the command this is mapped to  */
  85.     char *m_str;  /* the string user types (cbreak) */
  86.     char *x_str;  /* the string executed if a macro */
  87.     struct cmd_map *m_next;
  88. };
  89.  
  90. #ifdef CURSES
  91.  
  92. /*
  93.  * Pointers to the current active command or macro and to the map list.
  94.  *  This ought to be handled by having getcmd() return struct cmd_map *,
  95.  *  but curses_command() depends too heavily on getcmd() returning int.
  96.  */
  97. extern struct cmd_map *active_cmd, *cmd_map;
  98.  
  99. #endif /* CURSES */
  100.  
  101. /* This must be OUTSIDE the #ifdef CURSES -- needed in other modes */
  102. extern struct cmd_map *mac_hide;
  103.  
  104. /*
  105.  * Special bracketing recognized within an executing
  106.  *  macro as surrounding a curses function name
  107.  */
  108. #define MAC_LONG_CMD    '['
  109. #define MAC_LONG_END    ']'
  110. #define MAC_GET_STR    "getstr"
  111. #define MAC_GET_LINE    "getline"
  112. #define MAX_LONG_CMD    32
  113.  
  114. /*
  115.  * External declarations for map and map! purposes
  116.  */
  117. extern char *c_macro();
  118. extern struct cmd_map *line_map, *bang_map;
  119.