summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2006-09-18 04:35:10 +0000
committerjsorg71 <jsorg71>2006-09-18 04:35:10 +0000
commit9a5e4d594fdda4dff931df8c19601047b2395b55 (patch)
treec1ebf8875614ec3397f62a41be6f251a4147bad1 /common
parent58dc2e0df72c96d2350cfdea405b2ba23d102e5e (diff)
downloadxrdp-proprietary-9a5e4d594fdda4dff931df8c19601047b2395b55.tar.gz
xrdp-proprietary-9a5e4d594fdda4dff931df8c19601047b2395b55.zip
added function list_append_list_strdup
Diffstat (limited to 'common')
-rw-r--r--common/list.c18
-rw-r--r--common/list.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c
index 96b96eb7..9b338eca 100644
--- a/common/list.c
+++ b/common/list.c
@@ -179,3 +179,21 @@ list_insert_item(struct list* self, int index, long item)
self->items[index] = item;
}
}
+
+/*****************************************************************************/
+/* append one list to another using strdup for each item in the list */
+/* begins copy at start_index, a zero based index on the soure list */
+void APP_CC
+list_append_list_strdup(struct list* self, struct list* dest, int start_index)
+{
+ int index;
+ long item;
+ char* dup;
+
+ for (index = start_index; index < self->count; index++)
+ {
+ item = list_get_item(self, index);
+ dup = g_strdup((char*)item);
+ list_add_item(dest, (long)dup);
+ }
+}
diff --git a/common/list.h b/common/list.h
index a1163515..fa66f643 100644
--- a/common/list.h
+++ b/common/list.h
@@ -47,5 +47,7 @@ void APP_CC
list_remove_item(struct list* self, int index);
void APP_CC
list_insert_item(struct list* self, int index, long item);
+void APP_CC
+list_append_list_strdup(struct list* self, struct list* dest, int start_index);
#endif