From 2e437967eaee5ec4359bfada18a5c9bbedacb305 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 29 Sep 2024 12:49:12 -0700 Subject: vcr: clarify timeout units in naming vcr_backend_poll() mirrors the poll() api, but let's clarify the timeout units as microseconds. --- src/vcr.c | 6 +++--- src/vcr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vcr.c b/src/vcr.c index d90243d..f97b576 100644 --- a/src/vcr.c +++ b/src/vcr.c @@ -410,7 +410,7 @@ int vcr_backend_get_dimensions(vcr_backend_t *vbe, int *res_width, int *res_heig /* this is basically just needed by the vmon use case */ /* returns 1 if the backend has events to process, 0 on timeout/error. */ -int vcr_backend_poll(vcr_backend_t *vbe, int timeout) +int vcr_backend_poll(vcr_backend_t *vbe, int timeout_us) { /* FIXME TODO: should probably switch to ppoll() and keep signals blocked outside of * while blocked in ppoll(). Then ppoll() becomes our signal delivery/handling point... @@ -426,11 +426,11 @@ int vcr_backend_poll(vcr_backend_t *vbe, int timeout) if (XPending(vbe->xlib.xserver->display)) return 1; - return poll(&pfd, 1, timeout); + return poll(&pfd, 1, timeout_us); } #endif case VCR_BACKEND_TYPE_MEM: - return poll(NULL, 0, timeout); + return poll(NULL, 0, timeout_us); default: assert(0); diff --git a/src/vcr.h b/src/vcr.h index 057d39f..7ee9bc9 100644 --- a/src/vcr.h +++ b/src/vcr.h @@ -49,7 +49,7 @@ typedef struct vcr_str_t { vcr_backend_t * vcr_backend_new(vcr_backend_type_t backend, ...); int vcr_backend_get_dimensions(vcr_backend_t *vbe, int *res_width, int *res_height); -int vcr_backend_poll(vcr_backend_t *vbe, int timeout); +int vcr_backend_poll(vcr_backend_t *vbe, int timeout_us); vcr_backend_event_t vcr_backend_next_event(vcr_backend_t *vbe, int *res_width, int *res_height); vcr_backend_t * vcr_backend_free(vcr_backend_t *vbe); -- cgit v1.2.3