|
|
@ -179,3 +179,21 @@ list_insert_item(struct list* self, int index, long item)
|
|
|
|
self->items[index] = 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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|