return port where idc was previously plugged if any and forgot it.
| 587 | |
| 588 | // return port where idc was previously plugged if any and forgot it. |
| 589 | static int inputdevice_get_unplugged_device(struct inputdevconfig *idc, struct stored_jport **sjp) |
| 590 | { |
| 591 | for (int portnum = 0; portnum < MAX_JPORTS; portnum++) { |
| 592 | for (int i = 0; i < MAX_STORED_JPORTS; i++) { |
| 593 | struct stored_jport *jp = &stored_jports[portnum][i]; |
| 594 | if (jp->inuse && jp->jp.id == JPORT_UNPLUGGED) { |
| 595 | if (!_tcscmp(idc->name, jp->jp.idc.name) && !_tcscmp(idc->configname, jp->jp.idc.configname)) { |
| 596 | jp->inuse = false; |
| 597 | *sjp = jp; |
| 598 | return portnum; |
| 599 | } |
| 600 | } |
| 601 | } |
| 602 | } |
| 603 | return -1; |
| 604 | } |
| 605 | |
| 606 | // forget port's unplugged device |
| 607 | void inputdevice_forget_unplugged_device(int portnum) |
no outgoing calls
no test coverage detected