提交 18dccb4c 编写于 作者: A Adam Barth

Remove libxml and modp_b64

These were used only for base's test framework, which we don't need.
上级 92a516a5
......@@ -151,8 +151,6 @@ component("base") {
"auto_reset.h",
"barrier_closure.cc",
"barrier_closure.h",
"base64.cc",
"base64.h",
"base_export.h",
"base_switches.h",
"basictypes.h",
......@@ -656,7 +654,6 @@ component("base") {
":base_static",
"//base/allocator:allocator_extension_thunks",
"//base/third_party/dynamic_annotations",
"//third_party/modp_b64",
]
public_deps = [
......@@ -1172,7 +1169,6 @@ test("base_unittests") {
"at_exit_unittest.cc",
"atomicops_unittest.cc",
"barrier_closure_unittest.cc",
"base64_unittest.cc",
"big_endian_unittest.cc",
"bind_unittest.cc",
"bind_unittest.nc",
......
......@@ -5,7 +5,6 @@ include_rules = [
"+third_party/libevent",
"+third_party/dmg_fp",
"+third_party/mach_override",
"+third_party/modp_b64",
"+third_party/tcmalloc",
# These are implicitly brought in from the root, and we don't want them.
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/base64.h"
#include "third_party/modp_b64/modp_b64.h"
namespace base {
void Base64Encode(const StringPiece& input, std::string* output) {
std::string temp;
temp.resize(modp_b64_encode_len(input.size())); // makes room for null byte
// modp_b64_encode_len() returns at least 1, so temp[0] is safe to use.
size_t output_size = modp_b64_encode(&(temp[0]), input.data(), input.size());
temp.resize(output_size); // strips off null byte
output->swap(temp);
}
bool Base64Decode(const StringPiece& input, std::string* output) {
std::string temp;
temp.resize(modp_b64_decode_len(input.size()));
// does not null terminate result since result is binary data!
size_t input_size = input.size();
size_t output_size = modp_b64_decode(&(temp[0]), input.data(), input_size);
if (output_size == MODP_B64_ERROR)
return false;
temp.resize(output_size);
output->swap(temp);
return true;
}
} // namespace base
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_BASE64_H_
#define BASE_BASE64_H_
#include <string>
#include "base/base_export.h"
#include "base/strings/string_piece.h"
namespace base {
// Encodes the input string in base64. The encoding can be done in-place.
BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
// Decodes the base64 input string. Returns true if successful and false
// otherwise. The output string is only modified if successful. The decoding can
// be done in-place.
BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
} // namespace base
#endif // BASE_BASE64_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/base64.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
TEST(Base64Test, Basic) {
const std::string kText = "hello world";
const std::string kBase64Text = "aGVsbG8gd29ybGQ=";
std::string encoded;
std::string decoded;
bool ok;
Base64Encode(kText, &encoded);
EXPECT_EQ(kBase64Text, encoded);
ok = Base64Decode(encoded, &decoded);
EXPECT_TRUE(ok);
EXPECT_EQ(kText, decoded);
}
TEST(Base64Test, InPlace) {
const std::string kText = "hello world";
const std::string kBase64Text = "aGVsbG8gd29ybGQ=";
std::string text(kText);
Base64Encode(text, &text);
EXPECT_EQ(kBase64Text, text);
bool ok = Base64Decode(text, &text);
EXPECT_TRUE(ok);
EXPECT_EQ(text, kText);
}
} // namespace base
......@@ -35,8 +35,6 @@ source_set("test_support") {
"gtest_util.h",
"gtest_xml_unittest_result_printer.cc",
"gtest_xml_unittest_result_printer.h",
"gtest_xml_util.cc",
"gtest_xml_util.h",
"histogram_tester.cc",
"histogram_tester.h",
"launcher/test_launcher.cc",
......@@ -144,7 +142,6 @@ source_set("test_support") {
"//base/third_party/dynamic_annotations",
"//testing/gmock",
"//testing/gtest",
"//third_party/libxml",
"//third_party/icu:icuuc",
]
......
include_rules = [
"+third_party/libxml",
]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/gtest_xml_util.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/test/gtest_util.h"
#include "base/test/launcher/test_launcher.h"
#include "third_party/libxml/chromium/libxml_utils.h"
namespace base {
namespace {
// This is used for the xml parser to report errors. This assumes the context
// is a pointer to a std::string where the error message should be appended.
static void XmlErrorFunc(void *context, const char *message, ...) {
va_list args;
va_start(args, message);
std::string* error = static_cast<std::string*>(context);
StringAppendV(error, message, args);
va_end(args);
}
} // namespace
bool ProcessGTestOutput(const base::FilePath& output_file,
std::vector<TestResult>* results,
bool* crashed) {
DCHECK(results);
std::string xml_contents;
if (!ReadFileToString(output_file, &xml_contents))
return false;
// Silence XML errors - otherwise they go to stderr.
std::string xml_errors;
ScopedXmlErrorFunc error_func(&xml_errors, &XmlErrorFunc);
XmlReader xml_reader;
if (!xml_reader.Load(xml_contents))
return false;
enum {
STATE_INIT,
STATE_TESTSUITE,
STATE_TESTCASE,
STATE_FAILURE,
STATE_END,
} state = STATE_INIT;
while (xml_reader.Read()) {
xml_reader.SkipToElement();
std::string node_name(xml_reader.NodeName());
switch (state) {
case STATE_INIT:
if (node_name == "testsuites" && !xml_reader.IsClosingElement())
state = STATE_TESTSUITE;
else
return false;
break;
case STATE_TESTSUITE:
if (node_name == "testsuites" && xml_reader.IsClosingElement())
state = STATE_END;
else if (node_name == "testsuite" && !xml_reader.IsClosingElement())
state = STATE_TESTCASE;
else
return false;
break;
case STATE_TESTCASE:
if (node_name == "testsuite" && xml_reader.IsClosingElement()) {
state = STATE_TESTSUITE;
} else if (node_name == "x-teststart" &&
!xml_reader.IsClosingElement()) {
// This is our custom extension that helps recognize which test was
// running when the test binary crashed.
TestResult result;
std::string test_case_name;
if (!xml_reader.NodeAttribute("classname", &test_case_name))
return false;
std::string test_name;
if (!xml_reader.NodeAttribute("name", &test_name))
return false;
result.full_name = FormatFullTestName(test_case_name, test_name);
result.elapsed_time = TimeDelta();
// Assume the test crashed - we can correct that later.
result.status = TestResult::TEST_CRASH;
results->push_back(result);
} else if (node_name == "testcase" && !xml_reader.IsClosingElement()) {
std::string test_status;
if (!xml_reader.NodeAttribute("status", &test_status))
return false;
if (test_status != "run" && test_status != "notrun")
return false;
if (test_status != "run")
break;
TestResult result;
std::string test_case_name;
if (!xml_reader.NodeAttribute("classname", &test_case_name))
return false;
std::string test_name;
if (!xml_reader.NodeAttribute("name", &test_name))
return false;
result.full_name = test_case_name + "." + test_name;
std::string test_time_str;
if (!xml_reader.NodeAttribute("time", &test_time_str))
return false;
result.elapsed_time = TimeDelta::FromMicroseconds(
static_cast<int64>(strtod(test_time_str.c_str(), NULL) *
Time::kMicrosecondsPerSecond));
result.status = TestResult::TEST_SUCCESS;
if (!results->empty() &&
results->at(results->size() - 1).full_name == result.full_name &&
results->at(results->size() - 1).status ==
TestResult::TEST_CRASH) {
// Erase the fail-safe "crashed" result - now we know the test did
// not crash.
results->pop_back();
}
results->push_back(result);
} else if (node_name == "failure" && !xml_reader.IsClosingElement()) {
std::string failure_message;
if (!xml_reader.NodeAttribute("message", &failure_message))
return false;
DCHECK(!results->empty());
results->at(results->size() - 1).status = TestResult::TEST_FAILURE;
state = STATE_FAILURE;
} else if (node_name == "testcase" && xml_reader.IsClosingElement()) {
// Deliberately empty.
} else {
return false;
}
break;
case STATE_FAILURE:
if (node_name == "failure" && xml_reader.IsClosingElement())
state = STATE_TESTCASE;
else
return false;
break;
case STATE_END:
// If we are here and there are still XML elements, the file has wrong
// format.
return false;
}
}
*crashed = (state != STATE_END);
return true;
}
} // namespace base
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_TEST_GTEST_XML_UTIL_H_
#define BASE_TEST_GTEST_XML_UTIL_H_
#include <vector>
#include "base/compiler_specific.h"
namespace base {
class FilePath;
struct TestResult;
// Produces a vector of test results based on GTest output file.
// Returns true iff the output file exists and has been successfully parsed.
// On successful return |crashed| is set to true if the test results
// are valid but incomplete.
bool ProcessGTestOutput(const base::FilePath& output_file,
std::vector<TestResult>* results,
bool* crashed) WARN_UNUSED_RESULT;
} // namespace base
#endif // BASE_TEST_GTEST_XML_UTIL_H_
......@@ -4,7 +4,6 @@
#include "base/test/launcher/test_results_tracker.h"
#include "base/base64.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
......@@ -288,16 +287,6 @@ bool TestResultsTracker::SaveSummaryAsJSON(const FilePath& path) const {
test_result_value->SetString("output_snippet",
escaped_output_snippet);
test_result_value->SetBoolean("losless_snippet", losless_snippet);
// Also include the raw version (base64-encoded so that it can be safely
// JSON-serialized - there are no guarantees about character encoding
// of the snippet). This can be very useful piece of information when
// debugging a test failure related to character encoding.
std::string base64_output_snippet;
Base64Encode(test_result.output_snippet, &base64_output_snippet);
test_result_value->SetString("output_snippet_base64",
base64_output_snippet);
test_results->Append(test_result_value.Pass());
}
current_iteration_data->SetWithoutPathExpansion(j->first,
......
......@@ -19,7 +19,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/sys_info.h"
#include "base/test/gtest_xml_util.h"
#include "base/test/launcher/test_launcher.h"
#include "base/test/test_switches.h"
#include "base/test/test_timeouts.h"
......@@ -242,113 +241,25 @@ bool ProcessTestResults(
bool was_timeout,
std::vector<std::string>* tests_to_relaunch) {
std::vector<TestResult> test_results;
bool crashed = false;
bool have_test_results =
ProcessGTestOutput(output_file, &test_results, &crashed);
bool called_any_callback = false;
if (have_test_results) {
// TODO(phajdan.jr): Check for duplicates and mismatches between
// the results we got from XML file and tests we intended to run.
std::map<std::string, TestResult> results_map;
for (size_t i = 0; i < test_results.size(); i++)
results_map[test_results[i].full_name] = test_results[i];
bool had_interrupted_test = false;
// Results to be reported back to the test launcher.
std::vector<TestResult> final_results;
for (size_t i = 0; i < test_names.size(); i++) {
if (ContainsKey(results_map, test_names[i])) {
TestResult test_result = results_map[test_names[i]];
if (test_result.status == TestResult::TEST_CRASH) {
had_interrupted_test = true;
if (was_timeout) {
// Fix up the test status: we forcibly kill the child process
// after the timeout, so from XML results it looks just like
// a crash.
test_result.status = TestResult::TEST_TIMEOUT;
}
} else if (test_result.status == TestResult::TEST_SUCCESS ||
test_result.status == TestResult::TEST_FAILURE) {
// We run multiple tests in a batch with a timeout applied
// to the entire batch. It is possible that with other tests
// running quickly some tests take longer than the per-test timeout.
// For consistent handling of tests independent of order and other
// factors, mark them as timing out.
if (test_result.elapsed_time >
TestTimeouts::test_launcher_timeout()) {
test_result.status = TestResult::TEST_TIMEOUT;
}
}
test_result.output_snippet = GetTestOutputSnippet(test_result, output);
final_results.push_back(test_result);
} else if (had_interrupted_test) {
tests_to_relaunch->push_back(test_names[i]);
} else {
// TODO(phajdan.jr): Explicitly pass the info that the test didn't
// run for a mysterious reason.
LOG(ERROR) << "no test result for " << test_names[i];
TestResult test_result;
test_result.full_name = test_names[i];
test_result.status = TestResult::TEST_UNKNOWN;
test_result.output_snippet = GetTestOutputSnippet(test_result, output);
final_results.push_back(test_result);
}
}
// TODO(phajdan.jr): Handle the case where processing XML output
// indicates a crash but none of the test results is marked as crashing.
if (final_results.empty())
return false;
bool has_non_success_test = false;
for (size_t i = 0; i < final_results.size(); i++) {
if (final_results[i].status != TestResult::TEST_SUCCESS) {
has_non_success_test = true;
break;
}
}
if (!has_non_success_test && exit_code != 0) {
// This is a bit surprising case: all tests are marked as successful,
// but the exit code was not zero. This can happen e.g. under memory
// tools that report leaks this way. Mark all tests as a failure on exit,
// and for more precise info they'd need to be retried serially.
for (size_t i = 0; i < final_results.size(); i++)
final_results[i].status = TestResult::TEST_FAILURE_ON_EXIT;
}
for (size_t i = 0; i < final_results.size(); i++) {
// Fix the output snippet after possible changes to the test result.
final_results[i].output_snippet =
GetTestOutputSnippet(final_results[i], output);
test_launcher->OnTestFinished(final_results[i]);
called_any_callback = true;
}
} else {
fprintf(stdout,
"Failed to get out-of-band test success data, "
"dumping full stdio below:\n%s\n",
output.c_str());
fflush(stdout);
fprintf(stdout,
"Failed to get out-of-band test success data, "
"dumping full stdio below:\n%s\n",
output.c_str());
fflush(stdout);
// We do not have reliable details about test results (parsing test
// stdout is known to be unreliable), apply the executable exit code
// to all tests.
// TODO(phajdan.jr): Be smarter about this, e.g. retry each test
// individually.
for (size_t i = 0; i < test_names.size(); i++) {
TestResult test_result;
test_result.full_name = test_names[i];
test_result.status = TestResult::TEST_UNKNOWN;
test_launcher->OnTestFinished(test_result);
called_any_callback = true;
}
// We do not have reliable details about test results (parsing test
// stdout is known to be unreliable), apply the executable exit code
// to all tests.
// TODO(phajdan.jr): Be smarter about this, e.g. retry each test
// individually.
for (size_t i = 0; i < test_names.size(); i++) {
TestResult test_result;
test_result.full_name = test_names[i];
test_result.status = TestResult::TEST_UNKNOWN;
test_launcher->OnTestFinished(test_result);
called_any_callback = true;
}
return called_any_callback;
......
......@@ -19,7 +19,6 @@
#include "base/path_service.h"
#include "base/process/memory.h"
#include "base/test/gtest_xml_unittest_result_printer.h"
#include "base/test/gtest_xml_util.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/multiprocess_test.h"
#include "base/test/test_switches.h"
......
......@@ -19,8 +19,6 @@ _base_deps = [
'testing',
'third_party/ashmem',
'third_party/libevent',
'third_party/libxml', # via //base/test
'third_party/modp_b64',
'third_party/tcmalloc',
]
......@@ -54,7 +52,6 @@ _third_party_deps = [
'third_party/junit',
'third_party/libjpeg',
'third_party/libpng',
'third_party/libXNVCtrl',
'third_party/markupsafe',
'third_party/mesa',
'third_party/mockito',
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("libXNVCtrl") {
sources = [
"NVCtrl.c",
"NVCtrl.h",
"NVCtrlLib.h",
"nv_control.h",
]
}
/*
* Copyright (c) 2008 NVIDIA, Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
\ No newline at end of file
# Copyright (c) 2008 NVIDIA, Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
RANLIB ?= ranlib
CFLAGS += -fPIC
libXNVCtrl.a : libXNVCtrl.a(NVCtrl.o)
$(RANLIB) $@
NVCtrl.o : NVCtrl.h nv_control.h NVCtrlLib.h
.INTERMEDIATE: NVCtrl.o
clean ::
rm -f libXNVCtrl.a *.o
.PHONY: clean
此差异已折叠。
此差异已折叠。
此差异已折叠。
Name: NVidia Control X Extension Library
Short Name: libXNVCtrl
URL: http://cgit.freedesktop.org/~aplattner/nvidia-settings/
Version: unknown
Date: 2008
License: MIT
Security Critical: no
Description:
This package provides access to NVidia Control X Extension. It is used to determine the version of the NVIDIA driver in use.
The current version is pulled from nvidia-settings-302.17.
Local Modifications:
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'libXNVCtrl',
'type': 'static_library',
'sources': [
'NVCtrl.c',
'NVCtrl.h',
'NVCtrlLib.h',
'nv_control.h',
],
},
],
}
/*
* Copyright (c) 2008 NVIDIA, Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* NV-CONTROL Protocol Version History
*
* 1.0 - 1.5 NVIDIA Internal development versions
* 1.6 Initial public version
* 1.7 Added QueryBinaryData request
* 1.8 Added TargetTypes
* 1.9 Added QueryTargetCount request
* 1.10 Fixed target type/id byte ordering for compatibility with
* pre-1.8 NV-CONTROL clients
* 1.11 NVIDIA Internal development version
* 1.12 Added StringOperation request
* 1.13 NVIDIA Internal development version
* 1.14 Fixed an NV_CTRL_BINARY_DATA_MODELINES double scan modeline
* reporting bug (vsyncstart, vsyncend, and vtotal were incorrectly
* doubled)
* 1.15 Added AVAILABILITY_TARGET_ATTRIBUTE_CHANGED_EVENT
* 1.16 Added TARGET_STRING_ATTRIBUTE_CHANGED_EVENT
* 1.17 Added TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT
* 1.18 Updated QueryTargetCount to return a count of 0, rather than
* BadMatch, if an unknown TargetType is specified
* 1.19 Added TargetType support for SetAttributeAndGetStatus and
* SetStringAttribute requests
* 1.20 Added COOLER TargetType
* 1.21 Added initial 64-bit integer attribute support (read-only)
* 1.22 Added X_nvCtrlQueryValidStringAttributeValues to check
* string attribute permissions.
* 1.23 Added SENSOR TargetType
* 1.24 Fixed a bug where SLI_MOSAIC_MODE_AVAILABLE attribute would
* report false positives via the GPU and X screen target types
* 1.25 Added 3D_VISION_PRO_TRANSCEIVER TargetType
* 1.26 Added XNVCTRLQueryXXXAttributePermissions.
* 1.27 Added DISPLAY TargetType
* 1.28 Added NV_CTRL_CURRENT_METAMODE_ID: clients should use this
* attribute to switch MetaModes, rather than pass the MetaMode ID
* through the RRSetScreenConfig protocol request.
*/
#ifndef __NVCONTROL_H
#define __NVCONTROL_H
#define NV_CONTROL_ERRORS 0
#define NV_CONTROL_EVENTS 5
#define NV_CONTROL_NAME "NV-CONTROL"
#define NV_CONTROL_MAJOR 1
#define NV_CONTROL_MINOR 28
#define X_nvCtrlQueryExtension 0
#define X_nvCtrlIsNv 1
#define X_nvCtrlQueryAttribute 2
#define X_nvCtrlSetAttribute 3
#define X_nvCtrlQueryStringAttribute 4
#define X_nvCtrlQueryValidAttributeValues 5
#define X_nvCtrlSelectNotify 6
#define X_nvCtrlSetGvoColorConversionDeprecated 7
#define X_nvCtrlQueryGvoColorConversionDeprecated 8
#define X_nvCtrlSetStringAttribute 9
/* STUB X_nvCtrlQueryDDCCILutSize 10 */
/* STUB X_nvCtrlQueryDDCCISinglePointLutOperation 11 */
/* STUB X_nvCtrlSetDDCCISinglePointLutOperation 12 */
/* STUB X_nvCtrlQueryDDCCIBlockLutOperation 13 */
/* STUB X_nvCtrlSetDDCCIBlockLutOperation 14 */
/* STUB X_nvCtrlSetDDCCIRemoteProcedureCall 15 */
/* STUB X_nvCtrlQueryDDCCIDisplayControllerType 16 */
/* STUB X_nvCtrlQueryDDCCICapabilities 17 */
/* STUB X_nvCtrlQueryDDCCITimingReport 18 */
#define X_nvCtrlSetAttributeAndGetStatus 19
#define X_nvCtrlQueryBinaryData 20
#define X_nvCtrlSetGvoColorConversion 21
#define X_nvCtrlQueryGvoColorConversion 22
#define X_nvCtrlSelectTargetNotify 23
#define X_nvCtrlQueryTargetCount 24
#define X_nvCtrlStringOperation 25
#define X_nvCtrlQueryValidAttributeValues64 26
#define X_nvCtrlQueryAttribute64 27
#define X_nvCtrlQueryValidStringAttributeValues 28
#define X_nvCtrlQueryAttributePermissions 29
#define X_nvCtrlQueryStringAttributePermissions 30
#define X_nvCtrlQueryBinaryDataAttributePermissions 31
#define X_nvCtrlQueryStringOperationAttributePermissions 32
#define X_nvCtrlLastRequest (X_nvCtrlQueryStringOperationAttributePermissions + 1)
/* Define 32 bit floats */
typedef float FLOAT32;
#ifndef F32
#define F32
#endif
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
} xnvCtrlQueryExtensionReq;
#define sz_xnvCtrlQueryExtensionReq 4
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 major B16;
CARD16 minor B16;
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
CARD32 padl8 B32;
} xnvCtrlQueryExtensionReply;
#define sz_xnvCtrlQueryExtensionReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
} xnvCtrlIsNvReq;
#define sz_xnvCtrlIsNvReq 8
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 isnv B32;
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
CARD32 padl8 B32;
} xnvCtrlIsNvReply;
#define sz_xnvCtrlIsNvReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 target_type B32;
} xnvCtrlQueryTargetCountReq;
#define sz_xnvCtrlQueryTargetCountReq 8
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 count B32;
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
CARD32 padl8 B32;
} xnvCtrlQueryTargetCountReply;
#define sz_xnvCtrlQueryTargetCountReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16; /* X screen number or GPU number */
CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryAttributeReq;
#define sz_xnvCtrlQueryAttributeReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 value B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryAttributeReply;
#define sz_xnvCtrlQueryAttributeReply 32
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 pad3 B32;
int64_t value_64;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryAttribute64Reply;
#define sz_xnvCtrlQueryAttribute64Reply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16;
CARD16 target_type B16;
CARD32 display_mask B32;
CARD32 attribute B32;
INT32 value B32;
} xnvCtrlSetAttributeReq;
#define sz_xnvCtrlSetAttributeReq 20
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16;
CARD16 target_type B16;
CARD32 display_mask B32;
CARD32 attribute B32;
INT32 value B32;
} xnvCtrlSetAttributeAndGetStatusReq;
#define sz_xnvCtrlSetAttributeAndGetStatusReq 20
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlSetAttributeAndGetStatusReply;
#define sz_xnvCtrlSetAttributeAndGetStatusReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16; /* X screen number or GPU number */
CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryStringAttributeReq;
#define sz_xnvCtrlQueryStringAttributeReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 n B32; /* Length of string */
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryStringAttributeReply;
#define sz_xnvCtrlQueryStringAttributeReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16;
CARD16 target_type B16;
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 num_bytes B32;
} xnvCtrlSetStringAttributeReq;
#define sz_xnvCtrlSetStringAttributeReq 20
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlSetStringAttributeReply;
#define sz_xnvCtrlSetStringAttributeReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16; /* X screen number or GPU number */
CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryValidAttributeValuesReq;
#define sz_xnvCtrlQueryValidAttributeValuesReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 attr_type B32;
INT32 min B32;
INT32 max B32;
CARD32 bits B32;
CARD32 perms B32;
} xnvCtrlQueryValidAttributeValuesReply;
#define sz_xnvCtrlQueryValidAttributeValuesReply 32
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 attr_type B32;
int64_t min_64;
int64_t max_64;
CARD64 bits_64;
CARD32 perms B32;
CARD32 pad1 B32;
} xnvCtrlQueryValidAttributeValues64Reply;
#define sz_xnvCtrlQueryValidAttributeValues64Reply 48
#define sz_xnvCtrlQueryValidAttributeValues64Reply_extra ((48 - 32) >> 2)
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 attribute B32;
} xnvCtrlQueryAttributePermissionsReq;
#define sz_xnvCtrlQueryAttributePermissionsReq 8
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 attr_type B32;
CARD32 perms B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
CARD32 pad8 B32;
} xnvCtrlQueryAttributePermissionsReply;
#define sz_xnvCtrlQueryAttributePermissionsReply 32
/* Set GVO Color Conversion request (deprecated) */
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
FLOAT32 row1_col1 F32;
FLOAT32 row1_col2 F32;
FLOAT32 row1_col3 F32;
FLOAT32 row1_col4 F32;
FLOAT32 row2_col1 F32;
FLOAT32 row2_col2 F32;
FLOAT32 row2_col3 F32;
FLOAT32 row2_col4 F32;
FLOAT32 row3_col1 F32;
FLOAT32 row3_col2 F32;
FLOAT32 row3_col3 F32;
FLOAT32 row3_col4 F32;
} xnvCtrlSetGvoColorConversionDeprecatedReq;
#define sz_xnvCtrlSetGvoColorConversionDeprecatedReq 56
/* Query GVO Color Conversion request (deprecated) */
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
} xnvCtrlQueryGvoColorConversionDeprecatedReq;
#define sz_xnvCtrlQueryGvoColorConversionDeprecatedReq 8
/* Query GVO Color Conversion reply (deprecated) */
typedef struct {
BYTE type; /* X_Reply */
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
CARD32 pad8 B32;
} xnvCtrlQueryGvoColorConversionDeprecatedReply;
#define sz_xnvCtrlQueryGvoColorConversionDeprecatedReply 32
/* Set GVO Color Conversion request */
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
FLOAT32 cscMatrix_y_r F32;
FLOAT32 cscMatrix_y_g F32;
FLOAT32 cscMatrix_y_b F32;
FLOAT32 cscMatrix_cr_r F32;
FLOAT32 cscMatrix_cr_g F32;
FLOAT32 cscMatrix_cr_b F32;
FLOAT32 cscMatrix_cb_r F32;
FLOAT32 cscMatrix_cb_g F32;
FLOAT32 cscMatrix_cb_b F32;
FLOAT32 cscOffset_y F32;
FLOAT32 cscOffset_cr F32;
FLOAT32 cscOffset_cb F32;
FLOAT32 cscScale_y F32;
FLOAT32 cscScale_cr F32;
FLOAT32 cscScale_cb F32;
} xnvCtrlSetGvoColorConversionReq;
#define sz_xnvCtrlSetGvoColorConversionReq 68
/* Query GVO Color Conversion request */
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
} xnvCtrlQueryGvoColorConversionReq;
#define sz_xnvCtrlQueryGvoColorConversionReq 8
/* Query GVO Color Conversion reply */
typedef struct {
BYTE type; /* X_Reply */
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
CARD32 pad8 B32;
} xnvCtrlQueryGvoColorConversionReply;
#define sz_xnvCtrlQueryGvoColorConversionReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16; /* X screen number or GPU number */
CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryBinaryDataReq;
#define sz_xnvCtrlQueryBinaryDataReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 n B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryBinaryDataReply;
#define sz_xnvCtrlQueryBinaryDataReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD16 notifyType B16;
CARD16 onoff B16;
} xnvCtrlSelectNotifyReq;
#define sz_xnvCtrlSelectNotifyReq 12
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_id B16; /* X screen number or GPU number */
CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 num_bytes B32; /* Length of string */
} xnvCtrlStringOperationReq;
#define sz_xnvCtrlStringOperationReq 20
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 ret B32;
CARD32 num_bytes B32; /* Length of string */
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
} xnvCtrlStringOperationReply;
#define sz_xnvCtrlStringOperationReply 32
typedef struct {
union {
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
} u;
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
CARD32 time B32;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 value B32;
CARD32 pad0 B32;
CARD32 pad1 B32;
} attribute_changed;
} u;
} xnvctrlEvent;
/*
* Leave target_type before target_id for the
* xnvCtrlSelectTargetNotifyReq and xnvctrlEventTarget
* structures, even though other request protocol structures
* store target_id in the bottom 16-bits of the second DWORD of the
* structures. The event-related structures were added in version
* 1.8, and so there is no prior version with which to maintain
* compatibility.
*/
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD16 target_type B16; /* Don't swap these */
CARD16 target_id B16;
CARD16 notifyType B16;
CARD16 onoff B16;
} xnvCtrlSelectTargetNotifyReq;
#define sz_xnvCtrlSelectTargetNotifyReq 12
typedef struct {
union {
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
} u;
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
CARD32 time B32;
CARD16 target_type B16; /* Don't swap these */
CARD16 target_id B16;
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 value B32;
CARD32 pad0 B32;
CARD32 pad1 B32;
} attribute_changed;
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
CARD32 time B32;
CARD16 target_type B16; /* Don't swap these */
CARD16 target_id B16;
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 value B32;
CARD8 availability;
CARD8 pad0;
CARD16 pad1 B16;
CARD32 pad2 B32;
} availability_changed;
} u;
} xnvctrlEventTarget;
#endif /* __NVCONTROL_H */
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Define an "os_include" variable that points at the OS-specific generated
# headers. These were generated by running the configure script offline.
if (is_linux || is_android || is_nacl) {
os_include = "linux"
} else if (is_mac || is_ios) {
os_include = "mac"
} else if (is_win) {
os_include = "win32"
}
config("libxml_config") {
# Define LIBXML_STATIC as nothing to match how libxml.h (an internal header)
# defines LIBXML_STATIC, otherwise we get the macro redefined warning from
# GCC. ("defines" does "-DFOO" which defines the macro FOO as 1.)
cflags = [ "-DLIBXML_STATIC=" ]
include_dirs = [
"src/include",
"$os_include/include",
]
}
static_library("libxml") {
output_name = "libxml2"
sources = [
"chromium/libxml_utils.cc",
"chromium/libxml_utils.h",
"linux/config.h",
"linux/include/libxml/xmlversion.h",
"mac/config.h",
"mac/include/libxml/xmlversion.h",
"src/DOCBparser.c",
"src/HTMLparser.c",
"src/HTMLtree.c",
"src/SAX.c",
"src/SAX2.c",
"src/buf.c",
"src/buf.h",
"src/c14n.c",
"src/catalog.c",
"src/chvalid.c",
"src/debugXML.c",
"src/dict.c",
"src/elfgcchack.h",
"src/enc.h",
"src/encoding.c",
"src/entities.c",
"src/error.c",
"src/globals.c",
"src/hash.c",
"src/include/libxml/DOCBparser.h",
"src/include/libxml/HTMLparser.h",
"src/include/libxml/HTMLtree.h",
"src/include/libxml/SAX.h",
"src/include/libxml/SAX2.h",
"src/include/libxml/c14n.h",
"src/include/libxml/catalog.h",
"src/include/libxml/chvalid.h",
"src/include/libxml/debugXML.h",
"src/include/libxml/dict.h",
"src/include/libxml/encoding.h",
"src/include/libxml/entities.h",
"src/include/libxml/globals.h",
"src/include/libxml/hash.h",
"src/include/libxml/list.h",
"src/include/libxml/parser.h",
"src/include/libxml/parserInternals.h",
"src/include/libxml/pattern.h",
"src/include/libxml/relaxng.h",
"src/include/libxml/schemasInternals.h",
"src/include/libxml/schematron.h",
"src/include/libxml/threads.h",
"src/include/libxml/tree.h",
"src/include/libxml/uri.h",
"src/include/libxml/valid.h",
"src/include/libxml/xinclude.h",
"src/include/libxml/xlink.h",
"src/include/libxml/xmlIO.h",
"src/include/libxml/xmlautomata.h",
"src/include/libxml/xmlerror.h",
"src/include/libxml/xmlexports.h",
"src/include/libxml/xmlmemory.h",
"src/include/libxml/xmlmodule.h",
"src/include/libxml/xmlreader.h",
"src/include/libxml/xmlregexp.h",
"src/include/libxml/xmlsave.h",
"src/include/libxml/xmlschemas.h",
"src/include/libxml/xmlschemastypes.h",
"src/include/libxml/xmlstring.h",
"src/include/libxml/xmlunicode.h",
"src/include/libxml/xmlwriter.h",
"src/include/libxml/xpath.h",
"src/include/libxml/xpathInternals.h",
"src/include/libxml/xpointer.h",
"src/include/win32config.h",
"src/include/wsockcompat.h",
"src/legacy.c",
"src/libxml.h",
"src/list.c",
"src/parser.c",
"src/parserInternals.c",
"src/pattern.c",
"src/relaxng.c",
"src/save.h",
"src/schematron.c",
"src/threads.c",
"src/timsort.h",
"src/tree.c",
#"src/trio.c",
#"src/trio.h",
#"src/triodef.h",
#"src/trionan.c",
#"src/trionan.h",
#"src/triop.h",
#"src/triostr.c",
#"src/triostr.h",
"src/uri.c",
"src/valid.c",
"src/xinclude.c",
"src/xlink.c",
"src/xmlIO.c",
"src/xmlmemory.c",
"src/xmlmodule.c",
"src/xmlreader.c",
"src/xmlregexp.c",
"src/xmlsave.c",
"src/xmlschemas.c",
"src/xmlschemastypes.c",
"src/xmlstring.c",
"src/xmlunicode.c",
"src/xmlwriter.c",
"src/xpath.c",
"src/xpointer.c",
#"src/xzlib.c",
"src/xzlib.h",
"win32/config.h",
"win32/include/libxml/xmlversion.h",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":libxml_config" ]
public_deps = [
"//third_party/icu:icuuc",
]
deps = [
"//third_party/zlib",
]
if (is_win) {
cflags_c = [ "/wd4101" ] # Unreferenced local variable.
} else if (is_mac || is_ios || is_android) {
# http://www.xmlsoft.org/threads.html says that this is required when using
# libxml from several threads, which can possibly happen in chrome. On
# linux, this is picked up by transitivity from pkg-config output from
# build/linux/system.gyp.
defines = [ "_REENTRANT" ]
}
if (is_clang) {
cflags = [
# libxml passes `const unsigned char*` through `const char*`.
"-Wno-pointer-sign",
# pattern.c and uri.c both have an intentional `for (...);` /
# `while(...);` loop. I submitted a patch to move the `'` to its own
# line, but until that's landed suppress the warning:
"-Wno-empty-body",
# debugXML.c compares array 'arg' to NULL.
"-Wno-tautological-pointer-compare",
# threads.c attempts to forward declare a pthread_equal which doesn't
# match the prototype in pthreads.h
"-Wno-ignored-attributes",
]
}
config("libxml_warnings") {
if (is_clang) {
cflags += [
# libxml casts from int to long to void*.
"-Wno-int-to-void-pointer-cast",
# libxml passes a volatile LPCRITICAL_SECTION* to a function expecting
# a void* volatile*.
"-Wno-incompatible-pointer-types",
]
}
}
configs += [ ":libxml_warnings" ]
include_dirs = [ "$os_include" ]
}
include_rules = [
'+libxml',
]
# There's no real owners here. If you're familiar with the code please send
# a CL to add yourself here.
cpu@chromium.org
scottmg@chromium.org
Name: libxml
URL: http://xmlsoft.org
Version: 2.9.2
License: MIT
License File: src/Copyright
Security Critical: yes
Description:
libxml2 from libxml.org.
Modifications:
- Add helper classes in chromium/libxml_utils.cc and
chromium/include/libxml/libxml_utils.h.
- Import https://git.gnome.org/browse/libxml2/commit/?id=7580ce0a7f53891de520fed2c0e360266c286da6
from upstream.
- Self-assignment removed https://bugzilla.gnome.org/show_bug.cgi?id=751679.
To import a new snapshot:
On Linux, get the latest tar, untar, and replace src/ with libxml2-X.Y.Z/.
Remove:
src/doc/
src/example/
src/os400/
src/python/
src/result/
src/test/
src/vms/
src/VxWorks/
Generate config.h, include/libxml/xmlversion.h, and xml2-config:
cd linux
../src/configure --without-iconv --with-icu --without-ftp --without-http
cd ..
Patch config.h to not define HAVE_RAND_R since we use this file on Android
and it does not have it.
On a Mac, do the same in the mac/ subdir for config.h and
include/libxml/xmlversion.h and copy those to the Linux box in mac/
On a Windows box:
cd libxml2-2.9.2\win32
cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes ftp=no http=no
Then copy config.h and include/libxml/xmlversion.h to win32/ on Linux.
Update BUILD.gn and libxml.gyp as necessary to add/remove files, etc.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libxml_utils.h"
#include "libxml/xmlreader.h"
std::string XmlStringToStdString(const xmlChar* xmlstring) {
// xmlChar*s are UTF-8, so this cast is safe.
if (xmlstring)
return std::string(reinterpret_cast<const char*>(xmlstring));
else
return "";
}
XmlReader::XmlReader() : reader_(NULL) {
}
XmlReader::~XmlReader() {
if (reader_)
xmlFreeTextReader(reader_);
}
bool XmlReader::Load(const std::string& input) {
const int kParseOptions = XML_PARSE_RECOVER | // recover on errors
XML_PARSE_NONET; // forbid network access
// TODO(evanm): Verify it's OK to pass NULL for the URL and encoding.
// The libxml code allows for these, but it's unclear what effect is has.
reader_ = xmlReaderForMemory(input.data(), static_cast<int>(input.size()),
NULL, NULL, kParseOptions);
return reader_ != NULL;
}
bool XmlReader::LoadFile(const std::string& file_path) {
const int kParseOptions = XML_PARSE_RECOVER | // recover on errors
XML_PARSE_NONET; // forbid network access
reader_ = xmlReaderForFile(file_path.c_str(), NULL, kParseOptions);
return reader_ != NULL;
}
bool XmlReader::NodeAttribute(const char* name, std::string* out) {
xmlChar* value = xmlTextReaderGetAttribute(reader_, BAD_CAST name);
if (!value)
return false;
*out = XmlStringToStdString(value);
xmlFree(value);
return true;
}
bool XmlReader::IsClosingElement() {
return NodeType() == XML_READER_TYPE_END_ELEMENT;
}
bool XmlReader::ReadElementContent(std::string* content) {
const int start_depth = Depth();
if (xmlTextReaderIsEmptyElement(reader_)) {
// Empty tag. We succesfully read the content, but it's
// empty.
*content = "";
// Advance past this empty tag.
if (!Read())
return false;
return true;
}
// Advance past opening element tag.
if (!Read())
return false;
// Read the content. We read up until we hit a closing tag at the
// same level as our starting point.
while (NodeType() != XML_READER_TYPE_END_ELEMENT || Depth() != start_depth) {
*content += XmlStringToStdString(xmlTextReaderConstValue(reader_));
if (!Read())
return false;
}
// Advance past ending element tag.
if (!Read())
return false;
return true;
}
bool XmlReader::SkipToElement() {
do {
switch (NodeType()) {
case XML_READER_TYPE_ELEMENT:
return true;
case XML_READER_TYPE_END_ELEMENT:
return false;
default:
// Skip all other node types.
continue;
}
} while (Read());
return false;
}
// XmlWriter functions
XmlWriter::XmlWriter()
: writer_(NULL),
buffer_(NULL) {}
XmlWriter::~XmlWriter() {
if (writer_)
xmlFreeTextWriter(writer_);
if (buffer_)
xmlBufferFree(buffer_);
}
void XmlWriter::StartWriting() {
buffer_ = xmlBufferCreate();
writer_ = xmlNewTextWriterMemory(buffer_, 0);
xmlTextWriterSetIndent(writer_, 1);
xmlTextWriterStartDocument(writer_, NULL, NULL, NULL);
}
void XmlWriter::StopWriting() {
xmlTextWriterEndDocument(writer_);
xmlFreeTextWriter(writer_);
writer_ = NULL;
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
#define THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
#pragma once
#include <string>
#include "libxml/xmlreader.h"
#include "libxml/xmlwriter.h"
// Converts a libxml xmlChar* into a UTF-8 std::string.
// NULL inputs produce an empty string.
std::string XmlStringToStdString(const xmlChar* xmlstring);
// libxml uses a global error function pointer for reporting errors.
// A ScopedXmlErrorFunc object lets you change the global error pointer
// for the duration of the object's lifetime.
class ScopedXmlErrorFunc {
public:
ScopedXmlErrorFunc(void* context, xmlGenericErrorFunc func) {
old_error_func_ = xmlGenericError;
old_error_context_ = xmlGenericErrorContext;
xmlSetGenericErrorFunc(context, func);
}
~ScopedXmlErrorFunc() {
xmlSetGenericErrorFunc(old_error_context_, old_error_func_);
}
private:
xmlGenericErrorFunc old_error_func_;
void* old_error_context_;
};
// XmlReader is a wrapper class around libxml's xmlReader,
// providing a simplified C++ API.
class XmlReader {
public:
XmlReader();
~XmlReader();
// Load a document into the reader from memory. |input| must be UTF-8 and
// exist for the lifetime of this object. Returns false on error.
// TODO(evanm): handle encodings other than UTF-8?
bool Load(const std::string& input);
// Load a document into the reader from a file. Returns false on error.
bool LoadFile(const std::string& file_path);
// Wrappers around libxml functions -----------------------------------------
// Read() advances to the next node. Returns false on EOF or error.
bool Read() { return xmlTextReaderRead(reader_) == 1; }
// Next(), when pointing at an opening tag, advances to the node after
// the matching closing tag. Returns false on EOF or error.
bool Next() { return xmlTextReaderNext(reader_) == 1; }
// Return the depth in the tree of the current node.
int Depth() { return xmlTextReaderDepth(reader_); }
// Returns the "local" name of the current node.
// For a tag like <foo:bar>, this is the string "foo:bar".
std::string NodeName() {
return XmlStringToStdString(xmlTextReaderConstLocalName(reader_));
}
// When pointing at a tag, retrieves the value of an attribute.
// Returns false on failure.
// E.g. for <foo bar:baz="a">, NodeAttribute("bar:baz", &value)
// returns true and |value| is set to "a".
bool NodeAttribute(const char* name, std::string* value);
// Returns true if the node is a closing element (e.g. </foo>).
bool IsClosingElement();
// Helper functions not provided by libxml ----------------------------------
// Return the string content within an element.
// "<foo>bar</foo>" is a sequence of three nodes:
// (1) open tag, (2) text, (3) close tag.
// With the reader currently at (1), this returns the text of (2),
// and advances past (3).
// Returns false on error.
bool ReadElementContent(std::string* content);
// Skip to the next opening tag, returning false if we reach a closing
// tag or EOF first.
// If currently on an opening tag, doesn't advance at all.
bool SkipToElement();
private:
// Returns the libxml node type of the current node.
int NodeType() { return xmlTextReaderNodeType(reader_); }
// The underlying libxml xmlTextReader.
xmlTextReaderPtr reader_;
};
// XmlWriter is a wrapper class around libxml's xmlWriter,
// providing a simplified C++ API.
// StartWriting must be called before other methods, and StopWriting
// must be called before GetWrittenString() will return results.
class XmlWriter {
public:
XmlWriter();
~XmlWriter();
// Allocates the xmlTextWriter and an xmlBuffer and starts an XML document.
// This must be called before any other functions. By default, indenting is
// set to true.
void StartWriting();
// Ends the XML document and frees the xmlTextWriter.
// This must be called before GetWrittenString() is called.
void StopWriting();
// Wrappers around libxml functions -----------------------------------------
// All following elements will be indented to match their depth.
void StartIndenting() { xmlTextWriterSetIndent(writer_, 1); }
// All follow elements will not be indented.
void StopIndenting() { xmlTextWriterSetIndent(writer_, 0); }
// Start an element with the given name. All future elements added will be
// children of this element, until it is ended. Returns false on error.
bool StartElement(const std::string& element_name) {
return xmlTextWriterStartElement(writer_,
BAD_CAST element_name.c_str()) >= 0;
}
// Ends the current open element. Returns false on error.
bool EndElement() {
return xmlTextWriterEndElement(writer_) >= 0;
}
// Appends to the content of the current open element.
bool AppendElementContent(const std::string& content) {
return xmlTextWriterWriteString(writer_,
BAD_CAST content.c_str()) >= 0;
}
// Adds an attribute to the current open element. Returns false on error.
bool AddAttribute(const std::string& attribute_name,
const std::string& attribute_value) {
return xmlTextWriterWriteAttribute(writer_,
BAD_CAST attribute_name.c_str(),
BAD_CAST attribute_value.c_str()) >= 0;
}
// Adds a new element with name |element_name| and content |content|
// to the buffer. Example: <|element_name|>|content|</|element_name|>
// Returns false on errors.
bool WriteElement(const std::string& element_name,
const std::string& content) {
return xmlTextWriterWriteElement(writer_,
BAD_CAST element_name.c_str(),
BAD_CAST content.c_str()) >= 0;
}
// Helper functions not provided by xmlTextWriter ---------------------------
// Returns the string that has been written to the buffer.
std::string GetWrittenString() {
if (buffer_ == NULL)
return "";
return XmlStringToStdString(buffer_->content);
}
private:
// The underlying libxml xmlTextWriter.
xmlTextWriterPtr writer_;
// Stores the output.
xmlBufferPtr buffer_;
};
#endif // THIRD_PARTY_LIBXML_CHROMIUM_INCLUDE_LIBXML_LIBXML_UTILS_H_
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'conditions': [
# Define an "os_include" variable that points at the OS-specific generated
# headers. These were generated by running the configure script offline.
['os_posix == 1 and OS != "mac" and OS != "ios"', {
'os_include': 'linux'
}],
['OS=="mac"', {'os_include': 'mac'}],
['OS=="win"', {'os_include': 'win32'}],
],
'use_system_libxml%': 0,
},
'targets': [
{
'target_name': 'libxml',
'conditions': [
['use_system_libxml', {
'conditions': [
['os_posix == 1 and OS != "mac" and OS != "ios"', {
'type': 'static_library',
'sources': [
'chromium/libxml_utils.h',
'chromium/libxml_utils.cc',
],
'cflags': [
'<!@(pkg-config --cflags libxml-2.0)',
],
'defines': [
'USE_SYSTEM_LIBXML',
],
'direct_dependent_settings': {
'cflags': [
'<!@(pkg-config --cflags libxml-2.0)',
],
'defines': [
'USE_SYSTEM_LIBXML',
],
},
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other libxml-2.0)',
],
'libraries': [
'<!@(pkg-config --libs-only-l libxml-2.0)',
],
},
}],
['OS == "ios"', {
'type': 'static_library',
'sources': [
'chromium/libxml_utils.h',
'chromium/libxml_utils.cc',
],
'include_dirs': [
'$(SDKROOT)/usr/include/libxml2',
],
'all_dependent_settings': {
'defines': [
'USE_SYSTEM_LIBXML',
],
'include_dirs': [
'$(SDKROOT)/usr/include/libxml2',
],
},
'link_settings': {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-lxml2',
],
},
},
}],
],
}, { # else: !use_system_libxml
'type': 'static_library',
'sources': [
'chromium/libxml_utils.h',
'chromium/libxml_utils.cc',
'linux/config.h',
'linux/include/libxml/xmlversion.h',
'mac/config.h',
'mac/include/libxml/xmlversion.h',
'src/include/libxml/c14n.h',
'src/include/libxml/catalog.h',
'src/include/libxml/chvalid.h',
'src/include/libxml/debugXML.h',
'src/include/libxml/dict.h',
'src/include/libxml/DOCBparser.h',
'src/include/libxml/encoding.h',
'src/include/libxml/entities.h',
'src/include/libxml/globals.h',
'src/include/libxml/hash.h',
'src/include/libxml/HTMLparser.h',
'src/include/libxml/HTMLtree.h',
'src/include/libxml/list.h',
'src/include/libxml/parser.h',
'src/include/libxml/parserInternals.h',
'src/include/libxml/pattern.h',
'src/include/libxml/relaxng.h',
'src/include/libxml/SAX.h',
'src/include/libxml/SAX2.h',
'src/include/libxml/schemasInternals.h',
'src/include/libxml/schematron.h',
'src/include/libxml/threads.h',
'src/include/libxml/tree.h',
'src/include/libxml/uri.h',
'src/include/libxml/valid.h',
'src/include/libxml/xinclude.h',
'src/include/libxml/xlink.h',
'src/include/libxml/xmlautomata.h',
'src/include/libxml/xmlerror.h',
'src/include/libxml/xmlexports.h',
'src/include/libxml/xmlIO.h',
'src/include/libxml/xmlmemory.h',
'src/include/libxml/xmlmodule.h',
'src/include/libxml/xmlreader.h',
'src/include/libxml/xmlregexp.h',
'src/include/libxml/xmlsave.h',
'src/include/libxml/xmlschemas.h',
'src/include/libxml/xmlschemastypes.h',
'src/include/libxml/xmlstring.h',
'src/include/libxml/xmlunicode.h',
'src/include/libxml/xmlwriter.h',
'src/include/libxml/xpath.h',
'src/include/libxml/xpathInternals.h',
'src/include/libxml/xpointer.h',
'src/include/win32config.h',
'src/include/wsockcompat.h',
'src/buf.c',
'src/buf.h',
'src/c14n.c',
'src/catalog.c',
'src/chvalid.c',
'src/debugXML.c',
'src/dict.c',
'src/DOCBparser.c',
'src/elfgcchack.h',
'src/enc.h',
'src/encoding.c',
'src/entities.c',
'src/error.c',
'src/globals.c',
'src/hash.c',
'src/HTMLparser.c',
'src/HTMLtree.c',
'src/legacy.c',
'src/libxml.h',
'src/list.c',
'src/parser.c',
'src/parserInternals.c',
'src/pattern.c',
'src/relaxng.c',
'src/save.h',
'src/SAX.c',
'src/SAX2.c',
'src/schematron.c',
'src/threads.c',
'src/timsort.h',
'src/tree.c',
#'src/trio.c',
#'src/trio.h',
#'src/triodef.h',
#'src/trionan.c',
#'src/trionan.h',
#'src/triop.h',
#'src/triostr.c',
#'src/triostr.h',
'src/uri.c',
'src/valid.c',
'src/xinclude.c',
'src/xlink.c',
'src/xmlIO.c',
'src/xmlmemory.c',
'src/xmlmodule.c',
'src/xmlreader.c',
'src/xmlregexp.c',
'src/xmlsave.c',
'src/xmlschemas.c',
'src/xmlschemastypes.c',
'src/xmlstring.c',
'src/xmlunicode.c',
'src/xmlwriter.c',
'src/xpath.c',
'src/xpointer.c',
#'src/xzlib.c',
'src/xzlib.h',
'win32/config.h',
'win32/include/libxml/xmlversion.h',
],
'defines': [
# Define LIBXML_STATIC as nothing to match how libxml.h
# (an internal header) defines LIBXML_STATIC, otherwise
# we get the macro redefined warning from GCC. (-DFOO
# defines the macro FOO as 1.)
'LIBXML_STATIC=',
],
'variables': {
'clang_warning_flags': [
# libxml passes `const unsigned char*` through `const char*`.
'-Wno-pointer-sign',
# pattern.c and uri.c both have an intentional
# `for (...);` / `while(...);` loop. I submitted a patch to
# move the `'` to its own line, but until that's landed
# suppress the warning:
'-Wno-empty-body',
# debugXML.c compares array 'arg' to NULL.
'-Wno-tautological-pointer-compare',
# See http://crbug.com/138571#c8
'-Wno-ignored-attributes',
# libxml casts from int to long to void*.
'-Wno-int-to-void-pointer-cast',
# libxml passes a volatile LPCRITICAL_SECTION* to a function
# expecting a void* volatile*.
'-Wno-incompatible-pointer-types',
],
},
'include_dirs': [
'<(os_include)',
'<(os_include)/include',
'src/include',
],
'dependencies': [
'../icu/icu.gyp:icuuc',
'../zlib/zlib.gyp:zlib',
],
'export_dependent_settings': [
'../icu/icu.gyp:icuuc',
],
'direct_dependent_settings': {
'defines': [
'LIBXML_STATIC',
],
'include_dirs': [
'<(os_include)/include',
'src/include',
],
},
'conditions': [
['OS=="linux"', {
'link_settings': {
'libraries': [
# We need dl for dlopen() and friends.
'-ldl',
'-lm',
],
},
}],
# http://www.xmlsoft.org/threads.html says that this is required
# when using libxml from several threads, which can possibly happen
# in chrome. On linux, this is picked up by transitivity from
# pkg-config output from build/linux/system.gyp.
['OS=="mac" or OS=="android"', {'defines': ['_REENTRANT']}],
['OS=="win"', {
'product_name': 'libxml2',
# Disable unimportant 'unused variable' warning, and
# signed/unsigned comparison warning. The signed/unsigned (4101)
# is fixed upstream and can be removed eventually.
# TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4018, 4101, 4267 ],
}, { # else: OS!="win"
'product_name': 'xml2',
}],
],
}],
['OS == "ios"', {
'toolsets': ['host', 'target'],
}],
],
},
],
}
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Type cast for the gethostbyname() argument */
#define GETHOSTBYNAME_ARG_CAST /**/
/* Define to 1 if you have the <ansidecl.h> header file. */
/* #undef HAVE_ANSIDECL_H */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#define HAVE_ARPA_NAMESER_H 1
/* Whether struct sockaddr::__ss_family exists */
/* #undef HAVE_BROKEN_SS_FAMILY */
/* Define to 1 if you have the `class' function. */
/* #undef HAVE_CLASS */
/* Define to 1 if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Have dlopen based dso */
#define HAVE_DLOPEN /**/
/* Define to 1 if you have the <dl.h> header file. */
/* #undef HAVE_DL_H */
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `finite' function. */
#define HAVE_FINITE 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `fpclass' function. */
/* #undef HAVE_FPCLASS */
/* Define to 1 if you have the `fprintf' function. */
#define HAVE_FPRINTF 1
/* Define to 1 if you have the `fp_class' function. */
/* #undef HAVE_FP_CLASS */
/* Define to 1 if you have the <fp_class.h> header file. */
/* #undef HAVE_FP_CLASS_H */
/* Define to 1 if you have the `ftime' function. */
#define HAVE_FTIME 1
/* Define if getaddrinfo is there */
#define HAVE_GETADDRINFO /**/
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the <ieeefp.h> header file. */
/* #undef HAVE_IEEEFP_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `isascii' function. */
#define HAVE_ISASCII 1
/* Define if isinf is there */
#define HAVE_ISINF /**/
/* Define if isnan is there */
#define HAVE_ISNAN /**/
/* Define to 1 if you have the `isnand' function. */
/* #undef HAVE_ISNAND */
/* Define if history library is there (-lhistory) */
/* #undef HAVE_LIBHISTORY */
/* Have compression library */
/* #undef HAVE_LIBLZMA */
/* Define if pthread library is there (-lpthread) */
#define HAVE_LIBPTHREAD /**/
/* Define if readline library is there (-lreadline) */
/* #undef HAVE_LIBREADLINE */
/* Have compression library */
#define HAVE_LIBZ 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
/* Define to 1 if you have the <lzma.h> header file. */
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the <math.h> header file. */
#define HAVE_MATH_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define to 1 if you have the `munmap' function. */
#define HAVE_MUNMAP 1
/* mmap() is no good without munmap() */
#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
# undef /**/ HAVE_MMAP
#endif
/* Define to 1 if you have the <nan.h> header file. */
/* #undef HAVE_NAN_H */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1
/* Define to 1 if you have the `printf' function. */
#define HAVE_PRINTF 1
/* Define if <pthread.h> is there */
#define HAVE_PTHREAD_H /**/
/* Define to 1 if you have the `putenv' function. */
#define HAVE_PUTENV 1
/* Define to 1 if you have the `rand' function. */
#define HAVE_RAND 1
/* Define to 1 if you have the `rand_r' function. */
/* #undef HAVE_RAND_R */
/* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1
/* Have shl_load based dso */
/* #undef HAVE_SHLLOAD */
/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* Define to 1 if you have the `sprintf' function. */
#define HAVE_SPRINTF 1
/* Define to 1 if you have the `srand' function. */
#define HAVE_SRAND 1
/* Define to 1 if you have the `sscanf' function. */
#define HAVE_SSCANF 1
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
#define HAVE_STRNDUP 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `time' function. */
#define HAVE_TIME 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Whether va_copy() is available */
#define HAVE_VA_COPY 1
/* Define to 1 if you have the `vfprintf' function. */
#define HAVE_VFPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsprintf' function. */
#define HAVE_VSPRINTF 1
/* Define to 1 if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
/* Define to 1 if you have the `_stat' function. */
/* #undef HAVE__STAT */
/* Whether __va_copy() is available */
/* #undef HAVE___VA_COPY */
/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "libxml2"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Type cast for the send() function 2nd arg */
#define SEND_ARG2_CAST /**/
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Support for IPv6 */
#define SUPPORT_IP6 /**/
/* Define if va_list is an array type */
#define VA_LIST_IS_ARRAY 1
/* Version number of package */
#define VERSION "2.9.2"
/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Using the Win32 Socket implementation */
/* #undef _WINSOCKAPI_ */
/* ss_family is not defined here, use __ss_family instead */
/* #undef ss_family */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/*
* Summary: compile-time version informations
* Description: compile-time version informations for the XML library
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_VERSION_H__
#define __XML_VERSION_H__
#include <libxml/xmlexports.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* use those to be sure nothing nasty will happen if
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */
/**
* LIBXML_DOTTED_VERSION:
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.9.2"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 20902
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "20902"
/**
* LIBXML_VERSION_EXTRA:
*
* extra version information, used to show a CVS compilation
*/
#define LIBXML_VERSION_EXTRA ""
/**
* LIBXML_TEST_VERSION:
*
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20902);
#ifndef VMS
#if 0
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO
#else
/**
* WITHOUT_TRIO:
*
* defined if the trio support should not be configured in
*/
#define WITHOUT_TRIO
#endif
#else /* VMS */
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO 1
#endif /* VMS */
/**
* LIBXML_THREAD_ENABLED:
*
* Whether the thread support is configured in
*/
#if 1
#if defined(_REENTRANT) || defined(__MT__) || \
(defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
#define LIBXML_THREAD_ENABLED
#endif
#endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if 0
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/**
* LIBXML_TREE_ENABLED:
*
* Whether the DOM like tree manipulation API support is configured in
*/
#if 1
#define LIBXML_TREE_ENABLED
#endif
/**
* LIBXML_OUTPUT_ENABLED:
*
* Whether the serialization/saving support is configured in
*/
#if 1
#define LIBXML_OUTPUT_ENABLED
#endif
/**
* LIBXML_PUSH_ENABLED:
*
* Whether the push parsing interfaces are configured in
*/
#if 1
#define LIBXML_PUSH_ENABLED
#endif
/**
* LIBXML_READER_ENABLED:
*
* Whether the xmlReader parsing interface is configured in
*/
#if 1
#define LIBXML_READER_ENABLED
#endif
/**
* LIBXML_PATTERN_ENABLED:
*
* Whether the xmlPattern node selection interface is configured in
*/
#if 1
#define LIBXML_PATTERN_ENABLED
#endif
/**
* LIBXML_WRITER_ENABLED:
*
* Whether the xmlWriter saving interface is configured in
*/
#if 1
#define LIBXML_WRITER_ENABLED
#endif
/**
* LIBXML_SAX1_ENABLED:
*
* Whether the older SAX1 interface is configured in
*/
#if 1
#define LIBXML_SAX1_ENABLED
#endif
/**
* LIBXML_FTP_ENABLED:
*
* Whether the FTP support is configured in
*/
#if 0
#define LIBXML_FTP_ENABLED
#endif
/**
* LIBXML_HTTP_ENABLED:
*
* Whether the HTTP support is configured in
*/
#if 0
#define LIBXML_HTTP_ENABLED
#endif
/**
* LIBXML_VALID_ENABLED:
*
* Whether the DTD validation support is configured in
*/
#if 1
#define LIBXML_VALID_ENABLED
#endif
/**
* LIBXML_HTML_ENABLED:
*
* Whether the HTML support is configured in
*/
#if 1
#define LIBXML_HTML_ENABLED
#endif
/**
* LIBXML_LEGACY_ENABLED:
*
* Whether the deprecated APIs are compiled in for compatibility
*/
#if 1
#define LIBXML_LEGACY_ENABLED
#endif
/**
* LIBXML_C14N_ENABLED:
*
* Whether the Canonicalization support is configured in
*/
#if 1
#define LIBXML_C14N_ENABLED
#endif
/**
* LIBXML_CATALOG_ENABLED:
*
* Whether the Catalog support is configured in
*/
#if 1
#define LIBXML_CATALOG_ENABLED
#endif
/**
* LIBXML_DOCB_ENABLED:
*
* Whether the SGML Docbook support is configured in
*/
#if 1
#define LIBXML_DOCB_ENABLED
#endif
/**
* LIBXML_XPATH_ENABLED:
*
* Whether XPath is configured in
*/
#if 1
#define LIBXML_XPATH_ENABLED
#endif
/**
* LIBXML_XPTR_ENABLED:
*
* Whether XPointer is configured in
*/
#if 1
#define LIBXML_XPTR_ENABLED
#endif
/**
* LIBXML_XINCLUDE_ENABLED:
*
* Whether XInclude is configured in
*/
#if 1
#define LIBXML_XINCLUDE_ENABLED
#endif
/**
* LIBXML_ICONV_ENABLED:
*
* Whether iconv support is available
*/
#if 0
#define LIBXML_ICONV_ENABLED
#endif
/**
* LIBXML_ICU_ENABLED:
*
* Whether icu support is available
*/
#if 1
#define LIBXML_ICU_ENABLED
#endif
/**
* LIBXML_ISO8859X_ENABLED:
*
* Whether ISO-8859-* support is made available in case iconv is not
*/
#if 1
#define LIBXML_ISO8859X_ENABLED
#endif
/**
* LIBXML_DEBUG_ENABLED:
*
* Whether Debugging module is configured in
*/
#if 1
#define LIBXML_DEBUG_ENABLED
#endif
/**
* DEBUG_MEMORY_LOCATION:
*
* Whether the memory debugging is configured in
*/
#if 0
#define DEBUG_MEMORY_LOCATION
#endif
/**
* LIBXML_DEBUG_RUNTIME:
*
* Whether the runtime debugging is configured in
*/
#if 0
#define LIBXML_DEBUG_RUNTIME
#endif
/**
* LIBXML_UNICODE_ENABLED:
*
* Whether the Unicode related interfaces are compiled in
*/
#if 1
#define LIBXML_UNICODE_ENABLED
#endif
/**
* LIBXML_REGEXP_ENABLED:
*
* Whether the regular expressions interfaces are compiled in
*/
#if 1
#define LIBXML_REGEXP_ENABLED
#endif
/**
* LIBXML_AUTOMATA_ENABLED:
*
* Whether the automata interfaces are compiled in
*/
#if 1
#define LIBXML_AUTOMATA_ENABLED
#endif
/**
* LIBXML_EXPR_ENABLED:
*
* Whether the formal expressions interfaces are compiled in
*/
#if 1
#define LIBXML_EXPR_ENABLED
#endif
/**
* LIBXML_SCHEMAS_ENABLED:
*
* Whether the Schemas validation interfaces are compiled in
*/
#if 1
#define LIBXML_SCHEMAS_ENABLED
#endif
/**
* LIBXML_SCHEMATRON_ENABLED:
*
* Whether the Schematron validation interfaces are compiled in
*/
#if 1
#define LIBXML_SCHEMATRON_ENABLED
#endif
/**
* LIBXML_MODULES_ENABLED:
*
* Whether the module interfaces are compiled in
*/
#if 1
#define LIBXML_MODULES_ENABLED
/**
* LIBXML_MODULE_EXTENSION:
*
* the string suffix used by dynamic modules (usually shared libraries)
*/
#define LIBXML_MODULE_EXTENSION ".so"
#endif
/**
* LIBXML_ZLIB_ENABLED:
*
* Whether the Zlib support is compiled in
*/
#if 1
#define LIBXML_ZLIB_ENABLED
#endif
/**
* LIBXML_LZMA_ENABLED:
*
* Whether the Lzma support is compiled in
*/
#if 0
#define LIBXML_LZMA_ENABLED
#endif
#ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H
#include <ansidecl.h>
#endif
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#ifndef ATTRIBUTE_UNUSED
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
# define ATTRIBUTE_UNUSED __attribute__((unused))
# else
# define ATTRIBUTE_UNUSED
# endif
#endif
/**
* LIBXML_ATTR_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#ifndef LIBXML_ATTR_ALLOC_SIZE
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else
# define LIBXML_ATTR_ALLOC_SIZE(x)
# endif
#else
# define LIBXML_ATTR_ALLOC_SIZE(x)
#endif
/**
* LIBXML_ATTR_FORMAT:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#ifndef LIBXML_ATTR_FORMAT
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
# else
# define LIBXML_ATTR_FORMAT(fmt,args)
# endif
#else
# define LIBXML_ATTR_FORMAT(fmt,args)
#endif
#else /* ! __GNUC__ */
/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
#define ATTRIBUTE_UNUSED
/**
* LIBXML_ATTR_ALLOC_SIZE:
*
* Macro used to indicate to GCC this is an allocator function
*/
#define LIBXML_ATTR_ALLOC_SIZE(x)
/**
* LIBXML_ATTR_FORMAT:
*
* Macro used to indicate to GCC the parameter are printf like
*/
#define LIBXML_ATTR_FORMAT(fmt,args)
#endif /* __GNUC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
此差异已折叠。
此差异已折叠。
Daniel Veillard <daniel@veillard.com>
Bjorn Reese <breese@users.sourceforge.net>
William Brack <wbrack@mmm.com.hk>
Igor Zlatkovic <igor@zlatkovic.com> for the Windows port
Aleksey Sanin <aleksey@aleksey.com>
此差异已折叠。
Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
<?xml version="1.0" ?>
<!-- $Id$ -->
<bakefile-gen>
<disable-formats>gnu,dmars,cbx_unix,cbuilderx</disable-formats>
<input>libxml2.bkl</input>
<!-- List of output formats to generate: -->
<add-formats>
borland,dmars,mingw,msvc,msvc6prj,watcom,cbuilderx,cbx_unix,gnu
</add-formats>
</bakefile-gen>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
## Process this file with automake to produce Makefile.in
SUBDIRS=libxml
EXTRA_DIST = win32config.h wsockcompat.h
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册