Lines Matching full:ch
52 struct dcons_ch *ch; in dcons_ischar() local
54 ch = &dc->i; in dcons_ischar()
56 ptr = ntohl(*ch->ptr); in dcons_ischar()
59 if (gen == ch->gen && pos == ch->pos) in dcons_ischar()
62 next_gen = DCONS_NEXT_GEN(ch->gen); in dcons_ischar()
64 if ((gen != ch->gen && gen != next_gen) in dcons_ischar()
65 || (gen == ch->gen && pos < ch->pos)) { in dcons_ischar()
68 ch->gen = gen; in dcons_ischar()
69 ch->pos = pos; in dcons_ischar()
81 struct dcons_ch *ch; in dcons_checkc() local
83 ch = &dc->i; in dcons_checkc()
85 ptr = ntohl(*ch->ptr); in dcons_checkc()
88 if (gen == ch->gen && pos == ch->pos) in dcons_checkc()
91 next_gen = DCONS_NEXT_GEN(ch->gen); in dcons_checkc()
93 if ((gen != ch->gen && gen != next_gen) in dcons_checkc()
94 || (gen == ch->gen && pos < ch->pos)) { in dcons_checkc()
97 ch->gen = gen; in dcons_checkc()
98 ch->pos = pos; in dcons_checkc()
102 c = ch->buf[ch->pos]; in dcons_checkc()
103 ch->pos ++; in dcons_checkc()
104 if (ch->pos >= ch->size) { in dcons_checkc()
105 ch->gen = next_gen; in dcons_checkc()
106 ch->pos = 0; in dcons_checkc()
115 struct dcons_ch *ch; in dcons_putc() local
117 ch = &dc->o; in dcons_putc()
119 ch->buf[ch->pos] = c; in dcons_putc()
120 ch->pos ++; in dcons_putc()
121 if (ch->pos >= ch->size) { in dcons_putc()
122 ch->gen = DCONS_NEXT_GEN(ch->gen); in dcons_putc()
123 ch->pos = 0; in dcons_putc()
125 *ch->ptr = DCONS_MAKE_PTR(ch); in dcons_putc()