OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | |
6 #include <stdio.h> | |
7 #include <iostream> | |
8 #include <glib.h> | 5 #include <glib.h> |
9 #include <base/logging.h> | |
10 | 6 |
11 #include <libxml/parser.h> | 7 #include "update_engine/subprocess.h" |
12 #include <libxml/xpath.h> | |
13 #include <libxml/xpathInternals.h> | |
14 | |
15 // This code runs inside the main loop | |
16 gboolean EntryPoint(gpointer data) { | |
17 GMainLoop *loop = reinterpret_cast<GMainLoop*>(data); | |
18 LOG(INFO) << "Chrome OS Update Engine beginning"; | |
19 g_main_loop_quit(loop); | |
20 return FALSE; | |
21 } | |
22 | 8 |
23 int main(int argc, char** argv) { | 9 int main(int argc, char** argv) { |
24 xmlDocPtr doc = xmlNewDoc((const xmlChar*)"1.0"); | 10 g_thread_init(NULL); |
25 CHECK(doc); | 11 chromeos_update_engine::Subprocess::Init(); |
26 CHECK_EQ(argc, 2); | |
27 printf("enc: [%s]\n", xmlEncodeEntitiesReentrant(doc, (const xmlChar*)argv[1])
); | |
28 return 0; | |
29 | |
30 | |
31 GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE); | |
32 g_timeout_add(0, &EntryPoint, loop); | |
33 g_main_loop_run(loop); | |
34 return 0; | 12 return 0; |
35 } | 13 } |
OLD | NEW |