shift the last entry in command queue to first */
| 352 | |
| 353 | /* shift the last entry in command queue to first */ |
| 354 | void |
| 355 | cmdq_shift(int q) |
| 356 | { |
| 357 | struct _cmd_queue *tmp = NULL; |
| 358 | struct _cmd_queue *cq = gc.command_queue[q]; |
| 359 | |
| 360 | while (cq && cq->next && cq->next->next) |
| 361 | cq = cq->next; |
| 362 | |
| 363 | if (cq) |
| 364 | tmp = cq->next; |
| 365 | if (tmp) { |
| 366 | tmp->next = gc.command_queue[q]; |
| 367 | gc.command_queue[q] = tmp; |
| 368 | cq->next = NULL; |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | struct _cmd_queue * |
| 373 | cmdq_reverse(struct _cmd_queue *head) |