| 27 | } |
| 28 | |
| 29 | bool cif_bytes(cif_context *c, size_t count) { |
| 30 | if (c->error.status != CBM_INVENTORY_OK) { |
| 31 | return false; |
| 32 | } |
| 33 | if (count > CIF_BYTE_GAP) { |
| 34 | return cif_fail(c, CBM_INVENTORY_STATE); |
| 35 | } |
| 36 | if (count > c->byte_gap && !cif_poll(c)) { |
| 37 | return false; |
| 38 | } |
| 39 | c->byte_gap -= count; |
| 40 | return true; |
| 41 | } |
| 42 | |
| 43 | bool cif_event(cif_context *c) { |
| 44 | if (c->error.status != CBM_INVENTORY_OK || (!c->event_gap && !cif_poll(c))) { |
no test coverage detected