]> granicus.if.org Git - strace/commit
strace.c: refactor trace into two functions
authorVictor Krapivensky <krapivenskiy.va@phystech.edu>
Fri, 2 Jun 2017 14:05:56 +0000 (17:05 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 2 Jun 2017 14:20:09 +0000 (14:20 +0000)
commit6b4efe9f01e89e3ea5ed72a026dda9cfe164e67c
tree3425844b720a2a58e3605a7bd56d918505bab568
parenta25d7521ef70224dccb5eba56817047cd6053dca
strace.c: refactor trace into two functions

This change decouples waiting for next event from reacting to it.  This
makes the control flow easier to understand, and serves as a preparation
for implementing a pull-style API for LuaJIT.

* strace.c (enum trace_event): New enum.
(trace): Split into ...
(next_event, dispatch_event): ... new functions.
(main): Use them.
strace.c