exiftool-vendored.exe 12.80.0 → 12.82.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +6 -0
  2. package/bin/exiftool.exe +0 -0
  3. package/bin/exiftool_files/Changes +44 -0
  4. package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
  5. package/bin/exiftool_files/README +3 -2
  6. package/bin/exiftool_files/exiftool.pl +36 -14
  7. package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
  8. package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
  9. package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
  10. package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
  11. package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
  12. package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
  13. package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
  14. package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
  15. package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
  16. package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
  17. package/bin/exiftool_files/lib/B.pm +1 -1
  18. package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
  19. package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
  20. package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
  21. package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
  22. package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
  23. package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
  24. package/bin/exiftool_files/lib/Config.pm +9 -9
  25. package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
  26. package/bin/exiftool_files/lib/CryptX.pm +2 -82
  27. package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
  28. package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
  29. package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
  30. package/bin/exiftool_files/lib/Digest/base.pm +26 -20
  31. package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
  32. package/bin/exiftool_files/lib/Encode.pm +3 -3
  33. package/bin/exiftool_files/lib/Errno.pm +13 -13
  34. package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
  35. package/bin/exiftool_files/lib/Exporter.pm +1 -1
  36. package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
  37. package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
  38. package/bin/exiftool_files/lib/File/Find.pm +1 -1
  39. package/bin/exiftool_files/lib/File/Glob.pm +1 -8
  40. package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
  41. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
  42. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
  43. package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
  44. package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
  45. package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
  46. package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
  47. package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
  48. package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
  49. package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
  50. package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
  51. package/bin/exiftool_files/lib/File/Path.pm +3 -3
  52. package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
  53. package/bin/exiftool_files/lib/File/Temp.pm +70 -35
  54. package/bin/exiftool_files/lib/File/Which.pm +1 -240
  55. package/bin/exiftool_files/lib/File/stat.pm +3 -2
  56. package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
  57. package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
  58. package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
  59. package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
  60. package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
  61. package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
  62. package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
  63. package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
  64. package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
  65. package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
  66. package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
  67. package/bin/exiftool_files/lib/IO/File.pm +1 -1
  68. package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
  69. package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
  70. package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
  71. package/bin/exiftool_files/lib/IO/Select.pm +16 -2
  72. package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
  73. package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
  74. package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
  75. package/bin/exiftool_files/lib/IO/String.pm +425 -0
  76. package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
  77. package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
  78. package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
  79. package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
  80. package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
  81. package/bin/exiftool_files/lib/IO.pm +2 -2
  82. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +44 -31
  83. package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +2 -2
  84. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +20 -7
  85. package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +543 -0
  86. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +332 -149
  87. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +9 -4
  88. package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +32 -4
  89. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +2 -2
  90. package/bin/exiftool_files/lib/Image/ExifTool/Microsoft.pm +1 -1
  91. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +331 -22
  92. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +55 -1
  93. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +1 -0
  94. package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +21 -3
  95. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +3 -3
  96. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +40 -24
  97. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +61 -30
  98. package/bin/exiftool_files/lib/Image/ExifTool/README +2 -0
  99. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +1 -1
  100. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4815 -4775
  101. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +931 -617
  102. package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +30 -8
  103. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +10 -4
  104. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +4 -2
  105. package/bin/exiftool_files/lib/Image/ExifTool.pm +77 -41
  106. package/bin/exiftool_files/lib/Image/ExifTool.pod +24 -11
  107. package/bin/exiftool_files/lib/List/Util.pm +97 -8
  108. package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
  109. package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
  110. package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
  111. package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
  112. package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
  113. package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
  114. package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
  115. package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
  116. package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
  117. package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
  118. package/bin/exiftool_files/lib/POSIX.pm +1 -1
  119. package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
  120. package/bin/exiftool_files/lib/PerlIO.pm +397 -0
  121. package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
  122. package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
  123. package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
  124. package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
  125. package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
  126. package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
  127. package/bin/exiftool_files/lib/Portable.pm +246 -320
  128. package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
  129. package/bin/exiftool_files/lib/Socket.pm +16 -12
  130. package/bin/exiftool_files/lib/Storable.pm +1444 -1441
  131. package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
  132. package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
  133. package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
  134. package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
  135. package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
  136. package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
  137. package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
  138. package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
  139. package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
  140. package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
  141. package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
  142. package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
  143. package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
  144. package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
  145. package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
  146. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
  147. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
  148. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
  149. package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
  150. package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
  151. package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
  152. package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
  153. package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
  154. package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
  155. package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
  156. package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
  157. package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
  158. package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
  159. package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
  160. package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
  161. package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
  162. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
  163. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
  164. package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
  165. package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
  166. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
  167. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
  168. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
  169. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
  170. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
  171. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
  172. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
  173. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
  174. package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
  175. package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
  176. package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
  177. package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
  178. package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
  179. package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
  180. package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
  181. package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
  182. package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
  183. package/bin/exiftool_files/lib/Test/More.pm +1997 -0
  184. package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
  185. package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
  186. package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
  187. package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
  188. package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
  189. package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
  190. package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
  191. package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
  192. package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
  193. package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
  194. package/bin/exiftool_files/lib/Time/Local.pm +82 -35
  195. package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
  196. package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
  197. package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
  198. package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
  199. package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
  200. package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
  201. package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
  202. package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
  203. package/bin/exiftool_files/lib/Win32/API.pm +1 -830
  204. package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
  205. package/bin/exiftool_files/lib/Win32.pm +213 -89
  206. package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
  207. package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
  208. package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
  209. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
  210. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
  211. package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
  212. package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
  213. package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
  214. package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
  215. package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
  216. package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
  217. package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
  218. package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
  219. package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
  220. package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
  221. package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
  222. package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
  223. package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
  224. package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
  225. package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
  226. package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
  227. package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
  228. package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
  229. package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
  230. package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
  231. package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
  232. package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
  233. package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
  234. package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
  235. package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
  236. package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
  237. package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
  238. package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
  239. package/bin/exiftool_files/lib/feature.pm +49 -17
  240. package/bin/exiftool_files/lib/mro.pm +4 -20
  241. package/bin/exiftool_files/lib/overload.pm +15 -15
  242. package/bin/exiftool_files/lib/parent.pm +10 -2
  243. package/bin/exiftool_files/lib/re.pm +91 -33
  244. package/bin/exiftool_files/lib/warnings.pm +17 -6
  245. package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
  246. package/bin/exiftool_files/liblzma-5__.dll +0 -0
  247. package/bin/exiftool_files/libstdc++-6.dll +0 -0
  248. package/bin/exiftool_files/libwinpthread-1.dll +0 -0
  249. package/bin/exiftool_files/perl.exe +0 -0
  250. package/bin/exiftool_files/perl532.dll +0 -0
  251. package/package.json +7 -5
  252. package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
  253. package/bin/exiftool_files/perl530.dll +0 -0
@@ -0,0 +1,248 @@
1
+ #-*- perl -*-
2
+
3
+ package Unicode::LineBreak;
4
+ require 5.008;
5
+
6
+ ### Pragmas:
7
+ use strict;
8
+ use warnings;
9
+ use vars qw($VERSION @EXPORT_OK @ISA $Config @Config);
10
+
11
+ ### Exporting:
12
+ use Exporter;
13
+ our @EXPORT_OK = qw(UNICODE_VERSION SOMBOK_VERSION context);
14
+ our %EXPORT_TAGS = ('all' => [@EXPORT_OK]);
15
+
16
+ ### Inheritance:
17
+ our @ISA = qw(Exporter);
18
+
19
+ ### Other modules:
20
+ use Carp qw(croak carp);
21
+ use Encode qw(is_utf8);
22
+ use MIME::Charset;
23
+ use Unicode::GCString;
24
+
25
+ ### Globals
26
+
27
+ ### The package version
28
+ our $VERSION = '2019.001';
29
+
30
+ ### Public Configuration Attributes
31
+ our @Config = (
32
+ BreakIndent => 'YES',
33
+ CharMax => 998,
34
+ ColMax => 76,
35
+ ColMin => 0,
36
+ ComplexBreaking => 'YES',
37
+ Context => 'NONEASTASIAN',
38
+ EAWidth => undef,
39
+ Format => 'SIMPLE',
40
+ HangulAsAL => 'NO',
41
+ LBClass => undef,
42
+ LegacyCM => 'YES',
43
+ Newline => "\n",
44
+ Prep => undef,
45
+ Sizing => 'UAX11',
46
+ Urgent => undef,
47
+ ViramaAsJoiner => 'YES',
48
+ );
49
+ our $Config = {};
50
+ eval { require Unicode::LineBreak::Defaults; };
51
+ push @Config, (%$Config);
52
+
53
+ ### Exportable constants
54
+ use Unicode::LineBreak::Constants;
55
+ use constant 1.01;
56
+ my $package = __PACKAGE__;
57
+ my @consts = grep { s/^${package}::(\w\w+)$/$1/ } keys %constant::declared;
58
+ push @EXPORT_OK, @consts;
59
+ push @{$EXPORT_TAGS{'all'}}, @consts;
60
+
61
+ ### Load XS module
62
+ require XSLoader;
63
+ XSLoader::load('Unicode::LineBreak', $VERSION);
64
+
65
+ ### Load dynamic constants
66
+ foreach my $p ((['EA', EAWidths()], ['LB', LBClasses()])) {
67
+ my $prop = shift @{$p};
68
+ my $idx = 0;
69
+ foreach my $val (@{$p}) {
70
+ no strict;
71
+ my $const = "${prop}_${val}";
72
+ *{$const} = eval "sub { $idx }";
73
+ push @EXPORT_OK, $const;
74
+ push @{$EXPORT_TAGS{'all'}}, $const;
75
+ $idx++;
76
+ }
77
+ }
78
+
79
+ ### Privates
80
+ my $EASTASIAN_CHARSETS = qr{
81
+ ^BIG5 |
82
+ ^CP9\d\d |
83
+ ^EUC- |
84
+ ^GB18030 | ^GB2312 | ^GBK |
85
+ ^HZ |
86
+ ^ISO-2022- |
87
+ ^KS_C_5601 |
88
+ ^SHIFT_JIS
89
+ }ix;
90
+
91
+ my $EASTASIAN_LANGUAGES = qr{
92
+ ^AIN |
93
+ ^JA\b | ^JPN |
94
+ ^KO\b | ^KOR |
95
+ ^ZH\b | ^CHI
96
+ }ix;
97
+
98
+ use overload
99
+ '%{}' => \&as_hashref,
100
+ '${}' => \&as_scalarref,
101
+ '""' => \&as_string,
102
+ ;
103
+
104
+ sub new {
105
+ my $class = shift;
106
+
107
+ my $self = __PACKAGE__->_new();
108
+ $self->config(@Config);
109
+ $self->config(@_);
110
+ bless $self, $class;
111
+ }
112
+
113
+ sub config ($@) {
114
+ my $self = shift;
115
+
116
+ # Get config.
117
+ if (scalar @_ == 1) {
118
+ my $k = shift;
119
+ my $ret;
120
+
121
+ if (uc $k eq uc 'CharactersMax') {
122
+ return $self->_config('CharMax');
123
+ } elsif (uc $k eq uc 'ColumnsMax') {
124
+ return $self->_config('ColMax');
125
+ } elsif (uc $k eq uc 'ColumnsMin') {
126
+ return $self->_config('ColMin');
127
+ } elsif (uc $k eq uc 'SizingMethod') {
128
+ return $self->_config('Sizing');
129
+ } elsif (uc $k eq uc 'TailorEA') {
130
+ carp "$k is obsoleted. Use EAWidth";
131
+ $ret = $self->_config('EAWidth');
132
+ if (! defined $ret) {
133
+ return [];
134
+ } else {
135
+ return [map { ($_->[0] => $_->[1]) } @{$ret}];
136
+ }
137
+ } elsif (uc $k eq uc 'TailorLB') {
138
+ carp "$k is obsoleted. Use LBClass";
139
+ $ret = $self->_config('LBClass');
140
+ if (! defined $ret) {
141
+ return [];
142
+ } else {
143
+ return [map { ($_->[0] => $_->[1]) } @{$ret}];
144
+ }
145
+ } elsif (uc $k eq uc 'UrgentBreaking') {
146
+ return $self->_config('Urgent');
147
+ } elsif (uc $k eq uc 'UserBreaking') {
148
+ carp "$k is obsoleted. Use Prep";
149
+ $ret = $self->_config('Prep');
150
+ if (! defined $ret) {
151
+ return [];
152
+ } else {
153
+ return $ret;
154
+ }
155
+ } else {
156
+ return $self->_config($k);
157
+ }
158
+ }
159
+
160
+ # Set config.
161
+ my @config = ();
162
+ while (0 < scalar @_) {
163
+ my $k = shift;
164
+ my $v = shift;
165
+
166
+ if (uc $k eq uc 'CharactersMax') {
167
+ push @config, 'CharMax' => $v;
168
+ } elsif (uc $k eq uc 'ColumnsMax') {
169
+ push @config, 'ColMax' => $v;
170
+ } elsif (uc $k eq uc 'ColumnsMin') {
171
+ push @config, 'ColMin' => $v;
172
+ } elsif (uc $k eq uc 'SizingMethod') {
173
+ push @config, 'Sizing' => $v;
174
+ } elsif (uc $k eq uc 'TailorLB') {
175
+ carp "$k is obsoleted. Use LBClass";
176
+ push @config, 'LBClass' => undef;
177
+ if (! defined $v) {
178
+ ;
179
+ } else {
180
+ my @v = @{$v};
181
+ while (scalar(@v)) {
182
+ my $k = shift @v;
183
+ my $v = shift @v;
184
+ push @config, 'LBClass' => [ $k => $v ];
185
+ }
186
+ }
187
+ } elsif (uc $k eq uc 'TailorEA') {
188
+ carp "$k is obsoleted. Use EAWidth";
189
+ push @config, 'EAWidth' => undef;
190
+ if (! defined $v) {
191
+ ;
192
+ } else {
193
+ my @v = @{$v};
194
+ while (scalar(@v)) {
195
+ my $k = shift @v;
196
+ my $v = shift @v;
197
+ push @config, 'EAWidth' => [ $k => $v ];
198
+ }
199
+ }
200
+ } elsif (uc $k eq uc 'UserBreaking') {
201
+ carp "$k is obsoleted. Use Prep";
202
+ push @config, 'Prep' => undef;
203
+ if (! defined $v) {
204
+ ;
205
+ } elsif (ref $v eq 'ARRAY') {
206
+ push @config, map { ('Prep' => $_) } @{$v};
207
+ } else {
208
+ push @config, 'Prep' => $v;
209
+ }
210
+ } elsif (uc $k eq uc 'UrgentBreaking') {
211
+ push @config, 'Urgent' => $v;
212
+ } else {
213
+ push @config, $k => $v;
214
+ }
215
+ }
216
+
217
+ $self->_config(@config) if scalar @config;
218
+ }
219
+
220
+ sub context (@) {
221
+ my %opts = @_;
222
+
223
+ my $charset;
224
+ my $language;
225
+ my $context;
226
+ foreach my $k (keys %opts) {
227
+ if (uc $k eq 'CHARSET') {
228
+ if (ref $opts{$k}) {
229
+ $charset = $opts{$k}->as_string;
230
+ } else {
231
+ $charset = MIME::Charset->new($opts{$k})->as_string;
232
+ }
233
+ } elsif (uc $k eq 'LANGUAGE') {
234
+ $language = uc $opts{$k};
235
+ $language =~ s/_/-/;
236
+ }
237
+ }
238
+ if ($charset and $charset =~ /$EASTASIAN_CHARSETS/) {
239
+ $context = 'EASTASIAN';
240
+ } elsif ($language and $language =~ /$EASTASIAN_LANGUAGES/) {
241
+ $context = 'EASTASIAN';
242
+ } else {
243
+ $context = 'NONEASTASIAN';
244
+ }
245
+ $context;
246
+ }
247
+
248
+ 1;
@@ -576,180 +576,4 @@ __END__
576
576
  # DOCUMENTATION
577
577
  #
578
578
 
579
- =head1 NAME
580
-
581
- Win32::API::Struct - C struct support package for Win32::API
582
-
583
- =head1 SYNOPSIS
584
-
585
- use Win32::API;
586
-
587
- Win32::API::Struct->typedef( 'POINT', qw(
588
- LONG x;
589
- LONG y;
590
- ));
591
-
592
- my $Point = Win32::API::Struct->new( 'POINT' );
593
- $Point->{x} = 1024;
594
- $Point->{y} = 768;
595
-
596
- #### alternatively
597
-
598
- tie %Point, 'Win32::API::Struct', 'POINT';
599
- $Point{x} = 1024;
600
- $Point{y} = 768;
601
-
602
-
603
- =head1 ABSTRACT
604
-
605
- This module enables you to define C structs for use with
606
- Win32::API.
607
-
608
- See L<Win32::API/USING STRUCTURES> for more info about its usage.
609
-
610
- =head1 DESCRIPTION
611
-
612
- This module is automatically imported by Win32::API, so you don't
613
- need to 'use' it explicitly. The main methods are C<typedef> and
614
- C<new>, which are documented below.
615
-
616
- =over 4
617
-
618
- =item C<typedef NAME, TYPE, MEMBER, TYPE, MEMBER, ...>
619
-
620
- This method defines a structure named C<NAME>. The definition consists
621
- of types and member names, just like in C. In fact, most of the
622
- times you can cut the C definition for a structure and paste it
623
- verbatim to your script, enclosing it in a C<qw()> block. The
624
- function takes care of removing the semicolon after the member
625
- name. Win32::API::Struct does B<NOT> support Enums, Unions, or Bitfields.
626
- C<NAME> must not end in C<*>, typedef creates structs, not struct pointers.
627
- See L<Win32::API::Type/"typedef">
628
- on how to create a struct pointer type. Returns true on success, and undef on error.
629
- On error it L<warns|perlfunc/warn> with the specific reason.
630
-
631
- The synopsis example could be written like this:
632
-
633
- Win32::API::Struct->typedef('POINT', 'LONG', 'x', 'LONG', 'y');
634
-
635
- But it could also be written like this (note the indirect object
636
- syntax), which is pretty cool:
637
-
638
- typedef Win32::API::Struct POINT => qw{
639
- LONG x;
640
- LONG y;
641
- };
642
-
643
- L<Win32::API/Call> automatically knows that an 'LPNAME' type, refers
644
- to a 'NAME' type struct. Also see L<Win32::API::Type/"typedef"> on how to declare
645
- pointers to struct types.
646
-
647
- Unlike in Win32::API, a single non-array char or CHAR struct member in a
648
- struct is numeric, NOT the first character of a string. UTF16 strings pointers
649
- will be garbage on read back (passing in works, returning doesn't) since
650
- the NULL character will often be the 2nd byte of the UTF16 string.
651
-
652
- =item C<new NAME>
653
-
654
- This creates a structure (a Win32::API::Struct object) of the
655
- type C<NAME> (it must have been defined with C<typedef>). In Perl,
656
- when you create a structure, all the members are undefined. But
657
- when you use that structure in C (eg. a Win32::API call), you
658
- can safely assume that they will be treated as zero (or NULL).
659
-
660
- =item C<sizeof>
661
-
662
- This returns the size, in bytes, of the structure. Acts just like
663
- the C function of the same name. It is particularly useful for
664
- structures that need a member to be initialized to the structure's
665
- own size.
666
-
667
- =item C<align [SIZE]>
668
-
669
- Sets or returns the structure alignment (eg. how the structure is
670
- stored in memory). This is a very advanced option, and you normally
671
- don't need to mess with it.
672
- All structures in the Win32 Platform SDK should work without it.
673
- But if you define your own structure, you may need to give it an
674
- explicit alignment. In most cases, passing a C<SIZE> of 'auto'
675
- should keep the world happy.
676
-
677
- =back
678
-
679
- =head2 THE C<tie> INTERFACE
680
-
681
- Instead of creating an object with the C<new> method, you can
682
- tie a hash, which will hold the desired structure, using the
683
- C<tie> builtin function:
684
-
685
- tie %structure, Win32::API::Struct => 'NAME';
686
-
687
- The differences between the tied and non-tied approaches are:
688
-
689
- =over 4
690
-
691
- =item *
692
- with tied structures, you can access members directly as
693
- hash lookups, eg.
694
-
695
- # tied # non-tied
696
- $Point{x} vs. $Point->{x}
697
-
698
- =item *
699
- with tied structures, when you try to fetch or store a
700
- member that is not part of the structure, it will result
701
- in a warning, eg.
702
-
703
- print $Point{z};
704
- # this will warn: 'z' is not a member of Win32::API::Struct POINT
705
-
706
- =item *
707
- when you pass a tied structure as a Win32::API parameter,
708
- remember to backslash it, eg.
709
-
710
- # tied # non-tied
711
- GetCursorPos( \%Point ) vs. GetCursorPos( $Point )
712
-
713
- =back
714
-
715
- =head2 FOREIGN MEMORY ALLOCATORS
716
-
717
- Using Win32::API::Struct is not recommended in situations where a C function
718
- will return results to you by putting a pointer to a string or a pointer to
719
- another struct into your supplied struct. Win32::API::Struct will do its best
720
- to detect that a new pointer appeared and to read it contents into Perl, but
721
- that pointer will be tossed away after being read. If this pointer is
722
- something you must explicitly free, you have leaked it by using
723
- Win32::API::Struct to decode it. If this pointer is something you must pass back to
724
- the C API you are using, you lost/leaked it. If you pass NULL, or a ::Struct
725
- pointer in a ::Struct to C API, after the C API call, ::Struct will detect the
726
- pointer changed, it will read the new struct from the new pointer into
727
- Perl, and a new child ::Struct will appear in the hash slice
728
- of the parent ::Struct, if you pass this new child ::Struct into the C API
729
- it will be a B<COPY> of the struct the C API from Perl's allocation placed
730
- in the parent ::Struct. For C++-like APIs, this will be unacceptable and lead to
731
- crashes as the C Functions tries to free a memory block that didn't come from the
732
- allocator of the C Function. Windows has many memory allocators, each CRT
733
- (VS 2, 3, 4, 5, NT/6, 7.0, 7.1, 8, 9, 10) malloc, LocalAlloc, GlobalAlloc,
734
- HeapAlloc, (each version of C++ Runtime Library) "new", CoGetMalloc, CoTaskMemAlloc,
735
- NetApiBufferAllocate, VirtualAlloc, CryptMemAlloc, AllocADsMem, SHAlloc,
736
- SnmpUtilMemAlloc. None of these allocators' pointers are compatible with Perl's
737
- allocator. Some C APIs give you static global buffers which never are freed or freed
738
- automatically in the next call to a function from to that DLL.
739
-
740
- With foreign allocators, its best to treat to write a pointer class, bless the
741
- ref to scalar integer (holding the pointer) into that class to ensure that the
742
- DESTROY method will free the pointer and you never leak it, and your write
743
- method accessors using L<perlfunc/pack>, L<Win32::API/ReadMemory> and
744
- L<Win32::API/WriteMemory> around the pointer.
745
-
746
-
747
- =head1 AUTHOR
748
-
749
- Aldo Calpini ( I<dada@perl.it> ).
750
-
751
- =head1 MAINTAINER
752
-
753
- Cosimo Streppone ( I<cosimo@cpan.org> ).
754
-
755
- =cut
579
+ #line 756
@@ -309,106 +309,7 @@ sub Unpack {
309
309
  # DOCUMENTATION
310
310
  #
311
311
 
312
- =head1 NAME
313
-
314
- Win32::API::Type - C type support package for Win32::API
315
-
316
- =head1 SYNOPSIS
317
-
318
- use Win32::API;
319
-
320
- Win32::API::Type->typedef( 'my_number', 'LONG' );
321
-
322
-
323
- =head1 ABSTRACT
324
-
325
- This module is a support package for Win32::API that implements
326
- C types for the import with prototype functionality.
327
-
328
- See L<Win32::API> for more info about its usage.
329
-
330
- =head1 DESCRIPTION
331
-
332
- This module is automatically imported by Win32::API, so you don't
333
- need to 'use' it explicitly. These are the methods of this package:
334
-
335
- =over 4
336
-
337
- =item C<typedef NAME, TYPE>
338
-
339
- This method defines a new type named C<NAME>. This actually just
340
- creates an alias for the already-defined type C<TYPE>, which you
341
- can use as a parameter in a Win32::API call.
342
-
343
- When C<TYPE> contains a Win32::API::Struct type declared with
344
- L<Win32::API::Struct/typedef> with " *" postfixed to C<TYPE> parameter,
345
- C<NAME> will be a alias for the pointer version of the struct type. Creating
346
- an alias for a struct type is not supported, you have to call
347
- L<Win32::API::Struct/typedef> again. Passing a struct type as C<TYPE>
348
- without the " *" postfix is not supported.
349
-
350
- L<Warns|perlfunc/warn> and returns undef if C<TYPE> is unknown, else returns true.
351
-
352
- =item C<sizeof TYPE>
353
-
354
- This returns the size, in bytes, of C<TYPE>. Acts just like
355
- the C function of the same name.
356
-
357
- =item C<is_known TYPE>
358
-
359
- Returns true if C<TYPE> is known by Win32::API::Type, false
360
- otherwise.
361
-
362
- =back
363
-
364
- =head2 SUPPORTED TYPES
365
-
366
- This module recognizes many commonly used types defined in the Win32 Platform
367
- SDK header files, but not all. Types less than 13 years old are very unlikely
368
- to be the in built type database.
369
-
370
- Please see the source for this module, in the C<__DATA__> section,
371
- for the full list of builtin supported types.
372
-
373
-
374
- =head2 NOTES ON SELECT TYPES
375
-
376
- =over 4
377
-
378
- =item LPVOID
379
-
380
- Due to poor design, currently LPVOID is a char *, a string, not a number.
381
- It should really be a number. It is suggested to replace LPVOID in your
382
- C prototypes passed to Win32::API with UINT_PTR which is a pointer
383
- sized number.
384
-
385
- =item SOMETYPE **
386
-
387
- Currently ** types do not parse.
388
-
389
- =item void **
390
-
391
- Replace void ** in your C prototype that you pass to Win32::API::More with
392
- LPHANDLE.
393
-
394
- =item unsigned char
395
-
396
- =item signed char
397
-
398
- These 2 types by name force numeric handling. C<97> not C<"a">. C<UCHAR> is
399
- not a C<unsigned char> for numeric handling purposes.
400
-
401
- =back
402
-
403
- =head1 AUTHOR
404
-
405
- Aldo Calpini ( I<dada@perl.it> ).
406
-
407
- =head1 MAINTAINER
408
-
409
- Cosimo Streppone ( I<cosimo@cpan.org> ).
410
-
411
- =cut
312
+ #line 412
412
313
 
413
314
 
414
315
  __DATA__