/*
******************************************************************************
-* Copyright (C) 2009, International Business Machines
+* Copyright (C) 2009-2014, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
*/
U_CAPI void U_EXPORT2 ulist_deleteList(UList *list) {
UListNode *listHead = NULL;
- UListNode *listPointer = NULL;
-
+
if (list != NULL) {
listHead = list->head;
- listPointer = listHead;
while (listHead != NULL) {
- listPointer = listHead->next;
-
+ UListNode *listPointer = listHead->next;
+
if (listHead->forceDelete) {
uprv_free(listHead->data);
}
-
+
uprv_free(listHead);
listHead = listPointer;
}
}
U_CAPI const char * U_EXPORT2 ulist_next_keyword_value(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
+ const char *s;
if (U_FAILURE(*status)) {
return NULL;
}
-
- /* TODO: resultLength; */
-
- return (const char *)ulist_getNext((UList *)(en->context));
+
+ s = (const char *)ulist_getNext((UList *)(en->context));
+ if (s != NULL && resultLength != NULL) {
+ *resultLength = uprv_strlen(s);
+ }
+ return s;
}
U_CAPI void U_EXPORT2 ulist_reset_keyword_values_iterator(UEnumeration *en, UErrorCode *status) {