MCPcopy Index your code
hub / github.com/NetHack/NetHack / cmdq_add_key

Function cmdq_add_key

src/cmd.c:273–290  ·  view source on GitHub ↗

add a key to the command queue */

Source from the content-addressed store, hash-verified

271
272/* add a key to the command queue */
273void
274cmdq_add_key(int q, char key)
275{
276 struct _cmd_queue *tmp = (struct _cmd_queue *) alloc(sizeof *tmp);
277 struct _cmd_queue *cq = gc.command_queue[q];
278
279 tmp->typ = CMDQ_KEY;
280 tmp->key = key;
281 tmp->next = NULL;
282
283 while (cq && cq->next)
284 cq = cq->next;
285
286 if (cq)
287 cq->next = tmp;
288 else
289 gc.command_queue[q] = tmp;
290}
291
292/* add a direction to the command queue */
293void

Callers 15

allmain.cFile · 0.85
itemactions_pushkeysFunction · 0.85
nhl_pushkeyFunction · 0.85
use_pick_axeFunction · 0.85
dofireFunction · 0.85
getobjFunction · 0.85
docastFunction · 0.85
dorubFunction · 0.85
use_whipFunction · 0.85
use_poleFunction · 0.85
use_grappleFunction · 0.85
getdirFunction · 0.85

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected