diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/list.c | 17 | ||||
-rw-r--r-- | common/list.h | 2 | ||||
-rw-r--r-- | common/os_calls.c | 4 |
3 files changed, 23 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c index b3263a54..953ef676 100644 --- a/common/list.c +++ b/common/list.c @@ -199,3 +199,20 @@ list_append_list_strdup(struct list* self, struct list* dest, int start_index) list_add_item(dest, (tbus)dup); } } + +/*****************************************************************************/ +void APP_CC +list_dump_items(struct list* self) +{ + int index; + tbus item; + + if (self->count == 0) + { + g_writeln("List is empty"); + } + for (index = 0; index < self->count; index++) + { + g_writeln("%d: %s", index, list_get_item(self, index)); + } +} diff --git a/common/list.h b/common/list.h index 00c1cfed..7da3ad86 100644 --- a/common/list.h +++ b/common/list.h @@ -55,5 +55,7 @@ void APP_CC list_insert_item(struct list* self, int index, tbus item); void APP_CC list_append_list_strdup(struct list* self, struct list* dest, int start_index); +void APP_CC +list_dump_items(struct list* self); #endif diff --git a/common/os_calls.c b/common/os_calls.c index e805a09f..5db47447 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -1684,7 +1684,11 @@ g_get_strerror(void) int APP_CC g_get_errno(void) { +#if defined(_WIN32) + return GetLastError(); +#else return errno; +#endif } /*****************************************************************************/ |