зеркало из https://github.com/stride3d/SharpYaml.git
Added: Converter from YAML to XML.
This commit is contained in:
Родитель
a943090df5
Коммит
6dce7f9037
|
@ -0,0 +1,4 @@
|
|||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("YamlDotNet.Converters")]
|
||||
[assembly: AssemblyDescription("Part of the YamlDotNet library, provides converters to transform other formats from and to YAML.")]
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using YamlDotNet.Converters.Xml;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace YamlDotNet.Converters.Xml.Extensions {
|
||||
/// <summary>
|
||||
/// Defines extension methods for calling the methods of <see cref="XmlConverter"/>.
|
||||
/// </summary>
|
||||
public static class XmlConverterExtensions
|
||||
{
|
||||
public static XmlDocument ToXml(this YamlDocument document, string rootElementName) {
|
||||
XmlConverter converter = new XmlConverter();
|
||||
return converter.ToXml(document, rootElementName);
|
||||
}
|
||||
|
||||
public static XmlDocument ToXml(this YamlDocument document) {
|
||||
return document.ToXml("root");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace YamlDotNet.Converters.Xml
|
||||
{
|
||||
public class XmlConverter
|
||||
{
|
||||
private class YamlToXmlDocumentVisitor : YamlVisitor {
|
||||
private XmlDocument document;
|
||||
private XmlNode current;
|
||||
private Stack<string> states = new Stack<string>();
|
||||
|
||||
public XmlDocument Document {
|
||||
get {
|
||||
return document;
|
||||
}
|
||||
}
|
||||
|
||||
private XmlNode AddNode() {
|
||||
XmlNode newNode = document.CreateElement(states.Peek());
|
||||
current.AppendChild(newNode);
|
||||
return newNode;
|
||||
}
|
||||
|
||||
private void PushNode(string childElementName) {
|
||||
current = AddNode();
|
||||
states.Push(childElementName);
|
||||
}
|
||||
|
||||
private void PopNode() {
|
||||
current = current.ParentNode;
|
||||
states.Pop();
|
||||
}
|
||||
|
||||
public YamlToXmlDocumentVisitor(string rootElementName) {
|
||||
states.Push(rootElementName);
|
||||
}
|
||||
|
||||
protected override void Visit(YamlDocument document)
|
||||
{
|
||||
this.document = new XmlDocument();
|
||||
current = this.document;
|
||||
}
|
||||
|
||||
protected override void Visit(YamlScalarNode scalar)
|
||||
{
|
||||
XmlNode scalarNode = AddNode();
|
||||
scalarNode.AppendChild(document.CreateTextNode(scalar.Value));
|
||||
}
|
||||
|
||||
protected override void Visit(YamlSequenceNode sequence)
|
||||
{
|
||||
PushNode("sequence");
|
||||
}
|
||||
|
||||
protected override void Visited(YamlSequenceNode sequence)
|
||||
{
|
||||
PopNode();
|
||||
}
|
||||
|
||||
protected override void Visit(YamlMappingNode mapping)
|
||||
{
|
||||
PushNode("mapping");
|
||||
}
|
||||
|
||||
protected override void Visited(YamlMappingNode mapping)
|
||||
{
|
||||
PopNode();
|
||||
}
|
||||
|
||||
protected override void VisitChildren (YamlMappingNode mapping)
|
||||
{
|
||||
foreach (var pair in mapping.Children) {
|
||||
PushNode("key");
|
||||
pair.Key.Accept(this);
|
||||
states.Pop();
|
||||
states.Push("value");
|
||||
pair.Value.Accept(this);
|
||||
PopNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public XmlDocument ToXml(YamlDocument document, string rootElementName) {
|
||||
YamlToXmlDocumentVisitor visitor = new YamlToXmlDocumentVisitor(rootElementName);
|
||||
document.Accept(visitor);
|
||||
return visitor.Document;
|
||||
}
|
||||
|
||||
public YamlDocument FromXml(XmlDocument document) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
|
||||
namespace YamlDotNet.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies how a <see cref="XmlConverter"/> behaves.
|
||||
/// </summary>
|
||||
public class XmlConverterOptions
|
||||
{
|
||||
private string rootElementName = "root";
|
||||
|
||||
/// <value>
|
||||
/// Gets the name of the root XML element.
|
||||
/// </value>
|
||||
public string RootElementName {
|
||||
get {
|
||||
return rootElementName;
|
||||
}
|
||||
set {
|
||||
if(string.IsNullOrEmpty(value)) {
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
rootElementName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string sequenceElementName = "sequence";
|
||||
|
||||
/// <value>
|
||||
/// Gets the name of sequence elements.
|
||||
/// </value>
|
||||
public string SequenceElementName {
|
||||
get {
|
||||
return sequenceElementName;
|
||||
}
|
||||
set {
|
||||
if(string.IsNullOrEmpty(value)) {
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
sequenceElementName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string mappingElementName = "mapping";
|
||||
|
||||
/// <value>
|
||||
/// Gets the name of mapping elements.
|
||||
/// </value>
|
||||
public string MappingElementName {
|
||||
get {
|
||||
return mappingElementName;
|
||||
}
|
||||
set {
|
||||
if(string.IsNullOrEmpty(value)) {
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
mappingElementName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string mappingKeyElementName = "key";
|
||||
|
||||
/// <value>
|
||||
/// Gets the name of key elements.
|
||||
/// </value>
|
||||
public string MappingKeyElementName {
|
||||
get {
|
||||
return mappingKeyElementName;
|
||||
}
|
||||
set {
|
||||
if(string.IsNullOrEmpty(value)) {
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
mappingKeyElementName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string mappingValueElementName = "value";
|
||||
|
||||
/// <value>
|
||||
/// Gets the name of key elements.
|
||||
/// </value>
|
||||
public string MappingValueElementName {
|
||||
get {
|
||||
return mappingValueElementName;
|
||||
}
|
||||
set {
|
||||
if(string.IsNullOrEmpty(value)) {
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
mappingValueElementName = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<Project name="YamlDotNet.Converters" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
|
||||
<Configurations active="Debug">
|
||||
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
|
||||
<Output directory="bin/Debug" signAssembly="True" assemblyKeyFile="../YamlDotNet.snk" assembly="YamlDotNet.Converters" />
|
||||
<Build debugmode="True" target="Library" />
|
||||
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
|
||||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
|
||||
</Configuration>
|
||||
<Configuration name="Release" ctype="DotNetProjectConfiguration">
|
||||
<Output directory="bin/Release" signAssembly="True" assemblyKeyFile="../YamlDotNet.snk" assembly="YamlDotNet.Converters" />
|
||||
<Build debugmode="False" target="Library" />
|
||||
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
|
||||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<Contents>
|
||||
<File name="../CommonAssemblyInfo.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="Properties" subtype="Directory" buildaction="Compile" />
|
||||
<File name="Properties/AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="Xml" subtype="Directory" buildaction="Compile" />
|
||||
<File name="Xml/XmlConverter.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="Xml/Extensions" subtype="Directory" buildaction="Compile" />
|
||||
<File name="Xml/Extensions/XmlConverterExtensions.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="Xml/XmlConverterOptions.cs" subtype="Code" buildaction="Compile" />
|
||||
</Contents>
|
||||
<References>
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<ProjectReference type="Project" localcopy="True" refto="YamlDotNet.Core" />
|
||||
<ProjectReference type="Project" localcopy="True" refto="YamlDotNet.RepresentationModel" />
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</References>
|
||||
</Project>
|
|
@ -1,50 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "AliasEvent.h"
|
||||
#include "StringConverter.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
using namespace System::Runtime::InteropServices;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
AliasEvent::AliasEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
anchor = nullptr;
|
||||
}
|
||||
|
||||
AliasEvent::AliasEvent(String^ _anchor)
|
||||
: anchor(_anchor)
|
||||
{
|
||||
}
|
||||
|
||||
AliasEvent::~AliasEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ AliasEvent::Anchor::get() {
|
||||
if(anchor == nullptr && NativeEvent != NULL) {
|
||||
anchor = StringConverter::Convert(NativeEvent->data.alias.anchor);
|
||||
}
|
||||
return anchor;
|
||||
}
|
||||
|
||||
String^ AliasEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0} {1}", GetType()->Name, Anchor);
|
||||
}
|
||||
|
||||
void AliasEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
yaml_char_t* anchorBuffer = StringConverter::Convert(Anchor);
|
||||
|
||||
int result = yaml_alias_event_initialize(nativeEvent, anchorBuffer);
|
||||
|
||||
if(anchorBuffer != NULL) {
|
||||
delete[] anchorBuffer;
|
||||
}
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
/// <summary>
|
||||
/// Contains informations about a YAML alias.
|
||||
/// </summary>
|
||||
public ref class AliasEvent : public YamlEvent
|
||||
{
|
||||
private:
|
||||
String^ anchor;
|
||||
|
||||
internal:
|
||||
AliasEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
AliasEvent(String^ anchor);
|
||||
virtual ~AliasEvent();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the anchor
|
||||
/// </summary>
|
||||
property String^ Anchor {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
#include "stdafx.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Reflection;
|
||||
using namespace System::Runtime::CompilerServices;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace System::Security::Permissions;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly:AssemblyTitleAttribute("YamlDotNet.Core")];
|
||||
[assembly:AssemblyDescriptionAttribute("A library for parsing and emitting YAML.")];
|
||||
#ifdef _DEBUG
|
||||
[assembly: AssemblyConfigurationAttribute("Debug")]
|
||||
#else
|
||||
[assembly: AssemblyConfigurationAttribute("Release")]
|
||||
#endif
|
||||
[assembly:AssemblyCompanyAttribute("")];
|
||||
[assembly:AssemblyProductAttribute("YamlDotNet")];
|
||||
[assembly:AssemblyCopyrightAttribute("Copyright © Antoine Aubry 2008")];
|
||||
[assembly:AssemblyTrademarkAttribute("")];
|
||||
[assembly:AssemblyCultureAttribute("")];
|
||||
[assembly:CLSCompliant(true)]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly:AssemblyVersionAttribute("0.1.*")];
|
||||
|
||||
[assembly:ComVisible(false)];
|
||||
|
||||
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
|
|
@ -1,40 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "DocumentEndEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
DocumentEndEvent::DocumentEndEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
}
|
||||
|
||||
DocumentEndEvent::DocumentEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
DocumentEndEvent::~DocumentEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
bool DocumentEndEvent::IsImplicit::get() {
|
||||
if(NativeEvent != NULL) {
|
||||
return NativeEvent->data.document_end.implicit != 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String^ DocumentEndEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0} {1}", GetType()->Name, IsImplicit ? "implicit" : "explicit");
|
||||
}
|
||||
|
||||
void DocumentEndEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
int result = yaml_document_end_event_initialize(nativeEvent, IsImplicit ? 1 : 0);
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class DocumentEndEvent : public YamlEvent
|
||||
{
|
||||
internal:
|
||||
DocumentEndEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
DocumentEndEvent();
|
||||
virtual ~DocumentEndEvent();
|
||||
|
||||
property bool IsImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "DocumentStartEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
DocumentStartEvent::DocumentStartEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
if(nativeEvent->data.document_start.version_directive != NULL) {
|
||||
version = YamlVersion(nativeEvent->data.document_start.version_directive);
|
||||
}
|
||||
isImplicit = nativeEvent->data.document_start.implicit != 0;
|
||||
}
|
||||
|
||||
DocumentStartEvent::DocumentStartEvent()
|
||||
: version(1, 1), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
DocumentStartEvent::DocumentStartEvent(YamlVersion _version)
|
||||
: version(_version), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
DocumentStartEvent::DocumentStartEvent(YamlVersion _version, bool _isImplicit)
|
||||
: version(_version), isImplicit(_isImplicit)
|
||||
{
|
||||
}
|
||||
|
||||
DocumentStartEvent::~DocumentStartEvent()
|
||||
{
|
||||
}
|
||||
|
||||
YamlVersion DocumentStartEvent::Version::get() {
|
||||
return version;
|
||||
}
|
||||
|
||||
bool DocumentStartEvent::IsImplicit::get() {
|
||||
return isImplicit;
|
||||
}
|
||||
|
||||
String^ DocumentStartEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture,
|
||||
"{0} {1} {2}.{3}",
|
||||
GetType()->Name,
|
||||
IsImplicit ? "implicit" : "explicit",
|
||||
Version.Major,
|
||||
Version.Minor
|
||||
);
|
||||
}
|
||||
|
||||
void DocumentStartEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
yaml_version_directive_t version;
|
||||
|
||||
bool hasVersion = Version.Major != 0 || Version.Minor != 0;
|
||||
if(hasVersion) {
|
||||
version.major = Version.Major;
|
||||
version.minor = Version.Minor;
|
||||
}
|
||||
|
||||
// TODO: Allow to specify directives
|
||||
int result = yaml_document_start_event_initialize(
|
||||
nativeEvent,
|
||||
hasVersion ? &version : NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
IsImplicit ? 1 : 0
|
||||
);
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
#include "YamlVersion.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class DocumentStartEvent : public YamlEvent
|
||||
{
|
||||
private:
|
||||
YamlVersion version;
|
||||
bool isImplicit;
|
||||
|
||||
internal:
|
||||
DocumentStartEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
DocumentStartEvent();
|
||||
DocumentStartEvent(YamlVersion version);
|
||||
DocumentStartEvent(YamlVersion version, bool isImplicit);
|
||||
virtual ~DocumentStartEvent();
|
||||
|
||||
property YamlVersion Version {
|
||||
YamlVersion get();
|
||||
}
|
||||
|
||||
property bool IsImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
// TODO: Tag directives
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "Emitter.h"
|
||||
#include "WriteHandlers.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
Emitter::Emitter(Stream^ output)
|
||||
{
|
||||
emitter = new yaml_emitter_t();
|
||||
yaml_emitter_initialize(emitter);
|
||||
|
||||
this->output = new gcroot<Stream^>(output);
|
||||
yaml_emitter_set_output(emitter, StreamWriteHandler, this->output);
|
||||
}
|
||||
|
||||
Emitter::~Emitter()
|
||||
{
|
||||
this->!Emitter();
|
||||
}
|
||||
|
||||
Emitter::!Emitter()
|
||||
{
|
||||
if(emitter != NULL) {
|
||||
delete emitter;
|
||||
emitter = NULL;
|
||||
}
|
||||
if(output != NULL) {
|
||||
delete output;
|
||||
output = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Emitter::Emit(YamlEvent^ yamlEvent) {
|
||||
yaml_event_t yamlEvt;
|
||||
yamlEvent->CreateEvent(&yamlEvt);
|
||||
int result = yaml_emitter_emit(emitter, &yamlEvt);
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException(emitter->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Collections::Generic;
|
||||
using namespace System::IO;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ref class Emitter
|
||||
{
|
||||
private:
|
||||
yaml_emitter_t* emitter;
|
||||
gcroot<Stream^>* output;
|
||||
|
||||
public:
|
||||
Emitter(Stream^ output);
|
||||
~Emitter();
|
||||
!Emitter();
|
||||
|
||||
void Emit(YamlEvent^ yamlEvent);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public interface class INodeEvent
|
||||
{
|
||||
property String^ Anchor {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
property String^ Tag {
|
||||
String^ get();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "MappingEndEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
MappingEndEvent::MappingEndEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
}
|
||||
|
||||
MappingEndEvent::MappingEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
MappingEndEvent::~MappingEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ MappingEndEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0}", GetType()->Name);
|
||||
}
|
||||
|
||||
void MappingEndEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
int result = yaml_mapping_end_event_initialize(nativeEvent);
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class MappingEndEvent : public YamlEvent
|
||||
{
|
||||
internal:
|
||||
MappingEndEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
MappingEndEvent();
|
||||
virtual ~MappingEndEvent();
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "MappingStartEvent.h"
|
||||
#include "StringConverter.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
MappingStartEvent::MappingStartEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
style = (ScalarStyle)nativeEvent->data.mapping_start.style;
|
||||
isImplicit = nativeEvent->data.mapping_start.implicit != 0;
|
||||
}
|
||||
|
||||
MappingStartEvent::MappingStartEvent()
|
||||
: tag(nullptr), anchor(nullptr), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
MappingStartEvent::MappingStartEvent(String^ _tag)
|
||||
: tag(_tag), anchor(nullptr), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
MappingStartEvent::MappingStartEvent(String^ _tag, String^ _anchor)
|
||||
: tag(_tag), anchor(_anchor), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
MappingStartEvent::MappingStartEvent(String^ _tag, String^ _anchor, ScalarStyle _style)
|
||||
: tag(_tag), anchor(_anchor), style(_style), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
MappingStartEvent::MappingStartEvent(String^ _tag, String^ _anchor, ScalarStyle _style, bool _isImplicit)
|
||||
: tag(_tag), anchor(_anchor), style(_style), isImplicit(_isImplicit)
|
||||
{
|
||||
}
|
||||
|
||||
MappingStartEvent::~MappingStartEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ MappingStartEvent::Anchor::get() {
|
||||
if(anchor == nullptr && NativeEvent != NULL) {
|
||||
anchor = StringConverter::Convert(NativeEvent->data.mapping_start.anchor);
|
||||
}
|
||||
return anchor;
|
||||
}
|
||||
|
||||
String^ MappingStartEvent::Tag::get() {
|
||||
if(tag == nullptr && NativeEvent != NULL) {
|
||||
tag = StringConverter::Convert(NativeEvent->data.mapping_start.tag);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
bool MappingStartEvent::IsImplicit::get() {
|
||||
return isImplicit;
|
||||
}
|
||||
|
||||
ScalarStyle MappingStartEvent::Style::get() {
|
||||
return style;
|
||||
}
|
||||
|
||||
String^ MappingStartEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture,
|
||||
"{0} {1} {2} {3} {4}",
|
||||
GetType()->Name,
|
||||
Anchor,
|
||||
Tag,
|
||||
IsImplicit ? "implicit" : "explicit",
|
||||
Style
|
||||
);
|
||||
}
|
||||
|
||||
void MappingStartEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
yaml_char_t* anchorBuffer = StringConverter::Convert(Anchor);
|
||||
yaml_char_t* tagBuffer = StringConverter::Convert(Tag);
|
||||
|
||||
// TODO: Allow to specify the style?
|
||||
int result = yaml_mapping_start_event_initialize(
|
||||
nativeEvent,
|
||||
anchorBuffer,
|
||||
tagBuffer,
|
||||
IsImplicit ? 1 : 0,
|
||||
YAML_ANY_MAPPING_STYLE
|
||||
);
|
||||
|
||||
if(tagBuffer != NULL) {
|
||||
delete[] tagBuffer;
|
||||
}
|
||||
if(anchorBuffer != NULL) {
|
||||
delete[] anchorBuffer;
|
||||
}
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
#include "ScalarStyle.h"
|
||||
#include "INodeEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class MappingStartEvent : public YamlEvent, public INodeEvent
|
||||
{
|
||||
private:
|
||||
String^ anchor;
|
||||
String^ tag;
|
||||
ScalarStyle style;
|
||||
bool isImplicit;
|
||||
|
||||
internal:
|
||||
MappingStartEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
MappingStartEvent();
|
||||
MappingStartEvent(String^ tag);
|
||||
MappingStartEvent(String^ tag, String^ anchor);
|
||||
MappingStartEvent(String^ tag, String^ anchor, ScalarStyle style);
|
||||
MappingStartEvent(String^ tag, String^ anchor, ScalarStyle style, bool isImplicit);
|
||||
virtual ~MappingStartEvent();
|
||||
|
||||
virtual property String^ Anchor {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
virtual property String^ Tag {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
property bool IsImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
property ScalarStyle Style {
|
||||
ScalarStyle get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "Mark.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
Mark::Mark(const yaml_mark_t* mark)
|
||||
: index(mark->index), line(mark->line), column(mark->column)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned Mark::Index::get() {
|
||||
return index;
|
||||
}
|
||||
|
||||
unsigned Mark::Line::get() {
|
||||
return line;
|
||||
}
|
||||
|
||||
unsigned Mark::Column::get() {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public value class Mark
|
||||
{
|
||||
private:
|
||||
const unsigned index;
|
||||
const unsigned line;
|
||||
const unsigned column;
|
||||
|
||||
internal:
|
||||
Mark(const yaml_mark_t* mark);
|
||||
|
||||
public:
|
||||
property unsigned Index {
|
||||
unsigned get();
|
||||
}
|
||||
|
||||
property unsigned Line {
|
||||
unsigned get();
|
||||
}
|
||||
|
||||
property unsigned Column {
|
||||
unsigned get();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "Parser.h"
|
||||
#include "ReadHandlers.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
Parser::Parser(Stream^ input)
|
||||
{
|
||||
parser = new yaml_parser_t();
|
||||
yaml_parser_initialize(parser);
|
||||
|
||||
this->input = new gcroot<Stream^>(input);
|
||||
yaml_parser_set_input(parser, StreamReadHandler, this->input);
|
||||
}
|
||||
|
||||
Parser::~Parser()
|
||||
{
|
||||
this->!Parser();
|
||||
}
|
||||
|
||||
Parser::!Parser()
|
||||
{
|
||||
if(parser != NULL) {
|
||||
delete parser;
|
||||
parser = NULL;
|
||||
}
|
||||
if(input != NULL) {
|
||||
delete input;
|
||||
input = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
YamlEvent^ Parser::Current::get() {
|
||||
return current;
|
||||
}
|
||||
|
||||
bool Parser::MoveNext() {
|
||||
if(endOfStream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
yaml_event_t* nativeEvent = new yaml_event_t();
|
||||
if(yaml_parser_parse(parser, nativeEvent) == 0) {
|
||||
delete nativeEvent;
|
||||
|
||||
// TODO: Throw a better exception
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
|
||||
endOfStream = nativeEvent->type == YAML_STREAM_END_EVENT;
|
||||
|
||||
current = YamlEvent::Create(nativeEvent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::IO;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class Parser
|
||||
{
|
||||
private:
|
||||
gcroot<Stream^>* input;
|
||||
|
||||
yaml_parser_t* parser;
|
||||
YamlEvent^ current;
|
||||
bool endOfStream;
|
||||
|
||||
public:
|
||||
Parser(Stream^ input);
|
||||
~Parser();
|
||||
!Parser();
|
||||
|
||||
property YamlEvent^ Current {
|
||||
YamlEvent^ get();
|
||||
}
|
||||
|
||||
bool MoveNext();
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "ReadHandlers.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::IO;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
int StreamReadHandler(void *data, unsigned char* buffer, size_t size, size_t *size_read) {
|
||||
gcroot<Stream^>* input = (gcroot<Stream^>*)data;
|
||||
|
||||
array<unsigned char>^ managedBuffer = gcnew array<unsigned char>(size);
|
||||
int count = (*input)->Read(managedBuffer, 0, size);
|
||||
Marshal::Copy(managedBuffer, 0, IntPtr(buffer), count);
|
||||
*size_read = count;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
int StreamReadHandler(void *data, unsigned char* buffer, size_t size, size_t *size_read);
|
||||
}
|
||||
}
|
|
@ -1,132 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "ScalarEvent.h"
|
||||
#include "StringConverter.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
ScalarEvent::ScalarEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
style = (ScalarStyle)nativeEvent->data.scalar.style;
|
||||
isPlainImplicit = nativeEvent->data.scalar.plain_implicit != 0;
|
||||
isQuotedImplicit = nativeEvent->data.scalar.quoted_implicit != 0;
|
||||
}
|
||||
|
||||
ScalarEvent::ScalarEvent(String^ _value)
|
||||
: value(_value), tag(nullptr), anchor(nullptr), style(ScalarStyle::Plain), isPlainImplicit(true), isQuotedImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
ScalarEvent::ScalarEvent(String^ _value, String^ _tag)
|
||||
: value(_value), tag(_tag), anchor(nullptr), style(ScalarStyle::Plain), isPlainImplicit(true), isQuotedImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
ScalarEvent::ScalarEvent(String^ _value, String^ _tag, String^ _anchor)
|
||||
: value(_value), tag(_tag), anchor(_anchor), style(ScalarStyle::Plain), isPlainImplicit(true), isQuotedImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
ScalarEvent::ScalarEvent(String^ _value, String^ _tag, String^ _anchor, ScalarStyle _style)
|
||||
: value(_value), tag(_tag), anchor(_anchor), style(_style), isPlainImplicit(true), isQuotedImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
ScalarEvent::ScalarEvent(String^ _value, String^ _tag, String^ _anchor, ScalarStyle _style, bool _isPlainImplicit, bool _isQuotedImplicit)
|
||||
: value(_value), tag(_tag), anchor(_anchor), style(_style), isPlainImplicit(_isPlainImplicit), isQuotedImplicit(_isQuotedImplicit)
|
||||
{
|
||||
}
|
||||
|
||||
ScalarEvent::~ScalarEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ ScalarEvent::Anchor::get() {
|
||||
if(anchor == nullptr && NativeEvent != NULL) {
|
||||
anchor = StringConverter::Convert(NativeEvent->data.scalar.anchor);
|
||||
}
|
||||
return anchor;
|
||||
}
|
||||
|
||||
String^ ScalarEvent::Tag::get() {
|
||||
if(tag == nullptr && NativeEvent != NULL) {
|
||||
tag = StringConverter::Convert(NativeEvent->data.scalar.tag);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
String^ ScalarEvent::Value::get() {
|
||||
if(value == nullptr && NativeEvent != NULL) {
|
||||
value = StringConverter::Convert(NativeEvent->data.scalar.value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int ScalarEvent::Length::get() {
|
||||
if(NativeEvent != NULL) {
|
||||
return NativeEvent->data.scalar.length;
|
||||
} else {
|
||||
return value->Length;
|
||||
}
|
||||
}
|
||||
|
||||
bool ScalarEvent::IsPlainImplicit::get() {
|
||||
return isPlainImplicit;
|
||||
}
|
||||
|
||||
bool ScalarEvent::IsQuotedImplicit::get() {
|
||||
return isQuotedImplicit;
|
||||
}
|
||||
|
||||
ScalarStyle ScalarEvent::Style::get() {
|
||||
return style;
|
||||
}
|
||||
|
||||
String^ ScalarEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture,
|
||||
"{0} {1} {2} {3} {4} {5} {6} {7}",
|
||||
GetType()->Name,
|
||||
Anchor,
|
||||
Tag,
|
||||
Value,
|
||||
Length,
|
||||
IsPlainImplicit ? "plain_implicit" : "plain_explicit",
|
||||
IsPlainImplicit ? "quoted_implicit" : "quoted_explicit",
|
||||
Style
|
||||
);
|
||||
}
|
||||
|
||||
void ScalarEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
yaml_char_t* anchorBuffer = StringConverter::Convert(Anchor);
|
||||
yaml_char_t* tagBuffer = StringConverter::Convert(Tag);
|
||||
yaml_char_t* valueBuffer = StringConverter::Convert(Value);
|
||||
|
||||
// TODO: Allow to specify the style?
|
||||
int result = yaml_scalar_event_initialize(
|
||||
nativeEvent,
|
||||
anchorBuffer,
|
||||
tagBuffer,
|
||||
valueBuffer,
|
||||
Value->Length,
|
||||
IsPlainImplicit ? 1 : 0,
|
||||
IsQuotedImplicit ? 1 : 0,
|
||||
YAML_ANY_SCALAR_STYLE
|
||||
);
|
||||
|
||||
if(valueBuffer != NULL) {
|
||||
delete[] valueBuffer;
|
||||
}
|
||||
if(tagBuffer != NULL) {
|
||||
delete[] tagBuffer;
|
||||
}
|
||||
if(anchorBuffer != NULL) {
|
||||
delete[] anchorBuffer;
|
||||
}
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
#include "ScalarStyle.h"
|
||||
#include "INodeEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class ScalarEvent : public YamlEvent, public INodeEvent
|
||||
{
|
||||
private:
|
||||
String^ anchor;
|
||||
String^ tag;
|
||||
String^ value;
|
||||
ScalarStyle style;
|
||||
bool isPlainImplicit;
|
||||
bool isQuotedImplicit;
|
||||
|
||||
internal:
|
||||
ScalarEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
ScalarEvent(String^ value);
|
||||
ScalarEvent(String^ value, String^ tag);
|
||||
ScalarEvent(String^ value, String^ tag, String^ anchor);
|
||||
ScalarEvent(String^ value, String^ tag, String^ anchor, ScalarStyle style);
|
||||
ScalarEvent(String^ value, String^ tag, String^ anchor, ScalarStyle style, bool isPlainImplicit, bool isQuotedImplicit);
|
||||
virtual ~ScalarEvent();
|
||||
|
||||
virtual property String^ Anchor {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
virtual property String^ Tag {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
property String^ Value {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
property int Length {
|
||||
int get();
|
||||
}
|
||||
|
||||
property bool IsPlainImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
property bool IsQuotedImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
property ScalarStyle Style {
|
||||
ScalarStyle get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public enum class ScalarStyle
|
||||
{
|
||||
Any = YAML_ANY_SCALAR_STYLE,
|
||||
Plain = YAML_PLAIN_SCALAR_STYLE,
|
||||
SingleQuoted = YAML_SINGLE_QUOTED_SCALAR_STYLE,
|
||||
DoubleQuoted = YAML_DOUBLE_QUOTED_SCALAR_STYLE,
|
||||
Literal = YAML_LITERAL_SCALAR_STYLE,
|
||||
Folded = YAML_FOLDED_SCALAR_STYLE,
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "SequenceEndEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
SequenceEndEvent::SequenceEndEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceEndEvent::SequenceEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
SequenceEndEvent::~SequenceEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ SequenceEndEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0}", GetType()->Name);
|
||||
}
|
||||
|
||||
void SequenceEndEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
int result = yaml_sequence_end_event_initialize(nativeEvent);
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class SequenceEndEvent : public YamlEvent
|
||||
{
|
||||
internal:
|
||||
SequenceEndEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
SequenceEndEvent();
|
||||
virtual ~SequenceEndEvent();
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "SequenceStartEvent.h"
|
||||
#include "StringConverter.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
SequenceStartEvent::SequenceStartEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
style = (ScalarStyle)nativeEvent->data.sequence_start.style;
|
||||
isImplicit = nativeEvent->data.sequence_start.implicit != 0;
|
||||
}
|
||||
|
||||
SequenceStartEvent::SequenceStartEvent()
|
||||
: tag(nullptr), anchor(nullptr), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceStartEvent::SequenceStartEvent(String^ _tag)
|
||||
: tag(_tag), anchor(nullptr), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceStartEvent::SequenceStartEvent(String^ _tag, String^ _anchor)
|
||||
: tag(_tag), anchor(_anchor), style(ScalarStyle::Plain), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceStartEvent::SequenceStartEvent(String^ _tag, String^ _anchor, ScalarStyle _style)
|
||||
: tag(_tag), anchor(_anchor), style(_style), isImplicit(true)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceStartEvent::SequenceStartEvent(String^ _tag, String^ _anchor, ScalarStyle _style, bool _isImplicit)
|
||||
: tag(_tag), anchor(_anchor), style(_style), isImplicit(_isImplicit)
|
||||
{
|
||||
}
|
||||
|
||||
SequenceStartEvent::~SequenceStartEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ SequenceStartEvent::Anchor::get() {
|
||||
if(anchor == nullptr && NativeEvent != NULL) {
|
||||
anchor = StringConverter::Convert(NativeEvent->data.sequence_start.anchor);
|
||||
}
|
||||
return anchor;
|
||||
}
|
||||
|
||||
String^ SequenceStartEvent::Tag::get() {
|
||||
if(tag == nullptr && NativeEvent != NULL) {
|
||||
tag = StringConverter::Convert(NativeEvent->data.sequence_start.tag);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
bool SequenceStartEvent::IsImplicit::get() {
|
||||
return isImplicit;
|
||||
}
|
||||
|
||||
ScalarStyle SequenceStartEvent::Style::get() {
|
||||
return style;
|
||||
}
|
||||
|
||||
String^ SequenceStartEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture,
|
||||
"{0} {1} {2} {3} {4}",
|
||||
GetType()->Name,
|
||||
Anchor,
|
||||
Tag,
|
||||
IsImplicit ? "implicit" : "explicit",
|
||||
Style
|
||||
);
|
||||
}
|
||||
|
||||
void SequenceStartEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
yaml_char_t* anchorBuffer = StringConverter::Convert(Anchor);
|
||||
yaml_char_t* tagBuffer = StringConverter::Convert(Tag);
|
||||
|
||||
// TODO: Allow to specify the style?
|
||||
int result = yaml_sequence_start_event_initialize(nativeEvent, anchorBuffer, tagBuffer, IsImplicit ? 1 : 0, YAML_ANY_SEQUENCE_STYLE);
|
||||
|
||||
if(tagBuffer != NULL) {
|
||||
delete[] tagBuffer;
|
||||
}
|
||||
if(anchorBuffer != NULL) {
|
||||
delete[] anchorBuffer;
|
||||
}
|
||||
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
#include "ScalarStyle.h"
|
||||
#include "INodeEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class SequenceStartEvent : public YamlEvent, public INodeEvent
|
||||
{
|
||||
private:
|
||||
String^ anchor;
|
||||
String^ tag;
|
||||
ScalarStyle style;
|
||||
bool isImplicit;
|
||||
|
||||
internal:
|
||||
SequenceStartEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
SequenceStartEvent();
|
||||
SequenceStartEvent(String^ tag);
|
||||
SequenceStartEvent(String^ tag, String^ anchor);
|
||||
SequenceStartEvent(String^ tag, String^ anchor, ScalarStyle style);
|
||||
SequenceStartEvent(String^ tag, String^ anchor, ScalarStyle style, bool isImplicit);
|
||||
virtual ~SequenceStartEvent();
|
||||
|
||||
virtual property String^ Anchor {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
virtual property String^ Tag {
|
||||
String^ get();
|
||||
}
|
||||
|
||||
property bool IsImplicit {
|
||||
bool get();
|
||||
}
|
||||
|
||||
property ScalarStyle Style {
|
||||
ScalarStyle get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// YamlDotNet.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
|
@ -1,9 +0,0 @@
|
|||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <yaml.h>
|
||||
#include <vcclr.h>
|
||||
#include <assert.h>
|
|
@ -1,31 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "StreamEndEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
StreamEndEvent::StreamEndEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
}
|
||||
|
||||
StreamEndEvent::StreamEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
StreamEndEvent::~StreamEndEvent()
|
||||
{
|
||||
}
|
||||
|
||||
String^ StreamEndEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0}", GetType()->Name);
|
||||
}
|
||||
|
||||
void StreamEndEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
int result = yaml_stream_end_event_initialize(nativeEvent);
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class StreamEndEvent : public YamlEvent
|
||||
{
|
||||
internal:
|
||||
StreamEndEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
StreamEndEvent();
|
||||
virtual ~StreamEndEvent();
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "StreamStartEvent.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
StreamStartEvent::StreamStartEvent(const yaml_event_t* nativeEvent)
|
||||
: YamlEvent(nativeEvent)
|
||||
{
|
||||
switch(nativeEvent->data.stream_start.encoding) {
|
||||
case YAML_ANY_ENCODING:
|
||||
encoding = nullptr;
|
||||
break;
|
||||
|
||||
case YAML_UTF8_ENCODING:
|
||||
encoding = System::Text::Encoding::UTF8;
|
||||
break;
|
||||
|
||||
case YAML_UTF16LE_ENCODING:
|
||||
encoding = System::Text::Encoding::Unicode;
|
||||
break;
|
||||
|
||||
case YAML_UTF16BE_ENCODING:
|
||||
encoding = System::Text::Encoding::BigEndianUnicode;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw gcnew InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
StreamStartEvent::StreamStartEvent(System::Text::Encoding^ _encoding)
|
||||
: encoding(_encoding)
|
||||
{
|
||||
}
|
||||
|
||||
StreamStartEvent::~StreamStartEvent()
|
||||
{
|
||||
}
|
||||
|
||||
System::Text::Encoding^ StreamStartEvent::Encoding::get() {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
String^ StreamStartEvent::ToString() {
|
||||
return String::Format(System::Globalization::CultureInfo::InvariantCulture, "{0} {1}", GetType()->Name, Encoding->WebName);
|
||||
}
|
||||
|
||||
void StreamStartEvent::CreateEvent(yaml_event_t* nativeEvent) {
|
||||
// TODO: Allow to specify the encoding
|
||||
int result = yaml_stream_start_event_initialize(nativeEvent, YAML_UTF8_ENCODING);
|
||||
if(result != 1) {
|
||||
throw gcnew YamlException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "YamlEvent.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public ref class StreamStartEvent : public YamlEvent
|
||||
{
|
||||
private:
|
||||
System::Text::Encoding^ encoding;
|
||||
|
||||
internal:
|
||||
StreamStartEvent(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) override;
|
||||
|
||||
public:
|
||||
StreamStartEvent(System::Text::Encoding^ encoding);
|
||||
virtual ~StreamStartEvent();
|
||||
|
||||
property System::Text::Encoding^ Encoding {
|
||||
System::Text::Encoding^ get();
|
||||
}
|
||||
|
||||
virtual String^ ToString() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace System::Text;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
class StringConverter
|
||||
{
|
||||
public:
|
||||
static String^ Convert(yaml_char_t* text) {
|
||||
if(text == NULL) {
|
||||
return nullptr;
|
||||
} else {
|
||||
return gcnew String((char*)text);
|
||||
}
|
||||
}
|
||||
|
||||
static yaml_char_t* Convert(String^ text) {
|
||||
if(text == nullptr) {
|
||||
return NULL;
|
||||
} else {
|
||||
int length = Encoding::UTF8->GetByteCount(text);
|
||||
array<unsigned char>^ bytes = gcnew array<unsigned char>(length);
|
||||
Encoding::UTF8->GetBytes(text, 0, text->Length, bytes, 0);
|
||||
yaml_char_t* buffer = new yaml_char_t[length + 1];
|
||||
Marshal::Copy(bytes, 0, IntPtr(buffer), length);
|
||||
buffer[length] = 0;
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "WriteHandlers.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace System::IO;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
int StreamWriteHandler(void *data, unsigned char* buffer, size_t size) {
|
||||
gcroot<Stream^>* output = (gcroot<Stream^>*)data;
|
||||
|
||||
array<unsigned char>^ managedBuffer = gcnew array<unsigned char>(size);
|
||||
Marshal::Copy(IntPtr(buffer), managedBuffer, 0, size);
|
||||
|
||||
(*output)->Write(managedBuffer, 0, size);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
int StreamWriteHandler(void *data, unsigned char* buffer, size_t size);
|
||||
}
|
||||
}
|
|
@ -1,437 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="YamlDotNet.Core"
|
||||
ProjectGUID="{78A464C6-0EA9-4ABB-8116-660C8208D32E}"
|
||||
RootNamespace="YamlDotNetCore"
|
||||
Keyword="ManagedCProj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(ProjectDir)Bin\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="libyaml\include;libyaml;."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;YAML_DECLARE_STATIC;HAVE_CONFIG_H"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
GenerateXMLDocumentationFiles="true"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(NoInherit)"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
AssemblyDebug="1"
|
||||
TargetMachine="1"
|
||||
KeyFile="..\YamlDotNet.snk"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="libyaml\include;libyaml;."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;YAML_DECLARE_STATIC;HAVE_CONFIG_H"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(NoInherit)"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
<AssemblyReference
|
||||
RelativePath="System.dll"
|
||||
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
|
||||
/>
|
||||
<AssemblyReference
|
||||
RelativePath="System.Data.dll"
|
||||
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
|
||||
/>
|
||||
<AssemblyReference
|
||||
RelativePath="System.XML.dll"
|
||||
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
|
||||
/>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_api.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_dumper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_emitter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_loader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_parser.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_reader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_scanner.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\_writer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\AliasEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\AssemblyInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocumentEndEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocumentStartEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Emitter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MappingEndEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MappingStartEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Mark.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Parser.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ReadHandlers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ScalarEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SequenceEndEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SequenceStartEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StreamEndEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StreamStartEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WriteHandlers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlException.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlVersion.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\AliasEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\config.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocumentEndEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocumentStartEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Emitter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\INodeEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MappingEndEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MappingStartEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Mark.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Parser.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ReadHandlers.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ScalarEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ScalarStyle.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SequenceEndEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SequenceStartEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StreamEndEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StreamStartEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StringConverter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WriteHandlers.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\include\yaml.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\libyaml\src\yaml_private.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlEvent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlException.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\YamlVersion.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,102 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "YamlEvent.h"
|
||||
#include "AliasEvent.h"
|
||||
#include "DocumentEndEvent.h"
|
||||
#include "DocumentStartEvent.h"
|
||||
#include "MappingEndEvent.h"
|
||||
#include "MappingStartEvent.h"
|
||||
#include "ScalarEvent.h"
|
||||
#include "SequenceEndEvent.h"
|
||||
#include "SequenceStartEvent.h"
|
||||
#include "StreamEndEvent.h"
|
||||
#include "StreamStartEvent.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
YamlEvent::YamlEvent(const yaml_event_t* nativeEvent)
|
||||
{
|
||||
assert(nativeEvent != NULL);
|
||||
this->nativeEvent = nativeEvent;
|
||||
}
|
||||
|
||||
YamlEvent::YamlEvent()
|
||||
{
|
||||
nativeEvent = NULL;
|
||||
}
|
||||
|
||||
YamlEvent::~YamlEvent()
|
||||
{
|
||||
this->!YamlEvent();
|
||||
}
|
||||
|
||||
YamlEvent::!YamlEvent()
|
||||
{
|
||||
if(nativeEvent != NULL) {
|
||||
delete nativeEvent;
|
||||
nativeEvent = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const yaml_event_t* YamlEvent::NativeEvent::get()
|
||||
{
|
||||
return nativeEvent;
|
||||
}
|
||||
|
||||
YamlEvent^ YamlEvent::Create(const yaml_event_t* nativeEvent)
|
||||
{
|
||||
switch(nativeEvent->type) {
|
||||
case YAML_NO_EVENT:
|
||||
throw gcnew ArgumentException("Invalid event");
|
||||
|
||||
case YAML_STREAM_START_EVENT:
|
||||
return gcnew StreamStartEvent(nativeEvent);
|
||||
|
||||
case YAML_STREAM_END_EVENT:
|
||||
return gcnew StreamEndEvent(nativeEvent);
|
||||
|
||||
case YAML_DOCUMENT_START_EVENT:
|
||||
return gcnew DocumentStartEvent(nativeEvent);
|
||||
|
||||
case YAML_DOCUMENT_END_EVENT:
|
||||
return gcnew DocumentEndEvent(nativeEvent);
|
||||
|
||||
case YAML_ALIAS_EVENT:
|
||||
return gcnew AliasEvent(nativeEvent);
|
||||
|
||||
case YAML_SCALAR_EVENT:
|
||||
return gcnew ScalarEvent(nativeEvent);
|
||||
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
return gcnew SequenceStartEvent(nativeEvent);
|
||||
|
||||
case YAML_SEQUENCE_END_EVENT:
|
||||
return gcnew SequenceEndEvent(nativeEvent);
|
||||
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
return gcnew MappingStartEvent(nativeEvent);
|
||||
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
return gcnew MappingEndEvent(nativeEvent);
|
||||
|
||||
default:
|
||||
throw gcnew NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
Mark YamlEvent::Start::get() {
|
||||
if(nativeEvent != NULL) {
|
||||
return Mark(&nativeEvent->start_mark);
|
||||
} else {
|
||||
return Mark();
|
||||
}
|
||||
}
|
||||
|
||||
Mark YamlEvent::End::get() {
|
||||
if(nativeEvent != NULL) {
|
||||
return Mark(&nativeEvent->end_mark);
|
||||
} else {
|
||||
return Mark();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "Mark.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
/// <summary>
|
||||
/// Contains informations about part of a YAML stream.
|
||||
/// </summary>
|
||||
public ref class YamlEvent abstract
|
||||
{
|
||||
private:
|
||||
const yaml_event_t* nativeEvent;
|
||||
|
||||
protected:
|
||||
property const yaml_event_t* NativeEvent {
|
||||
const yaml_event_t* get();
|
||||
}
|
||||
|
||||
YamlEvent(const yaml_event_t* nativeEvent);
|
||||
YamlEvent();
|
||||
|
||||
internal:
|
||||
static YamlEvent^ Create(const yaml_event_t* nativeEvent);
|
||||
virtual void CreateEvent(yaml_event_t* nativeEvent) abstract;
|
||||
|
||||
public:
|
||||
virtual ~YamlEvent();
|
||||
!YamlEvent();
|
||||
|
||||
property Mark Start {
|
||||
Mark get();
|
||||
}
|
||||
|
||||
property Mark End {
|
||||
Mark get();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "YamlException.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
YamlException::YamlException()
|
||||
{
|
||||
}
|
||||
|
||||
YamlException::YamlException(String^ message)
|
||||
: Exception(message)
|
||||
{
|
||||
}
|
||||
|
||||
YamlException::YamlException(String^ message, Exception^ inner)
|
||||
: Exception(message, inner)
|
||||
{
|
||||
}
|
||||
|
||||
YamlException::YamlException(SerializationInfo^ info, StreamingContext context)
|
||||
: Exception(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
YamlException::YamlException(yaml_error_type_t type)
|
||||
: Exception(MessageFromErrorType(type))
|
||||
{
|
||||
}
|
||||
|
||||
String^ YamlException::MessageFromErrorType(yaml_error_type_t type)
|
||||
{
|
||||
switch(type) {
|
||||
case YAML_NO_ERROR:
|
||||
return "No error is produced.";
|
||||
|
||||
case YAML_MEMORY_ERROR:
|
||||
return "Cannot allocate or reallocate a block of memory.";
|
||||
|
||||
case YAML_READER_ERROR:
|
||||
return "Cannot read or decode the input stream.";
|
||||
|
||||
case YAML_SCANNER_ERROR:
|
||||
return "Cannot scan the input stream.";
|
||||
|
||||
case YAML_PARSER_ERROR:
|
||||
return "Cannot parse the input stream.";
|
||||
|
||||
case YAML_COMPOSER_ERROR:
|
||||
return "Cannot compose a YAML document.";
|
||||
|
||||
case YAML_WRITER_ERROR:
|
||||
return "Cannot write to the output stream.";
|
||||
|
||||
case YAML_EMITTER_ERROR:
|
||||
return "Cannot emit a YAML stream.";
|
||||
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Runtime::Serialization;
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
[Serializable]
|
||||
public ref class YamlException : public Exception
|
||||
{
|
||||
private:
|
||||
static String^ MessageFromErrorType(yaml_error_type_t type);
|
||||
|
||||
internal:
|
||||
YamlException(yaml_error_type_t type);
|
||||
|
||||
public:
|
||||
YamlException();
|
||||
YamlException(String^ message);
|
||||
YamlException(String^ message, Exception^ inner);
|
||||
|
||||
protected:
|
||||
YamlException(SerializationInfo^ info, StreamingContext context);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
#include "YamlVersion.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
YamlVersion::YamlVersion(const yaml_version_directive_t* version)
|
||||
: major(version->major), minor(version->minor)
|
||||
{
|
||||
}
|
||||
|
||||
YamlVersion::YamlVersion(int _major, int _minor)
|
||||
: major(_major), minor(_minor)
|
||||
{
|
||||
}
|
||||
|
||||
int YamlVersion::Major::get() {
|
||||
return major;
|
||||
}
|
||||
|
||||
int YamlVersion::Minor::get() {
|
||||
return minor;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
using namespace YamlDotNet::Core::LibYaml;
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
public value class YamlVersion
|
||||
{
|
||||
private:
|
||||
int major;
|
||||
int minor;
|
||||
|
||||
internal:
|
||||
YamlVersion(const yaml_version_directive_t* version);
|
||||
|
||||
public:
|
||||
YamlVersion(int major, int minor);
|
||||
|
||||
property int Major {
|
||||
int get();
|
||||
}
|
||||
|
||||
property int Minor {
|
||||
int get();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Двоичные данные
YamlDotNet.Core.Old/app.aps
Двоичные данные
YamlDotNet.Core.Old/app.aps
Двоичный файл не отображается.
|
@ -1,19 +0,0 @@
|
|||
Copyright (c) 2006 Kirill Simonov
|
||||
|
||||
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 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.
|
|
@ -1,15 +0,0 @@
|
|||
## Run `./bootstrap` to generate the "Makefile.in" files in this directory and
|
||||
## the "$SUBDIR" subdirectories.
|
||||
|
||||
SUBDIRS = include src . tests
|
||||
|
||||
EXTRA_DIST = README LICENSE doc/doxygen.cfg
|
||||
|
||||
maintainer-clean-local:
|
||||
-rm -f aclocal.m4 config.h.in configure config/*
|
||||
-find ${builddir} -name Makefile.in -exec rm -f '{}' ';'
|
||||
|
||||
.PHONY: bootstrap
|
||||
bootstrap: maintainer-clean
|
||||
./bootstrap
|
||||
|
|
@ -1,632 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure config/config.guess config/config.sub \
|
||||
config/depcomp config/install-sh config/ltmain.sh \
|
||||
config/missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_FALSE = @DOXYGEN_FALSE@
|
||||
DOXYGEN_TRUE = @DOXYGEN_TRUE@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
YAML_LT_AGE = @YAML_LT_AGE@
|
||||
YAML_LT_CURRENT = @YAML_LT_CURRENT@
|
||||
YAML_LT_RELEASE = @YAML_LT_RELEASE@
|
||||
YAML_LT_REVISION = @YAML_LT_REVISION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = include src . tests
|
||||
EXTRA_DIST = README LICENSE doc/doxygen.cfg
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/config $(distdir)/doc
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic \
|
||||
maintainer-clean-local
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
|
||||
check-am clean clean-generic clean-libtool clean-recursive \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-local maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
|
||||
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-info-am
|
||||
|
||||
|
||||
maintainer-clean-local:
|
||||
-rm -f aclocal.m4 config.h.in configure config/*
|
||||
-find ${builddir} -name Makefile.in -exec rm -f '{}' ';'
|
||||
|
||||
.PHONY: bootstrap
|
||||
bootstrap: maintainer-clean
|
||||
./bootstrap
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,29 +0,0 @@
|
|||
LibYAML - A C library for parsing and emitting YAML.
|
||||
|
||||
The project is in an early stage of development.
|
||||
|
||||
To build and install the library, run:
|
||||
$ ./configure
|
||||
$ make
|
||||
# make install
|
||||
|
||||
If you checked the source code from the Subversion repository, run
|
||||
$ ./bootstrap
|
||||
$ ./configure
|
||||
$ make
|
||||
# make install
|
||||
|
||||
For more information, check the LibYAML homepage:
|
||||
'http://pyyaml.org/wiki/LibYAML'.
|
||||
|
||||
Post your questions and opinions to the YAML-Core mailing list:
|
||||
'http://lists.sourceforge.net/lists/listinfo/yaml-core'.
|
||||
|
||||
Submit bug reports and feature requests to the LibYAML bug tracker:
|
||||
'http://pyyaml.org/newticket?component=libyaml'.
|
||||
|
||||
LibYAML is written by Kirill Simonov <xi@resolvent.net>. It is released
|
||||
under the MIT license. See the file LICENSE for more details.
|
||||
|
||||
This project is developed for Python Software Foundation as a part of
|
||||
Google Summer of Code under the mentorship of Clark Evans.
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,74 +0,0 @@
|
|||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_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 <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 <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 <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_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 <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "yaml"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "yaml"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "yaml 0.1.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "yaml"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.1.1"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.1.1"
|
||||
|
||||
/* Define the major version number. */
|
||||
#define YAML_VERSION_MAJOR 0
|
||||
|
||||
/* Define the minor version number. */
|
||||
#define YAML_VERSION_MINOR 1
|
||||
|
||||
/* Define the patch version number. */
|
||||
#define YAML_VERSION_PATCH 1
|
||||
|
||||
/* Define the version string. */
|
||||
#define YAML_VERSION_STRING "0.1.1"
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
|
@ -1,73 +0,0 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define the major version number. */
|
||||
#undef YAML_VERSION_MAJOR
|
||||
|
||||
/* Define the minor version number. */
|
||||
#undef YAML_VERSION_MINOR
|
||||
|
||||
/* Define the patch version number. */
|
||||
#undef YAML_VERSION_PATCH
|
||||
|
||||
/* Define the version string. */
|
||||
#undef YAML_VERSION_STRING
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,530 +0,0 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2005-07-09.11
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mecanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -1,323 +0,0 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# 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 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
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
test -n "$dir_arg$dstarg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
mkdircmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
mkdircmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp"
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test -d "$pathcomp" || exit
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $mkdircmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
$doit $cpprog "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
}
|
||||
}
|
||||
fi || { (exit 1); exit 1; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
(exit 0); exit 0
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,360 +0,0 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2005-06-08.21
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case "$1" in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,73 +0,0 @@
|
|||
# Run `./bootstrap` to generate the "configure" script.
|
||||
|
||||
# Define the package version numbers and the bug reporting link.
|
||||
m4_define([YAML_MAJOR], 0)
|
||||
m4_define([YAML_MINOR], 1)
|
||||
m4_define([YAML_PATCH], 1)
|
||||
m4_define([YAML_BUGS], [http://pyyaml.org/newticket?component=libyaml])
|
||||
|
||||
# Define the libtool version numbers; check the Autobook, Section 11.4.
|
||||
# Bump the libtool version numbers using the following algorithm:
|
||||
# if (the current interface has not been changed):
|
||||
# YAML_REVISION += 1
|
||||
# else:
|
||||
# YAML_REVISION = 0
|
||||
# YAML_CURRENT += 1
|
||||
# if (this release is backward compatible with the previous release):
|
||||
# YAML_AGE += 1
|
||||
# else:
|
||||
# YAML_AGE = 0
|
||||
m4_define([YAML_RELEASE], 0)
|
||||
m4_define([YAML_CURRENT], 1)
|
||||
m4_define([YAML_REVISION], 0)
|
||||
m4_define([YAML_AGE], 0)
|
||||
|
||||
# Initialize autoconf & automake.
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([yaml], [YAML_MAJOR.YAML_MINOR.YAML_PATCH], [YAML_BUGS])
|
||||
AC_CONFIG_AUX_DIR([config])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_INIT_AUTOMAKE([1.9 foreign])
|
||||
|
||||
# Define macro variables for the package version numbers.
|
||||
AC_DEFINE(YAML_VERSION_MAJOR, YAML_MAJOR, [Define the major version number.])
|
||||
AC_DEFINE(YAML_VERSION_MINOR, YAML_MINOR, [Define the minor version number.])
|
||||
AC_DEFINE(YAML_VERSION_PATCH, YAML_PATCH, [Define the patch version number.])
|
||||
AC_DEFINE(YAML_VERSION_STRING, "YAML_MAJOR.YAML_MINOR.YAML_PATCH", [Define the version string.])
|
||||
|
||||
# Define substitutions for the libtool version numbers.
|
||||
YAML_LT_RELEASE=YAML_RELEASE
|
||||
YAML_LT_CURRENT=YAML_CURRENT
|
||||
YAML_LT_REVISION=YAML_REVISION
|
||||
YAML_LT_AGE=YAML_AGE
|
||||
AC_SUBST(YAML_LT_RELEASE)
|
||||
AC_SUBST(YAML_LT_CURRENT)
|
||||
AC_SUBST(YAML_LT_REVISION)
|
||||
AC_SUBST(YAML_LT_AGE)
|
||||
|
||||
# Note: in order to update checks, run `autoscan` and look through "configure.scan".
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_CHECK_PROG(DOXYGEN, [doxygen], [true], [false])
|
||||
AM_CONDITIONAL(DOXYGEN, [test "$DOXYGEN" = true])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
# Define Makefiles.
|
||||
AC_CONFIG_FILES([include/Makefile src/Makefile Makefile tests/Makefile])
|
||||
|
||||
# Generate the "configure" script.
|
||||
AC_OUTPUT
|
|
@ -1,17 +0,0 @@
|
|||
INCLUDES = yaml.h
|
||||
DOXYGEN_CFG = $(top_srcdir)/doc/doxygen.cfg
|
||||
|
||||
nobase_include_HEADERS = $(INCLUDES)
|
||||
|
||||
if DOXYGEN
|
||||
|
||||
html: $(INCLUDES) $(DOXYGEN_CFG)
|
||||
PACKAGE=$(PACKAGE) VERSION=$(VERSION) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) doxygen $(DOXYGEN_CFG)
|
||||
|
||||
endif
|
||||
|
||||
distclean-local:
|
||||
-rm -rf $(top_builddir)/doc/html
|
||||
|
||||
dist-hook: html
|
||||
cp -a $(top_builddir)/doc/html $(top_distdir)/doc
|
|
@ -1,415 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include
|
||||
DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(includedir)"
|
||||
nobase_includeHEADERS_INSTALL = $(install_sh_DATA)
|
||||
HEADERS = $(nobase_include_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_FALSE = @DOXYGEN_FALSE@
|
||||
DOXYGEN_TRUE = @DOXYGEN_TRUE@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
YAML_LT_AGE = @YAML_LT_AGE@
|
||||
YAML_LT_CURRENT = @YAML_LT_CURRENT@
|
||||
YAML_LT_RELEASE = @YAML_LT_RELEASE@
|
||||
YAML_LT_REVISION = @YAML_LT_REVISION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
INCLUDES = yaml.h
|
||||
DOXYGEN_CFG = $(top_srcdir)/doc/doxygen.cfg
|
||||
nobase_include_HEADERS = $(INCLUDES)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-nobase_includeHEADERS: $(nobase_include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
|
||||
@$(am__vpath_adj_setup) \
|
||||
list='$(nobase_include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
$(am__vpath_adj) \
|
||||
echo " $(nobase_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
|
||||
$(nobase_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-nobase_includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@$(am__vpath_adj_setup) \
|
||||
list='$(nobase_include_HEADERS)'; for p in $$list; do \
|
||||
$(am__vpath_adj) \
|
||||
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(includedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(includedir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool \
|
||||
distclean-local distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
@DOXYGEN_FALSE@html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-nobase_includeHEADERS
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-nobase_includeHEADERS
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags dist-hook distclean distclean-generic \
|
||||
distclean-libtool distclean-local distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man \
|
||||
install-nobase_includeHEADERS install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-nobase_includeHEADERS
|
||||
|
||||
|
||||
@DOXYGEN_TRUE@html: $(INCLUDES) $(DOXYGEN_CFG)
|
||||
@DOXYGEN_TRUE@ PACKAGE=$(PACKAGE) VERSION=$(VERSION) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) doxygen $(DOXYGEN_CFG)
|
||||
|
||||
distclean-local:
|
||||
-rm -rf $(top_builddir)/doc/html
|
||||
|
||||
dist-hook: html
|
||||
cp -a $(top_builddir)/doc/html $(top_distdir)/doc
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,4 +0,0 @@
|
|||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||
lib_LTLIBRARIES = libyaml.la
|
||||
libyaml_la_SOURCES = yaml_private.h api.c reader.c scanner.c parser.c loader.c writer.c emitter.c dumper.c
|
||||
libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE)
|
|
@ -1,470 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libyaml_la_LIBADD =
|
||||
am_libyaml_la_OBJECTS = api.lo reader.lo scanner.lo parser.lo \
|
||||
loader.lo writer.lo emitter.lo dumper.lo
|
||||
libyaml_la_OBJECTS = $(am_libyaml_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libyaml_la_SOURCES)
|
||||
DIST_SOURCES = $(libyaml_la_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_FALSE = @DOXYGEN_FALSE@
|
||||
DOXYGEN_TRUE = @DOXYGEN_TRUE@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
YAML_LT_AGE = @YAML_LT_AGE@
|
||||
YAML_LT_CURRENT = @YAML_LT_CURRENT@
|
||||
YAML_LT_RELEASE = @YAML_LT_RELEASE@
|
||||
YAML_LT_REVISION = @YAML_LT_REVISION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||
lib_LTLIBRARIES = libyaml.la
|
||||
libyaml_la_SOURCES = yaml_private.h api.c reader.c scanner.c parser.c loader.c writer.c emitter.c dumper.c
|
||||
libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libyaml.la: $(libyaml_la_OBJECTS) $(libyaml_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libyaml_la_LDFLAGS) $(libyaml_la_OBJECTS) $(libyaml_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/api.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumper.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emitter.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reader.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writer.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,400 +0,0 @@
|
|||
#include <stdafx.h>
|
||||
#include "yaml_private.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
namespace LibYaml {
|
||||
/*
|
||||
* API functions.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_open(yaml_emitter_t *emitter);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_close(yaml_emitter_t *emitter);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document);
|
||||
|
||||
/*
|
||||
* Clean up functions.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_emitter_delete_document_and_anchors(yaml_emitter_t *emitter);
|
||||
|
||||
/*
|
||||
* Anchor functions.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_emitter_anchor_node(yaml_emitter_t *emitter, int index);
|
||||
|
||||
static yaml_char_t *
|
||||
yaml_emitter_generate_anchor(yaml_emitter_t *emitter, int anchor_id);
|
||||
|
||||
|
||||
/*
|
||||
* Serialize functions.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_node(yaml_emitter_t *emitter, int index);
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_alias(yaml_emitter_t *emitter, yaml_char_t *anchor);
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_scalar(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor);
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_sequence(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor);
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_mapping(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor);
|
||||
|
||||
/*
|
||||
* Issue a STREAM-START event.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_open(yaml_emitter_t *emitter)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
assert(emitter); /* Non-NULL emitter object is required. */
|
||||
assert(!emitter->opened); /* Emitter should not be opened yet. */
|
||||
|
||||
STREAM_START_EVENT_INIT(event, YAML_ANY_ENCODING, mark, mark);
|
||||
|
||||
if (!yaml_emitter_emit(emitter, &event)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
emitter->opened = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue a STREAM-END event.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_close(yaml_emitter_t *emitter)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
assert(emitter); /* Non-NULL emitter object is required. */
|
||||
assert(emitter->opened); /* Emitter should be opened. */
|
||||
|
||||
if (emitter->closed) return 1;
|
||||
|
||||
STREAM_END_EVENT_INIT(event, mark, mark);
|
||||
|
||||
if (!yaml_emitter_emit(emitter, &event)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
emitter->closed = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump a YAML document.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
assert(emitter); /* Non-NULL emitter object is required. */
|
||||
assert(document); /* Non-NULL emitter object is expected. */
|
||||
|
||||
emitter->document = document;
|
||||
|
||||
if (!emitter->opened) {
|
||||
if (!yaml_emitter_open(emitter)) goto error;
|
||||
}
|
||||
|
||||
if (STACK_EMPTY(emitter, document->nodes)) {
|
||||
if (!yaml_emitter_close(emitter)) goto error;
|
||||
yaml_emitter_delete_document_and_anchors(emitter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
assert(emitter->opened); /* Emitter should be opened. */
|
||||
|
||||
void** anchors = (void**)&emitter->anchors;
|
||||
*anchors = yaml_malloc(sizeof(*(emitter->anchors))
|
||||
* (document->nodes.top - document->nodes.start));
|
||||
if (!emitter->anchors) goto error;
|
||||
memset(emitter->anchors, 0, sizeof(*(emitter->anchors))
|
||||
* (document->nodes.top - document->nodes.start));
|
||||
|
||||
DOCUMENT_START_EVENT_INIT(event, document->version_directive,
|
||||
document->tag_directives.start, document->tag_directives.end,
|
||||
document->start_implicit, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) goto error;
|
||||
|
||||
yaml_emitter_anchor_node(emitter, 1);
|
||||
if (!yaml_emitter_dump_node(emitter, 1)) goto error;
|
||||
|
||||
DOCUMENT_END_EVENT_INIT(event, document->end_implicit, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) goto error;
|
||||
|
||||
yaml_emitter_delete_document_and_anchors(emitter);
|
||||
|
||||
return 1;
|
||||
|
||||
error:
|
||||
|
||||
yaml_emitter_delete_document_and_anchors(emitter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up the emitter object after a document is dumped.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_emitter_delete_document_and_anchors(yaml_emitter_t *emitter)
|
||||
{
|
||||
int index;
|
||||
|
||||
if (!emitter->anchors) {
|
||||
yaml_document_delete(emitter->document);
|
||||
emitter->document = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
for (index = 0; emitter->document->nodes.start + index
|
||||
< emitter->document->nodes.top; index ++) {
|
||||
yaml_node_t node = emitter->document->nodes.start[index];
|
||||
if (!emitter->anchors[index].serialized) {
|
||||
yaml_free(node.tag);
|
||||
if (node.type == YAML_SCALAR_NODE) {
|
||||
yaml_free(node.data.scalar.value);
|
||||
}
|
||||
}
|
||||
if (node.type == YAML_SEQUENCE_NODE) {
|
||||
STACK_DEL(emitter, node.data.sequence.items);
|
||||
}
|
||||
if (node.type == YAML_MAPPING_NODE) {
|
||||
STACK_DEL(emitter, node.data.mapping.pairs);
|
||||
}
|
||||
}
|
||||
|
||||
STACK_DEL(emitter, emitter->document->nodes);
|
||||
yaml_free(emitter->anchors);
|
||||
|
||||
emitter->anchors = NULL;
|
||||
emitter->last_anchor_id = 0;
|
||||
emitter->document = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the references of a node and assign the anchor id if needed.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_emitter_anchor_node(yaml_emitter_t *emitter, int index)
|
||||
{
|
||||
yaml_node_t *node = emitter->document->nodes.start + index - 1;
|
||||
yaml_node_item_t *item;
|
||||
yaml_node_pair_t *pair;
|
||||
|
||||
emitter->anchors[index-1].references ++;
|
||||
|
||||
if (emitter->anchors[index-1].references == 1) {
|
||||
switch (node->type) {
|
||||
case YAML_SEQUENCE_NODE:
|
||||
for (item = node->data.sequence.items.start;
|
||||
item < node->data.sequence.items.top; item ++) {
|
||||
yaml_emitter_anchor_node(emitter, *item);
|
||||
}
|
||||
break;
|
||||
case YAML_MAPPING_NODE:
|
||||
for (pair = node->data.mapping.pairs.start;
|
||||
pair < node->data.mapping.pairs.top; pair ++) {
|
||||
yaml_emitter_anchor_node(emitter, pair->key);
|
||||
yaml_emitter_anchor_node(emitter, pair->value);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (emitter->anchors[index-1].references == 2) {
|
||||
emitter->anchors[index-1].anchor = (++ emitter->last_anchor_id);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate a textual representation for an anchor.
|
||||
*/
|
||||
|
||||
#define ANCHOR_TEMPLATE "id%03d"
|
||||
#define ANCHOR_TEMPLATE_LENGTH 16
|
||||
|
||||
static yaml_char_t *
|
||||
yaml_emitter_generate_anchor(yaml_emitter_t * /*emitter*/, int anchor_id)
|
||||
{
|
||||
yaml_char_t *anchor = (yaml_char_t*)yaml_malloc(ANCHOR_TEMPLATE_LENGTH);
|
||||
|
||||
if (!anchor) return NULL;
|
||||
|
||||
sprintf((char *)anchor, ANCHOR_TEMPLATE, anchor_id);
|
||||
|
||||
return anchor;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialize a node.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_node(yaml_emitter_t *emitter, int index)
|
||||
{
|
||||
yaml_node_t *node = emitter->document->nodes.start + index - 1;
|
||||
int anchor_id = emitter->anchors[index-1].anchor;
|
||||
yaml_char_t *anchor = NULL;
|
||||
|
||||
if (anchor_id) {
|
||||
anchor = yaml_emitter_generate_anchor(emitter, anchor_id);
|
||||
if (!anchor) return 0;
|
||||
}
|
||||
|
||||
if (emitter->anchors[index-1].serialized) {
|
||||
return yaml_emitter_dump_alias(emitter, anchor);
|
||||
}
|
||||
|
||||
emitter->anchors[index-1].serialized = 1;
|
||||
|
||||
switch (node->type) {
|
||||
case YAML_SCALAR_NODE:
|
||||
return yaml_emitter_dump_scalar(emitter, node, anchor);
|
||||
case YAML_SEQUENCE_NODE:
|
||||
return yaml_emitter_dump_sequence(emitter, node, anchor);
|
||||
case YAML_MAPPING_NODE:
|
||||
return yaml_emitter_dump_mapping(emitter, node, anchor);
|
||||
default:
|
||||
assert(0); /* Could not happen. */
|
||||
break;
|
||||
}
|
||||
|
||||
return 0; /* Could not happen. */
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialize an alias.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_alias(yaml_emitter_t *emitter, yaml_char_t *anchor)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
ALIAS_EVENT_INIT(event, anchor, mark, mark);
|
||||
|
||||
return yaml_emitter_emit(emitter, &event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialize a scalar.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_scalar(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
int plain_implicit = (strcmp((char *)node->tag,
|
||||
YAML_DEFAULT_SCALAR_TAG) == 0);
|
||||
int quoted_implicit = (strcmp((char *)node->tag,
|
||||
YAML_DEFAULT_SCALAR_TAG) == 0);
|
||||
|
||||
SCALAR_EVENT_INIT(event, anchor, node->tag, node->data.scalar.value,
|
||||
node->data.scalar.length, plain_implicit, quoted_implicit,
|
||||
node->data.scalar.style, mark, mark);
|
||||
|
||||
return yaml_emitter_emit(emitter, &event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialize a sequence.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_sequence(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
int implicit = (strcmp((char *)node->tag, YAML_DEFAULT_SEQUENCE_TAG) == 0);
|
||||
|
||||
yaml_node_item_t *item;
|
||||
|
||||
SEQUENCE_START_EVENT_INIT(event, anchor, node->tag, implicit,
|
||||
node->data.sequence.style, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) return 0;
|
||||
|
||||
for (item = node->data.sequence.items.start;
|
||||
item < node->data.sequence.items.top; item ++) {
|
||||
if (!yaml_emitter_dump_node(emitter, *item)) return 0;
|
||||
}
|
||||
|
||||
SEQUENCE_END_EVENT_INIT(event, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialize a mapping.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_dump_mapping(yaml_emitter_t *emitter, yaml_node_t *node,
|
||||
yaml_char_t *anchor)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_mark_t mark = { 0, 0, 0 };
|
||||
|
||||
int implicit = (strcmp((char *)node->tag, YAML_DEFAULT_MAPPING_TAG) == 0);
|
||||
|
||||
yaml_node_pair_t *pair;
|
||||
|
||||
MAPPING_START_EVENT_INIT(event, anchor, node->tag, implicit,
|
||||
node->data.mapping.style, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) return 0;
|
||||
|
||||
for (pair = node->data.mapping.pairs.start;
|
||||
pair < node->data.mapping.pairs.top; pair ++) {
|
||||
if (!yaml_emitter_dump_node(emitter, pair->key)) return 0;
|
||||
if (!yaml_emitter_dump_node(emitter, pair->value)) return 0;
|
||||
}
|
||||
|
||||
MAPPING_END_EVENT_INIT(event, mark, mark);
|
||||
if (!yaml_emitter_emit(emitter, &event)) return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,436 +0,0 @@
|
|||
#include <stdafx.h>
|
||||
#include "yaml_private.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
namespace LibYaml {
|
||||
|
||||
/*
|
||||
* API functions.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document);
|
||||
|
||||
/*
|
||||
* Error handling.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_set_composer_error(yaml_parser_t *parser,
|
||||
const char *problem, yaml_mark_t problem_mark);
|
||||
|
||||
static int
|
||||
yaml_parser_set_composer_error_context(yaml_parser_t *parser,
|
||||
const char *context, yaml_mark_t context_mark,
|
||||
const char *problem, yaml_mark_t problem_mark);
|
||||
|
||||
|
||||
/*
|
||||
* Alias handling.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_register_anchor(yaml_parser_t *parser,
|
||||
int index, yaml_char_t *anchor);
|
||||
|
||||
/*
|
||||
* Clean up functions.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_parser_delete_aliases(yaml_parser_t *parser);
|
||||
|
||||
/*
|
||||
* Composer functions.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
static int
|
||||
yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
static int
|
||||
yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
static int
|
||||
yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
static int
|
||||
yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
static int
|
||||
yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event);
|
||||
|
||||
/*
|
||||
* Load the next document of the stream.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
|
||||
{
|
||||
yaml_event_t event;
|
||||
|
||||
assert(parser); /* Non-NULL parser object is expected. */
|
||||
assert(document); /* Non-NULL document object is expected. */
|
||||
|
||||
memset(document, 0, sizeof(yaml_document_t));
|
||||
if (!STACK_INIT(parser, document->nodes, INITIAL_STACK_SIZE, yaml_node_t))
|
||||
goto error;
|
||||
|
||||
if (!parser->stream_start_produced) {
|
||||
if (!yaml_parser_parse(parser, &event)) goto error;
|
||||
assert(event.type == YAML_STREAM_START_EVENT);
|
||||
/* STREAM-START is expected. */
|
||||
}
|
||||
|
||||
if (parser->stream_end_produced) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!yaml_parser_parse(parser, &event)) goto error;
|
||||
if (event.type == YAML_STREAM_END_EVENT) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!STACK_INIT(parser, parser->aliases, INITIAL_STACK_SIZE, yaml_alias_data_t))
|
||||
goto error;
|
||||
|
||||
parser->document = document;
|
||||
|
||||
if (!yaml_parser_load_document(parser, &event)) goto error;
|
||||
|
||||
yaml_parser_delete_aliases(parser);
|
||||
parser->document = NULL;
|
||||
|
||||
return 1;
|
||||
|
||||
error:
|
||||
|
||||
yaml_parser_delete_aliases(parser);
|
||||
yaml_document_delete(document);
|
||||
parser->document = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set composer error.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_set_composer_error(yaml_parser_t *parser,
|
||||
const char *problem, yaml_mark_t problem_mark)
|
||||
{
|
||||
parser->error = YAML_COMPOSER_ERROR;
|
||||
parser->problem = problem;
|
||||
parser->problem_mark = problem_mark;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set composer error with context.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_set_composer_error_context(yaml_parser_t *parser,
|
||||
const char *context, yaml_mark_t context_mark,
|
||||
const char *problem, yaml_mark_t problem_mark)
|
||||
{
|
||||
parser->error = YAML_COMPOSER_ERROR;
|
||||
parser->context = context;
|
||||
parser->context_mark = context_mark;
|
||||
parser->problem = problem;
|
||||
parser->problem_mark = problem_mark;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete the stack of aliases.
|
||||
*/
|
||||
|
||||
static void
|
||||
yaml_parser_delete_aliases(yaml_parser_t *parser)
|
||||
{
|
||||
while (!STACK_EMPTY(parser, parser->aliases)) {
|
||||
yaml_free(POP(parser, parser->aliases).anchor);
|
||||
}
|
||||
STACK_DEL(parser, parser->aliases);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a document object.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
yaml_event_t event;
|
||||
|
||||
assert(first_event->type == YAML_DOCUMENT_START_EVENT);
|
||||
/* DOCUMENT-START is expected. */
|
||||
|
||||
parser->document->version_directive
|
||||
= first_event->data.document_start.version_directive;
|
||||
parser->document->tag_directives.start
|
||||
= first_event->data.document_start.tag_directives.start;
|
||||
parser->document->tag_directives.end
|
||||
= first_event->data.document_start.tag_directives.end;
|
||||
parser->document->start_implicit
|
||||
= first_event->data.document_start.implicit;
|
||||
parser->document->start_mark = first_event->start_mark;
|
||||
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
|
||||
if (!yaml_parser_load_node(parser, &event)) return 0;
|
||||
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
assert(event.type == YAML_DOCUMENT_END_EVENT);
|
||||
/* DOCUMENT-END is expected. */
|
||||
|
||||
parser->document->end_implicit = event.data.document_end.implicit;
|
||||
parser->document->end_mark = event.end_mark;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a node.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
switch (first_event->type) {
|
||||
case YAML_ALIAS_EVENT:
|
||||
return yaml_parser_load_alias(parser, first_event);
|
||||
case YAML_SCALAR_EVENT:
|
||||
return yaml_parser_load_scalar(parser, first_event);
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
return yaml_parser_load_sequence(parser, first_event);
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
return yaml_parser_load_mapping(parser, first_event);
|
||||
default:
|
||||
assert(0); /* Could not happen. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
//return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add an anchor.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_register_anchor(yaml_parser_t *parser,
|
||||
int index, yaml_char_t *anchor)
|
||||
{
|
||||
yaml_alias_data_t data = { anchor, index, { 0, 0, 0 } };
|
||||
yaml_alias_data_t *alias_data;
|
||||
|
||||
if (!anchor) return 1;
|
||||
|
||||
data.mark = parser->document->nodes.start[index-1].start_mark;
|
||||
|
||||
for (alias_data = parser->aliases.start;
|
||||
alias_data != parser->aliases.top; alias_data ++) {
|
||||
if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
|
||||
yaml_free(anchor);
|
||||
return yaml_parser_set_composer_error_context(parser,
|
||||
"found duplicate anchor; first occurence",
|
||||
alias_data->mark, "second occurence", data.mark);
|
||||
}
|
||||
}
|
||||
|
||||
if (!PUSH(parser, parser->aliases, data)) {
|
||||
yaml_free(anchor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a node corresponding to an alias.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
yaml_char_t *anchor = first_event->data.alias.anchor;
|
||||
yaml_alias_data_t *alias_data;
|
||||
|
||||
for (alias_data = parser->aliases.start;
|
||||
alias_data != parser->aliases.top; alias_data ++) {
|
||||
if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
|
||||
yaml_free(anchor);
|
||||
return alias_data->index;
|
||||
}
|
||||
}
|
||||
|
||||
yaml_free(anchor);
|
||||
return yaml_parser_set_composer_error(parser, "found undefined alias",
|
||||
first_event->start_mark);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a scalar node.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
yaml_node_t node;
|
||||
int index;
|
||||
yaml_char_t *tag = first_event->data.scalar.tag;
|
||||
|
||||
if (!tag || strcmp((char *)tag, "!") == 0) {
|
||||
yaml_free(tag);
|
||||
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SCALAR_TAG);
|
||||
if (!tag) goto error;
|
||||
}
|
||||
|
||||
SCALAR_NODE_INIT(node, tag, first_event->data.scalar.value,
|
||||
first_event->data.scalar.length, first_event->data.scalar.style,
|
||||
first_event->start_mark, first_event->end_mark);
|
||||
|
||||
if (!PUSH(parser, parser->document->nodes, node)) goto error;
|
||||
|
||||
index = parser->document->nodes.top - parser->document->nodes.start;
|
||||
|
||||
if (!yaml_parser_register_anchor(parser, index,
|
||||
first_event->data.scalar.anchor)) return 0;
|
||||
|
||||
return index;
|
||||
|
||||
error:
|
||||
yaml_free(tag);
|
||||
yaml_free(first_event->data.scalar.anchor);
|
||||
yaml_free(first_event->data.scalar.value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a sequence node.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_node_t node;
|
||||
struct {
|
||||
yaml_node_item_t *start;
|
||||
yaml_node_item_t *end;
|
||||
yaml_node_item_t *top;
|
||||
} items = { NULL, NULL, NULL };
|
||||
int index, item_index;
|
||||
yaml_char_t *tag = first_event->data.sequence_start.tag;
|
||||
|
||||
if (!tag || strcmp((char *)tag, "!") == 0) {
|
||||
yaml_free(tag);
|
||||
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG);
|
||||
if (!tag) goto error;
|
||||
}
|
||||
|
||||
if (!STACK_INIT(parser, items, INITIAL_STACK_SIZE, yaml_node_item_t)) goto error;
|
||||
|
||||
SEQUENCE_NODE_INIT(node, tag, items.start, items.end,
|
||||
first_event->data.sequence_start.style,
|
||||
first_event->start_mark, first_event->end_mark);
|
||||
|
||||
if (!PUSH(parser, parser->document->nodes, node)) goto error;
|
||||
|
||||
index = parser->document->nodes.top - parser->document->nodes.start;
|
||||
|
||||
if (!yaml_parser_register_anchor(parser, index,
|
||||
first_event->data.sequence_start.anchor)) return 0;
|
||||
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
|
||||
while (event.type != YAML_SEQUENCE_END_EVENT) {
|
||||
item_index = yaml_parser_load_node(parser, &event);
|
||||
if (!item_index) return 0;
|
||||
if (!PUSH(parser,
|
||||
parser->document->nodes.start[index-1].data.sequence.items,
|
||||
item_index)) return 0;
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
}
|
||||
|
||||
parser->document->nodes.start[index-1].end_mark = event.end_mark;
|
||||
|
||||
return index;
|
||||
|
||||
error:
|
||||
yaml_free(tag);
|
||||
yaml_free(first_event->data.sequence_start.anchor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compose a mapping node.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
|
||||
{
|
||||
yaml_event_t event;
|
||||
yaml_node_t node;
|
||||
struct {
|
||||
yaml_node_pair_t *start;
|
||||
yaml_node_pair_t *end;
|
||||
yaml_node_pair_t *top;
|
||||
} pairs = { NULL, NULL, NULL };
|
||||
int index;
|
||||
yaml_node_pair_t pair;
|
||||
yaml_char_t *tag = first_event->data.mapping_start.tag;
|
||||
|
||||
if (!tag || strcmp((char *)tag, "!") == 0) {
|
||||
yaml_free(tag);
|
||||
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_MAPPING_TAG);
|
||||
if (!tag) goto error;
|
||||
}
|
||||
|
||||
if (!STACK_INIT(parser, pairs, INITIAL_STACK_SIZE, yaml_node_pair_t)) goto error;
|
||||
|
||||
MAPPING_NODE_INIT(node, tag, pairs.start, pairs.end,
|
||||
first_event->data.mapping_start.style,
|
||||
first_event->start_mark, first_event->end_mark);
|
||||
|
||||
if (!PUSH(parser, parser->document->nodes, node)) goto error;
|
||||
|
||||
index = parser->document->nodes.top - parser->document->nodes.start;
|
||||
|
||||
if (!yaml_parser_register_anchor(parser, index,
|
||||
first_event->data.mapping_start.anchor)) return 0;
|
||||
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
|
||||
while (event.type != YAML_MAPPING_END_EVENT) {
|
||||
pair.key = yaml_parser_load_node(parser, &event);
|
||||
if (!pair.key) return 0;
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
pair.value = yaml_parser_load_node(parser, &event);
|
||||
if (!pair.value) return 0;
|
||||
if (!PUSH(parser,
|
||||
parser->document->nodes.start[index-1].data.mapping.pairs,
|
||||
pair)) return 0;
|
||||
if (!yaml_parser_parse(parser, &event)) return 0;
|
||||
}
|
||||
|
||||
parser->document->nodes.start[index-1].end_mark = event.end_mark;
|
||||
|
||||
return index;
|
||||
|
||||
error:
|
||||
yaml_free(tag);
|
||||
yaml_free(first_event->data.mapping_start.anchor);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,466 +0,0 @@
|
|||
#include <stdafx.h>
|
||||
#include "yaml_private.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
namespace LibYaml {
|
||||
|
||||
/*
|
||||
* Declarations.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_set_reader_error(yaml_parser_t *parser, const char *problem,
|
||||
size_t offset, int value);
|
||||
|
||||
static int
|
||||
yaml_parser_update_raw_buffer(yaml_parser_t *parser);
|
||||
|
||||
static int
|
||||
yaml_parser_determine_encoding(yaml_parser_t *parser);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
|
||||
|
||||
/*
|
||||
* Set the reader error and return 0.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_set_reader_error(yaml_parser_t *parser, const char *problem,
|
||||
size_t offset, int value)
|
||||
{
|
||||
parser->error = YAML_READER_ERROR;
|
||||
parser->problem = problem;
|
||||
parser->problem_offset = offset;
|
||||
parser->problem_value = value;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Byte order marks.
|
||||
*/
|
||||
|
||||
#define BOM_UTF8 "\xef\xbb\xbf"
|
||||
#define BOM_UTF16LE "\xff\xfe"
|
||||
#define BOM_UTF16BE "\xfe\xff"
|
||||
|
||||
/*
|
||||
* Determine the input stream encoding by checking the BOM symbol. If no BOM is
|
||||
* found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_determine_encoding(yaml_parser_t *parser)
|
||||
{
|
||||
/* Ensure that we had enough bytes in the raw buffer. */
|
||||
|
||||
while (!parser->eof
|
||||
&& parser->raw_buffer.last - parser->raw_buffer.pointer < 3) {
|
||||
if (!yaml_parser_update_raw_buffer(parser)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine the encoding. */
|
||||
|
||||
if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
|
||||
&& !memcmp(parser->raw_buffer.pointer, BOM_UTF16LE, 2)) {
|
||||
parser->encoding = YAML_UTF16LE_ENCODING;
|
||||
parser->raw_buffer.pointer += 2;
|
||||
parser->offset += 2;
|
||||
}
|
||||
else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
|
||||
&& !memcmp(parser->raw_buffer.pointer, BOM_UTF16BE, 2)) {
|
||||
parser->encoding = YAML_UTF16BE_ENCODING;
|
||||
parser->raw_buffer.pointer += 2;
|
||||
parser->offset += 2;
|
||||
}
|
||||
else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 3
|
||||
&& !memcmp(parser->raw_buffer.pointer, BOM_UTF8, 3)) {
|
||||
parser->encoding = YAML_UTF8_ENCODING;
|
||||
parser->raw_buffer.pointer += 3;
|
||||
parser->offset += 3;
|
||||
}
|
||||
else {
|
||||
parser->encoding = YAML_UTF8_ENCODING;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the raw buffer.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_parser_update_raw_buffer(yaml_parser_t *parser)
|
||||
{
|
||||
size_t size_read = 0;
|
||||
|
||||
/* Return if the raw buffer is full. */
|
||||
|
||||
if (parser->raw_buffer.start == parser->raw_buffer.pointer
|
||||
&& parser->raw_buffer.last == parser->raw_buffer.end)
|
||||
return 1;
|
||||
|
||||
/* Return on EOF. */
|
||||
|
||||
if (parser->eof) return 1;
|
||||
|
||||
/* Move the remaining bytes in the raw buffer to the beginning. */
|
||||
|
||||
if (parser->raw_buffer.start < parser->raw_buffer.pointer
|
||||
&& parser->raw_buffer.pointer < parser->raw_buffer.last) {
|
||||
memmove(parser->raw_buffer.start, parser->raw_buffer.pointer,
|
||||
parser->raw_buffer.last - parser->raw_buffer.pointer);
|
||||
}
|
||||
parser->raw_buffer.last -=
|
||||
parser->raw_buffer.pointer - parser->raw_buffer.start;
|
||||
parser->raw_buffer.pointer = parser->raw_buffer.start;
|
||||
|
||||
/* Call the read handler to fill the buffer. */
|
||||
|
||||
if (!parser->read_handler(parser->read_handler_data, parser->raw_buffer.last,
|
||||
parser->raw_buffer.end - parser->raw_buffer.last, &size_read)) {
|
||||
return yaml_parser_set_reader_error(parser, "Input error",
|
||||
parser->offset, -1);
|
||||
}
|
||||
parser->raw_buffer.last += size_read;
|
||||
if (!size_read) {
|
||||
parser->eof = 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure that the buffer contains at least `length` characters.
|
||||
* Return 1 on success, 0 on failure.
|
||||
*
|
||||
* The length is supposed to be significantly less that the buffer size.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
|
||||
{
|
||||
assert(parser->read_handler); /* Read handler must be set. */
|
||||
|
||||
/* If the EOF flag is set and the raw buffer is empty, do nothing. */
|
||||
|
||||
if (parser->eof && parser->raw_buffer.pointer == parser->raw_buffer.last)
|
||||
return 1;
|
||||
|
||||
/* Return if the buffer contains enough characters. */
|
||||
|
||||
if (parser->unread >= length)
|
||||
return 1;
|
||||
|
||||
/* Determine the input encoding if it is not known yet. */
|
||||
|
||||
if (!parser->encoding) {
|
||||
if (!yaml_parser_determine_encoding(parser))
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Move the unread characters to the beginning of the buffer. */
|
||||
|
||||
if (parser->buffer.start < parser->buffer.pointer
|
||||
&& parser->buffer.pointer < parser->buffer.last) {
|
||||
size_t size = parser->buffer.last - parser->buffer.pointer;
|
||||
memmove(parser->buffer.start, parser->buffer.pointer, size);
|
||||
parser->buffer.pointer = parser->buffer.start;
|
||||
parser->buffer.last = parser->buffer.start + size;
|
||||
}
|
||||
else if (parser->buffer.pointer == parser->buffer.last) {
|
||||
parser->buffer.pointer = parser->buffer.start;
|
||||
parser->buffer.last = parser->buffer.start;
|
||||
}
|
||||
|
||||
/* Fill the buffer until it has enough characters. */
|
||||
|
||||
while (parser->unread < length)
|
||||
{
|
||||
/* Fill the raw buffer. */
|
||||
|
||||
if (!yaml_parser_update_raw_buffer(parser)) return 0;
|
||||
|
||||
/* Decode the raw buffer. */
|
||||
|
||||
while (parser->raw_buffer.pointer != parser->raw_buffer.last)
|
||||
{
|
||||
unsigned int value = 0, value2 = 0;
|
||||
int incomplete = 0;
|
||||
unsigned char octet;
|
||||
unsigned int width = 0;
|
||||
int low, high;
|
||||
size_t k;
|
||||
size_t raw_unread = parser->raw_buffer.last - parser->raw_buffer.pointer;
|
||||
|
||||
/* Decode the next character. */
|
||||
|
||||
switch (parser->encoding)
|
||||
{
|
||||
case YAML_UTF8_ENCODING:
|
||||
|
||||
/*
|
||||
* Decode a UTF-8 character. Check RFC 3629
|
||||
* (http://www.ietf.org/rfc/rfc3629.txt) for more details.
|
||||
*
|
||||
* The following table (taken from the RFC) is used for
|
||||
* decoding.
|
||||
*
|
||||
* Char. number range | UTF-8 octet sequence
|
||||
* (hexadecimal) | (binary)
|
||||
* --------------------+------------------------------------
|
||||
* 0000 0000-0000 007F | 0xxxxxxx
|
||||
* 0000 0080-0000 07FF | 110xxxxx 10xxxxxx
|
||||
* 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
|
||||
* 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
|
||||
*
|
||||
* Additionally, the characters in the range 0xD800-0xDFFF
|
||||
* are prohibited as they are reserved for use with UTF-16
|
||||
* surrogate pairs.
|
||||
*/
|
||||
|
||||
/* Determine the length of the UTF-8 sequence. */
|
||||
|
||||
octet = parser->raw_buffer.pointer[0];
|
||||
width = (octet & 0x80) == 0x00 ? 1 :
|
||||
(octet & 0xE0) == 0xC0 ? 2 :
|
||||
(octet & 0xF0) == 0xE0 ? 3 :
|
||||
(octet & 0xF8) == 0xF0 ? 4 : 0;
|
||||
|
||||
/* Check if the leading octet is valid. */
|
||||
|
||||
if (!width)
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Invalid leading UTF-8 octet",
|
||||
parser->offset, octet);
|
||||
|
||||
/* Check if the raw buffer contains an incomplete character. */
|
||||
|
||||
if (width > raw_unread) {
|
||||
if (parser->eof) {
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Incomplete UTF-8 octet sequence",
|
||||
parser->offset, -1);
|
||||
}
|
||||
incomplete = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Decode the leading octet. */
|
||||
|
||||
value = (octet & 0x80) == 0x00 ? octet & 0x7F :
|
||||
(octet & 0xE0) == 0xC0 ? octet & 0x1F :
|
||||
(octet & 0xF0) == 0xE0 ? octet & 0x0F :
|
||||
(octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
|
||||
|
||||
/* Check and decode the trailing octets. */
|
||||
|
||||
for (k = 1; k < width; k ++)
|
||||
{
|
||||
octet = parser->raw_buffer.pointer[k];
|
||||
|
||||
/* Check if the octet is valid. */
|
||||
|
||||
if ((octet & 0xC0) != 0x80)
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Invalid trailing UTF-8 octet",
|
||||
parser->offset+k, octet);
|
||||
|
||||
/* Decode the octet. */
|
||||
|
||||
value = (value << 6) + (octet & 0x3F);
|
||||
}
|
||||
|
||||
/* Check the length of the sequence against the value. */
|
||||
|
||||
if (!((width == 1) ||
|
||||
(width == 2 && value >= 0x80) ||
|
||||
(width == 3 && value >= 0x800) ||
|
||||
(width == 4 && value >= 0x10000)))
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Invalid length of a UTF-8 sequence",
|
||||
parser->offset, -1);
|
||||
|
||||
/* Check the range of the value. */
|
||||
|
||||
if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Invalid Unicode character",
|
||||
parser->offset, value);
|
||||
|
||||
break;
|
||||
|
||||
case YAML_UTF16LE_ENCODING:
|
||||
case YAML_UTF16BE_ENCODING:
|
||||
|
||||
low = (parser->encoding == YAML_UTF16LE_ENCODING ? 0 : 1);
|
||||
high = (parser->encoding == YAML_UTF16LE_ENCODING ? 1 : 0);
|
||||
|
||||
/*
|
||||
* The UTF-16 encoding is not as simple as one might
|
||||
* naively think. Check RFC 2781
|
||||
* (http://www.ietf.org/rfc/rfc2781.txt).
|
||||
*
|
||||
* Normally, two subsequent bytes describe a Unicode
|
||||
* character. However a special technique (called a
|
||||
* surrogate pair) is used for specifying character
|
||||
* values larger than 0xFFFF.
|
||||
*
|
||||
* A surrogate pair consists of two pseudo-characters:
|
||||
* high surrogate area (0xD800-0xDBFF)
|
||||
* low surrogate area (0xDC00-0xDFFF)
|
||||
*
|
||||
* The following formulas are used for decoding
|
||||
* and encoding characters using surrogate pairs:
|
||||
*
|
||||
* U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF)
|
||||
* U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF)
|
||||
* W1 = 110110yyyyyyyyyy
|
||||
* W2 = 110111xxxxxxxxxx
|
||||
*
|
||||
* where U is the character value, W1 is the high surrogate
|
||||
* area, W2 is the low surrogate area.
|
||||
*/
|
||||
|
||||
/* Check for incomplete UTF-16 character. */
|
||||
|
||||
if (raw_unread < 2) {
|
||||
if (parser->eof) {
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Incomplete UTF-16 character",
|
||||
parser->offset, -1);
|
||||
}
|
||||
incomplete = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Get the character. */
|
||||
|
||||
value = parser->raw_buffer.pointer[low]
|
||||
+ (parser->raw_buffer.pointer[high] << 8);
|
||||
|
||||
/* Check for unexpected low surrogate area. */
|
||||
|
||||
if ((value & 0xFC00) == 0xDC00)
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Unexpected low surrogate area",
|
||||
parser->offset, value);
|
||||
|
||||
/* Check for a high surrogate area. */
|
||||
|
||||
if ((value & 0xFC00) == 0xD800) {
|
||||
|
||||
width = 4;
|
||||
|
||||
/* Check for incomplete surrogate pair. */
|
||||
|
||||
if (raw_unread < 4) {
|
||||
if (parser->eof) {
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Incomplete UTF-16 surrogate pair",
|
||||
parser->offset, -1);
|
||||
}
|
||||
incomplete = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Get the next character. */
|
||||
|
||||
value2 = parser->raw_buffer.pointer[low+2]
|
||||
+ (parser->raw_buffer.pointer[high+2] << 8);
|
||||
|
||||
/* Check for a low surrogate area. */
|
||||
|
||||
if ((value2 & 0xFC00) != 0xDC00)
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Expected low surrogate area",
|
||||
parser->offset+2, value2);
|
||||
|
||||
/* Generate the value of the surrogate pair. */
|
||||
|
||||
value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF);
|
||||
}
|
||||
|
||||
else {
|
||||
width = 2;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(1); /* Impossible. */
|
||||
}
|
||||
|
||||
/* Check if the raw buffer contains enough bytes to form a character. */
|
||||
|
||||
if (incomplete) break;
|
||||
|
||||
/*
|
||||
* Check if the character is in the allowed range:
|
||||
* #x9 | #xA | #xD | [#x20-#x7E] (8 bit)
|
||||
* | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit)
|
||||
* | [#x10000-#x10FFFF] (32 bit)
|
||||
*/
|
||||
|
||||
if (! (value == 0x09 || value == 0x0A || value == 0x0D
|
||||
|| (value >= 0x20 && value <= 0x7E)
|
||||
|| (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF)
|
||||
|| (value >= 0xE000 && value <= 0xFFFD)
|
||||
|| (value >= 0x10000 && value <= 0x10FFFF)))
|
||||
return yaml_parser_set_reader_error(parser,
|
||||
"Control characters are not allowed",
|
||||
parser->offset, value);
|
||||
|
||||
/* Move the raw pointers. */
|
||||
|
||||
parser->raw_buffer.pointer += width;
|
||||
parser->offset += width;
|
||||
|
||||
/* Finally put the character into the buffer. */
|
||||
|
||||
/* 0000 0000-0000 007F -> 0xxxxxxx */
|
||||
if (value <= 0x7F) {
|
||||
*(parser->buffer.last++) = (yaml_char_t)value;
|
||||
}
|
||||
/* 0000 0080-0000 07FF -> 110xxxxx 10xxxxxx */
|
||||
else if (value <= 0x7FF) {
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0xC0 + (value >> 6));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + (value & 0x3F));
|
||||
}
|
||||
/* 0000 0800-0000 FFFF -> 1110xxxx 10xxxxxx 10xxxxxx */
|
||||
else if (value <= 0xFFFF) {
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0xE0 + (value >> 12));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + ((value >> 6) & 0x3F));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + (value & 0x3F));
|
||||
}
|
||||
/* 0001 0000-0010 FFFF -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
|
||||
else {
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0xF0 + (value >> 18));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + ((value >> 12) & 0x3F));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + ((value >> 6) & 0x3F));
|
||||
*(parser->buffer.last++) = (yaml_char_t)(0x80 + (value & 0x3F));
|
||||
}
|
||||
|
||||
parser->unread ++;
|
||||
}
|
||||
|
||||
/* On EOF, put NUL into the buffer and return. */
|
||||
|
||||
if (parser->eof) {
|
||||
*(parser->buffer.last++) = '\0';
|
||||
parser->unread ++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,146 +0,0 @@
|
|||
#include <stdafx.h>
|
||||
#include "yaml_private.h"
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
namespace LibYaml {
|
||||
/*
|
||||
* Declarations.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_set_writer_error(yaml_emitter_t *emitter, const char *problem);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_flush(yaml_emitter_t *emitter);
|
||||
|
||||
/*
|
||||
* Set the writer error and return 0.
|
||||
*/
|
||||
|
||||
static int
|
||||
yaml_emitter_set_writer_error(yaml_emitter_t *emitter, const char *problem)
|
||||
{
|
||||
emitter->error = YAML_WRITER_ERROR;
|
||||
emitter->problem = problem;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush the output buffer.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_emitter_flush(yaml_emitter_t *emitter)
|
||||
{
|
||||
int low, high;
|
||||
|
||||
assert(emitter); /* Non-NULL emitter object is expected. */
|
||||
assert(emitter->write_handler); /* Write handler must be set. */
|
||||
assert(emitter->encoding); /* Output encoding must be set. */
|
||||
|
||||
emitter->buffer.last = emitter->buffer.pointer;
|
||||
emitter->buffer.pointer = emitter->buffer.start;
|
||||
|
||||
/* Check if the buffer is empty. */
|
||||
|
||||
if (emitter->buffer.start == emitter->buffer.last) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If the output encoding is UTF-8, we don't need to recode the buffer. */
|
||||
|
||||
if (emitter->encoding == YAML_UTF8_ENCODING)
|
||||
{
|
||||
if (emitter->write_handler(emitter->write_handler_data,
|
||||
emitter->buffer.start,
|
||||
emitter->buffer.last - emitter->buffer.start)) {
|
||||
emitter->buffer.last = emitter->buffer.start;
|
||||
emitter->buffer.pointer = emitter->buffer.start;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return yaml_emitter_set_writer_error(emitter, "Write error");
|
||||
}
|
||||
}
|
||||
|
||||
/* Recode the buffer into the raw buffer. */
|
||||
|
||||
low = (emitter->encoding == YAML_UTF16LE_ENCODING ? 0 : 1);
|
||||
high = (emitter->encoding == YAML_UTF16LE_ENCODING ? 1 : 0);
|
||||
|
||||
while (emitter->buffer.pointer != emitter->buffer.last)
|
||||
{
|
||||
unsigned char octet;
|
||||
unsigned int width;
|
||||
unsigned int value;
|
||||
size_t k;
|
||||
|
||||
/*
|
||||
* See the "reader.c" code for more details on UTF-8 encoding. Note
|
||||
* that we assume that the buffer contains a valid UTF-8 sequence.
|
||||
*/
|
||||
|
||||
/* Read the next UTF-8 character. */
|
||||
|
||||
octet = emitter->buffer.pointer[0];
|
||||
|
||||
width = (octet & 0x80) == 0x00 ? 1 :
|
||||
(octet & 0xE0) == 0xC0 ? 2 :
|
||||
(octet & 0xF0) == 0xE0 ? 3 :
|
||||
(octet & 0xF8) == 0xF0 ? 4 : 0;
|
||||
|
||||
value = (octet & 0x80) == 0x00 ? octet & 0x7F :
|
||||
(octet & 0xE0) == 0xC0 ? octet & 0x1F :
|
||||
(octet & 0xF0) == 0xE0 ? octet & 0x0F :
|
||||
(octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
|
||||
|
||||
for (k = 1; k < width; k ++) {
|
||||
octet = emitter->buffer.pointer[k];
|
||||
value = (value << 6) + (octet & 0x3F);
|
||||
}
|
||||
|
||||
emitter->buffer.pointer += width;
|
||||
|
||||
/* Write the character. */
|
||||
|
||||
if (value < 0x10000)
|
||||
{
|
||||
emitter->raw_buffer.last[high] = (unsigned char)(value >> 8);
|
||||
emitter->raw_buffer.last[low] = (unsigned char)(value & 0xFF);
|
||||
|
||||
emitter->raw_buffer.last += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Write the character using a surrogate pair (check "reader.c"). */
|
||||
|
||||
value -= 0x10000;
|
||||
emitter->raw_buffer.last[high] =(unsigned char)( 0xD8 + (value >> 18));
|
||||
emitter->raw_buffer.last[low] = (unsigned char)((value >> 10) & 0xFF);
|
||||
emitter->raw_buffer.last[high+2] = (unsigned char)(0xDC + ((value >> 8) & 0xFF));
|
||||
emitter->raw_buffer.last[low+2] = (unsigned char)(value & 0xFF);
|
||||
|
||||
emitter->raw_buffer.last += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write the raw buffer. */
|
||||
|
||||
if (emitter->write_handler(emitter->write_handler_data,
|
||||
emitter->raw_buffer.start,
|
||||
emitter->raw_buffer.last - emitter->raw_buffer.start)) {
|
||||
emitter->buffer.last = emitter->buffer.start;
|
||||
emitter->buffer.pointer = emitter->buffer.start;
|
||||
emitter->raw_buffer.last = emitter->raw_buffer.start;
|
||||
emitter->raw_buffer.pointer = emitter->raw_buffer.start;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return yaml_emitter_set_writer_error(emitter, "Write error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,645 +0,0 @@
|
|||
#pragma warning ( disable : 4996 )
|
||||
#pragma warning ( disable : 4100 )
|
||||
#pragma warning ( disable : 4706 )
|
||||
#pragma warning ( disable : 4701 )
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <yaml.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
||||
namespace YamlDotNet {
|
||||
namespace Core {
|
||||
namespace LibYaml {
|
||||
|
||||
/*
|
||||
* Memory management.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(void *)
|
||||
yaml_malloc(size_t size);
|
||||
|
||||
YAML_DECLARE(void *)
|
||||
yaml_realloc(void *ptr, size_t size);
|
||||
|
||||
YAML_DECLARE(void)
|
||||
yaml_free(void *ptr);
|
||||
|
||||
YAML_DECLARE(yaml_char_t *)
|
||||
yaml_strdup(const yaml_char_t *);
|
||||
|
||||
/*
|
||||
* Reader: Ensure that the buffer contains at least `length` characters.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
|
||||
|
||||
/*
|
||||
* Scanner: Ensure that the token stack contains at least one token ready.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_parser_fetch_more_tokens(yaml_parser_t *parser);
|
||||
|
||||
/*
|
||||
* The size of the input raw buffer.
|
||||
*/
|
||||
|
||||
#define INPUT_RAW_BUFFER_SIZE 16384
|
||||
|
||||
/*
|
||||
* The size of the input buffer.
|
||||
*
|
||||
* It should be possible to decode the whole raw buffer.
|
||||
*/
|
||||
|
||||
#define INPUT_BUFFER_SIZE (INPUT_RAW_BUFFER_SIZE*3)
|
||||
|
||||
/*
|
||||
* The size of the output buffer.
|
||||
*/
|
||||
|
||||
#define OUTPUT_BUFFER_SIZE 16384
|
||||
|
||||
/*
|
||||
* The size of the output raw buffer.
|
||||
*
|
||||
* It should be possible to encode the whole output buffer.
|
||||
*/
|
||||
|
||||
#define OUTPUT_RAW_BUFFER_SIZE (OUTPUT_BUFFER_SIZE*2+2)
|
||||
|
||||
/*
|
||||
* The size of other stacks and queues.
|
||||
*/
|
||||
|
||||
#define INITIAL_STACK_SIZE 16
|
||||
#define INITIAL_QUEUE_SIZE 16
|
||||
#define INITIAL_STRING_SIZE 16
|
||||
|
||||
/*
|
||||
* Buffer management.
|
||||
*/
|
||||
|
||||
#define BUFFER_INIT(context,buffer,size) \
|
||||
(((buffer).start = (unsigned char*)yaml_malloc(size)) ? \
|
||||
((buffer).last = (buffer).pointer = (buffer).start, \
|
||||
(buffer).end = (buffer).start+(size), \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define BUFFER_DEL(context,buffer) \
|
||||
(yaml_free((buffer).start), \
|
||||
(buffer).start = (buffer).pointer = (buffer).end = 0)
|
||||
|
||||
/*
|
||||
* String management.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
yaml_char_t *start;
|
||||
yaml_char_t *end;
|
||||
yaml_char_t *pointer;
|
||||
} yaml_string_t;
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_string_extend(yaml_char_t **start,
|
||||
yaml_char_t **pointer, yaml_char_t **end);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_string_join(
|
||||
yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end,
|
||||
yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end);
|
||||
|
||||
#define NULL_STRING { NULL, NULL, NULL }
|
||||
|
||||
#define STRING(string,length) { (string), (string)+(length), (string) }
|
||||
|
||||
#define STRING_INIT(context,string,size) \
|
||||
(((string).start = (yaml_char_t *)yaml_malloc(size)) ? \
|
||||
((string).pointer = (string).start, \
|
||||
(string).end = (string).start+(size), \
|
||||
memset((string).start, 0, (size)), \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define STRING_DEL(context,string) \
|
||||
(yaml_free((string).start), \
|
||||
(string).start = (string).pointer = (string).end = 0)
|
||||
|
||||
#define STRING_EXTEND(context,string) \
|
||||
(((string).pointer+5 < (string).end) \
|
||||
|| yaml_string_extend(&(string).start, \
|
||||
&(string).pointer, &(string).end))
|
||||
|
||||
#define CLEAR(context,string) \
|
||||
((string).pointer = (string).start, \
|
||||
memset((string).start, 0, (string).end-(string).start))
|
||||
|
||||
#define JOIN(context,string_a,string_b) \
|
||||
((yaml_string_join(&(string_a).start, &(string_a).pointer, \
|
||||
&(string_a).end, &(string_b).start, \
|
||||
&(string_b).pointer, &(string_b).end)) ? \
|
||||
((string_b).pointer = (string_b).start, \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
/*
|
||||
* String check operations.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Check the octet at the specified position.
|
||||
*/
|
||||
|
||||
#define CHECK_AT(string,octet,offset) \
|
||||
((string).pointer[offset] == (yaml_char_t)(octet))
|
||||
|
||||
/*
|
||||
* Check the current octet in the buffer.
|
||||
*/
|
||||
|
||||
#define CHECK(string,octet) CHECK_AT((string),(octet),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is an alphabetical
|
||||
* character, a digit, '_', or '-'.
|
||||
*/
|
||||
|
||||
#define IS_ALPHA_AT(string,offset) \
|
||||
(((string).pointer[offset] >= (yaml_char_t) '0' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) '9') || \
|
||||
((string).pointer[offset] >= (yaml_char_t) 'A' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'Z') || \
|
||||
((string).pointer[offset] >= (yaml_char_t) 'a' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'z') || \
|
||||
(string).pointer[offset] == '_' || \
|
||||
(string).pointer[offset] == '-')
|
||||
|
||||
#define IS_ALPHA(string) IS_ALPHA_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is a digit.
|
||||
*/
|
||||
|
||||
#define IS_DIGIT_AT(string,offset) \
|
||||
(((string).pointer[offset] >= (yaml_char_t) '0' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) '9'))
|
||||
|
||||
#define IS_DIGIT(string) IS_DIGIT_AT((string),0)
|
||||
|
||||
/*
|
||||
* Get the value of a digit.
|
||||
*/
|
||||
|
||||
#define AS_DIGIT_AT(string,offset) \
|
||||
((string).pointer[offset] - (yaml_char_t) '0')
|
||||
|
||||
#define AS_DIGIT(string) AS_DIGIT_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is a hex-digit.
|
||||
*/
|
||||
|
||||
#define IS_HEX_AT(string,offset) \
|
||||
(((string).pointer[offset] >= (yaml_char_t) '0' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) '9') || \
|
||||
((string).pointer[offset] >= (yaml_char_t) 'A' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'F') || \
|
||||
((string).pointer[offset] >= (yaml_char_t) 'a' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'f'))
|
||||
|
||||
#define IS_HEX(string) IS_HEX_AT((string),0)
|
||||
|
||||
/*
|
||||
* Get the value of a hex-digit.
|
||||
*/
|
||||
|
||||
#define AS_HEX_AT(string,offset) \
|
||||
(((string).pointer[offset] >= (yaml_char_t) 'A' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'F') ? \
|
||||
((string).pointer[offset] - (yaml_char_t) 'A' + 10) : \
|
||||
((string).pointer[offset] >= (yaml_char_t) 'a' && \
|
||||
(string).pointer[offset] <= (yaml_char_t) 'f') ? \
|
||||
((string).pointer[offset] - (yaml_char_t) 'a' + 10) : \
|
||||
((string).pointer[offset] - (yaml_char_t) '0'))
|
||||
|
||||
#define AS_HEX(string) AS_HEX_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character is ASCII.
|
||||
*/
|
||||
|
||||
#define IS_ASCII_AT(string,offset) \
|
||||
((string).pointer[offset] <= (yaml_char_t) '\x7F')
|
||||
|
||||
#define IS_ASCII(string) IS_ASCII_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character can be printed unescaped.
|
||||
*/
|
||||
|
||||
#define IS_PRINTABLE_AT(string,offset) \
|
||||
(((string).pointer[offset] == 0x0A) /* . == #x0A */ \
|
||||
|| ((string).pointer[offset] >= 0x20 /* #x20 <= . <= #x7E */ \
|
||||
&& (string).pointer[offset] <= 0x7E) \
|
||||
|| ((string).pointer[offset] == 0xC2 /* #0xA0 <= . <= #xD7FF */ \
|
||||
&& (string).pointer[offset+1] >= 0xA0) \
|
||||
|| ((string).pointer[offset] > 0xC2 \
|
||||
&& (string).pointer[offset] < 0xED) \
|
||||
|| ((string).pointer[offset] == 0xED \
|
||||
&& (string).pointer[offset+1] < 0xA0) \
|
||||
|| ((string).pointer[offset] == 0xEE) \
|
||||
|| ((string).pointer[offset] == 0xEF /* #xE000 <= . <= #xFFFD */ \
|
||||
&& !((string).pointer[offset+1] == 0xBB /* && . != #xFEFF */ \
|
||||
&& (string).pointer[offset+2] == 0xBF) \
|
||||
&& !((string).pointer[offset+1] == 0xBF \
|
||||
&& ((string).pointer[offset+2] == 0xBE \
|
||||
|| (string).pointer[offset+2] == 0xBF))))
|
||||
|
||||
#define IS_PRINTABLE(string) IS_PRINTABLE_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is NUL.
|
||||
*/
|
||||
|
||||
#define IS_Z_AT(string,offset) CHECK_AT((string),'\0',(offset))
|
||||
|
||||
#define IS_Z(string) IS_Z_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is BOM.
|
||||
*/
|
||||
|
||||
#define IS_BOM_AT(string,offset) \
|
||||
(CHECK_AT((string),'\xEF',(offset)) \
|
||||
&& CHECK_AT((string),'\xBB',(offset)+1) \
|
||||
&& CHECK_AT((string),'\xBF',(offset)+2)) /* BOM (#xFEFF) */
|
||||
|
||||
#define IS_BOM(string) IS_BOM_AT(string,0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is space.
|
||||
*/
|
||||
|
||||
#define IS_SPACE_AT(string,offset) CHECK_AT((string),' ',(offset))
|
||||
|
||||
#define IS_SPACE(string) IS_SPACE_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is tab.
|
||||
*/
|
||||
|
||||
#define IS_TAB_AT(string,offset) CHECK_AT((string),'\t',(offset))
|
||||
|
||||
#define IS_TAB(string) IS_TAB_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is blank (space or tab).
|
||||
*/
|
||||
|
||||
#define IS_BLANK_AT(string,offset) \
|
||||
(IS_SPACE_AT((string),(offset)) || IS_TAB_AT((string),(offset)))
|
||||
|
||||
#define IS_BLANK(string) IS_BLANK_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character at the specified position is a line break.
|
||||
*/
|
||||
|
||||
#define IS_BREAK_AT(string,offset) \
|
||||
(CHECK_AT((string),'\r',(offset)) /* CR (#xD)*/ \
|
||||
|| CHECK_AT((string),'\n',(offset)) /* LF (#xA) */ \
|
||||
|| (CHECK_AT((string),'\xC2',(offset)) \
|
||||
&& CHECK_AT((string),'\x85',(offset)+1)) /* NEL (#x85) */ \
|
||||
|| (CHECK_AT((string),'\xE2',(offset)) \
|
||||
&& CHECK_AT((string),'\x80',(offset)+1) \
|
||||
&& CHECK_AT((string),'\xA8',(offset)+2)) /* LS (#x2028) */ \
|
||||
|| (CHECK_AT((string),'\xE2',(offset)) \
|
||||
&& CHECK_AT((string),'\x80',(offset)+1) \
|
||||
&& CHECK_AT((string),'\xA9',(offset)+2))) /* PS (#x2029) */
|
||||
|
||||
#define IS_BREAK(string) IS_BREAK_AT((string),0)
|
||||
|
||||
#define IS_CRLF_AT(string,offset) \
|
||||
(CHECK_AT((string),'\r',(offset)) && CHECK_AT((string),'\n',(offset)+1))
|
||||
|
||||
#define IS_CRLF(string) IS_CRLF_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character is a line break or NUL.
|
||||
*/
|
||||
|
||||
#define IS_BREAKZ_AT(string,offset) \
|
||||
(IS_BREAK_AT((string),(offset)) || IS_Z_AT((string),(offset)))
|
||||
|
||||
#define IS_BREAKZ(string) IS_BREAKZ_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character is a line break, space, or NUL.
|
||||
*/
|
||||
|
||||
#define IS_SPACEZ_AT(string,offset) \
|
||||
(IS_SPACE_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))
|
||||
|
||||
#define IS_SPACEZ(string) IS_SPACEZ_AT((string),0)
|
||||
|
||||
/*
|
||||
* Check if the character is a line break, space, tab, or NUL.
|
||||
*/
|
||||
|
||||
#define IS_BLANKZ_AT(string,offset) \
|
||||
(IS_BLANK_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))
|
||||
|
||||
#define IS_BLANKZ(string) IS_BLANKZ_AT((string),0)
|
||||
|
||||
/*
|
||||
* Determine the width of the character.
|
||||
*/
|
||||
|
||||
#define WIDTH_AT(string,offset) \
|
||||
(((string).pointer[offset] & 0x80) == 0x00 ? 1 : \
|
||||
((string).pointer[offset] & 0xE0) == 0xC0 ? 2 : \
|
||||
((string).pointer[offset] & 0xF0) == 0xE0 ? 3 : \
|
||||
((string).pointer[offset] & 0xF8) == 0xF0 ? 4 : 0)
|
||||
|
||||
#define WIDTH(string) WIDTH_AT((string),0)
|
||||
|
||||
/*
|
||||
* Move the string pointer to the next character.
|
||||
*/
|
||||
|
||||
#define MOVE(string) ((string).pointer += WIDTH((string)))
|
||||
|
||||
/*
|
||||
* Copy a character and move the pointers of both strings.
|
||||
*/
|
||||
|
||||
#define COPY(string_a,string_b) \
|
||||
((*(string_b).pointer & 0x80) == 0x00 ? \
|
||||
(*((string_a).pointer++) = *((string_b).pointer++)) : \
|
||||
(*(string_b).pointer & 0xE0) == 0xC0 ? \
|
||||
(*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++)) : \
|
||||
(*(string_b).pointer & 0xF0) == 0xE0 ? \
|
||||
(*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++)) : \
|
||||
(*(string_b).pointer & 0xF8) == 0xF0 ? \
|
||||
(*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++), \
|
||||
*((string_a).pointer++) = *((string_b).pointer++)) : 0)
|
||||
|
||||
/*
|
||||
* Stack and queue management.
|
||||
*/
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_stack_extend(void **start, void **top, void **end);
|
||||
|
||||
YAML_DECLARE(int)
|
||||
yaml_queue_extend(void **start, void **head, void **tail, void **end);
|
||||
|
||||
#define STACK_INIT(context,stack,size,T) \
|
||||
(((stack).start = (T*)yaml_malloc((size)*sizeof(*(stack).start))) ? \
|
||||
((stack).top = (stack).start, \
|
||||
(stack).end = (stack).start+(size), \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define STACK_DEL(context,stack) \
|
||||
(yaml_free((stack).start), \
|
||||
(stack).start = (stack).top = (stack).end = 0)
|
||||
|
||||
#define STACK_EMPTY(context,stack) \
|
||||
((stack).start == (stack).top)
|
||||
|
||||
#define PUSH(context,stack,value) \
|
||||
(((stack).top != (stack).end \
|
||||
|| yaml_stack_extend((void **)&(stack).start, \
|
||||
(void **)&(stack).top, (void **)&(stack).end)) ? \
|
||||
(*((stack).top++) = value, \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define POP(context,stack) \
|
||||
(*(--(stack).top))
|
||||
|
||||
#define QUEUE_INIT(context,queue,size,T) \
|
||||
(((queue).start = (T*)yaml_malloc((size)*sizeof(*(queue).start))) ? \
|
||||
((queue).head = (queue).tail = (queue).start, \
|
||||
(queue).end = (queue).start+(size), \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define QUEUE_DEL(context,queue) \
|
||||
(yaml_free((queue).start), \
|
||||
(queue).start = (queue).head = (queue).tail = (queue).end = 0)
|
||||
|
||||
#define QUEUE_EMPTY(context,queue) \
|
||||
((queue).head == (queue).tail)
|
||||
|
||||
#define ENQUEUE(context,queue,value) \
|
||||
(((queue).tail != (queue).end \
|
||||
|| yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \
|
||||
(void **)&(queue).tail, (void **)&(queue).end)) ? \
|
||||
(*((queue).tail++) = value, \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
#define DEQUEUE(context,queue) \
|
||||
(*((queue).head++))
|
||||
|
||||
#define QUEUE_INSERT(context,queue,index,value) \
|
||||
(((queue).tail != (queue).end \
|
||||
|| yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \
|
||||
(void **)&(queue).tail, (void **)&(queue).end)) ? \
|
||||
(memmove((queue).head+(index)+1,(queue).head+(index), \
|
||||
((queue).tail-(queue).head-(index))*sizeof(*(queue).start)), \
|
||||
*((queue).head+(index)) = value, \
|
||||
(queue).tail++, \
|
||||
1) : \
|
||||
((context)->error = YAML_MEMORY_ERROR, \
|
||||
0))
|
||||
|
||||
/*
|
||||
* Token initializers.
|
||||
*/
|
||||
|
||||
#define TOKEN_INIT(token,token_type,token_start_mark,token_end_mark) \
|
||||
(memset(&(token), 0, sizeof(yaml_token_t)), \
|
||||
(token).type = (token_type), \
|
||||
(token).start_mark = (token_start_mark), \
|
||||
(token).end_mark = (token_end_mark))
|
||||
|
||||
#define STREAM_START_TOKEN_INIT(token,token_encoding,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_STREAM_START_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.stream_start.encoding = (token_encoding))
|
||||
|
||||
#define STREAM_END_TOKEN_INIT(token,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_STREAM_END_TOKEN,(start_mark),(end_mark)))
|
||||
|
||||
#define ALIAS_TOKEN_INIT(token,token_value,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_ALIAS_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.alias.value = (token_value))
|
||||
|
||||
#define ANCHOR_TOKEN_INIT(token,token_value,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_ANCHOR_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.anchor.value = (token_value))
|
||||
|
||||
#define TAG_TOKEN_INIT(token,token_handle,token_suffix,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_TAG_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.tag.handle = (token_handle), \
|
||||
(token).data.tag.suffix = (token_suffix))
|
||||
|
||||
#define SCALAR_TOKEN_INIT(token,token_value,token_length,token_style,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_SCALAR_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.scalar.value = (token_value), \
|
||||
(token).data.scalar.length = (token_length), \
|
||||
(token).data.scalar.style = (token_style))
|
||||
|
||||
#define VERSION_DIRECTIVE_TOKEN_INIT(token,token_major,token_minor,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_VERSION_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.version_directive.major = (token_major), \
|
||||
(token).data.version_directive.minor = (token_minor))
|
||||
|
||||
#define TAG_DIRECTIVE_TOKEN_INIT(token,token_handle,token_prefix,start_mark,end_mark) \
|
||||
(TOKEN_INIT((token),YAML_TAG_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \
|
||||
(token).data.tag_directive.handle = (token_handle), \
|
||||
(token).data.tag_directive.prefix = (token_prefix))
|
||||
|
||||
/*
|
||||
* YamlEvent initializers.
|
||||
*/
|
||||
|
||||
#define EVENT_INIT(event,event_type,event_start_mark,event_end_mark) \
|
||||
(memset(&(event), 0, sizeof(yaml_event_t)), \
|
||||
(event).type = (event_type), \
|
||||
(event).start_mark = (event_start_mark), \
|
||||
(event).end_mark = (event_end_mark))
|
||||
|
||||
#define STREAM_START_EVENT_INIT(event,event_encoding,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_STREAM_START_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.stream_start.encoding = (event_encoding))
|
||||
|
||||
#define STREAM_END_EVENT_INIT(event,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_STREAM_END_EVENT,(start_mark),(end_mark)))
|
||||
|
||||
#define DOCUMENT_START_EVENT_INIT(event,event_version_directive, \
|
||||
event_tag_directives_start,event_tag_directives_end,event_implicit,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_DOCUMENT_START_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.document_start.version_directive = (event_version_directive), \
|
||||
(event).data.document_start.tag_directives.start = (event_tag_directives_start), \
|
||||
(event).data.document_start.tag_directives.end = (event_tag_directives_end), \
|
||||
(event).data.document_start.implicit = (event_implicit))
|
||||
|
||||
#define DOCUMENT_END_EVENT_INIT(event,event_implicit,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_DOCUMENT_END_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.document_end.implicit = (event_implicit))
|
||||
|
||||
#define ALIAS_EVENT_INIT(event,event_anchor,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_ALIAS_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.alias.anchor = (event_anchor))
|
||||
|
||||
#define SCALAR_EVENT_INIT(event,event_anchor,event_tag,event_value,event_length, \
|
||||
event_plain_implicit, event_quoted_implicit,event_style,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_SCALAR_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.scalar.anchor = (event_anchor), \
|
||||
(event).data.scalar.tag = (event_tag), \
|
||||
(event).data.scalar.value = (event_value), \
|
||||
(event).data.scalar.length = (event_length), \
|
||||
(event).data.scalar.plain_implicit = (event_plain_implicit), \
|
||||
(event).data.scalar.quoted_implicit = (event_quoted_implicit), \
|
||||
(event).data.scalar.style = (event_style))
|
||||
|
||||
#define SEQUENCE_START_EVENT_INIT(event,event_anchor,event_tag, \
|
||||
event_implicit,event_style,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_SEQUENCE_START_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.sequence_start.anchor = (event_anchor), \
|
||||
(event).data.sequence_start.tag = (event_tag), \
|
||||
(event).data.sequence_start.implicit = (event_implicit), \
|
||||
(event).data.sequence_start.style = (event_style))
|
||||
|
||||
#define SEQUENCE_END_EVENT_INIT(event,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_SEQUENCE_END_EVENT,(start_mark),(end_mark)))
|
||||
|
||||
#define MAPPING_START_EVENT_INIT(event,event_anchor,event_tag, \
|
||||
event_implicit,event_style,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_MAPPING_START_EVENT,(start_mark),(end_mark)), \
|
||||
(event).data.mapping_start.anchor = (event_anchor), \
|
||||
(event).data.mapping_start.tag = (event_tag), \
|
||||
(event).data.mapping_start.implicit = (event_implicit), \
|
||||
(event).data.mapping_start.style = (event_style))
|
||||
|
||||
#define MAPPING_END_EVENT_INIT(event,start_mark,end_mark) \
|
||||
(EVENT_INIT((event),YAML_MAPPING_END_EVENT,(start_mark),(end_mark)))
|
||||
|
||||
/*
|
||||
* Document initializer.
|
||||
*/
|
||||
|
||||
#define DOCUMENT_INIT(document,document_nodes_start,document_nodes_end, \
|
||||
document_version_directive,document_tag_directives_start, \
|
||||
document_tag_directives_end,document_start_implicit, \
|
||||
document_end_implicit,document_start_mark,document_end_mark) \
|
||||
(memset(&(document), 0, sizeof(yaml_document_t)), \
|
||||
(document).nodes.start = (document_nodes_start), \
|
||||
(document).nodes.end = (document_nodes_end), \
|
||||
(document).nodes.top = (document_nodes_start), \
|
||||
(document).version_directive = (document_version_directive), \
|
||||
(document).tag_directives.start = (document_tag_directives_start), \
|
||||
(document).tag_directives.end = (document_tag_directives_end), \
|
||||
(document).start_implicit = (document_start_implicit), \
|
||||
(document).end_implicit = (document_end_implicit), \
|
||||
(document).start_mark = (document_start_mark), \
|
||||
(document).end_mark = (document_end_mark))
|
||||
|
||||
/*
|
||||
* Node initializers.
|
||||
*/
|
||||
|
||||
#define NODE_INIT(node,node_type,node_tag,node_start_mark,node_end_mark) \
|
||||
(memset(&(node), 0, sizeof(yaml_node_t)), \
|
||||
(node).type = (node_type), \
|
||||
(node).tag = (node_tag), \
|
||||
(node).start_mark = (node_start_mark), \
|
||||
(node).end_mark = (node_end_mark))
|
||||
|
||||
#define SCALAR_NODE_INIT(node,node_tag,node_value,node_length, \
|
||||
node_style,start_mark,end_mark) \
|
||||
(NODE_INIT((node),YAML_SCALAR_NODE,(node_tag),(start_mark),(end_mark)), \
|
||||
(node).data.scalar.value = (node_value), \
|
||||
(node).data.scalar.length = (node_length), \
|
||||
(node).data.scalar.style = (node_style))
|
||||
|
||||
#define SEQUENCE_NODE_INIT(node,node_tag,node_items_start,node_items_end, \
|
||||
node_style,start_mark,end_mark) \
|
||||
(NODE_INIT((node),YAML_SEQUENCE_NODE,(node_tag),(start_mark),(end_mark)), \
|
||||
(node).data.sequence.items.start = (node_items_start), \
|
||||
(node).data.sequence.items.end = (node_items_end), \
|
||||
(node).data.sequence.items.top = (node_items_start), \
|
||||
(node).data.sequence.style = (node_style))
|
||||
|
||||
#define MAPPING_NODE_INIT(node,node_tag,node_pairs_start,node_pairs_end, \
|
||||
node_style,start_mark,end_mark) \
|
||||
(NODE_INIT((node),YAML_MAPPING_NODE,(node_tag),(start_mark),(end_mark)), \
|
||||
(node).data.mapping.pairs.start = (node_pairs_start), \
|
||||
(node).data.mapping.pairs.end = (node_pairs_end), \
|
||||
(node).data.mapping.pairs.top = (node_pairs_start), \
|
||||
(node).data.mapping.style = (node_style))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
|
||||
namespace YamlDotNet.RepresentationModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the method needed to be able to visit Yaml elements.
|
||||
/// </summary>
|
||||
public interface IYamlVisitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Visits a <see cref="YamlStream"/>.
|
||||
/// </summary>
|
||||
/// <param name="stream">
|
||||
/// The <see cref="YamlStream"/> that is being visited.
|
||||
/// </param>
|
||||
void Visit(YamlStream stream);
|
||||
|
||||
/// <summary>
|
||||
/// Visits a <see cref="YamlDocument"/>.
|
||||
/// </summary>
|
||||
/// <param name="document">
|
||||
/// The <see cref="YamlDocument"/> that is being visited.
|
||||
/// </param>
|
||||
void Visit(YamlDocument document);
|
||||
|
||||
/// <summary>
|
||||
/// Visits a <see cref="YamlScalarNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="scalar">
|
||||
/// The <see cref="YamlScalarNode"/> that is being visited.
|
||||
/// </param>
|
||||
void Visit(YamlScalarNode scalar);
|
||||
|
||||
/// <summary>
|
||||
/// Visits a <see cref="YamlSequenceNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="sequence">
|
||||
/// The <see cref="YamlSequenceNode"/> that is being visited.
|
||||
/// </param>
|
||||
void Visit(YamlSequenceNode sequence);
|
||||
|
||||
/// <summary>
|
||||
/// Visits a <see cref="YamlMappingNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="mapping">
|
||||
/// The <see cref="YamlMappingNode"/> that is being visited.
|
||||
/// </param>
|
||||
void Visit(YamlMappingNode mapping);
|
||||
}
|
||||
}
|
|
@ -31,5 +31,15 @@ namespace YamlDotNet.RepresentationModel
|
|||
{
|
||||
throw new NotSupportedException("A YamlAliasNode is an implementation detail and should never be saved.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public override void Accept(IYamlVisitor visitor) {
|
||||
throw new NotSupportedException("A YamlAliasNode is an implementation detail and should never be visited.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -114,5 +114,15 @@ namespace YamlDotNet.RepresentationModel
|
|||
IEnumerator IEnumerable.GetEnumerator() {
|
||||
return ((IEnumerable<YamlNode>)this).GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public void Accept(IYamlVisitor visitor) {
|
||||
visitor.Visit(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,6 +30,8 @@
|
|||
<File name="../CommonAssemblyInfo.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="YamlSerializer.cs" subtype="Code" buildaction="Nothing" />
|
||||
<File name="YamlSerializerOptions.cs" subtype="Code" buildaction="Nothing" />
|
||||
<File name="IYamlVisitor.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="YamlVisitor.cs" subtype="Code" buildaction="Compile" />
|
||||
</Contents>
|
||||
<References>
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
|
|
|
@ -103,5 +103,15 @@ namespace YamlDotNet.RepresentationModel
|
|||
}
|
||||
emitter.Emit(new MappingEnd());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public override void Accept(IYamlVisitor visitor) {
|
||||
visitor.Visit(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -119,6 +119,12 @@ namespace YamlDotNet.RepresentationModel
|
|||
}
|
||||
}
|
||||
|
||||
object IEnumerator.Current {
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveNext() {
|
||||
return false;
|
||||
}
|
||||
|
@ -135,5 +141,13 @@ namespace YamlDotNet.RepresentationModel
|
|||
internal virtual IEnumerator<YamlNode> GetEnumerator() {
|
||||
return EmptyEnumerator.Instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public abstract void Accept(IYamlVisitor visitor);
|
||||
}
|
||||
}
|
|
@ -73,5 +73,15 @@ namespace YamlDotNet.RepresentationModel
|
|||
{
|
||||
emitter.Emit(new Scalar(Anchor, Tag, Value, ScalarStyle.Any, false, false));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public override void Accept(IYamlVisitor visitor) {
|
||||
visitor.Visit(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -80,5 +80,15 @@ namespace YamlDotNet.RepresentationModel
|
|||
}
|
||||
emitter.Emit(new SequenceEnd());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public override void Accept(IYamlVisitor visitor) {
|
||||
visitor.Visit(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -59,6 +59,16 @@ namespace YamlDotNet.RepresentationModel
|
|||
}
|
||||
|
||||
emitter.Emit(new StreamEnd());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accepts the specified visitor by calling the appropriate Visit method on it.
|
||||
/// </summary>
|
||||
/// <param name="visitor">
|
||||
/// A <see cref="IYamlVisitor"/>.
|
||||
/// </param>
|
||||
public void Accept(IYamlVisitor visitor) {
|
||||
visitor.Visit(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
using System;
|
||||
|
||||
namespace YamlDotNet.RepresentationModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract implementation of <see cref="IYamlVisitor"/> that knows how to walk a complete Yaml object model.
|
||||
/// </summary>
|
||||
public abstract class YamlVisitor : IYamlVisitor {
|
||||
/// <summary>
|
||||
/// Called when this object is visiting a <see cref="YamlStream"/>.
|
||||
/// </summary>
|
||||
/// <param name="stream">
|
||||
/// The <see cref="YamlStream"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void Visit (YamlStream stream)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after this object finishes visiting a <see cref="YamlStream"/>.
|
||||
/// </summary>
|
||||
/// <param name="stream">
|
||||
/// The <see cref="YamlStream"/> that has been visited.
|
||||
/// </param>
|
||||
protected virtual void Visited (YamlStream stream)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when this object is visiting a <see cref="YamlDocument"/>.
|
||||
/// </summary>
|
||||
/// <param name="document">
|
||||
/// The <see cref="YamlDocument"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void Visit (YamlDocument document) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after this object finishes visiting a <see cref="YamlDocument"/>.
|
||||
/// </summary>
|
||||
/// <param name="document">
|
||||
/// The <see cref="YamlDocument"/> that has been visited.
|
||||
/// </param>
|
||||
protected virtual void Visited (YamlDocument document)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when this object is visiting a <see cref="YamlScalarNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="scalar">
|
||||
/// The <see cref="YamlScalarNode"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void Visit (YamlScalarNode scalar)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after this object finishes visiting a <see cref="YamlScalarNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="scalar">
|
||||
/// The <see cref="YamlScalarNode"/> that has been visited.
|
||||
/// </param>
|
||||
protected virtual void Visited (YamlScalarNode scalar)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when this object is visiting a <see cref="YamlSequenceNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="sequence">
|
||||
/// The <see cref="YamlSequenceNode"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void Visit (YamlSequenceNode sequence)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after this object finishes visiting a <see cref="YamlSequenceNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="sequence">
|
||||
/// The <see cref="YamlSequenceNode"/> that has been visited.
|
||||
/// </param>
|
||||
protected virtual void Visited (YamlSequenceNode sequence)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when this object is visiting a <see cref="YamlMappingNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="mapping">
|
||||
/// The <see cref="YamlMappingNode"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void Visit (YamlMappingNode mapping)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after this object finishes visiting a <see cref="YamlMappingNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="mapping">
|
||||
/// The <see cref="YamlMappingNode"/> that has been visited.
|
||||
/// </param>
|
||||
protected virtual void Visited (YamlMappingNode mapping)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visits every child of a <see cref="YamlStream"/>.
|
||||
/// </summary>
|
||||
/// <param name="stream">
|
||||
/// The <see cref="YamlStream"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void VisitChildren(YamlStream stream) {
|
||||
foreach (var document in stream.Documents) {
|
||||
document.Accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visits every child of a <see cref="YamlDocument"/>.
|
||||
/// </summary>
|
||||
/// <param name="document">
|
||||
/// The <see cref="YamlDocument"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void VisitChildren(YamlDocument document) {
|
||||
if(document.RootNode != null) {
|
||||
document.RootNode.Accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visits every child of a <see cref="YamlSequenceNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="sequence">
|
||||
/// The <see cref="YamlSequenceNode"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void VisitChildren(YamlSequenceNode sequence) {
|
||||
foreach (var node in sequence.Children) {
|
||||
node.Accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visits every child of a <see cref="YamlMappingNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="mapping">
|
||||
/// The <see cref="YamlMappingNode"/> that is being visited.
|
||||
/// </param>
|
||||
protected virtual void VisitChildren(YamlMappingNode mapping) {
|
||||
foreach (var pair in mapping.Children) {
|
||||
pair.Key.Accept(this);
|
||||
pair.Value.Accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
void IYamlVisitor.Visit (YamlStream stream)
|
||||
{
|
||||
Visit(stream);
|
||||
VisitChildren(stream);
|
||||
Visited(stream);
|
||||
}
|
||||
|
||||
void IYamlVisitor.Visit (YamlDocument document)
|
||||
{
|
||||
Visit(document);
|
||||
VisitChildren(document);
|
||||
Visited(document);
|
||||
}
|
||||
|
||||
void IYamlVisitor.Visit (YamlScalarNode scalar)
|
||||
{
|
||||
Visit(scalar);
|
||||
Visited(scalar);
|
||||
}
|
||||
|
||||
void IYamlVisitor.Visit (YamlSequenceNode sequence)
|
||||
{
|
||||
Visit(sequence);
|
||||
VisitChildren(sequence);
|
||||
Visited(sequence);
|
||||
}
|
||||
|
||||
void IYamlVisitor.Visit (YamlMappingNode mapping)
|
||||
{
|
||||
Visit(mapping);
|
||||
VisitChildren(mapping);
|
||||
Visited(mapping);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using NUnit.Framework;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using YamlDotNet.Converters.Xml;
|
||||
using YamlDotNet.Converters.Xml.Extensions;
|
||||
|
||||
namespace YamlDotNet.UnitTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class XmlConverterTests : YamlTest
|
||||
{
|
||||
private class TracingVisitor : YamlVisitor {
|
||||
private int indent = 0;
|
||||
|
||||
private void WriteIndent() {
|
||||
for(int i = 0; i < indent; ++i) {
|
||||
Console.Write(" ");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Visit (YamlDocument document) {
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visit(YamlDocument)");
|
||||
++indent;
|
||||
}
|
||||
|
||||
protected override void Visit (YamlMappingNode mapping)
|
||||
{
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visit(YamlMapping)");
|
||||
++indent;
|
||||
}
|
||||
|
||||
protected override void Visit (YamlScalarNode scalar)
|
||||
{
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visit(YamlScalarNode) - {0}", scalar.Value);
|
||||
++indent;
|
||||
}
|
||||
|
||||
protected override void Visit (YamlSequenceNode sequence)
|
||||
{
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visit(YamlSequenceNode)");
|
||||
++indent;
|
||||
}
|
||||
|
||||
protected override void Visit (YamlStream stream)
|
||||
{
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visit(YamlStream)");
|
||||
++indent;
|
||||
}
|
||||
|
||||
protected override void Visited (YamlDocument document)
|
||||
{
|
||||
--indent;
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visited(YamlDocument)");
|
||||
}
|
||||
|
||||
protected override void Visited (YamlMappingNode mapping)
|
||||
{
|
||||
--indent;
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visited(YamlMappingNode)");
|
||||
}
|
||||
|
||||
protected override void Visited (YamlScalarNode scalar)
|
||||
{
|
||||
--indent;
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visited(YamlScalarNode)");
|
||||
}
|
||||
|
||||
protected override void Visited (YamlSequenceNode sequence)
|
||||
{
|
||||
--indent;
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visited(YamlSequenceNode)");
|
||||
}
|
||||
|
||||
protected override void Visited (YamlStream stream)
|
||||
{
|
||||
--indent;
|
||||
WriteIndent();
|
||||
Console.WriteLine("Visited(YamlStream)");
|
||||
}
|
||||
}
|
||||
|
||||
private static YamlDocument GetDocument(string name) {
|
||||
YamlStream stream = new YamlStream();
|
||||
stream.Load(YamlFile(name));
|
||||
Assert.IsTrue(stream.Documents.Count > 0);
|
||||
return stream.Documents[0];
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ScalarToXml() {
|
||||
YamlDocument yaml = GetDocument("test2.yaml");
|
||||
|
||||
XmlConverter converter = new XmlConverter();
|
||||
XmlDocument xml = converter.ToXml(yaml, "root");
|
||||
|
||||
xml.Save(Console.Out);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SequenceOfScalarsToXml() {
|
||||
YamlDocument yaml = GetDocument("test8.yaml");
|
||||
|
||||
XmlConverter converter = new XmlConverter();
|
||||
XmlDocument xml = converter.ToXml(yaml, "root");
|
||||
|
||||
xml.Save(Console.Out);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MappingOfScalarsToXml() {
|
||||
YamlDocument yaml = GetDocument("test9.yaml");
|
||||
|
||||
XmlConverter converter = new XmlConverter();
|
||||
XmlDocument xml = converter.ToXml(yaml, "root");
|
||||
|
||||
xml.Save(Console.Out);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SequenceOfMappingAndSequencesToXml() {
|
||||
YamlDocument yaml = GetDocument("test10.yaml");
|
||||
|
||||
XmlConverter converter = new XmlConverter();
|
||||
XmlDocument xml = converter.ToXml(yaml, "root");
|
||||
|
||||
xml.Save(Console.Out);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToXmlUsingExtension() {
|
||||
YamlDocument yaml = GetDocument("test10.yaml");
|
||||
XmlDocument xml = yaml.ToXml();
|
||||
xml.Save(Console.Out);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,10 +6,26 @@ namespace YamlDotNet.UnitTests
|
|||
{
|
||||
public static void Main()
|
||||
{
|
||||
/*
|
||||
YamlStreamTests test = new YamlStreamTests();
|
||||
test.BackwardAliasReferenceWorks();
|
||||
test.ForwardAliasReferenceWorks();
|
||||
test.LoadSimpleDocument();
|
||||
*/
|
||||
|
||||
XmlConverterTests test = new XmlConverterTests();
|
||||
test.ScalarToXml();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("---");
|
||||
test.SequenceOfScalarsToXml();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("---");
|
||||
test.MappingOfScalarsToXml();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("---");
|
||||
test.SequenceOfMappingAndSequencesToXml();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("---");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,6 +42,9 @@
|
|||
<File name="Runner.cs" subtype="Code" buildaction="Compile" />
|
||||
<File name="backwardsAlias.yaml" subtype="Code" buildaction="EmbedAsResource" />
|
||||
<File name="forwardAlias.yaml" subtype="Code" buildaction="EmbedAsResource" />
|
||||
<File name="Converters" subtype="Directory" buildaction="Compile" />
|
||||
<File name="Converters/Xml" subtype="Directory" buildaction="Compile" />
|
||||
<File name="Converters/Xml/XmlConverterTests.cs" subtype="Code" buildaction="Compile" />
|
||||
</Contents>
|
||||
<References>
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
|
@ -49,5 +52,8 @@
|
|||
<ProjectReference type="Gac" localcopy="True" refto="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
|
||||
<ProjectReference type="Project" localcopy="True" refto="YamlDotNet.Core" />
|
||||
<ProjectReference type="Project" localcopy="True" refto="YamlDotNet.RepresentationModel" />
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<ProjectReference type="Project" localcopy="True" refto="YamlDotNet.Converters" />
|
||||
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</References>
|
||||
</Project>
|
|
@ -5,12 +5,14 @@
|
|||
<Entry build="True" name="YamlDotNet.UnitTests" configuration="Debug" />
|
||||
<Entry build="True" name="ExternalFiles" configuration="Default" />
|
||||
<Entry build="True" name="YamlDotNet.RepresentationModel" configuration="Debug" />
|
||||
<Entry build="True" name="YamlDotNet.Converters" configuration="Debug" />
|
||||
</Configuration>
|
||||
<Configuration name="Release" ctype="CombineConfiguration">
|
||||
<Entry build="True" name="YamlDotNet.Core" configuration="Release" />
|
||||
<Entry build="True" name="YamlDotNet.UnitTests" configuration="Release" />
|
||||
<Entry build="True" name="ExternalFiles" configuration="Default" />
|
||||
<Entry build="True" name="YamlDotNet.RepresentationModel" configuration="Release" />
|
||||
<Entry build="True" name="YamlDotNet.Converters" configuration="Release" />
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<StartMode startupentry="YamlDotNet.Core" single="True">
|
||||
|
@ -20,11 +22,13 @@
|
|||
<Execute type="None" entry="Test" />
|
||||
<Execute type="None" entry="ExternalFiles" />
|
||||
<Execute type="None" entry="YamlDotNet.RepresentationModel" />
|
||||
<Execute type="None" entry="YamlDotNet.Converters" />
|
||||
</StartMode>
|
||||
<Entries>
|
||||
<Entry filename="YamlDotNet.Core/YamlDotNet.Core.mdp" />
|
||||
<Entry filename="YamlDotNet.UnitTests/YamlDotNet.UnitTests.mdp" />
|
||||
<Entry filename="ExternalFiles/ExternalFiles.mdp" />
|
||||
<Entry filename="YamlDotNet.RepresentationModel/YamlDotNet.RepresentationModel.mdp" />
|
||||
<Entry filename="YamlDotNet.Converters/YamlDotNet.Converters.mdp" />
|
||||
</Entries>
|
||||
</Combine>
|
Загрузка…
Ссылка в новой задаче