Lines Matching defs:cbuf
277 CharBuffer* cbuf = cs->opaque;
279 while (cbuf->bip_first) {
280 BipBuffer* bip = cbuf->bip_first;
281 cbuf->bip_first = bip->next;
284 cbuf->bip_last = NULL;
285 cbuf->endpoint = NULL;
287 if (cbuf->endpoint != NULL) {
288 qemu_chr_close(cbuf->endpoint);
289 cbuf->endpoint = NULL;
296 CharBuffer* cbuf = cs->opaque;
297 CharDriverState* peer = cbuf->endpoint;
298 BipBuffer* bip = cbuf->bip_last;
302 len, cbuf, quote_bytes( buf, len ));
324 cbuf->bip_first = cbuf->bip_last = bip;
337 cbuf->bip_last = bip_buffer_alloc();
338 bip->next = cbuf->bip_last;
339 bip = cbuf->bip_last;
346 charbuffer_poll( CharBuffer* cbuf )
348 CharDriverState* peer = cbuf->endpoint;
354 BipBuffer* bip = cbuf->bip_first;
364 cbuf->bip_first = bip->next;
365 if (cbuf->bip_first == NULL)
366 cbuf->bip_last = NULL;
389 CharBuffer* cbuf = cs->opaque;
391 qemu_chr_add_handlers( cbuf->endpoint,
400 charbuffer_init( CharBuffer* cbuf, CharDriverState* endpoint )
402 CharDriverState* cs = cbuf->cs;
404 cbuf->bip_first = NULL;
405 cbuf->bip_last = NULL;
406 cbuf->endpoint = endpoint;
413 cs->opaque = cbuf;
423 CharBuffer* cbuf = _s_charbuffers;
424 CharBuffer* cbuf_end = cbuf + MAX_CHAR_BUFFERS;
429 for ( ; cbuf < cbuf_end; cbuf++ ) {
430 if (cbuf->endpoint == NULL)
434 if (cbuf == cbuf_end)
437 charbuffer_init(cbuf, endpoint);
438 return cbuf->cs;