diff options
author | Eugene V. Lyubimkin <jackyf.devel@gmail.com> | 2008-11-16 20:36:18 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:23 +0200 |
commit | bcb965d78ae0b4599fe77a2d641b3ff035658fc9 (patch) | |
tree | 59066e7fa5473b02eefaea37ac015cfaea7cd7c6 /ListItem.c | |
parent | 2eabf3432b05b93ce4de9af283ae549d0f7c18c8 (diff) | |
parent | c74c38760df69bb87e93dff18cf91464e5d02f37 (diff) | |
download | debian_htop-bcb965d78ae0b4599fe77a2d641b3ff035658fc9.tar.gz debian_htop-bcb965d78ae0b4599fe77a2d641b3ff035658fc9.tar.bz2 debian_htop-bcb965d78ae0b4599fe77a2d641b3ff035658fc9.zip |
Imported Debian patch 0.8.1-1debian/0.8.1-1
Diffstat (limited to 'ListItem.c')
-rw-r--r-- | ListItem.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -29,6 +29,21 @@ char* LISTITEM_CLASS = "ListItem"; #define LISTITEM_CLASS NULL #endif +static void ListItem_delete(Object* cast) { + ListItem* this = (ListItem*)cast; + free(this->value); + free(this); +} + +static void ListItem_display(Object* cast, RichString* out) { + ListItem* this = (ListItem*)cast; + assert (this != NULL); + int len = strlen(this->value)+1; + char buffer[len+1]; + snprintf(buffer, len, "%s", this->value); + RichString_write(out, CRT_colors[DEFAULT_COLOR], buffer); +} + ListItem* ListItem_new(char* value, int key) { ListItem* this = malloc(sizeof(ListItem)); Object_setClass(this, LISTITEM_CLASS); @@ -46,21 +61,6 @@ void ListItem_append(ListItem* this, char* text) { this->value = buf; } -void ListItem_delete(Object* cast) { - ListItem* this = (ListItem*)cast; - free(this->value); - free(this); -} - -void ListItem_display(Object* cast, RichString* out) { - ListItem* this = (ListItem*)cast; - assert (this != NULL); - int len = strlen(this->value)+1; - char buffer[len+1]; - snprintf(buffer, len, "%s", this->value); - RichString_write(out, CRT_colors[DEFAULT_COLOR], buffer); -} - const char* ListItem_getRef(ListItem* this) { return this->value; } |