1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-29 19:56:07 -04:00

Removed unused function

This commit is contained in:
James Booth 2014-07-16 22:34:02 +01:00
parent 0619303abe
commit 860591872f
2 changed files with 0 additions and 49 deletions

View File

@ -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;
}

View File

@ -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