/******************************************************************************
- * Copyright (C) 2008-2012, International Business Machines
+ * Copyright (C) 2008-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
#include <stdlib.h>
#include <string.h>
-
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
// read a file list -------------------------------------------------------- ***
U_NAMESPACE_USE
const char *listNameEnd=strchr(listname, 0);
const char *suffix;
int32_t i, length;
- for(i=0; i<LENGTHOF(listFileSuffixes); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(listFileSuffixes); ++i) {
suffix=listFileSuffixes[i].suffix;
length=listFileSuffixes[i].length;
if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix, length)) {
fclose(file);
} else if((listNameEnd-listname)>4 && 0==memcmp(listNameEnd-4, ".dat", 4)) {
// read the ICU .dat package
+ // Accept a .dat file whose name differs from the ToC prefixes.
+ listPkg->setAutoPrefix();
listPkg->readPackage(listname);
} else {
// list the single file itself