summaryrefslogtreecommitdiff
path: root/src
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
parentf034dbc3eb32fda727357834d3a03a42df12edef (diff)
til_stream: minor cosmetic naming/comments fixes
Some clarifications
Diffstat (limited to 'src')
-rw-r--r--src/til_stream.c10
-rw-r--r--src/til_stream.h2
2 files changed, 6 insertions, 6 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;
}
diff --git a/src/til_stream.h b/src/til_stream.h
index 1e9c516..3e83c7d 100644
--- a/src/til_stream.h
+++ b/src/til_stream.h
@@ -30,7 +30,7 @@ typedef struct til_tap_t til_tap_t;
* things can be done to it (like changing the ownership?)
* return 0 to stop iterating, 1 to continue, -errno on error
*/
-typedef int (til_stream_iter_func_t)(void *arg, til_stream_pipe_t *pipe, const void *owner, const void *owner_foo, const til_tap_t *driving_tap);
+typedef int (til_stream_iter_func_t)(void *context, til_stream_pipe_t *pipe, const void *owner, const void *owner_foo, const til_tap_t *driving_tap);
til_stream_t * til_stream_new(void);
til_stream_t * til_stream_free(til_stream_t *stream);
© All Rights Reserved