diff options
author | James Booth <boothj5@gmail.com> | 2014-07-16 22:34:02 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-07-16 22:34:02 +0100 |
commit | 860591872f41e78406751bf4476ffcde7f321c9a (patch) | |
tree | d2d288637275e811882d8b639511918e8a4d7472 /src/ui | |
parent | 0619303abe8a5eba2fe4e70d0e52a06fafc6a455 (diff) | |
download | profani-tty-860591872f41e78406751bf4476ffcde7f321c9a.tar.gz |
Removed unused function
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/buffer.c | 48 | ||||
-rw-r--r-- | src/ui/buffer.h | 1 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/ui/buffer.c b/src/ui/buffer.c index 88d7eb42..16919c08 100644 --- a/src/ui/buffer.c +++ b/src/ui/buffer.c @@ -95,52 +95,4 @@ buffer_yield_entry(ProfBuff* buffer, int entry) } else { return buffer->entry[entry % (buffer->current)]; } -} - -int -buffer_yield(ProfBuff* buffer, int line, ProfBuffEntry** list) -{ - //Returns the size of the (line+1)-th last line, and list contains the line - //e.g. if line == 0, returns the last line - //bug if the wrap happens in the middle of a line - int current = buffer->current; - int imax = current; - - if (buffer->wrap == 1) { - imax = BUFF_SIZE; - } - - int i = 1; - int j = 0; - while (i <= imax) { - ProfBuffEntry e = buffer->entry[(current - i) % BUFF_SIZE]; - - if (j == line && (e.flags & NO_EOL) == 0) { - //We found our line and we are at its last entry - int nb_entries = 1; - - while (i + nb_entries <= imax) { - e = buffer->entry[(current - i - nb_entries) % BUFF_SIZE]; - if ((e.flags & NO_EOL) == 0) { - break; - } - nb_entries += 1; - } - - if ((buffer->wrap == 1) && (i + nb_entries > imax)) { - //The line is at the top of the buffer, we don't know if it's complete - return 0; - } else { - *list = &(buffer->entry[(current - i - nb_entries + 1) % BUFF_SIZE]); - return nb_entries; - } - } - - if ((e.flags & NO_EOL) == 0) { - j++; - } - i++; - } - - return 0; } \ No newline at end of file diff --git a/src/ui/buffer.h b/src/ui/buffer.h index 4a0030d0..b8828c14 100644 --- a/src/ui/buffer.h +++ b/src/ui/buffer.h @@ -24,6 +24,5 @@ ProfBuff* buffer_create(); void buffer_free(ProfBuff* buffer); void buffer_push(ProfBuff* buffer, const char show_char, const char * const date_fmt, int flags, int attrs, const char * const from, const char * const message); int buffer_size(ProfBuff* buffer); -int buffer_yield(ProfBuff* buffer, int line, ProfBuffEntry** list); ProfBuffEntry buffer_yield_entry(ProfBuff* buffer, int entry); #endif \ No newline at end of file |