Lines Matching refs:buffer

56     str->buffer->delete_range(str->buffer->tell((buf_char*)pptr()),  in truncate()
57 str->buffer->tell(str->end)); in truncate()
62 inline void disconnect_gap_from_file(edit_buffer* buffer, FILE* fp) in disconnect_gap_from_file() argument
64 if (buffer->gap_start_ptr != &fp->__bufp) in disconnect_gap_from_file()
66 buffer->gap_start_normal = fp->__bufp; in disconnect_gap_from_file()
67 buffer->gap_start_ptr = &buffer->gap_start_normal; in disconnect_gap_from_file()
71 void edit_streambuf::flush_to_buffer(edit_buffer* buffer) in flush_to_buffer() argument
73 if (pptr() > buffer->_gap_start && pptr() < buffer->gap_end()) in flush_to_buffer()
74 buffer->_gap_start = pptr(); in flush_to_buffer()
77 void edit_streambuf::disconnect_gap_from_file(edit_buffer* buffer) in disconnect_gap_from_file() argument
79 if (buffer->_writer != this) return; in disconnect_gap_from_file()
80 flush_to_buffer(buffer); in disconnect_gap_from_file()
82 buffer->_writer = NULL; in disconnect_gap_from_file()
96 return str->buffer->tell(file->__bufp);
323 __off == index at start of buffer (need only be valid after seek ? )
327 __endp <= min(*gap_start_ptr, edit_string->end->ptr(buffer))
331 file->edit_string->end->ptr(buffer) == *gap_start_ptr+end
340 struct edit_buffer *buffer = str->buffer; in underflow() local
342 disconnect_gap_from_file(buffer); in underflow()
345 buf_char *str_end = str->end->ptr(buffer); in underflow()
352 if (str_end <= buffer->gap_start()) { in underflow()
356 if (gptr() < buffer->gap_start()) { in underflow()
357 setg(eback(), gptr(), buffer->gap_start()); in underflow()
360 if (gptr() == buffer->gap_start()) { in underflow()
361 disconnect_gap_from_file(buffer); in underflow()
363 setg(buffer->gap_end(), buffer->gap_end(), str_end); in underflow()
374 struct edit_buffer *buffer = str->buffer; in overflow() local
375 flush_to_buffer(buffer); in overflow()
381 buf_char *str_end = str->end->ptr(buffer); in overflow()
390 if (buffer->_writer) in overflow()
391 buffer->_writer->flush_to_buffer(); // Redundant? in overflow()
392 buffer->_writer = NULL; in overflow()
393 if (pptr() >= buffer->gap_end()) in overflow()
394 buffer->move_gap(pptr() - buffer->gap_size()); in overflow()
396 buffer->move_gap(pptr()); in overflow()
397 buffer->make_gap(1); in overflow()
398 setp(buffer->gap_start(), buffer->gap_end()); in overflow()
399 buffer->_writer = this; in overflow()
404 if (str_end <= buffer->gap_start()) { in overflow()
408 else if (pptr() < buffer->gap_start()) { in overflow()
410 setp(pptr(), buffer->gap_start()); in overflow()
413 else if (pptr() == buffer->gap_start()) { in overflow()
416 setp(buffer->gap_end(), str_end); in overflow()
443 struct edit_buffer *buffer = str->buffer; in seekoff() local
444 disconnect_gap_from_file(buffer); in seekoff()
445 buf_index cur_pos = buffer->tell((buf_char*)current());; in seekoff()
446 buf_index start_pos = buffer->tell(str->start); in seekoff()
447 buf_index end_pos = buffer->tell(str->end); in seekoff()
461 buf_char *new_pos = buffer->data + offset; in seekoff()
462 buf_char* gap_start = buffer->gap_start(); in seekoff()
464 buf_char* gap_end = buffer->gap_end(); in seekoff()
466 if (new_pos >= buffer->data + buffer->buf_size) abort(); // Paranoia. in seekoff()
477 struct edit_buffer *buffer = cookie->str->buffer;
478 buf_char *str_start = cookie->str->start->ptr(buffer);
479 disconnect_gap_from_file(buffer, cookie->file);
481 if (file->__bufp <= *buffer->gap_start_ptr
482 || str_start >= buffer->__gap_end)
486 (*buffer->gap_start_ptr - str_start) + (file->__bufp - __gap_end);
509 *buffer->gap_start_ptr; /* what if gap_start_ptr == &bufp ??? */
555 edit_buffer* buffer = bstr->buffer; in edit_streambuf() local
556 next = buffer->files; in edit_streambuf()
557 buffer->files = this; in edit_streambuf()
558 char* buf_ptr = bstr->start->ptr(buffer); in edit_streambuf()
574 struct edit_buffer *buffer = cookie->str->buffer;
576 for (ptr = &buffer->files; *ptr != cookie; ptr = &(*ptr)->next) ;
578 disconnect_gap_from_file(buffer, cookie->file);
589 edit_streambuf **ptr = &str->buffer->files; in ~edit_streambuf()
593 disconnect_gap_from_file(str->buffer); in ~edit_streambuf()
620 struct edit_buffer *buf = str->buffer; in edit_mark()
642 edit_buffer * edit_mark::buffer() in buffer() function in edit_mark
653 struct edit_buffer *buf = buffer(); in ~edit_mark()
662 ptrdiff_t delta = end->ptr(buffer) - start->ptr(buffer); in length()
663 if (end->ptr(buffer) <= buffer->gap_start() || in length()
664 start->ptr(buffer) >= buffer->gap_end()) in length()
666 return delta - buffer->gap_size(); in length()
674 start1 = start->ptr(buffer); in copy_bytes()
675 if (end->ptr(buffer) <= buffer->gap_start() in copy_bytes()
676 || start->ptr(buffer) >= buffer->gap_end()) { in copy_bytes()
677 len1 = end->ptr(buffer) - start1; in copy_bytes()
682 len1 = buffer->gap_start() - start1; in copy_bytes()
683 start2 = buffer->gap_end(); in copy_bytes()
684 len2 = end->ptr(buffer) - start2; in copy_bytes()
703 if (buffer == src->buffer /*&& ???*/) { /* overly conservative */ in assign()