1 /* -----------------------------------------------------------------------------
4 * Copyright (c) 2006, Vivek Mohan <vivek@sig9.com>
5 * All rights reserved. See LICENSE
6 * -----------------------------------------------------------------------------
13 uint8_t inp_next(struct ud
*);
14 uint8_t inp_peek(struct ud
*);
15 uint8_t inp_uint8(struct ud
*);
16 uint16_t inp_uint16(struct ud
*);
17 uint32_t inp_uint32(struct ud
*);
18 uint64_t inp_uint64(struct ud
*);
19 void inp_move(struct ud
*, size_t);
20 void inp_back(struct ud
*);
22 /* inp_init() - Initializes the input system. */
31 /* inp_start() - Should be called before each de-code operation. */
32 #define inp_start(u) u->inp_ctr = 0
34 /* inp_back() - Resets the current pointer to its position before the current
35 * instruction disassembly was started.
37 #define inp_reset(u) \
39 u->inp_curr -= u->inp_ctr; \
43 /* inp_sess() - Returns the pointer to current session. */
44 #define inp_sess(u) (u->inp_sess)
46 /* inp_cur() - Returns the current input byte. */
47 #define inp_curr(u) ((u)->inp_cache[(u)->inp_curr])