]> granicus.if.org Git - strace/commitdiff
Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
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.

defs.h
desc.c

diff --git a/defs.h b/defs.h
index fb466cb9b03a6733b299a654bb9429f66300a137..1a139f929973350286e63f127d9732b6f4a13e9a 100644 (file)
--- 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 c153624822f4f3fdf824c68185163c61ca23bbaf..9ac40834ce95d9b970d9a40bafb2b701cd9a0e80 100644 (file)
--- 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;