summaryrefslogtreecommitdiff
path: root/src/til_stream.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-19 22:45:23 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-21 13:34:10 -0800
commit54c35f22204982eef4eb606d0bf58ea945a2c0b5 (patch)
tree844d26f8559d181c9fc1bcf8c35126cd1825cbab /src/til_stream.c
parentf034dbc3eb32fda727357834d3a03a42df12edef (diff)
til_stream: minor cosmetic naming/comments fixes
Some clarifications
Diffstat (limited to 'src/til_stream.c')
-rw-r--r--src/til_stream.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/til_stream.c b/src/til_stream.c
index e59cbc9..c5e8326 100644
--- a/src/til_stream.c
+++ b/src/til_stream.c
@@ -76,7 +76,7 @@ struct til_stream_pipe_t {
const void *owner_foo; /* supplemental pointer for owner's use */
char *parent_path;
const til_tap_t *driving_tap; /* tap producing values for the pipe */
- uint32_t hash; /* hash of (driving_tap->path ^ parent_hash) */
+ uint32_t hash; /* hash of (driving_tap->name_hash ^ .parent_hash) */
};
typedef struct til_stream_t {
@@ -148,7 +148,7 @@ int til_stream_tap(til_stream_t *stream, const void *owner, const void *owner_fo
for (pipe = stream->buckets[bucket]; pipe != NULL; pipe = pipe->next) {
if (pipe->hash == hash) {
if (pipe->driving_tap == tap) {
- /* this is our pipe and we're driving */
+ /* this is the pipe and we're driving */
*(tap->ptr) = pipe->driving_tap->elems;
pthread_mutex_unlock(&stream->mutex);
@@ -372,7 +372,7 @@ void til_stream_fprint(til_stream_t *stream, FILE *out)
/* returns -errno on error (from pipe_cb), 0 otherwise */
-int til_stream_for_each_pipe(til_stream_t *stream, til_stream_iter_func_t pipe_cb, void *cb_arg)
+int til_stream_for_each_pipe(til_stream_t *stream, til_stream_iter_func_t pipe_cb, void *cb_context)
{
assert(stream);
assert(pipe_cb);
@@ -383,8 +383,8 @@ int til_stream_for_each_pipe(til_stream_t *stream, til_stream_iter_func_t pipe_c
for (til_stream_pipe_t *p = stream->buckets[i]; p != NULL; p = p->next) {
int r;
- r = pipe_cb(cb_arg, p, p->owner, p->owner_foo, p->driving_tap);
- if (r <= 0) {
+ r = pipe_cb(cb_context, p, p->owner, p->owner_foo, p->driving_tap);
+ if (r < 0) {
pthread_mutex_unlock(&stream->mutex);
return r;
}
© All Rights Reserved