From da142a0ade27dde377fac8b24b5f7e3edc087466 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:10:01 +0100 Subject: [PATCH 01/41] new result objects --- src/Example/Ude.Example.csproj | 6 +++- src/Example/app.config | 3 ++ src/Library/Ude.csproj | 8 +++-- src/Library/V2/DetectionResult.cs | 57 ++++++++++++++++++++++++++++++ src/Library/V2/DetectionSummary.cs | 35 ++++++++++++++++++ 5 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 src/Example/app.config create mode 100644 src/Library/V2/DetectionResult.cs create mode 100644 src/Library/V2/DetectionSummary.cs diff --git a/src/Example/Ude.Example.csproj b/src/Example/Ude.Example.csproj index 368630f..4d3b778 100644 --- a/src/Example/Ude.Example.csproj +++ b/src/Example/Ude.Example.csproj @@ -6,12 +6,13 @@ Ude.Example Debug AnyCPU - v2.0 + v3.5 2.0 + Exe @@ -52,4 +53,7 @@ Ude + + + \ No newline at end of file diff --git a/src/Example/app.config b/src/Example/app.config new file mode 100644 index 0000000..2fa6e95 --- /dev/null +++ b/src/Example/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/Library/Ude.csproj b/src/Library/Ude.csproj index 6ec22b1..e0f293c 100644 --- a/src/Library/Ude.csproj +++ b/src/Library/Ude.csproj @@ -12,12 +12,13 @@ Ude - v2.0 + v3.5 2.0 + true @@ -53,6 +54,7 @@ + @@ -94,6 +96,8 @@ + + @@ -118,8 +122,6 @@ - - diff --git a/src/Library/V2/DetectionResult.cs b/src/Library/V2/DetectionResult.cs new file mode 100644 index 0000000..1d703f1 --- /dev/null +++ b/src/Library/V2/DetectionResult.cs @@ -0,0 +1,57 @@ +using System; +using System.Text; +using Ude.Core; + +namespace Ude.V2 +{ + public class DetectionResult + { + private readonly string _encodingShortName; + + + /// + /// Initializes a new instance of the class. + /// + public DetectionResult(string encodingShortName, float confidence, CharsetProber prober, TimeSpan? time) + { + _encodingShortName = encodingShortName; + Confidence = confidence; + + try + { + Encoding = System.Text.Encoding.GetEncoding(encodingShortName); + } + catch (Exception) + { + + //wrong name + } + + Prober = prober; + Time = time; + } + + /// + /// Initializes a new instance of the class. + /// + public DetectionResult(CharsetProber prober, TimeSpan? time) + : this(prober.GetCharsetName(), prober.GetConfidence(), prober, time) + { + } + + [Obsolete("v1")] + public string Charset + { + get { return _encodingShortName; } + } + + public Encoding Encoding { get; set; } + + public float Confidence { get; set; } + + public CharsetProber Prober { get; set; } + + public TimeSpan? Time { get; set; } + + } +} diff --git a/src/Library/V2/DetectionSummary.cs b/src/Library/V2/DetectionSummary.cs new file mode 100644 index 0000000..dc48ec7 --- /dev/null +++ b/src/Library/V2/DetectionSummary.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Ude.V2 +{ + public class DetectionSummary + { + /// + /// Empty + /// + public DetectionSummary() + { + } + + /// + /// Initializes a new instance of the class. + /// + public DetectionSummary(IList allDetectionResults) + { + AllDetectionResults = allDetectionResults; + } + + public DetectionSummary(DetectionResult allDetectionResults) + { + AllDetectionResults = new List { allDetectionResults }; + } + + public DetectionResult Detected + { + get { return AllDetectionResults?.FirstOrDefault(); } + } + + public IList AllDetectionResults { set; get; } + } +} \ No newline at end of file From 089952798550638cf451434cdea298b47b86afc1 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:14:13 +0100 Subject: [PATCH 02/41] Helper method --- src/Library/Core/UniversalDetector.cs | 74 ++++++++++++++++----------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index f2f0922..47fab9e 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -165,37 +165,12 @@ public virtual void Feed(byte[] buf, int offset, int len) gotData = true; // If the data starts with BOM, we know it is UTF - if (start) { - start = false; - if (len > 3) { - switch (buf[0]) { - case 0xEF: - if (0xBB == buf[1] && 0xBF == buf[2]) - detectedCharset = "UTF-8"; - break; - case 0xFE: - if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) - // FE FF 00 00 UCS-4, unusual octet order BOM (3412) - detectedCharset = "X-ISO-10646-UCS-4-3412"; - else if (0xFF == buf[1]) - detectedCharset = "UTF-16BE"; - break; - case 0x00: - if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) - detectedCharset = "UTF-32BE"; - else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) - // 00 00 FF FE UCS-4, unusual octet order BOM (2143) - detectedCharset = "X-ISO-10646-UCS-4-2143"; - break; - case 0xFF: - if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) - detectedCharset = "UTF-32LE"; - else if (0xFE == buf[1]) - detectedCharset = "UTF-16LE"; - break; - } // switch - } - if (detectedCharset != null) { + if (start) + { + var bomSet = FindCharSetByBom(buf, len); + if (bomSet != null) + { + detectedCharset = bomSet; done = true; return; } @@ -264,6 +239,43 @@ public virtual void Feed(byte[] buf, int offset, int len) } } + private string FindCharSetByBom(byte[] buf, int len) + { + string bomSet = null; + start = false; + if (len > 3) + { + switch (buf[0]) + { + case 0xEF: + if (0xBB == buf[1] && 0xBF == buf[2]) + bomSet = "UTF-8"; + break; + case 0xFE: + if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + // FE FF 00 00 UCS-4, unusual octet order BOM (3412) + bomSet = "X-ISO-10646-UCS-4-3412"; + else if (0xFF == buf[1]) + bomSet = "UTF-16BE"; + break; + case 0x00: + if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) + bomSet = "UTF-32BE"; + else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) + // 00 00 FF FE UCS-4, unusual octet order BOM (2143) + bomSet = "X-ISO-10646-UCS-4-2143"; + break; + case 0xFF: + if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + bomSet = "UTF-32LE"; + else if (0xFE == buf[1]) + bomSet = "UTF-16LE"; + break; + } // switch + } + return bomSet; + } + /// /// Notify detector that no further data is available. /// From db37afe1f1ad8eb4b3d3a466dd0577645c0f5c42 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:15:18 +0100 Subject: [PATCH 03/41] remove reset --- src/Library/CharsetDetector.cs | 8 +------- src/Library/Core/UniversalDetector.cs | 22 +--------------------- src/Library/ICharsetDetector.cs | 5 +---- src/Tests/CharsetDetectorTestBatch.cs | 1 - 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index ad06496..1edfd52 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -95,13 +95,7 @@ public bool IsDone() { return done; } - - public override void Reset() - { - this.charset = null; - this.confidence = 0.0f; - base.Reset(); - } + public string Charset { get { return charset; } diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 47fab9e..0d1c8dd 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -318,27 +318,7 @@ public virtual void DataEnd() } } - /// - /// Clear internal state of charset detector. - /// In the original interface this method is protected. - /// - public virtual void Reset() - { - //TODO reset() should be removed with ctor call - - done = false; - start = true; - detectedCharset = null; - gotData = false; - bestGuess = -1; - inputState = InputState.PureASCII; - lastChar = 0x00; - if (escCharsetProber != null) - escCharsetProber.Reset(); - for (int i = 0; i < PROBERS_NUM; i++) - if (charsetProbers[i] != null) - charsetProbers[i].Reset(); - } + protected abstract void Report(string charset, float confidence); diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index dcdd620..009dd40 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -69,10 +69,7 @@ public interface ICharsetDetector /// an input stream void Feed(Stream stream); - /// - /// Resets the state of the detector. - /// - void Reset(); + /// /// Returns true if the detector has found a result and it is sure about it. diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/src/Tests/CharsetDetectorTestBatch.cs index 20e55cc..d64ccd5 100644 --- a/src/Tests/CharsetDetectorTestBatch.cs +++ b/src/Tests/CharsetDetectorTestBatch.cs @@ -84,7 +84,6 @@ private static void Process(string charset, string dirname) detector.Feed(fs); detector.DataEnd(); Assert.True(charset == detector.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detector.Charset, detector.Confidence)); - detector.Reset(); } } } From a024933b4ca9e84a4967f6d9cd41ae25c1f99bcd Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:16:30 +0100 Subject: [PATCH 04/41] remove unused --- src/Library/CharsetDetector.cs | 2 +- src/Library/Core/UniversalDetector.cs | 52 ++------------------------- 2 files changed, 3 insertions(+), 51 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 1edfd52..6b05cdd 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -76,7 +76,7 @@ public class CharsetDetector : UniversalDetector, ICharsetDetector //public event DetectorFinished Finished; - public CharsetDetector() : base(FILTER_ALL) + public CharsetDetector() : base() { } diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 0d1c8dd..b0b4551 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -45,47 +45,7 @@ namespace Ude.Core /// public abstract class UniversalDetector { - /// - /// TODO unused? - /// - protected const int FILTER_CHINESE_SIMPLIFIED = 1; - /// - /// TODO unused? - /// - protected const int FILTER_CHINESE_TRADITIONAL = 2; - /// - /// TODO unused? - /// - protected const int FILTER_JAPANESE = 4; - - /// - /// TODO unused? - /// - protected const int FILTER_KOREAN = 8; - - /// - /// TODO unused? - /// - protected const int FILTER_NON_CJK = 16; - - /// - /// TODO unused? (when is removed) - /// - protected const int FILTER_ALL = 31; - - /// - /// TODO unused? - /// - protected static int FILTER_CHINESE = - FILTER_CHINESE_SIMPLIFIED | FILTER_CHINESE_TRADITIONAL; - - - /// - /// TODO unused? - /// - protected static int FILTER_CJK = - FILTER_JAPANESE | FILTER_KOREAN | FILTER_CHINESE_SIMPLIFIED - | FILTER_CHINESE_TRADITIONAL; + protected const float SHORTCUT_THRESHOLD = 0.95f; protected const float MINIMUM_THRESHOLD = 0.20f; @@ -122,13 +82,6 @@ public abstract class UniversalDetector /// protected const int PROBERS_NUM = 3; - - /// - /// TODO unknown. Can be removed? - /// - protected int languageFilter; - - /// /// "list" of probers /// @@ -145,12 +98,11 @@ public abstract class UniversalDetector /// protected string detectedCharset; - protected UniversalDetector(int languageFilter) { + protected UniversalDetector() { this.start = true; this.inputState = InputState.PureASCII; this.lastChar = 0x00; this.bestGuess = -1; - this.languageFilter = languageFilter; } public virtual void Feed(byte[] buf, int offset, int len) From a1c5167b62d29c9c21971baaec588ca8e3e929bd Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:19:31 +0100 Subject: [PATCH 05/41] remove report() --- src/Library/CharsetDetector.cs | 16 ---------------- src/Library/Core/UniversalDetector.cs | 14 ++++++++++++-- src/Library/Ude.csproj.DotSettings | 2 ++ src/Library/V2/DetectionResult.cs | 2 +- src/Library/V2/DetectionSummary.cs | 2 +- 5 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 src/Library/Ude.csproj.DotSettings diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 6b05cdd..e07565d 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -96,23 +96,7 @@ public bool IsDone() return done; } - - public string Charset { - get { return charset; } - } - public float Confidence { - get { return confidence; } - } - - protected override void Report(string charset, float confidence) - { - this.charset = charset; - this.confidence = confidence; -// if (Finished != null) { -// Finished(charset, confidence); -// } - } } //public delegate void DetectorFinished(string charset, float confidence); diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index b0b4551..17467cf 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -271,8 +271,18 @@ public virtual void DataEnd() } - - protected abstract void Report(string charset, float confidence); + + protected void Report(string charset, float confidence) + { + Charset = charset; + Confidence = confidence; + } + + + public string Charset { get; set; } + + public float Confidence { get; set; } + } } diff --git a/src/Library/Ude.csproj.DotSettings b/src/Library/Ude.csproj.DotSettings new file mode 100644 index 0000000..f3bff25 --- /dev/null +++ b/src/Library/Ude.csproj.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/src/Library/V2/DetectionResult.cs b/src/Library/V2/DetectionResult.cs index 1d703f1..708804a 100644 --- a/src/Library/V2/DetectionResult.cs +++ b/src/Library/V2/DetectionResult.cs @@ -2,7 +2,7 @@ using System.Text; using Ude.Core; -namespace Ude.V2 +namespace Ude { public class DetectionResult { diff --git a/src/Library/V2/DetectionSummary.cs b/src/Library/V2/DetectionSummary.cs index dc48ec7..56a0a1b 100644 --- a/src/Library/V2/DetectionSummary.cs +++ b/src/Library/V2/DetectionSummary.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace Ude.V2 +namespace Ude { public class DetectionSummary { From d836077a50dc66e089f8db28223dce685e5f7fae Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:24:09 +0100 Subject: [PATCH 06/41] intermediate summary --- src/Library/Core/UniversalDetector.cs | 136 ++++++++++++++++---------- 1 file changed, 86 insertions(+), 50 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 17467cf..bbdd57f 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -43,9 +43,9 @@ namespace Ude.Core /// /// TODO remove protected fields /// - public abstract class UniversalDetector + public abstract class UniversalDetector { - + protected const float SHORTCUT_THRESHOLD = 0.95f; protected const float MINIMUM_THRESHOLD = 0.20f; @@ -71,7 +71,7 @@ public abstract class UniversalDetector /// Lastchar, but not always filled. TODO remove? /// protected byte lastChar; - + /// /// best guess rate between 0 and 1 (inluding) /// @@ -98,16 +98,18 @@ public abstract class UniversalDetector /// protected string detectedCharset; - protected UniversalDetector() { + protected UniversalDetector() + { this.start = true; this.inputState = InputState.PureASCII; - this.lastChar = 0x00; + this.lastChar = 0x00; this.bestGuess = -1; } public virtual void Feed(byte[] buf, int offset, int len) - { - if (done) { + { + if (done) + { return; } @@ -128,16 +130,20 @@ public virtual void Feed(byte[] buf, int offset, int len) } } - for (int i = 0; i < len; i++) { - + for (int i = 0; i < len; i++) + { + // other than 0xa0, if every other character is ascii, the page is ascii - if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) { + if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) + { // we got a non-ascii byte (high-byte) - if (inputState != InputState.Highbyte) { + if (inputState != InputState.Highbyte) + { inputState = InputState.Highbyte; // kill EscCharsetProber if it is active - if (escCharsetProber != null) { + if (escCharsetProber != null) + { escCharsetProber = null; } @@ -147,47 +153,56 @@ public virtual void Feed(byte[] buf, int offset, int len) if (charsetProbers[1] == null) charsetProbers[1] = new SBCSGroupProber(); if (charsetProbers[2] == null) - charsetProbers[2] = new Latin1Prober(); + charsetProbers[2] = new Latin1Prober(); } - } else { + } + else + { if (inputState == InputState.PureASCII && - (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) { + (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) + { // found escape character or HZ "~{" inputState = InputState.EscASCII; } lastChar = buf[i]; } } - + ProbingState st; - - switch (inputState) { + + switch (inputState) + { case InputState.EscASCII: - if (escCharsetProber == null) { + if (escCharsetProber == null) + { escCharsetProber = new EscCharsetProber(); } st = escCharsetProber.HandleData(buf, offset, len); - if (st == ProbingState.FoundIt) { + if (st == ProbingState.FoundIt) + { done = true; detectedCharset = escCharsetProber.GetCharsetName(); } break; case InputState.Highbyte: - for (int i = 0; i < PROBERS_NUM; i++) { - if (charsetProbers[i] != null) { + for (int i = 0; i < PROBERS_NUM; i++) + { + if (charsetProbers[i] != null) + { st = charsetProbers[i].HandleData(buf, offset, len); - #if DEBUG +#if DEBUG charsetProbers[i].DumpStatus(); - #endif - if (st == ProbingState.FoundIt) { +#endif + if (st == ProbingState.FoundIt) + { done = true; detectedCharset = charsetProbers[i].GetCharsetName(); return; - } + } } } break; - // else pure ascii + // else pure ascii } } @@ -233,55 +248,76 @@ private string FindCharSetByBom(byte[] buf, int len) /// public virtual void DataEnd() { - if (!gotData) { + if (!gotData) + { // we haven't got any data yet, return immediately // caller program sometimes call DataEnd before anything has // been sent to detector return; } - if (detectedCharset != null) { + if (detectedCharset != null) + { done = true; - Report(detectedCharset, 1.0f); + Report(detectedCharset, 1.0f, null); return; - } + } - if (inputState == InputState.Highbyte) { + if (inputState == InputState.Highbyte) + { float proberConfidence = 0.0f; float maxProberConfidence = 0.0f; - int maxProber = 0; - for (int i = 0; i < PROBERS_NUM; i++) { - if (charsetProbers[i] != null) { + CharsetProber maxProber = null; + for (int i = 0; i < PROBERS_NUM; i++) + { + if (charsetProbers[i] != null) + { proberConfidence = charsetProbers[i].GetConfidence(); - if (proberConfidence > maxProberConfidence) { + if (proberConfidence > maxProberConfidence) + { maxProberConfidence = proberConfidence; - maxProber = i; + maxProber = charsetProbers[i]; } } } //TODO why done isn't true? - if (maxProberConfidence > MINIMUM_THRESHOLD) { - Report(charsetProbers[maxProber].GetCharsetName(), maxProberConfidence); - } - - } else if (inputState == InputState.PureASCII) { + if (maxProberConfidence > MINIMUM_THRESHOLD) + { + Report(maxProber); + } + + } + else if (inputState == InputState.PureASCII) + { //TODO why done isn't true? - Report("ASCII", 1.0f); - } + Report("ASCII", 1.0f, null); + } } + private DetectionSummary summary; - - protected void Report(string charset, float confidence) + protected void Report(string charset, float confidence, CharsetProber prober) { - Charset = charset; - Confidence = confidence; + summary = new DetectionSummary(new DetectionResult(charset, confidence, prober, null)); + } - public string Charset { get; set; } + protected void Report(CharsetProber prober) + { + summary = new DetectionSummary(new DetectionResult(prober.GetCharsetName(), prober.GetConfidence(), prober, null)); + + } + + public string Charset + { + get { return summary.Detected.Charset; } + } - public float Confidence { get; set; } + public float Confidence + { + get { return summary.Detected.Confidence; } + } } From 05864dfdbdcf266e53588901dcc951a93e80a8d4 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:26:57 +0100 Subject: [PATCH 07/41] intermediate step --- src/Library/Core/UniversalDetector.cs | 18 ++++++++++++------ src/Library/V2/DetectionResult.cs | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index bbdd57f..8061946 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -96,7 +96,7 @@ public abstract class UniversalDetector /// /// Detected charset. Most of the time is true /// - protected string detectedCharset; + protected DetectionResult detectedCharset; protected UniversalDetector() { @@ -124,7 +124,7 @@ public virtual void Feed(byte[] buf, int offset, int len) var bomSet = FindCharSetByBom(buf, len); if (bomSet != null) { - detectedCharset = bomSet; + detectedCharset = new DetectionResult(bomSet, 1, null, null); done = true; return; } @@ -181,7 +181,7 @@ public virtual void Feed(byte[] buf, int offset, int len) if (st == ProbingState.FoundIt) { done = true; - detectedCharset = escCharsetProber.GetCharsetName(); + detectedCharset = new DetectionResult(escCharsetProber); } break; case InputState.Highbyte: @@ -196,7 +196,7 @@ public virtual void Feed(byte[] buf, int offset, int len) if (st == ProbingState.FoundIt) { done = true; - detectedCharset = charsetProbers[i].GetCharsetName(); + detectedCharset = new DetectionResult(charsetProbers[i]); return; } } @@ -259,7 +259,8 @@ public virtual void DataEnd() if (detectedCharset != null) { done = true; - Report(detectedCharset, 1.0f, null); + detectedCharset.Confidence = 1.0f; + Report(detectedCharset); return; } @@ -305,8 +306,13 @@ protected void Report(string charset, float confidence, CharsetProber prober) protected void Report(CharsetProber prober) { - summary = new DetectionSummary(new DetectionResult(prober.GetCharsetName(), prober.GetConfidence(), prober, null)); + var allDetectionResults = new DetectionResult(prober.GetCharsetName(), prober.GetConfidence(), prober, null); + Report(allDetectionResults); + } + private void Report(DetectionResult result) + { + summary = new DetectionSummary(result); } public string Charset diff --git a/src/Library/V2/DetectionResult.cs b/src/Library/V2/DetectionResult.cs index 708804a..6107203 100644 --- a/src/Library/V2/DetectionResult.cs +++ b/src/Library/V2/DetectionResult.cs @@ -12,7 +12,7 @@ public class DetectionResult /// /// Initializes a new instance of the class. /// - public DetectionResult(string encodingShortName, float confidence, CharsetProber prober, TimeSpan? time) + public DetectionResult(string encodingShortName, float confidence, CharsetProber prober = null, TimeSpan? time = null) { _encodingShortName = encodingShortName; Confidence = confidence; @@ -34,7 +34,7 @@ public DetectionResult(string encodingShortName, float confidence, CharsetProber /// /// Initializes a new instance of the class. /// - public DetectionResult(CharsetProber prober, TimeSpan? time) + public DetectionResult(CharsetProber prober, TimeSpan? time = null) : this(prober.GetCharsetName(), prober.GetConfidence(), prober, time) { } From d2ab0ca179870e4d76931be8d7395a29eba843e1 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:29:02 +0100 Subject: [PATCH 08/41] return detectionsummary --- src/Library/Core/UniversalDetector.cs | 23 ++++++++++++----------- src/Library/ICharsetDetector.cs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 8061946..d81ddfa 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -246,22 +246,21 @@ private string FindCharSetByBom(byte[] buf, int len) /// /// Notify detector that no further data is available. /// - public virtual void DataEnd() + public virtual DetectionSummary DataEnd() { if (!gotData) { // we haven't got any data yet, return immediately // caller program sometimes call DataEnd before anything has // been sent to detector - return; + return new DetectionSummary(); } if (detectedCharset != null) { done = true; detectedCharset.Confidence = 1.0f; - Report(detectedCharset); - return; + return Report(detectedCharset); } if (inputState == InputState.Highbyte) @@ -284,35 +283,37 @@ public virtual void DataEnd() //TODO why done isn't true? if (maxProberConfidence > MINIMUM_THRESHOLD) { - Report(maxProber); + return Report(maxProber); } } else if (inputState == InputState.PureASCII) { //TODO why done isn't true? - Report("ASCII", 1.0f, null); + return Report("ASCII", 1.0f, null); } + return new DetectionSummary(); } private DetectionSummary summary; - protected void Report(string charset, float confidence, CharsetProber prober) + protected DetectionSummary Report(string charset, float confidence, CharsetProber prober) { summary = new DetectionSummary(new DetectionResult(charset, confidence, prober, null)); - + return summary; } - protected void Report(CharsetProber prober) + protected DetectionSummary Report(CharsetProber prober) { var allDetectionResults = new DetectionResult(prober.GetCharsetName(), prober.GetConfidence(), prober, null); - Report(allDetectionResults); + return Report(allDetectionResults); } - private void Report(DetectionResult result) + private DetectionSummary Report(DetectionResult result) { summary = new DetectionSummary(result); + return summary; } public string Charset diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index 009dd40..e5bf0b4 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -83,7 +83,7 @@ public interface ICharsetDetector /// Tell the detector that there is no more data and it must take its /// decision. /// - void DataEnd(); + DetectionSummary DataEnd(); } } From e55a115e972f30ac2e88c8ce8580cf44decdd57d Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:32:47 +0100 Subject: [PATCH 09/41] using report --- src/Example/Udetect.cs | 24 +++++++---- src/Library/CharsetDetector.cs | 4 +- src/Library/Core/UniversalDetector.cs | 40 ++--------------- src/Library/ICharsetDetector.cs | 12 +----- src/Tests/CharsetDetectorTest.cs | 62 +++++++++++++-------------- src/Tests/CharsetDetectorTestBatch.cs | 6 ++- 6 files changed, 56 insertions(+), 92 deletions(-) diff --git a/src/Example/Udetect.cs b/src/Example/Udetect.cs index bea873d..845cd0a 100644 --- a/src/Example/Udetect.cs +++ b/src/Example/Udetect.cs @@ -17,23 +17,29 @@ public class Udetect /// a filename public static void Main(String[] args) { - if (args.Length == 0) { + if (args.Length == 0) + { Console.WriteLine("Usage: udetect "); return; } - + string filename = args[0]; - using (FileStream fs = File.OpenRead(filename)) { + using (FileStream fs = File.OpenRead(filename)) + { ICharsetDetector cdet = new CharsetDetector(); cdet.Feed(fs); - cdet.DataEnd(); - if (cdet.Charset != null) { - Console.WriteLine("Charset: {0}, confidence: {1}", - cdet.Charset, cdet.Confidence); - } else { + var result = cdet.DataEnd(); + + if (result.Detected != null) + { + Console.WriteLine("Charset: {0}, confidence: {1}", + result.Detected.Charset, result.Detected.Confidence); + } + else + { Console.WriteLine("Detection failed."); } } - } + } } } diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index e07565d..65b0def 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -70,9 +70,7 @@ namespace Ude /// public class CharsetDetector : UniversalDetector, ICharsetDetector { - private string charset; - - private float confidence; + //public event DetectorFinished Finished; diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index d81ddfa..87082b2 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -260,7 +260,7 @@ public virtual DetectionSummary DataEnd() { done = true; detectedCharset.Confidence = 1.0f; - return Report(detectedCharset); + return new DetectionSummary(detectedCharset); } if (inputState == InputState.Highbyte) @@ -283,49 +283,17 @@ public virtual DetectionSummary DataEnd() //TODO why done isn't true? if (maxProberConfidence > MINIMUM_THRESHOLD) { - return Report(maxProber); + var allDetectionResults = new DetectionResult(maxProber.GetCharsetName(), maxProber.GetConfidence(), maxProber, null); + return new DetectionSummary(allDetectionResults); } } else if (inputState == InputState.PureASCII) { //TODO why done isn't true? - return Report("ASCII", 1.0f, null); + return new DetectionSummary(new DetectionResult("ASCII", 1.0f, null, null)); } return new DetectionSummary(); } - - private DetectionSummary summary; - - protected DetectionSummary Report(string charset, float confidence, CharsetProber prober) - { - summary = new DetectionSummary(new DetectionResult(charset, confidence, prober, null)); - return summary; - } - - - protected DetectionSummary Report(CharsetProber prober) - { - var allDetectionResults = new DetectionResult(prober.GetCharsetName(), prober.GetConfidence(), prober, null); - return Report(allDetectionResults); - } - - private DetectionSummary Report(DetectionResult result) - { - summary = new DetectionSummary(result); - return summary; - } - - public string Charset - { - get { return summary.Detected.Charset; } - } - - public float Confidence - { - get { return summary.Detected.Confidence; } - } - - } } diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index e5bf0b4..6ff1679 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -43,17 +43,7 @@ namespace Ude public interface ICharsetDetector { - /// - /// The detected charset. It can be null. - /// - string Charset { get; } - - /// - /// The confidence of the detected charset, if any. - /// - /// Between 0 and 1 (including) - /// - float Confidence { get; } + /// /// Feed a block of bytes to the detector. diff --git a/src/Tests/CharsetDetectorTest.cs b/src/Tests/CharsetDetectorTest.cs index 0a29fc4..ff06eba 100644 --- a/src/Tests/CharsetDetectorTest.cs +++ b/src/Tests/CharsetDetectorTest.cs @@ -28,9 +28,9 @@ public void TestASCII() using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(s))) { detector.Feed(ms); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.ASCII, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } } @@ -44,32 +44,32 @@ public void TestUTF8_1() "利用案内でどうぞ。"; byte[] buf = Encoding.UTF8.GetBytes(s); detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF8, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF8, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF8() { var detector = new CharsetDetector(); - byte[] buf = {0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21}; + byte[] buf = { 0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21 }; detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF8, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF8, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF16_BE() { var detector = new CharsetDetector(); - byte[] buf = {0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65}; + byte[] buf = { 0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65 }; detector = new CharsetDetector(); detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF16_BE, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF16_BE, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] @@ -100,33 +100,33 @@ public void TestBomX_ISO_10646_UCS_4_2143() public void TestBomUTF16_LE() { var detector = new CharsetDetector(); - byte[] buf = {0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00}; + byte[] buf = { 0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00 }; detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF16_LE, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF16_LE, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF32_BE() { var detector = new CharsetDetector(); - byte[] buf = {0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68}; + byte[] buf = { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68 }; detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF32_BE, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF32_BE, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF32_LE() { var detector = new CharsetDetector(); - byte[] buf = {0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00}; + byte[] buf = { 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00 }; detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.UTF32_LE, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.UTF32_LE, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] @@ -135,9 +135,9 @@ public void TestIssue3() var detector = new CharsetDetector(); byte[] buf = Encoding.UTF8.GetBytes("3"); detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = detector.DataEnd(); + Assert.Equal(Charsets.ASCII, result.Detected.Charset); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] @@ -149,7 +149,7 @@ public void TestOutOfRange() detector.DataEnd(); Assert.Equal(Charsets.ASCII, detector.Charset); Assert.Equal(1.0f, detector.Confidence); - } + } [Fact] public void TestOutOfRange2() @@ -160,7 +160,7 @@ public void TestOutOfRange2() detector.DataEnd(); Assert.Equal(Charsets.ASCII, detector.Charset); Assert.Equal(1.0f, detector.Confidence); - } +} [Fact] public void TestEmpty() diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/src/Tests/CharsetDetectorTestBatch.cs index d64ccd5..c1f0009 100644 --- a/src/Tests/CharsetDetectorTestBatch.cs +++ b/src/Tests/CharsetDetectorTestBatch.cs @@ -82,8 +82,10 @@ private static void Process(string charset, string dirname) var detector = new CharsetDetector(); detector.Feed(fs); - detector.DataEnd(); - Assert.True(charset == detector.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detector.Charset, detector.Confidence)); + var result = detector.DataEnd(); + var detected = result.Detected; + Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); + } } } From 4e5ef11adccb1e6610138176b61051b6e31d694d Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:34:21 +0100 Subject: [PATCH 10/41] static --- src/Library/Core/UniversalDetector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 87082b2..699c447 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -122,6 +122,7 @@ public virtual void Feed(byte[] buf, int offset, int len) if (start) { var bomSet = FindCharSetByBom(buf, len); + start = false; if (bomSet != null) { detectedCharset = new DetectionResult(bomSet, 1, null, null); @@ -206,10 +207,9 @@ public virtual void Feed(byte[] buf, int offset, int len) } } - private string FindCharSetByBom(byte[] buf, int len) + private static string FindCharSetByBom(byte[] buf, int len) { string bomSet = null; - start = false; if (len > 3) { switch (buf[0]) From 1abc27c4e3ba28d2e93b109a3b613e788af1f9fe Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:34:48 +0100 Subject: [PATCH 11/41] cleanup --- src/Library/Core/UniversalDetector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 699c447..3f833a1 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -283,7 +283,7 @@ public virtual DetectionSummary DataEnd() //TODO why done isn't true? if (maxProberConfidence > MINIMUM_THRESHOLD) { - var allDetectionResults = new DetectionResult(maxProber.GetCharsetName(), maxProber.GetConfidence(), maxProber, null); + var allDetectionResults = new DetectionResult(maxProber); return new DetectionSummary(allDetectionResults); } From af002cdb14a2a7a24875b98fc8adda51089a2fb0 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:41:46 +0100 Subject: [PATCH 12/41] intermediate --- src/Library/Core/UniversalDetector.cs | 29 ++++++++++++--------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 3f833a1..f359bc3 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -36,7 +36,8 @@ * * ***** END LICENSE BLOCK ***** */ -using System; +using System.Collections.Generic; +using System.Linq; namespace Ude.Core { @@ -265,27 +266,23 @@ public virtual DetectionSummary DataEnd() if (inputState == InputState.Highbyte) { - float proberConfidence = 0.0f; - float maxProberConfidence = 0.0f; - CharsetProber maxProber = null; + var list = new List(PROBERS_NUM); for (int i = 0; i < PROBERS_NUM; i++) { - if (charsetProbers[i] != null) + var charsetProber = charsetProbers[i]; + + if (charsetProber != null) { - proberConfidence = charsetProbers[i].GetConfidence(); - if (proberConfidence > maxProberConfidence) - { - maxProberConfidence = proberConfidence; - maxProber = charsetProbers[i]; - } + list.Add(new DetectionResult(charsetProber)); } } + + var detectionResults = list.Where(p => p.Confidence > MINIMUM_THRESHOLD).OrderByDescending(p => p.Confidence).ToList(); + + return new DetectionSummary(detectionResults); + //TODO why done isn't true? - if (maxProberConfidence > MINIMUM_THRESHOLD) - { - var allDetectionResults = new DetectionResult(maxProber); - return new DetectionSummary(allDetectionResults); - } + } else if (inputState == InputState.PureASCII) From f15ee04dc73493703bff0a53c4f8ff5b7e250659 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:43:36 +0100 Subject: [PATCH 13/41] cleanup --- src/Library/Core/UniversalDetector.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index f359bc3..71ef717 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -170,7 +170,7 @@ public virtual void Feed(byte[] buf, int offset, int len) } } - ProbingState st; + ProbingState probingState; switch (inputState) { @@ -179,8 +179,8 @@ public virtual void Feed(byte[] buf, int offset, int len) { escCharsetProber = new EscCharsetProber(); } - st = escCharsetProber.HandleData(buf, offset, len); - if (st == ProbingState.FoundIt) + probingState = escCharsetProber.HandleData(buf, offset, len); + if (probingState == ProbingState.FoundIt) { done = true; detectedCharset = new DetectionResult(escCharsetProber); @@ -189,16 +189,18 @@ public virtual void Feed(byte[] buf, int offset, int len) case InputState.Highbyte: for (int i = 0; i < PROBERS_NUM; i++) { - if (charsetProbers[i] != null) + var charsetProber = charsetProbers[i]; + + if (charsetProber != null) { - st = charsetProbers[i].HandleData(buf, offset, len); + probingState = charsetProber.HandleData(buf, offset, len); #if DEBUG charsetProbers[i].DumpStatus(); #endif - if (st == ProbingState.FoundIt) + if (probingState == ProbingState.FoundIt) { done = true; - detectedCharset = new DetectionResult(charsetProbers[i]); + detectedCharset = new DetectionResult(charsetProber); return; } } From 68edab0edb3d63fa0fb7c00880352da2dceb563e Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:45:25 +0100 Subject: [PATCH 14/41] renames --- src/Library/Core/UniversalDetector.cs | 16 ++++++++-------- src/Library/V2/DetectionSummary.cs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 71ef717..4b5aad4 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -64,7 +64,7 @@ public abstract class UniversalDetector protected bool gotData; /// - /// Most of the time true of is set. TODO not always + /// Most of the time true of is set. TODO not always /// protected bool done; @@ -97,7 +97,7 @@ public abstract class UniversalDetector /// /// Detected charset. Most of the time is true /// - protected DetectionResult detectedCharset; + protected DetectionResult detectionResult; protected UniversalDetector() { @@ -126,7 +126,7 @@ public virtual void Feed(byte[] buf, int offset, int len) start = false; if (bomSet != null) { - detectedCharset = new DetectionResult(bomSet, 1, null, null); + detectionResult = new DetectionResult(bomSet, 1, null, null); done = true; return; } @@ -183,7 +183,7 @@ public virtual void Feed(byte[] buf, int offset, int len) if (probingState == ProbingState.FoundIt) { done = true; - detectedCharset = new DetectionResult(escCharsetProber); + detectionResult = new DetectionResult(escCharsetProber); } break; case InputState.Highbyte: @@ -200,7 +200,7 @@ public virtual void Feed(byte[] buf, int offset, int len) if (probingState == ProbingState.FoundIt) { done = true; - detectedCharset = new DetectionResult(charsetProber); + detectionResult = new DetectionResult(charsetProber); return; } } @@ -259,11 +259,11 @@ public virtual DetectionSummary DataEnd() return new DetectionSummary(); } - if (detectedCharset != null) + if (detectionResult != null) { done = true; - detectedCharset.Confidence = 1.0f; - return new DetectionSummary(detectedCharset); + detectionResult.Confidence = 1.0f; + return new DetectionSummary(detectionResult); } if (inputState == InputState.Highbyte) diff --git a/src/Library/V2/DetectionSummary.cs b/src/Library/V2/DetectionSummary.cs index 56a0a1b..f67049f 100644 --- a/src/Library/V2/DetectionSummary.cs +++ b/src/Library/V2/DetectionSummary.cs @@ -20,9 +20,9 @@ public DetectionSummary(IList allDetectionResults) AllDetectionResults = allDetectionResults; } - public DetectionSummary(DetectionResult allDetectionResults) + public DetectionSummary(DetectionResult detectionResult) { - AllDetectionResults = new List { allDetectionResults }; + AllDetectionResults = new List { detectionResult }; } public DetectionResult Detected From efd95e4724a139ced37eb3dbad48ec788fca3991 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:45:47 +0100 Subject: [PATCH 15/41] todo added --- src/Library/Core/UniversalDetector.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 4b5aad4..8238f93 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -262,6 +262,8 @@ public virtual DetectionSummary DataEnd() if (detectionResult != null) { done = true; + + //conf 1.0 is from v1.0 (todo wrong?) detectionResult.Confidence = 1.0f; return new DetectionSummary(detectionResult); } From c3bf722965298e1e6029a6c82ed86b262b410858 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:47:55 +0100 Subject: [PATCH 16/41] refactor --- src/Library/Core/UniversalDetector.cs | 78 ++++++++++++++------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 8238f93..100df6a 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -132,43 +132,7 @@ public virtual void Feed(byte[] buf, int offset, int len) } } - for (int i = 0; i < len; i++) - { - - // other than 0xa0, if every other character is ascii, the page is ascii - if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) - { - // we got a non-ascii byte (high-byte) - if (inputState != InputState.Highbyte) - { - inputState = InputState.Highbyte; - - // kill EscCharsetProber if it is active - if (escCharsetProber != null) - { - escCharsetProber = null; - } - - // start multibyte and singlebyte charset prober - if (charsetProbers[0] == null) - charsetProbers[0] = new MBCSGroupProber(); - if (charsetProbers[1] == null) - charsetProbers[1] = new SBCSGroupProber(); - if (charsetProbers[2] == null) - charsetProbers[2] = new Latin1Prober(); - } - } - else - { - if (inputState == InputState.PureASCII && - (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) - { - // found escape character or HZ "~{" - inputState = InputState.EscASCII; - } - lastChar = buf[i]; - } - } + FindInputState(buf, len); ProbingState probingState; @@ -210,6 +174,46 @@ public virtual void Feed(byte[] buf, int offset, int len) } } + private void FindInputState(byte[] buf, int len) + { + for (int i = 0; i < len; i++) + { + // other than 0xa0, if every other character is ascii, the page is ascii + if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) + { + // we got a non-ascii byte (high-byte) + if (inputState != InputState.Highbyte) + { + inputState = InputState.Highbyte; + + // kill EscCharsetProber if it is active + if (escCharsetProber != null) + { + escCharsetProber = null; + } + + // start multibyte and singlebyte charset prober + if (charsetProbers[0] == null) + charsetProbers[0] = new MBCSGroupProber(); + if (charsetProbers[1] == null) + charsetProbers[1] = new SBCSGroupProber(); + if (charsetProbers[2] == null) + charsetProbers[2] = new Latin1Prober(); + } + } + else + { + if (inputState == InputState.PureASCII && + (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) + { + // found escape character or HZ "~{" + inputState = InputState.EscASCII; + } + lastChar = buf[i]; + } + } + } + private static string FindCharSetByBom(byte[] buf, int len) { string bomSet = null; From 55d531faf1b777f5499aaffbd0d5562e97035b7b Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:54:17 +0100 Subject: [PATCH 17/41] extract method, remove duplicate code --- src/Library/Core/UniversalDetector.cs | 36 +++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 100df6a..6b5cee4 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -143,12 +143,9 @@ public virtual void Feed(byte[] buf, int offset, int len) { escCharsetProber = new EscCharsetProber(); } - probingState = escCharsetProber.HandleData(buf, offset, len); - if (probingState == ProbingState.FoundIt) - { - done = true; - detectionResult = new DetectionResult(escCharsetProber); - } + + RunProber(buf, offset, len, escCharsetProber); + break; case InputState.Highbyte: for (int i = 0; i < PROBERS_NUM; i++) @@ -157,16 +154,8 @@ public virtual void Feed(byte[] buf, int offset, int len) if (charsetProber != null) { - probingState = charsetProber.HandleData(buf, offset, len); -#if DEBUG - charsetProbers[i].DumpStatus(); -#endif - if (probingState == ProbingState.FoundIt) - { - done = true; - detectionResult = new DetectionResult(charsetProber); - return; - } + var found = RunProber(buf, offset, len, charsetProber); + if (found) return; } } break; @@ -174,6 +163,21 @@ public virtual void Feed(byte[] buf, int offset, int len) } } + private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetProber) + { + var probingState = charsetProber.HandleData(buf, offset, len); +#if DEBUG + charsetProbers[i].DumpStatus(); +#endif + if (probingState == ProbingState.FoundIt) + { + done = true; + detectionResult = new DetectionResult(charsetProber); + return true; + } + return false; + } + private void FindInputState(byte[] buf, int len) { for (int i = 0; i < len; i++) From ca89654e022a05c99dec946aedc3252bbad5bd12 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:55:29 +0100 Subject: [PATCH 18/41] remove unused --- src/Library/Core/UniversalDetector.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 6b5cee4..714c5a8 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -73,10 +73,7 @@ public abstract class UniversalDetector /// protected byte lastChar; - /// - /// best guess rate between 0 and 1 (inluding) - /// - protected int bestGuess; + /// /// tries @@ -104,7 +101,6 @@ protected UniversalDetector() this.start = true; this.inputState = InputState.PureASCII; this.lastChar = 0x00; - this.bestGuess = -1; } public virtual void Feed(byte[] buf, int offset, int len) @@ -134,8 +130,6 @@ public virtual void Feed(byte[] buf, int offset, int len) FindInputState(buf, len); - ProbingState probingState; - switch (inputState) { case InputState.EscASCII: From 47685d56f9ab158a5388e0385f1f055813c301d4 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 13:58:16 +0100 Subject: [PATCH 19/41] cleanup --- src/Library/Core/UniversalDetector.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs index 714c5a8..b0f1103 100644 --- a/src/Library/Core/UniversalDetector.cs +++ b/src/Library/Core/UniversalDetector.cs @@ -122,7 +122,7 @@ public virtual void Feed(byte[] buf, int offset, int len) start = false; if (bomSet != null) { - detectionResult = new DetectionResult(bomSet, 1, null, null); + detectionResult = new DetectionResult(bomSet, 1); done = true; return; } @@ -133,10 +133,8 @@ public virtual void Feed(byte[] buf, int offset, int len) switch (inputState) { case InputState.EscASCII: - if (escCharsetProber == null) - { - escCharsetProber = new EscCharsetProber(); - } + + escCharsetProber = escCharsetProber ?? new EscCharsetProber(); RunProber(buf, offset, len, escCharsetProber); From 7850bc29fa82b53e25642eb0395818229269b990 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:00:59 +0100 Subject: [PATCH 20/41] removed universalDetector --- src/Library/CharsetDetector.cs | 250 ++++++++++++++++++++- src/Library/Core/UniversalDetector.cs | 300 -------------------------- src/Library/Ude.csproj | 1 - 3 files changed, 243 insertions(+), 308 deletions(-) delete mode 100644 src/Library/Core/UniversalDetector.cs diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 65b0def..6855ef1 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -36,8 +36,9 @@ * * ***** END LICENSE BLOCK ***** */ +using System.Collections.Generic; using System.IO; - +using System.Linq; using Ude.Core; namespace Ude @@ -68,15 +69,60 @@ namespace Ude /// /// /// - public class CharsetDetector : UniversalDetector, ICharsetDetector + public class CharsetDetector : ICharsetDetector { - - + internal InputState inputState; + + /// + /// Start of the file + /// + protected bool start; + + /// + /// De byte array has data? + /// + protected bool gotData; + + /// + /// Most of the time true of is set. TODO not always + /// + protected bool done; + + /// + /// Lastchar, but not always filled. TODO remove? + /// + protected byte lastChar; + + /// + /// "list" of probers + /// + protected CharsetProber[] charsetProbers = new CharsetProber[PROBERS_NUM]; + + /// + /// TODO unknown + /// + protected CharsetProber escCharsetProber; + + /// + /// Detected charset. Most of the time is true + /// + protected DetectionResult detectionResult; + + protected const float SHORTCUT_THRESHOLD = 0.95f; + protected const float MINIMUM_THRESHOLD = 0.20f; + + /// + /// tries + /// + protected const int PROBERS_NUM = 3; + //public event DetectorFinished Finished; - public CharsetDetector() : base() + public CharsetDetector() { - + this.start = true; + this.inputState = InputState.PureASCII; + this.lastChar = 0x00; } public void Feed(Stream stream) @@ -93,8 +139,198 @@ public bool IsDone() { return done; } - + public virtual void Feed(byte[] buf, int offset, int len) + { + if (done) + { + return; + } + + if (len > 0) + gotData = true; + + // If the data starts with BOM, we know it is UTF + if (start) + { + var bomSet = FindCharSetByBom(buf, len); + start = false; + if (bomSet != null) + { + detectionResult = new DetectionResult(bomSet, 1); + done = true; + return; + } + } + + FindInputState(buf, len); + + switch (inputState) + { + case InputState.EscASCII: + + escCharsetProber = escCharsetProber ?? new EscCharsetProber(); + + RunProber(buf, offset, len, escCharsetProber); + + break; + case InputState.Highbyte: + for (int i = 0; i < PROBERS_NUM; i++) + { + var charsetProber = charsetProbers[i]; + + if (charsetProber != null) + { + var found = RunProber(buf, offset, len, charsetProber); + if (found) return; + } + } + break; + // else pure ascii + } + } + + private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetProber) + { + var probingState = charsetProber.HandleData(buf, offset, len); +#if DEBUG + charsetProbers[i].DumpStatus(); +#endif + if (probingState == ProbingState.FoundIt) + { + done = true; + detectionResult = new DetectionResult(charsetProber); + return true; + } + return false; + } + + private void FindInputState(byte[] buf, int len) + { + for (int i = 0; i < len; i++) + { + // other than 0xa0, if every other character is ascii, the page is ascii + if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) + { + // we got a non-ascii byte (high-byte) + if (inputState != InputState.Highbyte) + { + inputState = InputState.Highbyte; + + // kill EscCharsetProber if it is active + if (escCharsetProber != null) + { + escCharsetProber = null; + } + + // start multibyte and singlebyte charset prober + if (charsetProbers[0] == null) + charsetProbers[0] = new MBCSGroupProber(); + if (charsetProbers[1] == null) + charsetProbers[1] = new SBCSGroupProber(); + if (charsetProbers[2] == null) + charsetProbers[2] = new Latin1Prober(); + } + } + else + { + if (inputState == InputState.PureASCII && + (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) + { + // found escape character or HZ "~{" + inputState = InputState.EscASCII; + } + lastChar = buf[i]; + } + } + } + + private static string FindCharSetByBom(byte[] buf, int len) + { + string bomSet = null; + if (len > 3) + { + switch (buf[0]) + { + case 0xEF: + if (0xBB == buf[1] && 0xBF == buf[2]) + bomSet = "UTF-8"; + break; + case 0xFE: + if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + // FE FF 00 00 UCS-4, unusual octet order BOM (3412) + bomSet = "X-ISO-10646-UCS-4-3412"; + else if (0xFF == buf[1]) + bomSet = "UTF-16BE"; + break; + case 0x00: + if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) + bomSet = "UTF-32BE"; + else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) + // 00 00 FF FE UCS-4, unusual octet order BOM (2143) + bomSet = "X-ISO-10646-UCS-4-2143"; + break; + case 0xFF: + if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + bomSet = "UTF-32LE"; + else if (0xFE == buf[1]) + bomSet = "UTF-16LE"; + break; + } // switch + } + return bomSet; + } + + /// + /// Notify detector that no further data is available. + /// + public virtual DetectionSummary DataEnd() + { + if (!gotData) + { + // we haven't got any data yet, return immediately + // caller program sometimes call DataEnd before anything has + // been sent to detector + return new DetectionSummary(); + } + + if (detectionResult != null) + { + done = true; + + //conf 1.0 is from v1.0 (todo wrong?) + detectionResult.Confidence = 1.0f; + return new DetectionSummary(detectionResult); + } + + if (inputState == InputState.Highbyte) + { + var list = new List(PROBERS_NUM); + for (int i = 0; i < PROBERS_NUM; i++) + { + var charsetProber = charsetProbers[i]; + + if (charsetProber != null) + { + list.Add(new DetectionResult(charsetProber)); + } + } + + var detectionResults = list.Where(p => p.Confidence > MINIMUM_THRESHOLD).OrderByDescending(p => p.Confidence).ToList(); + + return new DetectionSummary(detectionResults); + + //TODO why done isn't true? + + + } + else if (inputState == InputState.PureASCII) + { + //TODO why done isn't true? + return new DetectionSummary(new DetectionResult("ASCII", 1.0f, null, null)); + } + return new DetectionSummary(); + } } //public delegate void DetectorFinished(string charset, float confidence); diff --git a/src/Library/Core/UniversalDetector.cs b/src/Library/Core/UniversalDetector.cs deleted file mode 100644 index b0f1103..0000000 --- a/src/Library/Core/UniversalDetector.cs +++ /dev/null @@ -1,300 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Universal charset detector code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Shy Shalom - * Rudi Pettazzi (C# port) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -using System.Collections.Generic; -using System.Linq; - -namespace Ude.Core -{ - /// - /// TODO remove protected fields - /// - public abstract class UniversalDetector - { - - - protected const float SHORTCUT_THRESHOLD = 0.95f; - protected const float MINIMUM_THRESHOLD = 0.20f; - - internal InputState inputState; - - /// - /// Start of the file - /// - protected bool start; - - /// - /// De byte array has data? - /// - protected bool gotData; - - /// - /// Most of the time true of is set. TODO not always - /// - protected bool done; - - /// - /// Lastchar, but not always filled. TODO remove? - /// - protected byte lastChar; - - - - /// - /// tries - /// - protected const int PROBERS_NUM = 3; - - /// - /// "list" of probers - /// - protected CharsetProber[] charsetProbers = new CharsetProber[PROBERS_NUM]; - - - /// - /// TODO unknown - /// - protected CharsetProber escCharsetProber; - - /// - /// Detected charset. Most of the time is true - /// - protected DetectionResult detectionResult; - - protected UniversalDetector() - { - this.start = true; - this.inputState = InputState.PureASCII; - this.lastChar = 0x00; - } - - public virtual void Feed(byte[] buf, int offset, int len) - { - if (done) - { - return; - } - - len = Math.Min(len, buf.Length); - - if (len > 0) - gotData = true; - - // If the data starts with BOM, we know it is UTF - if (start) - { - var bomSet = FindCharSetByBom(buf, len); - start = false; - if (bomSet != null) - { - detectionResult = new DetectionResult(bomSet, 1); - done = true; - return; - } - } - - FindInputState(buf, len); - - switch (inputState) - { - case InputState.EscASCII: - - escCharsetProber = escCharsetProber ?? new EscCharsetProber(); - - RunProber(buf, offset, len, escCharsetProber); - - break; - case InputState.Highbyte: - for (int i = 0; i < PROBERS_NUM; i++) - { - var charsetProber = charsetProbers[i]; - - if (charsetProber != null) - { - var found = RunProber(buf, offset, len, charsetProber); - if (found) return; - } - } - break; - // else pure ascii - } - } - - private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetProber) - { - var probingState = charsetProber.HandleData(buf, offset, len); -#if DEBUG - charsetProbers[i].DumpStatus(); -#endif - if (probingState == ProbingState.FoundIt) - { - done = true; - detectionResult = new DetectionResult(charsetProber); - return true; - } - return false; - } - - private void FindInputState(byte[] buf, int len) - { - for (int i = 0; i < len; i++) - { - // other than 0xa0, if every other character is ascii, the page is ascii - if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) - { - // we got a non-ascii byte (high-byte) - if (inputState != InputState.Highbyte) - { - inputState = InputState.Highbyte; - - // kill EscCharsetProber if it is active - if (escCharsetProber != null) - { - escCharsetProber = null; - } - - // start multibyte and singlebyte charset prober - if (charsetProbers[0] == null) - charsetProbers[0] = new MBCSGroupProber(); - if (charsetProbers[1] == null) - charsetProbers[1] = new SBCSGroupProber(); - if (charsetProbers[2] == null) - charsetProbers[2] = new Latin1Prober(); - } - } - else - { - if (inputState == InputState.PureASCII && - (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) - { - // found escape character or HZ "~{" - inputState = InputState.EscASCII; - } - lastChar = buf[i]; - } - } - } - - private static string FindCharSetByBom(byte[] buf, int len) - { - string bomSet = null; - if (len > 3) - { - switch (buf[0]) - { - case 0xEF: - if (0xBB == buf[1] && 0xBF == buf[2]) - bomSet = "UTF-8"; - break; - case 0xFE: - if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) - // FE FF 00 00 UCS-4, unusual octet order BOM (3412) - bomSet = "X-ISO-10646-UCS-4-3412"; - else if (0xFF == buf[1]) - bomSet = "UTF-16BE"; - break; - case 0x00: - if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) - bomSet = "UTF-32BE"; - else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) - // 00 00 FF FE UCS-4, unusual octet order BOM (2143) - bomSet = "X-ISO-10646-UCS-4-2143"; - break; - case 0xFF: - if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) - bomSet = "UTF-32LE"; - else if (0xFE == buf[1]) - bomSet = "UTF-16LE"; - break; - } // switch - } - return bomSet; - } - - /// - /// Notify detector that no further data is available. - /// - public virtual DetectionSummary DataEnd() - { - if (!gotData) - { - // we haven't got any data yet, return immediately - // caller program sometimes call DataEnd before anything has - // been sent to detector - return new DetectionSummary(); - } - - if (detectionResult != null) - { - done = true; - - //conf 1.0 is from v1.0 (todo wrong?) - detectionResult.Confidence = 1.0f; - return new DetectionSummary(detectionResult); - } - - if (inputState == InputState.Highbyte) - { - var list = new List(PROBERS_NUM); - for (int i = 0; i < PROBERS_NUM; i++) - { - var charsetProber = charsetProbers[i]; - - if (charsetProber != null) - { - list.Add(new DetectionResult(charsetProber)); - } - } - - var detectionResults = list.Where(p => p.Confidence > MINIMUM_THRESHOLD).OrderByDescending(p => p.Confidence).ToList(); - - return new DetectionSummary(detectionResults); - - //TODO why done isn't true? - - - } - else if (inputState == InputState.PureASCII) - { - //TODO why done isn't true? - return new DetectionSummary(new DetectionResult("ASCII", 1.0f, null, null)); - } - return new DetectionSummary(); - } - } -} diff --git a/src/Library/Ude.csproj b/src/Library/Ude.csproj index e0f293c..4b3e96b 100644 --- a/src/Library/Ude.csproj +++ b/src/Library/Ude.csproj @@ -98,7 +98,6 @@ - From 644f16a76ebb64281629434fbf150695830fae49 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:01:53 +0100 Subject: [PATCH 21/41] protected fields => gone --- src/Library/CharsetDetector.cs | 113 +++++++++++++++++---------------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 6855ef1..32bc6f6 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -21,6 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) + * J. Verdurmen * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -71,65 +72,65 @@ namespace Ude /// public class CharsetDetector : ICharsetDetector { - internal InputState inputState; + internal InputState InputState; /// /// Start of the file /// - protected bool start; + private bool _start; /// /// De byte array has data? /// - protected bool gotData; + private bool _gotData; /// - /// Most of the time true of is set. TODO not always + /// Most of the time true of is set. TODO not always /// - protected bool done; + private bool _done; /// /// Lastchar, but not always filled. TODO remove? /// - protected byte lastChar; + private byte _lastChar; /// /// "list" of probers /// - protected CharsetProber[] charsetProbers = new CharsetProber[PROBERS_NUM]; + private CharsetProber[] _charsetProbers = new CharsetProber[ProbersNum]; /// /// TODO unknown /// - protected CharsetProber escCharsetProber; + private CharsetProber _escCharsetProber; /// - /// Detected charset. Most of the time is true + /// Detected charset. Most of the time is true /// - protected DetectionResult detectionResult; + private DetectionResult _detectionResult; - protected const float SHORTCUT_THRESHOLD = 0.95f; - protected const float MINIMUM_THRESHOLD = 0.20f; + private const float ShortcutThreshold = 0.95f; + private const float MinimumThreshold = 0.20f; /// /// tries /// - protected const int PROBERS_NUM = 3; + private const int ProbersNum = 3; //public event DetectorFinished Finished; public CharsetDetector() { - this.start = true; - this.inputState = InputState.PureASCII; - this.lastChar = 0x00; + this._start = true; + this.InputState = InputState.PureASCII; + this._lastChar = 0x00; } public void Feed(Stream stream) { byte[] buff = new byte[1024]; int read; - while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !done) + while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !_done) { Feed(buff, 0, read); } @@ -137,47 +138,47 @@ public void Feed(Stream stream) public bool IsDone() { - return done; + return _done; } public virtual void Feed(byte[] buf, int offset, int len) { - if (done) + if (_done) { return; } if (len > 0) - gotData = true; + _gotData = true; // If the data starts with BOM, we know it is UTF - if (start) + if (_start) { var bomSet = FindCharSetByBom(buf, len); - start = false; + _start = false; if (bomSet != null) { - detectionResult = new DetectionResult(bomSet, 1); - done = true; + _detectionResult = new DetectionResult(bomSet, 1); + _done = true; return; } } FindInputState(buf, len); - switch (inputState) + switch (InputState) { case InputState.EscASCII: - escCharsetProber = escCharsetProber ?? new EscCharsetProber(); + _escCharsetProber = _escCharsetProber ?? new EscCharsetProber(); - RunProber(buf, offset, len, escCharsetProber); + RunProber(buf, offset, len, _escCharsetProber); break; case InputState.Highbyte: - for (int i = 0; i < PROBERS_NUM; i++) + for (int i = 0; i < ProbersNum; i++) { - var charsetProber = charsetProbers[i]; + var charsetProber = _charsetProbers[i]; if (charsetProber != null) { @@ -198,8 +199,8 @@ private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetPro #endif if (probingState == ProbingState.FoundIt) { - done = true; - detectionResult = new DetectionResult(charsetProber); + _done = true; + _detectionResult = new DetectionResult(charsetProber); return true; } return false; @@ -213,34 +214,34 @@ private void FindInputState(byte[] buf, int len) if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) { // we got a non-ascii byte (high-byte) - if (inputState != InputState.Highbyte) + if (InputState != InputState.Highbyte) { - inputState = InputState.Highbyte; + InputState = InputState.Highbyte; // kill EscCharsetProber if it is active - if (escCharsetProber != null) + if (_escCharsetProber != null) { - escCharsetProber = null; + _escCharsetProber = null; } // start multibyte and singlebyte charset prober - if (charsetProbers[0] == null) - charsetProbers[0] = new MBCSGroupProber(); - if (charsetProbers[1] == null) - charsetProbers[1] = new SBCSGroupProber(); - if (charsetProbers[2] == null) - charsetProbers[2] = new Latin1Prober(); + if (_charsetProbers[0] == null) + _charsetProbers[0] = new MBCSGroupProber(); + if (_charsetProbers[1] == null) + _charsetProbers[1] = new SBCSGroupProber(); + if (_charsetProbers[2] == null) + _charsetProbers[2] = new Latin1Prober(); } } else { - if (inputState == InputState.PureASCII && - (buf[i] == 0x1B || (buf[i] == 0x7B && lastChar == 0x7E))) + if (InputState == InputState.PureASCII && + (buf[i] == 0x1B || (buf[i] == 0x7B && _lastChar == 0x7E))) { // found escape character or HZ "~{" - inputState = InputState.EscASCII; + InputState = InputState.EscASCII; } - lastChar = buf[i]; + _lastChar = buf[i]; } } } @@ -286,7 +287,7 @@ private static string FindCharSetByBom(byte[] buf, int len) /// public virtual DetectionSummary DataEnd() { - if (!gotData) + if (!_gotData) { // we haven't got any data yet, return immediately // caller program sometimes call DataEnd before anything has @@ -294,21 +295,21 @@ public virtual DetectionSummary DataEnd() return new DetectionSummary(); } - if (detectionResult != null) + if (_detectionResult != null) { - done = true; + _done = true; //conf 1.0 is from v1.0 (todo wrong?) - detectionResult.Confidence = 1.0f; - return new DetectionSummary(detectionResult); + _detectionResult.Confidence = 1.0f; + return new DetectionSummary(_detectionResult); } - if (inputState == InputState.Highbyte) + if (InputState == InputState.Highbyte) { - var list = new List(PROBERS_NUM); - for (int i = 0; i < PROBERS_NUM; i++) + var list = new List(ProbersNum); + for (int i = 0; i < ProbersNum; i++) { - var charsetProber = charsetProbers[i]; + var charsetProber = _charsetProbers[i]; if (charsetProber != null) { @@ -316,7 +317,7 @@ public virtual DetectionSummary DataEnd() } } - var detectionResults = list.Where(p => p.Confidence > MINIMUM_THRESHOLD).OrderByDescending(p => p.Confidence).ToList(); + var detectionResults = list.Where(p => p.Confidence > MinimumThreshold).OrderByDescending(p => p.Confidence).ToList(); return new DetectionSummary(detectionResults); @@ -324,7 +325,7 @@ public virtual DetectionSummary DataEnd() } - else if (inputState == InputState.PureASCII) + else if (InputState == InputState.PureASCII) { //TODO why done isn't true? return new DetectionSummary(new DetectionResult("ASCII", 1.0f, null, null)); From 1ab718fb0ccda07e98affbc9988158eab20df0db Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:02:21 +0100 Subject: [PATCH 22/41] removed isdone() --- src/Library/CharsetDetector.cs | 5 ----- src/Library/ICharsetDetector.cs | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 32bc6f6..4096bcb 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -135,11 +135,6 @@ public void Feed(Stream stream) Feed(buff, 0, read); } } - - public bool IsDone() - { - return _done; - } public virtual void Feed(byte[] buf, int offset, int len) { diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index 6ff1679..cbaf005 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -59,16 +59,6 @@ public interface ICharsetDetector /// an input stream void Feed(Stream stream); - - - /// - /// Returns true if the detector has found a result and it is sure about it. - /// - /// TODO not always true - /// - /// true if the detector has detected the encoding - bool IsDone(); - /// /// Tell the detector that there is no more data and it must take its /// decision. From bcae1cf79abe62476f68c5d56020f4691492ea65 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:03:32 +0100 Subject: [PATCH 23/41] cleanup --- src/Library/CharsetDetector.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 4096bcb..2de7e60 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -97,7 +97,7 @@ public class CharsetDetector : ICharsetDetector /// /// "list" of probers /// - private CharsetProber[] _charsetProbers = new CharsetProber[ProbersNum]; + private readonly CharsetProber[] _charsetProbers = new CharsetProber[ProbersNum]; /// /// TODO unknown @@ -109,7 +109,6 @@ public class CharsetDetector : ICharsetDetector /// private DetectionResult _detectionResult; - private const float ShortcutThreshold = 0.95f; private const float MinimumThreshold = 0.20f; /// @@ -121,9 +120,9 @@ public class CharsetDetector : ICharsetDetector public CharsetDetector() { - this._start = true; - this.InputState = InputState.PureASCII; - this._lastChar = 0x00; + _start = true; + InputState = InputState.PureASCII; + _lastChar = 0x00; } public void Feed(Stream stream) From b7c2aed958610c5372b54139ebad2938844661b1 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:05:08 +0100 Subject: [PATCH 24/41] added todo --- src/Library/CharsetDetector.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 2de7e60..940544d 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -240,6 +240,7 @@ private void FindInputState(byte[] buf, int len) } } + private static string FindCharSetByBom(byte[] buf, int len) { string bomSet = null; @@ -252,6 +253,7 @@ private static string FindCharSetByBom(byte[] buf, int len) bomSet = "UTF-8"; break; case 0xFE: + //TODO potentional chrash bug[3] if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) // FE FF 00 00 UCS-4, unusual octet order BOM (3412) bomSet = "X-ISO-10646-UCS-4-3412"; @@ -259,6 +261,7 @@ private static string FindCharSetByBom(byte[] buf, int len) bomSet = "UTF-16BE"; break; case 0x00: + //TODO potentional chrash bug[3] if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) bomSet = "UTF-32BE"; else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) @@ -266,6 +269,7 @@ private static string FindCharSetByBom(byte[] buf, int len) bomSet = "X-ISO-10646-UCS-4-2143"; break; case 0xFF: + //TODO potentional chrash bug[3] if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) bomSet = "UTF-32LE"; else if (0xFE == buf[1]) From 5368fbfda31c4450b39f953de53ec0b9ae8db7c2 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:07:04 +0100 Subject: [PATCH 25/41] refactor --- src/Library/CharsetDetector.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 940544d..92d3836 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -246,33 +246,35 @@ private static string FindCharSetByBom(byte[] buf, int len) string bomSet = null; if (len > 3) { - switch (buf[0]) + //todo UTF bom of only 3 bytes isn't recognized + var b1 = buf[0]; + var b2 = buf[1]; + var b3 = buf[2]; + var b4 = buf[3]; + switch (b1) { case 0xEF: - if (0xBB == buf[1] && 0xBF == buf[2]) + if (0xBB == b2 && 0xBF == b3) bomSet = "UTF-8"; break; case 0xFE: - //TODO potentional chrash bug[3] - if (0xFF == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + if (0xFF == b2 && 0x00 == b3 && 0x00 == b4) // FE FF 00 00 UCS-4, unusual octet order BOM (3412) bomSet = "X-ISO-10646-UCS-4-3412"; - else if (0xFF == buf[1]) + else if (0xFF == b2) bomSet = "UTF-16BE"; break; case 0x00: - //TODO potentional chrash bug[3] - if (0x00 == buf[1] && 0xFE == buf[2] && 0xFF == buf[3]) + if (0x00 == b2 && 0xFE == b3 && 0xFF == b4) bomSet = "UTF-32BE"; - else if (0x00 == buf[1] && 0xFF == buf[2] && 0xFE == buf[3]) + else if (0x00 == b2 && 0xFF == b3 && 0xFE == b4) // 00 00 FF FE UCS-4, unusual octet order BOM (2143) bomSet = "X-ISO-10646-UCS-4-2143"; break; case 0xFF: - //TODO potentional chrash bug[3] - if (0xFE == buf[1] && 0x00 == buf[2] && 0x00 == buf[3]) + if (0xFE == b2 && 0x00 == b3 && 0x00 == b4) bomSet = "UTF-32LE"; - else if (0xFE == buf[1]) + else if (0xFE == b2) bomSet = "UTF-16LE"; break; } // switch From 7491b3e0ee6a748e2cf2eafdd77258a85dbc9bf0 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:08:31 +0100 Subject: [PATCH 26/41] dumpstatus fix --- src/Library/CharsetDetector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 92d3836..0c4ece5 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -189,7 +189,7 @@ private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetPro { var probingState = charsetProber.HandleData(buf, offset, len); #if DEBUG - charsetProbers[i].DumpStatus(); + charsetProber.DumpStatus(); #endif if (probingState == ProbingState.FoundIt) { From 6f6328983bf5c333630fa6f715e0a96e95b3cee3 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:18:46 +0100 Subject: [PATCH 27/41] refactor --- src/Example/Udetect.cs | 5 ++--- src/Library/CharsetDetector.cs | 19 ++++++++++++++++--- src/Library/ICharsetDetector.cs | 19 ++----------------- src/Tests/CharsetDetectorTest.cs | 24 ++++++++---------------- src/Tests/CharsetDetectorTestBatch.cs | 3 +-- 5 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/Example/Udetect.cs b/src/Example/Udetect.cs index 845cd0a..f3b8c94 100644 --- a/src/Example/Udetect.cs +++ b/src/Example/Udetect.cs @@ -26,9 +26,8 @@ public static void Main(String[] args) string filename = args[0]; using (FileStream fs = File.OpenRead(filename)) { - ICharsetDetector cdet = new CharsetDetector(); - cdet.Feed(fs); - var result = cdet.DataEnd(); + ICharsetDetector detector = new CharsetDetector(); + var result = detector.GetFromStream(fs); if (result.Detected != null) { diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 0c4ece5..f476787 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -125,7 +125,19 @@ public CharsetDetector() _lastChar = 0x00; } - public void Feed(Stream stream) + /// + /// TODO buffered + /// + /// + /// + public DetectionSummary GetFromBytes(byte[] bytes) + { + Feed(bytes, 0, bytes.Length); + return DataEnd(); + } + + + public DetectionSummary GetFromStream(Stream stream) { byte[] buff = new byte[1024]; int read; @@ -133,9 +145,10 @@ public void Feed(Stream stream) { Feed(buff, 0, read); } + return DataEnd(); } - public virtual void Feed(byte[] buf, int offset, int len) + protected virtual void Feed(byte[] buf, int offset, int len) { if (_done) { @@ -285,7 +298,7 @@ private static string FindCharSetByBom(byte[] buf, int len) /// /// Notify detector that no further data is available. /// - public virtual DetectionSummary DataEnd() + protected virtual DetectionSummary DataEnd() { if (!_gotData) { diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index cbaf005..a9828ee 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -42,28 +42,13 @@ namespace Ude { public interface ICharsetDetector { - - - - /// - /// Feed a block of bytes to the detector. - /// - /// input buffer - /// offset into buffer - /// number of available bytes - void Feed(byte[] buf, int offset, int len); - /// /// Feed a bytes stream to the detector. /// /// an input stream - void Feed(Stream stream); + DetectionSummary GetFromStream(Stream stream); - /// - /// Tell the detector that there is no more data and it must take its - /// decision. - /// - DetectionSummary DataEnd(); + } } diff --git a/src/Tests/CharsetDetectorTest.cs b/src/Tests/CharsetDetectorTest.cs index ff06eba..6b1f143 100644 --- a/src/Tests/CharsetDetectorTest.cs +++ b/src/Tests/CharsetDetectorTest.cs @@ -27,8 +27,7 @@ public void TestASCII() "click on the [Edit] link to start writing"; using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(s))) { - detector.Feed(ms); - var result = detector.DataEnd(); + var result = detector.GetFromStream(ms); Assert.Equal(Charsets.ASCII, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -43,8 +42,7 @@ public void TestUTF8_1() "ガイドブックを読んでから、サンドボックスで練習してみましょう。質問は" + "利用案内でどうぞ。"; byte[] buf = Encoding.UTF8.GetBytes(s); - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -54,8 +52,7 @@ public void TestBomUTF8() { var detector = new CharsetDetector(); byte[] buf = { 0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21 }; - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -66,8 +63,7 @@ public void TestBomUTF16_BE() var detector = new CharsetDetector(); byte[] buf = { 0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65 }; detector = new CharsetDetector(); - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF16_BE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -101,8 +97,7 @@ public void TestBomUTF16_LE() { var detector = new CharsetDetector(); byte[] buf = { 0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00 }; - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF16_LE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -112,8 +107,7 @@ public void TestBomUTF32_BE() { var detector = new CharsetDetector(); byte[] buf = { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68 }; - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF32_BE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -123,8 +117,7 @@ public void TestBomUTF32_LE() { var detector = new CharsetDetector(); byte[] buf = { 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00 }; - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.UTF32_LE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -134,8 +127,7 @@ public void TestIssue3() { var detector = new CharsetDetector(); byte[] buf = Encoding.UTF8.GetBytes("3"); - detector.Feed(buf, 0, buf.Length); - var result = detector.DataEnd(); + var result = detector.GetFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/src/Tests/CharsetDetectorTestBatch.cs index c1f0009..521a100 100644 --- a/src/Tests/CharsetDetectorTestBatch.cs +++ b/src/Tests/CharsetDetectorTestBatch.cs @@ -81,8 +81,7 @@ private static void Process(string charset, string dirname) { var detector = new CharsetDetector(); - detector.Feed(fs); - var result = detector.DataEnd(); + var result = detector.GetFromStream(fs); var detected = result.Detected; Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); From b01491282b1f6bcff45ffce31ff29d663eaef132 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 14:22:13 +0100 Subject: [PATCH 28/41] getFromFile --- src/Example/Udetect.cs | 24 +++++++++++------------- src/Library/CharsetDetector.cs | 21 ++++++++++++++++----- src/Library/ICharsetDetector.cs | 11 ++++------- src/Tests/CharsetDetectorTestBatch.cs | 16 +++++++--------- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/Example/Udetect.cs b/src/Example/Udetect.cs index f3b8c94..01b3688 100644 --- a/src/Example/Udetect.cs +++ b/src/Example/Udetect.cs @@ -24,21 +24,19 @@ public static void Main(String[] args) } string filename = args[0]; - using (FileStream fs = File.OpenRead(filename)) - { - ICharsetDetector detector = new CharsetDetector(); - var result = detector.GetFromStream(fs); - if (result.Detected != null) - { - Console.WriteLine("Charset: {0}, confidence: {1}", - result.Detected.Charset, result.Detected.Confidence); - } - else - { - Console.WriteLine("Detection failed."); - } + ICharsetDetector detector = new CharsetDetector(); + var result = detector.GetFromFile(filename); + + if (result.Detected != null) + { + Console.WriteLine("Charset: {0}, confidence: {1}", result.Detected.Charset, result.Detected.Confidence); } + else + { + Console.WriteLine("Detection failed."); + } + } } } diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index f476787..d7cd17d 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -117,7 +117,7 @@ public class CharsetDetector : ICharsetDetector private const int ProbersNum = 3; //public event DetectorFinished Finished; - + public CharsetDetector() { _start = true; @@ -138,7 +138,7 @@ public DetectionSummary GetFromBytes(byte[] bytes) public DetectionSummary GetFromStream(Stream stream) - { + { byte[] buff = new byte[1024]; int read; while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !_done) @@ -148,6 +148,17 @@ public DetectionSummary GetFromStream(Stream stream) return DataEnd(); } + + public DetectionSummary GetFromFile(string filePath) + { + using (FileStream fs = File.OpenRead(filePath)) + { + ICharsetDetector detector = new CharsetDetector(); + return detector.GetFromStream(fs); + } + + } + protected virtual void Feed(byte[] buf, int offset, int len) { if (_done) @@ -180,7 +191,7 @@ protected virtual void Feed(byte[] buf, int offset, int len) _escCharsetProber = _escCharsetProber ?? new EscCharsetProber(); RunProber(buf, offset, len, _escCharsetProber); - + break; case InputState.Highbyte: for (int i = 0; i < ProbersNum; i++) @@ -194,7 +205,7 @@ protected virtual void Feed(byte[] buf, int offset, int len) } } break; - // else pure ascii + // else pure ascii } } @@ -346,7 +357,7 @@ protected virtual DetectionSummary DataEnd() return new DetectionSummary(); } } - + //public delegate void DetectorFinished(string charset, float confidence); } diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs index a9828ee..852fcb6 100644 --- a/src/Library/ICharsetDetector.cs +++ b/src/Library/ICharsetDetector.cs @@ -42,13 +42,10 @@ namespace Ude { public interface ICharsetDetector { - /// - /// Feed a bytes stream to the detector. - /// - /// an input stream - DetectionSummary GetFromStream(Stream stream); - - + DetectionSummary GetFromBytes(byte[] bytes); + + DetectionSummary GetFromStream(Stream stream); + DetectionSummary GetFromFile(string filePath); } } diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/src/Tests/CharsetDetectorTestBatch.cs index 521a100..ae667c4 100644 --- a/src/Tests/CharsetDetectorTestBatch.cs +++ b/src/Tests/CharsetDetectorTestBatch.cs @@ -77,15 +77,13 @@ private static void Process(string charset, string dirname) foreach (string file in files) { - using (FileStream fs = new FileStream(file, FileMode.Open)) - { - var detector = new CharsetDetector(); - - var result = detector.GetFromStream(fs); - var detected = result.Detected; - Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); - - } + + var detector = new CharsetDetector(); + + var result = detector.GetFromFile(file); + var detected = result.Detected; + Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); + } } } From 1c852ed656da9aeceddd66d2c796f4d44e79bc7f Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 18:52:28 +0100 Subject: [PATCH 29/41] remove useless interface --- src/Example/Udetect.cs | 2 +- src/Library/CharsetDetector.cs | 4 +-- src/Library/ICharsetDetector.cs | 51 --------------------------------- src/Library/Ude.csproj | 1 - 4 files changed, 3 insertions(+), 55 deletions(-) delete mode 100644 src/Library/ICharsetDetector.cs diff --git a/src/Example/Udetect.cs b/src/Example/Udetect.cs index 01b3688..8391f54 100644 --- a/src/Example/Udetect.cs +++ b/src/Example/Udetect.cs @@ -25,7 +25,7 @@ public static void Main(String[] args) string filename = args[0]; - ICharsetDetector detector = new CharsetDetector(); + var detector = new CharsetDetector(); var result = detector.GetFromFile(filename); if (result.Detected != null) diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index d7cd17d..37d3111 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -70,7 +70,7 @@ namespace Ude /// /// /// - public class CharsetDetector : ICharsetDetector + public class CharsetDetector { internal InputState InputState; @@ -153,7 +153,7 @@ public DetectionSummary GetFromFile(string filePath) { using (FileStream fs = File.OpenRead(filePath)) { - ICharsetDetector detector = new CharsetDetector(); + var detector = new CharsetDetector(); return detector.GetFromStream(fs); } diff --git a/src/Library/ICharsetDetector.cs b/src/Library/ICharsetDetector.cs deleted file mode 100644 index 852fcb6..0000000 --- a/src/Library/ICharsetDetector.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Universal charset detector code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Shy Shalom - * Rudi Pettazzi (C# port) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -using System.IO; - -namespace Ude -{ - public interface ICharsetDetector - { - - DetectionSummary GetFromBytes(byte[] bytes); - - DetectionSummary GetFromStream(Stream stream); - DetectionSummary GetFromFile(string filePath); - } -} diff --git a/src/Library/Ude.csproj b/src/Library/Ude.csproj index 4b3e96b..3eea61e 100644 --- a/src/Library/Ude.csproj +++ b/src/Library/Ude.csproj @@ -120,7 +120,6 @@ - From 55f265df158a87aa428ae2ab043e391428f3aaa2 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Sat, 28 Nov 2015 18:55:05 +0100 Subject: [PATCH 30/41] to static --- src/Example/Udetect.cs | 3 +-- src/Library/CharsetDetector.cs | 21 ++++++++------- src/Tests/CharsetDetectorTest.cs | 38 +++++++++++---------------- src/Tests/CharsetDetectorTestBatch.cs | 3 +-- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/src/Example/Udetect.cs b/src/Example/Udetect.cs index 8391f54..1505509 100644 --- a/src/Example/Udetect.cs +++ b/src/Example/Udetect.cs @@ -25,8 +25,7 @@ public static void Main(String[] args) string filename = args[0]; - var detector = new CharsetDetector(); - var result = detector.GetFromFile(filename); + var result = CharsetDetector.GetFromFile(filename); if (result.Detected != null) { diff --git a/src/Library/CharsetDetector.cs b/src/Library/CharsetDetector.cs index 37d3111..43e6e1c 100644 --- a/src/Library/CharsetDetector.cs +++ b/src/Library/CharsetDetector.cs @@ -130,31 +130,34 @@ public CharsetDetector() /// /// /// - public DetectionSummary GetFromBytes(byte[] bytes) + public static DetectionSummary GetFromBytes(byte[] bytes) { - Feed(bytes, 0, bytes.Length); - return DataEnd(); + var detector = new CharsetDetector(); + detector.Feed(bytes, 0, bytes.Length); + return detector.DataEnd(); } - public DetectionSummary GetFromStream(Stream stream) + public static DetectionSummary GetFromStream(Stream stream) { + + var detector = new CharsetDetector(); byte[] buff = new byte[1024]; int read; - while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !_done) + while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !detector._done) { - Feed(buff, 0, read); + detector.Feed(buff, 0, read); } - return DataEnd(); + return detector.DataEnd(); } - public DetectionSummary GetFromFile(string filePath) + public static DetectionSummary GetFromFile(string filePath) { using (FileStream fs = File.OpenRead(filePath)) { var detector = new CharsetDetector(); - return detector.GetFromStream(fs); + return GetFromStream(fs); } } diff --git a/src/Tests/CharsetDetectorTest.cs b/src/Tests/CharsetDetectorTest.cs index 6b1f143..724aafd 100644 --- a/src/Tests/CharsetDetectorTest.cs +++ b/src/Tests/CharsetDetectorTest.cs @@ -19,7 +19,6 @@ public class CharsetDetectorTest [Fact] public void TestASCII() { - var detector = new CharsetDetector(); string s = "The Documentation of the libraries is not complete " + "and your contributions would be greatly appreciated " + @@ -27,7 +26,7 @@ public void TestASCII() "click on the [Edit] link to start writing"; using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(s))) { - var result = detector.GetFromStream(ms); + var result = CharsetDetector.GetFromStream(ms); Assert.Equal(Charsets.ASCII, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -36,13 +35,12 @@ public void TestASCII() [Fact] public void TestUTF8_1() { - var detector = new CharsetDetector(); string s = "ウィキペディアはオープンコンテントの百科事典です。基本方針に賛同し" + "ていただけるなら、誰でも記事を編集したり新しく作成したりできます。" + "ガイドブックを読んでから、サンドボックスで練習してみましょう。質問は" + "利用案内でどうぞ。"; byte[] buf = Encoding.UTF8.GetBytes(s); - var result = detector.GetFromBytes(buf); + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -50,9 +48,8 @@ public void TestUTF8_1() [Fact] public void TestBomUTF8() { - var detector = new CharsetDetector(); - byte[] buf = { 0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21 }; - var result = detector.GetFromBytes(buf); + byte[] buf = {0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21}; + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -60,10 +57,9 @@ public void TestBomUTF8() [Fact] public void TestBomUTF16_BE() { - var detector = new CharsetDetector(); - byte[] buf = { 0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65 }; - detector = new CharsetDetector(); - var result = detector.GetFromBytes(buf); + byte[] buf = {0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65}; + + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF16_BE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -95,9 +91,8 @@ public void TestBomX_ISO_10646_UCS_4_2143() [Fact] public void TestBomUTF16_LE() { - var detector = new CharsetDetector(); - byte[] buf = { 0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00 }; - var result = detector.GetFromBytes(buf); + byte[] buf = {0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00}; + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF16_LE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -105,9 +100,8 @@ public void TestBomUTF16_LE() [Fact] public void TestBomUTF32_BE() { - var detector = new CharsetDetector(); - byte[] buf = { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68 }; - var result = detector.GetFromBytes(buf); + byte[] buf = {0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68}; + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF32_BE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -115,9 +109,8 @@ public void TestBomUTF32_BE() [Fact] public void TestBomUTF32_LE() { - var detector = new CharsetDetector(); - byte[] buf = { 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00 }; - var result = detector.GetFromBytes(buf); + byte[] buf = {0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00}; + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.UTF32_LE, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -125,9 +118,8 @@ public void TestBomUTF32_LE() [Fact] public void TestIssue3() { - var detector = new CharsetDetector(); byte[] buf = Encoding.UTF8.GetBytes("3"); - var result = detector.GetFromBytes(buf); + var result = CharsetDetector.GetFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.Charset); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -152,7 +144,7 @@ public void TestOutOfRange2() detector.DataEnd(); Assert.Equal(Charsets.ASCII, detector.Charset); Assert.Equal(1.0f, detector.Confidence); -} + } [Fact] public void TestEmpty() diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/src/Tests/CharsetDetectorTestBatch.cs index ae667c4..671ef51 100644 --- a/src/Tests/CharsetDetectorTestBatch.cs +++ b/src/Tests/CharsetDetectorTestBatch.cs @@ -78,9 +78,8 @@ private static void Process(string charset, string dirname) foreach (string file in files) { - var detector = new CharsetDetector(); - var result = detector.GetFromFile(file); + var result = CharsetDetector.GetFromFile(file); var detected = result.Detected; Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); From d6523773c3c93cb59181769b1f51a303d55f7284 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 19:29:10 +0200 Subject: [PATCH 31/41] move --- {src/Example => Example}/Makefile.am | 0 {src/Example => Example}/Properties/AssemblyInfo.cs | 0 {src/Example => Example}/Ude.Example.csproj | 0 {src/Example => Example}/Ude.Example.mdp | 0 {src/Example => Example}/Udetect.cs | 0 {src/Example => Example}/app.config | 0 {src/Example => Example}/udetect.in | 0 src/{Library => }/CharsetDetector.cs | 0 src/{Library => }/Core/BIG5DistributionAnalyser.cs | 0 src/{Library => }/Core/BIG5SMModel.cs | 0 src/{Library => }/Core/Big5Prober.cs | 0 src/{Library => }/Core/BitPackage.cs | 0 src/{Library => }/Core/BulgarianModel.cs | 0 src/{Library => }/Core/CharDistributionAnalyser.cs | 0 src/{Library => }/Core/CharsetProber.cs | 0 src/{Library => }/Core/Charsets.cs | 0 src/{Library => }/Core/CodingStateMachine.cs | 0 src/{Library => }/Core/CyrillicModel.cs | 0 src/{Library => }/Core/EUCJPContextAnalyser.cs | 0 src/{Library => }/Core/EUCJPDistributionAnalyser.cs | 0 src/{Library => }/Core/EUCJPProber.cs | 0 src/{Library => }/Core/EUCJPSMModel.cs | 0 src/{Library => }/Core/EUCKRDistributionAnalyser.cs | 0 src/{Library => }/Core/EUCKRProber.cs | 0 src/{Library => }/Core/EUCKRSMModel.cs | 0 src/{Library => }/Core/EUCTWDistributionAnalyser.cs | 0 src/{Library => }/Core/EUCTWProber.cs | 0 src/{Library => }/Core/EUCTWSMModel.cs | 0 src/{Library => }/Core/EscCharsetProber.cs | 0 src/{Library => }/Core/GB18030DistributionAnalyser.cs | 0 src/{Library => }/Core/GB18030Prober.cs | 0 src/{Library => }/Core/GB18030SMModel.cs | 0 src/{Library => }/Core/GreekModel.cs | 0 src/{Library => }/Core/HZSMModel.cs | 0 src/{Library => }/Core/HebrewModel.cs | 0 src/{Library => }/Core/HebrewProber.cs | 0 src/{Library => }/Core/HungarianModel.cs | 0 src/{Library => }/Core/ISO2022CNSMModel.cs | 0 src/{Library => }/Core/ISO2022JPSMModel.cs | 0 src/{Library => }/Core/ISO2022KRSMModel.cs | 0 src/{Library => }/Core/Ibm855Model.cs | 0 src/{Library => }/Core/Ibm866Model.cs | 0 src/{Library => }/Core/InputState.cs | 0 src/{Library => }/Core/JapaneseContextAnalyser.cs | 0 src/{Library => }/Core/Koi8rModel.cs | 0 src/{Library => }/Core/Latin1Prober.cs | 0 src/{Library => }/Core/Latin2HungarianModel.cs | 0 src/{Library => }/Core/Latin5BulgarianModel.cs | 0 src/{Library => }/Core/Latin5Model.cs | 0 src/{Library => }/Core/Latin7Model.cs | 0 src/{Library => }/Core/MBCSGroupProber.cs | 0 src/{Library => }/Core/MacCyrillicModel.cs | 0 src/{Library => }/Core/ProbingState.cs | 0 src/{Library => }/Core/SBCSGroupProber.cs | 0 src/{Library => }/Core/SJISContextAnalyser.cs | 0 src/{Library => }/Core/SJISDistributionAnalyser.cs | 0 src/{Library => }/Core/SJISProber.cs | 0 src/{Library => }/Core/SJISSMModel.cs | 0 src/{Library => }/Core/SMModel.cs | 0 src/{Library => }/Core/SequenceModel.cs | 0 src/{Library => }/Core/SingleByteCharSetProber.cs | 0 src/{Library => }/Core/ThaiModel.cs | 0 src/{Library => }/Core/UCS2BESMModel.cs | 0 src/{Library => }/Core/UCS2LESMModel.cs | 0 src/{Library => }/Core/UTF8Prober.cs | 0 src/{Library => }/Core/UTF8SMModel.cs | 0 src/{Library => }/Core/Win1250HungarianModel.cs | 0 src/{Library => }/Core/Win1251BulgarianModel.cs | 0 src/{Library => }/Core/Win1251Model.cs | 0 src/{Library => }/Core/Win1253Model.cs | 0 src/{Library => }/Core/Win1255Model.cs | 0 src/{Library => }/DetectionConfidence.cs | 0 src/{Library => }/Makefile.am | 0 src/{Library => }/Ude.csproj | 0 src/{Library => }/Ude.csproj.DotSettings | 0 src/{Library => }/Ude.mdp | 0 src/{Library => }/V2/DetectionResult.cs | 0 src/{Library => }/V2/DetectionSummary.cs | 0 src/{Library => }/ude.pc.in | 0 {src/Tests => tests}/BitPackageTest.cs | 0 {src/Tests => tests}/CharsetDetectorTest.cs | 0 {src/Tests => tests}/CharsetDetectorTestBatch.cs | 0 {src/Tests => tests}/CharsetProberTest.cs | 0 {src/Tests => tests}/Data/README | 0 {src/Tests => tests}/Data/big5/1.txt | 0 {src/Tests => tests}/Data/eucjp/1.txt | 0 {src/Tests => tests}/Data/euckr/euc1.txt | 0 {src/Tests => tests}/Data/euckr/euc2.txt | 0 {src/Tests => tests}/Data/euctw/euc-tw1.txt | 0 {src/Tests => tests}/Data/gb18030/1.txt | 0 {src/Tests => tests}/Data/ibm855/1.txt | 0 {src/Tests => tests}/Data/ibm866/1.txt | 0 {src/Tests => tests}/Data/iso2022jp/1.txt | 0 {src/Tests => tests}/Data/iso2022kr/iso1.txt | 0 {src/Tests => tests}/Data/iso2022kr/iso2.txt | 0 {src/Tests => tests}/Data/iso88597/greek.txt | 0 {src/Tests => tests}/Data/koi8r/1.txt | 0 {src/Tests => tests}/Data/latin1/1.txt | 0 {src/Tests => tests}/Data/latin1/2.txt | 0 {src/Tests => tests}/Data/latin1/3.txt | 0 {src/Tests => tests}/Data/latin1/4.txt | 0 {src/Tests => tests}/Data/maccyrillic/1.txt | 0 {src/Tests => tests}/Data/shiftjis/1.txt | 0 {src/Tests => tests}/Data/shiftjis/2.txt | 0 {src/Tests => tests}/Data/shiftjis/3.txt | 0 {src/Tests => tests}/Data/shiftjis/4.txt | 0 {src/Tests => tests}/Data/utf8/1.txt | 0 {src/Tests => tests}/Data/utf8/2.txt | 0 {src/Tests => tests}/Data/utf8/3.txt | 0 {src/Tests => tests}/Data/utf8/4.txt | 0 {src/Tests => tests}/Data/utf8/5.txt | 0 {src/Tests => tests}/Data/utf8/greek.txt | 0 {src/Tests => tests}/Data/utf8/he1.txt | 0 {src/Tests => tests}/Data/utf8/he2.txt | 0 {src/Tests => tests}/Data/utf8/he3.txt | 0 {src/Tests => tests}/Data/utf8/russian.txt | 0 {src/Tests => tests}/Data/windows1251/1.txt | 0 {src/Tests => tests}/Data/windows1253/greek.txt | 0 {src/Tests => tests}/Data/windows1255/he1.txt | 0 {src/Tests => tests}/Data/windows1255/he2.txt | 0 {src/Tests => tests}/Data/windows1255/he3.txt | 0 {src/Tests => tests}/Makefile.am | 0 {src/Tests => tests}/Properties/AssemblyInfo.cs | 0 {src/Tests => tests}/Ude.Tests.csproj | 0 {src/Tests => tests}/Ude.Tests.mdp | 0 {src/Tests => tests}/packages.config | 0 126 files changed, 0 insertions(+), 0 deletions(-) rename {src/Example => Example}/Makefile.am (100%) rename {src/Example => Example}/Properties/AssemblyInfo.cs (100%) rename {src/Example => Example}/Ude.Example.csproj (100%) rename {src/Example => Example}/Ude.Example.mdp (100%) rename {src/Example => Example}/Udetect.cs (100%) rename {src/Example => Example}/app.config (100%) rename {src/Example => Example}/udetect.in (100%) rename src/{Library => }/CharsetDetector.cs (100%) rename src/{Library => }/Core/BIG5DistributionAnalyser.cs (100%) rename src/{Library => }/Core/BIG5SMModel.cs (100%) rename src/{Library => }/Core/Big5Prober.cs (100%) rename src/{Library => }/Core/BitPackage.cs (100%) rename src/{Library => }/Core/BulgarianModel.cs (100%) rename src/{Library => }/Core/CharDistributionAnalyser.cs (100%) rename src/{Library => }/Core/CharsetProber.cs (100%) rename src/{Library => }/Core/Charsets.cs (100%) rename src/{Library => }/Core/CodingStateMachine.cs (100%) rename src/{Library => }/Core/CyrillicModel.cs (100%) rename src/{Library => }/Core/EUCJPContextAnalyser.cs (100%) rename src/{Library => }/Core/EUCJPDistributionAnalyser.cs (100%) rename src/{Library => }/Core/EUCJPProber.cs (100%) rename src/{Library => }/Core/EUCJPSMModel.cs (100%) rename src/{Library => }/Core/EUCKRDistributionAnalyser.cs (100%) rename src/{Library => }/Core/EUCKRProber.cs (100%) rename src/{Library => }/Core/EUCKRSMModel.cs (100%) rename src/{Library => }/Core/EUCTWDistributionAnalyser.cs (100%) rename src/{Library => }/Core/EUCTWProber.cs (100%) rename src/{Library => }/Core/EUCTWSMModel.cs (100%) rename src/{Library => }/Core/EscCharsetProber.cs (100%) rename src/{Library => }/Core/GB18030DistributionAnalyser.cs (100%) rename src/{Library => }/Core/GB18030Prober.cs (100%) rename src/{Library => }/Core/GB18030SMModel.cs (100%) rename src/{Library => }/Core/GreekModel.cs (100%) rename src/{Library => }/Core/HZSMModel.cs (100%) rename src/{Library => }/Core/HebrewModel.cs (100%) rename src/{Library => }/Core/HebrewProber.cs (100%) rename src/{Library => }/Core/HungarianModel.cs (100%) rename src/{Library => }/Core/ISO2022CNSMModel.cs (100%) rename src/{Library => }/Core/ISO2022JPSMModel.cs (100%) rename src/{Library => }/Core/ISO2022KRSMModel.cs (100%) rename src/{Library => }/Core/Ibm855Model.cs (100%) rename src/{Library => }/Core/Ibm866Model.cs (100%) rename src/{Library => }/Core/InputState.cs (100%) rename src/{Library => }/Core/JapaneseContextAnalyser.cs (100%) rename src/{Library => }/Core/Koi8rModel.cs (100%) rename src/{Library => }/Core/Latin1Prober.cs (100%) rename src/{Library => }/Core/Latin2HungarianModel.cs (100%) rename src/{Library => }/Core/Latin5BulgarianModel.cs (100%) rename src/{Library => }/Core/Latin5Model.cs (100%) rename src/{Library => }/Core/Latin7Model.cs (100%) rename src/{Library => }/Core/MBCSGroupProber.cs (100%) rename src/{Library => }/Core/MacCyrillicModel.cs (100%) rename src/{Library => }/Core/ProbingState.cs (100%) rename src/{Library => }/Core/SBCSGroupProber.cs (100%) rename src/{Library => }/Core/SJISContextAnalyser.cs (100%) rename src/{Library => }/Core/SJISDistributionAnalyser.cs (100%) rename src/{Library => }/Core/SJISProber.cs (100%) rename src/{Library => }/Core/SJISSMModel.cs (100%) rename src/{Library => }/Core/SMModel.cs (100%) rename src/{Library => }/Core/SequenceModel.cs (100%) rename src/{Library => }/Core/SingleByteCharSetProber.cs (100%) rename src/{Library => }/Core/ThaiModel.cs (100%) rename src/{Library => }/Core/UCS2BESMModel.cs (100%) rename src/{Library => }/Core/UCS2LESMModel.cs (100%) rename src/{Library => }/Core/UTF8Prober.cs (100%) rename src/{Library => }/Core/UTF8SMModel.cs (100%) rename src/{Library => }/Core/Win1250HungarianModel.cs (100%) rename src/{Library => }/Core/Win1251BulgarianModel.cs (100%) rename src/{Library => }/Core/Win1251Model.cs (100%) rename src/{Library => }/Core/Win1253Model.cs (100%) rename src/{Library => }/Core/Win1255Model.cs (100%) rename src/{Library => }/DetectionConfidence.cs (100%) rename src/{Library => }/Makefile.am (100%) rename src/{Library => }/Ude.csproj (100%) rename src/{Library => }/Ude.csproj.DotSettings (100%) rename src/{Library => }/Ude.mdp (100%) rename src/{Library => }/V2/DetectionResult.cs (100%) rename src/{Library => }/V2/DetectionSummary.cs (100%) rename src/{Library => }/ude.pc.in (100%) rename {src/Tests => tests}/BitPackageTest.cs (100%) rename {src/Tests => tests}/CharsetDetectorTest.cs (100%) rename {src/Tests => tests}/CharsetDetectorTestBatch.cs (100%) rename {src/Tests => tests}/CharsetProberTest.cs (100%) rename {src/Tests => tests}/Data/README (100%) rename {src/Tests => tests}/Data/big5/1.txt (100%) rename {src/Tests => tests}/Data/eucjp/1.txt (100%) rename {src/Tests => tests}/Data/euckr/euc1.txt (100%) rename {src/Tests => tests}/Data/euckr/euc2.txt (100%) rename {src/Tests => tests}/Data/euctw/euc-tw1.txt (100%) rename {src/Tests => tests}/Data/gb18030/1.txt (100%) rename {src/Tests => tests}/Data/ibm855/1.txt (100%) rename {src/Tests => tests}/Data/ibm866/1.txt (100%) rename {src/Tests => tests}/Data/iso2022jp/1.txt (100%) rename {src/Tests => tests}/Data/iso2022kr/iso1.txt (100%) rename {src/Tests => tests}/Data/iso2022kr/iso2.txt (100%) rename {src/Tests => tests}/Data/iso88597/greek.txt (100%) rename {src/Tests => tests}/Data/koi8r/1.txt (100%) rename {src/Tests => tests}/Data/latin1/1.txt (100%) rename {src/Tests => tests}/Data/latin1/2.txt (100%) rename {src/Tests => tests}/Data/latin1/3.txt (100%) rename {src/Tests => tests}/Data/latin1/4.txt (100%) rename {src/Tests => tests}/Data/maccyrillic/1.txt (100%) rename {src/Tests => tests}/Data/shiftjis/1.txt (100%) rename {src/Tests => tests}/Data/shiftjis/2.txt (100%) rename {src/Tests => tests}/Data/shiftjis/3.txt (100%) rename {src/Tests => tests}/Data/shiftjis/4.txt (100%) rename {src/Tests => tests}/Data/utf8/1.txt (100%) rename {src/Tests => tests}/Data/utf8/2.txt (100%) rename {src/Tests => tests}/Data/utf8/3.txt (100%) rename {src/Tests => tests}/Data/utf8/4.txt (100%) rename {src/Tests => tests}/Data/utf8/5.txt (100%) rename {src/Tests => tests}/Data/utf8/greek.txt (100%) rename {src/Tests => tests}/Data/utf8/he1.txt (100%) rename {src/Tests => tests}/Data/utf8/he2.txt (100%) rename {src/Tests => tests}/Data/utf8/he3.txt (100%) rename {src/Tests => tests}/Data/utf8/russian.txt (100%) rename {src/Tests => tests}/Data/windows1251/1.txt (100%) rename {src/Tests => tests}/Data/windows1253/greek.txt (100%) rename {src/Tests => tests}/Data/windows1255/he1.txt (100%) rename {src/Tests => tests}/Data/windows1255/he2.txt (100%) rename {src/Tests => tests}/Data/windows1255/he3.txt (100%) rename {src/Tests => tests}/Makefile.am (100%) rename {src/Tests => tests}/Properties/AssemblyInfo.cs (100%) rename {src/Tests => tests}/Ude.Tests.csproj (100%) rename {src/Tests => tests}/Ude.Tests.mdp (100%) rename {src/Tests => tests}/packages.config (100%) diff --git a/src/Example/Makefile.am b/Example/Makefile.am similarity index 100% rename from src/Example/Makefile.am rename to Example/Makefile.am diff --git a/src/Example/Properties/AssemblyInfo.cs b/Example/Properties/AssemblyInfo.cs similarity index 100% rename from src/Example/Properties/AssemblyInfo.cs rename to Example/Properties/AssemblyInfo.cs diff --git a/src/Example/Ude.Example.csproj b/Example/Ude.Example.csproj similarity index 100% rename from src/Example/Ude.Example.csproj rename to Example/Ude.Example.csproj diff --git a/src/Example/Ude.Example.mdp b/Example/Ude.Example.mdp similarity index 100% rename from src/Example/Ude.Example.mdp rename to Example/Ude.Example.mdp diff --git a/src/Example/Udetect.cs b/Example/Udetect.cs similarity index 100% rename from src/Example/Udetect.cs rename to Example/Udetect.cs diff --git a/src/Example/app.config b/Example/app.config similarity index 100% rename from src/Example/app.config rename to Example/app.config diff --git a/src/Example/udetect.in b/Example/udetect.in similarity index 100% rename from src/Example/udetect.in rename to Example/udetect.in diff --git a/src/Library/CharsetDetector.cs b/src/CharsetDetector.cs similarity index 100% rename from src/Library/CharsetDetector.cs rename to src/CharsetDetector.cs diff --git a/src/Library/Core/BIG5DistributionAnalyser.cs b/src/Core/BIG5DistributionAnalyser.cs similarity index 100% rename from src/Library/Core/BIG5DistributionAnalyser.cs rename to src/Core/BIG5DistributionAnalyser.cs diff --git a/src/Library/Core/BIG5SMModel.cs b/src/Core/BIG5SMModel.cs similarity index 100% rename from src/Library/Core/BIG5SMModel.cs rename to src/Core/BIG5SMModel.cs diff --git a/src/Library/Core/Big5Prober.cs b/src/Core/Big5Prober.cs similarity index 100% rename from src/Library/Core/Big5Prober.cs rename to src/Core/Big5Prober.cs diff --git a/src/Library/Core/BitPackage.cs b/src/Core/BitPackage.cs similarity index 100% rename from src/Library/Core/BitPackage.cs rename to src/Core/BitPackage.cs diff --git a/src/Library/Core/BulgarianModel.cs b/src/Core/BulgarianModel.cs similarity index 100% rename from src/Library/Core/BulgarianModel.cs rename to src/Core/BulgarianModel.cs diff --git a/src/Library/Core/CharDistributionAnalyser.cs b/src/Core/CharDistributionAnalyser.cs similarity index 100% rename from src/Library/Core/CharDistributionAnalyser.cs rename to src/Core/CharDistributionAnalyser.cs diff --git a/src/Library/Core/CharsetProber.cs b/src/Core/CharsetProber.cs similarity index 100% rename from src/Library/Core/CharsetProber.cs rename to src/Core/CharsetProber.cs diff --git a/src/Library/Core/Charsets.cs b/src/Core/Charsets.cs similarity index 100% rename from src/Library/Core/Charsets.cs rename to src/Core/Charsets.cs diff --git a/src/Library/Core/CodingStateMachine.cs b/src/Core/CodingStateMachine.cs similarity index 100% rename from src/Library/Core/CodingStateMachine.cs rename to src/Core/CodingStateMachine.cs diff --git a/src/Library/Core/CyrillicModel.cs b/src/Core/CyrillicModel.cs similarity index 100% rename from src/Library/Core/CyrillicModel.cs rename to src/Core/CyrillicModel.cs diff --git a/src/Library/Core/EUCJPContextAnalyser.cs b/src/Core/EUCJPContextAnalyser.cs similarity index 100% rename from src/Library/Core/EUCJPContextAnalyser.cs rename to src/Core/EUCJPContextAnalyser.cs diff --git a/src/Library/Core/EUCJPDistributionAnalyser.cs b/src/Core/EUCJPDistributionAnalyser.cs similarity index 100% rename from src/Library/Core/EUCJPDistributionAnalyser.cs rename to src/Core/EUCJPDistributionAnalyser.cs diff --git a/src/Library/Core/EUCJPProber.cs b/src/Core/EUCJPProber.cs similarity index 100% rename from src/Library/Core/EUCJPProber.cs rename to src/Core/EUCJPProber.cs diff --git a/src/Library/Core/EUCJPSMModel.cs b/src/Core/EUCJPSMModel.cs similarity index 100% rename from src/Library/Core/EUCJPSMModel.cs rename to src/Core/EUCJPSMModel.cs diff --git a/src/Library/Core/EUCKRDistributionAnalyser.cs b/src/Core/EUCKRDistributionAnalyser.cs similarity index 100% rename from src/Library/Core/EUCKRDistributionAnalyser.cs rename to src/Core/EUCKRDistributionAnalyser.cs diff --git a/src/Library/Core/EUCKRProber.cs b/src/Core/EUCKRProber.cs similarity index 100% rename from src/Library/Core/EUCKRProber.cs rename to src/Core/EUCKRProber.cs diff --git a/src/Library/Core/EUCKRSMModel.cs b/src/Core/EUCKRSMModel.cs similarity index 100% rename from src/Library/Core/EUCKRSMModel.cs rename to src/Core/EUCKRSMModel.cs diff --git a/src/Library/Core/EUCTWDistributionAnalyser.cs b/src/Core/EUCTWDistributionAnalyser.cs similarity index 100% rename from src/Library/Core/EUCTWDistributionAnalyser.cs rename to src/Core/EUCTWDistributionAnalyser.cs diff --git a/src/Library/Core/EUCTWProber.cs b/src/Core/EUCTWProber.cs similarity index 100% rename from src/Library/Core/EUCTWProber.cs rename to src/Core/EUCTWProber.cs diff --git a/src/Library/Core/EUCTWSMModel.cs b/src/Core/EUCTWSMModel.cs similarity index 100% rename from src/Library/Core/EUCTWSMModel.cs rename to src/Core/EUCTWSMModel.cs diff --git a/src/Library/Core/EscCharsetProber.cs b/src/Core/EscCharsetProber.cs similarity index 100% rename from src/Library/Core/EscCharsetProber.cs rename to src/Core/EscCharsetProber.cs diff --git a/src/Library/Core/GB18030DistributionAnalyser.cs b/src/Core/GB18030DistributionAnalyser.cs similarity index 100% rename from src/Library/Core/GB18030DistributionAnalyser.cs rename to src/Core/GB18030DistributionAnalyser.cs diff --git a/src/Library/Core/GB18030Prober.cs b/src/Core/GB18030Prober.cs similarity index 100% rename from src/Library/Core/GB18030Prober.cs rename to src/Core/GB18030Prober.cs diff --git a/src/Library/Core/GB18030SMModel.cs b/src/Core/GB18030SMModel.cs similarity index 100% rename from src/Library/Core/GB18030SMModel.cs rename to src/Core/GB18030SMModel.cs diff --git a/src/Library/Core/GreekModel.cs b/src/Core/GreekModel.cs similarity index 100% rename from src/Library/Core/GreekModel.cs rename to src/Core/GreekModel.cs diff --git a/src/Library/Core/HZSMModel.cs b/src/Core/HZSMModel.cs similarity index 100% rename from src/Library/Core/HZSMModel.cs rename to src/Core/HZSMModel.cs diff --git a/src/Library/Core/HebrewModel.cs b/src/Core/HebrewModel.cs similarity index 100% rename from src/Library/Core/HebrewModel.cs rename to src/Core/HebrewModel.cs diff --git a/src/Library/Core/HebrewProber.cs b/src/Core/HebrewProber.cs similarity index 100% rename from src/Library/Core/HebrewProber.cs rename to src/Core/HebrewProber.cs diff --git a/src/Library/Core/HungarianModel.cs b/src/Core/HungarianModel.cs similarity index 100% rename from src/Library/Core/HungarianModel.cs rename to src/Core/HungarianModel.cs diff --git a/src/Library/Core/ISO2022CNSMModel.cs b/src/Core/ISO2022CNSMModel.cs similarity index 100% rename from src/Library/Core/ISO2022CNSMModel.cs rename to src/Core/ISO2022CNSMModel.cs diff --git a/src/Library/Core/ISO2022JPSMModel.cs b/src/Core/ISO2022JPSMModel.cs similarity index 100% rename from src/Library/Core/ISO2022JPSMModel.cs rename to src/Core/ISO2022JPSMModel.cs diff --git a/src/Library/Core/ISO2022KRSMModel.cs b/src/Core/ISO2022KRSMModel.cs similarity index 100% rename from src/Library/Core/ISO2022KRSMModel.cs rename to src/Core/ISO2022KRSMModel.cs diff --git a/src/Library/Core/Ibm855Model.cs b/src/Core/Ibm855Model.cs similarity index 100% rename from src/Library/Core/Ibm855Model.cs rename to src/Core/Ibm855Model.cs diff --git a/src/Library/Core/Ibm866Model.cs b/src/Core/Ibm866Model.cs similarity index 100% rename from src/Library/Core/Ibm866Model.cs rename to src/Core/Ibm866Model.cs diff --git a/src/Library/Core/InputState.cs b/src/Core/InputState.cs similarity index 100% rename from src/Library/Core/InputState.cs rename to src/Core/InputState.cs diff --git a/src/Library/Core/JapaneseContextAnalyser.cs b/src/Core/JapaneseContextAnalyser.cs similarity index 100% rename from src/Library/Core/JapaneseContextAnalyser.cs rename to src/Core/JapaneseContextAnalyser.cs diff --git a/src/Library/Core/Koi8rModel.cs b/src/Core/Koi8rModel.cs similarity index 100% rename from src/Library/Core/Koi8rModel.cs rename to src/Core/Koi8rModel.cs diff --git a/src/Library/Core/Latin1Prober.cs b/src/Core/Latin1Prober.cs similarity index 100% rename from src/Library/Core/Latin1Prober.cs rename to src/Core/Latin1Prober.cs diff --git a/src/Library/Core/Latin2HungarianModel.cs b/src/Core/Latin2HungarianModel.cs similarity index 100% rename from src/Library/Core/Latin2HungarianModel.cs rename to src/Core/Latin2HungarianModel.cs diff --git a/src/Library/Core/Latin5BulgarianModel.cs b/src/Core/Latin5BulgarianModel.cs similarity index 100% rename from src/Library/Core/Latin5BulgarianModel.cs rename to src/Core/Latin5BulgarianModel.cs diff --git a/src/Library/Core/Latin5Model.cs b/src/Core/Latin5Model.cs similarity index 100% rename from src/Library/Core/Latin5Model.cs rename to src/Core/Latin5Model.cs diff --git a/src/Library/Core/Latin7Model.cs b/src/Core/Latin7Model.cs similarity index 100% rename from src/Library/Core/Latin7Model.cs rename to src/Core/Latin7Model.cs diff --git a/src/Library/Core/MBCSGroupProber.cs b/src/Core/MBCSGroupProber.cs similarity index 100% rename from src/Library/Core/MBCSGroupProber.cs rename to src/Core/MBCSGroupProber.cs diff --git a/src/Library/Core/MacCyrillicModel.cs b/src/Core/MacCyrillicModel.cs similarity index 100% rename from src/Library/Core/MacCyrillicModel.cs rename to src/Core/MacCyrillicModel.cs diff --git a/src/Library/Core/ProbingState.cs b/src/Core/ProbingState.cs similarity index 100% rename from src/Library/Core/ProbingState.cs rename to src/Core/ProbingState.cs diff --git a/src/Library/Core/SBCSGroupProber.cs b/src/Core/SBCSGroupProber.cs similarity index 100% rename from src/Library/Core/SBCSGroupProber.cs rename to src/Core/SBCSGroupProber.cs diff --git a/src/Library/Core/SJISContextAnalyser.cs b/src/Core/SJISContextAnalyser.cs similarity index 100% rename from src/Library/Core/SJISContextAnalyser.cs rename to src/Core/SJISContextAnalyser.cs diff --git a/src/Library/Core/SJISDistributionAnalyser.cs b/src/Core/SJISDistributionAnalyser.cs similarity index 100% rename from src/Library/Core/SJISDistributionAnalyser.cs rename to src/Core/SJISDistributionAnalyser.cs diff --git a/src/Library/Core/SJISProber.cs b/src/Core/SJISProber.cs similarity index 100% rename from src/Library/Core/SJISProber.cs rename to src/Core/SJISProber.cs diff --git a/src/Library/Core/SJISSMModel.cs b/src/Core/SJISSMModel.cs similarity index 100% rename from src/Library/Core/SJISSMModel.cs rename to src/Core/SJISSMModel.cs diff --git a/src/Library/Core/SMModel.cs b/src/Core/SMModel.cs similarity index 100% rename from src/Library/Core/SMModel.cs rename to src/Core/SMModel.cs diff --git a/src/Library/Core/SequenceModel.cs b/src/Core/SequenceModel.cs similarity index 100% rename from src/Library/Core/SequenceModel.cs rename to src/Core/SequenceModel.cs diff --git a/src/Library/Core/SingleByteCharSetProber.cs b/src/Core/SingleByteCharSetProber.cs similarity index 100% rename from src/Library/Core/SingleByteCharSetProber.cs rename to src/Core/SingleByteCharSetProber.cs diff --git a/src/Library/Core/ThaiModel.cs b/src/Core/ThaiModel.cs similarity index 100% rename from src/Library/Core/ThaiModel.cs rename to src/Core/ThaiModel.cs diff --git a/src/Library/Core/UCS2BESMModel.cs b/src/Core/UCS2BESMModel.cs similarity index 100% rename from src/Library/Core/UCS2BESMModel.cs rename to src/Core/UCS2BESMModel.cs diff --git a/src/Library/Core/UCS2LESMModel.cs b/src/Core/UCS2LESMModel.cs similarity index 100% rename from src/Library/Core/UCS2LESMModel.cs rename to src/Core/UCS2LESMModel.cs diff --git a/src/Library/Core/UTF8Prober.cs b/src/Core/UTF8Prober.cs similarity index 100% rename from src/Library/Core/UTF8Prober.cs rename to src/Core/UTF8Prober.cs diff --git a/src/Library/Core/UTF8SMModel.cs b/src/Core/UTF8SMModel.cs similarity index 100% rename from src/Library/Core/UTF8SMModel.cs rename to src/Core/UTF8SMModel.cs diff --git a/src/Library/Core/Win1250HungarianModel.cs b/src/Core/Win1250HungarianModel.cs similarity index 100% rename from src/Library/Core/Win1250HungarianModel.cs rename to src/Core/Win1250HungarianModel.cs diff --git a/src/Library/Core/Win1251BulgarianModel.cs b/src/Core/Win1251BulgarianModel.cs similarity index 100% rename from src/Library/Core/Win1251BulgarianModel.cs rename to src/Core/Win1251BulgarianModel.cs diff --git a/src/Library/Core/Win1251Model.cs b/src/Core/Win1251Model.cs similarity index 100% rename from src/Library/Core/Win1251Model.cs rename to src/Core/Win1251Model.cs diff --git a/src/Library/Core/Win1253Model.cs b/src/Core/Win1253Model.cs similarity index 100% rename from src/Library/Core/Win1253Model.cs rename to src/Core/Win1253Model.cs diff --git a/src/Library/Core/Win1255Model.cs b/src/Core/Win1255Model.cs similarity index 100% rename from src/Library/Core/Win1255Model.cs rename to src/Core/Win1255Model.cs diff --git a/src/Library/DetectionConfidence.cs b/src/DetectionConfidence.cs similarity index 100% rename from src/Library/DetectionConfidence.cs rename to src/DetectionConfidence.cs diff --git a/src/Library/Makefile.am b/src/Makefile.am similarity index 100% rename from src/Library/Makefile.am rename to src/Makefile.am diff --git a/src/Library/Ude.csproj b/src/Ude.csproj similarity index 100% rename from src/Library/Ude.csproj rename to src/Ude.csproj diff --git a/src/Library/Ude.csproj.DotSettings b/src/Ude.csproj.DotSettings similarity index 100% rename from src/Library/Ude.csproj.DotSettings rename to src/Ude.csproj.DotSettings diff --git a/src/Library/Ude.mdp b/src/Ude.mdp similarity index 100% rename from src/Library/Ude.mdp rename to src/Ude.mdp diff --git a/src/Library/V2/DetectionResult.cs b/src/V2/DetectionResult.cs similarity index 100% rename from src/Library/V2/DetectionResult.cs rename to src/V2/DetectionResult.cs diff --git a/src/Library/V2/DetectionSummary.cs b/src/V2/DetectionSummary.cs similarity index 100% rename from src/Library/V2/DetectionSummary.cs rename to src/V2/DetectionSummary.cs diff --git a/src/Library/ude.pc.in b/src/ude.pc.in similarity index 100% rename from src/Library/ude.pc.in rename to src/ude.pc.in diff --git a/src/Tests/BitPackageTest.cs b/tests/BitPackageTest.cs similarity index 100% rename from src/Tests/BitPackageTest.cs rename to tests/BitPackageTest.cs diff --git a/src/Tests/CharsetDetectorTest.cs b/tests/CharsetDetectorTest.cs similarity index 100% rename from src/Tests/CharsetDetectorTest.cs rename to tests/CharsetDetectorTest.cs diff --git a/src/Tests/CharsetDetectorTestBatch.cs b/tests/CharsetDetectorTestBatch.cs similarity index 100% rename from src/Tests/CharsetDetectorTestBatch.cs rename to tests/CharsetDetectorTestBatch.cs diff --git a/src/Tests/CharsetProberTest.cs b/tests/CharsetProberTest.cs similarity index 100% rename from src/Tests/CharsetProberTest.cs rename to tests/CharsetProberTest.cs diff --git a/src/Tests/Data/README b/tests/Data/README similarity index 100% rename from src/Tests/Data/README rename to tests/Data/README diff --git a/src/Tests/Data/big5/1.txt b/tests/Data/big5/1.txt similarity index 100% rename from src/Tests/Data/big5/1.txt rename to tests/Data/big5/1.txt diff --git a/src/Tests/Data/eucjp/1.txt b/tests/Data/eucjp/1.txt similarity index 100% rename from src/Tests/Data/eucjp/1.txt rename to tests/Data/eucjp/1.txt diff --git a/src/Tests/Data/euckr/euc1.txt b/tests/Data/euckr/euc1.txt similarity index 100% rename from src/Tests/Data/euckr/euc1.txt rename to tests/Data/euckr/euc1.txt diff --git a/src/Tests/Data/euckr/euc2.txt b/tests/Data/euckr/euc2.txt similarity index 100% rename from src/Tests/Data/euckr/euc2.txt rename to tests/Data/euckr/euc2.txt diff --git a/src/Tests/Data/euctw/euc-tw1.txt b/tests/Data/euctw/euc-tw1.txt similarity index 100% rename from src/Tests/Data/euctw/euc-tw1.txt rename to tests/Data/euctw/euc-tw1.txt diff --git a/src/Tests/Data/gb18030/1.txt b/tests/Data/gb18030/1.txt similarity index 100% rename from src/Tests/Data/gb18030/1.txt rename to tests/Data/gb18030/1.txt diff --git a/src/Tests/Data/ibm855/1.txt b/tests/Data/ibm855/1.txt similarity index 100% rename from src/Tests/Data/ibm855/1.txt rename to tests/Data/ibm855/1.txt diff --git a/src/Tests/Data/ibm866/1.txt b/tests/Data/ibm866/1.txt similarity index 100% rename from src/Tests/Data/ibm866/1.txt rename to tests/Data/ibm866/1.txt diff --git a/src/Tests/Data/iso2022jp/1.txt b/tests/Data/iso2022jp/1.txt similarity index 100% rename from src/Tests/Data/iso2022jp/1.txt rename to tests/Data/iso2022jp/1.txt diff --git a/src/Tests/Data/iso2022kr/iso1.txt b/tests/Data/iso2022kr/iso1.txt similarity index 100% rename from src/Tests/Data/iso2022kr/iso1.txt rename to tests/Data/iso2022kr/iso1.txt diff --git a/src/Tests/Data/iso2022kr/iso2.txt b/tests/Data/iso2022kr/iso2.txt similarity index 100% rename from src/Tests/Data/iso2022kr/iso2.txt rename to tests/Data/iso2022kr/iso2.txt diff --git a/src/Tests/Data/iso88597/greek.txt b/tests/Data/iso88597/greek.txt similarity index 100% rename from src/Tests/Data/iso88597/greek.txt rename to tests/Data/iso88597/greek.txt diff --git a/src/Tests/Data/koi8r/1.txt b/tests/Data/koi8r/1.txt similarity index 100% rename from src/Tests/Data/koi8r/1.txt rename to tests/Data/koi8r/1.txt diff --git a/src/Tests/Data/latin1/1.txt b/tests/Data/latin1/1.txt similarity index 100% rename from src/Tests/Data/latin1/1.txt rename to tests/Data/latin1/1.txt diff --git a/src/Tests/Data/latin1/2.txt b/tests/Data/latin1/2.txt similarity index 100% rename from src/Tests/Data/latin1/2.txt rename to tests/Data/latin1/2.txt diff --git a/src/Tests/Data/latin1/3.txt b/tests/Data/latin1/3.txt similarity index 100% rename from src/Tests/Data/latin1/3.txt rename to tests/Data/latin1/3.txt diff --git a/src/Tests/Data/latin1/4.txt b/tests/Data/latin1/4.txt similarity index 100% rename from src/Tests/Data/latin1/4.txt rename to tests/Data/latin1/4.txt diff --git a/src/Tests/Data/maccyrillic/1.txt b/tests/Data/maccyrillic/1.txt similarity index 100% rename from src/Tests/Data/maccyrillic/1.txt rename to tests/Data/maccyrillic/1.txt diff --git a/src/Tests/Data/shiftjis/1.txt b/tests/Data/shiftjis/1.txt similarity index 100% rename from src/Tests/Data/shiftjis/1.txt rename to tests/Data/shiftjis/1.txt diff --git a/src/Tests/Data/shiftjis/2.txt b/tests/Data/shiftjis/2.txt similarity index 100% rename from src/Tests/Data/shiftjis/2.txt rename to tests/Data/shiftjis/2.txt diff --git a/src/Tests/Data/shiftjis/3.txt b/tests/Data/shiftjis/3.txt similarity index 100% rename from src/Tests/Data/shiftjis/3.txt rename to tests/Data/shiftjis/3.txt diff --git a/src/Tests/Data/shiftjis/4.txt b/tests/Data/shiftjis/4.txt similarity index 100% rename from src/Tests/Data/shiftjis/4.txt rename to tests/Data/shiftjis/4.txt diff --git a/src/Tests/Data/utf8/1.txt b/tests/Data/utf8/1.txt similarity index 100% rename from src/Tests/Data/utf8/1.txt rename to tests/Data/utf8/1.txt diff --git a/src/Tests/Data/utf8/2.txt b/tests/Data/utf8/2.txt similarity index 100% rename from src/Tests/Data/utf8/2.txt rename to tests/Data/utf8/2.txt diff --git a/src/Tests/Data/utf8/3.txt b/tests/Data/utf8/3.txt similarity index 100% rename from src/Tests/Data/utf8/3.txt rename to tests/Data/utf8/3.txt diff --git a/src/Tests/Data/utf8/4.txt b/tests/Data/utf8/4.txt similarity index 100% rename from src/Tests/Data/utf8/4.txt rename to tests/Data/utf8/4.txt diff --git a/src/Tests/Data/utf8/5.txt b/tests/Data/utf8/5.txt similarity index 100% rename from src/Tests/Data/utf8/5.txt rename to tests/Data/utf8/5.txt diff --git a/src/Tests/Data/utf8/greek.txt b/tests/Data/utf8/greek.txt similarity index 100% rename from src/Tests/Data/utf8/greek.txt rename to tests/Data/utf8/greek.txt diff --git a/src/Tests/Data/utf8/he1.txt b/tests/Data/utf8/he1.txt similarity index 100% rename from src/Tests/Data/utf8/he1.txt rename to tests/Data/utf8/he1.txt diff --git a/src/Tests/Data/utf8/he2.txt b/tests/Data/utf8/he2.txt similarity index 100% rename from src/Tests/Data/utf8/he2.txt rename to tests/Data/utf8/he2.txt diff --git a/src/Tests/Data/utf8/he3.txt b/tests/Data/utf8/he3.txt similarity index 100% rename from src/Tests/Data/utf8/he3.txt rename to tests/Data/utf8/he3.txt diff --git a/src/Tests/Data/utf8/russian.txt b/tests/Data/utf8/russian.txt similarity index 100% rename from src/Tests/Data/utf8/russian.txt rename to tests/Data/utf8/russian.txt diff --git a/src/Tests/Data/windows1251/1.txt b/tests/Data/windows1251/1.txt similarity index 100% rename from src/Tests/Data/windows1251/1.txt rename to tests/Data/windows1251/1.txt diff --git a/src/Tests/Data/windows1253/greek.txt b/tests/Data/windows1253/greek.txt similarity index 100% rename from src/Tests/Data/windows1253/greek.txt rename to tests/Data/windows1253/greek.txt diff --git a/src/Tests/Data/windows1255/he1.txt b/tests/Data/windows1255/he1.txt similarity index 100% rename from src/Tests/Data/windows1255/he1.txt rename to tests/Data/windows1255/he1.txt diff --git a/src/Tests/Data/windows1255/he2.txt b/tests/Data/windows1255/he2.txt similarity index 100% rename from src/Tests/Data/windows1255/he2.txt rename to tests/Data/windows1255/he2.txt diff --git a/src/Tests/Data/windows1255/he3.txt b/tests/Data/windows1255/he3.txt similarity index 100% rename from src/Tests/Data/windows1255/he3.txt rename to tests/Data/windows1255/he3.txt diff --git a/src/Tests/Makefile.am b/tests/Makefile.am similarity index 100% rename from src/Tests/Makefile.am rename to tests/Makefile.am diff --git a/src/Tests/Properties/AssemblyInfo.cs b/tests/Properties/AssemblyInfo.cs similarity index 100% rename from src/Tests/Properties/AssemblyInfo.cs rename to tests/Properties/AssemblyInfo.cs diff --git a/src/Tests/Ude.Tests.csproj b/tests/Ude.Tests.csproj similarity index 100% rename from src/Tests/Ude.Tests.csproj rename to tests/Ude.Tests.csproj diff --git a/src/Tests/Ude.Tests.mdp b/tests/Ude.Tests.mdp similarity index 100% rename from src/Tests/Ude.Tests.mdp rename to tests/Ude.Tests.mdp diff --git a/src/Tests/packages.config b/tests/packages.config similarity index 100% rename from src/Tests/packages.config rename to tests/packages.config From d8c5c17435970f0bf53909d791fe669a13e5e7a3 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 20:08:56 +0200 Subject: [PATCH 32/41] migrate to vs2017 and .net core --- .gitattributes | 63 + AUTHORS | 1 - COPYING | 1 - ChangeLog | 0 Example/Makefile.am | 38 - Example/Properties/AssemblyInfo.cs | 18 - Example/Ude.Example.csproj | 59 - Example/Ude.Example.mdp | 24 - Example/udetect.in | 4 - INSTALL | 34 - Makefile.am | 13 - Makefile.include | 35 - NEWS | 0 UTF-unknown.sln | 34 + Ude.mds | 24 - Ude.sln | 37 - Ude.sln.DotSettings | 18 - aclocal.m4 | 748 ----- autogen.sh | 60 - configure | 3789 ------------------------ configure.ac | 82 - example/ConsoleExample.csproj | 12 + {Example => example}/Udetect.cs | 0 {Example => example}/app.config | 0 install-sh | 519 ---- logo.png | Bin 0 -> 4031 bytes missing | 367 --- src/Library/Properties/AssemblyInfo.cs | 21 - src/Makefile.am | 70 - src/UTF-unknown.csproj | 43 + src/Ude.csproj | 133 - src/Ude.csproj.DotSettings | 2 - src/Ude.mdp | 55 - src/ude.pc.in | 8 - tests/CharsetProberTest.cs | 58 - tests/Makefile.am | 79 - tests/Properties/AssemblyInfo.cs | 19 - tests/UTF-unknown.Tests.csproj | 16 + tests/Ude.Tests.csproj | 153 - tests/Ude.Tests.mdp | 70 - tests/packages.config | 9 - 41 files changed, 168 insertions(+), 6548 deletions(-) create mode 100644 .gitattributes delete mode 100644 AUTHORS delete mode 100644 COPYING delete mode 100644 ChangeLog delete mode 100644 Example/Makefile.am delete mode 100644 Example/Properties/AssemblyInfo.cs delete mode 100644 Example/Ude.Example.csproj delete mode 100644 Example/Ude.Example.mdp delete mode 100644 Example/udetect.in delete mode 100644 INSTALL delete mode 100644 Makefile.am delete mode 100644 Makefile.include delete mode 100644 NEWS create mode 100644 UTF-unknown.sln delete mode 100644 Ude.mds delete mode 100644 Ude.sln delete mode 100644 Ude.sln.DotSettings delete mode 100644 aclocal.m4 delete mode 100755 autogen.sh delete mode 100755 configure delete mode 100644 configure.ac create mode 100644 example/ConsoleExample.csproj rename {Example => example}/Udetect.cs (100%) rename {Example => example}/app.config (100%) delete mode 100755 install-sh create mode 100644 logo.png delete mode 100755 missing delete mode 100644 src/Library/Properties/AssemblyInfo.cs delete mode 100644 src/Makefile.am create mode 100644 src/UTF-unknown.csproj delete mode 100644 src/Ude.csproj delete mode 100644 src/Ude.csproj.DotSettings delete mode 100644 src/Ude.mdp delete mode 100644 src/ude.pc.in delete mode 100644 tests/CharsetProberTest.cs delete mode 100644 tests/Makefile.am delete mode 100644 tests/Properties/AssemblyInfo.cs create mode 100644 tests/UTF-unknown.Tests.csproj delete mode 100644 tests/Ude.Tests.csproj delete mode 100644 tests/Ude.Tests.mdp delete mode 100644 tests/packages.config diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index d20eb95..0000000 --- a/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -rudi pettazzi diff --git a/COPYING b/COPYING deleted file mode 100644 index 2f730be..0000000 --- a/COPYING +++ /dev/null @@ -1 +0,0 @@ -See license directory diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/Example/Makefile.am b/Example/Makefile.am deleted file mode 100644 index 414f28d..0000000 --- a/Example/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -EXTRA_DIST = -COMPILE_TARGET = exe -BUILD_DIR=$(top_builddir)/bin -ASSEMBLY = $(BUILD_DIR)/udetect.exe -PROJECT_REFERENCES = $(BUILD_DIR)/Ude.dll - -if ENABLE_DEBUG_ANY_CPU -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -endif - -if ENABLE_RELEASE_ANY_CPU -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:TRACE" -endif - -EXTRAS = udetect.in -REFERENCES = System - -CLEANFILES = $(BINARIES) -MAINTAINERCLEANFILES = Makefile.in - -FILES = Ude.Example/Udetect.cs Properties/AssemblyInfo.cs - -include $(top_srcdir)/Makefile.include - -UDE_DLL = $(BUILD_DIR)/Ude.dll -BINARIES = $(UDETECT) - -all: $(ASSEMBLY) $(BINARIES) - -UDETECT = $(BUILD_DIR)/udetect - -$(eval $(call emit-deploy-wrapper,UDETECT,udetect, x)) - -$(ASSEMBLY): $(build_sources) $(PROJECT_REFERENCES) - mkdir -p $(dir $(ASSEMBLY)) - gmcs $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_references_ref) - - diff --git a/Example/Properties/AssemblyInfo.cs b/Example/Properties/AssemblyInfo.cs deleted file mode 100644 index 031ec2a..0000000 --- a/Example/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// AssemblyInfo.cs created with MonoDevelop -// -// Author: -// Rudi Pettazzi -// -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Ude.Example")] -[assembly: AssemblyDescription("Ude command line example")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Ude.Example")] -[assembly: AssemblyCopyright("Copyright © 2009 Rudi Pettazzi ")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: AssemblyVersion("0.1.0.0")] diff --git a/Example/Ude.Example.csproj b/Example/Ude.Example.csproj deleted file mode 100644 index 4d3b778..0000000 --- a/Example/Ude.Example.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {F672E6C2-14CC-47B6-8451-4D8AEDE86130} - Ude.Example - Debug - AnyCPU - v3.5 - - - - - 2.0 - - - - Exe - udetect - bin\Debug\ - true - Ude.Example - false - true - true - DEBUG - 4 - - - Exe - udetect - bin\Release\ - false - Ude.Example - false - true - true - - - 4 - - - - - - - - - - - - {7BECB850-389A-44FC-8523-3EF0B2540F07} - Ude - - - - - - \ No newline at end of file diff --git a/Example/Ude.Example.mdp b/Example/Ude.Example.mdp deleted file mode 100644 index 85afc9d..0000000 --- a/Example/Ude.Example.mdp +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Example/udetect.in b/Example/udetect.in deleted file mode 100644 index 8896610..0000000 --- a/Example/udetect.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -exec mono "@prefix@/lib/@PACKAGE@/udetect.exe" $MONO_EXTRA_ARGS "$@" - diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 2ad8248..0000000 --- a/INSTALL +++ /dev/null @@ -1,34 +0,0 @@ -WINDOWS -======= - - Build the Visual Studio 2005 solution "ude.sln". - -LINUX -===== - - You can build the library, the example and the nunit tests with monodelop - and its solution "ude.mds", or using make. To compile the sources tarball: - - $ ./configure.sh --prefix=/usr/local --enable-tests=yes - $ make - - To compile from svn: - - $ ./autogen.sh --prefix=/usr/local --enable-tests=yes - $ make - - You can pick the library (Ude.dll) from the toplevel build directory (./bin) or - you can install it to $prefix/lib/ude by typing: - - $ make install - - This will installs a command-line example program ($prefix/bin/udetect) to test - the library on a given file as: - - $ udetect filename - - To run the nunit tests you can type: - - $ make test - - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 93684f2..0000000 --- a/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -SUBDIRS = src/Library src/Example src/Tests m4 - -clean-local: - rm -rf $(top_builddir)/bin - -if ENABLE_TESTS -test: - @pushd src/Tests; \ - make test; \ - popd; -endif - -MAINTAINERCLEANFILES = Makefile.in diff --git a/Makefile.include b/Makefile.include deleted file mode 100644 index 1fc288f..0000000 --- a/Makefile.include +++ /dev/null @@ -1,35 +0,0 @@ -build_sources = $(FILES) $(GENERATED_FILES) -build_sources_embed = $(build_sources:%='$(srcdir)/%') -build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))) -build_references_ref += $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) -build_references_ref += $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) - -EXTRA_DIST += $(build_sources) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) -CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) -DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* - -pkglib_SCRIPTS = $(ASSEMBLY) -bin_SCRIPTS = $(BINARIES) - -programfilesdir = @libdir@/@PACKAGE@ -programfiles_DATA = $(PROGRAMFILES) -linuxpkgconfigdir = @libdir@/pkgconfig -linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) - -# $(call emit-deploy-target,deploy-variable-name) -define emit-deploy-target -$($1): $($1_SOURCE) - mkdir -p $$(dir $($1)) - cp '$$<' '$$@' -endef - -# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) -# assumes that for a wrapper foo.pc its source template is foo.pc.in -# if $3 is non-empty then wrapper is marked exec -define emit-deploy-wrapper -$($1): $2 - mkdir -p '$$(@D)' - cp '$$<' '$$@' - $(if $3,chmod +x '$$@') -endef - diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/UTF-unknown.sln b/UTF-unknown.sln new file mode 100644 index 0000000..03eb114 --- /dev/null +++ b/UTF-unknown.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.9 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UTF-unknown", "src\UTF-unknown.csproj", "{64CA7BA7-EFD9-4475-BB66-40B187622A73}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleExample", "example\ConsoleExample.csproj", "{386C6ABF-44EA-4418-B90E-E8D21E4C2475}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UTF-unknown.Tests", "Tests\UTF-unknown.Tests.csproj", "{1922DCC9-A45F-4627-9087-CD492BBF7F38}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64CA7BA7-EFD9-4475-BB66-40B187622A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64CA7BA7-EFD9-4475-BB66-40B187622A73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64CA7BA7-EFD9-4475-BB66-40B187622A73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64CA7BA7-EFD9-4475-BB66-40B187622A73}.Release|Any CPU.Build.0 = Release|Any CPU + {386C6ABF-44EA-4418-B90E-E8D21E4C2475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {386C6ABF-44EA-4418-B90E-E8D21E4C2475}.Debug|Any CPU.Build.0 = Debug|Any CPU + {386C6ABF-44EA-4418-B90E-E8D21E4C2475}.Release|Any CPU.ActiveCfg = Release|Any CPU + {386C6ABF-44EA-4418-B90E-E8D21E4C2475}.Release|Any CPU.Build.0 = Release|Any CPU + {1922DCC9-A45F-4627-9087-CD492BBF7F38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1922DCC9-A45F-4627-9087-CD492BBF7F38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1922DCC9-A45F-4627-9087-CD492BBF7F38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1922DCC9-A45F-4627-9087-CD492BBF7F38}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Ude.mds b/Ude.mds deleted file mode 100644 index 6705200..0000000 --- a/Ude.mds +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Ude.sln b/Ude.sln deleted file mode 100644 index 2741f2c..0000000 --- a/Ude.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ude.Example", "src\Example\Ude.Example.csproj", "{F672E6C2-14CC-47B6-8451-4D8AEDE86130}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ude.Tests", "src\Tests\Ude.Tests.csproj", "{53C6763B-CA4B-4F14-9326-A43C29FF0B4E}" - ProjectSection(ProjectDependencies) = postProject - {7BECB850-389A-44FC-8523-3EF0B2540F07} = {7BECB850-389A-44FC-8523-3EF0B2540F07} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ude", "src\Library\Ude.csproj", "{7BECB850-389A-44FC-8523-3EF0B2540F07}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F672E6C2-14CC-47B6-8451-4D8AEDE86130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F672E6C2-14CC-47B6-8451-4D8AEDE86130}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F672E6C2-14CC-47B6-8451-4D8AEDE86130}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {F672E6C2-14CC-47B6-8451-4D8AEDE86130}.Release|Any CPU.Build.0 = Debug|Any CPU - {53C6763B-CA4B-4F14-9326-A43C29FF0B4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53C6763B-CA4B-4F14-9326-A43C29FF0B4E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53C6763B-CA4B-4F14-9326-A43C29FF0B4E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53C6763B-CA4B-4F14-9326-A43C29FF0B4E}.Release|Any CPU.Build.0 = Release|Any CPU - {7BECB850-389A-44FC-8523-3EF0B2540F07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BECB850-389A-44FC-8523-3EF0B2540F07}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BECB850-389A-44FC-8523-3EF0B2540F07}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BECB850-389A-44FC-8523-3EF0B2540F07}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Ude.sln.DotSettings b/Ude.sln.DotSettings deleted file mode 100644 index c3b23be..0000000 --- a/Ude.sln.DotSettings +++ /dev/null @@ -1,18 +0,0 @@ - - - True - - True - - True - - True - - True - - True - - True - - True - UTF \ No newline at end of file diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 891d35a..0000000 --- a/aclocal.m4 +++ /dev/null @@ -1,748 +0,0 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This file 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. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi - -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. -# -# This file 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. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file 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. - -# serial 8 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. -# -# This file 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. - -# serial 13 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file 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. - -# serial 5 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# -# This file 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. - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# serial 3 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file 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. - -# serial 4 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006 Free Software Foundation, Inc. -# -# This file 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. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file 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. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/expansions.m4]) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 12f8691..0000000 --- a/autogen.sh +++ /dev/null @@ -1,60 +0,0 @@ -#! /bin/sh - -PROJECT=Ude -FILE= -CONFIGURE=configure.ac - -: ${AUTOCONF=autoconf} -: ${AUTOMAKE=automake} -: ${ACLOCAL=aclocal} - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd $srcdir -TEST_TYPE=-f -aclocalinclude="-I . -I m4 $ACLOCAL_FLAGS" - -DIE=0 - -($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $PROJECT." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile $PROJECT." - echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -case $CC in -*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;; -esac - -echo "Running $ACLOCAL $aclocalinclude ..." -$ACLOCAL $aclocalinclude - -echo "Running $AUTOMAKE --gnu $am_opt ..." -$AUTOMAKE --add-missing --gnu $am_opt - -echo "Running $AUTOCONF ..." -$AUTOCONF - -echo Running $srcdir/configure $conf_flags "$@" ... -$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \ diff --git a/configure b/configure deleted file mode 100755 index 17a0b69..0000000 --- a/configure +++ /dev/null @@ -1,3789 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Ude 0.1. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='Ude' -PACKAGE_TARNAME='ude' -PACKAGE_VERSION='0.1' -PACKAGE_STRING='Ude 0.1' -PACKAGE_BUGREPORT='' - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -PKG_CONFIG -expanded_libdir -expanded_bindir -expanded_datadir -GMCS -ENABLE_DEBUG_ANY_CPU_TRUE -ENABLE_DEBUG_ANY_CPU_FALSE -ENABLE_RELEASE_ANY_CPU_TRUE -ENABLE_RELEASE_ANY_CPU_FALSE -ENABLE_TESTS_TRUE -ENABLE_TESTS_FALSE -MONO_NUNIT_CFLAGS -MONO_NUNIT_LIBS -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -PKG_CONFIG -MONO_NUNIT_CFLAGS -MONO_NUNIT_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures Ude 0.1 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/ude] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of Ude 0.1:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-debug_any_cpu Use 'DEBUG_ANY_CPU' Configuration default=NO - --enable-release_any_cpu - Use 'RELEASE_ANY_CPU' Configuration default=YES - --enable-tests build unit tests default=yes - -Some influential environment variables: - PKG_CONFIG path to pkg-config utility - MONO_NUNIT_CFLAGS - C compiler flags for MONO_NUNIT, overriding pkg-config - MONO_NUNIT_LIBS - linker flags for MONO_NUNIT, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -Ude configure 0.1 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by Ude $as_me 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.10' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS - -fi - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='ude' - VERSION='0.1' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -# Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "x$PKG_CONFIG" = "xno"; then - { { echo "$as_me:$LINENO: error: You need to install pkg-config" >&5 -echo "$as_me: error: You need to install pkg-config" >&2;} - { (exit 1); exit 1; }; } -fi - - - expanded_libdir=`( - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - eval echo $libdir - )` - - - - expanded_bindir=`( - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - eval echo $bindir - )` - - - - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - - expanded_datadir=`(eval echo $datadir)` - expanded_datadir=`(eval echo $expanded_datadir)` - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -# Extract the first word of "gmcs", so it can be a program name with args. -set dummy gmcs; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GMCS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMCS="$GMCS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GMCS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GMCS" && ac_cv_path_GMCS="no" - ;; -esac -fi -GMCS=$ac_cv_path_GMCS -if test -n "$GMCS"; then - { echo "$as_me:$LINENO: result: $GMCS" >&5 -echo "${ECHO_T}$GMCS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "x$GMCS" = "xno"; then - { { echo "$as_me:$LINENO: error: gmcs Not found" >&5 -echo "$as_me: error: gmcs Not found" >&2;} - { (exit 1); exit 1; }; } -fi - -# Check whether --enable-debug_any_cpu was given. -if test "${enable_debug_any_cpu+set}" = set; then - enableval=$enable_debug_any_cpu; enable_debug_any_cpu=yes -else - enable_debug_any_cpu=no -fi - - if test x$enable_debug_any_cpu = xyes; then - ENABLE_DEBUG_ANY_CPU_TRUE= - ENABLE_DEBUG_ANY_CPU_FALSE='#' -else - ENABLE_DEBUG_ANY_CPU_TRUE='#' - ENABLE_DEBUG_ANY_CPU_FALSE= -fi - -if test "x$enable_debug_any_cpu" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -# Check whether --enable-release_any_cpu was given. -if test "${enable_release_any_cpu+set}" = set; then - enableval=$enable_release_any_cpu; enable_release_any_cpu=yes -else - enable_release_any_cpu=no -fi - - if test x$enable_release_any_cpu = xyes; then - ENABLE_RELEASE_ANY_CPU_TRUE= - ENABLE_RELEASE_ANY_CPU_FALSE='#' -else - ENABLE_RELEASE_ANY_CPU_TRUE='#' - ENABLE_RELEASE_ANY_CPU_FALSE= -fi - -if test "x$enable_release_any_cpu" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -if test -z "$CONFIG_REQUESTED" ; then - if true; then - ENABLE_RELEASE_ANY_CPU_TRUE= - ENABLE_RELEASE_ANY_CPU_FALSE='#' -else - ENABLE_RELEASE_ANY_CPU_TRUE='#' - ENABLE_RELEASE_ANY_CPU_FALSE= -fi - - enable_release_any_cpu=yes -fi - -# Check whether --enable-tests was given. -if test "${enable_tests+set}" = set; then - enableval=$enable_tests; enable_tests=${enableval} -else - enable_tests=no -fi - - - if test x$enable_tests = xyes; then - ENABLE_TESTS_TRUE= - ENABLE_TESTS_FALSE='#' -else - ENABLE_TESTS_TRUE='#' - ENABLE_TESTS_FALSE= -fi - - -if test "x$enable_tests" = "xyes"; then - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi - -fi - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for MONO_NUNIT" >&5 -echo $ECHO_N "checking for MONO_NUNIT... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$MONO_NUNIT_CFLAGS"; then - pkg_cv_MONO_NUNIT_CFLAGS="$MONO_NUNIT_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"mono-nunit\"") >&5 - ($PKG_CONFIG --exists --print-errors "mono-nunit") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_MONO_NUNIT_CFLAGS=`$PKG_CONFIG --cflags "mono-nunit" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$MONO_NUNIT_LIBS"; then - pkg_cv_MONO_NUNIT_LIBS="$MONO_NUNIT_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"mono-nunit\"") >&5 - ($PKG_CONFIG --exists --print-errors "mono-nunit") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_MONO_NUNIT_LIBS=`$PKG_CONFIG --libs "mono-nunit" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - MONO_NUNIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "mono-nunit"` - else - MONO_NUNIT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mono-nunit"` - fi - # Put the nasty error message in config.log where it belongs - echo "$MONO_NUNIT_PKG_ERRORS" >&5 - - { { echo "$as_me:$LINENO: error: Package requirements (mono-nunit) were not met: - -$MONO_NUNIT_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables MONO_NUNIT_CFLAGS -and MONO_NUNIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements (mono-nunit) were not met: - -$MONO_NUNIT_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables MONO_NUNIT_CFLAGS -and MONO_NUNIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables MONO_NUNIT_CFLAGS -and MONO_NUNIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details." >&5 -echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables MONO_NUNIT_CFLAGS -and MONO_NUNIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - MONO_NUNIT_CFLAGS=$pkg_cv_MONO_NUNIT_CFLAGS - MONO_NUNIT_LIBS=$pkg_cv_MONO_NUNIT_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi -fi - - - if test x$enable_tests = xyes; then - ENABLE_TESTS_TRUE= - ENABLE_TESTS_FALSE='#' -else - ENABLE_TESTS_TRUE='#' - ENABLE_TESTS_FALSE= -fi - - -ac_config_files="$ac_config_files Makefile m4/Makefile src/Example/Makefile src/Example/udetect src/Library/ude.pc src/Library/Makefile src/Tests/Makefile" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${ENABLE_DEBUG_ANY_CPU_TRUE}" && test -z "${ENABLE_DEBUG_ANY_CPU_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEBUG_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_DEBUG_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${ENABLE_RELEASE_ANY_CPU_TRUE}" && test -z "${ENABLE_RELEASE_ANY_CPU_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_RELEASE_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_RELEASE_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${ENABLE_RELEASE_ANY_CPU_TRUE}" && test -z "${ENABLE_RELEASE_ANY_CPU_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_RELEASE_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_RELEASE_ANY_CPU\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by Ude $as_me 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -Ude config.status 0.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; - "src/Example/Makefile") CONFIG_FILES="$CONFIG_FILES src/Example/Makefile" ;; - "src/Example/udetect") CONFIG_FILES="$CONFIG_FILES src/Example/udetect" ;; - "src/Library/ude.pc") CONFIG_FILES="$CONFIG_FILES src/Library/ude.pc" ;; - "src/Library/Makefile") CONFIG_FILES="$CONFIG_FILES src/Library/Makefile" ;; - "src/Tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/Tests/Makefile" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -expanded_libdir!$expanded_libdir$ac_delim -expanded_bindir!$expanded_bindir$ac_delim -expanded_datadir!$expanded_datadir$ac_delim -GMCS!$GMCS$ac_delim -ENABLE_DEBUG_ANY_CPU_TRUE!$ENABLE_DEBUG_ANY_CPU_TRUE$ac_delim -ENABLE_DEBUG_ANY_CPU_FALSE!$ENABLE_DEBUG_ANY_CPU_FALSE$ac_delim -ENABLE_RELEASE_ANY_CPU_TRUE!$ENABLE_RELEASE_ANY_CPU_TRUE$ac_delim -ENABLE_RELEASE_ANY_CPU_FALSE!$ENABLE_RELEASE_ANY_CPU_FALSE$ac_delim -ENABLE_TESTS_TRUE!$ENABLE_TESTS_TRUE$ac_delim -ENABLE_TESTS_FALSE!$ENABLE_TESTS_FALSE$ac_delim -MONO_NUNIT_CFLAGS!$MONO_NUNIT_CFLAGS$ac_delim -MONO_NUNIT_LIBS!$MONO_NUNIT_LIBS$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - -echo " -${PACKAGE}-${VERSION} - - Configuration summary - * Install Prefix: ${prefix} - * Datadir: ${expanded_datadir} - * Libdir: ${expanded_libdir} - * C# compiler: ${GMCS} - * Unit tests: ${enable_tests} -" - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 86de42e..0000000 --- a/configure.ac +++ /dev/null @@ -1,82 +0,0 @@ -AC_PREREQ([2.54]) -AC_INIT([Ude], [0.1]) -AM_INIT_AUTOMAKE([foreign]) -dnl AC_SUBST([ACLOCAL_AMFLAGS], ["-I m4 \${ACLOCAL_FLAGS}"]) - -dnl pkg-config -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -if test "x$PKG_CONFIG" = "xno"; then - AC_MSG_ERROR([You need to install pkg-config]) -fi - -SHAMROCK_EXPAND_LIBDIR -SHAMROCK_EXPAND_BINDIR -SHAMROCK_EXPAND_DATADIR - -AC_PROG_INSTALL - -AC_PATH_PROG(GMCS, gmcs, no) -if test "x$GMCS" = "xno"; then - AC_MSG_ERROR([gmcs Not found]) -fi - -AC_ARG_ENABLE(debug_any_cpu, - AC_HELP_STRING([--enable-debug_any_cpu], - [Use 'DEBUG_ANY_CPU' Configuration [default=NO]]), - enable_debug_any_cpu=yes, enable_debug_any_cpu=no) -AM_CONDITIONAL(ENABLE_DEBUG_ANY_CPU, test x$enable_debug_any_cpu = xyes) -if test "x$enable_debug_any_cpu" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(release_any_cpu, - AC_HELP_STRING([--enable-release_any_cpu], - [Use 'RELEASE_ANY_CPU' Configuration [default=YES]]), - enable_release_any_cpu=yes, enable_release_any_cpu=no) -AM_CONDITIONAL(ENABLE_RELEASE_ANY_CPU, test x$enable_release_any_cpu = xyes) -if test "x$enable_release_any_cpu" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -if test -z "$CONFIG_REQUESTED" ; then - AM_CONDITIONAL(ENABLE_RELEASE_ANY_CPU, true) - enable_release_any_cpu=yes -fi - -dnl package checks, common for all configs -dnl PKG_CHECK_MODULES([MONO_NUNIT], [mono-nunit]) -AC_ARG_ENABLE(tests, - AC_HELP_STRING([--enable-tests], - [build unit tests [default=yes]]), - enable_tests=${enableval}, enable_tests=no) - -AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes) - -if test "x$enable_tests" = "xyes"; then - PKG_CHECK_MODULES([MONO_NUNIT], [mono-nunit]) -fi - -AC_SUBST(MONO_NUNIT_LIBS) -AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes) - -AC_CONFIG_FILES([ -Makefile -m4/Makefile -src/Example/Makefile -src/Example/udetect -src/Library/ude.pc -src/Library/Makefile -src/Tests/Makefile -]) - -AC_OUTPUT - -echo " -${PACKAGE}-${VERSION} - - Configuration summary - * Install Prefix: ${prefix} - * Datadir: ${expanded_datadir} - * Libdir: ${expanded_libdir} - * C# compiler: ${GMCS} - * Unit tests: ${enable_tests} -" - diff --git a/example/ConsoleExample.csproj b/example/ConsoleExample.csproj new file mode 100644 index 0000000..5cc7f1f --- /dev/null +++ b/example/ConsoleExample.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp1.1 + + + + + + + \ No newline at end of file diff --git a/Example/Udetect.cs b/example/Udetect.cs similarity index 100% rename from Example/Udetect.cs rename to example/Udetect.cs diff --git a/Example/app.config b/example/app.config similarity index 100% rename from Example/app.config rename to example/app.config diff --git a/install-sh b/install-sh deleted file mode 100755 index a5897de..0000000 --- a/install-sh +++ /dev/null @@ -1,519 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2006-12-25.00 - -# 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. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -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: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -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. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; 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 - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - 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 "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # 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: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # 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 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 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. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# 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: diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a13164e0d12c4697b7d953e290caab36b64fbfa3 GIT binary patch literal 4031 zcmX9>2{=^U8)u9RG7Dv=v5SwAFB$9DGE}z4QsVoFe3qs$_DHU!F_jP{43dcK6vJd~ zEKwLCM5bXvvSrCq{IBPKpXc8DKF|4`_x-)gIp;kTI~z+O0Z9QaE-oP}oVf$|?>=~8 zhrn;SOGPdh7vheUxd}d;`XlGuMf|6oPAOEjK1@9Q-ZOql$sYVW^L>$V<`jbXejEAV z;TreoHdmK+&&fFLj@6PLi7}f8cnj@BowGsO`3VB$i~%efP2FIR@z>Gmzc_B6{``Jf zhJRDmba%IV=%mCi_fOJN}wjz)Ya9)f`4`Bu+Um3l~Tx@ z`l;w%yW3wCnE+Ovo#D7%Sj+$YL{ItLQ^wtx3!t6iiJkAImBOX9x(We`0&40 z6H``f5I&A23)jW*1PIP}m=F6ozYaScTf8+Ea>fc zbx?NV;sV+iG2>xHPkTOS!jfiM`4eq(;?OBw3gvBvjt~>H?ODm*@}YDW)zU58MWSs2 zIJWjsStalbi2jK)BZgf@N2AYZ1yOYaqgL#gadgxNi&Wj?NEz?p>Z@JhTe^{8mf2raIfbzY5-H<4*w8-DY;p!JOn?|A+2sp#Eu9dcrvYTLCtckURZUjJE>$H_|5RY0OTeJq5Q z0`Fb*@p*y!1jDO6x_ysm&_7P|R4q6Rhdc1=9ACp|VkjaIiDSp|7MGSby>~}u=6J2k_NIY zrOPKede5)gg&MW-efU|K53Pz#D93hVf-8b(ts^5Nv8r(ur_c1#DL24po!xQI!qvjF z5X+K|3Lp?P6Ce6JcxmWbagFdp``QqcnT5)hX5}@B=CpxXl{L(SixTq94@HD9WsCDJ z>P}MIq$I%dR@pYVxjvV+u@O?@Z28%VATvA(oTRxpU9h$7*VNExT8%U_GmFqd&MZ&0 zEX(ZO8lNuoGxUgv7?V17ETi!(JHu6{j3(7$R~+d~7))s2+}yl!`}Y3+$L8Vy9evV| z(Q237XIWWU#V0zf3u{(D%C76`ggi+tUEQsW)KpZ7jp-=pF*3px5jc$%c^4IQc8H8LWa zwEpFhy7MNPOdiX#C=?CLHhCgDk#r>S0zkDc*7oW9ZJ5z(c%<;(uUo6r4hi-`LTL8v zX_Z{t-O{tP@uQFig_?G^ip}pHB;pwxbRCqWR`4Zqxv7Cdp|D$9Tf1t)x<|~?0sPB> zr#~@1blW_mKYTus8z)0LCRKsaD$_4aX5iR~f}1yQrZ-wB;GWNT$>&u?y$cNuUAl|@ zz{IPb4;H=(^=u3pAS+L>H^GhdwsVNYQC?yGB*wF3N{iRR!h#aeHBdhAq>fF9$DW7J zG&MCv-0XKv#|No>>7I_UF+<(*Mrk$qS4yVE(l>qGCl{nE|km4GDT&apYw>s(sh7QWcPK;!$z`}`d54+I!wZdpX8Cc zWXZW%eO=xEe#D!)1nW^qKr3cwaB%Qp_-a){!=>?Fya$t`Xw3_mwX+3J3bxsFuJLUG zBhXT>DCQAAW2WRv1~bs9@;u&_TOE~nA+j`PyZEpA=Yml0qba~kmZl>bHnW4`8SDFAp{b}CQBHg^Iy z-np}*XX*SZ^>132Fvx2=@kHmdEs}~+`O5nINB5s!=9DOD=Atm_Tey>xlhL{HLz8#G z-K&==v&axyN`=N^35b@x9e*~_<`Km5pYw7yM1%%tGV(t^zbp}sBRdUSGgcNPB~$R& zH6I#V(<7^M=8WL4rO93Y!B7V7T&;7#VYgEcRNI>JvB>U4pdvVWeU3T&d~u-UzKRWX zMZD4LFOQt(72uK&wb#tp?_~Ck)%qA0E*!n0azAb82uMuR$=SKdr$1K-{*B#By42Bu zDH`auf+WkH{(4OXnOj(>bR!}nlT%bOKR-`q8+YEgF*E)#@3d}Gg`wxcDm6g z@O-~`0CdXdIPrM|1oJ}o4w>wuuct@7eA>3%L&et=T~Ge@?b~6u=9bs5J3{~I1iAa{ z?(7&;Y+i|t-91YsbDLtSLA5e`$XdU$wz zPfjr1$xlj7zHQ?iHvdCBT!tYgCf1a3;-BccgK`>3csrnM-XpEAuTTA;$4i;czR}#E z9DTO%jMJc2%^X>D&$@6h>BEN$oA=aF-BQ!~Po@7DfSc;^lz8k~C zjsmRucz;}j;{N+g?PECx5kHI6$(r44A{w!?)_8z>GoW7GpKD03uB%hF5N8Yx4J`)f zWM>RFs}BXi^X?o#3}CagT~=G%e%kQfz`%fIK|ujA3Hdh(o@Ynau_NYphBrQTr+xZ6 zYEI_o+HC)nQONfr3>0JvBT0#a-THwjiuquk=y@$XJiMZ`RK1dZqR!6nk!v!JuZwB_ zxWf|_S${ajod~YOAO!^lUMWJ%DQ*&cXYcITip2JueY)#TzD3Kq3{8!?*RS2CK7al= zDWks9`?8pxe^ti)0s=@Ye$muq7`Dpp*uO#}=EszwWQ|k0w(F}ajbqY^EfPILJw2bP zTC0~5A_p&|V`a^s2?ir4hM7zzKt;u=0tSf;=PEfGj|fGiJMP~Gh6qRWB!vbT!0P;; zq9y=-MgAF+D*pJGG_D*)Ay5>E#}fG(agrcd3&BDT< zVQ7&htZY0UKoW(~JQAR`d59cxg8R%VNCeUvYKo@uz`YLrM5pt|V;guMqV-ew^6_YB ztbStLU2q=hU>=g!5uB%SkOK7KM(SJ3Y%ENdznE+@yTVjMLN2yG6@6JmT0nhg=^lOl zmDpHdnS8CWvC;F7Ya&4nxB#^0ksi0z zYBfmq?fZHa6w$O72oaFnS-nJC$=Jwot>Y;0ip0?1!&vy~O)qr{w zJ{Cq2PCW-UUpRH;H)efF7yoa5gZ53@sPCW#iaRW3R{|ZtOwsiM#$Asd_2C6`*=w<3 zGN?zqjD~_&jX7Q1WxhT^uu5h-hQV@EgPOKlg%dF;e5sNE61Ma%@IVB8ge|S&%+LsV z&__Fhg@OiHiTH!!LRe;jc_=vw<5nrL9X}97!8&u#e#QF}O%3 z`+2wbwx^Sll12+wSEsvz*cn};h1m1PaJ&+-TP`3%+g`aSx28g{bjoU0d2yLWUx8!J zAaO^14K+G8KU#Wm1JD#56(DHn5TwN9G8NiqpEqQ?HliSOvGqw$IYRn5cZKYe>(iij zF<4X9Txr6hC4KP(4>f0FWa2eH-Y_Uh pI|h6B={Tt3!`BvWF0TE3nYufhiPPyp;KiKF%EHFH!t~$R{{dixlwJS; literal 0 HcmV?d00001 diff --git a/missing b/missing deleted file mode 100755 index 1c8ff70..0000000 --- a/missing +++ /dev/null @@ -1,367 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2006-05-10.23 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 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=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# 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' - autom4te touch the output file, or create a stub one - 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 ." - 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 "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - 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 test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -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 test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -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 "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -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 "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - 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: diff --git a/src/Library/Properties/AssemblyInfo.cs b/src/Library/Properties/AssemblyInfo.cs deleted file mode 100644 index 3a9682a..0000000 --- a/src/Library/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -// AssemblyInfo.cs created with MonoDevelop -// -// Author: -// Rudi Pettazzi -// -using System.Reflection; - -[assembly: AssemblyTitle("Ude")] -[assembly: AssemblyDescription("C# port of Mozilla Universal Charset Detector")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Ude")] -[assembly: AssemblyCopyright("Copyright © 2009 Rudi Pettazzi ")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] - - - diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 3fcbedd..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ - -EXTRA_DIST = -BUILD_DIR=$(top_builddir)/bin -ASSEMBLY = $(BUILD_DIR)/Ude.dll -COMPILE_TARGET = library -LINUX_PKGCONFIG = $(UDE_PC) - -if ENABLE_DEBUG_ANY_CPU -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY_MDB = $(ASSEMBLY).mdb -endif - -if ENABLE_RELEASE_ANY_CPU -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE" -ASSEMBLY_MDB = -endif - -all: $(ASSEMBLY) $(LINUX_PKGCONFIG) - -FILES = \ - Ude.Core/CharDistributionAnalyser.cs \ - Ude.Core/CharsetProber.cs \ - Properties/AssemblyInfo.cs \ - Ude.Core/CodingStateMachine.cs \ - Ude.Core/EscCharsetProber.cs \ - Ude.Core/EscSM.cs \ - Ude.Core/HebrewProber.cs \ - Ude.Core/Latin1Prober.cs \ - Ude.Core/MBCSGroupProber.cs \ - Ude.Core/BitPackage.cs \ - Ude.Core/SBCharsetProber.cs \ - Ude.Core/SBCSGroupProber.cs \ - Ude.Core/UniversalDetector.cs \ - Ude.Core/UTF8Prober.cs \ - Ude.Core/MBCSSM.cs \ - Ude.Core/SequenceModel.cs \ - Ude.Core/GB18030Prober.cs \ - Ude.Core/SMModel.cs \ - Ude.Core/LangCyrillicModel.cs \ - Ude.Core/LangBulgarianModel.cs \ - Ude.Core/LangHebrewModel.cs \ - Ude.Core/LangGreekModel.cs \ - Ude.Core/LangHungarianModel.cs \ - Ude.Core/LangThaiModel.cs \ - Ude.Core/Big5Prober.cs \ - Ude.Core/EUCJPProber.cs \ - Ude.Core/EUCKRProber.cs \ - Ude.Core/EUCTWProber.cs \ - Ude.Core/JapaneseContextAnalyser.cs \ - Ude.Core/SJISProber.cs \ - Ude/ICharsetDetector.cs \ - Ude/CharsetDetector.cs \ - Ude/DetectionConfidence.cs \ - Ude.Core/Charsets.cs - -EXTRAS = ude.pc.in -REFERENCES = System -UDE_PC = $(BUILD_DIR)/ude.pc - -CLEANFILES = $(LINUX_PKGCONFIG) $(ASSEMBLY) $(ASSEMBLY_MDB) $(UDE_PC) -MAINTAINERCLEANFILES = Makefile.in - -include $(top_srcdir)/Makefile.include - -$(eval $(call emit-deploy-wrapper,UDE_PC,ude.pc)) - -$(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) - mkdir -p $(dir $(ASSEMBLY)) - gmcs $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_references_ref) - diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj new file mode 100644 index 0000000..a5ce717 --- /dev/null +++ b/src/UTF-unknown.csproj @@ -0,0 +1,43 @@ + + + + netstandard1.3;net40 + + + UTF.Unknown + UTF.Unknown + 1.0.0-alpha1 + + + + Library + + + Julian Verdurmen, Rudi Pettazzi, Shy Shalom + en-US + UTF Unknown + + + Easily detect characterset for files, strings, steams and other bytes. + + Detection of character sets with a simple, redesigned, interface. + + This package is forked from Ude (https://github.com/errepi/ude), + which is a port of the Mozilla Universal Charset Detector (https://mxr.mozilla.org/mozilla/source/extensions/universalchardet/). + + + + + + + charset;detection;unicode;ascii;netstandard + First alpha + + https://github.com/CharsetDetector/UTF-unknown + https://github.com/CharsetDetector/UTF-unknown/blob/master/license/MPL-1.1.txt + false + git + https://github.com/CharsetDetector/UTF-unknown + + + \ No newline at end of file diff --git a/src/Ude.csproj b/src/Ude.csproj deleted file mode 100644 index 3eea61e..0000000 --- a/src/Ude.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {7BECB850-389A-44FC-8523-3EF0B2540F07} - Library - Properties - Ude - Ude - - - v3.5 - - - - - 2.0 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - Library - Ude - Ude - false - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - Library - Ude - false - Ude - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Ude.csproj.DotSettings b/src/Ude.csproj.DotSettings deleted file mode 100644 index f3bff25..0000000 --- a/src/Ude.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/Ude.mdp b/src/Ude.mdp deleted file mode 100644 index 9a6d1f3..0000000 --- a/src/Ude.mdp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ude.pc.in b/src/ude.pc.in deleted file mode 100644 index 33af5cf..0000000 --- a/src/ude.pc.in +++ /dev/null @@ -1,8 +0,0 @@ -prefix=@prefix@ -assemblies_dir=${prefix}/lib/@PACKAGE@ -Libraries=${assemblies_dir}/Ude.dll - -Name: Ude -Description: C# porting of Mozilla Universal Charset Detector -Version: 0.1 -Libs: -r:@prefix@/lib/@PACKAGE@/Ude.dll diff --git a/tests/CharsetProberTest.cs b/tests/CharsetProberTest.cs deleted file mode 100644 index 1e5a162..0000000 --- a/tests/CharsetProberTest.cs +++ /dev/null @@ -1,58 +0,0 @@ -// CharsetProberTest.cs created with MonoDevelop -// -// Author: -// Rudi Pettazzi -// - -using Ude.Core; -using Xunit; - -namespace Ude.Tests -{ - public class CharsetProberTest - { - [Fact] - public void TestFilterWithEnglishLetter() - { - byte[] buf = { 0xBF, 0x68, 0x21, 0x21, 0x65, 0x6C, 0x6F, 0x21, 0x21 }; - DummyCharsetProber p = new DummyCharsetProber(); - p.TestFilterWithEnglishLetter(buf, 0, buf.Length); - } - - [Fact] - public void TestFilterWithoutEnglishLetter() - { - byte[] buf = { 0xEE, 0x21, 0x6C, 0x21, 0xEE, 0x6C, 0x6C }; - DummyCharsetProber p = new DummyCharsetProber(); - p.TestFilterWithoutEnglishLetter(buf, 0, buf.Length); - - - } - - - private class DummyCharsetProber : CharsetProber - { - public byte[] TestFilterWithEnglishLetter(byte[] buf, int offset, int len) - { - return FilterWithEnglishLetters(buf, offset, len); - } - - public byte[] TestFilterWithoutEnglishLetter(byte[] buf, int offset, int len) - { - return FilterWithoutEnglishLetters(buf, offset, len); - } - - public override float GetConfidence() { return 0.0f; } - public override void Reset() { } - public override string GetCharsetName() { return null; } - public override ProbingState HandleData(byte[] buf, int offset, int len) - { - return ProbingState.Detecting; - } - - } - - - } -} - diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 2d79b73..0000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -if ENABLE_TESTS - -EXTRA_DIST = -COMPILE_TARGET = library -BUILD_DIR=bin/Debug -ASSEMBLY = $(BUILD_DIR)/Ude.Tests.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -PROJECT_REFERENCES = $(top_builddir)/bin/Ude.dll -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" - -FILES = \ - Properties/AssemblyInfo.cs \ - Ude.Tests/BitPackageTest.cs \ - Ude.Tests/CharsetDetectorTest.cs \ - Ude.Tests/CharsetProberTest.cs \ - Ude.Tests/CharsetDetectorTestBatch.cs - -EXTRAS = \ - Data/big5/1.txt \ - Data/eucjp/1.txt \ - Data/euckr/euc1.txt \ - Data/euckr/euc2.txt \ - Data/gb18030/1.txt \ - Data/ibm855/1.txt \ - Data/ibm866/1.txt \ - Data/iso2022jp/1.txt \ - Data/iso2022kr/iso1.txt \ - Data/iso2022kr/iso2.txt \ - Data/iso88597/greek.txt \ - Data/koi8r/1.txt \ - Data/latin1/1.txt \ - Data/latin1/2.txt \ - Data/latin1/3.txt \ - Data/latin1/4.txt \ - Data/maccyrillic/1.txt \ - Data/shiftjis/1.txt \ - Data/shiftjis/2.txt \ - Data/shiftjis/3.txt \ - Data/shiftjis/4.txt \ - Data/utf8/1.txt \ - Data/utf8/2.txt \ - Data/utf8/3.txt \ - Data/utf8/4.txt \ - Data/utf8/5.txt \ - Data/utf8/greek.txt \ - Data/utf8/he1.txt \ - Data/utf8/he2.txt \ - Data/utf8/he3.txt \ - Data/utf8/russian.txt \ - Data/windows1251/1.txt \ - Data/windows1253/greek.txt \ - Data/windows1255/he1.txt \ - Data/windows1255/he2.txt \ - Data/windows1255/he3.txt - -REFERENCES = System $(MONO_NUNIT_LIBS) -PROGRAMFILES = $(UDE_DLL) - -CLEANFILES = $(PROGRAMFILES) $(BUILD_DIR)/* -MAINTAINERCLEANFILES = Makefile.in - -all: $(ASSEMBLY) $(PROGRAMFILES) - -test: $(ASSEMBLY) - nunit-console $(ASSEMBLY) - -include $(top_srcdir)/Makefile.include - -UDE_DLL = $(top_builddir)/bin/Ude.dll - -$(eval $(call emit-deploy-target,UDE_DLL)) - -$(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) - mkdir -p $(dir $(ASSEMBLY)) - cp $(PROGRAMFILES) $(dir $(ASSEMBLY)) - gmcs $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_references_ref) - -endif - diff --git a/tests/Properties/AssemblyInfo.cs b/tests/Properties/AssemblyInfo.cs deleted file mode 100644 index f5e030e..0000000 --- a/tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// AssemblyInfo.cs created with MonoDevelop -// -// Author: -// Rudi Pettazzi -// -using System.Reflection; - -[assembly: AssemblyTitle("Ude.Tests")] -[assembly: AssemblyDescription("Unit tests for Ude")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Ude.Tests")] -[assembly: AssemblyCopyright("Copyright © rudi pettazzi 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] - diff --git a/tests/UTF-unknown.Tests.csproj b/tests/UTF-unknown.Tests.csproj new file mode 100644 index 0000000..add65b6 --- /dev/null +++ b/tests/UTF-unknown.Tests.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp1.1 + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Ude.Tests.csproj b/tests/Ude.Tests.csproj deleted file mode 100644 index 4c49ab2..0000000 --- a/tests/Ude.Tests.csproj +++ /dev/null @@ -1,153 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {53C6763B-CA4B-4F14-9326-A43C29FF0B4E} - Library - Ude.Tests - UdeTests - v4.5 - - - - - 2.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - Library - Ude.Tests - Ude.Tests - false - true - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - Library - Ude.Tests - true - Ude.Tests - false - true - false - - - - - - ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - - - - - - - - - {7BECB850-389A-44FC-8523-3EF0B2540F07} - Ude - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 - true - - - \ No newline at end of file diff --git a/tests/Ude.Tests.mdp b/tests/Ude.Tests.mdp deleted file mode 100644 index cf257cd..0000000 --- a/tests/Ude.Tests.mdp +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/packages.config b/tests/packages.config deleted file mode 100644 index 69a4ec4..0000000 --- a/tests/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file From 58e0b4cbe92fd660e1ce0434d789e41f3b78a581 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 20:24:17 +0200 Subject: [PATCH 33/41] adjust namespaces --- example/Udetect.cs | 4 ++-- src/CharsetDetector.cs | 4 ++-- src/Core/BIG5DistributionAnalyser.cs | 2 +- src/Core/BIG5SMModel.cs | 2 +- src/Core/Big5Prober.cs | 2 +- src/Core/BitPackage.cs | 2 +- src/Core/BulgarianModel.cs | 2 +- src/Core/CharDistributionAnalyser.cs | 2 +- src/Core/CharsetProber.cs | 2 +- src/Core/Charsets.cs | 2 +- src/Core/CodingStateMachine.cs | 2 +- src/Core/CyrillicModel.cs | 2 +- src/Core/EUCJPContextAnalyser.cs | 2 +- src/Core/EUCJPDistributionAnalyser.cs | 2 +- src/Core/EUCJPProber.cs | 2 +- src/Core/EUCJPSMModel.cs | 2 +- src/Core/EUCKRDistributionAnalyser.cs | 2 +- src/Core/EUCKRProber.cs | 2 +- src/Core/EUCKRSMModel.cs | 2 +- src/Core/EUCTWDistributionAnalyser.cs | 2 +- src/Core/EUCTWProber.cs | 2 +- src/Core/EUCTWSMModel.cs | 2 +- src/Core/EscCharsetProber.cs | 2 +- src/Core/GB18030DistributionAnalyser.cs | 2 +- src/Core/GB18030Prober.cs | 2 +- src/Core/GB18030SMModel.cs | 2 +- src/Core/GreekModel.cs | 2 +- src/Core/HZSMModel.cs | 2 +- src/Core/HebrewModel.cs | 2 +- src/Core/HebrewProber.cs | 2 +- src/Core/HungarianModel.cs | 2 +- src/Core/ISO2022CNSMModel.cs | 2 +- src/Core/ISO2022JPSMModel.cs | 2 +- src/Core/ISO2022KRSMModel.cs | 2 +- src/Core/Ibm855Model.cs | 2 +- src/Core/Ibm866Model.cs | 2 +- src/Core/InputState.cs | 2 +- src/Core/JapaneseContextAnalyser.cs | 2 +- src/Core/Koi8rModel.cs | 2 +- src/Core/Latin1Prober.cs | 2 +- src/Core/Latin2HungarianModel.cs | 2 +- src/Core/Latin5BulgarianModel.cs | 2 +- src/Core/Latin5Model.cs | 2 +- src/Core/Latin7Model.cs | 2 +- src/Core/MBCSGroupProber.cs | 2 +- src/Core/MacCyrillicModel.cs | 2 +- src/Core/ProbingState.cs | 2 +- src/Core/SBCSGroupProber.cs | 2 +- src/Core/SJISContextAnalyser.cs | 2 +- src/Core/SJISDistributionAnalyser.cs | 2 +- src/Core/SJISProber.cs | 2 +- src/Core/SJISSMModel.cs | 2 +- src/Core/SMModel.cs | 2 +- src/Core/SequenceModel.cs | 2 +- src/Core/SingleByteCharSetProber.cs | 2 +- src/Core/ThaiModel.cs | 2 +- src/Core/UCS2BESMModel.cs | 2 +- src/Core/UCS2LESMModel.cs | 2 +- src/Core/UTF8Prober.cs | 2 +- src/Core/UTF8SMModel.cs | 2 +- src/Core/Win1250HungarianModel.cs | 2 +- src/Core/Win1251BulgarianModel.cs | 2 +- src/Core/Win1251Model.cs | 2 +- src/Core/Win1253Model.cs | 2 +- src/Core/Win1255Model.cs | 2 +- src/DetectionConfidence.cs | 2 +- src/{V2 => }/DetectionResult.cs | 4 ++-- src/{V2 => }/DetectionSummary.cs | 2 +- src/UTF-unknown.csproj | 1 + tests/BitPackageTest.cs | 4 ++-- tests/CharsetDetectorTest.cs | 3 ++- tests/CharsetDetectorTestBatch.cs | 3 ++- tests/UTF-unknown.Tests.csproj | 1 + 73 files changed, 79 insertions(+), 75 deletions(-) rename src/{V2 => }/DetectionResult.cs (96%) rename src/{V2 => }/DetectionSummary.cs (97%) diff --git a/example/Udetect.cs b/example/Udetect.cs index 1505509..dc950d4 100644 --- a/example/Udetect.cs +++ b/example/Udetect.cs @@ -5,9 +5,9 @@ // using System; -using System.IO; +using UtfUnknown; -namespace Ude.Example +namespace ConsoleExample { public class Udetect { diff --git a/src/CharsetDetector.cs b/src/CharsetDetector.cs index 43e6e1c..92f4de2 100644 --- a/src/CharsetDetector.cs +++ b/src/CharsetDetector.cs @@ -40,9 +40,9 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Ude.Core; +using UtfUnknown.Core; -namespace Ude +namespace UtfUnknown { /// /// Default implementation of charset detection interface. diff --git a/src/Core/BIG5DistributionAnalyser.cs b/src/Core/BIG5DistributionAnalyser.cs index f44783e..fb91fb6 100644 --- a/src/Core/BIG5DistributionAnalyser.cs +++ b/src/Core/BIG5DistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class BIG5DistributionAnalyser : CharDistributionAnalyser { diff --git a/src/Core/BIG5SMModel.cs b/src/Core/BIG5SMModel.cs index e59a81f..b75c886 100644 --- a/src/Core/BIG5SMModel.cs +++ b/src/Core/BIG5SMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class BIG5SMModel : SMModel { diff --git a/src/Core/Big5Prober.cs b/src/Core/Big5Prober.cs index af10359..27cdf4f 100644 --- a/src/Core/Big5Prober.cs +++ b/src/Core/Big5Prober.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class Big5Prober : CharsetProber { diff --git a/src/Core/BitPackage.cs b/src/Core/BitPackage.cs index 2e66edb..3774579 100644 --- a/src/Core/BitPackage.cs +++ b/src/Core/BitPackage.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class BitPackage { diff --git a/src/Core/BulgarianModel.cs b/src/Core/BulgarianModel.cs index a70a2c0..b44bac5 100644 --- a/src/Core/BulgarianModel.cs +++ b/src/Core/BulgarianModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class BulgarianModel : SequenceModel { diff --git a/src/Core/CharDistributionAnalyser.cs b/src/Core/CharDistributionAnalyser.cs index fb5eab6..4e0b591 100644 --- a/src/Core/CharDistributionAnalyser.cs +++ b/src/Core/CharDistributionAnalyser.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { /// /// Base class for the Character Distribution Method, used for diff --git a/src/Core/CharsetProber.cs b/src/Core/CharsetProber.cs index 650d74a..e77300f 100644 --- a/src/Core/CharsetProber.cs +++ b/src/Core/CharsetProber.cs @@ -38,7 +38,7 @@ using System.IO; -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class CharsetProber { diff --git a/src/Core/Charsets.cs b/src/Core/Charsets.cs index d5ab94a..0d5242a 100644 --- a/src/Core/Charsets.cs +++ b/src/Core/Charsets.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude +namespace UtfUnknown.Core { /// /// TODO a lot of is unused diff --git a/src/Core/CodingStateMachine.cs b/src/Core/CodingStateMachine.cs index 5ae3030..f227df3 100644 --- a/src/Core/CodingStateMachine.cs +++ b/src/Core/CodingStateMachine.cs @@ -37,7 +37,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { /// /// Parallel state machine for the Coding Scheme Method diff --git a/src/Core/CyrillicModel.cs b/src/Core/CyrillicModel.cs index 245ce66..a046bea 100644 --- a/src/Core/CyrillicModel.cs +++ b/src/Core/CyrillicModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class CyrillicModel : SequenceModel { diff --git a/src/Core/EUCJPContextAnalyser.cs b/src/Core/EUCJPContextAnalyser.cs index 141ea8c..acdbfb6 100644 --- a/src/Core/EUCJPContextAnalyser.cs +++ b/src/Core/EUCJPContextAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCJPContextAnalyser : JapaneseContextAnalyser { diff --git a/src/Core/EUCJPDistributionAnalyser.cs b/src/Core/EUCJPDistributionAnalyser.cs index 9fe4152..660b026 100644 --- a/src/Core/EUCJPDistributionAnalyser.cs +++ b/src/Core/EUCJPDistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCJPDistributionAnalyser : SJISDistributionAnalyser { diff --git a/src/Core/EUCJPProber.cs b/src/Core/EUCJPProber.cs index 58a8211..7c5a82d 100644 --- a/src/Core/EUCJPProber.cs +++ b/src/Core/EUCJPProber.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCJPProber : CharsetProber { diff --git a/src/Core/EUCJPSMModel.cs b/src/Core/EUCJPSMModel.cs index 60729f9..f6a1d53 100644 --- a/src/Core/EUCJPSMModel.cs +++ b/src/Core/EUCJPSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCJPSMModel : SMModel { diff --git a/src/Core/EUCKRDistributionAnalyser.cs b/src/Core/EUCKRDistributionAnalyser.cs index e2aa724..01b3ad2 100644 --- a/src/Core/EUCKRDistributionAnalyser.cs +++ b/src/Core/EUCKRDistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCKRDistributionAnalyser : CharDistributionAnalyser { diff --git a/src/Core/EUCKRProber.cs b/src/Core/EUCKRProber.cs index ad288ff..97fb1ef 100644 --- a/src/Core/EUCKRProber.cs +++ b/src/Core/EUCKRProber.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCKRProber : CharsetProber { diff --git a/src/Core/EUCKRSMModel.cs b/src/Core/EUCKRSMModel.cs index 93806d1..48931f1 100644 --- a/src/Core/EUCKRSMModel.cs +++ b/src/Core/EUCKRSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCKRSMModel : SMModel { diff --git a/src/Core/EUCTWDistributionAnalyser.cs b/src/Core/EUCTWDistributionAnalyser.cs index 8ef7c5f..252f63a 100644 --- a/src/Core/EUCTWDistributionAnalyser.cs +++ b/src/Core/EUCTWDistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCTWDistributionAnalyser : CharDistributionAnalyser { diff --git a/src/Core/EUCTWProber.cs b/src/Core/EUCTWProber.cs index dabf09d..07e93a3 100644 --- a/src/Core/EUCTWProber.cs +++ b/src/Core/EUCTWProber.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCTWProber : CharsetProber { diff --git a/src/Core/EUCTWSMModel.cs b/src/Core/EUCTWSMModel.cs index c8b13be..51cca93 100644 --- a/src/Core/EUCTWSMModel.cs +++ b/src/Core/EUCTWSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class EUCTWSMModel : SMModel { diff --git a/src/Core/EscCharsetProber.cs b/src/Core/EscCharsetProber.cs index 4a3ac8a..3e67c9a 100644 --- a/src/Core/EscCharsetProber.cs +++ b/src/Core/EscCharsetProber.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class EscCharsetProber : CharsetProber { diff --git a/src/Core/GB18030DistributionAnalyser.cs b/src/Core/GB18030DistributionAnalyser.cs index fb3469b..0851e84 100644 --- a/src/Core/GB18030DistributionAnalyser.cs +++ b/src/Core/GB18030DistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class GB18030DistributionAnalyser : CharDistributionAnalyser { diff --git a/src/Core/GB18030Prober.cs b/src/Core/GB18030Prober.cs index e9a52b0..b327964 100644 --- a/src/Core/GB18030Prober.cs +++ b/src/Core/GB18030Prober.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { // We use gb18030 to replace gb2312, because 18030 is a superset. public class GB18030Prober : CharsetProber diff --git a/src/Core/GB18030SMModel.cs b/src/Core/GB18030SMModel.cs index fd14f79..479f5c8 100644 --- a/src/Core/GB18030SMModel.cs +++ b/src/Core/GB18030SMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class GB18030SMModel : SMModel { diff --git a/src/Core/GreekModel.cs b/src/Core/GreekModel.cs index 8a015b0..d8b3464 100644 --- a/src/Core/GreekModel.cs +++ b/src/Core/GreekModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class GreekModel : SequenceModel { diff --git a/src/Core/HZSMModel.cs b/src/Core/HZSMModel.cs index 1be8c46..3a02881 100644 --- a/src/Core/HZSMModel.cs +++ b/src/Core/HZSMModel.cs @@ -39,7 +39,7 @@ /// /// Escaped charsets state machines /// -namespace Ude.Core +namespace UtfUnknown.Core { public class HZSMModel : SMModel { diff --git a/src/Core/HebrewModel.cs b/src/Core/HebrewModel.cs index 9260d70..ef92579 100644 --- a/src/Core/HebrewModel.cs +++ b/src/Core/HebrewModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class HebrewModel : SequenceModel { diff --git a/src/Core/HebrewProber.cs b/src/Core/HebrewProber.cs index b296568..166541f 100644 --- a/src/Core/HebrewProber.cs +++ b/src/Core/HebrewProber.cs @@ -135,7 +135,7 @@ * charset identified, either "windows-1255" or "ISO-8859-8". * */ -namespace Ude.Core +namespace UtfUnknown.Core { /// diff --git a/src/Core/HungarianModel.cs b/src/Core/HungarianModel.cs index b17970d..cde6544 100644 --- a/src/Core/HungarianModel.cs +++ b/src/Core/HungarianModel.cs @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class HungarianModel : SequenceModel { diff --git a/src/Core/ISO2022CNSMModel.cs b/src/Core/ISO2022CNSMModel.cs index b0441f1..a317917 100644 --- a/src/Core/ISO2022CNSMModel.cs +++ b/src/Core/ISO2022CNSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class ISO2022CNSMModel : SMModel { diff --git a/src/Core/ISO2022JPSMModel.cs b/src/Core/ISO2022JPSMModel.cs index 5f519bd..53f8431 100644 --- a/src/Core/ISO2022JPSMModel.cs +++ b/src/Core/ISO2022JPSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class ISO2022JPSMModel : SMModel { diff --git a/src/Core/ISO2022KRSMModel.cs b/src/Core/ISO2022KRSMModel.cs index f982758..c630115 100644 --- a/src/Core/ISO2022KRSMModel.cs +++ b/src/Core/ISO2022KRSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class ISO2022KRSMModel : SMModel { diff --git a/src/Core/Ibm855Model.cs b/src/Core/Ibm855Model.cs index 936c2ff..6aba62d 100644 --- a/src/Core/Ibm855Model.cs +++ b/src/Core/Ibm855Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Ibm855Model : CyrillicModel { diff --git a/src/Core/Ibm866Model.cs b/src/Core/Ibm866Model.cs index 09e3787..3e6416a 100644 --- a/src/Core/Ibm866Model.cs +++ b/src/Core/Ibm866Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Ibm866Model : CyrillicModel { diff --git a/src/Core/InputState.cs b/src/Core/InputState.cs index df9d81d..28f398f 100644 --- a/src/Core/InputState.cs +++ b/src/Core/InputState.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { enum InputState { diff --git a/src/Core/JapaneseContextAnalyser.cs b/src/Core/JapaneseContextAnalyser.cs index 1303e05..b3f451e 100644 --- a/src/Core/JapaneseContextAnalyser.cs +++ b/src/Core/JapaneseContextAnalyser.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class JapaneseContextAnalyser { diff --git a/src/Core/Koi8rModel.cs b/src/Core/Koi8rModel.cs index 0a37686..752b4c2 100644 --- a/src/Core/Koi8rModel.cs +++ b/src/Core/Koi8rModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Koi8rModel : CyrillicModel { diff --git a/src/Core/Latin1Prober.cs b/src/Core/Latin1Prober.cs index a8546df..5a85955 100644 --- a/src/Core/Latin1Prober.cs +++ b/src/Core/Latin1Prober.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { // TODO: Using trigrams the detector should be able to discriminate between // latin-1 and iso8859-2 diff --git a/src/Core/Latin2HungarianModel.cs b/src/Core/Latin2HungarianModel.cs index 3bfab2e..5356ecc 100644 --- a/src/Core/Latin2HungarianModel.cs +++ b/src/Core/Latin2HungarianModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Latin2HungarianModel : HungarianModel { diff --git a/src/Core/Latin5BulgarianModel.cs b/src/Core/Latin5BulgarianModel.cs index b486964..d397a2e 100644 --- a/src/Core/Latin5BulgarianModel.cs +++ b/src/Core/Latin5BulgarianModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Latin5BulgarianModel : BulgarianModel { diff --git a/src/Core/Latin5Model.cs b/src/Core/Latin5Model.cs index 0f975e8..badef07 100644 --- a/src/Core/Latin5Model.cs +++ b/src/Core/Latin5Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Latin5Model : CyrillicModel { diff --git a/src/Core/Latin7Model.cs b/src/Core/Latin7Model.cs index f181e9f..bd135a9 100644 --- a/src/Core/Latin7Model.cs +++ b/src/Core/Latin7Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Latin7Model : GreekModel { diff --git a/src/Core/MBCSGroupProber.cs b/src/Core/MBCSGroupProber.cs index dcc9f06..1060cbc 100644 --- a/src/Core/MBCSGroupProber.cs +++ b/src/Core/MBCSGroupProber.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { /// /// Multi-byte charsets probers diff --git a/src/Core/MacCyrillicModel.cs b/src/Core/MacCyrillicModel.cs index 39e9666..f6b44c7 100644 --- a/src/Core/MacCyrillicModel.cs +++ b/src/Core/MacCyrillicModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class MacCyrillicModel : CyrillicModel { diff --git a/src/Core/ProbingState.cs b/src/Core/ProbingState.cs index b3b6013..c932f88 100644 --- a/src/Core/ProbingState.cs +++ b/src/Core/ProbingState.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public enum ProbingState { diff --git a/src/Core/SBCSGroupProber.cs b/src/Core/SBCSGroupProber.cs index 2d38e09..1223136 100644 --- a/src/Core/SBCSGroupProber.cs +++ b/src/Core/SBCSGroupProber.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { public class SBCSGroupProber : CharsetProber { diff --git a/src/Core/SJISContextAnalyser.cs b/src/Core/SJISContextAnalyser.cs index e74a442..34ff82b 100644 --- a/src/Core/SJISContextAnalyser.cs +++ b/src/Core/SJISContextAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class SJISContextAnalyser : JapaneseContextAnalyser { diff --git a/src/Core/SJISDistributionAnalyser.cs b/src/Core/SJISDistributionAnalyser.cs index 7b1275e..5c91717 100644 --- a/src/Core/SJISDistributionAnalyser.cs +++ b/src/Core/SJISDistributionAnalyser.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class SJISDistributionAnalyser : CharDistributionAnalyser { diff --git a/src/Core/SJISProber.cs b/src/Core/SJISProber.cs index 0368dc4..b246845 100644 --- a/src/Core/SJISProber.cs +++ b/src/Core/SJISProber.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { /// /// for S-JIS encoding, observe characteristic: diff --git a/src/Core/SJISSMModel.cs b/src/Core/SJISSMModel.cs index b5a0c76..942f14c 100644 --- a/src/Core/SJISSMModel.cs +++ b/src/Core/SJISSMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class SJISSMModel : SMModel { diff --git a/src/Core/SMModel.cs b/src/Core/SMModel.cs index 340a78e..c8cf344 100644 --- a/src/Core/SMModel.cs +++ b/src/Core/SMModel.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { /// /// State machine model diff --git a/src/Core/SequenceModel.cs b/src/Core/SequenceModel.cs index 04ad46f..96d8bb1 100644 --- a/src/Core/SequenceModel.cs +++ b/src/Core/SequenceModel.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { public abstract class SequenceModel { diff --git a/src/Core/SingleByteCharSetProber.cs b/src/Core/SingleByteCharSetProber.cs index d636ed6..b34e1a9 100644 --- a/src/Core/SingleByteCharSetProber.cs +++ b/src/Core/SingleByteCharSetProber.cs @@ -38,7 +38,7 @@ using System; -namespace Ude.Core +namespace UtfUnknown.Core { public class SingleByteCharSetProber : CharsetProber diff --git a/src/Core/ThaiModel.cs b/src/Core/ThaiModel.cs index 9e4a89f..7f6b8b6 100644 --- a/src/Core/ThaiModel.cs +++ b/src/Core/ThaiModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class ThaiModel : SequenceModel { diff --git a/src/Core/UCS2BESMModel.cs b/src/Core/UCS2BESMModel.cs index 0364780..04ea053 100644 --- a/src/Core/UCS2BESMModel.cs +++ b/src/Core/UCS2BESMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class UCS2BESMModel : SMModel { diff --git a/src/Core/UCS2LESMModel.cs b/src/Core/UCS2LESMModel.cs index 9085936..6f86e0d 100644 --- a/src/Core/UCS2LESMModel.cs +++ b/src/Core/UCS2LESMModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class UCS2LESMModel : SMModel { diff --git a/src/Core/UTF8Prober.cs b/src/Core/UTF8Prober.cs index 51db0d0..2ee2d59 100644 --- a/src/Core/UTF8Prober.cs +++ b/src/Core/UTF8Prober.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class UTF8Prober : CharsetProber { diff --git a/src/Core/UTF8SMModel.cs b/src/Core/UTF8SMModel.cs index 4fac311..f4d7309 100644 --- a/src/Core/UTF8SMModel.cs +++ b/src/Core/UTF8SMModel.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude.Core +namespace UtfUnknown.Core { public class UTF8SMModel : SMModel { diff --git a/src/Core/Win1250HungarianModel.cs b/src/Core/Win1250HungarianModel.cs index e1a9dcc..729face 100644 --- a/src/Core/Win1250HungarianModel.cs +++ b/src/Core/Win1250HungarianModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Win1250HungarianModel : HungarianModel { diff --git a/src/Core/Win1251BulgarianModel.cs b/src/Core/Win1251BulgarianModel.cs index 2737477..7716553 100644 --- a/src/Core/Win1251BulgarianModel.cs +++ b/src/Core/Win1251BulgarianModel.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Win1251BulgarianModel : BulgarianModel { diff --git a/src/Core/Win1251Model.cs b/src/Core/Win1251Model.cs index 2749ef1..b602c46 100644 --- a/src/Core/Win1251Model.cs +++ b/src/Core/Win1251Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Win1251Model : CyrillicModel { diff --git a/src/Core/Win1253Model.cs b/src/Core/Win1253Model.cs index e6605ab..a5a228b 100644 --- a/src/Core/Win1253Model.cs +++ b/src/Core/Win1253Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Win1253Model : GreekModel { diff --git a/src/Core/Win1255Model.cs b/src/Core/Win1255Model.cs index ade259b..aaf4698 100644 --- a/src/Core/Win1255Model.cs +++ b/src/Core/Win1255Model.cs @@ -1,4 +1,4 @@ -namespace Ude.Core +namespace UtfUnknown.Core { public class Win1255Model : HebrewModel { diff --git a/src/DetectionConfidence.cs b/src/DetectionConfidence.cs index e3daccb..46db4ad 100644 --- a/src/DetectionConfidence.cs +++ b/src/DetectionConfidence.cs @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -namespace Ude +namespace UtfUnknown { /// /// TODO not used? diff --git a/src/V2/DetectionResult.cs b/src/DetectionResult.cs similarity index 96% rename from src/V2/DetectionResult.cs rename to src/DetectionResult.cs index 6107203..73bacf2 100644 --- a/src/V2/DetectionResult.cs +++ b/src/DetectionResult.cs @@ -1,8 +1,8 @@ using System; using System.Text; -using Ude.Core; +using UtfUnknown.Core; -namespace Ude +namespace UtfUnknown { public class DetectionResult { diff --git a/src/V2/DetectionSummary.cs b/src/DetectionSummary.cs similarity index 97% rename from src/V2/DetectionSummary.cs rename to src/DetectionSummary.cs index f67049f..0849acf 100644 --- a/src/V2/DetectionSummary.cs +++ b/src/DetectionSummary.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace Ude +namespace UtfUnknown { public class DetectionSummary { diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index a5ce717..52d1881 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -38,6 +38,7 @@ false git https://github.com/CharsetDetector/UTF-unknown + UtfUnknown \ No newline at end of file diff --git a/tests/BitPackageTest.cs b/tests/BitPackageTest.cs index 303db21..632cfac 100644 --- a/tests/BitPackageTest.cs +++ b/tests/BitPackageTest.cs @@ -36,10 +36,10 @@ * * ***** END LICENSE BLOCK ***** */ -using Ude.Core; +using UtfUnknown.Core; using Xunit; -namespace Ude.Tests +namespace UtfUnknown.Tests { public class BitPackageTest { diff --git a/tests/CharsetDetectorTest.cs b/tests/CharsetDetectorTest.cs index 724aafd..7c2ac32 100644 --- a/tests/CharsetDetectorTest.cs +++ b/tests/CharsetDetectorTest.cs @@ -8,11 +8,12 @@ using System.IO; using System.Text; +using UtfUnknown.Core; using Xunit; #endregion -namespace Ude.Tests +namespace UtfUnknown.Tests { public class CharsetDetectorTest { diff --git a/tests/CharsetDetectorTestBatch.cs b/tests/CharsetDetectorTestBatch.cs index 671ef51..321352c 100644 --- a/tests/CharsetDetectorTestBatch.cs +++ b/tests/CharsetDetectorTestBatch.cs @@ -5,9 +5,10 @@ // using System.IO; +using UtfUnknown.Core; using Xunit; -namespace Ude.Tests +namespace UtfUnknown.Tests { public class CharsetDetectorTestBatch diff --git a/tests/UTF-unknown.Tests.csproj b/tests/UTF-unknown.Tests.csproj index add65b6..4686509 100644 --- a/tests/UTF-unknown.Tests.csproj +++ b/tests/UTF-unknown.Tests.csproj @@ -2,6 +2,7 @@ netcoreapp1.1 + UtfUnknown.Tests From 9d1fdd22ed6ef201eec629b638ffa02fc15abfc7 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 20:33:54 +0200 Subject: [PATCH 34/41] cleanup --- example/Udetect.cs | 3 +- src/CharsetDetector.cs | 9 +- src/DetectionConfidence.cs | 84 ------------------ src/DetectionResult.cs | 33 ++++--- src/UTF-unknown.csproj | 2 +- tests/CharsetDetectorTest.cs | 143 +++++++++--------------------- tests/CharsetDetectorTestBatch.cs | 2 +- {src/Core => tests}/Charsets.cs | 0 8 files changed, 70 insertions(+), 206 deletions(-) delete mode 100644 src/DetectionConfidence.cs rename {src/Core => tests}/Charsets.cs (100%) diff --git a/example/Udetect.cs b/example/Udetect.cs index dc950d4..31fd9a1 100644 --- a/example/Udetect.cs +++ b/example/Udetect.cs @@ -2,6 +2,7 @@ // // Author: // Rudi Pettazzi +// J. Verdurmen // using System; @@ -29,7 +30,7 @@ public static void Main(String[] args) if (result.Detected != null) { - Console.WriteLine("Charset: {0}, confidence: {1}", result.Detected.Charset, result.Detected.Confidence); + Console.WriteLine("Charset: {0}, confidence: {1}", result.Detected.EncodingName, result.Detected.Confidence); } else { diff --git a/src/CharsetDetector.cs b/src/CharsetDetector.cs index 92f4de2..fcb66ae 100644 --- a/src/CharsetDetector.cs +++ b/src/CharsetDetector.cs @@ -116,8 +116,6 @@ public class CharsetDetector /// private const int ProbersNum = 3; - //public event DetectorFinished Finished; - public CharsetDetector() { _start = true; @@ -136,8 +134,7 @@ public static DetectionSummary GetFromBytes(byte[] bytes) detector.Feed(bytes, 0, bytes.Length); return detector.DataEnd(); } - - + public static DetectionSummary GetFromStream(Stream stream) { @@ -150,8 +147,7 @@ public static DetectionSummary GetFromStream(Stream stream) } return detector.DataEnd(); } - - + public static DetectionSummary GetFromFile(string filePath) { using (FileStream fs = File.OpenRead(filePath)) @@ -361,7 +357,6 @@ protected virtual DetectionSummary DataEnd() } } - //public delegate void DetectorFinished(string charset, float confidence); } diff --git a/src/DetectionConfidence.cs b/src/DetectionConfidence.cs deleted file mode 100644 index 46db4ad..0000000 --- a/src/DetectionConfidence.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rudi Pettazzi (C# port) - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -namespace UtfUnknown -{ - /// - /// TODO not used? - /// - /// - /// Indicate how confident the detection module about the return result. - /// - /// - /// Example 1: the Shift_JIS/ISO-2022-JP/EUC-JP detector return - /// this w/ ISO-2022-JP when it hit one of the following ESC seq - /// ESC ( J - /// ESC $ @ - /// ESC $ B - /// - /// Example 2: the detector which can detect UCS2 return w/ UCS2 - /// when the first 2 byte are BOM mark. - /// Example 3: the Korean detector return ISO-2022-KR when it - /// hit ESC $ ) C - /// - public enum DetectionConfidence - { - /// - /// The detector have not find out a answer yet based on the data it received. - /// - NoAnswerYet = 0, - - /// - /// The answer the detector returned is the best one within - /// the knowledge of the detector. In other words, the test to all - /// other candidates fail. - /// For example, the (Shift_JIS/EUC-JP/ISO-2022-JP) detection - /// module may return this with answer "Shift_JIS " if it receive - /// bytes > 0x80 (which make ISO-2022-JP test failed) and byte - /// 0x82 (which may EUC-JP test failed) - /// - BestAnswer, - - /// - /// The detector is 100% sure about the answer. - /// - SureAnswer, - - NoAnswerMatch - } -} \ No newline at end of file diff --git a/src/DetectionResult.cs b/src/DetectionResult.cs index 73bacf2..b6937ca 100644 --- a/src/DetectionResult.cs +++ b/src/DetectionResult.cs @@ -4,17 +4,17 @@ namespace UtfUnknown { + /// + /// Result of a detection + /// public class DetectionResult { - private readonly string _encodingShortName; - - /// - /// Initializes a new instance of the class. + /// New result /// public DetectionResult(string encodingShortName, float confidence, CharsetProber prober = null, TimeSpan? time = null) { - _encodingShortName = encodingShortName; + EncodingName = encodingShortName; Confidence = confidence; try @@ -32,25 +32,36 @@ public DetectionResult(string encodingShortName, float confidence, CharsetProber } /// - /// Initializes a new instance of the class. + /// New Result /// public DetectionResult(CharsetProber prober, TimeSpan? time = null) : this(prober.GetCharsetName(), prober.GetConfidence(), prober, time) { } - [Obsolete("v1")] - public string Charset - { - get { return _encodingShortName; } - } + /// + /// The (short) name of the detected encoding. For full details, check + /// + public string EncodingName { get; } + /// + /// The detected encoding. + /// public Encoding Encoding { get; set; } + /// + /// The confidence of the found encoding + /// public float Confidence { get; set; } + /// + /// The used prober for detection + /// public CharsetProber Prober { get; set; } + /// + /// The time spent + /// public TimeSpan? Time { get; set; } } diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index 52d1881..bef83d6 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -18,7 +18,7 @@ UTF Unknown - Easily detect characterset for files, strings, steams and other bytes. + Detect character set for files, steams and other bytes. Detection of character sets with a simple, redesigned, interface. diff --git a/tests/CharsetDetectorTest.cs b/tests/CharsetDetectorTest.cs index 7c2ac32..1fb2f7a 100644 --- a/tests/CharsetDetectorTest.cs +++ b/tests/CharsetDetectorTest.cs @@ -18,7 +18,7 @@ namespace UtfUnknown.Tests public class CharsetDetectorTest { [Fact] - public void TestASCII() + public void TestAscii() { string s = "The Documentation of the libraries is not complete " + @@ -28,7 +28,7 @@ public void TestASCII() using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(s))) { var result = CharsetDetector.GetFromStream(ms); - Assert.Equal(Charsets.ASCII, result.Detected.Charset); + Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } } @@ -42,77 +42,75 @@ public void TestUTF8_1() "利用案内でどうぞ。"; byte[] buf = Encoding.UTF8.GetBytes(s); var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF8, result.Detected.Charset); + Assert.Equal(Charsets.UTF8, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] - public void TestBomUTF8() + public void TestBomUtf8() { - byte[] buf = {0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21}; + byte[] buf = { 0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21 }; var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF8, result.Detected.Charset); + Assert.Equal(Charsets.UTF8, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF16_BE() { - byte[] buf = {0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65}; - + byte[] buf = { 0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65 }; + var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF16_BE, result.Detected.Charset); + Assert.Equal(Charsets.UTF16_BE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomX_ISO_10646_UCS_4_3412() { - var detector = new CharsetDetector(); - byte[] buf = {0xFE, 0xFF, 0x00, 0x00, 0x65}; - detector = new CharsetDetector(); - detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal("X-ISO-10646-UCS-4-3412", detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + + byte[] buf = { 0xFE, 0xFF, 0x00, 0x00, 0x65 }; + + var result = CharsetDetector.GetFromBytes(buf); + Assert.Equal("X-ISO-10646-UCS-4-3412", result.Detected.EncodingName); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomX_ISO_10646_UCS_4_2143() { - var detector = new CharsetDetector(); - byte[] buf = {0x00, 0x00, 0xFF, 0xFE, 0x00, 0x65}; - detector = new CharsetDetector(); - detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - Assert.Equal("X-ISO-10646-UCS-4-2143", detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + + byte[] buf = { 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x65 }; + + var result = CharsetDetector.GetFromBytes(buf); + Assert.Equal("X-ISO-10646-UCS-4-2143", result.Detected.EncodingName); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF16_LE() { - byte[] buf = {0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00}; + byte[] buf = { 0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00 }; var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF16_LE, result.Detected.Charset); + Assert.Equal(Charsets.UTF16_LE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF32_BE() { - byte[] buf = {0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68}; + byte[] buf = { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68 }; var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF32_BE, result.Detected.Charset); + Assert.Equal(Charsets.UTF32_BE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestBomUTF32_LE() { - byte[] buf = {0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00}; + byte[] buf = { 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00 }; var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.UTF32_LE, result.Detected.Charset); + Assert.Equal(Charsets.UTF32_LE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -121,99 +119,42 @@ public void TestIssue3() { byte[] buf = Encoding.UTF8.GetBytes("3"); var result = CharsetDetector.GetFromBytes(buf); - Assert.Equal(Charsets.ASCII, result.Detected.Charset); + Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] public void TestOutOfRange() { - var detector = new CharsetDetector(); + byte[] buf = Encoding.UTF8.GetBytes("3"); - detector.Feed(buf, 0, 10); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); - } + var result = CharsetDetector.GetFromBytes(buf); + Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); + Assert.Equal(1.0f, result.Detected.Confidence); + } [Fact] public void TestOutOfRange2() { - var detector = new CharsetDetector(); + byte[] buf = Encoding.UTF8.GetBytes("1234567890"); - detector.Feed(buf, 10, 5); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); + var result = CharsetDetector.GetFromBytes(buf); + Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); + Assert.Equal(1.0f, result.Detected.Confidence); } [Fact] - public void TestEmpty() + public void TestSingleChar() { - var detector = new CharsetDetector(); byte[] buf = Encoding.UTF8.GetBytes("3"); - detector.Feed(buf, 0, 0); - detector.DataEnd(); - Assert.Equal(null, detector.Charset); - Assert.Equal(0, detector.Confidence); + var result = CharsetDetector.GetFromBytes(buf); + Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); + Assert.Equal(1, result.Detected.Confidence); } - /// - /// 2 times dataend should not change result - /// - [Fact] - public void TestEmpty2() - { - var detector = new CharsetDetector(); - byte[] buf = Encoding.UTF8.GetBytes("3"); - detector.Feed(buf, 0, 0); - detector.DataEnd(); - detector.DataEnd(); - Assert.Equal(null, detector.Charset); - Assert.Equal(0, detector.Confidence); - } - [Fact] - public void TestOffset() - { - var detector = new CharsetDetector(); - byte[] buf = Encoding.ASCII.GetBytes("test1"); - - //no crasg - detector.Feed(buf, 4, 2); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); - } - [Fact] - public void TestFeedSecondEmpty() - { - var detector = new CharsetDetector(); - byte[] buf = Encoding.UTF8.GetBytes("3"); - detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - - //feed empty - detector.Feed(buf, 0, 0); - detector.DataEnd(); - Assert.Equal(Charsets.ASCII, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); - } - [Fact] - public void TestFeedSecondEmpty_bom() - { - var detector = new CharsetDetector(); - byte[] buf = {0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65}; - detector = new CharsetDetector(); - detector.Feed(buf, 0, buf.Length); - detector.DataEnd(); - //feed empty - detector.Feed(buf, 0, 0); - detector.DataEnd(); - Assert.Equal(Charsets.UTF16_BE, detector.Charset); - Assert.Equal(1.0f, detector.Confidence); - } + } } \ No newline at end of file diff --git a/tests/CharsetDetectorTestBatch.cs b/tests/CharsetDetectorTestBatch.cs index 321352c..3df7b66 100644 --- a/tests/CharsetDetectorTestBatch.cs +++ b/tests/CharsetDetectorTestBatch.cs @@ -82,7 +82,7 @@ private static void Process(string charset, string dirname) var result = CharsetDetector.GetFromFile(file); var detected = result.Detected; - Assert.True(charset == detected.Charset, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.Charset, detected.Confidence * 100)); + Assert.True(charset == detected.EncodingName, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.EncodingName, detected.Confidence * 100)); } } diff --git a/src/Core/Charsets.cs b/tests/Charsets.cs similarity index 100% rename from src/Core/Charsets.cs rename to tests/Charsets.cs From a4cbc73624d4eba5246b3f079377308c773b1f8d Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 20:54:19 +0200 Subject: [PATCH 35/41] renames & cleanup --- example/{Udetect.cs => DetectFile.cs} | 4 +- src/CharsetDetector.cs | 46 +++++++++--------- src/DetectionDetail.cs | 68 +++++++++++++++++++++++++++ src/DetectionResult.cs | 61 ++++++++---------------- src/DetectionSummary.cs | 35 -------------- src/UTF-unknown.csproj | 2 +- tests/CharsetDetectorTest.cs | 26 +++++----- tests/CharsetDetectorTestBatch.cs | 2 +- tests/UTF-unknown.Tests.csproj | 1 + 9 files changed, 126 insertions(+), 119 deletions(-) rename example/{Udetect.cs => DetectFile.cs} (90%) create mode 100644 src/DetectionDetail.cs delete mode 100644 src/DetectionSummary.cs diff --git a/example/Udetect.cs b/example/DetectFile.cs similarity index 90% rename from example/Udetect.cs rename to example/DetectFile.cs index 31fd9a1..02b48b8 100644 --- a/example/Udetect.cs +++ b/example/DetectFile.cs @@ -10,7 +10,7 @@ namespace ConsoleExample { - public class Udetect + public class DetectFile { /// /// Command line example: detects the encoding of the given file. @@ -26,7 +26,7 @@ public static void Main(String[] args) string filename = args[0]; - var result = CharsetDetector.GetFromFile(filename); + var result = CharsetDetector.DetectFromFile(filename); if (result.Detected != null) { diff --git a/src/CharsetDetector.cs b/src/CharsetDetector.cs index fcb66ae..08a3547 100644 --- a/src/CharsetDetector.cs +++ b/src/CharsetDetector.cs @@ -85,7 +85,7 @@ public class CharsetDetector private bool _gotData; /// - /// Most of the time true of is set. TODO not always + /// Most of the time true of is set. TODO not always /// private bool _done; @@ -107,7 +107,7 @@ public class CharsetDetector /// /// Detected charset. Most of the time is true /// - private DetectionResult _detectionResult; + private DetectionDetail _detectionDetail; private const float MinimumThreshold = 0.20f; @@ -128,14 +128,14 @@ public CharsetDetector() /// /// /// - public static DetectionSummary GetFromBytes(byte[] bytes) + public static DetectionResult DetectFromBytes(byte[] bytes) { var detector = new CharsetDetector(); detector.Feed(bytes, 0, bytes.Length); return detector.DataEnd(); } - - public static DetectionSummary GetFromStream(Stream stream) + + public static DetectionResult DetectFromStream(Stream stream) { var detector = new CharsetDetector(); @@ -147,13 +147,12 @@ public static DetectionSummary GetFromStream(Stream stream) } return detector.DataEnd(); } - - public static DetectionSummary GetFromFile(string filePath) + + public static DetectionResult DetectFromFile(string filePath) { using (FileStream fs = File.OpenRead(filePath)) { - var detector = new CharsetDetector(); - return GetFromStream(fs); + return DetectFromStream(fs); } } @@ -175,7 +174,7 @@ protected virtual void Feed(byte[] buf, int offset, int len) _start = false; if (bomSet != null) { - _detectionResult = new DetectionResult(bomSet, 1); + _detectionDetail = new DetectionDetail(bomSet, 1); _done = true; return; } @@ -217,7 +216,7 @@ private bool RunProber(byte[] buf, int offset, int len, CharsetProber charsetPro if (probingState == ProbingState.FoundIt) { _done = true; - _detectionResult = new DetectionResult(charsetProber); + _detectionDetail = new DetectionDetail(charsetProber); return true; } return false; @@ -236,10 +235,7 @@ private void FindInputState(byte[] buf, int len) InputState = InputState.Highbyte; // kill EscCharsetProber if it is active - if (_escCharsetProber != null) - { - _escCharsetProber = null; - } + _escCharsetProber = null; // start multibyte and singlebyte charset prober if (_charsetProbers[0] == null) @@ -308,41 +304,41 @@ private static string FindCharSetByBom(byte[] buf, int len) /// /// Notify detector that no further data is available. /// - protected virtual DetectionSummary DataEnd() + protected virtual DetectionResult DataEnd() { if (!_gotData) { // we haven't got any data yet, return immediately // caller program sometimes call DataEnd before anything has // been sent to detector - return new DetectionSummary(); + return new DetectionResult(); } - if (_detectionResult != null) + if (_detectionDetail != null) { _done = true; //conf 1.0 is from v1.0 (todo wrong?) - _detectionResult.Confidence = 1.0f; - return new DetectionSummary(_detectionResult); + _detectionDetail.Confidence = 1.0f; + return new DetectionResult(_detectionDetail); } if (InputState == InputState.Highbyte) { - var list = new List(ProbersNum); + var list = new List(ProbersNum); for (int i = 0; i < ProbersNum; i++) { var charsetProber = _charsetProbers[i]; if (charsetProber != null) { - list.Add(new DetectionResult(charsetProber)); + list.Add(new DetectionDetail(charsetProber)); } } var detectionResults = list.Where(p => p.Confidence > MinimumThreshold).OrderByDescending(p => p.Confidence).ToList(); - return new DetectionSummary(detectionResults); + return new DetectionResult(detectionResults); //TODO why done isn't true? @@ -351,9 +347,9 @@ protected virtual DetectionSummary DataEnd() else if (InputState == InputState.PureASCII) { //TODO why done isn't true? - return new DetectionSummary(new DetectionResult("ASCII", 1.0f, null, null)); + return new DetectionResult(new DetectionDetail("ASCII", 1.0f, null, null)); } - return new DetectionSummary(); + return new DetectionResult(); } } diff --git a/src/DetectionDetail.cs b/src/DetectionDetail.cs new file mode 100644 index 0000000..45f90ac --- /dev/null +++ b/src/DetectionDetail.cs @@ -0,0 +1,68 @@ +using System; +using System.Text; +using UtfUnknown.Core; + +namespace UtfUnknown +{ + /// + /// Result of a detection + /// + public class DetectionDetail + { + /// + /// New result + /// + public DetectionDetail(string encodingShortName, float confidence, CharsetProber prober = null, TimeSpan? time = null) + { + EncodingName = encodingShortName; + Confidence = confidence; + + try + { + Encoding = System.Text.Encoding.GetEncoding(encodingShortName); + } + catch (Exception) + { + + //wrong name + } + + Prober = prober; + Time = time; + } + + /// + /// New Result + /// + public DetectionDetail(CharsetProber prober, TimeSpan? time = null) + : this(prober.GetCharsetName(), prober.GetConfidence(), prober, time) + { + } + + /// + /// The (short) name of the detected encoding. For full details, check + /// + public string EncodingName { get; } + + /// + /// The detected encoding. + /// + public Encoding Encoding { get; set; } + + /// + /// The confidence of the found encoding + /// + public float Confidence { get; set; } + + /// + /// The used prober for detection + /// + public CharsetProber Prober { get; set; } + + /// + /// The time spent + /// + public TimeSpan? Time { get; set; } + + } +} diff --git a/src/DetectionResult.cs b/src/DetectionResult.cs index b6937ca..6f9dcbd 100644 --- a/src/DetectionResult.cs +++ b/src/DetectionResult.cs @@ -1,68 +1,45 @@ -using System; -using System.Text; -using UtfUnknown.Core; +using System.Collections.Generic; +using System.Linq; namespace UtfUnknown { /// - /// Result of a detection + /// Result of a detection. /// public class DetectionResult { /// - /// New result + /// Empty /// - public DetectionResult(string encodingShortName, float confidence, CharsetProber prober = null, TimeSpan? time = null) + public DetectionResult() { - EncodingName = encodingShortName; - Confidence = confidence; - - try - { - Encoding = System.Text.Encoding.GetEncoding(encodingShortName); - } - catch (Exception) - { - - //wrong name - } - - Prober = prober; - Time = time; } /// - /// New Result + /// Multiple results /// - public DetectionResult(CharsetProber prober, TimeSpan? time = null) - : this(prober.GetCharsetName(), prober.GetConfidence(), prober, time) + public DetectionResult(IList details) { + Details = details; } /// - /// The (short) name of the detected encoding. For full details, check - /// - public string EncodingName { get; } - - /// - /// The detected encoding. - /// - public Encoding Encoding { get; set; } - - /// - /// The confidence of the found encoding + /// Single result /// - public float Confidence { get; set; } + /// + public DetectionResult(DetectionDetail detectionDetail) + { + Details = new List { detectionDetail }; + } /// - /// The used prober for detection + /// Get the best Detection /// - public CharsetProber Prober { get; set; } + public DetectionDetail Detected => Details?.FirstOrDefault(); /// - /// The time spent + /// All results /// - public TimeSpan? Time { get; set; } - + public IList Details { set; get; } } -} +} \ No newline at end of file diff --git a/src/DetectionSummary.cs b/src/DetectionSummary.cs deleted file mode 100644 index 0849acf..0000000 --- a/src/DetectionSummary.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace UtfUnknown -{ - public class DetectionSummary - { - /// - /// Empty - /// - public DetectionSummary() - { - } - - /// - /// Initializes a new instance of the class. - /// - public DetectionSummary(IList allDetectionResults) - { - AllDetectionResults = allDetectionResults; - } - - public DetectionSummary(DetectionResult detectionResult) - { - AllDetectionResults = new List { detectionResult }; - } - - public DetectionResult Detected - { - get { return AllDetectionResults?.FirstOrDefault(); } - } - - public IList AllDetectionResults { set; get; } - } -} \ No newline at end of file diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index bef83d6..4f51752 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -4,7 +4,7 @@ netstandard1.3;net40 - UTF.Unknown + UtfUnknown UTF.Unknown 1.0.0-alpha1 diff --git a/tests/CharsetDetectorTest.cs b/tests/CharsetDetectorTest.cs index 1fb2f7a..35b9656 100644 --- a/tests/CharsetDetectorTest.cs +++ b/tests/CharsetDetectorTest.cs @@ -27,7 +27,7 @@ public void TestAscii() "click on the [Edit] link to start writing"; using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(s))) { - var result = CharsetDetector.GetFromStream(ms); + var result = CharsetDetector.DetectFromStream(ms); Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -41,7 +41,7 @@ public void TestUTF8_1() "ガイドブックを読んでから、サンドボックスで練習してみましょう。質問は" + "利用案内でどうぞ。"; byte[] buf = Encoding.UTF8.GetBytes(s); - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -50,7 +50,7 @@ public void TestUTF8_1() public void TestBomUtf8() { byte[] buf = { 0xEF, 0xBB, 0xBF, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x21 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF8, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -60,7 +60,7 @@ public void TestBomUTF16_BE() { byte[] buf = { 0xFE, 0xFF, 0x00, 0x68, 0x00, 0x65 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF16_BE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -71,7 +71,7 @@ public void TestBomX_ISO_10646_UCS_4_3412() byte[] buf = { 0xFE, 0xFF, 0x00, 0x00, 0x65 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal("X-ISO-10646-UCS-4-3412", result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -82,7 +82,7 @@ public void TestBomX_ISO_10646_UCS_4_2143() byte[] buf = { 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x65 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal("X-ISO-10646-UCS-4-2143", result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -91,7 +91,7 @@ public void TestBomX_ISO_10646_UCS_4_2143() public void TestBomUTF16_LE() { byte[] buf = { 0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF16_LE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -100,7 +100,7 @@ public void TestBomUTF16_LE() public void TestBomUTF32_BE() { byte[] buf = { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x68 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF32_BE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -109,7 +109,7 @@ public void TestBomUTF32_BE() public void TestBomUTF32_LE() { byte[] buf = { 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00 }; - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.UTF32_LE, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -118,7 +118,7 @@ public void TestBomUTF32_LE() public void TestIssue3() { byte[] buf = Encoding.UTF8.GetBytes("3"); - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -128,7 +128,7 @@ public void TestOutOfRange() { byte[] buf = Encoding.UTF8.GetBytes("3"); - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -138,7 +138,7 @@ public void TestOutOfRange2() { byte[] buf = Encoding.UTF8.GetBytes("1234567890"); - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1.0f, result.Detected.Confidence); } @@ -147,7 +147,7 @@ public void TestOutOfRange2() public void TestSingleChar() { byte[] buf = Encoding.UTF8.GetBytes("3"); - var result = CharsetDetector.GetFromBytes(buf); + var result = CharsetDetector.DetectFromBytes(buf); Assert.Equal(Charsets.ASCII, result.Detected.EncodingName); Assert.Equal(1, result.Detected.Confidence); } diff --git a/tests/CharsetDetectorTestBatch.cs b/tests/CharsetDetectorTestBatch.cs index 3df7b66..0e985cd 100644 --- a/tests/CharsetDetectorTestBatch.cs +++ b/tests/CharsetDetectorTestBatch.cs @@ -80,7 +80,7 @@ private static void Process(string charset, string dirname) { - var result = CharsetDetector.GetFromFile(file); + var result = CharsetDetector.DetectFromFile(file); var detected = result.Detected; Assert.True(charset == detected.EncodingName, string.Format("Charset detection failed for {0}. Expected: {1}, detected: {2} ({3}% confidence)", file, charset, detected.EncodingName, detected.Confidence * 100)); diff --git a/tests/UTF-unknown.Tests.csproj b/tests/UTF-unknown.Tests.csproj index 4686509..23c22a5 100644 --- a/tests/UTF-unknown.Tests.csproj +++ b/tests/UTF-unknown.Tests.csproj @@ -3,6 +3,7 @@ netcoreapp1.1 UtfUnknown.Tests + UtfUnknown.Tests From acec9a747c1998c144b514c0b45c7254f6066ac0 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 20:54:30 +0200 Subject: [PATCH 36/41] move to new version --- README.md | 58 +++++++++++++++++++++---------------------- appveyor.yml | 24 ++++++------------ example/DetectFile.cs | 4 +++ 3 files changed, 39 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 565fc89..fec4f3a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,26 @@ [![Build status](https://ci.appveyor.com/api/projects/status/ouo7t319ixcokxer/branch/master?svg=true)](https://ci.appveyor.com/project/304NotModified/ude/branch/master) [![codecov.io](https://codecov.io/github/UniversalCharsetDetector/ude/coverage.svg?branch=master)](https://codecov.io/github/UniversalCharsetDetector/ude?branch=master) + Detect character set for files, steams and other bytes. -#WIP -Work in progress! + Detection of character sets with a simple and redesigned interface. + This package is based on [Ude](https://github.com/errepi/ude), + which is a port of the [Mozilla Universal Charset Detector](https://mxr.mozilla.org/mozilla/source/extensions/universalchardet/). -#About this libary + + The interface and other classes has been resigned so it's easier to use and better object oriented design (OOD). Unit tests and CI has been added. + Features: -#Docs + - OOD + - Moved to netstandard + - Added more unit tests + - Builds on CI (AppVeyor) + - Strong named -Ude is a C# port of [Mozilla Universal Charset Detector](http://mxr.mozilla.org/mozilla/source/extensions/universalchardet/src/). + +# Docs The article "[A composite approach to language/encoding detection](http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html)" describes the charsets detection algorithms implemented by the library. @@ -38,37 +47,26 @@ Ude can recognize the following charsets: * ASCII ## Platform -Windows. Linux work in progress (Mono and CoreCLR) - +.NET 4.0 and .NET Standard 1.3 ## Usage -### Example -```c# -public static void Main(String[] args) -{ - string filename = args[0]; - using (FileStream fs = File.OpenRead(filename)) { - Ude.CharsetDetector detector = new Ude.CharsetDetector(); - detector.Feed(fs); - detector.DataEnd(); - if (detector.Charset != null) { - Console.WriteLine("Charset: {0}, confidence: {1}", detector.Charset, detector.Confidence); - } else { - Console.WriteLine("Detection failed."); - } - } -} -``` +Use the static detectX methods from `CharsetDetector`. -## Other portings -The original Mozilla Universal Charset Detector has been ported to a variety of languages. Among these, a Java port: - -* [juniversalchardet](http://code.google.com/p/juniversalchardet/) +### Example -from which I copied a few data structures, and a Python port: +```c# +// Detect from File +var result = CharsetDetector.DetectFromFile("c:/myfile.txt"); +Encoding encoding = result.Detected.Encoding; //or result.Detected.EncodingName +float confidence = result.Detected.Confidence; //confidence between 0 and 1 +var allDetails = result.Details; +// Detect from Stream +var result = CharsetDetector.DetectFromStream(stream); +// Detect from bytes +var result = CharsetDetector.DetectFromBytes(byteArray); -* [chardet](http://chardet.feedparser.org/) +``` ## License diff --git a/appveyor.yml b/appveyor.yml index 8787588..1c40146 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,28 +1,18 @@ version: 1.0.{build} -clone_folder: c:\ude +clone_folder: c:\utfUnknown +image: Visual Studio 2017 +before_build: + - ps: msbuild /t:restore configuration: Release platform: Any CPU -assembly_info: - patch: true - file: '**\AssemblyInfo.*' - assembly_version: '1.0.0' - assembly_file_version: '{version}' - assembly_informational_version: '1.0' nuget: project_feed: true -before_build: - - ps: nuget restore -DisableParallelProcessing -matrix: - fast_finish: true build: publish_nuget: true publish_nuget_symbols: true verbosity: minimal deploy: off test_script: - - nuget.exe install OpenCover -ExcludeVersion - - OpenCover\tools\OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:"\"c:\ude\src\Tests\bin\Release\Ude.Tests.dll\" -appveyor -noshadow" -returntargetcode -filter:"+[Ude]* -[Ude.Tests]* -[Ude.Example]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -output:coverage.xml - - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" - - pip install codecov - - codecov -f "coverage.xml" - + - ps: cd .\tests\ + - ps: dotnet xunit + - ps: cd .. \ No newline at end of file diff --git a/example/DetectFile.cs b/example/DetectFile.cs index 02b48b8..b100eac 100644 --- a/example/DetectFile.cs +++ b/example/DetectFile.cs @@ -6,6 +6,7 @@ // using System; +using System.Text; using UtfUnknown; namespace ConsoleExample @@ -24,6 +25,9 @@ public static void Main(String[] args) return; } + + + string filename = args[0]; var result = CharsetDetector.DetectFromFile(filename); From c12ce6d70014e02f1f888d993af305b90011d2eb Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 21:22:36 +0200 Subject: [PATCH 37/41] test also net4 --- tests/UTF-unknown.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/UTF-unknown.Tests.csproj b/tests/UTF-unknown.Tests.csproj index 23c22a5..920286c 100644 --- a/tests/UTF-unknown.Tests.csproj +++ b/tests/UTF-unknown.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp1.1 + netcoreapp1.1;net452 UtfUnknown.Tests UtfUnknown.Tests From b5cc4f58ddc77535eed8ae3acba536c876b8d288 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 21:27:41 +0200 Subject: [PATCH 38/41] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fec4f3a..0339717 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -[![Build status](https://ci.appveyor.com/api/projects/status/ouo7t319ixcokxer/branch/master?svg=true)](https://ci.appveyor.com/project/304NotModified/ude/branch/master) +[![Build status](https://ci.appveyor.com/api/projects/status/xr59ab52cav8vuph/branch/master?svg=true)](https://ci.appveyor.com/project/304NotModified/utf-unknown/branch/master) + + Detect character set for files, steams and other bytes. @@ -18,6 +21,7 @@ - Added more unit tests - Builds on CI (AppVeyor) - Strong named + - Documentation added # Docs From 272b5f0f485863d9220098efd49d1227564da966 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 21:27:53 +0200 Subject: [PATCH 39/41] strong name --- src/UTF-unknown.csproj | 2 ++ src/UtfUnknown.snk | Bin 0 -> 596 bytes 2 files changed, 2 insertions(+) create mode 100644 src/UtfUnknown.snk diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index 4f51752..b5b6db1 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -39,6 +39,8 @@ git https://github.com/CharsetDetector/UTF-unknown UtfUnknown + True + UtfUnknown.snk \ No newline at end of file diff --git a/src/UtfUnknown.snk b/src/UtfUnknown.snk new file mode 100644 index 0000000000000000000000000000000000000000..ea0d94db679fe9081edaf6ecb7df87af0ece756d GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096g_O#ym$75!47KcU)M7Lp{jv1s8_k|~u z7X7X-X=UyDN=5?&{) zb0ab@FksL84RFxQ8%upg2phhwF@#Acs;#h4i)6nkjpeK5>Rif;l1U7f8+&yV!osPC zU+VjkgZEt3+rfe<;mJp`GI(V)hnH0QX2uJC7l!K!|5NzHGcEC40tu9@IflY+QNJDr z;TO3cvKZGZ6%xMBh<IHGNt4*-toDzuOoq?u?%o{vEmbaMY|(X@7XZ}AQ54~ zkkdyREx1MZ)f4~{ce$F5=$R!hNw|PU=lpcu$EDRH;2yP|AP#f};b~f4YE||=SsRHC zc-Ctv-EP~vdnm4(@D*!-2VP8c{JG=|+zbtF8u3RO@q!p4)JWnp$%-v8J4B|zw!$y-A?B1;*hUhh3N3Hm1)75#>9q%oK6 iDmv$Cl!*HU+&7P)Ype53lq Date: Fri, 7 Apr 2017 21:28:51 +0200 Subject: [PATCH 40/41] xml docs --- src/UTF-unknown.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index b5b6db1..6cabcc0 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -42,5 +42,8 @@ True UtfUnknown.snk + + bin\Release\netstandard1.3\UtfUnknown.xml + \ No newline at end of file From 13651f65b2f70b5ca757cceb375b0b38b6ead62f Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Fri, 7 Apr 2017 21:33:24 +0200 Subject: [PATCH 41/41] fix warnings --- src/Core/CharDistributionAnalyser.cs | 10 ++++------ src/Core/HZSMModel.cs | 4 +--- src/Core/HebrewProber.cs | 2 +- src/UTF-unknown.csproj | 1 + 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Core/CharDistributionAnalyser.cs b/src/Core/CharDistributionAnalyser.cs index 4e0b591..04a5b91 100644 --- a/src/Core/CharDistributionAnalyser.cs +++ b/src/Core/CharDistributionAnalyser.cs @@ -71,24 +71,22 @@ public CharDistributionAnalyser() /// /// Feed a block of data and do distribution analysis /// - /// - //public abstract void HandleData(byte[] buf, int offset, int len); - - /// + /// /// we do not handle character base on its original encoding string, but /// convert this encoding string to a number, here called order. /// This allow multiple encoding of a language to share one frequency table - /// + /// /// A /// /// public abstract int GetOrder(byte[] buf, int offset); - + /// /// Feed a character with known length /// /// A /// buf offset + /// 1 of 2 char length? public void HandleOneChar(byte[] buf, int offset, int charLen) { //we only care about 2-bytes character in our distribution analysis diff --git a/src/Core/HZSMModel.cs b/src/Core/HZSMModel.cs index 3a02881..c2fe3bb 100644 --- a/src/Core/HZSMModel.cs +++ b/src/Core/HZSMModel.cs @@ -36,9 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -/// -/// Escaped charsets state machines -/// +//Escaped charsets state machines namespace UtfUnknown.Core { public class HZSMModel : SMModel diff --git a/src/Core/HebrewProber.cs b/src/Core/HebrewProber.cs index 166541f..9f5bdd6 100644 --- a/src/Core/HebrewProber.cs +++ b/src/Core/HebrewProber.cs @@ -39,7 +39,7 @@ using System; -/** +/* * General ideas of the Hebrew charset recognition * * Four main charsets exist in Hebrew: diff --git a/src/UTF-unknown.csproj b/src/UTF-unknown.csproj index 6cabcc0..c727b50 100644 --- a/src/UTF-unknown.csproj +++ b/src/UTF-unknown.csproj @@ -44,6 +44,7 @@ bin\Release\netstandard1.3\UtfUnknown.xml + 1701;1702;1705,1570,1591 \ No newline at end of file