add integer to the command queue */
| 332 | |
| 333 | /* add integer to the command queue */ |
| 334 | void |
| 335 | cmdq_add_int(int q, int val) |
| 336 | { |
| 337 | struct _cmd_queue *tmp = (struct _cmd_queue *) alloc(sizeof *tmp); |
| 338 | struct _cmd_queue *cq = gc.command_queue[q]; |
| 339 | |
| 340 | tmp->typ = CMDQ_INT; |
| 341 | tmp->intval = val; |
| 342 | tmp->next = NULL; |
| 343 | |
| 344 | while (cq && cq->next) |
| 345 | cq = cq->next; |
| 346 | |
| 347 | if (cq) |
| 348 | cq->next = tmp; |
| 349 | else |
| 350 | gc.command_queue[q] = tmp; |
| 351 | } |
| 352 | |
| 353 | /* shift the last entry in command queue to first */ |
| 354 | void |