New upstream version 2020.20200313.54259
Norbert Preining
4 years ago
50 | 50 | - TL_MAKE_FLAGS="-j 2" |
51 | 51 | |
52 | 52 | # disable direct build, we don't need to build x86=64-linux two times |
53 | # | |
54 | 53 | # - os: linux |
55 | 54 | # addons: |
56 | 55 | # apt: |
85 | 84 | -v ${TRAVIS_BUILD_DIR}:/texlive -w /texlive \ |
86 | 85 | -it --rm i386/debian:jessie sh -c \ |
87 | 86 | "apt-get update; apt-get install -y --no-install-recommends bash gcc g++ make perl libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev build-essential ; ./Build -C" |
88 | # - os: linux | |
89 | # services: docker | |
90 | # env: | |
91 | # - tldir=x86_64-linuxmusl | |
92 | # - package=texlive-bin-x86_64-musl.tar.gz | |
93 | # script: | | |
94 | # docker run \ | |
95 | # -e TL_MAKE_FLAGS="${TL_MAKE_FLAGS}" \ | |
96 | # -v ${TRAVIS_BUILD_DIR}:/texlive -w /texlive \ | |
97 | # -it --rm alpine:3.2 sh -c \ | |
98 | # "apk update; apk add --no-progress bash gcc g++ make perl fontconfig-dev libx11-dev libxmu-dev libxaw-dev; ./Build -C" | |
87 | - os: linux | |
88 | services: docker | |
89 | env: | |
90 | - tldir=x86_64-linuxmusl | |
91 | - package=texlive-bin-x86_64-musl.tar.gz | |
92 | script: | | |
93 | docker run \ | |
94 | -e TL_MAKE_FLAGS="${TL_MAKE_FLAGS}" \ | |
95 | -v ${TRAVIS_BUILD_DIR}:/texlive -w /texlive \ | |
96 | -it --rm alpine:3.2 sh -c \ | |
97 | "apk update; apk add --no-progress bash gcc g++ make perl fontconfig-dev libx11-dev libxmu-dev libxaw-dev; ./Build -C" | |
99 | 98 | # - os: osx |
100 | 99 | # osx_image: xcode7.3 |
101 | 100 | # env: |
104 | 103 | # before_script: |
105 | 104 | # script: ./Build -C |
106 | 105 | |
107 | # somehow all binaries are always put into x86_64-pc-linux-gnu, probably because | |
108 | # this is the architecture travis-ci is running on. | |
109 | # Rename to the currently built architecture | |
106 | # somehow all binaries are always put into x86_64-pc-linux-gnu, probably | |
107 | # because this is the architecture travis-ci is running on. | |
108 | # Rename to the currently built architecture. | |
110 | 109 | before_deploy: |
111 | 110 | - if [ -n "$package" ]; then sudo mv inst/bin/* inst/bin/$tldir ; tar czvf ${package} -C inst/bin .; fi |
112 | 111 | - if [ -r inst/bin/*/luahbtex ] ; then cp inst/bin/*/luahbtex luahbtex.$tldir ; fi |
0 | 2020-03-06 Karl Berry <karl@tug.org> | |
1 | ||
2 | * .travis.yml: attempt to reenable musl build on github. | |
3 | ||
0 | 4 | 2020-01-31 Karl Berry <karl@tug.org> |
1 | 5 | |
2 | 6 | * Makefile.am (texlinks_dir): now texk/texlive/tl_support |
38 | 38 | CFLAGS=-D_NETBSD_SOURCE \ |
39 | 39 | CXXFLAGS='-D_NETBSD_SOURCE -std=c++11' \ |
40 | 40 | LDFLAGS='-L/usr/X11R7/lib -Wl,-rpath,/usr/X11R7/lib' \ |
41 | ./Build --enable-xindy CLISP=/usr/local/bin/clisp --disable-dvisvgm | |
41 | ./Build --enable-xindy CLISP=/usr/local/bin/clisp | |
42 | Except that we take Nelson's asy build. | |
42 | 43 | |
43 | 44 | i386-freebsd, amd64-freebsd: |
44 | 45 | http://anthesphoria.net/FreeBSD/TeXLive-2018/ has details for 2018. |
45 | 2019 built on contextgarden, see below. | |
46 | 2019 and forward built on contextgarden (see below). | |
47 | In 2020: FreeBSD 12.1-RELEASE-p1 | |
48 | (e.g., | |
49 | https://build.contextgarden.net/#/builders/56/builds/141/steps/2/logs/build _info | |
50 | ) Except that we take Nelson's asy build. | |
46 | 51 | |
47 | 52 | i386-linux: see travis below. |
48 | 53 |
4156 | 4156 | : ;; #( |
4157 | 4157 | *) : |
4158 | 4158 | case $host in #( |
4159 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
4159 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
4160 | 4160 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajittex'" >&5 |
4161 | 4161 | $as_echo "$as_me: $host -> \`--disable-luajittex'" >&6;} |
4162 | 4162 | ac_configure_args="$ac_configure_args '--disable-luajittex'" ;; #( |
4169 | 4169 | : ;; #( |
4170 | 4170 | *) : |
4171 | 4171 | case $host in #( |
4172 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
4172 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
4173 | 4173 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajithbtex'" >&5 |
4174 | 4174 | $as_echo "$as_me: $host -> \`--disable-luajithbtex'" >&6;} |
4175 | 4175 | ac_configure_args="$ac_configure_args '--disable-luajithbtex'" ;; #( |
4182 | 4182 | : ;; #( |
4183 | 4183 | *) : |
4184 | 4184 | case $host in #( |
4185 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
4185 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
4186 | 4186 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit'" >&5 |
4187 | 4187 | $as_echo "$as_me: $host -> \`--disable-mfluajit'" >&6;} |
4188 | 4188 | ac_configure_args="$ac_configure_args '--disable-mfluajit'" ;; #( |
4195 | 4195 | : ;; #( |
4196 | 4196 | *) : |
4197 | 4197 | case $host in #( |
4198 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
4198 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
4199 | 4199 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit-nowin'" >&5 |
4200 | 4200 | $as_echo "$as_me: $host -> \`--disable-mfluajit-nowin'" >&6;} |
4201 | 4201 | ac_configure_args="$ac_configure_args '--disable-mfluajit-nowin'" ;; #( |
3336 | 3336 | : ;; #( |
3337 | 3337 | *) : |
3338 | 3338 | case $host in #( |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3340 | 3340 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajittex'" >&5 |
3341 | 3341 | $as_echo "$as_me: $host -> \`--disable-luajittex'" >&6;} |
3342 | 3342 | ac_configure_args="$ac_configure_args '--disable-luajittex'" ;; #( |
3349 | 3349 | : ;; #( |
3350 | 3350 | *) : |
3351 | 3351 | case $host in #( |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3353 | 3353 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajithbtex'" >&5 |
3354 | 3354 | $as_echo "$as_me: $host -> \`--disable-luajithbtex'" >&6;} |
3355 | 3355 | ac_configure_args="$ac_configure_args '--disable-luajithbtex'" ;; #( |
3362 | 3362 | : ;; #( |
3363 | 3363 | *) : |
3364 | 3364 | case $host in #( |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3366 | 3366 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit'" >&5 |
3367 | 3367 | $as_echo "$as_me: $host -> \`--disable-mfluajit'" >&6;} |
3368 | 3368 | ac_configure_args="$ac_configure_args '--disable-mfluajit'" ;; #( |
3375 | 3375 | : ;; #( |
3376 | 3376 | *) : |
3377 | 3377 | case $host in #( |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3379 | 3379 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit-nowin'" >&5 |
3380 | 3380 | $as_echo "$as_me: $host -> \`--disable-mfluajit-nowin'" >&6;} |
3381 | 3381 | ac_configure_args="$ac_configure_args '--disable-mfluajit-nowin'" ;; #( |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for lua53 (TeX Live) 5.3.4. | |
2 | # Generated by GNU Autoconf 2.69 for lua53 (TeX Live) 5.3.5. | |
3 | 3 | # |
4 | 4 | # Report bugs to <tex-k@tug.org>. |
5 | 5 | # |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='lua53 (TeX Live)' |
591 | 591 | PACKAGE_TARNAME='lua53--tex-live-' |
592 | PACKAGE_VERSION='5.3.4' | |
593 | PACKAGE_STRING='lua53 (TeX Live) 5.3.4' | |
592 | PACKAGE_VERSION='5.3.5' | |
593 | PACKAGE_STRING='lua53 (TeX Live) 5.3.5' | |
594 | 594 | PACKAGE_BUGREPORT='tex-k@tug.org' |
595 | 595 | PACKAGE_URL='' |
596 | 596 | |
1326 | 1326 | # Omit some internal or obsolete options to make the list less imposing. |
1327 | 1327 | # This message is too long to be a string in the A/UX 3.1 sh. |
1328 | 1328 | cat <<_ACEOF |
1329 | \`configure' configures lua53 (TeX Live) 5.3.4 to adapt to many kinds of systems. | |
1329 | \`configure' configures lua53 (TeX Live) 5.3.5 to adapt to many kinds of systems. | |
1330 | 1330 | |
1331 | 1331 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1332 | 1332 | |
1397 | 1397 | |
1398 | 1398 | if test -n "$ac_init_help"; then |
1399 | 1399 | case $ac_init_help in |
1400 | short | recursive ) echo "Configuration of lua53 (TeX Live) 5.3.4:";; | |
1400 | short | recursive ) echo "Configuration of lua53 (TeX Live) 5.3.5:";; | |
1401 | 1401 | esac |
1402 | 1402 | cat <<\_ACEOF |
1403 | 1403 | |
1514 | 1514 | test -n "$ac_init_help" && exit $ac_status |
1515 | 1515 | if $ac_init_version; then |
1516 | 1516 | cat <<\_ACEOF |
1517 | lua53 (TeX Live) configure 5.3.4 | |
1517 | lua53 (TeX Live) configure 5.3.5 | |
1518 | 1518 | generated by GNU Autoconf 2.69 |
1519 | 1519 | |
1520 | 1520 | Copyright (C) 2012 Free Software Foundation, Inc. |
1975 | 1975 | This file contains any messages produced by compilers while |
1976 | 1976 | running configure, to aid debugging if configure makes a mistake. |
1977 | 1977 | |
1978 | It was created by lua53 (TeX Live) $as_me 5.3.4, which was | |
1978 | It was created by lua53 (TeX Live) $as_me 5.3.5, which was | |
1979 | 1979 | generated by GNU Autoconf 2.69. Invocation command line was |
1980 | 1980 | |
1981 | 1981 | $ $0 $@ |
3899 | 3899 | |
3900 | 3900 | # Define the identity of the package. |
3901 | 3901 | PACKAGE='lua53--tex-live-' |
3902 | VERSION='5.3.4' | |
3902 | VERSION='5.3.5' | |
3903 | 3903 | |
3904 | 3904 | |
3905 | 3905 | cat >>confdefs.h <<_ACEOF |
5107 | 5107 | fi |
5108 | 5108 | |
5109 | 5109 | |
5110 | LUA53VERSION=5.3.4 | |
5111 | ||
5112 | ||
5113 | LUA53_LT_VERSINFO=8:4:3 | |
5110 | LUA53VERSION=5.3.5 | |
5111 | ||
5112 | ||
5113 | LUA53_LT_VERSINFO=8:5:3 | |
5114 | 5114 | |
5115 | 5115 | |
5116 | 5116 | case `pwd` in |
14544 | 14544 | # report actual input values of CONFIG_FILES etc. instead of their |
14545 | 14545 | # values after options handling. |
14546 | 14546 | ac_log=" |
14547 | This file was extended by lua53 (TeX Live) $as_me 5.3.4, which was | |
14547 | This file was extended by lua53 (TeX Live) $as_me 5.3.5, which was | |
14548 | 14548 | generated by GNU Autoconf 2.69. Invocation command line was |
14549 | 14549 | |
14550 | 14550 | CONFIG_FILES = $CONFIG_FILES |
14610 | 14610 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
14611 | 14611 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
14612 | 14612 | ac_cs_version="\\ |
14613 | lua53 (TeX Live) config.status 5.3.4 | |
14613 | lua53 (TeX Live) config.status 5.3.5 | |
14614 | 14614 | configured by $0, generated by GNU Autoconf 2.69, |
14615 | 14615 | with options \\"\$ac_cs_config\\" |
14616 | 14616 |
7 | 7 | dnl -------------------------------------------------------- |
8 | 8 | dnl |
9 | 9 | dnl m4-include this file to define the current lua53 version |
10 | m4_define([lua53_version], [5.3.4]) | |
10 | m4_define([lua53_version], [5.3.5]) |
0 | 2020-03-12 Karl Berry <karl@freefriends.org> | |
1 | ||
2 | * kpse-setup.m4 (KPSE_SETUP): disable jit programs on any | |
3 | powerpc-*, not just powerpc-darwin, since jit is also unavailable | |
4 | on powerpc-linux (specifically powerpc64le-unknown-linux-gnu), | |
5 | per Johannes Hielscher. Although apparently there are patches to | |
6 | "floating around" to make jit work on powerpc, they are not in TL, | |
7 | and let's await anyone who actually needs them before refining. | |
8 | https://tug.org/pipermail/tlbuild/2020q1/004627.html (item 1). | |
9 | ||
0 | 10 | 2020-01-13 Karl Berry <karl@tug.org> |
1 | 11 | |
2 | 12 | * kpse-setup.m4 (KPSE_SETUP): use AS_TR_SH on the argument when |
87 | 87 | AS_CASE([$enable_[]AS_TR_SH([Kpse_Pkg])], |
88 | 88 | [yes | no], [:], |
89 | 89 | [AS_CASE([$host], |
90 | [alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ], | |
90 | [alpha* | sparc* | x86_64-*-solaris* | powerpc-* ], | |
91 | 91 | [AC_MSG_NOTICE([$host -> `--disable-]Kpse_Pkg[']) |
92 | 92 | ac_configure_args="$ac_configure_args '--disable-]Kpse_Pkg['"])]) |
93 | 93 | ]) |
3336 | 3336 | : ;; #( |
3337 | 3337 | *) : |
3338 | 3338 | case $host in #( |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3340 | 3340 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajittex'" >&5 |
3341 | 3341 | $as_echo "$as_me: $host -> \`--disable-luajittex'" >&6;} |
3342 | 3342 | ac_configure_args="$ac_configure_args '--disable-luajittex'" ;; #( |
3349 | 3349 | : ;; #( |
3350 | 3350 | *) : |
3351 | 3351 | case $host in #( |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3353 | 3353 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajithbtex'" >&5 |
3354 | 3354 | $as_echo "$as_me: $host -> \`--disable-luajithbtex'" >&6;} |
3355 | 3355 | ac_configure_args="$ac_configure_args '--disable-luajithbtex'" ;; #( |
3362 | 3362 | : ;; #( |
3363 | 3363 | *) : |
3364 | 3364 | case $host in #( |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3366 | 3366 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit'" >&5 |
3367 | 3367 | $as_echo "$as_me: $host -> \`--disable-mfluajit'" >&6;} |
3368 | 3368 | ac_configure_args="$ac_configure_args '--disable-mfluajit'" ;; #( |
3375 | 3375 | : ;; #( |
3376 | 3376 | *) : |
3377 | 3377 | case $host in #( |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3379 | 3379 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit-nowin'" >&5 |
3380 | 3380 | $as_echo "$as_me: $host -> \`--disable-mfluajit-nowin'" >&6;} |
3381 | 3381 | ac_configure_args="$ac_configure_args '--disable-mfluajit-nowin'" ;; #( |
0 | 0 | # TeXLive::TLConfig.pm - module exporting configuration values |
1 | # Copyright 2007-2019 Norbert Preining | |
1 | # Copyright 2007-2020 Norbert Preining | |
2 | 2 | # This file is licensed under the GNU General Public License version 2 |
3 | 3 | # or any later version. |
4 | 4 | |
5 | 5 | package TeXLive::TLConfig; |
6 | 6 | |
7 | my $svnrev = '$Revision: 53076 $'; | |
7 | my $svnrev = '$Revision: 54123 $'; | |
8 | 8 | my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; |
9 | 9 | sub module_revision { return $_modulerevision; } |
10 | 10 | |
44 | 44 | %TLPDBSettings |
45 | 45 | %TLPDBConfigs |
46 | 46 | $NetworkTimeout |
47 | $MaxLWPErrors | |
48 | $MaxLWPReinitCount | |
47 | 49 | $PartialEngineSupport |
48 | 50 | $F_OK $F_WARNING $F_ERROR $F_NOPOSTACTION |
49 | 51 | $ChecksumLength |
55 | 57 | |
56 | 58 | # the year of our release, will be used in the location of the |
57 | 59 | # network packages, and in menu names, and other places. |
58 | $ReleaseYear = 2019; | |
60 | $ReleaseYear = 2020; | |
59 | 61 | |
60 | 62 | # users can upgrade from this year to the current year; might be the |
61 | 63 | # same as the release year, or any number of releases earlier. |
62 | # Generally not tested. | |
64 | # Generally not tested, but should be. | |
63 | 65 | $MinRelease = 2016; |
64 | 66 | |
65 | 67 | # Meta Categories do not ship files, but only call for other packages. |
91 | 93 | |
92 | 94 | # timeout for network connections (wget, LWP) in seconds |
93 | 95 | our $NetworkTimeout = 30; |
96 | # number of errors during an LWP session until it is marked as disabled | |
97 | our $MaxLWPErrors = 5; | |
98 | # max number of times we reenable LWP after it was disabled | |
99 | our $MaxLWPReinitCount = 10; | |
94 | 100 | |
95 | 101 | our $Archive = "archive"; |
96 | 102 | our $TeXLiveServerURL = "http://mirror.ctan.org"; |
188 | 194 | "Directory for backups" ], |
189 | 195 | "create_formats" => |
190 | 196 | [ "b", 1, "formats", |
191 | "Create formats on installation" ], | |
197 | "Generate formats at installation or update" ], | |
192 | 198 | "desktop_integration" => |
193 | 199 | [ "b", 1, "desktop_integration", |
194 | 200 | "Create Start menu shortcuts (w32)" ], |
234 | 240 | our $WindowsMainMenuName = "TeX Live $ReleaseYear"; |
235 | 241 | |
236 | 242 | # Comma-separated list of engines which do not exist on all platforms. |
237 | our $PartialEngineSupport = "luahbtex,luajittex,mfluajit"; | |
243 | our $PartialEngineSupport = "luajithbtex,luajittex,mfluajit"; | |
238 | 244 | |
239 | 245 | # Flags for error handling across the scripts and modules |
240 | 246 | # all fine |
4 | 4 | |
5 | 5 | package TeXLive::TLUtils; |
6 | 6 | |
7 | my $svnrev = '$Revision: 53343 $'; | |
7 | my $svnrev = '$Revision: 54143 $'; | |
8 | 8 | my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; |
9 | 9 | sub module_revision { return $_modulerevision; } |
10 | 10 | |
272 | 272 | |
273 | 273 | =item C<platform_name($canonical_host)> |
274 | 274 | |
275 | Convert a canonical host names as returned by C<config.guess> into | |
276 | TeX Live platform names. | |
275 | Convert ORIG_PLATFORM, a canonical host name as returned by | |
276 | C<config.guess>, into a TeX Live platform name. | |
277 | 277 | |
278 | 278 | CPU type is determined by a regexp, and any C</^i.86/> name is replaced |
279 | 279 | by C<i386>. |
280 | 280 | |
281 | For OS we need a list because what's returned is not likely to match our | |
282 | historical names, e.g., C<config.guess> returns C<linux-gnu> but we need | |
283 | C<linux>. This list might/should contain OSs which are not currently | |
284 | supported. | |
281 | For the OS value we need a list because what's returned is not likely to | |
282 | match our historical names, e.g., C<config.guess> returns C<linux-gnu> | |
283 | but we need C<linux>. This list contains old OSs which are not currently | |
284 | supported, just in case. | |
285 | 285 | |
286 | 286 | If a particular platform is not found in this list we use the regexp |
287 | 287 | C</.*-(.*$)/> as a last resort and hope it provides something useful. |
289 | 289 | =cut |
290 | 290 | |
291 | 291 | sub platform_name { |
292 | my ($guessed_platform) = @_; | |
293 | ||
292 | my ($orig_platform) = @_; | |
293 | my $guessed_platform = $orig_platform; | |
294 | ||
295 | # try to parse out some bsd variants that use amd64. | |
294 | 296 | $guessed_platform =~ s/^x86_64-(.*-k?)(free|net)bsd/amd64-$1$2bsd/; |
295 | 297 | my $CPU; # CPU type as reported by config.guess. |
296 | 298 | my $OS; # O/S type as reported by config.guess. |
297 | 299 | ($CPU = $guessed_platform) =~ s/(.*?)-.*/$1/; |
300 | ||
298 | 301 | $CPU =~ s/^alpha(.*)/alpha/; # alphaev whatever |
299 | 302 | $CPU =~ s/mips64el/mipsel/; # don't distinguish mips64 and 32 el |
300 | 303 | $CPU =~ s/powerpc64/powerpc/; # don't distinguish ppc64 |
306 | 309 | $CPU = $guessed_platform =~ /hf$/ ? "armhf" : "armel"; |
307 | 310 | } |
308 | 311 | |
309 | my @OSs = qw(aix cygwin darwin freebsd hpux irix | |
312 | my @OSs = qw(aix cygwin darwin dragonfly freebsd hpux irix | |
310 | 313 | kfreebsd linux netbsd openbsd solaris); |
311 | 314 | for my $os (@OSs) { |
312 | 315 | # Match word boundary at the beginning of the os name so that |
315 | 318 | # solaris2 is matched. |
316 | 319 | $OS = $os if $guessed_platform =~ /\b$os/; |
317 | 320 | } |
318 | ||
321 | ||
322 | if (! $OS) { | |
323 | warn "$0: could not guess OS from config.guess string: $orig_platform"; | |
324 | $OS = "unknownOS"; | |
325 | } | |
326 | ||
319 | 327 | if ($OS eq "linux") { |
320 | 328 | # deal with the special case of musl based distributions |
321 | 329 | # config.guess returns |
335 | 343 | # We don't use uname numbers here.) |
336 | 344 | # |
337 | 345 | # this changes each year, per above: |
338 | my $mactex_darwin = 12; # lowest minor rev supported by x86_64-darwin. | |
346 | my $mactex_darwin = 13; # lowest minor rev supported by x86_64-darwin. | |
339 | 347 | # |
340 | 348 | # Most robust approach is apparently to check sw_vers (os version, |
341 | 349 | # returns "10.x" values), and sysctl (processor hardware). |
344 | 352 | if ($os_major != 10) { |
345 | 353 | warn "$0: only MacOSX is supported, not $OS $os_major.$os_minor " |
346 | 354 | . " (from sw_vers -productVersion: $sw_vers)\n"; |
347 | return "unknown-unknown"; | |
355 | return "unknownmac-unknownmac"; | |
348 | 356 | } |
349 | 357 | if ($os_minor >= $mactex_darwin) { |
350 | 358 | ; # current version, default is ok (x86_64-darwin). |
411 | 419 | 'universal-darwin' => 'MacOSX universal binaries', |
412 | 420 | 'win32' => 'Windows', |
413 | 421 | 'x86_64-cygwin' => 'Cygwin on x86_64', |
414 | 'x86_64-darwin' => 'MacOSX current (10.12-) on x86_64', | |
422 | 'x86_64-darwin' => 'MacOSX current (10.13-) on x86_64', | |
415 | 423 | 'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-) on x86_64', |
424 | 'x86_64-dragonfly' => 'DragonFlyBSD on x86_64', | |
416 | 425 | 'x86_64-linux' => 'GNU/Linux on x86_64', |
417 | 426 | 'x86_64-linuxmusl' => 'GNU/Linux on x86_64 with musl', |
418 | 427 | 'x86_64-solaris' => 'Solaris on x86_64', |
2788 | 2797 | } |
2789 | 2798 | } |
2790 | 2799 | |
2800 | ||
2791 | 2801 | sub _download_file_lwp { |
2792 | 2802 | my ($url, $dest) = @_; |
2793 | if (defined($::tldownload_server) && $::tldownload_server->enabled) { | |
2794 | debug("persistent connection set up, trying to get $url (for $dest)\n"); | |
2795 | my $ret = $::tldownload_server->get_file($url, $dest); | |
2796 | if ($ret) { | |
2797 | ddebug("downloading file via persistent connection succeeded\n"); | |
2798 | return $ret; | |
2799 | } else { | |
2800 | debug("TLUtils::download_file: persistent connection ok," | |
2801 | . " but download failed: $url\n"); | |
2802 | debug("TLUtils::download_file: retrying with wget.\n"); | |
2803 | } | |
2803 | if (!defined($::tldownload_server)) { | |
2804 | ddebug("::tldownload_server not defined\n"); | |
2805 | return(0); | |
2806 | } | |
2807 | if (!$::tldownload_server->enabled) { | |
2808 | # try to reinitialize a disabled connection | |
2809 | # disabling happens after 6 failed download trials | |
2810 | # we just re-initialize the connection | |
2811 | if (!setup_persistent_downloads()) { | |
2812 | # setup failed, give up | |
2813 | debug("reinitialization of LWP download failed\n"); | |
2814 | return(0); | |
2815 | } | |
2816 | # we don't need to check for ->enabled, because | |
2817 | # setup_persistent_downloads calls TLDownload->new() | |
2818 | # which, if it succeeds, automatically set enabled to 1 | |
2819 | } | |
2820 | # we are still here, so try to download | |
2821 | debug("persistent connection set up, trying to get $url (for $dest)\n"); | |
2822 | my $ret = $::tldownload_server->get_file($url, $dest); | |
2823 | if ($ret) { | |
2824 | ddebug("downloading file via persistent connection succeeded\n"); | |
2825 | return $ret; | |
2804 | 2826 | } else { |
2805 | if (!defined($::tldownload_server)) { | |
2806 | ddebug("::tldownload_server not defined\n"); | |
2807 | } else { | |
2808 | ddebug("::tldownload_server->enabled is not set\n"); | |
2809 | } | |
2810 | debug("persistent connection not set up\n"); | |
2827 | debug("TLUtils::download_file: persistent connection ok," | |
2828 | . " but download failed: $url\n"); | |
2829 | debug("TLUtils::download_file: retrying with other downloaders.\n"); | |
2811 | 2830 | } |
2812 | 2831 | # if we are still here, download with LWP didn't succeed. |
2813 | 2832 | return(0); |
2814 | 2833 | } |
2834 | ||
2815 | 2835 | |
2816 | 2836 | sub _download_file_program { |
2817 | 2837 | my ($url, $dest, $type) = @_; |
3417 | 3437 | If the log file (see L<process_logging_options>) is defined, it also |
3418 | 3438 | writes there. |
3419 | 3439 | |
3420 | This third level debugging message reports messages about processing | |
3421 | each line of any tlpdb files read, in addition to the first and second | |
3422 | levels. | |
3440 | In addition to the first and second levels, this third level debugging | |
3441 | message reports messages about processing each line of any tlpdb files | |
3442 | read, and messages about files tested or matched against tlpsrc | |
3443 | patterns. This output is extremely voluminous, so unless you're | |
3444 | debugging those parts of the code, it just gets in the way. | |
3423 | 3445 | |
3424 | 3446 | =cut |
3425 | 3447 | |
3838 | 3860 | sub setup_persistent_downloads { |
3839 | 3861 | if ($TeXLive::TLDownload::net_lib_avail) { |
3840 | 3862 | ddebug("setup_persistent_downloads has net_lib_avail set\n"); |
3841 | $::tldownload_server = TeXLive::TLDownload->new; | |
3863 | if ($::tldownload_server) { | |
3864 | if ($::tldownload_server->initcount() > $TeXLive::TLConfig::MaxLWPReinitCount) { | |
3865 | debug("stop retrying to initialize LWP after 10 failures\n"); | |
3866 | return 0; | |
3867 | } else { | |
3868 | $::tldownload_server->reinit(); | |
3869 | } | |
3870 | } else { | |
3871 | $::tldownload_server = TeXLive::TLDownload->new; | |
3872 | } | |
3842 | 3873 | if (!defined($::tldownload_server)) { |
3843 | 3874 | ddebug("TLUtils:setup_persistent_downloads: failed to get ::tldownload_server\n"); |
3844 | 3875 | } else { |
38 | 38 | use strict; |
39 | 39 | |
40 | 40 | (my $prg = basename($0)) =~ s/\.pl$//; |
41 | my $version = '20200115.0'; | |
41 | my $version = '20200307.0'; | |
42 | 42 | |
43 | 43 | if (win32()) { |
44 | 44 | # conversion between internal (utf-8) and console (cp932): |
573 | 573 | } |
574 | 574 | print_info(($opt_remove ? "removing" : "generating") . " snippets and cidfmap.aliases for font aliases ...\n"); |
575 | 575 | do_aliases(); |
576 | do_cmaps(); | |
576 | 577 | write_akotfps_datafile() if $opt_akotfps; |
577 | 578 | if ($opt_texmflink && !$dry_run) { |
578 | 579 | print_info("running mktexlsr ...\n"); |
726 | 727 | # |
727 | 728 | $outp .= "\n\n% Aliases\n"; |
728 | 729 | # |
729 | my (@jal, @kal, @tal, @sal); | |
730 | my (@jal, @kal, @tal, @sal, @ai0al); | |
730 | 731 | # |
731 | 732 | for my $al (sort keys %aliases) { |
732 | 733 | my $target; |
765 | 766 | push @sal, "/$al /$target ;"; |
766 | 767 | } elsif ($class eq 'CNS') { |
767 | 768 | push @tal, "/$al /$target ;"; |
769 | } elsif ($class eq 'AI0') { | |
770 | push @ai0al, "/$al /$target ;"; | |
768 | 771 | } else { |
769 | 772 | print STDERR "unknown class $class for $al\n"; |
770 | 773 | } |
778 | 781 | $outp .= "\n% Korean fonts\n" . join("\n", @kal) . "\n" if @kal; |
779 | 782 | $outp .= "\n% Traditional Chinese fonts\n" . join("\n", @tal) . "\n" if @tal; |
780 | 783 | $outp .= "\n% Simplified Chinese fonts\n" . join("\n", @sal) . "\n" if @sal; |
784 | $outp .= "\n% Adobe-Identity-0 fonts\n" . join("\n", @ai0al) . "\n" if @ai0al; | |
781 | 785 | # |
782 | 786 | return if $dry_run; |
783 | 787 | if ($outp && !$opt_remove) { |
795 | 799 | if (-f "$opt_output/$cidfmap_aliases_pathpart") { |
796 | 800 | unlink "$opt_output/$cidfmap_aliases_pathpart" if $opt_cleanup; |
797 | 801 | } |
802 | } | |
803 | ||
804 | sub do_cmaps { | |
805 | # add symlinking CMaps | |
806 | # for which we generate snippets but gs does not provide | |
807 | my $cmapdest = "$opt_output/CMap"; | |
808 | return if $dry_run; | |
809 | if ($opt_remove) { | |
810 | # we remove only if both of the following conditions are met: | |
811 | # (1) it is a link | |
812 | # (2) the link target is the same as kpsewhich result | |
813 | # otherwise it's unsafe to remove, as it may have been added | |
814 | # by others or distributed by gs itself | |
815 | for my $class (%encode_list) { | |
816 | for my $enc (@{$encode_list{$class}}) { | |
817 | if (-l "$cmapdest/$enc") { | |
818 | my $linkt = readlink("$cmapdest/$enc"); | |
819 | if ($linkt) { | |
820 | if ($linkt eq search_cmap($enc)) { | |
821 | unlink("$cmapdest/$enc"); | |
822 | } | |
823 | } | |
824 | } | |
825 | } | |
826 | } | |
827 | return; | |
828 | } | |
829 | # add mode | |
830 | if (! -d "$cmapdest") { | |
831 | print_debug("Creating directory $cmapdest ...\n"); | |
832 | make_dir("$cmapdest", "cannot create CMap directory"); | |
833 | } | |
834 | for my $class (%encode_list) { | |
835 | if ($class =~ m/^AI0-(.*)$/) { | |
836 | # skip AI0 font-specific CMap when the real font is unavailable | |
837 | next if (!$fontdb{$1}{'available'}); | |
838 | } | |
839 | for my $enc (@{$encode_list{$class}}) { | |
840 | if (! -f "$cmapdest/$enc") { | |
841 | print_debug("CMap $enc is not found in gs resource directory\n"); | |
842 | my $dest = search_cmap($enc); | |
843 | if ($dest) { | |
844 | print_debug("Symlinking CMap $dest ...\n"); | |
845 | link_font($dest, "$cmapdest", $enc); | |
846 | } else { | |
847 | print_debug("CMap $enc is not found by kpsewhich\n"); | |
848 | } | |
849 | } | |
850 | } | |
851 | } | |
852 | } | |
853 | ||
854 | my %cmap_cache; | |
855 | ||
856 | sub search_cmap { | |
857 | my ($cmap) = @_; | |
858 | # search CMap with kpsewhich and cache | |
859 | if (! exists $cmap_cache{$cmap}) { | |
860 | chomp($cmap_cache{$cmap} = `kpsewhich -format=cmap $cmap`); | |
861 | } | |
862 | return $cmap_cache{$cmap}; | |
798 | 863 | } |
799 | 864 | |
800 | 865 | sub update_master_cidfmap { |
898 | 963 | $s .= "1) 5]"; |
899 | 964 | } elsif ($c eq "Korea") { |
900 | 965 | $s .= "1) 2]"; |
966 | } elsif ($c eq "AI0") { | |
967 | print_warning("cannot use class AI0 for non-OTF $n, skipping.\n"); | |
968 | return ''; | |
901 | 969 | } else { |
902 | 970 | print_warning("unknown class $c for $n, skipping.\n"); |
903 | 971 | return ''; |
912 | 980 | if ($opt_akotfps) { |
913 | 981 | add_akotfps_data($n); |
914 | 982 | return; |
983 | } | |
984 | if ($c eq "AI0") { | |
985 | $c = "AI0-$n"; | |
915 | 986 | } |
916 | 987 | for my $enc (@{$encode_list{$c}}) { |
917 | 988 | if ($opt_remove) { |
1204 | 1275 | # dump aliases |
1205 | 1276 | sub info_list_aliases { |
1206 | 1277 | print "List of ", ($opt_listallaliases ? "all" : "available"), " aliases and their options (in decreasing priority):\n" unless $opt_machine; |
1207 | my (@jal, @kal, @tal, @sal); | |
1278 | my (@jal, @kal, @tal, @sal, @ai0al); | |
1208 | 1279 | for my $al (sort keys %aliases) { |
1209 | 1280 | my $cl; |
1210 | 1281 | my @ks = sort { $a <=> $b} keys(%{$aliases{$al}}); |
1236 | 1307 | push @sal, $foo; |
1237 | 1308 | } elsif ($cl eq 'CNS') { |
1238 | 1309 | push @tal, $foo; |
1310 | } elsif ($cl eq 'AI0') { | |
1311 | push @ai0al, $foo; | |
1239 | 1312 | } else { |
1240 | 1313 | print STDERR "unknown class $cl for $al\n"; |
1241 | 1314 | } |
1245 | 1318 | print @kal if @kal; |
1246 | 1319 | print @sal if @sal; |
1247 | 1320 | print @tal if @tal; |
1321 | print @ai0al if @ai0al; | |
1248 | 1322 | } else { |
1249 | 1323 | print "Aliases for Japanese fonts:\n", @jal, "\n" if @jal; |
1250 | 1324 | print "Aliases for Korean fonts:\n", @kal, "\n" if @kal; |
1251 | 1325 | print "Aliases for Simplified Chinese fonts:\n", @sal, "\n" if @sal; |
1252 | 1326 | print "Aliases for Traditional Chinese fonts:\n", @tal, "\n" if @tal; |
1327 | print "Aliases for Adobe-Identity-0 fonts:\n", @ai0al, "\n" if @ai0al; | |
1253 | 1328 | } |
1254 | 1329 | } |
1255 | 1330 | |
1428 | 1503 | my $actualpsname; |
1429 | 1504 | my $bname; |
1430 | 1505 | for my $b (sort keys %{$bntofn{$realfile}}) { |
1431 | $fontdb{$k}{'doublecheck'} = "debug" if $opt_strictpsname; | |
1432 | if ($fontdb{$k}{'doublecheck'} && $zrlistttc_available) { | |
1506 | if ($opt_strictpsname && !$fontdb{$k}{'doublecheck'}) { | |
1507 | $fontdb{$k}{'doublecheck'} = "debug"; # stub | |
1508 | } | |
1509 | if ($fontdb{$k}{'doublecheck'} && $fontdb{$k}{'doublecheck'} ne "false" && $zrlistttc_available) { | |
1433 | 1510 | print_debug("We need to test whether\n"); |
1434 | print_debug(" $b\n"); | |
1435 | print_debug("is the correct one. Invoking zrlistttc ...\n"); | |
1511 | print_debug(" $b:$index\n"); | |
1512 | print_debug("is the correct one ($k). Invoking zrlistttc ...\n"); | |
1436 | 1513 | chomp($actualpsname = `texlua $zrlistttc -i $index "$b"`); |
1437 | 1514 | if ($?) { |
1438 | 1515 | # something is wrong with the font file, or zrlistttc does not support it; |
1447 | 1524 | if ($actualpsname ne $k) { |
1448 | 1525 | print_debug("... PSName returned by zrlistttc ($actualpsname) is\n"); |
1449 | 1526 | print_debug("different from our database ($k), discarding!\n"); |
1450 | print_warning("zrlistttc check failed for $b\n") if $opt_strictpsname; | |
1527 | if ($opt_strictpsname && $fontdb{$k}{'doublecheck'} eq "debug") { | |
1528 | # in our database, we've set $fontdb{$k}{'doublecheck'} to "true" intentionally | |
1529 | # when we *know* doublecheck is actually required; | |
1530 | # if the stub "debug" detects a difference, our database should contain a bug! | |
1531 | print_warning("zrlistttc check failed for $b: please report to the author!\n"); | |
1532 | } | |
1451 | 1533 | } else { |
1452 | 1534 | print_debug("... test passed.\n"); |
1453 | 1535 | $bname = $b; |
1632 | 1714 | my (@curdbl) = @_; |
1633 | 1715 | my $fontname = ""; |
1634 | 1716 | my $fontclass = ""; |
1717 | my @fontcmaps = (); | |
1635 | 1718 | my %fontprovides = (); |
1636 | 1719 | my $fontdoublecheck = ""; |
1637 | 1720 | my %fontfiles; |
1657 | 1740 | $fontdb{$realfontname}{'doublecheck'} = $fontdoublecheck; |
1658 | 1741 | $fontdb{$realfontname}{'files'} = { %fontfiles }; |
1659 | 1742 | $fontdb{$realfontname}{'provides'} = { %fontprovides }; |
1743 | if ($fontclass eq "AI0") { | |
1744 | $encode_list{"AI0-$realfontname"} = [ @fontcmaps ]; | |
1745 | } elsif (@fontcmaps) { | |
1746 | print_warning("CMap entry for $realfontname (Class: $fontclass) ignored!\n"); | |
1747 | } | |
1660 | 1748 | if ($opt_debug >= 3) { |
1661 | 1749 | print_dddebug("Dumping fontfiles for $realfontname: " . Data::Dumper::Dumper(\%fontfiles)); |
1662 | 1750 | } |
1663 | 1751 | # reset to start |
1664 | 1752 | $fontname = $fontclass = $psname = ""; |
1665 | 1753 | $fontdoublecheck = ""; |
1754 | @fontcmaps = (); | |
1666 | 1755 | %fontfiles = (); |
1667 | 1756 | %fontprovides = (); |
1668 | 1757 | } else { |
1670 | 1759 | # reset to start |
1671 | 1760 | $fontname = $fontclass = $psname = ""; |
1672 | 1761 | $fontdoublecheck = ""; |
1762 | @fontcmaps = (); | |
1673 | 1763 | %fontfiles = (); |
1674 | 1764 | %fontprovides = (); |
1675 | 1765 | } |
1708 | 1798 | if ($l =~ m/^Name:\s*(.*)$/) { $fontname = $1; next; } |
1709 | 1799 | if ($l =~ m/^PSName:\s*(.*)$/) { $psname = $1; next; } |
1710 | 1800 | if ($l =~ m/^Class:\s*(.*)$/) { $fontclass = $1 ; next ; } |
1801 | if ($l =~ m/^CMap:\s*(.*)$/) { push(@fontcmaps, $1); next ; } | |
1711 | 1802 | if ($l =~ m/^Provides\((\d+)\):\s*(.*)$/) { $fontprovides{$2} = $1; next; } |
1712 | 1803 | if ($l =~ m/^Doublecheck:\s*(.*)$/) { $fontdoublecheck = $1 ; next ; } |
1713 | 1804 | if ($l =~ m/^Casefold:\s*(.*)$/) { $fontdoublecheck = $1 ; next ; } # no longer used |
1819 | 1910 | for my $k (sort keys %fontdb) { |
1820 | 1911 | print FOO "Name: $fontdb{$k}{'origname'}\n"; |
1821 | 1912 | print FOO "PSName: $k\n" if ($fontdb{$k}{'origname'} ne $k); |
1822 | print FOO "Class: $fontdb{$k}{'class'}\n"; | |
1913 | my $class = $fontdb{$k}{'class'}; | |
1914 | print FOO "Class: $class\n"; | |
1915 | if ($class eq "AI0") { | |
1916 | for my $cmap (@{$encode_list{"AI0-$k"}}) { | |
1917 | print FOO "CMap: $cmap\n"; | |
1918 | } | |
1919 | } | |
1823 | 1920 | for my $p (sort keys %{$fontdb{$k}{'provides'}}) { |
1824 | 1921 | print FOO "Provides($fontdb{$k}{'provides'}{$p}): $p\n"; |
1825 | 1922 | } |
2147 | 2244 | For the Japanese fonts: |
2148 | 2245 | Morisawa Pr6N, Morisawa, Hiragino ProN, Hiragino, |
2149 | 2246 | Kozuka Pr6N, Kozuka ProVI, Kozuka Pro, Kozuka Std, |
2247 | HaranoAji, | |
2150 | 2248 | Yu OS X, Yu Win, MS, |
2151 | 2249 | Moga-Mobo-ex, Moga-Mobo, IPAex, IPA, Ume |
2152 | 2250 | |
2327 | 2425 | # Sazanami (free) |
2328 | 2426 | INCLUDE cjkgs-sazanami.dat |
2329 | 2427 | |
2330 | # Harano Aji Fonts (free) | |
2428 | # Harano Aji Fonts (free) -- Provides J70, J71 | |
2331 | 2429 | INCLUDE cjkgs-haranoaji.dat |
2332 | 2430 | |
2333 | 2431 | # Osaka (Apple) |
2535 | 2633 | Class: Korea |
2536 | 2634 | TTCname(20): batang.ttc(3) |
2537 | 2635 | |
2636 | # for Windows 10 | |
2637 | # and Office for Mac 2016 (at least Ver.16.11.0, 2018-03) | |
2638 | Name: MalgunGothic | |
2639 | Class: Korea | |
2640 | Doublecheck: true | |
2641 | TTFname: malgun.ttf | |
2642 | ||
2643 | # for Windows 7 | |
2644 | # and Office for Mac 2016 (Ver.15.32.0, 2017-03) | |
2538 | 2645 | Name: MalgunGothicRegular |
2539 | 2646 | Class: Korea |
2647 | Doublecheck: true | |
2540 | 2648 | TTFname: malgun.ttf |
2541 | 2649 | |
2542 | 2650 | Name: MalgunGothicBold |
24 | 24 | --]] |
25 | 25 | |
26 | 26 | -- Version information |
27 | release_date = "2020-02-21" | |
27 | release_date = "2020-03-12" | |
28 | 28 | |
29 | 29 | -- File operations are aided by the LuaFileSystem module |
30 | 30 | local lfs = require("lfs") |
0 | 0 | #!/usr/bin/env texlua |
1 | 1 | |
2 | 2 | NAME = "ptex2pdf[.lua]" |
3 | VERSION = "20200119.0" | |
3 | VERSION = "20200307.0" | |
4 | 4 | AUTHOR = "Norbert Preining" |
5 | 5 | AUTHOREMAIL = "norbert@preining.info" |
6 | 6 | SHORTDESC = "Convert Japanese TeX documents to pdf" |
13 | 13 | ]] |
14 | 14 | USAGE = [[ |
15 | 15 | [texlua] ptex2pdf[.lua] { option | basename[.tex] } ... |
16 | options: -v version | |
17 | -h help | |
18 | -help print full help (installation, TeXworks setup) | |
19 | -e use eptex class of programs | |
20 | -u use uptex class of programs | |
21 | -l use latex based formats | |
22 | -s stop at dvi | |
23 | -i retain intermediate files | |
24 | -ot '<opts>' extra options for TeX | |
25 | -od '<opts>' extra options for dvipdfmx | |
26 | -output-directory '<dir>' directory for created files]] | |
16 | options: -v version | |
17 | -h help | |
18 | -help print full help (installation, TeXworks setup) | |
19 | -e use eptex class of programs | |
20 | -u use uptex class of programs | |
21 | -l use latex based formats | |
22 | -ld use latex-dev based formats | |
23 | -s stop at dvi | |
24 | -i retain intermediate files | |
25 | -ot '<opts>' extra options for TeX | |
26 | -od '<opts>' extra options for dvipdfmx | |
27 | -output-directory '<dir>' directory for created files]] | |
27 | 28 | |
28 | 29 | LICENSECOPYRIGHT = [[ |
29 | 30 | Originally based on musixtex.lua from Bob Tennent. |
30 | 31 | |
31 | (c) Copyright 2016-2020 Japanese TeX Development Community | |
32 | (c) Copyright 2013-2020 Norbert Preining norbert@preining.info | |
33 | (c) Copyright 2012 Bob Tennent rdt@cs.queensu.ca | |
32 | (c) Copyright 2016-2020 Japanese TeX Development Community | |
33 | (c) Copyright 2013-2020 Norbert Preining norbert@preining.info | |
34 | (c) Copyright 2012 Bob Tennent rdt@cs.queensu.ca | |
34 | 35 | |
35 | 36 | This program is free software; you can redistribute it and/or modify it |
36 | 37 | under the terms of the GNU General Public License as published by the |
180 | 181 | support directories containing dots (thanks kn1cht) |
181 | 182 | - version 20200119.0 |
182 | 183 | check invalid PATH string beforehand on windows |
184 | - version 20200307.0 | |
185 | add -ld option to run (u)platex-dev | |
183 | 186 | ]] |
184 | 187 | |
185 | 188 | |
277 | 280 | use_eptex = 0 |
278 | 281 | use_uptex = 0 |
279 | 282 | use_latex = 0 |
283 | use_latexdev = 0 | |
280 | 284 | outputdir = "." |
281 | 285 | prefilename = "" |
282 | 286 | filename = "" |
314 | 318 | use_uptex = 1 |
315 | 319 | elseif this_arg == "-l" then |
316 | 320 | use_latex = 1 |
321 | elseif this_arg == "-ld" then | |
322 | use_latex = 1 | |
323 | use_latexdev = 1 | |
317 | 324 | elseif this_arg == "-s" then |
318 | 325 | dvipdf = "" |
319 | 326 | elseif this_arg == "-i" then |
343 | 350 | |
344 | 351 | whoami() |
345 | 352 | |
346 | if use_eptex == 1 then | |
353 | if use_latex == 1 then | |
347 | 354 | if use_uptex == 1 then |
348 | if use_latex == 1 then | |
355 | if use_latexdev == 1 then | |
356 | tex = "uplatex-dev" | |
357 | else | |
349 | 358 | tex = "uplatex" -- uplatex already as etex extension |
350 | else | |
359 | end | |
360 | else | |
361 | if use_latexdev == 1 then | |
362 | tex = "platex-dev" | |
363 | else | |
364 | tex = "platex" -- latex needs etex anyway | |
365 | end | |
366 | end | |
367 | else | |
368 | if use_eptex == 1 then | |
369 | if use_uptex == 1 then | |
351 | 370 | tex = "euptex" |
371 | else | |
372 | tex = "eptex" | |
352 | 373 | end |
353 | 374 | else |
354 | if use_latex == 1 then | |
355 | tex = "platex" -- latex needs etex anyway | |
356 | else | |
357 | tex = "eptex" | |
358 | end | |
359 | end | |
360 | else | |
361 | if use_uptex == 1 then | |
362 | if use_latex == 1 then | |
363 | tex = "uplatex" | |
364 | else | |
375 | if use_uptex == 1 then | |
365 | 376 | tex = "uptex" |
366 | end | |
367 | else | |
368 | if use_latex == 1 then | |
369 | tex = "platex" | |
370 | 377 | else |
371 | 378 | tex = "ptex" |
372 | 379 | end |
0 | 0 | #!/usr/bin/env perl |
1 | # $Id: texfot,v 1.38 2019/06/30 22:59:39 karl Exp $ | |
1 | # $Id: texfot,v 1.40 2020/03/10 22:35:15 karl Exp $ | |
2 | 2 | # Invoke a TeX command, filtering all but interesting terminal output; |
3 | 3 | # do not look at the log or check any output files. |
4 | 4 | # Exit status is that of the subprogram. |
7 | 7 | # |
8 | 8 | # Public domain. Originally written 2014 by Karl Berry. |
9 | 9 | |
10 | my $ident = '$Id: texfot,v 1.38 2019/06/30 22:59:39 karl Exp $'; | |
10 | my $ident = '$Id: texfot,v 1.40 2020/03/10 22:35:15 karl Exp $'; | |
11 | 11 | (my $prg = $0) =~ s,^.*/,,; |
12 | 12 | select STDERR; $| = 1; # no buffering |
13 | 13 | select STDOUT; $| = 1; |
82 | 82 | |
83 | 83 | # It's not ideal to read all of stdout and then all of stderr; it would |
84 | 84 | # be better to intermix them in the original order of child output. |
85 | # this is simpler than other ways of avoiding possible deadlock (such | |
85 | # But this is simpler than other ways of avoiding possible deadlock (such | |
86 | 86 | # as select, sysread, etc.). |
87 | 87 | &debug ("processing stdout from child"); |
88 | 88 | &process_output (\*TEXOUT, ""); |
103 | 103 | |
104 | 104 | |
105 | 105 | |
106 | # Read filehandle $FH; print lines that we want to stdout, prefixed by | |
107 | # $PREFIX. If $PREFIX is null, omit lines by default; if $PREFIX is | |
108 | # non-null, print lines by default. | |
106 | # Read filehandle $FH, printing lines that we want to stdout, | |
107 | # prefixed by $PREFIX. | |
108 | # If $PREFIX is null (happens for processing stdout), omit lines by default; | |
109 | # if $PREFIX is non-null (processing stderr), print lines by default. | |
109 | 110 | # |
110 | 111 | sub process_output { |
111 | 112 | my ($fh,$prefix) = @_; |
117 | 118 | |
118 | 119 | warn "\n" if $opt_debug; # get blank line without texfot: prefix |
119 | 120 | &debug ("looking at line: $_"); |
120 | &debug ("checking if have print_next (is $print_next)\n"); | |
121 | ||
122 | &debug ("checking if have print_next (= $print_next)\n"); | |
121 | 123 | if ($print_next) { |
122 | 124 | &debug (" printing next ($print_next)\n"); |
123 | 125 | print $prefix; |
131 | 133 | LaTeX\ Warning:\ You\ have\ requested\ package |
132 | 134 | |LaTeX\ Font\ Warning:\ Some\ font\ shapes |
133 | 135 | |LaTeX\ Font\ Warning:\ Size\ substitutions |
134 | |Package\ caption\ Warning:\ Unsupported\ document\ class | |
136 | |Package\ caption\ Warning:\ Un(supported|known)\ document\ class | |
135 | 137 | |Package\ fixltx2e\ Warning:\ fixltx2e\ is\ not\ required |
138 | |Package\ layouts\ Warning:\ Layout\ scale | |
136 | 139 | |Package\ frenchb?\.ldf\ Warning:\ (Figures|The\ definition) |
137 | 140 | |\*\*\*\ Reloading\ Xunicode\ for\ encoding # spurious *** |
138 | 141 | |This\ is\ `?(epsf\.tex|.*\.sty|TAP) # so what |
0 | 0 | #!/usr/bin/env perl |
1 | # $Id: tlmgr.pl 54087 2020-03-05 00:48:55Z preining $ | |
1 | # $Id: tlmgr.pl 54118 2020-03-05 22:27:22Z karl $ | |
2 | 2 | # |
3 | 3 | # Copyright 2008-2020 Norbert Preining |
4 | 4 | # This file is licensed under the GNU General Public License version 2 |
5 | 5 | # or any later version. |
6 | 6 | |
7 | my $svnrev = '$Revision: 54087 $'; | |
8 | my $datrev = '$Date: 2020-03-05 01:48:55 +0100 (Thu, 05 Mar 2020) $'; | |
7 | my $svnrev = '$Revision: 54118 $'; | |
8 | my $datrev = '$Date: 2020-03-05 23:27:22 +0100 (Thu, 05 Mar 2020) $'; | |
9 | 9 | my $tlmgrrevision; |
10 | 10 | my $tlmgrversion; |
11 | 11 | my $prg; |
5528 | 5528 | |README.* |
5529 | 5529 | |a_.*\.enc |
5530 | 5530 | |cid2code\.txt |
5531 | |context\.json | |
5531 | 5532 | |etex\.src |
5532 | 5533 | |fithesis.* |
5533 | 5534 | |u?kinsoku\.tex |
5715 | 5716 | if (",$TeXLive::TLConfig::PartialEngineSupport," =~ /,$engine,/) { |
5716 | 5717 | # luajit[hb]tex is special since it is not available on all architectures |
5717 | 5718 | # due to inherent reasons (machine code); |
5718 | # luahbtex is special until we build it everywhere for TL'20. | |
5719 | 5719 | # |
5720 | 5720 | # We do not want to have error messages here, so we do the following: |
5721 | 5721 | # * if tlpkg/tlpsrc/luajittex.tlpsrc is available, then load it |
5727 | 5727 | my $pkg; |
5728 | 5728 | if ($engine =~ /luajit(hb)?tex/) { |
5729 | 5729 | $pkg = "luajittex"; |
5730 | } elsif ($engine eq "luahbtex") { | |
5731 | $pkg = "luahbtex"; | |
5732 | 5730 | } elsif ($engine eq "mfluajit") { |
5733 | 5731 | $pkg = "mflua"; |
5734 | 5732 | } else { |
10010 | 10008 | distribution (L<https://tug.org/texlive>) and both are licensed under the |
10011 | 10009 | GNU General Public License Version 2 or later. |
10012 | 10010 | |
10013 | $Id: tlmgr.pl 54087 2020-03-05 00:48:55Z preining $ | |
10011 | $Id: tlmgr.pl 54118 2020-03-05 22:27:22Z karl $ | |
10014 | 10012 | =cut |
10015 | 10013 | |
10016 | 10014 | # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html |
0 | 2020-03-12 Karl Berry <karl@freefriends.org> | |
1 | ||
2 | * doc/web2c.texi (\input quoted filename), | |
3 | (\input braced filename), | |
4 | (\input filename caveats): new subnodes of "\input filenames". | |
5 | ||
0 | 6 | 2020-02-09 Phelype Oleinik <phe.h.o1@gmail.com> |
1 | 7 | |
2 | 8 | * tex.ch (29.256, scan_file_name): new procedure to implement |
228 | 228 | @LUAHBTEX_TRUE@@WIN32_TRUE@am__append_90 = call_luahbtex |
229 | 229 | @LUAHBTEX_TRUE@@WIN32_TRUE@am__append_91 = install-luahbtex-links |
230 | 230 | @LUAHBTEX_TRUE@@WIN32_TRUE@am__append_92 = uninstall-luahbtex-links |
231 | @LUAHBTEX_TRUE@@WIN32_FALSE@am__append_93 = luahbtex$(EXEEXT):texlua luahbtex$(EXEEXT):texluac | |
231 | # keep texlua[c] as links to luatex unless luatex is not installed. | |
232 | @LUAHBTEX_TRUE@@LUATEX_FALSE@@WIN32_FALSE@am__append_93 = luahbtex$(EXEEXT):texlua luahbtex$(EXEEXT):texluac | |
232 | 233 | @LUAJITTEX_TRUE@am__append_94 = luajittex |
233 | 234 | @LUAJITTEX_TRUE@@WIN32_TRUE@am__append_95 = call_luajittex |
234 | 235 | @LUAJITTEX_TRUE@@WIN32_TRUE@am__append_96 = install-luajittex-links |
238 | 239 | @LUAJITHBTEX_TRUE@@WIN32_TRUE@am__append_100 = call_luajithbtex |
239 | 240 | @LUAJITHBTEX_TRUE@@WIN32_TRUE@am__append_101 = install-luajithbtex-links |
240 | 241 | @LUAJITHBTEX_TRUE@@WIN32_TRUE@am__append_102 = uninstall-luajithbtex-links |
241 | @LUAJITHBTEX_TRUE@@WIN32_FALSE@am__append_103 = luajithbtex$(EXEEXT):texluajit luajithbtex$(EXEEXT):texluajitc | |
242 | # keep texluajit[c] as links to luajittex unless luajittex is not installed. | |
243 | @LUAJITHBTEX_TRUE@@LUAJITTEX_FALSE@@WIN32_FALSE@am__append_103 = luajithbtex$(EXEEXT):texluajit luajithbtex$(EXEEXT):texluajitc | |
242 | 244 | @LUATEX_TRUE@am__append_104 = $(luatex_tests) |
243 | 245 | @LUAHBTEX_TRUE@am__append_105 = $(luahbtex_tests) |
244 | 246 | @LUAJITTEX_TRUE@am__append_106 = $(luajittex_tests) |
Binary diff not shown
11 | 11 | @end tex |
12 | 12 | |
13 | 13 | @set version 2020 |
14 | @set month-year January 2020 | |
14 | @set month-year March 2020 | |
15 | 15 | |
16 | 16 | @c Define new indices for commands in auxiliary files, filenames, and options. |
17 | 17 | @defcodeindex cm |
62 | 62 | an implementation of Donald Knuth's TeX system. |
63 | 63 | |
64 | 64 | Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
65 | 2004, 2005, 2007, 2008, 2009 Karl Berry & Olaf Weber. | |
65 | 2004, 2005, 2007, 2008, 2009, 2010-2020 Karl Berry & Olaf Weber. | |
66 | 66 | |
67 | 67 | Permission is granted to make and distribute verbatim copies of this |
68 | 68 | manual provided the copyright notice and this permission notice are |
87 | 87 | |
88 | 88 | |
89 | 89 | @titlepage |
90 | ||
91 | 90 | @title Web2c |
92 | 91 | @subtitle for version @value{version} |
93 | 92 | @subtitle @value{month-year} |
524 | 523 | * Initial and virgin:: Making memory dumps vs. production runs. |
525 | 524 | * Memory dumps:: .fmt/.base files for fast startup. |
526 | 525 | * Editor invocation:: The `e' response at errors. |
527 | * \input filenames:: ~ and $ expansion in TeX/MF/MP. | |
526 | * \input filenames:: Filename delimiters and Kpathsea expansion. | |
528 | 527 | @end menu |
529 | 528 | |
530 | 529 | |
807 | 806 | @code{\input} that allow different notation; here we are concerned only |
808 | 807 | with the primitive operation.) |
809 | 808 | |
810 | As of Web2c version 7.5.3, double-quote characters can be used to | |
811 | include spaces or other special cases. In typical use, the @samp{"} | |
812 | characters surround the entire filename: | |
809 | As (allowed) extensions to standard @TeX{}, Web2c also supports | |
810 | specifying the filename in double quotes (@code{"some name"}) and in | |
811 | braces (@code{@{"some name"@}}), which is convenient for filenames | |
812 | containing spaces or other special characters, as described in the | |
813 | sections below. | |
814 | ||
815 | In all cases, space tokens are ignored after the filename is read. | |
816 | ||
817 | @cindex @code{"} character, ignored in filenames | |
818 | @cindex double quote character, ignored in filenames | |
819 | Also, double quote (@code{"}) characters are ignored within the | |
820 | filename; there is no way to read files whose names contain a @code{"}. | |
821 | ||
822 | @cindex portable filenames | |
823 | However, for maximal portability of your document across systems, use | |
824 | only the characters @samp{a}--@samp{z}, @samp{0}--@samp{9}, and | |
825 | @samp{.}. Do not use anything but simple filenames, since directory | |
826 | separators vary among systems; instead, add the necessary directories | |
827 | to the appropriate search path. | |
828 | ||
829 | @menu | |
830 | * Quotes: \input quoted filename. \input "some name" | |
831 | * Braces: \input braced filename. \input @{some name@} | |
832 | * Caveats: \input filename caveats. Tokenization, nulls, Kpathsea expansion. | |
833 | @end menu | |
834 | ||
835 | ||
836 | @node \input quoted filename | |
837 | @subsubsection @code{\input} quoted filename: @code{\input "some name"} | |
838 | ||
839 | @cindex @code{\input} quoted filename | |
840 | @cindex quoted filename for @code{\input} | |
841 | ||
842 | As of Web2c version 7.5.3 (2004), double-quote characters can be used | |
843 | to include spaces or other special characters. In typical use, the | |
844 | @samp{"} characters surround the entire filename: | |
813 | 845 | @example |
814 | 846 | \input "filename with spaces" |
815 | 847 | @end example |
820 | 852 | \input filename" "with" "spaces |
821 | 853 | @end example |
822 | 854 | |
823 | One more point. In @LaTeX{}, the quotes are needed inside the braces, thus | |
855 | One more point. In @LaTeX{}, the quotes are needed inside the braces | |
856 | of its @code{\input} macro, thus: | |
824 | 857 | @example |
825 | 858 | \input@{a b@} % fails |
826 | 859 | \input@{"a b"@} % ok |
827 | 860 | @end example |
828 | 861 | |
829 | This quoting mechanism comes into play @emph{after} @TeX{} has | |
830 | tokenized and expanded the input. So, multiple spaces and tabs may be | |
831 | seen as a single space, active characters such as @samp{~} are | |
832 | expanded first, and so on. (See below.) | |
862 | There is no way to quote the quote character. | |
863 | ||
864 | ||
865 | @node \input braced filename | |
866 | @subsubsection @code{\input} braced filename: @code{\input@{some name@}} | |
867 | ||
868 | @cindex @code{\input} braced (grouped) filename | |
869 | @cindex braced filename for @code{\input} | |
870 | @cindex group-delimited filename for @code{\input} | |
871 | ||
872 | As of Web2c 2020, @code{\input} filenames in @TeX{} engines (this does | |
873 | not apply in Metafont and MetaPost) can also be specified within a | |
874 | @TeX{} group, typically curly braces. For example: | |
875 | @example | |
876 | \input@{filename with spaces@} | |
877 | @end example | |
878 | ||
879 | As always with @TeX{}, the brace characters are not hardwired; what | |
880 | counts is the category code: the first token after the @code{\input} | |
881 | must be of catcode@tie{}1 (begin group), and it is matched with the | |
882 | next character of catcode@tie{}2 (end group). | |
883 | ||
884 | Within the group-delimited filename, braces are treated as normal | |
885 | characters. | |
886 | ||
887 | As with all forms of filenames, following spaces are ignored (after | |
888 | the end group), and double quote (@code{"}) characters are ignored | |
889 | within the filename. | |
890 | ||
891 | ||
892 | @node \input filename caveats | |
893 | @subsubsection @code{\input} filename caveats | |
894 | ||
895 | @cindex @code{\input} filename caveats | |
896 | @cindex caveats for @code{\input} filenames | |
897 | @cindex tokenization, and @code{\input} filenames | |
898 | @cindex expansion, and @code{\input} filenames | |
899 | @cindex multiple spaces, and @code{\input} filenames | |
900 | @cindex tabs, and @code{\input} filenames | |
901 | The quoting mechanisms just described come into play @emph{after} | |
902 | @TeX{} has tokenized and expanded the input. So, multiple spaces and | |
903 | tabs will generally be seen as a single space, active characters such | |
904 | as @samp{~} are expanded first (generally causing an error), and so | |
905 | on. More examples below. | |
833 | 906 | |
834 | 907 | @cindex NUL, not allowed in filenames |
835 | 908 | @cindex eight-bit characters in filenames |
838 | 911 | byte (character code zero, ASCII NUL) to terminate strings. So |
839 | 912 | filenames in Web2c cannot contain nulls, even though @TeX{} itself does |
840 | 913 | not treat NUL specially. |
841 | In addition, some older Unix variants do not allow eight-bit characters | |
842 | (codes 128--255) in filenames. | |
843 | ||
844 | @cindex portable filenames | |
845 | For maximal portability of your document across systems, use only the | |
846 | characters @samp{a}--@samp{z}, @samp{0}--@samp{9}, and @samp{.}, and | |
847 | restrict your filenames to at most eight characters (not including the | |
848 | extension), and at most a three-character extension. Do not use | |
849 | anything but simple filenames, since directory separators vary among | |
850 | systems; instead, add the necessary directories to the appropriate | |
851 | search path. | |
852 | 914 | |
853 | 915 | @kindex ~ @r{expansion in filenames} |
854 | 916 | @kindex $ @r{expansion in filenames} |
855 | 917 | Finally, the present Web2c implementation does @samp{~} and @samp{$} |
856 | expansion on @var{name}, unlike Knuth's original implementation and | |
857 | older versions of Web2c. Thus: | |
918 | expansion on @var{name}, unlike Knuth's original implementation. | |
919 | Thus: | |
858 | 920 | @example |
859 | 921 | \input ~jsmith/$foo.bar |
860 | 922 | @end example |
861 | will dereference the environment variable or Kpathsea config file value | |
862 | @samp{foo} and read that file extended with @samp{.bar} in user | |
863 | @samp{jsmith}'s home directory. You can also use braces, as in | |
864 | @samp{$@{foo@}bar}, if you want to follow the variable name with a letter, | |
865 | numeral, or @samp{_}. | |
923 | will dereference the environment variable or Kpathsea config file | |
924 | value @samp{foo} and read that file, extended with @samp{.bar}, in | |
925 | user @samp{jsmith}'s home directory. You can also use braces in the | |
926 | variable expansion, as in @samp{$@{foo@}bar}, if you want to follow | |
927 | the variable name with a letter, numeral, or @samp{_}. | |
866 | 928 | |
867 | 929 | (So another way to get a program to read a filename containing |
868 | 930 | whitespace is to define an environment variable and dereference it.) |
869 | 931 | |
870 | @findex \string | |
871 | In all the common @TeX{} formats (plain @TeX{}, @LaTeX{}, AMS@TeX{}), | |
872 | the characters @samp{~} and @samp{$} have special category codes, so to | |
873 | actually use these in a document you have to change their catcodes or | |
874 | use @code{\string}. (The result is unportable anyway, see the | |
875 | suggestions above.) The place where they are most likely to be useful | |
876 | is when typing interactively. | |
932 | @findex \string@r{, and @code{\input filenames}} | |
933 | In all the common @TeX{} formats (plain @TeX{}, @LaTeX{}, Con@TeX{}t, | |
934 | AMS@TeX{}, @dots{}), the characters @samp{~} and @samp{$} have special | |
935 | category codes, so to actually use these in a document you have to | |
936 | change their catcodes or use @code{\string}. | |
877 | 937 | |
878 | 938 | |
879 | 939 | @node TeX |
0 | 2020-03-09 Luigi Scarso <luigi.scarso@gmail.com> | |
1 | * texluahb / texluahbjit for luahbtex / luajithbtex | |
2 | ||
3 | 2020-03-09 Luigi Scarso <luigi.scarso@gmail.com> | |
4 | * --shell-restricted now forbids loading of dso (dll/so object) | |
5 | ||
6 | 2020-03-09 Luigi Scarso <luigi.scarso@gmail.com> | |
7 | * append_vlist : node|nil [prevdepth] (fix + extension/warning) (HH) | |
8 | ||
9 | 2020-03-01 Luigi Scarso <luigi.scarso@gmail.com> | |
10 | * fixed lua stack overflow in run_put_next (M. Kruger) | |
11 | ||
12 | 2020-02-29 Luigi Scarso <luigi.scarso@gmail.com> | |
13 | * luahbtex: add (single codepoint) "add" method to buffer (M.Kruger) | |
14 | ||
15 | 2020-03-06 Karl Berry <karl@tug.org> | |
16 | ||
17 | * am/luatex.am (texlua[jit][c]) [LUA[JIT]HBTEX && !LUA[JIT]TEX]: | |
18 | keep these as links to base lua[jit]tex, not overwriting | |
19 | with links to luahb[jit]tex, unless the base luatex is not installed. | |
20 | https://tug.org/pipermail/tex-live/2020-March/044948.html | |
21 | (and preceding) | |
22 | ||
0 | 23 | 2020-02-12 Luigi Scarso <luigi.scarso@gmail.com> |
1 | 24 | * restore state for \input delimited with {} |
2 | ||
3 | 25 | |
4 | 26 | 2020-02-11 Luigi Scarso <luigi.scarso@gmail.com> |
5 | 27 | * patches for -fno-common (thanks to D. Seifert of Gentoo team) |
23 | 23 | install_exe_links += install-luahbtex-links |
24 | 24 | uninstall_exe_links += uninstall-luahbtex-links |
25 | 25 | else !WIN32 |
26 | if !LUATEX | |
27 | # keep texlua[c] as links to luatex unless luatex is not installed. | |
26 | 28 | bin_links += luahbtex$(EXEEXT):texlua luahbtex$(EXEEXT):texluac |
29 | endif !LUATEX | |
27 | 30 | endif !WIN32 |
28 | 31 | endif LUAHBTEX |
29 | 32 | |
45 | 48 | install_exe_links += install-luajithbtex-links |
46 | 49 | uninstall_exe_links += uninstall-luajithbtex-links |
47 | 50 | else !WIN32 |
51 | if !LUAJITTEX | |
52 | # keep texluajit[c] as links to luajittex unless luajittex is not installed. | |
48 | 53 | bin_links += luajithbtex$(EXEEXT):texluajit luajithbtex$(EXEEXT):texluajitc |
54 | endif !LUAJITTEX | |
49 | 55 | endif !WIN32 |
50 | 56 | endif LUAJITHBTEX |
51 | 57 |
946 | 946 | int pc = count_char_packet_bytes(L); |
947 | 947 | if (pc <= 0) |
948 | 948 | return; |
949 | while (l_fonts[(max_f + 1)] != 0) | |
950 | max_f++; | |
949 | if (l_fonts != NULL) { | |
950 | while (l_fonts[(max_f + 1)] != 0) { | |
951 | max_f++; | |
952 | } | |
953 | } | |
951 | 954 | cp = cpackets = xmalloc((unsigned) (pc + 1)); |
952 | 955 | for (i = 1; i <= (int) lua_rawlen(L, -1); i++) { |
953 | 956 | lua_rawgeti(L, -1, i); |
958 | 961 | s = lua_tostring(L, -1); |
959 | 962 | cmd = 0; |
960 | 963 | if (lua_key_eq(s, font)) { |
964 | if (l_fonts == NULL) { | |
965 | normal_error("vf command","no font table found"); | |
966 | } | |
961 | 967 | cmd = packet_font_code; |
962 | 968 | } else if (lua_key_eq(s, char)) { |
969 | if (l_fonts == NULL) { | |
970 | normal_error("vf command","no font table found"); | |
971 | } | |
963 | 972 | cmd = packet_char_code; |
964 | 973 | if (ff == 0) { |
965 | 974 | append_packet(packet_font_code); |
967 | 976 | do_store_four(ff); |
968 | 977 | } |
969 | 978 | } else if (lua_key_eq(s, slot)) { |
979 | if (l_fonts == NULL) { | |
980 | normal_error("vf command","no font table found"); | |
981 | } | |
970 | 982 | /*tex we could be sparse but no real reason */ |
971 | 983 | cmd = packet_nop_code; |
972 | 984 | lua_rawgeti(L, -2, 2); |
2599 | 2611 | |
2600 | 2612 | /*tex The ligaturing and kerning \LUA\ interface: */ |
2601 | 2613 | |
2602 | static halfword run_lua_ligkern_callback(halfword head, halfword tail, int callback_id) | |
2614 | static void run_lua_ligkern_callback(halfword head, halfword tail, int callback_id) | |
2603 | 2615 | { |
2604 | 2616 | int i; |
2605 | 2617 | int top = lua_gettop(Luas); |
2606 | 2618 | if (!get_callback(Luas, callback_id)) { |
2607 | 2619 | lua_settop(Luas, top); |
2608 | return tail; | |
2609 | 2620 | } |
2610 | 2621 | nodelist_to_lua(Luas, head); |
2611 | 2622 | nodelist_to_lua(Luas, tail); |
2613 | 2624 | formatted_warning("ligkern","error: %s",lua_tostring(Luas, -1)); |
2614 | 2625 | lua_settop(Luas, top); |
2615 | 2626 | luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1)); |
2616 | return tail; | |
2617 | 2627 | } |
2618 | 2628 | if (fix_node_lists) { |
2619 | 2629 | fix_node_list(head); |
2620 | 2630 | } |
2621 | 2631 | lua_settop(Luas, top); |
2622 | return tail; | |
2623 | 2632 | } |
2624 | 2633 | |
2625 | 2634 | halfword new_ligkern(halfword head, halfword tail) |
2626 | 2635 | { |
2627 | 2636 | int callback_id = 0; |
2637 | if (! head) | |
2638 | return null; | |
2628 | 2639 | if (vlink(head) == null) |
2629 | 2640 | return tail; |
2630 | 2641 | callback_id = callback_defined(ligaturing_callback); |
2631 | 2642 | if (callback_id > 0) { |
2632 | tail = run_lua_ligkern_callback(head, tail, callback_id); | |
2633 | if (tail == null) | |
2634 | tail = tail_of_list(head); | |
2643 | halfword save_tail = null; | |
2644 | if (tail) { | |
2645 | save_tail = vlink(tail); | |
2646 | vlink(tail) = null; | |
2647 | } | |
2648 | run_lua_ligkern_callback(head, tail, callback_id); | |
2649 | tail = tail_of_list(head); | |
2650 | if (save_tail) { | |
2651 | try_couple_nodes(tail, save_tail); | |
2652 | } | |
2653 | tail = tail_of_list(head); | |
2635 | 2654 | } else if (callback_id == 0) { |
2636 | 2655 | tail = handle_ligaturing(head, tail); |
2637 | 2656 | } |
2638 | 2657 | callback_id = callback_defined(kerning_callback); |
2639 | 2658 | if (callback_id > 0) { |
2640 | tail = run_lua_ligkern_callback(head, tail, callback_id); | |
2641 | if (tail == null) { | |
2642 | tail = tail_of_list(head); | |
2643 | } | |
2659 | run_lua_ligkern_callback(head, tail, callback_id); | |
2660 | tail = tail_of_list(head); | |
2644 | 2661 | } else if (callback_id == 0) { |
2645 | 2662 | halfword nest1 = new_node(nesting_node, 1); |
2646 | 2663 | halfword cur = vlink(head); |
263 | 263 | token_link(t) = x; |
264 | 264 | } |
265 | 265 | t = x; |
266 | lua_pop(L, 1); | |
266 | 267 | } |
267 | 268 | lua_pop(L, 1); |
268 | 269 | } |
322 | 322 | opterr = 0; |
323 | 323 | #ifdef LuajitTeX |
324 | 324 | if ((strstr(argv[0], "luajittexlua") != NULL) || |
325 | (strstr(argv[0], "texluajit") != NULL)) { | |
325 | (strstr(argv[0], "texluajit") != NULL) || | |
326 | (strstr(argv[0], "texluahbjit") != NULL) ) { | |
326 | 327 | #else |
327 | 328 | if ((strstr(argv[0], "luatexlua") != NULL) || |
328 | (strstr(argv[0], "texlua") != NULL)) { | |
329 | (strstr(argv[0], "texlua") != NULL) || | |
330 | (strstr(argv[0], "texluahb") != NULL)) { | |
329 | 331 | #endif |
330 | 332 | lua_only = 1; |
331 | 333 | luainit = 1; |
179 | 179 | luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1)); |
180 | 180 | return 0; |
181 | 181 | } |
182 | if (lua_type(Luas,-1) == LUA_TNUMBER) { | |
183 | *next_depth = lua_roundnumber(Luas,-1); | |
184 | *prev_set = true; | |
185 | if (lua_type(Luas, -2) != LUA_TNIL) { | |
186 | p = check_isnode(Luas, -2); | |
187 | *result = *p; | |
188 | } | |
189 | } else if (lua_type(Luas, -1) != LUA_TNIL) { | |
190 | p = check_isnode(Luas, -1); | |
182 | if (lua_type(Luas, -2) == LUA_TUSERDATA) { | |
183 | p = check_isnode(Luas, -2); | |
191 | 184 | *result = *p; |
185 | } else if (lua_type(Luas, -2) == LUA_TNIL) { | |
186 | *result = null; | |
187 | } else { | |
188 | normal_warning("append to vlist","error: node or nil expected"); | |
189 | } | |
190 | if (lua_type(Luas, -1) == LUA_TNUMBER) { | |
191 | *next_depth = lua_roundnumber(Luas, -1); | |
192 | *prev_set = 1; | |
192 | 193 | } |
193 | 194 | return 1; |
194 | 195 | } |
26 | 26 | 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x65, 0x61, |
27 | 27 | 0x6d, 0x27, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, 0x7d, 0x0a, 0x0a, 0x4c, 0x55, 0x41, 0x54, 0x45, 0x58, |
28 | 28 | 0x43, 0x4f, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, 0x31, 0x2e, |
29 | 0x31, 0x31, 0x32, 0x20, 0x2d, 0x2d, 0x20, 0x77, 0x65, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, | |
29 | 0x31, 0x32, 0x30, 0x20, 0x2d, 0x2d, 0x20, 0x77, 0x65, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, | |
30 | 30 | 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x20, 0x76, 0x65, 0x72, |
31 | 31 | 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, |
32 | 32 | 0x65, 0x73, 0x20, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, |
349 | 349 | 0x20, 0x73, 0x61, 0x66, 0x65, 0x72, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, |
350 | 350 | 0x31, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, |
351 | 351 | 0x20, 0x7e, 0x3d, 0x20, 0x31, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, |
352 | 0x66, 0x66, 0x69, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x66, | |
353 | 0x66, 0x69, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x2c, 0x20, | |
354 | 0x76, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x66, 0x66, 0x69, 0x20, 0x64, | |
355 | 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6b, 0x20, 0x7e, | |
356 | 0x3d, 0x20, 0x27, 0x67, 0x63, 0x27, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
357 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x5b, 0x6b, 0x5d, 0x20, 0x3d, | |
358 | 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, | |
359 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, | |
360 | 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, | |
361 | 0x6d, 0x64, 0x35, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, | |
362 | 0x63, 0x61, 0x6c, 0x20, 0x73, 0x75, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x64, 0x35, | |
363 | 0x2e, 0x73, 0x75, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x67, | |
364 | 0x73, 0x75, 0x62, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, | |
365 | 0x73, 0x75, 0x62, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x6f, | |
366 | 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x6f, | |
367 | 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, | |
368 | 0x79, 0x74, 0x65, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x62, | |
369 | 0x79, 0x74, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, | |
370 | 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, 0x78, 0x61, 0x20, 0x74, 0x68, 0x65, 0x6e, | |
371 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, | |
372 | 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, 0x78, 0x61, 0x28, 0x6b, 0x29, | |
373 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, | |
374 | 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, 0x28, 0x6b, 0x29, | |
375 | 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, | |
376 | 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
377 | 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, | |
378 | 0x28, 0x22, 0x25, 0x30, 0x32, 0x78, 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, | |
379 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, | |
380 | 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, | |
381 | 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, | |
382 | 0x6f, 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, 0x20, 0x74, | |
383 | 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, | |
384 | 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, | |
385 | 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
386 | 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, | |
387 | 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, | |
388 | 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
389 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6f, 0x72, | |
390 | 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x58, 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, | |
391 | 0x63, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
392 | 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, | |
393 | 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, | |
394 | 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, | |
395 | 0x3a, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x67, 0x6f, 0x20, | |
396 | 0x61, 0x77, 0x61, 0x79, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x6e, 0x70, | |
397 | 0x61, 0x63, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x70, | |
398 | 0x61, 0x63, 0x6b, 0x20, 0x3d, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x75, 0x6e, 0x70, 0x61, | |
399 | 0x63, 0x6b, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, | |
400 | 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x73, 0x20, 0x74, | |
401 | 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, | |
402 | 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, | |
403 | 0x65, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x72, 0x73, 0x0a, 0x65, 0x6e, 0x64, 0x0a, | |
404 | 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x72, 0x69, | |
405 | 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x61, 0x64, | |
406 | 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x0a, 0x65, 0x6e, | |
407 | 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, | |
408 | 0x69, 0x74, 0x79, 0x3a, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, | |
409 | 0x73, 0x74, 0x61, 0x79, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x74, | |
410 | 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x20, | |
411 | 0x35, 0x2e, 0x32, 0x3a, 0x20, 0x77, 0x65, 0x27, 0x72, 0x65, 0x20, 0x6f, 0x6b, 0x61, 0x79, 0x0a, | |
412 | 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x75, 0x74, 0x66, 0x38, 0x20, 0x74, 0x68, 0x65, | |
413 | 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x35, 0x2e, | |
414 | 0x33, 0x3a, 0x20, 0x20, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x6c, 0x75, 0x61, 0x2c, | |
415 | 0x20, 0x76, 0x20, 0x31, 0x2e, 0x32, 0x34, 0x20, 0x32, 0x30, 0x31, 0x34, 0x2f, 0x31, 0x32, 0x2f, | |
416 | 0x32, 0x36, 0x20, 0x31, 0x37, 0x3a, 0x32, 0x30, 0x3a, 0x35, 0x33, 0x20, 0x72, 0x6f, 0x62, 0x65, | |
417 | 0x72, 0x74, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, | |
418 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x28, 0x20, 0x5b, 0x5b, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, | |
419 | 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, | |
420 | 0x20, 0x2d, 0x2d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x3a, 0x20, | |
421 | 0x61, 0x72, 0x67, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x7d, 0x0a, 0x0a, 0x62, | |
422 | 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x20, | |
423 | 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x29, 0x0a, 0x20, | |
424 | 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x7e, 0x61, 0x20, 0x26, 0x20, 0x30, | |
425 | 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, | |
426 | 0x0a, 0x20, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, | |
427 | 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, | |
428 | 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, | |
429 | 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, | |
430 | 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x20, 0x26, 0x20, 0x28, 0x79, | |
352 | 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x6c, 0x69, 0x62, 0x20, | |
353 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, | |
354 | 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, | |
355 | 0x65, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x72, 0x73, 0x5b, 0x34, 0x5d, 0x20, 0x3d, | |
356 | 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, | |
357 | 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x72, 0x73, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, | |
358 | 0x6e, 0x69, 0x6c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x20, 0x3d, 0x20, 0x72, | |
359 | 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x66, 0x66, 0x69, 0x27, 0x29, 0x0a, 0x0a, 0x20, | |
360 | 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x66, 0x69, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, | |
361 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x2c, 0x20, 0x76, 0x20, | |
362 | 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x66, 0x66, 0x69, 0x20, 0x64, 0x6f, 0x0a, | |
363 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6b, | |
364 | 0x20, 0x7e, 0x3d, 0x20, 0x27, 0x67, 0x63, 0x27, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, | |
365 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, | |
366 | 0x69, 0x5b, 0x6b, 0x5d, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
367 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
368 | 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, | |
369 | 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x0a, 0x65, | |
370 | 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6d, 0x64, 0x35, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, | |
371 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x75, 0x6d, 0x20, 0x20, | |
372 | 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
373 | 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x67, 0x73, 0x75, 0x62, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, | |
374 | 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75, 0x62, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, | |
375 | 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x74, | |
376 | 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
377 | 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, | |
378 | 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
379 | 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, | |
380 | 0x78, 0x61, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
381 | 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, | |
382 | 0x68, 0x65, 0x78, 0x61, 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
383 | 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, | |
384 | 0x28, 0x73, 0x75, 0x6d, 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, | |
385 | 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
386 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, | |
387 | 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x78, 0x22, 0x2c, 0x62, | |
388 | 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
389 | 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
390 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, | |
391 | 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, | |
392 | 0x6d, 0x48, 0x45, 0x58, 0x41, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
393 | 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, | |
394 | 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
395 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, | |
396 | 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, | |
397 | 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, | |
398 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, | |
399 | 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x58, | |
400 | 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
401 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, | |
402 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, | |
403 | 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, | |
404 | 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x69, | |
405 | 0x67, 0x68, 0x74, 0x20, 0x67, 0x6f, 0x20, 0x61, 0x77, 0x61, 0x79, 0x0a, 0x0a, 0x69, 0x66, 0x20, | |
406 | 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, | |
407 | 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x3d, 0x20, 0x74, 0x61, 0x62, | |
408 | 0x6c, 0x65, 0x2e, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, | |
409 | 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, | |
410 | 0x61, 0x64, 0x65, 0x72, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, | |
411 | 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x73, 0x20, 0x3d, | |
412 | 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, | |
413 | 0x72, 0x73, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, | |
414 | 0x6f, 0x61, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, | |
415 | 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, | |
416 | 0x6c, 0x6f, 0x61, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, | |
417 | 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x74, 0x68, 0x69, 0x73, | |
418 | 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x73, 0x74, 0x61, 0x79, 0x0a, 0x0a, 0x69, 0x66, 0x20, | |
419 | 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
420 | 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x35, 0x2e, 0x32, 0x3a, 0x20, 0x77, 0x65, 0x27, 0x72, | |
421 | 0x65, 0x20, 0x6f, 0x6b, 0x61, 0x79, 0x0a, 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x75, | |
422 | 0x74, 0x66, 0x38, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, | |
423 | 0x20, 0x6c, 0x75, 0x61, 0x20, 0x35, 0x2e, 0x33, 0x3a, 0x20, 0x20, 0x62, 0x69, 0x74, 0x77, 0x69, | |
424 | 0x73, 0x65, 0x2e, 0x6c, 0x75, 0x61, 0x2c, 0x20, 0x76, 0x20, 0x31, 0x2e, 0x32, 0x34, 0x20, 0x32, | |
425 | 0x30, 0x31, 0x34, 0x2f, 0x31, 0x32, 0x2f, 0x32, 0x36, 0x20, 0x31, 0x37, 0x3a, 0x32, 0x30, 0x3a, | |
426 | 0x35, 0x33, 0x20, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x74, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
427 | 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x28, 0x20, 0x5b, | |
428 | 0x5b, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x3d, | |
429 | 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x2d, 0x2d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, | |
430 | 0x61, 0x64, 0x20, 0x6f, 0x66, 0x3a, 0x20, 0x61, 0x72, 0x67, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x2e, | |
431 | 0x2e, 0x2e, 0x20, 0x7d, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x0a, | |
432 | 0x20, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, | |
433 | 0x6e, 0x20, 0x28, 0x61, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, | |
434 | 0x20, 0x7e, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, | |
435 | 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x3d, | |
436 | 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, | |
437 | 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, | |
438 | 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
439 | 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x2d, | |
440 | 0x31, 0x29, 0x20, 0x26, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x29, 0x20, | |
441 | 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, | |
442 | 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, | |
443 | 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x26, 0x20, 0x79, 0x20, 0x26, 0x20, | |
444 | 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, | |
445 | 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, | |
446 | 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, | |
447 | 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, | |
448 | 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, | |
449 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, | |
450 | 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, | |
451 | 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x6f, | |
452 | 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, | |
453 | 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
454 | 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, | |
455 | 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, | |
456 | 0x72, 0x20, 0x30, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x29, | |
457 | 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, | |
458 | 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, | |
459 | 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x7c, 0x20, 0x79, 0x20, 0x7c, | |
460 | 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, | |
461 | 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, | |
462 | 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, | |
463 | 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x7c, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, | |
464 | 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, | |
465 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, | |
466 | 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, | |
467 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, | |
468 | 0x78, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, | |
469 | 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, | |
470 | 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, | |
471 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, | |
472 | 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x20, 0x7e, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x30, | |
473 | 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, | |
474 | 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, | |
475 | 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x7e, 0x20, 0x79, | |
476 | 0x20, 0x7e, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, | |
477 | 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, | |
478 | 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, | |
479 | 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x7e, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, | |
480 | 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, | |
481 | 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, | |
482 | 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, | |
483 | 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, | |
484 | 0x20, 0x62, 0x74, 0x65, 0x73, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, | |
485 | 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, | |
486 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, | |
487 | 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, | |
488 | 0x28, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x20, 0x26, 0x20, 0x28, 0x79, | |
431 | 489 | 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, |
432 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, | |
433 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, | |
434 | 0x20, 0x78, 0x20, 0x26, 0x20, 0x79, 0x20, 0x26, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
435 | 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, | |
436 | 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
437 | 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, | |
438 | 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, | |
439 | 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, | |
440 | 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, | |
441 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, | |
442 | 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, | |
443 | 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, | |
444 | 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, | |
445 | 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, | |
446 | 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x20, 0x7c, 0x20, | |
447 | 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, | |
448 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, | |
449 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, | |
450 | 0x3d, 0x20, 0x78, 0x20, 0x7c, 0x20, 0x79, 0x20, 0x7c, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
451 | 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, | |
452 | 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, | |
453 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x7c, | |
454 | 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, | |
455 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, | |
456 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, | |
457 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, | |
458 | 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x78, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x66, | |
459 | 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, | |
460 | 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, | |
461 | 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, | |
462 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x20, | |
463 | 0x7e, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, | |
464 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, | |
465 | 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, | |
466 | 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x7e, 0x20, 0x79, 0x20, 0x7e, 0x20, 0x7a, 0x0a, 0x20, 0x20, | |
467 | 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, | |
468 | 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, | |
469 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, | |
470 | 0x20, 0x7e, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, | |
471 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
472 | 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, | |
473 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, | |
474 | 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x74, 0x65, 0x73, 0x74, 0x20, | |
475 | 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, | |
476 | 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, | |
477 | 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
478 | 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, | |
479 | 0x20, 0x2d, 0x31, 0x29, 0x20, 0x26, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, | |
480 | 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, | |
481 | 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, | |
482 | 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, | |
483 | 0x78, 0x20, 0x26, 0x20, 0x79, 0x20, 0x26, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
484 | 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, | |
485 | 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
486 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, | |
487 | 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, | |
488 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, | |
489 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, | |
490 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, | |
491 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, | |
492 | 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, | |
493 | 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, | |
494 | 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, | |
495 | 0x46, 0x46, 0x46, 0x29, 0x20, 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, | |
496 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, | |
497 | 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, | |
498 | 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, | |
499 | 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, | |
500 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, | |
501 | 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, | |
502 | 0x0a, 0x20, 0x20, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, | |
503 | 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, | |
504 | 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, | |
505 | 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x62, 0x20, 0x3c, 0x3d, 0x20, | |
506 | 0x30, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x38, 0x30, 0x30, 0x30, | |
507 | 0x30, 0x30, 0x30, 0x30, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, | |
508 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, | |
509 | 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, | |
510 | 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
511 | 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, | |
512 | 0x62, 0x29, 0x20, 0x7c, 0x20, 0x7e, 0x28, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, | |
513 | 0x46, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, | |
514 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, | |
515 | 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, | |
516 | 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x2c, 0x62, 0x29, | |
517 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x3d, 0x20, 0x62, 0x20, 0x26, 0x20, 0x33, 0x31, 0x0a, | |
518 | 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, | |
519 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x28, | |
520 | 0x61, 0x20, 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, | |
521 | 0x28, 0x33, 0x32, 0x20, 0x2d, 0x20, 0x62, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, | |
522 | 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, | |
523 | 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x72, 0x6f, | |
524 | 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, | |
525 | 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x3d, 0x20, 0x2d, | |
490 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
491 | 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, | |
492 | 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x26, 0x20, 0x79, 0x20, 0x26, 0x20, 0x7a, | |
493 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, | |
494 | 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, | |
495 | 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, | |
496 | 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, | |
497 | 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, | |
498 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x72, 0x65, | |
499 | 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, | |
500 | 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, | |
501 | 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, | |
502 | 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, | |
503 | 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, | |
504 | 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x3c, 0x3c, 0x20, 0x62, | |
505 | 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, | |
506 | 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, | |
507 | 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, | |
508 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, | |
509 | 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x3e, 0x3e, | |
510 | 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, | |
511 | 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, | |
512 | 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, | |
513 | 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, | |
514 | 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, | |
515 | 0x66, 0x20, 0x62, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x61, 0x20, 0x26, | |
516 | 0x20, 0x30, 0x78, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x20, 0x3d, 0x3d, 0x20, | |
517 | 0x30, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, | |
518 | 0x75, 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, | |
519 | 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, | |
520 | 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, | |
521 | 0x28, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x7c, 0x20, 0x7e, 0x28, 0x30, 0x78, | |
522 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x29, 0x20, | |
523 | 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, | |
524 | 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x72, | |
525 | 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, | |
526 | 0x20, 0x28, 0x61, 0x20, 0x2c, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x3d, 0x20, | |
526 | 527 | 0x62, 0x20, 0x26, 0x20, 0x33, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, |
527 | 528 | 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, |
528 | 529 | 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x20, 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x7c, |
529 | 530 | 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x28, 0x33, 0x32, 0x20, 0x2d, 0x20, 0x62, 0x29, 0x29, |
530 | 531 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20, 0x26, 0x20, |
531 | 532 | 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, |
532 | 0x2c, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, | |
533 | 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, 0x29, | |
534 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x3e, | |
535 | 0x3e, 0x20, 0x66, 0x29, 0x20, 0x26, 0x20, 0x7e, 0x28, 0x2d, 0x31, 0x20, 0x3c, 0x3c, 0x20, 0x28, | |
536 | 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, | |
537 | 0x20, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, | |
538 | 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x76, 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, | |
539 | 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x73, 0x6b, | |
540 | 0x20, 0x3d, 0x20, 0x7e, 0x28, 0x2d, 0x31, 0x20, 0x3c, 0x3c, 0x20, 0x28, 0x77, 0x20, 0x6f, 0x72, | |
541 | 0x20, 0x31, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, | |
542 | 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, 0x7e, 0x28, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3c, 0x3c, 0x20, | |
543 | 0x66, 0x29, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x28, 0x76, 0x20, 0x26, 0x20, 0x6d, 0x61, 0x73, 0x6b, | |
544 | 0x29, 0x20, 0x3c, 0x3c, 0x20, 0x66, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, | |
545 | 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x7d, 0x0a, 0x20, | |
546 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x5d, 0x20, 0x29, 0x0a, 0x0a, 0x65, 0x6c, 0x73, | |
547 | 0x65, 0x69, 0x66, 0x20, 0x62, 0x69, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, | |
548 | 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x6a, 0x69, 0x74, 0x20, 0x28, 0x66, 0x6f, 0x72, | |
549 | 0x20, 0x6e, 0x6f, 0x77, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, | |
550 | 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x28, 0x20, 0x5b, 0x5b, 0x0a, 0x6c, 0x6f, 0x63, | |
551 | 0x61, 0x6c, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x20, 0x72, | |
552 | 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, | |
553 | 0x62, 0x69, 0x74, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x6e, | |
554 | 0x6f, 0x74, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x20, | |
555 | 0x62, 0x69, 0x74, 0x2e, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x33, | |
556 | 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, | |
557 | 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, | |
558 | 0x20, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x2c, | |
559 | 0x0a, 0x20, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x6e, 0x6f, | |
560 | 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, | |
561 | 0x69, 0x74, 0x2e, 0x62, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x78, 0x6f, 0x72, 0x20, 0x20, | |
562 | 0x20, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x78, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, | |
563 | 0x62, 0x74, 0x65, 0x73, 0x74, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, | |
564 | 0x6f, 0x6e, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, | |
565 | 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x7e, 0x3d, 0x20, | |
566 | 0x30, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, | |
567 | 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, | |
568 | 0x66, 0x2c, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, | |
569 | 0x62, 0x61, 0x6e, 0x64, 0x28, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x61, 0x2c, 0x66, 0x29, | |
570 | 0x2c, 0x32, 0x5e, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x2d, 0x31, 0x29, 0x0a, 0x20, | |
571 | 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, | |
572 | 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, 0x6f, 0x6c, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x73, 0x68, | |
573 | 0x69, 0x66, 0x74, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, | |
574 | 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, | |
575 | 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x76, 0x2c, 0x66, 0x2c, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, | |
576 | 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x32, 0x5e, | |
577 | 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x2d, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, | |
578 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x61, 0x2c, 0x62, 0x6e, 0x6f, | |
579 | 0x74, 0x28, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x66, 0x29, | |
580 | 0x29, 0x29, 0x2b, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x76, | |
581 | 0x2c, 0x6d, 0x61, 0x73, 0x6b, 0x29, 0x2c, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, | |
582 | 0x0a, 0x20, 0x20, 0x72, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, | |
583 | 0x2e, 0x72, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x20, | |
584 | 0x3d, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
585 | 0x20, 0x20, 0x20, 0x20, 0x5d, 0x5d, 0x20, 0x29, 0x0a, 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x0a, | |
586 | 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, | |
587 | 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x61, 0x69, 0x6c, | |
588 | 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x72, 0x65, | |
589 | 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x62, 0x69, 0x74, 0x33, 0x32, 0x22, 0x29, 0x0a, 0x0a, | |
590 | 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, | |
591 | 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x74, 0x74, 0x69, | |
592 | 0x6e, 0x67, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x73, 0x6f, 0x63, 0x6b, | |
593 | 0x65, 0x74, 0x22, 0x29, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x0a, 0x64, 0x6f, 0x0a, 0x0a, | |
594 | 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, | |
595 | 0x20, 0x3d, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, | |
596 | 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, | |
597 | 0x61, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, | |
598 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x3d, | |
599 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5b, 0x22, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, | |
600 | 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5d, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, | |
601 | 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6d, 0x69, 0x6d, | |
602 | 0x65, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, | |
603 | 0x6d, 0x69, 0x6d, 0x65, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5b, | |
604 | 0x22, 0x6d, 0x69, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5d, 0x20, 0x20, 0x20, 0x65, | |
605 | 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, | |
606 | 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6c, 0x66, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, | |
607 | 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6c, 0x66, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x20, | |
608 | 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, | |
609 | 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, | |
610 | 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, | |
611 | 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, | |
612 | 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, | |
613 | 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x79, 0x6d, | |
614 | 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x0a, | |
615 | 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x61, 0x6e, | |
616 | 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x20, 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x73, 0x69, | |
617 | 0x6e, 0x67, 0x20, 0x6c, 0x66, 0x73, 0x20, 0x28, 0x77, 0x61, 0x73, 0x20, 0x64, 0x65, 0x61, 0x64, | |
618 | 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x20, | |
619 | 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, | |
620 | 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
621 | 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, | |
622 | 0x73, 0x66, 0x69, 0x6c, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
623 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, | |
624 | 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, | |
625 | 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, | |
626 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, | |
627 | 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x6d, | |
628 | 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
629 | 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, | |
630 | 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, | |
631 | 0x73, 0x64, 0x69, 0x72, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
632 | 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, | |
633 | 0x73, 0x64, 0x69, 0x72, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, | |
634 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, | |
635 | 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, | |
636 | 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
637 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, | |
638 | 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x0a, | |
639 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
640 | 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x68, 0x6f, 0x72, | |
641 | 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, | |
642 | 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x72, 0x6f, 0x70, | |
643 | 0x70, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x0a, 0x0a, 0x20, | |
644 | 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, | |
645 | 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, | |
646 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, | |
647 | 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, | |
648 | 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, | |
649 | 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
650 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, | |
651 | 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, | |
652 | 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, | |
653 | 0x64, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, | |
654 | 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, | |
655 | 0x6e, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
656 | 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, | |
657 | 0x64, 0x6c, 0x69, 0x6e, 0x6b, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
658 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, | |
659 | 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, | |
660 | 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x29, 0x20, | |
661 | 0x6f, 0x72, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, | |
662 | 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, | |
663 | 0x0a, 0x00 | |
533 | 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, | |
534 | 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, | |
535 | 0x20, 0x20, 0x62, 0x20, 0x3d, 0x20, 0x2d, 0x62, 0x20, 0x26, 0x20, 0x33, 0x31, 0x0a, 0x20, 0x20, | |
536 | 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, | |
537 | 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x20, | |
538 | 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x28, 0x33, | |
539 | 0x32, 0x20, 0x2d, 0x20, 0x62, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, | |
540 | 0x72, 0x6e, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, | |
541 | 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, | |
542 | 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, | |
543 | 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, | |
544 | 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x66, 0x29, 0x20, 0x26, 0x20, 0x7e, 0x28, | |
545 | 0x2d, 0x31, 0x20, 0x3c, 0x3c, 0x20, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x29, 0x0a, | |
546 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, | |
547 | 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, | |
548 | 0x76, 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, | |
549 | 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x7e, 0x28, 0x2d, 0x31, 0x20, 0x3c, | |
550 | 0x3c, 0x20, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
551 | 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, 0x7e, 0x28, 0x6d, | |
552 | 0x61, 0x73, 0x6b, 0x20, 0x3c, 0x3c, 0x20, 0x66, 0x29, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x28, 0x76, | |
553 | 0x20, 0x26, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x29, 0x20, 0x3c, 0x3c, 0x20, 0x66, 0x29, 0x29, 0x20, | |
554 | 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, | |
555 | 0x6e, 0x64, 0x2c, 0x0a, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x5d, | |
556 | 0x20, 0x29, 0x0a, 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x62, 0x69, 0x74, 0x20, 0x74, | |
557 | 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x6a, | |
558 | 0x69, 0x74, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x77, 0x29, 0x0a, 0x0a, 0x20, 0x20, | |
559 | 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x28, | |
560 | 0x20, 0x5b, 0x5b, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x20, | |
561 | 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x20, 0x6c, 0x73, | |
562 | 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2c, | |
563 | 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, | |
564 | 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x6c, 0x73, 0x68, 0x69, 0x66, | |
565 | 0x74, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, | |
566 | 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x61, 0x72, 0x73, | |
567 | 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x20, 0x20, | |
568 | 0x3d, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x20, 0x20, | |
569 | 0x20, 0x20, 0x3d, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x20, | |
570 | 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x6f, 0x72, 0x2c, 0x0a, 0x20, | |
571 | 0x20, 0x62, 0x78, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, | |
572 | 0x78, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x74, 0x65, 0x73, 0x74, 0x20, 0x20, 0x20, 0x3d, | |
573 | 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, | |
574 | 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x2e, | |
575 | 0x2e, 0x2e, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, | |
576 | 0x20, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, | |
577 | 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x66, 0x2c, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
578 | 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x72, 0x73, 0x68, 0x69, | |
579 | 0x66, 0x74, 0x28, 0x61, 0x2c, 0x66, 0x29, 0x2c, 0x32, 0x5e, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, | |
580 | 0x31, 0x29, 0x2d, 0x31, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, | |
581 | 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, 0x6f, 0x6c, | |
582 | 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x73, | |
583 | 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, | |
584 | 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x76, 0x2c, 0x66, | |
585 | 0x2c, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, | |
586 | 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x32, 0x5e, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x2d, | |
587 | 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, | |
588 | 0x64, 0x28, 0x61, 0x2c, 0x62, 0x6e, 0x6f, 0x74, 0x28, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, | |
589 | 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x66, 0x29, 0x29, 0x29, 0x2b, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, | |
590 | 0x28, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x76, 0x2c, 0x6d, 0x61, 0x73, 0x6b, 0x29, 0x2c, 0x66, 0x29, | |
591 | 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x72, 0x6f, 0x74, 0x61, 0x74, | |
592 | 0x65, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x72, | |
593 | 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x20, 0x3d, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, | |
594 | 0x0a, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x5d, 0x20, 0x29, 0x0a, | |
595 | 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x68, 0x6f, | |
596 | 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x73, 0x74, 0x20, | |
597 | 0x6f, 0x72, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, | |
598 | 0x33, 0x32, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x62, 0x69, | |
599 | 0x74, 0x33, 0x32, 0x22, 0x29, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x74, | |
600 | 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, | |
601 | 0x72, 0x20, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, | |
602 | 0x65, 0x28, 0x22, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x29, 0x20, 0x72, 0x69, 0x67, 0x68, | |
603 | 0x74, 0x0a, 0x0a, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, | |
604 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, | |
605 | 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, | |
606 | 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x6f, 0x63, 0x6b, | |
607 | 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x73, | |
608 | 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5b, 0x22, | |
609 | 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5d, 0x20, 0x65, 0x6e, | |
610 | 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, | |
611 | 0x64, 0x65, 0x64, 0x2e, 0x6d, 0x69, 0x6d, 0x65, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, | |
612 | 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6d, 0x69, 0x6d, 0x65, 0x20, 0x20, 0x20, 0x3d, 0x20, | |
613 | 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5b, 0x22, 0x6d, 0x69, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x72, | |
614 | 0x65, 0x22, 0x5d, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, | |
615 | 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6c, 0x66, 0x73, | |
616 | 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6c, 0x66, 0x73, | |
617 | 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, | |
618 | 0x0a, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, | |
619 | 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, | |
620 | 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, | |
621 | 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x6c, | |
622 | 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x3d, 0x20, | |
623 | 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, | |
624 | 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, | |
625 | 0x65, 0x73, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x20, 0x64, | |
626 | 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x66, 0x73, 0x20, 0x28, 0x77, | |
627 | 0x61, 0x73, 0x20, 0x64, 0x65, 0x61, 0x64, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x66, | |
628 | 0x6f, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, | |
629 | 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, | |
630 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, | |
631 | 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, 0x69, 0x6c, 0x65, 0x28, 0x6e, 0x61, 0x6d, | |
632 | 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, | |
633 | 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, | |
634 | 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, | |
635 | 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
636 | 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x66, 0x69, 0x6c, | |
637 | 0x65, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x6c, 0x69, 0x6e, 0x6b, | |
638 | 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, | |
639 | 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, | |
640 | 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, 0x69, 0x72, 0x20, 0x74, 0x68, 0x65, 0x6e, | |
641 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, | |
642 | 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, 0x69, 0x72, 0x28, 0x6e, 0x61, 0x6d, 0x65, | |
643 | 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, | |
644 | 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, | |
645 | 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, 0x65, | |
646 | 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, | |
647 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x64, 0x69, 0x72, 0x65, | |
648 | 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, | |
649 | 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, | |
650 | 0x2d, 0x2d, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x68, 0x61, | |
651 | 0x76, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x72, 0x74, 0x20, | |
652 | 0x6f, 0x66, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, | |
653 | 0x6b, 0x70, 0x73, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, | |
654 | 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, | |
655 | 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, | |
656 | 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, | |
657 | 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
658 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, | |
659 | 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, | |
660 | 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6e, 0x6f, 0x77, | |
661 | 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x61, 0x72, 0x67, | |
662 | 0x65, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, | |
663 | 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, | |
664 | 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, | |
665 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, | |
666 | 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x6b, 0x28, 0x6e, 0x61, 0x6d, | |
667 | 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, | |
668 | 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, | |
669 | 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x74, 0x61, | |
670 | 0x72, 0x67, 0x65, 0x74, 0x22, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, | |
671 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, | |
672 | 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x00 | |
664 | 673 | }; |
665 | 674 | return luaL_dostring(L, (const char*) luatex_core_lua); |
666 | 675 | }⏎ |
6 | 6 | -- copyright = 'LuaTeX Development Team', |
7 | 7 | -- } |
8 | 8 | |
9 | LUATEXCOREVERSION = 1.112 -- we reflect the luatex version where changes happened | |
9 | LUATEXCOREVERSION = 1.120 -- we reflect the luatex version where changes happened | |
10 | 10 | |
11 | 11 | -- This file overloads some Lua functions. The readline variants provide the same |
12 | 12 | -- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the |
193 | 193 | |
194 | 194 | if saferoption == 1 or shellescape ~= 1 then |
195 | 195 | |
196 | package.loadlib = function() end | |
197 | package.searchers[4] = nil | |
198 | package.searchers[3] = nil | |
199 | ||
196 | 200 | ffi = require('ffi') |
197 | for k, v in next, ffi do | |
198 | if k ~= 'gc' then | |
199 | ffi[k] = nil | |
200 | end | |
201 | end | |
201 | ||
202 | if ffi then | |
203 | for k, v in next, ffi do | |
204 | if k ~= 'gc' then | |
205 | ffi[k] = nil | |
206 | end | |
207 | end | |
208 | end | |
209 | ||
202 | 210 | ffi = nil |
203 | 211 | |
204 | 212 | end |
2 | 2 | describe("harfbuzz.Buffer", function() |
3 | 3 | it("can be created", function() |
4 | 4 | harfbuzz.Buffer.new() |
5 | end) | |
6 | ||
7 | it("can add a single codepoints with explicit cluster value", function() | |
8 | local b = harfbuzz.Buffer.new() | |
9 | b:add(0x06CC, 42) | |
10 | local glyphs = b:get_glyphs() | |
11 | assert.are_equal(#glyphs, 1) | |
12 | assert.are_equal(glyphs[1].cluster, 42) | |
13 | assert.are_equal(glyphs[1].codepoint, 0x06CC) | |
5 | 14 | end) |
6 | 15 | |
7 | 16 | it("can add a UTF8 string", function() |
134 | 134 | hb_codepoint_t cp = (hb_codepoint_t) luaL_checkinteger(L, 2); |
135 | 135 | |
136 | 136 | hb_buffer_set_replacement_codepoint(*b, cp); |
137 | return 0; | |
138 | } | |
139 | ||
140 | static int buffer_add(lua_State *L) { | |
141 | Buffer *b = (Buffer *)luaL_checkudata(L, 1, "harfbuzz.Buffer"); | |
142 | ||
143 | hb_codepoint_t c = (hb_codepoint_t) luaL_checkinteger(L, 2); | |
144 | unsigned int cluster = luaL_checkinteger(L, 3); | |
145 | ||
146 | hb_buffer_add(*b, c, cluster); | |
147 | ||
137 | 148 | return 0; |
138 | 149 | } |
139 | 150 | |
289 | 300 | |
290 | 301 | static const struct luaL_Reg buffer_methods[] = { |
291 | 302 | { "__gc", buffer_destroy }, |
303 | { "add", buffer_add }, | |
292 | 304 | { "add_utf8", buffer_add_utf8 }, |
293 | 305 | { "add_codepoints", buffer_add_codepoints }, |
294 | 306 | { "clear_contents", buffer_clear_contents }, |
21 | 21 | |
22 | 22 | #define ppbytes_take(heap, size) _heap16_take(&(heap)->bytesheap, size) |
23 | 23 | #define ppbytes_buffer_init(heap) heap16_buffer_init(&(heap)->bytesheap, &(heap)->bytesbuffer) |
24 | #define ppbytes_buffer(heap, atleast) heap16_buffer_some(&(heap)->bytesheap, &(heap)->bytesbuffer, atleast) | |
24 | #define ppbytes_buffer(heap, atleast) _heap16_buffer_some(&(heap)->bytesheap, &(heap)->bytesbuffer, atleast) | |
25 | 25 | |
26 | 26 | #define ppstruct_heap heap64 |
27 | 27 | #define ppstruct_heap_init(heap, space, large, flags) (heap64_init(&(heap)->structheap, space, large, flags), heap64_head(&(heap)->structheap)) |
36 | 36 | |
37 | 37 | #define basexx_nl '\x0A' |
38 | 38 | //#define put_nl(O, line, maxline, n) ((void)((line += n) > maxline && ((line = n), iof_set(O, basexx_nl)))) // assignment in conditional warning |
39 | #define put_nl(O, line, maxline, n) do { line += n; if (line > maxline) line = n; iof_set(O, basexx_nl); } while (0) | |
39 | #define put_nl(O, line, maxline, n) do { line += n; if (line > maxline) { line = n; iof_set(O, basexx_nl); }} while (0) | |
40 | 40 | |
41 | 41 | /* tail macros */ |
42 | 42 |
945 | 945 | } |
946 | 946 | |
947 | 947 | static uint8_t iof_stdout_buffer[BUFSIZ]; |
948 | iof iof_stdout = IOF_WRITER_STRUCT(stdout_writer, NULL, iof_stdout_buffer, BUFSIZ, 0); | |
948 | iof iof_stdout = IOF_WRITER_INIT(stdout_writer, NULL, iof_stdout_buffer, BUFSIZ, 0); | |
949 | 949 | |
950 | 950 | static uint8_t iof_stderr_buffer[BUFSIZ]; |
951 | iof iof_stderr = IOF_WRITER_STRUCT(stderr_writer, NULL, iof_stderr_buffer, BUFSIZ, 0); | |
951 | iof iof_stderr = IOF_WRITER_INIT(stderr_writer, NULL, iof_stderr_buffer, BUFSIZ, 0); | |
952 | 952 | |
953 | 953 | /* read from somewhere */ |
954 | 954 |
63 | 63 | }; \ |
64 | 64 | size_t space; \ |
65 | 65 | iof_handler more; \ |
66 | union { iof *next; FILE *file; iof_file *iofile; void *link; }; \ | |
66 | union { void *link; iof *next; FILE *file; iof_file *iofile; }; \ | |
67 | 67 | int flags; \ |
68 | 68 | int refcount |
69 | 69 | |
134 | 134 | |
135 | 135 | /* initializers */ |
136 | 136 | |
137 | #define IOF_READER_STRUCT(handler, file, buffer, size, flags) \ | |
138 | { {{ (uint8_t *)(buffer), (uint8_t *)(buffer), (uint8_t *)(buffer) }}, size, handler, { file }, flags|IOF_READER, 0 } | |
139 | ||
140 | #define IOF_WRITER_STRUCT(handler, file, buffer, size, flags) \ | |
141 | { {{ (uint8_t *)(buffer), (uint8_t *)(buffer), (uint8_t *)(buffer) + size }}, size, handler, { file }, flags|IOF_WRITER, 0 } | |
142 | ||
143 | #define IOF_STRING_STRUCT(buffer, size) \ | |
137 | #define IOF_READER_INIT(handler, file, buffer, size, flags) \ | |
138 | { {{ (uint8_t *)(buffer), (uint8_t *)(buffer), (uint8_t *)(buffer) }}, size, handler, { file }, (flags)|IOF_READER, 0 } | |
139 | ||
140 | #define IOF_WRITER_INIT(handler, file, buffer, size, flags) \ | |
141 | { {{ (uint8_t *)(buffer), (uint8_t *)(buffer), (uint8_t *)(buffer) + size }}, size, handler, { file }, (flags)|IOF_WRITER, 0 } | |
142 | ||
143 | #define IOF_STRING_INIT(buffer, size) \ | |
144 | 144 | { {{ (uint8_t *)(buffer), (uint8_t *)(buffer), (uint8_t *)(buffer) + size }}, size, NULL, { NULL }, 0|IOF_READER|IOF_DATA, 0 } |
145 | 145 | |
146 | #define IOF_STRING() IOF_STRING_STRUCT(0, 0) | |
146 | #define IOF_STRING() IOF_STRING_INIT(0, 0) | |
147 | 147 | |
148 | 148 | /* refcount */ |
149 | 149 |
113 | 113 | iof interface |
114 | 114 | ============= |
115 | 115 | |
116 | iof is an independent interface for buffers written/read byte-by-byte. If used together with allocators, the provides a convenient | |
117 | way to write byte data to the heap or stock, without a need for intermediate buffers. The idea is to have iof buffer always ready | |
118 | for writing into the heap or stock. The buffer is setup just once, with | |
119 | ||
120 | iof *output = buffer_init(heap, iof) // calls some(heap, 0) | |
121 | ||
122 | Then one can write to iof with | |
123 | ||
124 | iof_put(output, char); | |
125 | iof_write(output, string); | |
126 | iof_ensure(output, bytes); | |
127 | .... | |
128 | ||
129 | iof keeps pointers to the beginning of buffer, end of buffer, and current position. Once the position reaches the end, the iof | |
130 | internal handler updates the buffer providing more space to write. In that case, updating the buffer means settings buf/pos/end | |
131 | pointers according to a data pointer and space returned by more(). From the user perspective, this pretends a countinuous space | |
132 | for writing, without bothering about buffer boundaries. | |
116 | iof is an independent interface for buffers written/read byte-by-byte. When used together with allocators, it provides | |
117 | a convenient way to write byte data to the heap or stock, without a need for intermediate buffers. The buffer is setup with | |
118 | ||
119 | iof output, *O | |
120 | O = buffer_init(heap, &output); // doesn't allocate anything | |
121 | ||
122 | or | |
123 | ||
124 | output = BUFFER_INIT(heap); // doesn't allocate anything | |
125 | O = &output; | |
126 | ||
127 | iof keeps pointers to the beginning of the buffer, end of buffer, and current position. Once the position reaches the end, | |
128 | the iof internal handler updates the buffer providing more space to write. When used in conjunction with heap or stock, | |
129 | the space to write is the space provided by the heap or stock. To start the buffer session: | |
130 | ||
131 | O = buffer_some(heap, O, atleast) // ensure iof *O to have atleast bytes to be written | |
133 | 132 | |
134 | 133 | Once you are done with writing some chunk |
135 | 134 | |
136 | iof_flush() // calls done() and some() again | |
135 | buffer_done(heap, O) | |
136 | ||
137 | instead of buffer_done(), one may also use | |
138 | ||
139 | iof_flush(O) // calls buffer_done() and buffer_some() again | |
137 | 140 | |
138 | updates the underlying heap or stock, and makes the iof ready for a new chunk. iof it self does not allocate a memory, so it | |
139 | doesn't need finalizer, iof_close(output) does nothing. So the cycle looks as follows: | |
140 | ||
141 | buffer_init(heap, iof) | |
142 | <write to iof> ... iof_flush(iof) | |
143 | <write to iof> ... iof_flush(iof) | |
144 | ... | |
141 | which updates the underlying heap or stock, and makes the iof ready for a new chunk. iof itself does not allocate a memory, | |
142 | so it doesn't need finalizer. iof_close(output) does nothing. To drop the buffer use: | |
143 | ||
144 | buffer_giveup(heap, O) // restore the from before buffer_some() | |
145 | 145 | |
146 | 146 | More often then not, we need to specify a minimal space for buffer each time, eg. for memcpy() or so. The actual space left |
147 | can be checked with iof_left(iof), the space for recent chunk is iof->space. | |
148 | ||
149 | We can also work as follows: | |
150 | ||
151 | buffer_init(heap, iof) | |
152 | buffer_some(heap, iof) ... <write to iof> ... data = iof_writer_result(iof, &size) | |
153 | buffer_some(heap, iof) ... <write to iof> ... data = iof_writer_result(iof, &size) | |
154 | ... | |
147 | can be checked with iof_left(O). The entire space of recent chunk is O->space (eq. O->end - O->buf). | |
155 | 148 | |
156 | 149 | Identical interface for heap and stock. |
157 | 150 | |
327 | 320 | to 4 bytes, heap64_take() returns a pointer aligned to 8 bytes. You can ask for any data length, but in practise you'll always |
328 | 321 | obtain 1N, 2N, 4N or 8N. Alignment implies data padding unless the user requests for "aligned" sizes. In statistics the padding |
329 | 322 | is not considered a waste. |
323 | ||
324 | Zeroing | |
325 | ======= | |
326 | ||
327 | All heap, stock and pool may return zeroed memory chunks, depending on initial flags: | |
328 | ||
329 | HEAP_ZERO | |
330 | STOCK_ZERO | |
331 | POOL_ZERO | |
332 | ||
333 | There are also take0() variants that simply return memset(take(), 0, size), regardless the flag. | |
330 | 334 | */ |
331 | 335 | |
332 | 336 | #ifndef UTIL_MEM_ALLC_C |
345 | 349 | #include <stdio.h> // printf() |
346 | 350 | |
347 | 351 | #include "utilmem.h" |
348 | //#include "utilmemallh.h" | |
349 | ||
350 | #if 0 // for a while | |
352 | ||
353 | //#if defined(DEBUG) && debug != 0 | |
354 | #if 1 | |
355 | # define ASSERT8(cond) ((void)((cond) || (printf("8bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
356 | # define ASSERT16(cond) ((void)((cond) || (printf("16bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
357 | # define ASSERT32(cond) ((void)((cond) || (printf("32bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
358 | # define ASSERT64(cond) ((void)((cond) || (printf("64bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
359 | #else | |
351 | 360 | # define ASSERT8(cond) (void)0 |
352 | 361 | # define ASSERT16(cond) (void)0 |
353 | 362 | # define ASSERT32(cond) (void)0 |
354 | 363 | # define ASSERT64(cond) (void)0 |
355 | #else | |
356 | # define ASSERT8(cond) ((void)((cond) || (printf("8bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
357 | # define ASSERT16(cond) ((void)((cond) || (printf("16bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
358 | # define ASSERT32(cond) ((void)((cond) || (printf("32bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
359 | # define ASSERT64(cond) ((void)((cond) || (printf("64bit allocator assertion, %s:%d: %s\n", __FILE__, __LINE__, #cond), 0))) | |
360 | 364 | #endif |
361 | 365 | |
362 | 366 | #if defined(UTIL_MEM_STOCK_H) || defined(UTIL_MEM_POOL_H) |
473 | 477 | /* align requested size to keep ream->data / pyre->data always aligned. size is always size_t, no insane overflow checks */ |
474 | 478 | |
475 | 479 | #define align_size8(size) ((void)size) |
476 | #define align_size16(size) ((void)((size & 1) ? (size += 1) : 0)) | |
477 | #define align_size32(size) ((void)((size & 3) ? (size += 4 - (size & 3)) : 0)) | |
478 | #define align_size64(size) ((void)((size & 7) ? (size += 8 - (size & 7)) : 0)) | |
480 | #define align_size16(size) (size = aligned_size16(size)) | |
481 | #define align_size32(size) (size = aligned_size32(size)) | |
482 | #define align_size64(size) (size = aligned_size64(size)) | |
479 | 483 | |
480 | 484 | /* |
481 | 485 | done() and pop() operations decrements block->left space by an aligned size; block->left -= alignedwritten. Lets have 8-bytes aligned |
485 | 489 | */ |
486 | 490 | |
487 | 491 | #define align_space8(space) ((void)space) |
488 | #define align_space16(space) ((void)((space & 1) ? (space < 0xFFFF ? (space += 1) : (space -= 1)) : 0)) | |
489 | #define align_space32(space) ((void)((space & 3) ? (space < 0xFFFFFFFD ? (space += 4 - (space & 3)) : (space -= (space & 3))) : 0)) | |
490 | #define align_space64(space) ((void)((space & 7) ? (space < 0xFFFFFFFFFFFFFFF8ULL ? (space += 8 - (space & 7)) : (space -= (space & 7))) : 0)) | |
492 | #define align_space16(space) (space = aligned_space16(space)) | |
493 | #define align_space32(space) (space = aligned_space32(space)) | |
494 | #define align_space64(space) (space = aligned_space64(space)) | |
491 | 495 | |
492 | 496 | /* handling ghost structure (stock and pool) */ |
493 | 497 |
11 | 11 | typedef struct ghost32 ghost32; |
12 | 12 | typedef struct ghost64 ghost64; |
13 | 13 | |
14 | #define aligned_size8(size) (size) | |
15 | #define aligned_size16(size) ((((size) + 1) >> 1) << 1) | |
16 | #define aligned_size32(size) ((((size) + 3) >> 2) << 2) | |
17 | #define aligned_size64(size) ((((size) + 7) >> 3) << 3) | |
18 | ||
19 | #define aligned_space8(size) (size) | |
20 | #define aligned_space16(size) (((size) & 1) ? ((size) < 0xFFFF ? ((size) + 1) : ((size) - 1)) : (size)) | |
21 | #define aligned_space32(size) (((size) & 3) ? ((size) < 0xFFFFFFFD ? ((size) - ((size) & 3) + 4) : (size) - ((size) & 3)) : (size)) | |
22 | #define aligned_space64(size) (((size) & 7) ? ((size) < 0xFFFFFFFFFFFFFFF8ULL ? ((size) - ((size) & 7) + 8) : (size) - ((size) & 7)) : (size)) | |
23 | ||
14 | 24 | /* info stub */ |
15 | 25 | |
16 | 26 | typedef struct { |
436 | 436 | return data; |
437 | 437 | } |
438 | 438 | |
439 | void * _heap8_take0 (heap8 *heap, size_t size) | |
440 | { | |
441 | return memset(_heap8_take(heap, size), 0, size); | |
442 | } | |
443 | ||
444 | void * _heap16_take0 (heap16 *heap, size_t size) | |
445 | { | |
446 | return memset(_heap16_take(heap, size), 0, size); | |
447 | } | |
448 | ||
449 | void * _heap32_take0 (heap32 *heap, size_t size) | |
450 | { | |
451 | return memset(_heap32_take(heap, size), 0, size); | |
452 | } | |
453 | ||
454 | void * _heap64_take0 (heap64 *heap, size_t size) | |
455 | { | |
456 | return memset(_heap64_take(heap, size), 0, size); | |
457 | } | |
458 | ||
439 | 459 | /* pop last heap chunk */ |
440 | 460 | |
441 | 461 | #define taken_from_head(taken, head) (byte_data(taken) == head->data) |
461 | 481 | head->prev = pyre->prev; |
462 | 482 | pyre_free(pyre); |
463 | 483 | } |
484 | else | |
485 | { | |
486 | ASSERT8(0); | |
487 | } | |
464 | 488 | } |
465 | 489 | |
466 | 490 | void heap16_pop (heap16 *heap, void *taken, size_t size) |
480 | 504 | head->prev = pyre->prev; |
481 | 505 | pyre_free(pyre); |
482 | 506 | } |
507 | else | |
508 | { | |
509 | ASSERT16(0); | |
510 | } | |
483 | 511 | } |
484 | 512 | |
485 | 513 | void heap32_pop (heap32 *heap, void *taken, size_t size) |
499 | 527 | head->prev = pyre->prev; |
500 | 528 | pyre_free(pyre); |
501 | 529 | } |
530 | else | |
531 | { | |
532 | ASSERT32(0); | |
533 | } | |
502 | 534 | } |
503 | 535 | |
504 | 536 | void heap64_pop (heap64 *heap, void *taken, size_t size) |
518 | 550 | head->prev = pyre->prev; |
519 | 551 | pyre_free(pyre); |
520 | 552 | } |
553 | else | |
554 | { | |
555 | ASSERT64(0); | |
556 | } | |
521 | 557 | } |
522 | 558 | |
523 | 559 | /* heap buffer */ |
610 | 646 | return void_data(pyre->data); |
611 | 647 | } |
612 | 648 | |
613 | void * heap8_more (heap8 *heap, void *taken, size_t written, size_t size) | |
649 | void * heap8_more (heap8 *heap, void *taken, size_t written, size_t size, size_t *pspace) | |
614 | 650 | { |
615 | 651 | pyre8 *pyre, *prev; |
616 | 652 | pyre = heap->head; |
618 | 654 | if (taken_from_head(taken, pyre)) |
619 | 655 | { |
620 | 656 | if (size <= pyre->left) |
621 | { // unlikely | |
657 | { | |
658 | *pspace = pyre->left; | |
622 | 659 | } |
623 | 660 | else if (take_new_block8(heap, pyre8, pyre, size)) |
624 | 661 | { |
625 | 662 | pyre = heap8_new(heap); |
626 | 663 | memcpy(pyre->data, taken, written); |
664 | *pspace = pyre->left; | |
627 | 665 | } |
628 | 666 | else |
629 | 667 | { |
630 | 668 | pyre = heap8_sole(heap, size); |
631 | 669 | memcpy(pyre->data, taken, written); |
670 | *pspace = size; | |
632 | 671 | } |
633 | 672 | } |
634 | 673 | else if (taken_from_sole(taken, pyre, prev)) |
635 | 674 | { |
636 | 675 | pyre = heap8_sole(heap, size); |
676 | memcpy(pyre->data, taken, written); | |
677 | *pspace = size; | |
637 | 678 | pyre->prev = prev->prev; |
638 | memcpy(pyre->data, taken, written); | |
639 | 679 | pyre_free(prev); |
640 | 680 | } |
641 | 681 | else |
682 | { | |
683 | ASSERT8(0); | |
684 | *pspace = 0; | |
642 | 685 | return NULL; |
686 | } | |
643 | 687 | return void_data(pyre->data); |
644 | 688 | } |
645 | 689 | |
646 | void * heap16_more (heap16 *heap, void *taken, size_t written, size_t size) | |
690 | void * heap16_more (heap16 *heap, void *taken, size_t written, size_t size, size_t *pspace) | |
647 | 691 | { |
648 | 692 | pyre16 *pyre, *prev; |
649 | 693 | pyre = heap->head; |
652 | 696 | { |
653 | 697 | if (size <= pyre->left) |
654 | 698 | { |
699 | *pspace = pyre->left; | |
655 | 700 | } |
656 | 701 | else if (take_new_block16(heap, pyre16, pyre, size)) |
657 | 702 | { |
658 | 703 | pyre = heap16_new(heap); |
659 | 704 | memcpy(pyre->data, taken, written); |
705 | *pspace = pyre->left; | |
660 | 706 | } |
661 | 707 | else |
662 | 708 | { |
663 | 709 | pyre = heap16_sole(heap, size); |
664 | 710 | memcpy(pyre->data, taken, written); |
711 | *pspace = size; | |
665 | 712 | } |
666 | 713 | } |
667 | 714 | else if (taken_from_sole(taken, pyre, prev)) |
668 | 715 | { |
669 | 716 | pyre = heap16_sole(heap, size); |
717 | memcpy(pyre->data, taken, written); | |
718 | *pspace = size; | |
670 | 719 | pyre->prev = prev->prev; |
671 | memcpy(pyre->data, taken, written); | |
672 | 720 | pyre_free(prev); |
673 | 721 | } |
674 | 722 | else |
723 | { | |
724 | ASSERT16(0); | |
725 | *pspace = 0; | |
675 | 726 | return NULL; |
727 | } | |
676 | 728 | return void_data(pyre->data); |
677 | 729 | } |
678 | 730 | |
679 | void * heap32_more (heap32 *heap, void *taken, size_t written, size_t size) | |
731 | void * heap32_more (heap32 *heap, void *taken, size_t written, size_t size, size_t *pspace) | |
680 | 732 | { |
681 | 733 | pyre32 *pyre, *prev; |
682 | 734 | pyre = heap->head; |
685 | 737 | { |
686 | 738 | if (size <= pyre->left) |
687 | 739 | { |
740 | *pspace = pyre->left; | |
688 | 741 | } |
689 | 742 | else if (take_new_block32(heap, pyre32, pyre, size)) |
690 | 743 | { |
691 | 744 | pyre = heap32_new(heap); |
692 | 745 | memcpy(pyre->data, taken, written); |
746 | *pspace = pyre->left; | |
693 | 747 | } |
694 | 748 | else |
695 | 749 | { |
696 | 750 | pyre = heap32_sole(heap, size); |
697 | 751 | memcpy(pyre->data, taken, written); |
752 | *pspace = size; | |
698 | 753 | } |
699 | 754 | } |
700 | 755 | else if (taken_from_sole(taken, pyre, prev)) |
701 | 756 | { |
702 | 757 | pyre = heap32_sole(heap, size); |
758 | memcpy(pyre->data, taken, written); | |
759 | *pspace = size; | |
703 | 760 | pyre->prev = prev->prev; |
704 | memcpy(pyre->data, taken, written); | |
705 | 761 | pyre_free(prev); |
706 | 762 | } |
707 | 763 | else |
764 | { | |
765 | ASSERT32(0); | |
766 | *pspace = 0; | |
708 | 767 | return NULL; |
768 | } | |
709 | 769 | return void_data(pyre->data); |
710 | 770 | } |
711 | 771 | |
712 | void * heap64_more (heap64 *heap, void *taken, size_t written, size_t size) | |
772 | void * heap64_more (heap64 *heap, void *taken, size_t written, size_t size, size_t *pspace) | |
713 | 773 | { |
714 | 774 | pyre64 *pyre, *prev; |
715 | 775 | pyre = heap->head; |
718 | 778 | { |
719 | 779 | if (size <= pyre->left) |
720 | 780 | { |
781 | *pspace = pyre->left; | |
721 | 782 | } |
722 | 783 | else if (take_new_block64(heap, pyre64, pyre, size)) |
723 | 784 | { |
724 | 785 | pyre = heap64_new(heap); |
725 | 786 | memcpy(pyre->data, taken, written); |
787 | *pspace = pyre->left; | |
726 | 788 | } |
727 | 789 | else |
728 | 790 | { |
729 | 791 | pyre = heap64_sole(heap, size); |
730 | 792 | memcpy(pyre->data, taken, written); |
793 | *pspace = size; | |
731 | 794 | } |
732 | 795 | } |
733 | 796 | else if (taken_from_sole(taken, pyre, prev)) |
734 | 797 | { |
735 | 798 | pyre = heap64_sole(heap, size); |
799 | memcpy(pyre->data, taken, written); | |
800 | *pspace = size; | |
736 | 801 | pyre->prev = prev->prev; |
737 | memcpy(pyre->data, taken, written); | |
738 | 802 | pyre_free(prev); |
739 | 803 | } |
740 | 804 | else |
805 | { | |
806 | ASSERT64(0); | |
807 | *pspace = 0; | |
741 | 808 | return NULL; |
809 | } | |
742 | 810 | return void_data(pyre->data); |
743 | 811 | } |
744 | 812 | |
758 | 826 | pyre->data += written; |
759 | 827 | pyre->chunks = 1; |
760 | 828 | } |
829 | else | |
830 | { | |
831 | ASSERT8(0); | |
832 | } | |
761 | 833 | } |
762 | 834 | |
763 | 835 | void heap16_done (heap16 *heap, void *taken, size_t written) |
776 | 848 | pyre->data += written; |
777 | 849 | pyre->chunks = 1; |
778 | 850 | } |
851 | else | |
852 | { | |
853 | ASSERT16(0); | |
854 | } | |
779 | 855 | } |
780 | 856 | |
781 | 857 | void heap32_done (heap32 *heap, void *taken, size_t written) |
794 | 870 | pyre->data += written; |
795 | 871 | pyre->chunks = 1; |
796 | 872 | } |
873 | else | |
874 | { | |
875 | ASSERT32(0); | |
876 | } | |
797 | 877 | } |
798 | 878 | |
799 | 879 | void heap64_done (heap64 *heap, void *taken, size_t written) |
811 | 891 | { |
812 | 892 | pyre->data += written; |
813 | 893 | pyre->chunks = 1; |
894 | } | |
895 | else | |
896 | { | |
897 | ASSERT64(0); | |
814 | 898 | } |
815 | 899 | } |
816 | 900 |
92 | 92 | }; |
93 | 93 | |
94 | 94 | #define HEAP_ZERO (1 << 0) |
95 | //#define HEAP_KEEP (1 << 1) | |
96 | 95 | #define HEAP_DEFAULTS 0 |
97 | 96 | |
98 | #define HEAP8_INIT(space, large, flags) { NULL, space, large, flags } | |
99 | #define HEAP16_INIT(space, large, flags) { NULL, space, large, flags } | |
100 | #define HEAP32_INIT(space, large, flags) { NULL, space, large, flags } | |
101 | #define HEAP64_INIT(space, large, flags) { NULL, space, large, flags } | |
97 | #define HEAP8_INIT(space, large, flags) { NULL, aligned_space8(space), large, flags } | |
98 | #define HEAP16_INIT(space, large, flags) { NULL, aligned_space16(space), large, flags } | |
99 | #define HEAP32_INIT(space, large, flags) { NULL, aligned_space32(space), large, flags } | |
100 | #define HEAP64_INIT(space, large, flags) { NULL, aligned_space64(space), large, flags } | |
102 | 101 | |
103 | 102 | UTILAPI heap8 * heap8_init (heap8 *heap, uint8_t space, uint8_t large, uint8_t flags); |
104 | 103 | UTILAPI heap16 * heap16_init (heap16 *heap, uint16_t space, uint16_t large, uint8_t flags); |
130 | 129 | UTILAPI void * _heap32_take (heap32 *heap, size_t size); |
131 | 130 | UTILAPI void * _heap64_take (heap64 *heap, size_t size); |
132 | 131 | |
132 | UTILAPI void * _heap8_take0 (heap8 *heap, size_t size); | |
133 | UTILAPI void * _heap16_take0 (heap16 *heap, size_t size); | |
134 | UTILAPI void * _heap32_take0 (heap32 *heap, size_t size); | |
135 | UTILAPI void * _heap64_take0 (heap64 *heap, size_t size); | |
136 | ||
133 | 137 | #define heap8_take(heap, size) (heap8_ensure_head(heap), _heap8_take(heap, size)) |
134 | 138 | #define heap16_take(heap, size) (heap16_ensure_head(heap), _heap16_take(heap, size)) |
135 | 139 | #define heap32_take(heap, size) (heap32_ensure_head(heap), _heap32_take(heap, size)) |
136 | 140 | #define heap64_take(heap, size) (heap64_ensure_head(heap), _heap64_take(heap, size)) |
141 | ||
142 | #define heap8_take0(heap, size) (heap8_ensure_head(heap), _heap8_take0(heap, size)) | |
143 | #define heap16_take0(heap, size) (heap16_ensure_head(heap), _heap16_take0(heap, size)) | |
144 | #define heap32_take0(heap, size) (heap32_ensure_head(heap), _heap32_take0(heap, size)) | |
145 | #define heap64_take0(heap, size) (heap64_ensure_head(heap), _heap64_take0(heap, size)) | |
137 | 146 | |
138 | 147 | UTILAPI void heap8_pop (heap8 *heap, void *taken, size_t size); |
139 | 148 | UTILAPI void heap16_pop (heap16 *heap, void *taken, size_t size); |
150 | 159 | #define heap32_some(heap, size, pspace) (heap32_ensure_head(heap), _heap32_some(heap, size, pspace)) |
151 | 160 | #define heap64_some(heap, size, pspace) (heap64_ensure_head(heap), _heap64_some(heap, size, pspace)) |
152 | 161 | |
153 | UTILAPI void * heap8_more (heap8 *heap, void *taken, size_t written, size_t size); | |
154 | UTILAPI void * heap16_more (heap16 *heap, void *taken, size_t written, size_t size); | |
155 | UTILAPI void * heap32_more (heap32 *heap, void *taken, size_t written, size_t size); | |
156 | UTILAPI void * heap64_more (heap64 *heap, void *taken, size_t written, size_t size); | |
162 | UTILAPI void * heap8_more (heap8 *heap, void *taken, size_t written, size_t size, size_t *pspace); | |
163 | UTILAPI void * heap16_more (heap16 *heap, void *taken, size_t written, size_t size, size_t *pspace); | |
164 | UTILAPI void * heap32_more (heap32 *heap, void *taken, size_t written, size_t size, size_t *pspace); | |
165 | UTILAPI void * heap64_more (heap64 *heap, void *taken, size_t written, size_t size, size_t *pspace); | |
157 | 166 | |
158 | 167 | UTILAPI void heap8_done (heap8 *heap, void *taken, size_t written); |
159 | 168 | UTILAPI void heap16_done (heap16 *heap, void *taken, size_t written); |
2 | 2 | |
3 | 3 | // this is identical to stock iof suite, keep in sync |
4 | 4 | |
5 | static size_t heap8_writer (iof *O, iof_mode mode) | |
5 | size_t heap8_writer (iof *O, iof_mode mode) | |
6 | 6 | { |
7 | 7 | heap8 *heap; |
8 | 8 | size_t written; |
10 | 10 | switch (mode) |
11 | 11 | { |
12 | 12 | case IOFFLUSH: |
13 | written = (size_t)iof_size(O); | |
14 | heap8_done(heap, O->buf, written); | |
13 | heap8_buffer_done(heap, O); | |
15 | 14 | O->buf = _heap8_some(heap, 0, &O->space); |
16 | 15 | O->pos = O->buf; |
17 | 16 | O->end = O->buf + O->space; |
18 | 17 | break; |
19 | 18 | case IOFWRITE: |
20 | 19 | written = (size_t)iof_size(O); |
21 | O->space = written << 1; | |
22 | O->buf = heap8_more(heap, O->buf, written, O->space); | |
20 | O->buf = heap8_more(heap, O->buf, written, written << 1, &O->space); | |
23 | 21 | O->pos = O->buf + written; |
24 | 22 | O->end = O->buf + O->space; |
25 | return written; // eq (space - written) | |
23 | return O->space - written; | |
26 | 24 | case IOFCLOSE: |
27 | 25 | default: |
28 | 26 | break; |
30 | 28 | return 0; |
31 | 29 | } |
32 | 30 | |
33 | static size_t heap16_writer (iof *O, iof_mode mode) | |
31 | size_t heap16_writer (iof *O, iof_mode mode) | |
34 | 32 | { |
35 | 33 | heap16 *heap; |
36 | 34 | size_t written; |
38 | 36 | switch (mode) |
39 | 37 | { |
40 | 38 | case IOFFLUSH: |
41 | written = (size_t)iof_size(O); | |
42 | heap16_done(heap, O->buf, written); | |
39 | heap16_buffer_done(heap, O); | |
43 | 40 | O->buf = _heap16_some(heap, 0, &O->space); |
44 | 41 | O->pos = O->buf; |
45 | 42 | O->end = O->buf + O->space; |
46 | 43 | break; |
47 | 44 | case IOFWRITE: |
48 | 45 | written = (size_t)iof_size(O); |
49 | O->space = written << 1; | |
50 | O->buf = heap16_more(heap, O->buf, written, O->space); | |
46 | O->buf = heap16_more(heap, O->buf, written, written << 1, &O->space); | |
51 | 47 | O->pos = O->buf + written; |
52 | 48 | O->end = O->buf + O->space; |
53 | return written; // eq (space - written) | |
49 | return O->space - written; | |
54 | 50 | case IOFCLOSE: |
55 | 51 | default: |
56 | 52 | break; |
58 | 54 | return 0; |
59 | 55 | } |
60 | 56 | |
61 | static size_t heap32_writer (iof *O, iof_mode mode) | |
57 | size_t heap32_writer (iof *O, iof_mode mode) | |
62 | 58 | { |
63 | 59 | heap32 *heap; |
64 | 60 | size_t written; |
66 | 62 | switch (mode) |
67 | 63 | { |
68 | 64 | case IOFFLUSH: |
69 | written = (size_t)iof_size(O); | |
70 | heap32_done(heap, O->buf, written); | |
65 | heap32_buffer_done(heap, O); | |
71 | 66 | O->buf = _heap32_some(heap, 0, &O->space); |
72 | 67 | O->pos = O->buf; |
73 | 68 | O->end = O->buf + O->space; |
74 | 69 | break; |
75 | 70 | case IOFWRITE: |
76 | 71 | written = (size_t)iof_size(O); |
77 | O->space = written << 1; | |
78 | O->buf = heap32_more(heap, O->buf, written, O->space); | |
72 | O->buf = heap32_more(heap, O->buf, written, written << 1, &O->space); | |
79 | 73 | O->pos = O->buf + written; |
80 | 74 | O->end = O->buf + O->space; |
81 | return written; // eq (space - written) | |
75 | return O->space - written; | |
82 | 76 | case IOFCLOSE: |
83 | 77 | default: |
84 | 78 | break; |
86 | 80 | return 0; |
87 | 81 | } |
88 | 82 | |
89 | static size_t heap64_writer (iof *O, iof_mode mode) | |
83 | size_t heap64_writer (iof *O, iof_mode mode) | |
90 | 84 | { |
91 | 85 | heap64 *heap; |
92 | 86 | size_t written; |
94 | 88 | switch (mode) |
95 | 89 | { |
96 | 90 | case IOFFLUSH: |
97 | written = (size_t)iof_size(O); | |
98 | heap64_done(heap, O->buf, written); | |
91 | heap64_buffer_done(heap, O); | |
99 | 92 | O->buf = _heap64_some(heap, 0, &O->space); |
100 | 93 | O->pos = O->buf; |
101 | 94 | O->end = O->buf + O->space; |
102 | 95 | break; |
103 | 96 | case IOFWRITE: |
104 | 97 | written = (size_t)iof_size(O); |
105 | O->space = written << 1; | |
106 | O->buf = heap64_more(heap, O->buf, written, O->space); | |
98 | O->buf = heap64_more(heap, O->buf, written, written << 1, &O->space); | |
107 | 99 | O->pos = O->buf + written; |
108 | 100 | O->end = O->buf + O->space; |
109 | return written; // eq (space - written) | |
101 | return O->space - written; | |
110 | 102 | case IOFCLOSE: |
111 | 103 | default: |
112 | 104 | break; |
114 | 106 | return 0; |
115 | 107 | } |
116 | 108 | |
117 | /* buffer init (made once) */ | |
118 | ||
119 | iof * heap8_buffer_init (heap8 *heap, iof *O) | |
120 | { | |
121 | void *data; | |
122 | size_t space; | |
123 | data = heap8_some(heap, 0, &space); | |
124 | if (iof_writer(O, (void *)heap, heap8_writer, data, space) == NULL) // sanity | |
125 | return NULL; | |
126 | return O; | |
127 | } | |
128 | ||
129 | iof * heap16_buffer_init (heap16 *heap, iof *O) | |
130 | { | |
131 | void *data; | |
132 | size_t space; | |
133 | data = heap16_some(heap, 0, &space); | |
134 | if (iof_writer(O, (void *)heap, heap16_writer, data, space) == NULL) | |
135 | return NULL; | |
136 | return O; | |
137 | } | |
138 | ||
139 | iof * heap32_buffer_init (heap32 *heap, iof *O) | |
140 | { | |
141 | void *data; | |
142 | size_t space; | |
143 | data = heap32_some(heap, 0, &space); | |
144 | if (iof_writer(O, (void *)heap, heap32_writer, data, space) == NULL) | |
145 | return NULL; | |
146 | return O; | |
147 | } | |
148 | ||
149 | iof * heap64_buffer_init (heap64 *heap, iof *O) | |
150 | { | |
151 | void *data; | |
152 | size_t space; | |
153 | data = heap64_some(heap, 0, &space); | |
154 | if (iof_writer(O, (void *)heap, heap64_writer, data, space) == NULL) | |
155 | return NULL; | |
156 | return O; | |
157 | } | |
158 | ||
159 | 109 | /* buffer for some */ |
160 | 110 | |
161 | iof * heap8_buffer_some (heap8 *heap, iof *O, size_t atleast) | |
111 | iof * _heap8_buffer_some (heap8 *heap, iof *O, size_t atleast) | |
162 | 112 | { |
163 | 113 | O->buf = _heap8_some(heap, atleast, &O->space); |
164 | 114 | O->pos = O->buf; |
166 | 116 | return O; |
167 | 117 | } |
168 | 118 | |
169 | iof * heap16_buffer_some (heap16 *heap, iof *O, size_t atleast) | |
119 | iof * _heap16_buffer_some (heap16 *heap, iof *O, size_t atleast) | |
170 | 120 | { |
171 | 121 | O->buf = _heap16_some(heap, atleast, &O->space); |
172 | 122 | O->pos = O->buf; |
174 | 124 | return O; |
175 | 125 | } |
176 | 126 | |
177 | iof * heap32_buffer_some (heap32 *heap, iof *O, size_t atleast) | |
127 | iof * _heap32_buffer_some (heap32 *heap, iof *O, size_t atleast) | |
178 | 128 | { |
179 | 129 | O->buf = _heap32_some(heap, atleast, &O->space); |
180 | 130 | O->pos = O->buf; |
182 | 132 | return O; |
183 | 133 | } |
184 | 134 | |
185 | iof * heap64_buffer_some (heap64 *heap, iof *O, size_t atleast) | |
135 | iof * _heap64_buffer_some (heap64 *heap, iof *O, size_t atleast) | |
186 | 136 | { |
187 | 137 | O->buf = _heap64_some(heap, atleast, &O->space); |
188 | 138 | O->pos = O->buf; |
4 | 4 | #include "utilmemheap.h" |
5 | 5 | #include "utiliof.h" |
6 | 6 | |
7 | UTILAPI iof * heap8_buffer_init (heap8 *heap, iof *O); | |
8 | UTILAPI iof * heap16_buffer_init (heap16 *heap, iof *O); | |
9 | UTILAPI iof * heap32_buffer_init (heap32 *heap, iof *O); | |
10 | UTILAPI iof * heap64_buffer_init (heap64 *heap, iof *O); | |
7 | UTILAPI size_t heap8_writer (iof *O, iof_mode mode); | |
8 | UTILAPI size_t heap16_writer (iof *O, iof_mode mode); | |
9 | UTILAPI size_t heap32_writer (iof *O, iof_mode mode); | |
10 | UTILAPI size_t heap64_writer (iof *O, iof_mode mode); | |
11 | 11 | |
12 | UTILAPI iof * heap8_buffer_some (heap8 *heap, iof *O, size_t atleast); | |
13 | UTILAPI iof * heap16_buffer_some (heap16 *heap, iof *O, size_t atleast); | |
14 | UTILAPI iof * heap32_buffer_some (heap32 *heap, iof *O, size_t atleast); | |
15 | UTILAPI iof * heap64_buffer_some (heap64 *heap, iof *O, size_t atleast); | |
12 | #define HEAP8_BUFFER_INIT(heap) IOF_WRITER_INIT(heap8_writer, (void *)(heap), NULL, 0, 0) | |
13 | #define HEAP16_BUFFER_INIT(heap) IOF_WRITER_INIT(heap16_writer, (void *)(heap), NULL, 0, 0) | |
14 | #define HEAP32_BUFFER_INIT(heap) IOF_WRITER_INIT(heap32_writer, (void *)(heap), NULL, 0, 0) | |
15 | #define HEAP64_BUFFER_INIT(heap) IOF_WRITER_INIT(heap64_writer, (void *)(heap), NULL, 0, 0) | |
16 | ||
17 | #define heap8_buffer_init(heap, O) iof_writer(O, (void *)(heap), heap8_writer, NULL, 0) | |
18 | #define heap16_buffer_init(heap, O) iof_writer(O, (void *)(heap), heap16_writer, NULL, 0) | |
19 | #define heap32_buffer_init(heap, O) iof_writer(O, (void *)(heap), heap32_writer, NULL, 0) | |
20 | #define heap64_buffer_init(heap, O) iof_writer(O, (void *)(heap), heap64_writer, NULL, 0) | |
21 | ||
22 | UTILAPI iof * _heap8_buffer_some (heap8 *heap, iof *O, size_t atleast); | |
23 | UTILAPI iof * _heap16_buffer_some (heap16 *heap, iof *O, size_t atleast); | |
24 | UTILAPI iof * _heap32_buffer_some (heap32 *heap, iof *O, size_t atleast); | |
25 | UTILAPI iof * _heap64_buffer_some (heap64 *heap, iof *O, size_t atleast); | |
26 | ||
27 | #define heap8_buffer_some(heap, O, atleast) (heap8_ensure_head(heap), _heap8_buffer_some(heap, O, atleast)) | |
28 | #define heap16_buffer_some(heap, O, atleast) (heap16_ensure_head(heap), _heap16_buffer_some(heap, O, atleast)) | |
29 | #define heap32_buffer_some(heap, O, atleast) (heap32_ensure_head(heap), _heap32_buffer_some(heap, O, atleast)) | |
30 | #define heap64_buffer_some(heap, O, atleast) (heap64_ensure_head(heap), _heap64_buffer_some(heap, O, atleast)) | |
31 | ||
32 | #define heap8_buffer_done(heap, O) heap8_done(heap, (O)->buf, (size_t)iof_size(O)) | |
33 | #define heap16_buffer_done(heap, O) heap16_done(heap, (O)->buf, (size_t)iof_size(O)) | |
34 | #define heap32_buffer_done(heap, O) heap32_done(heap, (O)->buf, (size_t)iof_size(O)) | |
35 | #define heap64_buffer_done(heap, O) heap64_done(heap, (O)->buf, (size_t)iof_size(O)) | |
36 | ||
37 | #define heap8_buffer_giveup(heap, O) heap8_giveup(heap, (O)->buf) | |
38 | #define heap16_buffer_giveup(heap, O) heap16_giveup(heap, (O)->buf) | |
39 | #define heap32_buffer_giveup(heap, O) heap32_giveup(heap, (O)->buf) | |
40 | #define heap64_buffer_giveup(heap, O) heap64_giveup(heap, (O)->buf) | |
16 | 41 | |
17 | 42 | #endif⏎ |
0 | 2020-02-18 Luigi Scarso <luigi.scarso@gmail.com> | |
1 | * better mp_snprintf macro | |
2 | ||
3 | ||
0 | 4 | 2019-03-06 Luigi Scarso <luigi.scarso@gmail.com> |
1 | 5 | * Code clean-up. |
2 | ||
3 | 6 | |
4 | 7 | 2019-02-06: Taco Hoekwater <taco@elvenkind.com> |
5 | 8 | * New primitive void: convert a suffix to a boolean. Work in progress. |
2959 | 2959 | } |
2960 | 2960 | |
2961 | 2961 | @ @<Internal library declarations@>= |
2962 | /*int mp_snprintf_res ;*/ | |
2963 | /* Some compilers (i.e. gcc 8.2.0 ) complained with the old */ | |
2964 | /* #define mp_snprintf (void)snprintf */ | |
2965 | /* about truncation. For the moment we store the result. */ | |
2966 | /*# define mp_snprintf mp_snprintf_res=snprintf */ | |
2967 | /* Now gcc 10 does't like common symbols, so we switch back */ | |
2968 | /* to the old define. */ | |
2969 | #define mp_snprintf (void)snprintf | |
2970 | ||
2962 | /* Avoid warning on format truncation */ | |
2963 | #define mp_snprintf(...) (snprintf(__VA_ARGS__) < 0 ? abort() : (void)0) | |
2971 | 2964 | |
2972 | 2965 | @* Dynamic memory allocation. |
2973 | 2966 |
0 | 2020-03-11 Karl Berry <karl@tug.org> | |
1 | ||
2 | Import autosp-2020-03-11. | |
3 | * patch-01-binary-write: Remove, now upstream | |
4 | ||
0 | 5 | 2020-02-07 Akira Kakuto <kakuto@w32tex.org> |
1 | 6 | |
2 | 7 | Import autosp-2020-02-06. |
0 | diff -ur autosp-2020-02-06/autosp.c autosp-src/autosp.c | |
1 | --- autosp-2020-02-06/autosp.c Thu Feb 06 23:00:34 2020 | |
2 | +++ autosp-src/autosp.c Fri Feb 07 07:43:38 2020 | |
3 | @@ -221,7 +221,7 @@ | |
4 | } | |
5 | else | |
6 | { | |
7 | - outfile = fopen (outfilename, "w"); | |
8 | + outfile = fopen (outfilename, "wb"); | |
9 | if (outfile == NULL) | |
10 | { printf ("Can't open %s\n", outfilename); | |
11 | exit (EXIT_FAILURE); | |
12 | @@ -239,7 +239,7 @@ | |
13 | *logfilename_n = '\0'; | |
14 | append (logfilename, &logfilename_n, "alog", sizeof (logfilename)); | |
15 | if (debug) | |
16 | - { logfile = fopen (logfilename, "w"); | |
17 | + { logfile = fopen (logfilename, "wb"); | |
18 | if (logfile == NULL) | |
19 | { printf ("Can't open %s\n", logfilename); | |
20 | exit (EXIT_FAILURE); | |
21 | diff -ur autosp-2020-02-06/rebar.c autosp-src/rebar.c | |
22 | --- autosp-2020-02-06/rebar.c Thu Feb 06 16:22:35 2020 | |
23 | +++ autosp-src/rebar.c Fri Feb 07 07:44:13 2020 | |
24 | @@ -264,7 +264,7 @@ | |
25 | else | |
26 | append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); | |
27 | } | |
28 | - outfile = fopen (outfilename, "w"); | |
29 | + outfile = fopen (outfilename, "wb"); | |
30 | if (outfile == NULL) | |
31 | { fprintf (stderr,"Can't open %s\n", outfilename); | |
32 | exit (EXIT_FAILURE); | |
33 | diff -ur autosp-2020-02-06/spacing_note.c autosp-src/spacing_note.c | |
34 | --- autosp-2020-02-06/spacing_note.c Thu Feb 06 16:22:35 2020 | |
35 | +++ autosp-src/spacing_note.c Fri Feb 07 07:47:00 2020 | |
36 | @@ -30,7 +30,7 @@ | |
37 | update_global_skip (n); | |
38 | /* commas will be discarded by filter_output (i) */ | |
39 | if (*s == '.' && new_beaming == 0 && !dottedbeamnotes) | |
40 | - spacing = spacing * 1.50; | |
41 | + spacing = (int)(spacing * 1.50); | |
42 | else if ( (*s == '^' || *s == '_' || *s == '=' || *s == '>') | |
43 | && !vspacing_active[i] /* is additional spacing needed? */ | |
44 | ) | |
45 | @@ -532,7 +532,7 @@ | |
46 | || prefix ("\\qbpp", s) | |
47 | || prefix ("\\dspp", s) | |
48 | || doubledotted ) | |
49 | - { spacing *= 1.75; doubledotted = false;} | |
50 | + { spacing = (int)(spacing * 1.75); doubledotted = false;} | |
51 | else | |
52 | if (prefix ("\\whp", s) | |
53 | || prefix ("\\hup", s) | |
54 | @@ -556,7 +556,7 @@ | |
55 | || prefix ("\\qbp", s) | |
56 | || prefix ("\\dsp", s) | |
57 | || dotted ) | |
58 | - { spacing *= 1.5; dotted = false; } | |
59 | + { spacing = (int)(spacing * 1.5); dotted = false; } | |
60 | ||
61 | t = strpbrk (s+1, "{\\&|$"); /* collective coding? */ | |
62 | if (*t == '{') /* {...} */ | |
63 | diff -ur autosp-2020-02-06/tex2aspc.c autosp-src/tex2aspc.c | |
64 | --- autosp-2020-02-06/tex2aspc.c Thu Feb 06 16:22:35 2020 | |
65 | +++ autosp-src/tex2aspc.c Fri Feb 07 07:47:30 2020 | |
66 | @@ -342,7 +342,7 @@ | |
67 | append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); | |
68 | } | |
69 | ||
70 | - outfile = fopen (outfilename, "w"); | |
71 | + outfile = fopen (outfilename, "wb"); | |
72 | if (outfile == NULL) | |
73 | { printf ("Can't open %s\n", outfilename); | |
74 | exit (EXIT_FAILURE); |
0 | 0 | AUTOSP |
1 | ||
2 | 2020-02-09 | |
3 | ||
4 | correct \Cpause handling at \alaligne when \TransformNotes is used | |
1 | 5 | |
2 | 6 | 2019-12-22 |
3 | 7 |
0 | 0 | This is the README for the autosp package, |
1 | version 2019-12-22. | |
1 | version 2020-02-06. | |
2 | 2 | |
3 | 3 | autosp is a preprocessor that generates note-spacing |
4 | 4 | commands for MusiXTeX scores. It simplifies the creation |
0 | char version[12] = "2020-02-06"; | |
0 | char version[12] = "2020-03-11"; | |
1 | 1 | |
2 | 2 | /* Copyright (C) 2014-20 R. D. Tennent School of Computing, |
3 | 3 | * Queen's University, rdt@cs.queensu.ca |
220 | 220 | } |
221 | 221 | else |
222 | 222 | { |
223 | outfile = fopen (outfilename, "wb"); | |
223 | outfile = fopen (outfilename, "w"); | |
224 | 224 | if (outfile == NULL) |
225 | 225 | { printf ("Can't open %s\n", outfilename); |
226 | 226 | exit (EXIT_FAILURE); |
238 | 238 | *logfilename_n = '\0'; |
239 | 239 | append (logfilename, &logfilename_n, "alog", sizeof (logfilename)); |
240 | 240 | if (debug) |
241 | { logfile = fopen (logfilename, "wb"); | |
241 | { logfile = fopen (logfilename, "w"); | |
242 | 242 | if (logfile == NULL) |
243 | 243 | { printf ("Can't open %s\n", logfilename); |
244 | 244 | exit (EXIT_FAILURE); |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for autosp 2020-02-06. | |
2 | # Generated by GNU Autoconf 2.69 for autosp 2020-03-11. | |
3 | 3 | # |
4 | 4 | # Report bugs to <rdt@cs.queensu.ca>. |
5 | 5 | # |
579 | 579 | # Identity of this package. |
580 | 580 | PACKAGE_NAME='autosp' |
581 | 581 | PACKAGE_TARNAME='autosp' |
582 | PACKAGE_VERSION='2020-02-06' | |
583 | PACKAGE_STRING='autosp 2020-02-06' | |
582 | PACKAGE_VERSION='2020-03-11' | |
583 | PACKAGE_STRING='autosp 2020-03-11' | |
584 | 584 | PACKAGE_BUGREPORT='rdt@cs.queensu.ca' |
585 | 585 | PACKAGE_URL='' |
586 | 586 | |
1264 | 1264 | # Omit some internal or obsolete options to make the list less imposing. |
1265 | 1265 | # This message is too long to be a string in the A/UX 3.1 sh. |
1266 | 1266 | cat <<_ACEOF |
1267 | \`configure' configures autosp 2020-02-06 to adapt to many kinds of systems. | |
1267 | \`configure' configures autosp 2020-03-11 to adapt to many kinds of systems. | |
1268 | 1268 | |
1269 | 1269 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1270 | 1270 | |
1330 | 1330 | |
1331 | 1331 | if test -n "$ac_init_help"; then |
1332 | 1332 | case $ac_init_help in |
1333 | short | recursive ) echo "Configuration of autosp 2020-02-06:";; | |
1333 | short | recursive ) echo "Configuration of autosp 2020-03-11:";; | |
1334 | 1334 | esac |
1335 | 1335 | cat <<\_ACEOF |
1336 | 1336 | |
1421 | 1421 | test -n "$ac_init_help" && exit $ac_status |
1422 | 1422 | if $ac_init_version; then |
1423 | 1423 | cat <<\_ACEOF |
1424 | autosp configure 2020-02-06 | |
1424 | autosp configure 2020-03-11 | |
1425 | 1425 | generated by GNU Autoconf 2.69 |
1426 | 1426 | |
1427 | 1427 | Copyright (C) 2012 Free Software Foundation, Inc. |
1844 | 1844 | This file contains any messages produced by compilers while |
1845 | 1845 | running configure, to aid debugging if configure makes a mistake. |
1846 | 1846 | |
1847 | It was created by autosp $as_me 2020-02-06, which was | |
1847 | It was created by autosp $as_me 2020-03-11, which was | |
1848 | 1848 | generated by GNU Autoconf 2.69. Invocation command line was |
1849 | 1849 | |
1850 | 1850 | $ $0 $@ |
2707 | 2707 | |
2708 | 2708 | # Define the identity of the package. |
2709 | 2709 | PACKAGE='autosp' |
2710 | VERSION='2020-02-06' | |
2710 | VERSION='2020-03-11' | |
2711 | 2711 | |
2712 | 2712 | |
2713 | 2713 | cat >>confdefs.h <<_ACEOF |
4973 | 4973 | # report actual input values of CONFIG_FILES etc. instead of their |
4974 | 4974 | # values after options handling. |
4975 | 4975 | ac_log=" |
4976 | This file was extended by autosp $as_me 2020-02-06, which was | |
4976 | This file was extended by autosp $as_me 2020-03-11, which was | |
4977 | 4977 | generated by GNU Autoconf 2.69. Invocation command line was |
4978 | 4978 | |
4979 | 4979 | CONFIG_FILES = $CONFIG_FILES |
5039 | 5039 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
5040 | 5040 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
5041 | 5041 | ac_cs_version="\\ |
5042 | autosp config.status 2020-02-06 | |
5042 | autosp config.status 2020-03-11 | |
5043 | 5043 | configured by $0, generated by GNU Autoconf 2.69, |
5044 | 5044 | with options \\"\$ac_cs_config\\" |
5045 | 5045 |
0 | 0 | AC_PREREQ(2.63) |
1 | AC_INIT([autosp],[2020-02-06],[rdt@cs.queensu.ca]) | |
1 | AC_INIT([autosp],[2020-03-11],[rdt@cs.queensu.ca]) | |
2 | 2 | AC_CONFIG_AUX_DIR([.]) |
3 | 3 | AM_INIT_AUTOMAKE |
4 | 4 | AC_CONFIG_HEADERS([config.h]) |
1008 | 1008 | else if (atnextbar) |
1009 | 1009 | { |
1010 | 1010 | fprintf (outfile, "\\def\\atnextbar{\\znotes"); |
1011 | for (i=1; i <= nstaffs; i++) | |
1011 | t = TransformNotes2; | |
1012 | while (true) | |
1012 | 1013 | { |
1014 | s = strchr (t, '#'); | |
1015 | if (s == NULL) | |
1016 | break; | |
1017 | while (t < s) /* output any initial \transpose etc. */ | |
1018 | { putc (*t, outfile); t++; } | |
1019 | t++; /* skip # */ | |
1020 | i = atoi (t) -1; t++; | |
1013 | 1021 | if (active[i]) |
1014 | 1022 | { |
1015 | 1023 | if (bar_rest[i]) |
1016 | 1024 | fprintf (outfile, "\\centerpause"); |
1017 | 1025 | bar_rest[i] = false; |
1018 | 1026 | } |
1019 | if ( terminator[i] != '$') putc (terminator[i], outfile); | |
1027 | if (*t != '\0') | |
1028 | { putc (*t, outfile); t++; } /* terminator */ | |
1020 | 1029 | } |
1021 | 1030 | fprintf (outfile, "\\en}%%\n"); |
1022 | 1031 | if (Changeclefs) /* \Changeclefs has to be output after \def\atnextbar... */ |
263 | 263 | else |
264 | 264 | append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); |
265 | 265 | } |
266 | outfile = fopen (outfilename, "wb"); | |
266 | outfile = fopen (outfilename, "w"); | |
267 | 267 | if (outfile == NULL) |
268 | 268 | { fprintf (stderr,"Can't open %s\n", outfilename); |
269 | 269 | exit (EXIT_FAILURE); |
29 | 29 | update_global_skip (n); |
30 | 30 | /* commas will be discarded by filter_output (i) */ |
31 | 31 | if (*s == '.' && new_beaming == 0 && !dottedbeamnotes) |
32 | spacing = (int)(spacing * 1.50); | |
32 | spacing = spacing * 1.50; | |
33 | 33 | else if ( (*s == '^' || *s == '_' || *s == '=' || *s == '>') |
34 | 34 | && !vspacing_active[i] /* is additional spacing needed? */ |
35 | 35 | ) |
531 | 531 | || prefix ("\\qbpp", s) |
532 | 532 | || prefix ("\\dspp", s) |
533 | 533 | || doubledotted ) |
534 | { spacing = (int)(spacing * 1.75); doubledotted = false;} | |
534 | { spacing *= 1.75; doubledotted = false;} | |
535 | 535 | else |
536 | 536 | if (prefix ("\\whp", s) |
537 | 537 | || prefix ("\\hup", s) |
555 | 555 | || prefix ("\\qbp", s) |
556 | 556 | || prefix ("\\dsp", s) |
557 | 557 | || dotted ) |
558 | { spacing = (int)(spacing * 1.5); dotted = false; } | |
558 | { spacing *= 1.5; dotted = false; } | |
559 | 559 | |
560 | 560 | t = strpbrk (s+1, "{\\&|$"); /* collective coding? */ |
561 | 561 | if (*t == '{') /* {...} */ |
0 | % Generated by autosp (2020-02-06). | |
0 | % Generated by autosp (2020-03-11). | |
1 | 1 | \input musixtex |
2 | 2 | \input musixplt |
3 | 3 | \input soul.sty |
341 | 341 | append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); |
342 | 342 | } |
343 | 343 | |
344 | outfile = fopen (outfilename, "wb"); | |
344 | outfile = fopen (outfilename, "w"); | |
345 | 345 | if (outfile == NULL) |
346 | 346 | { printf ("Can't open %s\n", outfilename); |
347 | 347 | exit (EXIT_FAILURE); |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for autosp (TeX Live) 2020-02-06. | |
2 | # Generated by GNU Autoconf 2.69 for autosp (TeX Live) 2020-03-11. | |
3 | 3 | # |
4 | 4 | # Report bugs to <tex-k@tug.org>. |
5 | 5 | # |
579 | 579 | # Identity of this package. |
580 | 580 | PACKAGE_NAME='autosp (TeX Live)' |
581 | 581 | PACKAGE_TARNAME='autosp--tex-live-' |
582 | PACKAGE_VERSION='2020-02-06' | |
583 | PACKAGE_STRING='autosp (TeX Live) 2020-02-06' | |
582 | PACKAGE_VERSION='2020-03-11' | |
583 | PACKAGE_STRING='autosp (TeX Live) 2020-03-11' | |
584 | 584 | PACKAGE_BUGREPORT='tex-k@tug.org' |
585 | 585 | PACKAGE_URL='' |
586 | 586 | |
1277 | 1277 | # Omit some internal or obsolete options to make the list less imposing. |
1278 | 1278 | # This message is too long to be a string in the A/UX 3.1 sh. |
1279 | 1279 | cat <<_ACEOF |
1280 | \`configure' configures autosp (TeX Live) 2020-02-06 to adapt to many kinds of systems. | |
1280 | \`configure' configures autosp (TeX Live) 2020-03-11 to adapt to many kinds of systems. | |
1281 | 1281 | |
1282 | 1282 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1283 | 1283 | |
1344 | 1344 | |
1345 | 1345 | if test -n "$ac_init_help"; then |
1346 | 1346 | case $ac_init_help in |
1347 | short | recursive ) echo "Configuration of autosp (TeX Live) 2020-02-06:";; | |
1347 | short | recursive ) echo "Configuration of autosp (TeX Live) 2020-03-11:";; | |
1348 | 1348 | esac |
1349 | 1349 | cat <<\_ACEOF |
1350 | 1350 | |
1441 | 1441 | test -n "$ac_init_help" && exit $ac_status |
1442 | 1442 | if $ac_init_version; then |
1443 | 1443 | cat <<\_ACEOF |
1444 | autosp (TeX Live) configure 2020-02-06 | |
1444 | autosp (TeX Live) configure 2020-03-11 | |
1445 | 1445 | generated by GNU Autoconf 2.69 |
1446 | 1446 | |
1447 | 1447 | Copyright (C) 2012 Free Software Foundation, Inc. |
1864 | 1864 | This file contains any messages produced by compilers while |
1865 | 1865 | running configure, to aid debugging if configure makes a mistake. |
1866 | 1866 | |
1867 | It was created by autosp (TeX Live) $as_me 2020-02-06, which was | |
1867 | It was created by autosp (TeX Live) $as_me 2020-03-11, which was | |
1868 | 1868 | generated by GNU Autoconf 2.69. Invocation command line was |
1869 | 1869 | |
1870 | 1870 | $ $0 $@ |
3788 | 3788 | |
3789 | 3789 | # Define the identity of the package. |
3790 | 3790 | PACKAGE='autosp--tex-live-' |
3791 | VERSION='2020-02-06' | |
3791 | VERSION='2020-03-11' | |
3792 | 3792 | |
3793 | 3793 | |
3794 | 3794 | cat >>confdefs.h <<_ACEOF |
5972 | 5972 | # report actual input values of CONFIG_FILES etc. instead of their |
5973 | 5973 | # values after options handling. |
5974 | 5974 | ac_log=" |
5975 | This file was extended by autosp (TeX Live) $as_me 2020-02-06, which was | |
5975 | This file was extended by autosp (TeX Live) $as_me 2020-03-11, which was | |
5976 | 5976 | generated by GNU Autoconf 2.69. Invocation command line was |
5977 | 5977 | |
5978 | 5978 | CONFIG_FILES = $CONFIG_FILES |
6029 | 6029 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
6030 | 6030 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
6031 | 6031 | ac_cs_version="\\ |
6032 | autosp (TeX Live) config.status 2020-02-06 | |
6032 | autosp (TeX Live) config.status 2020-03-11 | |
6033 | 6033 | configured by $0, generated by GNU Autoconf 2.69, |
6034 | 6034 | with options \\"\$ac_cs_config\\" |
6035 | 6035 |
0 | 0 | dnl $Id$ |
1 | 1 | dnl Process this file with autoconf to produce a configure script. |
2 | 2 | dnl |
3 | dnl Copyright 2016-2018 Karl Berry <tex-live@tug.org> | |
3 | dnl Copyright 2016-2020 Karl Berry <tex-live@tug.org> | |
4 | 4 | dnl |
5 | 5 | dnl This file is free software; the copyright holder |
6 | 6 | dnl gives unlimited permission to copy and/or distribute it, |
7 | 7 | dnl with or without modifications, as long as this notice is preserved. |
8 | 8 | dnl |
9 | m4_define([autosp_version], [2020-02-06])[]dnl using unmodified autosp source | |
9 | m4_define([autosp_version], [2020-03-11])[]dnl using unmodified autosp source | |
10 | 10 | AC_INIT([autosp (TeX Live)], autosp_version, [tex-k@tug.org]) |
11 | 11 | AC_PREREQ([2.65]) |
12 | 12 | AC_CONFIG_SRCDIR([autosp-src/autosp.c]) |
3336 | 3336 | : ;; #( |
3337 | 3337 | *) : |
3338 | 3338 | case $host in #( |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3339 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3340 | 3340 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajittex'" >&5 |
3341 | 3341 | $as_echo "$as_me: $host -> \`--disable-luajittex'" >&6;} |
3342 | 3342 | ac_configure_args="$ac_configure_args '--disable-luajittex'" ;; #( |
3349 | 3349 | : ;; #( |
3350 | 3350 | *) : |
3351 | 3351 | case $host in #( |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3352 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3353 | 3353 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-luajithbtex'" >&5 |
3354 | 3354 | $as_echo "$as_me: $host -> \`--disable-luajithbtex'" >&6;} |
3355 | 3355 | ac_configure_args="$ac_configure_args '--disable-luajithbtex'" ;; #( |
3362 | 3362 | : ;; #( |
3363 | 3363 | *) : |
3364 | 3364 | case $host in #( |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3365 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3366 | 3366 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit'" >&5 |
3367 | 3367 | $as_echo "$as_me: $host -> \`--disable-mfluajit'" >&6;} |
3368 | 3368 | ac_configure_args="$ac_configure_args '--disable-mfluajit'" ;; #( |
3375 | 3375 | : ;; #( |
3376 | 3376 | *) : |
3377 | 3377 | case $host in #( |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-*-darwin* ) : | |
3378 | alpha* | sparc* | x86_64-*-solaris* | powerpc-* ) : | |
3379 | 3379 | { $as_echo "$as_me:${as_lineno-$LINENO}: $host -> \`--disable-mfluajit-nowin'" >&5 |
3380 | 3380 | $as_echo "$as_me: $host -> \`--disable-mfluajit-nowin'" >&6;} |
3381 | 3381 | ac_configure_args="$ac_configure_args '--disable-mfluajit-nowin'" ;; #( |