… | |
… | |
3 | |
3 | |
4 | #ifdef KEYSYM_RESOURCE |
4 | #ifdef KEYSYM_RESOURCE |
5 | |
5 | |
6 | #include <cstring> |
6 | #include <cstring> |
7 | |
7 | |
|
|
8 | #include "rxvtperl.h" |
8 | #include "keyboard.h" |
9 | #include "keyboard.h" |
9 | #include "command.h" |
10 | #include "command.h" |
10 | |
11 | |
11 | /* an intro to the data structure: |
12 | /* an intro to the data structure: |
12 | * |
13 | * |
… | |
… | |
72 | static void |
73 | static void |
73 | output_string (rxvt_term *rt, const char *str) |
74 | output_string (rxvt_term *rt, const char *str) |
74 | { |
75 | { |
75 | if (strncmp (str, "command:", 8) == 0) |
76 | if (strncmp (str, "command:", 8) == 0) |
76 | rt->cmd_write ((unsigned char *)str + 8, strlen (str) - 8); |
77 | rt->cmd_write ((unsigned char *)str + 8, strlen (str) - 8); |
|
|
78 | else if (strncmp (str, "perl:", 5) == 0) |
|
|
79 | PERL_INVOKE((rt, HOOK_KEYBOARD_COMMAND, DT_STRING, str + 5, DT_END)); |
77 | else |
80 | else |
78 | rt->tt_write ((unsigned char *)str, strlen (str)); |
81 | rt->tt_write ((unsigned char *)str, strlen (str)); |
79 | } |
82 | } |
80 | |
83 | |
81 | static void |
84 | static void |
… | |
… | |
115 | } |
118 | } |
116 | |
119 | |
117 | //////////////////////////////////////////////////////////////////////////////// |
120 | //////////////////////////////////////////////////////////////////////////////// |
118 | // return: #bits of '1' |
121 | // return: #bits of '1' |
119 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) |
122 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) |
120 | # define bitcount(n) (__extension__ ({ uint32_t n__ = (n); __builtin_popcount (n); })) |
123 | # define bitcount(n) (__extension__ ({ uint32_t n__ = (n); __builtin_popcount (n__); })) |
121 | #else |
124 | #else |
122 | static int |
125 | static int |
123 | bitcount (uint16_t n) |
126 | bitcount (uint16_t n) |
124 | { |
127 | { |
125 | int i; |
128 | int i; |