Allow channels to be marked as dirty

This commit is contained in:
Rodrigo Arias 2023-02-20 11:47:00 +01:00 committed by Rodrigo Arias Mallo
parent d34a25a62d
commit 2b84318ebe
2 changed files with 17 additions and 0 deletions

View File

@ -237,6 +237,22 @@ chan_flush(struct chan *chan)
return 0;
}
/** Marks the channel as dirty */
int
chan_dirty(struct chan *chan)
{
/* Nothing to do, already dirty */
if (chan->is_dirty)
return 0;
if (set_dirty(chan) != 0) {
err("%s: set_dirty failed\n", chan->name);
return -1;
}
return 0;
}
void
chan_prop_set(struct chan *chan, enum chan_prop prop, int value)
{

View File

@ -63,5 +63,6 @@ USE_RET int chan_flush(struct chan *chan);
void chan_prop_set(struct chan *chan, enum chan_prop prop, int value);
USE_RET int chan_prop_get(struct chan *chan, enum chan_prop prop);
void chan_set_dirty_cb(struct chan *chan, chan_cb_t func, void *arg);
USE_RET int chan_dirty(struct chan *chan);
#endif /* CHAN_H */