void ud_set_input_file(register struct ud* u, FILE* f) { ud_inp_init(u); u->inp_hook = inp_file_hook; u->inp_file = f; }
/* ============================================================================= * ud_inp_set_buffer * Set buffer as input. * ============================================================================= */ void ud_set_input_buffer(register struct ud* u, const uint8_t* buf, size_t len) { ud_inp_init(u); u->inp_buf = buf; u->inp_buf_size = len; u->inp_buf_index = 0; }
/* ============================================================================= * ud_inp_set_buffer() - Set buffer as input. * ============================================================================= */ extern void ud_set_input_buffer(register struct ud* u, uint8_t* buf, size_t len) { u->inp_hook = inp_buff_hook; u->inp_buff = buf; u->inp_buff_end = buf + len; ud_inp_init(u); }
/* ============================================================================= * ud_inp_set_hook * Sets input hook. * ============================================================================= */ void ud_set_input_hook(register struct ud* u, int (*hook)(struct ud*)) { ud_inp_init(u); u->inp_hook = hook; }