Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: source/tools/toolutil/pkg_icu.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/tools/toolutil/pkg_genc.c ('k') | source/tools/toolutil/pkgitems.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /****************************************************************************** 1 /******************************************************************************
2 * Copyright (C) 2008-2013, International Business Machines 2 * Copyright (C) 2008-2014, International Business Machines
3 * Corporation and others. All Rights Reserved. 3 * Corporation and others. All Rights Reserved.
4 ******************************************************************************* 4 *******************************************************************************
5 */ 5 */
6 #include "unicode/utypes.h" 6 #include "unicode/utypes.h"
7 #include "unicode/putil.h" 7 #include "unicode/putil.h"
8 #include "cstring.h" 8 #include "cstring.h"
9 #include "toolutil.h" 9 #include "toolutil.h"
10 #include "uoptions.h" 10 #include "uoptions.h"
11 #include "uparse.h" 11 #include "uparse.h"
12 #include "package.h" 12 #include "package.h"
13 #include "pkg_icu.h" 13 #include "pkg_icu.h"
14 14
15 #include <stdio.h> 15 #include <stdio.h>
16 #include <stdlib.h> 16 #include <stdlib.h>
17 #include <string.h> 17 #include <string.h>
18 18
19
20 #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
21
22 // read a file list -------------------------------------------------------- *** 19 // read a file list -------------------------------------------------------- ***
23 20
24 U_NAMESPACE_USE 21 U_NAMESPACE_USE
25 22
26 static const struct { 23 static const struct {
27 const char *suffix; 24 const char *suffix;
28 int32_t length; 25 int32_t length;
29 } listFileSuffixes[]={ 26 } listFileSuffixes[]={
30 { ".txt", 4 }, 27 { ".txt", 4 },
31 { ".lst", 4 }, 28 { ".lst", 4 },
32 { ".tmp", 4 } 29 { ".tmp", 4 }
33 }; 30 };
34 31
35 /* check for multiple text file suffixes to see if this list name is a text file name */ 32 /* check for multiple text file suffixes to see if this list name is a text file name */
36 static UBool 33 static UBool
37 isListTextFile(const char *listname) { 34 isListTextFile(const char *listname) {
38 const char *listNameEnd=strchr(listname, 0); 35 const char *listNameEnd=strchr(listname, 0);
39 const char *suffix; 36 const char *suffix;
40 int32_t i, length; 37 int32_t i, length;
41 for(i=0; i<LENGTHOF(listFileSuffixes); ++i) { 38 for(i=0; i<UPRV_LENGTHOF(listFileSuffixes); ++i) {
42 suffix=listFileSuffixes[i].suffix; 39 suffix=listFileSuffixes[i].suffix;
43 length=listFileSuffixes[i].length; 40 length=listFileSuffixes[i].length;
44 if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix , length)) { 41 if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix , length)) {
45 return TRUE; 42 return TRUE;
46 } 43 }
47 } 44 }
48 return FALSE; 45 return FALSE;
49 } 46 }
50 47
51 /* 48 /*
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 pkg->writePackage(outFilename, outType, outComment); 172 pkg->writePackage(outFilename, outType, outComment);
176 173
177 if (pkgDelete) { 174 if (pkgDelete) {
178 delete pkg; 175 delete pkg;
179 delete addListPkg; 176 delete addListPkg;
180 } 177 }
181 178
182 return 0; 179 return 0;
183 } 180 }
184 181
OLDNEW
« no previous file with comments | « source/tools/toolutil/pkg_genc.c ('k') | source/tools/toolutil/pkgitems.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698