(code, fp, options)
| 591 | |
| 592 | |
| 593 | def _unpack_integer(code, fp, options): |
| 594 | if (ord(code) & 0xe0) == 0xe0: |
| 595 | return struct.unpack("b", code)[0] |
| 596 | elif code == b'\xd0': |
| 597 | return struct.unpack("b", _read_except(fp, 1))[0] |
| 598 | elif code == b'\xd1': |
| 599 | return struct.unpack(">h", _read_except(fp, 2))[0] |
| 600 | elif code == b'\xd2': |
| 601 | return struct.unpack(">i", _read_except(fp, 4))[0] |
| 602 | elif code == b'\xd3': |
| 603 | return struct.unpack(">q", _read_except(fp, 8))[0] |
| 604 | elif (ord(code) & 0x80) == 0x00: |
| 605 | return struct.unpack("B", code)[0] |
| 606 | elif code == b'\xcc': |
| 607 | return struct.unpack("B", _read_except(fp, 1))[0] |
| 608 | elif code == b'\xcd': |
| 609 | return struct.unpack(">H", _read_except(fp, 2))[0] |
| 610 | elif code == b'\xce': |
| 611 | return struct.unpack(">I", _read_except(fp, 4))[0] |
| 612 | elif code == b'\xcf': |
| 613 | return struct.unpack(">Q", _read_except(fp, 8))[0] |
| 614 | raise Exception("logic error, not int: 0x%02x" % ord(code)) |
| 615 | |
| 616 | |
| 617 | def _unpack_reserved(code, fp, options): |
nothing calls this directly
no test coverage detected