lib/subprocess: add callback feature to the subprocess library

For the libflashrom-compatible interface I'm working on, I needed the
ability to process data from the flashrom subprocess in a callback
function.

This adds a new type of subprocess_target, TARGET_CALLBACK, which can
read and write to/from a callback function.

BUG=chromium:478356
BRANCH=none
TEST=provided unit tests

Change-Id: I20b71000fc2b6b297a8617d2b03d0e91813007d1
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1959944
Reviewed-by: Julius Werner <jwerner@chromium.org>
3 files changed