Rename InitGoogle to mozc::InitMozc.
Currently flags.cc defines InitGoogle in which logging is initialized.
This is causing circular dependency between logging.cc and flags.cc.
This CL addresses the issue.
This CL also renames InitGoogle to mozc::InitMozc to make it clear that
the function is responsible for initializing only Mozc-related
components, and has nothing to do with any other libraries even if they
were developed by Google.
BUG=
TEST=unittest
REF_BUG=19010851
REF_CL=85680996,85596766,85688252,85688262,85688306,85689019
Noriyuki Takahashi authored 8 years ago
Yohei Yukawa committed 8 years ago
105 | 105 | 'flags.cc', |
106 | 106 | 'hash.cc', |
107 | 107 | 'init.cc', |
108 | 'init_mozc.cc', | |
108 | 109 | 'japanese_util_rule.cc', |
109 | 110 | 'logging.cc', |
110 | 111 | 'mmap.cc', |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/cpu_stats.h" | |
30 | ||
31 | 29 | #include <iostream> |
32 | 30 | #include <memory> |
33 | 31 | #include <string> |
34 | 32 | |
33 | #include "base/cpu_stats.h" | |
35 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
36 | 36 | #include "base/port.h" |
37 | 37 | #include "base/thread.h" |
38 | 38 | #include "base/util.h" |
59 | 59 | } // namespace |
60 | 60 | |
61 | 61 | int main(int argc, char **argv) { |
62 | InitGoogle(argv[0], &argc, &argv, false); | |
62 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
63 | 63 | |
64 | 64 | std::unique_ptr<DummyThread[]> threads; |
65 | 65 |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/encryptor.h" | |
30 | ||
31 | 29 | #include <iostream> |
32 | 30 | #include <string> |
31 | ||
32 | #include "base/encryptor.h" | |
33 | 33 | #include "base/file_stream.h" |
34 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
35 | 36 | #include "base/logging.h" |
36 | 37 | #include "base/mmap.h" |
37 | 38 | #include "base/util.h" |
60 | 61 | } // namespace |
61 | 62 | |
62 | 63 | int main(int argc, char **argv) { |
63 | InitGoogle(argv[0], &argc, &argv, false); | |
64 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
64 | 65 | |
65 | 66 | if (!FLAGS_iv.empty()) { |
66 | 67 | CHECK_EQ(16, FLAGS_iv.size()) << "iv size must be 16 byte"; |
29 | 29 | |
30 | 30 | #include "base/flags.h" |
31 | 31 | |
32 | #include <stdlib.h> // for atexit, getenv | |
33 | #ifdef OS_WIN | |
34 | #include <windows.h> | |
35 | #endif // OS_WIN | |
32 | #include <cstdlib> // for getenv | |
36 | 33 | #include <cstring> |
37 | 34 | #include <map> |
38 | 35 | #include <sstream> |
39 | 36 | #include <string> |
40 | 37 | #include <vector> |
41 | 38 | |
42 | #include "base/crash_report_handler.h" | |
43 | #include "base/init.h" | |
44 | 39 | #include "base/number_util.h" |
45 | 40 | #include "base/singleton.h" |
46 | 41 | #include "base/system_util.h" |
47 | 42 | #include "base/util.h" |
48 | ||
49 | DEFINE_string(program_invocation_name, "", "Program name copied from argv[0]."); | |
50 | 43 | |
51 | 44 | namespace mozc_flags { |
52 | 45 | namespace { |
258 | 251 | |
259 | 252 | } // namespace mozc_flags |
260 | 253 | |
261 | namespace { | |
262 | ||
263 | #ifdef OS_WIN | |
264 | LONG CALLBACK ExitProcessExceptionFilter( | |
265 | EXCEPTION_POINTERS *ExceptionInfo) { | |
266 | // Currently, we haven't found good way to perform both | |
267 | // "send mininump" and "exit the process gracefully". | |
268 | ::ExitProcess(static_cast<UINT>(-1)); | |
269 | return EXCEPTION_EXECUTE_HANDLER; | |
270 | } | |
271 | #endif // OS_WIN | |
272 | ||
273 | void InitGoogleInternal(const char *argv0, | |
274 | int *argc, char ***argv, | |
275 | bool remove_flags) { | |
276 | mozc_flags::FlagUtil::SetFlag("program_invocation_name", *argv[0]); | |
277 | mozc_flags::ParseCommandLineFlags(argc, argv, remove_flags); | |
278 | if (*argc > 0) { | |
279 | mozc::Logging::InitLogStream((*argv)[0]); | |
280 | } else { | |
281 | mozc::Logging::InitLogStream(); | |
282 | } | |
283 | ||
284 | mozc::RunInitializers(); // do all static initialization | |
285 | } | |
286 | ||
287 | } // namespace | |
288 | ||
289 | // not install breakpad | |
290 | // This function is defined in global namespace. | |
291 | void InitGoogle(const char *arg0, | |
292 | int *argc, char ***argv, | |
293 | bool remove_flags) { | |
294 | #ifdef OS_WIN | |
295 | // InitGoogle() is supposed to be used for code generator or | |
296 | // other programs which are not included in the production code. | |
297 | // In these code, we don't want to show any error messages when | |
298 | // exceptions are raised. This is important to keep | |
299 | // our continuous build stable. | |
300 | ::SetUnhandledExceptionFilter(ExitProcessExceptionFilter); | |
301 | #endif // OS_WIN | |
302 | ||
303 | InitGoogleInternal(arg0, argc, argv, remove_flags); | |
304 | } | |
305 |
33 | 33 | |
34 | 34 | |
35 | 35 | #include <string> |
36 | ||
36 | 37 | #include "base/port.h" |
37 | 38 | |
38 | 39 | namespace mozc_flags { |
48 | 49 | const void *default_storage, |
49 | 50 | int shorttpe, |
50 | 51 | const char *help); |
51 | virtual ~FlagRegister(); | |
52 | ~FlagRegister(); | |
53 | ||
52 | 54 | private: |
53 | 55 | Flag *flag_; |
54 | 56 | }; |
55 | 57 | |
56 | uint32 ParseCommandLineFlags(int *argc, char*** argv, | |
57 | bool remove_flags); | |
58 | uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags); | |
59 | ||
58 | 60 | } // mozc_flags |
59 | ||
60 | void InitGoogle(const char *arg0, | |
61 | int *argc, char ***argv, | |
62 | bool remove_flags); | |
63 | 61 | |
64 | 62 | #define DEFINE_VARIABLE(type, shorttype, name, value, help) \ |
65 | 63 | namespace mozc_flags_fL##shorttype { \ |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | #include "base/init_mozc.h" | |
30 | ||
31 | #ifdef OS_WIN | |
32 | #include <windows.h> | |
33 | #endif // OS_WIN | |
34 | ||
35 | #include "base/flags.h" | |
36 | #include "base/init.h" | |
37 | #include "base/logging.h" | |
38 | ||
39 | DEFINE_string(program_invocation_name, "", "Program name copied from argv[0]."); | |
40 | ||
41 | namespace mozc { | |
42 | ||
43 | #ifdef OS_WIN | |
44 | namespace { | |
45 | ||
46 | LONG CALLBACK ExitProcessExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo) { | |
47 | // Currently, we haven't found a good way to perform both | |
48 | // "send mininump" and "exit the process gracefully". | |
49 | ::ExitProcess(static_cast<UINT>(-1)); | |
50 | return EXCEPTION_EXECUTE_HANDLER; | |
51 | } | |
52 | ||
53 | } // namespace | |
54 | #endif // OS_WIN | |
55 | ||
56 | void InitMozc(const char *arg0, int *argc, char ***argv, bool remove_flags) { | |
57 | #ifdef OS_WIN | |
58 | // InitMozc() is supposed to be used for code generator or | |
59 | // other programs which are not included in the production code. | |
60 | // In these code, we don't want to show any error messages when | |
61 | // exceptions are raised. This is important to keep | |
62 | // our continuous build stable. | |
63 | ::SetUnhandledExceptionFilter(ExitProcessExceptionFilter); | |
64 | #endif // OS_WIN | |
65 | FLAGS_program_invocation_name = *argv[0]; | |
66 | mozc_flags::ParseCommandLineFlags(argc, argv, remove_flags); | |
67 | ||
68 | if (*argc > 0) { | |
69 | Logging::InitLogStream((*argv)[0]); | |
70 | } else { | |
71 | Logging::InitLogStream(); | |
72 | } | |
73 | ||
74 | RunInitializers(); | |
75 | } | |
76 | ||
77 | } // namespace mozc |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | #ifndef MOZC_BASE_INIT_MOZC_H_ | |
30 | #define MOZC_BASE_INIT_MOZC_H_ | |
31 | ||
32 | namespace mozc { | |
33 | ||
34 | // Initializes all the modules, such as flags and logging. | |
35 | void InitMozc(const char *arg0, int *argc, char ***argv, bool remove_flags); | |
36 | ||
37 | } // namespace mozc | |
38 | ||
39 | #endif // MOZC_BASE_INIT_MOZC_H_ |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/mac_util.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | #include <vector> |
33 | 31 | |
34 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
34 | #include "base/mac_util.h" | |
35 | 35 | #include "base/util.h" |
36 | 36 | |
37 | 37 | DEFINE_bool(label_for_suffix, false, |
55 | 55 | using mozc::MacUtil; |
56 | 56 | |
57 | 57 | int main(int argc, char **argv) { |
58 | InitGoogle(argv[0], &argc, &argv, false); | |
58 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
59 | 59 | |
60 | 60 | if (FLAGS_label_for_suffix) { |
61 | 61 | cout << MacUtil::GetLabelForSuffix(FLAGS_suffix) << endl; |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/flags.h" | |
30 | #include "base/init_mozc.h" | |
31 | #include "base/logging.h" | |
29 | 32 | #include "base/password_manager.h" |
30 | ||
31 | #include "base/flags.h" | |
32 | #include "base/logging.h" | |
33 | 33 | #include "base/util.h" |
34 | 34 | |
35 | 35 | int main(int argc,char **argv) { |
36 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
37 | 37 | string password; |
38 | 38 | if (!mozc::PasswordManager::GetPassword(&password)) { |
39 | 39 | LOG(INFO) << "GetPassword failed"; |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/process.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | |
33 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
34 | 33 | #include "base/logging.h" |
34 | #include "base/process.h" | |
35 | 35 | |
36 | 36 | DEFINE_string(open_browser, "", "URL"); |
37 | 37 | DEFINE_string(spawn_process, "", "path"); |
38 | 38 | |
39 | 39 | int main(int argc, char **argv) { |
40 | InitGoogle(argv[0], &argc, &argv, false); | |
40 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
41 | 41 | if (!FLAGS_open_browser.empty()) { |
42 | 42 | if (!mozc::Process::OpenBrowser(FLAGS_open_browser)) { |
43 | 43 | LOG(INFO) << "Failed to open: " << FLAGS_open_browser; |
34 | 34 | #include <string> |
35 | 35 | |
36 | 36 | #include "base/flags.h" |
37 | #include "base/init_mozc.h" | |
37 | 38 | #include "base/logging.h" |
38 | 39 | |
39 | 40 | DEFINE_int32(sleep_time, 30, "sleep 30 sec"); |
40 | 41 | DEFINE_string(name, "named_event_test", "name for named event"); |
41 | 42 | |
42 | 43 | int main(int argc, char **argv) { |
43 | InitGoogle(argv[0], &argc, &argv, false); | |
44 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
44 | 45 | |
45 | 46 | mozc::ProcessMutex mutex(FLAGS_name.c_str()); |
46 | 47 |
51 | 51 | // return the runlevel of current process |
52 | 52 | // NOTE: |
53 | 53 | // DO NOT USE logging library inside this method, |
54 | // since GetRunLevel() is called before InitGoogle(). | |
54 | // since GetRunLevel() is called before mozc::InitMozc(). | |
55 | 55 | // Logging stream and flags may not be initialized. |
56 | 56 | // Also, make sure that the code inside this function |
57 | 57 | // never raises any exceptions. Exception handler is installed |
58 | // inside InitGoogle(). | |
58 | // inside mozc::InitMozc(). | |
59 | 59 | static RunLevelType GetRunLevel(RunLevel::RequestType type); |
60 | 60 | |
61 | 61 | static bool IsValidClientRunLevel() { |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/run_level.h" | |
30 | ||
31 | 29 | #include <iostream> |
32 | 30 | #include <string> |
33 | 31 | #include <vector> |
34 | 32 | |
35 | 33 | #include "base/flags.h" |
34 | #include "base/init_mozc.h" | |
35 | #include "base/run_level.h" | |
36 | 36 | |
37 | 37 | DEFINE_bool(server, false, "server mode"); |
38 | 38 | DEFINE_bool(client, false, "client mode"); |
40 | 40 | // This is a simple command line tool |
41 | 41 | // too check RunLevel class |
42 | 42 | int main(int argc, char **argv) { |
43 | InitGoogle(argv[0], &argc, &argv, false); | |
43 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
44 | 44 | |
45 | 45 | mozc::RunLevel::RequestType type = mozc::RunLevel::SERVER; |
46 | 46 |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "base/stopwatch.h" | |
30 | ||
29 | #include <iostream> | |
31 | 30 | #include <string> |
32 | #include <iostream> | |
33 | 31 | |
34 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
34 | #include "base/stopwatch.h" | |
35 | 35 | #include "base/util.h" |
36 | 36 | |
37 | 37 | DEFINE_int32(sleep_time, 1000, "sleep time"); |
38 | 38 | |
39 | 39 | int main(int argc, char **argv) { |
40 | InitGoogle(argv[0], &argc, &argv, false); | |
40 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
41 | 41 | |
42 | 42 | mozc::Stopwatch stopwatch; |
43 | 43 | stopwatch.Start(); |
32 | 32 | #include "base/double_array.h" |
33 | 33 | #include "base/file_stream.h" |
34 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
35 | 36 | #include "base/logging.h" |
36 | 37 | #include "base/util.h" |
37 | 38 | #include "third_party/darts/v0_32/darts.h" |
133 | 134 | } // namespace mozc |
134 | 135 | |
135 | 136 | int main(int argc, char **argv) { |
136 | InitGoogle(argv[0], &argc, &argv, false); | |
137 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
137 | 138 | mozc::Compile(FLAGS_input, FLAGS_output); |
138 | 139 | return 0; |
139 | 140 | } |
39 | 39 | |
40 | 40 | #include "base/clock.h" |
41 | 41 | #include "base/flags.h" |
42 | #include "base/init_mozc.h" | |
42 | 43 | #include "base/logging.h" |
43 | 44 | #include "base/mutex.h" |
44 | 45 | #include "base/pepper_file_util.h" |
469 | 470 | namespace pp { |
470 | 471 | |
471 | 472 | Module *CreateModule() { |
472 | // We use dummy argc and argv to call InitGoogle(). | |
473 | // We use dummy argc and argv to call mozc::InitMozc(). | |
473 | 474 | int argc = 1; |
474 | 475 | char argv0[] = "NaclModule"; |
475 | 476 | char *argv_body[] = {argv0, NULL}; |
476 | 477 | char **argv = argv_body; |
477 | InitGoogle(argv[0], &argc, &argv, true); | |
478 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
478 | 479 | |
479 | 480 | return new mozc::session::NaclSessionHandlerModule(); |
480 | 481 | } |
30 | 30 | #include <cmath> |
31 | 31 | #include <iostream> // NOLINT |
32 | 32 | #include <iterator> |
33 | #include <string> | |
33 | 34 | #include <vector> |
34 | #include <string> | |
35 | 35 | |
36 | 36 | #include "base/file_stream.h" |
37 | 37 | #include "base/flags.h" |
38 | #include "base/init_mozc.h" | |
38 | 39 | #include "base/logging.h" |
39 | 40 | #include "base/port.h" |
40 | 41 | #include "base/singleton.h" |
364 | 365 | } // namespace mozc |
365 | 366 | |
366 | 367 | int main(int argc, char **argv) { |
367 | InitGoogle(argv[0], &argc, &argv, false); | |
368 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
368 | 369 | |
369 | 370 | vector<mozc::TestScenarioInterface *> tests; |
370 | 371 | vector<mozc::Result *> results; |
34 | 34 | |
35 | 35 | #include "base/file_stream.h" |
36 | 36 | #include "base/flags.h" |
37 | #include "base/init_mozc.h" | |
37 | 38 | #include "base/logging.h" |
38 | 39 | #include "base/multifile.h" |
39 | 40 | #include "base/port.h" |
199 | 200 | |
200 | 201 | |
201 | 202 | int main(int argc, char* argv[]) { |
202 | InitGoogle(argv[0], &argc, &argv, true); | |
203 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
203 | 204 | |
204 | 205 | mozc::client::Client client; |
205 | 206 | if (!FLAGS_server_path.empty()) { |
38 | 38 | #include "base/file_stream.h" |
39 | 39 | #include "base/file_util.h" |
40 | 40 | #include "base/flags.h" |
41 | #include "base/init_mozc.h" | |
41 | 42 | #include "base/logging.h" |
42 | 43 | #include "base/port.h" |
43 | 44 | #include "base/system_util.h" |
168 | 169 | } // namespace mozc |
169 | 170 | |
170 | 171 | int main(int argc, char **argv) { |
171 | InitGoogle(argv[0], &argc, &argv, false); | |
172 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
172 | 173 | |
173 | 174 | if (!FLAGS_profile_dir.empty()) { |
174 | 175 | mozc::FileUtil::CreateDirectory(FLAGS_profile_dir); |
39 | 39 | |
40 | 40 | #include "base/file_stream.h" |
41 | 41 | #include "base/flags.h" |
42 | #include "base/init_mozc.h" | |
42 | 43 | #include "base/logging.h" |
43 | 44 | #include "base/port.h" |
44 | 45 | #include "base/util.h" |
60 | 61 | DECLARE_bool(logtostderr); |
61 | 62 | |
62 | 63 | int main(int argc, char **argv) { |
63 | InitGoogle(argv[0], &argc, &argv, false); | |
64 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
64 | 65 | |
65 | 66 | FLAGS_logtostderr = true; |
66 | 67 |
29 | 29 | #include <iostream> // NOLINT |
30 | 30 | |
31 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
32 | 33 | #include "base/logging.h" |
33 | 34 | #include "client/client.h" |
34 | 35 | |
35 | 36 | // Simple command line tool to ping mozc server |
36 | 37 | int main(int argc, char **argv) { |
37 | InitGoogle(argv[0], &argc, &argv, false); | |
38 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
38 | 39 | mozc::client::Client client; |
39 | 40 | |
40 | 41 | if (client.PingServer()) { |
29 | 29 | #include <iostream> // NOLINT |
30 | 30 | |
31 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
32 | 33 | #include "base/logging.h" |
33 | 34 | #include "client/client.h" |
34 | 35 | |
37 | 38 | |
38 | 39 | // simple command line tool to launch mozc server |
39 | 40 | int main(int argc, char **argv) { |
40 | InitGoogle(argv[0], &argc, &argv, false); | |
41 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
41 | 42 | mozc::client::Client client; |
42 | 43 | |
43 | 44 | if (FLAGS_shutdown) { |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "composer/composer.h" | |
30 | ||
31 | 29 | #include <iostream> // NOLINT |
32 | 30 | #include <memory> |
33 | 31 | #include <string> |
34 | 32 | |
35 | 33 | #include "base/flags.h" |
34 | #include "base/init_mozc.h" | |
35 | #include "composer/composer.h" | |
36 | 36 | #include "composer/composition_interface.h" |
37 | 37 | #include "composer/table.h" |
38 | 38 | #include "protocol/commands.pb.h" |
44 | 44 | using ::mozc::commands::Request; |
45 | 45 | |
46 | 46 | int main(int argc, char **argv) { |
47 | InitGoogle(argv[0], &argc, &argv, false); | |
47 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
48 | 48 | |
49 | 49 | mozc::composer::Table table; |
50 | 50 | table.LoadFromFile(FLAGS_table.c_str()); |
30 | 30 | #include <sstream> |
31 | 31 | |
32 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
33 | 34 | #include "composer/internal/composition.h" |
34 | 35 | #include "composer/table.h" |
35 | 36 | |
38 | 39 | |
39 | 40 | |
40 | 41 | int main(int argc, char **argv) { |
41 | InitGoogle(argv[0], &argc, &argv, false); | |
42 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
42 | 43 | |
43 | 44 | mozc::composer::Table table; |
44 | 45 | table.LoadFromFile(FLAGS_table.c_str()); |
30 | 30 | #include <string> |
31 | 31 | |
32 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
33 | 34 | #include "composer/internal/converter.h" |
34 | 35 | #include "composer/table.h" |
35 | 36 | |
37 | 38 | "preedit conversion table file."); |
38 | 39 | |
39 | 40 | int main(int argc, char **argv) { |
40 | InitGoogle(argv[0], &argc, &argv, false); | |
41 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
41 | 42 | |
42 | 43 | mozc::composer::Table table; |
43 | 44 | table.LoadFromFile(FLAGS_table.c_str()); |
34 | 34 | |
35 | 35 | #include "base/file_stream.h" |
36 | 36 | #include "base/flags.h" |
37 | #include "base/init_mozc.h" | |
37 | 38 | #include "base/logging.h" |
38 | 39 | #include "base/number_util.h" |
39 | 40 | #include "base/port.h" |
376 | 377 | } // namespace mozc |
377 | 378 | |
378 | 379 | int main(int argc, char **argv) { |
379 | InitGoogle(argv[0], &argc, &argv, false); | |
380 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
380 | 381 | |
381 | 382 | if (!FLAGS_user_profile_dir.empty()) { |
382 | 383 | mozc::SystemUtil::SetUserProfileDirectory(FLAGS_user_profile_dir); |
32 | 32 | #include <vector> |
33 | 33 | |
34 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
35 | 36 | #include "base/util.h" |
36 | 37 | #include "converter/quality_regression_util.h" |
37 | 38 | #include "engine/engine_factory.h" |
44 | 45 | using mozc::quality_regression::QualityRegressionUtil; |
45 | 46 | |
46 | 47 | int main(int argc, char **argv) { |
47 | InitGoogle(argv[0], &argc, &argv, false); | |
48 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
48 | 49 | |
49 | 50 | std::unique_ptr<EngineInterface> engine(EngineFactory::Create()); |
50 | 51 | QualityRegressionUtil util(engine->GetConverter()); |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "converter/gen_segmenter_bitarray.h" |
31 | 32 | |
32 | 33 | namespace { |
36 | 37 | DEFINE_string(output, "", "header filename for chromeos segmenter"); |
37 | 38 | |
38 | 39 | int main(int argc, char **argv) { |
39 | InitGoogle(argv[0], &argc, &argv, true); | |
40 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
40 | 41 | mozc::SegmenterBitarrayGenerator::GenerateBitarray( |
41 | 42 | kLSize, kRSize, &IsBoundaryInternal, FLAGS_output); |
42 | 43 | return 0; |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "converter/gen_segmenter_bitarray.h" |
31 | 32 | |
32 | 33 | namespace { |
36 | 37 | DEFINE_string(output, "", "header filename for google segmenter"); |
37 | 38 | |
38 | 39 | int main(int argc, char **argv) { |
39 | InitGoogle(argv[0], &argc, &argv, true); | |
40 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
40 | 41 | mozc::SegmenterBitarrayGenerator::GenerateBitarray( |
41 | 42 | kLSize, kRSize, &IsBoundaryInternal, FLAGS_output); |
42 | 43 | return 0; |
29 | 29 | #include <string> |
30 | 30 | |
31 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
32 | 33 | #include "base/logging.h" |
33 | 34 | #include "base/version.h" |
34 | 35 | #include "converter/boundary_struct.h" |
42 | 43 | namespace mozc { |
43 | 44 | namespace { |
44 | 45 | |
46 | #include "data_manager/@DIR@/pos_matcher_data.h" | |
45 | 47 | #include "data_manager/@DIR@/user_pos_data.h" |
46 | #include "data_manager/@DIR@/pos_matcher_data.h" | |
47 | 48 | |
48 | 49 | } // namespace |
49 | 50 | |
61 | 62 | } // namespace mozc |
62 | 63 | |
63 | 64 | int main(int argc, char **argv) { |
64 | InitGoogle(argv[0], &argc, &argv, false); | |
65 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
65 | 66 | |
66 | 67 | if (FLAGS_output.empty()) { |
67 | 68 | LOG(FATAL) << "output flag is needed"; |
29 | 29 | #include <string> |
30 | 30 | |
31 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
32 | 33 | #include "base/logging.h" |
33 | 34 | #include "base/version.h" |
34 | 35 | #include "converter/boundary_struct.h" |
35 | 36 | #include "data_manager/packed/system_dictionary_data_packer.h" |
36 | #include "dictionary/suffix_dictionary_token.h" | |
37 | 37 | #include "dictionary/pos_group.h" |
38 | 38 | #include "dictionary/pos_matcher.h" |
39 | #include "dictionary/suffix_dictionary_token.h" | |
39 | 40 | #include "dictionary/user_pos.h" |
40 | 41 | #include "rewriter/correction_rewriter.h" |
41 | 42 | #include "rewriter/counter_suffix.h" |
52 | 53 | namespace mozc { |
53 | 54 | namespace { |
54 | 55 | |
55 | #include "data_manager/@DIR@/user_pos_data.h" | |
56 | #include "data_manager/@DIR@/boundary_data.h" | |
57 | #include "data_manager/@DIR@/embedded_collocation_data.h" | |
58 | #include "data_manager/@DIR@/embedded_collocation_suppression_data.h" | |
59 | #include "data_manager/@DIR@/embedded_connection_data.h" | |
60 | #include "data_manager/@DIR@/embedded_dictionary_data.h" | |
61 | #include "data_manager/@DIR@/pos_group_data.h" | |
56 | 62 | #include "data_manager/@DIR@/pos_matcher_data.h" |
57 | #include "data_manager/@DIR@/pos_group_data.h" | |
58 | #include "data_manager/@DIR@/boundary_data.h" | |
59 | #include "data_manager/@DIR@/suffix_data.h" | |
60 | 63 | #include "data_manager/@DIR@/reading_correction_data.h" |
61 | 64 | #include "data_manager/@DIR@/segmenter_data.h" |
62 | #include "data_manager/@DIR@/embedded_collocation_suppression_data.h" | |
65 | #include "data_manager/@DIR@/suffix_data.h" | |
63 | 66 | #include "data_manager/@DIR@/suggestion_filter_data.h" |
64 | #include "data_manager/@DIR@/embedded_connection_data.h" | |
65 | #include "data_manager/@DIR@/embedded_dictionary_data.h" | |
66 | #include "data_manager/@DIR@/embedded_collocation_data.h" | |
67 | 67 | #include "data_manager/@DIR@/symbol_rewriter_data.h" |
68 | #include "data_manager/@DIR@/user_pos_data.h" | |
68 | 69 | #ifndef NO_USAGE_REWRITER |
69 | 70 | #include "rewriter/usage_rewriter_data.h" |
70 | 71 | #endif // NO_USAGE_REWRITER |
127 | 128 | } // namespace mozc |
128 | 129 | |
129 | 130 | int main(int argc, char **argv) { |
130 | InitGoogle(argv[0], &argc, &argv, false); | |
131 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
131 | 132 | |
132 | 133 | if (FLAGS_output.empty()) { |
133 | 134 | LOG(FATAL) << "output flag is needed"; |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "converter/gen_segmenter_bitarray.h" |
31 | 32 | |
32 | 33 | namespace { |
36 | 37 | DEFINE_string(output, "", "header filename for mock segmenter"); |
37 | 38 | |
38 | 39 | int main(int argc, char **argv) { |
39 | InitGoogle(argv[0], &argc, &argv, true); | |
40 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
40 | 41 | mozc::SegmenterBitarrayGenerator::GenerateBitarray( |
41 | 42 | kLSize, kRSize, &IsBoundaryInternal, FLAGS_output); |
42 | 43 | return 0; |
40 | 40 | #include "base/codegen_bytearray_stream.h" |
41 | 41 | #include "base/file_stream.h" |
42 | 42 | #include "base/flags.h" |
43 | #include "base/init_mozc.h" | |
43 | 44 | #include "base/util.h" |
44 | 45 | #include "data_manager/testing/mock_user_pos_manager.h" |
45 | 46 | #include "data_manager/user_pos_manager.h" |
92 | 93 | } // namespace mozc |
93 | 94 | |
94 | 95 | int main(int argc, char **argv) { |
95 | InitGoogle(argv[0], &argc, &argv, false); | |
96 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
96 | 97 | |
97 | 98 | string system_dictionary_input, reading_correction_input; |
98 | 99 | mozc::GetInputFileName(FLAGS_input, |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include <iostream> | |
29 | 30 | #include <string> |
30 | #include <iostream> | |
31 | 31 | |
32 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
33 | 34 | #include "dictionary/user_dictionary_importer.h" |
34 | 35 | #include "protocol/user_dictionary_storage.pb.h" |
35 | 36 | |
36 | 37 | int main(int argc, char **argv) { |
37 | InitGoogle(argv[0], &argc, &argv, false); | |
38 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
38 | 39 | |
39 | 40 | mozc::user_dictionary::UserDictionary user_dic; |
40 | 41 | mozc::UserDictionaryImporter::ImportFromMSIME(&user_dic); |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunAboutDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunAboutDialog(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunAdministrationDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunAdministrationDialog(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunCharacterPalette(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunCharacterPalette(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunHandWriting(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunHandWriting(argc, argv); |
37 | 38 | } |
29 | 29 | // The main function of configure dialog for Mozc. |
30 | 30 | |
31 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
32 | 33 | #include "base/winmain.h" |
33 | 34 | |
34 | 35 | int RunConfigDialog(int argc, char *argv[]); |
35 | 36 | |
36 | 37 | int main(int argc, char *argv[]) { |
37 | InitGoogle(argv[0], &argc, &argv, false); | |
38 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
38 | 39 | return RunConfigDialog(argc, argv); |
39 | 40 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunConfirmationDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunConfirmationDialog(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunDictionaryTool(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunDictionaryTool(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunErrorMessageDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunErrorMessageDialog(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunPostInstallDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunPostInstallDialog(argc, argv); |
37 | 38 | } |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunSetDefaultDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunSetDefaultDialog(argc, argv); |
37 | 38 | } |
42 | 42 | #include "base/crash_report_handler.h" |
43 | 43 | #include "base/file_util.h" |
44 | 44 | #include "base/flags.h" |
45 | #include "base/init_mozc.h" | |
45 | 46 | #include "base/logging.h" |
46 | 47 | #include "base/password_manager.h" |
47 | 48 | #include "base/run_level.h" |
99 | 100 | "--fromenv=mode,error_type,confirmation_type,register_prelauncher"); |
100 | 101 | int new_argc = 2; |
101 | 102 | char **new_argv = tmp.get(); |
102 | InitGoogle(new_argv[0], &new_argc, &new_argv, false); | |
103 | mozc::InitMozc(new_argv[0], &new_argc, &new_argv, false); | |
103 | 104 | delete [] tmp[0]; |
104 | 105 | delete [] tmp[1]; |
105 | 106 | #else // OS_MACOSX |
106 | InitGoogle(argv[0], &argc, &argv, false); | |
107 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
107 | 108 | #endif // OS_MACOSX |
108 | 109 | |
109 | 110 | #ifdef OS_MACOSX |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "base/winmain.h" |
31 | 32 | |
32 | 33 | int RunWordRegisterDialog(int argc, char *argv[]); |
33 | 34 | |
34 | 35 | int main(int argc, char *argv[]) { |
35 | InitGoogle(argv[0], &argc, &argv, false); | |
36 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
36 | 37 | return RunWordRegisterDialog(argc, argv); |
37 | 38 | } |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "ipc/ipc.h" | |
30 | ||
31 | 29 | #include <cstring> |
32 | 30 | #include <iostream> // NOLINT |
33 | 31 | #include <string> |
34 | 32 | #include <vector> |
35 | 33 | |
36 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
37 | 36 | #include "base/logging.h" |
38 | 37 | #include "base/port.h" |
39 | 38 | #include "base/thread.h" |
39 | #include "ipc/ipc.h" | |
40 | 40 | |
41 | 41 | DEFINE_string(server_address, "ipc_test", ""); |
42 | 42 | DEFINE_bool(test, false, "automatic test mode"); |
95 | 95 | } // namespace mozc |
96 | 96 | |
97 | 97 | int main(int argc, char **argv) { |
98 | InitGoogle(argv[0], &argc, &argv, false); | |
98 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
99 | 99 | |
100 | 100 | if (FLAGS_test) { |
101 | 101 | mozc::EchoServer con(FLAGS_server_address, 10, 1000); |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "ipc/ipc_path_manager.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | |
33 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
34 | 33 | #include "base/logging.h" |
35 | 34 | #include "base/port.h" |
36 | 35 | #include "base/util.h" |
36 | #include "ipc/ipc_path_manager.h" | |
37 | 37 | |
38 | 38 | DEFINE_bool(client, false, "client mode"); |
39 | 39 | DEFINE_bool(server, false, "server mode"); |
41 | 41 | |
42 | 42 | // command line tool to check the behavior of IPCPathManager |
43 | 43 | int main(int argc, char **argv) { |
44 | InitGoogle(argv[0], &argc, &argv, false); | |
44 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
45 | 45 | |
46 | 46 | mozc::IPCPathManager *manager = |
47 | 47 | mozc::IPCPathManager::GetIPCPathManager(FLAGS_name); |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "ipc/named_event.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | |
33 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
34 | 33 | #include "base/logging.h" |
35 | 34 | #include "base/port.h" |
35 | #include "ipc/named_event.h" | |
36 | 36 | |
37 | 37 | DEFINE_bool(listener, true, "listener mode"); |
38 | 38 | DEFINE_bool(notifier, false, "notifier mode"); |
41 | 41 | DEFINE_string(name, "named_event_test", "name for named event"); |
42 | 42 | |
43 | 43 | int main(int argc, char **argv) { |
44 | InitGoogle(argv[0], &argc, &argv, false); | |
44 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
45 | 45 | |
46 | 46 | if (FLAGS_notifier) { |
47 | 47 | mozc::NamedEventNotifier notifier(FLAGS_name.c_str()); |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "ipc/process_watch_dog.h" | |
30 | ||
31 | 29 | #include <iostream> // NOLINT |
32 | 30 | #include <string> |
33 | 31 | #include <vector> |
34 | 32 | |
35 | 33 | #include "base/flags.h" |
34 | #include "base/init_mozc.h" | |
36 | 35 | #include "base/logging.h" |
37 | 36 | #include "base/port.h" |
38 | 37 | #include "base/util.h" |
38 | #include "ipc/process_watch_dog.h" | |
39 | 39 | |
40 | 40 | DEFINE_int32(timeout, -1, "set timeout"); |
41 | 41 | |
49 | 49 | } // namespace mozc |
50 | 50 | |
51 | 51 | int main(int argc, char **argv) { |
52 | InitGoogle(argv[0], &argc, &argv, false); | |
52 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
53 | 53 | |
54 | 54 | mozc::TestProcessWatchDog dog; |
55 | 55 |
31 | 31 | #import "DialogsController.h" |
32 | 32 | |
33 | 33 | #include "base/flags.h" |
34 | #include "base/init_mozc.h" | |
34 | 35 | |
35 | 36 | int main(int argc, char *argv[]) { |
36 | 37 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
37 | InitGoogle(argv[0], &argc, &argv, false); | |
38 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
38 | 39 | |
39 | 40 | DialogsController *dialogs = [[[DialogsController alloc] init] autorelease]; |
40 | 41 | [NSBundle loadNibNamed:@"Dialogs" owner:dialogs]; |
38 | 38 | #include "base/const.h" |
39 | 39 | #include "base/crash_report_handler.h" |
40 | 40 | #include "base/flags.h" |
41 | #include "base/init_mozc.h" | |
41 | 42 | #include "base/logging.h" |
42 | 43 | #include "base/run_level.h" |
43 | 44 | #include "client/client.h" |
54 | 55 | mozc::CrashReportHandler::Initialize(false); |
55 | 56 | } |
56 | 57 | #endif |
57 | InitGoogle(argv[0], &argc, &argv, false); | |
58 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
58 | 59 | |
59 | 60 | IMKServer *imkServer = [GoogleJapaneseInputServer getServer]; |
60 | 61 | if (!imkServer) { |
0 | 0 | MAJOR=2 |
1 | 1 | MINOR=17 |
2 | BUILD=2167 | |
2 | BUILD=2168 | |
3 | 3 | REVISION=102 |
4 | 4 | # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be |
5 | 5 | # downloaded by NaCl Mozc. |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "net/http_client.h" | |
30 | ||
31 | 29 | #include <iostream> // NOLINT |
32 | 30 | #include <string> |
33 | 31 | |
34 | 32 | #include "base/file_stream.h" |
35 | 33 | #include "base/flags.h" |
34 | #include "base/init_mozc.h" | |
36 | 35 | #include "base/port.h" |
36 | #include "net/http_client.h" | |
37 | 37 | #include "net/proxy_manager.h" |
38 | 38 | |
39 | 39 | DEFINE_string(url, "", "url"); |
47 | 47 | DEFINE_bool(use_proxy, true, "use the proxy or not"); |
48 | 48 | |
49 | 49 | int main(int argc, char **argv) { |
50 | InitGoogle(argv[0], &argc, &argv, false); | |
50 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
51 | 51 | |
52 | 52 | mozc::HTTPClient::Option option; |
53 | 53 | option.include_header = FLAGS_include_header; |
34 | 34 | #include "base/file_stream.h" |
35 | 35 | #include "base/flags.h" |
36 | 36 | #include "base/hash.h" |
37 | #include "base/init_mozc.h" | |
37 | 38 | #include "base/logging.h" |
38 | 39 | #include "base/util.h" |
39 | 40 | #include "storage/existence_filter.h" |
67 | 68 | // read per-line word list and generate |
68 | 69 | // bloom filter in raw byte array or header file format |
69 | 70 | int main(int argc, char **argv) { |
70 | InitGoogle(argv[0], &argc, &argv, true); | |
71 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
71 | 72 | |
72 | 73 | if ((FLAGS_input.empty() || |
73 | 74 | FLAGS_output.empty()) && argc > 2) { |
34 | 34 | |
35 | 35 | #include "base/crash_report_handler.h" |
36 | 36 | #include "base/flags.h" |
37 | #include "base/init_mozc.h" | |
37 | 38 | #include "base/run_level.h" |
38 | 39 | #include "base/system_util.h" |
39 | 40 | #include "base/util.h" |
40 | 41 | #include "config/stats_config_util.h" |
41 | 42 | |
42 | 43 | #ifdef OS_WIN |
44 | #include "base/win_util.h" | |
43 | 45 | #include "base/winmain.h" |
44 | #include "base/win_util.h" | |
45 | 46 | #include "renderer/win32/win32_server.h" |
46 | 47 | #elif defined(OS_MACOSX) |
48 | #include "renderer/mac/CandidateController.h" | |
47 | 49 | #include "renderer/mac/mac_server.h" |
48 | 50 | #include "renderer/mac/mac_server_send_command.h" |
49 | #include "renderer/mac/CandidateController.h" | |
50 | 51 | #elif defined(ENABLE_GTK_RENDERER) |
51 | 52 | #include "renderer/renderer_client.h" |
52 | 53 | #include "renderer/table_layout.h" |
95 | 96 | if (mozc::config::StatsConfigUtil::IsEnabled()) { |
96 | 97 | mozc::CrashReportHandler::Initialize(false); |
97 | 98 | } |
98 | InitGoogle(argv[0], &argc, &argv, false); | |
99 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
99 | 100 | |
100 | 101 | int result_code = 0; |
101 | 102 |
41 | 41 | |
42 | 42 | #include "base/file_stream.h" |
43 | 43 | #include "base/flags.h" |
44 | #include "base/init_mozc.h" | |
44 | 45 | #include "base/logging.h" |
45 | 46 | #include "rewriter/gen_existence_data.h" |
46 | 47 | |
87 | 88 | } // namespace mozc |
88 | 89 | |
89 | 90 | int main(int argc, char *argv[]) { |
90 | InitGoogle(argv[0], &argc, &argv, true); | |
91 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
91 | 92 | |
92 | 93 | if (FLAGS_collocation_data.empty() && argc > 1) { |
93 | 94 | FLAGS_collocation_data = argv[1]; |
44 | 44 | |
45 | 45 | #include "base/file_stream.h" |
46 | 46 | #include "base/flags.h" |
47 | #include "base/init_mozc.h" | |
47 | 48 | #include "base/logging.h" |
48 | 49 | #include "base/util.h" |
49 | 50 | #include "rewriter/gen_existence_data.h" |
102 | 103 | } // namespace mozc |
103 | 104 | |
104 | 105 | int main(int argc, char *argv[]) { |
105 | InitGoogle(argv[0], &argc, &argv, true); | |
106 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
106 | 107 | |
107 | 108 | LOG(INFO) << FLAGS_suppression_data; |
108 | 109 |
32 | 32 | // --ordering_rule=ordering_rule_file |
33 | 33 | // --input=input.tsv --output=output_header |
34 | 34 | |
35 | #include <algorithm> | |
35 | 36 | #include <climits> |
36 | 37 | #include <map> |
37 | #include <vector> | |
38 | 38 | #include <set> |
39 | 39 | #include <string> |
40 | #include <algorithm> | |
40 | #include <vector> | |
41 | 41 | |
42 | 42 | #include "base/file_stream.h" |
43 | 43 | #include "base/file_util.h" |
44 | 44 | #include "base/flags.h" |
45 | #include "base/init_mozc.h" | |
45 | 46 | #include "base/logging.h" |
46 | 47 | #include "base/util.h" |
47 | 48 | #include "rewriter/dictionary_generator.h" |
196 | 197 | } // namespace mozc |
197 | 198 | |
198 | 199 | int main(int argc, char **argv) { |
199 | InitGoogle(argv[0], &argc, &argv, true); | |
200 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
200 | 201 | |
201 | 202 | if ((FLAGS_input.empty() || |
202 | 203 | FLAGS_sorting_table.empty() || |
41 | 41 | |
42 | 42 | #include "base/file_stream.h" |
43 | 43 | #include "base/flags.h" |
44 | #include "base/init_mozc.h" | |
44 | 45 | #include "base/logging.h" |
45 | 46 | #include "base/util.h" |
46 | 47 | |
292 | 293 | } // namespace mozc |
293 | 294 | |
294 | 295 | int main(int argc, char **argv) { |
295 | InitGoogle(argv[0], &argc, &argv, true); | |
296 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
296 | 297 | mozc::Convert(); |
297 | 298 | return 0; |
298 | 299 | } |
85 | 85 | RewriterInterface() {} |
86 | 86 | }; |
87 | 87 | |
88 | ||
89 | 88 | } // namespace mozc |
90 | 89 | |
91 | 90 | #endif // MOZC_REWRITER_REWRITER_INTERFACE_H_ |
47 | 47 | #include <vector> |
48 | 48 | |
49 | 49 | #include "base/flags.h" |
50 | #include "base/init_mozc.h" | |
50 | 51 | #include "base/number_util.h" |
51 | 52 | #include "base/singleton.h" |
52 | 53 | #include "base/system_util.h" |
356 | 357 | } // namespace mozc |
357 | 358 | |
358 | 359 | int main(int argc, char *argv[]) { |
359 | InitGoogle(argv[0], &argc, &argv, false); | |
360 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
360 | 361 | |
361 | 362 | mozc::ScopedWSAData wsadata; |
362 | 363 |
39 | 39 | #include "base/crash_report_handler.h" |
40 | 40 | #include "base/flags.h" |
41 | 41 | #include "base/init.h" |
42 | #include "base/init_mozc.h" | |
42 | 43 | #include "base/logging.h" |
43 | 44 | #include "base/process_mutex.h" |
44 | 45 | #include "base/run_level.h" |
75 | 76 | |
76 | 77 | namespace server { |
77 | 78 | |
78 | void InitGoogleAndMozcServer(const char *arg0, | |
79 | int *argc, | |
80 | char ***argv, | |
81 | bool remove_flags) { | |
79 | void InitMozcAndMozcServer(const char *arg0, | |
80 | int *argc, | |
81 | char ***argv, | |
82 | bool remove_flags) { | |
82 | 83 | mozc::SystemUtil::DisableIME(); |
83 | 84 | |
84 | 85 | // Big endian is not supported. The storage for user history is endian |
91 | 92 | ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); |
92 | 93 | #endif |
93 | 94 | |
94 | // call GetRunLevel before InitGoogle(). | |
95 | // InitGoogle() will do all static initialization and may access | |
95 | // call GetRunLevel before mozc::InitMozc(). | |
96 | // mozc::InitMozc() will do all static initialization and may access | |
96 | 97 | // local resources. |
97 | 98 | const mozc::RunLevel::RunLevelType run_level = |
98 | 99 | mozc::RunLevel::GetRunLevel(mozc::RunLevel::SERVER); |
105 | 106 | if (mozc::config::StatsConfigUtil::IsEnabled()) { |
106 | 107 | mozc::CrashReportHandler::Initialize(false); |
107 | 108 | } |
108 | InitGoogle(arg0, argc, argv, remove_flags); | |
109 | mozc::InitMozc(arg0, argc, argv, remove_flags); | |
109 | 110 | |
110 | 111 | if (run_level == mozc::RunLevel::RESTRICTED) { |
111 | 112 | VLOG(1) << "Mozc server starts with timeout mode"; |
34 | 34 | namespace mozc { |
35 | 35 | namespace server { |
36 | 36 | |
37 | void InitGoogleAndMozcServer(const char *arg0, | |
38 | int *argc, | |
39 | char ***argv, | |
40 | bool remove_flags); | |
37 | void InitMozcAndMozcServer(const char *arg0, | |
38 | int *argc, | |
39 | char ***argv, | |
40 | bool remove_flags); | |
41 | 41 | |
42 | 42 | class MozcServer { |
43 | 43 | public: |
31 | 31 | #include "server/mozc_server.h" |
32 | 32 | |
33 | 33 | int main(int argc, char* argv[]) { |
34 | mozc::server::InitGoogleAndMozcServer(argv[0], &argc, &argv, false); | |
34 | mozc::server::InitMozcAndMozcServer(argv[0], &argc, &argv, false); | |
35 | 35 | |
36 | 36 | const int return_value = mozc::server::MozcServer::Run(); |
37 | 37 | mozc::server::MozcServer::Finalize(); |
33 | 33 | #include "base/file_stream.h" |
34 | 34 | #include "base/file_util.h" |
35 | 35 | #include "base/flags.h" |
36 | #include "base/init_mozc.h" | |
36 | 37 | #include "base/logging.h" |
37 | 38 | #include "base/port.h" |
38 | 39 | #include "base/system_util.h" |
85 | 86 | } // namespace mozc |
86 | 87 | |
87 | 88 | int main(int argc, char **argv) { |
88 | InitGoogle(argv[0], &argc, &argv, false); | |
89 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
89 | 90 | std::unique_ptr<mozc::InputFileStream> input_file; |
90 | 91 | std::unique_ptr<mozc::OutputFileStream> output_file; |
91 | 92 | istream *input = NULL; |
30 | 30 | #include <cstdio> |
31 | 31 | |
32 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
33 | 34 | #include "protocol/commands.pb.h" |
34 | 35 | #include "session/session_server.h" |
35 | 36 | |
54 | 55 | } // namespace mozc |
55 | 56 | |
56 | 57 | int main(int argc, char **argv) { |
57 | InitGoogle(argv[0], &argc, &argv, false); | |
58 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
58 | 59 | |
59 | 60 | mozc::SessionServer server; |
60 | 61 | mozc::commands::Input input; |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "storage/existence_filter.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | |
33 | 31 | #include "base/flags.h" |
32 | #include "base/init_mozc.h" | |
34 | 33 | #include "base/logging.h" |
35 | 34 | #include "base/port.h" |
36 | 35 | #include "base/util.h" |
36 | #include "storage/existence_filter.h" | |
37 | 37 | |
38 | 38 | using mozc::storage::ExistenceFilter; |
39 | 39 | |
40 | 40 | int main(int argc, char **argv) { |
41 | InitGoogle(argv[0], &argc, &argv, false); | |
41 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
42 | 42 | |
43 | 43 | int n = 500; |
44 | 44 | int m = ExistenceFilter::MinFilterSizeInBytesForErrorRate(0.01, n); |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include <iostream> // NOLINT | |
30 | #include <string> | |
31 | ||
32 | #include "base/flags.h" | |
33 | #include "base/init_mozc.h" | |
34 | #include "base/util.h" | |
29 | 35 | #include "storage/lru_cache.h" |
30 | 36 | |
31 | #include <string> | |
32 | #include <iostream> // NOLINT | |
33 | ||
34 | #include "base/flags.h" | |
35 | #include "base/util.h" | |
36 | ||
37 | 37 | int main(int argc, char **argv) { |
38 | InitGoogle(argv[0], &argc, &argv, false); | |
38 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
39 | 39 | mozc::storage::LRUCache<string, string> cache(5); |
40 | 40 | |
41 | 41 | string line; |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "storage/lru_storage.h" | |
30 | ||
31 | 29 | #include <string> |
32 | 30 | |
33 | 31 | #include "base/logging.h" |
34 | 32 | #include "base/port.h" |
35 | 33 | #include "base/util.h" |
34 | #include "storage/lru_storage.h" | |
36 | 35 | |
37 | 36 | DEFINE_bool(create_db, false, "initialize database"); |
38 | 37 | DEFINE_string(file, "test.db", ""); |
41 | 40 | using mozc::storage::LRUStorage; |
42 | 41 | |
43 | 42 | int main(int argc, char **argv) { |
44 | InitGoogle(argv[0], &argc, &argv, false); | |
43 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
45 | 44 | |
46 | 45 | if (FLAGS_create_db) { |
47 | 46 | CHECK(LRUStorage::CreateStorageFile( |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include "base/flags.h" |
30 | #include "base/init_mozc.h" | |
30 | 31 | #include "testing/base/public/googletest.h" |
31 | 32 | #include "testing/base/public/gunit.h" |
32 | 33 | |
39 | 40 | int main(int argc, char **argv) { |
40 | 41 | // TODO(yukawa, team): Implement b/2805528 so that you can specify any option |
41 | 42 | // given by gunit. |
42 | InitGoogle(argv[0], &argc, &argv, false); | |
43 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
43 | 44 | mozc::InitTestFlags(); |
44 | 45 | testing::InitGoogleTest(&argc, argv); |
45 | 46 |
39 | 39 | #include <cstring> |
40 | 40 | #include <memory> |
41 | 41 | |
42 | #include "base/port.h" | |
42 | #include "base/init_mozc.h" | |
43 | 43 | #include "base/logging.h" |
44 | 44 | #include "base/pepper_file_util.h" |
45 | #include "base/port.h" | |
45 | 46 | #include "net/http_client_pepper.h" |
46 | 47 | #include "testing/base/public/googletest.h" |
47 | 48 | #include "testing/base/public/gunit.h" |
135 | 136 | char argv0[] = "NaclModule"; |
136 | 137 | char *argv_body[] = {argv0, NULL}; |
137 | 138 | char **argv = argv_body; |
138 | InitGoogle(argv[0], &argc, &argv, true); | |
139 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
139 | 140 | testing::InitGoogleTest(&argc, argv); |
140 | 141 | |
141 | 142 | return new NaclTestModule(); |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "unix/emacs/mozc_emacs_helper_lib.h" | |
30 | ||
31 | 29 | #include <cstdio> |
32 | 30 | #include <iostream> |
33 | 31 | |
34 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
35 | 34 | #include "base/logging.h" |
36 | 35 | #include "base/protobuf/descriptor.h" |
37 | 36 | #include "base/protobuf/message.h" |
41 | 40 | #include "config/config_handler.h" |
42 | 41 | #include "protocol/commands.pb.h" |
43 | 42 | #include "unix/emacs/client_pool.h" |
43 | #include "unix/emacs/mozc_emacs_helper_lib.h" | |
44 | 44 | |
45 | 45 | DEFINE_bool(suppress_stderr, false, |
46 | 46 | "Discards all the output to stderr."); |
126 | 126 | |
127 | 127 | |
128 | 128 | int main(int argc, char **argv) { |
129 | InitGoogle(argv[0], &argc, &argv, true); | |
129 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
130 | 130 | if (FLAGS_suppress_stderr) { |
131 | 131 | #ifdef OS_WIN |
132 | 132 | const char path[] = "NUL"; |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include <cstddef> | |
29 | 30 | #include <cstdio> |
30 | 31 | |
31 | 32 | #include "base/flags.h" |
33 | #include "base/init_mozc.h" | |
32 | 34 | #include "base/logging.h" |
33 | 35 | #include "base/version.h" |
34 | 36 | #include "unix/ibus/main.h" |
122 | 124 | } // namespace |
123 | 125 | |
124 | 126 | int main(gint argc, gchar **argv) { |
125 | InitGoogle(argv[0], &argc, &argv, true); | |
127 | mozc::InitMozc(argv[0], &argc, &argv, true); | |
126 | 128 | ibus_init(); |
127 | 129 | InitIBusComponent(FLAGS_ibus); |
128 | 130 | mozc::ibus::MozcEngine::InitConfig(g_config); |
32 | 32 | |
33 | 33 | #include "base/crash_report_handler.h" |
34 | 34 | #include "base/flags.h" |
35 | #include "base/init_mozc.h" | |
35 | 36 | #include "base/system_util.h" |
36 | 37 | #ifdef OS_WIN |
37 | 38 | #include "base/winmain.h" |
60 | 61 | if (mozc::config::StatsConfigUtil::IsEnabled()) { |
61 | 62 | mozc::CrashReportHandler::Initialize(false); |
62 | 63 | } |
63 | InitGoogle(argv[0], &argc, &argv, false); | |
64 | mozc::InitMozc(argv[0], &argc, &argv, false); | |
64 | 65 | |
65 | 66 | int result = 0; |
66 | 67 | #ifdef OS_WIN |