Changeset 9fd74d5 in mainline
- Timestamp:
- 2025-11-09T16:20:43Z (3 days ago)
- Branches:
- master
- Children:
- a4301f1
- Parents:
- e6b4d2d
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-11-09 16:19:21)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-11-09 16:20:43)
- Location:
- uspace/lib/termui/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/termui/src/history.c
re6b4d2d r9fd74d5 126 126 127 127 #define _history_check(history) do { \ 128 assert(history->lines.head < history->lines.buf_len ); \129 assert(history->lines.tail < history->lines.buf_len ); \128 assert(history->lines.head < history->lines.buf_len || history->lines.head == 0); \ 129 assert(history->lines.tail < history->lines.buf_len || history->lines.tail == 0); \ 130 130 assert(history->cells.tail_top <= history->cells.head_offset); \ 131 131 assert(history->cells.head_offset <= history->cells.head_top); \ … … 298 298 if (lines->tail >= lines->buf_len) 299 299 lines->tail = 0; 300 301 if (viewport_inactive) { 302 /* Ensure consistent state so asserts don't trigger inside _evict_oldest_line(). */ 303 history->viewport_top = lines->tail; 304 } 300 305 301 306 if (lines->tail == lines->head) -
uspace/lib/termui/src/history.h
re6b4d2d r9fd74d5 66 66 }; 67 67 68 /* History consists of two circular buffers. 69 * The cell buffer is a linear array of character cells. 70 * The line buffer contains offsets into the cell buffer, and segments it into logical lines. 71 * Both of these buffers have a maximum size, so history is limited both by maximum number 72 * of characters, and maximum number of lines. */ 68 73 struct history { 69 74 size_t viewport_top;
Note:
See TracChangeset
for help on using the changeset viewer.
