Lines Matching refs:i
89 int i, num = 0; in buffer_read() local
102 i = ctx->ibuf_len; in buffer_read()
104 if (i != 0) { in buffer_read()
105 if (i > outl) in buffer_read()
106 i = outl; in buffer_read()
107 memcpy(out, &(ctx->ibuf[ctx->ibuf_off]), i); in buffer_read()
108 ctx->ibuf_off += i; in buffer_read()
109 ctx->ibuf_len -= i; in buffer_read()
110 num += i; in buffer_read()
111 if (outl == i) in buffer_read()
113 outl -= i; in buffer_read()
114 out += i; in buffer_read()
125 i = BIO_read(b->next_bio, out, outl); in buffer_read()
126 if (i <= 0) { in buffer_read()
128 if (i < 0) in buffer_read()
129 return ((num > 0) ? num : i); in buffer_read()
130 if (i == 0) in buffer_read()
133 num += i; in buffer_read()
134 if (outl == i) in buffer_read()
136 out += i; in buffer_read()
137 outl -= i; in buffer_read()
143 i = BIO_read(b->next_bio, ctx->ibuf, ctx->ibuf_size); in buffer_read()
144 if (i <= 0) { in buffer_read()
146 if (i < 0) in buffer_read()
147 return ((num > 0) ? num : i); in buffer_read()
148 if (i == 0) in buffer_read()
152 ctx->ibuf_len = i; in buffer_read()
160 int i, num = 0; in buffer_write() local
171 i = ctx->obuf_size - (ctx->obuf_len + ctx->obuf_off); in buffer_write()
173 if (i >= inl) { in buffer_write()
181 if (i > 0) { /* lets fill it up if we can */ in buffer_write()
182 memcpy(&(ctx->obuf[ctx->obuf_off + ctx->obuf_len]), in, i); in buffer_write()
183 in += i; in buffer_write()
184 inl -= i; in buffer_write()
185 num += i; in buffer_write()
186 ctx->obuf_len += i; in buffer_write()
190 i = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]), in buffer_write()
192 if (i <= 0) { in buffer_write()
195 if (i < 0) in buffer_write()
196 return ((num > 0) ? num : i); in buffer_write()
197 if (i == 0) in buffer_write()
200 ctx->obuf_off += i; in buffer_write()
201 ctx->obuf_len -= i; in buffer_write()
214 i = BIO_write(b->next_bio, in, inl); in buffer_write()
215 if (i <= 0) { in buffer_write()
217 if (i < 0) in buffer_write()
218 return ((num > 0) ? num : i); in buffer_write()
219 if (i == 0) in buffer_write()
222 num += i; in buffer_write()
223 in += i; in buffer_write()
224 inl -= i; in buffer_write()
241 int r, i, *ip; in buffer_ctrl() local
267 for (i = 0; i < ctx->ibuf_len; i++) { in buffer_ctrl()
268 if (p1[ctx->ibuf_off + i] == '\n') in buffer_ctrl()
422 int num = 0, i, flag; in buffer_gets() local
433 for (i = 0; (i < ctx->ibuf_len) && (i < size); i++) { in buffer_gets()
434 *(buf++) = p[i]; in buffer_gets()
435 if (p[i] == '\n') { in buffer_gets()
437 i++; in buffer_gets()
441 num += i; in buffer_gets()
442 size -= i; in buffer_gets()
443 ctx->ibuf_len -= i; in buffer_gets()
444 ctx->ibuf_off += i; in buffer_gets()
451 i = BIO_read(b->next_bio, ctx->ibuf, ctx->ibuf_size); in buffer_gets()
452 if (i <= 0) { in buffer_gets()
455 if (i < 0) in buffer_gets()
456 return ((num > 0) ? num : i); in buffer_gets()
457 if (i == 0) in buffer_gets()
460 ctx->ibuf_len = i; in buffer_gets()