OLD | NEW |
1 History uses fts3 with an icu-based segmenter. These changes allow | 1 History uses fts3 with an icu-based segmenter. These changes allow |
2 building a sqlite3 binary which can read those files. | 2 building a sqlite3 binary which can read those files. |
3 | 3 |
4 Index: src/shell.c | 4 Index: src/shell.c |
5 =================================================================== | 5 =================================================================== |
6 --- src/shell.c 2009-09-04 13:37:43.000000000 -0700 | 6 --- src/shell.c 2009-09-04 13:37:43.000000000 -0700 |
7 +++ src/shell.c 2009-09-15 11:32:08.000000000 -0700 | 7 +++ src/shell.c 2009-09-15 11:32:08.000000000 -0700 |
8 @@ -3007,6 +3007,14 @@ | 8 @@ -3007,6 +3007,14 @@ |
9 int i; | 9 int i; |
10 int rc = 0; | 10 int rc = 0; |
11 | 11 |
12 + /* Begin evanm patch. */ | 12 + /* Begin evanm patch. */ |
13 + extern int sqlite_shell_init_icu(); | 13 + extern int sqlite_shell_init_icu(); |
14 + if( !sqlite_shell_init_icu() ){ | 14 + if( !sqlite_shell_init_icu() ){ |
15 + fprintf(stderr, "%s: warning: couldn't find icudt38.dll; " | 15 + fprintf(stderr, "%s: warning: couldn't find icudt38.dll; " |
16 + "queries against ICU FTS tables will fail.\n", argv[0]); | 16 + "queries against ICU FTS tables will fail.\n", argv[0]); |
17 + } | 17 + } |
18 + /* End evanm patch. */ | 18 + /* End evanm patch. */ |
19 + | 19 + |
20 Argv0 = argv[0]; | 20 Argv0 = argv[0]; |
21 main_init(&data); | 21 main_init(&data); |
22 stdin_is_interactive = isatty(0); | 22 stdin_is_interactive = isatty(0); |
23 Index: src/shell_icu_linux.c | 23 diff --git src/shell_icu_linux.c src/shell_icu_linux.c |
24 =================================================================== | 24 new file mode 100644 |
25 --- src/shell_icu_linux.c» 1969-12-31 16:00:00.000000000 -0800 | 25 index 0000000..4ad0e42 |
26 +++ src/shell_icu_linux.c» 2009-09-17 13:48:49.000000000 -0700 | 26 --- /dev/null |
27 @@ -0,0 +1,26 @@ | 27 +++ src/shell_icu_linux.c |
| 28 @@ -0,0 +1,27 @@ |
28 +/* Copyright 2007 Google Inc. All Rights Reserved. | 29 +/* Copyright 2007 Google Inc. All Rights Reserved. |
29 +**/ | 30 +**/ |
30 + | 31 + |
31 +#include <limits.h> | 32 +#include <limits.h> |
32 +#include <unistd.h> | 33 +#include <unistd.h> |
| 34 +#include "unicode/putil.h" |
33 +#include "unicode/udata.h" | 35 +#include "unicode/udata.h" |
34 + | 36 + |
35 +/* | 37 +/* |
36 +** This function attempts to load the ICU data tables from a data file. | 38 +** This function attempts to load the ICU data tables from a data file. |
37 +** Returns 0 on failure, nonzero on success. | 39 +** Returns 0 on failure, nonzero on success. |
38 +** This a hack job of icu_utils.cc:Initialize(). It's Chrome-specific code. | 40 +** This a hack job of icu_utils.cc:Initialize(). It's Chrome-specific code. |
39 +*/ | 41 +*/ |
40 +int sqlite_shell_init_icu() { | 42 +int sqlite_shell_init_icu() { |
41 + char bin_dir[PATH_MAX + 1]; | 43 + char bin_dir[PATH_MAX + 1]; |
42 + int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX); | 44 + int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 + | 83 + |
82 + addr = GetProcAddress(module, ICU_DATA_SYMBOL); | 84 + addr = GetProcAddress(module, ICU_DATA_SYMBOL); |
83 + if (!addr) | 85 + if (!addr) |
84 + return 0; | 86 + return 0; |
85 + | 87 + |
86 + err = U_ZERO_ERROR; | 88 + err = U_ZERO_ERROR; |
87 + udata_setCommonData(addr, &err); | 89 + udata_setCommonData(addr, &err); |
88 + | 90 + |
89 + return 1; | 91 + return 1; |
90 +} | 92 +} |
OLD | NEW |