add extended command function to the command queue */
| 251 | |
| 252 | /* add extended command function to the command queue */ |
| 253 | void |
| 254 | cmdq_add_ec(int q, int (*fn)(void)) |
| 255 | { |
| 256 | struct _cmd_queue *tmp = (struct _cmd_queue *) alloc(sizeof *tmp); |
| 257 | struct _cmd_queue *cq = gc.command_queue[q]; |
| 258 | |
| 259 | tmp->typ = CMDQ_EXTCMD; |
| 260 | tmp->ec_entry = ext_func_tab_from_func(fn); |
| 261 | tmp->next = NULL; |
| 262 | |
| 263 | while (cq && cq->next) |
| 264 | cq = cq->next; |
| 265 | |
| 266 | if (cq) |
| 267 | cq->next = tmp; |
| 268 | else |
| 269 | gc.command_queue[q] = tmp; |
| 270 | } |
| 271 | |
| 272 | /* add a key to the command queue */ |
| 273 | void |
no test coverage detected