diff options
author | Daniel Lange <DLange@git.local> | 2022-05-02 16:04:22 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2022-05-02 16:04:22 +0200 |
commit | 2f0332b75397ad5240a429d72203f0531011b6a9 (patch) | |
tree | 4782d4b8d0c43f3e6faa1bbbe95816a09e815e67 /ListItem.c | |
parent | 93c96b12c9cb349b762d38d69568d65cd3e4fbfd (diff) | |
parent | 1b805a31720727008b32b1129a167758519fd4db (diff) | |
download | debian_htop-2f0332b75397ad5240a429d72203f0531011b6a9.tar.gz debian_htop-2f0332b75397ad5240a429d72203f0531011b6a9.tar.bz2 debian_htop-2f0332b75397ad5240a429d72203f0531011b6a9.zip |
Update upstream source from tag 'upstream/3.2.0'
Update to upstream version '3.2.0'
with Debian dir 5ce130e9471b77941bbd217b5ea8b7b3419a91c6
Diffstat (limited to 'ListItem.c')
-rw-r--r-- | ListItem.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -18,13 +18,13 @@ in the source distribution for its full text. #include "XUtils.h" -static void ListItem_delete(Object* cast) { +void ListItem_delete(Object* cast) { ListItem* this = (ListItem*)cast; free(this->value); free(this); } -static void ListItem_display(const Object* cast, RichString* out) { +void ListItem_display(const Object* cast, RichString* out) { const ListItem* const this = (const ListItem*)cast; assert (this != NULL); @@ -38,11 +38,15 @@ static void ListItem_display(const Object* cast, RichString* out) { RichString_appendWide(out, CRT_colors[DEFAULT_COLOR], this->value); } -ListItem* ListItem_new(const char* value, int key) { - ListItem* this = AllocThis(ListItem); +void ListItem_init(ListItem* this, const char* value, int key) { this->value = xStrdup(value); this->key = key; this->moving = false; +} + +ListItem* ListItem_new(const char* value, int key) { + ListItem* this = AllocThis(ListItem); + ListItem_init(this, value, key); return this; } @@ -55,7 +59,7 @@ void ListItem_append(ListItem* this, const char* text) { this->value[newLen] = '\0'; } -static int ListItem_compare(const void* cast1, const void* cast2) { +int ListItem_compare(const void* cast1, const void* cast2) { const ListItem* obj1 = (const ListItem*) cast1; const ListItem* obj2 = (const ListItem*) cast2; return strcmp(obj1->value, obj2->value); |