diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
commit | da23c8c5a188324455c8f417293c10d85f65cb63 (patch) | |
tree | d7a4b8cb0af705de6650e20e00ba3da04d84b27f /ListItem.c | |
parent | 12f4f09e6ed288bdedc86e4ef22f3cc34f0e787a (diff) |
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
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; } |