aboutsummaryrefslogtreecommitdiffstats
path: root/ListItem.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
commitc74c38760df69bb87e93dff18cf91464e5d02f37 (patch)
treeee2a19a0ef3a808bdfc8c1e6a00e96d79966dcb0 /ListItem.c
parent9379132a8234eeedf62d37ef57713e52c12db6ab (diff)
downloaddebian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.gz
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.bz2
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.zip
Imported Upstream version 0.8.1upstream/0.8.1
Diffstat (limited to 'ListItem.c')
-rw-r--r--ListItem.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ListItem.c b/ListItem.c
index 90107e4..05754ac 100644
--- a/ListItem.c
+++ b/ListItem.c
@@ -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;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy