Add PRV_NEXT flag to auto-increment the channel value

This commit is contained in:
Rodrigo Arias 2023-02-21 14:13:06 +01:00 committed by Rodrigo Arias Mallo
parent 1b30d5989c
commit b1e3cf7403
2 changed files with 5 additions and 1 deletions

View File

@ -108,6 +108,9 @@ emit(struct prv *prv, struct prv_chan *rchan)
switch (value.type) { switch (value.type) {
case VALUE_INT64: case VALUE_INT64:
val = value.i; val = value.i;
if (rchan->flags & PRV_NEXT)
val++;
//if (val == 0) { //if (val == 0) {
// err("forbidden value 0 in %s: %s\n", // err("forbidden value 0 in %s: %s\n",
// chan->name, // chan->name,

View File

@ -12,7 +12,8 @@
struct prv; struct prv;
enum prv_flags { enum prv_flags {
PRV_DUP = 1, PRV_DUP = 1<<0,
PRV_NEXT = 1<<1, /* Add one to the channel value */
}; };
struct prv_chan { struct prv_chan {