From: Dmitry V. Levin Date: Sat, 4 May 2019 23:15:52 +0000 (+0000) Subject: Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn X-Git-Tag: v5.1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db9213bcd0199ee808ce86d2a033fcbcf6783513;p=strace Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn These types are going to be used in signatures of functions that take print_*time* functions as parameters. * defs.h (print_obj_by_addr_fn, sprint_obj_by_addr_fn): New types. * desc.c (decode_select): Use them. --- diff --git a/defs.h b/defs.h index fb466cb9..1a139f92 100644 --- a/defs.h +++ b/defs.h @@ -837,6 +837,8 @@ typedef bool (*tfetch_mem_fn)(struct tcb *, kernel_ulong_t addr, unsigned int size, void *dest); typedef bool (*print_fn)(struct tcb *, void *elem_buf, size_t elem_size, void *opaque_data); +typedef int (*print_obj_by_addr_fn)(struct tcb *, kernel_ulong_t); +typedef const char * (*sprint_obj_by_addr_fn)(struct tcb *, kernel_ulong_t); /** diff --git a/desc.c b/desc.c index c1536248..9ac40834 100644 --- a/desc.c +++ b/desc.c @@ -52,8 +52,8 @@ SYS_FUNC(dup3) static int decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, - int (*const print_tv_ts) (struct tcb *, kernel_ulong_t), - const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t)) + const print_obj_by_addr_fn print_tv_ts, + const sprint_obj_by_addr_fn sprint_tv_ts) { int i, j; int nfds, fdsize;