diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 22:37:01 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 22:37:01 +0000 |
commit | 9995e1749a3eabca54973b07b5cb0e9ea6bcd025 (patch) | |
tree | 0d8febf62d9c07279d1bef941e71c4dd12f7a42c /third_party/sqlite/src | |
parent | 8332b73bf73730995157c96c881c712d58fba7fa (diff) | |
download | chromium_src-9995e1749a3eabca54973b07b5cb0e9ea6bcd025.zip chromium_src-9995e1749a3eabca54973b07b5cb0e9ea6bcd025.tar.gz chromium_src-9995e1749a3eabca54973b07b5cb0e9ea6bcd025.tar.bz2 |
Build the sqlite shell via scons on linux so we can debug the
full text indexed sqlite files.
Review URL: http://codereview.chromium.org/42250
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite/src')
-rwxr-xr-x | third_party/sqlite/src/shell_icu_linux.c | 26 | ||||
-rwxr-xr-x | third_party/sqlite/src/shell_icu_win.c (renamed from third_party/sqlite/src/shell_icu.c) | 0 |
2 files changed, 26 insertions, 0 deletions
diff --git a/third_party/sqlite/src/shell_icu_linux.c b/third_party/sqlite/src/shell_icu_linux.c new file mode 100755 index 0000000..8194db5 --- /dev/null +++ b/third_party/sqlite/src/shell_icu_linux.c @@ -0,0 +1,26 @@ +/* Copyright 2007 Google Inc. All Rights Reserved. +**/ + +#include <limits.h> +#include <unistd.h> +#include "unicode/udata.h" + +/* +** This function attempts to load the ICU data tables from a data file. +** Returns 0 on failure, nonzero on success. +** This a hack job of icu_utils.cc:Initialize(). It's Chrome-specific code. +*/ +int sqlite_shell_init_icu() { + char bin_dir[PATH_MAX + 1]; + int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX); + if (bin_dir_size < 0 || bin_dir_size > PATH_MAX) + return 0; + bin_dir[bin_dir_size] = 0;; + + u_setDataDirectory(bin_dir); + // Only look for the packaged data file; + // the default behavior is to look for individual files. + UErrorCode err = U_ZERO_ERROR; + udata_setFileAccess(UDATA_ONLY_PACKAGES, &err); + return err == U_ZERO_ERROR; +} diff --git a/third_party/sqlite/src/shell_icu.c b/third_party/sqlite/src/shell_icu_win.c index d68cf8f..d68cf8f 100755 --- a/third_party/sqlite/src/shell_icu.c +++ b/third_party/sqlite/src/shell_icu_win.c |